// externalCountrylist needs a call made to a servlet holding the dynamically generated countries !!
//var externalCountrylist = 
var lebara = {
	vars: {
			selectors:{
				textBoxWithValue: '.text[value]',
				checkoutAddressTrigger: '.form .showAddress',
				checkoutAddressFields: '.form fieldset.address',
				postCodeLookUpTrigger: '.form .postCodeLookUpTrigger',
				postCodeLookUpFields: '.postCodeLookUp',
				postCodeAddressFieldset :'.address-populated',
				postCodeField: '.postcode .text',
				priceChoice : '#priceChoice',
				countryChoice : '#countryChoice',
				priceCountryGo : '#priceCountryGo',
				predictiveDropDown : '.predictiveDropDown',
				deactivate : '.deactivate',
				tableHighlight : '.tableHighlight',
				activate : '.activate',
				activateSwitch : '.activateSwitch',
				radioSlider : '.radioSlider input',
				popup : '.popup',
				helpLink : '.helpLink',
				personalInformationForm :'#personalInformation',
					activationForm :'#activation',
				securityCodeForm :'#securityCode',
				changePasswordForm :'#changePassword',
				postCodeLookUpForm :'#postCodeLookUp',
				loginForm :"#login",
				loginTrigger :"a.loginTrigger",
				removeLink: 'a.remove',
				basket: '.basket',
				prePayNumberTrigger: '.basket input#upgrade',
				prePayNumberTarget: '.upgradeNumber',
				emptyBasket: '.emptyBasket',
				content: '#content',
				toolTip: ".toolTip",
				commonQuestions: ".commonQuestions a",
				showHowToFindMyNumber: ".showHowToFindMyNumber",
				languageSelector: ".changeLang",
				tariffPanel: ".tariffPrePayInternational",
				simSelectionPanel: '.simSelectionPanel',
				simSelectionPanelInput: '.simSelectionPanel input',
				simSelectionPanelLabel: '.simSelectionPanel label',
				simInfoDiv: '.sim-info div.split5',
				addToBasketTrigger:'.primaryButton-add',
				planSummaryAdd: 'a#planSummaryAdd',
				categories: '.categories',
				overlayScroller: '.overlay .scrolling',
				categoryLastRowFix: 'div.lastRow:first a'
					},
				
				paths:{
					validImage : '../assets/images/icons/iconMatched.gif',
					postCodeLookUpJson : '/GDHTML/postcode.json',
					languageSelectorJson : '/GDHTML/languageSelector.json'
					

				},
			regex: {
					alpha: /^[a-z]*$/i
					
				
				},
				
					strings:{
					en:{
						checkoutAddressTriggerText1:	"Enter Manually",
						checkoutAddressTriggerText2: "Enter Automatically",
						
						helpCategoryTriggerText1: "Maximise categories",
						helpCategoryTriggerText2: "Minimise categories"
						
						},
				validation: {
							personalInformation: {
								title:{
								
								},
								fName:{
									Required: {
										ValidationMessage: "This is a required field"
									},
									Format: {
										ValidationMessage: "Please enter a valid format",
										Regex: /^[a-z]*$/i							},
									
									MaxLength: {
										ValidationMessage: "You have exceeded the maximum length",
										Length:"32"
									}
									
								},
								email:{
									Required: {
										ValidationMessage: "This is a required field"
									},
									
									Format: {
										ValidationMessage: "Please enter a valid format",
										Regex: /^([a-zA-Z0-9\._\-]+)@([a-zA-Z0-9_\-]+)[\.][a-zA-Z][a-zA-Z]+([a-zA-Z0-9\\.]*[a-zA-Z])+$/	
										},
											MaxLength: {
												ValidationMessage: "You have exceeded the maximum length",
												Length:"100"
											}
								},
								confirmEmail:{
									Required: {
										ValidationMessage: "This is a required field"
									},
									
									Format: {
										ValidationMessage: "Please enter a valid format",
										Regex: /^([a-zA-Z0-9\._\-]+)@([a-zA-Z0-9_\-]+)[\.][a-zA-Z][a-zA-Z]+([a-zA-Z0-9\\.]*[a-zA-Z])+$/	
										},
											MaxLength: {
												ValidationMessage: "You have exceeded the maximum length",
												Length:"100"
											},
											Comparison:{
												ValidationMessage: "ValidationComparisonMessagePlaceholder",
												FieldToCompare : "email"
												
											}
								},
								lName:{
									Required: {
										ValidationMessage: "This is a required field"
									},
									Format: {
										ValidationMessage: "Please enter a valid format",
										Regex: /^[a-z]*$/i				},
										MaxLength: {
											ValidationMessage: "You have exceeded the maximum length",
											Length:"60"
										}
								},
										mobileNumber:{
												Required: {
													ValidationMessage: "This is a required field"
												},
												Format:{
															ValidationMessage: "Please enter a valid format",
															Regex: /^[0-9]*$/

													}
										},
										dob:{
												Required: {
													ValidationMessage: "This is a required field"
												}
										},
										day:{
												Required: {
													ValidationMessage: "This is a required field"
												}
										},
										month:{
												Required: {
													ValidationMessage: "This is a required field"
												}
										},
										year:{
												Required: {
													ValidationMessage: "This is a required field"
												}
										},
										adLine1: {
												Required: {
													ValidationMessage: "This is a required field"
												},
												MaxLength:{
														ValidationMessage: "You have exceeded the maximum length",
														Length:"100"

												}
										},

											adLine2: {
													MaxLength:{
															ValidationMessage: "You have exceeded the maximum length",
															Length:"100"

													}
											},
												adLine3: {
													MaxLength:{
															ValidationMessage: "You have exceeded the maximum length",
															Length:"100"




														}
												},
													city: {
														Required: {
															ValidationMessage: "This is a required field"
														},
														MaxLength:{
																ValidationMessage: "You have exceeded the maximum length",
																Length:"28"




															}

													},
													county: {
															Required: {
																ValidationMessage: "This is a required field"
															}


													},
														county: {
																Required: {
																	ValidationMessage: "This is a required field"
																}


														},
														pCode:{
															Required: {
																ValidationMessage: "This is a required field"
															},
															Format: {
																ValidationMessage: "Please enter a valid format",
																Regex: /^(GIR0AA)|((([A-PR-UWYZ][0-9][0-9]?)|(([A-PR-UWYZ][A-HK-Z][0-9][0-9]?)|(([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Z][0-9][ABEHMNPRVWXY]))))[0-9][ABD-HJLNP-UW-Z]{2})$/
															}
														
														}, 
															confirmPassword:{
																	Required: {
																		ValidationMessage: "This is a required field"
																	},
																	MinLength:{
																		ValidationMessage: "This field has a minimum length",
																		Length: "8"
																	},
																	Format:{
																			ValidationMessage: "Please enter a valid format",
																			Regex: /^[a-z0-9]*$/i

																	},
																	Comparison:{
																			ValidationMessage: "ValidationComparisonMessagePlaceholder",
																			FieldToCompare : "password"

																		}
															},
																password:{
																		Required: {
																			ValidationMessage: "This is a required field"
																		},
																		MinLength:{
																			ValidationMessage: "This field has a minimum length",
																			Length: "8"
																		},
																		Format:{
																				ValidationMessage: "Please enter a valid format",
																				Regex: /^[a-z0-9]*$/i

																		}

																}
							
							},
							securityCode: {
								smsCode:{
										Required: {
											ValidationMessage: "This is a required field"
										},
											MaxLength:{
												ValidationMessage: "You have exceeded the maximum length",
												Length: "8"
											},
											Format:{
													ValidationMessage: "Please enter a valid format",
													Regex: /^[0-9]*$/

											}
											
									
								}
								
							},
							activation:{
								mobileNumber:{
										Required: {
											ValidationMessage: "This is a required field"
										},
											Format:{
														ValidationMessage: "Please enter a valid format",
														Regex: /^[0-9]*$/

												}
								}
							},
									login:{
										loginID:{
												Required: {
													ValidationMessage: "This is a required field"
												},
													Format: {
														ValidationMessage: "Please enter a valid format",
														Regex: /^([a-zA-Z0-9\._\-]+)@([a-zA-Z0-9_\-]+)[\.][a-zA-Z][a-zA-Z]+([a-zA-Z0-9\\.]*[a-zA-Z])+$/	
														}
											},
											password:{
													Required: {
														ValidationMessage: "This is a required field"

														}
												
										}
									},
							changePassword:{
								oldPassword:{
										Required: {
											ValidationMessage: "This is a required field"
										},
											MinLength:{
												ValidationMessage: "This field has a minimum length",
												Length: "8"
											},
											Format:{
													ValidationMessage: "Please enter a valid format",
													Regex: /^[a-z0-9]*$/i
													
											}
								},
									newPassword:{
											Required: {
												ValidationMessage: "This is a required field"
											},
											MinLength:{
												ValidationMessage: "This field has a minimum length",
												Length: "8"
											},
											Format:{
													ValidationMessage: "Please enter a valid format",
													Regex: /^[a-z0-9]*$/i
													
											}
											
									},
									confirmPassword:{
											Required: {
												ValidationMessage: "This is a required field"
											},
											MinLength:{
												ValidationMessage: "This field has a minimum length",
												Length: "8"
											},
											Format:{
													ValidationMessage: "Please enter a valid format",
													Regex: /^[a-z0-9]*$/i
													
											},
											Comparison:{
													ValidationMessage: "ValidationComparisonMessagePlaceholder",
													FieldToCompare : "newPassword"
												
												}
									}
							},
							postCodeLookUp:{
								adLine1: {
										Required: {
											ValidationMessage: "This is a required field"
										},
										MaxLength:{
												ValidationMessage: "You have exceeded the maximum length",
												Length:"100"
											
										}
								},
							
									adLine2: {
											MaxLength:{
													ValidationMessage: "You have exceeded the maximum length",
													Length:"100"

											}
									},
										adLine3: {
											MaxLength:{
													ValidationMessage: "You have exceeded the maximum length",
													Length:"100"

											
											

												}
										},
											city: {
												Required: {
													ValidationMessage: "This is a required field"
												},
												MaxLength:{
														ValidationMessage: "You have exceeded the maximum length",
														Length:"28"




													}
													
											},
											county: {
													Required: {
														ValidationMessage: "This is a required field"
													}
												
												
											},
												county: {
														Required: {
															ValidationMessage: "This is a required field"
														}


												},
												pCode:{
													Required: {
														ValidationMessage: "This is a required field"
													},
													Format: {
														ValidationMessage: "Please enter a valid format",
														Regex: /^(GIR0AA)|((([A-PR-UWYZ][0-9][0-9]?)|(([A-PR-UWYZ][A-HK-Z][0-9][0-9]?)|(([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Z][0-9][ABEHMNPRVWXY]))))[0-9][ABD-HJLNP-UW-Z]{2})$/
													}
												}
							}
							
							
					}
				},
			arrays:{
					predictiveDropDown: {
					
						countryList : [{"label": " Afghanistan", "value" :"Af"}, {"label":" Zimbabwe","value" :"Zi"}],
						continentList : [],
						countryCodeList : []
					}
			}
		
	},
	
	init: function(){		
		//$('BODY').addClass('withJs');
		lebara.shopRateRevealer();
	    
		if ($(lebara.vars.selectors.commonQuestions).length > 0) {lebara.modalIframe(lebara.vars.selectors.commonQuestions);}
			if ($(lebara.vars.selectors.loginTrigger).length > 0) {lebara.loginModal(lebara.vars.selectors.loginTrigger);}
		if ($(lebara.vars.selectors.categories + ' div').length > 2) {lebara.categoryToggle();}
		if ($(lebara.vars.selectors.categoryLastRowFix).length > 0) {lebara.categoryLastRowFix();}

		
		if ($(lebara.vars.selectors.simSelectionPanel).length > 0) {lebara.simSelectionPanel();}
		if ($(lebara.vars.selectors.showHowToFindMyNumber).length > 0) {lebara.showHowToFindMyNumber();}
			if ($(lebara.vars.selectors.dataPicker).length > 0) {lebara.dataPicker();}
		if ($(lebara.vars.selectors.textBoxWithValue).length > 0) {lebara.removeTextBoxValue();}
		if ($("#navigation").length > 0) {lebara.Navigation();}
				if ($(lebara.vars.selectors.checkoutAddressTrigger).length > 0) {lebara.showFields();}
		if ($(lebara.vars.selectors.helpLink).length > 0) {lebara.HelpTooltips();}
			if ($(lebara.vars.selectors.overlayScroller).length > 0) {lebara.customScrollBar();}
		
	
if ($(lebara.vars.selectors.personalInformationForm).length > 0) {	lebara.FormValidation(lebara.vars.selectors.personalInformationForm);}
if ($(lebara.vars.selectors.changePasswordForm).length > 0) {	lebara.FormValidation(lebara.vars.selectors.changePasswordForm);}
if ($(lebara.vars.selectors.securityCodeForm).length > 0) {	lebara.FormValidation(lebara.vars.selectors.securityCodeForm);}
if ($(lebara.vars.selectors.activationForm).length > 0) {	lebara.FormValidation(lebara.vars.selectors.activationForm);}
if ($(lebara.vars.selectors.loginForm).length > 0) {	lebara.FormValidation(lebara.vars.selectors.loginForm);}
if ($(lebara.vars.selectors.postCodeLookUpForm).length > 0) {	lebara.FormValidation(lebara.vars.selectors.postCodeLookUpForm);}
		if ($(lebara.vars.selectors.predictiveDropDown).length > 0) {lebara.predictiveDropDown();}
		if ($(lebara.vars.selectors.deactivate).length > 0) {lebara.deactivateSwitcher();}
		if ($(lebara.vars.selectors.tableHighlight).length > 0) {lebara.tableHighlight();}
		if ($(lebara.vars.selectors.radioSlider).length > 0) {lebara.radioSlider();}
		if ($(lebara.vars.selectors.popup).length > 0) {lebara.popup();}
		if($(lebara.vars.selectors.prePayNumberTrigger).length > 0){lebara.toggleFields($(lebara.vars.selectors.prePayNumberTrigger),$(lebara.vars.selectors.prePayNumberTarget));}
		if ($(lebara.vars.selectors.postCodeLookUpFields).length > 0) {
				$(lebara.vars.selectors.postCodeLookUpTrigger).bind("click", function(e){ if($("#pCodeFind").val()){lebara.postcodeGetJson(lebara.vars.paths.postCodeLookUpJson,lebara.parseData);} return false;});
		}
			if ($(lebara.vars.selectors.languageSelector).length > 0) {lebara.getJson(lebara.vars.paths.languageSelectorJson,lebara.loadLanguageSelector);}
			if ($("a.showRates").length > 0){lebara.showRates();}
				if ($(lebara.vars.selectors.planSummaryAdd).length > 0){lebara.addToBasket(lebara.vars.selectors.planSummaryAdd);}
					if ($(lebara.vars.selectors.addToBasketTrigger).length > 0){lebara.addToBasket(lebara.vars.selectors.addToBasketTrigger); }
		
	lebara.postPayPlans();
		

	},
	Navigation: function() {
		
	//	$("#navigation ul li ul").hide();

$("#navigation ul li:not(.first)").bind("mouseover", function(){
		$("#navigation ul").addClass("jsNav");
		$(this).addClass("hover");
		//console.log(this);
		//$("#navigation ul li").removeClass("active")
			$("#navigation ul li ul").hide();

		$(this).children("ul").show();
		
	});
		$("#navigation ul li:not(.first)").bind("mouseout", function(){
				$(this).removeClass("hover");
		});
	$("#navigation ul").bind("mouseout", function(){
			$("#navigation ul").removeClass("jsNav");
				$("#navigation ul li ul").hide();
			$("#navigation ul li.active ul").show();
	});
	},
toggleFields: function(trigger, target){
		//Generic Display - Do not Change
		show()

	trigger.bind("click", function() {
	
	show()
		});
		function show() {	
			if (trigger.is(':checked')){
								$(target).show();
			}
			else{

					$(target).hide();
			}
		}
	
	},
	customScrollBar: function(){
		console.log("ddd");
	var scrollcontainer = $(lebara.vars.selectors.overlayScroller);
	new jsScrollbar(jsScroller, scrollcontainer, auto, eventHandler);
	},
	 getParam: function( name )
	{
	  name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
	  var regexS = "[\\?&]"+name+"=([^&#]*)";
	  var regex = new RegExp( regexS );
	  var results = regex.exec( window.location.href );
		//alert(results[1]);
	  if( results == null )
	    return "";
	  else
	    return results[1];

	},
	loadLanguageSelector: function(json) {
			var html = "<ul class='clear'/>";
			$(".changeLang").append(html);
			var languageSelected = lebara.getParam("IsoCode");
		
			if(json){
			//alert(languageSelected);
						for (var i = 0, jLen = json.length; i < jLen; i++) {
							var _item = json[i];
						
								curUrl = document.location.href.split("?");
							
							
							if (languageSelected == _item.value) {
					
							$(".changeLang ul").prepend("<li class='clear first'><a href='" + curUrl[0] + "?IsoCode=" + _item.value + "' title='" +  _item.value + "'><img src='" + _item.flag + "' alt=''/><span>" + _item.language  + "</span></a></li>");
								
									//If Selected Language add as first option
							
								}
						
		
							else{	$(".changeLang ul").append("<li class='clear'><a href='" + curUrl[0] + "?IsoCode=" + _item.value + "' title='" + _item.value + "'><img src='" + _item.flag + "' alt=''/><span>" + _item.language  + "</span></a></li>");
								}
						}
						if ($(".changeLang ul li.first").length == 0){$(".changeLang ul > li:first-child").addClass("first"); };
			
								$(".changeLang ul").bind("mouseover", function(){
								
									$(".changeLang ul").addClass("languageSelectorOpen"); 
									$(".searchTopBox input").hide();
									
								});
								$(".changeLang ul li a").bind("mousedown", function(){
										var list = $(this).parents("ul");
										
												var selectedLang = $(this).attr("title");

									});
										$(".changeLang ul").bind("mouseout", function() {
										
												$(".changeLang ul").removeClass("languageSelectorOpen"); 
													$(".searchTopBox input").show();
										});
								
			}
		
	},
	dataPicker: function(){
	
		$(lebara.vars.selectors.dataPicker).datepicker({							  
			dateFormat: 'dd/mm/yy',
			showOn: 'both',
			buttonImage: '../assets/images/Calendar.gif',
			buttonImageOnly: true,
			buttonText: 'Calendar'
		});
	
	},
	addToBasket: function(trigger) {
	
		$(trigger).bind("click", function() {
		
			$('#basketQuestion').dialog({modal:true, width:462}); 
			$(".ui-dialog-title").hide();
			
			return false;
		});
	},
	loadPrePayRates: function(html){
		//console.log("Load Pre pay");

		//var countryCode;
			$(".prePayPlans").remove();
	$(html).insertAfter(".planSummaryExpanded .predictiveDropDown")
	
	
		
		
	},
	loginModal: function(link){
		//Different Height iframe (May merge at end)
		$(link).not('.link').click(function(event){								   
			var iframeSrc = $(this).attr('href') + "?overlay=true";
			var modalTitle = $(this).html();
			var modalWidth = 670;
			var modalHeight = 220;
			$('<iframe src="' + iframeSrc + '" allowTransparency="true" border="0" frameborder="0" />').dialog({
				title:modalTitle,
				width:modalWidth,
				height:modalHeight,
				modal:true
			}).width(modalWidth-25).height(modalHeight-20);
			
			event.preventDefault();
		
		});
			
	},
	modalIframe: function(link){
		//for use for modals that need an iframe
		$(link).not('.link').click(function(event){								   
			var iframeSrc = $(this).attr('href') + "?overlay=true";
			var modalTitle = $(this).html();
			var modalWidth = 670;
			var modalHeight = 400;
			$('<iframe src="' + iframeSrc + '" allowTransparency="true" border="0" frameborder="0" />').dialog({
				title:modalTitle,
				width:modalWidth,
				height:modalHeight,
				modal:true
			}).width(modalWidth-25).height(modalHeight-20);
			
			event.preventDefault();
		
		});
			
	},
	
	showHowToFindMyNumber: function(){
		
		$(lebara.vars.selectors.showHowToFindMyNumber).click(function() {
			$('#howToFindMyNumber').dialog({modal: true, width:555});
				$(".ui-dialog-title").hide();
				return false;
		})
		
	},
	postcodeGetJson: function(_url, _success){
	
				$.ajax({				
					url: _url + "?postcode=" + ($(lebara.vars.selectors.postCodeField).val()),
					dataType: 'json',
					type: 'GET',					
					success: _success
				});
			
		
	
	},
	showRates: function(){
	
			$("a.showRates").toggle(function() {
				
				$(".planSummaryExpanded").css({"display" : "block"});
					$(this).addClass("open");
				return false;
			}, function() {
				//console.log("toggle");
				$(".planSummaryExpanded").css({"display" : "none"});
				$(this).removeClass("open");
			});
		
	},
	
	
	simSelectionPanel: function(){
		
		if ($(lebara.vars.selectors.simSelectionPanelInput).length > 0) {
			$(lebara.vars.selectors.simSelectionPanelInput).addClass('accessibility');
		}
		
		if ($(lebara.vars.selectors.simInfoDiv).length > 0) {
			var addButton = $(lebara.vars.selectors.simInfoDiv + ':last p.button').html();
			$(lebara.vars.selectors.simInfoDiv + ' p.button').html(addButton);
			$(lebara.vars.selectors.simInfoDiv).css('display', 'none');
			$(lebara.vars.selectors.simInfoDiv + ':eq(0)').css('display', 'block');
		}
		
		if ($(lebara.vars.selectors.simSelectionPanelLabel).length > 0) {
			$(lebara.vars.selectors.simSelectionPanelLabel+':eq(0)').parent().addClass('sim-selected');
			
			$(lebara.vars.selectors.simSelectionPanelLabel).click(function(event){
				$(lebara.vars.selectors.simSelectionPanelLabel).parent().removeClass('sim-selected');
				$(this).parent().addClass('sim-selected');
				//alert($(lebaraShop.vars.selectors.simSelectionPanelLabel).index(this));
				if ($(lebara.vars.selectors.simInfoDiv).length > 0) {
					var displayIndex = $(lebara.vars.selectors.simSelectionPanelLabel).index(this);
					$(lebara.vars.selectors.simInfoDiv).css('display', 'none');
					$(lebara.vars.selectors.simInfoDiv + ':eq('+ displayIndex + ')').css('display', 'block');
				}
			});
		}
		
	},
	

	getPlanDetails: function(html, amount){
	//console.log(amount);
		
				$(".bundleRates").html(html);
				//console.log($("#planSummaryAdd"));
					lebara.addToBasket();
	},
	getTariffDetails: function(html)
	{
		// quick fix - worth redoing in GD
		$(".tariffPrePayInternational .prepayRateTables").remove();
		$(".tariffPrePayInternational").append(html);
				
		
		
	},
	getTariffDetailsRoaming: function(html)
	{
		// quick fix - worth redoing in GD
		$(".tariffPrePayRoaming p").remove();
		$(".tariffPrePayRoaming .prepayRateTables").remove();
		$(".tariffPrePayRoaming").append(html);
				
		
		
	},
	onCountrySelected: function(SelectedLink, Input){
		var amountChecked = ($(Input).parents("fieldset.tariffForm").find("input[name='amountGroup']:checked"));
		var countryCode = SelectedLink;
		var amount = amountChecked.attr("id");
		var callGroupChecked = $("input[name='callGroup']:checked")
		var callgroup = callGroupChecked.attr("id");
		var international = $(Input).parents(".tariffPrePayInternational");
				var roaming = $(Input).parents(".tariffPrePayRoaming");
		if ((amountChecked).length > 0){
	
		
				$.ajax({				
					url: "../postPayPlans.html?callGroup=" + callgroup + "&countryCode=" + countryCode + "&amount=" + amount,
					dataType: 'html',
					type: 'GET',					
					success:lebara.getPlanDetails
				});
			
		
		}
		if ($(international).length > 0)
		{
			var countryCode = $((international).find("#countryCode")).val();
	
				$.ajax({				
					url: "../prePayTopUpInternational.html?tariffType=international&countryCode=" + countryCode,
					dataType: 'html',
					type: 'GET',					
					success:lebara.getTariffDetails
				});
			
		}
			if ($(roaming).length > 0)
			{
			
					$.ajax({				
						url: "../prePayTopUpRoaming.html?tariffType=roaming&continentCode=" + countryCode,
						dataType: 'html',
						type: 'GET',					
						success:lebara.getTariffDetailsRoaming
					});

			}

			$(Input).parents("fieldset.tariffForm").find("input[name='amountGroup']").change(function(){
				 var amount = $(this).attr("id");
				
				$.ajax({				
					url: "../postPayPlans.html?callGroup=" + callgroup +  "&countryCode=" + countryCode + "&amount=" + amount,
					dataType: 'html',
					type: 'GET',					
					success:lebara.getPlanDetails
				});
				//lebara.getJson("../postPayPlans.html?countryCode=" + countryCode + "&amount=" + amount, lebara.getPlanDetails);
			});
		
	},
	postPayPlans: function()
	{
		
		$(".callPlanForm .radio input[name='callGroup']").change(function(){
			$(".callPlans div").css({"display" : "none"});
				$(".tariffForm").css({"display" : "none"});
			var _selectedPlan = this.id;

			$(".callPlans ." + _selectedPlan).css({"display" : "block"});
			$("fieldset." + _selectedPlan).css({"display" : "block"});
			lebara.showRates();
		});
		
		
		
		/*console.log($(this).parents("fieldset.tariffForm").find("input[name='amountGroup']:checked"));
		if($(destinationInput).hasClass("populatePlan") && (this).parents("fieldset.tariffForm").find("input[name='amountGroup']:checked")){
			console.log("dounds")
		}*/
	},
	postPayPlans: function()
	{
		
		$(".callPlanForm .radio input[name='callGroup']").change(function(){
			$(".callPlans div").css({"display" : "none"});
				$(".tariffForm").css({"display" : "none"});
			var _selectedPlan = this.id;

			$(".callPlans ." + _selectedPlan).css({"display" : "block"});
			$("fieldset." + _selectedPlan).css({"display" : "block"});
			lebara.showRates();
		});
		
		
		
		/*console.log($(this).parents("fieldset.tariffForm").find("input[name='amountGroup']:checked"));
		if($(destinationInput).hasClass("populatePlan") && (this).parents("fieldset.tariffForm").find("input[name='amountGroup']:checked")){
			console.log("dounds")
		}*/
	},
	categoryLastRowFix:function(){
		var newHeight = 0;
		$(lebara.vars.selectors.categoryLastRowFix).each(function(){
			//alert($(this).height());							 
			if ($(this).height() > newHeight){
				newHeight = $(this).height();
			}						
		})
		//alert(newHeight);
		$(lebara.vars.selectors.categoryLastRowFix).each(function(){
			$(this).css({
				'min-height':newHeight,
				'margin-bottom':'0px',
				'padding-bottom':'0px'
			})
		})
	},
	categoryToggle:function(){
		$(lebara.vars.selectors.categories + ' div').not(lebara.vars.selectors.categories + ' div:eq(0)').not(lebara.vars.selectors.categories + ' div:eq(1)').addClass('hide');
		$(lebara.vars.selectors.categories + ' div:eq(1)').addClass('lastRow');
		$(lebara.vars.selectors.categories + ' a.secButton').css('display','block');
		
		$(lebara.vars.selectors.categories + ' a.secButton').toggle(
			function(){
				$(lebara.vars.selectors.categories + ' div').removeClass('hide');
				$(lebara.vars.selectors.categories + ' div:eq(1)').removeClass('lastRow');
				
				$(this).removeClass('secButton-max').addClass('secButton-min');
				$(this).html(lebara.vars.strings.en.helpCategoryTriggerText2);
				lebara.categoryLastRowFix();
				return false;
			},
			function(){
				$(lebara.vars.selectors.categories + ' div').not(lebara.vars.selectors.categories + ' div:eq(0)').not(lebara.vars.selectors.categories + ' div:eq(1)').addClass('hide');
				$(lebara.vars.selectors.categories + ' div:eq(1)').addClass('lastRow');
				
				$(this).removeClass('secButton-min').addClass('secButton-max');
				$(this).html(lebara.vars.strings.en.helpCategoryTriggerText1);
				return false;
			}
		);
	 },
	showFields:function(){

		$(lebara.vars.selectors.checkoutAddressTrigger).toggle(
			function(){
				$(lebara.vars.selectors.checkoutAddressFields).show();
				$(this).text(lebara.vars.strings.en.checkoutAddressTriggerText2);
				$(this).removeClass('secButton-max').addClass('secButton-min');

			$(".address-populated").css({"display":"none"});
			$(".postCodePopulate").css({"display":"none"});

			return false;
		}, 
	function(){
		$(lebara.vars.selectors.checkoutAddressFields).hide();

				$(this).text(lebara.vars.strings.en.checkoutAddressTriggerText1);
				$(this).removeClass('secButton-min').addClass('secButton-max');
				return false;
		});
	},
	deactivateSwitcher:function() {
		function deactivate() {		
			$(lebara.vars.selectors.deactivate).find('input,select').attr('disabled', 'disabled');
			$(lebara.vars.selectors.deactivate).find('input[type=text]').attr('readonly', 'readonly');
		}
		function activate() {		
			$(lebara.vars.selectors.activate).find('input,select').removeAttr("disabled");
			$(lebara.vars.selectors.activate).find('input[type=text]').removeAttr('readonly');
		}
		deactivate();
		$(lebara.vars.selectors.activateSwitch).click(function() {
			$(lebara.vars.selectors.activateSwitch).siblings(lebara.vars.selectors.activate).removeClass('activate').addClass('deactivate');
			deactivate();
			
			$(this).siblings(lebara.vars.selectors.deactivate).removeClass('deactivate').addClass('activate');
			activate();
		});
	},
	tableHighlight: function(){
    $(".tableHighlight tr").hover(
      function () {
        $(this).not(".noHighlight").addClass("trHoverColor");
      }, 
      function () {
        $(this).not(".noHighlight").removeClass("trHoverColor");
      }
    );
	},
	radioSlider:function() {
		$(lebara.vars.selectors.radioSlider).click(function() {
			if ($(this).val()=="on") {$(this).closest("fieldset").find("legend span").text("on");}
			else {$(this).closest("fieldset").find("legend span").text("off");}
			var message=$(this).closest("fieldset").find("legend").text();
			alert(message);
		});
	},
	popup:function() {
		$(lebara.vars.selectors.popup).click(function() {
			
		});
	},
	getJson: function(_url, _success){
	
				$.ajax({				
					url: _url,
					dataType: 'json',
					type: 'GET',					
					success: _success
				});
			
		
	
	},
	parseData: function(json){
	
	if(json){
	
		$(".postCodeLookUp .address").css({"display" : "none"});
	var _postcode = $(lebara.vars.selectors.postCodeField).val();
					if($(_postcode)) {
								 $(".postCodePopulate select.text option[value!='']").remove();
									for (var i = 0, jLen = json.length; i < jLen; i++) {
										var _item = json[i];
										
										if(_item.postCode == _postcode)
										{
											
										
										
									
										$(".postCodePopulate select.text").append($("<option value='" + _item.addressId + "'>" + _item.adline1 + "</option>"));
								
									
										
										}
									
										
									}
										if ($(".postCodePopulate select.text option").length > 0)
											{
													$(".postCodePopulate").show();
													lebara.populatePostCode(json);
															return false;
											}
											else
											{
											$(".postCodePopulate").hide();
											$(".address-populated").hide();
												}

						}
					
						
				

					
		
			
	}
	
	},
	populatePostCode: function(json){

		$(".postCodePopulate select.text").change(function () {
			$(".postCodePopulate select.text option:selected").each(function () {
			              //console.log("selected");
											if(json){
												for (var i = 0, jLen = json.length; i < jLen; i++) {
													var _item = json[i];
													if(_item.addressId == $(this).val()){
																	var allFields = $(lebara.vars.selectors.postCodeAddressFieldset).find("input.text")
															$(lebara.vars.selectors.postCodeAddressFieldset).css({"display" : "block"});
															$(".address-populated .adline1 input.text").val(_item.adline1);
																$(".address-populated .adline2 input.text").val(_item.adline2);
																	$(".address-populated .adline3 input.text").val(_item.adline3);
																		$(".address-populated .city input.text").val(_item.city);
																		$(".address-populated .county input.text").val(_item.county);
																			$(".address-populated .postcode input.text").val(_item.postCode);
																	
																	$(allFields).attr("disabled", "disabled");
																	$("#postCodeLookUp .primaryButton").bind("click", function(){
																		$(allFields).removeAttr("disabled");
																	});
																			
													}
											
												}
											}
			              });
			

	});
	
	},

	predictiveDropDown: function(){
	
	
		$(function() {
			var continentSet = 	$(".continentSet");
			var input =  $(".continentSet .fakeInput input");



			if ((continentSet).length>0) {

				$.ajax({
					url: "../continentList.json",
					dataType: "json",
					data: {
						maxRows: 12,	
						minLength: 2
					},
					success: function(data) {
						var x = [];
						var y = [];
						for (i = 0; i < data.length; i = i + 1) {
							x.push(data[i]);

						}
						lebara.vars.arrays.predictiveDropDown.continentList = x;
						
							$(input).each(function(){
								var input = this;
									var inputId = $(this).attr("id")

								$(input).autocomplete({

									source: lebara.vars.arrays.predictiveDropDown.continentList,
									focus: function() {
										var limiter=5;

									},

									change: function(e,b) { 


									if (b.item){

										$("#countryCode").val(b.item.value);
											$("#" + inputId).val((b.item.label));

									}
									},
									select: function(e, b) {

										$("#continentCode").val(b.item.value);

											$("#" + inputId).val((b.item.label));	
											$("#" + inputId).blur();	
									
											lebara.onCountrySelected(b.item.value, input)

									}


								});

					});
					}
				});

			}
		});

	

	// Give the input the autocomplete function - Countries
	$(function() {
		var countrySet = 	$(".countrySet");
		var input =  $(".countrySet .fakeInput input");
	
		
		
		if ((countrySet).length>0) {
	
			$.ajax({
				url: "../countryList.json",
				dataType: "json",
				data: {
					maxRows: 12,	
					minLength: 2
				},
				success: function(data) {
					var x = [];
					var y = [];
					for (i = 0; i < data.length; i = i + 1) {
						x.push(data[i]);
					
					}
					lebara.vars.arrays.predictiveDropDown.countryList = x;
					//console.log(lebara.vars.arrays.predictiveDropDown.countryList);
						$(input).each(function(){
							var input = this;
								var inputId = $(this).attr("id")
			
							$(input).autocomplete({
							
								source: lebara.vars.arrays.predictiveDropDown.countryList,
								focus: function() {
									var limiter=5;
										
								},
								
								change: function(e,b) { 
							
								
								if (b.item){
								
									$("#countryCode").val(b.item.value);
										$("#" + inputId).val((b.item.label));
										
								}
								},
								select: function(e, b) {
								
									$("#countryCode").val(b.item.value);
								
										$("#" + inputId).val((b.item.label));	
										$("#" + inputId).blur();	
										if((".simValue #priceCountryGo").length > 0)
										{
											
											$(".simValue #priceCountryGo").click();
										}
										lebara.onCountrySelected(b.item.value, input)
									
								}
							
								
							});
						
				});
				}
			});
		
		}
	});

	// Clicking on a list item puts it into the input box.
	function listSelector () {
	
		$("ul.dropdownList li a").click(function() {
					
			
			var pickup=$(this).text();
			var countryCode = $(this).attr("title");
		
			var destinationInput = $(this).closest(lebara.vars.selectors.predictiveDropDown).children().find(".fakeInput input");
			var dropDown = $(this).parents(".dropdownList");
		var countryCodeInput = $(dropDown).siblings("#countryCode");
				var continentCodeInput = $(dropDown).siblings("#continentCode");
		var planSummary = $(this).parents(".planSummaryExpanded");
	
	
	if((countryCodeInput).length > 0)
	{
		countryCodeInput.val(countryCode);
	}
	if((continentCodeInput).length > 0)
	{
		continentCodeInput.val(countryCode);
	}
	
			destinationInput.val(pickup);
			
			destinationInput.removeClass("initial");
			destinationInput.addClass("real");
			$(this).closest(lebara.vars.selectors.predictiveDropDown).children().find("a.clearInput").show();
			$(this).parent().parent().hide();
		
		if ((planSummary).length > 0){
				$.ajax({				
					url: "../prePayPlans.html?countryCode=" + countryCode,
					dataType: 'html',
					type: 'GET',					
					success: lebara.loadPrePayRates
				});
		 	
		}
	
		else
		{
			lebara.onCountrySelected(countryCode, destinationInput);	
			
		}
				return false;
			
	
		});
	}








	// On clicking on the down arrow, the list of items is created - countrySet
	$("a.beta").toggle(function() {
	
		var grandparent=$(this).closest(lebara.vars.selectors.predictiveDropDown);
		
		
		if (grandparent.hasClass("continentSet")) {
		
				$.getJSON('../continentList.json', function(data) {
					var newList="";
				
							for (var i = 0, jLen = data.length; i < jLen; i++) {
								var _item = data[i];
								//console.log(_item.name);


								newList+="<li class='ui-menu-item'><a href='#' class='ui-corner-all' title=" + _item.value + ">" + _item.label + "</a></li>";
							
								
								$(grandparent).find("ul.dropdownList").html(newList);
								$(grandparent).find("ul.dropdownList").show();

						}
								listSelector();
								return false;
							//return newList;
								$(this).parent().parent().find("ul.dropdownList").html(newList);
								$(this).parent().parent().find("ul.dropdownList").show();
				});
		
		}
		else { 
			$.getJSON('../countryList.json', function(data) {
				var newList="";
			  /*$('.result').html('<p>' + data.foo + '</p>'
			    + '<p>' + data.baz[1] + '</p>');*/
						for (var i = 0, jLen = data.length; i < jLen; i++) {
							var _item = data[i];

								
								
							newList+="<li class='ui-menu-item'><a href='#' class='ui-corner-all' title=" + _item.value + ">" + _item.label + "</a></li>";
						
							$(grandparent).find("ul.dropdownList").html(newList);
							$(grandparent).find("ul.dropdownList").show();
					
					}
							listSelector();
							return false;
					
							$(this).parent().parent().find("ul.dropdownList").html(newList);
							$(this).parent().parent().find("ul.dropdownList").show();
			});
			
			
		}
		
		

	

	
		
		
		listSelector();
		return false;
	}, function() {
		$(this).parent().parent().find("ul.dropdownList").hide();
	});
	

	
	// On clearing text in input, re-instate initial text and colour
	$("a.clearInput").click(function() {
		var currentInput=$(this).parent().find("input")
		var pickup=currentInput.attr("alt");
		currentInput.val(pickup);
		$(this).hide();
		currentInput.addClass("initial");
		currentInput.removeClass("real");
		return false;
	});
	
	// On focus on the input, remove initial text and colour
	$(".fakeInput input").focus(function(){
		$("ul.dropdownList").hide();
		if ($(this).val()==$(this).attr("alt")) {
			$(this).val(" ");
		}
		$(this).removeClass("initial");
		$(this).addClass("real");
		$(this).parent().find("a.clearInput").show();
	});
	
	// Once a key has been typed into the input box, the 'X to clear' appears
	$('.fakeInput input').keyup(function() {
		$(this).parent().find("a.clearInput").show();
		var userInput=$(this).val();
// Force a space character into the beginning of the user's input. Helps with alphabetical ordering.
		if (userInput.charAt(0)!=" ") {
			userInput=" " + userInput;
			$(this).val(userInput);
		}
		
	});

	}
	,
	
	shopRateRevealer: function(){
	
	if ($(".simValue").length>0) {
	
		$(lebara.vars.selectors.priceChoice).change(function() {
	
			if ($(lebara.vars.selectors.priceChoice).val()!=-1) {
							//console.log($("#countryCode").val());
							console.log("ddd");
				if ($("#countryCode").val()) {
					$(".ratesPanel,.outputPanel").show();
					
					}
			}
			$(".priceChoiceValue").text($(lebara.vars.selectors.priceChoice).val());
		});
	
		/*$(lebara.vars.selectors.priceChoice).change(function() {
			$(".simValue").find()
		});*/
		$(lebara.vars.selectors.priceCountryGo).click(function() {	
					
			if ($(lebara.vars.selectors.priceChoice).val()!=-1) {
			
				if ($("#countryCode").val()) {$(".ratesPanel,.outputPanel").show();
				
				
				}
			}
			return false;
		});
	}
},
countryChecker: function(whichPredictiveDropDown){
	i=0;
	var selectedPredictiveDropDown;
	if (whichPredictiveDropDown) 
	{selectedPredictiveDropDown=whichPredictiveDropDown;}
	else {selectedPredictiveDropDown=$(lebara.vars.selectors.countryChoice);}
	//alert("countryChecker - selectedPredictiveDropDown value=" + selectedPredictiveDropDown.val());//!!
	for (i=0;i<(lebara.vars.arrays.predictiveDropDown.countryList).length;i++) {
		//if ((lebara.vars.arrays.predictiveDropDown.countryList[i].toLowerCase())==$(lebara.vars.selectors.countryChoice).val().toLowerCase()) {
		if ((lebara.vars.arrays.predictiveDropDown.countryList[i].toLowerCase())==selectedPredictiveDropDown.val().toLowerCase()) {
			i=(lebara.vars.arrays.predictiveDropDown.countryList).length + 1;
			return true;
		}
	}
	return false;
},

FormValidation: function(formId){
	 
$(formId).each(function() {
		var _formId = this.id
		//console.log(this);
		var _formspecific = (lebara.vars.strings.validation[_formId]);
		
		for (var i = 0, forms = $(_formspecific).length; i < forms; i++) {
		
		$(formId).find((".input .text")).each(function() {

			var _fieldId = (this).id;
			var _fieldspecific = _formspecific[_fieldId]
			if (_fieldspecific) {
			var _required = _fieldspecific["Required"]
			var _format = _fieldspecific["Format"]
			var _minlength = _fieldspecific["MinLength"]
				var _maxlength = _fieldspecific["MaxLength"]
				var _comparison = _fieldspecific["Comparison"]
			var _selectedField = ($(this).parents(".field:not(.dob)"));
	
			$("#" + _fieldId).bind("blur", function(){
			if (_required) {
			var _type= "required"

			
			if ($(this).val()){
				
				//if required Test
				
				//If minlength
					if(_minlength){
					
						var _type = "minlength";
					 var _length = _minlength["Length"];
					 //if minlength test
					if((this.value.length) < _length){
										
							Invalid(this, _selectedField, _minlength, _type);
					}
					else
					{
					
						Valid(this, _selectedField);	
					}
					}
					
						//If minlength End
							//If maxlength
								if(_maxlength){
									
									var _type = "maxlength";
								 var _length = _maxlength["Length"];
								
								 //if minlength test
								if(this.value.length > _length){
									//console.log(" length invalid")
										Invalid(this, _selectedField, _maxlength, _type);
								}
								else
								{
	
									Valid(this, _selectedField);	
								}
								}

									//If maxlength End
							
					if(_format){
					if (_format["Regex"] === "alpha"){
					
					var _regex = new RegExp(/^[a-z]*$/i);
					}
					/*if (_format["Regex"] === "alphaNumeric"){
					
					var _regex = new RegExp(/^[a-z0-9]*$/i);
					}*/
					if (_format["Regex"] === "postcode"){
					//console.log("postcode");
					var _regex = new RegExp(/^(GIR0AA)|((([A-PR-UWYZ][0-9][0-9]?)|(([A-PR-UWYZ][A-HK-Z][0-9][0-9]?)|(([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Z][0-9][ABEHMNPRVWXY]))))[0-9][ABD-HJLNP-UW-Z]{2})$/);
					}
					else
					{
						var _regex = new RegExp(_format["Regex"]);
					}
					//console.log(_regex);
					var _type = "format"
						if (_regex.test($(this).val()))
						// if format Test
						{
						
						//console.log("true")
						
						Valid(this, _selectedField);	
						}
						else{
						Invalid(this, _selectedField, _format, _type);
						//console.log("Invalid Format")	
						}
					}
					else{
						
						var dob = $(_selectedField).parents(".dob");
								var dob_input = $(_selectedField).parents(".dob > .input");
								/*var _fieldspecific = _formspecific[dob];
								var _required = _fieldspecific["Required"];
								var _type = required;*/
						if(dob){
							var monthVal = dob.find("#month").val()
								var dayVal = dob.find("#day").val()
									var yearVal = dob.find("#year").val()
							if(monthVal && dayVal && yearVal){
									//If required dob
							
										Valid(dob_input, dob);
										
										
							}
							/*else{
								$(dob).find(".validImage").remove();
							Invalid(dob_input, dob, _required, _type);
							}*/
						/*	$(dob).find(".text").each(function(){
							if($(dob).find(".text").val())
							{
								console.log("xxx");
							}
								});*/
						/*	$(dob).find(".text").each(function(){
							console.log("xxx");
							});*/
							
						}
						else
						{
						Valid(this, _selectedField);
					}
					}
							//if Comparison
							
						if(_comparison)
							{
							
								var _type = "comparison";
								var _valueToCompare = ($("#" + _comparison["FieldToCompare"]).val())
								var _value =  $(this).val();
								
									
							if ((_valueToCompare) === (_value)){
										Valid(this, _selectedField);
								}
								else
								{
							
												Invalid(this, _selectedField, _comparison, _type);
								}
								
					
					
						}
				//if required Test end	
				}
				else 
				{
						var dob = $(_selectedField).parents(".dob");
							var dob_input = $(_selectedField).parents(".dob > .input");
						
								if($(dob).length > 0){
									Invalid(dob_input, dob, _required, _type);
									
								}
									else{
								Invalid(this, _selectedField, _required, _type);		
								}
			
				}
			
				}
			
			
				});
				
			}	

		
		});
			}
	});
		
		function Valid(input, _selectedField) {
		//console.log("Valid");
		
			var _validator = $(input).siblings(".validator");
				var _validImage = lebara.vars.paths.validImage
				
				//Valid - add valid class to field and add image - build function
				$(_selectedField).addClass("validField");
					$(_selectedField).removeClass("invalidField");
				//console.log(_selectedField);	
				if($(_selectedField.find(".validImage")).length > 0){
					 //If valid image			
					 //console.log("image")	
				}
				else
				{ $("<img src='" + _validImage + "' class='validImage' alt='Valid' />").insertAfter(input);
						
				}
			
				$((_selectedField).find(".errorTooltip")).remove();
		}
		function Invalid(input, _selectedField, validationMessage, type){
		//console.log("invalid");
		var _selectedFieldRequired = $(input).siblings("." + type);
				//Invalid - add validator with validation message - build function
				$(_selectedField).find(".validImage").remove();
				//	console.log(_selectedFieldRequired).length);
				if((_selectedFieldRequired).length > 0){
			
			
				}
				else
				{
								$(_selectedField).find(".errorTooltip").remove();
				$(_selectedField).addClass("invalidField");
			
					$("<a href='#' class='errorTooltip " + type + "' title='Error'><img src='../assets/images/icons/conflict.png' alt='error' /></a>").insertAfter(input);
					/*$("<div class='validator " + type + "'><span></span>" + validationMessage["ValidationMessage"] + "</div>").insertAfter(input);*/
					$(".errorTooltip").each(function(){
							$(this).bind("mouseover", function(){
									showTooltip(this);

							});
								$(this).bind("mousedown", function(){
								showTooltip(this);
								return false;
								});
							$(this).bind("mouseout", function(){
								$(".validator").remove();
							});
							
							function showTooltip(errorToolTipTrigger){
							var msg =	validationMessage["ValidationMessage"];
							var _html = "<div class='validator'><div><span></span>" + msg + "</div></div>";
							
									var _Pos = $(errorToolTipTrigger).offset();
								
									var _width = ($(errorToolTipTrigger).width())
									//$(_help.html()).appendTo(_html);

									$(lebara.vars.selectors.content).append(_html);
									$(".validator").css({"display" : "none"});

								$(".validator").css({ "left": ((parseInt(_Pos.left)) + _width + 10) + "px", "top": (parseInt(_Pos.top - 17) + "px")});
									$(".validator").show();
							}
					
						});
						
				}
				
			
		}	
	
},

HelpTooltips:function(){
	
	$(lebara.vars.selectors.helpLink).each(function(){
			$(this).bind("mouseover", function(){
					showTooltip(this);
		 	
			});
				$(this).bind("mousedown", function(){
				showTooltip(this);
				return false;
				});
			$(this).bind("mouseout", function(){
				$(lebara.vars.selectors.toolTip).remove();
			});
			function showTooltip(helpLink) {
		
					var _selectedHelp = new String($(helpLink).attr("href"));
			 		var _help = $('.help ' + _selectedHelp).siblings('p');
					if( (_help).length > 0){
					var _Pos = $(helpLink).offset();
					var _html = "<div class='toolTip'><div><span></span>" + _help.html() + "</div></div>";
					var _width = ($(helpLink).width())
					$(_help.html()).appendTo(_html);

					$(lebara.vars.selectors.content).append(_html);
					$(lebara.vars.selectors.toolTip).css({"display" : "none"});

				$(lebara.vars.selectors.toolTip).css({ "left": ((parseInt(_Pos.left)) + _width + 10) + "px", "top": (parseInt(_Pos.top - 17) + "px")});
					$(lebara.vars.selectors.toolTip).show();
				}
			}
	
	});

			
},

 removeTextBoxValue: function(){
		
		$(lebara.vars.selectors.textBoxWithValue).each(function(){
	
		$(this).bind("focus", function() {
			 (this).value = ""
		});
	
		});


}

}



