
var loc;rwMaps=function(){}
rwMaps.config={init:'default',lat:-29.382,lng:139.218,zoom:3,streetZoom:13,mode:'suburb',searchCriteria:'',baseURL:'',dataURL:'/wp-content/plugins/rwMaps/data/index.php?',overlayControl:true,loadFilter:false,loadLocalSearch:false,loadImageOverlay:false,loadCountryOverlay:false,localSearchTerms:['transit train'],localSearchAccuracy:1,delay:150}
rwMaps.status={currentMarker:'',infoWindowStatus:false,mapImageOverlay:false,cookie:'',bounds:''}
rwMaps.latlonglocations={};rwMaps.gmarkers={};rwMaps.lsmarkers={};rwMaps.markerCluster=null;rwMaps.markerClusterMarkers=[];rwMaps.filter='';rwMaps.locations={country:{},states:{},regions:{},suburbs:{}}
rwMaps.polylines={act:{},nsw:{},nt:{},ot:{},qld:{},sa:{},tas:{},vic:{},wa:{}};rwMaps.cachedURL={};jQuery.extend(rwMaps.prototype,{init:function(){window.onunload=function(){rwMaps={};GUnload();};if(rwMaps.config.init=='default'){rwMaps.config.loadLocalSearch=false;rwMaps.prototype.load();}else{if(rwMaps.config.loadLocalSearch){google.load("maps","2",{"callback":function(){google.load("search","1",{"callback":rwMaps.prototype.load})}});}else{google.load("maps","2",{"callback":this.load});}}},load:function(){if(MarkerClusterer){loadClusterMarker();}
rwMaps.status.cookie=new rwMaps.cookie();map=new google.maps.Map2(document.getElementById("rwmap"));if(rwMaps.status.cookie.getCookie("MapStatus")==""){jQuery('#rwmap').css({'background-image':'url('+rwMaps.config.baseURL+'images/map-loader.gif'+')','background-repeat':'no-repeat','background-attachment':'fixed','background-position':'center'});}
var mapTypeControl=new GMapTypeControl();var topRight=new GControlPosition(G_ANCHOR_TOP_RIGHT,new GSize(1,1));map.addControl(mapTypeControl,topRight);var mapZoomControl=new GLargeMapControl3D();var topLeft=new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(-4,-2));map.addControl(mapZoomControl,topLeft);map.addMapType(G_PHYSICAL_MAP);map.getMapTypes()[0].getMinimumResolution=function(){return 3;}
map.disableScrollWheelZoom();rwMaps.customise.prototype.init();map.addControl(new rwMaps.prototype.MapHoverStatus());jQuery('#mapStatusDiv').html('');map.addControl(new rwMaps.prototype.MapCenterMessage());jQuery('#mapCenterMessageDiv').html('');jQuery('#mapCenterMessageDiv').hide();if(rwMaps.config.overlayControl){var overlayControl=new GOverviewMapControl();map.addControl(overlayControl);}
switch(rwMaps.config.mode){case'suburb':var controller=new rwMaps.controllerSuburb();break;case'property':var controller=new rwMaps.controllerProperty();break;case'results':var controller=new rwMaps.controllerResults();break;default:}}});rwMaps.cookie=function(url){this.init(url)};jQuery.extend(rwMaps.cookie.prototype,{init:function(url){this.cookieName="MapStatus";this.defaultCenter=true;this.url=url;},save:function(url){var mapzoom=map.getZoom();var mapcenter=map.getCenter();var maplat=mapcenter.lat();var maplng=mapcenter.lng();var cookiestring=maplat+"_"+maplng+"_"+mapzoom;cookiestring+="_"+url;var exp=new Date();exp.setTime(exp.getTime()+(1000*60*60*24*30));this.setCookie(this.cookieName,cookiestring,exp);},load:function(url){var loadedstring=this.getCookie(this.cookieName);var splitstr=loadedstring.split("_");if(splitstr[3]==url){map.setCenter(new GLatLng(parseFloat(splitstr[0]),parseFloat(splitstr[1])),parseFloat(splitstr[2]));}else if(this.defaultCenter){}},setCookie:function(name,value,expires){document.cookie=name+"="+escape(value)+"; path=/"+((expires==null)?"":"; expires="+expires.toGMTString());},getCookie:function(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start=c_start+c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}
return"";}});rwMaps.interact=function(){};jQuery.extend(rwMaps.interact.prototype,{myclick:function(i){GEvent.trigger(rwMaps.gmarkers[i].marker,"click");},highlight:function(i){if(rwMaps.gmarkers[i].marker.isHidden()==false){rwMaps.gmarkers[i].marker.setImage(rwMaps.gmarkers[i].imageOn);rwMaps.gmarkers[i].marker.openToolTip(rwMaps.gmarkers[i].tooltipText);}},highlightreset:function(i){if(rwMaps.gmarkers[i].marker.isHidden()==false){rwMaps.gmarkers[i].marker.setImage(rwMaps.gmarkers[i].imageOff);rwMaps.gmarkers[i].marker.closeToolTip();}},loadSuburb:function(){var controller=new rwMaps.controllerSuburb();},getGeocoder:function(id){var geo=new GClientGeocoder();var address=rwMaps.gmarkers[id].property.details.address+","
+rwMaps.gmarkers[id].property.details.suburb+","
+rwMaps.gmarkers[id].property.details.state+","
+rwMaps.gmarkers[id].property.details.postcode+",AUSTRALIA";geo.getLocations(address,function(result){if(result.Status.code==G_GEO_SUCCESS){var p=result.Placemark[0].Point.coordinates;var lat=p[1];var lng=p[0];rwMaps.gmarkers[id].property.geometry.Point.coordinates[1]=lat;rwMaps.gmarkers[id].property.geometry.Point.coordinates[0]=lng;rwMaps.gmarkers[id].marker.setLatLng(new GLatLng(lat,lng));rwMaps.gmarkers[id].marker.show();if(map.getZoom()==rwMaps.config.zoom){map.setCenter(new GLatLng(lat,lng),rwMaps.config.streetZoom);}}else{if(result.Status.code=="620"&&console){}
try{if(rwMaps.config.mode=="property"){jQuery('#rwmap').hide();try{if(jQuery("#propertyResultList").find('h2')[1].innerHTML=="Property location map"){jQuery("#propertyResultList").find('h2')[1].innerHTML="";}}catch(e){}}else{if(jQuery("#p"+id).find('p')[2].innerHTML=="Click to view on Map"){jQuery("#p"+id).find('p')[2].innerHTML="";}}}catch(e){}}}.bind(this));}});rwMaps.customise=function(){this.init()};jQuery.extend(rwMaps.customise.prototype,{init:function(){this.createMapEvents();this.createToolTip();this.createInfoWindow();this.createMapHoverStatus();this.createMapCenterMessage();this.print();},createMapEvents:function(){GEvent.addListener(map,"zoomend",function(){if(rwMaps.status.currentMarker!=''){rwMaps.status.currentMarker.closeRWInfoWindow();}});},createToolTip:function(){ToolTip=function(marker,html,width){this.html_=html;this.width_=(width?width+'px':'auto');this.marker_=marker;}
ToolTip.prototype=new GOverlay();ToolTip.prototype.initialize=function(map){var div=document.createElement("div");div.style.display='none';map.getPane(G_MAP_FLOAT_PANE-1).appendChild(div);this.map_=map;this.container_=div;}
ToolTip.prototype.remove=function(){this.container_.parentNode.removeChild(this.container_);}
ToolTip.prototype.copy=function(){return new ToolTip(this.html_);}
ToolTip.prototype.redraw=function(force){if(!force)return;var pixelLocation=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.innerHTML=this.html_;jQuery(this.container_).addClass('mTooltip');this.container_.style.position='absolute';this.container_.style.left=pixelLocation.x+"px";this.container_.style.top=((pixelLocation.y-this.marker_.getIcon().iconSize.height)-parseInt(this.marker_.getIcon().iconSize.height/2))+"px";this.container_.style.width=this.width_;this.container_.style.whiteSpace='nowrap';if(this.width_!='auto')this.container_.style.overflow='hidden';this.container_.style.display='block';}
GMarker.prototype.ToolTipInstance=null;GMarker.prototype.openToolTip=function(content){if(this.ToolTipInstance==null){this.ToolTipInstance=new ToolTip(this,content)
map.addOverlay(this.ToolTipInstance);}}
GMarker.prototype.closeToolTip=function(){if(this.ToolTipInstance!=null){map.removeOverlay(this.ToolTipInstance);this.ToolTipInstance=null;}}},createInfoWindow:function(){RWInfoWindow=function(marker,html,width){this.html_=html;this.width_=(width?width+'px':'auto');this.marker_=marker;}
RWInfoWindow.prototype=new GOverlay();RWInfoWindow.prototype.initialize=function(map){this.map_=map;var container=document.createElement("div");container.style.display='none';map.getPane(G_MAP_FLOAT_PANE).appendChild(container);this.container_=container;var shadowContainer=document.createElement("div");shadowContainer.style.display='none';map.getPane(G_MAP_FLOAT_SHADOW_PANE).appendChild(shadowContainer);this.shadowContainer_=shadowContainer;}
RWInfoWindow.prototype.remove=function(){this.container_.parentNode.removeChild(this.container_);this.shadowContainer_.parentNode.removeChild(this.shadowContainer_);}
RWInfoWindow.prototype.copy=function(){return new RWInfoWindow(this.marker_,this.html_,this.width_);}
RWInfoWindow.prototype.redraw=function(force){if(!force)return;var content=document.createElement("div");content.innerHTML=this.html_;content.style.font='10px verdana';content.style.margin='0';content.style.padding='0';content.style.border='0';if(!this.width_||this.width_=='auto'||this.width_<=0){content.style.minWidth='10px';content.style.maxWidth='330px';content.style.width='auto';}else{content.style.width=width+'px';}
content.style.visibility='hidden';this.map_.getContainer().appendChild(content);var contentWidth=content.offsetWidth;var contentHeight=content.offsetHeight;content.parentNode.removeChild(content);content.style.visibility='visible';content.style.width=contentWidth+'px';content.style.height=contentHeight+'px';content.style.position='absolute';content.style.left='5px';content.style.top='7px';var wrapper=document.createElement("div");wrapper.id="mWrapper";wrapper.appendChild(content);var wrapperParts={tl:{l:0,t:0,w:5,h:7,image:rwMaps.config.baseURL+'images/0.png'},t:{l:15,t:0,w:(contentWidth-10),h:7,image:rwMaps.config.baseURL+'images/70.png'},tr:{l:(contentWidth+5),t:0,w:5,h:7,image:rwMaps.config.baseURL+'images/70.png'},l:{l:0,t:7,w:5,h:contentHeight,image:rwMaps.config.baseURL+'images/0.png'},r:{l:(contentWidth+5),t:7,w:5,h:(contentHeight-10),image:rwMaps.config.baseURL+'images/70.png'},bl:{l:0,t:(contentHeight+7),w:5,h:5,image:rwMaps.config.baseURL+'images/0.png'},p:{l:((contentWidth/2)-0),t:(contentHeight+6),w:23,h:19,image:rwMaps.config.baseURL+'images/windowArrow.png'},b:{l:5,t:(contentHeight+7),w:(contentWidth),h:5,image:rwMaps.config.baseURL+'images/0.png'},br:{l:(contentWidth+5),t:(contentHeight+7),w:5,h:5,image:rwMaps.config.baseURL+'images/0.png'}}
for(i in wrapperParts){var img=document.createElement('img');img.src=rwMaps.config.baseURL+'images/littleWindow/'+i+'.png';if(wrapperParts[i].image){img.src=wrapperParts[i].image;}else{img.src=rwMaps.config.baseURL+'images/littleWindow/'+i+'.png';}
img.style.position='absolute';img.style.top=wrapperParts[i].t+'px';img.style.left=wrapperParts[i].l+'px';img.style.width=wrapperParts[i].w+'px';img.style.height=wrapperParts[i].h+'px';wrapper.appendChild(img);wrapperParts[i].img=img;}
var marker=this.marker_;var pixelLocation=this.map_.fromLatLngToDivPixel(this.marker_.getPoint());this.container_.style.position='absolute';this.container_.style.left=((pixelLocation.x-(contentWidth/2)-(wrapperParts['p'].w/2))-3)+"px";this.container_.style.top=((pixelLocation.y-contentHeight-25-(this.marker_.getIcon().iconSize.height))+5)+"px";this.container_.style.border='0';this.container_.style.margin='0';this.container_.style.padding='0';this.container_.style.display='block';this.container_.appendChild(wrapper);var mapNE=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getNorthEast());var mapSW=this.map_.fromLatLngToDivPixel(this.map_.getBounds().getSouthWest());var panX=0;var panY=0;if(this.container_.offsetTop<mapNE.y){panY=(mapNE.y-this.container_.offsetTop);panY+=30;}
if((this.container_.offsetTop+contentHeight)>mapSW.y){panY=(mapSW.y-(this.container_.offsetTop+contentHeight))-50;}
if(this.container_.offsetLeft+contentWidth+10>mapNE.x){panX=(this.container_.offsetLeft+contentWidth+10)-mapNE.x;panX=(panX*-1)-10;}
if(this.container_.offsetLeft<mapSW.x){panX=(mapSW.x-this.container_.offsetLeft)+40;}
if(panX!=0||panY!=0){this.map_.panBy(new GSize(panX,panY));}}
GMarker.prototype.RWInfoWindowInstance=null;GMarker.prototype.openRWInfoWindow=function(content,width){if(this.RWInfoWindowInstance==null){this.RWInfoWindowInstance=new RWInfoWindow(this,content,width);map.addOverlay(this.RWInfoWindowInstance);rwMaps.status.infoWindowStatus=true;}}
GMarker.prototype.closeRWInfoWindow=function(){if(this.RWInfoWindowInstance!=null){map.removeOverlay(this.RWInfoWindowInstance);rwMaps.status.infoWindowStatus=false;this.RWInfoWindowInstance=null;}}},createMapHoverStatus:function(){rwMaps.prototype.MapHoverStatus=function(){};rwMaps.prototype.MapHoverStatus.prototype=new GControl();rwMaps.prototype.MapHoverStatus.prototype.initialize=function(map){var container=document.createElement("div");var mapStatusDiv=document.createElement("div");mapStatusDiv.id="mapStatusDiv";this.setButtonStyle_(mapStatusDiv);container.appendChild(mapStatusDiv);map.getContainer().appendChild(container);return container;}
rwMaps.prototype.MapHoverStatus.prototype.getDefaultPosition=function(){return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(70,0));}
rwMaps.prototype.MapHoverStatus.prototype.setButtonStyle_=function(button){button.style.padding="2px";button.style.marginBottom="3px";button.style.textAlign="center";button.style.width="230px";}},createMapCenterMessage:function(){rwMaps.prototype.MapCenterMessage=function(){};rwMaps.prototype.MapCenterMessage.prototype=new GControl();rwMaps.prototype.MapCenterMessage.prototype.initialize=function(map){var container=document.createElement("div");var mapCenterMessage=document.createElement("div");mapCenterMessage.id="mapCenterMessageDiv";this.setButtonStyle_(mapCenterMessage);container.appendChild(mapCenterMessage);map.getContainer().appendChild(container);return container;}
rwMaps.prototype.MapCenterMessage.prototype.getDefaultPosition=function(){var left=parseInt((jQuery('#rwmap').width()-130)/2);var down=parseInt((jQuery('#rwmap').height()-8)/2);return new GControlPosition(G_ANCHOR_TOP_LEFT,new GSize(left,down));}
rwMaps.prototype.MapCenterMessage.prototype.setButtonStyle_=function(button){button.style.font="small Arial";button.style.padding="0px";button.style.margin="0px";}},print:function(){if(!window.onresize){window.onresize=function(){if(map){map.checkResize();}}}}});rwMaps.markerIcons=function(property,html,tooltipText){this.init(property,html,tooltipText)};jQuery.extend(rwMaps.markerIcons.prototype,{init:function(property,html,tooltipText){this.property=property;this.html=html;this.tooltipText=tooltipText;this.id=this.property.details.id;var showMarker=true;if(this.property.geometry.Point.coordinates[1]==0&&this.property.geometry.Point.coordinates[0]==0){if(this.property.details.address!=""){this.getGeocoder();}else{if(rwMaps.config.mode=="property"){jQuery('#rwmap').hide();try{if(jQuery("#propertyResultList").find('h2')[1].innerHTML=="Property location map"){jQuery("#propertyResultList").find('h2')[1].innerHTML="";}}catch(e){}}
showMarker=false;}}
if(showMarker){this.displayMarker();}},displayMarker:function(){var point=new GLatLng(this.property.geometry.Point.coordinates[1],this.property.geometry.Point.coordinates[0]);var latlngHash=(point.lat().toFixed(6)+""+point.lng().toFixed(6));latlngHash=latlngHash.replace(".","").replace(".","").replace("-","");if(rwMaps.latlonglocations[latlngHash]==null){rwMaps.latlonglocations[latlngHash]={};rwMaps.latlonglocations[latlngHash]['total']=1;rwMaps.latlonglocations[latlngHash]['type']={};rwMaps.latlonglocations[latlngHash]['type'][this.property.details.type]=1;}else{rwMaps.latlonglocations[latlngHash].total++;if(rwMaps.latlonglocations[latlngHash]['type'][this.property.details.type]){rwMaps.latlonglocations[latlngHash]['type'][this.property.details.type]++;}else{rwMaps.latlonglocations[latlngHash]['type'][this.property.details.type]=1;}}
var marker=new GMarker(point,this.createMarker(this.property.details.type));rwMaps.gmarkers[this.property.details.id]={'id':this.property.details.id,'latlngHash':latlngHash,'type':this.property.details.type,'marker':marker,'tooltipText':this.tooltipText,'html':this.html,'imageOn':this._imageOn,'imageOff':this._imageOff,'imageCluster':this._imageCluster,'imageClusterOn':this._imageClusterOn,'imageLogo':this._imageLogo,'property':this.property};map.addOverlay(rwMaps.gmarkers[this.property.details.id].marker);rwMaps.gmarkers[this.property.details.id]['events']=this.addMarkerEvents(rwMaps.gmarkers[this.property.details.id]);for(var ele in rwMaps.gmarkers){if(ele!=this.property.details.id&&latlngHash==rwMaps.gmarkers[ele].latlngHash){var count=rwMaps.latlonglocations[latlngHash].total;count=(count>9)?"9plus":count;var cluserImage=rwMaps.gmarkers[this.property.details.id].imageCluster+count+'.png';var cluserImageOn=rwMaps.gmarkers[this.property.details.id].imageClusterOn+count+'.png';if(Object.size(rwMaps.latlonglocations[latlngHash]['type'])>1){cluserImage=rwMaps.config.baseURL+'images/_c'+count+'.png';cluserImageOn=rwMaps.config.baseURL+'images/_on_c'+count+'.png';}
rwMaps.gmarkers[ele].marker.setImage(cluserImage);rwMaps.gmarkers[this.property.details.id].marker.setImage(cluserImage);rwMaps.gmarkers[ele].imageOff=cluserImage;rwMaps.gmarkers[this.property.details.id].imageOff=cluserImage;rwMaps.gmarkers[ele].imageOn=cluserImageOn;rwMaps.gmarkers[this.property.details.id].imageOn=cluserImageOn;rwMaps.gmarkers[ele].tooltipText=rwMaps.latlonglocations[latlngHash].total+" Listings";rwMaps.gmarkers[this.property.details.id].tooltipText=rwMaps.latlonglocations[latlngHash].total+" Listings";}}
if(this.property.geometry.Point.coordinates[1]==0&&this.property.geometry.Point.coordinates[0]==0){rwMaps.gmarkers[this.property.details.id].marker.hide();}},getGeocoder:function(){if(rwMaps.config.delay>0){setTimeout('rwMaps.interact.prototype.getGeocoder('+this.property.details.id+')',rwMaps.config.delay);rwMaps.config.delay=rwMaps.config.delay+150;}},createMarker:function(type,cluster){if(cluster){this.setMarkerImageCluster(type);}else{this.setMarkerImage(type);}
var markerIcon=new GIcon();markerIcon.image=this._imageOff;markerIcon.shadow=this._shadow;markerIcon.iconSize=this._iconSize;markerIcon.shadowSize=this._shadowSize;markerIcon.iconAnchor=this._iconAnchor;markerIcon.infoWindowAnchor=this._infoWindowAnchor;if(this._imageMap)markerIcon.imageMap=this._imageMap;return{icon:markerIcon};},setMarkerImage:function(type){if(type=='commercial'){this._imageOn=rwMaps.config.baseURL+'images/s_on.png';this._imageOff=rwMaps.config.baseURL+'images/s.png';this._shadow=rwMaps.config.baseURL+'images/s_shadow.png';this._imageCluster=rwMaps.config.baseURL+'images/s_c';this._imageClusterOn=rwMaps.config.baseURL+'images/s_on_c';this._imageLogo=rwMaps.config.baseURL+'images/s_l';this._iconSize=new GSize(32.0,31.0);this._shadowSize=new GSize(39.0,25.0);this._iconAnchor=new GPoint(16.0,31.0);this._infoWindowAnchor=new GPoint(13.0,13.0);this._imageMap=[24,6,25,7,25,8,25,9,25,10,25,11,25,12,25,13,25,14,25,15,25,16,25,17,25,18,25,19,25,20,25,21,25,22,25,23,24,24,17,25,16,26,15,27,15,28,14,29,14,30,12,30,11,29,11,28,10,27,10,26,9,25,1,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,1,6];}else if(type=='commercial lease'){this._imageOn=rwMaps.config.baseURL+'images/l_on.png';this._imageOff=rwMaps.config.baseURL+'images/l.png';this._shadow=rwMaps.config.baseURL+'images/s_shadow.png';this._imageCluster=rwMaps.config.baseURL+'images/l_c';this._imageClusterOn=rwMaps.config.baseURL+'images/l_on_c';this._imageLogo=rwMaps.config.baseURL+'images/l_l';this._iconSize=new GSize(32.0,31.0);this._shadowSize=new GSize(39.0,25.0);this._iconAnchor=new GPoint(16.0,31.0);this._infoWindowAnchor=new GPoint(13.0,13.0);this._imageMap=[24,6,25,7,25,8,25,9,25,10,25,11,25,12,25,13,25,14,25,15,25,16,25,17,25,18,25,19,25,20,25,21,25,22,25,23,24,24,17,25,16,26,15,27,15,28,14,29,14,30,12,30,11,29,11,28,10,27,10,26,9,25,1,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,1,6];}else if(type=='residential'){this._imageOn=rwMaps.config.baseURL+'images/s_on.png';this._imageOff=rwMaps.config.baseURL+'images/s.png';this._shadow=rwMaps.config.baseURL+'images/s_shadow.png';this._imageCluster=rwMaps.config.baseURL+'images/s_c';this._imageClusterOn=rwMaps.config.baseURL+'images/s_on_c';this._imageLogo=rwMaps.config.baseURL+'images/s_l';this._iconSize=new GSize(32.0,31.0);this._shadowSize=new GSize(39.0,25.0);this._iconAnchor=new GPoint(16.0,31.0);this._infoWindowAnchor=new GPoint(13.0,13.0);this._imageMap=[24,6,25,7,25,8,25,9,25,10,25,11,25,12,25,13,25,14,25,15,25,16,25,17,25,18,25,19,25,20,25,21,25,22,25,23,24,24,17,25,16,26,15,27,15,28,14,29,14,30,12,30,11,29,11,28,10,27,10,26,9,25,1,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,1,6];}else if(type=='rent'){this._imageOn=rwMaps.config.baseURL+'images/r_on.png';this._imageOff=rwMaps.config.baseURL+'images/r.png';this._shadow=rwMaps.config.baseURL+'images/s_shadow.png';this._imageCluster=rwMaps.config.baseURL+'images/r_c';this._imageClusterOn=rwMaps.config.baseURL+'images/r_on_c';this._imageLogo=rwMaps.config.baseURL+'images/r_l';this._iconSize=new GSize(32.0,31.0);this._shadowSize=new GSize(39.0,25.0);this._iconAnchor=new GPoint(16.0,31.0);this._infoWindowAnchor=new GPoint(13.0,13.0);this._imageMap=[24,6,25,7,25,8,25,9,25,10,25,11,25,12,25,13,25,14,25,15,25,16,25,17,25,18,25,19,25,20,25,21,25,22,25,23,24,24,17,25,16,26,15,27,15,28,14,29,14,30,12,30,11,29,11,28,10,27,10,26,9,25,1,24,0,23,0,22,0,21,0,20,0,19,0,18,0,17,0,16,0,15,0,14,0,13,0,12,0,11,0,10,0,9,0,8,0,7,1,6];}else if(type=='commercial_old'){this._imageOn=rwMaps.config.baseURL+'images/commercial_white.png';this._imageOff=rwMaps.config.baseURL+'images/commercial_yellow.png';this._shadow=rwMaps.config.baseURL+'images/commercial_y_w_shadow.png';this._iconSize=new GSize(27.0,40.0);this._shadowSize=new GSize(48.0,40.0);this._iconAnchor=new GPoint(13.0,40.0);this._infoWindowAnchor=new GPoint(13.0,20.0);}else if(type=='commercial_old_blue'){this._imageOn=rwMaps.config.baseURL+'images/commercial_blue.png';this._imageOff=rwMaps.config.baseURL+'images/commercial.png';this._shadow=rwMaps.config.baseURL+'images/commercial_shadow.png';this._iconSize=new GSize(24.0,47.0);this._shadowSize=new GSize(48.0,47.0);this._iconAnchor=new GPoint(12.0,23.0);this._infoWindowAnchor=new GPoint(12.0,23.0);}else{this._imageOn=rwMaps.config.baseURL+'images/small_house_blue.png';this._imageOff=rwMaps.config.baseURL+'images/small_house.png';this._shadow=rwMaps.config.baseURL+'images/shadow.png';this._iconSize=new GSize(34.0,32.0);this._shadowSize=new GSize(51.0,32.0);this._iconAnchor=new GPoint(17.0,16.0);this._infoWindowAnchor=new GPoint(17.0,16.0);}},setMarkerImageCluster:function(type){if(type=='commercial'){this._imageOn=rwMaps.config.baseURL+'images/s_c_on.png';this._imageOff=rwMaps.config.baseURL+'images/s_c.png';this._shadow=rwMaps.config.baseURL+'images/s_shadow.png';this._iconSize=new GSize(32.0,31.0);this._shadowSize=new GSize(39.0,25.0);this._iconAnchor=new GPoint(16.0,25.0);this._infoWindowAnchor=new GPoint(13.0,13.0);}},importanceOrder:function(marker,b){return GOverlay.getZIndex(marker.getPoint().lat())+marker.importance*1000000;},addMarkerEvents:function(gmarker){var click=GEvent.addListener(gmarker.marker,"click",function(){if(gmarker.marker.RWInfoWindowInstance){gmarker.marker.closeRWInfoWindow();}else{if(rwMaps.status.currentMarker!=''){rwMaps.status.currentMarker.closeRWInfoWindow();}
var html=gmarker.html;try{var latlngHash=rwMaps.gmarkers[gmarker.property.details.id].latlngHash;if(rwMaps.latlonglocations[latlngHash].total>1){var counter=1;var position=1;var multiLocation={};for(var ele in rwMaps.gmarkers){if(latlngHash==rwMaps.gmarkers[ele].latlngHash){if(ele==gmarker.property.details.id){position=counter;}
multiLocation[counter]=ele;counter++;}}
counter--;var newHtml="<div id='mapNavigation'>";var location=(position==1)?counter:(position-1);newHtml+="<a href='javascript:rwMaps.interact.prototype.myclick("+multiLocation[location]+");'  title='Click to view previous propery'/>"
newHtml+="<img src='"+rwMaps.config.baseURL+"images/previous.gif' />";newHtml+="</a>";newHtml+=" "+position+" of "+counter+" ";var location=(position==counter)?1:(position+1);newHtml+="<a href='javascript:rwMaps.interact.prototype.myclick("+multiLocation[location]+");'  title='Click to view next propery'/>"
newHtml+="<img src='"+rwMaps.config.baseURL+"images/next.gif' />";newHtml+="</a>";newHtml+="</div>";html=newHtml+html;}}catch(e){}
gmarker.marker.openRWInfoWindow(html);}
rwMaps.status.currentMarker=gmarker.marker;gmarker.marker.closeToolTip();if(!map.getBounds().containsLatLng(gmarker.marker.getLatLng())){map.setCenter(gmarker.marker.getLatLng());}});var mouseover=GEvent.addListener(gmarker.marker,"mouseover",function(){gmarker.marker.setImage(gmarker.imageOn);gmarker.marker.openToolTip(gmarker.tooltipText);});var mouseout=GEvent.addListener(gmarker.marker,"mouseout",function(){gmarker.marker.setImage(gmarker.imageOff);gmarker.marker.closeToolTip();});return{"click":click,"mouseover":mouseover,"mouseout":mouseout};}});rwMaps.controller=function(){};jQuery.extend(rwMaps.controller.prototype,{init:function(){},getData:function(){},getPropertyHTML:function(){},startDataLoad:function(){jQuery('#mapStatusDiv').html("Loading <img src='"+rwMaps.config.baseURL+"images/ajax-loader.gif'/>");},finishedDataLoad:function(total){jQuery('#mapStatusDiv').html('');if(this.total>0){this.mapSetCenter();}else{jQuery('#mapCenterMessageDiv').show();jQuery('#mapCenterMessageDiv').html('<span>No Properties found</span>');jQuery('#mapCenterMessageDiv').fadeOut(1500);}},maplocation:function(property){var marker=new rwMaps.markerIcons(property,this.getPropertyHTML(property),this.getTooltipText(property));this.addPropertyEvents(property);if(marker.property.geometry.Point.coordinates[1]!=0&&marker.property.geometry.Point.coordinates[1]!=0){this.mapBounds(property.geometry.Point.coordinates[1],property.geometry.Point.coordinates[0]);}},addPropertyEvents:function(){},getTooltipText:function(property){return(property.details.address)?property.details.address:property.details.suburb;},mapBounds:function(lat,lng){rwMaps.status.bounds.extend(new GLatLng(lat,lng));},mapSetCenter:function(){if(rwMaps.status.bounds.isEmpty()){map.setCenter(new google.maps.LatLng(rwMaps.config.lat,rwMaps.config.lng),rwMaps.config.zoom);}else{var percent=0.10;var north=rwMaps.status.bounds.getNorthEast().lat();var east=rwMaps.status.bounds.getNorthEast().lng();var south=rwMaps.status.bounds.getSouthWest().lat();var west=rwMaps.status.bounds.getSouthWest().lng();var extendNorth=north+((north-south)*percent);var extendEast=east+((east-west)*percent);var extendSouth=south-((north-south)*percent);var extendWest=west-((east-west)*percent);rwMaps.status.bounds.extend(new GLatLng(extendNorth,extendEast));rwMaps.status.bounds.extend(new GLatLng(extendSouth,extendWest));var zoom=(north!=south)?map.getBoundsZoomLevel(rwMaps.status.bounds):rwMaps.config.streetZoom;map.setCenter(rwMaps.status.bounds.getCenter(),zoom);}},getPropertyHTML:function(property){var html="";html+="<div id='mProperty'>";html+=" <div id='mTitleBar'>";html+="  <div id='mCloseButton'>";html+="<img src='"+rwMaps.config.baseURL+"images/close_btn.png' ";html+="onclick='rwMaps.status.currentMarker.closeRWInfoWindow();'/>";html+="</div>";html+="   <div id='mBedBathCar'>";html+=(property.details.bed>0)?"<div id='mBed'><p>"+property.details.bed+"</p></div>":"";html+=(property.details.bath>0)?"<div id='mBath'><p>"+property.details.bath+"</p></div>":"";html+=(property.details.car>0)?"<div id='mCar'><p>"+property.details.car+"</p></div>":"";html+="   </div>";html+="  <div id='mTitle'>";if(property.details.type=="commercial"){html+="<img src='"+rwMaps.config.baseURL+"images/s_l.png' />";html+="For Sale";}else if(property.details.type=="commercial lease"){html+="<img src='"+rwMaps.config.baseURL+"images/l_l.png' />";html+="For Lease";}else if(property.details.type=="residential"){html+="<img src='"+rwMaps.config.baseURL+"images/s_l.png' />";html+="For Sale";}else if(property.details.type=="rent"){html+="<img src='"+rwMaps.config.baseURL+"images/r_l.png' />";html+="For Rent";}
html+=" </div>";html+=" </div>";html+=" <div id='mSpacer'></div>";html+=" <div id='mPropertyInfo'>";html+="  <div id='mInfo'>";html+="   <div id='mImage'>";html+="<a href='"+property.details.link+"'>";html+="<img src='"+property.details.image+"' />";html+="</a>";html+="</div>";html+="   <div id='lAddress'>"+property.details.address+" "+property.details.suburb+" </div>";html+="   <div id='mPrice'>"+property.details.price+"</div>";html+="   <div id='mContent'>";html+=property.details.description;html+="</div>";html+="  </div>";html+=" </div>";html+="</div>";return html;},errorDataLoad:function(){jQuery('#mapStatusDiv').html("Error Loading Data");}});rwMaps.controllerSuburb=function(){this.init();};jQuery.extend(rwMaps.controllerSuburb.prototype,rwMaps.controller.prototype);jQuery.extend(rwMaps.controllerSuburb.prototype,{init:function()
{this.data={};this.total=0;this.deleteMarkers();rwMaps.status.bounds=new GLatLngBounds();this.getData();},getData:function(){jQuery.ajax({url:this.getURL(),dataType:"jsonp",jsonp:"callback",start:this.startDataLoad(),error:function(xmlHttpRequest,textStatus,errorThrown){this.errorDataLoad();},success:function(data){if(data&&data.properties){this.data=data;jQuery.each(data.properties,function(i,property){if(property&&property.details){this.total++;this.maplocation(property);}}.bind(this));}
this.finishedDataLoad(this.total);jQuery('#rwmap').css({'background':'#E5E3DF'});}.bind(this)});},getURL:function(){var url=rwMaps.config.dataURL;if(rwMaps.config.searchCriteria){url=url+rwMaps.config.searchCriteria;}
return url;},getPropertyHTML:function(property){var html="";html+="<div id='mProperty'>";html+=" <div id='mAddressBar'>";html+="  <div id='mCloseButton'>";html+="<img src='"+rwMaps.config.baseURL+"images/close.png' ";html+="onMouseOut=\"this.src='"+rwMaps.config.baseURL+"images/close.png'\" ";html+="onMouseOver=\"this.src='"+rwMaps.config.baseURL+"images/close_hover.png'\" ";html+="onclick='rwMaps.status.currentMarker.closeRWInfoWindow();'/>";html+="</div>";html+="  <div id='mAddress'>"+property.details.address+" "+property.details.suburb+" </div>";html+=" </div>";html+=" <div id='mSpacer'></div>";html+=" <div id='mPropertyInfo'>";html+="  <div id='mInfo'>";html+="   <div id='mImage'>";html+="<a href='"+property.details.link+"'>";html+="<img src='"+property.details.image+"' />";html+="</a>";html+="</div>";html+="   <div id='mPrice'>"+property.details.price+"</div>";html+="   <div id='mBedBathCar'>";html+=(property.details.bed>0)?"<img src='http://www.raywhiteauction.com/images/icon_bed.gif' alt=' Bedrooms' width='29' height='21'/>"+property.details.bed:"";html+=(property.details.bath>0)?"<img src='http://www.raywhiteauction.com/images/icon_bathroom.gif' alt=' Bedrooms' width='20' height='21'/>"+property.details.bath:"";html+=(property.details.car>0)?"<img src='http://www.raywhiteauction.com/images/icon_garage.gif' alt=' Bedrooms' width='19' height='21'/>"+property.details.car:"";html+="   </div>";html+="   <div id='mContent'>";html+=property.details.description;html+="</div>";html+="  </div>";html+=" </div>";html+="</div>";return html;},addPropertyEvents:function(property){var i=property.details.id;var divID='#p'+i;jQuery(divID).hover(function(){rwMaps.interact.prototype.highlight(i);},function(){rwMaps.interact.prototype.highlightreset(i);});var mapLink=document.createElement("div");mapLink.id=divID+'maplink';mapLink.innerHTML="<p>Click to view on Map</p>"
jQuery(mapLink).attr("title","Click to view '"+property.details.address+" "+property.details.suburb+"' on the Map");jQuery(mapLink).click(function(){rwMaps.interact.prototype.myclick(i);});jQuery(mapLink).hover(function(){jQuery(this).css({'cursor':'pointer'});},function(){jQuery(this).css({'cursor':'default'});});jQuery(divID+' .listContent').append(mapLink);},deleteMarkers:function(){for(var ele in rwMaps.gmarkers){map.removeOverlay(rwMaps.gmarkers[ele].marker);delete rwMaps.gmarkers[ele];}}});rwMaps.controllerProperty=function(){this.init();};jQuery.extend(rwMaps.controllerProperty.prototype,rwMaps.controller.prototype);jQuery.extend(rwMaps.controllerProperty.prototype,{init:function()
{this.total=0;rwMaps.status.cookie.load(this.getURL());rwMaps.status.bounds=new GLatLngBounds();this.getData();},getData:function(){jQuery.ajax({url:this.getURL(),dataType:"jsonp",jsonp:"callback",start:this.startDataLoad(),error:function(xmlHttpRequest,textStatus,errorThrown){this.errorDataLoad();},success:function(data){if(data&&data.properties){this.total++;this.maplocation(data.properties[0]);}
this.finishedDataLoad(this.total);try{this.openProperty(data.properties[0]);}catch(e){};rwMaps.status.cookie.save(this.getURL());jQuery('#rwmap').css({'background':'#E5E3DF'});}.bind(this)});},getURL:function(){var propertID=location.href.match(/\d+/g);var url=rwMaps.config.dataURL+"propertyIDs="+propertID;return url;},addPropertyEvents:function(property){},openProperty:function(property){GEvent.trigger(rwMaps.gmarkers[property.details.id].marker,"click");}});rwMaps.controllerResults=function(){this.init();};jQuery.extend(rwMaps.controllerResults.prototype,rwMaps.controller.prototype);jQuery.extend(rwMaps.controllerResults.prototype,{init:function()
{this.data={};this.total=0;this.deleteMarkers();rwMaps.status.cookie.load(this.getURL());rwMaps.status.bounds=new GLatLngBounds();this.getData();},getData:function(){jQuery.ajax({url:this.getURL(),dataType:"jsonp",jsonp:"callback",start:this.startDataLoad(),error:function(xmlHttpRequest,textStatus,errorThrown){this.errorDataLoad();},success:function(data){if(data&&data.properties){this.data=data;jQuery.each(data.properties,function(i,property){if(property&&property.details){this.total++;this.maplocation(property);}}.bind(this));}
this.finishedDataLoad(this.total);rwMaps.status.cookie.save(this.getURL());jQuery('#rwmap').css({'background':'#E5E3DF'});}.bind(this)});},getURL:function(){var ids="";var properties=jQuery('#propertyResultList').find('div').filter('[@class=PropertyList]');jQuery.each(properties,function(i,property){ids+=property.id.replace(/p/g,"")+",";});var url=rwMaps.config.dataURL;if(rwMaps.config.searchCriteria){url=url+"propertyIDs="+ids;}
return url;},addPropertyEvents:function(property){if(property.details.address==""&&property.geometry.Point.coordinates[1]==0&&property.geometry.Point.coordinates[0]==0){return false;}
var i=property.details.id;var divID='#p'+i;jQuery(divID).hover(function(){rwMaps.interact.prototype.highlight(i);},function(){rwMaps.interact.prototype.highlightreset(i);});var mapLink=document.createElement("div");mapLink.id=divID+'maplink';mapLink.innerHTML="<p>Click to view on Map</p>"
jQuery(mapLink).attr("title","Click to view '"+property.details.address+" "+property.details.suburb+"' on the Map");jQuery(mapLink).click(function(){rwMaps.interact.prototype.myclick(i);if(jQuery(window).scrollTop()>(jQuery('#rwmap').offset().top)){jQuery('html, body').animate({scrollTop:jQuery('#rwmap').offset().top},'slow');}});jQuery(mapLink).hover(function(){jQuery(this).css({'cursor':'pointer'});},function(){jQuery(this).css({'cursor':'default'});});jQuery(divID+' .listContent').append(mapLink);},deleteMarkers:function(){for(var ele in rwMaps.gmarkers){map.removeOverlay(rwMaps.gmarkers[ele].marker);delete rwMaps.gmarkers[ele];}}});Object.size=function(obj){var size=0,key;for(key in obj){if(obj.hasOwnProperty(key))size++;}
return size;};