function Querystring(b){this.params={};if(b==null){b=location.search.substring(1,location.search.length)}if(b.length==0){return}b=b.replace(/\+/g," ");var c=b.split("&");for(var d=0;d<c.length;d++){var a=c[d].split("=");var e=decodeURIComponent(a[0]);var f=(a.length==2)?decodeURIComponent(a[1]):e;this.params[e]=f}}Querystring.prototype.get=function(b,c){var a=this.params[b];c=c||"";return(a!=null)?a:c};Querystring.prototype.contains=function(b){var a=this.params[b];return(a!=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(b){var a=getAppRoot()+"/account/"+b+".aspx?formtype="+b+"&onregister=register&onsignin=signin&onresize=resizeoverlay&onloginsuccess=showlogininfo&onsuccess="+escape(escape(window.location.href+getRedirectParams()));return a}function resizeoverlay(b,a){$("#cboxIframe").contents().find("html").css("overflow","hidden");$("#cboxIframe").css("width",b+"px");$("#cboxIframe").css("height",a+"px");$("#cboxLoadedContent").css("width",b+"px");$("#cboxLoadedContent").css("height",a+"px");$("#cboxIframe").colorbox.resize()}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("TRIO=GUID")!=""){return true}return false}function getRedirectParams(){var a=[];a.push(getSearchCookie());a.push(getNextAction());var b=["?"];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("TRIO=GUID");return a?"search="+a:""}function getNextAction(){return _onLoginAction==null?"":"nextaction="+_onLoginAction};