﻿/* (c) LoopNet Map Search Results Version   5.6  */
LNJS.__mapsearchresults=true;LNJS.MapSearchResults=Class.create();LNJS.MapSearchResults.prototype=(new LNJS.MapBase()).extend({onLoad:function(){if(!overrideDefaultCenterPoint){if(ll_search_criteria==''){if(LNJS.Widget.Modal){new LNJS.Widget.Modal({customContainer:true,showOnLoad:function(){LNJS.Modal.show({container:'WelcomeMsg',target:'mapMainPanel',onClickClose:true});}});LNJS.Page.SearchMgr.adjustMapBasedOnPins=true;}}}LNJS.Page.SearchMgr.supportsSavedSearch=false;LNJS.Page.SearchMgr.isInitialSearch=true;this.search(null,true);},initialize:function(options){this.__className="LNJS.MapSearchResults";this.__trapErr=true;this.cacheEL("msgcont",null,true);this.cacheEL("msgclass",null,true);this.cacheEL("msgtext",null,true);this.cacheEL("msgpntr",null,true);this.cacheEL("msgdontshow",null,true);this.cacheEL("dontshowagain",null,true);this.cacheEL("msgclose",null,true);var msg=this.Msgs[LNJS.ErrType.SystemError][LNJS.ErrSource.ClientSideJavaScriptError];msg.extend({onShow:function(){if(LNJS.Page){LNJS.Page.hideUpdatingMapMsg();if(LNJS.Page.SearchMgr){LNJS.Page.SearchMgr._clearPins();LNJS.Page.SearchMgr._clearResultList();}}}});this.Msgs.add({title:"Please Try Again",text:"Unknown Virtual Earth Error.",useErrText:true},{type:LNJS.ErrType.LNJSFramework,source:LNJS.ErrSource.LNJSMapManager});this.options={panelGlideTo:305,minWindowWidth:1000,minWindowHeight:600,hidepause:700,showpause:300,leftpanelcont:"mapResultsPanel",leftpanel:"moveSlide",MapContainer:"MapContainer",mapopt:{container:"MapFrame",opt:{latitude:defaultLat,longitude:defaultLon,zoomlevel:defaultZoom,onMapInit:this._onInitMap.bindAsEventListener(this)}},searchopt:{resultCount:"resultCount",resultcont:"mapResultsList",searchType:defaultSearchType,searchTypes:["FS","FL","RS","PD"],selectedCats:[[],[],[]],popup:'ppp',critopt:{searchType:defaultSearchType,editor:"map",maxsearchrowcount:100,maxcount:100,statuslist:"10",approvalstatuslist:"AP,PA",countrylist:"US"}},slideropt:{useHTMLSliders:null},suggopt:{element:'suggest',update:'citySuggest',url:'/xNet/MainSite/WebServices/Address/Geolookup.asmx',opt:{queueLength:1,frequency:0.14,minChars:3,ServiceSourceCode:10,SOAPMethod:'GetGeoSuggestions',SOAPNamespace:'http://www.loopnet.com/WebServices',processResults:this.geoProcess,updateElement:this.geoUpdate,clonePosition:false,onReturn:function(){LNJS.Page.search();},onChange:function(){LNJS.Page.Suggest.index=-1;LNJS.Page.suggestIndex=-1;LNJS.Page.suggestList=null;LNJS.Page.SearchMgr.hidePinProfile();}}}}.extend(options||{});this.hidepause=this.options.hidepause;this.showpause=this.options.showpause;this.searchMode=null;this.Msgs.add({title:"",text:"Please select at least one property type to search.",pointer:"ml",x:"175px",y:"130px",onShow:function(){}},{type:LNJS.ErrType.RequiredField,source:LNJS.ErrSource.MapPropertyTypes});this.Msgs.add({title:"",text:"Your location could not be found, please try again. You may enter a location in the following formats:<br/> - Zip code <br/>- City, State <br/>- Address, City, State",pointer:"ml",x:$('suggest'),y:"280px",offsetX:35},{type:LNJS.ErrType.InvalidData,source:LNJS.ErrSource.MapLocation});this.Msgs.add({title:"Required Field Property ID",text:"Please enter a property id to search for.",pointer:"ml",x:"92px",y:"245px"},{type:LNJS.ErrType.RequiredField,source:LNJS.ErrSource.MapPropertyID});this.Msgs.add({title:"Invalid Property ID",text:"Please enter a valid property id.",pointer:"ml",x:"92px",y:"245px"},{type:LNJS.ErrType.InvalidData,source:LNJS.ErrSource.MapPropertyID});this.Msgs.add({title:"You Need to Zoom In",text:"Some results are not shown, please narrow your search. Tip: you may also zoom in by double clicking the map.",pointer:"ml",targetX:"MSVE_navAction_zoomMinusWrapper",y:"515px",offsetX:-71,dontshow:true},{name:"result100plus"});this.Msgs.add({title:"",text:"To use this, you must have at least one property selected. Select a record from the results list by checking the box next to the record title."},{name:"nothingSelected"});this.Msgs.add({title:"",text:""},{name:"genericMsg"});this.cacheEL("updatingMapMsg");this.cacheEL("leftpanelcont");this.cacheEL("MapContainer");if(enNGMapMode!="MapOnly"){this.cacheEL("updatingResultsMsg");this.cacheEL("resortingResultsMsg");}this.cacheEL("layoutFrame");Event.observe(window,"resize",this._resizeHandler);if(this.EL.saveListingDD){Event.observe(document,"click",this._closeSaveListingDD.bindAsEventListener(this));}if(LNJS.PageState)this._initPageState();if(LNJS.SavedCriteria)this._initCriteria(this.options.searchopt);if(LNJS.isNull(LNJS.SearchManager))throw this.Err(this.__className+" requires LNJS.SearchManager!");this.SearchMgr=new LNJS.SearchManager(this.options.searchopt);this._initCheckboxes();this._initPageDisplay();if(LNJS.isNull(LNJS.MapManager))throw this.Err(this.__className+" requires LNJS.MapManager!");this.MapMgr=new LNJS.MapManager(this.options.mapopt.container,this.options.mapopt.opt);},search:function(sourcecode,locSet){if((this.MapMgr)&&(!this.MapMgr.mapInitialized)){return;}if(this.SearchMgr._isRS()){if(!Element.visible(this.EL.purchasingTray)&&!LNJS.User.rSID.y()){Element.hide(this.EL.reportingTray);if(this.EL.RSDisclaimer)Element.show(this.EL.RSDisclaimer);Element.show(this.EL.purchasingTray);}}this.hideMsg();this.SearchMgr.CritMgr.initCriteria(this.SearchMgr.searchType);this.searchsourcecode=sourcecode;this.searchlocSet=locSet;this.SearchMgr.buildCriteria();},_search:function(){if(this.searchsourcecode)LNJS.ServiceSourceCode=LNJS.ServiceSource[this.searchsourcecode];if(ll_search_criteria!=''){this.SearchMgr.executeInitialSearch();}else{this.SearchMgr.performSearch();}this.searchsourcecode=null;this.searchlocSet=null;LNJS.Page.Log.__LogEvent({eventclass:90,eventtype:80,eventdata:"<SiteUser SiteUserID=\""+LNJS.User.iSUID+"\"/>"});LNJS.ServiceSourceCode=LNJS.ServiceSource.Clear;Element.show(this.SearchMgr.resultcont);},goBtn:function(){LNJS.Page.Log.__LogActionCode(90);this.search();},rsSearchByState:function(sStateName){LNJS.Page.SearchMgr.searchHasRun=false;if(Element.visible(LNJS.Page.EL.filterItems))LNJS.Page.toggleFilters();Element.hide(LNJS.Page.SearchMgr.resultcont);if(LNJS.Page.MapMgr.isBirdsEye())LNJS.Page.MapMgr.setMapStyle("r");LNJS.Page.hideMsg();if(LNJS.Page.EL.result0msg)Element.hide(LNJS.Page.EL.result0msg);LNJS.Page.SearchMgr.hidePinProfile();this.excludePinIndex=-1;LNJS.Page.SearchMgr._clearPins();LNJS.Page.SearchMgr._clearResultList();LNJS.Page.clearSelected(false);if(LNJS.Page.SearchMgr._isMLS()){LNJS.Page.EL.reportingTray.className="mapPropTray-reporting proptray-disabled";}else{LNJS.Page.EL.purchasingTray.className="mapPropTray-purchasing proptray-disabled";}LNJS.Page.SearchMgrTrayEnabled=false;Element.hide(LNJS.Page.EL.saveSearch);LNJS.Page.x=false;LNJS.Page.EL.suggest.value=sStateName;LNJS.Page.search();},startNewSearch:function(){LNJS.Page.SearchMgr.searchHasRun=false;if(Element.visible(LNJS.Page.EL.filterItems))LNJS.Page.toggleFilters();Element.hide(this.SearchMgr.resultcont);if(this.MapMgr.isBirdsEye())this.MapMgr.setMapStyle("r");this.hideMsg();if(this.EL.result0msg)Element.hide(this.EL.result0msg);this.SearchMgr.hidePinProfile();this.excludePinIndex=-1;this.SearchMgr._clearPins();this.SearchMgr._clearResultList();this.clearSelected(false);if(this.SearchMgr._isMLS()){this.EL.reportingTray.className="mapPropTray-reporting proptray-disabled";}else{this.EL.purchasingTray.className="mapPropTray-purchasing proptray-disabled";}this.SearchMgrTrayEnabled=false;Element.hide(this.EL.saveSearch);this.LeftPanel.glideTo(0,0,200);if(this.searchMode!="edit"){setTimeout((function(){this.resetFilters();}).bind(this),210);}this.x=false;},setRentFormat:function(name,value){if(!this.SliderMgr.useFlashSliders){this.SliderMgr.setFormat(name,name+'format'+value);}else{value=(value.indexOf("Y")==0)?"YR":"MO";this.SearchMgr.CritMgr.Criteria.ListingType.ForLeaseListing.SpaceListing.RatePerSizeRange.RateType=value;}this.SearchMgr.rentType=value;if(this.SearchMgr.pData&&this.SearchMgr.pData.resultCount>0){for(var i=0;i<this.SearchMgr.pData.resultCount;i++){var rateyr=$('rateyr'+i);var ratemo=$('ratemo'+i);if(rateyr)Element[(value=="YR")?'show':'hide'](rateyr);if(ratemo)Element[(value=="YR")?'hide':'show'](ratemo);rateyr=null;ratemo=null;}}if(this.SearchMgr._isFL()&&Element.visible(LNJS.Page.SearchMgr.popup)){if(this.SearchMgr.pinIndex!=-1&&$('ppprenttype'))$('ppprenttype').innerHTML=$('rate'+value.toLowerCase()+this.SearchMgr.pinIndex).innerHTML;}},zoomToStreet:function(index){var item=LNJS.Page.SearchMgr.pData.items[index];LNJS.Page.SearchMgr.profileZoomLock=item;LNJS.Page.MapMgr.setCenterAndZoom(new VELatLong(item.lat,item.lon),16);item=null;},switchToRS:function(index){this.resetFilters();LNJS.Page.SearchMgr.searchHasRun=false;this.hideMsg();this.SearchMgr.hidePinProfile();this.excludePinIndex=-1;this.SearchMgr._clearPins();this.SearchMgr._clearResultList();this.clearSelected(false);LNJS.Page.selectSearchType('RS');if(LNJS.Page.searchMode=='edit'){LNJS.Page.cancelSaveSearch();}else{LNJS.Page._clearSavedSearch();}setTimeout((function(){LNJS.Page.search();}).bind(this),210);},resetFilters:function(doSearch){if(this.SliderMgr){this.SliderMgr._resetSliders(LNJS.Page.SearchMgr.searchType);}this.clearKeywords(false);this.EL.dateentered.selectedIndex=0;this.EL.datesold.selectedIndex=0;if(doSearch===true){setTimeout((function(){this.search();}).bind(this),210);}},clearKeywords:function(doSearch){this.EL.keyword.value="Keywords";if(doSearch)this.search();},onDateDropDownChange:function(){if(document.activeElement)document.body.setActive();this.search();},showUpdatingMapResultsMsg:function(){if(this.EL.leftpanelcont&&this.EL.updatingResultsMsg){this.EL.updatingResultsMsg.style.top=Position.cumulativeOffset(this.EL.leftpanelcont)[1]+'px';Element.show(this.EL.updatingResultsMsg);}},showResortingResultsMsg:function(){if(this.EL.leftpanelcont&&this.EL.resortingResultsMsg){this.EL.resortingResultsMsg.style.top=Position.cumulativeOffset(this.EL.leftpanelcont)[1]+'px';Element.show(this.EL.resortingResultsMsg);}},hideResortingResultsMsg:function(){if(this.EL.resortingResultsMsg)Element.hide(this.EL.resortingResultsMsg);},showUpdatingMapMsg:function(){if(this.EL.updatingMapMsg){Element.show(this.EL.updatingMapMsg);}if((this.EL.MapContainer)&&(this.EL.updatingResultsMsg)){Element.show(this.EL.updatingResultsMsg);this.EL.updatingResultsMsg.style.top=(Position.cumulativeOffset(this.EL.MapContainer)[1]+'px');this.EL.updatingResultsMsg.style.left=(this.EL.MapContainer.offsetLeft+this.EL.MapContainer.clientWidth-this.EL.updatingResultsMsg.clientWidth+'px');}},hideUpdatingMapResultsMsg:function(){if(this.EL.updatingResultsMsg)Element.hide(this.EL.updatingResultsMsg);},hideUpdatingMapMsg:function(){if(this.EL.updatingMapMsg)Element.hide(this.EL.updatingMapMsg);if(this.EL.updatingResultsMsg)Element.hide(this.EL.updatingResultsMsg);},showSearchResultTools:function(){},selectSearchType:function(type){this.SearchMgr.lastSearchType=this.SearchMgr.searchType;this.SearchMgr.searchType=type;return;if(this.SearchMgr._isFL()){this.EL.filterToggleTitle.src=LNJS.contentProviderUrl+'/images/search/map/5.5/titles/filters-FL.gif';}else{this.EL.filterToggleTitle.src=LNJS.contentProviderUrl+'/images/search/map/5.5/titles/filters.gif';}this.EL.toggleFSLabel.style.fontWeight='normal';this.EL.toggleFLLabel.style.fontWeight='normal';this.EL.toggleRSLabel.style.fontWeight='normal';this.EL['toggle'+type].checked=true;this.EL['toggle'+type+'Label'].style.fontWeight='bold';if(this.SearchMgr._isPD()){}else{Element.show(this.EL["searchOptions"+((this.SearchMgr._isFL())?"FL":"FS")]);Element.hide(this.EL["searchOptions"+((!this.SearchMgr._isFL())?"FL":"FS")]);Element.show(this.EL.searchpage);}if(this.SearchMgr._isRS()){if(!Element.visible(this.EL.purchasingTray)&&LNJS.User.rSID.y()){Element.hide(this.EL.reportingTray);if(this.EL.RSDisclaimer)Element.show(this.EL.RSDisclaimer);Element.show(this.EL.purchasingTray);}}else{if(!Element.visible(this.EL.reportingTray)){Element.hide(this.EL.purchasingTray);if(this.EL.RSDisclaimer)Element.hide(this.EL.RSDisclaimer);Element.show(this.EL.reportingTray);}Element.hide(this.EL.groupListFS,this.EL.groupListFL);Element.show(this.EL['groupList'+this.SearchMgr.searchType]);}},togglePropType:function(element){this.selectSearchType(element.value);this.hideMsg();},showSaveSearch:function(){LNJS.Modal.show({container:'saveSearchMsg',target:'mapMainPanel',onClickClose:true});},hideSaveSearch:function(){LNJS.Modal.hide();},cancelSaveSearch:function(){Element.hide('editingSavedSearch');LNJS.Page._clearSavedSearch();},toggleFilters:function(e){LNJS.Page.SliderMgr.setDisplay(LNJS.Page.SearchMgr.searchType,LNJS.Page.SearchMgr._getSelectedCatIds());if(!LNJS.Page.SliderMgr.useFlashSliders){LNJS.Page._finishToggleFilters();}},_finishToggleFilters:function(){Element.toggleHidden(LNJS.Page.EL.filterItems);if(Element.visible(LNJS.Page.EL.filterItems)){LNJS.Page.Log.__LogActionCode(89);if(LNJS.Page.SearchMgr._isRS()){Element.show(LNJS.Page.EL.datesold);Element.hide(LNJS.Page.EL.dateentered);}else{Element.hide(LNJS.Page.EL.datesold);Element.show(LNJS.Page.EL.dateentered);}LNJS.Page.EL.filterToggleImg.style.backgroundPosition='0px -15px !important';}else{Element.hide(LNJS.Page.EL.datesold,LNJS.Page.EL.dateentered);LNJS.Page.Log.__LogActionCode(88);LNJS.Page.EL.filterToggleImg.style.backgroundPosition='0px 0px !important';}},toggleTooltip:function(arg){var tip=(typeof arg=='string')?this.Msgs[arg]:arg;this.showMsg(tip);},toggle:function(e,arg){var args={call:LNJS.Page._toggle,hidepause:LNJS.Page.hidepause,showpause:0}.extend(arg||{});if(e.type==="show"||e.type==="mouseover"){if(!isNaN(args.element.hid)){clearTimeout(args.element.hid);args.element.hid=null;}args.element.sid=setTimeout((function(){args.call({type:"show"},args);}).bind(this),args.showpause);}else{if(!isNaN(args.element.sid)){clearTimeout(args.element.sid);args.element.sid=null;}args.element.hid=setTimeout((function(){args.call({type:"hide"},args);}).bind(this),args.hidepause);}},toggleSaveDD:function(event){if(!LNJS.Page.SearchMgr.TrayEnabled)return;if(LNJS.Page.SearchMgr.selectedListingsCount==0){LNJS.Page.showMsg(LNJS.Page.Msgs.nothingSelected);return;}if(Element.visible(LNJS.Page.EL.saveListingDD)){Element.hide(LNJS.Page.EL.saveListingDD);}else{var pos=Position.cumulativeOffset(LNJS.Page.EL.toggleSaveDD);LNJS.Page.EL.saveListingDD.style.left=pos[0]+"px";LNJS.Page.EL.saveListingDD.style.top=(pos[1]+25)+"px";Element.show(LNJS.Page.EL.saveListingDD);}Event.stop(event);},clearSelected:function(skipCheckBoxes){if(!LNJS.Page.SearchMgr.TrayEnabled)return;var oMgr=LNJS.Page.SearchMgr;if(oMgr._isMLS()){if(skipCheckBoxes!==false){for(id in oMgr.selectedListings){var rchk=$('rchk'+id);if(rchk)rchk.checked=false;rchk=null;oMgr.selectedListings[id]=null;delete oMgr.selectedListings[id];}if(oMgr.pinIndex!=-1){var pchk=$('pchk'+oMgr.pData.items[oMgr.pinIndex].lid);if(pchk)pchk.checked=false;pchk=null;}}oMgr.selectedListings=[];oMgr.selectedListingsCount=0;LNJS.Page.EL.reportingCount.innerHTML=0;Element.hide(LNJS.Page.EL.clearProperties);LNJS.Page.EL.reportingTrayCont.title='To use this, you must have at least one property selected.';}else{if(skipCheckBoxes!==false){for(id in oMgr.selectedComparables){var rchk=$('rchk'+id);if(rchk)rchk.checked=false;rchk=null;oMgr.selectedComparables[id]=null;delete oMgr.selectedComparables[id];}if(oMgr.pinIndex!=-1){var pchk=$('pchk'+oMgr.pData.items[oMgr.pinIndex].cid);if(pchk)pchk.checked=false;pchk=null;}}oMgr.selectedComparables=[];oMgr.selectedComparablesCount=0;oMgr.selectedComparablesPrice=0;LNJS.Page.EL.purchasingCount.innerHTML=0;Element.hide(LNJS.Page.EL.clearRecentSales);if(LNJS.Page.EL.purchasingPrice)LNJS.Page.EL.purchasingPrice.innerHTML='$0.00';}oMgr=null;},saveSearchCriteria:function(resultlist){if(resultlist){criterionName=$('criterionName2');contactInfo=$('contactInfo2');alertWeekly=$('alertWeekly2');alertDaily=$('alertDaily2');alertNone=$('alertNone2');}else{criterionName=LNJS.Page.EL.criterionName;contactInfo=LNJS.Page.EL.contactInfo;alertWeekly=LNJS.Page.EL.alertWeekly;alertDaily=LNJS.Page.EL.alertDaily;alertNone=LNJS.Page.EL.alertNone;}if(criterionName.value.length==0){alert('Please enter a Name for your search criteria');return;}var sFrequency=null;if(alertWeekly.checked)sFrequency='WK';else if(alertDaily.checked)sFrequency='DA';else if(alertNone.checked)sFrequency='OFF';if(sFrequency==null){alert('Please select an Email Alert Frequency');return;}LNJS.Page.SearchMgr.CritMgr.Criteria.Name=criterionName.value;LNJS.Page.SearchMgr.CritMgr.Criteria.Frequency=sFrequency;LNJS.Page.SearchMgr.CritMgr.Criteria.ReleaseContactInd=contactInfo.checked;LNJS.Page.SearchMgr.CritMgr.Criteria.GeographicFilter.Radius.Address.Latitude=LNJS.Page.MapMgr.getCenterLatitude();LNJS.Page.SearchMgr.CritMgr.Criteria.GeographicFilter.Radius.Address.Longitude=LNJS.Page.MapMgr.getCenterLongitude();LNJS.Page.SearchMgr.CritMgr.Criteria.GeographicFilter.Radius.Zoomlevel=LNJS.Page.MapMgr.getZoomLevel();var sData='<PFRequestData ';if(LNJS.SearchCriterionID)sData+='SearchCriterionID="'+LNJS.SearchCriterionID+'"';sData+='>'+LNJS.Page.SearchMgr.CritMgr.Criteria.toXml()+'</PFRequestData>';var options=({queueLength:1,SOAPMethod:'SaveSearchCriteria',SOAPNamespace:'http://www.loopnet.com/WebServices',postBody:GetSoapInput(sData,'SaveSearchCriteria','http://www.loopnet.com/WebServices',-1,true),onComplete:LNJS.Page._saveSearchCriteria_callback});var url='/xNet/MainSite/WebServices/Listings/Search.asmx';LNJS.Ajax.post(url,options);LNJS.Modal.hide();},saveListings:function(arg){if(!LNJS.Page.SearchMgr.TrayEnabled)return;if(LNJS.Page.SearchMgr.selectedListingsCount==0){LNJS.Page.showMsg(LNJS.Page.Msgs.nothingSelected);return;}var slist='';for(id in LNJS.Page.SearchMgr.selectedListings){if(typeof LNJS.Page.SearchMgr.selectedListings[id]=='number')slist+=LNJS.Page.SearchMgr.selectedListings[id]+',';}slist=slist.substring(0,slist.length-1);sData='<PFRequestData><ListingList IDList="'+slist+'" GroupType="'+LNJS.Page.SearchMgr.searchType+'"';if(arg=='New'){if(LNJS.Page._createNewGroup()){sData+=' GroupName="'+LNJS.Page.groupName+'" ';}else{return;}}else if(arg=='Default Folder'){sData+=' GroupName="'+arg+'" ';}else if(!LNJS.isNull(arg)&&!isNaN(arg)){sData+=' GroupID="'+arg+'" ';}sData+='/></PFRequestData>';var options=({queueLength:1,SOAPMethod:'SaveListings',SOAPNamespace:'http://www.loopnet.com/WebServices',postBody:GetSoapInput(sData,'SaveListings','http://www.loopnet.com/WebServices',-1,true),onComplete:LNJS.Page._saveListings_callback});var url='/xNet/MainSite/WebServices/Listings/Listing.asmx';LNJS.Ajax.post(url,options);},saveComparables:function(){if(LNJS.Page.SearchMgr.selectedComparablesCount==0){LNJS.Page.Msgs.genericMsg.title="";LNJS.Page.Msgs.genericMsg.text="To use this, you must have at least one RecentSales selected. Select a record from the results list by checking the box next to the record title and try again.";LNJS.Page.showMsg(LNJS.Page.Msgs.genericMsg);return;}var slist='';for(id in LNJS.Page.SearchMgr.selectedComparables){if(typeof LNJS.Page.SearchMgr.selectedComparables[id].id=='number')slist+=LNJS.Page.SearchMgr.selectedComparables[id].id+',';}slist=slist.substring(0,slist.length-1);var options=({queueLength:1,SOAPMethod:'SaveComparables',SOAPNamespace:'http://www.loopnet.com/WebServices',postBody:GetSoapInput('<PFRequestData><ComparableList IDList="'+slist+'" /></PFRequestData>','SaveComparables','http://www.loopnet.com/WebServices',-1,true),onComplete:LNJS.Page._saveComparables_callback});var url='/xNet/MainSite/WebServices/Comparables/Comparable.asmx';LNJS.Ajax.post(url,options);},emailListings:function(){if(!LNJS.Page.SearchMgr.TrayEnabled||LNJS.Page.SearchMgr.selectedListingsCount==0)return;},createListingsReport:function(ReportTypeID){if(!LNJS.Page.SearchMgr.TrayEnabled)return;if(LNJS.Page.SearchMgr.selectedListingsCount==0){LNJS.Page.showMsg(LNJS.Page.Msgs.nothingSelected);return;}if(!LNJS.Page.SearchMgr._checkSelection(ReportTypeID))return;var slist='';for(id in LNJS.Page.SearchMgr.selectedListings){if(typeof LNJS.Page.SearchMgr.selectedListings[id]=='number')slist+=LNJS.Page.SearchMgr.selectedListings[id]+',';}slist=slist.substring(0,slist.length-1);if(LNJS.Page.SearchMgr._isMLS()){LNForm1AddInput('ListingIDList',slist,true);LNForm1AddInput('ReportTypeID',ReportTypeID,true);LNForm1AddInput('ListingType',LNJS.Page.SearchMgr.searchType,true);LNForm1AddInput('SearchID',LNJS.Page.SearchMgr.pData.searchResultID,true);LNJS.Page._savePageState('/xNet/MainSite/Listing/Report/ReportCustomization.aspx');}else{}},goToUpgrade:function(category,linkcode){LNJS.Page._savePageState('/xNet/MainSite/Product/Product.aspx?CategoryID='+category+'&FromLocation=mapsearch&LinkCode='+linkcode);},goToPurchase:function(sType){if(LNJS.Page.SearchMgr.selectedComparablesCount==0&&sType=='Buy'){LNJS.Page.Msgs.genericMsg.title="";LNJS.Page.Msgs.genericMsg.text="To use this, you must have at least one RecentSales selected. Select a record from the results list by checking the box next to the record title and try again.";LNJS.Page.showMsg(LNJS.Page.Msgs.genericMsg);return;}var slist='';for(id in LNJS.Page.SearchMgr.selectedComparables){if(typeof LNJS.Page.SearchMgr.selectedComparables[id].id=='number')slist+=LNJS.Page.SearchMgr.selectedComparables[id].id+',';}document.forms[0].SelectedComparables.value=slist.substring(0,slist.length-1);document.forms[0].PageState.value=LNJS.Base64.encode(this._getPageState().toString());window.__doPostBack(sType);},addToCart:function(id){var rchk=$('rchk'+id);if(rchk.checked)return;rchk.checked=true;rchk=null;LNJS.Page.SearchMgr.trackCheckbox(id);},setSaveOption:function(el){switch(el.type.toLowerCase()){case'radio':if(el.value=='DA'&&!LNJS.User.rPID.x()){$('bsupsellmsg').style.display='block';el.checked=false;if(confirm('Daily email notifications are only available to Premium Members. Click \'OK\' to Learn more.'))LNJS.Page.SearchMgr.showMarketingPage(4,null);}else el.checked=true;break;case'checkbox':el.checked=!el.checked;break;}},dispose:function(){Event.stopObserving(LNJS.Page.EL.keyword,"keypress",LNJS.Page._onKeyPress);Event.stopObserving(window,"resize",LNJS.Page._resizeHandler);if(LNJS.Page.EL.saveListingDD){Event.stopObserving(document,"click",LNJS.Page._closeSaveListingDD);}},_onInitMap:function(oMapMgr){if(this.SearchMgr.attachMapEvents){this.SearchMgr.attachMapEvents(oMapMgr);}},_toggle:function(e,args){if(args.classon&&args.classoff){Element[((e.type==="show"||e.type==="mouseover")?'remove':'add')+'ClassName'](args.element,args.classoff);Element[((e.type==="show"||e.type==="mouseover")?'add':'remove')+'ClassName'](args.element,args.classon);}else if(args.onFX&&args.offFX){args[((e.type==="show"||e.type==="mouseover")?'on':'off')+'FX'].run();}else Element[(e.type==="show"||e.type==="mouseover")?'show':'hide'](args.element);},_onKeyPress:function(event){if(event.keyCode==Event.KEY_RETURN)this.search();},_getPageState:function(){var state=new StringBuilder();state.append("<PageState>");LNJS.Page.SearchMgr.CritMgr.Criteria.GeographicFilter.Radius.Address.Latitude=LNJS.Page.MapMgr.getCenterLatitude();LNJS.Page.SearchMgr.CritMgr.Criteria.GeographicFilter.Radius.Address.Longitude=LNJS.Page.MapMgr.getCenterLongitude();LNJS.Page.SearchMgr.CritMgr.Criteria.GeographicFilter.Radius.Zoomlevel=LNJS.Page.MapMgr.getZoomLevel();state.append(LNJS.Page.SearchMgr.CritMgr.Criteria.toXml());state.append("</PageState>");return state;},_savePageState:function(url){var state=this._getPageState();LNForm1AddInput('VIEWSTATEID',document.forms[0].VIEWSTATEID.value,true);LNForm1AddInput('PageDataContextUpdateFromRequestOnNextPage',true,true);LNForm1AddInput('PgCxtGuid',document.forms[0].PgCxtGuid.value,true);LNForm1AddInput('PgCxtFLKey',document.forms[0].PgCxtFLKey.value,true);LNForm1AddInput('PgCxtCurFLKey',document.forms[0].PgCxtCurFLKey.value,true);LNForm1AddInput('PgCxtDir','Down',true);LNForm1AddInput('PageDataContextUpdateValue_PageState',true,true);LNForm1AddInput('PageState',LNJS.Base64.encode(state.toString()),true);PostLNForm1(url);},_initPageState:function(){this.loadingSearch=true;var sXml=LNJS.Base64.decode(LNJS.PageState);LNJS.Trace.info('Saved Page PageState:');LNJS.Trace.debug(sXml);LNJS.PageState=LNJS.Xml.getDomDocument();LNJS.PageState=(new DOMParser()).parseFromString(sXml,"text/xml");if(LNJS.PageState.parseError!=0)LNJS.PageState="";else LNJS.PageState=LNJS.PageState.documentElement;LNJS.SavedCriteria=LNJS.PageState.selectSingleNode("./SearchCriteria");},_initCriteria:function(options){this.loadingSearch=true;if(typeof LNJS.SavedCriteria=="string"){var sXml=LNJS.Base64.decode(LNJS.SavedCriteria);LNJS.Trace.info('Loading Saved Criteria:');LNJS.Trace.debug(sXml);LNJS.SavedCriteria=LNJS.Xml.getDomDocument();LNJS.SavedCriteria=(new DOMParser()).parseFromString(sXml,"text/xml");if(LNJS.SavedCriteria.parseError!=0)LNJS.SavedCriteria="";else LNJS.SavedCriteria=LNJS.SavedCriteria.documentElement;}if(LNJS.SavedCriteria.getAttribute("SearchType")!=null){options.searchType=LNJS.SavedCriteria.getAttribute("SearchType");}else{var leaseNode=LNJS.SavedCriteria.selectSingleNode("//ListingTypes/ForLeaseListing");options.searchType=(leaseNode)?"FL":"FS";leaseNode=null;}options.critopt.searchType=options.searchType;if(options.searchType=="FL"){node=LNJS.SavedCriteria.selectSingleNode("//ListingTypes/ForLeaseListing/SpaceListing/RatePerSizeRange");if(node)options.rentType=node.getAttribute("RateType");defaultSearchType=options.rentType;node=null;}Element.hide(this.EL.groupListFS,this.EL.groupListFL);Element.show(this.EL['groupList'+options.critopt.searchType]);var cats=LNJS.SavedCriteria.selectNodes("./CategoryList/PropertyCategory");if(cats.length==0)cats=LNJS.SavedCriteria.selectNodes("//CategoryList/Category");window.defaultCats=[];for(i=0;i<cats.length;i++){window.defaultCats[i]=parseInt(cats[i].getAttribute('CategoryID'));}cats=null;var radius=LNJS.SavedCriteria.selectSingleNode("./GeographicFilter/Radius");var address=LNJS.SavedCriteria.selectSingleNode("./GeographicFilter/Radius/Address");this.options.mapopt.opt=Object.extend(this.options.mapopt.opt,{minlatitude:parseFloat(radius.getAttribute("MinLatitude")),maxlatitude:parseFloat(radius.getAttribute("MaxLatitude")),minlongitude:parseFloat(radius.getAttribute("MinLongitude")),maxlongitude:parseFloat(radius.getAttribute("MaxLongitude")),zoomlevel:parseInt(radius.getAttribute("Zoomlevel")),latitude:parseFloat(address.getAttribute("Latitude")),longitude:parseFloat(address.getAttribute("Longitude"))});radius=null;address=null;if(window.location.href.indexOf("PCID")!=-1){this.searchMode=(window.location.href.indexOf("View")!=-1)?'view':'edit';if(this.searchMode=="edit"){this.EL.startNewSearch.innerHTML="Modify Search";}this.EL.criterionName.value=LNJS.SavedCriteria.getAttribute("Name");var emailalert=LNJS.SavedCriteria.selectSingleNode("./SearchCriteriaAlerts/SearchCriteriaAlert[@AlertType='MN']");if(emailalert){switch(emailalert.getAttribute("Frequency")){case'DA':this.EL.alertDaily.checked=true;break;case'WK':this.EL.alertWeekly.checked=true;break;default:this.EL.alertNone.checked=true;break;}this.EL.contactInfo.checked=(emailalert.getAttribute("ReleaseContactInd")=="Y");}}var keywords=LNJS.SavedCriteria.selectSingleNode("./ListingKeywords");if(keywords){stext=LNJS.Xml.getText(keywords);if(stext.length>0)this.EL.keyword.value=stext;}keywords=null;var saveddate=LNJS.SavedCriteria.selectSingleNode("./DateEnteredRange");if(saveddate){for(i=0;i<document.forms[0].dateentered.options.length;i++){if(saveddate.getAttribute("DateIndicator")==document.forms[0].dateentered.options[i].value){document.forms[0].dateentered.options[i].selected=true;break;}}}saveddate=null;this.onLoad=function(){if(!this.SliderMgr.useFlashSliders)this.search(null,true);};},_initPageDisplay:function(){this.selectSearchType(this.SearchMgr.searchType);},_initCheckboxes:function(){var fs=document.getElementsByClassName('propcheckbox','searchOptionsFS');var fl=document.getElementsByClassName('propcheckbox','searchOptionsFL');list=fs.concat(fl);for(i=0;i<list.length;i++){var el=list[i];var catid=el.id.replace(/[^\d]/g,'');var type=el.id.replace(/[\d]/g,'');var cats=this.options.searchopt.selectedCats[this.options.searchopt.searchTypes.indexOf(type)];if(el.checked||!LNJS.isNull(cats[catid])||(defaultCats.indexOf(catid)!=-1)){cats[catid]=el.title;el.checked=true;if(this.SearchMgr._isFS(type)){var cat=this.options.searchopt.selectedCats[this.options.searchopt.searchTypes.indexOf("RS")];cat[catid]=el.title;}}Event.observe(el,"click",this.SearchMgr._onChangeCat.bindAsEventListener(this));el=null;}},_resizeHandler:function(){if(!LNJS.Page)return;var iWidth=0,iHeight=0;if(typeof(window.innerWidth)=='number'){iWidth=window.innerWidth;iHeight=window.innerHeight;}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){iWidth=document.documentElement.clientWidth;iHeight=document.documentElement.clientHeight;}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){iWidth=document.body.clientWidth;iHeight=document.body.clientHeight;}var className="layoutFrameNone";if(iWidth<LNJS.Page.options.minWindowWidth&&iHeight<LNJS.Page.options.minWindowHeight){className="layoutFrameBoth";}else if(iWidth<LNJS.Page.options.minWindowWidth&&iHeight>LNJS.Page.options.minWindowHeight){className="layoutFrameWidth";}else if(iWidth>LNJS.Page.options.minWindowWidth&&iHeight<LNJS.Page.options.minWindowHeight){className="layoutFrameHeight";}if(LNJS.Page.EL.layoutFrame&&LNJS.Page.EL.layoutFrame.className!=className){Element.removeClassNames(LNJS.Page.EL.layoutFrame,'layoutFrameNone','layoutFrameBoth','layoutFrameWidth','layoutFrameHeight');Element.addClassName(LNJS.Page.EL.layoutFrame,className);}},_resizeResultList:function(){alert('calling resize results list');var size=Position.cumulativeOffset($('mapResultsPanel'))[1]+80;LNJS.Page.SearchMgr.resultcont.style.top=size+'px';try{if(/MSIE/.test(navigator.userAgent))LNJS.Page.SearchMgr.resultcont.style.height=(document.body.clientHeight-(size+23))+"px";}catch(e){}},_resizePropertyCategories:function(iHeight){if(iHeight<=590&&iHeight>=450){LNJS.Page.EL.searchOptionsFS.style.height=(iHeight-400)+"px";LNJS.Page.EL.searchOptionsFS.style.overflow='auto';}else if(iHeight<450){LNJS.Page.EL.searchOptionsFS.style.height='50px';LNJS.Page.EL.searchOptionsFS.style.overflow='auto';}else{LNJS.Page.EL.searchOptionsFS.style.height='auto';}},_saveSearchCriteria_callback:function(oReq){if(oReq.ReturnCode=='0'){LNJS.Page.Msgs.genericMsg.title="Search Saved";LNJS.Page.Msgs.genericMsg.text="Your search has been saved to <a href='/xNet/MainSite/Listing/SavedSearches/MySavedSearches_"+LNJS.Page.SearchMgr.searchType+".aspx'>My LoopNet</a>. To ensure that you receive email alerts, add help@loopnet.com to your address book.";LNJS.Page.showMsg(LNJS.Page.Msgs.genericMsg);var oNode=oReq.responseXML.documentElement.selectSingleNode("//PFResponseInfo");if(oNode){var SearchCriterionID=oNode.getAttribute("SearchCriterionID");LNJS.Trace.info('SearchCriterionID: '+SearchCriterionID);}oNode=null;Element.hide(LNJS.Page.EL.saveSearch,'resultSaveSearchMsg');LNJS.Page.cancelSaveSearch();}else{LNJS.Trace.error('Save Search Criteria Failed!');}},_saveListings_callback:function(oReq){if(oReq.ReturnCode=='0'){LNJS.Page.Msgs.genericMsg.title="Listings Saved";LNJS.Page.Msgs.genericMsg.text="The Listings you selected have been saved to <a href='/xNet/MainSite/Listing/MyWatchList/'>My Watch List</a>";LNJS.Page.showMsg(LNJS.Page.Msgs.genericMsg);if(!LNJS.User.rPID.x())return;var oNode=oReq.responseXML.documentElement.selectSingleNode("//PFResponseInfo");if(oNode){sText=LNJS.Xml.getText(oNode);if(sText.length>0){LNJS.Page.EL['groupList'+LNJS.Page.SearchMgr.searchType].innerHTML='<dd class="newfolder"><a href="javascript:void(0);" onclick="LNJS.Page.saveListings(\'New\');">Save in New Folder</a></dd><dd class="spacer">&nbsp;</dd>'+sText;}}oNode=null;}else{LNJS.Trace.error('Save Listings Failed!');}},_clearSavedSearch:function(){},_closeSaveListingDD:function(){if(Element.visible(LNJS.Page.EL.saveListingDD))Element.hide(LNJS.Page.EL.saveListingDD);},_createNewGroup:function(){var groupErrMsg1="The folder name is too long. Please try another folder name:";var groupLabel="Please enter a name for your new folder (e.g., Office Properties, Client Jane Smith):";var groupName='';var isValid=false;var isCancel=false;var isPopUpWarning=false;while(groupName!=null){groupName=prompt(groupLabel,groupName);isCancel=(groupName==null);if(isCancel){return false;}groupName=groupName.trim();isValid=((groupName!=null)&&(groupName.length>=1&&groupName.length<=60))?true:false;if(isValid){this.groupName=groupName;return true;}else{if(groupName.length>60){if(isPopUpWarning){alert(groupErrMsg1);}else{groupLabel=groupErrMsg1;}}}}},_saveComparables_callback:function(oReq){if(oReq.ReturnCode=='0'){var oNode=oReq.responseXML.documentElement.selectSingleNode("//PFResponseInfo");LNJS.Page.Msgs.genericMsg.title="RecentSales Saved";LNJS.Page.Msgs.genericMsg.text="The RecentSales you selected have been saved to <a href='/xNet/MainSite/Comparables/SavedComparables/MyComparables.aspx?PCIDs="+oNode.getAttribute("PCIDs")+"'>My LoopNet</a>";oNode=null;LNJS.Page.showMsg(LNJS.Page.Msgs.genericMsg);}else{LNJS.Trace.error('Save Comparables Failed!');}},locationSearch:function(){if(this.suggestIndex>-1){this.SearchMgr.searchHasRun=true;if(!this.suggestList)return;oLoc=this.suggestList.items[this.suggestIndex];if(oLoc.MaximumLatitude!=LNJS.DataType.NullString&&oLoc.MaximumLongitude!=LNJS.DataType.NullString){if(this._isLatLonToClose(oLoc)){this.MapMgr.setBestView(oLoc.MinimumLatitude,oLoc.MinimumLongitude,oLoc.MaximumLatitude,oLoc.MaximumLongitude);}else{ZoomLevel=(this.MapMgr.getZoomLevel()==12)?13:12;this.MapMgr.setCenterAndZoom(parseFloat(oLoc.Latitude),parseFloat(oLoc.Longitude),ZoomLevel);}}else{ZoomLevel=(this.MapMgr.getZoomLevel()==15)?14:15;this.MapMgr.setCenterAndZoom(parseFloat(oLoc.Latitude),parseFloat(oLoc.Longitude),ZoomLevel);}}else{var sLoc=LNJS.Page.EL.suggest.value.trim();var oDoc=(sLoc.length>2)?this._getGeoSuggestions(sLoc):{};if(sLoc.length>2&&oDoc.ReturnCode==="0"){this.SearchMgr.searchHasRun=true;var oNode=oDoc.responseXML.documentElement.selectSingleNode("//AddressSuggestionList");if(oNode!=null){oLoc=new LNAddressSuggestionList(oNode).items[0];if(oLoc.MaximumLatitude!=LNJS.DataType.NullString&&oLoc.MaximumLongitude!=LNJS.DataType.NullString){if(this._isLatLonToClose(oLoc)){this.MapMgr.setBestView(oLoc.MinimumLatitude,oLoc.MinimumLongitude,oLoc.MaximumLatitude,oLoc.MaximumLongitude);}else{ZoomLevel=(this.MapMgr.getZoomLevel()==14)?15:14;this.MapMgr.setCenterAndZoom(parseFloat(oLoc.Latitude),parseFloat(oLoc.Longitude),ZoomLevel);}}else{ZoomLevel=(this.MapMgr.getZoomLevel()==15)?14:15;this.MapMgr.setCenterAndZoom(parseFloat(oLoc.Latitude),parseFloat(oLoc.Longitude),ZoomLevel);}}else{throw this.Err(this.__className+": AddressSuggestionList node missing!");}}else{this.EL.suggest.focus();this.EL.suggest.select();throw this.LNErr(LNJS.ErrType.InvalidData,LNJS.ErrSource.MapLocation,sLoc);}}}});LNJS.addObserver({onPageLoad:function(){LNJS.Page=new LNJS.MapSearchResults();LNJS.Page._resizeHandler();if(LNJS.Page.onLoad)LNJS.Page.onLoad();}});