/*[0ms]*/(function($){var Map={googleMap:null,streetViewMap:null,placeMarker:function(){if(google.maps.BrowserIsCompatible){document.body.onunload=google.maps.Unload;Map.googleMap=new google.maps.Map2($('#GoogleMap').get(0));Map.googleMap.enableDoubleClickZoom();Map.googleMap.enableContinuousZoom();Map.googleMap.addMapType(G_SATELLITE_3D_MAP);Map.googleMap.addControl(new google.maps.MapTypeControl());Map.googleMap.addControl(new google.maps.LargeMapControl3D());var baseIcon=new google.maps.Icon(G_DEFAULT_ICON);baseIcon.image='/Images/V1.0.1/HouseMarker.png';baseIcon.shadow='/Images/V1.0.1/HouseShadow.png';baseIcon.iconSize=new google.maps.Size(30,40);baseIcon.shadowSize=new google.maps.Size(42,40);baseIcon.iconAnchor=new google.maps.Point(15,38);baseIcon.infoWindowAnchor=new google.maps.Point(15,8);baseIcon.imageMap=[15,3,29,15,29,25,19,28,15,38,12,28,10,28,3,22,3,14,8,9,8,3];var center=new google.maps.LatLng(DMP.Listing.Map.latitude,DMP.Listing.Map.longitude),marker=new google.maps.Marker(center,{icon:baseIcon});Map.googleMap.setCenter(center,12);Map.googleMap.addOverlay(marker);new google.maps.StreetviewClient().getNearestPanorama(center,Map.createStreetView);var infoWindowHtml='<div style="font-size:11px;font-weight:normal;padding:0px 10px 0px 0px;text-align:left;width:350px">';if(DMP.Listing.Map.thumbnail)infoWindowHtml+='<img src="'+DMP.Listing.Map.thumbnail+'?maxWidth=135&amp;maxHeight=90" alt="Primary Image" style="border:1px solid #333;float:left;margin:5px"/>';if(DMP.Listing.Map.estateName||DMP.Listing.Map.fullAddress){infoWindowHtml+='<div style="font-size:13px;font-weight:bold">';if(DMP.Listing.Map.estateName)infoWindowHtml+=DMP.Listing.Map.estateName+'<br/>';if(DMP.Listing.Map.fullAddress)infoWindowHtml+=DMP.Listing.Map.fullAddress+'<br/>';infoWindowHtml+='</div>';}infoWindowHtml+=DMP.Listing.Map.cityStateZip+'<br/><br/>';if(DMP.Listing.Map.price)infoWindowHtml+='<b>'+DMP.Listing.Map.listingType+':</b> '+DMP.Listing.Map.price+'<br/>';if(DMP.Listing.Map.propertyStyle)infoWindowHtml+=DMP.Listing.Map.propertyStyle+'<br/>';if(DMP.Listing.Map.totalBeds||DMP.Listing.Map.totalBaths||DMP.Listing.Map.TotalFinishedArea){infoWindowHtml+='<table cellpadding="0" cellspacing="0" style="font-size:11px;width:190px"><tbody><tr>';if(DMP.Listing.Map.totalBeds)infoWindowHtml+='<td>'+DMP.Listing.Map.totalBeds+' Bed'+(DMP.Listing.Map.totalBeds!=1?'s':'')+'</td>';if(DMP.Listing.Map.totalBaths)infoWindowHtml+='<td>'+DMP.Listing.Map.totalBaths+' Bath'+(DMP.Listing.Map.totalBaths!=1?'s':'')+'</td>';if(DMP.Listing.Map.TotalFinishedArea)infoWindowHtml+='<td>'+DMP.Listing.Map.TotalFinishedArea+' Fin Area</td>';infoWindowHtml+='</tr></tbody></table>';}infoWindowHtml+='</div>';marker.bindInfoWindowHtml(infoWindowHtml);marker.openInfoWindowHtml(infoWindowHtml);}},showMap:function(){var center=new google.maps.LatLng(DMP.Listing.Map.latitude,DMP.Listing.Map.longitude);Map.googleMap.setCenter(center,12);Map.googleMap.setMapType(G_NORMAL_MAP);$('#StreetViewMap').hide('slow');$('#GoogleMap').show('slow');},showAerial:function(){var center=new GLatLng(DMP.Listing.Map.latitude,DMP.Listing.Map.longitude);Map.googleMap.setCenter(center,19);Map.googleMap.setMapType(G_SATELLITE_MAP);$('#StreetViewMap').hide('slow');$('#GoogleMap').show('slow');},showEarth:function(){var center=new GLatLng(DMP.Listing.Map.latitude,DMP.Listing.Map.longitude);Map.googleMap.setCenter(center,13);Map.googleMap.setMapType(G_SATELLITE_3D_MAP);$('#StreetViewMap').hide('slow');$('#GoogleMap').show('slow');},showStreetView:function(){$('#GoogleMap').hide('slow');$('#StreetViewMap').show('slow');},createStreetView:function(sVD){if(sVD.code!=200)return;$('.StreetView').show();Map.streetViewMap=new google.maps.StreetviewPanorama($('#StreetViewMap')[0]);var cLng=parseFloat(sVD.location.latlng.lng()),cLat=parseFloat(sVD.location.latlng.lat()),vLng=DMP.Listing.Map.longitude,vLat=DMP.Listing.Map.latitude;Map.streetViewMap.setLocationAndPOV(sVD.location.latlng,{yaw:((Math.atan2(Math.sin((vLng-cLng)*Math.PI/180)*Math.cos(vLat*Math.PI/180),Math.cos(cLat*Math.PI/180)*Math.sin(vLat*Math.PI/180)-Math.sin(cLat*Math.PI/180)*Math.cos(vLat*Math.PI/180)*Math.cos((vLng-cLng)*Math.PI/180))*180/Math.PI)+360)%360});}};$(function(){Map.placeMarker();$('#AreaMap a').click(Map.showMap);$('#Aerials a').click(Map.showAerial);$('#Earth a').click(Map.showEarth);$('#StreetView a').click(Map.showStreetView);if(DMP.Listing.Map.audio)swfobject.embedSWF('/SWF/V1.0.4/JWPlayer.swf','AudioPlayer','800px','20px','9','/SWF/V1.0.4/ExpressInstall.swf',{file:DMP.Listing.Map.audio,backcolor:'aaaaaa',autostart:'true',repeat:'always'},{quality:'best',wmode:'transparent'},null);});})(jQuery);