	var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&
					parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
	var isMinIE4 = (document.all) ? 1 : 0;
	var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.")) >= 0 ? 1 : 0;
	var isNav = (navigator.appName.indexOf("Netscape") != -1);
	var isIE = (navigator.appName.indexOf("Microsoft") != -1);

	var allSupport = (document.all!=null);
	var layersSupport = (document.layers!=null);
	
	function setupTimeout(curTimeOut) {
		//window.setTimeout('getUserResponse(curTimeOut)', curTimeOut);
		timerID=window.setTimeout('goToTimeout(curTimeOut)', curTimeOut); //+TimeOutWaitMilliseconds);
	} //setupTimeout()

	function goToTimeout(curTimeOut) {
		var timeoutMsg="Your Online session has timed out."
					+"\n\nThe page is reloading.";
		var sURL;

		if (endsWith(window.location.pathname, 'Default.aspx')) {
			sURL = unescape(window.location.pathname);
		}
		else {
			sURL = unescape(window.location.pathname);
			if (endsWith(window.location.pathname, '/')) {
				sURL += 'Default.aspx';
			}
			else {
				sURL += '/Default.aspx';
			}
		}
		//alert('sURL=' + sURL);
		//alert(timeoutMsg);
		self.status ="Reloading now...";
		//self.status ="sURL=" + sURL;
		//window.location.reload();
		window.location.href = sURL;
		//self.location=timeoutUrl;
		return;
	} //goToTimeout()
	
	function endsWith(sSource, sFind) {
		var bSuccess = false;
		var compareLen = sFind.length;
		
		if (sSource.substr(sSource.length-compareLen, compareLen) == sFind) {
			bSuccess = true
		}
		
		return bSuccess;
	} //endsWith()

	function getUserResponse(curTimeOut) {
		var timeoutWarningMsg="Your Online session is about to be timed out."
							+"\nTo preserve internal state, all sessions end after "+ (curTimeOut+TimeOutWaitMilliseconds)/60000 + " minutes of inactivity!"
							+"\nThe page will reload, and all changes would be lost!"
							+"\nPress 'OK', and then Save your changes.";
		var bConfirmed;

		bConfirmed = false;

		bConfirmed = window.confirm(timeoutWarningMsg);

		if (bConfirmed) {
			window.location.reload();
		}

	} //getUserResponse()

	function clearGoToTimeout() {
		clearTimeout(timerID);

		if(this["UITimeoutMilliseconds"] != null)
		{
			curTimeOut=UITimeoutMilliseconds;
		}
		setupTimeout(curTimeOut);
	} //clearGoToTimeout()

	function onClientSearch(sClientID)
	{
		/*
			public string OnSearchClientCB(
				  string monthyear
				, string destinationText
				, string destinationValue
				, string cruiseLengthCode
				, string sControlStyle
				)
		*/
		try {	
			document.getElementById("imgBtnClientSearch").disabled = true;

			Carnival.Web.Controls.QuickSearch.OnSearchClientCB(
				cboTravelMonth.options[cboTravelMonth.selectedIndex].value
				,cboDestination.options[cboDestination.selectedIndex].text
				,cboDestination.options[cboDestination.selectedIndex].value
				,cboEmbarkationPort.options[cboEmbarkationPort.selectedIndex].text
				,cboEmbarkationPort.options[cboEmbarkationPort.selectedIndex].value
				,cboCruiseLength.options[cboCruiseLength.selectedIndex].value
				,sgControlStyle
				,"Y"
				,"N"
				,cboStateOfResidency.options[cboStateOfResidency.selectedIndex].value
				,SearchClient_callback
				);    
		}
		catch(e)
		{
			window.status =	'SearchClient_callback(): Error: ' + e.number + '; ' + e.description;
		}

	} //onClientSearch()
	
	function SearchClient_callback(response)
	{
		var sURL = "";
		//debugger;
		try {	
			document.getElementById("imgBtnClientSearch").disabled = false;

			//if the server side code threw an exception
			if (response.error != null)
			{    
				sTemp = "SearchClient_callback(): "
								+ "A problem occurred in Carnival.Web.Controls.QuickSearch.OnSearchClientCB()\n"
								+ response.error.Message; //we should probably do better than this
				window.status = sTemp;
				return;
			}  

			sURL = response.value;
			
			window.location.href = sURL;
		}
		catch(e)
		{
			window.status =	'SearchClient_callback(): Error: ' + e.number + '; ' + e.description;
		}

	} //SearchClient_callback()

	function resetCombos(sClientID)
	{
		/*
		var cboTravelMonth = document.getElementById(sClientID+"cboTravelMonth");
		var cboDestination = document.getElementById(sClientID+"cboDestination");
		var cboCruiseLength = document.getElementById(sClientID+"cboCruiseLength");
		var imgTravelMonthLoader = document.getElementById(sClientID+"imgTravelMonthLoader");
		var imgDestinationLoader = document.getElementById(sClientID+"imgDestinationLoader");
		var imgCruiseLengthLoader = document.getElementById(sClientID+"imgCruiseLengthLoader");
		*/
		clearGoToTimeout();

		sSelectedTravelMonth = "";
		sSelectedDestination = "";
		sSelectedEmbarkationPort = "";
		sSelectedCruiseLength = "";
		sSelectedCruiseLengthCode = "";
		/*
		if (cboTravelMonth)
			document.getElementById("imgTravelMonthLoader").style.visibility = "visible";
		if (cboDestination)
			document.getElementById("imgDestinationLoader").style.visibility = "visible";
		if (cboCruiseLength)
			document.getElementById("imgCruiseLengthLoader").style.visibility = "visible";
		*/	
		if (cboTravelMonth)
			imgTravelMonthLoader.style.visibility = "visible";
		if (cboDestination)
			imgDestinationLoader.style.visibility = "visible";
		if (cboCruiseLength)
			imgCruiseLengthLoader.style.visibility = "visible";
		if (cboEmbarkationPort)
			imgEmbarkationPortLoader.style.visibility = "visible";
			
		if (cboTravelMonth)
		{
			cboTravelMonth.options.length = 0; //reset the dropdown     
			cboTravelMonth.options[cboTravelMonth.options.length] = 
							new Option("Loading...", "");
		}
		if (cboDestination)
		{
			cboDestination.options.length = 0; //reset the dropdown     
			cboDestination.options[cboDestination.options.length] = 
							new Option("Loading", "");
		}
		if (cboEmbarkationPort)
		{
			cboEmbarkationPort.options.length = 0; //reset the dropdown     
			cboEmbarkationPort.options[cboEmbarkationPort.options.length] = 
							new Option("Loading", "");
		}
		if (cboCruiseLength)
		{
			cboCruiseLength.options.length = 0; //reset the dropdown     
			cboCruiseLength.options[cboCruiseLength.options.length] = 
							new Option("Loading...", "");
		}
		
		//Added by Debasmit
		if (cboStateOfResidency)
		{
            //	cboStateOfResidency.options.length = 0; //reset the dropdown     
            //	cboStateOfResidency.options[cboStateOfResidency.options.length] = 
            //	new Option("Loading...", "");
            cboStateOfResidency.selectedIndex = 0;
		}   
             
        // Clear the checkBox Options.
        var chkBoxCount= chkOptions.getElementsByTagName("input");
        for(var i=0;i<chkBoxCount.length;i++) 
        {
            chkBoxCount[i].checked = false;
        }
        
        
		if (cboTravelMonth)
			Carnival.Web.Controls.QuickSearch.GetMonthYears("", "", "", "", GetMonthYears_callback);    
		if (cboDestination)
			Carnival.Web.Controls.QuickSearch.GetDestinations("", "", "",GetDestinations_callback);    
		if (cboEmbarkationPort)
			Carnival.Web.Controls.QuickSearch.GetEmbarkPort("", "", "", "",GetEmbarkPort_callback);   
		if (cboCruiseLength)
			Carnival.Web.Controls.QuickSearch.GetDurations("", "", "", "",GetDurations_callback);
			
			if (cboStateOfResidency)
			Carnival.Web.Controls.QuickSearch.GetDurations("", "", "", "",GetDurations_callback);  
			
	} //resetCombos()
	
	function onTravelMonthChange(cboTravelMonth, sClientID) {
		//debugger;
        var strMonthYear = cboTravelMonth.options[cboTravelMonth.selectedIndex].value; 
        //alert(strMonthYear);
        /*
		if (cboDestination)
			document.getElementById("imgDestinationLoader").style.visibility = "visible";
		if (cboCruiseLength)
			document.getElementById("imgCruiseLengthLoader").style.visibility = "visible";
		*/
		if (cboDestination)
			imgDestinationLoader.style.visibility = "visible";
		if (cboCruiseLength)
			imgCruiseLengthLoader.style.visibility = "visible";
		if (cboEmbarkationPort)
			imgEmbarkationPortLoader.style.visiblity = "visible"

		clearGoToTimeout();

		sSelectedTravelMonth = strMonthYear;
		
		if (cboDestination)
		{
			cboDestination.options.length = 0; //reset the dropdown     
			cboDestination.options[cboDestination.options.length] = 
							new Option("Loading", "");
		} //if (cboDestination)
		if (cboEmbarkationPort)
		{
			cboEmbarkationPort.options.length = 0; //reset the dropdown     
			cboEmbarkationPort.options[cboEmbarkationPort.options.length] = 
							new Option("Loading...", ""); //if (cboCruiseLength)
		}
		if (cboCruiseLength)
		{
			cboCruiseLength.options.length = 0; //reset the dropdown     
			cboCruiseLength.options[cboCruiseLength.options.length] = 
							new Option("Loading...", "");
			if (sSelectedDestination.length == 1) {
				Carnival.Web.Controls.QuickSearch.GetDurations(sSelectedDestination, "", sSelectedTravelMonth, sSelectedEmbarkationPort, GetDurations_callback);  
				Carnival.Web.Controls.QuickSearch.GetEmbarkPort(sSelectedDestination, "", sSelectedTravelMonth, sSelectedCruiseLengthCode, GetEmbarkPort_callback);    
				}
			else {
				Carnival.Web.Controls.QuickSearch.GetDurations("", sSelectedDestination, sSelectedTravelMonth, sSelectedEmbarkationPort, GetDurations_callback); 
				Carnival.Web.Controls.QuickSearch.GetEmbarkPort("", sSelectedDestination, sSelectedTravelMonth, sSelectedCruiseLengthCode, GetEmbarkPort_callback);   
			} 
		} //if (cboCruiseLength)

		//window.status =	'onTravelMonthChange(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode;
		
		if (cboDestination)
			Carnival.Web.Controls.QuickSearch.GetDestinations(sSelectedTravelMonth, sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetDestinations_callback); 
		
	} //onTravelMonthChange()
	
	function onDestinationChange(cboDestination, sClientID) {
		//debugger;
        var strDestination = cboDestination.options[cboDestination.selectedIndex].value; 
        //alert(strDestination);
        /*
		if (cboTravelMonth)
			document.getElementById("imgTravelMonthLoader").style.visibility = "visible";
		if (cboCruiseLength)
			document.getElementById("imgCruiseLengthLoader").style.visibility = "visible";
		*/
		if (cboTravelMonth)
			imgTravelMonthLoader.style.visibility = "visible";
		if (cboCruiseLength)
			imgCruiseLengthLoader.style.visibility = "visible";
		if (cboEmbarkationPort)
			imgEmbarkationPortLoader.style.visiblity = "visible"
		clearGoToTimeout();

		sSelectedDestination = strDestination;
		
		//window.status =	'onDestinationChange(): sSelectedDestination='+sSelectedDestination;
		//window.status =	'onDestinationChange(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode;

		if (cboTravelMonth)
		{
			cboTravelMonth.options.length = 0; //reset the dropdown     
			cboTravelMonth.options[cboTravelMonth.options.length] = 
							new Option("Loading...", "");
		} //if (cboTravelMonth)
		if (cboCruiseLength)
		{
			cboCruiseLength.options.length = 0; //reset the dropdown     
			cboCruiseLength.options[cboCruiseLength.options.length] = 
							new Option("Loading...", "");
		}
		if (cboEmbarkationPort)
		{
			cboEmbarkationPort.options.length = 0; //reset the dropdown     
			cboEmbarkationPort.options[cboEmbarkationPort.options.length] = 
							new Option("Loading...", ""); //if (cboCruiseLength)
		}
        if (sSelectedDestination.length == 1) {
			if (cboTravelMonth)
				Carnival.Web.Controls.QuickSearch.GetMonthYears(sSelectedDestination, "", sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetMonthYears_callback);    
			if (cboCruiseLength)
				Carnival.Web.Controls.QuickSearch.GetDurations(sSelectedDestination, "", sSelectedTravelMonth, sSelectedEmbarkationPort, GetDurations_callback);    
			if (cboEmbarkationPort)
				Carnival.Web.Controls.QuickSearch.GetEmbarkPort(sSelectedDestination, "", sSelectedTravelMonth, sSelectedCruiseLengthCode, GetEmbarkPort_callback);    
        }
        else {
			if (cboTravelMonth)
				Carnival.Web.Controls.QuickSearch.GetMonthYears("", sSelectedDestination, sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetMonthYears_callback);    
			if (cboCruiseLength)
				Carnival.Web.Controls.QuickSearch.GetDurations("", sSelectedDestination, sSelectedTravelMonth, sSelectedEmbarkationPort, GetDurations_callback);    
			if (cboEmbarkationPort)
				Carnival.Web.Controls.QuickSearch.GetEmbarkPort("", sSelectedDestination, sSelectedTravelMonth, sSelectedCruiseLengthCode, GetEmbarkPort_callback);
        } 
	} //onDestinationChange()
	
	function onEmbarkationPortChange(cboEmbarkationPort, sClientID) {
		//debugger;
        var strEmbarkPort = cboEmbarkationPort.options[cboEmbarkationPort.selectedIndex].value; 
        //alert(strDestination);
        /*
		if (cboTravelMonth)
			document.getElementById("imgTravelMonthLoader").style.visibility = "visible";
		if (cboCruiseLength)
			document.getElementById("imgCruiseLengthLoader").style.visibility = "visible";
		*/
		if (cboTravelMonth)
			imgTravelMonthLoader.style.visibility = "visible";
		if (cboCruiseLength)
			imgCruiseLengthLoader.style.visibility = "visible";
		if (cboDestination)
			imgDestinationLoader.style.visibility = "visible";
		clearGoToTimeout();

		sSelectedEmbarkationPort = strEmbarkPort;
		
		//window.status =	'onDestinationChange(): sSelectedDestination='+sSelectedDestination;
		//window.status =	'onDestinationChange(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode;

		if (cboTravelMonth)
		{
			cboTravelMonth.options.length = 0; //reset the dropdown     
			cboTravelMonth.options[cboTravelMonth.options.length] = 
							new Option("Loading...", "");
		} //if (cboTravelMonth)
		if (cboCruiseLength)
		{
			cboCruiseLength.options.length = 0; //reset the dropdown     
			cboCruiseLength.options[cboCruiseLength.options.length] = 
							new Option("Loading...", "");
		} //if (cboCruiseLength)
        if (sSelectedDestination.length == 1) {
			if (cboTravelMonth)
				Carnival.Web.Controls.QuickSearch.GetMonthYears(sSelectedDestination, "", sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetMonthYears_callback);    
			if (cboCruiseLength)
				Carnival.Web.Controls.QuickSearch.GetDurations(sSelectedDestination, "", sSelectedTravelMonth, sSelectedEmbarkationPort, GetDurations_callback);    
        }		
        else {
			if (cboTravelMonth)
				Carnival.Web.Controls.QuickSearch.GetMonthYears("", sSelectedDestination, sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetMonthYears_callback);    
			if (cboCruiseLength)
				Carnival.Web.Controls.QuickSearch.GetDurations("", sSelectedDestination, sSelectedTravelMonth, sSelectedEmbarkationPort, GetDurations_callback);    
        } 
        if (cboDestination)
			Carnival.Web.Controls.QuickSearch.GetDestinations(sSelectedTravelMonth, sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetDestinations_callback); 
	}//onEmbarkationPortChange
	function onCruiseLengthChange(onCruiseLengthChange, sClientID) {
		//debugger;
        sSelectedCruiseLengthCode = cboCruiseLength.options[cboCruiseLength.selectedIndex].value; //.value; 
        //alert(strCruiseLength);
        /*
		if (cboTravelMonth)
			document.getElementById("imgTravelMonthLoader").style.visibility = "visible";
		if (cboDestination)
			document.getElementById("imgDestinationLoader").style.visibility = "visible";
        */
		if (cboTravelMonth)
			imgTravelMonthLoader.style.visibility = "visible";
		if (cboDestination)
			imgDestinationLoader.style.visibility = "visible";
		if (cboEmbarkationPort)
			imgEmbarkationPortLoader.style.visiblity = "visible"
		clearGoToTimeout();

		sSelectedCruiseLength = cboCruiseLength.options[cboCruiseLength.selectedIndex].text;

		if (cboTravelMonth)
		{
			cboTravelMonth.options.length = 0; //reset the dropdown     
			cboTravelMonth.options[cboTravelMonth.options.length] = 
							new Option("Loading...", "");
		} //if (cboTravelMonth)
		if (cboDestination)
		{
			cboDestination.options.length = 0; //reset the dropdown     
			cboDestination.options[cboDestination.options.length] = 
							new Option("Loading", "");
		} //if (cboDestination)
		if (cboEmbarkationPort)
		{
			cboEmbarkationPort.options.length = 0; //reset the dropdown     
			cboEmbarkationPort.options[cboEmbarkationPort.options.length] = 
							new Option("Loading...", ""); //if (cboCruiseLength)
		}//if (cboEmbarkationPort)
		
		//window.status =	'onCruiseLengthChange(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode;
		if (cboTravelMonth)
		{
			if (sSelectedDestination.length == 1) {
				Carnival.Web.Controls.QuickSearch.GetMonthYears(sSelectedDestination, "", sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetMonthYears_callback);       
				Carnival.Web.Controls.QuickSearch.GetEmbarkPort(sSelectedDestination, "", sSelectedTravelMonth, sSelectedCruiseLengthCode, GetEmbarkPort_callback);    
			}
			else {
				Carnival.Web.Controls.QuickSearch.GetMonthYears("", sSelectedDestination, sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetMonthYears_callback);    
				Carnival.Web.Controls.QuickSearch.GetEmbarkPort("", sSelectedDestination, sSelectedTravelMonth, sSelectedCruiseLengthCode, GetEmbarkPort_callback);     
			} 
		} //if (cboTravelMonth)

		if (cboDestination)
				Carnival.Web.Controls.QuickSearch.GetDestinations(sSelectedTravelMonth, sSelectedCruiseLengthCode, sSelectedEmbarkationPort, GetDestinations_callback); 

		//window.status =	'onCruiseLengthChange(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode;

	} //onCruiseLengthChange()
	
	function GetMonthYears_callback(response)
	{
		//debugger;
		var sTemp = "";
		//var div = document.getElementById("<%=ClientID%>_"+"divTest");
		
		//document.getElementById(sgClientID+"imgTravelMonthLoader").style.visibility = "hidden";
		imgTravelMonthLoader.style.visibility = "hidden";
		//if the server side code threw an exception
		if (response.error != null)
		{    
			sTemp = "GetMonthYears_callback(): "
							+ "A problem occurred in Carnival.Web.Controls.QuickSearch.GetMonthYears()\n"
							+ response.error.Message; //we should probably do better than this
			window.status = sTemp;
			//div.innerHTML = sTemp;
			return;
		}  
		
		//window.status =	'GetMonthYears_callback(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode;

		//alert('GetMonthYears_callback(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode);

		cboTravelMonth.options.length = 0; //reset the dropdown     
		cboTravelMonth.options[cboTravelMonth.options.length] = 
						new Option("Any Month", "");
		try {	
			var dv = response.value;
			if ((dv != null) && (typeof(dv) == "object")){
				var s = new Array();
				s[s.length] = "";
				for (var i=0; i < dv.Rows.length; i++) {
					//s[s.length] = dv.Rows[i].MonthYear;
					cboTravelMonth.options[cboTravelMonth.options.length] = 
							new Option(dv.Rows[i].MONTHYEAR, dv.Rows[i].MONTHYEAR);       
							//new Option(dv.Rows[i].MonthYear, dv.Rows[i].MonthYear);       
				}
				//div.innerHTML = s.join("<br>");
			}
			else { 
				sTemp = "GetMonthYears_callback(): Error. [3001] " + response.request.responseText; 
				window.status = sTemp;
				//div.innerHTML = sTemp;
			}
		}
		catch(e)
		{
			window.status =	'GetMonthYears_callback(): Error: ' + e.number + '; ' + e.description;
		}
		
		if (sSelectedTravelMonth.length > 0) {
			if (cboTravelMonth)
				setDropDownItem(cboTravelMonth, sSelectedTravelMonth)				
		}
		if (sSelectedDestination.length > 0) {
			if (cboDestination)
				setDropDownItem(cboDestination, sSelectedDestination)				
		}
		
		if (sSelectedEmbarkationPort.length > 0) {
			if (cboEmbarkationPort)
				setDropDownItem(cboEmbarkationPort, sSelectedEmbarkationPort)				
		}
		if (sSelectedCruiseLength.length > 0) {
			if (cboCruiseLength)
				setDropDownItemByText(cboCruiseLength, sSelectedCruiseLength)				
		}
		
	} //GetMonthYears_callback()
	
	function GetDestinations_callback(response)
	{
		//debugger;
		var sTemp = "";
		//var div = document.getElementById("divTest");
		
		//document.getElementById(sgClientID+"imgDestinationLoader").style.visibility = "hidden";
		imgDestinationLoader.style.visibility = "hidden";
		//if the server side code threw an exception
		if (response.error != null)
		{    
			sTemp = "GetDestinations_callback(): "
							+ "A problem occurred in Carnival.Web.Controls.QuickSearch.GetMonthYears()\n"
							+ response.error.Message; //we should probably do better than this
			window.status = sTemp;
			//div.innerHTML = sTemp;
			return;
		}  

		//alert('GetDestinations_callback(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode);

		cboDestination.options.length = 0; //reset the dropdown     
		cboDestination.options[cboDestination.options.length] = 
						new Option("Any Destination", "");
		try {	
			var dv = response.value;
			if ((dv != null) && (typeof(dv) == "object")){
				var s = new Array();
				s[s.length] = "";
				for (var i=0; i < dv.Rows.length; i++) {
					//s[s.length] = dv.Rows[i].REGION_NAME;
					cboDestination.options[cboDestination.options.length] = 
							new Option(dv.Rows[i].REGION_NAME, dv.Rows[i].REGION_CODE);       
				}
				//div.innerHTML = s.join("<br>");
			}
			else { 
				sTemp = "GetDestinations_callback(): Error. [3001] " + response.request.responseText; 
				window.status = sTemp;
				//div.innerHTML = sTemp;
			}
		}
		catch(e)
		{
			window.status =	'GetDestinations_callback(): Error: ' + e.number + '; ' + e.description;
		}
		
		//debugger;
		
		//window.status =	'GetDestinations_callback(): sSelectedDestination=' + sSelectedDestination;

		if (sSelectedTravelMonth.length > 0) {
			if (cboTravelMonth)
				setDropDownItem(cboTravelMonth, sSelectedTravelMonth)				
		}
		if (sSelectedDestination.length > 0) {
			if (cboDestination)
				setDropDownItem(cboDestination, sSelectedDestination)				
		}
		if (sSelectedEmbarkationPort.length > 0) {
			if (cboEmbarkationPort)
				setDropDownItem(cboEmbarkationPort, sSelectedEmbarkationPort)				
		}
		if (sSelectedCruiseLength.length > 0) {
			if (cboCruiseLength)
				setDropDownItemByText(cboCruiseLength, sSelectedCruiseLength)				
		}
		
	} //GetDestinations_callback()
	
	function GetEmbarkPort_callback(response)
	{
		//debugger;
		var sTemp = "";
		//var div = document.getElementById("divTest");
		
		//document.getElementById(sgClientID+"imgDestinationLoader").style.visibility = "hidden";
		imgEmbarkationPortLoader.style.visibility = "hidden";
		//if the server side code threw an exception
		if (response.error != null)
		{    
			sTemp = "GetEmbarkPort_callback(): "
							+ "A problem occurred in Carnival.Web.Controls.QuickSearch.GetEmbarkPort()\n"
							+ response.error.Message; //we should probably do better than this
			window.status = sTemp;
			//div.innerHTML = sTemp;
			return;
		}  

		//alert('GetDestinations_callback(): sSelectedCruiseLengthCode='+sSelectedCruiseLengthCode);

		cboEmbarkationPort.options.length = 0; //reset the dropdown     
		cboEmbarkationPort.options[cboEmbarkationPort.options.length] = 
						new Option("Any Departure Port", "");
		try {	
			var dv = response.value;
			if ((dv != null) && (typeof(dv) == "object")){
				var s = new Array();
				s[s.length] = "";
				for (var i=0; i < dv.Rows.length; i++) {
					//s[s.length] = dv.Rows[i].REGION_NAME;
					cboEmbarkationPort.options[cboEmbarkationPort.options.length] = 
							new Option(dv.Rows[i].PORT_NAME, dv.Rows[i].PORT_CODE);       
				}
				//div.innerHTML = s.join("<br>");
			}
			else { 
				sTemp = "GetEmbarkPort_callback(): Error. [3001] " + response.request.responseText; 
				window.status = sTemp;
				//div.innerHTML = sTemp;
			}
		}
		catch(e)
		{
			window.status =	'GetEmbarkPort_callback(): Error: ' + e.number + '; ' + e.description;
		}
		
		//debugger;
		
		//window.status =	'GetDestinations_callback(): sSelectedDestination=' + sSelectedDestination;

		if (sSelectedTravelMonth.length > 0) {
			if (cboTravelMonth)
				setDropDownItem(cboTravelMonth, sSelectedTravelMonth)				
		}
		if (sSelectedDestination.length > 0) {
			if (cboDestination)
				setDropDownItem(cboDestination, sSelectedDestination)				
		}
		if (sSelectedEmbarkationPort.length > 0) {
			if (cboEmbarkationPort)
				setDropDownItem(cboEmbarkationPort, sSelectedEmbarkationPort)				
		}
		if (sSelectedCruiseLength.length > 0) {
			if (cboCruiseLength)
				setDropDownItemByText(cboCruiseLength, sSelectedCruiseLength)				
		}
		
	}
	
	
	function GetDurations_callback(response)
	{
		//debugger;
		var sTemp = "";
		//var div = document.getElementById("<%=ClientID%>_"+"divTest");
		
		//if the server side code threw an exception
		//document.getElementById(sgClientID+"imgCruiseLengthLoader").style.visibility = "hidden";
		imgCruiseLengthLoader.style.visibility = "hidden";
		if (response.error != null)
		{    
			sTemp = "GetDurations_callback(): "
							+ "A problem occurred in Carnival.Web.Controls.QuickSearch.GetDurations()\n"
							+ response.error.Message; //we should probably do better than this
			window.status = sTemp;
			//div.innerHTML = sTemp;
			return;
		}  

		cboCruiseLength.options.length = 0; //reset the dropdown     
		cboCruiseLength.options[cboCruiseLength.options.length] = 
						new Option("Any Cruise Length", "");
		try
		{
			var dv = response.value;
			if ((dv != null) && (typeof(dv) == "object")){
				var s = new Array();
				s[s.length] = "";
				for (var i=0; i < dv.Rows.length; i++) {
					//s[s.length] = dv.Rows[i].DurationRange;
					/*
					cboCruiseLength.options[cboCruiseLength.options.length] = 
							new Option(dv.Rows[i].DurationRange, dv.Rows[i].DurationDays);       
					*/
					cboCruiseLength.options[cboCruiseLength.options.length] = 
							new Option(dv.Rows[i].NAME, dv.Rows[i].CODE);       
				}
				//div.innerHTML = s.join("<br>");
			}
			else { 
				sTemp = "GetDurations_callback(): Error. [3001] " + response.request.responseText; 
				window.status = sTemp;
				//div.innerHTML = sTemp;
			}
		}
		catch(e)
		{
			window.status =	'GetDestinations_callback(): Error: ' + e.number + '; ' + e.description;
		}
		//debugger;
		if (sSelectedTravelMonth.length > 0) {
			if (cboTravelMonth)
				setDropDownItem(cboTravelMonth, sSelectedTravelMonth)				
		}
		if (sSelectedDestination.length > 0) {
			if (cboDestination)
				setDropDownItem(cboDestination, sSelectedDestination)				
		}
		if (sSelectedEmbarkationPort.length > 0) {
			if (cboEmbarkationPort)
				setDropDownItem(cboEmbarkationPort, sSelectedEmbarkationPort)				
		}
		if (sSelectedCruiseLength.length > 0) {
			if (cboCruiseLength)
				setDropDownItemByText(cboCruiseLength, sSelectedCruiseLength)				
		}
		
	} //GetDurations_callback()
	
	function setDropDownItem(drp, sSearch) {
		var bFound = false;
		
		for (var i=0; i < drp.options.length; i++)
		{
			if (sSearch.toUpperCase() == drp.options[i].value.toUpperCase()) //.substr(0, sSearch.length).toUpperCase())
			{
				bFound = true;
				break;
			}
		}

		if (bFound)
		{
			drp.selectedIndex = i;
		}
		else
		{
			//alert("No item found beginning with " + sSearch +"!");
		}

		return bFound;

	} //setDropDownItem()
	
	function setDropDownItemByText(drp, sSearch) {
		var bFound = false;
		
		for (var i=0; i < drp.options.length; i++)
		{
			if (sSearch.toUpperCase() == drp.options[i].text.toUpperCase()) //.substr(0, sSearch.length).toUpperCase())
			{
				bFound = true;
				break;
			}
		}

		if (bFound)
		{
			drp.selectedIndex = i;
		}
		else
		{
			//alert("No item found beginning with " + sSearch +"!");
		}

		return bFound;

	} //setDropDownItemByText()
