var map;var currentMarkerLat;
var currentMarkerLon;
var currentCenterLat;
var currentCenterLon;
var currentZoom;var houseIcon;
var houseSelIcon;var venueIcon;
var eventIcon;var markerOptions;
var pano;var currentMarkers=new Array();
var mapDiv;var mapWidth;
var mapHeight;var mapBgcolor;
var mapLat;var mapLon;
var mapZoom;var mapCenterlat;
var mapCenterlon;var mapAutoCenter=false;
var mapBoundariesLocked=false;
var mapBoundaries;var mapAutoBoundaries;
var panoDiv;var panoWidth;
var panoHeight;var panoLat;
var panoLon;var panoZoom;
var panoPitch;var panoYaw;
var jsInfoMgrLoaded=false;
var jsMarkerMgrLoaded=false;
var markersQueue=new Array();
var suburbProfileMarkers=new Array();
var suburbProfileMarkersWithProperty=false;
function lockBoundaries(lock){mapBoundariesLocked=lock;
}function mapsLoaded(){var script;
if(google.maps.BrowserIsCompatible()){initMap(mapDiv,mapWidth,mapHeight,mapBgcolor,mapLat,mapLon,mapZoom,mapCenterLat,mapCenterLon);
}window.onunload=google.maps.Unload;
for(var i=0;i<markersQueue.length;
i++){if(markersQueue[i].type=="property"){createAndBindPropertyMarker(markersQueue[i].id,markersQueue[i].lat,markersQueue[i].lon,0);
}else{if(markersQueue[i].type=="propertyNoCT"){createAndBindPropertyMarker(markersQueue[i].id,markersQueue[i].lat,markersQueue[i].lon,1);
}else{if(markersQueue[i].type=="agency"){createAndBindAgencyMarker(markersQueue[i].lat,markersQueue[i].lon);
}}}}if(mapAutoCenter){centerMapOnMarkers();
}if(!jsInfoMgrLoaded){script=document.createElement("script");
script.src="/site/inc/js/google/extinfowindow/extinfowindow.js";
script.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(script);
jsInfoMgrLoaded=true;
}if(!jsMarkerMgrLoaded){script=document.createElement("script");
script.src="/site/inc/js/google/markermanager/markermanager.js";
script.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(script);
jsMarkerMgrLoaded=true;
}}function loadMap(div,width,height,bgcolor,lat,lon,zoom,centerLat,centerLon,autoCenter,autoBoundaries){mapDiv=div;
mapWidth=width;mapHeight=height;
mapBgcolor=bgcolor;mapLat=lat;
mapLon=lon;mapZoom=zoom;
mapCenterLat=centerLat;
mapCenterLon=centerLon;
mapAutoCenter=autoCenter;
mapAutoBoundaries=autoBoundaries;
if(mapAutoBoundaries){lockBoundaries(false);
}google.load("maps","2",{callback:mapsLoaded,language:"en_au"});
}function loadPano(div,width,height,lat,lon,zoom,pitch,yaw){panoDiv=div;
panoWidth=width;panoHeight=height;
panoLat=lat;panoLon=lon;
panoZoom=zoom;panoPitch=pitch;
panoYaw=yaw;google.load("maps","2",{callback:panoLoaded,language:"en_au"});
}function panoLoaded(){var script;
if(google.maps.BrowserIsCompatible()){initPano(panoDiv,panoWidth,panoHeight,panoLat,panoLon,panoZoom,panoPitch,panoYaw);
}window.onunload=google.maps.Unload;
if(!jsInfoMgrLoaded){script=document.createElement("script");
script.src="/site/inc/js/google/extinfowindow/extinfowindow.js";
script.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(script);
jsInfoMgrLoaded=true;
}if(!jsMarkerMgrLoaded){script=document.createElement("script");
script.src="/site/inc/js/google/markermanager/markermanager.js";
script.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(script);
jsMarkerMgrLoaded=true;
}}function initMap(div,width,height,bgcolor,lat,lon,zoom,centerLat,centerLon){var marker;
var point;houseIcon=new google.maps.Icon();
houseIcon.image="/site/inc/img/houseIco.png";
houseIcon.iconSize=new google.maps.Size(32,54);
houseIcon.shadowSize=new google.maps.Size(22,20);
houseIcon.iconAnchor=new google.maps.Point(32,54);
houseIcon.infoWindowAnchor=new google.maps.Point(5,1);
houseSelIcon=new google.maps.Icon();
houseSelIcon.image="/site/inc/img/houseSelIco.png";
houseSelIcon.iconSize=new google.maps.Size(32,54);
houseSelIcon.shadowSize=new google.maps.Size(22,20);
houseSelIcon.iconAnchor=new google.maps.Point(32,54);
houseSelIcon.infoWindowAnchor=new google.maps.Point(5,1);
venueIcon=new google.maps.Icon();
venueIcon.image="/site/inc/img/houseIco.png";
venueIcon.iconSize=new google.maps.Size(32,54);
venueIcon.shadowSize=new google.maps.Size(22,20);
venueIcon.iconAnchor=new google.maps.Point(32,54);
venueIcon.infoWindowAnchor=new google.maps.Point(5,1);
eventIcon=new google.maps.Icon();
eventIcon.image="/site/inc/img/houseIco.png";
eventIcon.iconSize=new google.maps.Size(32,54);
eventIcon.shadowSize=new google.maps.Size(22,20);
eventIcon.iconAnchor=new google.maps.Point(32,54);
eventIcon.infoWindowAnchor=new google.maps.Point(5,1);
agencyIcon=new google.maps.Icon();
agencyIcon.image="/site/inc/img/icon_office.png";
agencyIcon.iconSize=new google.maps.Size(32,54);
agencyIcon.shadowSize=new google.maps.Size(22,20);
agencyIcon.iconAnchor=new google.maps.Point(32,54);
agencyIcon.infoWindowAnchor=new google.maps.Point(5,1);
markerOptions={draggable:false,icon:houseIcon};
map=new google.maps.Map2(div,{size:new google.maps.Size(width,height),backgroundColor:bgcolor});
map.setUIToDefault();
currentZoom=zoom;currentCenterLat=centerLat;
currentCenterLon=centerLon;
currentMarkerLat=lat;
currentMarkerLon=lon;
map.setCenter(new google.maps.LatLng(centerLat,centerLon),currentZoom);
point=new google.maps.LatLng(lat,lon);
currentPos=point;map.setMapType(G_NORMAL_MAP);
map.disableScrollWheelZoom();
if(!mapBoundariesLocked){if(mapAutoBoundaries){mapBoundaries=map.getBounds();
lockBoundaries(true);
}}}function setBoundaries(){}function closeExtInfoWindow(){map.closeExtInfoWindow();
return false;}function queuePropertyMarker(propId,lat,lon){markersQueue.push({id:propId,lat:lat,lon:lon,type:"property"});
}function queuePropertyMarkerNoCT(propId,lat,lon){markersQueue.push({id:propId,lat:lat,lon:lon,type:"propertyNoCT"});
}function queueAgencyMarker(lat,lon){markersQueue.push({id:0,lat:lat,lon:lon,type:"agency"});
}function createAndBindAgencyMarker(lat,lon){var marker;
var point;var options;
point=new google.maps.LatLng(lat,lon);
if(mapBoundariesLocked){if(mapBoundaries.containsLatLng(point)==false){return;
}}options={draggable:false,icon:agencyIcon};
marker=new google.maps.Marker(point,options);
google.maps.Event.addListener(marker,"click",function(){marker.openExtInfoWindow(map,"custom_info_window_property","",{beakOffset:1,contentRightOffset:20,contentBottomOffset:7,ajaxUrl:"/site/master.cfm?fuseaction=site-ajax.displayContactUsInfoWindow"});
});currentMarkers.push(marker);
map.addOverlay(marker);
}function createAndBindPropertyMarker(propId,lat,lon,noCT){var marker;
var point;point=new google.maps.LatLng(lat,lon);
if(mapBoundariesLocked){if(mapBoundaries.containsLatLng(point)==false){return;
}}marker=new google.maps.Marker(point,markerOptions);
google.maps.Event.addListener(marker,"click",function(){marker.openExtInfoWindow(map,"custom_info_window_property","",{beakOffset:1,contentRightOffset:20,contentBottomOffset:7,ajaxUrl:"/site/master.cfm?fuseaction=site-ajax.displayPropertyInfoWindow&propId="+propId+"&noCT="+noCT});
});currentMarkers.push(marker);
map.addOverlay(marker);
}function createAndBindSuburbPropertyMarker(propId,lat,lon,noCT){var marker;
var point;point=new google.maps.LatLng(lat,lon);
if(mapBoundariesLocked){if(mapBoundaries.containsLatLng(point)==false){return;
}}options={draggable:false,icon:houseSelIcon};
marker=new google.maps.Marker(point,options);
google.maps.Event.addListener(marker,"click",function(){marker.openExtInfoWindow(map,"custom_info_window_property","",{beakOffset:1,contentRightOffset:20,contentBottomOffset:7,ajaxUrl:"/site/master.cfm?fuseaction=site-ajax.displayPropertyInfoWindow&propId="+propId+"&noCT="+noCT});
});currentMarkers.push(marker);
map.addOverlay(marker);
}function clearAllOverlays(){currentMarkers=new Array();
if(map){map.clearOverlays();
}}function clearAllMarkersQueue(){markersQueue=new Array();
}function createAndBindSuburbProfilePropertyMarker(){for(var i=0;
i<markersQueue.length;
i++){if(markersQueue[i].type=="propertyNoCT"){createAndBindSuburbPropertyMarker(markersQueue[i].id,markersQueue[i].lat,markersQueue[i].lon,1);
}}}function createAndBindSuburbProfileMarker(index,cat,id,lat,lon,type){var marker;
var point;var icon;var options;
point=new google.maps.LatLng(lat,lon);
if(mapBoundariesLocked){if(mapBoundaries.containsLatLng(point)==false){return;
}}if(type=="v"){icon=venueIcon;
icon.image="/site/inc/img/icon_"+cat+"_"+(index+1)+".png";
}else{if(type=="e"){icon=eventIcon;
icon.image="/site/inc/img/icon_"+cat+"_"+(index+1)+".png";
}}options={draggable:false,icon:icon};
marker=new google.maps.Marker(point,options);
google.maps.Event.addListener(marker,"click",function(){marker.openExtInfoWindow(map,"custom_info_window_suburbprofile","",{beakOffset:1,contentRightOffset:15,contentBottomOffset:2,ajaxUrl:" /site/master.cfm?fuseaction=site-ajax.displayTimeoutInfoWindow&id="+id+"&type="+type});
});currentMarkers.push(marker);
map.addOverlay(marker);
}function centerMapOnMarkers(){if(!mapBoundariesLocked){var bounds=new google.maps.LatLngBounds();
for(var i=0;i<currentMarkers.length;
i++){bounds.extend(currentMarkers[i].getPoint());
}var center=bounds.getCenter();
var zoom=map.getBoundsZoomLevel(bounds);
if(zoom>15){zoom=15;}map.setCenter(center,zoom);
mapBoundaries=bounds;
}}function initPano(div,width,height,lat,lon,zoom,pitch,yaw){var panoLatLng=new google.maps.LatLng(lat,lon);
var panoramaOptions={latlng:panoLatLng,pov:{yaw:yaw,pitch:pitch,zoom:zoom}};
pano=new google.maps.StreetviewPanorama(div,panoramaOptions);
google.maps.Event.addListener(pano,"error",handleNoFlash);
google.maps.Event.addListener(pano,"initialized",function(viewLoc){var panoLatLng=viewLoc.latlng;
});}function handleNoFlash(errorCode){if(errorCode==600){alert("Error: Location not found on Google Street View.");
}else{if(errorCode==FLASH_UNAVAILABLE){alert("Error: Flash doesn't appear to be supported by your browser.");
return;}}}function unloadMap(){if(pano){pano.remove();
}try{google.maps.Unload();
}catch(exc){}lockBoundaries(false);
}