var g_aItlCountryDivs=[];var g_strCurrentCountry="";var g_strProvinceValue;var g_strProvinceStyle;function showNewProvinceList(B,A){countryObj=document.getElementById("countryid");if(countryObj){showProvinceList(countryObj.options[countryObj.selectedIndex].value,B,A)}}function showProvinceList(strCountry,strTitle,strProvinceValue){if(strProvinceValue===undefined){g_strProvinceValue="";g_strProvinceStyle=' style="width:75%;" '}else{g_strProvinceValue=strProvinceValue;g_strProvinceStyle=' style="border: 0px none white; width: 95%; padding: 0; " '
}if(strCountry==""){document.getElementById("div_provincelist").innerHTML=""}else{g_CyberAjaxQueue.schedule("getprovincelist","/search/worldwide/getprovincelist.jsp?country="+strCountry,function(o){var o=o;var JSON=o.responseText.replace(/\n/g,"");var ob=eval("("+JSON+")");var ret="";ret+='<div class="provincelistcontainer" '+g_strProvinceStyle+" >"+strTitle;ret+='<select name="province" id="provinceid"  >';for(i=0;i<ob.results.length;i++){var strProvince=ob.results[i];var selectedOpt="";if(strProvince=="All Provinces"){strProvince=""
}if(strProvince==g_strProvinceValue){selectedOpt=" selected "}ret+="<option "+selectedOpt+" value='"+strProvince+"' >"+ob.results[i]+"</option>"}ret+="</select></div>";if(el=document.getElementById("div_provincelist")){el.innerHTML=ret}},function(o){alert("There was a transmission error while trying to retrieve the list of provinces for the country you selected.")},true,true,null)}}function setProvidenceIdx(){document.getElementById("pidx").value=document.getElementById("provinceid").selectedIndex}function showProvinceList_ele(strCountry,strTitle){if(strCountry==""){document.getElementById("div_provincelist").innerHTML=""
}else{g_CyberAjaxQueue.schedule("getprovincelist","/search/worldwide/getprovincelist.jsp?country="+strCountry,function(o){var o=o;var JSON=o.responseText.replace(/\n/g,"");var ob=eval("("+JSON+")");var ret="";var topele=document.getElementById("div_provincelist");while(topele.hasChildNodes()){topele.removeChild(topele.firstChild)}var pidx=document.getElementById("pidx");var px=0;if(pidx.value>-1){px=pidx.value}var container=document.createElement("div");container.className="provincelistcontainer";var selectElement=document.createElement("select");
selectElement.setAttribute("id","provinceid");selectElement.style.width="75%";selectElement.onchange=function(){setProvidenceIdx()};for(i=0;i<ob.results.length;i++){var strProvince=ob.results[i];if(strProvince=="All Provinces"){strProvince=""}var optionElement=document.createElement("option");theText=document.createTextNode(ob.results[i]);optionElement.appendChild(theText);optionElement.setAttribute("value",strProvince);if(i==px){optionElement.selected=true}selectElement.appendChild(optionElement)}if(el=document.getElementById("div_provincelist")){container.appendChild(selectElement);
el.appendChild(container)}},function(o){alert("There was a transmission error while trying to retrieve the list of provinces for the country you selected.")},true,true,null)}}function setDivDisplayOnOff_ele(B,F){document.getElementById(B).style.display="block";document.getElementById(F).style.display="none";var H=document.getElementById("countryid");var D=-1;var G=-1;var A=document.getElementById("cidx");var E=document.getElementById("pidx");if(A){D=A.value}if(E){G=E.value}if(B="form_international"){if(D>-1){H[D].selected=true;
var C=H[D].value;showProvinceList_ele(C,"")}}}function addLoadEvent(A){var B=window.onload;if(typeof window.onload!="function"){window.onload=A}else{window.onload=function(){if(B){B()}A()}}}function syncBrowserBackButton(){var G=document.getElementById("countryid");var H=document.getElementsByName("searchcategory");var B=0;var D=-1;var F=-1;var A=document.getElementById("cidx");var E=document.getElementById("pidx");if(A){D=A.value}if(E){F=E.value}for(i=0;i<H.length;i++){if(H[i].checked==true){B=i;break}}if(B==1){setDivDisplayOnOff_ele("form_international","form_us");
if(D>-1){G[D].selected=true;var C=G[D].value;showProvinceList_ele(C,"")}}};