

                 
   
     
                                                                                
                     
	  
	
		var WordWheel = function(){}
var objectClose;
WordWheel.prototype = { 
	input : {},
	searchValue : "", type : "", dialect : "",
	maxDisplay : 10,
	ie6 : $.browser.msie && $.browser.version=="6.0",
	cachedData : [],
	hiddenInputs : ["HiddenEOAG","AutoFill","searchType","stateCode","countryCode","isServedBy"],
	query : function(location){
		var self = this;
		$.getJSON(htz.config.rootContext+"/reservation/gaq/templates/home/wordwheelRequest.jsp?searchText="+location+"&dialect="+self.dialect,
			function(response){
				if(response.locationList.length>0){
					self.draw(response.locationList,response.searchText); 
					self.cachedData[response.searchText]=response.locationList;
					self.searchValue = response.searchText;
				}
				else{
				    if(objectClose!= null)
		   				objectClose.hide();
					self.clear();
					self.prepare(null);
				}
			}
		);	
	}
	,
	setTogglerTimer : function() {
		var self = this;
		if(self.currentTimer == 0) {
			self.currentTimer = null;
			clearTimeout(self.toggleTimeout);
			// Adding condition if length of search text > 3 or if the text box doesnt have an initial spaces
			if(self.input.val().length>=3 && self.input.val().substring(0,1) != ' '){
				self.query(encodeURIComponent(self.input.val())); 
			}
		} else {
			self.currentTimer--;
			self.toggleTimeout = setTimeout(function(){
									self.setTogglerTimer();
								},100);
		}
	}, 
	
	handle : function(e){
		var self = this;
		//Fix for fire fox 2 by adding timer
		self.currentTimer = 10;
		clearTimeout(self.toggleTimeout);
		var key = (e.charCode) ? e.charCode : ((e.keyCode) ? e.keyCode : ((e.which) ? e.which : 0));
		if(key==13){ self.select(); return; }
		if(key!=37 && key!=38 && key!=39 && key!=40){

			// Adding condition if length of search text > 3 or if the text box doesnt have an initial spaces
			if(self.input.val().length>=3 && self.input.val().substring(0,1) != ' '){
				if(self.cachedData[self.input.val()]==undefined){
				self.handleTimeout = setTimeout(function(){
										self.setTogglerTimer();
									},5); 
				}
				else {
					self.draw(self.cachedData[self.input.val()],self.input.val()); 
					self.searchValue = self.input.val();
				}
			} else {
			    if(objectClose!= null)
		   			objectClose.hide();
				self.clear();
				self.prepare(null);
			}
		}
	},
	shift : function(e){
		var self = this;
		var key = (e.charCode) ? e.charCode : ((e.keyCode) ? e.keyCode : ((e.which) ? e.which : 0));
		if ($("#wordWheelResults").length && $("#wordWheelResults").css("visibility")=="visible")	{
			if (key==38) 
				self.move(0);				
			if (key==40) 
				self.move(1);
		}
	},
	prepare : function(location){
		var self = this;
		var prefix = "inp"+self.type.charAt(0).toUpperCase()+self.type.substr(1);
		if(location){
			for(var key in location){
				if(key=="preferredOag"){
					if(location[key]!="null") 
						$("#"+self.type+"HiddenEOAG").val(location[key]);
					else 
						$("#"+self.type+"HiddenEOAG").val("");
				}
				if(location[key]!="null") 
					$("#"+prefix+key.charAt(0).toUpperCase()+key.substr(1)).val(location[key]);
				else 
					$("#"+prefix+key.charAt(0).toUpperCase()+key.substr(1)).val("");
			}
			$("#"+prefix+"AutoFill").val("Y");

			if(location.locationTitle!="null") self.input.val(location.locationTitle);
			else self.input.val(location.displayText);
		}
		else {
			for(var i=0; i<self.hiddenInputs.length;i++){
				if(self.hiddenInputs[i]=="HiddenEOAG") 
					$("#"+self.type+"HiddenEOAG").val("");
				else 
					$("#"+prefix+self.hiddenInputs[i].charAt(0).toUpperCase()+self.hiddenInputs[i].substr(1)).val("");
			}
		}
	},
	select : function(){
		var self = this;
		var selected = $("#wordWheelResults .wordWheelSelected");
		var location = null;
		if(selected.length && self.cachedData[self.searchValue]){
			for(var i=0;i<self.cachedData[self.searchValue].length;i++){
				var obj = self.cachedData[self.searchValue][i];
				if(obj.displayText == selected.text()) { 
					location = obj;
					break;
				}
			}
			self.prepare(location);
		}

		self.input.unbind('keyup keydown keypress blur').blur();	
		self.clear();
		if(objectClose!= null)
		   objectClose.hide();
		setTimeout(function(){ self.set(); },1);
	},
	move : function(direction){
		var self = this;
		var results = $("#wordWheelResults");
		var selected = results.find(".wordWheelSelected");
		self.detach();
		
		if (direction==0){
			if(selected.length && selected.prev()!=null) 
				selected.removeClass("wordWheelSelected").prev().addClass("wordWheelSelected");
			else
				results.find("div:last-child").addClass("wordWheelSelected"); 
		}
		if (direction==1){
			if(selected.length && selected.next()!=null) 
				selected.removeClass("wordWheelSelected").next().addClass("wordWheelSelected");			
			else 
				results.find(":first").addClass("wordWheelSelected"); 
		}
        
		if (results.find(".wordWheelSelected").length){
			if (results.find(".wordWheelSelected").attr("id")=="wordWheelClose")
			  self.input.val('');
			else
			  self.input.val(results.find(".wordWheelSelected").attr("name"));
		} else
			self.input.val(self.searchValue);
		
		self.reposition(direction);

		if (self.ie6) 
			setTimeout(function(){ self.attach(); },1);
		else 
			self.attach();
	},
	reposition : function(direction){
		var results = $("#wordWheelResults");
		var selected = results.find(".wordWheelSelected");
		
		if(!selected.length) results.attr("scrollTop",0);
		else {
			if (direction==0){
				if(selected.position().top>=results.height()) 
					results.attr("scrollTop",selected.position().top);
				else if(selected.position().top<0) 
					results.attr("scrollTop",results.attr("scrollTop")-selected.outerHeight()); 
			}
			if (direction==1){
				if (selected.position().top>=results.height()) 
					results.attr("scrollTop",selected.position().top-results.height()+selected.outerHeight()+results.attr("scrollTop"));
			}
		}
	},
	draw : function(list,searchText){ 
		var self = this;
		var results = $("#wordWheelResults");
		self.clear();

		var locationCountText='';
		var length;
		var suggestionStringToHighlight;
		var suggestionStringNotToHighlight;
		var index;
		var highlightedText;
		var nonHighlightedText;
		var locationCountInfo;
		var regularText;
		var displayText;
		var actualHeight;
		var outerHeight;
		var listLength;
		var topPosition;
		var topPosition;
		

		if(objectClose!= null)
		   objectClose.hide();	
		if (!results.length)
			results = $("<div>").attr("id","wordWheelResults").css("visibility","hidden").appendTo("body");

				
		for(var i=0; i<list.length;i++){
			var obj = list[i];
			index=0;
			displayText=obj.displayText;
			if (obj.displayText.indexOf('(') >0 && obj.searchType!=4 && obj.searchType!=6){
	    		locationCountText= obj.displayText.substring(obj.displayText.indexOf('('));
	    		displayText= obj.displayText.substring(0,obj.displayText.indexOf('('));
           	} else
         		locationCountText='';
         	        	
			var divWordWheel=$("<div>").attr("name", obj.locationTitle!="null" ? obj.locationTitle : obj.displayText)
							.mouseover(function(){ $("#wordWheelResults .wordWheelSelected").removeClass(); $(this).addClass("wordWheelSelected"); })
							.click(function(){ self.select(); })
							.appendTo(results);
							
			while(index!=-1){
         		
         		  length=searchText.length;
         		  index=displayText.toLowerCase().indexOf(searchText.toLowerCase());
         		  if(index == 0)
         		     suggestionString=displayText.substring(0,length);
         		  else if(index == -1)
         		      suggestionString=displayText.substring(0);  
         		  else
         		      suggestionString=displayText.substring(0,index); 
         		        
         		  if(suggestionString.toLowerCase() == searchText.toLowerCase()){    
         		     $("<span>").attr("id","wordWheelHighlight").text(suggestionString).appendTo(divWordWheel);
         		     displayText=displayText.substring(index+length);   
         		  }   
         		  else{
         		     $("<span>").attr("id","nonHighlightedText").text(suggestionString).appendTo(divWordWheel);  
         		     displayText=displayText.substring(index);   
         		   }  
         	}
         	$("<span>").attr("id","wordWheelLocationCount").text(locationCountText).appendTo(divWordWheel);
       			
		}
		//var txtCloseButton = $("#closeButton").val();//modifyed by Animesh Singh
		var txtCloseButton = $("#closeButton").length > 0 ? $("#closeButton").val() : "";//Check for closeButton In the page
		var imgCloseButton = htz.config.protocol + '://images.hertz.com' + htz.config.fullContext + '/misc_refresh/popup_close.gif';
		var divClose=$("<div>").attr("id","wordWheelClose").click(function(){self.input.val('');$('#wordWheelResults').css('visibility')='hidden';divClose.hide(); }).css("visibility","hidden").appendTo("body");
		var spanCloseText=$("<span>").attr("id","wordWheelCloseText").click(function(){self.input.val('');divClose.hide(); }).text(txtCloseButton).appendTo(divClose);
		var spanCloseImg=$("<span>").attr("id","wordWheelCloseImg").click(function(){self.input.val('');divClose.hide(); }).appendTo(divClose);
		$("<img>").attr("src",imgCloseButton).appendTo(spanCloseImg);
		
		outerHeight=results.find(":first").outerHeight();
		listLength=list.length;
		if(listLength>self.maxDisplay)
		  actualHeight=outerHeight*10;
		else  
		  actualHeight=outerHeight*listLength;
		
		topPosition=self.input.offset().top+20;
		topPosition=topPosition+actualHeight;
		leftPosition=self.input.offset().left;
		divClose.css({"top":topPosition,"left":leftPosition,"visibility":"visible"});	
		objectClose=divClose;
	    objectResults=results;

		self.attach();
		
		if (list.length>=self.maxDisplay) 
			results.css("height",results.find(":first").outerHeight()*self.maxDisplay);
		results.css({"top":self.input.offset().top+20,"left":self.input.offset().left,"visibility":"visible"});		

		if(self.ie6){
			if (!$("#wordWheelResultsIFrame").length) 
				$("<iframe>").attr({"id":"wordWheelResultsIFrame","src":"javascript:false;"}).css("visibility","hidden").appendTo("body");
			$("#wordWheelResultsIFrame").css({"height":results.outerHeight()+outerHeight,"width":results.outerWidth(),"top":self.input.offset().top+self.input.outerHeight(),"left":self.input.offset().left,"visibility":"visible"});
		}
	},
	detach : function(){
		var results = $("#wordWheelResults");
		if(results.length) results.unbind().children().unbind();
	},
	attach : function(){
		var self = this;
		var results = $("#wordWheelResults");
		if(results.length){
			if(!$.browser.mozilla){
				results.mouseenter(function(){ self.input.unbind("blur").blur(function(){ self.input.focus(); }); })
					.mouseleave(function(){ self.input.unbind("blur").blur(function(){ self.select(); }); });
			}
			results.mousemove(function(){
				$(this).unbind('mousemove').children().unbind()
					.mouseover(function(){ $("#wordWheelResults .wordWheelSelected").removeClass(); $(this).addClass("wordWheelSelected"); })
					.click(function(){ self.select(); });	
			});			
		}
	},
	clear : function(){
		var self = this;
 		if($("#wordWheelResults").length) $("#wordWheelResults").css({"height":"auto","visibility":"hidden"}).children().remove();
		if(self.ie6 && $("#wordWheelResultsIFrame").length) $("#wordWheelResultsIFrame").css("visibility","hidden");
		self.searchValue = "";				
	},
	set : function(){
		var self = this;
      	self.input.unbind('keyup keydown keypress blur')
      		.keyup(function(event){ self.handle(event); })
       		.keydown(function(event){ self.shift(event); })
       		.keypress(function(event){ return (event.keyCode != 13); })
			.blur(function(){ self.select(); });
	},
	init : function(input){
		var self = this;
		self.input = input;
		self.dialet = htz.config.dialect;
		
		if(self.input.attr("id")=="pickupLocation") self.type = "pickup";
		if(self.input.attr("id")=="dropoffLocation") self.type = "dropoff";

		self.set();
	}
};
	
		var HomePage = (function() {

	if(htz.homepage.jsflag.enableRightBannerAds) {
		var homePageAdsLoad = { cache: false, dataType: 'html', success: function(data) { $('#homePageBannerAdContainer').html(data); }};
		homePageAdsLoad.url = htz.config.rootContext + '/reservation/gaq/templates/home/reservationOnHomepageAds.jsp';
		LazyLoad.queueJS(homePageAdsLoad, 'high');
	}
	
	$(document).ready(function() {
		Clock.init(htz.clock.pickupHour, htz.clock.pickupMin, htz.clock.dropoffHour, htz.clock.dropoffMin, htz.clock.useMilitaryTime);
		
		$("#pickupDay")
			.focus(function(){ $(this).blur(); })
			.click(function(){ Calendar.showStart($(this),$("#dropoffDay"),htz.calendar.flags.militaryClock); });
			
		$("#dropoffDay")
			.focus(function(){ $(this).blur(); })
			.click(function(){ Calendar.showEnd($(this),$("#pickupDay"),htz.calendar.flags.militaryClock); });	
	
		$(".wordWheelInput").each(function(){ 
			new WordWheel().init($(this));
		});
		
		// To handle DnC
		if(htz.homepage.jsflag.isDnCAvailable){
			$("#pickupLocation").keydown(function(){HomePage.setDandCChangedValue('isDeliveryChanged',htz.homepage.jsdata.pkLocation,'Y',$("#pickupLocation")[0]);})
								.change(function(){HomePage.setDandCChangedValue('isDeliveryChanged',htz.homepage.jsdata.pkLocation,'Y',$("#pickupLocation")[0]);});
			
			$("#dropoffLocation").keydown(function(){HomePage.setDandCChangedValue('isCollectChanged',htz.homepage.jsdata.drLocation,'Y',$("#dropoffLocation")[0]);})
								.change(function(){HomePage.setDandCChangedValue('isCollectChanged',htz.homepage.jsdata.drLocation,'Y',$("#dropoffLocation")[0]);});
		}
	

	});
	
	/* Copied the functions to submit home page , will refactor the code/functions after functionality is working. - KM */
	
	validateResLocations = function(){
		if(htz.homepage.jsflag.isDropDownLocation)
			return validateDropDownLocations();
		
		return true;
	};
	
	validateResDates = function(){
		with(document.resForm){
			if($.trim(pickupDay.value).length == 0){
				alert(htz.homepage.jscontent.choosePickDate);
				return false;
			}
			if($.trim(dropoffDay.value).length == 0){
				alert(htz.homepage.jscontent.chooseReturnDate);
				return false;
			}
		}
		return true;
	};
	
	handleFTSSubmit = function(){
		with(document.resForm){
			if($.trim(wasFormSubmitted.value) == 'true'){
				continueButton.value = 'continue'; 
		 		submit();
			}
	    }
 	};

	validateArrivalInformation = function(){
		var formVar = document.resForm;
		
		if(formVar.arrivingInfoRadioButton){
			if(!$.isArray(formVar.arrivingInfoRadioButton) || formVar.arrivingInfoRadioButton[2].checked){
				if($.trim(formVar.selectedAirline.value).length == 0){
					alert(htz.homepage.jscontent.arrivalOptionError);
					return false;
				}
				return true;
			}
		
			if(!formVar.arrivingInfoRadioButton[0].checked && !formVar.arrivingInfoRadioButton[1].checked && !formVar.arrivingInfoRadioButton[2].checked)
			{
				alert(htz.homepage.jscontent.arrivalInfoError);
				return false;
			}
		}
		return true;
	};
	
	determineOverallFormSubmission = function() {
		document.resForm.continueButton.value = 'continue';
		document.resForm.submit()	
	}	
	
	handleServedBy = function() {
		if(!htz.homepage.jsflag.isDropDownLocation){	
			if($('#inpPickupIsServedBy').val() == 'Y') {
				window.open(htz.config.rootContext+'/fts/'+htz.config.dialect+'/fullTextSearchHomepageServedByTab.jsp?oag=' + $('#pickupHiddenEOAG').val() + '&locType=pUp','resWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=350,height=400').focus();
				return false;
			}
			if($('#inpDropoffIsServedBy').val() == 'Y') {
				alert(htz.homepage.jscontent.cannotReturn);
				return false;
			}
		}
		return true;
	};
	
	populateLocation  = function (locationList){
		var pickCountry = $("#pickupCountry");
		var pickLocation = $("#pickupLocation");
		var dropLocation = $("#dropoffLocation");
		var pickUpOptions = pickLocation.attr('options');
		var dropOffOptions = dropLocation.attr('options');	
		
		pickCountry.attr("disabled", false);
		pickLocation.empty();
		dropLocation.empty();			
		if(locationList.nvplist.length <= 1){		
			locationList.nvplist[0].name = htz.homepage.jscontent.selectAnotherCountry;
		} else {
			locationList.nvplist[0].name = htz.homepage.jscontent.selectALocation;
		}
		
		for(i=0; i<locationList.nvplist.length; i++){
		    pickUpOptions[pickUpOptions.length] = new Option(locationList.nvplist[i].name, locationList.nvplist[i].value);
		    dropOffOptions[dropOffOptions.length] = new Option(locationList.nvplist[i].name, locationList.nvplist[i].value);
		}		
	};
	
	resetSelections = function (){
		$("#pickupCountry").attr("disabled", false);
		$("#pickupLocation").empty().append($('<option>').text(htz.homepage.jscontent.selectCountry).val(""));
		$("#dropoffLocation").empty().append($('<option>').text(htz.homepage.jscontent.selectCountry).val(""));
	};
	
	validateDropDownLocations = function(){
		var pickupCountry = $("#pickupCountry");
		var pickupLocation = $("#pickupLocation");
		var resCheckBox = $("#oneWayTripCheckBox");
		var dropoffLocation = $("#dropoffLocation");	
		
		if(($.trim(pickupCountry.val())).length == 0 || ($.trim(pickupLocation.val())).length == 0){
			if(($.trim(pickupCountry.val())).length == 0){
				alert(htz.homepage.jscontent.selectCountry);
				pickupCountry.focus();
			} else {
				alert(htz.homepage.jscontent.selectPickupLoc);			
				pickupLocation.focus();
			}
			return false;			
		}
		
		if(resCheckBox.attr("checked")){
			if(($.trim(dropoffLocation.val())).length == 0){
				alert(htz.homepage.jscontent.selectDropoffLoc);
				dropoffLocation.focus();
				return false;
			}
		}
	
		return true;
	};
	 
	handleDropDownSubmit = function(){
		with(document.resForm){ 
			pickupHiddenEOAG.value = pickupLocation.value;
			var index = pickupLocation.selectedIndex;
			pickupLocation.options[index].value = pickupLocation.options[index].text;
			
			if(returnAtDifferentLocationCheckbox.checked){
				dropoffHiddenEOAG.value = dropoffLocation.value;
                var index = dropoffLocation.selectedIndex;
				dropoffLocation.options[index].value = dropoffLocation.options[index].text;
			} else 
				dropoffHiddenEOAG.value = "";
		   
		   continueButton.value = 'continue';
		   submit();
	   }		
	};
 	
	return {
		toggleTabs: function(cN) {
			$('#homeResFormTabs').removeClass().addClass(cN);				
		},
		
		openDandC : function (url,isLoginRequired){
			if(!isLoginRequired)
				window.open(url,'resWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=300,height=425').focus();
			else		
				document.location.href = url;			
		},
		
		setDandCChangedValue : function (id, originalLocationValue, flagValue, element){	
			if(element.value != originalLocationValue)
				$("#"+id).val(flagValue);
		    return true;
		},
		
		showOneWayTrip : function (){
			if($('#oneWayTripCheckBox').attr("checked"))
				$('#rtnLocationSec').show();
			else {
				$('#rtnLocationSec').hide();
				$('#inpDropoffIsServedBy').val('');
				$('#dropoffLocation').val('');
				$('#dropoffHiddenEOAG').val('');
			}
		},
		
		openLinkInPopup : function (url, width, height) {
			if(!width) width = 500;
			if(!height) height = 500;
			window.open(url,'resWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + width + ',height=' + height).focus();
		},
		
		handleFormSubmit : function(){
			
			// pickup and dropoff location
			if(!validateResLocations()) return;
			
			// pickup and dropoff dates
			if(!validateResDates()) return;
			
			//arrival information
			if (!validateArrivalInformation()) return;
			
			//served by information
			if(!handleServedBy()) return;
			 
			// submit form
			if(htz.homepage.jsflag.isDropDownLocation){	
				handleDropDownSubmit();
			} else {
				document.resForm.wasFormSubmitted.value = "true";
				handleFTSSubmit();
			}
		},
		
		toggleAffiliations : function(obj){
			if(obj != null && obj.checked) $('#affiliationsSection').show();
			else $('#affiliationsSection').hide();
		},
		
		toggleCorpDependentFields : function (obj) {
			with(document.resForm){
				if(obj.checked) { 
					$('#RQCVITSection').hide(); 
					
					if(!htz.homepage.jsflag.showPCField)
					    $('#PCSection').hide();
					
					if($.trim(cdpField.value).length > 0 && $('#cdpOptions').size() > 0) {
						corporateRate.checked = true;
						officialTravel.checked = true;
						$('#cdpOptions').show();
					}
					corpCustomer.value = "Y";
				} else {
					$('#RQCVITSection').show(); 
					$('#PCSection').show();
					if($('#cdpOptions').size() > 0){
						$('#cdpOptions').hide();
						corporateRate.checked = false;
						officialTravel.checked = false;
					}
					corpCustomer.value = "N";
				}
			}
		},
		
		showCDPOptions : function (){ 
			with(document.resForm){
				var cdpOption = $('#cdpOptions').size() > 0 ? $('#cdpOptions').get(0) : null;
				if(cdpOption == null) return;
				if($.trim(cdpField.value).length > 0){
					if(typeof corpCustCheckBoxFE != "undefined") {
						if(corpCustCheckBoxFE.checked){
							corporateRate.checked = true;
							officialTravel.checked = true;
							cdpOption.style.display = "block";
						}
					} else {
						cdpOption.style.display = "block";
					}
			    } else {
			    	cdpOption.style.display = "none";
			    	if(typeof corporateRate != "undefined")
						corporateRate.checked = false;
					if(typeof officialTravel != "undefined")
						officialTravel.checked = false;
				}
			}
		},
		
		highlightRow : function (element,trId) {
			if($.trim(element.value).length == 0) {
				$("#"+trId).removeClass('homeValidDisctountCode');
			} else {
				$("#"+trId).addClass('homeValidDisctountCode');
			}
		},
		
		showCdpRqWarning : function (){
			with (document.resForm){
				if(corporateRate.checked)
					if(typeInRateQuote.value != "" && !($('#corpCustCheckBoxFE').size() > 0 && $('#corpCustCheckBoxFE').attr("checked")))
						alert(htz.homepage.jscontent.cdprqError);
			}
		},
		
		arrivalRadioButton : function () {
			$("#arrivalDropDownRadio").attr("checked", true);
		},
		
		determineOverallFormSubmission : function (){
			handleFTSSubmit();
		},
		
		findRes : function (x){
			if(typeof(x)=="object")	{ 
				$("#confirmationNumber").val(x.innerHTML)
				$("#confirmationNumber").css(	{ 'color' : 'white' } ) 
				}
	 		document.resModifyForm.submit();
	 	},		 
		
	 	
	 	handlePickCountrySelection : function(url){
			var pickCountry = $("#pickupCountry");
			if(pickCountry.attr("selectedIndex") > 0){
				pickCountry.attr("disabled", true);
				url+="?countrySelection="+pickCountry.val();
				$("#pickupLocation").empty().append($('<option>').text(htz.homepage.jscontent.loadingText).val(""));
				$.getJSON(url , function (data){ populateLocation(data);});
			} else 
			  resetSelections();
		},
		
		reloadDropoffLocation : function(){
			var pickLocation = $("#pickupLocation");
			var dropLocation = $("#dropoffLocation");	
			
			dropLocation.empty();
			pickLocation = pickLocation[0];
			dropLocation = dropLocation[0]; 
			
			if(pickLocation.value != "" && pickLocation.value != null){
				for(i = 0; i < pickLocation.options.length ; i++){
					if(pickLocation.options[i].value != pickLocation.value){
						dropLocation.options[dropLocation.options.length] = new Option(pickLocation.options[i].text,pickLocation.options[i].value);
					}
				}
				if($("#oneWayTripCheckBox").attr("checked")) dropLocation.focus();		
			} else {
				for(i = 0 ; i < pickLocation.options.length ; i++){
					dropLocation.options[i] = new Option(pickLocation.options[i].text,pickLocation.options[i].value);
				}
			}
		}	
		
	}
})();



     
	  
	
     



                 
   
        
                                                                                 
                                 
	                
	
	  
		
			
				
			
       
                                                                                                                  
/* EOF */                                                                                                                                 
                                                                                                                  
/* EOF */                                                                                                             