var map;function load(){if(GBrowserIsCompatible()){map=new GMap2(document.getElementById("map"));var E=21.281697;var C=-157.831006;var A=getCookie("start_lat");if(A!=null){E=A}var B=getCookie("start_lon");if(B!=null){C=B}var D=15;map.setCenter(new GLatLng(E,C),D);map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.addControl(new GScaleControl());map.enableScrollWheelZoom()}else{alert("You browser is not compatible with google maps")}}load();var DOM=(typeof (document.getElementById)!="undefined");var geo_coder=new GClientGeocoder();function GetObj(A){if(!DOM){return false}return document.getElementById(A)}function SearchByCondoName(){var B=GetObj("condoname_field");var A=B.value.trim().replace("*","").replace("%","");if(A.length<2){alert("Please, enter at least two characters of building name");return }mmc.LoadFromCondoName(A)}function SearchByMls(){var A=GetObj("mls_field");var B=A.value;if(B==""){alert("Please, enter the comma separated MLS values");return }mmc.LoadFromMlsList(B)}function SearchByZipCode(){zip_field=GetObj("zip_field");if(zip_field.value==""){alert("Please, enter the zip code");return }if(!IsInt(zip_field.value)){alert("The zip code can contain only numbers!");zip_field.focus();return }zip_field.disabled=true;geo_coder.getLatLng(zip_field.value,SearchByZipCode_CallBack)}function SearchByZipCode_CallBack(A){zip_field=GetObj("zip_field");zip_field.disabled=false;if(A==null){alert("Sory, but objects by this code does not found!");return }map.clearOverlays();var B=map.getZoom();map.setCenter(A,B);latlon_arr=GetLatLonByObj(A)}function SearchByCity(){city_field=GetObj("city_field");if(city_field.value==""){alert("Please, enter the city");return }city_field.disabled=true;search_str=city_field.value;geo_coder.getLatLng(search_str,SearchByCity_CallBack)}function SearchByCity_CallBack(A){city_field=GetObj("city_field");city_field.disabled=false;if(A==null){alert("Sory, but objects by this city does not found!");return }map.clearOverlays();var B=map.getZoom();map.setCenter(A,B);latlon_arr=GetLatLonByObj(A)}function GetLatLonByObj(A){tmp="a"+A+"b";mylat=tmp.substring(tmp.indexOf("a")+2,tmp.indexOf(","));mylon=tmp.substring(tmp.indexOf(", ")+2,tmp.indexOf(")b"));return new Array(mylat,mylon)};