WPNI.Module.Messageing={init:function(){$("#overlay-message").jqm({modal:true,trigger:"a[href='#overlay-message']"});
$("#feedback").jqm({toTop:true,modal:true,trigger:"a[href='#feedback']",onHide:function(A){WPNI.Util.Utility.resetForm("feedback","feedback_form");
A.w.hide();
A.o.remove()
}});
$("#feedbackSuccess").jqm({toTop:true,modal:true});
$("#feedback_form").validate({ignore:".ignore",focusInvalid:false,errorPlacement:function(A,B){A.insertBefore(B)
},rules:{email:{required:true},comments:{required:true}},messages:{email:{required:"Your E-mail Address is required."},comments:{required:"Please enter a comment."}},submitHandler:function(){WPNI.Util.Utility.blockUI("feedback");
var A="false";
if($("#feedback-cc:checked").length>0){A="true"
}console.log($("#feedback-cc:checked").length);
console.log(A);
$.postJSON("/real-estate/send-feedback.json",{emailAddress:encodeURIComponent($("#feedback-email").val()),comment:encodeURIComponent($("#feedback-comment").val().replace(/\n/g,"<br>")),ccMe:A},function(B){if(B.act){$("#feedback").jqmHide();
WPNI.Util.Utility.unblockUI("feedback");
$("#feedbackSuccess").jqmShow()
}else{$("#feedback p").after('<p class="json-error">Error sending the feedback, please try again.</p>');
WPNI.Util.Utility.unblockUI("feedback")
}})
}})
}};
WPNI.Module.TopSearches={init:function(){$(document).ready(function(){if($.browser.msie&&parseInt($.browser.version)==7){$(".module.seo-links ul li").each(function(A){if(A>0&&A%4==0){$(this).prepend("<br/>")
}})
}})
}};
WPNI.Module.SellOptions={init:function(){$('a.popup[rel="external-small"]').click(function(){window.open($(this).attr("href"),"sample","width=805,height=650,scrollbars=yes");
return false
})
}};
WPNI.Util.Utility.pageTrack=false;
WPNI.Util.Utility.trackLinks=function(){if(!WPNI.Util.Utility.pageTrack){WPNI.Util.Utility.pageTrack=true;
$(document).ready(function(){$("a[omniture][omniture!='']").bindOnTop("click",function(){var A=$(this).attr("omniture");
WPNI.Util.Utility.logEvent("realestate",A)
})
})
}};
WPNI.Util.Utility.fixIE=function(){if($.browser.msie&&parseInt($.browser.version)>6){$(document).ready(function(){$(".ie.ie7 .module.orbit-front-editorial-tmpl div.clear-wrap").each(function(){$(this).prepend('<div class="clear"></div>')
})
})
}};function IsFieldEmpty(A){if((A.val().length==0)||A.val()==null){return true
}else{return false
}}var PROMPT_FOR_NAME_COUNTY_ZIP="Please enter an Owner/Buyer Name or County or Zip.";
var PROMPT_FOR_STREETNAME_COUNTY_ZIP="Please enter Street Name and County or Zip.";
var PROMPT_FOR_COUNTY_ZIP="Please enter County or Zip.";
function validateHomeSalesForm(E,A,D,F,C,G,B){if(E=="large"){if(!IsFieldEmpty(A)){return""
}if(!IsFieldEmpty(D)&&IsFieldEmpty(F)&&IsFieldEmpty(G)&&IsFieldEmpty(B)){return PROMPT_FOR_STREETNAME_COUNTY_ZIP
}}if(!IsFieldEmpty(G)){return""
}if(!IsFieldEmpty(B)){return""
}if(!IsFieldEmpty(C)&&(C.val()!=-1)&&IsFieldEmpty(F)){return PROMPT_FOR_STREETNAME_COUNTY_ZIP
}if(!IsFieldEmpty(F)){return PROMPT_FOR_COUNTY_ZIP
}if(E=="large"){return PROMPT_FOR_NAME_COUNTY_ZIP
}else{return PROMPT_FOR_COUNTY_ZIP
}}WPNI.Module.RealEstateSearch={sellFormState:"",rentFormState:"",siteSearchExampleText:"",realestateBuySearchData:[],init:function(A){$(document).ready(function(){if(A=="buy"){WPNI.Module.RealEstateSearch.initBuyBox();
WPNI.Util.Utility.trackLinks()
}else{if(A=="sell"){WPNI.Module.RealEstateSearch.initSellBox()
}else{if(A=="rent"){WPNI.Module.RealEstateSearch.initRentBox();
WPNI.Util.Utility.trackLinks()
}else{if(A=="nosey-neighbor"){WPNI.Module.RealEstateSearch.initNoseyNeighbor()
}else{if(A=="nosey-neighbor-narrow"){WPNI.Module.RealEstateSearch.initNoseyNeighborNarrow()
}else{if(A=="home-valuation"){WPNI.Module.RealEstateSearch.initHomeValuation()
}}}}}}})
},setRealEstateBuySearchData:function(A){this.realestateBuySearchData=A
},initBuyBox:function(){$("#search-buy-form").validate({focusInvalid:false,errorLabelContainer:"#search-messages",wrapper:"li",rules:{search:{required:true}},messages:{search:{required:"Please enter an Address, City and State or Zip."}},submitHandler:function(E){var D=$("#search-by-open-houses-only");
if($(D).is(":checked")){if($(D).attr("omniture")){var C=$(D).attr("omniture");
WPNI.Util.Utility.logEvent("realestate",C)
}}var B=$("#search-by-foreclosures-only");
if($(B).is(":checked")){if($(B).attr("omniture")){var C=$(B).attr("omniture");
WPNI.Util.Utility.logEvent("realestate",C)
}}E.submit();
return false
},invalidHandler:function(C,B){$("#search-messages").slideDown("slow")
}});
var A=WPNI.Module.RealEstateSearch.realestateBuySearchData;
if(A){$("#search-buy-city-state-zip").autocomplete(A,{selectFirst:false,multiple:false})
}$("form#search-buy-form #search-by-open-houses-only").bind("click",function(){if($("form#search-buy-form #search-by-foreclosures-only").attr("checked")&&$("form#search-buy-form #search-by-open-houses-only").attr("checked")){$("form#search-buy-form #search-by-foreclosures-only").removeAttr("checked")
}});
$("form#search-buy-form #search-by-foreclosures-only").bind("click",function(){if($("form#search-buy-form #search-by-open-houses-only").attr("checked")&&$("form#search-buy-form #search-by-foreclosures-only").attr("checked")){$("form#search-buy-form #search-by-open-houses-only").removeAttr("checked")
}if($(this).attr("checked")){$("#show-classifieds").removeAttr("name").removeAttr("value")
}else{$("#show-classifieds").attr({name:"pt",value:"fs:1,c:1"})
}})
},initSellBox:function(){$("#search-sell-get-started-button").bind("click",function(){var B=$("select[name='categories'] option:selected");
if($(B).attr("omniture")){var C=$(B).attr("omniture");
WPNI.Util.Utility.logEvent("realestate",C)
}var A=$("select[name='ad-categories'] option:selected");
if($(A).attr("omniture")){var C=$(A).attr("omniture");
WPNI.Util.Utility.logEvent("realestate",C)
}if($(this).attr("omniture")){var C=$(this).attr("omniture");
WPNI.Util.Utility.logEvent("realestate",C)
}return WPNI.Module.RealEstateSearch.searchGetStarted()
});
$(".module.realestate-search .sell select[name='categories']").bind("change",function(){if(WPNI.Module.RealEstateSearch.sellFormState!=""){return true
}var A=$(".module.realestate-search .sell select[name='categories']").val();
WPNI.Module.RealEstateSearch.sellFormState=A;
$(".module.realestate-search .sell select[name='ad-categories']").val("online");
WPNI.Module.RealEstateSearch.changeSellBoxState(A,"online")
});
$(".module.realestate-search .sell select[name='ad-categories']").bind("change",function(){if(WPNI.Module.RealEstateSearch.sellFormState!=""){return true
}var A=$(".module.realestate-search .sell select[name='categories']").val();
var B=$(".module.realestate-search .sell select[name='ad-categories']").val();
WPNI.Module.RealEstateSearch.sellFormState=A+"-"+B;
WPNI.Module.RealEstateSearch.changeSellBoxState(A,B)
});
$('a.popup[rel="external-small"]').click(function(){window.open($(this).attr("href"),"sample","width=805,height=650,scrollbars=yes");
return false
})
},initRentBox:function(){$(".module.realestate-search .rent .categories").bind("change",function(){var A=$(this).val();
if(WPNI.Module.RealEstateSearch.rentFormState!=""){return true
}WPNI.Module.RealEstateSearch.rentFormState=A;
$("#search-messages").fadeOut("slow",function(){$("#search-messages").html("")
})
});
$("#apartment_search").validate({focusInvalid:false,errorLabelContainer:"#search-messages",wrapper:"li",rules:{state:{required:true}},messages:{state:{required:"Please choose a state."}},invalidHandler:function(B,A){$("#search-messages").slideDown("slow")
}});
$(".module.realestate-search .rent #apt-bedrooms").bind("change",function(){var A=$(".module.realestate-search .rent #apt-bedrooms").val();
if(A=="studio"){$("#apt-bedrooms-hidden").attr("name","studio");
$("#apt-bedrooms-hidden").attr("value","1")
}else{if(A=="onebdrm"){$("#apt-bedrooms-hidden").attr("name","onebdrm");
$("#apt-bedrooms-hidden").attr("value","1")
}else{if(A=="twobdrm"){$("#apt-bedrooms-hidden").attr("name","twobdrm");
$("#apt-bedrooms-hidden").attr("value","1")
}else{if(A=="threebdrm-any"){$("#apt-bedrooms-hidden").attr("name","threebdrm");
$("#apt-bedrooms-hidden").attr("value","1");
$("#apt-four-bedrooms-hidden").attr("name","fourbdrm");
$("#apt-four-bedrooms-hidden").attr("value","1")
}}}}});
$(".module.realestate-search .rent #apt-pets").bind("change",function(){var A=$(".module.realestate-search .rent #apt-pets").val();
if(A=="cats"){$("#apt-pets-hidden").attr("name","am4");
$("#apt-pets-hidden").attr("value","0")
}else{if(A=="small-dogs"){$("#apt-pets-hidden").attr("name","am5");
$("#apt-pets-hidden").attr("value","0")
}else{if(A=="large-dogs"){$("#apt-pets-hidden").attr("name","am6");
$("#apt-pets-hidden").attr("value","0")
}}}});
$("#rental_homes_search").validate({focusInvalid:false,errorLabelContainer:"#search-messages",wrapper:"li",rules:{state:{required:true}},messages:{state:{required:"Please choose a state."}},invalidHandler:function(B,A){$("#search-messages").slideDown("slow")
}});
$("#form1").validate({focusInvalid:false,errorLabelContainer:"#search-messages",wrapper:"li",rules:{CLASSES:{required:true}},messages:{CLASSES:{required:"Please choose a state."}},invalidHandler:function(B,A){$("#search-messages").slideDown("slow")
}});
$("#corporate_rentals_form").submit(function(){var A=$("#corporate_rentals_form .state:selected").val();
$("#corporate_rentals_form").attr("action",A)
});
$("#webID-help").jqm({modal:true,trigger:"a[href='#webID-help']"});
$("#webSearch").validate({focusInvalid:false,errorLabelContainer:"#search-messages",wrapper:"li",rules:{webID:{required:true,maxlength:9,minlength:9}},messages:{webID:{required:"Web ID must be a 9-digit value, please enter a valid Web ID."}},submitHandler:function(){var D=$("#webSearch .webID").val();
var B=D.substr(0,6);
var C=D.substr(6,8);
var A="http://www.apartments.com/search/oasis.dll?page=Results&mode=18&lookup="+B+"."+C+"&partner=wpost";
document.location.href=A;
return false
},invalidHandler:function(B,A){$("#search-messages").slideDown("slow")
}});
$("#search-by-map-sales").jqm({modal:true,trigger:"a[href='#search-by-map-sales']"})
},initNoseyNeighbor:function(){var A=false;
$(".required_group").bind("keyup change",function(B){if(A){$("#nosey-neighbor").valid()
}});
$.validator.addMethod("largeComplexValidate",function(D,B){var C=validateHomeSalesForm("large",$("#nosey-neighbor input[name=txtBuyerName]"),$("#nosey-neighbor input[name=addressNumber]"),$("#nosey-neighbor input[name=txtStreetName]"),$("#nosey-neighbor select[name=selStreetType]"),$("#nosey-neighbor select[name=txtJurisdiction]"),$("#nosey-neighbor input[name=txtZipCode]"));
$.validator.messages.largeComplexValidate=C;
A=true;
return C.length==0
});
$("#nosey-neighbor").validate({focusInvalid:false,errorLabelContainer:"#nosey-messages",wrapper:"li",rules:{txtBuyerName:{largeComplexValidate:true}}})
},initNoseyNeighborNarrow:function(){var A=false;
$(".required_group1").bind("keyup change",function(B){if(A){$("#nosey-neighbor-narrow").valid()
}});
$.validator.addMethod("narrowComplexValidate",function(D,B){var C=validateHomeSalesForm("narrow",null,null,$("#nosey-neighbor-narrow input[name=txtStreetName]"),$("#nosey-neighbor-narrow select[name=selStreetType]"),$("#nosey-neighbor-narrow select[name=txtJurisdiction]"),$("#nosey-neighbor-narrow input[name=txtZipCode]"));
$.validator.messages.narrowComplexValidate=C;
A=true;
return C.length==0
});
$("#nosey-neighbor-narrow").validate({focusInvalid:false,errorLabelContainer:"#nosey-narrow-messages",wrapper:"li",rules:{txtZipCode:{narrowComplexValidate:true}}})
},initHomeValuation:function(){$("#home-valuation-form").validate({focusInvalid:false,errorLabelContainer:"#hv-messages",wrapper:"li",rules:{addr:{required:true,maxlength:100},csz:{required:true,maxlength:100}},messages:{addr:{required:"A street address is required."},csz:{required:"Please enter a city, state or zip."}}})
},resetSearchForm:function(){$(".module.realestate-search input[type='text']").val("");
$(".module.realestate-search select").val("");
$(".module.realestate-search checkbox").attr("checked","checked")
},changeSellBoxState:function(A,B){function C(){var D="https://classified.washpost.com/advportal/css.portal?_nfpb=true&_pageLabel=cssAds";
if(A=="agent"){if(B=="online"){D="http://washingtonpost.trulia.com/truliapro"
}}else{if(A=="owner"){if(B=="online"){D=CSS_FSBO_LINK
}}}return D
}$("#realestate-search-sell-choose").fadeOut("slow",function(){$("#realestate-search-sell-text-owner-online-print").fadeOut("slow",function(){$("#realestate-search-sell-text").fadeOut("slow",function(){$(".module.realestate-search .sell .button").fadeOut("slow",function(){$("#agent-online").slideUp("slow",function(){$("#agent-online-print").slideUp("slow",function(){$("#owner-online-print").slideUp("slow",function(){$("#broker-builder").slideUp("slow",function(){if(A=="agent"||A=="owner"){$("#realestate-search-sell-choose").fadeIn("slow");
$(".module.realestate-search .sell .button").fadeIn("slow");
if(B=="online"){$(".module.realestate-search .sell .button a").attr("href",C());
$("#agent-online").slideDown("slow")
}else{$(".module.realestate-search .sell .button a").attr("href",C());
$("#agent-online-print").slideDown("slow")
}$("#search-extra").slideDown("slow")
}else{if((A=="broker")||(A=="builder")){$("#realestate-search-sell-text").fadeIn("slow");
$("#broker-builder").slideDown("slow");
$("#search-extra").slideUp("slow")
}}WPNI.Module.RealEstateSearch.sellFormState=""
})
})
})
})
})
})
})
})
},searchGetStarted:function(){var A=$("#search-sell-get-started-button").attr("href");
if(A=="#agent-packages"){$("#agent-packages").jqmShow();
return false
}},setSiteSearchExample:function(A){WPNI.Module.RealEstateSearch.siteSearchExampleText=A
},initSiteSearch:function(){if(WPNI.Module.RealEstateSearch.siteSearchExampleText==""){return 
}$("#siteSearchSearchText").addClass("example");
$("#siteSearchSearchText").attr("value",WPNI.Module.RealEstateSearch.siteSearchExampleText);
$("#siteSearchSearchText").bind("click",function(){$(this).removeClass("example");
$(this).attr("value","")
});
$("#siteSearchSearchText").bind("blur",function(){if($(this).attr("value")==""){$(this).addClass("example");
$(this).attr("value",WPNI.Module.RealEstateSearch.siteSearchExampleText)
}});
$("#siteSearchForm").bind("submit",function(){if($("#siteSearchSearchText").attr("value")==WPNI.Module.RealEstateSearch.siteSearchExampleText){$("#siteSearchSearchText").attr("value","")
}})
}};
WPNI.Module.RealEstateSearchEditorials={init:function(){$(document).ready(function(){$("select.editorial-search-state").bind("change",function(){var B=$(this).val();
WPNI.Module.RealEstateSearchEditorials.updateFormState(B,true)
});
$("select[name='county']").bind("change",function(){var B=$(this).val();
$("form#search-articles input[name='c']").val(B)
});
var A=$("form#search-articles select[name='s']").val();
WPNI.Module.RealEstateSearchEditorials.updateFormState(A,false);
if(A=="va"||A=="md"){if($.browser.msie){$("#article_search").height("auto");
$("#editorial-search-button").animate({marginRight:"280px"},"slow")
}else{$("#editorial-search-button").animate({marginRight:"300px"},"slow")
}}})
},initSorter:function(){$(document).ready(function(){$("#editorial-search-sort-by").bind("change",function(){var A=$(this).val();
$("form#search-articles input[name='sb']").val(A);
$("form#search-articles").submit()
})
})
},updateFormState:function(B,A){if(B=="md"){$("#realestate-search-editorial-county").html("");
$("#realestate-search-editorial-countyHold option[state='md']").clone().appendTo("#realestate-search-editorial-county");
if($.browser.msie){try{$("#realestate-search-editorial-county").val($("#realestate-search-editorial-countyHold").val())
}catch(C){}}$("#the_dot").hide();
if(!$("#counties").is(":visible")){$("#counties").addClass("wp-pad-top");
$("#counties").slideDown("slow",function(){if($.browser.msie){$("#article_search").height("auto");
$("#editorial-search-button").animate({marginRight:"280px"},"slow")
}else{$("#editorial-search-button").animate({marginRight:"300px"},"slow")
}})
}}else{if(B=="va"){$("#realestate-search-editorial-county").html("");
$("#realestate-search-editorial-countyHold option[state='va']").clone().appendTo("#realestate-search-editorial-county");
if($.browser.msie){try{$("#realestate-search-editorial-county").val($("#realestate-search-editorial-countyHold").val())
}catch(C){}}$("#the_dot").hide();
if(!$("#counties").is(":visible")){$("#counties").addClass("wp-pad-top");
$("#counties").slideDown("slow",function(){if($.browser.msie){$("#article_search").height("auto");
$("#editorial-search-button").animate({marginRight:"280px"},"slow")
}else{$("#editorial-search-button").animate({marginRight:"300px"},"slow")
}})
}}else{$("#editorial-search-button").animate({marginRight:"0"},"slow",function(){$("#counties").slideUp("slow",function(){$("#the_dot").show();
$("#counties").removeClass("wp-pad-top");
$("#realestate-search-editorial-county").html("")
})
})
}}if(A){$("form#search-articles input[name='c']").val("");
$("form#search-articles select[name='county']").val("")
}}};WPNI.Module.PhotoGallery={current:0,paused:false,pause:function(A){this.paused=A
},init:function(A){WPNI.Module.PhotoGallery.current=A;
WPNI.Module.PhotoGallery.setupData();
setInterval("WPNI.Module.PhotoGallery.rotate()",5000);
WPNI.Module.PhotoGallery.enableButtons();
$(".module.photo-gallery").hover(function(){WPNI.Module.PhotoGallery.pause(true)
},function(){WPNI.Module.PhotoGallery.pause(false)
});
$(".module.photo-gallery .photo-gallery-left-shadow, .module.photo-gallery .photo-gallery-right-shadow, .module.photo-gallery .photo-gallery-bottom-shadow").css("opacity",".2");
WPNI.Util.Utility.trackLinks()
},rotate:function(){if(!this.paused){WPNI.Module.PhotoGallery.moveRight()
}},moveLeft:function(){WPNI.Module.PhotoGallery.current=WPNI.Module.PhotoGallery.current-1;
if(WPNI.Module.PhotoGallery.current<1){WPNI.Module.PhotoGallery.current=WPNI.Module.PhotoGallery.getTotal()
}for(var B=0;
B<WPNI.Module.PhotoGallery.data.length;
B++){var C=WPNI.Module.PhotoGallery.data[B];
var A=C.index;
C.index=(C.index+1);
if(C.index>(WPNI.Module.PhotoGallery.getTotal()-1)){C.index=WPNI.Module.PhotoGallery.getTotal()-C.index
}WPNI.Module.PhotoGallery.data[B]=C
}WPNI.Module.PhotoGallery.animateOut(WPNI.Module.PhotoGallery.data[5].id,"show-5","show-6");
$(".module.photo-gallery .photo-gallery-right-shadow").fadeOut("slow");
WPNI.Module.PhotoGallery.animateTo(WPNI.Module.PhotoGallery.data[4].id,"show-4","show-5");
$(".module.photo-gallery .photo-gallery-right-shadow").fadeIn("slow");
WPNI.Module.PhotoGallery.animateTo(WPNI.Module.PhotoGallery.data[3].id,"show-3","show-4");
$(".module.photo-gallery .photo-gallery-bottom-shadow").fadeOut("slow");
WPNI.Module.PhotoGallery.animateTo(WPNI.Module.PhotoGallery.data[2].id,"show-2","show-3");
$(".module.photo-gallery .photo-gallery-bottom-shadow").fadeIn("slow");
WPNI.Module.PhotoGallery.animateTo(WPNI.Module.PhotoGallery.data[1].id,"show-1","show-2");
$(".module.photo-gallery .photo-gallery-left-shadow").fadeOut("slow");
WPNI.Module.PhotoGallery.animateIn(WPNI.Module.PhotoGallery.data[0].id,"show-0","show-1");
$(".module.photo-gallery .photo-gallery-left-shadow").fadeIn("slow");
WPNI.Module.PhotoGallery.animateSwitch(WPNI.Module.PhotoGallery.data[WPNI.Module.PhotoGallery.data.length-1].id,"show-6","show-0");
WPNI.Module.PhotoGallery.updatePosition(WPNI.Module.PhotoGallery.current,WPNI.Module.PhotoGallery.getTotal());
WPNI.Module.PhotoGallery.data.sort(sortPhotoGalleryData)
},moveRight:function(){WPNI.Module.PhotoGallery.current=WPNI.Module.PhotoGallery.current+1;
if(WPNI.Module.PhotoGallery.current>WPNI.Module.PhotoGallery.getTotal()){WPNI.Module.PhotoGallery.current=1
}for(var B=0;
B<WPNI.Module.PhotoGallery.data.length;
B++){var C=WPNI.Module.PhotoGallery.data[B];
var A=C.index;
C.index=(C.index-1);
if(C.index<0){C.index=WPNI.Module.PhotoGallery.getTotal()-1
}WPNI.Module.PhotoGallery.data[B]=C
}WPNI.Module.PhotoGallery.animateSwitch(WPNI.Module.PhotoGallery.data[0].id,"show-0","show-6");
$(".module.photo-gallery .photo-gallery-left-shadow").fadeOut("slow");
WPNI.Module.PhotoGallery.animateOut(WPNI.Module.PhotoGallery.data[1].id,"show-1","show-0");
WPNI.Module.PhotoGallery.animateTo(WPNI.Module.PhotoGallery.data[2].id,"show-2","show-1");
$(".module.photo-gallery .photo-gallery-left-shadow").fadeIn("slow");
WPNI.Module.PhotoGallery.animateTo(WPNI.Module.PhotoGallery.data[3].id,"show-3","show-2");
$(".module.photo-gallery .photo-gallery-bottom-shadow").fadeOut("slow");
WPNI.Module.PhotoGallery.animateTo(WPNI.Module.PhotoGallery.data[4].id,"show-4","show-3");
$(".module.photo-gallery .photo-gallery-bottom-shadow").fadeIn("slow");
WPNI.Module.PhotoGallery.animateTo(WPNI.Module.PhotoGallery.data[5].id,"show-5","show-4");
$(".module.photo-gallery .photo-gallery-right-shadow").fadeOut("slow");
WPNI.Module.PhotoGallery.animateIn(WPNI.Module.PhotoGallery.data[6].id,"show-6","show-5");
$(".module.photo-gallery .photo-gallery-right-shadow").fadeIn("slow");
WPNI.Module.PhotoGallery.updatePosition(WPNI.Module.PhotoGallery.current,WPNI.Module.PhotoGallery.getTotal());
WPNI.Module.PhotoGallery.data.sort(sortPhotoGalleryData)
},setupData:function(){WPNI.Module.PhotoGallery.data=new Array();
$(".module.photo-gallery .photo-gallery-display .photo-gallery-display-item").each(function(A,B){var C=new Object();
C.index=A;
C.id=$(this).attr("id");
WPNI.Module.PhotoGallery.data[A]=C
})
},animate:function(A,C,B){if(C==B){return 
}$("#"+A).addClass(B);
$("#"+A).removeClass(C)
},animateOut:function(A,C,B){$("#"+A).animate({opacity:"0"},{queue:true,duration:"slow",complete:function(){WPNI.Module.PhotoGallery.animateSwitch(A,C,B)
}})
},animateIn:function(A,C,B){$("#"+A).fadeIn("slow",function(){WPNI.Module.PhotoGallery.animateSwitch(A,C,B)
})
},animateTo:function(A,C,B){if(B=="show-5"){$("#"+A).animate({top:87,left:440,height:87,width:94},{queue:false,duration:"slow",complete:function(){WPNI.Module.PhotoGallery.animateSwitch(A,C,B)
}});
$("#"+A+" img").animate({height:63,width:94},"slow")
}else{if(B=="show-4"){$("#"+A).animate({top:79,left:386,height:93,width:112},{queue:false,duration:"slow",complete:function(){WPNI.Module.PhotoGallery.animateSwitch(A,C,B)
}});
$("#"+A+" img").animate({height:75,width:112},"slow")
}else{if(B=="show-3"){$("#"+A).animate({top:16,left:180,height:172,width:241},{queue:false,duration:"slow",step:function(){$("#"+A).css("zIndex","300")
},complete:function(){WPNI.Module.PhotoGallery.animateSwitch(A,C,B)
}});
$("#"+A+" img").animate({height:139,width:241},"slow")
}else{if(B=="show-2"){$("#"+A).animate({top:79,left:111,height:93,width:112},{queue:false,duration:"slow",complete:function(){WPNI.Module.PhotoGallery.animateSwitch(A,C,B)
}});
$("#"+A+" img").animate({height:75,width:112},"slow")
}else{if(B=="show-1"){$("#"+A).animate({top:87,left:73,height:77,width:94},{queue:false,duration:"slow",complete:function(){WPNI.Module.PhotoGallery.animateSwitch(A,C,B)
}});
$("#"+A+" img").animate({height:63,width:94},"slow")
}else{WPNI.Module.PhotoGallery.animateSwitch(A,C,B)
}}}}}},animateSwitch:function(A,C,B){if(C==B){return 
}$("#"+A).addClass(B);
$("#"+A).removeClass(C);
$("#"+A).removeAttr("style");
$("#"+A+" img").removeAttr("style")
},getCurrentIndex:function(){return WPNI.Module.PhotoGallery.current-1
},getTotal:function(){if(WPNI.Module.PhotoGallery.data){return WPNI.Module.PhotoGallery.data.length
}return 0
},getCss:function(A){if(A<6){return"show-"+A
}return"show-6"
},updatePosition:function(A,B){$("#photo-gallery-display-selected").html(A);
$("#photo-gallery-display-total").html(B)
},enableButtons:function(){$(".module.photo-gallery .photo-gallery-display .photo-gallery-display-control").css("opacity",".5");
$(".module.photo-gallery .photo-gallery-display .photo-gallery-display-control").hover(function(){$(this).css("opacity","1")
},function(){$(this).css("opacity",".5")
});
$("#photo-gallery-display-control-right").bind("click",function(){WPNI.Module.PhotoGallery.moveRight();
return false
});
$("#photo-gallery-display-control-left").bind("click",function(){WPNI.Module.PhotoGallery.moveLeft();
return false
})
}};
function sortPhotoGalleryData(B,A){return B.index-A.index
};WPNI.Module.RealEstateAds={init:function(A){if(A=="ccr"){WPNI.Module.RealEstateAds.initCondosCommunityRealtor()
}else{if(A=="nhb"){WPNI.Module.RealEstateAds.initNewHomeBuilder()
}else{if(A=="rent"){WPNI.Module.RealEstateAds.initRentals()
}}}},initCondosCommunityRealtor:function(){$(document).ready(function(){if($("#slug_sponsor_condo:visible, #slug_sponsor_community:visible, #slug_sponsor_realtor:visible").length==0){$("#slug_sponsor_ccr").hide();
if($.browser.msie){$(".module.advertisement.featured-ad-five .module-column.five").css("width","260px")
}}})
},initNewHomeBuilder:function(){$(document).ready(function(){$(".module.advertisement.featured-ad-ten tr td").attr("cellspacing","10");
if($.browser.msie){$(".module.advertisement.featured-ad-five .module-column.five").css("width","260px")
}})
},initRentals:function(){$(document).ready(function(){$(".module.advertisement.featured-rentals tr td").attr("cellspacing","10");
$(".video.flyout a,li.icon-video a").each(function(){$(this).removeAttr("target");
$(this).attr("overlayurl",$(this).attr("href"));
if($(this).attr("overlayurl").indexOf("http://ad.doubleclick.net/")!=-1){$(this).removeAttr("href")
}else{$(this).attr("href","#")
}});
$("#featured-rental-ad").jqm({toTop:true,modal:true,trigger:".play-small-icon.real-estate a,li.icon-video a",onShow:function(C){var A="/real-estate/dc-apartments-rentals/ad.djs?u="+$(C.t).attr("overlayurl");
try{if($.browser.msie){$("#featured-rental-ad-content").load(A,function(E,F,D){$("#featured-rental-ad-content link").remove()
})
}else{$("#featured-rental-ad-content").load(A+" #content")
}}catch(B){$("#featured-rental-ad-content").html('<iframe src="'+A+'" frameborder="0" marginheight="0" marginwidth="0" scrolling="auto" class="fallback" />')
}WPNI.Modal.onShow(C,true)
}})
})
}};WPNI.Module.ToolsCalculators={init:function(){$("input").bind("blur",function(){if($(this).hasClass("dollar")){WPNI.Module.ToolsCalculators.formatDollar(this)
}else{if($(this).hasClass("percent")){WPNI.Module.ToolsCalculators.formatPercent(this)
}else{if($(this).hasClass("number")){WPNI.Module.ToolsCalculators.formatNumber(this)
}}}});
WPNI.Module.ToolsCalculators.toggleElements()
},toggleElements:function(){$(".toggleBox").each(function(){var B=$(this);
var A=function(){var D=B.find(".toggleSource").val();
var C=B.find(".toggleShow").val();
if(D==C){B.find(".toggleDestination").slideDown("slow")
}else{B.find(".toggleDestination").slideUp("slow")
}};
A();
B.find(".toggleSource").change(A)
})
},formatDollar:function(F){var I=F.value;
var A=false;
if(I.substring(0,1)=="-"){A=true;
I=I.substring(1,I.length)
}var G="";
for(var C=0;
C<I.length;
C++){var J=I.substring(C,C+1);
if(((J>="0")&&(J<="9"))||(J==".")){G+=J
}else{if((J!="$")&&(J!=",")){alert("Enter a number, please.");
return false
}}}if(A){G="-"+G
}if(G==""){G="0"
}var B=parseFloat(G);
if(A){G=G.substring(1,G.length)
}var H=0;
var D="";
var E=G.indexOf(".");
for(var C=G.length;
C>0;
C--){if(H>2){D+=",";
H=0
}D+=G.substring(C,C-1);
if((E==-1)||(C<=E)){H+=1
}}if(A){G="-$"
}else{G="$"
}for(var C=D.length;
C>0;
C--){G+=D.substring(C,C-1)
}F.value=G;
return true
},formatPercent:function(G){var F=G.value;
var A=false;
if(F.substring(0,1)=="-"){A=true;
F=F.substring(1,F.length)
}var B="";
for(var E=0;
E<F.length;
E++){var D=F.substring(E,E+1);
if(((D>="0")&&(D<="9"))||(D==".")){B+=D
}else{if(D!="%"){alert("Enter a number, please.");
return false
}}}if(B==""){B="0"
}var C=parseFloat(B);
C=C/100;
if(A){C=C*-1
}if(A){B=B.substring(1,B.length)
}lsBuffer=WPNI.Module.ToolsCalculators.round(C*100,2);
if(A){G.value="-"+lsBuffer+"%"
}else{G.value=lsBuffer+"%"
}return true
},formatNumber:function(F){var I=F.value;
var A=false;
if(I.substring(0,1)=="-"){A=true;
I=I.substring(1,I.length)
}var G="";
for(var C=0;
C<I.length;
C++){var J=I.substring(C,C+1);
if(((J>="0")&&(J<="9"))||(J==".")){G+=J
}else{if(J!=","){alert("Enter a number, please.");
return false
}}}if(A){G="-"+G
}if(G==""){G="0"
}var B=parseFloat(G);
if(A){G=G.substring(1,G.length)
}var H=0;
var D="";
var E=G.indexOf(".");
for(var C=G.length;
C>0;
C--){if(H>2){D+=",";
H=0
}D+=G.substring(C,C-1);
if((E==-1)||(C<=E)){H+=1
}}if(A){G="-"
}else{G=""
}for(var C=D.length;
C>0;
C--){G+=D.substring(C,C-1)
}F.value=G;
return true
},round:function(A,C){var B=0;
B=Math.round(A*Math.pow(100,C))/Math.pow(100,C);
return B
}};WPNI.Module.Classified={init:function(){$(document).ready(function(){$(".module.classified-listing div.admission-data div.admission-images a").bind("click",function(){var A=$(this).find("img");
WPNI.Module.Classified.changeImage(A.attr("src"));
WPNI.Module.Classified.adjustFade(A);
return false
});
$(".module.classified-listing div.admission-data div.admission-images a").removeAttr("target");
$(".module.classified-listing div.admission-data div.admission-images img:first").fadeTo("slow",0.2)
})
},initMap:function(){$(document).ready(function(){WPNI.Maps.pan=true;
WPNI.Maps.zoom="small";
WPNI.Maps.defaultZoom=14;
WPNI.Maps.init()
})
},changeImage:function(A){$(".module.classified-listing div.admission-data div.admission-image").slideUp("slow",function(){$(".module.classified-listing div.admission-data div.admission-image img").attr("src",A);
$(".module.classified-listing div.admission-data div.admission-image").slideDown("slow")
})
},adjustFade:function(A){$(".module.classified-listing div.admission-data div.admission-images img").each(function(){if(this.id!=$(A).attr("id")){$(this).fadeTo("slow",1)
}else{$(A).fadeTo("slow",0.2)
}})
}};