var ISDEBUG = false; 

var NRT=window.NRT||{};NRT.namespace=function()
{var a=arguments,o=null,i,j,d;for(i=0;i<a.length;i=i+1)
{d=a[i].split(".");o=NRT;for(j=(d[0]=="NRT")?1:0;j<d.length;j=j+1)
{o[d[j]]=o[d[j]]||{};o=o[d[j]];}}
return o;};NRT.namespace("ErrorHandler");var _oErrorHandler;NRT.ErrorHandler=function()
{return{ERRORTYPE_JS:'JS',ERRORTYPE_AJAX:'AJAX',ERRORTYPE_AJAX_RESPONSE:'AJAX_RESPONSE',ERRORTYPE_VBCODE:'VBCODE',ERRORTYPE_VBDATA:'VBDATA',ERRORTYPE_JS_MESSAGE:'An error has occurred!',ERRORTYPE_AJAX_MESSAGE:'An AJAX call acted up!',ERRORTYPE_AJAX_RESPONSE_MESSAGE:'The AJAX call had trouble in the response.',ERRORTYPE_VBCODE_MESSAGE:'A problem occured in VB!',ERRORTYPE_VBDATA_MESSAGE:'The Data has an issue!',ERRORTYPE_DEFAULT_MESSAGE:'Oops!?!',ERROR_DEBUG_HEADER:'A problem occurred in ',ERROR_DEBUG_MESSAGE_LABEL:'  Error Message is:  ',ERROR_DEBUG_SOURCE_LABEL:'  Error Source is:   ',ERROR_DEBUG_NAME_LABEL:'  Error Name:        ',ERROR_DEBUG_DESCRIPTION_LABEL:'  Error Description: ',ERROR_DEBUG_RESPONSE_LABEL:'  Response was:      ',ERROR_DEBUG_REQUEST_LABEL:'  Request was:       ',ERROR_DASHLINE:'-----------------------------------------------------------------',ERROR_FRIENDLY_HEADER:'An Error has occurred:',ERROR_FRIENDLY_FOOTER:'Please try again by refreshing this page in your browser.',_isDebug:ISDEBUG,Error:function(sFunctionName,eErrorType,oError)
{var sErrorMessage='';try
{if(oError!==null&&typeof oError!=='undefined')
{sErrorMessage+='JavaScript Error:'+'source:'+oError.source+', name:'+oError.name+', message:'+oError.message;this._logError(sErrorMessage);if(this._isDebug)
{this._development_Message(eErrorType,sFunctionName,oError);}else
{this._friendly_Message(eErrorType);}}
return;}
catch(err)
{}},IsDebug:function()
{try
{return this._isDebug;}
catch(err)
{}},ResponseError:function(sFunctionName,oResponse)
{var sErrorMessage='';var oError={};try
{if(oResponse!==null&&typeof oResponse!=='undefined')
{oError.source=sFunctionName;oError.name=oResponse.error.name;oError.message=this.ERROR_DEBUG_MESSAGE_LABEL+oResponse.error.message+'\n';oError.message+=this.ERROR_DEBUG_REQUEST_LABEL+oResponse.request.responseText+'\n';sErrorMessage+='JavaScript Error:'+'source:'+oError.source+', name:'+oError.name+', message:'+oError.message;this._logError(sErrorMessage);if(this._isDebug)
{this._development_Message(this.ERRORTYPE_AJAX_RESPONSE,sFunctionName,oError);}else
{this._friendly_Message(this.ERRORTYPE_AJAX_RESPONSE);}}
return;}
catch(err)
{}},ShowDebug:function(bShowDebug)
{try
{this._isDebug=bShowDebug;return;}
catch(err)
{}},_development_Message:function(eType,sFunctionName,oError)
{var sDebugErrorMessage;try
{sDebugErrorMessage=this.ERROR_DEBUG_HEADER+sFunctionName+'\n';sDebugErrorMessage+=this.ERROR_DASHLINE+'\n';sDebugErrorMessage+=this.ERROR_DEBUG_SOURCE_LABEL+oError.source+'\n';sDebugErrorMessage+=this.ERROR_DEBUG_NAME_LABEL+oError.name+'\n';sDebugErrorMessage+=this.ERROR_DEBUG_MESSAGE_LABEL+oError.message+'\n';alert(sDebugErrorMessage);return;}
catch(err)
{}},_friendly_Message:function(eType)
{var sFriendlyMessage='';try
{sFriendlyMessage=this.ERROR_FRIENDLY_HEADER+'\n';sFriendlyMessage+=this.ERROR_DASHLINE+'\n';switch(eType)
{case this.ERRORTYPE_JS:sFriendlyMessage+='    '+this.ERRORTYPE_JS_MESSAGE+'\n';break;case this.ERRORTYPE_AJAX:sFriendlyMessage+='    '+this.ERRORTYPE_AJAX_MESSAGE+'\n';break;case this.ERRORTYPE_AJAX_RESPONSE:sFriendlyMessage+='    '+this.ERRORTYPE_AJAX_RESPONSE_MESSAGE+'\n';break;case this.ERRORTYPE_VBCODE:sFriendlyMessage+='    '+this.ERRORTYPE_VBCODE_MESSAGE+'\n';break;case this.ERRORTYPE_VBDATA:sFriendlyMessage+='    '+this.ERRORTYPE_VBDATA_MESSAGE+'\n';break;default:sFriendlyMessage+='    '+this.ERRORTYPE_DEFAULT_MESSAGE+'\n';break;}
sFriendlyMessage+='    '+this.ERROR_FRIENDLY_FOOTER+'\n';alert(sFriendlyMessage);return;}
catch(err)
{}},_init:function()
{try
{this._isDebug=ISDEBUG;}
catch(err)
{}},_logError:function(strError)
{var sResult;try
{if(!this._isDebug)
{SearchUIController.LogClientError(strError);}
return;}
catch(err)
{}}};}();_oErrorHandler=NRT.ErrorHandler;_oErrorHandler._init();NRT.namespace("Utility");var _oUtility;var IsLayeredWindowActive=false;NRT.Utility=function()
{return{browserCookiesEnabled:function()
{var tmpcookie=new Date();var chkcookie;try
{chkcookie=(tmpcookie.getTime()+'');document.cookie="chkcookie="+chkcookie+"; path=/";if(document.cookie.indexOf(chkcookie,0)>0)
{this.deleteTestCookie(document.cookie);return true;}
else
{return false;}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.browserCookiesEnabled',_oErrorHandler.ERRORTYPE_JS,err);return;}},addNRTListener:function(targetElementName,eventName,callbackFunction)
{if(targetElementName==null||targetElementName==undefined||callbackFunction==null||callbackFunction==undefined)
return;else
{var targetElement=null;if(targetElementName.childNodes===undefined)
targetElement=document.getElementById(targetElementName);else
targetElement=targetElementName;if(targetElement==null||targetElement==undefined)
return;if(targetElement.attachEvent)
{targetElement.attachEvent('on'+eventName,callbackFunction);}
else
{targetElement.addEventListener(eventName,callbackFunction,false);}}},deleteTestCookie:function(name)
{var oldDate=new Date(1970,1,1);try
{document.cookie=name+"=0; expires="+oldDate.toGMTString();}
catch(err)
{_oErrorHandler.Error('NRT.Utility.deleteTestCookie',_oErrorHandler.ERRORTYPE_JS,err);return;}},browserType:function()
{var m_spm_sBrowser='';try
{if($.browser.msie)
m_spm_sBrowser="ie";else if($.browser.mozilla)
m_spm_sBrowser="mo";return m_spm_sBrowser;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.browserType',_oErrorHandler.ERRORTYPE_JS,err);return;}},setFocus:function(ctrl)
{try
{if(ctrl!==null&&typeof ctrl!=='undefined')
{if(ctrl.style.visibility==="hidden"||ctrl.style.display==="none"||ctrl.disabled===true)
{return;}else
{try
{ctrl.focus();}
catch(e)
{}}}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.setFocus',_oErrorHandler.ERRORTYPE_JS,err);return;}},createCollection:function(className)
{var obj=[];var t;var _item;try
{t=eval('new '+className+'()');for(_item in t)
{eval('obj.'+_item+'=t.'+_item);}
return obj;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.createCollection',_oErrorHandler.ERRORTYPE_JS,err);return;}},disableAnchor:function(obj,Disable)
{var sOldClassName;var sNewClassName='';try
{obj.Disable=Disable;sOldClassName=obj.className;if(Disable)
{if(sOldClassName.indexOf('link')>-1)
{obj.className=obj.className.replace('link','bold');}}else
{if(sOldClassName.indexOf('bold')>-1)
{obj.className=obj.className.replace('bold','link');}}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.disableAnchor',_oErrorHandler.ERRORTYPE_JS,err);return;}},decodeURL:function(stringToDecode)
{var HEXCHARS="0123456789ABCDEFabcdef";var encoded;var plaintext="";var i=0;var ch;try
{encoded=stringToDecode;while(i<encoded.length)
{ch=encoded.charAt(i);if(ch==="+")
{plaintext+=" ";i+=1;}else if(ch==="%")
{if(i<(encoded.length-2)&&HEXCHARS.indexOf(encoded.charAt(i+1))!==-1&&HEXCHARS.indexOf(encoded.charAt(i+2))!==-1)
{plaintext+=unescape(encoded.substr(i,3));i+=3;}else
{alert('Bad escape combination near ...'+encoded.substr(i));plaintext+="%[ERROR]";i+=1;}}else
{plaintext+=ch;i+=1;}}
return plaintext;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.decodeURL',_oErrorHandler.ERRORTYPE_JS,err);}},encodeURL:function(stringToEncode)
{var SAFECHARS="0123456789"+"ABCDEFGHIJKLMNOPQRSTUVWXYZ"+"abcdefghijklmnopqrstuvwxyz"+"-_.!~*'()";var HEX="0123456789ABCDEF";var plaintext=stringToEncode;var encoded="";var i;var ch;var charCode;try
{for(i=0;i<plaintext.length;i+=1)
{ch=plaintext.charAt(i);if(ch===" ")
{encoded+="+";}else if(SAFECHARS.indexOf(ch)!==-1)
{encoded+=ch;}else
{charCode=ch.charCodeAt(0);if(charCode>255)
{alert("Unicode Character '"+ch+"' cannot be encoded using standard URL encoding.\n"+"(URL encoding only supports 8-bit characters.)\n"+"A space (+) will be substituted.");encoded+="+";}else
{encoded+="%";encoded+=HEX.charAt((charCode>>4)&0xF);encoded+=HEX.charAt(charCode&0xF);}}}
return encoded;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.encodeURL',_oErrorHandler.ERRORTYPE_JS,err);}},getAppPath:function()
{var sAppPath=null;var oLocation=window.location;try
{if(oLocation!==null)
{sAppPath=oLocation.protocol+'//'+oLocation.hostname;}
return sAppPath;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.getAppPath',_oErrorHandler.ERRORTYPE_JS,err);}},getElementByTagNameAndID:function(sID,sTagName)
{var arrElements;var i;var objElement;try
{arrElements=document.getElementsByTagName(sTagName);if(arrElements.length>0)
{for(i=0;i<arrElements.length;i+=1)
{if(arrElements[i].id.indexOf(sID)>-1)
{objElement=document.getElementById(arrElements[i].id);if(objElement!==null&&typeof objElement!=='undefined')
{return objElement;}}}}
return null;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.getElementByTagNameAndID',_oErrorHandler.ERRORTYPE_JS,err);return;}},getElementsByTagNameAndID:function(sID,sTagName)
{var arrElements;var arrCleanupElements=[];var i;try
{arrElements=document.getElementsByTagName(sTagName);if(arrElements!==null&&typeof arrElements!=='undefined'&&arrElements.length>0)
{for(i=0;i<arrElements.length;i+=1)
{if(arrElements[i].id.indexOf(sID)>-1)
{arrCleanupElements.push(arrElements[i]);}}
return arrCleanupElements;}else
{return null;}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.getElementsByTagNameAndID',_oErrorHandler.ERRORTYPE_JS,err);return;}},getSelectedDetails:function(ctrl)
{try
{var strTemp=null;strTemp=$(ctrl).val();if(strTemp==null)
strTemp='';if($.isArray(strTemp))
strTemp=strTemp.join(",");return strTemp;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.getSelectedDetails',_oErrorHandler.ERRORTYPE_JS,err);return;}},isNumeric:function(sText)
{var ValidChars='0123456789.';var IsNumber=true;var Char;var i;try
{for(i=0;i<sText.length&&IsNumber===true;i+=1)
{Char=sText.charAt(i);if(ValidChars.indexOf(Char)===-1)
{IsNumber=false;}}
return IsNumber;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.isNumeric',_oErrorHandler.ERRORTYPE_JS,err);return;}},getActiveLayeredWindow:function()
{return IsLayeredWindowActive;},setActiveLayeredWindow:function(value)
{IsLayeredWindowActive=value;},initializeModalPopupExtender:function()
{try
{$(document).ready(function()
{Sys.require([Sys.components.modalPopup],function()
{$("#showThePopup").modalPopup({id:"modalPopup",PopupControlID:"pnlPopup",OkControlID:"hlClose",CancelControlID:"hlClose",shown:NRT.Utility.modalShown,hidden:NRT.Utility.modalHidden,OnOkScript:NRT.Utility.okayWasClicked,OnCancelScript:NRT.Utility.okayWasClicked,BackgroundCssClass:"modalBackgroundFilter"})});});}
catch(err)
{_oErrorHandler.Error('NRT.Utility.initializeModalPopupExtender',_oErrorHandler.ERRORTYPE_JS,err);return;}},okayWasClicked:function()
{NRT.Utility.setActiveLayeredWindow(false);},modalShown:function()
{var selector=$("#modalBody input:visible:first");if(selector.length>0)
{selector[0].focus();selector[0].focus();if(selector[0].type==='text')
{selector[0].select();}}
else
{selector=$("#modalBody img[onclick]:visible");if(selector.length>0)
selector[0].focus();else
{selector=$("#modalBody a:first");if(selector.length>0)
selector[0].focus();}}},modalHidden:function()
{try
{var modalPopupBehaviorCtrl=$find('modalPopup');if(modalPopupBehaviorCtrl)
{if(modalPopupBehaviorCtrl.restoreOnFocus!=="")
{elementToFocus=document.getElementById(modalPopupBehaviorCtrl.restoreOnFocus);if(elementToFocus!==null&&typeof(elementToFocus)!=='undefined')
{NRT.Utility.setFocus(elementToFocus);modalPopupBehaviorCtrl.restoreOnFocus=null;}}}
else
{return;}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.modalHidden',_oErrorHandler.ERRORTYPE_JS,err);return;}},closeLayeredPage:function(sDialogName)
{var tmpOverlay=null;try
{var modalPopupBehaviorCtrl=$find('modalPopup');if(modalPopupBehaviorCtrl)
{modalPopupBehaviorCtrl.hide();NRT.Utility.setActiveLayeredWindow(false);}
else
{return;}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.closeLayeredPage',_oErrorHandler.ERRORTYPE_JS,err);return;}},showLayeredPage:function(queryString,width,title,sDefFocusItemID,sDefFocusItemType)
{var defWidth=width!==null?width:540;var defTitle=title!==null?title:"&nbsp;";var k_d_ent=null;var DialogID="Dialog_"+title.replace(" ","_");try
{var url='/Property/host.aspx?'+queryString+'&WIDTH='+defWidth+'';$.get(url,{},function(content)
{var modalPopupBehaviorCtrl=$find('modalPopup');document.getElementById('modalPopupHeader').innerHTML=title;document.getElementById('modalBody').innerHTML=content;defWidth=defWidth+50;document.getElementById('modalContainer').style.width=defWidth+'px';document.getElementById('modalBody').style.display='block';document.getElementById('modalContainer').style.display='block';if(title=='DID YOU MEAN...?')
{}
else
{document.getElementById('modalContainer').style.height='auto';}
if(modalPopupBehaviorCtrl)
{if(!$.browser.safari)
{if(typeof(document.activeElement.id)!=='undefined')
{if(title!=='DID YOU MEAN...?')
{modalPopupBehaviorCtrl.restoreOnFocus=document.activeElement.id;}
else
{if(NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName()!=='TypeIn')
{modalPopupBehaviorCtrl.restoreOnFocus=document.activeElement.id;}}}}
modalPopupBehaviorCtrl.show();NRT.Utility.setActiveLayeredWindow(true);if($.browser.msie&&parseInt($.browser.version)<7)
{document.getElementById('modalContainer').style.top='-300px';document.getElementById('modalContainer').style.left='-600px';return;}
var height=(document.documentElement.clientHeight/2)-(document.getElementById('modalContainer').offsetHeight/2);document.getElementById('modalContainer').style.top=height+'px';var width=770/2-(defWidth/2);document.getElementById('modalContainer').style.left=width+'px';}});}
catch(err)
{_oErrorHandler.Error('NRT.Utility.showLayeredPage',_oErrorHandler.ERRORTYPE_JS,err);return;}},showInfo:function(sContent,width,title,sDefFocusItemID,sDefFocusItemType)
{var defWidth=width!==null?width:300;var defTitle=title!==null?title:"&nbsp;";var infoDialogID="infoDialog_"+title.replace(" ","_");try
{this.showAlert(sContent,width,title);}
catch(err)
{_oErrorHandler.Error('NRT.Utility.showInfo',_oErrorHandler.ERRORTYPE_JS,err);return;}},showAlert:function(sContent,width,title)
{var defWidth=width!==null?width:200;var defTitle=title!==null?title:"&nbsp;";var alertDialogID="alertDialog_"+title.replace(" ","_");try
{if(title==='UNABLE TO MAP PROPERTIES')
{var sHTML='';sHTML+="<table width ='";sHTML+=defWidth.toString();sHTML+="px'>";sHTML+="<tr>";sHTML+="<td style='font: 1em Arial'>";sHTML+=sContent;sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td height='1' >";sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td width ='";sHTML+=defWidth-20;sHTML+="px'>";sHTML+="</td><td align ='right' >";sHTML+="<button type ='button' onclick='NRT.Utility.closeLayeredPage();' class='button-group'> ";sHTML+="OK </button>";sHTML+="</td>";sHTML+="</tr>";sHTML+="</table>";sContent=sHTML;}
var modalPopupBehaviorCtrl=$find('modalPopup');document.getElementById('modalPopupHeader').innerHTML=title;document.getElementById('modalBody').innerHTML=sContent
defWidth=defWidth+30;document.getElementById('modalContainer').style.width=defWidth+'px';document.getElementById('modalBody').style.display='block';document.getElementById('modalContainer').style.display='block';document.getElementById('modalContainer').style.height='auto';if(modalPopupBehaviorCtrl)
{if(!$.browser.safari)
{if(typeof(document.activeElement.id)!=='undefined')
{modalPopupBehaviorCtrl.restoreOnFocus=document.activeElement.id;}}
modalPopupBehaviorCtrl.show();NRT.Utility.setActiveLayeredWindow(true);if($.browser.msie&&parseInt($.browser.version)<7)
{document.getElementById('modalContainer').style.top='-300px';document.getElementById('modalContainer').style.left='-600px';return;}
var height=(document.documentElement.clientHeight/2)-(document.getElementById('modalContainer').offsetHeight/2);document.getElementById('modalContainer').style.top=height+'px';var width=770/2-(defWidth/2);document.getElementById('modalContainer').style.left=width+'px';}
else
{return;}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.showAlert',_oErrorHandler.ERRORTYPE_JS,err);return;}},showMessage:function(msg)
{try
{var sHTML='';sHTML+="<table width ='400px'>";sHTML+="<tr>";sHTML+="<td style='font: 1em Arial'>";sHTML+=msg;sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td height='2' >";sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td width ='380px'></td><td align ='right' >";sHTML+="<input id='showAlert_btnOK' type ='button' onclick='NRT.Utility.closeLayeredPage();' class='button-group' value='OK' onkeypress='javascript:if(NRT.Utility.getKeyCode(event)===13){NRT.Utility.closeLayeredPage();}'> ";sHTML+="</td>";sHTML+="</tr>";sHTML+="</table>";this.showAlert(sHTML,420,'ALERT');return;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.showMessage',_oErrorHandler.ERRORTYPE_JS,err);return;}},showNewHostWindow:function(queryString,width,height,title)
{var defWidth=width!==null?width:200;var defHeight=height!==null?height:150;var defTitle=title!==null?title:"&nbsp;";try
{this.showNewWindow('/Property/host.aspx?'+queryString+'&WIDTH='+defWidth+'&HEIGHT='+defHeight+'',title,width,height);return;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.showNewHostWindow',_oErrorHandler.ERRORTYPE_JS,err);return;}},showNewWindow:function(url,name,width,height)
{var oWin;try
{oWin=window.open(url,name,'height='+height+',width='+width+',resizable=yes,scrollbars=yes,menubar=no,toolbar=no,status=no,titlebar=yes',true);return;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.showNewWindow',_oErrorHandler.ERRORTYPE_JS,err);return;}},xreplace:function(checkMe,toberep,repwith)
{var temp;var i;try
{temp=checkMe;i=temp.indexOf(toberep);while(i>-1)
{temp=temp.replace(toberep,repwith);i=temp.indexOf(toberep,i+repwith.length+1);}
return temp;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.xreplace',_oErrorHandler.ERRORTYPE_JS,err);return;}},getQueryStringParam:function(paramname)
{var regexS=new RegExp("[\\?&]"+paramname+"=([^&#]*)");var tmpURL;var results;try
{tmpURL=window.location.href;results=regexS.exec(tmpURL);if(results===null||typeof results==='undefined')
{return null;}else
{return results[1];}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.getQueryStringParam',_oErrorHandler.ERRORTYPE_JS,err);return;}},trimString:function(sInString)
{try
{sInString=sInString.replace(/^\s+/g,"");return sInString.replace(/\s+$/g,"");}
catch(err)
{_oErrorHandler.Error('NRT.Utility.trimString',_oErrorHandler.ERRORTYPE_JS,err);return;}},validEmail:function(emailAddress)
{var regexS=new RegExp(/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/);try
{return regexS.test(NRT.Utility.trimString(emailAddress));}
catch(err)
{_oErrorHandler.Error('NRT.Utility.validEmail',_oErrorHandler.ERRORTYPE_JS,err);return;}},validMLSNumber:function(mlsNumber)
{var sParseString='';var regexS=new RegExp(/^[-a-zA-Z0-9,*]+$/);try
{sParseString=mlsNumber.replace(/ /g,"");return regexS.test(NRT.Utility.trimString(sParseString));}
catch(err)
{_oErrorHandler.Error('NRT.Utility.validMLSNumber',_oErrorHandler.ERRORTYPE_JS,err);return;}},validPassword:function(password)
{var regexS=new RegExp(/^[a-zA-Z]\w {4,19} $/);try
{return regexS.test(NRT.Utility.trimString(password));}
catch(err)
{_oErrorHandler.Error('NRT.Utility.validPassword',_oErrorHandler.ERRORTYPE_JS,err);return;}},validZipCode:function(zipcode)
{var regexS=new RegExp(/(^\d {5} $)/);var aZipRanges;var aRanges;var i;var aValues;var aState;var sState;var minRange;var maxRange;try
{if(regexS.test(zipcode))
{aZipRanges=NRT.Property.Search.CityZip.getZipCodeRanges();aRanges=aZipRanges.split(",");if(aRanges.length>0)
{for(i=aRanges.length-1;i>=0;i-=1)
{aValues=aRanges[i].split("-");aState=aValues[0].split(":");sState=aState[0];minRange=aState[1];maxRange=aValues[1];if(zipcode>=minRange&&zipcode<=maxRange)
{return true;}}}}
return false;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.validZipCode',_oErrorHandler.ERRORTYPE_JS,err);return false;}},flipButton:function(button,mode)
{var oImg=eval(button);try
{switch(mode)
{case 1:if(oImg.src.indexOf('_Over.gif')<0)
{oImg.src=oImg.src.replace('.gif','_Over.gif');}
return;case 0:if(oImg.src.indexOf('_Over.gif')>-1)
{oImg.src=oImg.src.replace('_Over.gif','.gif');}
return;}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.flipButton',_oErrorHandler.ERRORTYPE_JS,err);return;}},getBranding:function(sPrefix)
{return NRT.Utility.Branding.getBranding(sPrefix);},createCookie:function(value,expiredays,expireminutes)
{var oExpireDate=null;var sCookie=null;try
{oExpireDate=new Date();if(expiredays===null)
{oExpireDate.setTime(oExpireDate.getTime()+(expireminutes*60*1000));sCookie="StateID="+escape(value)+((expireminutes===null)?"":"; expires="+oExpireDate.toGMTString())+"; path=/";}
else
{oExpireDate.setTime(oExpireDate.getTime()+(expiredays*24*3600*1000));sCookie="StateID="+escape(value)+((expiredays===null)?"":"; expires="+oExpireDate.toGMTString())+"; path=/";}
document.cookie=sCookie;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.createCookie',_oErrorHandler.ERRORTYPE_JS,err);}},getCookie:function(name)
{var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i<clen)
{var j=i+alen;if(document.cookie.substring(i,j)===arg)
{return(this.getCookieVal(j));}
i=document.cookie.indexOf(" ",i)+1;if(i===0)
{break;}}
return(null);},getCookieVal:function(offset)
{var endstr=document.cookie.indexOf(";",offset);if(endstr==-1)
{endstr=document.cookie.length;}
return(unescape(document.cookie.substring(offset,endstr)));},getWebsiteID:function()
{var oSearchCriteria=null;try
{oSearchCriteria=eval('('+NRT.Utility.getElementByTagNameAndID('hdnSrchCriteria','INPUT').value+')');if(oSearchCriteria!==null&&typeof oSearchCriteria!=='undefined')
{return oSearchCriteria.WebsiteID;}else
{return 0;}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.getWebsiteID',_oErrorHandler.ERRORTYPE_JS,err);}},getKeyCode:function(e)
{var key=null;try
{key=window.event?e.keyCode:e.which;return key;}
catch(err)
{_oErrorHandler.Error('NRT.Utility.getKeyCode',_oErrorHandler.ERRORTYPE_JS,err);}},objectExists:function(ctrl)
{try
{if(ctrl===null||typeof ctrl==='undefined')
{return false;}else
{return true;}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.objectExists',_oErrorHandler.ERRORTYPE_JS,err);}},highlightSelectedRadioButton:function(ctrl)
{try
{if(ctrl!==null||typeof ctrl!=='undefined')
{$(ctrl).find('input[type=radio]').each(function()
{if(this.checked)
{this.parentNode.className='textbold';}
else
{this.parentNode.className='text';}});}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.highlightSelectedRadioButton',_oErrorHandler.ERRORTYPE_JS,err);return;}}};}();_oUtility=NRT.Utility;
NRT.namespace("Utility.Branding");NRT.Utility.Branding=function()
{return{appendBranding:function(brandingID)
{var sBranding='';var bAgentBranding=false;var bTeamBranding=false;try
{if(brandingID!==null&&typeof brandingID!=='undefined'&&brandingID.length>0&&brandingID!=='')
{bAgentBranding=brandingID.indexOf('a')>-1;bTeamBranding=brandingID.indexOf('t')>-1;if(bAgentBranding)
{sBranding='&IsBranded=1&AgentID='+brandingID.substr(1,(brandingID.length-1));}
if(bTeamBranding)
{sBranding='&IsBranded=1&AgentTeamID='+brandingID.substr(1,(brandingID.length-1));}}
return sBranding;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.appendBranding',_oErrorHandler.ERRORTYPE_JS,err);return'';}},getBranding:function(sPrefix)
{var _sBranding='';var _sPrefix='';var _sAbrand=NRT.Utility.getQueryStringParam('AgentID');var _sTbrand=NRT.Utility.getQueryStringParam('TeamID');try
{if(_sAbrand!==null&&typeof _sAbrand!=='undefined')
{_sBranding='IsBranded=1&AgentID='+_sAbrand;}
if(_sTbrand!==null&&typeof _sTbrand!=='undefined')
{_sBranding='IsBranded=1&TeamID='+_sTbrand;}
else
{_sTbrand=NRT.Utility.getQueryStringParam('AgentTeamID');if(_sTbrand!==null&&_sTbrand!=='undefined')
{_sBranding='IsBranded=1&AgentTeamID='+_sTbrand;}}
if(_sBranding.length>0)
{if(sPrefix!==null&&typeof sPrefix!=='undefined'&&sPrefix==='?')
{_sPrefix='?';}else
{_sPrefix='&';}
return _sPrefix+_sBranding;}else
{return'';}}
catch(err)
{_oErrorHandler.Error('NRT.Utility.Branding.getBranding',_oErrorHandler.ERRORTYPE_JS,err);return'';}}};}();
NRT.namespace('Property');NRT.namespace('Property.Result');NRT.namespace('Property.Search');NRT.namespace('Property.Search.NewConstruction');NRT.namespace('Property.Search.QuickSearch');NRT.namespace('Property.Search.SchoolDistrict');NRT.namespace('Property.Validation');NRT.namespace('WebTrends');NRT.namespace('WebTrends.PropertySearch');NRT.namespace('WebTrends.PropertyResults');