
var destinations={handleCityList:{success:function(o){var cityInsiders=o.responseXML.getElementsByTagName('City');var cityDropDown=document.getElementById("cityId");cityDropDown.options.length=1;for(var i=0;i<cityInsiders.length;i++){newCityText=utils.getNodeValue(cityInsiders[i],'CityName');newCityValue=utils.getNodeValue(cityInsiders[i],'CityId');cityDropDown.options[i+1]=new Option(newCityText,newCityValue);}},failure:function(o){return;}},init:function(){effects.initializeExpandableContent("div","h2");effects.initializeExpandableContent("ul","h3");if(document.getElementById("destinations-country")){document.getElementById("destinations-country").onchange=destinations.toggleDropDowns;if(document.getElementById("destinations-country").value=="US"){document.getElementById("state-container").style.display="inline";}
else if(document.getElementById("destinations-country").value!=""){document.getElementById("city-container").style.display="inline";var transactionURL="/search/SearchCityInsider.mi?country="+document.getElementById("destinations-country").value+"&state="+document.getElementById("us-state").value;var transaction=YAHOO.util.Connect.asyncRequest('GET',transactionURL,destinations.handleCityList,null);}}
if(document.getElementById("us-state")){document.getElementById("us-state").onchange=destinations.toggleDropDowns;if(document.getElementById("us-state").value!=""){document.getElementById("city-container").style.display="inline";}}
if(document.getElementById("cityId")){document.getElementById("cityId").onchange=destinations.submitEventForm;}
document.getElementById("stay-header").onclick=destinations.toggleStaySection;document.getElementById("city-insider-search-button").style.display="none";},toggleStaySection:function(){if(document.getElementById("stay-header").className==("expanded")){effects.hideContent.call(document.getElementById("stay-header"));}
else if(document.getElementById("stay-header").className==("collapsed")){effects.showContent.call(document.getElementById("stay-header"));}
document.getElementById("stay-header").onclick=destinations.toggleStaySection;},toggleDropDowns:function(){if(document.getElementById("city-container")){document.getElementById("city-container").style.display="none";}
if(this.id=="us-state"){if(this.value!=""){document.getElementById("city-container").style.display="inline";}}
else if(this.id=="destinations-country"){if(this.value=="US"){document.getElementById("state-container").style.display="inline";}
else{document.getElementById("state-container").style.display="none";document.getElementById("us-state").value="";if(this.value!=""){document.getElementById("city-container").style.display="inline";}}}
var transactionURL="/search/SearchCityInsider.mi?country="+document.getElementById("destinations-country").value+"&state="+document.getElementById("us-state").value;var transaction=YAHOO.util.Connect.asyncRequest('GET',transactionURL,destinations.handleCityList,null);},submitEventForm:function(){if(this.value==""){return false;}
var cityInsiderURL=document.getElementById("city-insider-url").value;window.location.href=cityInsiderURL+"?cityId="+document.getElementById("cityId").value;}}
addLoadEvent(destinations.init);
