
NRT.Property.Validation.TYPE_CITYZIP='0';NRT.Property.Validation.TYPE_NEARBYCITY='1';NRT.Property.Validation.TYPE_ADDRESS='2';NRT.Property.Validation.TYPE_MLSNUMBER='3';NRT.Property.Validation.TYPE_NEWCONSTRUCTION='4';NRT.Property.Validation.TYPE_SCHOOLDISTRICT='5';NRT.Property.Validation.TYPE_SUBDIVISIONS='6';NRT.Property.Validation.TYPE_QUICKSEARCH='7';NRT.Property.Validation.MESSAGE_COMMON_ERROR_TITLE='Please correct the following errors:';NRT.Property.Validation.MESSAGE_COMMON_SELLOC_EMPTY='At least one <b>Location</b> must be added to your Selected Locations list.';NRT.Property.Validation.MESSAGE_CITYZIP_DUPLICATE_LOC='has already been added.';NRT.Property.Validation.MESSAGE_CITYZIP_TYPEIN_LOC_EMPTY='Please enter a location first, then click "Add".';NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_LOC_EMPTY='Please enter a location first, then click "Add".';NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_LOCS_NOTFOUND='No locations could be found for the selected state and/or region.';NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_LOCS_MAX='Maximum locations.';NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY='Please select a state above.';NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_STATE_EMPTY='Please select a state.';NRT.Property.Validation.MESSAGE_NBCITIES_LOC_EMPTY='Please enter a location first, then click the "Show Nearby Cities" button.';NRT.Property.Validation.MESSAGE_NBCITIES_NO_SELECTIONS='Please select at least one city or community.';NRT.Property.Validation.MESSAGE_NBCITIES_LOCTYPEIN_EMPTY='Please enter a location.';NRT.Property.Validation.MESSAGE_ADDDRES_ADDRESS_EMPTY='Please enter any part of a street address.';NRT.Property.Validation.MESSAGE_ADDRESS_CITY_EMPTY='Please enter a city.';NRT.Property.Validation.MESSAGE_ADDRESS_STATE_EMPTY='Please select a state.';NRT.Property.Validation.MESSAGE_ADDRESS_REGION_EMPTY='Please select a region.';NRT.Property.Validation.MESSAGE_MLS_MLS_EMPTY='Please enter an MLSTABLABEL number.';NRT.Property.Validation.MESSAGE_MLS_WRONGDELIMINATOR='No special characters are allowed, only commas can be used to separate the numbers.<br>Please re-enter a valid MLS number or multiple numbers separated by commas.';NRT.Property.Validation.MESSAGE_SUBDIVISIONS_SUBDIVISIONS_EMPTY='Please enter any part of a subdivision.';NRT.Property.Validation.MESSAGE_LOCATION_INVALID='No special characters are allowed when entering a location. Please re-enter a valid location.';NRT.Property.Validation.MESSAGE_LOCATION_ZIPCODE_INVALID='This is an invalid zip code or one that is not part of our company\'s coverage area.<br><br>Please enter a valid 5 digit  zip code.';NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_PROPTYPE_EMPTY='At least one <b>Property Type</b> must be selected.';NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_MAXPRICE_INVALID='The <b>Maximum Price</b> must be greater than the minimum price.';NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_MAXACRES_INVALID='The <b>Maximum Acreage</b> must be greater than the minimum acreage.';NRT.Property.Validation.MESSAGE_DIDYOUMEAN_LOC_EMPTY='Please select at least one recommended location, or click "Cancel".';NRT.Property.Validation.MESSAGE_COMMSELECT_COMM_EMPTY='Please select at least one community, \r\n or choose ';NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_DUPLICATE_LOC='has already been added.';NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_LOCATIONLIST_LOC_EMPTY='Please select at least one recommended school district.';NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_LOCATIONLIST_LOCS_NOTFOUND='No school districts could be found for the selected state and/or region.';NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_LOCATIONLIST_LOCS_MAX='Maximum school districts.';NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_SELLOC_EMPTY='At least one <b>School District</b> must be added to your Selected School Districts list.';NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_DISTRICTLIST_STATE_EMPTY='Please select a state above.';NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_STATE_EMPTY='Please select a state.';NRT.Property.Validation.MESSAGE_NEWCONSTRUCTION_STATE_EMPTY='Please select a state.';NRT.Property.Validation.UI=function()
{return{closeMaxLocationsWindow:function()
{var DialogID=null;try
{DialogID="infoDialog_"+_WinTitle_LocationMax.replace(" ","_");_oUtility.closeLayeredPage(DialogID);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.closeMaxLocationsWindow',_oErrorHandler.ERRORTYPE_JS,err);return;}},displayMaxLocationsMessage:function()
{var sHTML="";try
{sHTML+="<table style='border:0px; padding:0px; WIDTH:"+(_WinW_LocationMax-10)+"px;'>";sHTML+="<tr>";sHTML+="<td class='text'>";sHTML+="You have reached the maximum limit of "+_MaxLocations+' locations.';sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td>";sHTML+="<TABLE style='padding:0px; border:0px; width:100%;'>";sHTML+="<TR>";sHTML+="<td style='height:9px;' class='separatorLineH'>";sHTML+="<img src='/NRTProducts/include/images/common_spacer.gif' border='0' width='100%' height='9'>";sHTML+="</td>";sHTML+="</TR>";sHTML+="</TABLE>";sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td style='text-align:center;'>";sHTML+="<img id='"+_DefFocusItemID_LocationMax+"' border='0' class='pointer' src='/NRTProducts/include/images/btnOK.gif'";sHTML+=" onmouseover=\"javascript:NRT.Utility.flipButton(this,1);\" onmouseout=\"javascript:NRT.Utility.flipButton(this,0);\"";sHTML+=" onclick=\"javascript:NRT.Property.Validation.UI.closeMaxLocationsWindow();this.onblur=null;\" onblur=\"javascript:this.focus();\">";sHTML+="</td>";sHTML+="</tr>";sHTML+="</table>";_oUtility.showInfo(sHTML,_WinW_LocationMax,_WinTitle_LocationMax,_DefFocusItemID_LocationMax,_DefFocusItemType_LocationMax);return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.displayMaxLocationsMessage',_oErrorHandler.ERRORTYPE_JS,err);return;}},showSelectedLocations:function(bError)
{var oSelLocations=null;try
{if(NRT.Property.Search.Utility.getActiveDiv()==='CZT')
{oSelLocations=_oUtility.getElementByTagNameAndID('td_CityZipTypeIn_SelectedLocations','TD');}else{oSelLocations=_oUtility.getElementByTagNameAndID('td_CityZipLocationList_SelectedLocations','TD');}
this._displayError(oSelLocations,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showSelectedLocations',_oErrorHandler.ERRORTYPE_JS,err);return;}},showSelectedSchoolDistricts:function(bError)
{var oSelLocations=null;try
{oSelLocations=_oUtility.getElementByTagNameAndID('td_SchoolDistrictList_SelectedSchoolDistricts','TD');this._displayError(oSelLocations,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showSelectedSchoolDistricts',_oErrorHandler.ERRORTYPE_JS,err);return;}},showPropertyType:function(bError)
{var oPropertyType;try
{oPropertyType=_oUtility.getElementByTagNameAndID('tdPropertyTypeTitle','TD');this._displayError(oPropertyType,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showPropertyType',_oErrorHandler.ERRORTYPE_JS,err);return;}},showInvalidMaxPrice:function(bError)
{var oMaxPrice;try
{oMaxPrice=_oUtility.getElementByTagNameAndID('ddlMaxPrice','SELECT');this._displayError(oMaxPrice,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showInvalidMaxPrice',_oErrorHandler.ERRORTYPE_JS,err);return;}},showInvalidMaxRentalPrice:function(bError)
{var oMaxPrice;try
{oMaxPrice=_oUtility.getElementByTagNameAndID('ddlRentalMaxPrice','SELECT');this._displayError(oMaxPrice,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showInvalidMaxRentalPrice',_oErrorHandler.ERRORTYPE_JS,err);return;}},showInvalidMaxAcres:function(bError)
{var oMaxAcres;try
{oMaxAcres=_oUtility.getElementByTagNameAndID('ddlMaxAcres','SELECT');this._displayError(oMaxAcres,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showInvalidMaxAcres',_oErrorHandler.ERRORTYPE_JS,err);return;}},showAddress:function(bError)
{var oAddress;try
{oAddress=_oUtility.getElementByTagNameAndID('spn_Address_Address','SPAN');this._displayError(oAddress,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showAddress',_oErrorHandler.ERRORTYPE_JS,err);return;}},showCity:function(bError)
{var oCity;try
{oCity=_oUtility.getElementByTagNameAndID('spn_Address_City','SPAN');this._displayError(oCity,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showCity',_oErrorHandler.ERRORTYPE_JS,err);return;}},showState:function(bError)
{var oState;try
{oState=_oUtility.getElementByTagNameAndID('spn_Address_State','SPAN');this._displayError(oState,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showState',_oErrorHandler.ERRORTYPE_JS,err);return;}},showStateList:function(bError){var oState;try{oState=_oUtility.getElementByTagNameAndID('ddlState','SELECT');this._displayError(oState,bError);}
catch(err){_oErrorHandler.Error('NRT.Property.Validation.UI.showStateLost',_oErrorHandler.ERRORTYPE_JS,err);return;}},showRegion:function(bError)
{var oRegion;try
{oRegion=_oUtility.getElementByTagNameAndID('spn_Address_Region','SPAN');this._displayError(oRegion,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showRegion',_oErrorHandler.ERRORTYPE_JS,err);return;}},showMLSNumber:function(bError)
{var oMlsNumber;try
{oMlsNumber=_oUtility.getElementByTagNameAndID('spn_MlsNumber_TextDesc','SPAN');this._displayError(oMlsNumber,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showMLSNumber',_oErrorHandler.ERRORTYPE_JS,err);return;}},showSubDivisions:function(bError)
{var oSubDivisions;try
{oSubDivisions=_oUtility.getElementByTagNameAndID('spn_SubDivisions_TextDesc','SPAN');this._displayError(oSubDivisions,bError);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.UI.showSubDivisions',_oErrorHandler.ERRORTYPE_JS,err);return;}},showInvalidMaxSubDivisionPrice:function(bError){var oMaxPrice;try{oMaxPrice=_oUtility.getElementByTagNameAndID('ddlMaxSubDivisionPrice','SELECT');this._displayError(oMaxPrice,bError);}
catch(err){_oErrorHandler.Error('NRT.Property.Validation.UI.showInvalidMaxSubDivisionPrice',_oErrorHandler.ERRORTYPE_JS,err);return;}},_displayError:function(oObject,bError)
{var sErrorClassName='error_message_text';if(oObject!==null){if(oObject.tagName==='SELECT'){oObject=oObject.parentNode;sErrorClassName='error_message_box';}
if(bError===true){if(_oUtility.trimString(oObject.className).length>0){oObject.className+=' '+sErrorClassName;}else{oObject.className=sErrorClassName;}}else{oObject.className=_oUtility.trimString(oObject.className.replace(sErrorClassName,''));}}}};}();NRT.Property.Validation.Summary=function()
{return{clear:function()
{var oValidationsNode=null;var type='';var divValidation=null;try
{oValidationsNode=_oValidationXML.xmlDoc.firstChild.firstChild;if(oValidationsNode!==null&&oValidationsNode.attributes.length>0)
{type=oValidationsNode.attributes[0].value;switch(type)
{case NRT.Property.Validation.TYPE_CITYZIP:divValidation=_oUtility.getElementByTagNameAndID('div_CityZip_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_NEARBYCITY:divValidation=_oUtility.getElementByTagNameAndID('div_NearbyCities_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_ADDRESS:divValidation=_oUtility.getElementByTagNameAndID('div_Address_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_MLSNUMBER:divValidation=_oUtility.getElementByTagNameAndID('div_MLSNumber_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_NEWCONSTRUCTION:divValidation=_oUtility.getElementByTagNameAndID('div_NewConstruction_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_SCHOOLDISTRICT:divValidation=_oUtility.getElementByTagNameAndID('div_SchoolDistrict_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_SUBDIVISIONS:divValidation=_oUtility.getElementByTagNameAndID('div_SubDivisions_ValidSummary','DIV');break;}
if(divValidation!==null)
{divValidation.innerHTML='';divValidation.style.display='none';}
_oValidationXML.clear();}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.Summary.clear',_oErrorHandler.ERRORTYPE_JS,err);return;}},getValidationSummaryHtml:function()
{var sValidationXML=null;var serializer;try
{if(_oUtility.browserType()==='ie')
{sValidationXML=_oValidationXML.xmlDoc.getElementsByTagName("Validations")[0].xml;}else{serializer=new XMLSerializer();sValidationXML=serializer.serializeToString(_oValidationXML.xmlDoc.getElementsByTagName("Validations")[0]);}
if(sValidationXML!==null)
{SearchUIController.GetValidationSummaryHtml(sValidationXML,this._getValidationSummaryHtml_Callback);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.Summary.getValidationSummaryHtml',_oErrorHandler.ERRORTYPE_JS,err);return;}},hide:function(type)
{var divValidation=null;try
{switch(type)
{case NRT.Property.Validation.TYPE_CITYZIP:divValidation=_oUtility.getElementByTagNameAndID('div_CityZip_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_NEARBYCITY:divValidation=_oUtility.getElementByTagNameAndID('div_NearbyCities_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_ADDRESS:divValidation=_oUtility.getElementByTagNameAndID('div_Address_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_MLSNUMBER:divValidation=_oUtility.getElementByTagNameAndID('div_MLSNumber_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_NEWCONSTRUCTION:divValidation=_oUtility.getElementByTagNameAndID('div_NewConstruction_ValidSummary','DIV');if(divValidation==null){divValidation=_oUtility.getElementByTagNameAndID('div_SchoolDistrict_ValidSummary','DIV');}
break;case NRT.Property.Validation.TYPE_SCHOOLDISTRICT:divValidation=_oUtility.getElementByTagNameAndID('div_SchoolDistrict_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_SUBDIVISIONS:divValidation=_oUtility.getElementByTagNameAndID('div_SubDivisions_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_QUICKSEARCH:divValidation=_oUtility.getElementByTagNameAndID('div_QuickSearch_ValidSummary','DIV');break;}
if(divValidation!==null)
{divValidation.innerHTML='';divValidation.style.display='none';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.Summary.hide',_oErrorHandler.ERRORTYPE_JS,err);return;}},show:function()
{try
{this.getValidationSummaryHtml();}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.Summary.show',_oErrorHandler.ERRORTYPE_JS,err);return;}},_getValidationSummaryHtml_Callback:function(response)
{var oValidationsNode;var type;var divValidation=null;try
{if(response.error!==null)
{_oErrorHandler.ResponseError('NRT.Property.Validation.Summary._getValidationSummaryHtml_Callback',response);return;}
else
{if(response!==null&&response.value!==null&&response.value!==undefined)
{oValidationsNode=_oValidationXML.xmlDoc.childNodes[0].childNodes[0];type=oValidationsNode.attributes[0].value;switch(type)
{case NRT.Property.Validation.TYPE_CITYZIP:divValidation=_oUtility.getElementByTagNameAndID('div_CityZip_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_NEARBYCITY:divValidation=_oUtility.getElementByTagNameAndID('div_NearbyCities_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_ADDRESS:divValidation=_oUtility.getElementByTagNameAndID('div_Address_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_MLSNUMBER:divValidation=_oUtility.getElementByTagNameAndID('div_MLSNumber_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_NEWCONSTRUCTION:divValidation=_oUtility.getElementByTagNameAndID('div_NewConstruction_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_SCHOOLDISTRICT:divValidation=_oUtility.getElementByTagNameAndID('div_SchoolDistrict_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_SUBDIVISIONS:divValidation=_oUtility.getElementByTagNameAndID('div_SubDivisions_ValidSummary','DIV');break;case NRT.Property.Validation.TYPE_QUICKSEARCH:divValidation=_oUtility.getElementByTagNameAndID('div_QuickSearch_ValidSummary','DIV');break;}
if(divValidation!==null)
{divValidation.innerHTML=response.value;divValidation.style.display='inline';}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.Summary._getValidationSummaryHtml_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}}};}();NRT.Property.Validation.XML=function()
{var root;var oRootNode;if(_oUtility.browserType()==="ie")
{this.xmlDoc=new ActiveXObject('Microsoft.XMLDOM');}else if(document.implementation&&document.implementation.createDocument)
{this.xmlDoc=document.implementation.createDocument('','ValidationInfo',null);}
if(_oUtility.browserType()==="ie")
{root=this.xmlDoc.createElement('ValidationInfo');this.xmlDoc.documentElement=root;this.xmlObj=this.xmlDoc.documentElement;}else if(document.implementation&&document.implementation.createDocument)
{this.xmlObj=this.xmlDoc.documentElement;}
oRootNode=this.xmlDoc.childNodes[0];oRootNode.appendChild(this.xmlDoc.createElement('Validations'));};NRT.Property.Validation.XML.prototype.xmlDoc=null;NRT.Property.Validation.XML.prototype.xmlObj=null;NRT.Property.Validation.XML.prototype.addValidation=function(type,message)
{var oRootNode;var oValidationsNode=null;try
{if(this.xmlObj!==null)
{oRootNode=this.xmlDoc.childNodes[0];if(oRootNode!==null)
{oValidationsNode=oRootNode.selectSingleNode("//Validations");if(oValidationsNode===null||typeof oValidationsNode==='undefined')
{oRootNode.appendChild(this.xmlDoc.createElement('Validations'));oValidationsNode=oRootNode.selectSingleNode("//Validations");}
oValidationsNode.setAttribute("type",type);this._addValidationNode(oValidationsNode,message);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.XML.addValidation',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Validation.XML.prototype.clear=function()
{var oRootNode;var oValidationsNode;try
{if(this.xmlObj!==null)
{oRootNode=this.xmlDoc.childNodes[0];if(oRootNode!==null)
{oValidationsNode=this.xmlObj.selectSingleNode("//Validations");if(oValidationsNode!==null)
{oRootNode.removeChild(oValidationsNode);}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.XML.clear',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Validation.XML.prototype.count=function()
{var ovalidationsNode;try
{ovalidationsNode=this.xmlDoc.childNodes[0].childNodes[0];if(ovalidationsNode===null||typeof ovalidationsNode==='undefined')
{return 0;}else{return this.xmlDoc.childNodes[0].childNodes[0].childNodes.length;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.XML.count',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Validation.XML.prototype.messageExists=function(message)
{var oRootNode=null;var oValidationsNode=null;var oValidationNode=null;try
{if(this.xmlObj!==null)
{oRootNode=this.xmlDoc.childNodes[0];if(oRootNode!==null)
{oValidationsNode=oRootNode.selectSingleNode("//Validations");if(oValidationsNode!==null&&typeof oValidationsNode!=='undefined')
{for(i=0;i<oValidationsNode.childNodes.length;i+=1)
{oValidationNode=oValidationsNode.childNodes[i];if(oValidationNode!==null||typeof oValidationNode!=='undefined')
{if(oValidationNode.getAttribute("message")===message)
{return true;}}}}}}
return false;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.XML.messageExists',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Validation.XML.prototype.removeValidation=function(type,message)
{var oRootNode=null;var oValidationsNode=null;var oValidationNode=null;try
{if(this.xmlObj!==null)
{oRootNode=this.xmlDoc.childNodes[0];if(oRootNode!==null)
{oValidationsNode=oRootNode.selectSingleNode("//Validations");if(oValidationsNode!==null&&typeof oValidationsNode!=='undefined')
{for(i=0;i<oValidationsNode.childNodes.length;i+=1)
{oValidationNode=oValidationsNode.childNodes[i];if(oValidationNode!==null||typeof oValidationNode!=='undefined')
{if(oValidationNode.getAttribute("message")===message)
{oValidationsNode.removeChild(oValidationNode);break;}}}}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Validation.XML.removeValidation',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Validation.XML.prototype._createNode=function(nodeName)
{var oCurrNode=null;oCurrNode=this.xmlDoc.createElement(nodeName);return oCurrNode;};NRT.Property.Validation.XML.prototype._addValidationNode=function(parentNode,message)
{var oValidationNode=this._createNode("validation");oValidationNode.setAttribute("message",message);parentNode.appendChild(oValidationNode);return oValidationNode;};var oNSResolver;var aItems;var aResult=[];var i;if(document.implementation.hasFeature("XPath","3.0"))
{XMLDocument.prototype.selectNodes=function(cXPathString,xNode)
{if(!xNode)
{xNode=this;}
oNSResolver=this.createNSResolver(this.documentElement);aItems=this.evaluate(cXPathString,xNode,oNSResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(i=0;i<aItems.snapshotLength;i+=1)
{aResult[i]=aItems.snapshotItem(i);}
return aResult;};Element.prototype.selectNodes=function(cXPathString)
{if(this.ownerDocument.selectNodes)
{return this.ownerDocument.selectNodes(cXPathString,this);}else{throw"For XML Elements Only";}};}
var xItems;if(document.implementation.hasFeature("XPath","3.0"))
{XMLDocument.prototype.selectSingleNode=function(cXPathString,xNode)
{if(!xNode)
{xNode=this;}
xItems=this.selectNodes(cXPathString,xNode);if(xItems.length>0)
{return xItems[0];}else{return null;}};Element.prototype.selectSingleNode=function(cXPathString)
{if(this.ownerDocument.selectSingleNode)
{return this.ownerDocument.selectSingleNode(cXPathString,this);}else{throw"For XML Elements Only";}};}
NRT.Property.Search.CityZip=function()
{var _zipCodeRanges;var _mapPanelIDs=new Array();return{getZipCodeRanges:function()
{return _zipCodeRanges;},setZipCodeRanges:function(value)
{_zipCodeRanges=value;},addLocationFromListBox:function(bSearch)
{var lstCtrl;var olocCollection;var i;var str;var idx;var idx2;var locID;var locName;var locIsParent;var sCommunities=null;var locIsCommunity;var stateID;try
{NRT.Property.Search.CityZip.clearErrorMessage();lstCtrl=NRT.Property.Search.GlobalObject.lstAvailLocations();olocCollection=new _oUtility.createCollection('NRT.Property.Search.LocationCollection');stateID=NRT.Property.Search.State.getStateID();if(stateID<1){NRT.Property.Search.CityZip.showErrorMessage(NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY);return false;}
for(i=0;i<lstCtrl.childNodes.length;i+=1)
{if(lstCtrl.childNodes.item(i).selected)
{_SelectedLocations=_SelectedLocations+1;if(_SelectedLocations>_MaxLocations-_oCZLocationXML.count())
{_SelectedLocations=0;_oValidationXML.addValidation(NRT.Property.Validation.TYPE_CITYZIP,NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_LOCS_MAX);NRT.Property.Validation.UI.displayMaxLocationsMessage();return false;}
str=lstCtrl.childNodes.item(i).value;idx=str.indexOf('-');idx2=str.lastIndexOf('-');locID=str.substring(0,idx);locName=lstCtrl.childNodes.item(i).text;locIsParent=str.substring(idx+1,idx2);locIsCommunity=str.substring(idx2+1,str.length);if(_oCZLocationXML.locationExists(locID)&&_SelectedLocations===1)
{_oUtility.showMessage(locName+' '+NRT.Property.Validation.MESSAGE_CITYZIP_DUPLICATE_LOC);}
olocCollection.add(new NRT.Property.Search.Location(locID,locName,locIsParent,sCommunities,locIsCommunity));}}
if(olocCollection.length===0)
{if(bSearch===null||typeof bSearch==='undefined'){NRT.Property.Search.CityZip.showErrorMessage(NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_LOC_EMPTY);NRT.Property.Validation.UI.showSelectedLocations(true);}else{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_CITYZIP,NRT.Property.Validation.MESSAGE_COMMON_SELLOC_EMPTY);NRT.Property.Validation.UI.showSelectedLocations(true);}
return false;}else{NRT.Property.Validation.UI.showSelectedLocations(false);}
if(olocCollection!==null)
{_oCZLocationXML.addLocations(olocCollection);this.refreshSelectedLocations(NRT.Property.Search.GlobalObject.divSelectedLocations());_oValidationXML.removeValidation(NRT.Property.Validation.TYPE_CITYZIP,NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_LOC_EMPTY);NRT.Property.Search.Utility.validate();}
_SelectedLocations=0;}
catch(err)
{_SelectedLocations=0;_oErrorHandler.Error('NRT.Property.Search.CityZip.addLocationFromListBox',_oErrorHandler.ERRORTYPE_JS,err);return;}},clearErrorMessage:function()
{var spnErrMessage;try
{if(NRT.Property.Search.Utility.getActiveDiv()==='CZT'){spnErrMessage=document.getElementById('spnCityZipTypeInErrMessage');}else{spnErrMessage=document.getElementById('spnCityZipLocationListErrMessage');}
if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML='';spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.clearErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}},closeMap:function()
{var DialogID=null;try
{DialogID="Dialog_"+_WinTitle_MapSelection.replace(" ","_");_oUtility.closeLayeredPage(DialogID);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.closeMap',_oErrorHandler.ERRORTYPE_JS,err);return;}},loadDiv:function(divID)
{var olnkTypeIn;var olnkLocationList;var oDivCZTI;var oDivCZLL;var divInstructionText;var oTxtIntellisense;var oAvailLocs;var nStateID=0;var ctrlName=null;var rbtnlName=null;var rbCtrlList=null;try
{olnkTypeIn=_oUtility.getElementByTagNameAndID('lblTypeIn','LABEL');olnkLocationList=_oUtility.getElementByTagNameAndID('lblLocationList','LABEL');oDivCZTI=_oUtility.getElementByTagNameAndID('div_CityZip_TypeIn','DIV');oDivCZLL=_oUtility.getElementByTagNameAndID('div_CityZip_LocationList','DIV');divInstructionText=_oUtility.getElementByTagNameAndID('div_CityZip_InstructionText','DIV');_oUtility.disableAnchor(olnkTypeIn,true);_oUtility.disableAnchor(olnkLocationList,true);switch(divID)
{case'div_CityZip_TypeIn':oDivCZTI.className='showDiv';oDivCZLL.className='hideDiv';divInstructionText.innerHTML=NRT.Property.Search.INSTRUCTION_CITYZIP_TYPEIN;NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('TypeIn');NRT.Property.Search.State.setDefault(true);NRT.Property.Search.Region.setDefault(true);NRT.Property.Search.CityZip._getSelectedLocations(divID);if(_bRestore===true)
{NRT.Property.Search.CityZip.refreshSelectedLocations(NRT.Property.Search.GlobalObject.divSelectedLocations());}
_oUtility.disableAnchor(olnkLocationList,false);NRT.Property.Search.Utility.setActiveDiv('CZT');oTxtIntellisense=_oUtility.getElementByTagNameAndID('txtIntellisense','INPUT');_oUtility.setFocus(oTxtIntellisense);nStateID=NRT.Property.Search.State.getStateID();if(NRT.Property.Search.State.getIsVisible()==='True'&&nStateID<=0)
{oTxtIntellisense.value=NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY;oTxtIntellisense.disabled=true;}else{oTxtIntellisense.disabled=false;}
if(_bRestore===false){_oUtility.setFocus(oTxtIntellisense);}
break;case'div_CityZip_LocationList':oDivCZTI.className='hideDiv';oDivCZLL.className='showDiv';NRT.Property.Search.Utility.setActiveDiv('CZL');_oUtility.disableAnchor(olnkTypeIn,false);divInstructionText.innerHTML=NRT.Property.Search.INSTRUCTION_CITYZIP_LOCATIONLIST;NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('LocationList');NRT.Property.Search.State.setDefault(true);NRT.Property.Search.Region.setDefault(true);this._loadLocationList('div_CityZip_LocationList');ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();rbtnlName='rbtnl_'+ctrlName+'_States';rbCtrlList=document.getElementById(rbtnlName);NRT.Utility.highlightSelectedRadioButton(rbCtrlList);NRT.Property.Search.Region.getCounties();NRT.Property.Search.County.getLocations('');if(_bRestore===true)
{NRT.Property.Search.County.selectCounty();NRT.Property.Search.CityZip.refreshSelectedLocations(NRT.Property.Search.GlobalObject.divSelectedLocations());_bRestore=false;}
_oUtility.disableAnchor(olnkTypeIn,false);NRT.Property.Search.Utility.setActiveDiv('CZL');oAvailLocs=_oUtility.getElementByTagNameAndID('lst_CityZipLocationList_AvailLocations','SELECT');_oUtility.setFocus(oAvailLocs);if(_bRestore===false){_oUtility.setFocus(oAvailLocs);}
break;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.loadDiv',_oErrorHandler.ERRORTYPE_JS,err);return;}},loadREODiv:function(divID)
{var olnkTypeIn;var olnkLocationList;var oDivCZTI;var oDivCZLL;var oDivCZSel
var divInstructionText;var oTxtIntellisense;var oAvailLocs;try
{oDivCZLL=_oUtility.getElementByTagNameAndID('div_REO_LocationList','DIV');divInstructionText=_oUtility.getElementByTagNameAndID('div_CityZip_InstructionText','DIV');NRT.Property.Search.Utility.setActiveDiv('REO');oDivCZLL.className='showDiv';divInstructionText.innerHTML=NRT.Property.Search.INSTRUCTION_CITYZIP_LOCATIONLIST;NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('LocationList');NRT.Property.Search.State.setDefault(true);NRT.Property.Search.Region.setDefault(true);this._loadLocationList('div_REO_LocationList');NRT.Property.Search.Region.getCounties();NRT.Property.Search.County.getLocations();if(_bRestore===true)
{NRT.Property.Search.County.selectCounty();NRT.Property.Search.CityZip.refreshSelectedLocations(NRT.Property.Search.GlobalObject.divSelectedLocations());_bRestore=false;}
oAvailLocs=_oUtility.getElementByTagNameAndID('lst_CityZipLocationList_AvailLocations','SELECT');oAvailLocs.focus();if(_bRestore===false)
{oAvailLocs.focus();}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.loadREODiv',_oErrorHandler.ERRORTYPE_JS,err);return;}},loadLIDiv:function(divID)
{var olnkTypeIn;var olnkLocationList;var oDivCZTI;var oDivCZLL;var oDivCZSel
var divInstructionText;var oTxtIntellisense;var oAvailLocs;try
{oDivCZLL=_oUtility.getElementByTagNameAndID('div_LimitedInv_LocationList','DIV');divInstructionText=_oUtility.getElementByTagNameAndID('div_CityZip_InstructionText','DIV');NRT.Property.Search.Utility.setActiveDiv('LI');oDivCZLL.className='showDiv';divInstructionText.innerHTML=NRT.Property.Search.INSTRUCTION_CITYZIP_LOCATIONLIST;NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('LocationList');NRT.Property.Search.State.setDefault(true);NRT.Property.Search.Region.setDefault(true);this._loadLocationList('div_LimitedInv_LocationList');NRT.Property.Search.Region.getCounties();NRT.Property.Search.County.getLocations();if(_bRestore===true)
{NRT.Property.Search.County.selectCounty();NRT.Property.Search.CityZip.refreshSelectedLocations(NRT.Property.Search.GlobalObject.divSelectedLocations());_bRestore=false;}
oAvailLocs=_oUtility.getElementByTagNameAndID('lst_CityZipLocationList_AvailLocations','SELECT');if(oAvailLocs.disabled==false)
{oAvailLocs.focus();}
if(_bRestore===false&&oAvailLocs.disabled==false)
{oAvailLocs.focus();}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.loadLIDiv',_oErrorHandler.ERRORTYPE_JS,err);return;}},refreshSelectedLocations:function(divCtrl)
{var data;var spnLocTotal;var locRecord;var locID;var locName;var locIsParent;var locTable;var table;var x;try
{if(divCtrl!==null)
{divCtrl.innerHTML='';data=_oCZLocationXML.xmlDoc.getElementsByTagName('Locations')[0];if(data!==null)
{if(ISDEBUG)
{spnLocTotal=document.getElementById('spnLocationTotal');if(spnLocTotal!==null&&typeof spnLocTotal!=='undefined')
{spnLocTotal.innerHTML=data.childNodes.length;}}
for(x=0;x<data.childNodes.length;x+=1)
{if(data.childNodes[x]!==null)
{if(data.childNodes[x].nodeType===1)
{locRecord=data.childNodes[x];locID=locRecord.attributes[0].value;locName=locRecord.attributes[1].value;locIsParent=locRecord.attributes[2].value;locTable=document.getElementById(divCtrl.id+'_tblSelectLocation'+locID);if(locTable===null||typeof locTable==='undefined')
{table=document.createElement('table');table.setAttribute('id','tblSelectLocation'+locID);table.setAttribute('border','0');this._addToSelectedLocationsDiv(table,locID,locName,locIsParent);divCtrl.appendChild(table);}}}}}
divCtrl.scrollTop=divCtrl.scrollHeight;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.refreshSelectedLocations',_oErrorHandler.ERRORTYPE_JS,err);return;}},removeLocationFromSelectedLists:function(id)
{try
{NRT.Property.Search.CityZip._removeLocationFromSelectedList(document.getElementById('div_CityZipTypeIn_SelectedLocations'),id);NRT.Property.Search.CityZip._removeLocationFromSelectedList(document.getElementById('div_CityZipLocationList_SelectedLocations'),id);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.removeLocationFromSelectedLists',_oErrorHandler.ERRORTYPE_JS,err);return;}},restoreUI:function()
{var iConsumerSearchID;var iSearchID;var oSearchCriteria=null;try
{iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();if(iConsumerSearchID>0)
{oSearchCriteria=SearchController.GetPersistedConsumerSearch(iConsumerSearchID,this._restoreUI_Callback);}
if(iSearchID>0)
{oSearchCriteria=SearchController.GetPersistedSearch(iSearchID,this._restoreUI_Callback);}
return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.restoreUI',_oErrorHandler.ERRORTYPE_JS,err);return;}},addMapPanels:function(mapPanelClientIDs)
{_mapPanelIDs=new Array();_mapPanelIDs=mapPanelClientIDs.split(",");},selectMap:function(areaName,mapPanelName,parentId,id)
{var ifrmMap;var lstCtrl;var rbState;var divRegion;var div;var tr;var td;var i;var rbtn;var panelIndex;var panel;var panelID;try
{if(mapPanelName.length>0)
{for(panelIndex=0;panelIndex<_mapPanelIDs.length;panelIndex++)
{panelID=_mapPanelIDs[panelIndex];panel=document.getElementById(panelID);if(panelID.toLowerCase()===('pnl'+mapPanelName.toLowerCase()))
{panel.style.display='inline';}else{panel.style.display='none';}}}
switch(areaName)
{case'State':if(NRT.Property.Search.State.getIsVisible()==='True')
{lstCtrl=NRT.Property.Search.GlobalObject.lstStates();if(NRT.Property.Search.Utility.setCheckedRadioButton(lstCtrl,id))
{NRT.Property.Search.State.setStateID(id);rbState=NRT.Property.Search.Utility.getCheckedRadioButton(lstCtrl);if(_oUtility.browserType()==='ie')
{NRT.Property.Search.State.setStateName(rbState.parentNode.innerText);}else{NRT.Property.Search.State.setStateName(rbState.parentNode.textContent);}
NRT.Property.Search.State.setState(lstCtrl);NRT.Property.Search.State.setStateDependentControls();}}
if(NRT.Property.Search.Region.getIsVisible()==='True')
{NRT.Property.Search.Region.setDefault(false);divRegion=NRT.Property.Search.GlobalObject.divRegionState(_stateID);divRegion.style.display='inline';}
break;case'Region':NRT.Property.Search.Region.setRegionID(id);if(NRT.Property.Search.Region.getIsVisible()==='True')
{if(_oUtility.browserType()==='ie')
{div=NRT.Property.Search.GlobalObject.divRegionState(parentId);tr=div.firstChild.firstChild.firstChild;td=tr.firstChild;for(i=0;i<tr.children.length;i+=1)
{rbtn=td.firstChild;if(rbtn.value==id)
{rbtn.checked=true;}else{rbtn.checked=false;}
td=td.nextSibling;}}
else
{div=NRT.Property.Search.GlobalObject.divRegionState(parentId);tr=div.childNodes[0].childNodes[1];td=tr.childNodes[0];for(i=0;i<td.cells.length;i+=1)
{rbtn=td.cells[i].firstChild;if(rbtn.value==id)
{rbtn.checked=true;}else{rbtn.checked=false;}}}}
NRT.Property.Search.Region.getCounties();break;case'County':lstCtrl=NRT.Property.Search.GlobalObject.lstCounties();if(lstCtrl!==null&&typeof lstCtrl!=='undefined')
{for(i=0;i<lstCtrl.options.length;i+=1)
{if(lstCtrl.options[i].value==id)
{lstCtrl.options[i].selected=true;break;}}
NRT.Property.Search.County.getLocations('County');}
lstCtrl=NRT.Property.Search.GlobalObject.lstCountiesSchoolDistrict();if(lstCtrl!==null&&typeof lstCtrl!=='undefined')
{for(i=0;i<lstCtrl.options.length;i+=1)
{if(lstCtrl.options[i].value==id)
{lstCtrl.options[i].selected=true;break;}}
NRT.Property.Search.County.getLocations('County');break;}}
if(mapPanelName===null||mapPanelName.length===0)
{window.parent.NRT.Property.Search.CityZip.closeMap();}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.selectMap',_oErrorHandler.ERRORTYPE_JS,err);return;}},showCommunityLayeredPage:function(id,name)
{var stateID;var regionID;var sQueryString;try
{stateID=NRT.Property.Search.State.getStateID();regionID=NRT.Property.Search.Region.getRegionID();sQueryString='controlType=CommunitySelection&cityID='+id+'&cityName='+name+'&StateID='+stateID+'&RegionID='+regionID;_oUtility.showLayeredPage(sQueryString,_WinW_CommunitySelection,_WinTitle_CommunitySelection,_DefFocusItemID_CommunitySelection,_DefFocusItemType_CommunitySelection);return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.showCommunityLayeredPage',_oErrorHandler.ERRORTYPE_JS,err);return;}},showDidYouMeanLayer:function()
{var searchVal;var stateID;var regionID;var sQueryString;try
{searchVal=NRT.Property.Search.Intellisense.getSearchString();stateID=NRT.Property.Search.State.getStateID();regionID=NRT.Property.Search.Region.getRegionID();sQueryString='controlType=DidYouMean&inputType=checkbox&searchValue='+searchVal+'&StateID='+stateID+'&RegionID='+regionID+'&TabName=CityZip';_oUtility.showLayeredPage(sQueryString,_WinW_DidYouMean,_WinTitle_DidYouMean,_DefFocusItemID_DidYouMean,_DefFocusItemType_DidYouMean);return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.showDidYouMeanLayer',_oErrorHandler.ERRORTYPE_JS,err);return;}},showErrorMessage:function(sMessage)
{var spnErrMessage;try
{if(NRT.Property.Search.Utility.getActiveDiv()==='CZT'){spnErrMessage=document.getElementById('spnCityZipTypeInErrMessage');}else{spnErrMessage=document.getElementById('spnCityZipLocationListErrMessage');}
if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML=sMessage;spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.showErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}},validate:function()
{var bReturn=true;var ctrlName=null;try
{NRT.Property.Validation.UI.showSelectedLocations(false);ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();if(ctrlName!==null&&typeof ctrlName!=='undefined'&&ctrlName=='TypeIn')
{if(this._selectedLocationsIsEmpty())
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_CITYZIP,NRT.Property.Validation.MESSAGE_COMMON_SELLOC_EMPTY);NRT.Property.Validation.UI.showSelectedLocations(true);bReturn=false;}}else{if(this._selectedLocationsIsEmpty())
{bReturn=NRT.Property.Search.CityZip.addLocationFromListBox(true);}}
return bReturn;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}},viewMap:function()
{var sQueryString;var lstCtrl;var rbState;var sStateName;try
{sQueryString='controlType=MapSelection';lstCtrl=document.getElementById('rbtnl_LocationList_States');if(lstCtrl!==null)
{rbState=NRT.Property.Search.Utility.getCheckedRadioButton(lstCtrl);if(rbState!==null&&typeof rbState!=='undefined'){if(_oUtility.browserType()==='ie')
{NRT.Property.Search.State.setStateName(rbState.parentElement.innerText);}else{NRT.Property.Search.State.setStateName(rbState.parentNode.textContent);}}}
sStateName=NRT.Property.Search.State.getStateName();sQueryString+='&State='+sStateName.replace(' ','');_oUtility.showLayeredPage(sQueryString,405,_WinTitle_MapSelection,null,null);return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.viewMap',_oErrorHandler.ERRORTYPE_JS,err);return;}},_addToSelectedLocationsDiv:function(tbl,id,name,isparent)
{var commrow;var commcell;var comgt;var comgttext;var comanchor;var comanchortext;var tablebody;var locrow;var loccell;var loccelltext;var remanchor;var remanchortext;var remcell;tablebody=document.createElement('tbody');locrow=document.createElement('tr');locrow.setAttribute('id','lr'+id);locrow.className='text';loccell=document.createElement('td');loccell.setAttribute('width','200');if(_oUtility.isNumeric(name))
{loccelltext=document.createTextNode('Zip Code: '+name);}else{loccelltext=document.createTextNode(name);}
loccell.appendChild(loccelltext);locrow.appendChild(loccell);remcell=document.createElement('td');remcell.setAttribute('width','45');remcell.setAttribute('align','right');remanchor=document.createElement('a');remanchor.className='tiny';remanchor.setAttribute("href","javascript: NRT.Property.Search.CityZip.removeLocationFromSelectedLists('"+id+"');");remanchortext=document.createTextNode('remove');remanchor.appendChild(remanchortext);remcell.appendChild(remanchor);locrow.appendChild(remcell);tablebody.appendChild(locrow);if(isparent!==null&&isparent.toUpperCase()==='TRUE')
{commrow=document.createElement('tr');commrow.setAttribute('id','cr'+id);commrow.setAttribute('class','text');commcell=document.createElement('td');commcell.setAttribute('width','200');commcell.setAttribute('colspan','2');comgt=document.createElement('label');comgt.className='tiny';comgttext=document.createTextNode('> ');comgt.appendChild(comgttext);comanchor=document.createElement('a');comanchor.className='tiny';comanchor.setAttribute("href","javascript: NRT.Property.Search.CityZip.showCommunityLayeredPage("+id+",\'"+name+"\');");comanchortext=document.createTextNode('select communities');comanchor.appendChild(comanchortext);commcell.appendChild(comgt);commcell.appendChild(comanchor);commrow.appendChild(commcell);tablebody.appendChild(commrow);}
tbl.appendChild(tablebody);},_getSelectedLocations:function(divName)
{var divSelectedLocations=null;try
{switch(divName)
{case'div_CityZip_TypeIn':divSelectedLocations=document.getElementById('div_CityZipTypeIn_SelectedLocations');break;case'div_CityZip_LocationList':divSelectedLocations=document.getElementById('div_CityZipLocationList_SelectedLocations');break;case'div_REO_LocationList':divSelectedLocations=document.getElementById('div_CityZipLocationList_SelectedLocations');break;case'div_LimitedInv_LocationList':divSelectedLocations=document.getElementById('div_CityZipLocationList_SelectedLocations');break;}
if(divSelectedLocations!==null)
{this.refreshSelectedLocations(divSelectedLocations);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip.getSelectedLocations',_oErrorHandler.ERRORTYPE_JS,err);}},_loadLocationList:function(divName)
{var divLocationList;var oResp;var sHtml;var pattern;var sStateDiv;var sStateRb;var sRegionRb;var nStateID;var nRegionID;divLocationList=document.getElementById(divName);divLocationList.style.visibility='hidden';if(divLocationList.innerHTML==='')
{divLocationList.innerHTML='';nStateID=NRT.Property.Search.State.getStateID();nRegionID=NRT.Property.Search.Region.getRegionID();switch(divName)
{case'div_CityZip_LocationList':oResp=SearchUIController.GetLocationListHTML(nStateID,nRegionID);break;case'div_REO_LocationList':oResp=SearchUIController.GetREOLocationListHTML();break;case'div_LimitedInv_LocationList':oResp=SearchUIController.GetLILocationListHTML();break;}
try
{if(oResp.error!==null)
{_oErrorHandler.ResponseError('NRT.Property.Search.CityZip.getLocationListHTML_Callback',oResp);return;}else{if(oResp!==null&&oResp.value!==null)
{sHtml=oResp.value;pattern=/checked=\"checked\"/g;sHtml=sHtml.replace(pattern,'');pattern=/(\"_div_Region_State_)(\d+)(\" runat=\"server\" style=\"DISPLAY: )(inline|none)/g;sHtml=sHtml.replace(pattern,'$1$2$3'+'none');sStateDiv='\"_div_Region_State_'+NRT.Property.Search.State.getStateID()+'\"';sHtml=sHtml.replace(sStateDiv,sStateDiv+' style=\"DISPLAY: inline\"');sStateRb='rbtnl_LocationList_States\" value=\"'+NRT.Property.Search.State.getStateID()+'\"';sHtml=sHtml.replace(sStateRb,sStateRb+' checked=\"checked\"');sRegionRb='\"rbtnl_LocationList_Regions_'+NRT.Property.Search.State.getStateID()+'\" value=\"'+NRT.Property.Search.Region.getRegionID()+'\"';sHtml=sHtml.replace(sRegionRb,sRegionRb+' checked=\"checked\"');document.getElementById(divName).innerHTML=sHtml;NRT.Property.Search.CityZip._getSelectedLocations(divName);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip._getLocationListHTML',_oErrorHandler.ERRORTYPE_AJAX,err);}}else{NRT.Property.Search.CityZip._getSelectedLocations('div_CityZip_LocationList');}
divLocationList.style.visibility='visible';divLocationList.className='showDiv';},_removeLocationFromSelectedList:function(divCtrl,id)
{var locTable=null;var i;if(divCtrl!==null)
{for(i=0;i<divCtrl.childNodes.length;i+=1)
{if(divCtrl.childNodes[i].id==='tblSelectLocation'+id)
{locTable=divCtrl.childNodes[i];break;}}
if(locTable!==null)
{if(locTable.hasChildNodes())
{locTable.parentNode.removeChild(locTable);_oCZLocationXML.removeLocationNodeByValue(id);}}}},_selectedLocationsIsEmpty:function()
{if(NRT.Property.Search.GlobalObject.divSelectedLocations()!==null){if(NRT.Property.Search.GlobalObject.divSelectedLocations().childNodes.length===0){return true;}}
return false;},_restoreUI_Callback:function(response)
{var locXML;try
{if(response.error!==null)
{_oErrorHandler.ResponseError('NRT.Property.Search.CityZip._restoreUI_Callback',response);return;}else{if(response!==null&&response.value!==null)
{_bRestore=true;locXML=response.value.LocationXML;if(locXML!==null)
{_oCZLocationXML.loadFromXML(locXML);}
if(response.value.StateID!==null)
{NRT.Property.Search.State.setStateID(response.value.StateID);}
if(response.value.RegionID!==null)
{NRT.Property.Search.Region.setRegionID(response.value.RegionID);}
if(response.value.CountyID!==null)
{NRT.Property.Search.County.setCountyID(response.value.CountyID);}
switch(response.value.ActiveDiv)
{case'CZT':NRT.Property.Search.CityZip.loadDiv('div_CityZip_TypeIn');break;case'REO':NRT.Property.Search.CityZip.loadREODiv('div_REO_LocationList');break;case'LI':NRT.Property.Search.CityZip.loadLIDiv('div_LimitedInv_LocationList');break;default:NRT.Property.Search.CityZip.loadDiv('div_CityZip_LocationList');break;}}
return;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip._restoreUI_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}}};}();
NRT.Property.Search.Location=function(locId,locName,locIsParent,locChildLocations,locType)
{this.id=locId;this.name=locName;this.isParent=locIsParent;this.childLocations=locChildLocations;this.locationType=locType;};NRT.Property.Search.Location.prototype.id=null;NRT.Property.Search.Location.prototype.name=null;NRT.Property.Search.Location.prototype.isParent=null;NRT.Property.Search.Location.prototype.childLocations=null;NRT.Property.Search.Location.prototype.locationType=null;NRT.Property.Search.LocationCollection=function(){};NRT.Property.Search.LocationCollection.prototype.add=function(obj)
{this.push(obj);};NRT.Property.Search.LocationXML=function(searchMethod)
{if(_oUtility.browserType()==="ie")
{this.xmlDoc=new ActiveXObject('Microsoft.XMLDOM');}else if(document.implementation&&document.implementation.createDocument)
{this.xmlDoc=document.implementation.createDocument('','LocationInfo',null);}
var root;if(_oUtility.browserType()==="ie")
{root=this.xmlDoc.createElement('LocationInfo');this.xmlDoc.documentElement=root;this.xmlObj=this.xmlDoc.documentElement;}else if(document.implementation&&document.implementation.createDocument)
{this.xmlObj=this.xmlDoc.documentElement;}
this.searchMethod=searchMethod;var oRootNode=this.xmlDoc.childNodes[0];oRootNode.appendChild(this.xmlDoc.createElement(searchMethod));var oSearchMethodNode=this.xmlDoc.firstChild.childNodes[0];oSearchMethodNode.appendChild(this.xmlDoc.createElement('Locations'));};NRT.Property.Search.LocationXML.prototype.xmlDoc=null;NRT.Property.Search.LocationXML.prototype.xmlObj=null;NRT.Property.Search.LocationXML.prototype.searchMethod=null;NRT.Property.Search.LocationXML.prototype.addLocation=function(id,name,isParent,locType)
{var oRootNode;var oLocationsNode;var oLocationNode;try
{if(this.xmlObj!==null)
{oRootNode=this.xmlDoc.childNodes[0];oLocationsNode=oRootNode.selectSingleNode("//"+this.searchMethod+"/Locations");oLocationNode=this.xmlObj.selectSingleNode("//Locations/location[@id='"+id+"']");if(oLocationNode===null||typeof oLocationNode==='undefined')
{this._addLocationNode(oLocationsNode,id,name,isParent,locType,null);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.addLocation',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.addLocations=function(locations)
{var i;var oRootNode;var oLocationsNode;var oLocationNode;try
{if(this.xmlObj!==null)
{for(i=0;i<locations.length;i+=1)
{oRootNode=this.xmlDoc.childNodes[0];oLocationsNode=oRootNode.selectSingleNode("//"+this.searchMethod+"/Locations");oLocationNode=this.xmlObj.selectSingleNode("//Locations/location[@id='"+locations[i].id+"']");if(oLocationNode===null||typeof oLocationNode==='undefined')
{this._addLocationNode(oLocationsNode,locations[i].id,locations[i].name,locations[i].isParent,locations[i].locationType,locations[i].childLocations);}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.addLocations',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.addLocationCommunities=function(id,communityIds,communityNames)
{var oLocationNode;try
{if(this.xmlObj!==null)
{oLocationNode=this.xmlObj.selectSingleNode("//Locations/location[@id='"+id+"']");if(oLocationNode!==null)
{oLocationNode.setAttribute("communityids",communityIds);oLocationNode.setAttribute("communitynames",communityNames);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.addLocationCommunities',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.clear=function()
{var oLocationsNode;var i;var oChildNode;var locLength;try
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");if(oLocationsNode!==null)
{locLength=oLocationsNode.childNodes.length;for(i=0;i<locLength;i+=1)
{oChildNode=oLocationsNode.childNodes[0];oLocationsNode.removeChild(oChildNode);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.clear',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.count=function()
{var oLocationsNode;try
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");if(oLocationsNode!==null)
{return oLocationsNode.childNodes.length;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.count',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.getXML=function(bSave)
{var xml;var serializer;try
{xml=null;if(_oUtility.browserType()==='ie')
{if(this.searchMethod==='NearbyCity')
{if(bSave===false||bSave===null)
{xml=this.xmlDoc.getElementsByTagName("LocationInfo")[0].xml;}else{xml=this.xmlDoc.getElementsByTagName("Locations")[0].xml;}}else{xml=this.xmlDoc.getElementsByTagName("Locations")[0].xml;}}else{serializer=new XMLSerializer();if(this.searchMethod==='NearbyCity')
{if(bSave===false||bSave===null)
{xml=serializer.serializeToString(this.xmlDoc.getElementsByTagName("LocationInfo")[0]);}else{xml=serializer.serializeToString(this.xmlDoc.getElementsByTagName("Locations")[0]);}}else{xml=serializer.serializeToString(this.xmlDoc.getElementsByTagName("Locations")[0]);}}
return xml;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.getXML',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.isEmpty=function()
{var oLocationsNode;try
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");if(oLocationsNode!==null)
{if(oLocationsNode.childNodes.length===0)
{return true;}else{return false;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.isEmpty',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.locationExists=function(id)
{var oLocationsNode;var oLocationNode;var i;try
{if(this.xmlObj!==null)
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");for(i=0;i<oLocationsNode.childNodes.length;i+=1)
{oLocationNode=this.xmlObj.selectSingleNode("//Locations/location[@id='"+id+"']");if(oLocationNode!==null)
{return true;}}
return false;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.locationExists',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.locationId=function()
{var oLocationsNode;var oLocationNode;try
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");if(oLocationsNode!==null)
{oLocationNode=oLocationsNode.childNodes[0];if(oLocationNode!==null)
{return oLocationNode.attributes[0].value;}else{return 0;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.locationId',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.locationName=function()
{var oLocationsNode;var oLocationNode;try
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");if(oLocationsNode!==null)
{oLocationNode=oLocationsNode.childNodes[0];if(oLocationNode!==null)
{return oLocationNode.attributes[1].value;}else{return 0;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.locationName',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.loadFromXML=function(xml)
{var oLocationsNode;var oxmlDoc;var oParser;var i;var oNode;var oLocationNode;try
{if(this.xmlObj!==null)
{if(xml!==null)
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");oxmlDoc=null;if(_oUtility.browserType()==="ie")
{oxmlDoc=new ActiveXObject('Microsoft.XMLDOM');oxmlDoc.loadXML(xml);}else if(document.implementation&&document.implementation.createDocument)
{oParser=new DOMParser();oxmlDoc=oParser.parseFromString(xml,"text/xml");}
if(oxmlDoc.childNodes.length>0)
{for(i=0;i<oxmlDoc.firstChild.childNodes.length;i+=1)
{oNode=oxmlDoc.firstChild.childNodes[i];oLocationNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations/location[@id='"+oNode.attributes[0].nodeValue+"']");if(oLocationNode===null||typeof oLocationNode==='undefined')
{if(oNode.attributes[5]===null||typeof oNode.attributes[5]==='undefined')
{if(oNode.attributes[3]===null||typeof oNode.attributes[3]==='undefined')
{this._addLocationNode(oLocationsNode,oNode.attributes[0].nodeValue,oNode.attributes[1].nodeValue,oNode.attributes[2].nodeValue,'0');}else{this._addLocationNode(oLocationsNode,oNode.attributes[0].nodeValue,oNode.attributes[1].nodeValue,oNode.attributes[2].nodeValue,oNode.attributes[3].nodeValue);}}else{this._addLocationNode(oLocationsNode,oNode.attributes[0].nodeValue,oNode.attributes[1].nodeValue,oNode.attributes[2].nodeValue,oNode.attributes[3].nodeValue,oNode.attributes[4].nodeValue,oNode.attributes[5].nodeValue);}}}}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.loadFromXML',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.removeLocationNodeByValue=function(id)
{var oLocationsNode;var oLocationNode;try
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");if(oLocationsNode!==null)
{oLocationNode=oLocationsNode.selectSingleNode("location[@id = '"+id+"']");if(oLocationNode!==null)
{oLocationsNode.removeChild(oLocationNode);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.removeLocationNodeByValue',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype.updateLocations=function(parentid,locations)
{var oLocationsNode;var i;var oLocationNode;try
{if(this.xmlObj!==null)
{oLocationsNode=this.xmlObj.selectSingleNode("//"+this.searchMethod+"/Locations");for(i=0;i<locations.length;i+=1)
{oLocationNode=this.xmlObj.selectSingleNode("//Locations/location[@id='"+locations[i].id+"']");if(oLocationNode===null||typeof oLocationNode==='undefined')
{this._addLocationNode(oLocationsNode,locations[i].id,locations[i].name,'false',locations[i].locationType,null);}}
NRT.Property.Search.CityZip.removeLocationFromSelectedLists(parentid);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.LocationXML.updateLocations',_oErrorHandler.ERRORTYPE_JS,err);return;}};NRT.Property.Search.LocationXML.prototype._addLocationNode=function(parentNode,id,name,isparent,loctype,communityids,communitynames)
{var oLocationNode=this._createNode("location");oLocationNode.setAttribute("id",id);oLocationNode.setAttribute("name",name);oLocationNode.setAttribute("isParent",isparent);oLocationNode.setAttribute("type",loctype);if(communityids!==null&&typeof communityids!=='undefined')
{oLocationNode.setAttribute("communityids",communityids);}
if(communitynames!==null&&typeof communitynames!=='undefined')
{oLocationNode.setAttribute("communitynames",communitynames);}
parentNode.appendChild(oLocationNode);return oLocationNode;};NRT.Property.Search.LocationXML.prototype._createNode=function(nodeName)
{var oCurrNode=null;oCurrNode=this.xmlDoc.createElement(nodeName);return oCurrNode;};if(document.implementation.hasFeature("XPath","3.0"))
{XMLDocument.prototype.selectNodes=function(cXPathString,xNode)
{if(xNode===null||typeof xNode==='undefined')
{xNode=this;}
var oNSResolver=this.createNSResolver(this.documentElement);var aItems=this.evaluate(cXPathString,xNode,oNSResolver,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);var aResult=[];for(var i=0;i<aItems.snapshotLength;i+=1)
{aResult[i]=aItems.snapshotItem(i);}
return aResult;};Element.prototype.selectNodes=function(cXPathString)
{if(this.ownerDocument.selectNodes)
{return this.ownerDocument.selectNodes(cXPathString,this);}else{throw"For XML Elements Only";}};}
if(document.implementation.hasFeature("XPath","3.0"))
{XMLDocument.prototype.selectSingleNode=function(cXPathString,xNode)
{if(!xNode)
{xNode=this;}
var xItems=this.selectNodes(cXPathString,xNode);if(xItems.length>0)
{return xItems[0];}else{return null;}};Element.prototype.selectSingleNode=function(cXPathString)
{if(this.ownerDocument.selectSingleNode)
{return this.ownerDocument.selectSingleNode(cXPathString,this);}else{throw"For XML Elements Only";}};}
var _oCZLocationXML=new NRT.Property.Search.LocationXML('CityZip');var _oNBCLocationXML=new NRT.Property.Search.LocationXML('NearbyCity');var _oADLocationXML=new NRT.Property.Search.LocationXML('Address');var _oSDLocationXML=new NRT.Property.Search.LocationXML('SchoolDistrict');var _oValidationXML=new NRT.Property.Validation.XML();var _oSearchCriteria=null;var _bRestore=false;var _bChangeRadious=false;var _SelectedLocations=0;var _MaxLocations=0;var _FocusId='';NRT.Property.Search.METHOD_CITYZIP_TYPEIN=0;NRT.Property.Search.METHOD_CITYZIP_LIST=1;NRT.Property.Search.METHOD_NEARBYCITY=2;NRT.Property.Search.METHOD_ADDRESS=3;NRT.Property.Search.METHOD_MLS=4;NRT.Property.Search.METHOD_SCHOOL_DISTRICT=40;NRT.Property.Search.METHOD_LIMITED_INV=20;NRT.Property.Search.METHOD_REO=30;NRT.Property.Search.METHOD_SUBDIVISIONS=50;NRT.Property.Search.INSTRUCTION_CITYZIP_TYPEIN='Enter a city, community, or zip code, then click "Add" to select a location.&nbsp; You can add multiple locations for your search.';NRT.Property.Search.INSTRUCTION_CITYZIP_LOCATIONLIST='Select a city and click Add. You can filter the location list by selecting a county.&nbsp; You can Add multiple locations for your search.';NRT.Property.Search.EXAMPLE_MLS='eg. 123456789, 43434568';NRT.Property.Search.EXAMPLE_SUBDIVISION='eg. Aberdeen';var _WinTitle_CommunitySelection='COMMUNITY SELECTION';var _WinW_CommunitySelection=360;var _DefFocusItemID_CommunitySelection='divCommunitySelectionCheckboxes';var _DefFocusItemType_CommunitySelection='DIV';var _WinTitle_DidYouMean='DID YOU MEAN';var _WinW_DidYouMean=445;var _DefFocusItemID_DidYouMean='divResults';var _DefFocusItemType_DidYouMean='DIV';var _WinTitle_InvalidLocation='INVALID LOCATION';var _WinW_InvalidLocation=300;var _DefFocusItemID_InvalidLocation='btnOK_InvalidLocation';var _DefFocusItemType_InvalidLocation=null;var _WinTitle_InvalidZipcode='INVALID ZIP CODE';var _WinW_InvalidZipcode=300;var _DefFocusItemID_InvalidZipcode='btnOK_InvalidZipcode';var _DefFocusItemType_InvalidZipcode=null;var _WinTitle_LocationMax='MAXIMUM LOCATIONS';var _WinW_LocationMax=260;var _DefFocusItemID_LocationMax='btnOK_LocationMax';var _DefFocusItemType_LocationMax=null;var _WinTitle_NoLocationsFound='NO LOCATIONS FOUND';var _WinW_NoLocationsFound=385;var _DefFocusItemID_NoLocationsFound='btnOK_NoLocationsFound';var _DefFocusItemType_NoLocationsFound=null;var _WinTitle_MapSelection='MAP SELECTION';NRT.Property.Search.LISearchType=function()
{var _LISearchType='Lease';return{getLISearchType:function()
{return parseInt(_LISearchType,10);},setLISearchType:function(id)
{_LISearchType=id;}};}();NRT.Property.Search.State=function()
{var _stateID=0;var _stateName='';var _isVisible=false;return{getStateID:function()
{return parseInt(_stateID,10);},setStateID:function(id)
{_stateID=id;NRT.Utility.createCookie(_stateID,365,null);},getStateName:function()
{return _stateName;},setStateName:function(name)
{_stateName=name;},getIsVisible:function()
{return _isVisible;},setIsVisible:function(isVisible)
{_isVisible=isVisible;},setDefault:function(bUseStateId)
{var ctrlName=null;var rbtnlName=null;var rbState=null;var rbCtrlList=null;var divRegion=null;try
{ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();rbtnlName='rbtnl_'+ctrlName+'_States';this._hideRegionDivs();if(bUseStateId)
{rbCtrlList=document.getElementById(rbtnlName);if(rbCtrlList===null||typeof rbCtrlList==='undefined')
{return;}
rbState=NRT.Property.Search.Utility.getRadioButtonByValue(rbCtrlList,_stateID);}else{rbState=document.getElementById(rbtnlName+'_0');if(_oUtility.browserType()==='ie')
{this.setStateName(rbState.parentNode.innerText);}else{this.setStateName(rbState.parentNode.textContent);}
this.setStateID(rbState.value);}
if(rbState===null||typeof rbState==='undefined')
{this.setStateID(-1);}else{rbState.checked=true;NRT.Property.Search.State.setState(rbCtrlList);}
divRegion=NRT.Property.Search.GlobalObject.divRegionState(_stateID);if(divRegion!==null&&typeof divRegion!=='undefined')
{divRegion.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.State.setDefault',_oErrorHandler.ERRORTYPE_JS,err);return;}},setState:function(ctrlState)
{var rbState=null;var i;var j;var oChildNode;var nItemIndex=0;var oControl;var oLabel;try
{rbState=NRT.Property.Search.Utility.getCheckedRadioButton(ctrlState);if(rbState!==null&&typeof rbState!=='undefined'){if(_oUtility.browserType()==='ie')
{this.setStateName(rbState.parentNode.innerText);nItemIndex=0;}else{this.setStateName(rbState.parentNode.textContent);nItemIndex=1;}
this.setStateID(rbState.value);for(i=0;i<ctrlState.childNodes[nItemIndex].childNodes.length;i+=1)
{oChildNode=ctrlState.childNodes[nItemIndex].childNodes[i];for(j=0;j<oChildNode.childNodes.length;j+=1)
{oControl=oChildNode.childNodes[j].firstChild;if(oControl!==null&&typeof oControl!=='undefined')
{oLabel=oControl.parentNode;if(oControl.checked===true)
{oLabel.className='textbold';}else{oLabel.className='text';}}}}
if(_oTab.tabSelected()===0){NRT.Property.Search.County.setCountyID(-1);NRT.Property.Search.Region.getCounties();NRT.Property.Search.County.getLocations('State');}
if(_oTab.tabSelected()===4&&_oTab.tabDivSelected()==='div_SD_Tab'){NRT.Property.Search.County.setCountyID(-1);NRT.Property.Search.SchoolDistrict.getCounties();NRT.Property.Search.SchoolDistrict.getLocations('State');}
if(_oTab.tabSelected()===null){NRT.Property.Search.County.setCountyID(-1);NRT.Property.Search.Region.getCounties();NRT.Property.Search.County.getLocations('State');}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.State.setState',_oErrorHandler.ERRORTYPE_JS,err);return;}},getRegions:function(ctrlState)
{var divRegion=null;try
{this.setState(ctrlState);NRT.Property.Search.Region.setDefault(false);divRegion=NRT.Property.Search.GlobalObject.divRegionState(_stateID);divRegion.style.display='inline';}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.State.getRegions',_oErrorHandler.ERRORTYPE_JS,err);return;}},setStateDependentControls:function()
{var nStateID=0;var txtIntellisense;var txtIntellisenseNBC;var txtSubDivisions;var spnErrMessage;try
{spnErrMessage=document.getElementById('spnCityZipTypeInErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML='';spnErrMessage.style.display='inline';}
spnErrMessage=document.getElementById('spnCityZipLocationListErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML='';spnErrMessage.style.display='inline';}
NRT.Property.Search.NearbyCity.clearErrorMessage();nStateID=NRT.Property.Search.State.getStateID();txtIntellisense=_oUtility.getElementByTagNameAndID('txtIntellisense','INPUT');if(txtIntellisense!==null&&typeof txtIntellisense!=='undefined')
{if(nStateID<1)
{txtIntellisense.value=NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY;txtIntellisense.disabled=true;}else{txtIntellisense.disabled=false;txtIntellisense.value='';}}
txtIntellisenseNBC=_oUtility.getElementByTagNameAndID('txtIntellisenseNBC','INPUT');if(txtIntellisenseNBC!==null&&typeof txtIntellisenseNBC!=='undefined')
{if(nStateID<1)
{txtIntellisenseNBC.value=NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY;txtIntellisenseNBC.disabled=true;}else{txtIntellisenseNBC.disabled=false;txtIntellisenseNBC.value='';}}
txtSubDivisions=_oUtility.getElementByTagNameAndID('txtSubDivisions','INPUT');if(txtSubDivisions!==null&&typeof txtSubDivisions!=='undefined')
{if(nStateID<1)
{txtSubDivisions.value=NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY;txtSubDivisions.disabled=true;}else{txtSubDivisions.disabled=false;txtSubDivisions.value='';}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.State.setStateDependentControls',_oErrorHandler.ERRORTYPE_JS,err);return;}},_hideRegionDivs:function()
{var i;var e=null;var divCtrl=NRT.Property.Search.GlobalObject.divRegionStates();if(divCtrl===null||typeof divCtrl==='undefined')
{return;}
if(_oUtility.browserType()==='ie')
{for(i=0;i<divCtrl.children.length;i+=1)
{e=divCtrl.children[i];if(e.tagName==='DIV')
{e.style.display='none';}}}else{for(i=0;i<divCtrl.childNodes.length;i+=1)
{e=divCtrl.childNodes[i];if(e.tagName==='DIV')
{e.style.display='none';}}}}};}();NRT.Property.Search.Region=function()
{var _regionID=0;var _regionName='';var _isVisible=false;return{getRegionID:function()
{return parseInt(_regionID,10);},setRegionID:function(id)
{_regionID=id;},getRegionName:function()
{return _regionName;},setRegionName:function(name)
{_regionName=name;},getIsVisible:function()
{return _isVisible;},setIsVisible:function(isVisible)
{_isVisible=isVisible;},setDefault:function(bUseRegionId)
{var ctrlName=null;var rbtnlName=null;var rbRegion=null;var rbCtrlList=null;try
{ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();rbtnlName='rbtnl_'+ctrlName+'_Regions_'+NRT.Property.Search.State.getStateID();if(bUseRegionId)
{rbCtrlList=document.getElementById(rbtnlName);if(rbCtrlList!==null&&typeof rbCtrlList!=='undefined')
{rbRegion=NRT.Property.Search.Utility.getRadioButtonByValue(rbCtrlList,_regionID);}}else{rbRegion=document.getElementById(rbtnlName+'_0');this.setRegionName(rbRegion.parentNode.innerText);this.setRegionID(rbRegion.value);}
if(rbRegion===null||typeof rbRegion==='undefined')
{this.setRegionID(-1);}else{rbRegion.checked=true;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Region.setDefault',_oErrorHandler.ERRORTYPE_JS,err);return;}},setRegion:function(ctrl)
{var ctrlName=null;var rbtnlName=null;var rbRegion=null;var rbCtrlList=null;try
{ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();rbtnlName='rbtnl_'+ctrlName+'_Regions_'+NRT.Property.Search.State.getStateID();rbCtrlList=document.getElementById(rbtnlName);rbRegion=NRT.Property.Search.Utility.getCheckedRadioButton(rbCtrlList);this.setRegionID(rbRegion.value);if(_oUtility.browserType()==='ie')
{this.setRegionName(rbRegion.parentNode.innerText);}else{this.setRegionName(rbRegion.parentNode.textContent);}
if(ctrlName==='LocationList')
{this.getCounties();}
return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Region.setRegion',_oErrorHandler.ERRORTYPE_JS,err);return;}},getCounties:function()
{var stateID=0;var regionID=0;var aCounties=null;var response=null;try
{switch(NRT.Property.Search.Utility.getActiveDiv())
{case'CZL':if(NRT.Tab.tabSelected()===0)
{stateID=NRT.Property.Search.State.getStateID();regionID=NRT.Property.Search.Region.getRegionID();if(_oUtility.browserType()==='ie')
{aCounties=SearchController.GetCounties(stateID,regionID,NRT.Property.Search.Region._getCounties_Callback);}else{response=SearchController.GetCounties(stateID,regionID);aCounties=response.value.Locations;}}
break;case'REO':if(_oUtility.browserType()==='ie')
{aCounties=SearchController.GetREOCounties(stateID,regionID,NRT.Property.Search.Region._getCounties_Callback);}else{response=SearchController.GetREOCounties(stateID,regionID);aCounties=response.value.Locations;}
break;case'LI':var LiSearchType=NRT.Property.Search.LISearchType.getLISearchType();var stateID=NRT.Property.Search.State.getStateID();if(_oUtility.browserType()==='ie')
{aCounties=SearchController.GetLICounties(LiSearchType,stateID,NRT.Property.Search.Region._getCounties_Callback);}else{response=SearchController.GetLICounties(LiSearchType,stateID);aCounties=response.value.Locations;}
break;}
if(aCounties!=null)
{this._FillCountyList(aCounties);}
return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Region.getCounties',_oErrorHandler.ERRORTYPE_JS,err);return;}},_FillCountyList:function(aCounties)
{var lstCounties=null;lstCounties=NRT.Property.Search.GlobalObject.lstCounties();this._FillCountyListByControl(aCounties,lstCounties);},_FillSchoolDistrictCountyList:function(aCounties)
{var lstCounties=null;lstCounties=NRT.Property.Search.GlobalObject.lstCountiesSchoolDistrict();this._FillCountyListByControl(aCounties,lstCounties);},_FillCountyListByControl:function(aCounties,cntl)
{var lstCounties=null;var i;var bSelected=false;var nStateID;if(aCounties!==null)
{lstCounties=cntl;if(lstCounties!==null&&typeof lstCounties!=='undefined')
{lstCounties.innerHTML='';lstCounties.options[0]=new Option('--All Counties--','-99',false,false);nStateID=NRT.Property.Search.State.getStateID();if(NRT.Property.Search.State.getIsVisible()==='True'&&nStateID<=0)
{lstCounties.value='-99';lstCounties.disabled=true;}else{lstCounties.disabled=false;for(i=0;i<aCounties.length;i+=1)
{bSelected=false;if(aCounties[i].LocationID===NRT.Property.Search.County.getCountyID())
{bSelected=true;}
lstCounties.options[lstCounties.length]=new Option(aCounties[i].DisplayName1,aCounties[i].LocationID,false,false);lstCounties.options[lstCounties.length-1].selected=bSelected;}}}}},_getCounties_Callback:function(response)
{var aCounties=null;try
{if(response.error!==null&&typeof response.error!=='undefined')
{_oErrorHandler.ResponseError('NRT.Property.Search.Region._getCounties_Callback',response);return;}else{if(response!==null&&response.value!==null)
{aCounties=response.value.Locations;NRT.Property.Search.Region._FillCountyList(aCounties);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Region._getCounties_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}}};}();NRT.Property.Search.County=function()
{var _countyID=-1;return{getCountyID:function()
{return parseInt(_countyID,10);},setCountyID:function(id)
{_countyID=id;},getLocations:function(sSource)
{var stateID=0;var regionID=0;var countyID=0;var aLocations=null;var response=null;var lstAvailLocations=null;var activeDiv=null;try
{activeDiv=NRT.Property.Search.Utility.getActiveDiv();if(activeDiv==='CZL'||activeDiv==='REO'||activeDiv==='LI')
{stateID=NRT.Property.Search.State.getStateID(0);regionID=NRT.Property.Search.Region.getRegionID(0);countyID=NRT.Property.Search.County.getCountyID(0);if(_bRestore===false)
{if(sSource==='State')
{countyID=-1;}
else
{countyID=_oUtility.getSelectedDetails(NRT.Property.Search.GlobalObject.lstCounties());if(countyID==='')
{countyID=-1;}}}else{if(countyID===''||countyID===0)
{countyID=-1;}}
aLocations=null;if(countyID!=='0')
{switch(activeDiv)
{case'REO':response=SearchController.GetREOLocations(countyID);break;case'LI':var LiSearchType=NRT.Property.Search.LISearchType.getLISearchType();response=SearchController.GetLILocations(stateID,countyID,LiSearchType);break;default:response=SearchController.GetLocations(stateID,regionID,countyID);break;}
aLocations=response.value.Locations;this._FillLocationList(aLocations);}else{lstAvailLocations=NRT.Property.Search.GlobalObject.lstAvailLocations();lstAvailLocations.innerHTML='';NRT.Property.Search.CityZip.showErrorMessage(NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_LOCS_NOTFOUND);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.County.getLocations',_oErrorHandler.ERRORTYPE_JS,err);return;}},selectCounty:function()
{var countyList=null;var countyID=null;var i=0;try
{if(_bRestore===false)
{countyID=_oUtility.getSelectedDetails(NRT.Property.Search.GlobalObject.lstCounties());}else{countyID=NRT.Property.Search.County.getCountyID();}
if(countyID!==0)
{countyList=NRT.Property.Search.GlobalObject.lstCounties();if(countyList!==null)
{for(i=0;i<countyList.options.length;i+=1)
{if(countyList.options[i].value==countyID)
{countyList.options[i].selected=true;break;}}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.County.selectCounty',_oErrorHandler.ERRORTYPE_JS,err);return;}},_FillLocationList:function(aLocations)
{var lstAvailLocations=null;var i;var nStateID;if(aLocations!==null&&typeof aLocations!=='undefined')
{if(aLocations.length>0)
{nStateID=NRT.Property.Search.State.getStateID();lstAvailLocations=NRT.Property.Search.GlobalObject.lstAvailLocations();if(NRT.Property.Search.State.getIsVisible()==='True'&&nStateID<=0)
{lstAvailLocations.innerHTML='';lstAvailLocations.options[0]=new Option(NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY,'0',false,false);lstAvailLocations.disabled=true;}else{lstAvailLocations.disabled=false;lstAvailLocations.innerHTML='';for(i=0;i<aLocations.length;i+=1)
{lstAvailLocations.options[lstAvailLocations.length]=new Option(aLocations[i].DisplayName1,aLocations[i].LocationID+'-'+aLocations[i].IsParentLocation+'-'+aLocations[i].LocationType,false,false);}}}else{lstAvailLocations=NRT.Property.Search.GlobalObject.lstAvailLocations();lstAvailLocations.innerHTML='';if(NRT.Property.Search.Utility.getActiveDiv()==='LI')
{nStateID=NRT.Property.Search.State.getStateID();if(NRT.Property.Search.State.getIsVisible()==='True'&&nStateID<=0)
{lstAvailLocations.options[0]=new Option(NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY,'0',false,false);lstAvailLocations.disabled=true;}}}}}};}();NRT.Property.Search.GlobalObject=function()
{var _ctrl='ucPropertySearch';var _selectedCtrlSourceName;var _divLocationList=null;var _divTypeIn=_ctrl+'_ucCityZip_ucCityZipTypeIn';var _divNearbyCities=_ctrl+'_ucNearbyCities';var _divSchoolDistrict=_ctrl+'_ucSchoolDistrict';var _divSelectedLocations=null;var _divSelectedSchoolDistricts=null;var _divRegionStates=null;var _divRegionState=null;var _divCommunitySelectionCheckboxes=null;var _lstStates=null;var _lstCounties=null;var _lstCountiesSchoolDistrict=null;var _lstAvailLocations=null;var _lstAvailSchoolDistricts=null;var _ddlNearbyMiles=null;return{getSelectedCtrlSourceName:function()
{return _selectedCtrlSourceName;},setSelectedCtrlSourceName:function(name)
{_selectedCtrlSourceName=name;},txtAddress:function()
{return NRT.Utility.getElementByTagNameAndID('txtAddress','INPUT');},txtCity:function()
{return NRT.Utility.getElementByTagNameAndID('txtCity','INPUT');},txtMLSNumber:function()
{return NRT.Utility.getElementByTagNameAndID('txtMLSNumber','INPUT');},txtSubDivisions:function()
{return NRT.Utility.getElementByTagNameAndID('txtSubDivisions','INPUT');},ddlNearbyMiles:function()
{return NRT.Utility.getElementByTagNameAndID('ddlNearbyMiles','SELECT');},ddlStateList:function()
{return NRT.Utility.getElementByTagNameAndID('ddlStateList','SELECT');},divRegionStates:function()
{var sRegionCollectionCtrl=NRT.Utility.getElementByTagNameAndID('div_Region_Collection','DIV');switch(_selectedCtrlSourceName)
{case'TypeIn':_divRegionStates=document.getElementById(_divTypeIn+sRegionCollectionCtrl);break;case'LocationList':_divRegionStates=sRegionCollectionCtrl;break;case'NearbyCities':_divRegionStates=document.getElementById(_divNearbyCities+sRegionCollectionCtrl);break;case'SchoolDistrict':_divRegionStates=document.getElementById(_divSchoolDistrict+sRegionCollectionCtrl);break;}
return _divRegionStates;},divRegionState:function(stateID)
{var sRegionStateCtrl='_ucStateRegion_div_Region_State_'+stateID;switch(_selectedCtrlSourceName)
{case'TypeIn':_divRegionState=document.getElementById(_divTypeIn+'_ucStateRegion_div_Region_State_'+stateID);break;case'LocationList':_divRegionState=document.getElementById('_div_Region_State_'+stateID);break;case'NearbyCities':_divRegionState=document.getElementById(_divNearbyCities+'_ucStateRegion_div_Region_State_'+stateID);break;case'SchoolDistrict':_divRegionState=document.getElementById(_divSchoolDistrict+'_ucStateRegion_div_Region_State_'+stateID);break;}
return _divRegionState;},divSelectedLocations:function()
{switch(_selectedCtrlSourceName)
{case'TypeIn':_divSelectedLocations=document.getElementById('div_CityZipTypeIn_SelectedLocations');break;case'LocationList':_divSelectedLocations=document.getElementById('div_CityZipLocationList_SelectedLocations');break;}
return _divSelectedLocations;},divSelectedSchoolDistricts:function()
{if(_divSelectedSchoolDistricts===null||typeof _divSelectedSchoolDistricts==='undefined')
{_divSelectedSchoolDistricts=document.getElementById('div_SchoolDistrictList_SelectedSchoolDistricts');}
return _divSelectedSchoolDistricts;},divCommunitySelectionCheckboxes:function()
{if(_divCommunitySelectionCheckboxes===null||typeof _divCommunitySelectionCheckboxes==='undefined')
{_divCommunitySelectionCheckboxes=NRT.Utility.getElementByTagNameAndID('divCommunitySelectionCheckboxes','DIV');}
return _divCommunitySelectionCheckboxes;},lstStates:function()
{if(_lstStates===null||typeof _lstStates==='undefined')
{switch(_selectedCtrlSourceName)
{case'TypeIn':_lstStates=NRT.Utility.getElementByTagNameAndID('rbtnl_TypeIn_States','TABLE');break;case'LocationList':_lstStates=NRT.Utility.getElementByTagNameAndID('rbtnl_LocationList_States','TABLE');break;case'NearbyCities':_lstStates=NRT.Utility.getElementByTagNameAndID('rbtnl_NearbyCities_States','TABLE');break;case'SchoolDistrict':_lstStates=NRT.Utility.getElementByTagNameAndID('rbtnl_SchoolDistrict_States','TABLE');break;case'SubDivisions':_lstStates=NRT.Utility.getElementByTagNameAndID('rbtnl_SubDivisions_States','TABLE');break;}}
return _lstStates;},lstCounties:function()
{if(_lstCounties===null||typeof _lstCounties==='undefined')
{_lstCounties=NRT.Utility.getElementByTagNameAndID('lst_CityZipLocationList_Counties','SELECT');}
return _lstCounties;},lstCountiesSchoolDistrict:function()
{if(_lstCountiesSchoolDistrict===null||typeof _lstCountiesSchoolDistrict==='undefined')
{_lstCountiesSchoolDistrict=NRT.Utility.getElementByTagNameAndID('lst_SchoolDistrict_Counties','SELECT');}
return _lstCountiesSchoolDistrict;},lstAvailLocations:function()
{if(_lstAvailLocations===null||typeof _lstAvailLocations==='undefined')
{if(_selectedCtrlSourceName==='LocationList')
{_lstAvailLocations=NRT.Utility.getElementByTagNameAndID('lst_CityZipLocationList_AvailLocations','SELECT');}}
return _lstAvailLocations;},lstAvailSchoolDistricts:function()
{if(_lstAvailSchoolDistricts===null||typeof _lstAvailSchoolDistricts==='undefined')
{_lstAvailSchoolDistricts=NRT.Utility.getElementByTagNameAndID('lst_SchoolDistrictList_AvailSchoolDistricts','SELECT');}
return _lstAvailSchoolDistricts;},rbAllCommunities:function()
{return NRT.Utility.getElementByTagNameAndID('rbAllCommunities','INPUT');}};}();NRT.Property.Search.Utility=function()
{var _activeDiv=null;var _locationInvalidKeyCodes=null;var _maxLocations=null;var _searchClass=null;var _qsParm=[];var _isCityRequired=true;return{getActiveDiv:function()
{return _activeDiv;},setActiveDiv:function(divName)
{_activeDiv=divName;},getCityRequired:function()
{return _isCityRequired;},setCityRequired:function(isRequired)
{_isCityRequired=isRequired;},getLocationInvalidKeyCodes:function()
{return _locationInvalidKeyCodes;},setLocationInvalidKeyCodes:function(invalidKeyCodes)
{_locationInvalidKeyCodes=invalidKeyCodes;},setMaxLocations:function(value)
{_MaxLocations=value;},getSearchClass:function()
{return _searchClass;},setSearchClass:function(name)
{_searchClass=name;},addIntellisenseLocation:function(sSource)
{var sLocation='';var oLocation=null;var sQuery='';var stateID=0;var regionID=0;var results=null;var divSelectedLocations=null;var olocCollection=null;try
{if(sSource==='CZT')
{NRT.Property.Search.CityZip.clearErrorMessage();NRT.Property.Validation.UI.showSelectedLocations(false);}else if(sSource==='NBC')
{NRT.Property.Search.NearbyCity.clearErrorMessage();NRT.Property.Validation.UI.showSelectedLocations(false);}
sLocation=_oUtility.trimString(NRT.Property.Search.Intellisense.getSearchString());if(!NRT.Property.Search.Utility.validLocation(sLocation))
{NRT.Property.Search.Utility.displayInvalidLocationMessage();return false;}
oLocation=NRT.Property.Search.Intellisense.getSelectedLocation(sLocation);sQuery=sLocation.substring(0,5);if(sQuery===null||typeof sQuery==='undefined'||sQuery.length===0)
{if(sSource==='CZT')
{NRT.Property.Search.CityZip.showErrorMessage(NRT.Property.Validation.MESSAGE_CITYZIP_TYPEIN_LOC_EMPTY);}else if(sSource==='NBC')
{NRT.Property.Search.NearbyCity.showErrorMessage(NRT.Property.Validation.MESSAGE_NBCITIES_LOC_EMPTY);}
return false;}
if(_oUtility.isNumeric(sLocation.substring(0,1)))
{if(!NRT.Property.Search.Utility.validZipCode(sQuery))
{NRT.Property.Search.Utility.displayInvalidZipCodeMessage(sLocation);return false;}}
if(oLocation.id===0)
{stateID=NRT.Property.Search.State.getStateID();regionID=NRT.Property.Search.Region.getRegionID();results=SearchController.GetCorrectedLocations(stateID,regionID,sLocation);if(stateID<1){NRT.Property.Search.CityZip.showErrorMessage(NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY);NRT.Property.Search.NearbyCity.showErrorMessage(NRT.Property.Validation.MESSAGE_CITYZIP_STATE_EMPTY);}else{if(results!==null&&typeof results!=='undefined'&&results.value.Locations.length===0)
{if(sSource==='CZT')
{NRT.Property.Search.Utility.showNoLocationsFoundLayer(true);}else{NRT.Property.Search.Utility.showNoLocationsFoundLayer(false);}}else{if(sSource==='CZT')
{NRT.Property.Search.CityZip.showDidYouMeanLayer();}else if(sSource==='NBC')
{NRT.Property.Search.NearbyCity.showDidYouMeanLayer();}}}}else{if(sSource==='CZT')
{if(_oCZLocationXML.locationExists(oLocation.id))
{_oUtility.showMessage(oLocation.name+' '+NRT.Property.Validation.MESSAGE_CITYZIP_DUPLICATE_LOC);}
divSelectedLocations=document.getElementById('div_CityZipTypeIn_SelectedLocations');if(divSelectedLocations!==null&&typeof divSelectedLocations!=='undefined')
{olocCollection=new _oUtility.createCollection('NRT.Property.Search.LocationCollection');_SelectedLocations=_SelectedLocations+1;if(_SelectedLocations>(_MaxLocations-_oCZLocationXML.count()))
{_SelectedLocations=0;NRT.Property.Validation.UI.displayMaxLocationsMessage();return false;}
olocCollection.add(new NRT.Property.Search.Location(oLocation.id,oLocation.name,oLocation.isParentLocation.toString(),oLocation.childLocations,oLocation.locationType));if(olocCollection!==null&&typeof olocCollection!=='undefined'&&olocCollection.length>0){_oCZLocationXML.addLocations(olocCollection);NRT.Property.Search.CityZip.refreshSelectedLocations(divSelectedLocations);_oValidationXML.removeValidation(NRT.Property.Validation.TYPE_CITYZIP,NRT.Property.Validation.MESSAGE_COMMON_SELLOC_EMPTY);NRT.Property.Search.Utility.validate();NRT.Property.Search.Intellisense.setFocus();}else{if(olocCollection.length===0){NRT.Property.Validation.UI.showSelectedLocations(true);return false;}}}}else if(sSource==='NBC')
{NRT.Property.Search.NearbyCity.getNearbyCityListHtml(sLocation);}}
return true;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.addIntellisenseLocation',_oErrorHandler.ERRORTYPE_JS,err);return false;}},clearSearchCriteria:function()
{var oCriteria=null;var i;try
{_oSearchCriteria=eval('('+NRT.Utility.getElementByTagNameAndID('hdnSrchCriteria','INPUT').value+')');_nWebsiteID=_oSearchCriteria.WebsiteID;if(_oSearchCriteria!==null&&typeof _oSearchCriteria!=='undefined')
{_oSearchCriteria.PropertySearchClass=0;_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_CITYZIP_TYPEIN;_oSearchCriteria.StateID=0;_oSearchCriteria.StateName=null;_oSearchCriteria.RegionID=0;_oSearchCriteria.CountyID=0;_oSearchCriteria.ActiveTab=0;_oSearchCriteria.ActiveDiv=null;_oSearchCriteria.Locations=null;_oSearchCriteria.LocationXML=null;_oSearchCriteria.NearbyCityStartLoc.ChildControlCount='0';_oSearchCriteria.NearbyCityStartLoc.ControlValue=null;_oSearchCriteria.NearbyCityRadius.ChildControlCount='0';_oSearchCriteria.NearbyCityRadius.ControlValue=null;_oSearchCriteria.Address.ChildControlCount='0';_oSearchCriteria.Address.ControlValue=null;_oSearchCriteria.MlsNumber.ChildControlCount='0';_oSearchCriteria.MlsNumber.ControlValue=null;_oSearchCriteria.CoMinglingGroupID=-1;_oSearchCriteria.DisplayType="List";_oSearchCriteria.MaxListingsPerPage=10;_oSearchCriteria.PageNumber=1;_oSearchCriteria.SortColumn="Price_Desc";for(i=0;i<_oSearchCriteria.CustomCriterias.length;i+=1)
{oCriteria=_oSearchCriteria.CustomCriterias[i];oCriteria.ControlValue=null;oCriteria.ControlDisplayValue=null;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.clearSearchCriteria',_oErrorHandler.ERRORTYPE_JS,err);return;}},closeInvalidLocationWindow:function()
{var DialogID=null;try
{DialogID="infoDialog_"+_WinTitle_InvalidLocation.replace(" ","_");_oUtility.closeLayeredPage(DialogID);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.closeInvalidLocationWindow',_oErrorHandler.ERRORTYPE_JS,err);return;}},closeInvalidZipCodeWindow:function()
{var DialogID=null;try
{DialogID="infoDialog_"+_WinTitle_InvalidZipcode.replace(" ","_");_oUtility.closeLayeredPage(DialogID);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.closeInvalidLocationWindow',_oErrorHandler.ERRORTYPE_JS,err);return;}},closeNoLocationsFoundWindow:function()
{var DialogID=null;try
{DialogID="Dialog_"+_WinTitle_NoLocationsFound.replace(" ","_");_oUtility.closeLayeredPage(DialogID);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.closeNoLocationsFoundWindow',_oErrorHandler.ERRORTYPE_JS,err);return;}},displayInvalidLocationMessage:function()
{var sHTML="";try
{sHTML+="<table style='border:0px; padding:0px; WIDTH:"+(_WinW_InvalidLocation-10)+"px;'>";sHTML+="<tr>";sHTML+="<td class='text'>";sHTML+=NRT.Property.Validation.MESSAGE_LOCATION_INVALID;sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td>";sHTML+="<TABLE style='padding:0px; border:0px; width:100%;'>";sHTML+="<TR>";sHTML+="<td style='height:9px;' class='separatorLineH'>";sHTML+="<img src='/NRTProducts/include/images/common_spacer.gif' border='0' width='100%' height='9'>";sHTML+="</td>";sHTML+="</TR>";sHTML+="</TABLE>";sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td style='text-align:center;'>";sHTML+="<img id='"+_DefFocusItemID_InvalidLocation+"' border='0' class='pointer' src='/NRTProducts/include/images/btnOK.gif'";sHTML+=" onmouseover='javascript:NRT.Utility.flipButton(this,1);' onmouseout='javascript:NRT.Utility.flipButton(this,0);'";sHTML+=" onclick='javascript:NRT.Property.Search.Utility.closeInvalidLocationWindow();' onblur='javascript:this.focus();'>";sHTML+="</td>";sHTML+="</tr>";sHTML+="</table>";_oUtility.showInfo(sHTML,_WinW_InvalidLocation,_WinTitle_InvalidLocation,_DefFocusItemID_InvalidLocation,_DefFocusItemType_InvalidLocation);return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.displayInvalidLocationMessage',_oErrorHandler.ERRORTYPE_JS,err);return;}},displayInvalidZipCodeMessage:function(ZipCode)
{var sHTML="";try
{sHTML+="<table style='border:0px; padding:0px; WIDTH:"+(_WinW_InvalidZipcode-10)+"px;'>";sHTML+="<tr>";sHTML+="<td class='text'>";sHTML+=" <label class='textbold'>You entered</label>&nbsp;";sHTML+=ZipCode;sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td class='text'>";sHTML+=NRT.Property.Validation.MESSAGE_LOCATION_ZIPCODE_INVALID;sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td>";sHTML+="<TABLE style='padding:0px; border:0px; width:100%'>";sHTML+="<TR>";sHTML+="<td style='height:9px;' class='separatorLineH'>";sHTML+="<img src='/NRTProducts/include/images/common_spacer.gif' border='0' width='100%' height='9'>";sHTML+="</td>";sHTML+="</TR>";sHTML+="</TABLE>";sHTML+="</td>";sHTML+="</tr>";sHTML+="<tr>";sHTML+="<td style='text-align:center;'>";sHTML+="<img id='"+_DefFocusItemID_InvalidZipcode+"' border='0' class='pointer' src='/NRTProducts/include/images/btnOK.gif'";sHTML+=" onmouseover='javascript:NRT.Utility.flipButton(this,1);'  onmouseout='javascript:NRT.Utility.flipButton(this,0);'";sHTML+=" onclick='javascript:NRT.Property.Search.Utility.closeInvalidZipCodeWindow();this.onblur=null;' onblur='javascript:this.focus();'>";sHTML+="</td>";sHTML+="</tr>";sHTML+="</table>";_oUtility.showInfo(sHTML,_WinW_InvalidZipcode,_WinTitle_InvalidZipcode,_DefFocusItemID_InvalidZipcode,_DefFocusItemType_InvalidZipcode);return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.displayInvalidZipCodeMessage',_oErrorHandler.ERRORTYPE_JS,err);return;}},fetchQS:function()
{var query=null;var parms=null;var i;var pos=0;var key='';var val='';try
{query=window.location.search.substring(1);parms=query.split('&');for(i=0;i<parms.length;i+=1)
{pos=parms[i].indexOf('=');if(pos>0)
{key=parms[i].substring(0,pos);val=parms[i].substring(pos+1);_qsParm[key]=val;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.fetchQS',_oErrorHandler.ERRORTYPE_JS,err);return;}},setCheckedRadioButton:function(rbCtrlList,val)
{var tr=null;var td=null;var i;var myCtrl=null;var bIsChecked=false;var oLabel;try
{if(_oUtility.browserType()==='ie')
{tr=rbCtrlList.firstChild.firstChild;if(tr===null||typeof tr==='undefined')
{return false;}
td=tr.firstChild;for(i=0;i<tr.children.length;i+=1)
{myCtrl=td.firstChild;oLabel=myCtrl.parentNode;if(myCtrl.value===val.toString()){myCtrl.checked=true;oLabel.className='textbold';bIsChecked=true;}else{oLabel.className='text';}
td=td.nextSibling;}
return bIsChecked;}else{tr=rbCtrlList.childNodes[1];if(tr===null||typeof tr==='undefined')
{return false;}
td=tr.childNodes[0];for(i=0;i<td.cells.length;i+=1)
{myCtrl=td.cells[i].firstChild;oLabel=myCtrl.parentNode;if(myCtrl.value===val.toString()){myCtrl.checked=true;oLabel.className='textbold';bIsChecked=true;}else{oLabel.className='text';}}
return bIsChecked;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.setCheckedRadioButton',_oErrorHandler.ERRORTYPE_JS,err);return false;}},getCheckedRadioButton:function(rbCtrlList)
{var tr=null;var td=null;var i;var myCtrl=null;try
{if(_oUtility.browserType()==='ie')
{if(rbCtrlList===null||typeof rbCtrlList==='undefined')
{return null;}
tr=rbCtrlList.firstChild.firstChild;if(tr===null||typeof tr==='undefined')
{return null;}
td=tr.firstChild;for(i=0;i<tr.children.length;i+=1)
{myCtrl=td.firstChild;if(myCtrl.checked)
{return myCtrl;}
td=td.nextSibling;}
return null;}else{if(rbCtrlList===null||typeof rbCtrlList==='undefined')
{return null;}
tr=rbCtrlList.childNodes[1];if(tr===null||typeof tr==='undefined')
{return null;}
td=tr.childNodes[0];for(i=0;i<td.cells.length;i+=1)
{myCtrl=td.cells[i].firstChild;if(myCtrl.checked)
{return myCtrl;}}
return null;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.getCheckedRadioButton',_oErrorHandler.ERRORTYPE_JS,err);return;}},getRadioButtonByValue:function(rbCtrlList,sValue)
{var tr=null;var td=null;var i;var myCtrl=null;var myCtrlVal=null;try
{if(_oUtility.browserType()==='ie')
{if(rbCtrlList===null||typeof rbCtrlList==='undefined')
{return null;}
tr=rbCtrlList.firstChild.firstChild;if(tr===null||typeof tr==='undefined')
{return null;}
td=tr.firstChild;for(i=0;i<tr.children.length;i+=1)
{myCtrl=td.firstChild;myCtrlVal=myCtrl.value;if(myCtrlVal!==null&&typeof myCtrlVal!=='undefined'&&typeof myCtrlVal==='string'&&myCtrlVal===String(sValue))
{return myCtrl;}
td=td.nextSibling;}
return null;}else{tr=rbCtrlList.childNodes[1];if(tr===null||typeof tr==='undefined')
{return null;}
td=tr.childNodes[0];for(i=0;i<td.cells.length;i+=1)
{myCtrl=td.cells[i].firstChild;myCtrlVal=myCtrl.value;if(myCtrlVal!==null&&typeof myCtrlVal!=='undefined'&&typeof myCtrlVal==='string'&&myCtrlVal===String(sValue))
{return myCtrl;}}
return null;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.getRadioButtonByValue',_oErrorHandler.ERRORTYPE_JS,err);return;}},getConsumerSearchID:function()
{try
{_qsParm.ConsumerSearchID=null;this.fetchQS();if(_qsParm.ConsumerSearchID!==null&&typeof _qsParm.ConsumerSearchID!=='undefined')
{return parseInt(_qsParm.ConsumerSearchID,10);}else{return 0;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.getConsumerSearchID',_oErrorHandler.ERRORTYPE_JS,err);return;}},getSearchID:function()
{try
{_qsParm.SearchID=null;this.fetchQS();if(_qsParm.SearchID!==null&&typeof _qsParm.SearchID!=='undefined')
{return parseInt(_qsParm.SearchID,10);}else{return 0;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.getSearchID',_oErrorHandler.ERRORTYPE_JS,err);return;}},initTab:function(activeTabId)
{var aTabs=null;var tabId=0;try
{NRT.Property.Search.TabCaptions.init();aTabs=NRT.Property.Search.TabCaptions.getTabCaptions();if(aTabs!==null&&typeof aTabs!=='undefined')
{_oTab.setTabs(aTabs);_oTab.setTabAlign('LEFT');_oTab.setSourceName('ucPropertySearch');_oTab.load();}
NRT.Property.Search.Intellisense.init('txtIntellisense','divIntellisenseContainer',true);NRT.Property.Search.State.setStateDependentControls();if(activeTabId===null||typeof activeTabId==='undefined')
{tabId=NRT.Property.Search.TabCaptions.getDefaultTab();}else{tabId=activeTabId;}
if(tabId===0)
{NRT.Property.Search.CityZip.loadDiv('div_CityZip_TypeIn');}else{if(activeTabId!==null&&typeof activeTabId!=='undefined')
{_oTab.tabClick(tabId);}
this.tabClick(tabId);}
NRT.Property.Search.Criteria.updateCriteriaLists();}
catch(err)
{throw err;}},initREO:function(activeTabId)
{var aTabs=null;var tabId=0;try
{NRT.Property.Search.State.setStateDependentControls();NRT.Property.Search.CityZip.loadREODiv('div_REO_LocationList');NRT.Property.Search.Criteria.updateCriteriaLists();}
catch(err)
{throw err;}},initLI:function(activeTabId)
{var aTabs=null;var tabId=0;try
{NRT.Property.Search.State.setStateDependentControls();NRT.Property.Search.CityZip.loadLIDiv('div_LimitedInv_LocationList');NRT.Property.Search.Criteria.updateCriteriaLists();}
catch(err)
{throw err;}},noEnter:function(e)
{var key=window.event?e.keyCode:e.which;try
{return!(key===13);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.noEnter',_oErrorHandler.ERRORTYPE_JS,err);return;}},onKeyDown:function(e)
{var key=window.event?e.keyCode:e.which;try
{if(key===13)
{var tmpOverlay=null;tmpOverlay=NRT.Dialogs.DialogManager.getActive();if(tmpOverlay===null||typeof tmpOverlay==='undefined')
{if(_FocusId!=='txtEmail'&&_FocusId!=='txtPassword')
{NRT.Property.Search.Utility.performSearch();}}else{}}else if(key===114&&ISDEBUG)
{}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.onKeyDown',_oErrorHandler.ERRORTYPE_JS,err);return;}},performSearch:function()
{var iConsumerSearchID=0;var iSearchID=0;var conSrchID=0;var srchID=0;var hdnSearchID=0;var bValidate=true;var txtIntellisense;var oSelLocations;var nlocationCount;try
{if(NRT.Property.Search.Utility.getActiveDiv()!='REO'&&NRT.Property.Search.Utility.getActiveDiv()!='LI')
{txtIntellisense=NRT.Property.Search.Intellisense.getSearchString();}
oSelLocations=NRT.Property.Search.GlobalObject.divSelectedLocations();if(oSelLocations!==null&&typeof oSelLocations!=='undefined')
{nlocationCount=oSelLocations.childNodes.length;if(typeof nlocationCount!=='undefined'&&nlocationCount==0)
{if(txtIntellisense!==null&&typeof txtIntellisense!=='undefined'&&txtIntellisense!='')
{if(_oTab.tabSelected()===0){bValidate=NRT.Property.Search.Utility.addIntellisenseLocation('CZT');}}}}
if(bValidate)
{if(!this.validate())
{return;}}else{return;}
this.saveSearchCriteria();if(typeof NRT.WebTrends.PropertySearch.sendSearchButtonWebTrends!=='undefined')
{NRT.WebTrends.PropertySearch.sendSearchButtonWebTrends();}
iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();if(iConsumerSearchID>0)
{conSrchID=SearchController.PersistConsumerSearch(_oSearchCriteria);window.location="/property/PropertyResults.aspx?ConsumerSearchID="+conSrchID.val+NRT.Utility.Branding.appendBranding(_oSearchCriteria.BrandingID);}else{srchID=SearchController.PersistSearch(_oSearchCriteria);hdnSearchID=_oUtility.getElementByTagNameAndID('hdnSearchID','INPUT');if(hdnSearchID!==null)
{hdnSearchID.value=srchID.value;}
window.location="/property/PropertyResults.aspx?SearchID="+srchID.value+NRT.Utility.Branding.appendBranding(_oSearchCriteria.BrandingID);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.performSearch',_oErrorHandler.ERRORTYPE_JS,err);return;}},performSaveSearch:function(bEnableJustListed)
{var EnableJustListed=null;try
{if(!this.validate())
{if(_oUtility.browserType()==='ie')
{document.body.firstChild.scrollIntoView(true);}else{document.body.scrollIntoView(true);}
return;}
EnableJustListed=_oUtility.getElementByTagNameAndID('hdnEnableJustListed','INPUT');if(EnableJustListed!==null&&typeof EnableJustListed!=='undefined')
{EnableJustListed.value=bEnableJustListed;}
if(NRT.MySite.Authentication.validateUser())
{this.saveSearch();}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.performSaveSearch',_oErrorHandler.ERRORTYPE_JS,err);return;}},saveSearch:function()
{var consumerID=0;var conSrchID=0;var bIsEnable=false;var EnableJustListed=null;var bResult=false;var sQueryString='';try
{this.saveSearchCriteria();consumerID=NRT.MySite.Authentication.getConsumerID();conSrchID=SearchController.PersistConsumerSearch(consumerID,_oSearchCriteria).value;EnableJustListed=_oUtility.getElementByTagNameAndID('hdnEnableJustListed','INPUT');if(EnableJustListed!==null&&typeof EnableJustListed!=='undefined')
{bIsEnable=EnableJustListed.value;}
bResult=MySiteProvider.HasMaxSavedSearches(_MaxSavedSearches,consumerID).value;if(bResult)
{sQueryString='controlType=SaveSearchLimitReached&ConsumerSearchID='+conSrchID+'&ConsumerID='+consumerID+'&EnableJustListed='+bIsEnable;_oUtility.showLayeredPage(sQueryString,_WinW_SaveSearch_LimitReached,_WinTitle_SaveSearch_LimitReached,_DefFocusItemID_SaveSearch_LimitReached,_DefFocusItemType_SaveSearch_LimitReached);}else{sQueryString='controlType=SaveSearch&ConsumerSearchID='+conSrchID+'&ConsumerID='+consumerID+'&EnableJustListed='+bIsEnable;_oUtility.showLayeredPage(sQueryString,_WinW_SaveSearch,_WinTitle_SaveSearch,_DefFocusItemID_SaveSearch,_DefFocusItemType_SaveSearch);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.saveSearch',_oErrorHandler.ERRORTYPE_JS,err);return;}},saveSearchCriteria:function()
{var countyID=0;var schoolDistrictID=0;var oCriteria=null;var i;try
{NRT.Property.Search.Utility.clearSearchCriteria();_oSearchCriteria.PropertySearchClass=NRT.Property.Search.Utility.getSearchClass();_oSearchCriteria.StateID=NRT.Property.Search.State.getStateID();_oSearchCriteria.StateName=NRT.Property.Search.State.getStateName();_oSearchCriteria.RegionID=NRT.Property.Search.Region.getRegionID();_oSearchCriteria.ActiveTab=_oTab.tabSelected();_oSearchCriteria.ActiveDiv=_oTab.tabDivSelected();switch(_oTab.tabDivSelected())
{case'div_CZ_Tab':_oSearchCriteria.ActiveDiv=NRT.Property.Search.Utility.getActiveDiv();if(_oSearchCriteria.ActiveDiv==='CZT')
{_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_CITYZIP_TYPEIN;_oSearchCriteria.LocationXML=_oCZLocationXML.getXML();}else{_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_CITYZIP_LIST;countyID=_oUtility.getSelectedDetails(NRT.Property.Search.GlobalObject.lstCounties());_oSearchCriteria.CountyID=parseInt(countyID,10);_oSearchCriteria.LocationXML=_oCZLocationXML.getXML();}
break;case'div_NC_Tab':_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_NEARBYCITY;_oSearchCriteria.NearbyCityStartLoc.ElementName='txtIntellisenseNBC';_oSearchCriteria.NearbyCityStartLoc.ControlType='TextBox';_oSearchCriteria.NearbyCityStartLoc.ControlServerName='txtIntellisenseNBC';_oSearchCriteria.NearbyCityStartLoc.ControlHtmlName='txtIntellisenseNBC';_oSearchCriteria.NearbyCityStartLoc.ChildControlCount='1';_oSearchCriteria.NearbyCityStartLoc.DBParamName='@StartLoc';this._setControlValue(_oSearchCriteria.NearbyCityStartLoc);_oSearchCriteria.NearbyCityRadius.ElementName='ddlNearbyMiles';_oSearchCriteria.NearbyCityRadius.ControlType='DropDownList';_oSearchCriteria.NearbyCityRadius.ControlServerName='ddlNearbyMiles';_oSearchCriteria.NearbyCityRadius.ControlHtmlName=NRT.Property.Search.GlobalObject.ddlNearbyMiles().id;_oSearchCriteria.NearbyCityRadius.ChildControlCount='1';_oSearchCriteria.NearbyCityRadius.DBParamName='@Radius';this._setControlValue(_oSearchCriteria.NearbyCityRadius);_oSearchCriteria.LocationXML=_oNBCLocationXML.getXML(true);break;case'div_AD_Tab':_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_ADDRESS;_oSearchCriteria.Address.ElementName='txtAddress';_oSearchCriteria.Address.ControlType='TextBox';_oSearchCriteria.Address.ControlServerName='txtAddress';_oSearchCriteria.Address.ControlHtmlName=NRT.Property.Search.GlobalObject.txtAddress().id;_oSearchCriteria.Address.ChildControlCount='1';_oSearchCriteria.Address.DBParamName='@Address';this._setControlValue(_oSearchCriteria.Address);_oSearchCriteria.LocationXML=_oADLocationXML.getXML();break;case'div_MN_Tab':_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_MLS;_oSearchCriteria.MlsNumber.ElementName='txtMLSNumber';_oSearchCriteria.MlsNumber.ControlType='TextBox';_oSearchCriteria.MlsNumber.ControlServerName='txtMLSNumber';_oSearchCriteria.MlsNumber.ControlHtmlName=NRT.Property.Search.GlobalObject.txtMLSNumber().id;_oSearchCriteria.MlsNumber.ChildControlCount='1';_oSearchCriteria.MlsNumber.DBParamName='@MlsNumber';this._setControlValue(_oSearchCriteria.MlsNumber);break;case'div_SD_Tab':_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_SCHOOL_DISTRICT;countyID=_oUtility.getSelectedDetails(NRT.Property.Search.GlobalObject.lstCountiesSchoolDistrict());_oSearchCriteria.CountyID=parseInt(countyID,10);_oSearchCriteria.LocationXML=_oSDLocationXML.getXML();_oSearchCriteria.SchoolSearchType=NRT.Property.Search.SchoolDistrict.getSchoolSearchTypeID();break;case'div_SubDiv_Tab':_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_SUBDIVISIONS;_oSearchCriteria.Address.ElementName='txtSubDivision';_oSearchCriteria.Address.ControlType='TextBox';_oSearchCriteria.Address.ControlServerName='txtSubDivision';_oSearchCriteria.Address.ControlHtmlName=NRT.Property.Search.GlobalObject.txtSubDivisions().id;_oSearchCriteria.Address.ChildControlCount='1';_oSearchCriteria.Address.DBParamName='@Address';this._setControlValue(_oSearchCriteria.Address);for(i=0;i<_oSearchCriteria.CustomCriterias.length;i+=1)
{oCriteria=_oSearchCriteria.CustomCriterias[i];if(oCriteria.ControlType==="DropDownList")
{ddlb=_oUtility.getElementByTagNameAndID(oCriteria.ControlHtmlName,'SELECT');if(ddlb!==null&&typeof ddlb!=='undefined')
{if(ddlb.id.search(/ddlMinSubDivisionPrice/)>0||ddlb.id.search(/ddlMaxSubDivisionPrice/)>0)
{oCriteria.ControlValue=ddlb.options[ddlb.selectedIndex].value;oCriteria.ControlDisplayValue=ddlb.options[ddlb.selectedIndex].innerHTML;}}}}
break;}
if(NRT.Property.Search.Utility.getActiveDiv()==='REO')
{countyID=_oUtility.getSelectedDetails(NRT.Property.Search.GlobalObject.lstCounties());_oSearchCriteria.ActiveDiv='REO'
_oSearchCriteria.CountyID=parseInt(countyID,10);_oSearchCriteria.LocationXML=_oCZLocationXML.getXML();_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_REO;}
if(NRT.Property.Search.Utility.getActiveDiv()==='LI')
{countyID=_oUtility.getSelectedDetails(NRT.Property.Search.GlobalObject.lstCounties());_oSearchCriteria.ActiveDiv='LI'
_oSearchCriteria.CountyID=parseInt(countyID,10);_oSearchCriteria.LocationXML=_oCZLocationXML.getXML();_oSearchCriteria.SearchMethod=NRT.Property.Search.METHOD_LIMITED_INV;LiType=NRT.Property.Search.LISearchType.getLISearchType();switch(LiType)
{case 1:_oSearchCriteria.LimitedInventoryType='Coastal';break;case 5:_oSearchCriteria.LimitedInventoryType='Lease';break;case 6:_oSearchCriteria.LimitedInventoryType='SeasonalRental';break;case 7:_oSearchCriteria.LimitedInventoryType='BrokerOpen';break;case 8:_oSearchCriteria.LimitedInventoryType='RentalIncome';break;case 9:_oSearchCriteria.LimitedInventoryType='REO';break;}}
if(_oSearchCriteria.ActiveTab===0||_oSearchCriteria.ActiveTab===1||_oSearchCriteria.ActiveTab==4||NRT.Property.Search.Utility.getActiveDiv()==='REO'||NRT.Property.Search.Utility.getActiveDiv()==='LI')
{for(i=0;i<_oSearchCriteria.CustomCriterias.length;i+=1)
{oCriteria=_oSearchCriteria.CustomCriterias[i];this._setControlValue(oCriteria);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.saveSearchCriteria',_oErrorHandler.ERRORTYPE_JS,err);return;}},showNoLocationsFoundLayer:function(bShowSelect,locationVal)
{var searchVal='';var sQueryString='';try
{if(locationVal===null||typeof locationVal==='undefined')
{searchVal=NRT.Property.Search.Intellisense.getSearchString();}else{searchVal=locationVal;}
sQueryString='controlType=NoLocationsFound&SearchValue='+searchVal+'&ShowSelect='+bShowSelect;_oUtility.showLayeredPage(sQueryString,_WinW_NoLocationsFound,_WinTitle_NoLocationsFound,_DefFocusItemID_NoLocationsFound,_DefFocusItemType_NoLocationsFound);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.showNoLocationsFoundLayer',_oErrorHandler.ERRORTYPE_JS,err);return;}},tabClick:function(tabId)
{var divCriteria=null;var divSearch=null;var divInstructionText=null;var divExampleText=null;var divAlertSS=null;var oDDLStateList=null;var ctrlName=null;var rbtnlName=null;var rbState=null;var rbCtrlList=null;var stateID=-1;var oChildNode;var nItemIndex=0;var oControl;var oLabel;var i=0;var j=0;try
{divCriteria=document.getElementById('div_SC_PropertyCriteria');divSearch=document.getElementById('divSearch');divAlertSS=document.getElementById('divAlertSS');divCriteria.style.display='none';divAlertSS.style.display='none';divSearch.style.display='none';_oValidationXML.clear();switch(_oTab.tabDivSelected())
{case'div_CZ_Tab':divAlertSS.style.display='inline';divSearch.style.display='inline';if(this.getActiveDiv()==='CZT'||this.getActiveDiv()===null||typeof this.getActiveDiv()==='undefined')
{NRT.Property.Search.CityZip.loadDiv('div_CityZip_TypeIn');NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('TypeIn');}else if(this.getActiveDiv()==='CZL')
{NRT.Property.Search.CityZip.loadDiv('div_CityZip_LocationList');}
NRT.Property.Search.Intellisense.init('txtIntellisense','divIntellisenseContainer',false);NRT.Property.Search.State.setDefault(true);NRT.Property.Search.Region.setDefault(true);divCriteria.style.display='inline';return;case'div_NC_Tab':NRT.Property.Search.Intellisense.init('txtIntellisenseNBC','divIntellisenseContainerNBC',true);NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('NearbyCities');divCriteria.style.display='inline';divAlertSS.style.display='inline';divSearch.style.display='inline';if(_bRestore===false)
{_oUtility.setFocus(document.getElementById('txtIntellisenseNBC'));}
NRT.Property.Search.State.setDefault(true);NRT.Property.Search.Region.setDefault(true);return;case'div_AD_Tab':divAlertSS.style.display='inline';divSearch.style.display='inline';oDDLStateList=NRT.Utility.getElementByTagNameAndID('ddlStateList','SELECT');if(oDDLStateList!==null&&typeof oDDLStateList!=='undefined')
{oDDLStateList.value=NRT.Property.Search.State.getStateID();}
if(_bRestore===false)
{_oUtility.setFocus(NRT.Property.Search.GlobalObject.txtAddress());}
return;case'div_MN_Tab':divExampleText=document.getElementById('div_MLSNumber_ExampleText');divExampleText.innerHTML=NRT.Property.Search.EXAMPLE_MLS;divSearch.style.display='inline';if(_bRestore===false)
{_oUtility.setFocus(NRT.Property.Search.GlobalObject.txtMLSNumber());}
return;case'div_SD_Tab':divAlertSS.style.display='inline';divSearch.style.display='inline';NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('SchoolDistrict');NRT.Property.Search.State.setDefault(true);NRT.Property.Search.Region.setDefault(true);NRT.Property.Search.SchoolDistrict.setDefault();NRT.Property.Search.SchoolDistrict.getLocations();stateID=NRT.Property.Search.State.getStateID();ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();rbtnlName='rbtnl_'+ctrlName+'_States';rbCtrlList=document.getElementById(rbtnlName);NRT.Utility.highlightSelectedRadioButton(rbCtrlList);oAvailLocs=_oUtility.getElementByTagNameAndID('lst_SchoolDistrictList_AvailSchoolDistricts','SELECT');_oUtility.setFocus(oAvailLocs);divCriteria.style.display='inline';return;case'div_SubDiv_Tab':divAlertSS.style.display='inline';divSearch.style.display='inline';NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('SubDivisions');divExampleText=document.getElementById('div_SubDivisions_ExampleText');divExampleText.innerHTML=NRT.Property.Search.EXAMPLE_SUBDIVISION;divSearch.style.display='inline';if(_bRestore===false)
{_oUtility.setFocus(NRT.Property.Search.GlobalObject.txtSubDivisions());}
NRT.Property.Search.State.setDefault(true);NRT.Property.Search.Region.setDefault(true);return;default:return;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.tabClick',_oErrorHandler.ERRORTYPE_JS,err);return;}},validate:function()
{var bReturn=false;try{_oValidationXML.clear();NRT.Property.Search.CityZip.clearErrorMessage();switch(_oTab.tabDivSelected()){case'div_CZ_Tab':NRT.Property.Search.CityZip.validate();NRT.Property.Search.Criteria.validate(NRT.Property.Validation.TYPE_CITYZIP);break;case'div_NC_Tab':NRT.Property.Search.NearbyCity.validate();NRT.Property.Search.Criteria.validate(NRT.Property.Validation.TYPE_NEARBYCITY);break;case'div_AD_Tab':bReturn=NRT.Property.Search.Address.validate();break;case'div_MN_Tab':NRT.Property.Search.MlsNumber.validate();break;case'div_SD_Tab':NRT.Property.Search.SchoolDistrict.validate();NRT.Property.Search.Criteria.validate(NRT.Property.Validation.TYPE_SCHOOLDISTRICT);break;case'div_SubDiv_Tab':NRT.Property.Search.SubDivisions.validate();NRT.Property.Search.Criteria.validate(NRT.Property.Validation.TYPE_SUBDIVISIONS);break;default:if(NRT.Property.Search.Utility.getActiveDiv()==='REO'||NRT.Property.Search.Utility.getActiveDiv()==='LI')
{NRT.Property.Search.CityZip.validate();NRT.Property.Search.Criteria.validate(NRT.Property.Validation.TYPE_CITYZIP);break;}else{return true;}}
if(_oTab.tabDivSelected()=='div_AD_Tab'&&_oValidationXML.count()===0){return bReturn;}
if(_oValidationXML.count()!==0){if(!_oValidationXML.messageExists(NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_LOCS_MAX)){NRT.Property.Validation.Summary.show();}
return false;}else{if(NRT.Property.Search.Utility.getActiveDiv()==='REO'||NRT.Property.Search.Utility.getActiveDiv()==='LI')
{NRT.Property.Validation.Summary.hide('0');}else{NRT.Property.Validation.Summary.hide(_oTab.tabSelected().toString());}
return true;}}catch(err){_oErrorHandler.Error('NRT.Property.Search.Utility.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}},validLocation:function(sLocation)
{var sArray=null;var x;var sLocationInvalidChars=null;try
{sLocationInvalidChars=NRT.Property.Search.Utility.getLocationInvalidKeyCodes();if(sLocationInvalidChars!==null&&typeof sLocationInvalidChars!=='undefined')
{sArray=sLocationInvalidChars.split(',');for(x=0;x<sArray.length;x+=1)
{if(sLocation.indexOf(sArray[x])!==-1)
{return false;}}}
return true;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Utility.validLocation',_oErrorHandler.ERRORTYPE_JS,err);return;}},validZipCode:function(zipcode)
{var regexS=new RegExp(/(^\d{5}$)/);var aZipRanges=null;var aRanges=null;var i;var aValues=null;var aState=null;var sState='';var minRange=0;var maxRange=0;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.Property.Search.Utility.validZipCode',_oErrorHandler.ERRORTYPE_JS,err);return false;}},_setControlValue:function(criteria)
{var count;var count2;var currRadioButton=null;var rbLabel=null;var oChkLstBoxLst=null;var oChkLstBoxLstCheckboxes=null;var currCheckBox=null;var nValueStart=0;var nValueLength=0;var sCurrBoxValue='';var ckboxLabel=null;var ddlb=null;var ctrlName=null;var currTextBox=null;switch(criteria.ControlType)
{case"RadioButtonList":criteria.ControlValue=0;for(count=0;count<criteria.ChildControlCount;count+=1)
{currRadioButton=_oUtility.getElementByTagNameAndID(criteria.ControlHtmlName+"_"+count,'INPUT');if(currRadioButton!==null&&typeof currRadioButton!=='undefined'&&currRadioButton.checked===true)
{criteria.ControlValue=currRadioButton.value;rbLabel=currRadioButton.nextSibling;criteria.ControlDisplayValue=rbLabel.firstChild.nodeValue;break;}}
break;case"CheckBoxList":criteria.ControlValue="";criteria.ControlDisplayValue="";oChkLstBoxLst=NRT.Utility.getElementByTagNameAndID(criteria.ControlHtmlName,'TABLE');if(oChkLstBoxLst!==null&&typeof oChkLstBoxLst!=='undefined'){oChkLstBoxLstCheckboxes=oChkLstBoxLst.getElementsByTagName('input');criteria.ChildControlCount=oChkLstBoxLstCheckboxes.length;for(count=0;count<criteria.ChildControlCount;count+=1)
{currCheckBox=oChkLstBoxLstCheckboxes[count];if(currCheckBox!==null&&typeof currCheckBox!=='undefined'&&currCheckBox.checked===true)
{nValueStart=currCheckBox.id.lastIndexOf('_')+1;nValueLength=currCheckBox.id.length-nValueStart;sCurrBoxValue=currCheckBox.id.substr(nValueStart,nValueLength);criteria.ControlValue+=sCurrBoxValue;if(count<criteria.ChildControlCount)
{criteria.ControlValue+=",";}
ckboxLabel=currCheckBox.nextSibling;criteria.ControlDisplayValue+=ckboxLabel.firstChild.nodeValue;if(count<criteria.ChildControlCount)
{criteria.ControlDisplayValue+=",";}}}}
break;case"CheckBox":currCheckBox=_oUtility.getElementByTagNameAndID(criteria.ControlHtmlName,'INPUT');if(currCheckBox!==null&&typeof currCheckBox!=='undefined')
{if(!currCheckBox.isDisabled)
{criteria.ControlValue=currCheckBox.checked?"1":"0";ckboxLabel=currCheckBox.nextSibling;criteria.ControlDisplayValue=ckboxLabel.firstChild.nodeValue;}}
break;case"DropDownList":ddlb=_oUtility.getElementByTagNameAndID(criteria.ControlHtmlName,'SELECT');if(ddlb!==null&&typeof ddlb!=='undefined')
{if(!ddlb.disabled)
{ctrlName=ddlb.id.search(/ddlDays/);if(ctrlName>0)
{NRT.Property.Search.Criteria.setPastListings(ddlb.value);criteria.ControlValue=NRT.Property.Search.Criteria.getPastListings().toString();criteria.ControlDisplayValue=NRT.Property.Search.Criteria.getPastListings().toString();}else{criteria.ControlValue=ddlb.options[ddlb.selectedIndex].value;criteria.ControlDisplayValue=ddlb.options[ddlb.selectedIndex].innerHTML;}}}
break;case"TextBox":currTextBox=_oUtility.getElementByTagNameAndID(criteria.ControlHtmlName,'INPUT');if(currTextBox!==null&&typeof currTextBox!=='undefined')
{criteria.ControlValue=currTextBox.value;criteria.ControlDisplayValue=currTextBox.innerHTML;}
break;}
return criteria.ControlValue;}};}();
NRT.Property.Search.Criteria=function()
{var _searchTypeID;var _searchTypeName;var _pastListings=0;return{getSearchTypeID:function()
{return parseInt(_searchTypeID,10);},setSearchTypeID:function(id)
{_searchTypeID=id;},getSearchTypeName:function()
{return _searchTypeName;},setSearchTypeName:function(name)
{_searchTypeName=name;},getPastListings:function()
{return parseInt(_pastListings,10);},setPastListings:function(value)
{_pastListings=value;},updateCriteriaLists:function()
{var oSearchType;var oPropertyType;try
{oSearchType=NRT.Utility.getElementByTagNameAndID('rbtnl_SearchTypes','TABLE');this.setSearchType(oSearchType);oPropertyType=document.getElementById('chklstPropertyType');if(oPropertyType!==null&&typeof oPropertyType!=='undefined'&&oPropertyType.innerHTML.length>0)
{this.setPropertyType(oPropertyType);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Criteria.updateCriteriaLists',_oErrorHandler.ERRORTYPE_JS,err);return;}},restoreUI:function()
{try
{this.updateCriteriaLists();}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Criteria.restoreUI',_oErrorHandler.ERRORTYPE_JS,err);return;}},setSearchType:function(ctrlSearchType)
{var rbSearchType;var oLabel;var divPropType;var divPropTypeHolder;var oMySearchCriteria;var nCustomCriteriaCount;var sPropertyTypes='';var nIndex;var criteria;var response;var oPropertyType;var oCheckBoxes;var divBedBaths;var ddlBeds;var ddlBaths;var divPriceRange;var divRentalPriceRange;var nItemIndex=0;var i;var ochildNode;var j;var oControl;var ddlRentalMinPrice;var ddlRentalMaxPrice;var ddlMaxPrice;var ddlMinPrice;var ddlGarages;var ddlSqFt;var ddlLotSize;var ddlYearBuilt;var ddlStories;var divGarageSqFt;var divLotSize;var divStoriesYrBuilt;var divAcreage;var divDateAvailable;try
{rbSearchType=NRT.Property.Search.Utility.getCheckedRadioButton(ctrlSearchType);if(rbSearchType!==null)
{oLabel=rbSearchType.parentNode;this.setSearchTypeID(rbSearchType.value);if(_oUtility.browserType()==='ie')
{this.setSearchTypeName(oLabel.innerText);}else{this.setSearchTypeName(oLabel.textContent);}
divPropType=document.getElementById('divPropertyType');divPropTypeHolder=document.getElementById('divPropTypeHolder');oMySearchCriteria=eval('('+NRT.Utility.getElementByTagNameAndID('hdnSrchCriteria','INPUT').value+')');nCustomCriteriaCount=oMySearchCriteria.CustomCriterias.length;for(nIndex=0;nIndex<nCustomCriteriaCount;nIndex+=1)
{criteria=oMySearchCriteria.CustomCriterias[nIndex];if(criteria.ControlType==='CheckBoxList')
{if(criteria.ControlHtmlName==='chklstPropertyType')
{sPropertyTypes=criteria.ControlValue;break;}}}
oMySearchCriteria=null;response=PropertyCriteriaControl.GetPropertyTypeByID(rbSearchType.value,sPropertyTypes);if(response.error!==null)
{_oErrorHandler.ResponseError('PropertyCriteriaControl.GetPropertyTypeByID',response);return;}else{if(response!==null&&response.value!==null)
{divPropTypeHolder.innerHTML=response.value;oPropertyType=document.getElementById('chklstPropertyType');oCheckBoxes=oPropertyType.getElementsByTagName('input');criteria.ChildControlCount=oCheckBoxes.length;if(oCheckBoxes.length>0)
{divPropType.style.display='inline';}else{divPropType.style.display='none';}}else{divPropType.style.display='none';}}
divBedBaths=document.getElementById('divBedBaths');ddlBeds=_oUtility.getElementByTagNameAndID('ddlBeds','SELECT');ddlBaths=_oUtility.getElementByTagNameAndID('ddlBaths','SELECT');divPriceRange=_oUtility.getElementByTagNameAndID('divPriceRange','DIV');divRentalPriceRange=_oUtility.getElementByTagNameAndID('divRentalPriceRange','DIV');ddlRentalMinPrice=_oUtility.getElementByTagNameAndID('ddlRentalMinPrice','SELECT');ddlRentalMaxPrice=_oUtility.getElementByTagNameAndID('ddlRentalMaxPrice','SELECT');ddlMaxPrice=_oUtility.getElementByTagNameAndID('ddlMaxPrice','SELECT');ddlMinPrice=_oUtility.getElementByTagNameAndID('ddlMinPrice','SELECT');ddlGarages=_oUtility.getElementByTagNameAndID('ddlGarages','SELECT');ddlSqFt=_oUtility.getElementByTagNameAndID('ddlSqFt','SELECT');ddlLotSize=_oUtility.getElementByTagNameAndID('ddlLotSize','SELECT');ddlYearBuilt=_oUtility.getElementByTagNameAndID('ddlYearBuilt','SELECT');ddlStories=_oUtility.getElementByTagNameAndID('ddlStories','SELECT');divGarageSqFt=_oUtility.getElementByTagNameAndID('divGarageSqFt','DIV');divLotSize=_oUtility.getElementByTagNameAndID('divLotSize','DIV');divStoriesYrBuilt=_oUtility.getElementByTagNameAndID('divStoriesYrBuilt','DIV');divAcreage=_oUtility.getElementByTagNameAndID('divAcreage','DIV');divDateAvailable=_oUtility.getElementByTagNameAndID('divDateAvailable','DIV');switch(rbSearchType.value)
{case'1':if(divBedBaths!==null&&typeof divBedBaths!=='undefined')
{divBedBaths.style.display='inline';}
if(ddlBeds!==null&&typeof ddlBeds!=='undefined')
{ddlBeds.disabled=false;}
if(ddlBaths!==null&&typeof ddlBaths!=='undefined')
{ddlBaths.disabled=false;}
if(divPriceRange!==null&&typeof divPriceRange!=='undefined')
{divPriceRange.style.display='inline';}
if(divRentalPriceRange!==null&&typeof divRentalPriceRange!=='undefined')
{divRentalPriceRange.style.display='none';}
if(ddlRentalMinPrice!==null&&typeof ddlRentalMinPrice!=='undefined')
{ddlRentalMinPrice.disabled=true;}
if(ddlRentalMaxPrice!==null&&typeof ddlRentalMaxPrice!=='undefined')
{ddlRentalMaxPrice.disabled=true;}
if(ddlMinPrice!==null&&typeof ddlMinPrice!=='undefined')
{ddlMinPrice.disabled=false;}
if(ddlMaxPrice!==null&&typeof ddlMaxPrice!=='undefined')
{ddlMaxPrice.disabled=false;}
if(ddlGarages!==null&&typeof ddlGarages!=='undefined')
{ddlGarages.disabled=false;}
if(ddlSqFt!==null&&typeof ddlSqFt!=='undefined')
{ddlSqFt.disabled=false;}
if(ddlLotSize!==null&&typeof ddlLotSize!=='undefined')
{ddlLotSize.disabled=true;}
if(ddlYearBuilt!==null&&typeof ddlYearBuilt!=='undefined')
{ddlYearBuilt.disabled=false;}
if(ddlStories!==null&&typeof ddlStories!=='undefined')
{ddlStories.disabled=false;}
if(divGarageSqFt!==null&&typeof divGarageSqFt!=='undefined')
{divGarageSqFt.style.display='inline';}
if(divLotSize!==null&&typeof divLotSize!=='undefined')
{divLotSize.style.display='none';}
if(divStoriesYrBuilt!==null&&typeof divStoriesYrBuilt!=='undefined')
{divStoriesYrBuilt.style.display='inline';}
if(divAcreage!==null&&typeof divAcreage!=='undefined')
{divAcreage.style.display='inline';}
if(divDateAvailable!==null&&typeof divDateAvailable!=='undefined')
{divDateAvailable.style.display='none';}
break;case'2':if(divBedBaths!==null&&typeof divBedBaths!=='undefined')
{divBedBaths.style.display='inline';}
if(ddlBeds!==null&&typeof ddlBeds!=='undefined')
{ddlBeds.disabled=false;}
if(ddlBaths!==null&&typeof ddlBaths!=='undefined')
{ddlBaths.disabled=false;}
if(divPriceRange!==null&&typeof divPriceRange!=='undefined')
{divPriceRange.style.display='inline';}
if(divRentalPriceRange!==null&&typeof divRentalPriceRange!=='undefined')
{divRentalPriceRange.style.display='none';}
if(ddlRentalMinPrice!==null&&typeof ddlRentalMinPrice!=='undefined')
{ddlRentalMinPrice.disabled=true;}
if(ddlRentalMaxPrice!==null&&typeof ddlRentalMaxPrice!=='undefined')
{ddlRentalMaxPrice.disabled=true;}
if(ddlMinPrice!==null&&typeof ddlMinPrice!=='undefined')
{ddlMinPrice.disabled=false;}
if(ddlMaxPrice!==null&&typeof ddlMaxPrice!=='undefined')
{ddlMaxPrice.disabled=false;}
if(ddlGarages!==null&&typeof ddlGarages!=='undefined')
{ddlGarages.disabled=true;}
if(ddlSqFt!==null&&typeof ddlSqFt!=='undefined')
{ddlSqFt.disabled=true;}
if(ddlLotSize!==null&&typeof ddlLotSize!=='undefined')
{ddlLotSize.disabled=true;}
if(ddlYearBuilt!==null&&typeof ddlYearBuilt!=='undefined')
{ddlYearBuilt.disabled=true;}
if(ddlStories!==null&&typeof ddlStories!=='undefined')
{ddlStories.disabled=true;}
if(divGarageSqFt!==null&&typeof divGarageSqFt!=='undefined')
{divGarageSqFt.style.display='none';}
if(divLotSize!==null&&typeof divLotSize!=='undefined')
{divLotSize.style.display='none';}
if(divStoriesYrBuilt!==null&&typeof divStoriesYrBuilt!=='undefined')
{divStoriesYrBuilt.style.display='none';}
if(divAcreage!==null&&typeof divAcreage!=='undefined')
{divAcreage.style.display='inline';}
if(divDateAvailable!==null&&typeof divDateAvailable!=='undefined')
{divDateAvailable.style.display='none';}
break;case'3':if(criteria!==null&&typeof criteria!=='undefined')
{criteria.ControlValue=null;}
if(divBedBaths!==null&&typeof divBedBaths!=='undefined')
{divBedBaths.style.display='none';}
if(ddlBeds!==null&&typeof ddlBeds!=='undefined')
{ddlBeds.disabled=true;}
if(ddlBaths!==null&&typeof ddlBaths!=='undefined')
{ddlBaths.disabled=true;}
if(divPriceRange!==null&&typeof divPriceRange!=='undefined')
{divPriceRange.style.display='inline';}
if(divRentalPriceRange!==null&&typeof divRentalPriceRange!=='undefined')
{divRentalPriceRange.style.display='none';}
if(ddlRentalMinPrice!==null&&typeof ddlRentalMinPrice!=='undefined')
{ddlRentalMinPrice.disabled=true;}
if(ddlRentalMaxPrice!==null&&typeof ddlRentalMaxPrice!=='undefined')
{ddlRentalMaxPrice.disabled=true;}
if(ddlMinPrice!==null&&typeof ddlMinPrice!=='undefined')
{ddlMinPrice.disabled=false;}
if(ddlMaxPrice!==null&&typeof ddlMaxPrice!=='undefined')
{ddlMaxPrice.disabled=false;}
if(ddlGarages!==null&&typeof ddlGarages!=='undefined')
{ddlGarages.disabled=true;}
if(ddlSqFt!==null&&typeof ddlSqFt!=='undefined')
{ddlSqFt.disabled=true;}
if(ddlLotSize!==null&&typeof ddlLotSize!=='undefined')
{ddlLotSize.disabled=false;}
if(ddlYearBuilt!==null&&typeof ddlYearBuilt!=='undefined')
{ddlYearBuilt.disabled=true;}
if(ddlStories!==null&&typeof ddlStories!=='undefined')
{ddlStories.disabled=true;}
if(divGarageSqFt!==null&&typeof divGarageSqFt!=='undefined')
{divGarageSqFt.style.display='none';}
if(divLotSize!==null&&typeof divLotSize!=='undefined')
{divLotSize.style.display='inline';}
if(divStoriesYrBuilt!==null&&typeof divStoriesYrBuilt!=='undefined')
{divStoriesYrBuilt.style.display='none';}
if(divAcreage!==null&&typeof divAcreage!=='undefined')
{divAcreage.style.display='inline';}
if(divDateAvailable!==null&&typeof divDateAvailable!=='undefined')
{divDateAvailable.style.display='none';}
break;case'4':if(divBedBaths!==null&&typeof divBedBaths!=='undefined')
{divBedBaths.style.display='inline';}
if(ddlBeds!==null&&typeof ddlBeds!=='undefined')
{ddlBeds.disabled=false;}
if(ddlBaths!==null&&typeof ddlBaths!=='undefined')
{ddlBaths.disabled=false;}
if(divPriceRange!==null&&typeof divPriceRange!=='undefined')
{divPriceRange.style.display='none';}
if(divRentalPriceRange!==null&&typeof divRentalPriceRange!=='undefined')
{divRentalPriceRange.style.display='inline';}
if(ddlRentalMinPrice!==null&&typeof ddlRentalMinPrice!=='undefined')
{ddlRentalMinPrice.disabled=false;}
if(ddlRentalMaxPrice!==null&&typeof ddlRentalMaxPrice!=='undefined')
{ddlRentalMaxPrice.disabled=false;}
if(ddlMinPrice!==null&&typeof ddlMinPrice!=='undefined')
{ddlMinPrice.disabled=true;}
if(ddlMaxPrice!==null&&typeof ddlMaxPrice!=='undefined')
{ddlMaxPrice.disabled=true;}
if(ddlGarages!==null&&typeof ddlGarages!=='undefined')
{ddlGarages.disabled=true;}
if(ddlSqFt!==null&&typeof ddlSqFt!=='undefined')
{ddlSqFt.disabled=true;}
if(ddlLotSize!==null&&typeof ddlLotSize!=='undefined')
{ddlLotSize.disabled=true;}
if(ddlYearBuilt!==null&&typeof ddlYearBuilt!=='undefined')
{ddlYearBuilt.disabled=true;}
if(ddlStories!==null&&typeof ddlStories!=='undefined')
{ddlStories.disabled=true;}
if(divGarageSqFt!==null&&typeof divGarageSqFt!=='undefined')
{divGarageSqFt.style.display='none';}
if(divLotSize!==null&&typeof divLotSize!=='undefined')
{divLotSize.style.display='none';}
if(divStoriesYrBuilt!==null&&typeof divStoriesYrBuilt!=='undefined')
{divStoriesYrBuilt.style.display='none';}
if(divAcreage!==null&&typeof divAcreage!=='undefined')
{divAcreage.style.display='none';}
if(divDateAvailable!==null&&typeof divDateAvailable!=='undefined')
{divDateAvailable.style.display='inline';}
break;}
if(_oUtility.browserType()==='ie')
{nItemIndex=0;}else{nItemIndex=1;}
for(i=0;i<ctrlSearchType.childNodes[nItemIndex].childNodes.length;i+=1)
{ochildNode=ctrlSearchType.childNodes[nItemIndex].childNodes[i];for(j=0;j<ochildNode.childNodes.length;j+=1)
{oControl=ochildNode.childNodes[j].firstChild;if(oControl!==null&&typeof oControl!=='undefined')
{oLabel=oControl.parentNode;if(oControl.checked===true)
{oLabel.className='textbold';}else{oLabel.className='text';}}}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Criteria.setSearchType',_oErrorHandler.ERRORTYPE_JS,err);return;}},setSearchClassType:function(checkboxControl)
{try
{if(checkboxControl!==null)
{switch(checkboxControl.parentNode.innerText)
{case'Open Homes':if(checkboxControl.checked===true)
{NRT.Property.Search.Utility.setSearchClass('1');}else{NRT.Property.Search.Utility.setSearchClass('Main');}
break;case'Luxury Homes & Estates':if(checkboxControl.checked===true)
{NRT.Property.Search.Utility.setSearchClass('2');}else{NRT.Property.Search.Utility.setSearchClass('Main');}
break;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Criteria.setSearchClassType',_oErrorHandler.ERRORTYPE_JS,err);return;}},setPropertyType:function(ctrlPropertyType)
{var i;var ochildNode;var j;var oControl;var oLabel;try
{for(i=0;i<ctrlPropertyType.firstChild.childNodes.length;i+=1)
{ochildNode=ctrlPropertyType.firstChild.childNodes[i];for(j=0;j<ochildNode.childNodes.length;j+=1)
{oControl=ochildNode.childNodes[j].firstChild;if(oControl!==null&&typeof oControl!=='undefined')
{oLabel=oControl.parentNode;if(oControl.checked===true)
{oLabel.className='textbold';}else{oLabel.className='text';}}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Criteria.setPropertyType',_oErrorHandler.ERRORTYPE_JS,err);return;}},setSelectedControlTextStyle:function(oControl)
{var oLabel;try
{oLabel=oControl.parentNode;if(oControl.checked===true||oControl.selected===true)
{oLabel.className='textbold';}else{oLabel.className='text';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Criteria.setSelectedControlTextStyle',_oErrorHandler.ERRORTYPE_JS,err);return;}},toggleDisplayNewListings:function(ctrlDisplayPastListings)
{var lblDays;var ddlDays;var oLabel;try
{lblDays=NRT.Utility.getElementByTagNameAndID('lblDays','SPAN');ddlDays=NRT.Utility.getElementByTagNameAndID('ddlDays','SELECT');oLabel=ctrlDisplayPastListings.parentNode;if(ctrlDisplayPastListings.checked===true)
{lblDays.style.fontWeight='bold';oLabel.style.fontWeight='bold';if(ddlDays!==null)
{ddlDays.disabled=false;this.setPastListings(ddlDays.value);}}else{lblDays.style.fontWeight='';oLabel.style.fontWeight='';if(ddlDays!==null)
{ddlDays.disabled=true;}
this.setPastListings(1);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Criteria.toggleDisplayNewListings',_oErrorHandler.ERRORTYPE_JS,err);return;}},validate:function(validationType)
{var bResult=true;var odivPriceRange;var minPrice;var maxPrice;var rentalMinPrice;var rentalMaxPrice;var odivRentalPriceRange;var nStateID;var divAcreage;var minAcres;var maxAcres;var minAcresValue;var maxAcresValue;try
{NRT.Property.Validation.UI.showPropertyType(false);NRT.Property.Validation.UI.showInvalidMaxPrice(false);NRT.Property.Validation.UI.showInvalidMaxRentalPrice(false);if(!this._selectedPropertyTypeIsEmpty())
{_oValidationXML.addValidation(validationType,NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_PROPTYPE_EMPTY);NRT.Property.Validation.UI.showPropertyType(true);bResult=false;}
nStateID=NRT.Property.Search.State.getStateID();if(NRT.Property.Search.State.getIsVisible()==='True'&&nStateID<=0){_oValidationXML.addValidation(validationType,NRT.Property.Validation.MESSAGE_CITYZIP_LOCATIONLIST_STATE_EMPTY);NRT.Property.Validation.UI.showPropertyType(true);bResult=false;}
odivPriceRange=NRT.Utility.getElementByTagNameAndID('divPriceRange','DIV');if(odivPriceRange!==null&&typeof odivPriceRange!=='undefined'&&odivPriceRange.style.display!=="none")
{minPrice=NRT.Utility.getElementByTagNameAndID('ddlMinPrice','SELECT');maxPrice=NRT.Utility.getElementByTagNameAndID('ddlMaxPrice','SELECT');if(parseInt(maxPrice.value,10)<parseInt(minPrice.value,10))
{_oValidationXML.addValidation(validationType,NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_MAXPRICE_INVALID);NRT.Property.Validation.UI.showInvalidMaxPrice(true);bResult=false;}}
odivRentalPriceRange=NRT.Utility.getElementByTagNameAndID('divRentalPriceRange','DIV');if(odivRentalPriceRange!==null&&typeof odivRentalPriceRange!=='undefined'&&odivRentalPriceRange.style.display!=="none")
{rentalMinPrice=NRT.Utility.getElementByTagNameAndID('ddlRentalMinPrice','SELECT');rentalMaxPrice=NRT.Utility.getElementByTagNameAndID('ddlRentalMaxPrice','SELECT');if(parseInt(rentalMaxPrice.value,10)<parseInt(rentalMinPrice.value,10))
{_oValidationXML.addValidation(validationType,NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_MAXPRICE_INVALID);NRT.Property.Validation.UI.showInvalidMaxRentalPrice(true);bResult=false;}}
divAcreage=NRT.Utility.getElementByTagNameAndID('divAcreage','DIV');if(divAcreage!==null&&typeof divAcreage!=='undefined'&&divAcreage.style.display!=="none")
{minAcres=NRT.Utility.getElementByTagNameAndID('ddlMinAcres','SELECT');maxAcres=NRT.Utility.getElementByTagNameAndID('ddlMaxAcres','SELECT');minAcresValue=(minAcres.value*100);maxAcresValue=(maxAcres.value*100);if(maxAcresValue<minAcresValue)
{_oValidationXML.addValidation(validationType,NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_MAXACRES_INVALID);NRT.Property.Validation.UI.showInvalidMaxAcres(true);bResult=false;}}
return bResult;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Criteria.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}},_selectedPropertyTypeIsEmpty:function()
{var propTypeCheckBoxName='chklstPropertyType';var oPropertyType=document.getElementById('chklstPropertyType');var allInputs=oPropertyType.getElementsByTagName('input');var x;if(allInputs.length>0)
{for(x=0;x<allInputs.length;x+=1)
{if(allInputs[x].type==='checkbox')
{if(allInputs[x].id.indexOf(propTypeCheckBoxName)>-1)
{if(allInputs[x].checked===true)
{return true;}}}}
return false;}else{return true;}}};}();
var _LearnMoreURL='/DynamicPage.aspx?PageID=34';var _oSearchCriteria=null;var _bRestore=false;var _NEW_YORK_STATE_ID='38';var _oValidationXML=new NRT.Property.Validation.XML();NRT.Property.Search.METHOD_NEWCONSTRUCTION='7';NRT.Property.Search.NEWCONSTRUCTION_PAGE_DESC='The Coldwell Banker Residential Brokerage New Homes Division is staffed with '+'experienced individuals who are experts in the field. This specialty division '+'represents hundreds of builders in the tri-state area and is well respected in '+'the industry. Our sales and marketing initiatives have garnered the highest awards.';NRT.Property.Search.NewConstruction=function(){var _stateID=0;var _regionID=0;var _countyID=0;var _countyName='';return{getStateID:function(){return parseInt(NRT.Property.Search.NewConstruction._stateID,10);},setStateID:function(ctrlState){if(ctrlState!==null&&typeof ctrlState!=='undefined'){var stateID;stateID=ctrlState.value;NRT.Property.Search.NewConstruction._stateID=stateID;if((stateID!==null)&&(stateID!=='')&&(stateID!=='-1')&&(stateID!=='0')){NRT.Utility.createCookie(stateID,365,null);}}},setStateIDByControlValue:function(id){NRT.Property.Search.NewConstruction._stateID=id;},getRegionID:function(){return parseInt(NRT.Property.Search.NewConstruction._regionID,10);},setRegionID:function(ctrlRegion){if(ctrlRegion!==null&&typeof ctrlRegion!=='undefined'){NRT.Property.Search.NewConstruction._regionID=ctrlRegion.value;}},setRegionIDByControlValue:function(id){NRT.Property.Search.NewConstruction._regionID=id;},getCountyID:function(){return parseInt(NRT.Property.Search.NewConstruction._countyID,10);},setCountyID:function(ctrlCounty){if(ctrlCounty!==null&&typeof ctrlCounty!=='undefined'){NRT.Property.Search.NewConstruction._countyID=ctrlCounty.value;NRT.Property.Search.NewConstruction._countyName=ctrlCounty.options(ctrlCounty.selectedIndex).text;}},setCountyIDByControlValue:function(id){NRT.Property.Search.NewConstruction._countyID=id;},getCountyName:function(){return NRT.Property.Search.NewConstruction._countyName;},setCountyName:function(countyName){NRT.Property.Search.NewConstruction._countyName=countyName;},getCountiesByState:function(){var stateID=0;try{stateID=NRT.Property.Search.NewConstruction.getStateID();if(stateID!==null&&typeof stateID!=='undefined'){NRT.Property.Search.NewConstruction._fillCountyDropDownList(stateID,0);}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.getCountiesByState',_oErrorHandler.ERRORTYPE_JS,err);return;}},getCountiesByStateRegion:function(){var stateID=0;var regionID=0;try{stateID=NRT.Property.Search.NewConstruction.getStateID();if(stateID!==null&&typeof stateID!=='undefined'){regionID=NRT.Property.Search.NewConstruction.getRegionID();if(regionID!==null&&typeof regionID!=='undefined'){NRT.Property.Search.NewConstruction._fillCountyDropDownList(stateID,regionID);}}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.getCountiesByStateRegion',_oErrorHandler.ERRORTYPE_JS,err);return;}},getRegions:function(){var stateID=0;try{stateID=NRT.Property.Search.NewConstruction.getStateID();if(stateID!==null&&typeof stateID!=='undefined'){NRT.Property.Search.NewConstruction._fillRegionDropDownList(stateID);}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.getRegions',_oErrorHandler.ERRORTYPE_JS,err);return;}},initializeUI:function(){var divPageDesc=null;try{divPageDesc=document.getElementById('div_NewConstruction_PageDesc');if(divPageDesc!==null&&typeof divPageDesc!=='undefined'){divPageDesc.innerHTML=NRT.Property.Search.NEWCONSTRUCTION_PAGE_DESC;}
NRT.Property.Search.NewConstruction._stateID=11;}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.initializeUI',_oErrorHandler.ERRORTYPE_JS,err);}},onKeyDown:function(evt){try{var charCode=(evt.which)?evt.which:event.keyCode
if(charCode==13){var btnSearch=_oUtility.getElementByTagNameAndID('img_Search','IMG');if(NRT.Utility.objectExists(btnSearch)){NRT.Property.Search.NewConstruction.performSearch();return true;}
return false;}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.onKeyDown',_oErrorHandler.ERRORTYPE_JS,err);return;}},performSearch:function(){var iConsumerSearchID=0;var iSearchID=0;var conSrchID=0;var srchID=0;try{if(!NRT.Property.Search.NewConstruction.validate()){return;}
NRT.Property.Search.NewConstruction.saveSearchCriteria();iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();if(iConsumerSearchID>0){conSrchID=SearchController.PersistConsumerSearch(_oSearchCriteria);window.location="PropertyResults.aspx?ConsumerSearchID="+conSrchID.val+NRT.Utility.Branding.appendBranding(_oSearchCriteria.BrandingID);}else{try{srchID=SearchController.NCPersistSearch(_oSearchCriteria);}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.getCountiesByState',_oErrorHandler.ERRORTYPE_JS,err);return;}
if(srchID!==null){window.location="PropertyResults.aspx?SearchID="+srchID.value+NRT.Utility.Branding.appendBranding(_oSearchCriteria.BrandingID);}}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.performSearch',_oErrorHandler.ERRORTYPE_JS,err);return;}},performSaveSearch:function(bEnableJustListed){var EnableJustListed=null;try{if(!NRT.Property.Search.NewConstruction.validate()){return;}
EnableJustListed=_oUtility.getElementByTagNameAndID('hdnEnableJustListed','INPUT');if(EnableJustListed!==null&&typeof EnableJustListed!=='undefined'){EnableJustListed.value=bEnableJustListed;}
if(NRT.MySite.Authentication.validateUser()){NRT.Property.Search.NewConstruction.saveSearch();}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.performSaveSearch',_oErrorHandler.ERRORTYPE_JS,err);return;}},redirectToLearnMorePage:function(){try{window.location=_oUtility.getAppPath()+_LearnMoreURL;}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.redirectToLearnMorePage',_oErrorHandler.ERRORTYPE_JS,err);return;}},restoreUI:function(){var iConsumerSearchID=0;var iSearchID=0;var oSearchCriteria=null;try{iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();if(iConsumerSearchID>0){oSearchCriteria=SearchController.GetPersistedConsumerSearch(iConsumerSearchID,this._restoreUI_Callback);}
if(iSearchID>0){oSearchCriteria=SearchController.GetPersistedSearch(iSearchID,this._restoreUI_Callback);}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.restoreUI',_oErrorHandler.ERRORTYPE_JS,err);return;}},saveSearch:function(){var consumerID=0;var conSrchID=0;var bIsEnable=false;var EnableJustListed=null;var bResult=false;var sQueryString='';try{NRT.Property.Search.NewConstruction.saveSearchCriteria();consumerID=NRT.MySite.Authentication.getConsumerID();conSrchID=SearchController.PersistConsumerSearch(consumerID,_oSearchCriteria).value;EnableJustListed=_oUtility.getElementByTagNameAndID('hdnEnableJustListed','INPUT');if(EnableJustListed!==null&&typeof EnableJustListed!=='undefined'){bIsEnable=EnableJustListed.value;}
bResult=MySiteProvider.HasMaxSavedSearches(_MaxSavedSearches,consumerID).value;if(bResult){sQueryString='controlType=SaveSearchLimitReached&ConsumerSearchID='+conSrchID+'&ConsumerID='+consumerID+'&EnableJustListed='+bIsEnable;_oUtility.showLayeredPage(sQueryString,_WinW_SaveSearch_LimitReached,_WinTitle_SaveSearch_LimitReached,_DefFocusItemID_SaveSearch_LimitReached,_DefFocusItemType_SaveSearch_LimitReached);}else{sQueryString='controlType=SaveSearch&ConsumerSearchID='+conSrchID+'&EnableJustListed='+bIsEnable;_oUtility.showLayeredPage(sQueryString,_WinW_SaveSearch,_WinTitle_SaveSearch,_DefFocusItemID_SaveSearch,_DefFocusItemType_SaveSearch);}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.saveSearch',_oErrorHandler.ERRORTYPE_JS,err);return;}},saveSearchCriteria:function(){var i;var oCriteria=null;try{_oSearchCriteria=eval('('+NRT.Utility.getElementByTagNameAndID('hdnSrchCriteria','INPUT').value+')');_oSearchCriteria.SearchMethod=parseInt(NRT.Property.Search.METHOD_NEWCONSTRUCTION,10);_oSearchCriteria.PropertySearchClass='Main';_oSearchCriteria.StateID=NRT.Property.Search.NewConstruction.getStateID();_oSearchCriteria.RegionID=NRT.Property.Search.NewConstruction.getRegionID();_oSearchCriteria.CountyID=NRT.Property.Search.NewConstruction.getCountyID();_oSearchCriteria.CountyName=NRT.Property.Search.NewConstruction.getCountyName();for(i=0;i<_oSearchCriteria.CustomCriterias.length;i+=1){oCriteria=_oSearchCriteria.CustomCriterias[i];NRT.Property.Search.NewConstruction._setControlValue(oCriteria);}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.saveSearchCriteria',_oErrorHandler.ERRORTYPE_JS,err);return;}},validate:function(){var bReturn=true;var ddlState=null;var minPrice;var maxPrice;var stateText='';try{_oValidationXML.clear();NRT.Property.Validation.UI.showStateList(false);NRT.Property.Validation.UI.showInvalidMaxPrice(false);ddlState=_oUtility.getElementByTagNameAndID('ddlState','SELECT');if(ddlState!==null&&typeof ddlState!=='undefined'){stateText=ddlState.options[ddlState.selectedIndex].text;if(stateText===''){_oValidationXML.addValidation(NRT.Property.Validation.TYPE_NEWCONSTRUCTION,NRT.Property.Validation.MESSAGE_NEWCONSTRUCTION_STATE_EMPTY);NRT.Property.Validation.UI.showStateList(true);bResult=false;}}
minPrice=NRT.Utility.getElementByTagNameAndID('ddlMinPrice','SELECT');maxPrice=NRT.Utility.getElementByTagNameAndID('ddlMaxPrice','SELECT');if(parseInt(maxPrice.value,10)<parseInt(minPrice.value,10)){_oValidationXML.addValidation(NRT.Property.Validation.TYPE_NEWCONSTRUCTION,NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_MAXPRICE_INVALID);NRT.Property.Validation.UI.showInvalidMaxPrice(true);bResult=false;}
if(_oValidationXML.count()!==0){NRT.Property.Validation.Summary.show();bReturn=false;}
return bReturn;}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}},_fillCountyDropDownList:function(StateID,RegionID){var aCounties=null;try{aCounties=SearchController.GetCounties(StateID,RegionID,NRT.Property.Search.NewConstruction._fillCountyDropDownList_CallBack);}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction._fillCountyDropDownList',_oErrorHandler.ERRORTYPE_JS,err);}},_fillRegionDropDownList:function(StateID){var aRegions=null;try{aRegions=SearchController.GetRegions(StateID,NRT.Property.Search.NewConstruction._fillRegionDropDownList_CallBack);}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction._fillRegionDropDownList',_oErrorHandler.ERRORTYPE_JS,err);}},_fillCountyDropDownList_CallBack:function(response){var oLocations=null;var lstCounty=null;var i;try{if(response.error!==null){_oErrorHandler.ResponseError('NRT.Property.Search.NewConstruction._fillCountyDropDownList_CallBack',response);return;}else{if(response!==null&&response.value!==null){oLocations=response.value.Locations;if(oLocations.length>0&&response.value!==''){lstCounty=_oUtility.getElementByTagNameAndID('ddlCounty','SELECT');if(lstCounty!==null&&typeof lstCounty!=='undefined'){lstCounty.innerHTML='';lstCounty.options[0]=new Option('-- All --','-99',false,false);for(i=0;i<oLocations.length;i+=1){lstCounty.options[lstCounty.length]=new Option(oLocations[i].DisplayName1,oLocations[i].LocationID,false,false);}}}}}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction._fillCountyDropDownList_CallBack',_oErrorHandler.ERRORTYPE_AJAX,err);}},_fillRegionDropDownList_CallBack:function(response){var oLocations=null;var lstRegion=null;var lstState=null;var i;try{if(response.error!==null){_oErrorHandler.ResponseError('NRT.Property.Search.NewConstruction._fillRegionDropDownList_CallBack',response);return;}else{if(response!==null&&response.value!==null){oLocations=response.value.Locations;if(oLocations.length>0&&response.value!==''){lstRegion=_oUtility.getElementByTagNameAndID('ddlRegion','SELECT');lstState=_oUtility.getElementByTagNameAndID('ddlState','SELECT');if((lstRegion!==null)&&(typeof lstRegion!=='undefined')&&(lstState.value===_NEW_YORK_STATE_ID)){lstRegion.disabled=false;lstRegion.innerHTML='';for(i=0;i<oLocations.length;i+=1){lstRegion.options[lstRegion.length]=new Option(oLocations[i].DisplayName1,oLocations[i].LocationID,false,false);if(i==0){NRT.Property.Search.NewConstruction.setRegionIDByControlValue(oLocations[0].LocationID);}}}
else{lstRegion.innerHTML='';lstRegion.disabled=true;NRT.Property.Search.NewConstruction.setRegionIDByControlValue(-1);}}}}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction._fillRegionDropDownList_CallBack',_oErrorHandler.ERRORTYPE_AJAX,err);}},_restoreUI_Callback:function(response){var locXML=null;try{if(response.error!==null){_oErrorHandler.ResponseError('NRT.Property.Search.CityZip._restoreUI_Callback',response);return;}else{if(response!==null&&response.value!==null){_bRestore=true;locXML=response.value.LocationXML;if(locXML!==null&&typeof locXML!=='undefined'){_oCZLocationXML.loadFromXML(locXML);}
if(response.value.StateID!==null){NRT.Property.Search.State.setStateID(response.value.StateID);}
if(response.value.RegionID!==null){NRT.Property.Search.Region.setRegionID(response.value.RegionID);}
if(response.value.CountyID!==null){NRT.Property.Search.County.setCountyID(response.value.CountyID);}}}}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction._restoreUI_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}},_setControlValue:function(criteria){var ddlb=null;try{if(criteria.ControlType==='DropDownList'){ddlb=_oUtility.getElementByTagNameAndID(criteria.ControlHtmlName,'SELECT');if(ddlb!==null&&typeof ddlb!=='undefined'){criteria.ControlValue=ddlb.options[ddlb.selectedIndex].value;criteria.ControlDisplayValue=ddlb.options[ddlb.selectedIndex].innerHTML;}}
else if(criteria.ControlType=='CheckBox'){currCheckBox=_oUtility.getElementByTagNameAndID(criteria.ControlHtmlName,'INPUT');if(currCheckBox!==null&&typeof currCheckBox!=='undefined'){if(!currCheckBox.isDisabled){criteria.ControlValue=currCheckBox.checked?"1":"0";ckboxLabel=currCheckBox.nextSibling;criteria.ControlDisplayValue=ckboxLabel.firstChild.nodeValue;}}}
return criteria.ControlValue;}
catch(err){_oErrorHandler.Error('NRT.Property.Search.NewConstruction._setControlValue',_oErrorHandler.ERRORTYPE_JS,err);return;}}};}();
NRT.Property.Search.Intellisense=function()
{var _sSource=null;var _oAutoComp;var _maxResultsDisplayed=10;var _oLocation={};return{getSource:function()
{return _sSource;},setSource:function(sourceName)
{_sSource=sourceName;},getSearchString:function()
{return _oAutoComp._elTextbox.value;},setSearchString:function(textValue)
{_oAutoComp._elTextbox.value=textValue;},setFocus:function()
{var oTxtIntellisense;try
{if(_oTab.tabSelected()===0)
{if(NRT.Property.Search.Utility.getActiveDiv()==='CZT')
{oTxtIntellisense=_oUtility.getElementByTagNameAndID('txtIntellisense','INPUT');_oUtility.setFocus(oTxtIntellisense);oTxtIntellisense.select();}}else if(_oTab.tabSelected()===1)
{oTxtIntellisense=_oUtility.getElementByTagNameAndID('txtIntellisenseNBC','INPUT');_oUtility.setFocus(oTxtIntellisense);oTxtIntellisense.select();}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Intellisense.setFocus',_oErrorHandler.ERRORTYPE_JS,err);return;}},init:function(elInput,elContainer,subscribe)
{var oACDS;var _isOlderIE=false;var sKey='';var sKeyQuery='';var sKeyRemainder='';var aMarkup=null;try
{if(elInput==='txtIntellisense')
{this.setSource('CZT');}else if(elInput==='txtIntellisenseNBC')
{this.setSource('NBC');}
oACDS=new YAHOO.widget.DS_JSFunction(this.getLocations);oACDS.responseType=YAHOO.util.XHRDataSource.TYPE_JSON;oACDS.maxCacheEntries=0;oACDS.responseSchema={resultsList:".Locations",fields:["DisplayName1","DisplayName2","LocationID","LocationType","IsParentLocation","ProximityDistance","InternalLocationID","LocationKey"]}
_oAutoComp=new YAHOO.widget.AutoComplete(elInput,elContainer,oACDS);if((navigator.appVersion.indexOf('MSIE 4',0)>-1)||(navigator.appVersion.indexOf('MSIE 5',0)>-1)||(navigator.appVersion.indexOf('MSIE 6',0)>-1))
{_isOlderIE=true;}
if(_isOlderIE)
{_oAutoComp.useIFrame=true;}
_oAutoComp.alwaysShowContainer=false;_oAutoComp.animVert=true;_oAutoComp.queryDelay=0;_oAutoComp.minQueryLength=1;_oAutoComp.maxResultsDisplayed=10;_oAutoComp.useShadow=true;_oAutoComp.typeAhead=false;_oAutoComp.resultTypeList=false;_oAutoComp._elTextbox.maxLength=100;_FocusId=_oAutoComp._elTextbox.id;_oAutoComp.formatResult=function(oResultItem,sQuery,sResultMatch)
{sKey=oResultItem.DisplayName1;sKeyQuery=sKey.substr(0,sQuery.length);sKeyRemainder=sKey.substr(sQuery.length);aMarkup=["<div id=\"ysearchresult\">","<span style=\"font-weight: bold\">",sKeyQuery,"</span>",sKeyRemainder,"</div>"];return(aMarkup.join(""));};_oAutoComp.dataReturnEvent.subscribe(this.myOnDataReturn);_oAutoComp.containerCollapseEvent.subscribe(this.myOnContainerCollapse);if(subscribe===true)
{_oAutoComp.itemSelectEvent.subscribe(this.myItemSelectEvent);}}
catch(err)
{throw err;}},getLocations:function(sQuery)
{var s=null;var stateID=0;var regionID=0;var aRequest=null;var aResults=[];var oDS_XHR=null;try
{if(!_oUtility.isNumeric(sQuery))
{stateID=NRT.Property.Search.State.getStateID();regionID=NRT.Property.Search.Region.getRegionID();s=SearchController.GetIntellisenseLocations(stateID,regionID,sQuery);if(_oTab.tabSelected()===0)
{document.getElementById("divIntellisenseContainer").style.display="inline";}else
{document.getElementById("divIntellisenseContainerNBC").style.display="inline";}
return s.value.replace(/\'/g,'\"');}else
{return aResults;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Intellisense.getLocations',_oErrorHandler.ERRORTYPE_JS,err);return;}},getSelectedLocation:function(sLocation)
{var sQuery;try
{if(_oUtility.isNumeric(sLocation.substring(0,1)))
{if(sLocation.length<5)
{NRT.Property.Search.Intellisense._resetLocation();}
else
{sQuery=sLocation.substring(0,5);_oLocation.id='-'+sQuery;_oLocation.internalId='';_oLocation.name=sQuery;_oLocation.locationType=0;_oLocation.isParentLocation=false;_oLocation.proximityDistance=0;}}
else
{_oAutoComp.dataSource.sendRequest(sLocation,this._setItem,_oAutoComp);}
return _oLocation;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Intellisense.getSelectedLocation',_oErrorHandler.ERRORTYPE_JS,err);return;}},_resetLocation:function()
{_oLocation.id=0;_oLocation.internalId='';_oLocation.name='';_oLocation.locationType=0;_oLocation.isParentLocation=false;_oLocation.proximityDistance=0;},_setItem:function(sQuery,oResults,oSelf)
{var nItems;var i;var oResultItemi;var aResults;NRT.Property.Search.Intellisense._resetLocation();if(oResults.length!==0)
{if(oResults!==null&&typeof oResults!==undefined)
{aResults=oResults.results;nItems=aResults.length;}
for(i=nItems-1;i>=0;i-=1)
{oResultItemi=aResults[i];if(oResultItemi.DisplayName1.toUpperCase()===sQuery.toUpperCase())
{_oLocation.id=oResultItemi.LocationID;_oLocation.internalId=oResultItemi.InternalLocationID;_oLocation.name=oResultItemi.DisplayName1;if(oResultItemi.LocationType!==null&&typeof oResultItemi.LocationType!=='undefined'&&oResultItemi.LocationType!=='')
{_oLocation.locationType=oResultItemi.LocationType;}
_oLocation.isParentLocation=oResultItemi.IsParentLocation;_oLocation.proximityDistance=oResultItemi.ProximityDistance;}}}},myItemSelectEvent:function(sType,aArgs)
{var oTextbox=null;if(_sSource==='CZT')
{NRT.Property.Search.Utility.addIntellisenseLocation('CZT');oTextbox=document.getElementById('txtIntellisense');if(oTextbox!==null)
{oTextbox.value='';}}else if(_sSource==='NBC')
{NRT.Property.Search.Utility.addIntellisenseLocation('NBC');oTextbox=document.getElementById('txtIntellisenseNBC');}},myOnDataReturn:function(sType,aArgs)
{var oAutoComp=aArgs[0];var sQuery=aArgs[1];var aResults=aArgs[2];if(NRT.Property.Search.NearbyCity!==null)
{if(aResults.length===0)
{NRT.Property.Search.NearbyCity.toggleDDL(true);}else
{NRT.Property.Search.NearbyCity.toggleDDL(false);}}},myOnContainerCollapse:function(sType,aArgs)
{if(NRT.Property.Search.NearbyCity!==null)
{NRT.Property.Search.NearbyCity.toggleDDL(true);}},checkForValidKeyCodes:function(e)
{var key=window.event?e.keyCode:e.which;var keychar;keychar=String.fromCharCode(key);if(!NRT.Property.Search.Utility.validLocation(keychar))
{YAHOO.util.Event.stopEvent(e);}
return;}};}();
NRT.Property.Search.NearbyCity=function()
{return{changeMiles:function()
{var sLocation;try
{if(_oNBCLocationXML!==null)
{_bChangeRadious=true;sLocation=_oUtility.trimString(NRT.Property.Search.Intellisense.getSearchString());NRT.Property.Search.NearbyCity.getNearbyCityListHtml(sLocation,null,_oNBCLocationXML.getXML(false),null,_bChangeRadious);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.changeMiles',_oErrorHandler.ERRORTYPE_JS,err);return;}},clearErrorMessage:function()
{var spnErrMessage;try
{spnErrMessage=document.getElementById('spnNearbyCityErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML='';spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.clearErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}},clickCheckbox:function(chkNearbyCity)
{var oRow=null;var nChar;var locID;try
{oRow=chkNearbyCity.parentNode.parentNode;nChar=chkNearbyCity.id.lastIndexOf('_');locID=chkNearbyCity.id.substr(nChar+1,chkNearbyCity.id.length);if(_oNBCLocationXML.locationExists(locID))
{_oNBCLocationXML.removeLocationNodeByValue(locID);if(chkNearbyCity.checked)
{NRT.Property.Search.CommunitySelection.setSelectedCommunityLink(true,'Select Communities',locID,'');}}
if(chkNearbyCity.checked)
{oRow.className='textbold';_oNBCLocationXML.addLocation(locID,chkNearbyCity.value,chkNearbyCity.lang,0);}else{oRow.className='text';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.clickCheckbox',_oErrorHandler.ERRORTYPE_JS,err);return;}},getNearbyCityListHtml:function(startLoc,miles,xmlLocations,bRestore,bChangeRadious)
{var locationID=null;var locationName=null;var oLocation=null;var stateID;var stateDisplayName;var regionID;var oCityLocResults;var oCity;var milesDDL;var distance='0';try
{if(!_oNBCLocationXML.isEmpty()&&!bRestore&&!bChangeRadious)
{_oNBCLocationXML.clear();}
oLocation=NRT.Property.Search.Intellisense.getSelectedLocation(startLoc);if(oLocation.id===0&&!_oNBCLocationXML.isEmpty()&&bRestore)
{locationName=_oNBCLocationXML.locationName();oLocation=NRT.Property.Search.Intellisense.getSelectedLocation(locationName);}
if(oLocation.id===0)
{locationID=NRT.Property.Search.DidYouMean.getSelectedNearbyCityInternalId();locationName=NRT.Property.Search.DidYouMean.getSelectedNearbyCityLocationName();}else{locationID=oLocation.internalId;locationName=oLocation.name;}
stateID=NRT.Property.Search.State.getStateID();stateDisplayName=NRT.Property.Search.State.getStateName();regionID=NRT.Property.Search.Region.getRegionID();if((locationID!==null&&typeof locationID!=='undefined')&&(locationName!==null&&typeof locationName!=='undefined'&&locationName.length>0))
{oCityLocResults=SearchController.GetCity(locationName,stateID,regionID,null);if(oCityLocResults.value.Locations.length>=1)
{if(bRestore===null&&bChangeRadious===null)
{oCity=oCityLocResults.value.Locations[0];_oNBCLocationXML.addLocation(oCity.LocationID,oCity.DisplayName1,oCity.IsParentLocation.toString(),oCity.LocationType);}
xmlLocations=_oNBCLocationXML.getXML(false);}}
if(miles!==null)
{distance=miles;}else{milesDDL=NRT.Property.Search.GlobalObject.ddlNearbyMiles();if(milesDDL!==null)
{distance=milesDDL.value;}}
SearchUIController.GetNearbyCityLocationListHtml(locationID,locationName,stateID,stateDisplayName,regionID,distance,xmlLocations,bChangeRadious,bRestore,this._getNearbyCityListHtml_Callback);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.getNearbyCityListHtml',_oErrorHandler.ERRORTYPE_JS,err);return;}},restoreUI:function()
{var iConsumerSearchID;var iSearchID;var oSearchCriteria=null;try
{iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();if(iConsumerSearchID>0)
{oSearchCriteria=SearchController.GetPersistedConsumerSearch(iConsumerSearchID,this._restoreUI_Callback);}
if(iSearchID>0)
{oSearchCriteria=SearchController.GetPersistedSearch(iSearchID,this._restoreUI_Callback);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.restoreUI',_oErrorHandler.ERRORTYPE_JS,err);return;}},selectAll:function(bCheck)
{var x;var allInputs;try
{allInputs=document.getElementsByTagName('input');for(x=0;x<allInputs.length;x+=1)
{if(allInputs[x].type==='checkbox')
{if(allInputs[x].name.indexOf('chkNearbyCitySelectedLocation')>-1)
{if(allInputs[x].checked!==bCheck)
{allInputs[x].checked=bCheck;this.clickCheckbox(allInputs[x]);}}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.selectAll',_oErrorHandler.ERRORTYPE_JS,err);return;}},showCommunitySelection:function(cityId,cityName,communityIds)
{var stateID;var regionID;var sQueryString;try
{NRT.Property.Search.GlobalObject.setSelectedCtrlSourceName('TypeIn');stateID=NRT.Property.Search.State.getStateID();regionID=NRT.Property.Search.Region.getRegionID();sQueryString='controlType=CommunitySelection&cityName='+cityName+'&cityID='+cityId+'&CommunityIds='+communityIds+'&StateID='+stateID+'&RegionID='+regionID;_oUtility.showLayeredPage(sQueryString,_WinW_CommunitySelection,_WinTitle_CommunitySelection,_DefFocusItemID_CommunitySelection,_DefFocusItemType_CommunitySelection);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.showCommunitySelection',_oErrorHandler.ERRORTYPE_JS,err);return;}},showErrorMessage:function(sMessage)
{var spnErrMessage;try
{spnErrMessage=document.getElementById('spnNearbyCityErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML=sMessage;spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.showErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}},showDidYouMeanLayer:function()
{var searchVal;var stateID;var regionID;var sQueryString;try
{searchVal=NRT.Property.Search.Intellisense.getSearchString();stateID=NRT.Property.Search.State.getStateID();regionID=NRT.Property.Search.Region.getRegionID();sQueryString='controlType=DidYouMean&inputType=radio&searchValue='+searchVal+'&StateID='+stateID+'&RegionID='+regionID+'&TabName=NearbyCities';_oUtility.showLayeredPage(sQueryString,_WinW_DidYouMean,_WinTitle_DidYouMean,_DefFocusItemID_DidYouMean,_DefFocusItemType_DidYouMean);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.showDidYouMeanLayer',_oErrorHandler.ERRORTYPE_JS,err);return;}},toggleDDL:function(bShow)
{var ddlElements;try
{ddlElements=NRT.Utility.getElementByTagNameAndID('ddlNearbyMiles','SELECT');if(ddlElements!==null)
{if(ddlElements.length>0)
{if(bShow)
{ddlElements[0].style.display='block';}else{ddlElements[0].style.display='none';}}
ddlElements=null;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.toggleDDL',_oErrorHandler.ERRORTYPE_JS,err);return;}},validate:function()
{var ddlNearbyMiles;try
{if(NRT.Property.Search.Intellisense.getSearchString()==="")
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_NEARBYCITY,NRT.Property.Validation.MESSAGE_NBCITIES_LOC_EMPTY);this._scrollToTop();return false;}
else
{ddlNearbyMiles=_oUtility.getElementByTagNameAndID('ddlNearbyMiles','SELECT');if(_oNBCLocationXML.isEmpty()||ddlNearbyMiles===null||typeof ddlNearbyMiles==='undefined')
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_NEARBYCITY,NRT.Property.Validation.MESSAGE_NBCITIES_NO_SELECTIONS);this._scrollToTop();return false;}}
return true;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}},_refreshLocationXML:function(locations)
{var arrLocsToDelete=[];var i;var locId;var bFound;var j;var k;var id;try
{if(_oNBCLocationXML!==null)
{for(i=0;i<_oNBCLocationXML.xmlDoc.childNodes[0].childNodes[0].childNodes[0].childNodes.length;i+=1)
{locId=_oNBCLocationXML.xmlDoc.childNodes[0].childNodes[0].childNodes[0].childNodes[i].attributes[0].value;bFound=false;for(j=0;j<locations.length;j+=1)
{if(locations[j]===locId)
{bFound=true;break;}}
if(bFound)
{arrLocsToDelete.push(locId);}}
for(k=0;k<arrLocsToDelete.length;k+=1)
{id=arrLocsToDelete[k];if(_oNBCLocationXML.locationExists(id))
{_oNBCLocationXML.removeLocationNodeByValue(id);}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity._refreshLocationXML',_oErrorHandler.ERRORTYPE_JS,err);}},_scrollToTop:function()
{try
{if(_oUtility.browserType()==='ie')
{document.body.firstChild.scrollIntoView(true);}else{document.body.scrollIntoView(true);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity._scrollToTop',_oErrorHandler.ERRORTYPE_JS,err);}},_getNearbyCityListHtml_Callback:function(response)
{var _oLocationsHTML;var _oLocations;var sHtml;try
{if(response.error!==null)
{_oErrorHandler.ResponseError('NRT.Property.Search.NearbyCity.getNearbyCityListHtml_Callback',response);return;}else{if(response!==null&&response.value!==null)
{_oLocationsHTML=eval('('+response.value+')');document.getElementById('divNearbyCitiesResults').innerHTML=_oLocationsHTML.NBCLocations;_oLocations=_oLocationsHTML.Locations;if(_oLocations!==null&&_oLocations.length>0&&_oNBCLocationXML.isEmpty())
{_oNBCLocationXML.addLocation(_oLocations[0],_oLocations[1],_oLocations[2],_oLocations[3]);return;}
if(_oLocations!==null&&!_bRestore&&_bChangeRadious)
{if(_oLocations.length>0)
{NRT.Property.Search.NearbyCity._refreshLocationXML(_oLocations);}}
_bRestore=false;_bChangeRadious=false;}else{sHtml=null;sHtml='<br /><strong>No locations were found that match your search criteria!</strong><br /><br />';document.getElementById('divNearbyCitiesResults').innerHTML=sHtml;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity._getNearbyCityListHtml_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}},_restoreUI_Callback:function(response)
{var ctrlStartLoc;var locXML;try
{if(response.error!==null)
{_oErrorHandler.ResponseError('NRT.Property.Search.NearbyCity._restoreUI_Callback',response);return;}else{if(response!==null&&response.value!==null)
{_bRestore=true;if(response.value.ActiveTab===1)
{NRT.Property.Search.Utility.tabClick(1);}
NRT.Property.Search.State.setStateDependentControls();if(response.value.NearbyCityStartLoc!==null)
{ctrlStartLoc=document.getElementById(response.value.NearbyCityStartLoc.ControlHtmlName);ctrlStartLoc.value=response.value.NearbyCityStartLoc.ControlValue;}
locXML=response.value.LocationXML;if(locXML!==null)
{_oNBCLocationXML.loadFromXML(locXML);}
if(response.value.NearbyCityRadius!==null)
{NRT.Property.Search.NearbyCity.getNearbyCityListHtml(ctrlStartLoc.value,response.value.NearbyCityRadius.ControlValue,_oNBCLocationXML.getXML(false),_bRestore);}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.NearbyCity._restoreUI_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}}};}();
NRT.Property.Search.CommunitySelection=function()
{var _communitySelectionCheckBoxName='chkSelectedCommunity';var _nearbycitySelectionCheckBoxName='chkNearbyCitySelectedLocation';return{closeWindow:function()
{var DialogID=null;try
{DialogID="Dialog_"+_WinTitle_CommunitySelection.replace(" ","_");_oUtility.closeLayeredPage(DialogID);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CommunitySelection.closeWindow',_oErrorHandler.ERRORTYPE_JS,err);return;}},getSelectedCommunities:function()
{var rbAllCommunities;var bIsSelectAllChecked;var sSelCommunityLocationID;var sSelectedCommunityIds;var sSelectedCommunityLocationName;var sSelectedCommunityLocationID='';var arrSelectedCommunityInfo=[];var arrSelectedCommunityCheckBoxes=[];var i;var sMessage=null;var oLocLabel;var locID;var locName;var locIsParent='false';var sCommunities=null;var locIsCommunity=1;var sGenericInputFieldName;var divName;var olocCollection;try
{NRT.Property.Search.CommunitySelection._clearErrorMessage();rbAllCommunities=NRT.Property.Search.GlobalObject.rbAllCommunities();if(rbAllCommunities!==null)
{bIsSelectAllChecked=rbAllCommunities.checked;}
if(_oTab.tabSelected()===1)
{arrSelectedCommunityInfo=this._getSelectedCommunityIds();if(arrSelectedCommunityInfo!==null&&arrSelectedCommunityInfo.length>0)
{sSelectedCommunityIds=arrSelectedCommunityInfo[0];sSelectedCommunityLocationID=arrSelectedCommunityInfo[1];sSelectedCommunityLocationName=arrSelectedCommunityInfo[2];sSelectedCommunityLocationName=sSelectedCommunityLocationName.slice(0,sSelectedCommunityLocationName.length-1);if(bIsSelectAllChecked)
{this.setSelectedCommunityLink(true,'Select Communities',sSelectedCommunityLocationName,sSelectedCommunityLocationID,sSelectedCommunityIds);}else{if(sSelectedCommunityIds==='')
{oLocLabel=NRT.Utility.getElementByTagNameAndID('lblAllCommunities','SPAN');if(oLocLabel!==null)
{sMessage=NRT.Property.Validation.MESSAGE_COMMSELECT_COMM_EMPTY+"\''";sMessage+=oLocLabel.innerText+"\''.";}
NRT.Property.Search.CommunitySelection._showErrorMessage(sMessage);return;}else{this.setSelectedCommunityLink(false,'Edit Selected Communities',sSelectedCommunityLocationName,sSelectedCommunityLocationID,sSelectedCommunityIds);}}}}else{arrSelectedCommunityCheckBoxes=this._getSelectedCheckBoxes();if(arrSelectedCommunityCheckBoxes!==null&&arrSelectedCommunityCheckBoxes.length>0)
{olocCollection=new _oUtility.createCollection('NRT.Property.Search.LocationCollection');for(i=0;i<arrSelectedCommunityCheckBoxes.length;i+=1)
{locID=arrSelectedCommunityCheckBoxes[i].value;locName=arrSelectedCommunityCheckBoxes[i].title;olocCollection.add(new NRT.Property.Search.Location(locID,locName,locIsParent,sCommunities,locIsCommunity));}
if(olocCollection!==null&&olocCollection.length>0)
{sGenericInputFieldName=arrSelectedCommunityCheckBoxes[0].id.replace(_communitySelectionCheckBoxName,'');sSelCommunityLocationID=document.getElementById(sGenericInputFieldName+'hdnSelCommunityCityID').value;divName=NRT.Property.Search.GlobalObject.divSelectedLocations();_oCZLocationXML.updateLocations(sSelCommunityLocationID,olocCollection);NRT.Property.Search.CityZip.refreshSelectedLocations(divName);NRT.Property.Search.CommunitySelection.closeWindow();NRT.Property.Search.Intellisense.setFocus();}}
else if(!bIsSelectAllChecked)
{oLocLabel=NRT.Utility.getElementByTagNameAndID('lblAllCommunities','SPAN');if(oLocLabel!==null)
{sMessage=NRT.Property.Validation.MESSAGE_COMMSELECT_COMM_EMPTY+"\''";sMessage+=oLocLabel.innerText+"\''.";}
NRT.Property.Search.CommunitySelection._showErrorMessage(sMessage);return;}}
NRT.Property.Search.CommunitySelection.closeWindow();}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CommunitySelection.getSelectedCommunities',_oErrorHandler.ERRORTYPE_JS,err);return;}},handleSearchAllCommunitiesClick:function()
{var oCommunityControl;try
{oCommunityControl=NRT.Property.Search.GlobalObject.divCommunitySelectionCheckboxes();if(oCommunityControl!==null&&oCommunityControl!==undefined)
{this._setCommunityCheckBoxProperties(_communitySelectionCheckBoxName,false,false);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CommunitySelection.handleSearchAllCommunitiesClick',_oErrorHandler.ERRORTYPE_JS,err);return;}},handleSearchSelectedCommunitiesClick:function()
{var oCommunityControl;var sTableId;try
{oCommunityControl=NRT.Property.Search.GlobalObject.divCommunitySelectionCheckboxes();if(oCommunityControl!==null&&oCommunityControl!==undefined)
{oCommunityControl.style.backgroundColor='#FFFFFF';this._setCommunityCheckBoxProperties(_communitySelectionCheckBoxName,false,false);this._setSPANVisibility(false);sTableId='_chkCommunitySelection';this._setTableVisibility(false,sTableId);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CommunitySelection.handleSearchSelectedCommunitiesClick',_oErrorHandler.ERRORTYPE_JS,err);return;}},setSelectedCommunityLink:function(isChecked,linkText,sSelectedCommunityLocationName,sSelectedCommunityLocationID,sSelectedCommunityIds)
{var allLinks;var x;var allImg;var i;var chkSelectedCity;var sSelectedCityValue=null;try
{allLinks=document.getElementsByTagName('a');for(x=0;x<allLinks.length;x+=1)
{if(allLinks[x].id.indexOf('_hlSelCommunities_'+sSelectedCommunityLocationID)>-1)
{allLinks[x].innerHTML=linkText;allImg=document.getElementsByTagName('img');for(i=0;i<allImg.length;i+=1)
{if(allImg[i].id.indexOf('_imgSelCommunities_'+sSelectedCommunityLocationID)>-1)
{if(linkText.indexOf('Edit')>-1)
{allImg[i].src='/NRTProducts/include/images/check.gif';allImg[i].height='9';allImg[i].width='8';}
else
{allImg[i].src='/NRTProducts/include/images/common_spacer.gif';allImg[i].height='1';allImg[i].width='1';}
allImg=null;break;}}
if(sSelectedCommunityLocationID.length>0)
{chkSelectedCity=NRT.Utility.getElementByTagNameAndID('chkNearbyCitySelectedLocation_'+sSelectedCommunityLocationID,'INPUT');}
else
{if(sSelectedCommunityLocationName.length>0)
{chkSelectedCity=NRT.Utility.getElementByTagNameAndID('chkNearbyCitySelectedLocation_'+sSelectedCommunityLocationName,'INPUT');}}
if(chkSelectedCity!==null&&chkSelectedCity!==undefined)
{chkSelectedCity.checked=isChecked;if(isChecked)
{NRT.Property.Search.NearbyCity.clickCheckbox(chkSelectedCity);}
else
{if(sSelectedCommunityIds!==''&&typeof sSelectedCommunityIds!=='undefined')
{if(!_oNBCLocationXML.locationExists(sSelectedCommunityLocationID))
{_oNBCLocationXML.addLocation(sSelectedCommunityLocationID,chkSelectedCity.value,'True',1);}
_oNBCLocationXML.addLocationCommunities(sSelectedCommunityLocationID,sSelectedCommunityIds,sSelectedCommunityLocationName);}}
sSelectedCityValue=chkSelectedCity.value;}
if(sSelectedCommunityLocationID.length>0)
{allLinks[x].href="javascript: NRT.Property.Search.NearbyCity.showCommunitySelection(\'"+sSelectedCommunityLocationID+"\', \'"+sSelectedCityValue+"\', \'"+sSelectedCommunityIds+"\');";}
else
{if(sSelectedCommunityLocationName.length>0)
{allLinks[x].href="javascript: NRT.Property.Search.NearbyCity.showCommunitySelection(\'"+sSelectedCommunityLocationName+"\', \'"+sSelectedCityValue+"\', \'"+sSelectedCommunityIds+"\');";}}
allLinks=null;break;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CommunitySelection.setSelectedCommunityLink',_oErrorHandler.ERRORTYPE_JS,err);return;}},setSelectedCommunitySelectionTextStyle:function(oInputCheckBox)
{try
{NRT.Utility.getElementByTagNameAndID('rbSelectedCommunities','INPUT').checked=true;if(oInputCheckBox.checked===true)
{oInputCheckBox.parentNode.className='textbold';}
else
{oInputCheckBox.parentNode.className='text';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CommunitySelection.setSelectedCommunitySelectionTextStyle',_oErrorHandler.ERRORTYPE_JS,err);return;}},_clearErrorMessage:function()
{var spnErrMessage;try
{spnErrMessage=document.getElementById('spnCommunitySelectionErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML='';spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CommunitySelection._clearErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}},_isValidSelectedCommunities:function(selectedCommunityList)
{return selectedCommunityList.length>0?true:false;},_getSelectedCommunityIds:function()
{var sSelectedCommunityIds='';var sSelectedCommunityNames='';var sSelCommunityCityID='';var x;var allInputs=document.getElementsByTagName('input');var sGenericInputName;var communityArray=[];for(x=0;x<allInputs.length;x+=1)
{if(allInputs[x].type==='checkbox')
{if(allInputs[x].name.indexOf(_communitySelectionCheckBoxName)>-1)
{if(allInputs[x].checked===true)
{sGenericInputName=allInputs[x].id.replace(_communitySelectionCheckBoxName,'');sSelCommunityCityID=document.getElementById(sGenericInputName+'hdnSelCommunityCityID').value;sSelectedCommunityIds+=allInputs[x].value+',';sSelectedCommunityNames+=allInputs[x].title+',';}else{sGenericInputName=allInputs[x].id.replace(_communitySelectionCheckBoxName,'');sSelCommunityCityID=document.getElementById(sGenericInputName+'hdnSelCommunityCityID').value;}}}}
communityArray[0]=sSelectedCommunityIds;communityArray[1]=sSelCommunityCityID;communityArray[2]=sSelectedCommunityNames;return communityArray;},_getSelectedCheckBoxes:function()
{var aSelectedCheckBoxes=[];var allInputs=document.getElementsByTagName('input');var x;for(x=0;x<allInputs.length;x+=1)
{if(allInputs[x].type==='checkbox')
{if(allInputs[x].name.indexOf(_communitySelectionCheckBoxName)>-1)
{if(allInputs[x].checked===true)
{aSelectedCheckBoxes.push(allInputs[x]);}}}}
return aSelectedCheckBoxes;},_setCommunityCheckBoxProperties:function(checkBoxName,isDisabled,isChecked)
{var allInputs=document.getElementsByTagName('input');var x;var allDivs;var i;for(x=0;x<allInputs.length;x+=1)
{if(allInputs[x].type==='checkbox')
{if(allInputs[x].name.indexOf(checkBoxName)>-1)
{allInputs[x].checked=isChecked;allInputs[x].disabled=isDisabled;}}}
allDivs=document.getElementsByTagName('div');for(i=0;i<allDivs.length;i+=1)
{if(allDivs[i].id.indexOf('_divCheckBoxText')>-1)
{allDivs[i].style.fontWeight='';}}
allDivs=null;allInputs=null;},_setSPANVisibility:function(isDisabled)
{var allSpans=document.getElementsByTagName('span');var s;for(s=0;s<allSpans.length;s+=1)
{allSpans[s].disabled=isDisabled;}},_setTableVisibility:function(isDisabled,sTableId)
{var allTables=document.getElementsByTagName('table');var i;for(i=0;i<allTables.length;i+=1)
{if(allTables[i].id.indexOf(sTableId)>-1)
{allTables[i].disabled=isDisabled;}}},_showErrorMessage:function(sMessage)
{var spnErrMessage;try
{spnErrMessage=document.getElementById('spnCommunitySelectionErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML=sMessage;spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CommunitySelection._showErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}}};}();
NRT.Property.Search.DidYouMean=function()
{var _selectedNearbyCityLocationID;var _selectedNearbyCityLocationName;var _selectedNearbyCityInternalId;var _selectedNearbyCityIsParent;var _selectedNearbyCityLocationType;return{getSelectedNearbyCityLocationID:function()
{return _selectedNearbyCityLocationID;},_setSelectedNearbyCityLocationID:function(id)
{_selectedNearbyCityLocationID=id;},getSelectedNearbyCityLocationName:function()
{return _selectedNearbyCityLocationName;},_setSelectedNearbyCityLocationName:function(name)
{_selectedNearbyCityLocationName=name;},getSelectedNearbyCityInternalId:function()
{return _selectedNearbyCityInternalId;},_setSelectedNearbyCityInternalId:function(id)
{_selectedNearbyCityInternalId=id;},getSelectedNearbyCityIsParent:function()
{return _selectedNearbyCityIsParent;},_setSelectedNearbyCityIsParent:function(bVal)
{_selectedNearbyCityIsParent=bVal;},getSelectedNearbyCityLocationType:function()
{return _selectedNearbyCityLocationType;},_setSelectedNearbyCityLocationType:function(nType)
{_selectedNearbyCityLocationType=nType;},closeWindow:function()
{var DialogID=null;try
{DialogID="Dialog_"+_WinTitle_DidYouMean.replace(" ","_");_oUtility.closeLayeredPage(DialogID);NRT.Property.Search.Intellisense.setFocus();}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.DidYouMean.closeWindow',_oErrorHandler.ERRORTYPE_JS,err);return;}},getSelectedDidYouMeanLocations:function()
{var divCityZip;var txtIntellisense;try
{NRT.Property.Search.DidYouMean._clearErrorMessage();switch(_oTab.tabDivSelected())
{case'div_CZ_Tab':divCityZip=NRT.Property.Search.GlobalObject.divSelectedLocations();this._getCityZipSelectedItems(divCityZip);break;case'div_NC_Tab':this._getNearbyCitiesSelectedItems();txtIntellisense=document.getElementById("txtIntellisenseNBC");if(txtIntellisense!==null&&typeof txtIntellisense!=='undefined')
{txtIntellisense.value=this.getSelectedNearbyCityLocationName();NRT.Property.Search.NearbyCity.getNearbyCityListHtml(txtIntellisense.value);}
this.closeWindow();break;case'div_AD_Tab':this._getAddressTabSelectedItem();break;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.DidYouMean.getSelectedDidYouMeanLocations',_oErrorHandler.ERRORTYPE_JS,err);return;}},handleDidYouMeanCheckboxSelect:function(divDidYouMeanBox)
{var inputDYM=null;var tableDYMResults;var allDivs;var i;try
{if(_oUtility.browserType()==='ie')
{inputDYM=divDidYouMeanBox.firstChild;}else{inputDYM=divDidYouMeanBox.firstChild.nextSibling;}
if(divDidYouMeanBox.style.fontWeight==='')
{if(inputDYM.type==='radio')
{tableDYMResults=NRT.Utility.getElementByTagNameAndID('dlDidYouMean','TABLE');allDivs=tableDYMResults.getElementsByTagName('DIV');for(i=0;i<allDivs.length;i+=1)
{allDivs[i].style.fontWeight='';}}
divDidYouMeanBox.style.fontWeight='bold';inputDYM.checked=true;}
else
{if((inputDYM.checked===true)&&(inputDYM.type==='radio'))
{return;}
else
{divDidYouMeanBox.style.fontWeight='';inputDYM.checked=false;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.DidYouMean.handleDidYouMeanCheckboxSelect',_oErrorHandler.ERRORTYPE_JS,err);return;}},handleSelectFromListLocationsClick:function()
{try
{this.closeWindow();NRT.Property.Search.CityZip.loadDiv('div_CityZip_LocationList');}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.DidYouMean.handleSelectFromListLocationsClick',_oErrorHandler.ERRORTYPE_JS,err);return;}},performSearch:function()
{var iConsumerSearchID;var iSearchID;var conSrchID;var srchID;try
{NRT.Property.Search.Utility.saveSearchCriteria();iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();if(iConsumerSearchID>0)
{conSrchID=SearchController.PersistConsumerSearch(_oSearchCriteria);window.location="/property/PropertyResults.aspx?ConsumerSearchID="+conSrchID.val+NRT.Utility.Branding.appendBranding(_oSearchCriteria.BrandingID);}else{srchID=SearchController.PersistSearch(_oSearchCriteria);window.location="/property/PropertyResults.aspx?SearchID="+srchID.value+NRT.Utility.Branding.appendBranding(_oSearchCriteria.BrandingID);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.DidYouMean.performSearch',_oErrorHandler.ERRORTYPE_JS,err);return;}},_clearErrorMessage:function()
{var spnErrMessage;try
{spnErrMessage=document.getElementById('spnDidYouMeanErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML='';spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.DidYouMean._clearErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}},_getAddressTabSelectedItem:function()
{var checkedElements=document.getElementsByName('chkDidYouMean');var i;var elementValue=null;var nHyphenIdx;var LocationID;var nSquiglyIdx;var IsParent;var nPoundIdx;var LocationName;var nHatIdx;var InternalLocationID;var LocationType;for(i=0;i<checkedElements.length;i+=1)
{if(checkedElements[i].checked===true)
{elementValue=checkedElements[i].value;nHyphenIdx=elementValue.indexOf('-');LocationID=elementValue.substring(0,nHyphenIdx);nSquiglyIdx=elementValue.indexOf('~~');IsParent=elementValue.substring(nHyphenIdx+1,nSquiglyIdx);nPoundIdx=elementValue.indexOf('###');LocationName=elementValue.substring(nSquiglyIdx+2,nPoundIdx).replace("&#39;","'");nHatIdx=elementValue.indexOf('^^^^');InternalLocationID=elementValue.substring(nPoundIdx+3,nHatIdx);LocationType=elementValue.substring(nHatIdx+4,elementValue.length);break;}}
if(!_oADLocationXML.isEmpty())
{_oADLocationXML.clear();}
_oADLocationXML.addLocation(LocationID,LocationName,IsParent,LocationType);this.closeWindow();this.performSearch();},_getCityZipSelectedItems:function(divCityZipResults)
{olocCollection=new _oUtility.createCollection('NRT.Property.Search.LocationCollection');var checkedElements=document.getElementsByName('chkDidYouMean');var i;var str;var locID;var locName;var locIsParent;var locIsCommunity=0;var nIdxLocId;var nIdxLocIsParent;var nIdxLocName;var nIdxLocIsCommunity;var nIdx;var nPoundIdx;var test;var sCommunities=null;var oDate=new Date();if(checkedElements.length>0)
{for(i=0;i<checkedElements.length;i+=1)
{if(checkedElements[i].checked===true)
{str=checkedElements[i].value;nIdxLocId=str.indexOf('-');locID=str.substring(0,nIdxLocId);nIdxLocIsParent=str.indexOf('~~');locIsParent=str.substring(nIdxLocId+1,nIdxLocIsParent);nIdxLocName=str.indexOf('###');locName=str.substring(nIdxLocIsParent+2,nIdxLocName);if(locName.indexOf('&#39;')!==-1)
{test=locName.replace(/&#39;/,"'");locName=test;}
nIdxLocIsCommunity=str.indexOf('^^^^');locIsCommunity=str.substring(nIdxLocIsCommunity+4,str.length);olocCollection.add(new NRT.Property.Search.Location(locID,locName,locIsParent,sCommunities,locIsCommunity));}}
if(olocCollection!==null&&olocCollection.length>0)
{_oCZLocationXML.addLocations(olocCollection);NRT.Property.Search.CityZip.refreshSelectedLocations(divCityZipResults);this.closeWindow();}else{NRT.Property.Search.DidYouMean._showErrorMessage(NRT.Property.Validation.MESSAGE_DIDYOUMEAN_LOC_EMPTY);return;}}else{locID='NoMatch:'+oDate.getTime();locName=NRT.Property.Search.Intellisense.getSearchString();locIsParent=false;locIsCommunity=1;olocCollection.add(new NRT.Property.Search.Location(locID,locName,locIsParent,sCommunities,locIsCommunity));_oCZLocationXML.addLocations(olocCollection);NRT.Property.Search.CityZip.refreshSelectedLocations(divCityZipResults);this.closeWindow();}},_getNearbyCitiesSelectedItems:function()
{var checkedElements=document.getElementsByName('chkDidYouMean');var i;var str;var idx;var nIdx;var nPoundIdx;var nHatIdx;var internalId;for(i=0;i<checkedElements.length;i+=1)
{if(checkedElements[i].checked===true)
{str=checkedElements[i].value;idx=str.indexOf('-');this._setSelectedNearbyCityLocationID(str.substring(0,idx));nIdx=str.indexOf('~~');this._setSelectedNearbyCityIsParent(str.substring(idx+1,nIdx));nPoundIdx=str.indexOf('###');this._setSelectedNearbyCityLocationName(str.substring(nIdx+2,nPoundIdx).replace("&#39;","'"));nHatIdx=str.indexOf('^^^^');internalId=str.substring(nPoundIdx+3,nHatIdx);this._setSelectedNearbyCityInternalId(internalId);this._setSelectedNearbyCityLocationType(str.substring(nHatIdx+4,str.length));break;}}},_showErrorMessage:function(sMessage)
{var spnErrMessage;try
{spnErrMessage=document.getElementById('spnDidYouMeanErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML=sMessage;spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.DidYouMean._showErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}}};}();
NRT.Property.Search.Address=function()
{return{restoreUI:function()
{var iConsumerSearchID;var iSearchID;var oSearchCriteria=null;try
{iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();if(iConsumerSearchID>0)
{oSearchCriteria=SearchController.GetPersistedConsumerSearch(iConsumerSearchID,this._restoreUI_Callback);}
if(iSearchID>0)
{oSearchCriteria=SearchController.GetPersistedSearch(iSearchID,this._restoreUI_Callback);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Address.restoreUI',_oErrorHandler.ERRORTYPE_JS,err);return;}},validate:function()
{var bReturn=true;var sSearchAddress;var sSearchCity;var stateID;var regionID;var oCityLocResults;var oCity;var oCorrectedLocResults;var bCityRequired;try
{bCityRequired=NRT.Property.Search.Utility.getCityRequired();NRT.Property.Validation.UI.showAddress(false);NRT.Property.Validation.UI.showCity(false);NRT.Property.Validation.UI.showState(false);sSearchAddress=NRT.Property.Search.GlobalObject.txtAddress().value;sSearchCity=NRT.Property.Search.GlobalObject.txtCity().value;if(sSearchAddress.length===0)
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_ADDRESS,NRT.Property.Validation.MESSAGE_ADDDRES_ADDRESS_EMPTY);NRT.Property.Validation.UI.showAddress(true);bReturn=false;}
if(sSearchCity.length===0)
{if(bCityRequired===true)
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_ADDRESS,NRT.Property.Validation.MESSAGE_ADDRESS_CITY_EMPTY);NRT.Property.Validation.UI.showCity(true);bReturn=false;}}
stateID=NRT.Property.Search.State.getStateID();if(NRT.Property.Search.State.getIsVisible()==='True'&&stateID<=0)
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_ADDRESS,NRT.Property.Validation.MESSAGE_ADDRESS_STATE_EMPTY);NRT.Property.Validation.UI.showState(true);bReturn=false;}
regionID=NRT.Property.Search.Region.getRegionID();if(NRT.Property.Search.Region.getIsVisible()==='True'&&regionID<=0)
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_ADDRESS,NRT.Property.Validation.MESSAGE_ADDRESS_REGION_EMPTY);NRT.Property.Validation.UI.showRegion(true);bReturn=false;}
else
{if(bReturn&&sSearchCity.length>0)
{oCityLocResults=SearchController.GetCity(sSearchCity,stateID,regionID,null);if(oCityLocResults.value!==null||typeof oCityLocResults.value!=='undefined')
{if(oCityLocResults.value.Locations.length===1)
{oCity=oCityLocResults.value.Locations[0];if(oCity!==null&&typeof oCity!=='undefined')
{_oADLocationXML.clear();_oADLocationXML.addLocation(oCity.LocationID,oCity.DisplayName1,oCity.IsParentLocation,oCity.LocationType);}
return true;}else{oCorrectedLocResults=SearchController.GetCorrectedLocations(stateID,regionID,sSearchCity);if(oCorrectedLocResults.value.Locations.length===0)
{NRT.Property.Search.Utility.showNoLocationsFoundLayer(false,sSearchCity);bReturn=false;}else{this._showNearbyCityDidYouMeanLayer(sSearchCity);bReturn=false;}}}else{bReturn=false;}}}
return bReturn;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Address.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}},_showNearbyCityDidYouMeanLayer:function(cityName)
{var stateID=NRT.Property.Search.State.getStateID();var regionID=NRT.Property.Search.Region.getRegionID();var sQueryString='controlType=DidYouMean&inputType=radio&searchValue='+cityName+'&StateID='+stateID+'&RegionID='+regionID+'&TabName=Address';_oUtility.showLayeredPage(sQueryString,_WinW_DidYouMean,_WinTitle_DidYouMean,_DefFocusItemID_DidYouMean,_DefFocusItemType_DidYouMean);},_restoreUI_Callback:function(response)
{var ctrlAddress;var locXML;var data;var locName;var locRecord;var ctrlCity;var oDDLStateList=null;try
{if(response.error!==null)
{_oErrorHandler.ResponseError('NRT.Property.Search.Address._restoreUI_Callback',response);return;}
else
{if(response!==null&&response.value!==null)
{_bRestore=true;if(response.value.ActiveTab==='AD')
{NRT.Property.Search.Utility.tabClick(2);}
if(response.value.Address!==null)
{ctrlAddress=document.getElementById(response.value.Address.ControlHtmlName);ctrlAddress.value=response.value.Address.ControlValue;}
if(response.value.LocationXML!==null)
{locXML=response.value.LocationXML;_oADLocationXML.loadFromXML(locXML);data=_oADLocationXML.xmlDoc.getElementsByTagName('Locations')[0];if(data!==null&&data.childNodes.length>0)
{if(data.childNodes[0].nodeType===1)
{locRecord=data.childNodes[0];locName=locRecord.attributes[1].value;ctrlCity=NRT.Property.Search.GlobalObject.txtCity();ctrlCity.value=locName;}}}
if(response.value.StateID!==null)
{NRT.Property.Search.State.setStateID(response.value.StateID);oDDLStateList=NRT.Utility.getElementByTagNameAndID('ddlStateList','SELECT');if(oDDLStateList!==null&&typeof oDDLStateList!=='undefined')
{oDDLStateList.value=NRT.Property.Search.State.getStateID();}}
_bRestore=false;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Address._restoreUI_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}}};}();
NRT.Property.Search.MlsNumber=function()
{return{restoreUI:function()
{var iConsumerSearchID;var iSearchID;var oSearchCriteria;try
{iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();oSearchCriteria=null;if(iConsumerSearchID>0)
{oSearchCriteria=SearchController.GetPersistedConsumerSearch(iConsumerSearchID,this._restoreUI_Callback);}
if(iSearchID>0)
{oSearchCriteria=SearchController.GetPersistedSearch(iSearchID,this._restoreUI_Callback);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.MlsNumber.restoreUI',_oErrorHandler.ERRORTYPE_JS,err);return;}},validate:function()
{var bReturn=true;var sMlsNumber;var spnMlsNumberTextDesc;var delim;try
{NRT.Property.Validation.UI.showMLSNumber(false);spnMlsNumberTextDesc=NRT.Utility.getElementByTagNameAndID('spn_MlsNumber_TextDesc','SPAN');sMlsNumber=NRT.Property.Search.GlobalObject.txtMLSNumber().value;if(sMlsNumber.length===0){_oValidationXML.addValidation(NRT.Property.Validation.TYPE_MLSNUMBER,NRT.Property.Validation.MESSAGE_MLS_MLS_EMPTY.replace('MLSTABLABEL',spnMlsNumberTextDesc.innerHTML));NRT.Property.Validation.UI.showMLSNumber(true);bReturn=false;}else{if(!_oUtility.validMLSNumber(sMlsNumber)){_oValidationXML.addValidation(NRT.Property.Validation.TYPE_MLSNUMBER,NRT.Property.Validation.MESSAGE_MLS_WRONGDELIMINATOR);NRT.Property.Validation.UI.showMLSNumber(true);bReturn=false;}}
return bReturn;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.MlsNumber.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}},_restoreUI_Callback:function(response)
{var ctrlMLSNum;try
{if(response.error!==null)
{_oErrorHandler.ResponseError('NRT.Property.Search.MlsNumber._restoreUI_Callback',response);return;}
else
{if(response!==null&&response.value!==null)
{_bRestore=true;if(response.value.ActiveTab==='MLS')
{NRT.Property.Search.Utility.tabClick(3);}
if(response.value.MlsNumber!==null)
{ctrlMLSNum=document.getElementById(response.value.MlsNumber.ControlHtmlName);ctrlMLSNum.value=response.value.MlsNumber.ControlValue;}
_bRestore=false;}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.MlsNumber._restoreUI_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}}};}();
NRT.Property.Search.SchoolDistrict=function()
{var _schoolSearchTypeID=4;var _ShowSchoolSearchType=false;return{getLocations:function()
{var stateID=0;var regionID=0;var countyID=0;var schoolSearchTypeID=4;var aLocations=null;var response=null;var lstAvailLocations=null;var ctrlName=null;var rbtnlName=null;var rbState=null;var rbCtrlList=null;try
{stateID=NRT.Property.Search.State.getStateID();ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();rbtnlName='rbtnl_'+ctrlName+'_States';rbCtrlList=document.getElementById(rbtnlName);if(rbCtrlList!==null&&typeof rbCtrlList!=='undefined')
{rbState=NRT.Property.Search.Utility.getRadioButtonByValue(rbCtrlList,stateID);}
if(rbState===null||typeof rbState==='undefined')
{stateID=0;}
if((stateID===0)&&(NRT.Property.Search.State.getIsVisible()==='False'))
{stateID=NRT.Property.Search.State.getStateID();this.getCounties();}
regionID=NRT.Property.Search.Region.getRegionID(0);countyID=NRT.Property.Search.County.getCountyID(0);schoolSearchTypeID=NRT.Property.Search.SchoolDistrict.getSchoolSearchTypeID();aLocations=null;if(countyID===-99)
countyID=-1;response=SearchController.GetSchoolDistrictLocations(stateID,regionID,countyID,schoolSearchTypeID);aLocations=response.value.Locations;this._FillLocationList(aLocations);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.getLocations',_oErrorHandler.ERRORTYPE_JS,err);return;}},setSchoolSearchTypes:function(ctrlSchoolSearchType,bRefreshLoc)
{var rbSchoolSearchType=null;var i;var j;var oChildNode;var nItemIndex=0;var oControl;var oLabel;try
{rbSchoolSearchType=NRT.Property.Search.Utility.getCheckedRadioButton(ctrlSchoolSearchType);if(rbSchoolSearchType!==null&&typeof rbSchoolSearchType!=='undefined')
{this.setSchoolSearchTypeID(rbSchoolSearchType.value);NRT.Utility.highlightSelectedRadioButton(ctrlSchoolSearchType);if(bRefreshLoc=='True')
{NRT.Property.Search.SchoolDistrict.getLocations();}}}
catch(err)
{_oErrorHandler.Error('.Property.Search.SchoolDistrict.setSchoolSearchTypes',_oErrorHandler.ERRORTYPE_JS,err);return;}},getSchoolSearchTypeID:function()
{return parseInt(_schoolSearchTypeID,10);},setSchoolSearchTypeID:function(id)
{_schoolSearchTypeID=id;},getShowSchoolSearchType:function()
{return _ShowSchoolSearchType;},setShowSchoolSearchType:function(value)
{_ShowSchoolSearchType=value;},setDefault:function()
{var rbtnlName=null;var rbSchoolSearchType=null;var rbCtrlList=null;try
{if(_ShowSchoolSearchType)
{rbCtrlList=document.getElementById('rbtnl_SchoolSearchType');if(rbCtrlList===null||typeof rbCtrlList==='undefined')
{return;}
rbSchoolSearchType=NRT.Property.Search.Utility.getRadioButtonByValue(rbCtrlList,_schoolSearchTypeID);}else
{this.setSchoolSearchTypeID(4);}
if(rbSchoolSearchType===null||typeof rbSchoolSearchType==='undefined')
{this.setSchoolSearchTypeID(4);}else
{rbSchoolSearchType.checked=true;NRT.Property.Search.SchoolDistrict.setSchoolSearchTypes(rbCtrlList);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.setDefault',_oErrorHandler.ERRORTYPE_JS,err);return;}},clearErrorMessage:function()
{var spnErrMessage;try
{spnErrMessage=document.getElementById('spnSchoolDistrictListErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML='';spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.clearErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}},refreshSelectedSchoolDistricts:function(divCtrl)
{var data;var spnLocTotal;var locRecord;var locID;var locName;var locIsParent;var locTable;var table;var x;try
{if(divCtrl!==null)
{divCtrl.innerHTML='';data=_oSDLocationXML.xmlDoc.getElementsByTagName('Locations')[0];if(data!==null)
{spnLocTotal=document.getElementById('spnSchoolDistrictTotal');if(spnLocTotal!==null&&typeof spnLocTotal!=='undefined')
{if(data.childNodes.length===0)
{spnLocTotal.innerHTML='';}else
{spnLocTotal.innerHTML=data.childNodes.length;}}
for(x=0;x<data.childNodes.length;x+=1)
{if(data.childNodes[x]!==null)
{if(data.childNodes[x].nodeType===1)
{locRecord=data.childNodes[x];locID=locRecord.attributes[0].value;locName=locRecord.attributes[1].value;locIsParent=locRecord.attributes[2].value;locTable=document.getElementById(divCtrl.id+'_tblSelectSchoolDistrict'+locID);if(locTable===null||typeof locTable==='undefined')
{table=document.createElement('table');table.setAttribute('id','tblSelectSchoolDistrict'+locID);table.setAttribute('border','0');table.setAttribute('width','100%');this._addToSelectedLocationsDiv(table,locID,locName,locIsParent);divCtrl.appendChild(table);}}}}}
divCtrl.scrollTop=divCtrl.scrollHeight;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.refreshSelectedSchoolDistricts',_oErrorHandler.ERRORTYPE_JS,err);return;}},addSchoolDistrictFromListBox:function(bSearch)
{var lstCtrl;var olocCollection;var i;var str;var idx;var idx2;var locID;var locName;var locIsParent;var sCommunities=null;var locIsCommunity;var ctrlName=null;var rbtnlName=null;var rbState=null;var rbCtrlList=null;var stateID=-1;var schoolSearchTypeID=0;var rbSchoolSearchType=null;try
{NRT.Property.Search.SchoolDistrict.clearErrorMessage();schoolSearchTypeID=NRT.Property.Search.SchoolDistrict.getSchoolSearchTypeID();lstCtrl=NRT.Property.Search.GlobalObject.lstAvailSchoolDistricts();olocCollection=new _oUtility.createCollection('NRT.Property.Search.LocationCollection');for(i=0;i<lstCtrl.childNodes.length;i+=1)
{if(lstCtrl.childNodes.item(i).selected)
{_SelectedLocations=_SelectedLocations+1;if(_SelectedLocations>_MaxLocations-_oSDLocationXML.count())
{_SelectedLocations=0;_oValidationXML.addValidation(NRT.Property.Validation.TYPE_SCHOOLDISTRICT,NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_LOCATIONLIST_LOCS_MAX);NRT.Property.Validation.UI.displayMaxLocationsMessage();return false;}
str=lstCtrl.childNodes.item(i).value;idx=str.indexOf('-');idx2=str.lastIndexOf('-');locID=str.substring(0,idx)+'_'+schoolSearchTypeID;locName=lstCtrl.childNodes.item(i).text;locIsParent=str.substring(idx+1,idx2);locIsCommunity=str.substring(idx2+1,str.length);if(_oSDLocationXML.locationExists(locID)&&_SelectedLocations===1)
{_oUtility.showMessage(locName+' '+NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_DUPLICATE_LOC);}
olocCollection.add(new NRT.Property.Search.Location(locID,locName,locIsParent,sCommunities,-1));}}
if(olocCollection.length===0)
{stateID=NRT.Property.Search.State.getStateID();ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();rbtnlName='rbtnl_'+ctrlName+'_States';rbCtrlList=document.getElementById(rbtnlName);rbState=NRT.Property.Search.Utility.getRadioButtonByValue(rbCtrlList,stateID);if(bSearch===null||typeof bSearch==='undefined')
{if((rbState===null||typeof rbState==='undefined')&&(NRT.Property.Search.State.getIsVisible()==='True'))
{NRT.Property.Search.SchoolDistrict.showErrorMessage(NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_STATE_EMPTY);}else
{NRT.Property.Search.SchoolDistrict.showErrorMessage(NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_LOCATIONLIST_LOC_EMPTY);NRT.Property.Validation.UI.showSelectedSchoolDistricts(true);}}else
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_SCHOOLDISTRICT,NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_SELLOC_EMPTY);if(stateID>0&&(rbState===null||typeof rbState==='undefined')&&(NRT.Property.Search.State.getIsVisible()==='True'))
{_oValidationXML.addValidation(NRT.Property.Validation.TYPE_SCHOOLDISTRICT,NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_STATE_EMPTY);}
NRT.Property.Validation.UI.showSelectedSchoolDistricts(true);}
return false;}else
{NRT.Property.Validation.UI.showSelectedSchoolDistricts(false);}
if(olocCollection!==null)
{_oSDLocationXML.addLocations(olocCollection);this.refreshSelectedSchoolDistricts(NRT.Property.Search.GlobalObject.divSelectedSchoolDistricts());_oValidationXML.removeValidation(NRT.Property.Validation.TYPE_SCHOOLDISTRICT,NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_LOCATIONLIST_LOC_EMPTY);NRT.Property.Search.Utility.validate();}
_SelectedLocations=0;}
catch(err)
{_SelectedLocations=0;_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.addSchoolDistrictFromListBox',_oErrorHandler.ERRORTYPE_JS,err);return;}},getCounties:function()
{var stateID=0;var regionID=0;var aCounties=null;var response=null;try
{stateID=NRT.Property.Search.State.getStateID();regionID=NRT.Property.Search.Region.getRegionID();if(_oUtility.browserType()==='ie')
{aCounties=SearchController.GetCounties(stateID,regionID,NRT.Property.Search.SchoolDistrict._getCounties_Callback);}
else
{response=SearchController.GetCounties(stateID,regionID);aCounties=response.value.Locations;}
if(aCounties!=null)
{NRT.Property.Search.Region._FillSchoolDistrictCountyList(aCounties);}
return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.getCounties',_oErrorHandler.ERRORTYPE_JS,err);return;}},_getCounties_Callback:function(response)
{var aCounties=null;try
{if(response.error!==null&&typeof response.error!=='undefined')
{_oErrorHandler.ResponseError('NRT.Property.Search.SchoolDistrict._getCounties_Callback',response);return;}else
{if(response!==null&&response.value!==null)
{aCounties=response.value.Locations;NRT.Property.Search.Region._FillSchoolDistrictCountyList(aCounties);}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.Region._getCounties_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}},_selectedSchoolDistrictIsEmpty:function()
{var totalLabel=null;totalLabel=document.getElementById('spnSchoolDistrictTotal');if(totalLabel!==null||typeof bSearch!=='undefined')
{if(totalLabel.innerHTML==='')
{return true;}}
return false;},validate:function()
{var bReturn=true;var ctrlName=null;try
{NRT.Property.Validation.UI.showSelectedSchoolDistricts(false);if(this._selectedSchoolDistrictIsEmpty())
{bReturn=NRT.Property.Search.SchoolDistrict.addSchoolDistrictFromListBox(true);}
return bReturn;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}},removeSchoolDistrictFromSelectedLists:function(id)
{try
{NRT.Property.Search.SchoolDistrict._removeSchoolDistrictFromSelectedLists(document.getElementById('div_SchoolDistrictList_SelectedSchoolDistricts'),id);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.removeSchoolDistrictFromSelectedLists',_oErrorHandler.ERRORTYPE_JS,err);return;}},restoreUI:function()
{var iConsumerSearchID;var iSearchID;var oSearchCriteria=null;try
{iConsumerSearchID=NRT.Property.Search.Utility.getConsumerSearchID();iSearchID=NRT.Property.Search.Utility.getSearchID();if(iConsumerSearchID>0)
{oSearchCriteria=SearchController.GetPersistedConsumerSearch(iConsumerSearchID,this._restoreUI_Callback);}
if(iSearchID>0)
{oSearchCriteria=SearchController.GetPersistedSearch(iSearchID,this._restoreUI_Callback);}
return;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.restoreUI',_oErrorHandler.ERRORTYPE_JS,err);return;}},_restoreUI_Callback:function(response)
{var locXML;try
{if(response.error!==null)
{_oErrorHandler.ResponseError('NRT.Property.Search.SchoolDistrict._restoreUI_Callback',response);return;}else
{if(response!==null&&response.value!==null)
{_bRestore=true;locXML=response.value.LocationXML;if(locXML!==null)
{_oSDLocationXML.loadFromXML(locXML);}}
NRT.Property.Search.SchoolDistrict.refreshSelectedSchoolDistricts(NRT.Property.Search.GlobalObject.divSelectedSchoolDistricts());return;}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.CityZip._restoreUI_Callback',_oErrorHandler.ERRORTYPE_AJAX,err);}},_FillLocationList:function(aLocations)
{var lstAvailLocations=null;var i;var nStateID;var ctrlName=null;var rbtnlName=null;var rbState=null;var rbCtrlList=null;lstAvailLocations=NRT.Property.Search.GlobalObject.lstAvailSchoolDistricts();lstAvailLocations.innerHTML='';nStateID=NRT.Property.Search.State.getStateID();if(aLocations!==null&&typeof aLocations!=='undefined'&&aLocations.length>0)
{if(NRT.Property.Search.State.getIsVisible()==='True'&&nStateID<=0)
{lstAvailLocations.innerHTML='';lstAvailLocations.options[0]=new Option(NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_DISTRICTLIST_STATE_EMPTY,'0',false,false);lstAvailLocations.disabled=true;}else
{lstAvailLocations.disabled=false;for(i=0;i<aLocations.length;i+=1)
{lstAvailLocations.options[lstAvailLocations.length]=new Option(aLocations[i].DisplayName1,aLocations[i].LocationID+'-'+aLocations[i].IsParentLocation+'-'+aLocations[i].LocationType,false,false);}}}else
{ctrlName=NRT.Property.Search.GlobalObject.getSelectedCtrlSourceName();rbtnlName='rbtnl_'+ctrlName+'_States';rbCtrlList=document.getElementById(rbtnlName);if(rbCtrlList!==null&&typeof rbState!=='undefined')
{rbState=NRT.Property.Search.Utility.getRadioButtonByValue(rbCtrlList,nStateID);}
if(NRT.Property.Search.State.getIsVisible()==='True'&&(rbState===null||typeof rbState==='undefined'))
{lstAvailLocations.innerHTML='';lstAvailLocations.options[0]=new Option(NRT.Property.Validation.MESSAGE_SCHOOLDISTRICT_DISTRICTLIST_STATE_EMPTY,'0',false,false);lstAvailLocations.disabled=true;}}},_removeSchoolDistrictFromSelectedLists:function(divCtrl,id)
{var locTable=null;var i;if(divCtrl!==null)
{for(i=0;i<divCtrl.childNodes.length;i+=1)
{if(divCtrl.childNodes[i].id==='tblSelectSchoolDistrict'+id)
{locTable=divCtrl.childNodes[i];break;}}
if(locTable!==null)
{if(locTable.hasChildNodes())
{locTable.parentNode.removeChild(locTable);_oSDLocationXML.removeLocationNodeByValue(id);}}
this.refreshSelectedSchoolDistricts(NRT.Property.Search.GlobalObject.divSelectedSchoolDistricts());}},showErrorMessage:function(sMessage)
{var spnErrMessage;try
{spnErrMessage=document.getElementById('spnSchoolDistrictListErrMessage');if(spnErrMessage!==null&&typeof spnErrMessage!=='undefined')
{spnErrMessage.innerHTML=sMessage;spnErrMessage.style.display='inline';}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.SchoolDistrict.showErrorMessage',_oErrorHandler.ERRORTYPE_JS,err);}},_addToSelectedLocationsDiv:function(tbl,id,name,isparent)
{var commrow;var commcell;var comgt;var comgttext;var tablebody;var locrow;var loccell;var loccelltext;var remanchor;var remanchortext;var remcell;tablebody=document.createElement('tbody');locrow=document.createElement('tr');locrow.setAttribute('id','lr'+id);locrow.className='text';loccell=document.createElement('td');loccell.setAttribute('width','200');loccelltext=document.createTextNode(name);loccell.appendChild(loccelltext);locrow.appendChild(loccell);remcell=document.createElement('td');remcell.setAttribute('width','45');remcell.setAttribute('align','right');remanchor=document.createElement('a');remanchor.className='tiny';remanchor.setAttribute("href","javascript: NRT.Property.Search.SchoolDistrict.removeSchoolDistrictFromSelectedLists('"+id+"');");remanchortext=document.createTextNode('remove');remanchor.appendChild(remanchortext);remcell.appendChild(remanchor);locrow.appendChild(remcell);tablebody.appendChild(locrow);if(isparent!==null&&isparent.toUpperCase()==='TRUE')
{commrow=document.createElement('tr');commrow.setAttribute('id','cr'+id);commrow.setAttribute('class','text');commcell=document.createElement('td');commcell.setAttribute('width','250');commcell.setAttribute('colspan','2');comgt=document.createElement('label');comgt.className='tiny';comgttext=document.createTextNode('> ');comgt.appendChild(comgttext);commcell.appendChild(comgt);commrow.appendChild(commcell);tablebody.appendChild(commrow);}
tbl.appendChild(tablebody);}};}();
NRT.namespace("Tab");var _oTab;NRT.Tab=function()
{var _sourceName=null;var _tabs=null;var _tabAlign=null;var _tabSelected=null;var _tabDivSelected=null;var _previousTabId=null;return{sourceName:function()
{return _sourceName;},setSourceName:function(name)
{_sourceName=name;},tabs:function()
{return _tabs;},setTabs:function(value)
{_tabs=value;},tabAlign:function()
{return _tabAlign;},setTabAlign:function(value)
{_tabAlign=value;},tabSelected:function()
{return _tabSelected;},tabDivSelected:function()
{return _tabDivSelected;},setTabSelected:function(value)
{_tabSelected=value;},setTabDivSelected:function(value)
{_tabDivSelected=value;},previousTabId:function()
{return _previousTabId;},setPreviousTabId:function(id)
{_previousTabId=id;},changeTabStyle:function(evt,tabId)
{var oTab=document.getElementById('trTab'+tabId);var oLeft=document.getElementById('tdLeftTab'+tabId);var oCenter=document.getElementById('tdCenterTab'+tabId);var oRight=document.getElementById('tdRightTab'+tabId);try
{if(oTab!==null&&typeof oTab!=='undefined')
{switch(evt)
{case 0:if(this.tabSelected()!==tabId)
{oTab.className='tab_default_bg';oLeft.className='tab_default_left';oCenter.className='tab_default_font';oRight.className='tab_default_right';}
return;case 2:oTab.className='tab_active_bg';oLeft.className='tab_active_left';oCenter.className='tab_active_font';oRight.className='tab_active_right';this.setTabSelected(tabId);return;}}}
catch(err)
{_oErrorHandler.Error('NRT.Tab.changeTabStyle',_oErrorHandler.ERRORTYPE_JS,err);return;}},load:function()
{var sHTML;var i;var tab;var divTabButtons;try
{sHTML="<table cellSpacing=\"0\" cellPadding=\"0\" align=\"left\" border=\"0\">";sHTML+="<tr>";for(i=0;i<_tabs.length;i+=1)
{tab=_tabs[i].split("|");sHTML+="<td align=\"left\" valign=\"bottom\" class=\"tabs\" onclick=\"_oTab.tabClick("+i+"); "+tab[2]+"\">";sHTML+="<table id=\"tblTab"+i+"\" height=\"29\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"tabmoveps\">";sHTML+="<tr id=\"trTab"+i+"\" class=\"tab_active_bg\">";sHTML+="<td id=\"tdLeftTab"+i+"\" width=\"1\" class=\"tab_active_left\"><img src=\"/NRTProducts/include/images/common_spacer.gif\" border=\"0\" width=\"1\" height=\"29\" /></td>";sHTML+="<td id=\"tdCenterTab"+i+"\" class=\"tab_active_font\" nowrap>&nbsp;"+tab[0]+"&nbsp;</td>";sHTML+="<td id=\"tdRightTab"+i+"\" width=\"1\" class=\"tab_active_right\"><img src=\"/NRTProducts/include/images/common_spacer.gif\" border=\"0\" width=\"1\" height=\"29\" /></td>";sHTML+="</tr>";sHTML+="</table>";sHTML+="</td>";sHTML+="<td width=\"4\" valign=\"bottom\" class=\"tabspace\">";sHTML+="<img src=\"/NRTProducts/include/images/tab_spacer.gif\" border=\"0\" width=\"4\" height=\"29\" class=\"tabspacer\" /></td>";}
sHTML+="</tr>";sHTML+="</table>";divTabButtons=NRT.Utility.getElementByTagNameAndID('div_Tabs','DIV');divTabButtons.innerHTML=sHTML;for(i=0;i<_tabs.length;i+=1)
{tab=_tabs[i].split("|");if(tab[3]==="*")
{this.tabClick(i);break;}}}
catch(err)
{_oErrorHandler.Error('NRT.Tab.load',_oErrorHandler.ERRORTYPE_JS,err);return;}},tabClick:function(tabId)
{var tab;var prevTabId;var prevTab;var divPrevious;var divCurrent;try
{this._tabOn(tabId);this._clearSelectedTab();tab=_tabs[tabId].split("|");this.setTabDivSelected(tab[1]);prevTabId=this.previousTabId();if(prevTabId!==null)
{prevTab=_tabs[prevTabId].split("|");divPrevious=document.getElementById(prevTab[1]);if(divPrevious!==null)
{divPrevious.style.display='none';}}
divCurrent=document.getElementById(tab[1]);if(divCurrent!==null)
{divCurrent.style.display='inline';}
this.setPreviousTabId(tabId);}
catch(err)
{_oErrorHandler.Error('NRT.Tab.tabClick',_oErrorHandler.ERRORTYPE_JS,err);return;}},_clearSelectedTab:function()
{var i;for(i=0;i<_tabs.length;i+=1)
{this._tabOff(i);}},_tabOff:function(tabId)
{this.changeTabStyle(0,tabId);},_tabOn:function(tabId)
{this.changeTabStyle(2,tabId);}};}();_oTab=NRT.Tab;
NRT.Property.Search.TabCaptions=function()
{var _tabCaptions=[];var _defaultTab=null;return{getTabCaptions:function()
{return _tabCaptions;},setTabCaptions:function(value)
{_tabCaptions=value;},getDefaultTab:function()
{return _defaultTab;},setDefaultTab:function(value)
{_defaultTab=value;},init:function()
{var aTabs;try
{aTabs=['City/Zip|div_CZ_Tab|NRT.Property.Search.Utility.tabClick(0)|*','Nearby Cities|div_NC_Tab|NRT.Property.Search.Utility.tabClick(1)','Address|div_AD_Tab|NRT.Property.Search.Utility.tabClick(2)','MLS#|div_MN_Tab|NRT.Property.Search.Utility.tabClick(3)','School District|div_SD_Tab|NRT.Property.Search.Utility.tabClick(4)'];this.setTabCaptions(aTabs);this.setDefaultTab(0);}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.TabCaptions.init',_oErrorHandler.ERRORTYPE_JS,err);return;}}};}();
﻿NRT.Property.Search.QuickSearch=function()
{return{performSearch:function()
{var oSearchCriteria=null;var oCriteria=null;var srchID=0;var rbStatesArr=null;var stateID=0;var stateName=null;var ddlLocation=null;var locationValue='';var locationName=null;var locationInfo=null;var locationID='';var locationType='';var locationXML='<Locations><location id="{LOCID}" name="{LOCNAME}" isParent="" type="{LOCTYPE}" /></Locations>';var ddlPropCategoryType=null;var propCategoryTypeValue='';var propTypeID='';var propCategoryID='';var propCategoryDisplay=null;var propTypeDisplay=null;var propInfo=null;try
{if(!this.validate(NRT.Property.Validation.TYPE_QUICKSEARCH))
{return;}
oSearchCriteria=eval('('+NRT.Utility.getElementByTagNameAndID('hdnSrchCriteria','INPUT').value+')');if(NRT.Utility.objectExists(oSearchCriteria))
{rbStatesArr=NRT.Utility.getElementsByTagNameAndID('rblState','INPUT');if(NRT.Utility.objectExists(rbStatesArr)&&rbStatesArr.length>0)
{for(i=0;i<rbStatesArr.length;i+=1)
{if(rbStatesArr[i].checked)
{if(_oUtility.browserType()==='ie')
{stateName=rbStatesArr[i].nextSibling.innerText.toString();}else{stateName=rbStatesArr[i].nextSibling.textContent.toString();}
stateID=rbStatesArr[i].value;oSearchCriteria.StateID=stateID;oSearchCriteria.StateName=stateName;i=rbStatesArr.length;}}}
ddlLocation=NRT.Utility.getElementByTagNameAndID('ddlLocation','SELECT');if(NRT.Utility.objectExists(ddlLocation))
{locationName=ddlLocation.options[ddlLocation.selectedIndex].innerHTML;locationValue=ddlLocation.options[ddlLocation.selectedIndex].value;locationInfo=locationValue.split('|');if(locationInfo.length>0)
{locationID=locationInfo[0];locationType=locationInfo[1];}
locationXML=locationXML.replace("{LOCID}",locationID);locationXML=locationXML.replace("{LOCNAME}",locationName);locationXML=locationXML.replace("{LOCTYPE}",locationType);oSearchCriteria.LocationXML=locationXML;}
ddlPropCategoryType=NRT.Utility.getElementByTagNameAndID('ddlPropCategoryType','SELECT');if(NRT.Utility.objectExists(ddlPropCategoryType))
{propCategoryTypeValue=ddlPropCategoryType.options[ddlPropCategoryType.selectedIndex].value;propInfo=propCategoryTypeValue.split('|');if(propInfo.length>0)
{propCategoryID=propInfo[0];propCategoryDisplay=propInfo[1];propTypeID=propInfo[2];propTypeDisplay=propInfo[3];}}
for(i=0;i<oSearchCriteria.CustomCriterias.length;i+=1)
{oCriteria=oSearchCriteria.CustomCriterias[i];if(oCriteria.DBParamName==='@PropertyCategoryType')
{oCriteria.ControlValue=propCategoryID;oCriteria.ControlDisplayValue=propCategoryDisplay;}
else if(oCriteria.DBParamName==='@PropertyType')
{if(propTypeID.length>0)
{propTypeID+=',';}
if(propTypeDisplay.length>0)
{propTypeDisplay+=',';}
oCriteria.ControlValue=propTypeID;oCriteria.ControlDisplayValue=propTypeDisplay;}
else
{NRT.Property.Search.Utility._setControlValue(oCriteria);}}
srchID=SearchController.PersistSearch(oSearchCriteria);window.location='/property/PropertyResults.as'+'px?SearchID='+srchID.value+NRT.Utility.Branding.getBranding(oSearchCriteria.BrandingID);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.QuickSearch.performSearch',_oErrorHandler.ERRORTYPE_JS,err);return;}},getCities:function(rblState)
{var stateID=0;var regionID=-1;var countyID=-1;var aCities=null;var response=null;var arrStates=null;var oLabel=null;try
{if(NRT.Utility.objectExists(rblState))
{arrStates=NRT.Utility.getElementsByTagNameAndID('rblState','INPUT');if(arrStates.length>0)
{for(i=0;i<arrStates.length;i+=1)
{oLabel=arrStates[i].parentNode;if(arrStates[i].checked===true){stateID=arrStates[i].value;oLabel.style.fontWeight='bold';}else{oLabel.style.fontWeight='';}}}
if(stateID===0)
{stateID=NRT.Property.Search.State.getStateID();}
NRT.Property.Search.State.setStateID(stateID);response=SearchController.GetLocations(stateID,regionID,countyID);aCities=response.value.Locations;NRT.Property.Search.QuickSearch.fillCityList(aCities);}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.QuickSearch.getCities',_oErrorHandler.ERRORTYPE_JS,err);return;}},fillCityList:function(aCities)
{var lstCities=null;var i;try
{if(aCities!==null)
{lstCities=NRT.Utility.getElementByTagNameAndID('ddlLocation','SELECT');if(lstCities!==null&&typeof lstCities!=='undefined')
{lstCities.innerHTML='';for(i=0;i<aCities.length;i+=1)
{lstCities.options[lstCities.length]=new Option(aCities[i].DisplayName1,aCities[i].LocationID,false,false);}}}}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.QuickSearch.fillCityList',_oErrorHandler.ERRORTYPE_JS,err);return;}},updateDisplay:function(ctl1)
{var ddlPropCategoryType=null;var propCategoryTypeValue='';var ddlMinPrice=null;var ddlMaxPrice=null;var ddlRentalMinPrice=null;var ddlRentalMaxPrice=null;var ddlBeds=null;var ddlBaths=null;var lblBathrooms=null;var lblBedrooms=null;ddlBaths=NRT.Utility.getElementByTagNameAndID('ddlBaths','SELECT');ddlBeds=NRT.Utility.getElementByTagNameAndID('ddlBeds','SELECT');ddlMaxPrice=NRT.Utility.getElementByTagNameAndID('ddlMaxPrice','SELECT');ddlMinPrice=NRT.Utility.getElementByTagNameAndID('ddlMinPrice','SELECT');ddlPropCategoryType=NRT.Utility.getElementByTagNameAndID('ddlPropCategoryType','SELECT');ddlRentalMaxPrice=NRT.Utility.getElementByTagNameAndID('ddlRentalMaxPrice','SELECT');ddlRentalMinPrice=NRT.Utility.getElementByTagNameAndID('ddlRentalMinPrice','SELECT');lblBathrooms=NRT.Utility.getElementByTagNameAndID('lblBathrooms','SPAN');lblBedrooms=NRT.Utility.getElementByTagNameAndID('lblBedrooms','SPAN');if(NRT.Utility.objectExists(ddlPropCategoryType))
{propCategoryTypeValue=ddlPropCategoryType.options[ddlPropCategoryType.selectedIndex].value;if(propCategoryTypeValue.length>1)
{propCategoryTypeValue=propCategoryTypeValue.substring(0,1);}
if(propCategoryTypeValue=='1')
{if(NRT.Utility.objectExists(ddlBaths)){ddlBaths.disabled=false;}
if(NRT.Utility.objectExists(ddlBeds)){ddlBeds.disabled=false;}
if(NRT.Utility.objectExists(ddlMaxPrice)){ddlMaxPrice.style.display='inline';ddlMaxPrice.disabled=false;}
if(NRT.Utility.objectExists(ddlMinPrice)){ddlMinPrice.style.display='inline';ddlMinPrice.disabled=false;}
if(NRT.Utility.objectExists(ddlRentalMaxPrice)){ddlRentalMaxPrice.style.display='none';ddlRentalMaxPrice.disabled=true;}
if(NRT.Utility.objectExists(ddlRentalMinPrice)){ddlRentalMinPrice.style.display='none';ddlRentalMinPrice.disabled=true;}
if(NRT.Utility.objectExists(lblBathrooms)){lblBathrooms.disabled=false;}
if(NRT.Utility.objectExists(lblBedrooms)){lblBedrooms.disabled=false;}}else if(propCategoryTypeValue=='4'){if(NRT.Utility.objectExists(ddlBaths)){ddlBaths.disabled=false;}
if(NRT.Utility.objectExists(ddlBeds)){ddlBeds.disabled=false;}
if(NRT.Utility.objectExists(ddlMaxPrice)){ddlMaxPrice.style.display='none';ddlMaxPrice.disabled=true;}
if(NRT.Utility.objectExists(ddlMinPrice)){ddlMinPrice.style.display='none';ddlMinPrice.disabled=true;}
if(NRT.Utility.objectExists(ddlRentalMaxPrice)){ddlRentalMaxPrice.style.display='inline';ddlRentalMaxPrice.disabled=false;}
if(NRT.Utility.objectExists(ddlRentalMinPrice)){ddlRentalMinPrice.style.display='inline';ddlRentalMinPrice.disabled=false;}
if(NRT.Utility.objectExists(lblBathrooms)){lblBathrooms.disabled=false;}
if(NRT.Utility.objectExists(lblBedrooms)){lblBedrooms.disabled=false;}}else{if(NRT.Utility.objectExists(ddlBaths)){ddlBaths.disabled=true;}
if(NRT.Utility.objectExists(ddlBeds)){ddlBeds.disabled=true;}
if(NRT.Utility.objectExists(ddlMaxPrice)){ddlMaxPrice.style.display='inline';ddlMaxPrice.disabled=false;}
if(NRT.Utility.objectExists(ddlMinPrice)){ddlMinPrice.style.display='inline';ddlMinPrice.disabled=false;}
if(NRT.Utility.objectExists(ddlRentalMaxPrice)){ddlRentalMaxPrice.style.display='none';ddlRentalMaxPrice.disabled=true;}
if(NRT.Utility.objectExists(ddlRentalMinPrice)){ddlRentalMinPrice.style.display='none';ddlRentalMinPrice.disabled=true;}
if(NRT.Utility.objectExists(lblBathrooms)){lblBathrooms.disabled=true;}
if(NRT.Utility.objectExists(lblBedrooms)){lblBedrooms.disabled=true;}}}},trapEnter:function(evt)
{try
{var charCode=(evt.which)?evt.which:event.keyCode
if(charCode==13)
{var btnSearch=document.getElementById('btnSearch');if(NRT.Utility.objectExists(btnSearch))
{NRT.Property.Search.QuickSearch.performSearch();return true;}}
return false;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.QuickSearch.trapEnter',_oErrorHandler.ERRORTYPE_JS,err);return;}},validate:function(validationType)
{var bResult=true;var ddlMinPrice;var ddlMaxPrice;var ddlRentalMinPrice;var ddlRentalMaxPrice;var nStateID;var divValidation=null;try
{_oValidationXML.clear();NRT.Property.Validation.UI.showInvalidMaxPrice(false);NRT.Property.Validation.UI.showInvalidMaxRentalPrice(false);ddlMinPrice=NRT.Utility.getElementByTagNameAndID('ddlMinPrice','SELECT');ddlMaxPrice=NRT.Utility.getElementByTagNameAndID('ddlMaxPrice','SELECT');ddlRentalMinPrice=NRT.Utility.getElementByTagNameAndID('ddlRentalMinPrice','SELECT');ddlRentalMaxPrice=NRT.Utility.getElementByTagNameAndID('ddlRentalMaxPrice','SELECT');if(NRT.Utility.objectExists(ddlMinPrice)&&NRT.Utility.objectExists(ddlMaxPrice)&&!ddlMinPrice.disabled)
{if(parseInt(ddlMaxPrice.value,10)<parseInt(ddlMinPrice.value,10))
{_oValidationXML.addValidation(validationType,NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_MAXPRICE_INVALID);NRT.Property.Validation.UI.showInvalidMaxPrice(true);bResult=false;}}
if(NRT.Utility.objectExists(ddlRentalMinPrice)&&NRT.Utility.objectExists(ddlRentalMaxPrice)&&!ddlRentalMinPrice.disabled)
{if(parseInt(ddlRentalMaxPrice.value,10)<parseInt(ddlRentalMinPrice.value,10))
{_oValidationXML.addValidation(validationType,NRT.Property.Validation.MESSAGE_SEARCHCRITERIA_MAXPRICE_INVALID);NRT.Property.Validation.UI.showInvalidMaxRentalPrice(true);bResult=false;}}
divValidation=_oUtility.getElementByTagNameAndID('div_QuickSearch_ValidSummary','DIV');if(_oValidationXML.count()!==0){NRT.Property.Validation.Summary.show();}else{NRT.Property.Validation.Summary.hide(NRT.Property.Validation.TYPE_QUICKSEARCH);}
return bResult;}
catch(err)
{_oErrorHandler.Error('NRT.Property.Search.QuickSearch.validate',_oErrorHandler.ERRORTYPE_JS,err);return;}}};}();
