function Querystring(a){this.params={};if(a==null){a=location.search.substring(1,location.search.length)}if(a.length==0){return}a=a.replace(/\+/g," ");var f=a.split("&");for(var b=0;b<f.length;b++){var e=f[b].split("=");var d=decodeURIComponent(e[0]);var c=(e.length==2)?decodeURIComponent(e[1]):d;this.params[d]=c}}Querystring.prototype.get=function(c,a){var b=this.params[c];a=a||"";return(b!=null)?b:a};Querystring.prototype.contains=function(a){var b=this.params[a];return(b!=null)};var _onLoginAction=null;var _qs=new Querystring();function saveSearch(a){if(a){$(document).ready(function(){if(_isMemberLoggedIn){$(".save-search").attr("href",getSaveSearchUrl(0))}else{$(".save-search").attr("href",getHref("login"))}$(".save-search").colorbox({width:400,height:200,opacity:0.7,close:"<span></span>",iframe:true,scrollbars:false,speed:0,transition:"none"});$(".save-search").click()})}else{document.getElementById("ListingSearch/SaveSearch").value=1;document.forms.ListingSearch.submit()}}function getHref(a){var b=getAppRoot()+"/account/"+a+".aspx?formtype="+a+"&onregister=register&onsignin=signin&onresize=resizeoverlay&onloginsuccess=showlogininfo&onsuccess="+escape(escape(window.location.href+getRedirectParams()));return b}function resizeoverlay(a,b){$(".cboxIframe").contents().find("html").css("overflow","hidden");$(".cboxIframe").css("width",a+"px");$(".cboxIframe").css("height",b+"px");$("#cboxLoadedContent").css("width",a+"px");$("#cboxLoadedContent").css("height",b+"px");$(".cboxIframe").colorbox.resize({innerWidth:a,innerHeight:b})}function getSaveSearchUrl(a){try{var c=(_qs.contains("ListingSearch")?"&ListingSearchID="+_qs.get("ListingSearch"):"");if(a>0){c="&ListingSearchID="+a}return getAppRoot()+"/account/savesearch.aspx?overlay=1"+c+"&onresize=resizeoverlay"}catch(b){}}function isAdminApp(){return window.location.href.toString().toLowerCase().indexOf("fnistools.com")>=0}function getAppRoot(){return isAdminApp()?"/brokeroffice.admin/agent/public":Utils.AppPath}function isLoggedIn(){if(typeof(_customerInfo)!="undefined"){if(typeof(_customerInfo.firstName)!="undefined"&&_customerInfo.firstName!=""){return true}}return false}function register(){$(".cboxIframe").attr("src",getHref("signup"))}function signin(){$(".cboxIframe").attr("src",getHref("login"));$(".save-search").colorbox({width:400,height:200,opacity:0.7,close:"<span></span>",iframe:true,scrollbars:false,speed:0,transition:"none"});$(".save-search").click()}function showlogininfo(a){$(".cboxIframe").attr("src",getSaveSearchUrl())}function isProxyLoggedIn(){if(isAdminApp()&&readCookie("rBW-ListingSearch")!=""){return true}return false}function getRedirectParams(){var a=[];a.push(getSearchCookie());a.push(getNextAction());var b=(window.location.href.lastIndexOf("?")===-1)?["?"]:[""];if(window.location.href.lastIndexOf("/")==window.location.href.length-1){b=["default.aspx?"]}$.each(a,function(){if(this!=""){if(b.length>1){b.push(escape("%26"))}b.push(this)}});return b.join("")}function getSearchCookie(){var a=readCookie("rBW-ListingSearch");return a?"search="+a:""}function getNextAction(){return _onLoginAction==null?"":"nextaction="+_onLoginAction};
