var homeCountry="AUSTRALIA";var homeState="-SELECT-";window.onload=function(){var D=(getCookie("hotspot_country")||homeCountry);var C=(getCookie("hotspot_state")||homeState);document.getElementById("country").value=D;var A=getStates("select");for(var B=0;B<A.length;B++){setValue(A[B],C)}if(D==homeCountry){getHotspots(D,C)}else{setStateDisplay("none");getHotspots(D)}if(isIPhone()){document.getElementById("gmm").style.display="none"}};function getCookie(A){var C=new String(document.cookie).split(/;( *)/);for(var B=0;B<C.length;B++){if(C[B].substr(0,A.length)==A){return unescape(C[B].substr(A.length+1))}}return null}function setCookie(B,C,A){if(!A){A=new Date();A.setTime(A.getTime()+(30*86400))}document.cookie=B+"="+escape(C)+"; expires="+A.toGMTString()}function getHotspots(F,C){var E;if(window.XMLHttpRequest){E=new XMLHttpRequest()}else{if(window.ActiveXObject){E=new ActiveXObject("Microsoft.XMLHTTP")}}E.onreadystatechange=function(){if(E.readyState==4){document.getElementById("hotspots").innerHTML=E.responseText}};var D=new String(window.location);var A=D.substr(0,D.search("/index.php"));var B=A+"/tomizone/"+F;if(C){B+="-"+C}B+=".html";E.open("GET",B,true);E.send("")}function getStates(D){var A=[];var C=document.getElementsByTagName(D);for(var B=0;B<C.length;B++){if(C[B].className.search("state")!=-1){A.push(C[B])}}return A}function isIPhone(){return(window.navigator.userAgent.search(/i(Pod|Phone)/)!=-1)}function pickCountry(A){var B=A.value;if(B==homeCountry){setStateDisplay("block");getHotspots(B,getStates("select").pop().value)}else{setStateDisplay("none");getHotspots(B)}setCookie("hotspot_country",B)}function pickState(A){var D=A.value;var B=getStates("select");for(var C=0;C<B.length;C++){if(B[C]!=A){setValue(B[C],D)}}getHotspots(homeCountry,D);setCookie("hotspot_state",D)}function setStateDisplay(C){var A=getStates("p");for(var B=0;B<A.length;B++){A[B].style.display=C}}function setValue(A,D){if(window.navigator.userAgent.search("IEMobile")!=-1){var B=A.options;for(var C=0;C<B.length;C++){if(B[C].value==D){B[C].selected=true}}}else{A.value=D}}function showHotspot(B){var A=new String(window.location).replace(/^([^\/]*)\/\/([^\/]*)\/(.*?)\/(.*)$/,"$1//$2/$3/tomizone/kml/"+B+".kml");if(isIPhone()){window.location="maps://maps.google.com/maps?f=q&hl=en&geocode=&q="+escape(A);return false}return true};

