/*[2ms]*/DMP.Listing=function(){var Window={resize:function(){var w=$(window);var dW=w.width()-1010,dH=w.height()-(screen.height-180<1000?screen.height-180:1000);if(dW<0){window.resizeBy&&window.resizeBy(-dW,0);window.moveTo&&window.moveTo((screen.width-915)/4,0);}if(dH<0){window.resizeBy&&window.resizeBy(0,-dH);window.moveTo&&window.moveTo((screen.width-915)/4,0);}}},Mortgage={calculate:function(){var i=$('#Mortgage input');if(i.length!=3)return;var pN=$('#Payment'),p=DMP.Listing.price,d=parseFloat(i.eq(0).val().replace(/[^0-9\.]/g,'')),t=parseFloat(i.eq(1).val()),a=parseFloat(i.eq(2).val()),P;if(isNaN(p)||isNaN(d)||isNaN(t)||isNaN(a))return;if(d>p){pN.text('Down payment larger than price.');return;}if(a>30){pN.text('You need a better interest rate.');return;}P=(((p-d)*((a/100)/12)*Math.pow(1+((a/100)/12),t*12))/(Math.pow(1+((a/100)/12),t*12)-1));var M=0,T=0,H=0;if(P>1000000)M=parseInt(P/1000000);if(P>1000)T=parseInt((P-(M*1000000))/1000);H=(P-(M*1000000)-(T*1000)).toFixed(2);if(M>0)while(T.length!=3)T='0'+T;if(T>0)while(H.length!=6)H='0'+H;pN.text('$'+(M>0?M+',':'')+(T>0?T+',':'')+H);}},Home={initialize:function(){if(DMP.Listing.Home&&DMP.Listing.Home.audio)swfobject.embedSWF('/SWF/V1.0.0/JWPlayer.swf','AudioPlayer','800px','20px','9','/SWF/V1.0.0/ExpressInstall.swf',{file:DMP.Listing.Home.audio,backcolor:'aaaaaa',autostart:'true',repeat:'always'},{quality:'best',wmode:'transparent'},null);}},PhotoGallery={initialize:function(){swfobject.embedSWF('/SWF/V1.0.0/SlideShowPro.swf','SlideShowPlayer','800px','600px','9','/SWF/V1.0.0/ExpressInstall.swf',{xmlFilePath:DMP.Listing.PhotoGallery.xmlFilePath,fullScreen:DMP.Listing.PhotoGallery.allowFullScreen},{base:document.location.href,quality:'best',bgcolor:'#121212',allowfullscreen:DMP.Listing.PhotoGallery.allowFullScreen,wmode:'transparent'},null);}},VirtualTour={initialize:function(){$('#VirtualTour .Tours a').click(VirtualTour.replace);if(DMP.Listing.VirtualTour&&DMP.Listing.VirtualTour.audio)swfobject.embedSWF('/SWF/V1.0.0/JWPlayer.swf','AudioPlayer','800px','20px','9','/SWF/V1.0.0/ExpressInstall.swf',{file:DMP.Listing.VirtualTour.audio,backcolor:'aaaaaa',autostart:'true',repeat:'always'},{quality:'best',wmode:'transparent'},null);},replace:function(event){var t=$(this);if(t.parents('td').eq(0).hasClass('Active')){event.preventDefault();return;}$('#VirtualTour .Tours .Active').removeClass('Active').addClass('Inactive');t.parents('td').eq(0).removeClass('Inactive').addClass('Active');}},MovieTour={initialize:function(){$('#MovieTour .Tours a').click(MovieTour.replace);},replace:function(event){if(DMP.Listing.MovieTour.deviceType=='Computer'){var t=$(this);if(t.parents('td').eq(0).hasClass('Active')){event.preventDefault();return;}$('#MovieTour .Tours .Active').removeClass('Active').addClass('Inactive');t.parents('td').eq(0).removeClass('Inactive').addClass('Active');}}},Map={googleMap:null,streetViewMap:null,initialize: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.0/JWPlayer.swf','AudioPlayer','800px','20px','9','/SWF/V1.0.0/ExpressInstall.swf',{file:DMP.Listing.Map.audio,backcolor:'aaaaaa',autostart:'true',repeat:'always'},{quality:'best',wmode:'transparent'},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});}},WalkScore={initialize:function(){if(DMP.Listing.WalkScore&&DMP.Listing.WalkScore.audio)swfobject.embedSWF('/SWF/V1.0.0/JWPlayer.swf','AudioPlayer','800px','20px','9','/SWF/V1.0.0/ExpressInstall.swf',{file:DMP.Listing.WalkScore.audio,backcolor:'aaaaaa',autostart:'true',repeat:'always'},{quality:'best',wmode:'transparent'},null);}},Data={initialize:function(){if(DMP.Listing.Data&&DMP.Listing.Data.audio)swfobject.embedSWF('/SWF/V1.0.0/JWPlayer.swf','AudioPlayer','800px','20px','9','/SWF/V1.0.0/ExpressInstall.swf',{file:DMP.Listing.Data.audio,backcolor:'aaaaaa',autostart:'true',repeat:'always'},{quality:'best',wmode:'transparent'},null);}},Brochure={initialize:function(){if(DMP.Listing.Brochure&&DMP.Listing.Brochure.audio)swfobject.embedSWF('/SWF/V1.0.0/JWPlayer.swf','AudioPlayer','800px','20px','9','/SWF/V1.0.0/ExpressInstall.swf',{file:DMP.Listing.Brochure.audio,backcolor:'aaaaaa',autostart:'true',repeat:'always'},{quality:'best',wmode:'transparent'},null);}},School={initialize:function(){if(DMP.Listing.School&&DMP.Listing.School.audio)swfobject.embedSWF('/SWF/V1.0.0/JWPlayer.swf','AudioPlayer','800px','20px','9','/SWF/V1.0.0/ExpressInstall.swf',{file:DMP.Listing.School.audio,backcolor:'aaaaaa',autostart:'true',repeat:'always'},{quality:'best',wmode:'transparent'},null);}},EmailFriend={initialize:function(){DMP.Page.Methods.register('/EmailFriend.aspx','SendEmailFriend');$('#Send').click(EmailFriend.send);DMP.Page.Validators.setMessageBox('Email',$('#SendButton p.Error'));},send:function(){if(!DMP.Page.Validators.validate('Email'))return;$('#Failed,#Success,#Code').hide();DMP.Page.Methods.SendEmailFriend([DMP.Listing.EmailFriend.tenDigitUniqueID,DMP.Listing.EmailFriend.branded,$('#YourFName').val(),$('#YourLName').val(),$('#YourEmail').val(),$('#TheirFName').val(),$('#TheirLName').val(),$('#TheirEmail').val(),$('#Message').val(),$('#recaptcha_challenge_field').val(),$('#recaptcha_response_field').val()],EmailFriend.success,EmailFriend.failure);},success:function(msg){if(msg.d==0){$('#SendButton').hide();$('#Success').show();$('#SentName').text($('#TheirFName').val()+' '+$('#TheirLName').val());}else if(msg.d==1){$('#Failed,#Code').show();$('#FailedName').text($('#TheirFName').val()+' '+$('#TheirLName').val());}},failure:function(){$('#SendButton').hide();$('#Failed').show();$('#FailedName').text($('#TheirFName').val()+' '+$('#TheirLName').val());}},EmailAgent={initialize:function(){DMP.Page.Methods.register('/EmailAgent.aspx','SendEmailAgent');$('#Send').click(EmailAgent.send);DMP.Page.Validators.setMessageBox('Email',$('#SendButton p.Error'));},send:function(){if(!DMP.Page.Validators.validate('Email'))return;$('#Failed,#Success,#Code').hide();DMP.Page.Methods.SendEmailAgent([DMP.Listing.EmailAgent.tenDigitUniqueID,$('#FName').val(),$('#LName').val(),$('#PhoneNUM').val(),$('#BestTime').val(),$('#Email').val(),$('#Subject').val(),$('#Message').val(),$('#recaptcha_challenge_field').val(),$('#recaptcha_response_field').val()],EmailAgent.success,EmailAgent.failure);},success:function(msg){if(msg.d==0){$('#SendButton').hide();$('#Success').show();}else if(msg.d==1)$('#Failed,#Code').show();},failure:function(){$('#SendButton').hide();$('#Failed').show();}},Showing={initialize:function(){DMP.Page.Methods.register('/Showing.aspx','SendShowing');$('#Send').click(Showing.send);DMP.Page.Validators.setMessageBox('Email',$('#SendButton p.Error'));},send:function(){if(!DMP.Page.Validators.validate('Email'))return;$('#Failed,#Success,#Code').hide();DMP.Page.Methods.SendShowing([DMP.Listing.Showing.tenDigitUniqueID,$('#DateRequested').val(),$('#TimeRequested').val(),$('#AMPM').val(),$('#FName').val(),$('#LName').val(),$('#PhoneNUM').val(),$('#BestTime').val(),$('#Email').val(),$('#recaptcha_challenge_field').val(),$('#recaptcha_response_field').val()],Showing.success,Showing.failure);},success:function(msg){if(msg.d==0){$('#SendButton').hide();$('#Success').show();}else if(msg.d==1)$('#Failed,#Code').show();},failure:function(){$('#SendButton').hide();$('#Failed').show();}},Blog={initialize:function(){DMP.Page.Methods.register('/Blog.aspx','ReplyToAuthor');$('#Send').click(Blog.send);$('#NewSecurityImage').click(Blog.newSecurityImage);DMP.Page.Validators.setMessageBox('Email',$('#SendButton p.Error'));},newSecurityImage:function(event){event.preventDefault();$('#SecurityImage').attr({src:'/SecurityImage.aspx?num='+Math.floor(Math.random()*16777216)});},send:function(){if(!DMP.Page.Validators.validate('Email'))return;$('#Failed,#Success,#Code').hide();DMP.Page.Methods.ReplyToAuthor([DMP.Listing.Blog.tenDigitUniqueID,DMP.Listing.Blog.articleNUM,$('#FName').val(),$('#LName').val(),$('#Email').val(),$('#Content').val(),$('#recaptcha_challenge_field').val(),$('#recaptcha_response_field').val()],Blog.success,Blog.failure);},success:function(msg){if(msg.d==0){$('#SendButton').hide();$('#Success').show();}else if(msg.d==1)$('#Failed,#Code').show();},failure:function(){$('#SendButton').hide();$('#Failed').show();}},initialize=function(){$('#HideShow').click(function(event){event.preventDefault();var s=$('#HideShow span');if(s.css('background-position')!=undefined){if(s.css('background-position')=='0px 0px'){$('#Navigation,#Navigation span,#Mortgage,#BlankMortgage,#RentalPricing').slideUp('slow');s.css({backgroundPosition:'0px -13px'});}else{$('#Navigation,#Navigation span,#Mortgage,#BlankMortgage,#RentalPricing').slideDown('fast');s.css({backgroundPosition:'0px 0px'});}}else{if(s.css('background-position-y')=='0px'){$('#Navigation,#Navigation span,#Mortgage,#BlankMortgage,#RentalPricing').slideUp('slow');s.css({backgroundPositionY:'-13px'});}else{$('#Navigation,#Navigation span,#Mortgage,#BlankMortgage,#RentalPricing').slideDown('fast');s.css({backgroundPositionY:'0px'});}}});$('#Mortgage input').change(Mortgage.calculate);if($('#Home').length>0)Home.initialize();if($('#PhotoGallery').length>0)PhotoGallery.initialize();if($('#VirtualTour').length>0)VirtualTour.initialize();if($('#MovieTour').length>0)MovieTour.initialize();if($('#Map').length>0)Map.initialize();if($('#WalkScore').length>0)WalkScore.initialize();if($('#Data').length>0)Data.initialize();if($('#Brochure').length>0)Brochure.initialize();if($('#School').length>0)School.initialize();if($('#EmailFriend #Send').length>0)EmailFriend.initialize();if($('#EmailAgent #Send').length>0)EmailAgent.initialize();if($('#Showing #Send').length>0)Showing.initialize();if($('#Blog #Send').length>0)Blog.initialize();Window.resize();};return{initialize:initialize};}();$(DMP.Listing.initialize);$(window).load(function(){var h=$('tbody td').eq(0).height(),b=$('.LeftBevel,.RightBevel,.LeftShadow');if(b.eq(0).height()!=h)b.height(h);});