var MAX_SAVED_RECENT_PROPERTIES=8;function SavedPropertyEntry(C,B,A){this.m_strPropertyId=C;this.m_strPhotoUrl=B;this.m_strTitle=A;this.setFromSerialized=function(E){var D=E.split("#");if(D.length==3){this.m_strPropertyId=unescape(D[0]);this.m_strPhotoUrl=unescape(D[1]);this.m_strTitle=unescape(D[2]);return true}return false};this.getSerialized=function(){return escape(this.m_strPropertyId)+"#"+escape(this.m_strPhotoUrl)+"#"+escape(this.m_strTitle)}}function SavePropertyAsRecentlyViewed(H,C,F){if(H==null||H==""){return 
}var B="";if(F!=null&&F!=""){B="MLS# "+F}else{B="ID# "+H}var E=RetrieveRecentlyViewedProperties();for(var D in E){if(E[D]!=null&&E[D].m_strPropertyId==H){E.splice(D,1)}}var A=new SavedPropertyEntry(H,C,B);E.unshift(A);var G="";for(var D in E){if(D<MAX_SAVED_RECENT_PROPERTIES){if(D>0){G+="|"}G+=E[D].getSerialized()}}SetCookie("rvp",G,null,"default.htm")}function RetrieveRecentlyViewedProperties(){var C=new Array();var D=GetCookie("rvp");if(D!=null){aSplit=D.split("|");for(var B=0;B<aSplit.length;B++){var A=new SavedPropertyEntry();
if(A.setFromSerialized(aSplit[B])){C.push(A)}}}return C}function DisplayRecentlyViewedPropertiesCallout(){var B=RetrieveRecentlyViewedProperties();if(B&&B.length>0){document.write('<div class="profilehr" style="margin-top:1em;margin-bottom:1em;">');document.write('   <div class="lt"></div>');document.write('   <div class="rt"></div>');document.write("</div>");document.write('<div class="graycalloutcontainer" style="margin-left:-3px;">');document.write('<div class="innercontainer" style="padding:4px;height:160px;overflow-y:hidden;">');
document.write('<h5 style="border-bottom:1px solid #999">Recently Viewed Listings</h5>');for(var A in B){document.write('<div style="float:left;width:131px;padding:4px;background:white;text-align:center;border:1px solid #999;margin-right:5px;margin-bottom:20px;">');document.write('<a href="index.jsp@property='+escape(B[A].m_strPropertyId)+'">');document.write('<img src="'+B[A].m_strPhotoUrl+'" border="0" width="131" height="98"><br>');document.write(B[A].m_strTitle);document.write("</a>");document.write("</div>")
}document.write('<div class="clearfloat"></div>');document.write("</div>");document.write('<div class="tl"></div>');document.write('<div class="tr"></div>');document.write('<div class="bl"></div>');document.write('<div class="br"></div>');document.write("</div>")}};
