var search=new Array();var CardFmt=new Array();var srch_mls=new Array();var srch_crossmls_proptypes=new Array();var searchCarts=new Array();var global_filter="";var global_field={id:null,type:null};var fieldcount=0;var ts=null;var dirtysearch=false;var srchWarningId=null;var currently_blipping=null;var currentCardFmt=null;var currentSearchTab=0;var fbs_scroll_type="select";var advancedSearches=new Array();advancedSearches.push({name:"Has Photos",type:"I",tb:"picture",f:"has_picture",info:"",value:false});advancedSearches.push({name:"Has Videos",type:"I",tb:"video",f:"has_video",info:"",value:false});advancedSearches.push({name:"Has Documents",type:"I",tb:"document",f:"has_document",info:"",value:false});advancedSearches.push({name:"Open House",type:"D",tb:"openhouse",f:"openhouse_date",info:"",value:false});advancedSearches.push({name:"Tour of Home",type:"D",tb:"tour",f:"tour_date",info:"",value:false});advancedSearches.push({name:"Virtual Tour",type:"Y",tb:"vtour",f:"has_vtour",info:"",value:false});advancedSearches.push({name:"Listing Cart",type:"cart",tb:"cart",f:"cart",info:"",value:false});advancedSearches.push({name:"MLS Numbers",type:"specifiedlistings",tb:"mlsnumber",f:"",r:"",info:"",value:false});advancedSearches.push({name:"MLS Numbers",type:"idxmlsnumber",tb:"idxmlsnumber",f:"",r:"",info:"",value:false});function card_fmt_type(code,name,prop_group_id,non_public){this.code=code;this.name=name;this.prop_group_id=prop_group_id;this.card_fmt_type=card_fmt_type;this.non_public=non_public}function MLS_type(tech_id,name,pref,abbr){this.tech_id=tech_id;this.name=name;this.abbr=abbr;this.card_fmt_list=new Array();this.prefix=(pref!=null?pref:true)}function Criteria(tb,f,o,c,d,r,g){this.tb=tb;this.f=f;this.o=o;this.c=c;this.d=d;this.r=r;this.g=g}function SearchTemplate(tech_id,name){this.name=name;this.tech_id=tech_id}function searchTab(id,name,operator){this.id=(!id||id=="")?Math.floor(Math.random()*1000000000000)+"":id+"";this.name=name;this.operator=(!operator)?"R":operator}function CardFmtType(card_fmt,description,has_details,has_rooms,has_units){this.card_fmt=card_fmt.trim();this.description=description;this.has_details=has_details;this.has_rooms=has_rooms;this.has_units=has_units;this.loaded=false;this.loading_in_progress=false;this.remark1_book_length=(js_ma_tech_id=="20010602000846355519000000")?400:0;this.remark2_book_length=(js_ma_tech_id=="20010602000846355519000000")?400:0;this.groups=new Array();this.groupsObjects=new Array();this.parentchild=false;this.AddGroup=function(group_id,display_val,type,display_count,srch_data){var newgroup=new GroupType(this,group_id,display_val,type,display_count,srch_data);this.groups.push(newgroup);this.groupsObjects[group_id]=this.groups.length-1;return newgroup};this.allfields=new Array();this.allfieldsObjects=new Array();this.rooms=new Array();this.AddRoom=function(field_id,display_val,type,display_len){var newroom=new RoomUnitType(this,field_id,display_val,type,display_len);this.rooms.push(newroom);return newroom};this.units=new Array();this.AddUnit=function(field_id,display_val,type,display_len){var newunit=new RoomUnitType(this,field_id,display_val,type,display_len);this.units.push(newunit);return newunit}}function RoomUnitType(card_fmt,field_id,display_val,type,display_len){this.card_fmt=card_fmt;this.field_id=field_id;this.display_val=display_val;this.type=type;this.display_len=display_len;this.items=new Array();this.AddItem=function(value,description,selected,tech_id){var newitem=new ListItemType(this,value,description,selected,tech_id);this.items.push(newitem);return newitem}}function GroupType(card_fmt,group_id,display_val,type,display_count,srch_data){this.card_fmt=card_fmt;this.group_id=group_id;this.display_val=display_val;this.type=type;this.display_count=(display_count==""?0:(parseInt(display_count)&8191));this.visible=true;this.fields=new Array();this.srch_data=srch_data;this.AddField=function(table_name,field_id,display_val,required,type,display_len,tech_id,srch_data,def,field_picker){var trange=false;if(type=="TR"){type="T";trange=true}var newfield=new FieldType(this,table_name,field_id,display_val,required,type,display_len,tech_id,srch_data,def,field_picker);newfield.range_text=trange;this.fields.push(newfield);this.card_fmt.allfields.push(newfield);this.card_fmt.allfieldsObjects[tech_id]=this.card_fmt.allfields.length-1;return newfield}}function FieldType(group,table_name,field_id,display_val,required,type,display_len,tech_id,srch_data,def,field_picker){this.group=group;this.tech_id=tech_id;this.table_name=table_name;this.field_id=field_id;this.display_val=display_val;this.required=(required=="Y");this.type=type;this.display_len=display_len;this.field_picker=(field_picker?field_picker:false);this.def=(def?def:"");this.range_text=false;this.map_area_autocomplete=null;this.visible=true;this.rownum=-1;this.srch_data=srch_data.toUpperCase();this.items=new Array();this.AddItem=function(value,description,selected){if(this.table_name=="list"&&this.field_id=="status"&&value.indexOf("AWC_")==0){selected="Y"}var newitem=new ListItemType(this,value,description,selected);this.items.push(newitem);return newitem}}function ListItemType(field,value,description,selected,tech_id){this.field=field;this.value=value;this.description=description;this.selected=(selected=="Y");this.tech_id=tech_id}function verifydate(string,def){string=""+string.replace(/^\s+/,"").replace(/\s$/,"").replace(/\D/g,"/").replace(/[^\d\/]/g,"");var today=new Date();if(def===undefined){def=(today.getMonth()+1)+"/"+today.getDate()+"/"+today.getFullYear()}if(string.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{4}$/)){return(appearsToBeValidDate(string))?string:def}else{if(string.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{2}$/)){if(appearsToBeValidDate(string)){return string.replace(/[0-9]{2}$/,today.getFullYear().toString().match(/^[0-9]{2}/)+string.replace(/[0-9]{1,2}\/[0-9]{1,2}\//,"").match(/^[0-9]{2}/))}else{return def}}else{if(string.match(/^[0-9]{1,2}\/[0-9]{1,2}/)){if(appearsToBeValidDate(string+"/"+today.getFullYear())){return string.match(/^[0-9]{1,2}\/[0-9]{1,2}/)+"/"+today.getFullYear()}else{return def}}else{if(string.indexOf("/")<0&&string.match(/^[0-9]+$/)){var testyear1=string.substr(0,4);var testyear2=string.substr(4,4);if((testyear2.match(/^20/)||testyear2.match(/^19/))){string=string.substr(0,2)+"/"+string.substr(2,2)+"/"+string.substr(4,4)}else{string=string.substr(4,2)+"/"+string.substr(6,2)+"/"+string.substr(0,4)}if(string.match(/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{2,4}$/)&&appearsToBeValidDate(string)){return string}}}}}return def;function appearsToBeValidDate(tmpStr){var tmpMonth=parseInt(tmpStr.split("/")[0],10);var tmpDay=parseInt(tmpStr.split("/")[1],10);var tmpYear=parseInt(tmpStr.split("/")[2],10);var tmpDate=new Date(tmpStr);if(tmpDay===tmpDate.getDate()&&tmpMonth===tmpDate.getMonth()+1&&(tmpYear===tmpDate.getFullYear()||tmpYear===tmpDate.getYear())){return true}else{return false}}}function verifyint(string,def){string=""+string;var str=string.replace(/[^\d]+/gi,"");if(str==""){if(def){return def}else{return"0"}}return str}function verifyfloat(string,def){string=""+string;var str=string.replace(/[^\d\.]/gi,"");if(str==""){if(def){return def}else{return"0"}}return str}function verifylistnum(string,prefix){string=""+string;if(string==""){return""}var newstring="";if(prefix){var rx=new RegExp(/^[a-zA-Z0-9]{1,2}-[0-9]{1,9}(-[0-9]{1,9})?/)}else{var rx=new RegExp(/^[0-9]{1,9}(-[0-9]{1,9})?/)}string=string.replace(/\s+/g,",").replace(/[,]+/,",");var strlist=string.split(",");for(var x=0;x<strlist.length;x++){if(!strlist[x].replace(/\s/g,"").match(rx)){strlist[x]=""}if(strlist[x]==""){continue}if(strlist[x].replace(/\s/g,"").match(rx).length<2){strlist[x]=strlist[x].replace(/\s/g,"").match(rx)}else{strlist[x]=strlist[x].replace(/\s/g,"").match(rx)[0]}}return strlist.join(",").replace(/,+/,",").replace(/,$/,"").replace(/^,/,"")}function verifytime(string){return string.match(/^[0-9]{1,2}[:][0-9]{2}/)}function findCardFmtObj(card_fmt){for(var i=0;i<CardFmt.length;i++){if(CardFmt[i].card_fmt==card_fmt){return CardFmt[i]}}return false}function getPropertyTypeAbbrs(){if(card_fmt_list){return card_fmt_list}var l=prop_type_list.split(",");var rl="";var cf_list=null;for(var x=0;x<srch_mls.length;x++){if(js_ma_tech_id.match(rmxId(srch_mls[x].tech_id))){cf_list=srch_mls[x].card_fmt_list;break}}if(!cf_list){return false}for(var x=0;x<l.length;x++){for(var y=0;y<cf_list.length;y++){if(rmxId(cf_list[y].prop_group_id)==l[x].replace(/[^0-9]/g,"")){rl+=(rl?",":"")+"'"+cf_list[y].code+"'"}}}return rl}function getCardFmtDesc(ma_tech_id,card_fmt){ma_tech_id=rmxId(ma_tech_id);card_fmt=card_fmt.replace(/\'/g,"");for(var x=0;x<srch_mls.length;x++){if(ma_tech_id.match(rmxId(srch_mls[x].tech_id))){var cf_list=srch_mls[x].card_fmt_list;for(var y=0;y<cf_list.length;y++){if(cf_list[y].code.replace(/\'/g,"")==card_fmt||rmxId(cf_list[y].prop_group_id)==card_fmt.replace(/[^0-9]/g,"")){return cf_list[y].name}}}}return""}function add_card_fmt(tech_id,code,name,prop_group_id,non_public){for(var i=0;i<srch_mls.length;i++){if(srch_mls[i].tech_id=="x'"+tech_id+"'"){srch_mls[i].card_fmt_list[srch_mls[i].card_fmt_list.length]=new card_fmt_type(code,name,prop_group_id,non_public);break}}}function use_status_sort(field_id){if(js_ma_tech_id=="20070913202326493241000000"&&field_id=="status"){return true}else{return false}}function status_sort(a,b){if(js_ma_tech_id=="20070913202326493241000000"){if(!a&&!b){return 0}else{if(!a){return -1}else{if(!b){return 1}}}a=a.value||"";b=b.value||"";a=a.toUpperCase().replace(/\'/g,"");b=b.toUpperCase().replace(/\'/g,"");var sort_list="'A','P','C','E','W','L','D'";if(a==b){return 0}if(a&&a.indexOf("AWC")>=0){return(b=="A"?1:-1)}if(b&&b.indexOf("AWC")>=0){return(a=="A"?-1:1)}var first=sort_list.indexOf(a);var second=sort_list.indexOf(b);return((first>second)?1:((second>first)?-1:0))}}function getSearchFields(cf,pt,mls,firstLoad,loadFirstCardFmtOnly,noFieldCheck){var tmp_cf=(loadFirstCardFmtOnly)?cf.split(",")[0]:cf;var newCF=findCardFmtObj(tmp_cf+":"+pt+":"+mls);var firstLoad=(firstLoad==true)?"true":"false";if(newCF){currentCardFmt=newCF}else{loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch/getFields.html&noFieldCheck="+(noFieldCheck?true:false)+"&card_fmt_list="+tmp_cf+"&prop_type_list="+pt+"&ma_search_list="+mls+"&firstLoad="+firstLoad+(interfaceObj.idx?"&idx="+interfaceObj.idx:"")+additional_ajax_params,false)}}function getFetchableFields(firstLoad,loadFirstCardFmtOnly,no_cfmt_update){var tmp_cf=(loadFirstCardFmtOnly)?card_fmt_list.split(",")[0]:card_fmt_list;var newCF=findCardFmtObj(tmp_cf+":"+prop_type_list+":"+ma_search_list);var firstLoad=(firstLoad==true)?true:false;if((newCF||no_cfmt_update)&&all_fields_retrieved){if(!no_cfmt_update){currentCardFmt=newCF}getFieldsDone();HALT_COMPILE=false;return false}var rstr_list=document.getElementById("field_restrict_list");all_fields_retrieved=false;var ffields=new Array();var mfields=new Array();var apfields=new Array();var curr_groups=",";for(var x=0;x<search.length;x++){if(search[x].tb=="feature"){var g=search[x].c.substr(0,search[x].c.indexOf(" and "));if(curr_groups.indexOf(","+g+",")<0){ffields.push("<input type='hidden' name='feat_"+ffields.length+"' value=\""+g+'">');curr_groups+=g+","}}else{mfields.push("<input type='hidden' name='main_"+mfields.length+"' value=\""+search[x].f+'">')}}for(var x=0;x<field_buffer.length;x++){if(field_buffer[x].tb=="feature"){var g=field_buffer[x].c.substr(0,field_buffer[x].c.indexOf(" and "));if(curr_groups.indexOf(","+g+",")<0){ffields.push("<input type='hidden' name='feat_"+ffields.length+"' value=\""+g+'">');curr_groups+=g+","}}else{mfields.push("<input type='hidden' name='main_"+mfields.length+"' value=\""+field_buffer[x].f+'">')}}var list=document.getElementById("searchList");for(var x=0;x<list.childNodes.length;x++){if(isLastCustomNode(list.childNodes[x])){break}else{if(list.childNodes[x].kind=="card_fmt"||list.childNodes[x].kind=="ma_search_list"){continue}else{if(list.childNodes[x].tb=="list"||list.childNodes[x].tb=="report"){mfields.push("<input type='hidden' name='main_"+mfields.length+"' value=\""+list.childNodes[x].f+'">')}else{if(list.childNodes[x].tb=="feature"){var g=list.childNodes[x].c.substr(0,list.childNodes[x].c.indexOf(" and "));if(curr_groups.indexOf(","+g+",")<0){ffields.push("<input type='hidden' name='feat_"+ffields.length+"' value=\""+g+'">');curr_groups+=g+","}}}}}}mfields.push("<input type='hidden' name='main_count' value='"+mfields.length+"'>");mfields.push("<input type='hidden' name='feat_count' value='"+ffields.length+"'>");var firstLoad=(firstLoad==true)?"true":"false";var add_params=additional_ajax_params.split("&");for(var x=0;x<add_params.length;x++){if(add_params[x]==""){continue}apfields.push("<input type='hidden' name='"+add_params[x].substr(0,add_params[x].indexOf("="))+"' value=\""+add_params[x].substr(add_params[x].indexOf("=")+1)+'">')}rstr_list.innerHTML=mfields.join("")+ffields.join("")+apfields.join("");var fp_showing=(fieldPicker&&fieldPicker.style.display!="none"?true:false);document.fieldform.noFieldCheck.value=fp_showing;document.fieldform.field_restrict.value=!fp_showing;document.fieldform.firstLoad.value=firstLoad;document.fieldform.card_fmt_list.value=tmp_cf;document.fieldform.ma_search_list.value=ma_search_list;document.fieldform.prop_type_list.value=prop_type_list;loadJavaScriptDoc("form","mainmenu.cgi","fieldform",false)}function isLastCustomNode(elem){if(interfaceObj.idx){if(elem.id&&elem.id=="adv_picture"){return true}}else{if(elem.id=="fieldPickerNode"){return true}}return false}function getLastCustomNode(){if(interfaceObj.idx){return document.getElementById("adv_picture")}else{return document.getElementById("fieldPickerNode")}return false}function getFieldsDone(){if(srch_mls.length>1&&srch_source!="edit_as_fullsearch"){renderCriteria("ma_search_list",ma_search_list)}var has_card_fmt=false;if(srch_source=="edit_as_fullsearch"){var list=document.getElementById("searchList");for(var x=0;x<list.childNodes.length;x++){if(list.childNodes[x].kind&&list.childNodes[x].kind=="card_fmt"){if(list.childNodes[x].style.display!="none"){list.removeChild(list.childNodes[x]);has_card_fmt=true}break}else{if(isLastCustomNode(list.childNodes[x])){break}}}}var prop_item=null;if(ma_search_list.split(",").length>1&&(srch_source!="edit_as_fullsearch"||has_card_fmt)){prop_item=renderCriteria("card_fmt",prop_type_list,null,ma_search_list)}else{if(srch_source!="edit_as_fullsearch"||has_card_fmt){prop_item=renderCriteria("card_fmt",card_fmt_list,null,ma_search_list)}}if(searchtype=="A"){var firststreet=-1;var strList=new Array();for(var x=0;x<search.length;x++){if(search[x].tb=="list"&&search[x].f=="streetname"){if(firststreet==-1){firststreet=x;search[x].r="R";continue}else{strList.push(x);search[firststreet].c+=","+search[x].c}}}for(var x=(strList.length-1);x>=0;x--){search.splice(strList[x],1)}}srch.draw(true,true,(srch_source=="edit_as_fullsearch"?true:false));if(srch_source=="edit_as_fullsearch"||srch_source=="new_quicksearch"){field_id_list=new Array();if(js_ma_tech_id!="20010602000846355519000000"){if(ma_search_list.split(",").length==1){scrollfl_ma_tech_id=ma_search_list;_AP_Reload(scrollfl_ma_tech_id,card_fmt_list)}}else{setTimeout("scrollfl_update_finish()",100)}}if(srch_source=="edit_as_fullsearch"){srch_source="";fs_wait=true;updateMatchCount((searchmode.split("||")[1].indexOf("searchtab_")<0?true:false));changeSearchSubTab("restore")}if(!interfaceObj.idx&&(srch_source=="quicksearch"||srch_source=="new_quicksearch"||srch_source=="editmapsearch")){showFirstField()}}function getFieldsCheckList(noFieldCheck){srch.draw(false,true);if(!noFieldCheck){noFieldCheck=false}var list=document.getElementById("searchList");var disabled_nodes=new Array();for(var x=0;x<list.childNodes.length&&!noFieldCheck;x++){var myNode=list.childNodes[x];if(isLastCustomNode(myNode)){break}if(myNode.f=="ma_search_list"||myNode.f=="card_fmt"||myNode.tb=="mapshape"||myNode.kind=="idxmlsnumber"||myNode.tb=="openhouse"){continue}if((myNode.f.match("date")&&myNode.f!="end_date")||myNode.f=="list_price"||myNode.f=="sold_price"||myNode.f=="status"||myNode.f=="house_nbr"||myNode.f=="streetname"||myNode.f=="city"||myNode.f=="area"||myNode.f=="total_sqft"){var field=null;for(var y=0;y<currentCardFmt.allfields.length;y++){if(currentCardFmt.allfields[y].field_id==myNode.f){field=currentCardFmt.allfields[y];break}}}else{var field=null;for(var y=0;y<currentCardFmt.allfields.length;y++){if(myNode.tb=="feature"&&myNode.kind=="group"&&myNode.display_val==currentCardFmt.allfields[y].group.display_val&&myNode.group_id==currentCardFmt.allfields[y].group.group_id){field=currentCardFmt.allfields[y];break}else{if(myNode.tb=="feature"&&myNode.f=="group_id"&&myNode.d==(currentCardFmt.allfields[y].group.display_val+": "+currentCardFmt.allfields[y].display_val)){field=currentCardFmt.allfields[y];break}else{if(currentCardFmt.allfields[y].table_name==myNode.tb&&currentCardFmt.allfields[y].field_id==myNode.f&&currentCardFmt.allfields[y].display_val==myNode.d){field=currentCardFmt.allfields[y];break}else{if((myNode.tb=="agency"||myNode.tb=="agent"||myNode.tb=="company")&&myNode.tb==currentCardFmt.allfields[y].table_name){field=currentCardFmt.allfields[y];break}}}}}}if(field){if(document.getElementById("enabled_"+myNode.unique_id)&&!document.getElementById("enabled_"+myNode.unique_id).checked){myNode.r="Q"}var yesNos=new Array();if(myNode.kind=="group"){var qs=new Array();var tbl=document.getElementById(myNode.unique_id+"_body_table");for(var y=0;y<tbl.rows.length;y++){for(var z=0;z<tbl.rows[y].childNodes.length;z++){var thisNode=tbl.rows[y].childNodes[z];if(thisNode.unique_id){for(var j=0;j<currentCardFmt.allfields.length;j++){if(thisNode.d==(currentCardFmt.allfields[j].group.display_val+": "+currentCardFmt.allfields[j].display_val)){thisNode.onOff=document.getElementById("check_"+thisNode.unique_id).checked?"on":"off";thisNode.tech_id=currentCardFmt.allfields[j].tech_id;yesNos.push(thisNode);break}}}}}}var forceShow=false;if(srch.doShowField(myNode)&&(srch_source=="quicksearch"||srch_source=="new_quicksearch"||srch_source=="editmapsearch")&&(document.getElementById(myNode.unique_id+"_body")&&document.getElementById(myNode.unique_id+"_body").style.display!="none")){forceShow=true}myNode.innerHTML=srch.render(myNode,myNode.c,myNode.r,field.tech_id);if(forceShow){document.getElementById(myNode.unique_id+"_body").style.display="block"}if(myNode.kind=="group"){for(var j=0;j<yesNos.length;j++){srch.type.group.append(myNode,yesNos[j].c,yesNos[j].r,yesNos[j].tech_id,yesNos[j].onOff)}}myNode.cannotEnable=false;myNode.disabled=false}else{if(myNode.kind=="block"){}else{if(!interfaceObj.idx){changeSearchText(myNode.d,"","","remove");list.removeChild(myNode);x--}else{if(interfaceObj.idx){if(myNode.kind!="member"){disableNode(myNode);myNode.cannotEnable=true;disabled_nodes.push(myNode)}}}}}}if(document.getElementById("fieldPicker").style.display!="none"){draw_default()}if(interfaceObj.idx&&disabled_nodes&&!noFieldCheck){for(var x=0;x<disabled_nodes.length;x++){disabled_nodes[x].parentNode.removeChild(disabled_nodes[x]);list.insertBefore(disabled_nodes[x],getLastCustomNode())}}field_id_list=new Array();if(js_ma_tech_id!="20010602000846355519000000"){if(ma_search_list.split(",").length==1){scrollfl_ma_tech_id=ma_search_list;_AP_Reload(scrollfl_ma_tech_id,card_fmt_list)}}else{setTimeout("scrollfl_update_finish()",100)}if(interfaceObj.can_search&&document.getElementById("findfield")&&document.getElementById("findfield").value.trim()!=""&&fieldPicker&&fieldPicker.style.display!="none"){fieldPicker_matchFields(null,document.getElementById("findfield"),true)}if(!interfaceObj.idx&&(srch_source=="quicksearch"||srch_source=="new_quicksearch"||srch_source=="editmapsearch")){showFirstField()}}function showFirstField(){var list=document.getElementById("searchList");for(var y=0;y<list.childNodes.length;y++){if(list.childNodes[y].unique_id&&list.childNodes[y].f!="status"&&list.childNodes[y].kind!="ma_search_list"&&list.childNodes[y].kind!="card_fmt"){document.getElementById(list.childNodes[y].unique_id+"_body").style.display="block";return true}}return false}function disableNode(node){if(node.disabled){return false}if(browser_type!="IE"){node.style.opacity=0.8}node.disabled=true;var enab=document.getElementById("enabled_"+node.unique_id);if(enab){enab.onfocus="";enab.disabled=true;enab.oldChecked=enab.checked;srch.enable(node,false,true);enab.oldTitle=enab.title;enab.title="This field cannot be used with the current search parameters."}if(document.getElementById(node.unique_id+"_body").style.display!="none"){showHideBody(node)}if(document.getElementById(node.unique_id+"_desc")){var desc=document.getElementById(node.unique_id+"_desc");desc.oldTitle=desc.title;desc.title="This field cannot be used with the current search parameters.";desc.style.display="none"}if(document.getElementById(node.unique_id+"_operator")){var op=document.getElementById(node.unique_id+"_operator");op.oldInnerHTML=op.innerHTML;op.oldTitle=op.title;op.innerHTML="";op.title="This field cannot be used with the current search parameters."}if(document.getElementById(node.unique_id+"_title")){var title=document.getElementById(node.unique_id+"_title");title.oldTitle=title.title;title.title="This field cannot be used with the current search parameters."}}function enableNode(node,force){if(node.cannotEnable&&!force){return}if(browser_type!="IE"){node.style.opacity=""}node.disabled=false;var enab=document.getElementById("enabled_"+node.unique_id);if(enab&&node.kind!="card_fmt"&&node.kind!="ma_search_list"){enab.disabled=false;if(enab.oldChecked){srch.enable(node,true,true)}enab.oldChecked=false;if(enab.oldTitle){enab.title=enab.oldTitle}enab.oldTitle=false}if(document.getElementById(node.unique_id+"_desc")){var desc=document.getElementById(node.unique_id+"_desc");if(desc.oldTitle){desc.title=desc.oldTitle}else{desc.title="Click to edit"}if(!enab||enab.checked||node.kind=="card_fmt"||node.kind=="ma_search_list"){desc.style.display=""}desc.oldTitle=false}if(document.getElementById(node.unique_id+"_operator")){var op=document.getElementById(node.unique_id+"_operator");if(op.oldInnerHTML){op.innerHTML=op.oldInnerHTML}if(op.oldTitle){op.title=op.oldTitle}op.oldTitle=op.oldInnerHTML=false}if(document.getElementById(node.unique_id+"_title")){var title=document.getElementById(node.unique_id+"_title");if(title.oldTitle){title.title=title.oldTitle}title.oldTitle=false}}function enableAllNodesButMe(node,force){var searchList=document.getElementById("searchList");searchList.disableNewNodes=false;for(var x=0;x<searchList.childNodes.length;x++){if(searchList.childNodes[x]!=node&&searchList.childNodes[x].id!="listAdditionalOptions"&&searchList.childNodes[x].id!="fieldPickerNode"){enableNode(searchList.childNodes[x],force)}}}function disableAllNodesButMe(node){var searchList=document.getElementById("searchList");searchList.disableNewNodes=node.kind?node.kind:true;for(var x=0;x<searchList.childNodes.length;x++){if(searchList.childNodes[x]!=node&&searchList.childNodes[x].id!="listAdditionalOptions"&&searchList.childNodes[x].id!="fieldPickerNode"){disableNode(searchList.childNodes[x])}}}function disableAllNodesButCarts(){var searchList=document.getElementById("searchList");searchList.disableNewNodes="cart";for(var x=0;x<searchList.childNodes.length;x++){if(searchList.childNodes[x].kind&&searchList.childNodes[x].kind!="cart"&&searchList.childNodes[x].id!="listAdditionalOptions"&&searchList.childNodes[x].id!="fieldPickerNode"){disableNode(searchList.childNodes[x])}}}function enableAllNodesIfNoCarts(){var searchList=document.getElementById("searchList");for(var x=0;x<searchList.childNodes.length;x++){if(searchList.childNodes[x].kind&&searchList.childNodes[x].kind=="cart"&&searchList.childNodes[x].r=="R"&&document.getElementById("enabled_"+searchList.childNodes[x].unique_id).checked){return false}}enableAllNodesButMe(null,true)}function addTemplate(tech_id,nocfupdate){showLoad();var tech_id=tech_id.replace(/[x\']/g,"");HALT_COMPILE=true;loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch/addTemplate.html&nocfupdate="+(nocfupdate?nocfupdate:false)+"&template_tech_id="+tech_id+additional_ajax_params,false)}function changeSearch(tech_id){showLoad();loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch/changeSearch.html&search_id="+tech_id+additional_ajax_params,false)}function editingFullSearch(){return(searchmode&&tabIndex==7&&searchmode.indexOf("searchtab_fullsearch")==0)}function editingMap(){return(searchmode&&tabIndex==7&&searchmode=="searchtab_mapsearch")}function sendToMultipleAddress(){document.multaddressform.ma_search_list.value=ma_search_list;document.multaddressform.card_fmt_list.value=card_fmt_list;document.multaddressform.prop_type_list.value=prop_type_list;var div=document.getElementById("multqcountdiv");var qcount=0;var html=[];html=pushSearchParams(html,true);div.innerHTML=html.join("");document.multaddressform.submit();return false}function editSearch(noHide){idxsearchcounter++;if(interfaceObj.idx&&interfaceObj.publicside&&smilies&&keepprompting&&prtl_reg_req_srches!="N"&&idxsearchcounter>parseInt(prtl_reg_req_srches)){portallogon(null,null,"prtl_reg_req_srches","You need to be logged in to keep searching for listings");return false}if(typeof spotlight!="undefined"){spotlight.hide("idxgridlinkcart");spotlight.hide("idxsinglegridimage");spotlight.hide("idxfavmessage");spotlight.hide("idxgridsortlink")}interfaceObj.check_all=false;if(frommultaddresssearch){sendToMultipleAddress();return false}if(srmode=="cart"){srmode="results";current_grid_totallistings=results_totallistings;allwherestr=results_allwherestr;allorderby=results_allorderby;switchGridView("grid");editSearch()}else{if(lasttabran=="tab_search"){return}else{for(var x=0;x<tabArray.length;x++){document.getElementById(tabArray[x]).className="tabunsel";if(x!=0){document.getElementById(iframesArray[x-1]).style.display="none";document.getElementById(optionsArray[x-1]).style.display="none"}}document.getElementById("tab_search").className="tabsel";clickTab("no_tab",false,true);switchGridView("search");if(!searchmode||searchmode==""){if(interfaceObj.open_map_tab_on_edit){changeSearchSubTab("searchtab_mapsearch")}else{changeSearchSubTab("searchtab_quicksearch")}}else{changeSearchSubTab("previous")}tabIndex=7}}updateNoMapCount((matchesdiv&&matchesdiv.innerHTML.indexOf("&mdash;")<0&&matchesdiv.innerHTML.replace(/[^0-9]/g,"")!=""?matchesdiv.innerHTML.replace(/[^0-9]/g,""):"0"),true);if(searchgriddiv){searchgriddiv.scrollTop=0}}function renameSearchTitle(title){document.getElementById("search_header").innerHTML=title}function resize_search(height,width){resizeFieldPicker();if(search_subtabs.style.display!="none"){var nw=validSizeValue(width-miniwidth-20);iframe_no_tab.style.width=nw;options_no_tab.style.width=nw;options_no_tab.style.height=27;iframe_no_tab.style.height=validSizeValue(height-100-11);iframe_map.style.width=nw;document.getElementById("options_map").style.width=nw;document.getElementById("fullsearch_bottom").style.width=validSizeValue(width-20-(gridwidth!=1000?gridwidth:(width-21)));if(tabIndex==7&&searchmode=="searchtab_mapsearch"&&gridwidth!=1000){var mnw=validSizeValue(width-gridwidth-18-(browser_type=="IE"?2:1));iframe_map.style.width=mnw;options_no_tab.style.width=mnw}else{iframe_map.style.width=nw;options_no_tab.style.width=nw}var addlPadding;if(browser_type=="IE"){addlPadding=0}else{addlPadding=0}iframe_no_tab.style.height=validSizeValue(height-100-11-addlPadding);iframe_map.style.height=validSizeValue(height-100-11-addlPadding);document.getElementById("iframe_no_tab").style.top="30px";iframe_map.style.top="30px";searchgriddiv.style.top="30px";if(searchmode&&searchmode.indexOf("searchtab_fullsearch")>=0){var bh=25,bw=22;if(browser_type=="IE"){bh=30;bw=20;fullsearchgridframe.style.width=validSizeValue(width-20)}document.getElementById("fullsearch_bottom").style.height=bh.toString()+"px";fullsearchgridframe.style.height=validSizeValue(height-111-4-bh+(browser_type=="IE"?7:0));fullsearchgridframe.style.width=validSizeValue(width-bw);if(browser_type=="IE"&&fullsearchgridframe.contentWindow.document.getElementById("outer_fstable")){var scrollW=0;if(fullsearchgridframe.contentWindow.document.getElementById("outer_fstable").scrollHeight>fullsearchgridframe.clientHeight){scrollW=20}fullsearchgridframe.contentWindow.document.getElementById("outer_fstable").style.width=validSizeValue(width-22-scrollW)}}document.getElementById("lowertoptableright").style.width=nw;document.getElementById("lowertopright").style.width=nw;grid.style.borderRight="none";lowertopleft.style.display="none";lowertopright.style.width=validSizeValue(width-20);lowertoptableright.style.width=validSizeValue(width-20);if(browser_type=="IE"){var nomap_numcontainer=iframe_no_tab.contentWindow.document.getElementById("nomap_numcontainer");if(nomap_numcontainer&&nomap_numcontainer.clientHeight<110){nomap_numcontainer.style.height="110px"}}}else{grid.style.borderRight="1px solid #666"}}function popCalEditWrapper(callelm,inelm,frmtstr,chkelm){fadeElemInSrchWrapper(srch.get_parent(chkelm).unique_id+"_update",0,false,1,50);var cal=document.getElementById("calendar");var selectMonth=document.getElementById("selectMonth");var selectYear=document.getElementById("selectYear");if(cal.parentNode!=searchgriddiv){searchgriddiv.appendChild(cal);searchgriddiv.appendChild(selectMonth);searchgriddiv.appendChild(selectYear)}popUpCalendar(callelm,inelm,frmtstr,chkelm);if((((callelm.offsetTop+callelm.height-searchgriddiv.scrollTop)+cal.clientHeight)>searchgriddiv.clientHeight)&&((callelm.offsetTop-(cal.clientHeight+callelm.clientHeight))>searchgriddiv.scrollTop)){cal.style.top=parseInt(callelm.offsetTop)-(parseInt(cal.clientHeight)+callelm.clientHeight)}else{cal.style.top=parseInt(callelm.offsetTop)+parseInt(callelm.height)}if(parseInt(cal.offsetLeft)+parseInt(cal.offsetWidth)>parseInt(searchgriddiv.style.width)){cal.style.left=(parseInt(searchgriddiv.style.width)-parseInt(cal.offsetWidth))-25}var calspan=document.getElementById("content");if(calspan){calspan.onclick=function(){srch.type.D.change(callelm.parentNode.parentNode)}}}function renderCriteria(type,value,required,info,forceShow){if(type=="association"){return false}if(type=="ma_search_list"&&!interfaceObj.cross_mls_search){return false}var list=document.getElementById("searchList");fieldcount++;var item=document.createElement("li");item.className=(required=="Q"&&info!="card_fmt"&&info!="ma_search_list")?"itemDisabled":"item";item.unique_id=fieldcount;item.onmouseover=function(){this.className=(document.getElementById("enabled_"+this.unique_id).checked)?"itemOver":"itemDisabledOver"};item.onmouseout=function(){this.className=(document.getElementById("enabled_"+this.unique_id).checked)?"item":"itemDisabled"};if(type=="S"){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];if(field&&field.items.length==0){type="Y"}}if(type=="Y"){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];var group=field.group;var groupItem=null;for(var y=0;y<list.childNodes.length;y++){if(group.group_id==list.childNodes[y].display_id){groupItem=list.childNodes[y];break}}if(groupItem){srch.type.group.append(groupItem,value,required,info)}else{item.kind="group";item.innerHTML=srch.render(item,value,required,info);list.insertBefore(item,getLastCustomNode());if(list.disableNewNodes){disableNode(item)}srch.type.group.append(item,value,required,info)}}else{if(type=="N"&&srch_number_type=="Z"){var field_tech_id=(info.match(":"))?info.substring(0,info.indexOf(":")):info;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[field_tech_id]];if(!interfaceObj.idx&&field&&(field.field_id=="list_price"||field.field_id=="low_price"||field.field_id=="sold_price")){type="Z"}}if(type=="S"&&(js_ma_tech_id=="20020916141532502797000000"||js_ma_tech_id=="20051230194116769413000000"||js_ma_tech_id=="20060523190739851043000000")){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];if(field&&((js_ma_tech_id=="20020916141532502797000000"&&field.field_id=="owner")||field.field_id=="subdivision")){type="combo"}}item.kind=type;item.innerHTML=srch.render(item,value,required,info);if(item.kind=="cart"){list.appendChild(item);if(value){srch.type[item.kind].load();srch.enable(item,true)}}else{list.insertBefore(item,getLastCustomNode());if(list.disableNewNodes){disableNode(item)}}if(item.kind=="ma_search_list"&&interfaceObj.idx&&!interfaceObj.show_ma_search_list){item.style.display="none"}if(type=="member"){if(value!=""){loadJavaScriptDoc("querystring","mainmenu.cgi",'cmd=srv+srch/getMembers.html&finishscript=fillMemberSelect(super_list, "'+item.unique_id+'_select", "'+value+'" );srch.type["member"].change(document.getElementById("enabled_'+item.unique_id+'").parentNode.parentNode);&mode='+info.split("_")[0]+"&search="+(value==""?"true":value)+additional_ajax_params,false)}}}var bodydiv=document.getElementById(item.unique_id+"_body");if(bodydiv){if(item.kind=="mapshape"||forceShow||(srch.doShowField(item)&&!list.disableNewNodes&&(srch_source=="quicksearch"||srch_source=="new_quicksearch"||srch_source=="editmapsearch")&&!interfaceObj.idx_collapse_fields)){item.isShowing=true;bodydiv.style.display="block"}else{item.isShowing=false;bodydiv.style.display="none"}}return item}function drawCriteriaByQCount(tb,f,o,c,d,r,g){var field=null;var value=c;var operator=r;var ret_item=null;if(tb=="list"||tb=="report"||tb=="feature"){if(tb=="list"&&(f=="tech_id"||f=="list_nbr"||f=="tech_id_list")){for(var acount=0;acount<advancedSearches.length;acount++){if(advancedSearches[acount].tb=="mlsnumber"){var matech="";if(srch_source=="metlistnum"||srch_source=="keylistnum"){r="R";srch_source="listnum"}if(f=="tech_id_list"){matech=c.substr(c.indexOf("where ma_tech_id=")+17);value=c.substr(0,c.indexOf("where ma_tech_id="))}else{if(srch_source!="listnum"&&c&&c.indexOf("ma_tech_id")>=0){matech=c.substr(c.indexOf("ma_tech_id")+11,30).match(/x'[0-9]+'/)}else{if(srch_source!="listnum"&&c.match(/^x'[0-9]+'/)){var is_matech=false;for(var j=0;j<srch_mls.length;j++){if(srch_mls[j].tech_id==c){is_matech=true}}r=(is_matech?r:"R");matech=(is_matech?c:"");value=d}else{if(srch_source!="listnum"||f!="list_nbr"){value=d}}}}if(!matech&&!value&&!d){break}if(!advancedSearches[acount].value){advancedSearches[acount].value=[]}if(advancedSearches[acount].info==""){advancedSearches[acount].info=[]}if(advancedSearches[acount].f==""){advancedSearches[acount].f=[]}advancedSearches[acount].value.push({mls:matech,val:value});advancedSearches[acount].info.push({mls:matech,val:operator});advancedSearches[acount].f.push({mls:matech,val:d});if(srch_source=="listnum"){advancedSearches[acount].r="R"}else{if(advancedSearches[acount].r!="R"){advancedSearches[acount].r=r}}break}}return ret_item}else{if(srch_source=="agentagency"&&tb=="list"&&(f=="me_tech_id"||f=="co_list_agent"||f=="sell_agent_id"||f=="co_sell_agent_id")){if(f=="me_tech_id"||value.indexOf("me_tech_id")>-1){r="L"}if(f=="sell_agent_id"||value.indexOf("sell_agent_id")>-1||f=="sell_agency_id"||value.indexOf("sell_agency_id")>-1){r+="S"}if(value.indexOf("group_tech_id")>-1){tb="agency";d="Office"}else{tb="agent";d="Member";if(f=="co_list_agent"||value.indexOf("co_list_agent")>-1){r+="C"}if(f=="co_sell_agent_id"||value.indexOf("co_sell_agent_id")>-1){r+="A"}}f="or";var idlist="";if(value!=""){var firstIndex=value.indexOf("x'");var lastIndex=value.substr(firstIndex,value.length-1).indexOf(")");if(!lastIndex||lastIndex<0){lastIndex=value.length}idlist=value.substr(firstIndex,lastIndex)}value=idlist;if(currentCardFmt.allfields[currentCardFmt.allfieldsObjects[d]]){ret_item=renderCriteria("member",value,r,d+"_"+f)}return ret_item}else{var field_id=((tb=="list"||tb=="report")||r=="Q")?f:value.replace(/^[^=]*='([^']+)'.*/,"$1");var value=((tb=="list"||tb=="report")||r=="Q")?value:value.replace(/^[^=]*='([^']+)'\sand\s(.*)/,"$2");for(var x=0;x<currentCardFmt.allfields.length;x++){if(currentCardFmt.allfields[x].table_name==tb&&currentCardFmt.allfields[x].field_id==field_id){field=currentCardFmt.allfields[x];break}}}}if(interfaceObj.idx&&tb=="list"&&f=="status"){value="";if(srch_source=="quicksearch"){value=interfaceObj.active_statuses+",'P'"}else{if(c.replace(/AWC/g,"").indexOf("A")>=0){value="'A'"}if(c.indexOf("AWC_")>=0){var tmp_c=c.split(",");for(var x=0;x<tmp_c.length;x++){if(tmp_c[x].indexOf("AWC_")>=0){value+=(value!=""?",":"")+tmp_c[x]}}}if(interfaceObj.pending_on_idx=="Y"&&c.indexOf("P")>=0){value=(value==""?"'P'":value+",'P'")}if(interfaceObj.closed_on_idx=="Y"&&c.indexOf("C")>=0){value=(value==""?"'C'":value+",'C'")}}}if(field){var list=document.getElementById("searchList");var field2=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[field.tech_id]];if(field2){for(var y=0;y<list.childNodes.length;y++){if(list.childNodes[y].display_id==field.tech_id){if(r=="Q"){list.insertBefore(list.childNodes[y],getLastCustomNode())}return list.childNodes[y]}}}var tmp_info=(field.type=="combo"||o.trim()=="in ranges of")?field.tech_id+":"+o:field.tech_id;ret_item=renderCriteria(field.type,value,operator,tmp_info)}}else{if(tb=="range"||tb=="block"){var list=document.getElementById("searchList");for(var y=0;y<list.childNodes.length;y++){if(list.childNodes[y].kind=="block"){return list.childNodes[y]}}if(tb=="block"){value=o+"||"+c+"||"+f}else{value=f+"||"+o}ret_item=renderCriteria("block",value,"",tb)}else{if(tb=="room"){ret_item=renderCriteria(tb,value,operator,d)}else{if(tb=="agency"||tb=="agent"||tb=="company"){if(d==""&&tb=="company"){d="Company"}if(!value||value==""){var list=document.getElementById("searchList");for(var y=0;y<list.childNodes.length;y++){if(list.childNodes[y].tb==tb){return list.childNodes[y]}}}if(currentCardFmt.allfields[currentCardFmt.allfieldsObjects[d]]){ret_item=renderCriteria("member",value,operator,d+"_"+f)}return ret_item}else{if(tb=="general"){}else{if(tb=="mapshape"){var addShapeItem=doShapesExist();if(addShapeItem!=null){srch.type.mapshape.add_shape_before_map_loaded(addShapeItem,f,value,d)}else{value+=";"+o;ret_item=renderCriteria(tb,value,operator,f+"|"+d)}}else{var isAdvanced=false;if(tb=="cart"&&interfaceObj.idx){return ret_item}for(var acount=0;acount<advancedSearches.length;acount++){if(advancedSearches[acount].tb==tb){if(tb=="cart"&&advancedSearches[acount].value){break}advancedSearches[acount].value=value;isAdvanced=true;break}}if(isAdvanced){return ret_item}else{if(tb=="supplement"||tb=="anybedroomonmain"){field={type:"Y",tech_id:f};ret_item=renderCriteria(field.type,value,operator,field.tech_id)}else{ret_item=renderCriteria(tb,value,operator)}}}}}}}}return ret_item}function customSlideup(elem,speed,callback){if(browser_type=="IE"){$(elem).animate({opacity:"hide"},speed,callback)}else{$(elem).slideUp(speed,callback)}}function removeCriteria(node){changeSearchText(node.d,"","","remove");customSlideup(node,"slow",function(){$(this).remove()});srch.update();return}function criteriaFade(opacity){if(!currentlyFading){return}if(!currentlyFading.startTime||currentlyFading.startTime==""){currentlyFading.startTime=new Date()}else{var now=new Date();if((now.getTime()-currentlyFading.startTime.getTime())>200){opacity=0;fader.fail_fade()}else{currentlyFading.startTime=new Date()}}if(opacity<=0){var wasSearch=(currentlyFading.kind=="search")?true:false;var display_id=currentlyFading.display_id;var tabIndex=null;currentlyFading.parentNode.removeChild(currentlyFading);currentlyFading=null;srch.update();return}if(browser_type=="IE"){currentlyFading.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity="+(parseFloat(opacity)*100)+")"}else{currentlyFading.style.opacity=opacity}opacity=opacity-0.1;setTimeout("criteriaFade("+opacity+");",10)}function resetAdvancedCriteria(){for(var acount=0;acount<advancedSearches.length;acount++){advancedSearches[acount].value=false}}function renderAdvancedCriteria(){if(advancedCriteriaDrawn){return}var cart_mode=false;for(var acount=0;acount<advancedSearches.length;acount++){if(interfaceObj.idx&&(advancedSearches[acount].name=="Listing Cart"||advancedSearches[acount].name=="Tour of Home")){continue}else{if(!document.getElementById("adv_"+advancedSearches[acount].tb)){continue}}var item=document.getElementById("adv_"+advancedSearches[acount].tb);item.unique_id="adv_"+advancedSearches[acount].tb;item.kind=advancedSearches[acount].type;if(!advancedSearches[acount].value){var onOff="off";if(advancedSearches[acount].name=="Open House"||advancedSearches[acount].name=="Tour of Home"){advancedSearches[acount].value="7"}}else{var onOff="on";item.value=advancedSearches[acount].value}if(item.kind=="Y"){item.kind="group";item.innerHTML=srch.render(item,advancedSearches[acount].value,"",advancedSearches[acount].f,onOff);srch.type.group.append(item,advancedSearches[acount].value,"R",advancedSearches[acount].f,onOff)}else{if(item.kind=="specifiedlistings"){item.innerHTML=srch.render(item,advancedSearches[acount].value,advancedSearches[acount].info,advancedSearches[acount].f,onOff);var spec_op="";for(var x=0;x<srch_mls.length;x++){var this_val=this_f="";for(var y=0;y<advancedSearches[acount].value.length;y++){if(advancedSearches[acount].value[y].mls==srch_mls[x].tech_id||(advancedSearches[acount].value[y].mls==""&&(ma_search_list.indexOf(srch_mls[x].tech_id)>=0))){this_val=(this_val==""?advancedSearches[acount].value[y].val:this_val+"||"+advancedSearches[acount].value[y].val)}if(advancedSearches[acount].f[y].mls==srch_mls[x].tech_id||(advancedSearches[acount].f[y].mls==""&&(ma_search_list.indexOf(srch_mls[x].tech_id)>=0))){this_f=(this_f==""?advancedSearches[acount].f[y].val:this_f+"||"+advancedSearches[acount].f[y].val)}}if(interfaceObj.cross_mls_search||js_ma_tech_id==rmxId(srch_mls[x].tech_id)){srch.type.specifiedlistings.append(item,this_val,"",this_f,x,onOff)}}item.r=(!advancedSearches[acount].r||advancedSearches[acount].r=="")?"R":advancedSearches[acount].r;if(document.getElementById("enabled_"+item.unique_id).checked){srch.type.specifiedlistings.operator(item,true)}document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.specifiedlistings.describe(item)}else{item.innerHTML=srch.render(item,advancedSearches[acount].value,advancedSearches[acount].info,advancedSearches[acount].f,onOff);if(advancedSearches[acount].name=="Listing Cart"&&advancedSearches[acount].value&&item.c){cart_mode=true;srch.type[item.kind].load(item)}}}if(item.kind=="idxmlsnumber"){var list=document.getElementById("searchList");item.parentNode.removeChild(item);list.insertBefore(item,list.childNodes[0])}}if(cart_mode){disableAllNodesButCarts()}advancedCriteriaDrawn=true}function getAdvancedSearchHTML(){var s=new Array();if(!interfaceObj.idx){s.push('<li id="fieldPickerNode" class="item">');s.push('<input id="findfield" style="color:#666;font-weight:bold;" onfocus="userFieldPickerInput(this);" onclick="userFieldPickerInput(this);" onkeydown="return fieldPicker_matchFields(event,this);" onblur="resetFieldPickerInput(this);" value="Add a field to the search">');s.push('&nbsp;&nbsp;<span class="movebut" style="position:relative;'+(browser_type=="IE"?"bottom:2px;":"")+'" id="fieldPicker_browsebutton" onmouseover="this.className=\'movebuthover\';" onmouseout="this.className=\'movebut\';" onclick="enhanceSearchBrowse(this);" >Browse</span>');s.push("</li>");s.push('<li id="listAdditionalOptions" onclick="toggleSearchOptions();"><span id="addlExpCol" style="font-size:12pt;">-</span> Additional Search Options</li>')}s.push('<li id="adv_picture" class="item"></li>');s.push('<li id="adv_video" class="item"></li>');s.push('<li id="adv_document" class="item"></li>');if(!interfaceObj.idx){s.push('<li id="adv_vtour" class="item"></li>')}s.push('<li id="adv_openhouse" class="item"></li>');if(!interfaceObj.idx){s.push('<li id="adv_tour" class="item"></li>');s.push('<li id="adv_mlsnumber" class="item"></li>');s.push('<li id="adv_cart" class="item"></li>')}else{s.push('<li id="adv_idxmlsnumber" class="item"></li>')}return s.join("")}function toggleSearchOptions(){searchOptionsVisible=!searchOptionsVisible;if(document.getElementById("addlExpCol")){document.getElementById("addlExpCol").innerHTML=(searchOptionsVisible?"-":"+")}var a_l=["picture","video","document","vtour","openhouse","tour","mlsnumber","cart"];for(var x=0;x<a_l.length;x++){searchOptionsVisible?$("#adv_"+a_l[x]).show("slow"):$("#adv_"+a_l[x]).hide("slow")}}function lookupMember(item){var searchString=document.getElementById(item.unique_id+"_name").value;loadJavaScriptDoc("querystring","mainmenu.cgi",'cmd=srv+srch/getMembers.html&finishscript=fillMemberSelect(super_list, "'+item.unique_id+'_select");&mode='+item.d+"&search=true&searchstring="+searchString+additional_ajax_params,false);return false}function fillMemberSelect(list,id_str,def){var html=new Array();var memsel=document.getElementById(id_str);if(!def){def=""}var curvals=new Array();if(memsel&&memsel.childNodes.length>0){for(var x=(memsel.childNodes.length-1);x>=0;x--){if(memsel.childNodes[x].selected==true){curvals.push(memsel.childNodes[x].value)}else{memsel.removeChild(memsel.childNodes[x])}}}for(var x=0;x<list.length;x++){if(list[x]&&list[x][3]){srch.type.member.team_members[list[x][0]]=list[x][3]}var found=false;for(var y=0;y<curvals.length;y++){if(curvals[y]==list[x][0]){found=true;break}}if(found){continue}var newOpt=document.createElement("option");newOpt.title=list[x][1];newOpt.value=list[x][0];newOpt.selected=def.indexOf(list[x][0])>0?true:false;newOpt.innerHTML=(list[x][1].length<21?list[x][1]:list[x][1].substr(0,20)+"...")+" ("+list[x][2]+")";memsel.appendChild(newOpt)}}function scrollfl_update_finish(){var list=document.getElementById("searchList");if(!list){return}for(var x=0;x<list.childNodes.length;x++){if(list.childNodes[x].kind=="S"&&list.childNodes[x].tb!="feature"){scrollflrelate_setup(list.childNodes[x].f,"s_"+list.childNodes[x].unique_id)}}}function scrollflrelate_setup(field_id,id){if(!document.getElementById(id)){setTimeout("scrollflrelate_setup('"+field_id+"','"+id+"');",100);return}fieldIDListAdd(field_id,id);if(srch_source!="quicksearch"&&srch_source!="new_quicksearch"&&getParentID(field_id)){scrollflrelate_checkRelated(getParentObject(field_id),false,getParentID(field_id))}}function scrollflrelate_removeNode(id){var childNodes=new Array();childNodes=find_children(id,"id");if(!childNodes){return}for(var x=0;x<childNodes.length;x++){fieldIDListRestoreOptions(childNodes[x])}scrollflrelate_checkRelatedupdateChildSelects(id);fieldIDListRemove(id,"id")}function readyScrollRelate(elem_id){srch.get_parent(document.getElementById("s_"+elem_id)).stallScrollRelate=false}function delayScrollRelate(elem){if(elem.stallScrollRelate){try{clearTimeout(elem.stallScrollRelate)}catch(e){}}elem.stallScrollRelate=setTimeout('readyScrollRelate("'+elem.unique_id+'");',500)}function scrollflrelate_checkRelated(select_control,called_from_onchange,real_id){if(select_control&&srch.get_parent(select_control).stallScrollRelate){setTimeout('scrollflrelate_checkRelated(document.getElementById("s_'+srch.get_parent(select_control).unique_id+'"),"'+(called_from_onchange?called_from_onchange:false)+'","'+(real_id?real_id:false)+'")',100);return true}check_related(select_control,called_from_onchange,real_id);scrollflrelate_checkRelatedupdateChildSelects(real_id)}function scrollflrelate_checkRelatedupdateChildSelects(real_id){var childFields=new Array();childFields=find_children(real_id,"id");if(!childFields){return}for(var x=0;x<childFields.length;x++){if(document.getElementById(childFields[x])){srch.type.S.change(document.getElementById(childFields[x]).parentNode.parentNode,document.getElementById(childFields[x]),true)}}}function searchHideLeftSide(){var miniSearch=document.getElementById("miniSearch");var searchStarter=document.getElementById("searchStarter");var visible=(document.getElementById("searchOptionsHide").style.display=="none")?true:false;if(visible){miniSearch.style.display="none";searchStarter.style.display="";document.getElementById("searchOptionsHide").style.display=""}else{miniSearch.style.display="";searchStarter.style.display="none";document.getElementById("searchOptionsHide").style.display="none"}resize_search()}function showHideBody(item,index,forceShow){if(item.disabled){if(document.getElementById(item.unique_id+"_body")){document.getElementById(item.unique_id+"_body").style.display="none"}return}if(!index){index=0}var display_id=item.display_id;var body=document.getElementById(item.unique_id+"_body");if(!body){return}var display;if(body.style.display=="block"&&!forceShow){display="none";item.isShowing=false}else{display="block";item.isShowing=true}if(arguments.length==2){if(item.kind!="specifiedlistings"&&arguments[1]!=display&&arguments[1]!=1&&arguments[1]!=2&&arguments[1]!=3&&arguments[1]!=4){return}}var cback=function(){if(display=="block"){var textelements=body.getElementsByTagName("input");var selectelements=body.getElementsByTagName("select");if(textelements.length>index){textelements[index].select();textelements[index].focus()}else{if(selectelements.length>index){selectelements[index].focus()}}}};if(display=="none"){customSlideup(body,"slow",cback)}else{$(body).slideDown("slow",cback)}}function searchShowHideAll(showHide){var list=document.getElementById("search_"+searchTabs[currentSearchTab].id);for(var x=0;x<list.childNodes.length;x++){showHideBody(list.childNodes[x],showHide)}}function searchClearAll(){var l=document.getElementById("inputform");var e=l.elements;enableAllNodesButMe(null);clearSrchUpdateLinks();for(var x=0;x<e.length;x++){if(e[x].id=="findfield"){continue}var t=srch.get_parent(e[x]);if(e[x].type=="checkbox"){e[x].checked=false}else{if(e[x].type=="text"){if(t.kind=="Z"){if(e[x].id.indexOf("_zeroes_">=0)){e[x].value="000"}else{if(e[x].id.indexOf("from_")>=0){e[x].value="0"}else{if(e[x].id.indexOf("to_")>=0){e[x].value=t.param_max.substr(0,t.param_max.length-3)}}}}else{if(t.kind=="N"||t.kind=="I"){if(e[x].id.indexOf("from_")>=0){e[x].value=t.param_min}else{if(e[x].id.indexOf("to_")>=0){e[x].value=t.param_max}}}else{if(t.kind=="D"){if(t.g=="relative"){e[x].value="7"}else{if(e[x].id.indexOf("from_")>=0){e[x].value=t.min}else{if(e[x].id.indexOf("to_")>=0){e[x].value=t.max}}}}else{e[x].value=""}}}}else{if((e[x].type=="select-one"||e[x].type=="select-multiple")&&t.kind!="ma_search_list"&&t.kind!="card_fmt"){for(var y=0;y<e[x].options.length;y++){e[x].options[y].selected=false}}}}if(t&&t.kind){if(t.kind=="ma_search_list"){srch.type[t.kind].describe(t.c,t)}else{if(t.kind=="mapshape"){while(t.shapes.length>0){srch.type[t.kind].remove_shape(t,0)}}else{if(t.kind=="card_fmt"){srch.type[t.kind].describe(t,t.c)}}}if(typeof e[x].onchange=="function"&&t.kind!="cart"&&t.kind!="ma_search_list"&&t.kind!="card_fmt"){if(t.kind=="member"){t.innerHTML=srch.type[t.kind].render(t,"",t.r,t.d)}if(typeof e[x].onchange=="function"){e[x].onchange()}srch.enable(t,false);if(t.kind=="Z"||t.kind=="N"||t.kind=="I"){srch.set_grayed_fields(t,"from_"+t.unique_id,"to_"+t.unique_id)}}}}}function saveQSChangeType(type){if(type=="replace"){document.getElementById("modal_replace_ptype").style.display="";document.getElementById("modal_replace_view").style.display="";document.getElementById("modal_repl_qs").style.display="";document.getElementById("modal_groups_warning_row").style.display="";document.getElementById("modal_new_view").style.display="none";document.getElementById("modal_new_ptype").style.display="none";modalQSCheckReplace(document.getElementById("modal_qs_sel").value)}else{if(type=="new"){document.getElementById("modal_replace_ptype").style.display="none";document.getElementById("modal_replace_view").style.display="none";document.getElementById("modal_repl_qs").style.display="none";document.getElementById("modal_groups_warning_row").style.display="none";document.getElementById("modal_new_view").style.display="";document.getElementById("modal_new_ptype").style.display="";document.getElementById("modal_qs_name").value=""}}}function modalSaveQuickSearch(){var errors=false;document.getElementById("modal_qs_name").className="";document.getElementById("modal_qs_sel").className="";document.getElementById("modal_qs_view").className="";var mode=(document.getElementById("modal_qs_existing")&&document.getElementById("modal_qs_existing").checked)?"edit":"new";var name=document.getElementById("modal_qs_name").value;var view="";var card_fmt="";if(mode=="edit"){if(document.getElementById("modal_qs_update_view").checked){view=rmxId(document.getElementById("new_sd_tech_id").value)}}else{view=rmxId(document.getElementById("modal_qs_view").value);if(!view){document.getElementById("modal_qs_view").className="badinput";errors=true}}var replace="";if(mode=="edit"){replace=document.getElementById("modal_qs_sel").value;if(!replace){document.getElementById("modal_qs_sel").className="badinput";errors=true}}if(!name&&mode!="edit"){document.getElementById("modal_qs_name").className="badinput";errors=true}if(errors){alert("You have left at least one required field blank.  Required fields are outlined in red, and must be completed before saving.");return false}document.saveqsform.name.value=name;document.saveqsform.mode.value=mode;document.saveqsform.repl.value=replace;var div=[];var field_count=0;var l=document.getElementById("searchList");for(var x=0;x<l.childNodes.length;x++){if(isLastCustomNode(l.childNodes[x])){break}else{if(!l.childNodes[x].kind||!l.childNodes[x].display_id){continue}}var d_id=rmxId(l.childNodes[x].display_id);if(l.childNodes[x].kind=="group"){var c=l.childNodes[x].getElementsByTagName("td");for(var y=0;y<c.length;y++){if(!c[y].display_id){continue}d_id=rmxId(c[y].display_id);field_count++;div.push("<input type='hidden' name='qs_field_"+field_count+"' value='"+d_id+"'>")}}else{field_count++;div.push("<input type='hidden' name='qs_field_"+field_count+"' value='"+d_id+"'>")}}div.push("<input type='hidden' name='field_count' value='"+field_count+"'>");if(view){div.push("<input type='hidden' name='view' value='"+view+"'>")}card_fmt=getPropertyTypeAbbrs();div.push("<input type='hidden' name='card_fmt_list' value='"+card_fmt.replace(/\'/g,"")+"'>");if(!field_count){alert("You must first select search criteria before saving a Quick Search!");return false}document.getElementById("saveqsform_inputs").innerHTML=div.join("");showModalLoading("Saving...");loadJavaScriptDoc("form","mainmenu.cgi","saveqsform",true)}function modalSaveQuickSearchFinished(id){showModalFinalMessage("Your Quick Search has been successfully saved.",true);if(parent&&parent.idx_interface){setTimeout("parent.idx_interface.returnFromEditing('srch_template_id','"+id.quote("js")+"');")}else{getQuickSearches()}}function modalQSCheckReplace(str){str+="";var name="";var warnstr="";if(str){var g=quick_search_object[str];if(g){name=g.name;if(parseInt(g.groups,10)>0){warnstr="Quick Search '"+name+"' has groups defined!<BR>These groups will be lost upon saving."}}}document.getElementById("modal_qs_name").value=name;document.getElementById("modal_groups_warning").innerHTML=warnstr}function saveQuickSearch(){closeAllDropDowns();if(ma_search_list.indexOf(rmxId(js_ma_tech_id))<0){alert("You can only save a quick search when searching your own MLS.");return false}else{if(!card_fmt_list&&!prop_type_list){alert("Please select at least one property type before saving a quick search.");return false}}var qs=document.getElementById("quick_srches");if(qs.options.length==0){showLoad();loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch/getQuickSearches.html&from_save=true&select_box_id=quick_srches"+additional_ajax_params,false);return false}var html=[];var ptypes="";var cfmt=getPropertyTypeAbbrs();for(var x=0;x<srch_mls.length;x++){if(js_ma_tech_id.match(rmxId(srch_mls[x].tech_id))){var cl="";cl=cfmt.split(",");var y=0;for(;y<cl.length;y++){ptypes+=((y!=0?", ":"")+getCardFmtDesc(js_ma_tech_id,cl[y]))}break}}var can_edit=false;for(var item in quick_search_object){if(!quick_search_object[item].from_inherit){can_edit=true;break}}var can_edit_current_template=(can_edit&&template_id&&quick_search_object[template_id.replace(/[^0-9]/g,"")]&&!quick_search_object[template_id.replace(/[^0-9]/g,"")].from_inherit);var view_name="";var view_id="";html.push("<div class='modaldivheader'>");html.push("<input type='radio' name='modal_qs_type' id='modal_qs_new' value='new' onclick='saveQSChangeType(\"new\");' "+(can_edit_current_template?"":"checked")+">&nbsp;<label for='modal_qs_new'>New Template</label> &nbsp; ");if(can_edit){html.push("<input type='radio' name='modal_qs_type' id='modal_qs_existing' onclick='saveQSChangeType(\"replace\");' value='existing' "+(can_edit_current_template?"checked":"")+">&nbsp;<label for='modal_qs_existing'>Replace Existing Template</label>")}html.push("</div>");html.push("<table style='width:100%;' cellspadding=4px cellspacing=4px>");html.push("<tr id='modal_repl_qs' "+(can_edit_current_template?"":"style='display:none;' ")+">");html.push("<td class='modaltdlabel'>Replace: </td>");html.push("<td>");html.push("<select id='modal_qs_sel' size=4  style='width:100%;' onchange='modalQSCheckReplace(this.value);' >");for(var x=0;x<qs.options.length;x++){var qs_id=qs.options[x].value.replace(/[^0-9]/g,"");if(quick_search_object[qs_id].from_inherit){continue}html.push("<option value='"+qs_id+"' "+(qs.options[x].value.indexOf(rmxId(template_id))>=0?"selected":"")+">"+qs.options[x].innerHTML+"</option>")}html.push("</select>");html.push("</td></tr>");html.push("<tr id='modal_groups_warning_row' style='display:none;'>");html.push("<td>&nbsp;</td><td id='modal_groups_warning'></td>");html.push("</tr>");html.push("<tr>");html.push("<td class='modaltdlabel' style='vertical-align:middle;'>Name: </td><td><input type='text' id='modal_qs_name' value='' style='width:100%;' maxlength='40'></td>");html.push("</tr>");html.push("<tr id='modal_new_view' "+(can_edit_current_template?"style='display:none;' ":"")+">");html.push("<td class='modaltdlabel'>View: </td>");html.push("<td>");var v=document.getElementById("new_sd_tech_id");html.push("<select id='modal_qs_view' size=4  style='width:100%;' >");for(var x=0;x<v.options.length;x++){if(v.options[x].selected){view_name=v.options[x].innerHTML;view_id=v.options[x].value}html.push("<option value='"+rmxId(v.options[x].value)+"' "+(v.options[x].selected?"selected":"")+">"+v.options[x].innerHTML+"</option>")}html.push("</select>");html.push("</td></tr>");html.push("<tr id='modal_new_ptype' "+(can_edit_current_template?"style='display:none;' ":"")+">");html.push("<td class='modaltdlabel'>Property Types: </td>");html.push("<td>"+ptypes);if(prop_type_list&&!card_fmt_list){html.push("<br><i>When multiple MLSes are selected, additional property types may appear.</i>")}html.push("</td>");html.push("</tr>");html.push("<tr id='modal_replace_ptype' "+(can_edit_current_template?"":"style='display:none;' ")+">");html.push("<td class='modaltdlabel'>&nbsp;</td>");html.push("<td class='modaltdllabel'><label for='modal_qs_update_ptype'>Property Types will change to '"+ptypes+"'</label></td>");html.push("</tr>");html.push("<tr id='modal_replace_view'  "+(can_edit_current_template?"":"style='display:none;' ")+" >");html.push("<td class='modaltdlabel'><input type='checkbox' id='modal_qs_update_view' value='"+view_id+"'> </td>");html.push("<td class='modaltdllabel'><label for='modal_qs_update_view'>Update view to '"+view_name+"'</label></td>");html.push("</tr>");html.push("</table>");var footer="<a href='javascript:void(0);' onclick='modalSaveQuickSearch();'><img src='/images/save_16."+img_ext+"' height=14px>Save</a> &nbsp; ";footer+="<a href='javascript:void(0);' onclick='closeModalDia();'><img src='/images/cancl_16."+img_ext+"' height=14px>Close</a>";showModalDia("Save Quick Search",html.join(""),footer)}function showModalDia(title,innerHTML,footer){var mm=document.getElementById("modalmask");document.getElementById("modalshim").style.display="block";mm.style.display="block";var html=[];html.push('<div class="modaldelbutton" id="modaldelbutton" onclick="closeModalDia();" title="Close">X</div><div class="modaltitle">'+title+"</div>");html.push('<div class="modalbody" id="modalbody">');html.push(innerHTML);html.push("</div>");html.push('<div class="modalfooter" id="modalfooter" style="padding-top:'+(browser_type=="IE"?"14":"11")+'px;">');html.push(footer);html.push("</div>");var mc=document.getElementById("modalcontent");mc.innerHTML=html.join("");resizeModalDia()}function showModalLoading(msg){if(!msg){msg="Loading..."}document.getElementById("modaldelbutton").style.display="none";document.getElementById("modalfooter").innerHTML="";document.getElementById("modalbody").innerHTML="<div class='modalloading'><img src='/images/srch_rs/loading.gif'> "+msg+"</div>"}function showModalFinalMessage(msg,good){msg+="";var color="green";if(!good){color="red"}document.getElementById("modaldelbutton").style.display="none";document.getElementById("modalfooter").innerHTML="<a href='javascript:void(0);' onclick='closeModalDia();'>Close</a>";document.getElementById("modalbody").innerHTML="<div class='modalloading' style='color:"+color+";'>"+msg+"</div>"}function closeModalDia(){document.getElementById("modalcontent").innerHTML="";document.getElementById("modalmask").style.display="none";document.getElementById("modalshim").style.display="none"}function closeAllDropDowns(ignore){if(ignore!="quicksearch"){closeNewQuickSearch()}if(ignore!="params"){hideSearchParameters()}if(ignore!="search"){showMoreSearchMenu("hide")}if(ignore!="share"){hideSharePanel()}}function newQuickSearch(){if(searchmode.indexOf("searchtab_fullsearch")>=0){return}else{if(new_quicksearch.style.display!="none"){closeNewQuickSearch();return}}new_quicksearch.style.display="";var nsize=0;for(var x=0;x<new_quicksearch.childNodes.length;x++){if(new_quicksearch.childNodes[x].className=="buttons"){nsize=new_quicksearch.childNodes[x].offsetTop+new_quicksearch.childNodes[x].clientHeight+(browser_type=="IE"?30:5);break}}if(nsize>new_quicksearch.clientHeight){new_quicksearch.style.height=nsize+"px"}var select_box=document.getElementById("quick_srches");if(select_box.options.length==0){showLoad();getQuickSearches()}}function getQuickSearches(){var select_box=document.getElementById("quick_srches");while(select_box.options.length>0){select_box.removeChild(select_box.options[0])}loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch/getQuickSearches.html&select_box_id=quick_srches"+additional_ajax_params,false)}function closeNewQuickSearch(){singlegriddiv_blackout.style.display="none";new_quicksearch.style.display="none"}function loadNewQuickSearch(template_index){var select_box=document.getElementById("quick_srches");template_info=select_box.options[template_index].value;template_name=select_box.options[template_index].text;var template_vars=template_info.split("|");var cf_update=(template_vars[1].split(",")[0]==card_fmt_list)?false:true;search.length=0;template_id=template_vars[0];card_fmt_list=template_vars[1].split(",")[0];limit_card_fmt_list=template_vars[1];ma_search_list="x'"+js_ma_tech_id+"'";prop_type_list="";srch_source="new_quicksearch";var list=document.getElementById("searchList");for(var x=0;x<list.childNodes.length;x++){var myNode=list.childNodes[x];if(isLastCustomNode(myNode)){break}if(myNode.tb=="mapshape"){global_shape_item_to_preserve=myNode}list.removeChild(myNode);x--}addTemplate(template_id,!cf_update);if(prospect_tech_id_4_messages_name){template_name+=" <i>for "+prospect_tech_id_4_messages_name+"</i>"}document.getElementById("resultsheader").innerHTML=template_name;closeNewQuickSearch();srch.update()}function enhanceSearchBrowse(elem){if(fieldPicker.style.display=="none"){enhanceExposeSearch();elem.innerHTML="Done"}else{elem.innerHTML="Browse";document.getElementById("findfield").value="";resetFieldPickerInput(document.getElementById("findfield"))}}function enhanceExposeSearch(menuSelection){if(fieldPicker.style.display=="none"){exposeFieldPicker()}if(!all_fields_retrieved){all_fields_retrieved="expose_fp";showLoad();getSearchFields(card_fmt_list,prop_type_list,ma_search_list,null,null,true);return false}else{if(all_fields_retrieved=="expose_fp"){return false}}draw_default();if(menuSelection&&menuSelection!=""){fieldPicker_matchFields(false,menuSelection)}}function exposeFieldPicker(){var shim=(browser_type=="IE"?document.getElementById("fieldPickerShim"):"");if(shim){shim.style.display=""}fieldPicker.style.display="";resizeFieldPicker();if(shim){$(shim).hide()}$(fieldPicker).hide();if(shim){$(shim).animate({opacity:"show"},"slow")}$(fieldPicker).animate({opacity:"show"},"slow");fieldPicker.onmouseover=function(){fieldPicker.hasMouse=true};fieldPicker.onmouseout=function(){fieldPicker.hasMouse=false}}function hideFieldPicker(){if(interfaceObj.idx){return}document.getElementById("fieldPicker_browsebutton").innerHTML="Browse";document.getElementById("fieldPickerShim").style.display="none";if($(fieldPicker).is(":visible")){$(fieldPicker).animate({opacity:"hide"},"slow")}}function resizeFieldPicker(){if(fieldPicker.style.display=="none"){return false}var newHeight=bottomsection.style.height.replace(/px/,"");var optionsHeight=parseInt(options_summary.style.height.replace(/px/,""));var itemHeight=document.getElementById("searchList").childNodes[0].style.height.replace(/px/,"");var height=getWindowHeight();var width=getWindowWidth();fieldPicker.style.height=validSizeValue(newHeight-12);fieldPicker_list.style.height=validSizeValue((newHeight-12)-40)+"px";fieldPicker.style.width=validSizeValue(width-miniwidth-20);fieldPicker.style.left=searchgriddiv.clientWidth+11+(searchgriddiv.scrollHeight>searchgriddiv.clientHeight?16:0);document.getElementById("fieldPickerShim").style.left=searchgriddiv.clientWidth+12+(searchgriddiv.scrollHeight>searchgriddiv.clientHeight?16:0)}function draw_default(){if(fieldPicker.style.display=="none"){return}fieldPicker_showAllFields(document.getElementById("fieldPicker_list"));fieldPicker_selectFirst()}function fieldPicker_forceReset(elem){elem.value="";resetFieldPickerInput(elem)}function resetFieldPickerInput(elem,force){if((elem.value==""&&!fieldPicker.hasMouse)||force){elem.userValue=false;elem.value="Add a field to the search";elem.style.color="#666";elem.style.fontWeight="bold";document.getElementById("fieldPicker_browsebutton").innerHTML="Browse";hideFieldPicker()}}function userFieldPickerInput(elem){if(!elem.userValue){elem.userValue=true;elem.value="";elem.style.color="black";elem.style.fontWeight="normal"}else{elem.select()}elem.focus();document.getElementById("fieldPicker_browsebutton").innerHTML="Done";enhanceExposeSearch(elem.value)}function searchCriteriaRendered(type,display_id,room_addlparam){var list=document.getElementById("searchList");var already_exists=false;for(var y=0;y<list.childNodes.length;y++){var t_item=list.childNodes[y];if(type=="room"){if(t_item.kind=="room"){var id=t_item.c.split(",")[0];if(id==room_addlparam){already_exists=t_item;break}}}else{if((type=="block"&&t_item.kind=="block")||(type!="block"&&t_item.display_id==display_id)){already_exists=t_item;break}else{if(display_id&&type=="Y"&&t_item.fields&&t_item.fields.length){for(var z=0;z<t_item.fields.length;z++){if(t_item.fields[z]==display_id){already_exists=t_item;break}}}}}}return already_exists}function fieldPicker_showAllFields(attachTo){function sortByGroupName(a,b){var first=a.group.toUpperCase();var second=b.group.toUpperCase();return((first>second)?1:((second>first)?-1:0))}function sortByDisplayVal(a,b){var first=a.display_val.toUpperCase();var second=b.display_val.toUpperCase();return((first>second)?1:((second>first)?-1:0))}var showList=new Array();attachTo.innerHTML="";for(var x=0;x<currentCardFmt.groups.length;x++){var show_mem=show_off=false;for(var y=0;y<currentCardFmt.groups[x].fields.length;y++){if(currentCardFmt.groups[x].fields[y].field_picker&&currentCardFmt.groups[x].fields[y].field_picker=="no"){if(currentCardFmt.groups[x].fields[y].tech_id=="Member"){show_mem=true}if(currentCardFmt.groups[x].fields[y].tech_id=="Office"){show_off=true}continue}var addLoc;for(var addLoc=0;addLoc<showList.length;addLoc++){if(showList[addLoc].group==currentCardFmt.groups[x].display_val){break}}if(showList.length==addLoc){showList[showList.length]=new Object();showList[showList.length-1].group=currentCardFmt.groups[x].display_val;if(currentCardFmt.groups[x].fields[y].table_name=="feature"){showList[showList.length-1].group_id=currentCardFmt.groups[x].group_id}showList[showList.length-1].fields=new Array();addLoc=showList.length-1}showList[addLoc].fields.push({type:currentCardFmt.groups[x].fields[y].type,tech_id:currentCardFmt.groups[x].fields[y].tech_id,display_val:currentCardFmt.groups[x].fields[y].display_val})}}if(show_mem||show_off){showList[showList.length]=new Array();showList[showList.length-1].group="Listing/Selling Member";showList[showList.length-1].fields=new Array();if(show_mem){showList[showList.length-1].fields.push({type:"member",tech_id:"Member",display_val:"Listing/Selling Member"})}if(show_off){showList[showList.length-1].fields.push({type:"member",tech_id:"Office",display_val:"Listing/Selling Office"});showList[showList.length-1].fields.push({type:"member",tech_id:"Company",display_val:"Listing/Selling Company"})}}showList.sort(sortByGroupName);for(var x=0;x<showList.length;x++){var table=document.createElement("table");table.width="100%";var tbody=document.createElement("tbody");var tr=document.createElement("tr");var th=document.createElement("th");th.colSpan="2";if(showList[x].group_id){th.className="fieldpicker_th_action";th.group_id=showList[x].group_id;th.onmousedown=function(){addFieldPickerSearch("fieldpicker_group",this.group_id)};th.title="Click to add all fields in this group"}else{th.className="fieldpicker_th"}th.appendChild(document.createTextNode(showList[x].group));tr.appendChild(th);tbody.appendChild(tr);var y=0;var td=null;showList[x].fields.sort(sortByDisplayVal);for(;y<showList[x].fields.length;y++){td=document.createElement("td");td.width="50%";td.field_type=showList[x].fields[y].type;td.display_id=showList[x].fields[y].tech_id;td.groupName=showList[x].group;td.onmousedown=function(){addFieldPickerSearch(this.field_type,this.display_id)};td.onmouseover=function(){this.style.backgroundColor="#E0E0E0"};td.onmouseout=function(){this.style.backgroundColor="#f6f6f6"};td.innerHTML=showList[x].fields[y].display_val;if((y%2)==0){tr=document.createElement("tr");tr.appendChild(td)}else{tr.appendChild(td);tbody.appendChild(tr)}}if((y%2)!=0){td=document.createElement("td");tr.appendChild(td);tbody.appendChild(tr)}table.appendChild(tbody);attachTo.appendChild(table)}if(js_ma_tech_id=="20010602000846355519000000"){var table=document.createElement("table");table.width="100%";var tbody=document.createElement("tbody");var tr=document.createElement("tr");var th=document.createElement("th");th.colSpan="2";th.className="fieldpicker_th";th.appendChild(document.createTextNode("Range"));tr.appendChild(th);tbody.appendChild(tr);tr=document.createElement("tr");td=document.createElement("td");td.width="50%";td.onmousedown=function(){addFieldPickerSearch("block")};td.onmouseover=function(){this.style.backgroundColor="#E0E0E0"};td.onmouseout=function(){this.style.backgroundColor="#f6f6f6"};td.innerHTML="Block and Range Search";tr.appendChild(td);td=document.createElement("td");tr.appendChild(td);tbody.appendChild(tr);table.appendChild(tbody);attachTo.appendChild(table);if(card_fmt_list.indexOf(",")==-1&&(card_fmt_list=="'A'"||card_fmt_list=="'B'"||card_fmt_list=="'F'")&&metro_rooms&&metro_rooms[card_fmt_list.replace(/'/g,"")]){var cIndex=card_fmt_list.replace(/'/g,"");var table=document.createElement("table");table.width="100%";var tbody=document.createElement("tbody");var tr=document.createElement("tr");var th=document.createElement("th");th.colSpan="2";th.className="fieldpicker_th";th.appendChild(document.createTextNode("Rooms"));tr.appendChild(th);tbody.appendChild(tr);for(var x=0;x<metro_rooms[cIndex].length;x++){if(x%2==0){tr=document.createElement("tr")}td=document.createElement("td");td.width="50%";td.desc=metro_rooms[cIndex][x].desc;td.room_id=metro_rooms[cIndex][x].tech_id;td.onmousedown=function(){addFieldPickerSearch("room",this.desc,this.room_id)};td.onmouseover=function(){this.style.backgroundColor="#E0E0E0"};td.onmouseout=function(){this.style.backgroundColor="#f6f6f6"};td.innerHTML=metro_rooms[cIndex][x].desc;tr.appendChild(td);if(x%2!=0){tbody.appendChild(tr)}}table.appendChild(tbody);attachTo.appendChild(table)}}var table=document.createElement("table");table.width="100%";var tbody=document.createElement("tbody");var tr=document.createElement("tr");var th=document.createElement("th");th.colSpan="2";th.className="fieldpicker_th";th.appendChild(document.createTextNode("Cart"));tr.appendChild(th);tbody.appendChild(tr);tr=document.createElement("tr");td=document.createElement("td");td.width="50%";td.onmousedown=function(){addFieldPickerSearch("cart")};td.onmouseover=function(){this.style.backgroundColor="#E0E0E0"};td.onmouseout=function(){this.style.backgroundColor="#f6f6f6"};td.innerHTML="Listing Cart";tr.appendChild(td);td=document.createElement("td");tr.appendChild(td);tbody.appendChild(tr);table.appendChild(tbody);attachTo.appendChild(table);return attachTo}function fieldPicker_matchFields(e,elem,forceMatch){if(fieldPicker.style.display=="none"){exposeFieldPicker()}var list=document.getElementById("fieldPicker_list");var listTables=list.getElementsByTagName("table");if(!forceMatch){var keynum;if(window.event){keynum=e.keyCode}else{if(e.which){keynum=e.which}}if(keynum==27){fieldPicker_forceReset(elem);return false}else{if(keynum==13){if(list.selectedItem){list.selectedItem.onmousedown()}document.getElementById("findfield").select();if(typeof e.stop=="function"){e.stop()}return false}else{if(keynum==38){fieldPicker_scroll("up");return false}else{if(keynum==40){fieldPicker_scroll("down");return false}else{if(keynum==37){fieldPicker_scroll("left");return false}else{if(keynum==39){fieldPicker_scroll("right");return false}}}}}}}find_str=elem.value;if(!find_str){find_str=""}if(forceMatch&&!elem.userValue){find_str=""}find_str=find_str.toUpperCase();var tableColumns;var showTable;if(!list.selectedItem){list.selectedItem=""}else{if(list.selectedItem.innerHTML.toUpperCase().indexOf(find_str)<0){fieldPicker_unselect(list.selectedItem);list.selectedItem=""}}for(var x=0;x<listTables.length;x++){showTable=false;tableColumns=listTables[x].getElementsByTagName("td");for(var y=0;y<tableColumns.length;y++){if(tableColumns[y].innerHTML.toUpperCase().indexOf(find_str)>=0||(tableColumns[y].groupName&&tableColumns[y].groupName.toUpperCase().indexOf(find_str)>=0)){if(list.selectedItem==""){list.selectedItem=tableColumns[y];fieldPicker_select(list.selectedItem)}tableColumns[y].style.display="";showTable=true}else{tableColumns[y].style.display="none"}}if(!showTable){listTables[x].style.display="none"}else{listTables[x].style.display=""}}}function fieldPicker_selectFirst(){var list=document.getElementById("fieldPicker_list");list.selectedItem=false;list.selectedItem=list.getElementsByTagName("table")[0].getElementsByTagName("td")[0];fieldPicker_select(list.selectedItem)}function fieldPicker_unselect(elem){if(!elem){return}elem.style.border="none";elem.style.backgroundColor="#f6f6f6"}function fieldPicker_select(elem){if(!elem){return}elem.style.border="1px solid #1569c7";elem.style.backgroundColor="#e0e0e0"}function fieldPicker_scroll(direction){var list=document.getElementById("fieldPicker_list");var listTables=list.getElementsByTagName("table");var tableColumns;var showTable;if(!list.selectedItem){list.selectedItem=""}else{fieldPicker_unselect(list.selectedItem)}var firstItem=firstLeft=firstRight=lastLeft=lastRight=null;var selectNext=selectLast=false;var lastElem=downIndex=upIndex=null;var itemFound=false;for(var x=0;x<listTables.length;x++){showTable=false;tableColumns=listTables[x].getElementsByTagName("td");for(var y=0;y<tableColumns.length;y++){if(tableColumns[y].style.display!="none"){if(tableColumns[y]==list.selectedItem){if(direction=="up"&&upIndex==null&&((y%2==0&&lastLeft)||(y%2!=0&&lastRight))){if(y%2==0){fieldPicker_select(lastLeft);list.selectedItem=lastLeft;itemFound=true;break}else{fieldPicker_select(lastRight);list.selectedItem=lastRight;itemFound=true;break}}else{if(direction=="up"&&upIndex==null){upIndex=y}}if(lastElem&&direction=="left"){fieldPicker_select(lastElem);list.selectedItem=lastElem;itemFound=true;break}else{if(direction=="left"){selectLast=true}else{if(direction=="right"){selectNext=true}else{if(direction=="down"&&downIndex==null){downIndex=y}}}}}else{if(selectNext&&tableColumns[y].innerHTML.replace(/\s+/g,"")!=""){fieldPicker_select(tableColumns[y]);list.selectedItem=tableColumns[y];selectNext=false;itemFound=true;break}else{if(downIndex!=null){if(downIndex%2==y%2&&tableColumns[y].innerHTML.replace(/\s+/g,"")!=""){fieldPicker_select(tableColumns[y]);list.selectedItem=tableColumns[y];itemFound=true;downIndex=null;break}}}}if(tableColumns[y].innerHTML.replace(/\s+/g,"")!=""){lastElem=tableColumns[y];if(!firstItem){firstItem=tableColumns[y]}if(!firstLeft&&y%2==0){firstLeft=tableColumns[y]}if(!firstRight&&y%2!=0){firstRight=tableColumns[y]}if(y%2==0){lastLeft=tableColumns[y]}else{lastRight=tableColumns[y]}}}if(itemFound){break}}}if(selectLast&&lastElem){fieldPicker_select(lastElem);list.selectedItem=lastElem}else{if(selectNext&&firstItem){fieldPicker_select(firstItem);list.selectedItem=firstItem}else{if(selectLast||selectNext){list.selectedItem=""}else{if(upIndex!=null){if(upIndex%2==0){fieldPicker_select(lastLeft);list.selectedItem=lastLeft}else{fieldPicker_select(lastRight);list.selectedItem=lastRight}}else{if(downIndex!=null){if(downIndex%2==0){fieldPicker_select(firstLeft);list.selectedItem=firstLeft}else{fieldPicker_select(firstRight);list.selectedItem=firstRight}}}}}}}function ismatch(searchable,arr){var match=true;for(var i=0;i<arr.length;i++){var a=arr[i];if(match&&!searchable.srch_data.match(a)){match=false}}return match}function match_field_id(searchable,field_arr){var match=true;for(var i=0;i<field_arr.length;i++){var a=field_arr[i];if(match&&!searchable.field_id.match(a)){match=false}}return match}function get_search_item(field_id){var sList=document.getElementById("searchList");if(!sList){return null}for(var x=0;x<sList.childNodes.length;x++){if(sList.childNodes[x].f==field_id){return sList.childNodes[x]}}return null}function setCurrentlyBlipping(item){currently_blipping=item}function resetCurrentlyBlipping(){if(currently_blipping){$(currently_blipping).stop();$(currently_blipping).css({backgroundColor:"#eee"});currently_blipping=null}}function blipCriteria(item,times){if(isNaN(times)){times=1}$(item).animate({backgroundColor:"#FFFF7E"},"slow",function(){$(item).animate({backgroundColor:"#eee"},"slow",function(){if(--times){blipCriteria(item,times)}else{currently_blipping=null}})})}function highlightCriteria(already_exists){try{var top=$("#searchgriddiv").scrollTop()+$(already_exists).offset().top;top-=$("#searchgriddiv").height()/2;if(top<0){top=0}$("#searchgriddiv").animate({scrollTop:(top)},"fast");$("#"+already_exists.unique_id+"_body").show();setCurrentlyBlipping(already_exists);blipCriteria(already_exists,2)}catch(e){}}function addFieldPickerSearch(type,display_id,addlparam){resetCurrentlyBlipping();userFieldPickerInput(document.getElementById("findfield"));var list=document.getElementById("searchList");var item;if(type=="room"){var existing_room=null;if((existing_room=searchCriteriaRendered(type,display_id,addlparam))){highlightCriteria(existing_room);return}}else{var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[display_id]];if(field||type=="block"){var already_exists=searchCriteriaRendered(type,display_id);if(already_exists){var warn_d="";if(type=="block"){warn_d="Block and Range Search"}else{warn_d=field.display_val}highlightCriteria(already_exists);return}}}var g_items=[];if(type=="fieldpicker_group"){var gObj=null;var loc;var one_rendered=false;var group_name="";for(loc=0;loc<currentCardFmt.groups.length;loc++){if(display_id==currentCardFmt.groups[loc].group_id){if(!group_name&&currentCardFmt.groups[loc].display_val){group_name=currentCardFmt.groups[loc].display_val}for(var x=0;x<currentCardFmt.groups[loc].fields.length;x++){if(currentCardFmt.groups[loc].fields[x].table_name=="feature"){if(!searchCriteriaRendered(currentCardFmt.groups[loc].fields[x].type,currentCardFmt.groups[loc].fields[x].tech_id)){one_rendered=true;var item=renderCriteria(currentCardFmt.groups[loc].fields[x].type,"'"+display_id+"' and detail_name='"+currentCardFmt.groups[loc].fields[x].field_id+"'","Q",currentCardFmt.groups[loc].fields[x].tech_id,true);if(item){$(item).hide();g_items.push(item)}}}}}}if(!one_rendered){srchWarningId=writeToWarningDiv("All fields in group '"+group_name+"' are already part of your criteria","attention");return false}}else{if(type=="room"){item=renderCriteria(type,addlparam+",0,0,,,,","Q",display_id,true)}else{item=renderCriteria(type,"","Q",display_id,true)}}if(type!="fieldpicker_group"){$(item).hide()}srch.update();if(item){item.id="srchitem_"+item.unique_id;if(type!="fieldpicker_group"){$(item).slideDown("slow")}else{for(var x=0;x<g_items.length;x++){$(g_items[x]).animate({opacity:"show"},"slow")}}}document.getElementById("searchgriddiv").scrollTop=document.getElementById("searchgriddiv").scrollHeight}function doShapesExist(){var list=document.getElementById("searchList");var addShapeItem=null;for(var y=0;y<list.childNodes.length;y++){if(list.childNodes[y].tb=="mapshape"){addShapeItem=list.childNodes[y];break}}return addShapeItem}function updateShapeInfo(){var mappingShapes=document.getElementById("iframe_map").contentWindow.mappingShapes;var addShapeItem=doShapesExist();if(addShapeItem!=null){searchmode="searchtab_mapsearch";editSearch(true);(mappingShapes.length==0)?removeCriteria(addShapeItem):srch.type.mapshape.update(addShapeItem)}else{if(mappingShapes.length>0){searchmode="searchtab_mapsearch";editSearch(true);if(mappingShapes[0].type=="db2poly"){renderCriteria("mapshape",null,null,mappingShapes[0].type)}else{renderCriteria("mapshape",mappingShapes[0].nodes,null,mappingShapes[0].type)}document.getElementById("searchgriddiv").scrollTop=document.getElementById("searchgriddiv").scrollHeight}}for(var m=mappingShapes.length-1;m>=0;m--){if(mappingShapes[m].type=="db2poly"&&mappingShapes[m].c_tech_id==null){loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch/save_poly.html&id="+mappingShapes[m].id+"&coords="+mappingShapes[m].nodes+((additional_ajax_params)?additional_ajax_params:""));mappingShapes[m].c_tech_id=0}}}function updateShape(shape){var mappingShapes=document.getElementById("iframe_map").contentWindow.mappingShapes;var addShapeItem=doShapesExist();if(addShapeItem!=null){for(var x=0;x<mappingShapes.length;x++){if(mappingShapes[x]==shape){srch.type.mapshape.change_shape_appearance(addShapeItem,x,shape.color,shape.label);break}}}}function returnSavedPolygon(tech_id,mapserver_id){var mappingShapes=document.getElementById("iframe_map").contentWindow.mappingShapes;for(var x=0;x<mappingShapes.length;x++){if(mappingShapes[x].id==mapserver_id){mappingShapes[x].c_tech_id=tech_id;break}}var addShapeItem=doShapesExist();if(addShapeItem!=null){srch.type.mapshape.update(addShapeItem)}}function enableMappingAutoPopulation(item,type,value,lookup_name,map_cache_id){if(!iframe_map||!iframe_map.contentWindow.myFBSMapLoaded||iframe_map.style.display=="none"){changeSearchSubTab("searchtab_mapsearch")}isolateTab(true,"iframe_map");if(navigator.userAgent.match("MSIE")){search_subtabs.style.display="none"}if(iframe_map&&iframe_map.contentWindow.myFBSMapLoaded){iframe_map.contentWindow.mapAutoPopulate({mapObj:iframe_map.contentWindow.myFBSMap,lookup_field_name:lookup_name,lookup_formal_name:item.d,map_cache_id:map_cache_id,ma_tech_ids:ma_search_list.split(","),values:(type=="S")?value.replace(/^'(.*)'$/,"$1").split("','"):value.split(","),callback:{func:"parent.disableMappingAutoPopulation",params:[{name:"item_unique_id",value:item.unique_id},{name:"item_type",value:type}]}});closeNewQuickSearch()}else{setTimeout("enableMappingAutoPopulation({f:'"+item.f.quote("js","")+"',d:'"+item.d.quote("js","")+"',unique_id:"+item.unique_id+"}, '"+type+"', '"+value.quote("js","")+"', '"+lookup_name+"', '"+map_cache_id+"')",250)}}function disableMappingAutoPopulation(new_value,callbackObj){if(new_value!=null&&callbackObj.item_unique_id){srch.type[callbackObj.item_type].autopop(callbackObj.item_unique_id,new_value)}isolateTab(false,"iframe_map");if(navigator.userAgent.match("MSIE")){search_subtabs.style.display=""}}function isolateTab(show,tab_id){var objBody=document.getElementsByTagName("body").item(0);if(show){if(document.getElementById("popoverMask")){document.getElementById("popoverMask").style.display="block"}else{var objMask=document.createElement("div");objMask.setAttribute("id","popoverMask");objMask.style.display="block";objBody.insertBefore(objMask,objBody.firstChild)}document.getElementById(tab_id).style.zIndex=901;if(navigator.userAgent.match("MSIE")){bottomsection.style.zIndex=901}}else{document.getElementById("popoverMask").style.display="none";document.getElementById(tab_id).style.zIndex=1;if(navigator.userAgent.match("MSIE")){bottomsection.style.zIndex=1}}}function compile(purpose,debug,updateMap,addObj){if(HALT_COMPILE){setTimeout("compile("+(purpose?"'"+purpose+"'":"null")+","+(debug?debug:false)+",'"+(updateMap?updateMap:"")+"',"+uneval(addObj)+");",1000);return false}if(srchautoupdate&&!forprint){srch.set_counts("animate")}if(!purpose||purpose==null){listing_in_focus_not_in_grid=false}if(purpose=="count"&&!srchautoupdate){var animation_index=false}var hFields=new Array();var qparams=new Array();var temp_card_fmt_list=card_fmt_list;var temp_prop_type_list=prop_type_list;var temp_ma_search_list=ma_search_list;if(purpose){hFields.push('<input type="hidden" name="purpose" value="'+purpose+'" />')}if(debug){hFields.push('<input type="hidden" name="debug" value="true" />')}if(purpose=="count"){hFields.push('<input type="hidden" name="animation_index" value="'+animation_index+'" />')}if(addObj&&addObj.ignoreNoListings){hFields.push('<input type="hidden" name="ignoreNoListings" value="true" />')}var list=document.getElementById("searchList");if(!addObj||!addObj.use_current_srch){for(var x=0;x<list.childNodes.length;x++){var node=list.childNodes[x];if(document.getElementById("enabled_"+node.unique_id)&&(document.getElementById("enabled_"+node.unique_id).checked||node.kind=="ma_search_list"||node.kind=="card_fmt")){qparams=qparams.concat(srch.type[node.kind].compile(node));if(node.kind=="idxmlsnumber"){break}else{if(node.kind=="specifiedlistings"&&node.r=="R"&&srch.type[node.kind].compile(node).length==0){return false}}}}for(var x=0;x<qparams.length;x++){if(qparams[x].tb=="general"&&qparams[x].f=="ma_search_list"){temp_ma_search_list=qparams[x].c;qparams.splice(x,1);x--}else{if(qparams[x].tb=="general"&&qparams[x].f=="card_fmt"){if(temp_ma_search_list.match(",")){temp_prop_type_list=qparams[x].c;temp_card_fmt_list=""}else{temp_card_fmt_list=qparams[x].c;temp_prop_type_list=""}qparams.splice(x,1);x--;break}}}}else{qparams=search}if(purpose=="test"){var join_qparams="";var join_search="";var join_qparams_r="";var join_search_r="";for(var x=0;x<qparams.length;x++){join_qparams+=qparams[x].c;join_qparams_r+=qparams[x].r}for(var x=0;x<search.length;x++){join_search+=search[x].c;join_search_r+=search[x].r}return !(join_qparams==join_search&&join_qparams_r==join_search_r&&card_fmt_list==temp_card_fmt_list&&prop_type_list==temp_prop_type_list&&ma_search_list==temp_ma_search_list)}else{if(purpose=="fullsearchedit"){search=qparams;card_fmt_list=temp_card_fmt_list;prop_type_list=temp_prop_type_list;ma_search_list=temp_ma_search_list}else{var need_to_update_global_search=noListingMode;if(noListingMode){goNoListingMode(false)}for(var x=qparams.length-1;x>=0;x--){if(qparams[x].c==""&&qparams[x].tb!="range"){qparams.splice(x,1)}}for(var x=0;x<qparams.length;x++){hFields.push('<input type="hidden" name="tb'+(x+1)+'" value="'+qparams[x].tb+'" />');hFields.push('<input type="hidden" name="f'+(x+1)+'" value="'+qparams[x].f+'" />');hFields.push('<input type="hidden" name="o'+(x+1)+'" value="'+qparams[x].o+'" />');hFields.push('<input type="hidden" name="c'+(x+1)+'" value="'+(qparams[x].c?qparams[x].c.replace(/[\"]/g,"&quot;"):"")+'" />');hFields.push('<input type="hidden" name="d'+(x+1)+'" value="'+qparams[x].d+'" />');hFields.push('<input type="hidden" name="r'+(x+1)+'" value="'+qparams[x].r+'" />');hFields.push('<input type="hidden" name="g'+(x+1)+'" value="'+qparams[x].g+'" />');hFields.push('<input type="hidden" name="t'+(x+1)+'" value="'+qparams[x].t+'" />')}hFields.push('<input type="hidden" name="qcount" value="'+qparams.length+'" />');hFields.push('<input type="hidden" name="ma_tech_id" value="x\''+js_ma_tech_id+"'\" />");hFields.push('<input type="hidden" name="tech_id" value="x\''+js_tech_id+"'\" />");hFields.push('<input type="hidden" name="ma_search_list" value="'+temp_ma_search_list+'" />');hFields.push('<input type="hidden" name="card_fmt_list" value="'+temp_card_fmt_list+'" />');hFields.push('<input type="hidden" name="prop_type_list" value="'+temp_prop_type_list+'" />');if(updateMap){hFields.push('<input type="hidden" name="updateMap" value="true" />');if(updateMap=="autoupdate"){hFields.push('<input type="hidden" name="mapMaxCount" value="1000" />');clearSrchUpdateLinks()}}document.getElementById("hiddenFormElements").innerHTML=hFields.join("");if((purpose!="test"&&purpose!="count")||(purpose=="count"&&need_to_update_global_search)){search=qparams;card_fmt_list=temp_card_fmt_list;prop_type_list=temp_prop_type_list;ma_search_list=temp_ma_search_list}loadJavaScriptDoc("form","mainmenu.cgi","inputform",false,debug);dirtysearch=(purpose=="count")?true:false}}return true}function showMapWarning(count){var lcount=count.format(0,true);var message="<div class='delbutton' onclick='closeWarning(srchWarningId);'>X</div>";message+="<div style='padding:3px 5px 3px 5px;width:225px;'>"+lcount+" listing"+(count==1?"":"s")+" matched your search. ";message+="<br>To plot these listing"+(count==1?"":"s")+", ";message+=" <a href=\"javascript:suppress_mapping=false;compile('count',false,true);closeWarning(srchWarningId);\">click here</a> </div>";srchWarningId=writeToWarningDiv(message,"map_message",0,srchWarningId)}function dirtyMap(){if(!iframe_map||!iframe_map.contentWindow.myFBSMap){return}if(iframe_map.contentWindow.myFBSMap&&iframe_map.contentWindow.myFBSMap.dynamicLayer){iframe_map.contentWindow.myFBSMap.dynamicLayer.setOpacity(0.4)}iframe_map.contentWindow.mapTipListingsFetch=false;if(iframe_map.contentWindow.selected_listing_mark){iframe_map.contentWindow.myFBSMap.removeObject(iframe_map.contentWindow.selected_listing_mark);iframe_map.contentWindow.selected_listing_mark=null}}function updateSrchCount(count,animation_index){var count=Number(count);var textCount=count.format(0,true);if(count==0){noListingMode=true;dirtysearch=false}else{current_grid_totallistings=count}srch.set_counts(textCount);updateNoMapCount(textCount)}function noMapFadeOutCount(){var iframe_no_tab=document.getElementById("iframe_no_tab");if(iframe_no_tab){var nomap_count=iframe_no_tab.contentWindow.document.getElementById("nomap_numlistings");if(nomap_count){var start_op=1;if(browser_type=="IE"&&nomap_count.style.filter&&nomap_count.style.filter.indexOf("opacity=")>=0){start_op=nomap_count.style.filter.substr(nomap_count.style.filter.indexOf("opacity=")).match(/^[0-9]/);if(isNaN(start_op)){start_op=1}}else{if(nomap_count.style.opacity){start_op=nomap_count.style.opacity;if(isNaN(start_op)){start_op=1}}}nomap_count.fadeStatus=null;setTimeout("fadeElemOut('nomap_numlistings',"+start_op+",'iframe_no_tab',.01);",100)}}}function dirtyNoMapTab(){if(srchautoupdate){return}var iframe_no_tab=document.getElementById("iframe_no_tab");if(!iframe_no_tab){return}var nomap_count=iframe_no_tab.contentWindow.document.getElementById("nomap_numlistings");if(!nomap_count){return}if(nomap_count.fadeStatus&&(nomap_count.fadeStatus=="faded"||nomap_count.fadeStatus=="fading")){return}nomap_count.fadeStatus="fading";if(browser_type=="IE"){nomap_count.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=100)";nomap_count.style.width=nomap_count.clientWidth}else{nomap_count.style.opacity=1}setTimeout("fadeElemOut('nomap_numlistings',1,'iframe_no_tab',.25,false,false,'&mdash;');",100)}function updateNoMapCount(count,noAnimate){var iframe_no_tab=document.getElementById("iframe_no_tab");if(!iframe_no_tab){return}var nomap_count=iframe_no_tab.contentWindow.document.getElementById("nomap_numlistings");if(!nomap_count){return}var nomap_postnum=iframe_no_tab.contentWindow.document.getElementById("nomap_postnum");count=count.replace(/[^0-9]/g,"");if(parseInt(count)<=0){nomap_count.className="bigBlueNoLink"}else{nomap_count.className="bigBlueLink"}if(parseInt(count)==1&&nomap_postnum){nomap_postnum.innerHTML="listing matched your search"}else{nomap_postnum.innerHTML="listings matched your search"}if(noAnimate||(nomap_count.fadeStatus&&(nomap_count.fadeStatus=="opaque"||nomap_count.fadeStatus=="appearing"))){if(browser_type=="IE"){nomap_count.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=100)"}else{nomap_count.style.opacity=1}nomap_count.innerHTML=parseInt(count).format(0,true);return}if(!srchautoupdate){nomap_count.fadeStatus="appearing";if(browser_type=="IE"){nomap_count.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";nomap_count.style.width=nomap_count.clientWidth}else{nomap_count.style.opacity=0}}var old_count=nomap_count.innerHTML.replace(/[^0-9]/g,"");if(old_count==""){old_count="0"}var diff=1/(0.05/3.5);var max=count.replace(/\,/g,"");if(max>=parseInt(old_count)){var start=Number(max)-Math.floor(diff);start=(start<0?0:start);if((max-start)>=25){nomap_count.innerHTML="0";setTimeout("noMapCount('up',"+max+","+start+");",10)}else{nomap_count.innerHTML=parseInt(max).format(0,true)}if(!srchautoupdate){setTimeout("fader.fade({'mode':'in','id':'nomap_numlistings','opacity':0,'frame_id':'iframe_no_tab'});",100)}}else{var start=Number(max)+Math.floor(diff);start=(start<0?0:start);if((start-max)>=25){setTimeout("noMapCount('down',"+max+","+start+");",10)}else{nomap_count.innerHTML=parseInt(max).format(0,true)}if(!srchautoupdate){setTimeout("fader.fade({'mode':'in','id':'nomap_numlistings','opacity':0,'frame_id':'iframe_no_tab'});",100)}}}var more_map_menu=[];more_map_menu.push("<a href='javascript:void(0);' onclick='srchlog(\"map listing action\",\"more info\");event.cancelBubble=true;updateSingleListingFromMap(selectedlisting)'>Show More Information</a>");more_map_menu.push("<a href='javascript:void(0);' onclick='srchlog(\"map listing action\",\"select\");event.cancelBubble=true;selectlistingfromajax(selectedlisting)'>Add to Selected Listings</a>");if(interfaceObj.birdseye){more_map_menu.push('<a href=\'javascript:void(0);\' onclick=\'srchlog("map listing action","birds eye");event.cancelBubble=true;(selListObj.geo_lon/latLonDivisor == 0 || selListObj.geo_lat/latLonDivisor == 0)?document.getElementById("iframe_map").contentWindow.warnListingIsNotGeocoded(selectedlisting):document.getElementById("iframe_map").contentWindow.birdsEye(selListObj.geo_lon/latLonDivisor,selListObj.geo_lat/latLonDivisor);\'>Show Bird\'s Eye Map</a>')}more_map_menu.push('<a href=\'javascript:void(0);\' onclick=\'srchlog("map listing action","zoom to");event.cancelBubble=true;(selListObj.geo_lon/latLonDivisor == 0 || selListObj.geo_lat/latLonDivisor == 0)?document.getElementById("iframe_map").contentWindow.warnListingIsNotGeocoded(selectedlisting):document.getElementById("iframe_map").contentWindow.myFBSMap.zoomTo([selListObj.geo_lon/latLonDivisor,selListObj.geo_lat/latLonDivisor], 423.1875159493829);\'>Zoom to Listing</a>');if(interfaceObj.can_search){more_map_menu.push('<a href=\'javascript:void(0);\' onclick=\'srchlog("map listing action","radius search");event.cancelBubble=true;(selListObj.geo_lon/latLonDivisor == 0 || selListObj.geo_lat/latLonDivisor == 0)?document.getElementById("iframe_map").contentWindow.warnListingIsNotGeocoded(selectedlisting):document.getElementById("iframe_map").contentWindow.radiusSearch(selListObj.geo_lon/latLonDivisor,selListObj.geo_lat/latLonDivisor);\'>Radius Search from Listing</a>')}if(interfaceObj.privatemode&&interfaceObj.print_map){more_map_menu.push('<a href=\'javascript:void(0);\' onclick=\'srchlog("map listing action","move");event.cancelBubble=true;document.getElementById("iframe_map").contentWindow.mapRecommendFindListing(selectedlisting, null, { mapDiv: "fbsMapDiv", dragElement: "mapDD", listElement: "fbsMapList" });\'>Move this Listing</a>')}function formatCount(num){return num.format(0,true)}function noMapCount(mode,target,current,lastCall){var iframe_no_tab=document.getElementById("iframe_no_tab");if(!iframe_no_tab){return}var nomap_count=iframe_no_tab.contentWindow.document.getElementById("nomap_numlistings");if(!nomap_count){return}if(!lastCall||lastCall==""){lastCall=new Date();lastCall=lastCall.getTime()}else{var now=new Date();if((now.getTime()-parseInt(lastCall))>100){current=target}else{lastCall=new Date();lastCall=lastCall.getTime()}}if((mode=="up"&&current>=target)||(mode=="down"&&current<=target)){nomap_count.innerHTML=target.format(0,true);if(target==0){nomap_count.className="bigBlueNoLink"}else{nomap_count.className="bigBlueLink"}}else{if(mode=="up"){current++}else{current--}nomap_count.innerHTML=current.format(0,true);setTimeout("noMapCount('"+mode+"',"+target+","+current+","+lastCall+");",10)}}var Fader=function(){this.okayToFade="";this.fadeWait=1000;this.fadeTicks=0};Fader.prototype={can_fade:function(){var now=new Date();if(this.okayToFade!=""){var now=new Date();if((now.getTime()-this.okayToFade.getTime())>this.fadeWait){this.okayToFade="";this.fadeTicks=0}else{return false}}if(this.fadeTicks>0){this.fadeTicks--}return true},fail_fade:function(){this.fadeTicks+=2;if(this.fadeTicks>10){this.okayToFade=new Date()}},check_time:function(elem,rate){var now=new Date();if(!elem.startTime||elem.startTime==""){elem.startTime=new Date()}else{if((now.getTime()-elem.startTime.getTime())>(rate*10)){fader.fail_fade();return false}else{elem.startTime=new Date()}}return true},fade:function(obj){if(!obj){return}if(obj.frame_id){var frame=document.getElementById(obj.frame_id);if(!frame){return}var elem=frame.contentWindow.document.getElementById(obj.id);if(!elem){return}}else{var elem=document.getElementById(obj.id);if(!elem){return}}if(!elem.fadeStatus&&obj.mode=="out"){elem.fadeStatus="fading"}else{if(!elem.fadeStatus&&obj.mode=="in"){elem.fadeStatus="appearing"}}if((obj.mode=="out"&&elem.fadeStatus=="appearing")||(obj.mode=="in"&&elem.fadeStatus=="fading")){return}obj.target=(typeof(obj.target)!="undefined"?parseFloat(obj.target):(obj.mode=="in"?1:0));obj.rate=(typeof(obj.rate)!="undefined"?parseFloat(obj.rate):100);obj.opacity=(typeof(obj.opacity)!="undefined"?parseFloat(obj.opacity):(obj.mode=="in"?0:1));obj.text=(typeof(obj.text)!="undefined"?obj.text:false);if(!fader.can_fade()||!fader.check_time(elem,obj.rate)){obj.opacity=obj.target}if((obj.mode=="out"&&obj.opacity<=obj.target)||(obj.mode=="in"&&obj.opacity>=obj.target)){if(browser_type=="IE"){elem.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity="+obj.target*100+")"}else{elem.style.opacity=obj.target}if(obj.target<=0){elem.style.display="none"}else{if(obj.target>=1&&browser_type=="IE"){elem.style.filter=""}}if(obj.text){elem.innerHTML=obj.text}elem.fadeStatus=(obj.mode=="out"?"faded":"opaque");elem.startTime="";return}obj.inc=(obj.inc?obj.inc:0.05);if(obj.mode=="out"){obj.opacity-=obj.inc}else{obj.opacity+=obj.inc}if(browser_type=="IE"){elem.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity="+(100*obj.opacity)+")"}else{elem.style.opacity=obj.opacity}var str="{'mode':'"+obj.mode+"','id':'"+obj.id+"',"+(obj.frame_id?"'frame_id':'"+obj.frame_id+"',":"")+"'target':"+obj.target+",'inc':"+obj.inc+",'rate':"+obj.rate+",'opacity':"+obj.opacity+(obj.text?", 'text':'"+obj.text+"'":"")+"}";setTimeout("fader.fade("+str+");",obj.rate)}};fader=new Fader();function fadeElemInSrchWrapper(id,opacity,frame_id,max,rate){if(!document.getElementById(id)||(document.getElementById(id)&&document.getElementById(id).fadeStatus&&(document.getElementById(id).fadeStatus=="opaque"||document.getElementById(id).fadeStatus=="appearing"))){return}document.getElementById(id).style.display="";document.getElementById(id).fadeStatus="appearing";fader.fade({mode:"in",id:id,opacity:0,frame_id:frame_id,target:max,rate:rate})}function fadeElemOut(id,opacity,frame_id,min,rate,inc,endText){fader.fade({mode:"out",id:id,opacity:opacity,frame_id:frame_id,target:min,rate:rate,inc:inc,text:endText})}function applySrchResults(){compile();closeWarning(srchWarningId);srchWarningId=null}function searchAddTab(name,id){var createNewTab=true;var tab=null;var id=new String((!id)?Math.floor(Math.random()*1000000000000):id);for(var x=0;x<searchTabs.length;x++){if(document.getElementById("branding_"+searchTabs[x].id).className=="branding"&&searchTabs[x].name=="Untitled"){searchTabs[x].name=name;createNewTab=false;tab=x;break}}if(createNewTab){searchTabs.push(new searchTab(id,name));tab=searchTabs.length-1}var searchDiv=(createNewTab)?document.createElement("div"):document.getElementById("srch_arena_"+searchTabs[tab].id);searchDiv.id="srch_arena_"+searchTabs[tab].id;searchDiv.className="arena";searchDiv.innerHTML='<img src="http://www.flexmls.com/flexmls.jpg" id="branding_'+searchTabs[tab].id+'" class="branding'+((name=="Untitled")?"":"Hidden")+'" /><ul class="search" id="search_'+searchTabs[tab].id+'"></ul>';if(createNewTab){document.getElementById("inputform").appendChild(searchDiv)}if(!createNewTab){var newTab=ts.tabs[tab];newTab.setText(searchTabs[tab].name)}switchSearchTab(tab);createSearchTabs(tab)}function createSearchTabs(selectedIndex){ts=addTabSet();if(!selectedIndex){selectedIndex=0}if(searchTabs.length==selectedIndex&&searchTabs.length==1){selectedIndex=0;currentSearchTab=0;document.getElementById("srch_arena_combined").style.display="none";document.getElementById("srch_arena_"+searchTabs[currentSearchTab].id).style.display=""}if(searchTabs.length>1){var selected=(searchTabs.length==selectedIndex)?true:false;ts.addTab("<img src='/images/smicn_16.png' style='width:12px;height:12px;' /> All","switchSearchTab('combined');",selected);var combinedList=document.getElementById("search_combined");while(combinedList.hasChildNodes()){combinedList.removeChild(combinedList.firstChild)}for(var x=0;x<searchTabs.length;x++){renderCriteria("search",searchTabs[x].name,searchTabs[x].operator,searchTabs[x].id)}}for(var x=0;x<searchTabs.length;x++){var selected=(x==selectedIndex)?true:false;ts.addTab(searchTabs[x].name,"switchSearchTab("+x+");",selected)}ts.draw("search_header")}function showPrettyDialog(title,body,sizeObj){var pa=document.getElementById("prettydialog");var pshim=document.getElementById("prettydialogshim");if(!pa){return}document.getElementById("prettydialogtitle").innerHTML=title;document.getElementById("prettydialogbody").innerHTML=body;if(sizeObj){if(sizeObj.height){pshim.style.height=pa.style.height=sizeObj.height}if(sizeObj.width){pshim.style.width=pa.style.width=sizeObj.width}pshim.style.top=pa.style.top=(sizeObj.top?sizeObj.top:"");pshim.style.left=pa.style.left=(sizeObj.left?sizeObj.left:"");pshim.style.right=pa.style.right=(sizeObj.right?sizeObj.right:"");pshim.style.bottom=pa.style.bottom=(sizeObj.bottom?sizeObj.bottom:"")}pa.style.display="";pshim.style.display=""}function hidePrettyDialog(){document.getElementById("prettydialog").style.display="none";document.getElementById("prettydialogshim").style.display="none"}function switchSearchTab(id){var oldTab=(currentSearchTab=="combined")?"srch_arena_combined":"srch_arena_"+searchTabs[currentSearchTab].id;var newTab=(id=="combined")?"srch_arena_combined":"srch_arena_"+searchTabs[id].id;currentSearchTab=id;document.getElementById(oldTab).style.display="none";document.getElementById(newTab).style.display=""}function showSearchMenuButtons(mode,arr){var buttons=["smenu_saveqs","smenu_clearall","smenu_createidx"];if(!arr){arr=buttons}var disp=(mode=="hide"?"none":"");for(var x=0;x<arr.length;x++){var d=document.getElementById(arr[x]);if(d){d.style.display=disp}}}function showMoreSearchMenu(force){closeAllDropDowns("search");if(force=="hide"||(!force&&document.getElementById("moresearchmenutable").style.display!="none")){document.getElementById("moresearchmenutable").style.display="none";return false}if(tabIndex==7&&document.getElementById("smenu_saveqs")&&searchmode.indexOf("searchtab_fullsearch")==-1){document.getElementById("smenu_saveqs").style.display=""}else{if(document.getElementById("smenu_saveqs")){document.getElementById("smenu_saveqs").style.display="none"}}if(cart_totallistings>0&&document.getElementById("smenu_saveselected")){document.getElementById("smenu_saveselected").style.display="";document.getElementById("saveselected_text").innerHTML="Save Selected Listings ("+cart_totallistings.toString()+")"}else{if(document.getElementById("smenu_saveselected")){document.getElementById("smenu_saveselected").style.display="none"}}var menu_items=0;for(var x=0;x<searchmenuitems.length;x++){if(document.getElementById("smenu_"+searchmenuitems[x])&&document.getElementById("smenu_"+searchmenuitems[x]).style.display!="none"){menu_items++}}if(interfaceObj.editing_prospect_seller||menu_items<2||(document.saveform&&document.saveform.contactMgmtBasedSearch&&document.saveform.contactMgmtBasedSearch.value=="true")){fireSave();return false}var btn=document.getElementById("savelinkimage");document.getElementById("moresearchmenutable").style.display="";var left=isNaN(parseInt(btn.offsetLeft))?0:parseInt(btn.offsetLeft);if((left+document.getElementById("moresearchmenutable").clientWidth)+20>getWindowWidth()){document.getElementById("moresearchmenutable").style.left="";document.getElementById("moresearchmenutable").style.right=0}else{document.getElementById("moresearchmenutable").style.left=left+8}document.getElementById("moresearchmenutable").style.top=20}function hideMoreSearchMenu(){document.getElementById("moresearchmenutable").style.display="none"}function showSearchParameters(){closeAllDropDowns("params");var opt_sum=document.getElementById("options_summary");var btn=document.getElementById("info_button");var pnode=opt_sum;var top=isNaN(parseInt(pnode.offsetTop))?0:parseInt(pnode.offsetTop);var left=isNaN(parseInt(btn.offsetLeft))?0:parseInt(btn.offsetLeft);while(pnode=pnode.parentNode){top+=isNaN(parseInt(pnode.offsetTop))?0:parseInt(pnode.offsetTop)}var spt=document.getElementById("searchparamtable");spt.style.left=left+opt_sum.clientHeight;spt.style.top=top;$("#searchparamtable").show("slow")}function hideSearchParameters(){$("#searchparamtable").hide("slow")}function changeSearchText(desc,op,value,mode,item){if(mode=="add"&&value==""){return}var stip=document.getElementById("searchparamtip");var s_text=stip.innerHTML.split("<BR>");if(s_text.length<=1){s_text=stip.innerHTML.split("<br>");if(s_text.length==0){s_text=new Array()}}var s_link=s_text[s_text.length-1];s_text.splice(s_text.length-1,1);var found=false;for(var x=0;x<s_text.length;x++){var end_index=s_text[x].length;if(s_text[x].toLowerCase().indexOf("<font")>=0){end_index=s_text[x].toLowerCase().indexOf("<font")}if(s_text[x].substr(0,end_index).trim()==desc.trim()){found=true;if(mode=="remove"){s_text.splice(x,1);break}else{if(mode=="add"){var istr=(s_text[x].indexOf("<font")>=0?s_text[x].indexOf("<font"):s_text[x].indexOf("<FONT"));if(item&&op=="between"&&item.param_max&&item.param_min&&value.indexOf(" and ")>=0){if(item.param_max<=value.split(" and ")[1].replace(/'/,"").replace(/\s/g,"")){value=value.split(" and ")[0]+"+";op="of"}}s_text[x]=s_text[x].substr(0,istr)+" <FONT style='color:#1569c7;font-style:italic;text-decoration:none;font-weight:normal;'>"+op+" "+value+"</FONT>";break}}}}if(!found&&mode=="add"){if(item&&op=="between"&&item.param_max&&item.param_min&&value.indexOf(" and ")>=0){if(item.param_max<=value.split(" and ")[1].replace(/'/,"").replace(/\s/g,"")){value=value.split(" and ")[0]+"+";op="of"}}var newstr=desc+" <FONT style='color:#1569c7;font-style:italic;text-decoration:none;font-weight:normal;'>"+op+" "+value+"</FONT>;";s_text.push(newstr)}s_text.push(s_link);var new_stip=s_text.join("<BR>");new_stip=new_stip.replace(/^(<br>)/i,"");stip.innerHTML=new_stip}function shapeHighlight(light,shapeDiv,shapeIndex){shapeDiv.className=(light)?"shapeDivOver":"shapeDiv";var mapframe=document.getElementById("iframe_map").contentWindow;if(!mapframe.myFBSMapLoaded){return}if(mapframe.mappingShapes[shapeIndex]){var feature=(mapframe.mappingShapes[shapeIndex].id!=null)?mapframe.myFBSMap.findFeature(mapframe.mappingShapes[shapeIndex].id):mapframe.mappingShapes[shapeIndex].feature;feature.style.strokeColor=(light)?"#FF0000":feature.attributes.strokeColor;feature.style.fillColor=(light)?"#FFFF00":feature.attributes.fillColor;feature.style.fillOpacity=(light)?0.55:feature.attributes.fillOpacity;feature.layer.drawFeature(feature)}}var search_need_display_change=false;var srch={type:[],srchables:[]};srch.check_for_grayed=function(elem,minOrMax){var item=srch.get_parent(elem);if(!item){return}if(elem.className=="srch_field_gray"){elem.value=""}elem.className=""};srch.set_grayed_fields=function(item,from_id,to_id){var lower=upper=null;var low_zeroes=upper_zeroes=null;if(from_id){lower=document.getElementById(from_id)}if(to_id){upper=document.getElementById(to_id)}var lower_val=lower?lower.value.trim():0;var upper_val=upper?upper.value.trim():0;if(item.kind=="Z"){low_zeroes=document.getElementById("from_zeroes_"+item.unique_id);upper_zeroes=document.getElementById("to_zeroes_"+item.unique_id);var low_zeroes_txt=upper_zeroes_txt="";if(low_zeroes){low_zeroes_txt=low_zeroes.value}if(upper_zeroes){upper_zeroes_txt=upper_zeroes.value}lower_val=parseInt(lower_val.toString()+low_zeroes_txt.toString());upper_val=parseInt(upper_val.toString()+upper_zeroes_txt.toString())}if(lower&&item.param_min!="undefined"){if(lower_val==""||isNaN(lower_val)||lower_val==item.param_min){lower.value="min";lower.className="srch_field_gray";if(low_zeroes){low_zeroes.value=""}}else{lower.className=""}}if(upper&&item.param_max!="undefined"){if(upper_val==""||isNaN(upper_val)||upper_val==item.param_max){upper.value="max";upper.className="srch_field_gray";if(upper_zeroes){upper_zeroes.value=""}}else{upper.className=""}}};srch.doShowField=function(item){if(interfaceObj.idx&&item.tb=="list"&&item.f=="list_price"){return true}else{if(!interfaceObj.idx&&interfaceObj.qs_expand_fields=="Y"){return true}else{return false}}};srch.set_counts=function(count,fs){if(!count){count="&mdash;"}else{if(count=="animate"){count='<img src="/images/srch_rs/loading.gif" align="absmiddle">'}}if(fs&&!isNaN(count)){count=parseInt(count).format(0,true)}matchesdiv.innerHTML=": "+count;top_matchesdiv.innerHTML=": "+count;try{if(!isNaN(parseInt(count,10))){updateNoMapCount(count)}}catch(e){}};srch.toggle_search_menu=function(mode){var d="";if(mode=="hide"){d="none"}if(false&&document.getElementById("srch_menu_button")){document.getElementById("srch_menu_button").style.display=d}};srch.toggle_links=function(mode){if(!mode){mode="off"}if(mode=="on"){gridlink_outermatch.style.display="";topgridlink_outermatch.style.display="";gridlink_updatematches.style.display="";topgridlink_updatematches.style.display="";srch.toggle_search_menu()}else{gridlink_outermatch.style.display="none";topgridlink_outermatch.style.display="none";gridlink_updatematches.style.display="none";topgridlink_updatematches.style.display="none";srch.toggle_search_menu("hide")}};srch.draw=function(drawSearchParams,clearBuffer,unCheckBuffer){var status_param=null;if(drawSearchParams){for(var x=0;x<search.length;x++){if(searchtype=="A"&&search[x].tb=="list"){if(search[x].f=="streetname"||search[x].f=="streetaddlinfo"||search[x].f=="streetdirsuffix"||search[x].f=="streetsuffix"||search[x].f=="streetdirprefix"||search[x].f=="zip"||search[x].f=="city"||search[x].f=="state"||search[x].f=="county"){search[x].c=search[x].c.replace(/\*/g,"")}}var ret_item=drawCriteriaByQCount(search[x].tb,search[x].f,search[x].o,search[x].c,search[x].d,search[x].r,search[x].g);if(ret_item&&ret_item.tb=="list"&&ret_item.f=="status"){status_param=ret_item}}}var list=document.getElementById("searchList");for(var x=0;x<field_buffer.length;x++){if(searchtype=="A"&&field_buffer[x].tb=="list"){if(field_buffer[x].f=="streetname"||field_buffer[x].f=="streetaddlinfo"||field_buffer[x].f=="streetdirsuffix"||field_buffer[x].f=="streetsuffix"||search[x].f=="streetdirprefix"||field_buffer[x].f=="zip"||field_buffer[x].f=="city"||field_buffer[x].f=="state"||field_buffer[x].f=="county"){field_buffer[x].c=field_buffer[x].c.replace(/\*/g,"")}}var ret_item=drawCriteriaByQCount(field_buffer[x].tb,field_buffer[x].f,field_buffer[x].o,field_buffer[x].c,field_buffer[x].d,field_buffer[x].r,field_buffer[x].g);if(ret_item&&ret_item.tb=="list"&&ret_item.f=="status"){status_param=ret_item}if(unCheckBuffer){for(var y=0;y<list.childNodes.length;y++){if(list.childNodes[y]==getLastCustomNode()){break}else{if(list.childNodes[y].kind=="card_fmt"||list.childNodes[y].kind=="ma_search_list"){continue}else{if(list.childNodes[y].tb!="feature"&&list.childNodes[y].tb==field_buffer[x].tb&&list.childNodes[y].f==field_buffer[x].f&&document.getElementById("enabled_"+list.childNodes[y].unique_id)){document.getElementById("enabled_"+list.childNodes[y].unique_id).checked=false}else{if(list.childNodes[y].tb=="feature"&&list.childNodes[y].tb==field_buffer[x].tb){var sg=list.childNodes[y].c.substr(0,list.childNodes[y].c.indexOf(" and "));var rg=field_buffer[x].c.substr(0,field_buffer[x].c.indexOf(" and "));var sd=list.childNodes[y].c.substr(list.childNodes[y].c.indexOf("detail_name=")+12).match(/^['][^']+[']/)[0];var rd=field_buffer[x].c.substr(field_buffer[x].c.indexOf("detail_name=")+12).match(/^['][^']+[']/)[0];if(sg==rg&&sd==rd&&document.getElementById("enabled_"+list.childNodes[y].unique_id)&&(list.childNodes[y].kind!="group"||srch.type.group.compile(list.childNodes[y]).length==0)){document.getElementById("enabled_"+list.childNodes[y].unique_id).checked=false}}}}}}}}if(clearBuffer){field_buffer=new Array()}if(global_shape_item_to_preserve){document.getElementById("searchList").insertBefore(global_shape_item_to_preserve,getLastCustomNode());global_shape_item_to_preserve=null}renderAdvancedCriteria();if(interfaceObj.idx&&status_param){document.getElementById("searchList").insertBefore(status_param,getLastCustomNode())}};srch.render=function(item,value,required,info,advanced){if(srch.type[item.kind]){return srch.type[item.kind].render(item,value,required,info,advanced)}else{return""}};srch.compile=function(item){return srch.type[item.kind].compile(item)};srch.get_parent=function(node){var parent=node;while(parent&&parent.parentNode!=document.getElementById("searchList")){parent=parent.parentNode}return parent};srch.updateTimer=null;srch.update=function(noMapUpdate){if(srchautoupdate){clearTimeout(srch.updateTimer);var list=document.getElementById("searchList");for(var x=0;x<list.childNodes.length;x++){if(list.childNodes[x]&&list.childNodes[x].tb&&list.childNodes[x].tb=="mapshape"){for(var y=0;y<list.childNodes[x].shapes.length;y++){if(list.childNodes[x].shapes[y].f=="db2poly"&&list.childNodes[x].shapes[y].c==null){setTimeout("srch.update("+noMapUpdate+");",1000);return}}}}srch.updateTimer=setTimeout("compile('count',false,'"+(noMapUpdate?"":"autoupdate")+"');",1000)}else{dirtysearch=true;srch.set_counts();gridlink_match.style.display="";disableLSelector()}dirtyNoMapTab();dirtyMap()};srch.title_html=function(item,field,obj){var advancedType=quicksearch=false;var value=desc_text=opt_text="";if(obj){advancedType=(obj.advanced?obj.advanced:false);value=(obj.value?obj.value:"");quicksearch=(obj.quicksearch?obj.quicksearch:false);desc_text=(obj.desc_text?obj.desc_text:"");opt_text=(obj.opt_text?obj.opt_text:"")}var html=new Array();if((!advancedType||advancedType=="none")&&!interfaceObj.idx){html.push('<div class="delbutton" onclick="removeCriteria(srch.get_parent(this));event.cancelBubble=true;'+(item.kind=="S"?"scrollflrelate_removeNode('s_"+item.unique_id+"');":"")+'" title="Remove '+field.display_val+' from this search">X</div>')}html.push('<div class="title click" id="'+item.unique_id+'_title" onclick="showHideBody(srch.get_parent(this));" title="Click to edit">');html.push('<div class="hangingindent">');var check_override=(quicksearch&&field.field_id=="status"&&field.table_name=="list");html.push('<input id="enabled_'+item.unique_id+'" onfocus="showHideBody(srch.get_parent(this),false,true);" type="checkbox" '+((check_override||(!quicksearch&&advancedType!="off"))?"checked":"")+' onclick="event.cancelBubble=true;srch.enable(srch.get_parent(this),this.checked);srch.update();"  /> ');var s_disp="";if(quicksearch||advancedType=="off"){s_disp=" style='display:none;' "}if(item.kind=="S"){if(item.tb=="feature"){html.push(srch.operator_html(item,"",(s_disp!="")));html.push(" "+item.d+" ")}else{html.push(" "+item.d+" ");html.push(srch.operator_html(item,"",(s_disp!="")))}}else{if(item.kind=="T"){html.push(item.d+" ");html.push(srch.operator_html(item,opt_text,(s_disp!="")))}else{if(item.kind=="D"||item.kind=="combo"){html.push(field.display_val);html.push(srch.operator_html(item,opt_text,(s_disp!="")))}else{if(item.kind=="room"){html.push(field.display_val)}else{html.push(field.display_val);html.push(srch.operator_html(item,"",(s_disp!="")))}}}}html.push('<span id="'+item.unique_id+'_desc" class="desc"'+s_disp+">");if(item.kind=="S"){html.push(srch.type[item.kind].describe(item.display_id,desc_text,item))}else{if(item.kind=="T"){html.push(srch.type.T.describe(desc_text,item))}else{if(item.kind=="D"){html.push(srch.type.D.describe(item,value))}else{html.push(srch.type[item.kind].describe(value,item))}}}html.push("</span>");html.push("</div>");html.push("</div>");return html.join("")};srch.desc_html=function(inner,cind,formatNumber){if(formatNumber&&inner&&!inner.toString().replace(/[0-9]/g,"")){inner=parseInt(inner,10).format(0,true)}return' <span class="searchdesc"  onmouseover="this.className=\'searchdesc_hover\'" onmouseout="this.className=\'searchdesc\'"'+(cind?'onclick="showHideBody(srch.get_parent(this),'+cind+');event.cancelBubble=true;"':"")+">"+inner+"</span> "};srch.update_html=function(item){return' <span id="'+item.unique_id+'_update" class="srchupdatelink" style="display:none;cursor:pointer;" onclick="updateFromSrchLink(this);fadeElemOut(this.id,1,false,0,50);" onmouseover="this.className=\'srchupdatelink_hover\';" onmouseout="this.className=\'srchupdatelink\';">Update</span> '};srch.operator_html=function(item,txt,hide){if(!txt){if(item.kind=="N"||item.kind=="I"||item.kind=="Z"){if(item.param_max&&item.c.split(" and ")[1]>=item.param_max){txt=(item.r=="X")?"not of":((item.range&&item.kind!="Z")?"in ranges of":"of")}else{txt=(item.r=="X")?"not between":((item.range&&item.kind!="Z")?"in ranges of":"between")}}if(item.kind=="S"){if(item.tb=="feature"){if(item.r=="R"){txt="and"}else{if(item.r=="X"){txt="not"}else{txt="or"}}}else{txt=(item.r=="X")?"not of":"of"}}}var s_disp=(hide?" style='display:none;' ":"");return' <span id="'+item.unique_id+'_operator" class="operator" onmouseover="this.className=\'operator_hover\';" onmouseout="this.className=\'operator\';" title="Click to change include/exclude"  onclick="srch.type[\''+item.kind+"'].operator(srch.get_parent(this));event.cancelBubble=true;\""+s_disp+">"+txt+"</span> "};srch.enable=function(item,checked,noEnableAll){var checkbox=document.getElementById("enabled_"+item.unique_id);var newCheckValue=(checked==undefined)?!checkbox.checked:checked;item.className=(newCheckValue)?"item":"itemDisabled";item.toggle=(newCheckValue?"on":"off");checkbox.checked=newCheckValue;if(item.range){enableDisableFullSearch(newCheckValue)}if(!noEnableAll&&newCheckValue&&item.kind=="specifiedlistings"&&item.r=="R"){disableAllNodesButMe(item)}else{if(!noEnableAll&&item.kind=="specifiedlistings"){enableAllNodesIfNoCarts()}}if(!noEnableAll&&newCheckValue&&item.kind=="cart"&&item.r=="R"){disableAllNodesButCarts()}else{if(!noEnableAll&&item.kind=="cart"){enableAllNodesIfNoCarts()}}var op="";var desc="";if(document.getElementById(item.unique_id+"_operator")){op=document.getElementById(item.unique_id+"_operator").innerHTML.replace(/(<([^>]+)>)/g,"")}if(item.kind=="specifiedlistings"){srch.type.specifiedlistings.popuptext(item,(item.toggle=="on"?"add":"remove"))}else{if(item.kind=="block"){desc=item.d.split(" at ")[1];op="at";d=item.d.split(" at ")[0]}else{if(document.getElementById(item.unique_id+"_desc")){desc=document.getElementById(item.unique_id+"_desc").innerHTML.replace(/(<([^>]+)>)/g,"");d=item.d}}}if(item.kind!="specifiedlistings"&&item.kind!="idxmlsnumber"){changeSearchText(d,op,desc,(item.toggle=="on"?"add":"remove"),item)}var enab=document.getElementById("enabled_"+item.unique_id);var op=document.getElementById(item.unique_id+"_operator");var desc=document.getElementById(item.unique_id+"_desc");if(enab&&enab.checked){if(op){op.style.display=""}if(desc){desc.style.display=""}}else{if(op){op.style.display="none"}if(desc){desc.style.display="none"}}};srch.srchables.push({name:"Listing Cart",srch_data:"LISTING CART",type:"cart"});srch.type.N={render:function(item,value,required,info,advanced){var html=new Array();item.range=info.match(":");if(item.range){info=info.substring(0,info.indexOf(":"));enableDisableFullSearch(true)}var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];var min="0";var max="";if(field.table_name=="picture"||field.table_name=="document"||field.table_name=="video"){min="1"}for(var x=0;x<field.display_len;x++){max+="9"}if(!value){item.c=value=min+" and "+max}else{if(field.table_name=="feature"){item.range=(value.match(/^[^\)]*\)\sin\sranges\sof\s(.+)/));if(item.range){var value=value.replace(/^[^\)]*\)\sin\sranges\sof\s(.+)/,"$1")}else{var value=value.replace(/^[^\)]*\)\sbetween\s(.+)/,"$1");var low=value.split(" and ")[0].replace(/'/g,"");var high=value.split(" and ")[1].replace(/'/g,"");if(isNaN(low)){low="0";value=""}if(isNaN(high)){high="";for(var x=0;x<field.display_len;x++){high+="9"}value=""}if(value==""){value=low+" and "+high}}}else{item.c=value}}item.display_id=info;item.tb=field.table_name;item.r=(!required||required=="Q")?"R":required;item.g="";item.param_max=max;item.param_min=min;item.field_length=field.display_len;if(field.table_name=="feature"){item.f="group_id";item.o="=";item.d=field.group.display_val+": "+field.display_val;item.c="'"+field.group.group_id+"' and detail_name='"+field.field_id+"'";if(value!=""){item.c+=" and decimal(data_value,15,2) "+((item.range)?"in ranges of":"between")+" "+value}}else{item.f=field.field_id;item.o=(item.range)?"in ranges of":"between";item.d=field.display_val}item.toggle=((!quicksearch&&advancedType!="off")?"on":"off");html.push(srch.title_html(item,field,{value:value,advanced:advancedType,quicksearch:quicksearch}));html.push('<div id="'+item.unique_id+'_body" class="body">');html.push(srch.type.N.render_inputs(item));html.push(srch.update_html(item));html.push("</div>");return html.join("")},operator:function(item){var optext="";var changeHTML=false;if(item.r=="X"){if(item.tb=="feature"){item.c=item.c.replace(/\)\sbetween\s/,") in ranges of ")}else{item.o="in ranges of"}item.r="R";optext="in ranges of";item.range=true;changeHTML=true}else{if(item.range){if(item.tb=="feature"){item.c=item.c.replace(/\)\sin\sranges\sof\s/,") between ")}else{item.o="between"}item.r="R";if(item.abridged_desc){optext="of"}else{optext="between"}item.range=false;changeHTML=true}else{item.r="X";if(item.abridged_desc){optext="not of"}else{optext="not between"}}}if(changeHTML){if(item.range){item.c=item.c.replace(/(\d+)\sand\s(\d+)/,"$1-$2");var value=(item.tb=="feature")?item.c.replace(/^[^\)]*\)\sin\sranges\sof\s(.+)/,"$1"):item.c;enableDisableFullSearch(true)}else{item.c=item.c.replace(/(\d+)-(\d+)/,"$1 and $2");var value=(item.tb=="feature")?item.c.replace(/^[^\)]*\)\sbetween\s(.+)/,"$1"):item.c;enableDisableFullSearch()}document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.N.describe(value,item);document.getElementById(item.unique_id+"_body").innerHTML=srch.type.N.render_inputs(item)+srch.update_html(item)}document.getElementById(item.unique_id+"_operator").innerHTML=optext;srch.enable(item,true);srch.update()},describe:function(value,item){var values=value.replace(/'/g,"");if(values==""){return""}if(item.range){changeSearchText(item.d,"in ranges of",value,(item.toggle=="on"?"add":"remove"),item);return srch.desc_html(value)}else{values=values.split(" and ");if(!values[0]){values[0]=""}if(!values[1]){values[1]=""}changeSearchText(item.d,(item.r=="X")?"not between":"between",value,(item.toggle=="on"?"add":"remove"),item);var desc_val="";var op=document.getElementById(item.unique_id+"_operator");if(item.param_max<=values[1]){if(values[0].replace(/0/g,"")==""){values[0]="0"}desc_val=srch.desc_html(values[0]+"+");item.abridged_desc=true;if(op){op.innerHTML=op.innerHTML.replace("between","of")}}else{desc_val=srch.desc_html(values[0])+(values[0]!="..."?" and"+srch.desc_html(values[1],1):"");if(op){op.innerHTML=op.innerHTML.replace("of","between")}item.abridged_desc=false}return desc_val}},compile:function(item){return[{tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"N"}]},change:function(item,noEnable){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[item.display_id]];if(item.range){var value=document.getElementById("range_"+item.unique_id).value}else{var tmp=document.getElementById("from_"+item.unique_id).value;var tmp2=document.getElementById("to_"+item.unique_id).value;if(!tmp2){tmp2=item.param_max}if(isNaN(tmp)){tmp=item.param_min}if(isNaN(tmp2)){tmp2=item.param_max}var value=tmp+" and "+tmp2}item.c=(item.tb=="feature")?"'"+field.group.group_id+"' and detail_name='"+field.field_id+"' and decimal(data_value,15,2) "+((item.range)?"in ranges of":"between")+" "+value:value;document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.N.describe(value,item);if(!noEnable){srch.enable(item,true)}srch.update()},render_inputs:function(item){if(item.range){var value=(item.tb=="feature")?item.c.replace(/^[^\)]*\)\sin\sranges\sof\s(.+)/,"$1"):item.c;var html=['<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"range_"+item.unique_id+'" id="range_'+item.unique_id+'" size="25" value="'+value+'" onchange="srch.type[\'N\'].change(srch.get_parent(this));">']}else{var value=(item.tb=="feature")?item.c.replace(/^[^\)]*\)\sbetween\s(.+)/,"$1"):item.c;var value_array=value.split(" and ");var low=value_array[0].replace(/'/g,"");var high=(value_array.length>1)?value.split(" and ")[1].replace(/'/g,""):"";var is_min=low==item.param_min;var is_max=high==item.param_max;var html=['<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"from_"+item.unique_id+'" id="from_'+item.unique_id+'" size="'+item.field_length+'" maxlength="20" '+(is_min?'class="srch_field_gray"':"")+' value="'+(is_min?"min":low)+'" onchange="this.value=verifyfloat(this.value,\''+item.param_min+"');srch.type['N'].change(srch.get_parent(this));\" onfocus=\"srch.check_for_grayed(this,'min');\" onblur=\"srch.set_grayed_fields(srch.get_parent(this),this.id,null);\">"];html.push(' to <input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"to_"+item.unique_id+'" id="to_'+item.unique_id+'" size="'+item.field_length+'" maxlength="20" '+(is_max?'class="srch_field_gray"':"")+' value="'+(is_max?"max":high)+"\" onchange=\"this.value=verifyfloat(this.value,'invalid');if(this.value=='invalid')this.value='';srch.type['N'].change(srch.get_parent(this));\" onfocus=\"srch.check_for_grayed(this,'max');\" onblur=\"srch.set_grayed_fields(srch.get_parent(this),null,this.id);\">")}return html.join("")}};srch.type.I={render:function(item,value,required,info,advanced){var html=new Array();item.range=info.match(":");if(item.range){info=info.substring(0,info.indexOf(":"));enableDisableFullSearch(true)}var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];var min="0";var max="";if(field.table_name=="picture"||field.table_name=="document"||field.table_name=="video"){min="1"}for(var x=0;x<field.display_len;x++){max+="9"}if(!value){item.c=value=min+" and "+max}else{if(field.table_name=="feature"){item.range=(value.match(/^[^\)]*\)\sin\sranges\sof\s(.+)/));if(item.range){var value=value.replace(/^[^\)]*\)\sin\sranges\sof\s(.+)/,"$1")}else{var value=value.replace(/^[^\)]*\)\sbetween\s(.+)/,"$1");var low=value.split(" and ")[0].replace(/'/g,"");var high=value.split(" and ")[1].replace(/'/g,"");if(isNaN(low)){low="0";value=""}if(isNaN(high)){high="";for(var x=0;x<field.display_len;x++){high+="9"}value=""}if(value==""){value=low+" and "+high}}}else{item.c=value}}item.display_id=info;item.tb=field.table_name;item.r=(!required||required=="Q")?"R":required;item.g="";item.param_max=max;item.param_min=min;item.field_length=field.display_len;if(field.table_name=="feature"){item.f="group_id";item.o="=";item.d=field.group.display_val+": "+field.display_val;item.c="'"+field.group.group_id+"' and detail_name='"+field.field_id+"'";if(value!=""){item.c+=" and integer(data_value) "+((item.range)?"in ranges of":"between")+" "+value}}else{item.f=field.field_id;item.o=(item.range)?"in ranges of":"between";item.d=field.display_val}item.toggle=((!quicksearch&&advancedType!="off")?"on":"off");html.push(srch.title_html(item,field,{value:value,advanced:advancedType,quicksearch:quicksearch}));html.push('<div id="'+item.unique_id+'_body" class="body">');html.push(srch.type.I.render_inputs(item));html.push(srch.update_html(item));html.push("</div>");return html.join("")},operator:function(item){var optext="";var changeHTML=false;var isDomItem=(item.tb=="report"&&(item.f=="dom"||item.f=="adom"||item.f=="cdom"));var rangeIsAvailable=(item.tb!="picture"&&item.tb!="video"&&item.tb!="document"&&!isDomItem);if(item.r=="X"&&rangeIsAvailable){if(item.tb=="feature"){item.c=item.c.replace(/\)\sbetween\s/,") in ranges of ")}else{item.o="in ranges of"}item.r="R";optext="in ranges of";item.range=true;changeHTML=true}else{if(item.range||(item.r=="X"&&!rangeIsAvailable)){if(item.tb=="feature"){item.c=item.c.replace(/\)\sin\sranges\sof\s/,") between ")}else{item.o="between"}item.r="R";if(item.abridged_desc){optext="of"}else{optext="between"}item.range=false;changeHTML=true}else{item.r="X";if(item.abridged_desc){optext="not of"}else{optext="not between"}}}if(changeHTML){if(item.range){item.c=item.c.replace(/(\d+)\sand\s(\d+)/,"$1-$2");var value=(item.tb=="feature")?item.c.replace(/^[^\)]*\)\sin\sranges\sof\s(.+)/,"$1"):item.c;enableDisableFullSearch(true)}else{item.c=item.c.replace(/(\d+)-(\d+)/,"$1 and $2");var value=(item.tb=="feature")?item.c.replace(/^[^\)]*\)\sbetween\s(.+)/,"$1"):item.c;enableDisableFullSearch()}document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.I.describe(value,item);document.getElementById(item.unique_id+"_body").innerHTML=srch.type.I.render_inputs(item)+srch.update_html(item)}document.getElementById(item.unique_id+"_operator").innerHTML=optext;srch.enable(item,true);srch.update()},describe:function(value,item){var values=value.replace(/'/g,"");if(values==""){return""}if(item.range){changeSearchText(item.d,"in ranges of",value,(item.toggle=="on"?"add":"remove"),item);return srch.desc_html(value)}else{values=values.split(" and ");if(!values[0]){values[0]=""}if(!values[1]){values[1]=""}changeSearchText(item.d,(item.r=="X")?"not between":"between",value,(item.toggle=="on"?"add":"remove"),item);var desc_val="";var op=document.getElementById(item.unique_id+"_operator");if(item.param_max<=values[1]){if(values[0].replace(/0/g,"")==""){values[0]="0"}desc_val=srch.desc_html(values[0]+"+");item.abridged_desc=true;if(op){op.innerHTML=op.innerHTML.replace("between","of")}}else{desc_val=srch.desc_html(values[0])+(values[0]!="..."?" and"+srch.desc_html(values[1],1):"");if(op){op.innerHTML=op.innerHTML.replace("of","between")}item.abridged_desc=false}return desc_val}},compile:function(item){return[{tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"I"}]},change:function(item,noEnable){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[item.display_id]];if(item.range){var value=document.getElementById("range_"+item.unique_id).value}else{var tmp=document.getElementById("from_"+item.unique_id).value;var tmp2=document.getElementById("to_"+item.unique_id).value;if(!tmp2){tmp2=item.param_max}if(isNaN(tmp)){tmp=item.param_min}if(isNaN(tmp2)){tmp2=item.param_max}var value=tmp+" and "+tmp2}item.c=(item.tb=="feature")?"'"+field.group.group_id+"' and detail_name='"+field.field_id+"' and integer(data_value) "+((item.range)?"in ranges of":"between")+" "+value:value;document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.I.describe(value,item);if(!noEnable){srch.enable(item,true)}srch.update()},render_inputs:function(item){if(item.range){var value=(item.tb=="feature")?item.c.replace(/^[^\)]*\)\sin\sranges\sof\s(.+)/,"$1"):item.c;var html=['<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"range_"+item.unique_id+'" id="range_'+item.unique_id+'" size="25" value="'+value+'" onchange="srch.type[\'I\'].change(srch.get_parent(this));">']}else{var value=(item.tb=="feature")?item.c.replace(/^[^\)]*\)\sbetween\s(.+)/,"$1"):item.c;var value_array=value.split(" and ");var low=value_array[0].replace(/'/g,"");var high=(value_array.length>1)?value.split(" and ")[1].replace(/'/g,""):"";var is_min=low==item.param_min;var is_max=high==item.param_max;var html=['<input type="text" '+(is_min?'class="srch_field_gray"':"")+" onkeypress=\"$('#"+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"from_"+item.unique_id+'" id="from_'+item.unique_id+'" size="'+item.field_length+'" maxlength="20" value="'+(low==item.param_min?"min":low)+'" onchange="this.value=verifyfloat(this.value,\''+item.param_min+"');srch.type['I'].change(srch.get_parent(this));\" onfocus=\"srch.check_for_grayed(this,'min');\" onblur=\"srch.set_grayed_fields(srch.get_parent(this),this.id,null);\">"];html.push(' to <input type="text" '+(is_max?'class="srch_field_gray"':"")+" onkeypress=\"$('#"+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"to_"+item.unique_id+'" id="to_'+item.unique_id+'" size="'+item.field_length+'" maxlength="20" value="'+(high==item.param_max?"max":high)+"\" onchange=\"this.value=verifyfloat(this.value,'invalid');if(this.value=='invalid')this.value='';srch.type['I'].change(srch.get_parent(this));\" onfocus=\"srch.check_for_grayed(this,'max');\" onblur=\"srch.set_grayed_fields(srch.get_parent(this),null,this.id);\">")}return html.join("")}};srch.type.Z={render:function(item,value,required,info){var html=new Array();var quicksearch=(required=="Q")?true:false;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];var min="0";var max="";for(var x=0;x<field.display_len-3;x++){max+="9"}if(!value){var low=min;var high=max;var low_zeroes="000";var high_zeroes="000"}else{var low,high;var low_zeroes=value.split(" and ")[0].toString().replace(/[^0-9]/g,"");var high_zeroes=value.split(" and ")[1].toString().replace(/[^0-9]/g,"");low=(low_zeroes.length>3)?low_zeroes.substring(0,low_zeroes.length-3):"0";low_zeroes=(low_zeroes.length>3)?low_zeroes.substr(low_zeroes.length-3,3):low_zeroes;while(low_zeroes.length<3){low_zeroes="0"+low_zeroes}high=(high_zeroes.length>3)?high_zeroes.substring(0,high_zeroes.length-3):"0";high_zeroes=(high_zeroes.length>3)?high_zeroes.substr(high_zeroes.length-3,3):high_zeroes;while(high_zeroes.length<3){high_zeroes="0"+high_zeroes}}item.param_min=min.toString()+(low_zeroes?low_zeroes:"");item.param_max=max.toString()+(high_zeroes?high_zeroes:"");item.display_id=info;item.tb=field.table_name;item.f=field.field_id;item.o="between";item.c=(!value)?"0 and "+high+"000":value;item.d=field.display_val;item.r=(!required||required=="Q")?"R":required;item.g="";item.toggle=(!quicksearch?"on":"off");var starting_min=parseInt(low.toString()+low_zeroes.toString(),10)==item.param_min;var starting_max=parseInt(high.toString()+high_zeroes.toString(),10)==item.param_max;html.push(srch.title_html(item,field,{value:item.c,advanced:false,quicksearch:quicksearch}));html.push('<div id="'+item.unique_id+'_body" class="body">');html.push('<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"from_"+item.unique_id+'" id="from_'+item.unique_id+'" size="'+(field.display_len-3)+'" maxlength="20" onfocus="srch.check_for_grayed(this,\'min\');"  value="'+(starting_min?"min":low)+'" onchange="srch.type[\'Z\'].change(srch.get_parent(this));" style="text-align:right;" '+(starting_min?"class='srch_field_gray'":"")+' onblur="srch.set_grayed_fields(srch.get_parent(this),this.id,null);" >');html.push('<input type="text" name="from_zeroes_'+item.unique_id+'" id="from_zeroes_'+item.unique_id+'" size="3" maxlength="3" value="'+(starting_min?"":low_zeroes)+'" onkeypress="fadeElemInSrchWrapper(\''+item.unique_id+"_update',0,false,1,50,true);\" onchange=\"this.value=verifyint(this.value,'000');srch.type['Z'].change(srch.get_parent(this));\" onblur=\"srch.set_grayed_fields(srch.get_parent(this),'from_"+item.unique_id+"',null);\">");html.push(" to ");html.push('<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"to_"+item.unique_id+'" id="to_'+item.unique_id+'" size="'+(field.display_len-3)+'" maxlength="20" onfocus="srch.check_for_grayed(this,\'max\');" value="'+(starting_max?"max":high)+'" onchange="srch.type[\'Z\'].change(srch.get_parent(this));" style="text-align:right;" '+(starting_max?"class='srch_field_gray'":"")+' onblur="srch.set_grayed_fields(srch.get_parent(this),null,this.id);">');html.push('<input type="text" name="to_zeroes_'+item.unique_id+'" id="to_zeroes_'+item.unique_id+'" size="3" maxlength="3" value="'+(starting_max?"":high_zeroes)+'" onkeypress="fadeElemInSrchWrapper(\''+item.unique_id+"_update',0,false,1,50,true);\" onchange=\"this.value=verifyint(this.value,'000');srch.type['Z'].change(srch.get_parent(this),false,true);\" onblur=\"srch.set_grayed_fields(srch.get_parent(this),null,'to_"+item.unique_id+"');\">");html.push(srch.update_html(item));html.push("</div>");return html.join("")},operator:function(item){item.r=(item.r=="X")?"R":"X";if(item.abridged_desc){document.getElementById(item.unique_id+"_operator").innerHTML=(item.r=="X")?"not of":"of"}else{document.getElementById(item.unique_id+"_operator").innerHTML=(item.r=="X")?"not between":"between"}srch.enable(item,true);srch.update()},describe:function(value,item){var values=value.replace(/'/g,"");if(values==""){return""}values=values.split(" and ");if(!values[0]){values[0]=""}if(!values[1]){values[1]=""}changeSearchText(item.d,(item.r=="X")?"not between":"between",value,(item.toggle=="on"?"add":"remove"),true);var desc_val="";var op=document.getElementById(item.unique_id+"_operator");if(item.param_max<=values[1]){if(values[0].replace(/0/g,"")==""){values[0]="0"}else{if(!isNaN(parseInt(values[0],10))){values[0]=parseInt(values[0],10)}}desc_val=srch.desc_html(values[0]+"+",false,true);item.abridged_desc=true;if(op){op.innerHTML=op.innerHTML.replace("between","of")}}else{desc_val=srch.desc_html(values[0],false,true)+(values[0]!="..."?" and "+srch.desc_html(values[1],2,true):"");if(op){op.innerHTML=op.innerHTML.replace("of","between")}item.abridged_desc=false}return desc_val},compile:function(item){return new Array({tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"Z"})},change:function(item,noEnable,highZero){var lower=document.getElementById("from_"+item.unique_id);var upper=document.getElementById("to_"+item.unique_id);var l_zeroes=document.getElementById("from_zeroes_"+item.unique_id);var u_zeroes=document.getElementById("to_zeroes_"+item.unique_id);if(highZero){try{var bto=upper.value;var bzeros=u_zeroes.value;if(parseInt(bzeros)!=0&&bto.replace(/[9]/g,"")==""&&bto.length>2){bto="0"}else{if(parseInt(bzeros)==0&&bto.replace(/[0]/g,"")==""){bto=item.param_max.substr(0,item.param_max.length-3)}}upper.value=bto;u_zeroes.value=bzeros}catch(e){}}if(!isNaN(lower.value)&&l_zeroes.value==""){document.getElementById("from_zeroes_"+item.unique_id).value="000"}if(!isNaN(upper.value)&&u_zeroes.value==""){u_zeroes.value="000"}var lower_val=lower.value;var upper_val=upper.value;var l_z_val=l_zeroes.value;var u_z_val=u_zeroes.value;if(parseInt(l_z_val,10)>0&&isNaN(lower_val)){lower_val=0;lower.value=0}if(parseInt(u_z_val,10)>0&&isNaN(upper_val)){upper_val=0;upper.value=0}var tmp=lower_val+""+l_z_val;var tmp2=upper_val+""+u_z_val;if(isNaN(tmp)){tmp=item.param_min}if(isNaN(tmp2)){tmp2=item.param_max}item.c=tmp+" and "+tmp2;document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.Z.describe(item.c,item);if(!noEnable){srch.enable(item,true)}srch.update()}};srch.type.Y={render:function(item,value,required,info,advanced){var html=new Array();var checkd='checked="checked"';var advancedType=(advanced==null)?"none":advanced;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];if(required=="Q"){required="O";checkd=""}else{if(advancedType=="off"){checkd=""}else{if(required==null){checkd=""}}}if(field.table_name=="supplement"||field.table_name=="vtour"||field.table_name=="anybedroomonmain"){item.f=field.field_id}else{item.f="group_id"}if(field.table_name=="feature"){item.c="'"+field.group.group_id+"' and detail_name='"+field.field_id+"'"}else{item.c=value}item.display_id=info;item.display_val=field.display_val;item.tb=field.table_name;item.o="=";item.d=field.group.display_val+": "+field.display_val;item.r=(!required)?"O":required;item.g="";if(item.r=="X"){var operator_word="not"}else{if(item.r=="R"){var operator_word="and"}else{var operator_word="or"}}html.push('<input type="checkbox" name="check_'+item.unique_id+'" id="check_'+item.unique_id+'" '+checkd+" onclick=\"srch.type['Y'].change(this.parentNode);\" /> ");html.push(' <span id="'+item.unique_id+'_operator" class="operator" title="Click to change and/or/not" onclick="srch.type[\'Y\'].operator(this.parentNode);">'+operator_word+"</span> ");html.push('<span class="desc"><label for="check_'+item.unique_id+'">'+field.display_val+"</label></span>");return html.join("")},change:function(item,noEnable){var li_item=item.parentNode.parentNode.parentNode.parentNode.parentNode;document.getElementById(li_item.unique_id+"_desc").innerHTML=srch.type.group.describe(li_item);if(!noEnable){srch.enable(li_item,true)}srch.update()},operator:function(item){if(item.r=="O"){item.r="X";document.getElementById(item.unique_id+"_operator").innerHTML="not"}else{if(item.r=="X"){item.r="R";document.getElementById(item.unique_id+"_operator").innerHTML="and"}else{item.r="O";document.getElementById(item.unique_id+"_operator").innerHTML="or"}}if(document.getElementById("check_"+item.unique_id)){document.getElementById("check_"+item.unique_id).checked=true}var li_item=item.parentNode.parentNode.parentNode.parentNode.parentNode;document.getElementById(li_item.unique_id+"_desc").innerHTML=srch.type.group.describe(li_item);srch.enable(li_item,true);srch.update()}};srch.type.S={render:function(item,value,required,info){var html=new Array();var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];var quicksearch=(required=="Q"&&field.field_id!="status")?true:false;var scrolltype=fbs_scroll_type;if(!quicksearch&&!value){value="";for(var x=0;x<field.items.length;x++){if(field.items[x].selected){value+=(value=="")?"'"+field.items[x].value+"'":",'"+field.items[x].value+"'"}}}if(field.table_name=="feature"){value=value.replace(/^[^\(]*\(([^\)]+)\)/,"$1")}item.display_id=info;item.tb=field.table_name;item.g="";if(field.map_area_autocomplete){item.lookup_name=field.map_area_autocomplete.lookup_name;item.map_cache_id=field.map_area_autocomplete.map_cache_id}if(interfaceObj.idx&&field.table_name=="list"&&field.field_id=="status"&&js_ma_tech_id!="20070913202326493241000000"){item.style.display="none"}if(interfaceObj.idx&&field.table_name=="list"&&field.field_id=="status"&&interfaceObj.closed_on_idx=="Y"){item.style.display="block"}if(field.table_name=="feature"){item.f="group_id";item.o="=";item.c="'"+field.group.group_id+"' and detail_name='"+field.field_id+"'";if(value&&value.indexOf("and detail_name=")<0){item.c+=" and scroll_value in ("+value+")"}item.d=field.group.display_val+": "+field.display_val;item.r=(!required||required=="Q")?"O":required;var re=/^[^\(]*\(([^\)]+)\)/;var re_match=item.c.match(re);var txt_value=(re_match)?item.c.replace(re,"$1"):""}else{item.f=field.field_id;item.o="in";item.c=(value!=""&&value.split(",").length==1&&!value.match(/^[\'].+[\']$/))?"'"+value+"'":value;item.d=field.display_val;item.r=(!required||required=="Q")?"R":required;var txt_value=item.c}item.toggle=(!quicksearch?"on":"off");html.push(srch.title_html(item,field,{value:value,advanced:false,quicksearch:quicksearch,desc_text:txt_value}));html.push('<div id="'+item.unique_id+'_body" class="body">');if(scrolltype=="checkbox"){var columnCount=0;var valuetrim=txt_value.toLowerCase().trim();html.push('<table cellpadding="0" cellspacing="0" border="0" style="width:100%;">');for(var i=0;i<field.items.length;i++){var scroll_item=field.items[i];columnCount++;if(columnCount==1){html.push("<tr>")}html.push('<td><input type="checkbox" name="c_'+i+"_"+item.unique_id+'" id="c_'+i+"_"+item.unique_id+'" value="'+scroll_item.value+'" onchange="srch.type[\'S\'].change(srch.get_parent(this), this);" ');if(!quicksearch&&((txt_value!=""&&valuetrim.match("'"+scroll_item.value.toLowerCase().trim()+"'"))||(txt_value==""&&scroll_item.selected))){html.push(' checked="checked"')}html.push(' /> <label for="c_'+i+"_"+item.unique_id+'">'+scroll_item.description+"</label></td>");if(columnCount==3){html.push("</tr>");columnCount=0}}while(columnCount<3){html.push("<td></td>");columnCount++}html.push("</tr></table>")}else{var select_size=(field.items.length<scrollsize)?field.items.length:scrollsize;html.push('<select name="s_'+item.unique_id+'" id="s_'+item.unique_id+'" onkeydown="delayScrollRelate(srch.get_parent(this));" onchange="srch.type[\'S\'].change(srch.get_parent(this), this);scrollflrelate_checkRelated(this, false, \'s_'+item.unique_id+'\');" size="'+select_size+'" multiple>');var valuetrim=txt_value.toLowerCase().trim();var s_field_items=field.items;if(use_status_sort(field.field_id)){s_field_items.sort(status_sort)}for(var i=0;i<s_field_items.length;i++){var scroll_item=s_field_items[i];if(select_size!=1&&scroll_item.value==""){continue}if(interfaceObj.idx&&field.table_name=="list"&&field.field_id=="status"){if((interfaceObj.closed_on_idx=="Y"&&scroll_item.value=="C")||(interfaceObj.pending_on_idx=="Y"&&scroll_item.value=="P")||(scroll_item.value=="A"||scroll_item.value.indexOf("AWC_")>=0)){}else{continue}}html.push('<option value="'+scroll_item.value+'"');if(item.tb=="feature"&&!quicksearch&&((txt_value!=""&&scroll_item.description!=""&&valuetrim.indexOf("'"+scroll_item.description.toLowerCase().trim()+"'")>=0)||(txt_value==""&&scroll_item.selected))){html.push(" selected")}else{if(!quicksearch&&((txt_value!=""&&scroll_item.value!=""&&valuetrim.indexOf("'"+scroll_item.value.toLowerCase().trim()+"'")>=0)||(txt_value==""&&scroll_item.selected))){html.push(" selected")}}html.push(">"+scroll_item.description+"</option>")}html.push("</select>")}html.push('<br><center><span class="searchdesc" onmouseover="this.className=\'searchdesc_hover\';" onmouseout="this.className=\'searchdesc\';" onclick="srch.type[\'S\'].showall(srch.get_parent(this));" style="cursor:pointer;">See All...</span>');if(field.map_area_autocomplete){html.push(' &nbsp; <span class="searchdesc" onmouseover="this.className=\'searchdesc_hover\';" onmouseout="this.className=\'searchdesc\';" onclick="enableMappingAutoPopulation(srch.get_parent(this), \'S\', srch.get_parent(this).c, srch.get_parent(this).lookup_name, srch.get_parent(this).map_cache_id);" style="cursor:pointer;">Find via Map Areas...</span>')}html.push("</center></div>");if(item.tb!="feature"){html.push('<script defer>scrollflrelate_setup("'+item.f+'","s_'+item.unique_id+'");<\/script>')}return html.join("")},showall:function(item){var mm=document.getElementById("modalmask");var mc=document.getElementById("modalcontent");if(browser_type=="IE"){$(mc).hide()}mc.innerHTML="";var html=new Array();html.push("<div class=\"modaldelbutton\" onclick=\"srch.type['S'].closeall('"+item.unique_id+'\');" title="Close">X</div><div class="modaltitle">'+item.d+"</div>");html.push('<div class="modalbody">');var s=document.getElementById("s_"+item.unique_id);html.push("<table width=100% align=center border=0 cellspacing=5px>");var x;for(x=0;x<s.childNodes.length;x++){if(x%3==0){if(x!=0){html.push("</tr>")}html.push("<tr>")}html.push('<td valign=middle width="15px"><input type="checkbox" name="c_'+item.unique_id+"_"+x+'" id="c_'+item.unique_id+"_"+x+'" value="'+s.childNodes[x].value+'" '+(s.childNodes[x].selected?"checked":"")+"></td>");var disp=s.childNodes[x].innerHTML;html.push('<td valign=middle width="120px"><label for="c_'+item.unique_id+"_"+x+'" title="'+s.childNodes[x].innerHTML+'">'+disp+"</label></td>")}while(x%3!=0){html.push("<td>&nbsp;</td>");x++}html.push("</tr></table></div>");html.push('<div style="padding-top:'+(browser_type=="IE"?"8":"5")+'px;">');var sp='<span class="searchdesc" style="cursor:pointer;" onmouseover="this.className=\'searchdesc_hover\';" onmouseout="this.className=\'searchdesc\';" onclick="srch.type[\'S\'].';if(interfaceObj.scroll_sel_all_link){html.push(sp+"checkall('"+item.unique_id+"','on');\">Select All</span> &nbsp; ")}html.push(sp+"checkall('"+item.unique_id+"','off');\">Select None</span>");html.push("<br> "+sp+"closeall('"+item.unique_id+"');\"><b>Finished</b></span>");html.push("</div>");mc.innerHTML=html.join("");if(browser_type=="IE"){mm.style.display="block";$(mc).animate({opacity:"show"},function(){document.getElementById("modalshim").style.display="block"})}else{$(mm).animate({opacity:"show"},function(){document.getElementById("modalshim").style.display="block"})}resizeModalDia()},checkall:function(item_id,mode){if(mode=="on"){mode=true}else{mode=false}var count=document.getElementById("s_"+item_id).childNodes.length;for(var x=0;x<count;x++){document.getElementById("c_"+item_id+"_"+x).checked=mode}},closeall:function(item_id){var sel=document.getElementById("s_"+item_id);var item=srch.get_parent(sel);for(var x=0;x<sel.childNodes.length;x++){sel.childNodes[x].selected=document.getElementById("c_"+item_id+"_"+x).checked}document.getElementById("modalshim").style.display="none";if(browser_type=="IE"){$("#modalcontent").animate({opacity:"hide"},function(){document.getElementById("modalmask").style.display="none"})}else{$("#modalmask").animate({opacity:"hide"})}srch.type.S.change(item,sel);scrollflrelate_checkRelated(sel,false,"s_"+item.unique_id)},compile:function(item){var qs=new Array();qs.push({tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"S"});return qs},describe:function(display_id,value,item){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[display_id]];var desc="";if(!value||value=="''"){return'<span class="searchdescempty"  onmouseover="this.className=\'searchdescempty_hover\'" onmouseout="this.className=\'searchdescempty\'">select...</span>'}for(var y=0;y<field.items.length;y++){if(value.indexOf("'"+field.items[y].value+"'")>=0&&field.items[y].value!=""){desc+=(desc=="")?field.items[y].description:", "+field.items[y].description}}if(item.tb=="feature"){var op=(item.r=="O"?"or":(item.r=="X"?"not":"and"))}else{var op=(item.r=="X"?"not of":"of")}changeSearchText(item.d,op,desc,(item.toggle=="on"?"add":"remove"));return((field&&field.table_name=="feature"&&desc!="")?"of ":"")+srch.desc_html(desc)},operator:function(item){if(item.tb=="feature"){if(item.r=="O"){item.r="X";document.getElementById(item.unique_id+"_operator").innerHTML="not"}else{if(item.r=="X"){item.r="R";document.getElementById(item.unique_id+"_operator").innerHTML="and"}else{item.r="O";document.getElementById(item.unique_id+"_operator").innerHTML="or"}}}else{item.r=(item.r=="X")?"R":"X";document.getElementById(item.unique_id+"_operator").innerHTML=(item.r=="X")?"not of":"of"}srch.enable(item,true);srch.update()},change:function(item,scroll,noUpdate,noEnable){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[item.display_id]];var value="";var scrolltype=fbs_scroll_type;if(scrolltype=="checkbox"){var boxes=item.getElementsByTagName("input");for(var x=0;x<boxes.length;x++){if(boxes[x].checked){value+=(value=="")?"'"+boxes[x].value+"'":",'"+boxes[x].value+"'"}}}else{for(var x=0;x<scroll.options.length;x++){if(scroll.options[x].selected){value+=(value=="")?"'"+scroll.options[x].value+"'":",'"+scroll.options[x].value+"'"}}}if(item.tb=="feature"){item.c="'"+field.group.group_id+"' and detail_name='"+field.field_id+"' and scroll_value in ("+value+")"}else{item.c=value}document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.S.describe(item.display_id,value,item);if(scroll.selectedIndex==-1&&!noEnable){srch.enable(item,false)}else{if(!noEnable){srch.enable(item,true)}}if(!noUpdate){srch.update()}},autopop:function(item_id,value){var select_box=document.getElementById("s_"+item_id);var selected_array=value.replace(/^'/,"").replace(/'$/,"").split(",");var selected=false;select_box.onchange="return false;";for(var x=0;x<select_box.options.length;x++){selected=false;for(var y=0;y<selected_array.length;y++){if(select_box.options[x].value==selected_array[y]){selected=true;selected_array.splice(y,1);break}}select_box.options[x].selected=selected}select_box.onchange=function(){srch.type.S.change(srch.get_parent(this),this);scrollflrelate_checkRelated(this,false,this.id)};srch.type.S.change(srch.get_parent(select_box),select_box);scrollflrelate_checkRelated(select_box,false,"s_"+item_id)}};srch.type.T={render:function(item,value,required,info){var html=new Array();var quicksearch=(required=="Q")?true:false;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];if(!value){value=""}item.display_id=info;item.tb=field.table_name;item.g="";item.c=value;item.fake_num=false;if(field.map_area_autocomplete){item.lookup_name=field.map_area_autocomplete.lookup_name;item.map_cache_id=field.map_area_autocomplete.map_cache_id}if(field.field_id=="house_nbr"||field.range_text){if(field.field_id=="house_nbr"){item.fake_num=true}item.text_range=true}else{item.text_range=false}var maxlen="1000";var txt_value="";var txt_value2="";if(field.table_name=="feature"){item.f="group_id";item.o="=";item.d=field.group.display_val+": "+field.display_val;item.r=(!required||required=="Q")?"O":required;var re=/^[^=]*='([^']+)'[^']*'([^']+)'/;var re_match=item.c.match(re);if(!re_match){re=/^data_value like '([^']+)'/;txt_value=(item.c.match(re))?txt_value=item.c.replace(re,"$1"):""}else{txt_value=item.c.replace(re,"$2")}item.c="'"+field.group.group_id+"' and detail_name='"+field.field_id+"'";if(txt_value){item.c+=" and data_value like "+txt_value}}else{item.f=field.field_id;item.d=field.display_val;item.r=(!required||required=="Q")?"R":required;item.o="like";txt_value=item.c;if(item.text_range){if(item.c.split(" and ").length>1){txt_value=item.c.split(" and ")[0]?item.c.split(" and ")[0].replace(/^[\']/,"").replace(/[\']$/,""):"";txt_value2=item.c.split(" and ")[1]?item.c.split(" and ")[1].replace(/^[\']/,"").replace(/[\']$/,""):"";item.o="between";if(item.fake_num){maxlen="10"}}else{item.o=(item.fake_num?"=":"like");txt_value=item.c.replace(/^'/,"").replace(/'$/,"")}}}item.toggle=((!quicksearch)?"on":"off");if(item.text_range){if(item.fake_num){opttext=(txt_value2?"between":((item.r=="X")?"is not":"is"))}else{opttext=(txt_value2?"between":((item.r=="X")?"not like":"like"))}}else{opttext=(item.r=="X")?"not like":"like"}html.push(srch.title_html(item,field,{value:value,advanced:false,quicksearch:quicksearch,desc_text:(txt_value2!=""?(txt_value+" and "+txt_value2):txt_value),opt_text:opttext}));html.push('<div id="'+item.unique_id+'_body" class="body">');if(txt_value2!=""){html.push('<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"t_"+item.unique_id+'" id="t_'+item.unique_id+'" size="10" maxlength="'+maxlen+'" value="'+txt_value+'" onchange="srch.type[\'T\'].change(srch.get_parent(this));"> and <input type="text" name="tmax_'+item.unique_id+'" id="tmax_'+item.unique_id+'" size="10" maxlength="'+maxlen+'" value="'+txt_value2+'" onkeypress="fadeElemInSrchWrapper(\''+item.unique_id+"_update',0,false,1,50,true);\" onchange=\"srch.type['T'].change(srch.get_parent(this));\">")}else{html.push('<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"t_"+item.unique_id+'" id="t_'+item.unique_id+'" size="25" maxlength="'+maxlen+'" value="'+txt_value+'" onchange="srch.type[\'T\'].change(srch.get_parent(this));">')}html.push(srch.update_html(item));if(field.map_area_autocomplete){html.push("<br><center><span class=\"searchdesc\" onmouseover=\"this.className='searchdesc_hover';\" onmouseout=\"this.className='searchdesc';\" onclick=\"enableMappingAutoPopulation(srch.get_parent(this), 'T', document.getElementById('t_"+item.unique_id+'\').value, srch.get_parent(this).lookup_name, srch.get_parent(this).map_cache_id);" style="cursor:pointer;">Find via Map Areas...</span></center>')}html.push("</div>");return html.join("")},operator:function(item){var oper=document.getElementById(item.unique_id+"_operator");if(!item.text_range){item.r=(item.r=="X")?"R":"X";oper.innerHTML=(item.r=="X")?"not like":"like"}else{var bod=document.getElementById(item.unique_id+"_body");var txt_value=document.getElementById("t_"+item.unique_id).value;if((item.fake_num&&oper.innerHTML=="is")||(item.f!="house_nbr"&&oper.innerHTML=="like")){oper.innerHTML=(item.fake_num?"is not":"not like");item.r="X";item.o=(item.fake_num?"=":"like")}else{if((item.fake_num&&oper.innerHTML=="is not")||(item.f!="house_nbr"&&oper.innerHTML=="not like")){oper.innerHTML="between";if(txt_value.replace(/\s+/g)==""&&item.fake_num){txt_value="0"}if(!item.fake_num){txt_value=(txt_value?txt_value.split(",")[0]:"")}bod.innerHTML='<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"t_"+item.unique_id+'" id="t_'+item.unique_id+'" size="10" maxlength="'+(item.fake_num?"10":"1000")+'" value="'+txt_value+'" onchange="srch.type[\'T\'].change(srch.get_parent(this));"> and <input type="text" name="tmax_'+item.unique_id+'" id="tmax_'+item.unique_id+'" size="10" maxlength="'+(item.fake_num?"10":"1000")+'" onkeypress="fadeElemInSrchWrapper(\''+item.unique_id+'_update\',0,false,1,50,true);" value="'+txt_value+'" onchange="srch.type[\'T\'].change(srch.get_parent(this));">';bod.innerHTML+=srch.update_html(item);item.r="R";item.o="between"}else{oper.innerHTML=(item.fake_num?"is":"like");bod.innerHTML='<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"t_"+item.unique_id+'" id="t_'+item.unique_id+'" size="25" maxlength="1000" value="'+txt_value+'" onchange="srch.type[\'T\'].change(srch.get_parent(this));">';bod.innerHTML+=srch.update_html(item);item.r="R";item.o=(item.fake_num?"=":"like")}}}if(item.r=="R"&&item.tb=="feature"){item.r="O"}srch.type.T.change(item);srch.enable(item,true);srch.update()},describe:function(value,item){if(value==""){return srch.desc_html("...")}else{var op="";if(item.text_range&&item.o=="between"){op="between"}else{op=(item.r=="X")?"not like":"like"}changeSearchText(item.d,op,value,(item.toggle=="on"?"add":"remove"));return srch.desc_html(value)}},compile:function(item){try{if(item.text_range&&item.o=="between"){var new_c=item.c.split("and");var first=new_c[0].trim()&&new_c[0].trim().replace(/[\']/g,"")?new_c[0].trim():(new_c[1].trim()&&new_c[1].trim().replace(/[\']/g,"")?new_c[1].trim():new_c[0].trim());var second=(new_c[1].trim()&&new_c[1].trim().replace(/[\']/g,"")?new_c[1].trim():new_c[0].trim());first=first.replace(/^[\']/,"").replace(/[\']$/,"");second=second.replace(/^[\']/,"").replace(/[\']$/,"");if(item.fake_num){first=first.replace(/[^0-9]/g,"")||0;second=second.replace(/[^0-9]/g,"")||0;first=parseInt(first,10);second=parseInt(second,10);if(first>second){var tmp=first;first=second;second=tmp}}else{if(first.toUpperCase()>second.toUpperCase()){var tmp=first;first=second;second=tmp}}item.c="'"+first+"' and '"+second+"'"}}catch(e){}return new Array({tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"T"})},change:function(item,noEnable){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[item.display_id]];if(item.text_range&&document.getElementById("tmax_"+item.unique_id)){if(item.fake_num){document.getElementById("t_"+item.unique_id).value=document.getElementById("t_"+item.unique_id).value.replace(/[^0-9]/g,"");document.getElementById("tmax_"+item.unique_id).value=document.getElementById("tmax_"+item.unique_id).value.replace(/[^0-9]/g,"")}var quote="'";if(item.fake_num){quote=""}txt_value=quote+document.getElementById("t_"+item.unique_id).value+quote+" and "+quote+document.getElementById("tmax_"+item.unique_id).value+quote}else{txt_value=document.getElementById("t_"+item.unique_id).value}if(item.tb=="feature"){item.c="'"+field.group.group_id+"' and detail_name='"+field.field_id+"' and data_value like '"+txt_value+"'"}else{if(item.fake_num&&!document.getElementById("tmax_"+item.unique_id)){item.c="'"+txt_value+"'"}else{item.c=txt_value}}document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.T.describe(txt_value,item);if(txt_value==""&&!noEnable){srch.enable(item,false)}else{if(!noEnable){srch.enable(item,true)}}srch.update()},autopop:function(item_id,value){var input_field=document.getElementById("t_"+item_id);input_field.value=value;srch.type.T.change(srch.get_parent(input_field))}};srch.type.D={render:function(item,value,required,info,advanced){var html=new Array();var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];item.relative=false;var startRelative=false;item.display_id=info;item.tb=field.table_name;item.r=(!required||required=="Q")?"R":required;item.g="";if(field.table_name=="feature"){item.f="group_id";item.o="=";item.d=field.group.display_val+": "+field.display_val}else{item.f=field.field_id;item.o="between";item.d=field.display_val}item.toggle=((!quicksearch&&advancedType!="off")?"on":"off");var lowRange;var highRange;if(field.def&&field.def.split(" and ")[1]){lowRange=field.def.split(" and ")[0];highRange=field.def.split(" and ")[1]}else{var tmpLow=new Date();var tmpHigh=new Date();tmpLow.setYear(tmpLow.getFullYear()-1);tmpHigh.setYear(tmpHigh.getFullYear()+10);lowRange=tmpLow.getTime();highRange=tmpHigh.getTime()}var minDate=new Date();minDate.setTime(parseInt(lowRange,10));var maxDate=new Date();maxDate.setTime(parseInt(highRange,10));item.min=((minDate.getMonth()+1<10)?"0":"")+(minDate.getMonth()+1)+"/"+minDate.getDate()+"/"+minDate.getFullYear();item.max=((maxDate.getMonth()+1<10)?"0":"")+(maxDate.getMonth()+1)+"/"+maxDate.getDate()+"/"+maxDate.getFullYear();if(!value){var low=item.min;var high=item.max;item.c="'"+low+"' and '"+high+"'";value=item.c}else{if(field.table_name=="feature"){if(value.indexOf("between")>=0){value=value.substr(value.indexOf("between")+8);var low=value.split(" and ")[0].replace(/'/g,"");var high=value.split(" and ")[1].replace(/'/g,"")}else{var low=item.min;var high=item.max;value="'"+low+"' and '"+high+"'"}item.c="'"+field.group.group_id+"' and detail_name='"+field.field_id+"' and date(data_value) between "+value}else{if(field.table_name=="tour"||field.table_name=="openhouse"){item.relative=true;if(value&&value.split(" and ").length>1){startRelative=false;var low=value.split(" and ")[0].replace(/'/g,"");var high=value.split(" and ")[1].replace(/'/g,"");item.c=value;item.f=item.f.replace(/_relative$/,"_date")}else{startRelative=true;if(!value||value==""||isNaN(value)){value=7}item.c=value;item.f=item.f.replace(/_date$/,"_relative")}}else{var low=value.split(" and ")[0].replace(/'/g,"");var high=value.split(" and ")[1].replace(/'/g,"");item.c=value}}}html.push(srch.title_html(item,field,{value:value,advanced:advancedType,quicksearch:quicksearch,opt_text:((startRelative)?"in the next":(item.r=="X")?"not between":"between")}));html.push('<div id="'+item.unique_id+'_body" class="body">');if(!startRelative){html.push('<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"from_"+item.unique_id+'" id="from_'+item.unique_id+'" size="10" maxlength="10" value="'+low+'" onchange="this.value=verifydate(this.value,\''+item.min+"');srch.type['D'].change(srch.get_parent(this));\">");html.push('<img src="/images/datepicker.gif" alt="" class="datepicker" align="absbottom" onclick="popCalEditWrapper(this,document.inputform.from_'+item.unique_id+",'mm/dd/yyyy',document.getElementById('enabled_"+item.unique_id+"'));\">");html.push(" to ");html.push("<input onkeypress=\"$('#"+item.unique_id+"_update').animate({'opacity':'show'});\" type=\"text\" name=\"to_"+item.unique_id+'" id="to_'+item.unique_id+'" size="10" maxlength="10" value="'+high+'" onchange="this.value=verifydate(this.value,\''+item.max+"');srch.type['D'].change(srch.get_parent(this));\">");html.push('<img src="/images/datepicker.gif" alt="" class="datepicker" align="absbottom" onclick="popCalEditWrapper(this,document.inputform.to_'+item.unique_id+",'mm/dd/yyyy',document.getElementById('enabled_"+item.unique_id+"'));\">")}else{html.push('in the next <input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"from_"+item.unique_id+'" id="from_'+item.unique_id+'" size="3" maxlength="5" value="'+value+"\" onchange=\"this.value=verifyint(this.value,'7');srch.type['D'].change(srch.get_parent(this));\"> <b>days</b>");item.g="relative"}html.push(srch.update_html(item));html.push("</div>");return html.join("")},describe:function(item,value){var values=value.replace(/'/g,"");if(values==""){return""}if(document.getElementById(item.unique_id+"_operator")){var op=document.getElementById(item.unique_id+"_operator").innerHTML}else{if(item.relative){var op="in the next"}else{var op=(item.r=="X")?"not between":"between"}}changeSearchText(item.d,op,values,(item.toggle=="on"?"add":"remove"));if(item.relative&&values.split(" and ").length==1){return srch.desc_html(values+(value!="..."?" days":""),0)}else{values=values.split(" and ");if(!values[0]){values[0]=""}if(!values[1]){values[1]=""}return srch.desc_html(values[0])+" and "+srch.desc_html(values[1],1)}},operator:function(item){if(!item.relative){item.r=(item.r=="X")?"R":"X";document.getElementById(item.unique_id+"_operator").innerHTML=(item.r=="X")?"not between":"between"}else{var from=document.getElementById("from_"+item.unique_id).value;var dbod=document.getElementById(item.unique_id+"_body");var curop=document.getElementById(item.unique_id+"_operator");var desc=document.getElementById(item.unique_id+"_desc");var fromDate=new Date();item.g="";if(curop.innerHTML=="between"){item.r="X";curop.innerHTML="not between";item.f=item.f.replace(/_relative$/,"_date")}else{if(curop.innerHTML=="not between"){item.r="R";item.g="relative";var to=document.getElementById("to_"+item.unique_id).value;var toDate=new Date(to);var range=Math.ceil((toDate.getTime()-fromDate.getTime())/(1000*60*60*24));if(range<0){range=7}item.c=range;range=range.toString();dbod.innerHTML='in the next <input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"from_"+item.unique_id+'" id="from_'+item.unique_id+'" size="3" maxlength="5" value="'+range+"\" onchange=\"this.value=verifyint(this.value,'7');srch.type['D'].change(srch.get_parent(this));\"> <b>days</b>";dbod.innerHTML+=srch.update_html(item);curop.innerHTML="in the next";desc.innerHTML=srch.type.D.describe(item,range);item.f=item.f.replace(/_date$/,"_relative")}else{item.r="R";var html=new Array();var toDate=new Date();toDate.setDate(toDate.getDate()+parseInt(from));var formatFrom=(fromDate.getMonth()+1)+"/"+fromDate.getDate()+"/"+fromDate.getFullYear();var formatTo=(toDate.getMonth()+1)+"/"+toDate.getDate()+"/"+toDate.getFullYear();html.push('<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"from_"+item.unique_id+'" id="from_'+item.unique_id+'" size="10" maxlength="10" value="'+formatFrom+'" onchange="this.value=verifydate(this.value,\''+item.min+"');srch.type['D'].change(srch.get_parent(this));\">");html.push('<img src="/images/datepicker.gif" alt="" class="datepicker" align="absbottom" onclick="popCalEditWrapper(this,document.inputform.from_'+item.unique_id+",'mm/dd/yyyy',document.getElementById('enabled_"+item.unique_id+"'));\">");html.push(" to ");html.push('<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"to_"+item.unique_id+'" id="to_'+item.unique_id+'" size="10" maxlength="10" value="'+formatTo+'" onchange="this.value=verifydate(this.value,\''+item.max+"');srch.type['D'].change(srch.get_parent(this));\">");html.push('<img src="/images/datepicker.gif" alt="" class="datepicker" align="absbottom" onclick="popCalEditWrapper(this,document.inputform.to_'+item.unique_id+",'mm/dd/yyyy',document.getElementById('enabled_"+item.unique_id+"'));\">");html.push(srch.update_html(item));dbod.innerHTML=html.join("");curop.innerHTML="between";desc.innerHTML=srch.type.D.describe(item,"'"+formatFrom+" and "+formatTo+"'");item.c="'"+formatFrom+" and "+formatTo+"'";item.f=item.f.replace(/_relative$/,"_date")}}}srch.enable(item,true);srch.update()},compile:function(item){return[{tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"D"}]},change:function(item,noEnable){var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[item.display_id]];var tmp,tmp2,value,descval;if(item.relative){var from=document.getElementById("from_"+item.unique_id).value;var dbod=document.getElementById(item.unique_id+"_body");var curop=document.getElementById(item.unique_id+"_operator").innerHTML;if(curop=="between"||curop=="not between"){descval=value="'"+document.getElementById("from_"+item.unique_id).value+"' and '"+document.getElementById("to_"+item.unique_id).value+"'"}else{descval=document.getElementById("from_"+item.unique_id).value;value=descval}}else{descval=value="'"+document.getElementById("from_"+item.unique_id).value+"' and '"+document.getElementById("to_"+item.unique_id).value+"'"}item.c=(item.tb=="feature")?"'"+field.group.group_id+"' and detail_name='"+field.field_id+"' and date(data_value) between "+value:value;document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.D.describe(item,descval);if(!noEnable){srch.enable(item,true)}srch.update()}};srch.type.group={render:function(item,value,required,info,advanced){var html=new Array();var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];var group=field.group;var simpleYesNo=false;item.display_id=field.group.group_id;item.fields=new Array();if(field.table_name=="vtour"||field.table_name=="supplement"||field.table_name=="anybedroomonmain"){item.tb=field.table_name;item.f=field.field_id;simpleYesNo=true}else{item.tb="feature";item.f="group_id"}item.o="=";item.c=value;item.d=group.display_val;item.r=(!required||required=="Q")?"R":required;item.g="";item.simple=simpleYesNo;item.display_val=group.display_val;item.group_id=group.group_id;item.toggle=(!quicksearch&&advancedType!="off"?"on":"off");var s_disp="";if(quicksearch||advancedType=="off"){s_disp=" style='display:none;' "}if(advancedType=="none"&&!interfaceObj.idx){html.push('<div class="delbutton" onclick="removeCriteria(this.parentNode);event.cancelBubble=true;" title="Remove '+field.display_val+' from this search">X</div>')}if(simpleYesNo){html.push('<div class="title">')}else{html.push('<div class="title click" id="'+item.unique_id+'_title" onclick="showHideBody(srch.get_parent(this));" title="Click to edit">')}html.push('<div class="hangingindent">');html.push('<input id="enabled_'+item.unique_id+'" '+(simpleYesNo?"":'onfocus="showHideBody(srch.get_parent(this),false,true);"')+' type="checkbox" '+((!quicksearch&&advancedType!="off")?"checked":"")+' onclick="event.cancelBubble=true;srch.enable(srch.get_parent(this),this.checked);srch.update();'+(simpleYesNo?"srch.type['group'].simpleupdate(this);":"")+'" /> ');if(field.table_name=="anybedroomonmain"){html.push('<label for="enabled_'+item.unique_id+'">'+group.display_val+"</label>")}else{if(simpleYesNo){html.push('<span id="'+item.unique_id+'_operator" class="operator" '+s_disp+' title="Click to change include/exclude" onclick="srch.type[\'group\'].operator(this.parentNode.parentNode.parentNode);event.cancelBubble=true;">'+((item.r=="X")?"Does Not Have":"Has")+'</span> <label for="enabled_'+item.unique_id+'">'+group.display_val+"</label> ")}else{html.push(group.display_val+" ")}}html.push('<span id="'+item.unique_id+'_desc" class="desc" '+(simpleYesNo||s_disp?"style='display:none;'":"")+"></span>");html.push("</div>");html.push("</div>");html.push('<div id="'+item.unique_id+'_body" class="body">');html.push('<table id="'+item.unique_id+'_body_table" cellpadding="0" cellspacing="0" border="0" style="width:100%;"></table>');html.push("</div>");return html.join("")},compile:function(item){var qs=new Array();var tbl=document.getElementById(item.unique_id+"_body_table");for(var y=0;y<tbl.rows.length;y++){for(var z=0;z<tbl.rows[y].childNodes.length;z++){if(item.simple||(tbl.rows[y].childNodes[z].unique_id&&document.getElementById("check_"+tbl.rows[y].childNodes[z].unique_id).checked)){qs.push({tb:tbl.rows[y].childNodes[z].tb,f:tbl.rows[y].childNodes[z].f,o:"=",c:(tbl.rows[y].childNodes[z].c?tbl.rows[y].childNodes[z].c:" "),d:tbl.rows[y].childNodes[z].d,r:(item.simple?item.r:tbl.rows[y].childNodes[z].r),g:"",t:"group"})}if(item.simple){break}}}return qs},describe:function(item){var ands=new Array();var ors=new Array();var nots=new Array();var tbl=document.getElementById(item.unique_id+"_body_table");var desc="";for(var y=0;y<tbl.rows.length;y++){for(var z=0;z<tbl.rows[y].childNodes.length;z++){if(tbl.rows[y].childNodes[z].unique_id&&document.getElementById("check_"+tbl.rows[y].childNodes[z].unique_id).checked){if(tbl.rows[y].childNodes[z].r=="X"){nots.push(tbl.rows[y].childNodes[z].display_val)}else{if(tbl.rows[y].childNodes[z].r=="R"){ands.push(tbl.rows[y].childNodes[z].display_val)}else{ors.push(tbl.rows[y].childNodes[z].display_val)}}}}}if(!item.simple){for(var x=0;x<ands.length;x++){desc+=(desc=="")?"of "+(ands.length==1?" (and) ":"")+ands[x]:" and "+ands[x]}for(var x=0;x<ors.length;x++){desc+=(desc=="")?"of "+(ors.length==1?" (or) ":"")+ors[x]:" or "+ors[x]}for(var x=0;x<nots.length;x++){desc+=(desc=="")?"not of "+nots[x]:" not "+nots[x]}if(desc==""){desc=" of ..."}}changeSearchText(item.d,"",desc,(item.toggle=="on"?"add":"remove"));return"<span class='searchdesc'>"+desc+"</span>"},operator:function(operator){if(operator.simple){operator.r=(operator.r=="X")?"R":"X";document.getElementById(operator.unique_id+"_operator").innerHTML=(operator.r=="X")?"Does Not Have":"Has";srch.enable(operator,true);srch.update();return true}var possibilities=new Array("and","or","not");var currentOp=operator.innerHTML;for(var x=0;x<possibilities.length;x++){if(possibilities[x]==currentOp&&x!=possibilities.length-1){operator.innerHTML=possibilities[x+1];break}else{if(possibilities[x]==currentOp&&x==possibilities.length-1){operator.innerHTML=possibilities[0]}}}},append:function(item,value,required,info,advanced){var tbl=document.getElementById(item.unique_id+"_body_table");for(var x=0;x<item.fields.length;x++){if(item.fields[x]==info){return}}var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];item.fields.push(info);lastRow=(tbl.rows.length-1==-1)?null:tbl.rows[tbl.rows.length-1];if(lastRow&&lastRow.childNodes[lastRow.childNodes.length-1].childNodes.length==0){var cell=lastRow.childNodes[1]}else{var row=tbl.insertRow(tbl.rows.length);var cell=row.insertCell(0);var emptyCell=row.insertCell(1)}cell.unique_id=item.fields.length+"9999"+item.unique_id;cell.kind="Y";cell.innerHTML=srch.render(cell,value,required,info,advanced);document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.group.describe(item)},simpleupdate:function(elem){var isChecked=(elem.checked==true);document.getElementById("check_19999"+elem.id.replace(/enabled_/,"")).checked=isChecked}};srch.type.search={render:function(item,value,required,info){var html=new Array();var quicksearch=(required=="Q")?true:false;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];item.display_id=info;item.tb="search";item.f="search";item.o="within";item.c=info;item.d=value;item.r=(!required||required=="Q")?"R":required;item.g="";if(!interfaceObj.idx){html.push('<div class="delbutton" onclick="removeCriteria(srch.get_parent(this));event.cancelBubble=true;" title="Remove '+field.display_val+' from this search">X</div>')}html.push('<div class="title search" title="Click to edit">');html.push('<input id="enabled_'+item.unique_id+'" type="checkbox" '+((!quicksearch)?"checked":"")+' onclick="event.cancelBubble=true;srch.update();" /> ');html.push('<span id="'+item.unique_id+'_desc" onclick="srch.type[\'search\'].operator(srch.get_parent(this));" class="desc" title="Click to change this search\'s mode of operation">');if(item.r=="O"){html.push("OR within")}else{if(item.r=="X"){html.push("NOT within")}else{html.push("AND within")}}html.push("</span>");html.push(" "+item.d);html.push("</div>");return html.join("")},compile:function(item){var qs=new Array();qs.push({tb:item.tb,f:item.f,o:item.o,c:("x'"+item.c+"'"),d:item.d,r:item.r,g:item.g,t:"search"});return qs},operator:function(item){var operator=item.r;var possibilities=new Array({id:"R",desc:"AND within"},{id:"O",desc:"OR within"},{id:"X",desc:"NOT within"});for(var x=0;x<possibilities.length;x++){if(possibilities[x].id==operator&&x!=possibilities.length-1){item.r=possibilities[x+1].id;document.getElementById(item.unique_id+"_desc").innerHTML=possibilities[x+1].desc;break}else{if(possibilities[x].id==operator&&x==possibilities.length-1){item.r=possibilities[0].id;document.getElementById(item.unique_id+"_desc").innerHTML=possibilities[0].desc}}}srch.enable(item,true);srch.update()}};srch.type.cart={render:function(item,value,required,info,advanced){var html=new Array();var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;var carts=searchCarts;if(!value){value=""}item.tb="cart";item.f="tech_id";item.o="in";item.c=value||"";if(item.unique_id=="adv_cart"){num_carts=1;item.d="Cart"}else{num_carts++;item.d="Cart "+num_carts}item.r=(!required||required=="Q")?"R":required;item.g="";item.kind="cart";item.carts_loaded=false;item.toggle=(!quicksearch&&advancedType!="off"?"on":"off");if(advancedType=="none"&&!interfaceObj.idx){html.push('<div class="delbutton" onclick="removeCriteria(srch.get_parent(this));event.cancelBubble=true;" title="Remove this cart from this search">X</div>')}html.push('<div class="title click" id="'+item.unique_id+'_title" onclick="showHideBody(srch.get_parent(this));srch.type[\'cart\'].load(this.parentNode);" title="Click to edit">');html.push('<div class="hangingindent">');html.push('<input id="enabled_'+item.unique_id+'" onfocus="showHideBody(srch.get_parent(this),false,true);srch.type[\'cart\'].load(srch.get_parent(this));" type="checkbox" '+((!quicksearch&&advancedType!="off")?"checked":"")+' onclick="event.cancelBubble=true;srch.enable(srch.get_parent(this),this.checked);srch.update();" /> ');html.push(srch.operator_html(item,((item.r=="X")?"not within":"within")));html.push("Listing Cart ");html.push('<span id="'+item.unique_id+'_desc" class="desc">'+value+"</span>");html.push("</div>");html.push("</div>");html.push('<div id="'+item.unique_id+'_body" class="body">');html.push('<select name="cart_'+item.unique_id+'" '+(browser_type=="IE"?"onkeydown":"onkeypress")+"=\"srch.type['cart'].wrap_tab(event,'"+item.unique_id+'\');" id="cart_'+item.unique_id+'" size="1" style="width:auto;" onchange="srch.enable(srch.get_parent(this), true);srch.type[\'cart\'].desc(srch.get_parent(this),this.value);srch.update();">');if(carts_loaded==true){for(i=0;i<searchCarts.length;i++){html.push('<option value="'+searchCarts[i].tech_id+'"');if(value.match(searchCarts[i].tech_id)){html.push(" selected")}html.push(">"+searchCarts[i].name+" ("+searchCarts[i].count+")</option>")}item.carts_loaded=true}html.push("</select>");html.push("</div>");return html.join("")},wrap_tab:function(e,id){if(browser_type=="IE"){e=event}if(e.keyCode==9){var list=document.getElementById("searchList");if(list.childNodes[list.childNodes.length-1].unique_id==id){var x=0;while(list.childNodes[x]&&list.childNodes[x].style.display=="none"){x++}if(!list.childNodes[x]){return}if(browser_type!="IE"){showHideBody(list.childNodes[x],false,true)}else{setTimeout("showHideBody(document.getElementById('searchList').childNodes["+x+"],false,true);",100)}}}else{return}},operator:function(item){item.r=(item.r=="X")?"R":"X";document.getElementById(item.unique_id+"_operator").innerHTML=(item.r=="X")?"not within":"within";srch.enable(item,true);srch.update()},desc:function(item,value){var crt=document.getElementById("cart_"+item.unique_id);var newVal=crt.options[crt.selectedIndex].innerHTML;document.getElementById(item.unique_id+"_desc").innerHTML=newVal;changeSearchText(item.d,((item.r=="X")?"not within":"within"),newVal,(item.toggle=="on"?"add":"remove"))},load:function(item){if(item.carts_loaded==true){return}if(carts_loaded!=true){loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch/load_carts.html&cart_elem_id="+item.unique_id+additional_ajax_params,false)}else{srch.type.cart.fill_select(item.unique_id)}},fill_select:function(item_id){var crt=document.getElementById("cart_"+item_id);var def_val=document.getElementById(item_id+"_desc").innerHTML;for(i=0;i<searchCarts.length;i++){var opt=document.createElement("option");opt.value=searchCarts[i].tech_id;if(def_val.match(searchCarts[i].tech_id)){opt.selected=true}opt.innerHTML=searchCarts[i].name+" ("+searchCarts[i].count+")";crt.appendChild(opt)}srch.type.cart.desc(srch.get_parent(document.getElementById("enabled_"+item_id)));srch.get_parent(crt).carts_loaded=true},compile:function(item){var qs=new Array();var selectedCart=document.getElementById("cart_"+item.unique_id);if(searchCarts.length<=0||!selectedCart.options||selectedCart.options.length<=0){return{tb:item.tb,f:item.f,o:item.o,c:false,d:description,r:item.r,g:item.g,t:"cart"}}var tech_id=selectedCart.options[selectedCart.options.selectedIndex].value;for(i=0;i<searchCarts.length;i++){if(searchCarts[i].tech_id==tech_id){var description=searchCarts[i].name;break}}var description="Listing cart of "+description;qs.push({tb:item.tb,f:item.f,o:item.o,c:("x'"+tech_id+"'"),d:description,r:item.r,g:item.g,t:"cart"});return qs}};srch.type.mapshape={render:function(item,value,required,info){var html=new Array();var quicksearch=(required=="Q")?true:false;item.toggle=((!quicksearch)?"on":"off");var value=(value)?value.trim():null;if(value){item.intersection=value.replace(/[^a-z]+|x/g,"");value=value.replace(/[abcdefghijklmnopqrstuvwyz]+/g,"");value=value.replace(/;$/,"")}var info_array=info.split("|");var shape_color="0069ff";var shape_type=info_array.shift();var shape_label=srch.type.mapshape.find_generic_label(shape_type);if(info_array.length>1){shape_color=info_array.shift();for(var slabel=0;slabel<info_array.length;slabel++){shape_label=(slabel==0)?info_array[0]:shape_label+"|"+info_array[slabel]}}item.shapes=[];item.tb="mapshape";item.d="Search Areas";if(shape_type=="db2poly"){item.shapes.push({tb:"mapshape",f:shape_type,o:"",c:value,d:shape_label,r:"R",g:"",coords:null,color:shape_color})}else{item.shapes.push({tb:"mapshape",f:shape_type,o:"",c:null,d:shape_label,r:"R",g:"",coords:value,color:shape_color})}if(!interfaceObj.idx){html.push('<div class="delbutton" onclick="srch.type[\'mapshape\'].remove_all_shapes(srch.get_parent(this));event.cancelBubble=true;" title="Remove all shapes from this search">X</div>')}html.push('<div class="title click" id="'+item.unique_id+'_title" onclick="showHideBody(srch.get_parent(this));" title="Click to edit">');html.push('<input id="enabled_'+item.unique_id+'" onfocus="showHideBody(srch.get_parent(this),false,true);" type="checkbox" '+((!quicksearch)?"checked":"")+' onclick="event.cancelBubble=true;srch.update();" /> Search Areas ');html.push('<span id="'+item.unique_id+'_desc" class="desc"></span>');html.push('<div id="'+item.unique_id+'_body" class="body shape" style="display:block;cursor:default;width:100%;" onclick="event.cancelBubble=true;">');html.push(srch.type.mapshape.draw_list(item));html.push("</div>");html.push("</div>");srch.type.mapshape.describe(item);return html.join("")},describe:function(item){var value="";for(var x=0;x<item.shapes.length;x++){value+=(x!=0?", ":"")+item.shapes[x].d}if(document.getElementById("intersection_"+item.unique_id)){item.intersection=(document.getElementById("intersection_"+item.unique_id).checked)?"intersection":""}var op=(item.intersection=="intersection")?"intersecting":"within";changeSearchText("Search Areas",op,value,(item.toggle=="on"?"add":"remove"),item)},compile:function(item){var qs=[];var intersection=(document.getElementById("intersection_"+item.unique_id)&&document.getElementById("intersection_"+item.unique_id).checked)?"intersection":"within";for(var x=0;x<item.shapes.length;x++){if(item.shapes[x].f!="db2poly"||item.shapes[x].c!=null){qs.push({tb:item.shapes[x].tb,f:item.shapes[x].f,o:intersection,c:((item.shapes[x].f=="db2poly")?item.shapes[x].c:item.shapes[x].coords),d:item.shapes[x].color+"|"+item.shapes[x].d.replace(/[\"]/g,"'"),r:item.shapes[x].r,g:item.shapes[x].g})}}return qs},draw_list:function(item){var html=[];for(var x=0;x<item.shapes.length;x++){html.push('<div class="shapeDiv" onmouseover="shapeHighlight(true,this,'+x+')" onmouseout="shapeHighlight(false,this,'+x+')">');html.push(srch.type.mapshape.draw_list_item(item,x));html.push("</div>")}if(item.shapes.length>1){html.push('<hr size="1" color="#9fafc6" />');html.push('<input type="checkbox" name="intersection_'+item.unique_id+'" id="intersection_'+item.unique_id+'" value="Y" onchange="srch.type[\'mapshape\'].describe(srch.get_parent(this));srch.update();" onclick="srch.type[\'mapshape\'].describe(srch.get_parent(this));srch.update();" '+((item.intersection=="intersection")?"checked=checked":"")+'/> <label for="intersection_'+item.unique_id+'">Intersection</label>')}if(document.getElementById("iframe_map").contentWindow.myFBSMapLoaded){srch.update()}srch.type.mapshape.describe(item);return html.join("")},draw_list_item:function(item,shapeIndex){var html=[];if(item.shapes[shapeIndex].f=="db2poly"&&item.shapes[shapeIndex].c==null){html.push('<img src="/images/srch_rs/loading.gif" align="absmiddle" title="Rendering Polygon" />')}else{html.push('<span class="deltext" onclick="srch.type[\'mapshape\'].remove_shape(srch.get_parent(this), '+shapeIndex+');" title="Remove this Search Area">X</span> &nbsp; ')}html.push('<div class="shape_color" style="background-color:#'+item.shapes[shapeIndex].color+';">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div> &nbsp;');html.push('<a href="javascript:void(0);" onclick="document.getElementById(\'iframe_map\').contentWindow.centerOnShape('+shapeIndex+')" title="Click to zoom to shape">'+item.shapes[shapeIndex].d+"</a>");return html.join("")},update:function(item){var qs=[];var mapframe=document.getElementById("iframe_map").contentWindow;var mappingShapes=mapframe.mappingShapes;for(var x=0;x<mappingShapes.length;x++){if(mappingShapes[x].type=="db2poly"){qs.push({tb:"mapshape",f:mappingShapes[x].type,o:"",c:mappingShapes[x].c_tech_id,d:mappingShapes[x].label,r:"R",g:"",coords:null,color:mappingShapes[x].color})}else{qs.push({tb:"mapshape",f:mappingShapes[x].type,o:"",c:null,d:mappingShapes[x].label,r:"R",g:"",coords:mappingShapes[x].nodes,color:mappingShapes[x].color})}}item.shapes=qs;document.getElementById(item.unique_id+"_body").innerHTML=srch.type.mapshape.draw_list(item);srch.enable(item,true);srch.type.mapshape.describe(item)},add_shape_before_map_loaded:function(item,type,value,description){var label=srch.type.mapshape.find_generic_label(type);var color="0069ff";if(description.indexOf("|")!=-1){color=description.substring(0,6);label=description.substring(7)}item.shapes.push({tb:"mapshape",f:type,o:"",c:((type=="db2poly")?value:null),d:label,r:"R",g:"",coords:((type=="db2poly")?null:value),color:color});document.getElementById(item.unique_id+"_body").innerHTML=srch.type.mapshape.draw_list(item)},remove_shape:function(item,shape_index){var mapframe=document.getElementById("iframe_map").contentWindow;if(!mapframe.myFBSMapLoaded){return}item.shapes.splice(shape_index,1);if(mapframe.removeFeature){mapframe.removeFeature(shape_index)}if(item.shapes.length==0){removeCriteria(item)}else{srch.type.mapshape.update(item)}},remove_all_shapes:function(item){var mapframe=document.getElementById("iframe_map").contentWindow;if(!mapframe.myFBSMapLoaded){return}if(mapframe.mappingShapes){var mappingShapes=mapframe.mappingShapes;for(var x=mappingShapes.length-1;x>-1;x--){mapframe.removeFeature(x)}}removeCriteria(item)},change_shape_appearance:function(item,shape_index,color,label){item.shapes[shape_index].color=color;item.shapes[shape_index].d=label;document.getElementById(item.unique_id+"_body").childNodes[shape_index].innerHTML=srch.type.mapshape.draw_list_item(item,shape_index)},find_generic_label:function(type){if(type=="polygon"||type=="db2poly"){return"Polygon"}else{if(type=="radius"){return"Circle"}else{return"Rectangle"}}}};srch.type.card_fmt={render:function(item,value,required,info,advanced){var html=new Array();var mls_list=info;item.kind="card_fmt";if(mls_list.match(",")){var cf_list=new Array();item.array_count=-1;for(var i=0;i<srch_crossmls_proptypes.length;i++){var found=false;for(var j=0;j<srch_mls.length;j++){for(var k=0;k<srch_mls[j].card_fmt_list.length;k++){if(srch_mls[j].card_fmt_list[k].prop_group_id==srch_crossmls_proptypes[i].prop_group_id){found=true;break}}if(found){break}}if(found){cf_list.push(srch_crossmls_proptypes[i])}}}else{for(var x=0;x<srch_mls.length;x++){if(mls_list.match(srch_mls[x].tech_id)){var cf_list=srch_mls[x].card_fmt_list;item.array_count=x;break}}}if(!value&&item.array_count==-1){var value="x'"+cf_list[0].prop_group_id+"'";prop_type_list=value;card_fmt_list=""}else{if(!value){var value=cf_list[0].code;value=(value.match(/^\'.*\'$/)?value:"'"+value+"'");prop_type_list="";card_fmt_list=value}}item.tb="general";item.f="card_fmt";item.c=value;item.d="Property Type";item.kind="card_fmt";var opts=new Array();var valuetrim=value.toLowerCase().trim();var newvalue=new Array();for(var i=0;i<cf_list.length;i++){if(limit_card_fmt_list&&(limit_card_fmt_list!="undefined")){if(!limit_card_fmt_list.toLowerCase().match(cf_list[i].code.toLowerCase().trim())){continue}}if(interfaceObj.idx&&cf_list[i].non_public){continue}opts_string='<option value="'+((item.array_count==-1)?"x":"")+"'"+((item.array_count==-1)?cf_list[i].prop_group_id:cf_list[i].code)+"'\"";if(interfaceObj.idx&&idx_sel_proptype&&(srch_source=="quicksearch"||srch_source=="editmapsearch")){var iproptypes=idx_sel_proptype.split(",");for(var j=0;j<iproptypes.length;j++){if((i+1)==iproptypes[j]){opts_string+=" selected";newvalue.push("'"+((item.array_count==-1)?cf_list[i].prop_group_id:cf_list[i].code)+"'");break}}}else{if(item.array_count==-1){if(valuetrim.match(cf_list[i].prop_group_id.toLowerCase().trim())||(value==""&&i==0)){opts_string+=" selected"}}else{if(valuetrim.match(cf_list[i].code.toLowerCase().trim())||(value==""&&i==0)){opts_string+=" selected"}}}opts_string+=">"+cf_list[i].name+"</option>";opts.push(opts_string)}if(interfaceObj.idx&&(srch_source=="quicksearch"||srch_source=="editmapsearch")){idx_sel_proptype="";if(newvalue.length>0){item.c=newvalue.join(",")}}if(opts.length<2){html.push('<div class="title">');item.onmouseover="";item.onmouseout="";item.style.display="none"}else{item.style.display="";html.push('<div class="title click" id="'+item.unique_id+'_title" style="margin-left:24px;" onclick="showHideBody(srch.get_parent(this));" title="Click to edit">');item.onmouseover=function(){this.className=(document.getElementById("enabled_"+this.unique_id).checked)?"itemOver":"itemDisabledOver"};item.onmouseout=function(){this.className=(document.getElementById("enabled_"+this.unique_id).checked)?"item":"itemDisabled"}}html.push('<div class="hangingindent">');html.push('<input type="checkbox" onfocus="showHideBody(srch.get_parent(this),false,true);" id="enabled_'+item.unique_id+'" checked="checked" style="display:none;" disabled />');html.push(" Property Type ");html.push('<span id="'+item.unique_id+'_desc" class="desc">');html.push(srch.type.card_fmt.describe(item,item.c));html.push("</span>");html.push("</div>");html.push("</div>");html.push('<div id="'+item.unique_id+'_body" class="body" '+(advanced&&advanced=="on"?'style="display:block;"':"")+">");var select_size=(opts.length<scrollsize)?opts.length:scrollsize;html.push('<select name="s_'+item.unique_id+'" id="s_'+item.unique_id+'" onchange="srch.type[\'card_fmt\'].change(srch.get_parent(this), this);" size="'+select_size+'" multiple>');html.push(opts.join(""));html.push("</select>");html.push("</div>");if(!(interfaceObj.idx&&(srch_source=="quicksearch"||srch_source=="editmapsearch"))&&limit_card_fmt_list){limit_card_fmt_list=""}return html.join("")},compile:function(item){var qs=new Array();qs.push({tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"card_fmt"});return qs},describe:function(item,value){var cf_list=(item.array_count==-1)?srch_crossmls_proptypes:srch_mls[item.array_count].card_fmt_list;var desc="";if(!value&&item.array_count==-1){var value=cf_list[0].prop_group_id}else{if(!value){var value=cf_list[0].code}}for(var y=0;y<cf_list.length;y++){if(item.array_count==-1){if(value.match(cf_list[y].prop_group_id)){desc+=(desc=="")?cf_list[y].name:", "+cf_list[y].name}}else{if(value.match(cf_list[y].code)&&(!interfaceObj.idx||!cf_list[y].non_public)){desc+=(desc=="")?cf_list[y].name:", "+cf_list[y].name}}}changeSearchText(item.d,"",desc,"add");return((desc!="")?" of ":"")+srch.desc_html(desc)},change:function(item,scroll){var list=document.getElementById("searchList");var value="";if(list.childNodes.length>(((srch_mls.length>1)?1:0)+1)){search_need_display_change=true}for(var x=0;x<scroll.options.length;x++){if(scroll.options[x].selected){value+=(value=="")?scroll.options[x].value:","+scroll.options[x].value}}item.c=value;if(item.array_count==-1){prop_type_list=value;card_fmt_list=""}else{prop_type_list="";card_fmt_list=value}if(interfaceObj.idx){enableAllNodesButMe(null,true)}getFetchableFields();document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.card_fmt.describe(item,item.c);if(js_ma_tech_id!="20010602000846355519000000"){field_id_list=new Array()}srch.update()}};srch.type.ma_search_list={render:function(item,value,required,info){var html=new Array();if(!value){var value=""}item.tb="general";item.f="ma_search_list";item.c=value;item.d="MLS";html.push('<div class="title click" id="'+item.unique_id+'_title" onclick="showHideBody(srch.get_parent(this));" style="margin-left:24px;"; title="Click to edit">');html.push('<div class="hangingindent">');html.push('<input type="checkbox" onfocus="showHideBody(srch.get_parent(this),false,true);" id="enabled_'+item.unique_id+'" checked="checked" style="display:none;" disabled /> MLS ');html.push('<span id="'+item.unique_id+'_desc" class="desc">');html.push(srch.type.ma_search_list.describe(item.c,item));html.push("</span>");html.push("</div>");html.push("</div>");html.push('<div id="'+item.unique_id+'_body" class="body">');var select_size=(srch_mls.length<scrollsize)?srch_mls.length:scrollsize;html.push('<select name="s_'+item.unique_id+'" id="s_'+item.unique_id+'" '+(browser_type=="IE"?"onkeydown":"onkeypress")+"=\"srch.type['ma_search_list'].wrap_tab(event,'"+item.unique_id+'\');" onchange="srch.type[\'ma_search_list\'].change(srch.get_parent(this), this);" size="'+select_size+'" multiple>');var valuetrim=value.toLowerCase().trim();for(var i=0;i<srch_mls.length;i++){html.push('<option value="'+srch_mls[i].tech_id+'"');if(interfaceObj.idx&&!interfaceObj.show_ma_search_list){if(srch_mls[i].tech_id==xId(js_ma_tech_id)){html.push(" selected")}}else{if(valuetrim.match(srch_mls[i].tech_id.toLowerCase().trim())||(value==""&&i==0)){html.push(" selected")}}html.push(">"+srch_mls[i].name+"</option>")}html.push("</select>");html.push("</div>");return html.join("")},wrap_tab:function(e,id){var pType=document.getElementById("enabled_2");if(!pType||pType.parentNode.parentNode.parentNode.style.display=="none"){return}if(browser_type=="IE"){e=event}if(e.keyCode==9){if(browser_type!="IE"){pType=pType.parentNode.parentNode.parentNode;showHideBody(pType,false,true)}else{setTimeout("showHideBody(document.getElementById('enabled_2').parentNode.parentNode.parentNode,false,true);",10)}}else{return}},compile:function(item){var qs=new Array();qs.push({tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"ma_search_list"});return qs},describe:function(value,item){var desc="";var mls_count=0;if(!value){var value=""}for(var y=0;y<srch_mls.length;y++){if(value.match(srch_mls[y].tech_id)){desc+=(desc=="")?srch_mls[y].name:", "+srch_mls[y].name;mls_count++}}if(srch_mls.length==mls_count){desc="All MLSs"}changeSearchText(item.d,"",desc,"add");return((desc!="")?" of ":"")+srch.desc_html(desc)},change:function(item,scroll){var list=document.getElementById("searchList");var value="";if(list.childNodes.length>(((srch_mls.length>1)?1:0)+1)){search_need_display_change=true}for(var x=0;x<scroll.options.length;x++){if(scroll.options[x].selected){value+=(value=="")?scroll.options[x].value:","+scroll.options[x].value}}item.c=value;ma_search_list=value;var cf_item=null;for(var x=0;x<list.childNodes.length;x++){if(list.childNodes[x]&&list.childNodes[x].kind&&list.childNodes[x].kind=="card_fmt"){cf_item=list.childNodes[x];break}}if(cf_item&&cf_item.kind=="card_fmt"){var advancedCFMT=false;if(srch_source=="new_quicksearch"||srch_source=="quicksearch"||srch_source=="editmapsearch"){if(document.getElementById(cf_item.unique_id+"_body")&&document.getElementById(cf_item.unique_id+"_body").style.display!="none"){advancedCFMT="on"}}cf_item.innerHTML=srch.type.card_fmt.render(cf_item,null,null,item.c,advancedCFMT)}if(interfaceObj.idx){enableAllNodesButMe(null,true)}getFetchableFields();document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.ma_search_list.describe(item.c,item);srch.update()}};srch.type.idxmlsnumber={render:function(item,value,required,info,advanced){var html=new Array();item.fields=new Array();item.style.borderBottom="2px solid #999";item.style.marginBottom="0px";item.tb="list";item.f="tech_id";item.o="in";item.c=(!value)?"":value;item.d=info;item.r=(!required||required=="Q")?"R":required;item.g="";var l_nums="";if(interfaceObj.idx_list_numbers){l_nums=verifylistnum(interfaceObj.idx_list_numbers,use_prefix)}html.push('<div class="title click" id="'+item.unique_id+'_title">');html.push('<input id="enabled_'+item.unique_id+'" type="checkbox" onclick="event.cancelBubble=true;this.checked=!this.checked;srch.enable(srch.get_parent(this));srch.update();" '+(l_nums?"checked":"")+" /> MLS # &nbsp;");html.push('<span id="'+item.unique_id+'_desc" class="desc">');var use_prefix=false;for(var x=0;x<srch_mls.length;x++){if(ma_search_list&&ma_search_list.indexOf(srch_mls[x].tech_id)>=0&&srch_mls[x].prefix){use_prefix=true;break}else{if(xId(js_ma_tech_id).indexOf(srch_mls[x].tech_id)>=0&&srch_mls[x].prefix){use_prefix=true;break}}}html.push('<input type="text" maxlength="200"  name="t_'+item.unique_id+'" id="t_'+item.unique_id+'" size=37 onchange="this.value=verifylistnum(this.value, '+use_prefix+");srch.type['idxmlsnumber'].change(srch.get_parent(this),this.value);\" value=\""+l_nums+'">');html.push("</span>");html.push("</div>");html.push('<div id="'+item.unique_id+'_body" class="body" style="display:none;">');html.push("</div>");return html.join("")},change:function(item,value){if(this.value!=""){srch.enable(item,true)}srch.update()},compile:function(item){var qs=new Array();var listNums=document.getElementById("t_"+item.unique_id).value;var listNumsList=listNums.split(",");for(var x=0;x<srch_mls.length;x++){if(ma_search_list&&ma_search_list.indexOf(srch_mls[x].tech_id)<0){continue}else{if(xId(js_ma_tech_id).indexOf(srch_mls[x].tech_id)<0){continue}}var num_dashes=srch_mls[x].prefix?2:1;var splice_list=new Array();for(var j=0;j<listNumsList.length;j++){if(listNumsList[j].split("-").length>num_dashes){var new_c=listNumsList[j].split("-")[num_dashes-1]+" and "+listNumsList[j].split("-")[num_dashes];if(num_dashes>1){new_c+=" and prefix='"+listNumsList[j].split("-")[0]+"'";disp=listNumsList[j].split("-")[0]+"-"+listNumsList[j].split("-")[num_dashes-1]+" and "+listNumsList[j].split("-")[0]+"-"+listNumsList[j].split("-")[num_dashes]}else{disp=listNumsList[j].split("-")[num_dashes-1]+" and "+listNumsList[j].split("-")[num_dashes]}new_c+=" and ma_tech_id="+srch_mls[x].tech_id;qs.push({tb:"list",f:"list_nbr",o:"between",c:new_c,d:"Listings between "+disp,r:"O",g:srch_mls[x].tech_id,t:"specified_listings"});splice_list[splice_list.length]=j}}for(var j=splice_list.length-1;j>=0;j--){listNumsList.splice(splice_list[j],1)}listNums=listNumsList.join(",");if(listNums.replace(/\s/g,"")!=""){var temp_d="List # of "+listNums;qs.push({tb:"list",f:"tech_id",o:"in",c:srch_mls[x].tech_id,d:temp_d,r:"O",g:srch_mls[x].tech_id,t:"specified_listings"})}}return qs}};srch.type.specifiedlistings={render:function(item,value,required,info,advanced){var html=new Array();var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;item.fields=new Array();item.tb="list";item.f="tech_id";item.o="in";item.c=(!value)?"":value;item.d=info;item.r=(!required||required=="Q")?"R":required;item.g="";item.kind="specifiedlistings";var s_disp="";if(quicksearch||advancedType=="off"){s_disp=" style='display:none;' "}if(advancedType=="none"&&!interfaceObj.idx){html.push('<div class="delbutton" onclick="removeCriteria(srch.get_parent(this));event.cancelBubble=true;" title="Remove '+field.display_val+' from this search">X</div>')}html.push('<div class="title click" id="'+item.unique_id+'_title" onclick="showHideBody(srch.get_parent(this));" title="Click to edit">');html.push('<input id="enabled_'+item.unique_id+'" onfocus="showHideBody(srch.get_parent(this),false,true);" type="checkbox" '+((!quicksearch&&advancedType!="off")?"checked":"")+' onclick="event.cancelBubble=true;this.checked=!this.checked;srch.enable(srch.get_parent(this));srch.update();" /> MLS #');html.push(srch.operator_html(item,((item.r=="R")?"exclusively of":(item.r=="O"?"of":"not of")),(s_disp!="")));html.push('<span id="'+item.unique_id+'_desc" class="desc" '+s_disp+">"+srch.desc_html("...")+"</span>");html.push("</div>");html.push('<div id="'+item.unique_id+'_body" class="body">');html.push(srch.update_html(item));html.push('<table id="'+item.unique_id+'_body_table" cellpadding="0" cellspacing="0" border="0" ></table>');html.push("</div>");return html.join("")},append:function(item,value,required,info,index,advanced){var tbl=document.getElementById(item.unique_id+"_body_table");var justNumbers="";if(value){values=value.split("||");for(var x=0;x<values.length;x++){val=values[x];if(val.indexOf(" and ma_tech_id")>=0&&val.indexOf(srch_mls[index].tech_id)<0){continue}if(justNumbers){justNumbers+=","}if(val.indexOf("List #")>=0){var tmpNumbers=val.substr(val.indexOf("List #")+6).replace(/\s+/g,"").replace(/of/,"").split(",");var fi=0;for(var y=0;y<tmpNumbers.length;y++){if((tmpNumbers[y].indexOf("-")<0&&!srch_mls[index].prefix)||(tmpNumbers[y].indexOf("-")>=0&&srch_mls[index].prefix)){justNumbers+=(fi!=0?",":"")+tmpNumbers[y];fi++}}}else{if(val.indexOf("and")>=0){if(val.indexOf("prefix=")>=0){justNumbers+=val.substr(val.indexOf("prefix=")).split(" and ")[0].match(/[0-9]+/)+"-"}justNumbers+=val.match(/^[0-9]+/)+"-"+val.split(" and ")[1].match(/^[0-9]+/)}else{justNumbers+=val}}}}if(srch_source=="listnum"&&srch_mls.length>1){var slist=document.getElementById("searchList").childNodes;var msl;for(var x=0;x<slist.length;x++){if(slist[x].kind=="ma_search_list"){msl=slist[x];break}}if(msl){if(msl.c.indexOf(srch_mls[index].tech_id)<0){justNumbers=""}}else{justNumbers=""}}var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];item.fields.push(info);var row=tbl.insertRow(tbl.rows.length);var cell=row.insertCell(0);cell.tb=item.tb;cell.f=item.f;cell.o=item.o;cell.c=item.c;cell.r=item.r;cell.d=item.d;cell.g=srch_mls[index].tech_id;cell.unique_id=index+"_"+item.unique_id;cell.kind="specifiedlistings";var html=new Array();html.push("<b>"+srch_mls[index].name+"</b><br /><b>MLS #</b> ");html.push('<input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"t_"+cell.unique_id+'" id="t_'+cell.unique_id+'" size="40" maxlength="1000" value="'+verifylistnum(justNumbers,srch_mls[index].prefix)+'" onchange="this.value=verifylistnum(this.value, '+srch_mls[index].prefix+");srch.type['specifiedlistings'].change(srch.get_parent(this),this.value);\"><br />");cell.innerHTML=html.join("")},change:function(item,value){document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.specifiedlistings.describe(item);if(value){srch.enable(item,true)}else{srch.type.specifiedlistings.popuptext(item,"blank")}srch.update()},operator:function(item,noChange){var op=document.getElementById(item.unique_id+"_operator");var optext="";if(noChange){item.r=(item.r=="R"?"X":(item.r=="O"?"R":"O"))}if(item.r=="X"){item.r="R";optext="exclusively of"}else{if(item.r=="R"){item.r="O";optext="of"}else{item.r="X";optext="not of"}}op.innerHTML='<font style="cursor:pointer;text-decoration:underline;">'+optext+"</font>";srch.enable(srch.get_parent(item),true);if(!noChange){srch.update()}},describe:function(item){var desc="";var tbl=document.getElementById(item.unique_id+"_body_table");for(var y=0;y<tbl.rows.length;y++){for(var z=0;z<tbl.rows[y].childNodes.length;z++){if(tbl.rows[y].childNodes[z].unique_id&&document.getElementById("t_"+tbl.rows[y].childNodes[z].unique_id).value!=""){var listNums=document.getElementById("t_"+tbl.rows[y].childNodes[z].unique_id).value;desc+=srch.desc_html((srch_mls.length>1?srch_mls[y].abbr+": ":"")+listNums.split(",").join(", "),y)}}}return(desc!=""?desc:"<span class='searchdesc' onmouseover='this.className=\"searchdesc_hover\"' onmouseout='this.className=\"searchdesc\"'>...</span>")},popuptext:function(item,mode){var just_blanks=false;if(mode=="blank"){just_blanks=true;mode="remove"}var tbl=document.getElementById(item.unique_id+"_body_table");for(var y=0;y<tbl.rows.length;y++){for(var z=0;z<tbl.rows[y].childNodes.length;z++){if(!just_blanks&&tbl.rows[y].childNodes[z].unique_id&&document.getElementById("t_"+tbl.rows[y].childNodes[z].unique_id).value!=""){var listNums=document.getElementById("t_"+tbl.rows[y].childNodes[z].unique_id).value;var d="List # for "+srch_mls[y].name;changeSearchText(d,(item.r=="X"?"not in":"in"),listNums,mode)}else{if(tbl.rows[y].childNodes[z].unique_id&&document.getElementById("t_"+tbl.rows[y].childNodes[z].unique_id).value==""){var d="List # for "+srch_mls[y].name;changeSearchText(d,"","","remove")}}}}},compile:function(item){var qs=new Array();var tbl=document.getElementById(item.unique_id+"_body_table");for(var y=0;y<tbl.rows.length;y++){var num_dashes=srch_mls[y].prefix?2:1;var splice_list=new Array();for(var z=0;z<tbl.rows[y].childNodes.length;z++){if(tbl.rows[y].childNodes[z].unique_id&&document.getElementById("t_"+tbl.rows[y].childNodes[z].unique_id).value!=""){var listNums=document.getElementById("t_"+tbl.rows[y].childNodes[z].unique_id).value;var listNumsList=listNums.split(",");for(var j=0;j<listNumsList.length;j++){if(listNumsList[j].split("-").length>num_dashes){var new_c=listNumsList[j].split("-")[num_dashes-1]+" and "+listNumsList[j].split("-")[num_dashes];if(num_dashes>1){new_c+=" and prefix='"+listNumsList[j].split("-")[0]+"'";disp=listNumsList[j].split("-")[0]+"-"+listNumsList[j].split("-")[num_dashes-1]+" and "+listNumsList[j].split("-")[0]+"-"+listNumsList[j].split("-")[num_dashes]}else{disp=listNumsList[j].split("-")[num_dashes-1]+" and "+listNumsList[j].split("-")[num_dashes]}new_c+=" and ma_tech_id="+srch_mls[y].tech_id;qs.push({tb:tbl.rows[y].childNodes[z].tb,f:"list_nbr",o:"between",c:new_c,d:"Listings between "+disp,r:item.r,g:tbl.rows[y].childNodes[z].g,t:"specified_listings"});splice_list[splice_list.length]=j}}for(var j=splice_list.length-1;j>=0;j--){listNumsList.splice(splice_list[j],1)}listNums=listNumsList.join(",");if(listNums.replace(/\s/g,"")==""){continue}tbl.rows[y].childNodes[z].d="MLS # List";qs.push({tb:tbl.rows[y].childNodes[z].tb,f:"tech_id_list",o:"in",c:listNums+" where ma_tech_id="+tbl.rows[y].childNodes[z].g,d:tbl.rows[y].childNodes[z].d,r:item.r,g:tbl.rows[y].childNodes[z].g,t:"specified_listings"})}}}return qs}};srch.type.combo={render:function(item,value,required,info){var o=info.split(":").length>1?info.split(":")[1].trim():"like";info=info.split(":")[0];if(o=="in"){var tmp_val=value.split(",");value="";for(var x=0;x<tmp_val.length;x++){value+=(value!=""?",":"")+tmp_val[x].trim().replace(/^\'/,"").replace(/\'$/,"")}}var html=new Array();var quicksearch=(required=="Q")?true:false;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info]];if(!value){value=""}item.display_id=info;item.tb=field.table_name;item.f=field.field_id;item.o="like";item.c=value.replace(/^[\*]/,"").replace(/[\*]$/,"");item.d=field.display_val;item.r=(!required||required=="Q")?"R":required;item.g="";if(field.map_area_autocomplete){item.lookup_name=field.map_area_autocomplete.lookup_name;item.map_cache_id=field.map_area_autocomplete.map_cache_id}html.push(srch.title_html(item,{display_val:field.display_val},{value:value,advanced:false,quicksearch:quicksearch,opt_text:((item.r=="X")?"not like":"like")}));html.push('<div id="'+item.unique_id+'_body" class="body" style="text-align:left;clear:both;">');html.push("<table cellspacing=0 cellpadding=0>");html.push('<tr><td style="padding-bottom:6px;">');html.push('<input type="text" name="l_'+item.unique_id+'" id="l_'+item.unique_id+'" style="width:270px;" maxlength="500" value="'+item.c+'"onchange="srch.type[\'combo\'].change(srch.get_parent(this));" onkeyup="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" >");html.push("<span class=\"searchdesc\" onmouseover=\"this.className='searchdesc_hover';\" onmouseout=\"this.className='searchdesc';\" onclick=\"srch.type['combo'].showmore('"+item.unique_id+'\');" style="cursor:pointer;"><img src="/images/minihourglass.gif" /><!--Find via Keywords...--></span>');html.push(srch.update_html(item));html.push("<br><center>");if(field.map_area_autocomplete){html.push(" &nbsp; <span class=\"searchdesc\" onmouseover=\"this.className='searchdesc_hover';\" onmouseout=\"this.className='searchdesc';\" onclick=\"enableMappingAutoPopulation(srch.get_parent(this), 'combo', document.getElementById('l_"+item.unique_id+'\').value, srch.get_parent(this).lookup_name, srch.get_parent(this).map_cache_id);" style="cursor:pointer;">Find via Map Areas...</span>')}html.push("</center>");html.push("</td></tr>");html.push('<tr id="'+item.unique_id+'_showhide" style="display:none;">');html.push('<td style="text-align:left;border-top:1px dashed #666;padding-top:6px;">');html.push('<input type="text" name="t_'+item.unique_id+'" id="t_'+item.unique_id+'" style="padding:1px 2px;border:1px solid #666;margin:0 2px;width:210px;" maxlength="500" >');html.push('&nbsp;&nbsp;<button title="Look up values" style="cursor:pointer;" onclick="srch.type[\'combo\'].showlist(srch.get_parent(this)); return false;" /><small>Lookup Keywords</small></button>');html.push('<br /><select id="'+item.unique_id+'_matches" style="width:335px;margin-top:4px;" size="'+scrollsize+'" ondblclick="srch.type[\'combo\'].add(srch.get_parent(this));" multiple></select><br />');html.push("<center><button onclick=\"srch.type['combo'].add(srch.get_parent(this));return false;\" onsubmit=\"return false;\"><small>Add</small></button> <button onclick=\"srch.type['combo'].cancel('"+item.unique_id+'\');return false;" onsubmit="return false;"><small>Done</small></button></center>');html.push("</div>");html.push("</div>");html.push("</td></tr>");html.push("</table>");html.push("</div>");return html.join("")},add:function(item){var addBox=document.getElementById(item.unique_id+"_matches");var l_list=document.getElementById("l_"+item.unique_id).value.split(",");var l=document.getElementById("l_"+item.unique_id);for(var i=(addBox.childNodes.length-1);i>=0;i--){if(addBox.childNodes[i].selected){var found=false;for(var x=0;x<l_list.length;x++){if(l_list[x]==addBox.childNodes[i].value){found=true;break}}if(found){continue}if(item.c==""&&addBox.childNodes[i].value!=""){item.c="="+addBox.childNodes[i].value}else{if(addBox.childNodes[i].value!=""){item.c+=",="+addBox.childNodes[i].value}}if(l.value==""){l.value="="+addBox.childNodes[i].value}else{l.value+=", ="+addBox.childNodes[i].value}addBox.removeChild(addBox.childNodes[i])}}document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.combo.describe(item.c);if(addBox.childNodes.length<1){srch.type.combo.cancel(item.unique_id)}srch.type.combo.change(item);fadeElemInSrchWrapper(item.unique_id+"_update",0,false,1,50);return false},cancel:function(id){document.getElementById(id+"_showhide").style.display="none";return false},showmore:function(id){var smore=document.getElementById(id+"_showhide");if(smore.style.display=="none"){$(smore).slideDown("slow");document.getElementById("t_"+id).focus()}else{customSlideup(smore,"slow")}return false},operator:function(item){item.r=(item.r=="X")?"R":"X";document.getElementById(item.unique_id+"_operator").innerHTML=(item.r=="X")?"not like":"like";srch.enable(item,true);srch.update()},describe:function(value,item){if(item){changeSearchText(item.d,"",value.replace(/,/g,", "),"add")}return srch.desc_html(value.replace(/,/g,", "))},compile:function(item){return new Array({tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"combo"})},change:function(item,noEnable){item.c=document.getElementById("l_"+item.unique_id).value;document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.combo.describe(item.c,item);if(item.c==""&&!noEnable){srch.enable(item,false)}else{if(!noEnable){srch.enable(item,true)}}srch.update()},autopop:function(item_id,value){var input_field=document.getElementById("l_"+item_id);input_field.value=value.replace(/^(.)/,"=$1").replace(/,/g,",=");srch.type.combo.change(srch.get_parent(input_field))},showlist:function(item){while(document.getElementById(item.unique_id+"_matches").childNodes.length>0){document.getElementById(item.unique_id+"_matches").removeChild(document.getElementById(item.unique_id+"_matches").childNodes[0])}var qs=new Array();qs.push("cmd=srv+srch/getComboFields.html");qs.push("select_id="+item.unique_id+"_matches");qs.push("field_id="+item.f);qs.push("card_fmt_list="+card_fmt_list);qs.push("table_name="+item.tb);qs.push("searchstring="+document.getElementById("t_"+item.unique_id).value);qs.push("tech_id="+js_tech_id);qs.push("ma_tech_id="+js_ma_tech_id);loadJavaScriptDoc("querystring","mainmenu.cgi",qs.join("&"),true)}};srch.type.member={team_members:{},render:function(item,value,required,info,advanced){var html=new Array();var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;var field=currentCardFmt.allfields[currentCardFmt.allfieldsObjects[info.split("_")[0]]];var listing=false;var colisting=false;var selling=false;var coselling=false;var fullopts=(!interfaceObj.idx||(interfaceObj.idx_fullmembersrch&&interfaceObj.idx_fullmembersrch=="Y")?true:false);if(!required||required==""){listing=true;selling=true}else{if(required.indexOf("L")>-1){listing=true}if(required.indexOf("S")>-1){selling=true}if(info.indexOf("Member")>-1){if(required.indexOf("C")>-1){colisting=true}if(required.indexOf("A")>-1){coselling=true}}}item.f=(info.split("_")[1]?info.split("_")[1]:"");info=(info.split("_")[0]?info.split("_")[0]:"");item.tb=(info=="Member")?"agent":(info=="Office")?"agency":"company";item.o="in";item.c=(!value)?"":value;item.d=info;item.r=required;item.g="";item.mask=field.field_id.split(":")[1]||"";if(advancedType=="none"&&!interfaceObj.idx){html.push('<div class="delbutton" onclick="removeCriteria(srch.get_parent(this));event.cancelBubble=true;" title="Remove from this search">X</div>')}html.push('<div class="title click" id="'+item.unique_id+'_title" onclick="showHideBody(srch.get_parent(this));" title="Click to edit">');html.push('<div class="hangingindent">');html.push('<input id="enabled_'+item.unique_id+'" onfocus="showHideBody(srch.get_parent(this),false,true);" type="checkbox" '+((!quicksearch&&advancedType!="off")?"checked":"")+' onclick="event.cancelBubble=true;srch.enable(srch.get_parent(this),this.checked);srch.update();" />');html.push(" Listing/Selling "+info);html.push('<span id="'+item.unique_id+'_desc" class="desc">');html.push("</span>");html.push("</div>");html.push("</div>");html.push('<div id="'+item.unique_id+'_body" class="body" style="clear:both;">');html.push('<table id="'+item.unique_id+'_body_table" cellpadding="0" cellspacing="0" border="0" style="width:100%" >');html.push('<tr><td colspan=2><b>Name: </b><input type=text id="'+item.unique_id+"_name\" onkeypress=\"if (event.keyCode == 13 && !this.wait){ this.wait = true;lookupMember(srch.get_parent(this));setTimeout('document.getElementById(\\'"+item.unique_id+"_name\\').wait = false;',100);}\" size=20 maxlength=100 />&nbsp;&nbsp;<button onclick=\"if (!document.getElementById('"+item.unique_id+'_name\').wait)lookupMember(srch.get_parent(this));return false;" onsubmit="return false;"><small><b>Find</b></small></button></td></tr>');html.push("<tr><td colspan=2 align=left><b>"+(info=="Company"?"Companies":info+"s")+": </b></td></tr>");html.push('<tr><td align=left><select size="'+(scrollsize>4?scrollsize:6)+'" style="width:215px;" id="'+item.unique_id+'_select" name="'+item.unique_id+'_select" onchange="srch.type[\'member\'].change(srch.get_parent(this))" multiple></select>');html.push("<br /><br /><center><input "+(!fullopts?'style="display:none;"':"")+' type=radio name="'+item.unique_id+'_field" id="'+item.unique_id+'_field1" value=and '+(item.f=="and"&&!interfaceObj.idx?"checked=checked":"")+" onchange=\"srch.type['member'].change(srch.get_parent(this));\">");html.push("<label "+(!fullopts?'style="display:none;"':"")+' for="'+item.unique_id+'_field1">And</label>');html.push("<input type=radio "+(!fullopts?'style="display:none;"':"")+' name="'+item.unique_id+'_field" id="'+item.unique_id+'_field2" value=or '+(quicksearch||item.f==""||interfaceObj.idx?"checked=checked":(item.f=="or"?"checked=checked":""))+" onchange=\"srch.type['member'].change(srch.get_parent(this));\">");html.push("<label "+(!fullopts?'style="display:none;"':"")+' for="'+item.unique_id+'_field2">Or</label>');html.push("</center></td>");html.push("<td align=left>");html.push('<table cellpadding=2 cellspacing=0 border=0 style="width:133px;text-align:left;'+(!fullopts?"display:none;":"")+'">');var a=new Array();var b=new Array();if(item.mask.indexOf("L")>=0){a.push("listing");b.push("Listing")}if(info=="Member"&&item.mask.indexOf("C")>=0){a.push("colisting");b.push("Co-listing")}if(item.mask.indexOf("S")>=0){a.push("selling");b.push("Selling")}if(info=="Member"&&item.mask.indexOf("c")>=0){a.push("coselling");b.push("Co-selling")}for(var x=0;x<a.length;x++){html.push('<tr><td style="width:10%;vertical-align:bottom;">');html.push('<input type=checkbox name="'+item.unique_id+'_listing" id="'+item.unique_id+"_"+a[x]+'" onclick="srch.type[\'member\'].change(srch.get_parent(this))" value=Y '+(listing||interfaceObj.idx?"checked=checked":"")+"></td>");html.push('<td style="width:90%;vertical-align:bottom;"><label for="'+item.unique_id+"_"+a[x]+'"> '+b[x]+" "+info+"</label>");html.push("</td></tr>")}html.push("</table>");html.push("</td></tr>");html.push("</table>");html.push("</div>");return html.join("")},change:function(item,noEnable){if(!document.getElementById(item.unique_id+"_select")||!document.getElementById(item.unique_id+"_select").value){if(document.getElementById("enabled_"+item.unique_id)){srch.enable(item,false);if(item.c!=""){item.c="";srch.update()}}return}var tmp="";var sel=document.getElementById(item.unique_id+"_select");item.f=(document.getElementById(item.unique_id+"_field1").checked?"and":"or");var name="";for(var x=0;x<sel.childNodes.length;x++){if(sel.childNodes[x].selected){if(tmp==""){tmp="x'"+sel.childNodes[x].value+"'"}else{tmp+=",x'"+sel.childNodes[x].value+"'"}if(name==""){name=sel.childNodes[x].innerHTML}else{name+=" "+item.f+" "+sel.childNodes[x].innerHTML}if(this.team_members[sel.childNodes[x].value]){for(var z=0;z<this.team_members[sel.childNodes[x].value].length;z++){if(tmp.indexOf(this.team_members[sel.childNodes[x].value][z][0])<0){tmp+=",x'"+this.team_members[sel.childNodes[x].value][z][0]+"'"}}}}}item.c=tmp;var listing=(item.mask.indexOf("L")>=0&&document.getElementById(item.unique_id+"_listing").checked);var selling=(item.mask.indexOf("S")>=0&&document.getElementById(item.unique_id+"_selling").checked);if(item.d=="Member"){var colisting=(item.mask.indexOf("C")>=0&&document.getElementById(item.unique_id+"_colisting").checked);var coselling=(item.mask.indexOf("c")>=0&&document.getElementById(item.unique_id+"_coselling").checked)}else{var colisting=coselling=false}if(listing){item.r="L"}if(selling){item.r+="S"}if(item.d=="Member"){if(colisting){item.r+="C"}if(coselling){item.r+="A"}}if(item.f!=""){if(!noEnable){document.getElementById(item.unique_id+"_desc").innerHTML="&nbsp;&nbsp;"+name;changeSearchText(item.d,"",document.getElementById(item.unique_id+"_desc").innerHTML,"add");if((!listing&&!selling&&!colisting&&!coselling)||item.c==""){srch.enable(item,false)}else{srch.enable(item,true)}}srch.update()}else{if(!noEnable){document.getElementById(item.unique_id+"_desc").innerHTML="";changeSearchText(item.d,"",document.getElementById(item.unique_id+"_desc").innerHTML,"remove");srch.enable(item,false)}}},operator:function(item){item.r=(item.r=="X")?"R":"X";document.getElementById(item.unique_id+"_operator").innerHTML=(item.r=="X")?"is not":"is";srch.type.member.change(item)},compile:function(item){var qs=new Array();qs.push({tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"member"});return qs}};srch.type.block={render:function(item,value,required,info,advanced){var html=new Array();var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;item.kind="block";item.tb=(info?info:"block");item.t="block";item.display_val="Block/Ranged Search";item.r=(!required||required=="Q")?"R":required;item.g="";item.f="";item.o="";item.c="";item.min="0";item.minblock="1";if(!value||value.replace(/\|\|/g,"")==""){if(item.tb=="range"){item.f="0,0,0,0";item.o="N,N,W,W"}else{item.o="0,0";item.c="N,W";item.f="1"}}else{var values=value.split("||");if(item.tb=="range"){item.f=(values[0]?values[0]:"0,0,0,0");item.o=(values[1]?values[1]:"N,N,W,W")}else{item.o=(values[0]?values[0]:"0,0");item.c=(values[1]?values[1]:"N,E");item.f=(values[2]?values[2]:"1")}}if(item.tb=="range"){item.d="Range Search at "+item.f.split(",")[0]+item.o.split(",")[0]+","+item.f.split(",")[1]+item.o.split(",")[1]+","+item.f.split(",")[2]+item.o.split(",")[2]+","+item.f.split(",")[3]+item.o.split(",")[3]}else{item.d="Block Search at "+item.o.split(",")[0]+item.c.split(",")[0]+","+item.o.split(",")[1]+item.c.split(",")[1]+","+item.f+" Blocks"}item.toggle=((!quicksearch&&advancedType!="off")?"on":"off");if(item.toggle=="on"){changeSearchText(item.d.split(" at ")[0],"at",item.d.split(" at ")[1],"add")}if(advancedType=="none"&&!interfaceObj.idx){html.push('<div class="delbutton" onclick="removeCriteria(srch.get_parent(this));event.cancelBubble=true;" title="Remove '+item.display_val+' from this search">X</div>')}html.push('<div class="title click" id="'+item.unique_id+'_title" onclick="showHideBody(srch.get_parent(this));" title="Click to edit">');html.push('<div class="hangingindent">');html.push('<input id="enabled_'+item.unique_id+'" onfocus="showHideBody(srch.get_parent(this),false,true);" type="checkbox" '+((!quicksearch&&advancedType!="off")?"checked":"")+' onclick="event.cancelBubble=true;srch.enable(srch.get_parent(this),this.checked);srch.update();"  /> ');html.push(srch.operator_html(item,((item.tb=="range")?"Range":"Block")));html.push(" Search ");html.push('<span id="'+item.unique_id+'_desc" class="desc">');html.push(srch.type.block.describe(item));html.push("</span>");html.push("</div>");html.push("</div>");html.push('<div id="'+item.unique_id+'_body" class="body">');html.push(srch.type.block.drawbody(item));html.push("</div>");return html.join("")},drawbody:function(item){if(item.tb=="range"){inputs=item.f.split(",");in1=inputs[0];in1a=inputs[1];in2=inputs[2];in2a=inputs[3];sels=item.o.split(",");sel1=sels[0];sel1b=sels[1];sel2=sels[2];sel2b=sels[3]}else{if(item.tb=="block"){inputs=item.o.split(",");sels=item.c.split(",");sel1=sels[0];sel2=sels[1];in1=inputs[0];in2=inputs[1];blocks=item.f}}var html=new Array();html.push("North-South");html.push('<br/><center><input type="text" name="input1_'+item.unique_id+'" id="input1_'+item.unique_id+'" size="4" maxlength="5" value="'+in1+'" onchange="this.value=verifyint(this.value,\''+item.min+"');srch.type['block'].change(srch.get_parent(this));\">");html.push('<select onchange="srch.type[\'block\'].change(srch.get_parent(this));"	style="width:50px;" id="s1_'+item.unique_id+'" name="s1_'+item.unique_id+'"><option value="N" '+(sel1=="N"?"selected":"")+' >N</option><option value="S" '+(sel1=="S"?"selected":"")+" >S</option></select>");if(item.tb=="range"){html.push(' to <input type="text" name="input1b_'+item.unique_id+'" id="input1b_'+item.unique_id+'" size="4" maxlength="5" value="'+in1a+'" onchange="this.value=verifyint(this.value,\''+item.min+"');srch.type['block'].change(srch.get_parent(this));\">");html.push('<select onchange="srch.type[\'block\'].change(srch.get_parent(this));"	 style="width:50px;" id="s1b_'+item.unique_id+'" name="s1b_'+item.unique_id+'"><option value="N" '+(sel1b=="N"?"selected":"")+'>N</option><option value="S" '+(sel1b=="S"?"selected":"")+">S</option></select>")}html.push("</center><br />");html.push("East-West");html.push('<br /><center><input type="text" name="input2_'+item.unique_id+'" id="input2_'+item.unique_id+'" size="4" maxlength="5" value="'+in2+'" onchange="this.value=verifyint(this.value,\''+item.min+"');srch.type['block'].change(srch.get_parent(this));\">");html.push('<select onchange="srch.type[\'block\'].change(srch.get_parent(this));"	 style="width:50px;" id="s2_'+item.unique_id+'" name="s1_'+item.unique_id+'"><option value="W" '+(sel2=="W"?"selected":"")+'>W</option><option value="E" '+(sel2=="E"?"selected":"")+">E</option></select>");if(item.tb=="range"){html.push(' to <input type="text" name="input2b_'+item.unique_id+'" id="input2b_'+item.unique_id+'" size="4" maxlength="5" value="'+in2a+'" onchange="this.value=verifyint(this.value,\''+item.min+"');srch.type['block'].change(srch.get_parent(this));\">");html.push('<select onchange="srch.type[\'block\'].change(srch.get_parent(this));"	style="width:50px;" id="s2b_'+item.unique_id+'" name="s2b_'+item.unique_id+'"><option value="W" '+(sel2b=="W"?"selected":"")+'>W</option><option value="E" '+(sel2b=="E"?"selected":"")+">E</option></select>")}html.push("</center><br />");if(item.tb=="block"){html.push("Number of Blocks");html.push('<br /><center><input type="text" name="blocks_'+item.unique_id+'" id="blocks_'+item.unique_id+'" size=5 maxlength="4" value="'+blocks+'" onchange="this.value=verifyint(this.value,\''+item.minblock+"');srch.type['block'].change(srch.get_parent(this));\"></center>")}html.push("</table>");return html.join("")},operator:function(item){changeSearchText(item.d.split(" at ")[0],"","","remove");item.tb=(item.tb=="range")?"block":"range";if(item.tb=="range"){var new_o=item.c.split(",")[0]+",N,"+item.c.split(",")[1]+",W";var new_f=item.o.split(",")[0]+","+item.min+","+item.o.split(",")[1]+","+item.min;var new_c="";var new_d="Range Search at "+new_f.split(",")[0]+new_o.split(",")[0]+","+new_f.split(",")[1]+new_o.split(",")[1]+","+new_f.split(",")[2]+new_o.split(",")[2]+","+new_f.split(",")[3]+new_o.split(",")[3]}else{var new_o=item.f.split(",")[0]+","+item.f.split(",")[2];var new_f=item.minblock;var new_c=item.o.split(",")[0]+","+item.o.split(",")[2];var new_d="Block Search at "+item.f.split(",")[0]+item.o.split(",")[0]+","+item.f.split(",")[2]+item.o.split(",")[2]+","+new_f+" Blocks"}item.f=new_f;item.o=new_o;item.c=new_c;item.d=new_d;document.getElementById(item.unique_id+"_operator").innerHTML=(item.tb=="range")?"Range":"Block";document.getElementById(item.unique_id+"_body").innerHTML=srch.type.block.drawbody(item);document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.block.describe(item);srch.enable(item,true);srch.update()},describe:function(item){return"at "+srch.desc_html(item.d.split(" at ")[1])},compile:function(item){return[{tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:"R",g:item.g,t:"range"}]},change:function(item,noEnable){if(item.tb=="range"){var new_o=document.getElementById("s1_"+item.unique_id).value+","+document.getElementById("s1b_"+item.unique_id).value+","+document.getElementById("s2_"+item.unique_id).value+","+document.getElementById("s2b_"+item.unique_id).value;var new_f=document.getElementById("input1_"+item.unique_id).value+","+document.getElementById("input1b_"+item.unique_id).value+","+document.getElementById("input2_"+item.unique_id).value+","+document.getElementById("input2b_"+item.unique_id).value;var new_c="";var new_d="Range Search at "+new_f.split(",")[0]+new_o.split(",")[0]+","+new_f.split(",")[1]+new_o.split(",")[1]+","+new_f.split(",")[2]+new_o.split(",")[2]+","+new_f.split(",")[3]+new_o.split(",")[3]}else{var new_o=document.getElementById("input1_"+item.unique_id).value+","+document.getElementById("input2_"+item.unique_id).value;var new_f=document.getElementById("blocks_"+item.unique_id).value;new_f=(!isNaN(new_f)?new_f:item.minblock);var new_c=document.getElementById("s1_"+item.unique_id).value+","+document.getElementById("s2_"+item.unique_id).value;var new_d="Block Search at "+new_o.split(",")[0]+new_c.split(",")[0]+","+new_o.split(",")[1]+new_c.split(",")[1]+","+new_f+" Blocks"}item.f=new_f;item.o=new_o;item.c=new_c;item.d=new_d;document.getElementById(item.unique_id+"_desc").innerHTML=srch.type.block.describe(item);if(!noEnable){srch.enable(item,true)}srch.update()}};srch.type.room={render:function(item,value,required,info,advanced){var html=new Array();var quicksearch=(required=="Q")?true:false;var advancedType=(advanced==null)?"none":advanced;item.toggle=((!quicksearch&&advancedType!="off")?"on":"off");item.kind=item.tb="room";item.f="scroll_id";item.c=value;item.o="in";item.r="";item.g="";item.d=info;var min=0;var length=0;var width=0;var main=upper=lower=false;var cyes=cno=false;var wyes=wno=false;if(value){var dList=item.c.split(",");length=(!isNaN(dList[1])?dList[1]:1);width=(!isNaN(dList[2])?dList[2]:2);main=(dList[3].indexOf("M")>=0);upper=(dList[3].indexOf("U")>=0);lower=(dList[3].indexOf("L")>=0);cyes=(dList[4].indexOf("Y")>=0);cno=(dList[4].indexOf("N")>=0);wyes=(dList[5].indexOf("Y")>=0);wno=(dList[5].indexOf("N")>=0)}html.push(srch.title_html(item,{display_val:info},{value:value,advanced:advancedType,quicksearch:quicksearch}));html.push('<div id="'+item.unique_id+'_body" class="body">');html.push('<b>Length:</b> <input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"length_"+item.unique_id+'" id="length_'+item.unique_id+'" size="5" maxlength="10" value="'+length+'" onchange="this.value=verifyfloat(this.value,\''+min+"');srch.type['room'].change(srch.get_parent(this));\">&nbsp;&nbsp;");html.push('<b>Width:</b> <input type="text" onkeypress="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});\" name=\"width_"+item.unique_id+'" id="width_'+item.unique_id+'" size="5" maxlength="10" value="'+width+'" onchange="this.value=verifyfloat(this.value,\''+min+"');srch.type['room'].change(srch.get_parent(this));\">&nbsp;&nbsp;");html.push(srch.update_html(item));html.push("<br><br>");html.push("<b>Level:</b><br>");html.push('<div style="padding-left:5px;"><input type="checkbox" name="main_'+item.unique_id+'" id="main_'+item.unique_id+'" onclick="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});srch.type['room'].change(srch.get_parent(this));\" value=\"M\" "+(main?"checked":"")+'><label for="main_'+item.unique_id+'">Main</label>&nbsp;');html.push('<input type="checkbox" name="upper_'+item.unique_id+'" id="upper_'+item.unique_id+'" onclick="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});srch.type['room'].change(srch.get_parent(this));\" value=\"U\" "+(upper?"checked":"")+'><label for="upper_'+item.unique_id+'">Upper</label>&nbsp;');html.push('<input type="checkbox" name="lower_'+item.unique_id+'" id="lower_'+item.unique_id+'" onclick="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});srch.type['room'].change(srch.get_parent(this));\" value=\"L\" "+(lower?"checked":"")+'><label for="lower_'+item.unique_id+'">Lower</label>');html.push("</div><br>");html.push("<b>Carpet:</b><br>");html.push('<div style="padding-left:5px;"><input type="checkbox" name="cyes_'+item.unique_id+'" id="cyes_'+item.unique_id+'" onclick="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});srch.type['room'].change(srch.get_parent(this));\" value=\"Y\" "+(cyes?"checked":"")+'><label for="cyes_'+item.unique_id+'">Yes</label>&nbsp;');html.push('<input type="checkbox" name="cno_'+item.unique_id+'" id="cno_'+item.unique_id+'" onclick="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});srch.type['room'].change(srch.get_parent(this));\" value=\"N\" "+(cno?"checked":"")+'><label for="cno_'+item.unique_id+'">No</label>');html.push("</div><br>");html.push("<b>Window Treatment:</b><br>");html.push('<div style="padding-left:5px;"><input type="checkbox" name="wyes_'+item.unique_id+'" id="wyes_'+item.unique_id+'" onclick="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});srch.type['room'].change(srch.get_parent(this));\" value=\"Y\" "+(wyes?"checked":"")+'><label for="wyes_'+item.unique_id+'">Yes</label>&nbsp;');html.push('<input type="checkbox" name="wno_'+item.unique_id+'" id="wno_'+item.unique_id+'" onclick="$(\'#'+item.unique_id+"_update').animate({'opacity':'show'});srch.type['room'].change(srch.get_parent(this));\" value=\"N\" "+(wno?"checked":"")+'><label for="wno_'+item.unique_id+'">No</label>');html.push("</div>");html.push("</div>");return html.join("")},change:function(item,noEnable){var l=document.getElementById("length_"+item.unique_id).value;var w=document.getElementById("width_"+item.unique_id).value;var level=(document.getElementById("main_"+item.unique_id).checked?"M":"")+(document.getElementById("upper_"+item.unique_id).checked?"U":"")+(document.getElementById("lower_"+item.unique_id).checked?"L":"");var carpet=(document.getElementById("cyes_"+item.unique_id).checked?"Y":"")+(document.getElementById("cno_"+item.unique_id).checked?"N":"");var wtreat=(document.getElementById("wyes_"+item.unique_id).checked?"Y":"")+(document.getElementById("wno_"+item.unique_id).checked?"N":"");item.c=item.c.split(",")[0]+","+l+","+w+","+level+","+carpet+","+wtreat;document.getElementById(item.unique_id+"_desc").innerHTML=" &nbsp; "+srch.type.room.describe(item.c,item);if(!noEnable){srch.enable(item,true)}srch.update()},describe:function(value,item){var value="";var dList=item.c.split(",");value="length of "+dList[1]+", width of "+dList[2];if(dList[3].indexOf("M")!=-1){value+=", main level"}if(dList[3].indexOf("U")!=-1){value+=", upper level"}if(dList[3].indexOf("L")!=-1){value+=", lower level"}if(dList[4].indexOf("Y")!=-1&&dList[4].indexOf("N")<0){value+=", carpeted"}else{if(dList[4].indexOf("N")!=-1&&dList[4].indexOf("Y")<0){value+=", not carpeted"}}if(dList[5].indexOf("Y")!=-1&&dList[5].indexOf("N")<0){value+=", windows treated"}else{if(dList[5].indexOf("N")!=-1&&dList[5].indexOf("Y")<0){value+=", windows untreated"}}changeSearchText(item.d,(item.r=="X")?"not between":"between",value,(item.toggle=="on"?"add":"remove"),item);return" &nbsp;"+value},compile:function(item){return[{tb:item.tb,f:item.f,o:item.o,c:item.c,d:item.d,r:item.r,g:item.g,t:"room"}]}};var helpfile="search_results.html";var HALT_COMPILE=false;var sortranonce=false;var currentlyviewing="";var miniwidth=315;var miniwidth_srch=385;var miniwidth_orig=315;var tabArray=new Array("tab_grid","tab_detail","tab_tour","tab_stats","tab_notes","tab_map","no_tab");var iframesArray=new Array("iframe_detail","iframe_tour","iframe_stats","iframe_notes","iframe_map","iframe_no_tab");var optionsArray=new Array("options_detail","options_tour","options_stats","options_notes","options_map","options_no_tab");var tabIndex=0;var lasttabran="";var results_totaldiv,matchesdiv,selectedinput,begindexdiv,endindexdiv,loadedtd,selectedtd,firsttimeindiv,cart_totaldiv,menuicons,menuicons_container,resultsheader,menushadow,loadingdiv,warningdiv,singlegriddiv,singlegriddiv_blackout,new_quicksearch,morelistingstop,morelistingsbot,floatingsmilies,tabcheckdiv,tabcheckdiv_a,tabcheck;var new_sd_tech_id,thegrid,thegrid_dummy,gridC,businessCardPanel,switchviewdiv,rightgridoptionsdiv,minibar,hidegridbut,grid,thegridbody,thegridbody_dummy,gridbottom,options_summary,iframe_detail,iframe_tour,iframe_map,iframe_stats,iframe_notes,iframe_search,iframe_no_tab;var gridchangebuttons,copyrighttd,thegridheader,thegridheader_dummy,bottomsection,topsection,lowertopleft,lowertoptableleft,lowertopright,lowertoptableright,buscardinnerds,buscardlinks,dropmenudiv,searchgriddiv,enhance,grid_subtabs,listingrotatordiv,photodescriptions;var tablecolumns=new Array();var neededcolumns=new Array();var colArray=new Object();var magicnumtoacton=200;var fetchamount=25;var alreadyrunning=false;var Lselectorenabled=true;var howmanytoinit=50;var howmanytoshow=50;var sortmax=200;var sellistings=new Array();var resultslistings=new Array();var original_cart_listings=null;var favlistings=new Array();var poslistings=new Array();var rejlistings=new Array();var agtlistings=new Array();var begindex,endindex,selectedlisting,selectedInd;var prev_selectedlisting="";var selListObj=new Object();var scrollcause=false;var sortmenu,filtermenu;var uniquet=new Date().getTime();var dbfetchamt=5000;var tab_detail_listing,tab_tour_listing,tab_map_listing,tab_stats_listing,tab_notes_listing;var noListingMode=true;var printlimit=200;var warningid,gridelem,detailselectvalue,gridlink_back2search,lastfire,gridinlineiframe,overlayPanel,backToSearch,overlayframe,gridimage,singlegridimage,clickedHeader,clickedHeaderLabel,gridsortlink,top_gridsortlink,gridviewlink,gridviewlinkhotsheet,gridlink_updatematches,topgridlink_updatematches;var search_subtabs,searchtab_quicksearch,searchtab_mapsearch,searchtab_fullsearch,options_no_tab,fs_update_link;var busCardHolder=new Object();var agent_prefs={};var idxsearchcounter=0;var idxlistingsviewedcounter=0;var minicol=3;var gridphoto=true;var allwherestr="";var cart_allwherestr="";var results_allwherestr="";var allorderby="";var cart_allorderby="";var results_allorderby="";var current_grid_totallistings=0;var current_grid_totalextents=null;var current_grid_unmapped_count=0;var cart_totallistings=0;var results_totallistings=0;var whereStringChanged_map=false;var whereStringChanged_stats=false;var confirmcancelled=false;var keepprompting=true;var listingchanged="no";var sortobj=new Object();var sortorder=new Array();var photoobj=new Object();var photoIndex=0;var reportselecthtml="";var reportmenu=new Array();var cust_sort_menu=new Array();var srmode="results";var gridlink_results,gridlink_hotsheet,gridlink_cart,gridlink_match,matchesdivtext,show_datashare_badge,print_sd_tech_id,fullsearchgridframe,hotsheetlabel,beginandendspan,orderbuttons,orderbuttons_dead;var topgridlink_outermatch,gridlink_outermatch,listabmessageicons,top_gridlink_match,top_matchesdiv,top_matchesdivtext,fieldPicker,fieldPicker_list,backshadowlayer,useTempScheduleId;var orig_gridfont=9;var gridfont=9;var report_puborpriv="private";var businesscard="generic";var warnings=new Array();var last_detail_ran="reports";var DetailTabIndex=1,TourTabIndex=2,CompareTabIndex=3,DiscussTabIndex=4,MapTabIndex=5,NoTabIndex=6;var oneline=false;var resizing=false;var listing_in_focus_not_in_grid=false;var approve_comment,portal_client_name;var useopenhouseview=false;var moreinfomap_tech_id;var approvehides=new Object();var pendingapprove=false;var viewCustomLabels=new Object();var tab_detail_first_time_check=false;var singlelistingviewtype="pics";var currentlyFading=null;var carts_loaded=false;var num_carts=0,chk_counter=0;var searchmode=null;var fs_wait=stallForFire=squelchKeyCheck=false;var metro_rooms=null;var map_haveWarned=suppress_mapping=false;var field_buffer=new Array();var advancedCriteriaDrawn=false;var all_fields_retrieved=false;var global_shape_item_to_preserve=null;var using_custom_sort=false;var quick_search_object={};var searchmenuitems=[];function defineElementVariables(){approve_comment=document.getElementById("approve_comment");gridlink_hotsheet=document.getElementById("gridlink_hotsheet");gridlink_cart=document.getElementById("gridlink_cart");gridlink_results=document.getElementById("gridlink_results");gridlink_match=document.getElementById("gridlink_match");top_gridlink_match=document.getElementById("top_gridlink_match");topgridlink_outermatch=document.getElementById("topgridlink_outermatch");gridlink_outermatch=document.getElementById("gridlink_outermatch");matchesdivtext=document.getElementById("matchesdivtext");top_matchesdivtext=document.getElementById("top_matchesdivtext");results_totaldiv=document.getElementById("results_totaldiv");matchesdiv=document.getElementById("matchesdiv");top_matchesdiv=document.getElementById("top_matchesdiv");hotsheetlabel=document.getElementById("hotsheetlabel");selectedinput=document.getElementById("selectedinput");begindexdiv=document.getElementById("begindexdiv");endindexdiv=document.getElementById("endindexdiv");loadedtd=document.getElementById("loadedtd");selectedtd=document.getElementById("selectedtd");cart_totaldiv=document.getElementById("cart_totaldiv");fullsearchgridframe=document.getElementById("fullsearchgridframe");firsttimeindiv=document.getElementById("firsttimeindiv");loadingdiv=document.getElementById("loadingdiv");warningdiv=document.getElementById("warningdiv");menuicons_container=document.getElementById("menuicons_container");resultsheader=document.getElementById("resultsheader");menuicons=document.getElementById("menuicons");menushadow=document.getElementById("menushadow");singlegriddiv=document.getElementById("singlegriddiv");singlegriddiv_blackout=document.getElementById("singlegriddiv_blackout");new_quicksearch=document.getElementById("new_quicksearch");searchgriddiv=document.getElementById("searchgriddiv");enhance=document.getElementById("enhance");morelistingstop=document.getElementById("morelistingstop");morelistingsbot=document.getElementById("morelistingsbot");floatingsmilies=document.getElementById("floatingsmilies");tabcheck=document.getElementById("tabcheck");tabcheckdiv=document.getElementById("tabcheckdiv");tabcheckdiv_a=document.getElementById("tabcheckdiv_a");new_sd_tech_id=document.getElementById("new_sd_tech_id");thegrid=document.getElementById("thegrid");thegrid_dummy=document.getElementById("thegrid_dummy");gridC=document.getElementById("gridC");businessCardPanel=document.getElementById("businessCardPanel");switchviewdiv=document.getElementById("switchviewdiv");rightgridoptionsdiv=document.getElementById("rightgridoptionsdiv");minibar=document.getElementById("minibar");hidegridbut=document.getElementById("hidegridbut");grid=document.getElementById("grid");thegridbody=document.getElementById("thegridbody");thegridbody_dummy=document.getElementById("thegridbody_dummy");gridbottom=document.getElementById("gridbottom");options_summary=document.getElementById("options_summary");options_no_tab=document.getElementById("options_no_tab");iframe_tour=document.getElementById("iframe_tour");iframe_detail=document.getElementById("iframe_detail");iframe_map=document.getElementById("iframe_map");iframe_stats=document.getElementById("iframe_stats");iframe_notes=document.getElementById("iframe_notes");iframe_search=document.getElementById("iframe_search");iframe_no_tab=document.getElementById("iframe_no_tab");gridchangebuttons=document.getElementById("gridchangebuttons");copyrighttd=document.getElementById("copyrighttd");thegridheader=document.getElementById("thegridheader");thegridheader_dummy=document.getElementById("thegridheader_dummy");bottomsection=document.getElementById("bottomsection");topsection=document.getElementById("topsection");lowertopleft=document.getElementById("lowertopleft");lowertoptableleft=document.getElementById("lowertoptableleft");lowertopright=document.getElementById("lowertopright");lowertoptableright=document.getElementById("lowertoptableright");buscardinnerds=document.getElementById("buscardinnerds");buscardlinks=document.getElementById("buscardlinks");dropmenudiv=document.getElementById("dropmenudiv");beginandendspan=document.getElementById("beginandendspan");orderbuttons=document.getElementById("orderbuttons");orderbuttons_dead=document.getElementById("orderbuttons_dead");gridinlineiframe=document.getElementById("gridinlineiframe");overlayPanel=document.getElementById("overlayPanel");backToSearch=document.getElementById("backToSearch");gridsortlink=document.getElementById("gridsortlink");top_gridsortlink=document.getElementById("top_gridsortlink");gridviewlink=document.getElementById("gridviewlink");gridviewlinkhotsheet=document.getElementById("gridviewlinkhotsheet");overlayframe=document.getElementById("overlayframe");gridlink_back2search=document.getElementById("gridlink_back2search");gridimage=document.getElementById("gridimage");singlegridimage=document.getElementById("singlegridimage");gridlink_updatematches=document.getElementById("gridlink_updatematches");topgridlink_updatematches=document.getElementById("topgridlink_updatematches");search_subtabs=document.getElementById("search_subtabs");searchtab_quicksearch=document.getElementById("searchtab_quicksearch");searchtab_mapsearch=document.getElementById("searchtab_mapsearch");searchtab_fullsearch=document.getElementById("searchtab_fullsearch");grid_subtabs=document.getElementById("grid_subtabs");fs_update_link=document.getElementById("fs_update_link");listabmessageicons=document.getElementById("listabmessageicons");fieldPicker=document.getElementById("fieldPicker");fieldPicker_list=document.getElementById("fieldPicker_list");listingrotatordiv=document.getElementById("listingrotatordiv");photodescriptions=document.getElementById("photo-descriptions");backshadowlayer=document.getElementById("backshadowlayer");if(browser_type=="IE"||browser_type=="Safari"||browser_type=="Opera"){gridelem=gridC}else{gridelem=thegridbody}}function srchlog(e,l,addprev,usethislisting,additionalinfo){var tmplo=new Object();tmplo.e=e;tmplo.l=l;if(!usethislisting){tmplo.i=selectedlisting}else{tmplo.i=usethislisting}tmplo.n=uniquet;tmplo.d="search results";tmplo.c=lasttabran;if(additionalinfo){tmplo.a=additionalinfo.substr(0,495)}if(addprev){tmplo.i2=prev_selectedlisting}if(interfaceObj.portal){tmplo.t="portal";tmplo.u=rmxId(client_id)}else{if(interfaceObj.privatemode){tmplo.t="private";tmplo.u=rmxId(js_tech_id)}else{if(interfaceObj.idx){tmplo.t="IDX";tmplo.u=rmxId(js_tech_id);tmplo.s=idx_link_tech_id}else{if(interfaceObj.publicside){tmplo.t="email";tmplo.u=rmxId(js_tech_id)}else{tmplo.t="print";tmplo.u=rmxId(js_tech_id)}}}}flexmls.Log(tmplo)}function srchlog2(a,b){if(typeof(srchlog)=="function"){srchlog(a,b)}else{if(parent&&typeof(parent.srchlog)=="function"){parent.srchlog(a,b)}}}function setHelpFile(filename){if(filename){helpfile=filename}else{if(tabIndex==7&&document.getElementById(searchmode)){helpfile="new_search_results_"+searchmode+".html"}else{helpfile="new_search_results_"+tabArray[tabIndex]+".html"}}if(!helpfile||helpfile==""){helpfile="new_search_results_tab_grid.html"}}function keyCheck(e){if(squelchKeyCheck){return true}e=e||window.event;if(tabArray[tabIndex]=="tab_tour"&&iframe_tour&&iframe_tour.contentWindow.keyCheck){iframe_tour.contentWindow.keyCheck(e)}if(e.ctrlKey&&e.shiftKey){switch(e.keyCode){case 65:srchlog("keyboard shortcut","A");if(interfaceObj.can_cma){fireCMA();return false}else{return true}case 67:srchlog("keyboard shortcut","C");if(interfaceObj.show_compare){clickTab("tab_stats");return false}else{return true}case 68:srchlog("keyboard shortcut","D");if(interfaceObj.show_detail){clickTab("tab_detail");return false}else{return true}case 69:srchlog("keyboard shortcut","E");if(interfaceObj.can_email){fireEmail();return false}else{return true}case 71:srchlog("keyboard shortcut","G");if(interfaceObj.show_discuss){clickTab("tab_notes");return false}else{return true}case 76:srchlog("keyboard shortcut","L");if(interfaceObj.show_grid){clickTab("tab_grid");return false}else{return true}case 77:srchlog("keyboard shortcut","M");if(interfaceObj.show_map){clickTab("tab_map");return false}else{return true}case 79:srchlog("keyboard shortcut","O");if(interfaceObj.show_photos){clickTab("tab_tour");return false}else{return true}case 80:srchlog("keyboard shortcut","P");if(interfaceObj.can_print){firePrint();return false}else{return true}case 82:srchlog("keyboard shortcut","R");if(interfaceObj.can_drivingdirections){fireDirections();return false}else{return true}case 83:srchlog("keyboard shortcut","S");if(interfaceObj.can_save){fireSave();return false}else{return true}case 84:srchlog("keyboard shortcut","T");if(interfaceObj.can_search){editSearch();return false}else{return true}case 85:srchlog("keyboard shortcut","U");if(interfaceObj.can_search){updateMatchCount();return false}else{return true}case 88:srchlog("keyboard shortcut","X");if(interfaceObj.can_export){fireExport();return false}else{return true}case 17:return true;case 16:return true;default:return true}}else{if(tabIndex!=7){switch(e.keyCode){case 40:srchlog("arrow key","down",true);nextL();return false;case 38:srchlog("arrow key","up",true);prevL();return false}}}}var comment_message="Choose an action to enter a comment that will be e-mailed to the listing member.";function enterApproveMessage(){if(approve_comment.value==comment_message){approve_comment.value="";approve_comment.disabled=false;approve_comment.focus()}}function disableApproveMessage(){pendingapprove=false;approve_comment.value=comment_message;approve_comment.disabled=true;document.getElementById("approve_radio_null").checked=true}function approveHideRow(lista,art){var rowa=document.getElementById("row-"+lista);if(rowa){rowa.style.backgroundImage="url(/images/srch_rs/"+art+".png)"}}function firenewwindowpost(){var tarr1=iframe_detail.src.split("&");var tarr2=tarr1[0].split("?");tarr1[0]=tarr2[1];var inputstr="";for(var x=0;x<tarr1.length;x++){tarr2=tarr1[x].split("=");inputstr+='<input type="hidden" name="'+tarr2[0]+'" value="'+decodeURI(tarr2[1])+'">'}document.getElementById("newwindowform_inputs").innerHTML=inputstr;document.newwindowform.submit()}function fireApprove(xobj){var tval="";if(document.getElementById("approve_radio_Y").checked){tval="Y"}else{if(document.getElementById("approve_radio_N").checked){tval="N"}else{if(document.getElementById("approve_radio_D").checked){tval="D"}}}if(tval!=""){var tmpaddr=xobj.address.striphtml();var tempstr="cmd=srv+srch_rs/approveSave.html";tempstr+="&approve_radio="+tval;tempstr+="&approve_comment="+approve_comment.value;tempstr+="&list_tech_id="+xobj.id.substr(4,30);tempstr+="&list_me_tech_id="+xobj.me_tech_id.tech_id;tempstr+="&bcc_mls_app_rej="+bcc_mls_app_rej;tempstr+="&mls_email_addr="+mls_email_addr;tempstr+="&listing_nbr="+xobj.list_nbr;tempstr+="&address="+tmpaddr;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}}function defineColors(){var y=(prompt("Please enter the main background color","#E1DFDD"));changecss("body","backgroundColor",y);parent.changeBackgroundColor(y)}function changeGridFont(dir){if(dir!="saved"){if(dir=="orig"){gridfont=orig_gridfont}else{if(dir=="up"){srchlog("font size change","+;"+gridfont+";"+(gridfont+1));gridfont++}else{if(dir=="down"){srchlog("font size change","-;"+gridfont+";"+(gridfont-1));gridfont--}else{if(!isNaN(dir)){srchlog("font size change","textbox;"+gridfont+";"+parseInt(dir));gridfont=parseInt(dir)}}}if(gridfont>36){gridfont=36}if(gridfont<4){gridfont=4}}}document.getElementById("fontsizedisp").value=gridfont;changecss(".gridtdsel","fontSize",gridfont+"pt");changecss(".gridtd","fontSize",gridfont+"pt");changecss(".gridth","fontSize",gridfont+"pt");changecss(".gridth span","fontSize",gridfont+"pt");changecss(".gridthextra","fontSize",gridfont+"pt");changecss(".gridthextra span","fontSize",gridfont+"pt");changecss(".addressdiv span","fontSize",gridfont+"pt");changecss(".addressdiv span","lineHeight",(gridfont+1)+"pt");resize();if(dir!="saved"){if(interfaceObj.publicside){createCookie("gridfont",gridfont,60)}else{loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/updateFontPref.html&fontsize="+gridfont+additional_ajax_params,false)}}}function alerttest(arr){var tempmsg="";for(var z=0;z<arr.length;z++){tempmsg+="num("+z+") "+arr[z]+" | "}writeToWarningDiv(tempmsg,"attention",5000)}function showSharePanel(e){if(selectedlisting||sellistings.length>0){if(sellistings.length>0){document.getElementById("sharepaneltitle").innerHTML="Share Listing(s)";document.getElementById("shareselectionrow").style.display=""}else{document.getElementById("shareradioOne").checked=true;document.getElementById("sharepaneltitle").innerHTML="Share Current Listing";document.getElementById("shareselectionrow").style.display="none"}if(document.getElementById("shareradioMulti").checked){document.getElementById("dwelliciouslink").style.display="none"}document.getElementById("permalinkrow").style.display="none";closeAllDropDowns("share");document.getElementById("sharepaneltable").style.left=e.clientX-150;document.getElementById("sharepaneltable").style.top=e.clientY+10;document.getElementById("sharepaneltable").style.display=""}else{writeToWarningDiv("There is no listing in focus or listings selected to share","attention",10000)}}function hideSharePanel(){document.getElementById("sharepaneltable").style.display="none"}function sharelink(sharesrc){if((document.getElementById("shareradioMulti").checked&&sellistings.length<=magicnumtoacton)||document.getElementById("shareradioOne").checked){var tempstr="cmd=srv+share/share.html";tempstr+="&sharesrc="+sharesrc;if(interfaceObj.idx&&!idx_link_tech_id){tempstr+="&mode=backdooridx"}else{if(interfaceObj.idx&&idx_link_tech_id){tempstr+="&mode=idx"}else{if(interfaceObj.portal||fromshare){tempstr+="&mode=portal"}}}tempstr+="&idx_tech_id="+rmxId(idx_link_tech_id);tempstr+="&ma_search_list="+ma_search_list;var useblurbfromsingleselected=false;var temprr;if(sellistings.length==1){if(rmxId(selectedlisting)!=rmxId(sellistings[0])){temprr=document.getElementById("row-"+rmxId(sellistings[0]));if(temprr){useblurbfromsingleselected=true}}else{useblurbfromsingleselected=true;temprr=selListObj}}if(document.getElementById("shareradioOne").checked||useblurbfromsingleselected){tempstr+="&linktype=listing";if(useblurbfromsingleselected){tempstr+="&linktype_id="+rmxId(sellistings[0])}else{tempstr+="&linktype_id="+rmxId(selectedlisting)}var startposx="";switch(lasttabran){case"tab_detail":startposx="details";var currentdetailopts=new Array("report","history","tax","supplement","documents","remarks","tourofhomes","openhouse","calculator");if(currentdetailopts.indexOf(last_detail_ran)!=-1){startposx=last_detail_ran}break;case"tab_tour":startposx="media";break;case"tab_stats":startposx="compare";break;case"tab_notes":startposx="discuss";break;case"tab_map":startposx="map";break}tempstr+="&startpos="+startposx;var tempbool;if(useblurbfromsingleselected){tempbool=temprr.listexportidx_id}else{tempbool=selListObj.listexportidx_id}if(interfaceObj.display_address&&((!interfaceObj.idx&&!interfaceObj.portal)||((interfaceObj.idx||interfaceObj.portal)&&!tempbool))){tempstr+="&useaddress=true"}else{tempstr+="&useaddress=false"}}else{tempstr+="&linktype=selected";tempstr+="&sellistings="+sellistings.join("")}tempstr+="&shortdisplay_id="+new_sd_tech_id.options[new_sd_tech_id.selectedIndex].value;tempstr+="&report_type="+detailselectvalue;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false);if(sharesrc!="permalink"){hideSharePanel()}}else{writeToWarningDiv("Only "+magicnumtoacton+" or less listings can be shared","attention",10000)}}function getTechIdsUpToLimit(funcToCallAfter,limit){if(current_grid_totallistings<=howmanytoshow){var techarray=new Array();var tb=thegrid;for(var x=1;x<(tb.rows.length-minusextrarow());x++){techarray.push(tb.rows[x].id.substr(4,30))}eval(funcToCallAfter+"(techarray)")}else{var tempstr="cmd=srv+srch_rs/getTechIdsUpToLimit.html";tempstr+="&allwherestr="+allwherestr;tempstr+="&additionalcond="+additionalcond;tempstr+="&useopenhouseview="+useopenhouseview;tempstr+="&allorderby="+allorderby;tempstr+="&uniquet="+uniquet+srmode;tempstr+="&srmode="+srmode;tempstr+="&dbfetchamt="+dbfetchamt;tempstr+="&totallistings="+current_grid_totallistings;tempstr+="&limit="+limit;tempstr+="&funcToCallAfter="+funcToCallAfter;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}}var shownidxfavmessage=false;var shownidxgridlinkcart=false;function addselectedlisting(techid){if(sellistings.indexOf(techid)==-1){sellistings.push(techid);if((interfaceObj.idx||interfaceObj.portal)&&interfaceObj.publicside&&sellistings.length==1&&!shownidxgridlinkcart){shownidxgridlinkcart=true;loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[document.getElementById("gridlink_cart"),{id:"idxgridlinkcart",html:"<img src='/images/up_16.gif' align='absmiddle' style='margin-right:5px'> Click here to view the listings you've selected.",close:true,orientation:"below",width:320,cancelCookie:"idxgridlinkcart",closeTimer:10000}],{dependencyAlias:"spotlight",cancelCookie:"idxgridlinkcart"})}if((interfaceObj.idx||interfaceObj.portal)&&interfaceObj.publicside&&sellistings.length==3&&!shownidxfavmessage){shownidxfavmessage=true;loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[document.getElementById("fav_"+sellistings[sellistings.length-1]),{id:"idxfavmessage",html:"<img src='/images/up_16.gif' align='absmiddle' style='margin-right:5px'> Click here to mark your favorite listings.",close:true,orientation:"below",width:300,cancelCookie:"idxfavmessage",closeTimer:10000}],{dependencyAlias:"spotlight",cancelCookie:"idxfavmessage"})}}cart_totallistings=sellistings.length;cart_totaldiv.innerHTML=": "+((!cart_totallistings)?"0":cart_totallistings.format(0,true))}function selectProspect(xxx){document.getElementById("selected_contact_text").innerHTML=xxx.options[xxx.selectedIndex].text;document.getElementById("contact_list_div").style.display="none"}function remselectedlisting(techid){for(var x=0;x<cart_totallistings;x++){if(sellistings[x]==techid){sellistings.splice(x,1);cart_totallistings=sellistings.length;cart_totaldiv.innerHTML=": "+((!cart_totallistings)?"0":cart_totallistings.format(0,true));break}}}function selectlistingfromajax(techid){var idx=document.getElementById("check-"+techid);if(idx){idx.src="/images/srch_rs/check.png";addselectedlisting(techid)}else{addselectedlisting(techid)}}function checkLoaded(){if(!alreadyrunning){var numtoselect=0;if(current_grid_totallistings>magicnumtoacton){writeToWarningDiv("Selected the first "+magicnumtoacton+" listings","warning",3000);numtoselect=magicnumtoacton}else{numtoselect=current_grid_totallistings}if(numtoselect<=howmanytoshow){var tb=thegrid;for(var x=1;x<(tb.rows.length-minusextrarow());x++){selectlistingfromajax(tb.rows[x].id.substr(4,30))}}else{alreadyrunning=true;var tempstr="cmd=srv+srch_rs/selectListings.html";tempstr+="&allwherestr="+allwherestr;tempstr+="&additionalcond="+additionalcond;tempstr+="&useopenhouseview="+useopenhouseview;tempstr+="&allorderby="+allorderby;tempstr+="&uniquet="+uniquet+srmode;tempstr+="&srmode="+srmode;tempstr+="&totallistings="+current_grid_totallistings;tempstr+="&numtoselect="+numtoselect;tempstr+="&dbfetchamt="+dbfetchamt;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}tabcheckClicked("on")}}function uncheckLoaded(){var imgs=document.getElementsByTagName("img");for(var i=0;i<imgs.length;i++){if(imgs[i].id.substring(0,5)=="check"){imgs[i].src="/images/srch_rs/check_u.png"}}chk_counter=0;sellistings=new Array();cart_totallistings=sellistings.length;cart_totaldiv.innerHTML=": "+((!cart_totallistings)?"0":cart_totallistings.format(0,true));tabcheckClicked("off")}function updateMapPref(newvalue){if(interfaceObj.publicside){createCookie("open_map_tab_on_edit",newvalue,60)}else{loadJavaScriptDoc("querystring","/cgi-bin/mainmenu-compress.cgi","cmd=srv+srch_rs/saveMapPref.html&val="+newvalue,false)}interfaceObj.open_map_tab_on_edit=newvalue}function goNoListingMode(xmode){var origNoListingMode=noListingMode;noListingMode=xmode;if(!forprint){if(noListingMode){if(hotsheet){writeToWarningDiv("Hot Sheet had 0 listings","attention",10000)}else{noListingMode=true;writeToWarningDiv("Search returned 0 listings","attention",5000);if(!frommultaddresssearch&&interfaceObj.can_search){if(interfaceObj.open_map_tab_on_edit){editSearch("default_map")}else{editSearch()}}else{resize()}srch.set_counts(0)}disableLSelector()}else{enableLSelector();if(tabIndex!=7&&!hotsheet&&!tab_detail_first_time_check&&(full_list_view_init||results_totallistings==1||startpos!="")){var startpos_found=false;if(startpos!=""){switch(startpos){case"map":if(interfaceObj.show_map){startpos_found=true;clickTab("tab_map",false);tab_detail_first_time_check=true}break;case"details":if(interfaceObj.show_detail&&interfaceObj.show_report){startpos_found=true;clickTab("tab_detail",false);tab_detail_first_time_check=true}break;case"report":if(interfaceObj.show_detail&&interfaceObj.show_report){startpos_found=true;clickTab("tab_detail",false);tab_detail_first_time_check=true}break;case"history":if(interfaceObj.show_detail&&interfaceObj.show_history){startpos_found=true;clickTab("tab_detail",false);detailChoice("history");tab_detail_first_time_check=true}break;case"tax":if(interfaceObj.show_detail&&interfaceObj.show_tax){startpos_found=true;clickTab("tab_detail",false);detailChoice("taxes");tab_detail_first_time_check=true}break;case"supplement":if(interfaceObj.show_detail&&interfaceObj.show_supplement){startpos_found=true;clickTab("tab_detail",false);detailChoice("supplement");tab_detail_first_time_check=true}break;case"documents":if(interfaceObj.show_detail&&interfaceObj.show_documents){startpos_found=true;clickTab("tab_detail",false);detailChoice("documents");tab_detail_first_time_check=true}break;case"remarks":if(interfaceObj.show_detail&&interfaceObj.show_officeremarks){startpos_found=true;clickTab("tab_detail",false);detailChoice("officerem");tab_detail_first_time_check=true}break;case"tourofhomes":if(interfaceObj.show_detail&&interfaceObj.show_tourhomes){startpos_found=true;clickTab("tab_detail",false);detailChoice("tourofhomes");tab_detail_first_time_check=true}break;case"openhouse":if(interfaceObj.show_detail&&interfaceObj.show_openhouse){startpos_found=true;clickTab("tab_detail",false);detailChoice("openhouse");tab_detail_first_time_check=true}break;case"calculator":if(interfaceObj.show_detail&&interfaceObj.show_mortgagecalc){startpos_found=true;clickTab("tab_detail",false);detailChoice("calculator");tab_detail_first_time_check=true}break;case"media":if(interfaceObj.show_tour){startpos_found=true;clickTab("tab_tour",false);tab_detail_first_time_check=true}break;case"photos":if(interfaceObj.show_tour){startpos_found=true;clickTab("tab_tour",false);tab_detail_first_time_check=true}break;case"videos":if(interfaceObj.show_tour&&interfaceObj.show_video){startpos_found=true;clickTab("tab_tour",false)}break;case"virtualtour":if(interfaceObj.show_tour&&interfaceObj.show_virtualtours){startpos_found=true;clickTab("tab_tour",false)}break;case"compare":if(interfaceObj.show_compare){startpos_found=true;clickTab("tab_stats",false);tab_detail_first_time_check=true}break;case"discuss":if(interfaceObj.show_discuss){startpos_found=true;clickTab("tab_notes",false);tab_detail_first_time_check=true}break;case"search":if(interfaceObj.can_search){startpos_found=true;editSearch()}break;default:break}}if(!startpos_found){if(interfaceObj.show_detail&&interfaceObj.show_report){clickTab("tab_detail",false)}else{clickTab("tab_tour",false)}tab_detail_first_time_check=true}if(results_totallistings==1){if(interfaceObj.publicside&&!interfaceObj.can_search){document.getElementById("tab_grid").style.display="none";document.getElementById("tab_grid_space").style.display="none";tabcheckdiv.style.display="none"}setTimeout("switchtoSingleTimer()",300)}}if(listingcart=="true"){if((srmode=="results"&&results_totallistings>sortmax)||(srmode=="cart"&&cart_totallistings>sortmax)){orderbuttons_dead.style.display="";orderbuttons.style.display="none"}else{orderbuttons.style.display="";orderbuttons_dead.style.display="none"}}}if(noListingMode==origNoListingMode){results_totaldiv.innerHTML=": "+((!results_totallistings)?"0":results_totallistings.format(0,true));cart_totaldiv.innerHTML=": "+((!cart_totallistings)?"0":cart_totallistings.format(0,true));matchesdiv.innerHTML=": "+((!results_totallistings)?"0":results_totallistings.format(0,true));top_matchesdiv.innerHTML=": "+((!results_totallistings)?"0":results_totallistings.format(0,true));updateNoMapCount((!results_totallistings)?"0":results_totallistings.format(0,true))}}}function switchtoSingleTimer(){if(selListObj){switchGridView("single")}else{setTimeout("switchtoSingleTimer()",300)}}function mouseTabOver(xt){if(xt.className=="tabunsel"){xt.className="tabhover"}}function mouseTabOut(xt){if(xt.className=="tabhover"){xt.className="tabunsel"}}function fullSearchFire(xt){if(fs_wait){setTimeout('fullSearchFire("'+xt+'")',1000)}fadeoutFirsttimein();if(current_grid_totallistings>0){noListingMode=false}results_totallistings=current_grid_totallistings;if(xt=="email"){if(current_grid_totallistings<1){searchmode="";changeSearchSubTab("searchtab_fullsearch");writeToWarningDiv("Search returned 0 listings","attention",5000);return}fireEmail()}else{if(xt=="save"){fireSave()}else{if(xt=="print"){if(current_grid_totallistings<1){searchmode="";changeSearchSubTab("searchtab_fullsearch");writeToWarningDiv("Search returned 0 listings","attention",5000);return}firePrint()}else{if(xt=="cma_cart"){fireActualCMA("cart")}else{if(xt=="cma_all"){fireActualCMA("all")}else{if(xt=="export"){fireExport()}else{if(xt=="idx"){changeSearchSubTab("searchtab_fullsearch");searchmode="idx_fs_stall";createIDXLink();searchmode="searchtab_fullsearch"}}}}}}}}var first_time_search=true;function changeSearchSubTab(tabname){tab_detail_first_time_check=true;if(!searchmode){searchmode=""}if(document.getElementById("enabled_adv_mlsnumber")&&document.getElementById("enabled_adv_mlsnumber").checked&&tabname=="searchtab_fullsearch"){writeToWarningDiv("Full Search is unavailable when searching by MLS Number");if(!searchmode||searchmode=="searchtab_fullsearch"){searchmode="searchtab_quicksearch"}else{return false}}if(searchmode==tabname){if((tabname=="searchtab_quicksearch"||tabname=="searchtab_mapsearch")&&!interfaceObj.idx){newQuickSearch()}return}else{if(document.getElementById(searchmode)){document.getElementById(searchmode).className="subTab"}}firsttimeindiv.style.display="";closeAllDropDowns();if(srchWarningId){closeWarning(srchWarningId)}if(tabname=="restore"){document.getElementById(searchmode.split("||")[0]).className="subTab";tabname=searchmode.split("||")[1];if(searchmode.split("||")[2]){xt=searchmode.split("||")[2];if(xt.indexOf("tab_")>=0){searchmode="searchtab_fullsearch";clickTab(xt,null,null,"fromfs");return}else{searchmode="fs_return";if(fs_wait){setTimeout('fullSearchFire("'+xt+'")',1000)}else{fullSearchFire(xt)}return}}}else{if(tabname=="previous"){if(searchmode=="searchtab_fullsearch||"||searchmode=="searchtab_fullsearch||searchtab_fullsearch"){searchmode="searchtab_fullsearch"}tabname=searchmode}else{if((searchmode&&searchmode.indexOf("searchtab_fullsearch")==0&&searchmode!="searchtab_fullsearch")||tabname.indexOf("fs_popout")==0){if(tabname.indexOf("fs_popout")==0){searchmode="searchtab_fullsearch||"+searchmode.split("||")[1]+"||"+tabname.split("||")[1]}else{searchmode="searchtab_fullsearch||"+tabname}fullsearchgridframe.contentWindow.do_submit("fullsearchedit");document.getElementById("searchtab_fullsearch").className="subTab";return}}}if(tabname=="searchtab_mapsearch"&&!interfaceObj.show_map){tabname="searchtab_quicksearch"}if(tabname=="searchtab_fullsearch"&&interfaceObj.idx){tabname="searchtab_quicksearch"}if(tabname=="searchtab_quicksearch"&&searchtab_quicksearch){if(!interfaceObj.idx){document.getElementById("quicksearchdrop").style.display=""}document.getElementById("map_quicksearchdrop").style.display="none";iframe_no_tab.style.display="";options_no_tab.style.display="";iframe_map.style.display="none";moveGrid("mini");hidegridbut.style.display="none";fadeoutFirsttimein()}else{if(tabname=="searchtab_mapsearch"&&searchtab_mapsearch){document.getElementById("quicksearchdrop").style.display="none";if(!interfaceObj.idx){document.getElementById("map_quicksearchdrop").style.display=""}iframe_no_tab.style.display="none";options_no_tab.style.display="none";iframe_map.style.display="";document.getElementById("options_map").style.display="none";options_no_tab.style.display="";if(lasttabran!="tab_map"){changeSelectedTab("map_subTab")}fadeoutFirsttimein();hidegridbut.style.display=""}else{if(tabname=="searchtab_fullsearch"&&searchtab_fullsearch){document.getElementById("quicksearchdrop").style.display="none";document.getElementById("map_quicksearchdrop").style.display="none";options_no_tab.style.display="";if(!interfaceObj.idx){switchGridView("fullsearch")}moveGrid("mini");hidegridbut.style.display="none"}}}if(document.getElementById(tabname)){setHelpFile("new_search_results_"+tabname+".html");document.getElementById(tabname).className="subTab_selected";if(tabname=="searchtab_fullsearch"){searchmode=tabname+"||"+searchmode}else{searchmode=tabname}}else{if(document.getElementById(searchmode)){setHelpFile("new_search_results_"+searchmode+".html")}}if(first_time_search){setTimeout("resize()",100);first_time_search=false}lasttabran="tab_search"}var shownidxloginlink=false;function checkidxtimer(){var testtime=new Date();if(smilies&&keepprompting&&prtl_reg_req_time!="N"){if(document.getElementById("portallogonframe").style.display=="none"&&(testtime.getTime()-idxtimer.getTime())>=(parseInt(prtl_reg_req_time)*60*1000)){idxtimer=new Date();portallogon(null,null,"prtl_reg_req_time","You need to be logged in to continue to view listings.")}setTimeout("checkidxtimer()",45000)}if((interfaceObj.idx||interfaceObj.portal)&&interfaceObj.publicside&&smilies&&!portallogonlaunched&&!shownidxloginlink){if((testtime.getTime()-idxtimer.getTime())>=(10*60*1000)){shownidxloginlink=true;loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[document.getElementById("loginlink"),{id:"idxloginlink",html:"<img src='/images/up_16.gif' align='absmiddle' style='margin-right:5px'> Click here to create an account with us to save searches, get updates, and more!",close:true,orientation:"below",width:300,cancelCookie:"idxloginlink",closeTimer:10000}],{dependencyAlias:"spotlight",cancelCookie:"idxloginlink"})}else{setTimeout("checkidxtimer()",45000)}}}function clickTab(xt,skipresize,fromsearch,special){if(searchmode&&searchmode.indexOf("searchtab_fullsearch")>=0&&searchmode!="searchtab_fullsearch"){fullsearchgridframe.contentWindow.update_count_from_edit("fs_popout||"+xt)}else{if((!noListingMode||dirtysearch)&&lasttabran!=xt){if(interfaceObj.idx&&interfaceObj.publicside&&smilies&&keepprompting&&prtl_reg_req_results=="Y"){portallogon(null,null,"prtl_reg_req_results","You need to be logged in to view the listings that match this search");return false}if(interfaceObj.idx&&interfaceObj.publicside&&smilies&&keepprompting&&prtl_reg_req_details=="Y"&&xt!="tab_grid"){portallogon(null,null,"prtl_reg_req_details","You need to be logged in to view details off this listing");return false}full_list_view_init=false;closeAllDropDowns();if(srchWarningId!=null){closeWarning(srchWarningId)}if(xt!="no_tab"){lasttabran=xt}hideFieldPicker();var empty="";close_inline();businessCardPanel.style.display="none";toggleCopyright("none");for(var x=0;x<tabArray.length;x++){if(tabArray[x]==xt){tabIndex=x;document.getElementById(tabArray[x]).className="tabsel";if((gridwidth==1000||gridwidth==0)&&tabIndex!=0){moveGrid("mini",true);empty="Anime"}else{if(tabIndex==0){moveGrid("full",true);empty="Anime"}}if(x!=0&&xt!="tab_grid"){hideSortSpot();if(searchgriddiv.style.display==""){if(interfaceObj.can_search&&dirtysearch){if(!compile(null,null,null,{use_current_srch:(special&&special=="fromfs"?true:false)})){dirtysearch=false;lasttabran="";goNoListingMode(true);return false}dirtysearch=false}else{if(listing_in_focus_not_in_grid){showLargeLoading(true);selectListingBySpinMemCache(selectedlisting);listing_in_focus_not_in_grid=false}}switchGridView("grid");moveGrid("mini",false)}document.getElementById(optionsArray[x-1]).style.display="";if(xt=="tab_map"){iframe_map.contentWindow.mustResize=false}else{if(typeof spotlight!="undefined"){spotlight.hide("idxrectangle_tool")}}document.getElementById(iframesArray[x-1]).style.display=""}if(xt=="tab_grid"){if(typeof spotlight!="undefined"){spotlight.hide("idxsinglegridimage")}if(typeof spotlight!="undefined"){spotlight.hide("idxrectangle_tool")}hideAllOptionsFrames();setActiveGridLink(srmode);if(interfaceObj.can_search&&dirtysearch){if(!compile(null,null,null,{use_current_srch:(special&&special=="fromfs"?true:false)})){dirtysearch=false;lasttabran="";goNoListingMode(true);return false}dirtysearch=false}else{if(listing_in_focus_not_in_grid){showLargeLoading();selectListingBySpinMemCache(selectedlisting);listing_in_focus_not_in_grid=false}}switchGridView("grid")}else{if(xt=="tab_search"){moveGrid("completehide")}}}else{document.getElementById(tabArray[x]).className="tabunsel";if(x!=0&&xt!="tab_grid"){document.getElementById(iframesArray[x-1]).style.display="none";document.getElementById(optionsArray[x-1]).style.display="none"}if(xt=="tab_grid"){hideAllOptionsFrames()}}}if(xt!="no_tab"){document.getElementById("tab_search").className="tabunsel"}if(xt=="tab_grid"){gridlink_results.style.display="";gridlink_cart.style.display="";gridlink_back2search.style.display="none";listabmessageicons.style.display="";srch.toggle_links("off");if((interfaceObj.idx||interfaceObj.portal)&&interfaceObj.publicside&&special=="mouse"){setTimeout("spotSort()",2000)}}else{listabmessageicons.style.display="none"}if(xt=="tab_map"){singlelistingviewtype="pics";if(singlegriddiv.style.display==""){switchSingleListingView()}}if((xt=="tab_tour"||xt=="tab_detail")&&interfaceObj.print_map){singlelistingviewtype="map";if(singlegriddiv.style.display==""){switchSingleListingView()}}changeSelectedTab(special);if(!skipresize){resize(empty)}}else{if(noListingMode&&xt!="no_tab"){writeToWarningDiv("Your search has 0 listings","attention",5000)}}}setHelpFile()}var shownidxgridsortlink=false;function spotSort(){if(!shownidxgridsortlink){shownidxgridsortlink=true;loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[document.getElementById("helplink"),{id:"idxgridsortlink",html:"Click here or a column header to change the sort order of the listings. <img src='/images/up_16.gif' align='absmiddle' style='margin-left:5px'>",close:true,orientation:"below",width:440,left:-390,top:70,cancelCookie:"idxgridsortlink",closeTimer:10000}],{dependencyAlias:"spotlight",cancelCookie:"idxgridsortlink"})}}function hideSortSpot(){if(typeof spotlight!="undefined"){spotlight.hide("idxgridsortlink")}}function changeSelectedTab(special){special=(special?special:"");if(!selectedlisting&&(!special||special!="map_subTab")){setTimeout("changeSelectedTab();",100);return}if(tabIndex==DetailTabIndex){currentlyviewing="details";if(tab_detail_listing!=selectedlisting){changeDetail(true);tab_detail_listing=selectedlisting}}if(tabIndex==TourTabIndex){currentlyviewing="photos";if(tab_tour_listing){if(tab_tour_listing!=selectedlisting){if(iframe_tour.contentWindow.tour_kind){tour_kind=iframe_tour.contentWindow.tour_kind}else{tour_kind=false}iframe_tour.contentWindow.changeListing(selectedlisting);if(interfaceObj.show_photos&&(!tour_kind||tour_kind=="photos")){iframe_tour.contentWindow.switchTourType("photos")}else{if(interfaceObj.show_video&&(!tour_kind||tour_kind=="videos")){iframe_tour.contentWindow.switchTourType("videos")}else{iframe_tour.contentWindow.switchTourType("vtour")}}tab_tour_listing=selectedlisting}}else{iframe_tour.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/tourTab.html&list_tech_id="+selectedlisting+additional_ajax_params;tab_tour_listing=selectedlisting}}if(tabIndex==CompareTabIndex){currentlyviewing="compare";if(tab_stats_listing&&iframe_stats.contentWindow.compareLoaded){if(whereStringChanged_stats){whereStringChanged_stats=false;iframe_stats.contentWindow.changeClause();tab_stats_listing=999}if(tab_stats_listing!=selectedlisting){iframe_stats.contentWindow.changeListing(selectedlisting);tab_stats_listing=selectedlisting}}else{iframe_stats.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/compareTab.html&list_tech_id="+selectedlisting+additional_ajax_params;tab_stats_listing=selectedlisting}}if(tabIndex==DiscussTabIndex){currentlyviewing="discuss";if(tab_notes_listing){if(tab_notes_listing!=selectedlisting){iframe_notes.contentWindow.changeListing(selectedlisting);tab_notes_listing=selectedlisting}}else{if((interfaceObj.idx||fromshare)&&!interfaceObj.portal){iframe_notes.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/discussTabPub.html&list_tech_id="+selectedlisting+additional_ajax_params+(fromshare?"&fromshare=true":"")}else{iframe_notes.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/discussTab.html&list_tech_id="+selectedlisting+additional_ajax_params}tab_notes_listing=selectedlisting}}if(tabIndex==MapTabIndex||special=="map_subTab"){currentlyviewing="map";if(tab_map_listing){if(!iframe_map.contentWindow.requestDynamicLayer){return}suppress_mapping=false;if(whereStringChanged_map&&(special!="map_subTab"||(gridlink_updatematches.style.display=="none"&&current_grid_totallistings<=1000))){whereStringChanged_map=false;iframe_map.contentWindow.requestDynamicLayer();tab_map_listing=999}else{if(whereStringChanged_map&&current_grid_totallistings>=1000&&special=="map_subTab"&&gridlink_updatematches.style.display=="none"){dirtyMap();showMapWarning(current_grid_totallistings)}else{if(special=="map_subTab"&&gridlink_updatematches.style.display!="none"){dirtyMap()}}}if(!special||special!="map_subTab"){if(tab_map_listing!=selectedlisting){iframe_map.contentWindow.changeListing(selectedlisting,selListObj.geo_lat,selListObj.geo_lon,selListObj.list_nbr);tab_map_listing=selectedlisting}if(special){updateSingleListingFromMap(special)}}}else{if(interfaceObj.show_map){if((current_grid_totallistings>1000)&&!suppress_mapping&&special=="map_subTab"){showMapWarning(current_grid_totallistings);suppress_mapping=true}var p="";if(interfaceObj.idx){p="&publicside=idx";if(interfaceObj.satellite_map_default){p+="&makeSatelliteDefault=true"}}else{if(interfaceObj.publicside){p="&publicside=true"}}iframe_map.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/mapTab.html&from_search=true&can_search="+interfaceObj.can_search+"&list_tech_id="+selectedlisting+p+additional_ajax_params+(dirtysearch&&special=="map_subTab"&&searchmode!="searchtab_fullsearch||searchtab_mapsearch"?"&dirtyOnLoad=true":"")}else{iframe_map.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/nomapTab.html";document.getElementById("options_map").innerHTML="<img src='/images/trans1x1.gif' boder=0 height=27 width=1 align='right'>"}tab_map_listing=(selectedlisting)?selectedlisting:999}map_haveWarned=false;iframe_map.contentWindow.mustResize=true}}function hideAllOptionsFrames(){for(var x=0;x<iframesArray.length;x++){document.getElementById(iframesArray[x]).style.display="none";document.getElementById(optionsArray[x]).style.display="none"}}var gridwidth=1000;function moveGrid(tt,skipresize){if(tt=="hide"){if(typeof spotlight!="undefined"){spotlight.hide("idxgridlinkcart");spotlight.hide("idxsinglegridimage");spotlight.hide("idxfavmessage")}gridwidth=15;if(tabIndex==0){tabIndex=1;clickTab(tabArray[tabIndex],true)}}else{if(tt=="completehide"){gridwidth=0;if(tabIndex==0){tabIndex=1;clickTab(tabArray[tabIndex],true)}}else{if(tt=="mini"){if(searchgriddiv.style.display==""){miniwidth=miniwidth_srch;gridwidth=miniwidth}else{miniwidth=miniwidth_orig;gridwidth=miniwidth;if(tabIndex==0){tabIndex=1;clickTab(tabArray[tabIndex],true)}}}else{gridwidth=1000}}}if(!skipresize){resize("Anime")}changeGrid(tt)}function changeGrid(xt){if(xt=="hide"){switchviewdiv.style.display="none";rightgridoptionsdiv.style.display="none";tabcheckdiv.style.display="";tabcheckdiv.style.backgroundImage="none";var tleft=(listingrotatordiv?listingrotatordiv.clientWidth:130);tabcheckdiv.style.left=tleft+15;tabcheckdiv.style.top="47px";if(searchgriddiv.style.display==""||(results_totallistings==1&&interfaceObj.publicside&&!interfaceObj.can_search)){tabcheckdiv.style.display="none"}if(smilies=="true"){floatingsmilies.style.display="";floatingsmilies.style.backgroundImage="none"}if(document.getElementById("agt_out")&&document.getElementById("agt_out").style.display=="none"){floatingsmilies.style.left=tleft+15+(tabcheckdiv.style.display==""?91:0)}else{floatingsmilies.style.left=tleft+15+(tabcheckdiv.style.display==""?70:0)}floatingsmilies.style.top="45px";minibar.style.display="";hidegridbut.style.display="none";if(search_subtabs&&search_subtabs.style.display!="none"&&searchmode=="searchtab_mapsearch"){document.getElementById("options_no_tab").appendChild(document.getElementById("opt_sum_left_div"))}}else{if(xt=="mini"){switchviewdiv.style.display="none";rightgridoptionsdiv.style.display="none";if(singlegriddiv.style.display==""){tabcheckdiv.style.left="15px";tabcheckdiv.style.backgroundImage="url(/images/srch_rs/tabcheckbg.png)";tabcheckdiv.style.top="105px";if(results_totallistings==1&&interfaceObj.publicside&&!interfaceObj.can_search){tabcheckdiv.style.display="none"}else{tabcheckdiv.style.display=""}if(smilies=="true"){floatingsmilies.style.display="";floatingsmilies.style.backgroundImage="url(/images/srch_rs/floatingsmiliesbg.png)"}if(document.getElementById("agt_out")&&document.getElementById("agt_out").style.display=="none"){floatingsmilies.style.left="256px"}else{floatingsmilies.style.left="235px"}floatingsmilies.style.top="105px"}else{tabcheckdiv.style.display="none";floatingsmilies.style.display="none"}minibar.style.display="none";if((!search_subtabs||search_subtabs.style.display=="none")||(search_subtabs&&search_subtabs.style.display!="none"&&searchmode=="searchtab_mapsearch")){hidegridbut.style.display=""}if(document.getElementById("opt_sum_left_div").parentNode.id!="options_summary"){document.getElementById("options_summary").appendChild(document.getElementById("opt_sum_left_div"))}gridchangebuttons.style.display="";copyrighttd.style.display="none";changecss(".extracolumns","display","none");changecss(".gridthextra","display","none")}else{if(xt=="completehide"){switchviewdiv.style.display="none";rightgridoptionsdiv.style.display="none";tabcheckdiv.style.display="none";floatingsmilies.style.display="none";minibar.style.display="none";hidegridbut.style.display="none";gridC.style.display="";singlegriddiv.style.display="none";searchgriddiv.style.display="none";singlegridimage.src="/images/srch_rs/singlegrid.png";gridimage.src="/images/srch_rs/grid_d.png";enhance.style.display="none";changecss(".extracolumns","display","none");changecss(".gridthextra","display","none")}else{if(document.getElementById("opt_sum_left_div").parentNode.id!="options_summary"){document.getElementById("options_summary").appendChild(document.getElementById("opt_sum_left_div"))}if((interfaceObj.show_viewswitcher&&!hotsheet)||(interfaceObj.show_viewswitcher&&hotsheet&&srmode=="cart")){new_sd_tech_id.style.display="";gridviewlink.style.display=""}else{new_sd_tech_id.style.display="none";gridviewlink.style.display="none";if(hotsheet&&hs_force_mls_view=="N"){gridviewlinkhotsheet.style.display=""}else{gridviewlinkhotsheet.style.display="none"}}if((interfaceObj.show_sort&&!hotsheet)||(interfaceObj.show_sort&&hotsheet&&srmode=="cart")){gridsortlink.style.display="";top_gridsortlink.style.display=""}else{gridsortlink.style.display="none";top_gridsortlink.style.display="none"}switchviewdiv.style.display="";rightgridoptionsdiv.style.display="";tabcheckdiv.style.display="none";floatingsmilies.style.display="none";minibar.style.display="none";hidegridbut.style.display="none";gridchangebuttons.style.display="none";copyrighttd.style.display="";gridC.style.display="";singlegriddiv.style.display="none";searchgriddiv.style.display="none";singlegridimage.src="/images/srch_rs/singlegrid.png";gridimage.src="/images/srch_rs/grid_d.png";enhance.style.display="none";changecss(".extracolumns","display","");changecss(".gridthextra","display","")}}}}function jumpToMap(){if(interfaceObj.show_map){clickTab("tab_map",false)}}function jumpToMediaPhoto(){if(interfaceObj.show_tour){clickTab("tab_tour",false);setTimeout("jumpToMediaPhotoSub()",500)}}function jumpToMediaPhotoSub(){if(iframe_tour.contentWindow.property&&warningdiv.style.display=="none"){iframe_tour.contentWindow.forceRedrawFlag=true;iframe_tour.contentWindow.jumpPhoto(photoobj[selectedlisting][photoIndex],selectedlisting)}else{setTimeout("jumpToMediaPhotoSub()",500)}}function prevPhoto(){var singlelistingpicture=document.getElementById("singlelistingpicture");if(singlelistingpicture){if(photoobj[selectedlisting]){var chngIndex=photoobj[selectedlisting][photoIndex-1]?photoIndex-1:photoobj[selectedlisting].length-1;if(photoobj[selectedlisting][chngIndex]){document.getElementById("singlephotocount").innerHTML=photoobj[selectedlisting].length;var cursrc=singlelistingpicture.src;singlelistingpicture.src=cursrc.substr(0,cursrc.length-30)+photoobj[selectedlisting][chngIndex]+".jpg";photoIndex=chngIndex;document.getElementById("singlephotoindex").innerHTML=chngIndex+1;if(tabIndex==2){jumpToMediaPhoto()}}}else{loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/getSingleListingView.html&direction=prev&list_tech_id="+selectedlisting+additional_ajax_params,false)}}}function nextPhoto(){var singlelistingpicture=document.getElementById("singlelistingpicture");if(singlelistingpicture){if(photoobj[selectedlisting]){var chngIndex=photoobj[selectedlisting][photoIndex+1]?photoIndex+1:0;if(photoobj[selectedlisting][chngIndex]){document.getElementById("singlephotocount").innerHTML=photoobj[selectedlisting].length;var cursrc=singlelistingpicture.src;singlelistingpicture.src=cursrc.substr(0,cursrc.length-30)+photoobj[selectedlisting][chngIndex]+".jpg";photoIndex=chngIndex;document.getElementById("singlephotoindex").innerHTML=chngIndex+1;if(tabIndex==2){jumpToMediaPhoto()}}}else{loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/getSingleListingView.html&direction=next&list_tech_id="+selectedlisting+additional_ajax_params,false)}}}function drawMap(extent){if(selListObj.geo_lat==0||selListObj.geo_lon==0){return"/images/srch_rs/nomap_single.jpg"}mapserver_miniZoom=extent;var src=drawmapserver+"?width=314&height=200";var mls_abbr="";for(var x=0;x<srch_mls.length;x++){if(srch_mls[x].tech_id=="x'"+selListObj.ma_tech_id+"'"){mls_abbr=srch_mls[x].abbr;break}}src+="&client="+mls_abbr;src+="&layers=parcels";if(extent<13000){src+="&parcel=true&units=feet"}src+="&center="+selListObj.geo_lon/latLonDivisor+","+selListObj.geo_lat/latLonDivisor+","+extent;src+="&markers="+selListObj.geo_lon/latLonDivisor+","+selListObj.geo_lat/latLonDivisor+",pin";return src}function miniZoom(action,callbackFunction){var miniPhoto=document.getElementById("singlelistingpicture");var miniZoomArray=[500,1000,1650,3300,6600,13200,26400,52800,105600,211200,528000,1056000];var newExtent=0;var existingExtent=mapserver_miniZoom;if(existingExtent==0){return false}if(action==undefined||action==null){newExtent=mapserver_miniZoom}else{if(action=="zoomin"){for(var x=0;x<miniZoomArray.length;x++){if(existingExtent>miniZoomArray[x]){newExtent=miniZoomArray[x]}}}else{for(var x=miniZoomArray.length-1;x>-1;x--){if(existingExtent<miniZoomArray[x]){newExtent=miniZoomArray[x]}}}}if(newExtent==0){return false}miniPhoto.style.opacity=".4";if(!interfaceObj.idx){loadJavaScriptDoc("querystring","/cgi-bin/mainmenu-compress.cgi","cmd=srv+srch_rs/saveExtentPref.html&extent="+newExtent,false)}miniPhoto.src=eval(callbackFunction+"("+newExtent+");")}function switchSingleListingView(type){type=type||singlelistingviewtype;if(type!=singlelistingviewtype){singlelistingviewtype=type}var caption=document.getElementById("singlelistingcaption");var button1=document.getElementById("singlelistingviewbutton1");var button2=document.getElementById("singlelistingviewbutton2");var photo=document.getElementById("singlelistingpicture");if(type=="pics"){photoIndex=0}photo.src=(type=="map")?drawMap(mapserver_miniZoom):selListObj.image.replace("-t.jpg",".jpg");photo.onclick=(type=="map")?function(){jumpToMap()}:function(){jumpToMediaPhoto()};photo.onerror=(type=="map")?function(){this.src="/images/srch_rs/nomap_single.jpg"}:function(){this.src="/images/srch_rs/nophoto_single.png"};photo.title=(type=="map")?"Click for larger map":"Click for larger image";photo.onload=(type=="map")?function(){this.style.opacity="1"}:function(){};caption.innerHTML=(type=="map")?"&nbsp;":'<span id="singlephotoindex">0</span>&nbsp;of&nbsp;<span id="singlephotocount">0</span>';caption.title=(type=="map")?"":"Current Photo Index";if(type=="pics"){if(!photoobj[selectedlisting]){loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/getSingleListingView.html&list_tech_id="+selectedlisting+additional_ajax_params,false)}else{document.getElementById("singlephotocount").innerHTML=photoobj[selectedlisting].length;if(photoobj[selectedlisting].length>0){document.getElementById("singlephotoindex").innerHTML=1}else{document.getElementById("singlephotoindex").innerHTML=0}}}button1.innerHTML=(type=="map")?"+":'<img src="/images/srch_rs/arrowleft.gif" border=0>';button1.onclick=(type=="map")?function(){miniZoom("zoomin","drawMap")}:function(){prevPhoto()};button1.title=(type=="map")?"Zoom In":"Previous Photo";button2.innerHTML=(type=="map")?"-":'<img src="/images/srch_rs/arrowright.gif" border=0>';button2.onclick=(type=="map")?function(){miniZoom("zoomout","drawMap")}:function(){nextPhoto()};button2.title=(type=="map")?"Zoom Out":"Next Photo"}function updateFromSrchLink(elem){if(srchautoupdate){return}updateMatchCount();clearSrchUpdateLinks()}function clearSrchUpdateLinks(){var list=document.getElementById("searchList");for(var x=0;x<list.childNodes.length;x++){var tmpNode=list.childNodes[x];if(document.getElementById(list.childNodes[x].unique_id+"_update")){document.getElementById(list.childNodes[x].unique_id+"_update").style.display="none";document.getElementById(list.childNodes[x].unique_id+"_update").fadeStatus="faded"}}}function updateMatchCount(norecompile){srch.set_counts("animate");if(!srchautoupdate){noMapFadeOutCount()}var updatemap=(searchmode&&(searchmode=="searchtab_mapsearch"||searchmode=="searchtab_fullsearch||searchtab_mapsearch")?"autoupdate":false);if(!compile("count",false,updatemap,{use_current_srch:(norecompile?true:false)})){goNoListingMode(true)}else{noListingMode=true;clearSrchUpdateLinks()}}function back2search(){switchGridView("search")}function switchGridView(typey,avoid_reset){gridlink_back2search.style.display="none";if(typey=="single"){if(tabArray[tabIndex]=="tab_grid"){clickTab("tab_map",false)}singlegridimage.src="/images/srch_rs/singlegrid_d.png";gridimage.src="/images/srch_rs/grid.png";singlegriddiv.style.display="";grid_subtabs.style.display="";if(searchgriddiv.style.display==""){gridlink_back2search.style.display=""}else{gridlink_results.style.display="";results_totaldiv.style.display="";gridlink_cart.style.display=""}gridsortlink.style.display="none";top_gridsortlink.style.display="";search_subtabs.style.display="none";orderbuttons_dead.style.display="none";orderbuttons.style.display="none";srch.toggle_links("off");tabcheckdiv.style.left="15px";tabcheckdiv.style.top="105px";if(document.getElementById("agt_out")&&document.getElementById("agt_out").style.display=="none"){floatingsmilies.style.left="256px"}else{floatingsmilies.style.left="235px"}floatingsmilies.style.top="105px";enhance.style.display="none";gridbottom.style.display="";gridC.style.display="none";fullsearchgridframe.style.display="none";if(!avoid_reset){updateSingleView();if(!(interfaceObj.publicside&&results_totallistings==1)){tabcheckdiv.style.display=""}tabcheckdiv.style.backgroundImage="url(/images/srch_rs/tabcheckbg.png)";if(smilies=="true"){floatingsmilies.style.display="";floatingsmilies.style.backgroundImage="url(/images/srch_rs/floatingsmiliesbg.png)"}}if(searchgriddiv.style.display==""){tabcheckdiv.style.display="none";floatingsmilies.style.display="none"}}else{if(typey=="search"){search_subtabs.style.display="";searchgriddiv.style.display="";tabcheckdiv.style.display="none";floatingsmilies.style.display="none";enhance.style.display="";grid_subtabs.style.display="none";singlegriddiv.style.display="none";gridlink_results.style.display="none";gridlink_cart.style.display="none";fullsearchgridframe.style.display="none";singlegridimage.src="/images/srch_rs/singlegrid.png";gridimage.src="/images/srch_rs/grid_d.png";gridC.style.display="none";moveGrid("mini",false);srch.toggle_links("on")}else{if(typey=="fullsearch"){hideFieldPicker();toggleCopyright("none");if(document.getElementById("options_map")&&document.getElementById("options_map").style.display==""){document.getElementById("options_map").style.display="none";document.getElementById("options_no_tab").style.display=""}if(interfaceObj.can_search&&dirtysearch){compile("fullsearchedit");dirtysearch=false}singlegridimage.src="/images/srch_rs/singlegrid.png";gridimage.src="/images/srch_rs/grid_d.png";tabcheckdiv.style.display="none";floatingsmilies.style.display="none";hidegridbut.style.display="none";gridlink_updatematches.style.display="";topgridlink_updatematches.style.display="";showSearchMenuButtons("hide",["smenu_saveqs","smenu_createidx"]);if(document.getElementById("smenu_clearall_a")){document.getElementById("smenu_clearall_a").onclick=function(){srchlog("edit search clear","click");fullsearchgridframe.contentWindow.clear_all_fields()}}gridlink_updatematches.onclick=function(){srchlog("edit search update count","bottom");fullsearchgridframe.contentWindow.update_count_from_edit()};topgridlink_updatematches.onclick=function(){srchlog("edit search update count","top");fullsearchgridframe.contentWindow.update_count_from_edit()};gridlink_outermatch.href="javascript:srchlog('edit search update view results','bottom');fullsearchgridframe.contentWindow.update_count_from_edit('results');";topgridlink_outermatch.href="javascript:srchlog('edit search update view results','top');fullsearchgridframe.contentWindow.update_count_from_edit('results');";document.getElementById("fullsearch_bottom").style.display="";enhance.style.display="";gridC.style.display="none";fullsearchgridframe.style.display="";document.fullsearchform.ma_search_list.value=ma_search_list;document.fullsearchform.card_fmt_list.value=card_fmt_list;var oldfs=(document.fullsearchform.fullsearchmode.value=="old");var tmp_h="";if(prop_type_list&&prop_type_list!=""&&prop_type_list!="undefined"){tmp_h+="<input type=hidden name='prop_type_list' value=\""+prop_type_list+'">'}var card_fmt_array=card_fmt_list.split(",");tmp_h+="<input type=hidden name='card_fmt_count' value=\""+card_fmt_array.length+'">';for(var cvar=1;cvar<=card_fmt_array.length;cvar++){tmp_h+="<input type=hidden name='card_fmt' value=\""+card_fmt_array[cvar-1]+'">'}var realqcount=0;for(var qvar=1;qvar<=search.length;qvar++){if(oldfs&&search[qvar-1].c.trim()==""){continue}realqcount++;tmp_h+="<input type=hidden name='tb"+realqcount+"' value=\""+search[qvar-1].tb+'">';tmp_h+="<input type=hidden name='f"+realqcount+"' value=\""+search[qvar-1].f+'">';tmp_h+="<input type=hidden name='o"+realqcount+"' value=\""+search[qvar-1].o+'">';tmp_h+="<input type=hidden name='c"+realqcount+"' value=\""+search[qvar-1].c.replace(/[\"]/g,"&quot;")+'">';tmp_h+="<input type=hidden name='d"+realqcount+"' value=\""+search[qvar-1].d+'">';tmp_h+="<input type=hidden name='r"+realqcount+"' value=\""+search[qvar-1].r+'">';tmp_h+="<input type=hidden name='g"+realqcount+"' value=\""+search[qvar-1].g+'">'}tmp_h+="<input type=hidden name='qcount' value='"+realqcount+"'>";document.getElementById("fullsearch_hidden").innerHTML=tmp_h;if(oldfs){document.fullsearchform.target="view_frame"}document.getElementById("searchparamtip").innerHTML="Please view search results to see search parameters.<BR>";document.fullsearchform.submit()}else{if(typey=="multi"&&srmode=="cart"){if(cart_totallistings>sortmax){orderbuttons_dead.style.display="";orderbuttons.style.display="none"}else{orderbuttons.style.display="";orderbuttons_dead.style.display="none"}}if(listing_in_focus_not_in_grid){if(typey=="multi"){showLargeLoading(true)}else{showLargeLoading()}selectListingBySpinMemCache(selectedlisting);listing_in_focus_not_in_grid=false}enableLSelector();setActiveGridLink(srmode);singlegridimage.src="/images/srch_rs/singlegrid.png";gridimage.src="/images/srch_rs/grid_d.png";tabcheckdiv.style.display="none";floatingsmilies.style.display="none";singlegriddiv.style.display="none";grid_subtabs.style.display="";gridlink_results.style.display="";gridlink_cart.style.display="";gridlink_back2search.style.display="none";search_subtabs.style.display="none";searchgriddiv.style.display="none";enhance.style.display="none";gridbottom.style.display="";srch.toggle_links("off");fullsearchgridframe.style.display="none";gridC.style.display="";if(gridwidth!=1000){moveGrid("mini",false)}if((interfaceObj.show_viewswitcher&&!hotsheet)||(interfaceObj.show_viewswitcher&&hotsheet&&srmode=="cart")){new_sd_tech_id.style.display="";gridviewlink.style.display=""}else{new_sd_tech_id.style.display="none";gridviewlink.style.display="none";if(hotsheet&&hs_force_mls_view=="N"){gridviewlinkhotsheet.style.display=""}else{gridviewlinkhotsheet.style.display="none"}}if((interfaceObj.show_sort&&!hotsheet)||(interfaceObj.show_sort&&hotsheet&&srmode=="cart")){gridsortlink.style.display="";top_gridsortlink.style.display=""}else{gridsortlink.style.display="none";top_gridsortlink.style.display="none"}}}}}function delayEVReset(){setTimeout("resetGrid(true,true)",500)}function close_inline(){gridinlineiframe.style.display="none"}function changesort(mode){gridinlineiframe.src="/blank.html";var url="/cgi-bin/mainmenu.cgi?cmd=srv+/srch_rs/editsort.html";if(mode&&mode=="new"){url+="&newsort=true"}url+="&ma_search_list="+ma_search_list;url+="&card_fmt_list="+card_fmt_list;url+="&cart_techid_list="+cart_techid_list.join(",");url+="&prop_type_list="+prop_type_list;url+="&sdlist="+new_sd_tech_id.options[new_sd_tech_id.selectedIndex].value;url+="&popup=true&html_title_text=";url+=escape("Edit View "+new_sd_tech_id.options[new_sd_tech_id.selectedIndex].text);gridinlineiframe.style.display="";gridinlineiframe.src=url}function editview(){srchlog("edit view","",false,rmxId(new_sd_tech_id.options[new_sd_tech_id.selectedIndex].value));gridinlineiframe.src="/blank.html";var url="/cgi-bin/mainmenu.cgi?cmd=url+other/popup/edit_view.html&sdlist=";url+=new_sd_tech_id.options[new_sd_tech_id.selectedIndex].value+"&popup=true&html_title_text=";url+=escape("Edit View "+new_sd_tech_id.options[new_sd_tech_id.selectedIndex].text);gridinlineiframe.style.display="";gridinlineiframe.src=url}function addview(tech_id,name,photo,inherited){var text=""+(photo?"[":"")+name+(inherited?" *":"")+(photo?"]":"");var next="";for(var i=0;i<new_sd_tech_id.options.length;++i){if(tech_id==new_sd_tech_id.options[i].value){new_sd_tech_id.remove(i);break}}var j;for(j=0;j<new_sd_tech_id.options.length;++j){next=new_sd_tech_id.options[j].text;if(next.match(/\[.*\]/)){next=next.slice(1,-1)}if(name.toLowerCase()<next.toLowerCase()){break}}try{new_sd_tech_id.add(new Option(text,tech_id),(new_sd_tech_id.options[j]?new_sd_tech_id.options[j]:null))}catch(e){new_sd_tech_id.add(new Option(text,tech_id),j)}}function populate_prospect_names(){var contact_id=document.getElementById("new_contact_id");var fname=document.getElementById("new_contact_fname");var lname=document.getElementById("new_contact_lname");if(fname.value.replace(/ /g,"")==""&&lname.value.replace(/ /g,"")==""){var names=contact_id.value.split(/\s+/);lname.value=names.pop();fname.value=names.join(" ")}}function validSizeValue(n){if(n>=0){return n}else{return 0}}function resize(fms){if(!forprint){var height=getWindowHeight();var width=getWindowWidth();if(fms!="onload"){if(document.body.clientHeight&&!resizing&&overlayPanel&&overlayPanel.style){resizing=true;overlayPanel.style.width=width;backToSearch.style.width=width;overlayframe.style.width=width;overlayPanel.style.height=height;backshadowlayer.style.width=width;backshadowlayer.style.height=height;backToSearch.style.height=30;overlayframe.style.height=validSizeValue(height-30);gridinlineiframe.style.width=validSizeValue(width-21);gridinlineiframe.style.height=validSizeValue(height-70-12);if(firsttimeindiv.clientWidth!=miniwidth){firsttimeindiv.style.width=validSizeValue(width-21)}firsttimeindiv.style.height=validSizeValue(height-70-10);var t_gw=(gridwidth!=1000?gridwidth:(width-21));grid.style.width=t_gw;gridC.style.width=t_gw;singlegriddiv.style.width=t_gw;singlegriddiv_blackout.style.width=t_gw;searchgriddiv.style.width=t_gw;gridbottom.style.width=t_gw;gridC.style.height=validSizeValue(height-131-10);menuicons_container.style.width=width;resultsheader.style.width=validSizeValue(width-menuicons.clientWidth-10);menushadow.style.width=width;menushadow.style.height=5;if(searchgriddiv.style.display==""){singlegriddiv.style.height=validSizeValue(height-101-10-2);singlegriddiv_blackout.style.height=validSizeValue(height-101-10-2);grid.style.height=validSizeValue(height-70-10)}else{singlegriddiv.style.height=validSizeValue(height-131-10-2);singlegriddiv_blackout.style.height=validSizeValue(height-131-10-2);grid.style.height=validSizeValue(height-70-12)}searchgriddiv.style.height=validSizeValue(height-131-10);gridbottom.style.height=30;options_summary.style.height=27;if(browser_type=="IE"){options_summary.style.width=t_gw}else{options_summary.style.width=validSizeValue((gridwidth!=1000?gridwidth-10:(width-31)))}if(gridwidth==1000){grid_subtabs.style.width=validSizeValue(rightgridoptionsdiv.offsetLeft-grid_subtabs.offsetLeft)}else{if((options_summary.clientWidth-hidegridbut.clientWidth-30)>0){grid_subtabs.style.width=validSizeValue(options_summary.clientWidth-hidegridbut.clientWidth-30)}}var qsrch_width=validSizeValue((gridwidth!=1000?gridwidth:(width-1))-36);if(qsrch_width<0){qsrch_width=0}new_quicksearch.style.width=qsrch_width;if(document.getElementById("singlepaneoverflow")&&document.getElementById("imageandaddressspan")){if(searchgriddiv.style.display==""){document.getElementById("singlepaneoverflow").style.height=validSizeValue(getWindowHeight()-document.getElementById("imageandaddressspan").clientHeight-(browser_type=="IE"?113:121)-2)}else{document.getElementById("singlepaneoverflow").style.height=validSizeValue(getWindowHeight()-document.getElementById("imageandaddressspan").clientHeight-(browser_type=="IE"?143:151)-2)}}var bodyminus=0;if(thegrid.clientWidth>gridC.clientWidth){bodyminus=22}var startingpt=141;var headerminus=thegridheader.clientHeight;thegridbody.style.height=validSizeValue((height-(startingpt+headerminus+bodyminus)));if(thegrid.rows[0]){thegrid.rows[0].style.width="1%"}minibar.style.width=15;minibar.style.height=validSizeValue(height-70-10);if(gridwidth!=1000){bottomsection.style.width=validSizeValue(width-gridwidth)}bottomsection.style.height=validSizeValue(height-70);topsection.style.width=validSizeValue(width-20);if(gridwidth!=1000){if(browser_type=="IE"){lowertopleft.style.display="";lowertopleft.style.width=gridwidth;lowertoptableleft.style.width=gridwidth;lowertopright.style.width=validSizeValue(width-gridwidth-31);lowertoptableright.style.width=validSizeValue(width-gridwidth-32)}else{lowertopleft.style.display="";lowertopleft.style.width=gridwidth+2;lowertoptableleft.style.width=gridwidth+2;lowertopright.style.width=validSizeValue(width-gridwidth-30);lowertoptableright.style.width=validSizeValue(width-gridwidth-30)}}else{lowertopleft.style.display="none";lowertopright.style.width=validSizeValue(width-20);if(browser_type=="IE"){lowertoptableright.style.width=validSizeValue(width-22)}else{lowertoptableright.style.width=validSizeValue(width-19)}}lowertoptableright.style.height=24;if(tabIndex!=0&&tabIndex!=7){var titlePad=0;var borderPad=0;var borderStyle="1px solid #666";if(tabArray[tabIndex]=="tab_map"||tabArray[tabIndex]=="tab_stats"||(tabArray[tabIndex]=="tab_tour"&&!document.getElementById("media_photos_link"))){document.getElementById(iframesArray[tabIndex-1]).style.top="30px"}else{document.getElementById(iframesArray[tabIndex-1]).style.top="30px";titlePad=0;borderPad=0}document.getElementById(optionsArray[tabIndex-1]).style.height=27;document.getElementById(iframesArray[tabIndex-1]).style.height=validSizeValue(height-100-10-titlePad);if(gridwidth!=1000){document.getElementById(optionsArray[tabIndex-1]).style.width=validSizeValue(width-gridwidth-32);document.getElementById(iframesArray[tabIndex-1]).style.width=validSizeValue(width-gridwidth-32-borderPad);document.getElementById(iframesArray[tabIndex-1]).style.right=(borderPad>0?1:0);document.getElementById(iframesArray[tabIndex-1]).style.borderRight=borderStyle;document.getElementById(iframesArray[tabIndex-1]).style.borderLeft=borderStyle}}else{if(tabIndex==0){gridC.style.top="30px";gridC.style.borderTop="none"}}if(directlink){minibar.style.display="none";minibar.style.width=0;lowertoptableleft.style.width=0;lowertoptableleft.style.display="none";grid.style.display="none";grid.style.width=0;if(tabIndex!=7){document.getElementById(optionsArray[tabIndex-1]).style.width=validSizeValue(width-gridwidth-12);document.getElementById(iframesArray[tabIndex-1]).style.width=validSizeValue(width-gridwidth-12)}}if(smilies=="true"&&!forprint){if(browser_type!="IE"&&browser_type!="Safari"&&browser_type!="Opera"&&thegridbody.scrollHeight>thegridbody.clientHeight&&gridwidth!=1000){changecss(".smilediv","paddingRight","15px")}else{changecss(".smilediv","paddingRight","0px")}}if(tabArray[tabIndex]=="tab_tour"){tbcnt=0;mtlwidth=(document.getElementById("media_vtour_link")?document.getElementById("media_vtour_link").clientWidth:0);mvlwidth=(document.getElementById("media_videos_link")?document.getElementById("media_videos_link").clientWidth:0);mplwidth=(document.getElementById("media_photos_link")?document.getElementById("media_photos_link").clientWidth:0);tbcnt=(mtlwidth>0?1:0)+(mvlwidth>0?1:0)+(mplwidth>0?1:0);if(tbcnt==0){photodescriptions.style.width=""}else{photodescriptions.style.width=validSizeValue(options_tour.clientWidth-130-mtlwidth-mvlwidth-mplwidth-(tbcnt*4))}}resize_search(height,width);resizing=false;if(tabArray[tabIndex]=="tab_detail"){fitDetailMenu()}resizeModalDia()}}else{for(var h=0;h<iframesArray.length;h++){document.getElementById(optionsArray[h]).style.width=validSizeValue(width-miniwidth-32);document.getElementById(iframesArray[h]).style.width=validSizeValue(width-miniwidth-32);document.getElementById(optionsArray[h]).style.height=27;document.getElementById(iframesArray[h]).style.height=validSizeValue(height-100-10)}}}}var extrarowX=15;function addextrarow(){if(current_grid_totallistings<=extrarowX&&current_grid_totallistings>0){var row=document.createElement("TR");tmpmath=100-(current_grid_totallistings*6);row.style.height=tmpmath+"%";thegrid.tBodies[0].appendChild(row)}setTimeout("resize()",1500)}function minusextrarow(){return(current_grid_totallistings<=extrarowX&&current_grid_totallistings>0)?1:0}function resizeModalDia(){if(document.getElementById("modalmask").style.display!="none"){var mc=document.getElementById("modalcontent");var ms=document.getElementById("modalshim");var h=getWindowHeight();var w=getWindowWidth();if(h<=mc.clientHeight){mc.style.top=0;ms.style.top=0}else{mc.style.top=(h-mc.clientHeight)/2;ms.style.top=(h-mc.clientHeight)/2}if(w<=mc.clientWidth){mc.style.left=0;ms.style.left=0}else{mc.style.left=(w-mc.clientWidth)/2;ms.style.left=(w-mc.clientWidth)/2}}}function hideModalDia(){document.getElementById("modalmask").style.display="none";document.getElementById("modalshim").style.display="none"}function createIDXLink(){closeAllDropDowns();var select_box=document.getElementById("quick_srches");if(select_box.options.length==0){showLoad();loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch/getQuickSearches.html&from_idx=true&select_box_id=quick_srches"+additional_ajax_params,false);return false}if(dirtysearch){compile();stallForFire="idx";return}if(editingFullSearch()&&searchmode!="idx_fs_stall"){fullsearchgridframe.contentWindow.update_count_from_edit("fs_popout||idx");return}else{if(searchmode=="idx_fs_stall"){searchmode="searchtab_fullsearch"}}stallForFire=false;var view="";var template="";if(new_sd_tech_id){view=new_sd_tech_id.value}var s=new Array();s.push('<input type="hidden" name="from_sr" value="true">');s.push('<input type="hidden" name="ma_search_list" value="'+ma_search_list+'" />');s.push('<input type="hidden" name="card_fmt_list" value="'+card_fmt_list+'" />');s.push('<input type="hidden" name="prop_type_list" value="'+prop_type_list+'" />');s.push('<input type="hidden" name="shortdisplay_id" value="'+rmxId(view)+'">');s.push('<input type="hidden" name="srch_template_id" value="'+rmxId(template_id)+'">');var title=document.getElementById("resultsheader").innerHTML.trim();if(title){s.push('<input type="hidden" name="link_title" value="'+title.replace(/\"/g,"&quot;").replace(/\s+/g," ")+'">')}if(document.getElementById("detailreports")){s.push('<input type="hidden" name="report_type" value="'+document.getElementById("detailreports").value+'">')}else{if(detailselectvalue){s.push('<input type="hidden" name="report_type" value="'+detailselectvalue+'">')}}if(srch_source=="quicksearch"&&!search.length){s.push('<input type="hidden" name="saved_search_link" value="false">')}else{s=pushSearchParams(s,true);s.push('<input type="hidden" name="saved_search_link" value="true">')}overlayPanel.style.display="";document.getElementById("idxform_div").innerHTML=s.join("");document.idxform.submit()}function showLargeLoading(makemini){if(makemini){document.getElementById("firsttimeindiv").style.width=miniwidth}else{document.getElementById("firsttimeindiv").style.width=getWindowWidth()-21}document.getElementById("firsttimeindiv_innerds").innerHTML='<span>Loading <img src="/images/srch_rs/loading.gif" border="0" align="absmiddle"></span>';document.getElementById("firsttimeindiv").style.display=""}function fadeoutFirsttimein(){if(!forprint){if(document.getElementById("firsttimeindiv").style.display==""){document.getElementById("firsttimeindiv").style.width=getWindowWidth()-21;if(((frommultaddresssearch=="true"||listuserrejected=="true"||approvereject||additionalcond!=""||((interfaceObj.publicside||interfaceObj.idx)&&!interfaceObj.can_search))||(interfaceObj.portal&&!interfaceObj.idx))&&current_grid_totallistings==0){if(approvereject){document.getElementById("approvepanel").style.display="none"}if(interfaceObj.idx){document.getElementById("firsttimeindiv_innerds").innerHTML="No listings match the search."}else{if(interfaceObj.publicside){document.getElementById("firsttimeindiv_innerds").innerHTML="The listing or listings are no longer available since they have changed since this link was sent and no longer match the search."}else{document.getElementById("firsttimeindiv_innerds").innerHTML='No listings found.<br><br><a href="/cgi-bin/mainmenu.cgi?cmd=url+welcome.html&no_html_header=true&firsttime=false" target="view_frame">Go to the flexmls Web Dashboard</a>'}}}else{document.getElementById("firsttimeindiv").style.display="none";resize()}if(srmode=="results"&&current_grid_totallistings<=magicnumtoacton&&chk_counter==current_grid_totallistings){flipCheck("on")}}if(listingcart=="true"&&original_cart_listings==null&&srmode=="results"){original_cart_listings=new Array();var tb=thegrid;var tid=null;for(var x=1;x<(tb.rows.length-minusextrarow());x++){tid=tb.rows[x].id.substr(4,30);original_cart_listings.push(tid)}}if(stallForFire){switch(stallForFire){case"email":fireEmail();break;case"print":firePrint();break;case"cma_cart":fireActualCMA("cart");break;case"cma_all":fireActualCMA("all");break;case"export":fireExport();break;case"tax":fireTaxLookup();break;case"save":fireSave();break;case"idx":createIDXLink();break;default:}if(editingMap()){if(iframe_map&&iframe_map.contentWindow.requestDynamicLayer){current_grid_totalextents=null;iframe_map.contentWindow.requestDynamicLayer()}}stallForFire=false}interfaceObj.check_all=false}}function updateReportSelectHtml(val){var drh=document.getElementById("detailreportshidden");if(val=="onload"){var foundmatch=false;for(var x=0;x<drh.length;x++){drhsp=drh[x].value.split(",");if(drhsp[1]==detailselectvalue||drh[x].value==detailselectvalue){foundmatch=true;drh[x].selected=true;detailselectvalue=drh[x].value}}if(!foundmatch){detailselectvalue="s,fulllistA"}}else{if(val){detailselectvalue=val;for(var x=0;x<drh.length;x++){if(drh[x].value==detailselectvalue){drh[x].selected=true}}}else{detailselectvalue=drh.options[drh.selectedIndex].value}}if(!detailselectvalue||detailselectvalue==""){detailselectvalue="s,fulllistA"}reportselecthtml="";for(var x=0;x<drh.length;x++){if(drh[x].value==detailselectvalue){reportselecthtml+='<option value="'+drh[x].value+'" selected>'+drh[x].text+"</option>"}else{reportselecthtml+='<option value="'+drh[x].value+'">'+drh[x].text+"</option>"}}reportmenu[0]='<select id="detailreports" onclick="updateReportSelectHtml(this.value);changeDetail();hidemenu();" size=10 style="width:300px">'+reportselecthtml+"</select>";if(interfaceObj.show_versionselection){reportmenu[0]+='<div style="width:295px; padding:3px; border-bottom:1px solid #333;"><input id="report_public" value="public" name="report_pp" type="radio" onclick="report_puborpriv=\'public\';changeDetail();updateReportSelectHtml();hidemenu();" '+(report_puborpriv=="public"?"checked":"")+'><label for="report_public">Public</label><input id="report_private" value="private" name="report_pp" type="radio" onclick="report_puborpriv=\'private\';changeDetail();updateReportSelectHtml();hidemenu();" '+(report_puborpriv=="private"?"checked":"")+'><label for="report_private">Private</label></div>'}}function changeDetail(keep_detail,skiplookup){if(!skiplookup){var row=document.getElementById("row-"+selectedlisting);if(row&&row.detail_links&&(!interfaceObj.idx||row.i_show_rpt_cache)){for(var i in detail_links){detail_links[i].list_allow=row.detail_links[i]}generateDetailMenu();setActiveDetailLink();if(interfaceObj.idx&&idx_fulllistlink!="Y"){interfaceObj.show_report=row.i_show_rpt}}else{loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/detailGetInfo.html&srch_rs=true&list_tech_id="+selectedlisting+"&p="+!interfaceObj.privatemode+"&i="+interfaceObj.idx+"&ifull="+idx_fulllistlink+"&s_supp="+interfaceObj.show_supplement+"&s_orem="+interfaceObj.show_officeremarks+"&s_docs="+interfaceObj.show_documents+"&s_tour="+interfaceObj.show_tourhomes+"&s_open="+interfaceObj.show_openhouse+additional_ajax_params,false)}}if(!keep_detail||last_detail_ran=="reports"){currentlyviewing="report";if(interfaceObj.show_report){var newstr=getReportURL(selectedlisting);iframe_detail.src=newstr+"&srch_rs=true"}else{iframe_detail.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/reportnotavail.html"}last_detail_ran="reports";setActiveDetailLink()}else{detailChoice(last_detail_ran)}}function getReportURL(list_tech_id,new_module_inst){if(new_module_inst){var s="/cgi-bin/mainmenu.cgi?cmd=url+search/listnum/step2.html";s+="&use_tech_id=true&list_tech_id="+list_tech_id;return s}var selval=detailselectvalue;var newstr="/cgi-bin/mainmenu.cgi?cmd=url+reports/dispatcher/";var Selected=selval.split(",");if(Selected[0]=="s"){newstr+="display_standard_report.html"}if(Selected[0]=="c"){newstr+="display_custom_report.html"}if(Selected[0]=="o"){newstr+="display_old_custom_report.html";report_param="o,"+xId(Selected[1])}else{report_param=selval}newstr+="&wait_var=5";newstr+="&please_wait_override=Y";newstr+="&report_grid=";newstr+="&report_title=";newstr+="&fontsize=";newstr+="&spacing=";newstr+="&auto_print_report=";newstr+="&allow_linkbar=N";newstr+="&report="+report_param;if(Selected[0]=="o"){newstr+="&report2="+xId(Selected[1])}newstr+="&linkbar_toggle=";newstr+="&report_type="+report_puborpriv;newstr+="&buscardselect="+businesscard;newstr+="&override_copyright=system";newstr+="&qcount=1";newstr+="&c1="+xId(list_tech_id);newstr+=additional_ajax_params;return newstr}function toggleCopyright(override){if(override){document.getElementById("copyrightPanel").style.display=override}else{document.getElementById("copyrightPanel").style.display=(document.getElementById("copyrightPanel").style.display=="block")?"none":"block"}}var hotsheetindex=0;function hotsheetFooter(){if(hotsheet){var tmpstr="";var tmpstr2="";for(var t=0;t<hotsheetmenu_foot.length;t++){rExp=/\ \(\d+\)/gi;tmpstr2=hotsheetmenu_foot[t].hreflabel.replace(rExp,"");rExp=/New Listings/gi;tmpstr2=tmpstr2.replace(rExp,"New");rExp=/Price Changes/gi;tmpstr2=tmpstr2.replace(rExp,"Price");rExp=/Text Change/gi;tmpstr2=tmpstr2.replace(rExp,"Text");if(hotsheetlabel.innerHTML.indexOf(hotsheetmenu_foot[t].hreflabel)==-1){if(tmpstr==""){tmpstr+='<a href="'+hotsheetmenu_foot[t].hrefcode+'" title="'+hotsheetmenu_foot[t].hreflabel+'">'+tmpstr2+"</a>"}else{tmpstr+=' | <a href="'+hotsheetmenu_foot[t].hrefcode+'" title="'+hotsheetmenu_foot[t].hreflabel+'">'+tmpstr2+"</a>"}}else{if(tmpstr==""){tmpstr+="<span class='hotsheetselectedlink'><a href=\""+hotsheetmenu_foot[t].hrefcode+'" title="'+hotsheetmenu_foot[t].hreflabel+'">'+tmpstr2+"</a></span>"}else{tmpstr+=" | <span class='hotsheetselectedlink'><a href=\""+hotsheetmenu_foot[t].hrefcode+'" title="'+hotsheetmenu_foot[t].hreflabel+'">'+tmpstr2+"</a></span>"}}}copyrighttd.innerHTML=tmpstr}}function onloadCall(){srchlog("init","");defineElementVariables();if(interfaceObj.buildsearchquery_dropped_mls_flag==true){writeToWarningDiv("Your search criteria contains an MLS whose data you no longer have access to.","warning",10000);interfaceObj.buildsearchquery_dropped_mls_flag=false}if(interfaceObj.idx&&interfaceObj.publicside){idxtimer=new Date();checkidxtimer()}if(interfaceObj.show_approvereject){disableApproveMessage()}if(approvereject&&notautorizedmessage!=""){writeToWarningDiv(notautorizedmessage,"attention",5000)}updateReportSelectHtml("onload");if(interfaceObj.publicside&&!interfaceObj.portal){changecss(".publicmessageicon","display","none");changecss(".privatemessageicon","display","none")}else{changecss(".publicmessageicon","display","");if(interfaceObj.privatemode||client_id){changecss(".privatemessageicon","display","")}}if(interfaceObj.idx&&interfaceObj.portal){loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/resetTabsByPortalPref.html"+additional_ajax_params,false)}else{if(interfaceObj.idx){document.getElementById("tab_notes").style.display="none";interfaceObj.show_discuss=false;if(startpos=="discuss"){if(interfaceObj.show_detail&&interfaceObj.show_report){clickTab("tab_detail",false)}}}}if(interfaceObj.idx){if(interfaceObj.open_map_tab_on_edit){searchmode="searchtab_mapsearch"}else{searchmode="searchtab_quicksearch"}}else{if(interfaceObj.search_tab_on_edit=="A"||(srch_source=="quicksearch"||srch_source=="editmapsearch")){var radiusSearch=false;for(var qvar=0;qvar<search.length;qvar++){if(search[qvar].tb=="radius"||search[qvar].tb=="mapshape"){radiusSearch=true;break}}if(radiusSearch){searchmode="searchtab_mapsearch"}else{if(srch_source=="saved_search"&&saved_search_type){if(saved_search_type=="G"){searchmode="searchtab_mapsearch"}else{if(saved_search_type=="T"||saved_search_type=="Q"){searchmode="searchtab_quicksearch"}}}else{if(srch_source=="saved_full_search"){searchmode="searchtab_fullsearch"}else{if(srch_source=="quicksearch"||srch_source=="saved_quick_search"){searchmode="searchtab_quicksearch"}else{if(srch_source=="editmapsearch"){searchmode="searchtab_mapsearch"}else{if(srch_source=="fullsearch"){searchmode="searchtab_fullsearch"}}}}}}}else{if(interfaceObj.search_tab_on_edit=="Q"){searchmode="searchtab_quicksearch"}else{if(interfaceObj.search_tab_on_edit=="M"){searchmode="searchtab_mapsearch"}else{if(interfaceObj.search_tab_on_edit=="F"){searchmode="searchtab_fullsearch"}}}}}if(browser_type=="IE"||browser_type=="Safari"||browser_type=="Opera"){gridC.onscroll=function(){scrollCall(this)}}else{thegridbody.onscroll=function(){scrollCall(this)}}sortMaxCheck("results");if(hotsheet){hotsheetFooter();gridlink_results.style.display="none";gridlink_hotsheet.style.display="";gridlink_results=document.getElementById("gridlink_hotsheet");if(combined_hotsheet_count<0){document.hotinitform.combined_hotsheet_sql.value=combined_hotsheet_sql;loadJavaScriptDoc("form","mainmenu.cgi","hotinitform",false)}}else{gridlink_results.style.display="";gridlink_hotsheet.style.display="none";gridlink_results=document.getElementById("gridlink_results")}setActiveGridLink(srmode);if((interfaceObj.show_viewswitcher&&!hotsheet)||(interfaceObj.show_viewswitcher&&hotsheet&&srmode=="cart")){new_sd_tech_id.style.display="";gridviewlink.style.display=""}else{new_sd_tech_id.style.display="none";gridviewlink.style.display="none";if(hotsheet&&hs_force_mls_view=="N"){gridviewlinkhotsheet.style.display=""}else{gridviewlinkhotsheet.style.display="none"}}if((interfaceObj.show_sort&&!hotsheet)||(interfaceObj.show_sort&&hotsheet&&srmode=="cart")){gridsortlink.style.display="";top_gridsortlink.style.display=""}else{gridsortlink.style.display="none";top_gridsortlink.style.display="none"}if(interfaceObj.can_search){if(ma_search_list.match(",")&&prop_type_list==""){var cf_list=new Array();for(var i=0;i<srch_crossmls_proptypes.length;i++){var found=false;for(var j=0;j<srch_mls.length;j++){for(var k=0;k<srch_mls[j].card_fmt_list.length;k++){if(srch_mls[j].card_fmt_list[k].prop_group_id==srch_crossmls_proptypes[i].prop_group_id){found=true;break}}if(found){break}}if(found){cf_list.push(srch_crossmls_proptypes[i])}}prop_type_list=xId(cf_list[0].prop_group_id)}else{if(!ma_search_list.match(",")&&card_fmt_list==""){for(var x=0;x<srch_mls.length;x++){if(ma_search_list.match(srch_mls[x].tech_id)){card_fmt_list="'"+srch_mls[x].card_fmt_list[0].code+"'";break}}}}if(srch_source=="quicksearch"||srch_source=="new_quicksearch"||srch_source=="saved_quick_search"||srch_source=="editmapsearch"){addTemplate(template_id)}else{getFetchableFields(true,false)}}if(srch_source=="quicksearch"||srch_source=="editmapsearch"||(interfaceObj.edit_on_load&&interfaceObj.can_search)){noListingMode=true;disableLSelector();editSearch();setTimeout("fadeoutFirsttimein()",1000);srch.update()}else{resetGrid(true,true,new_sd_tech_id.options[new_sd_tech_id.selectedIndex].value,true)}if(interfaceObj.publicside){if(readCookie("gridfont")!=null){savedfont=parseInt(readCookie("gridfont"))}if(readCookie("open_map_tab_on_edit")!=null){interfaceObj.open_map_tab_on_edit=new Boolean(readCookie("open_map_tab_on_edit"));clickTab("tab_map")}}if(gridfont!=savedfont){gridfont=savedfont;changeGridFont("saved")}if(interfaceObj.publicside&&document.getElementById("brought_to_you_by_div")&&document.getElementById("brought_to_you_by_div").innerHTML!=""){if(browser_type=="IE"){document.getElementById("resultsheader").innerHTML=document.getElementById("brought_to_you_by_div").innerText}else{document.getElementById("resultsheader").innerHTML=document.getElementById("brought_to_you_by_div").textContent}}if(interfaceObj.portal&&portal_client_name){var srtitle=document.getElementById("resultsheader").innerHTML.trim();document.getElementById("resultsheader").innerHTML=srtitle+"<i> for "+portal_client_name+"</i>"}if(document.fullsearchform&&document.fullsearchform.fullsearchmode&&document.fullsearchform.fullsearchmode.value=="old"){document.getElementById("searchtab_fullsearch").className="subTab";if(document.saveform&&document.saveform.contactMgmtBasedSearch&&document.saveform.contactMgmtBasedSearch.value=="true"){enableDisableFullSearch(true)}}if(document.getElementById("fontsizedisp")){document.getElementById("fontsizedisp").value=gridfont;if(browser_type=="IE"){document.getElementById("fontsizedisp").style.top="2px";document.getElementById("fontsizeminus").style.marginTop="5px";document.getElementById("fontsizeplus").style.marginTop="5px"}}try{if(browser_type=="IE"){document.onkeydown=keyCheck}else{window.onkeydown=keyCheck}}catch(e){}if(ma_search_list.indexOf(",")==-1&&xId(js_ma_tech_id)!=ma_search_list&&js_ma_tech_id!="20010602000846355519000000"){field_id_list=new Array();if(ma_search_list.split(",").length==1){scrollfl_ma_tech_id=ma_search_list;_AP_Reload(scrollfl_ma_tech_id,card_fmt_list)}}resize("onload");if(interfaceObj.publicside&&document.getElementById("loginlink")){var cooktext=readCookie("portalkey");if(cooktext){var cooksplit=cooktext.split("|");if(cooksplit[2]){portal_client_name=cooksplit[2]}if(cooksplit[3]){portalownername=cooksplit[3]}portallogonreturn(cooksplit[0],cooksplit[1],true)}}}function tabcheckClicked(onOff){if((onOff&&onOff=="off")||(!onOff&&tabcheck.src.indexOf("check.png")!=-1)){tabcheck.src="/images/srch_rs/check_u.png";if(!onOff){remselectedlisting(selectedlisting);chk_counter--}if(document.getElementById("check-"+rmxId(selectedlisting))){document.getElementById("check-"+rmxId(selectedlisting)).src="/images/srch_rs/check_u.png"}}else{tabcheck.src="/images/srch_rs/check.png";if(!onOff){addselectedlisting(selectedlisting);chk_counter++}if(document.getElementById("check-"+rmxId(selectedlisting))){document.getElementById("check-"+rmxId(selectedlisting)).src="/images/srch_rs/check.png"}}}function checkClick(xi,techid){if(xi.src.indexOf("check.png")!=-1){xi.src="/images/srch_rs/check_u.png";srchlog("listing checkbox","removed",false,techid);remselectedlisting(techid);if(techid==selectedlisting){tabcheck.src="/images/srch_rs/check_u.png"}chk_counter--;flipCheck("off")}else{xi.src="/images/srch_rs/check.png";srchlog("listing checkbox","added",false,techid);addselectedlisting(techid);if(techid==selectedlisting){tabcheck.src="/images/srch_rs/check.png"}chk_counter++;if(current_grid_totallistings<=magicnumtoacton&&chk_counter==current_grid_totallistings){flipCheck("on")}}}function nextL(){if(!alreadyrunning&&!noListingMode&&Lselectorenabled){if(selectedInd+1<=current_grid_totallistings){selectLbyIndex(selectedInd+1,"down")}}}function prevL(){if(!alreadyrunning&&!noListingMode&&Lselectorenabled){if(selectedInd-1>=1){selectLbyIndex(selectedInd-1,"up")}}}var manualordering=false;function fixCartOrder(){if(!manualordering){manualordering=true;var tarr=new Array();var tb=thegrid;var tid=null;if(listingcart=="true"&&srmode=="results"){original_cart_listings=[]}for(var x=1;x<(tb.rows.length-minusextrarow());x++){tid=tb.rows[x].id.substr(4,30);if(document.getElementById("check-"+tid).src.indexOf("check.png")!=-1||srmode=="results"){tarr.push(tid);if(listingcart=="true"&&srmode=="results"){original_cart_listings.push(tid)}}document.getElementById("rowpos-"+tid).innerHTML=x}sellistings=tarr;cart_allorderby="";if(srmode=="results"){resultslistings=tarr;results_allorderby=""}manualordering=false}}function reorderListing(whr){if((srmode=="cart"&&cart_totallistings>sortmax)||(srmode=="results"&&results_totallistings>sortmax)){writeToWarningDiv("Manual sorting is only available on a set of listings less than "+sortmax,"attention",5000)}else{manualordering=true;var selrow=document.getElementById("row-"+selectedlisting);if(whr=="up"&&selrow.previousSibling){selrow.parentNode.insertBefore(selrow,selrow.previousSibling)}else{if(whr=="down"&&selrow.nextSibling&&selrow.nextSibling.id){selrow.parentNode.insertBefore(selrow.nextSibling,selrow)}else{if(whr=="top"){selrow.parentNode.insertBefore(selrow,selrow.parentNode.firstChild)}else{if(whr=="bottom"){if(minusextrarow()==0){selrow.parentNode.insertBefore(selrow,null)}else{selrow.parentNode.insertBefore(selrow,selrow.parentNode.lastChild)}}}}}manualordering=false;setTimeout("fixCartOrder()",1000)}}function selectLbyIndex(ri,move){var tb=thegrid;var rr="";for(var x=1;x<(tb.rows.length-minusextrarow());x++){if(ri==tb.rows[x].mind){rr=tb.rows[x].id.substr(4,30);break}}if(rr!=""){setTimeout('selectL("'+rr+'","'+move+'");',1)}else{getListingFromInput(ri)}}function peekNextL(){var tb=thegrid;var rr=null;for(var x=1;x<(tb.rows.length-minusextrarow());x++){if((selectedInd+1)==tb.rows[x].mind){rr=tb.rows[x].id.substr(4,30);break}}return rr}function requestShowing(list_id){clickTab("tab_notes",false);iframe_notes.contentWindow.requestShowing(selectedlisting)}function fireHot(sqlid,label){srmode="results";new_sd_tech_id.style.display="none";gridsortlink.style.display="none";top_gridsortlink.style.display="none";gridviewlink.style.display="none";setActiveGridLink(srmode);hidemenu();hotsheetlabel.innerHTML=label;results_allwherestr=hotsheetSqlobj[sqlid];allwherestr=results_allwherestr;last_hotsheet=sqlid;resetGrid(true,true);hotsheetFooter();if(tabIndex==CompareTabIndex){if(tab_stats_listing){if(whereStringChanged_stats){whereStringChanged_stats=false;iframe_stats.contentWindow.changeClause();tab_stats_listing=999}if(tab_stats_listing!=selectedlisting){iframe_stats.contentWindow.changeListing(selectedlisting);tab_stats_listing=selectedlisting}}else{iframe_stats.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/compareTab.html&list_tech_id="+selectedlisting+additional_ajax_params;tab_stats_listing=selectedlisting}}}function updateSingleView(){var row=document.getElementById("row-"+rmxId(selectedlisting));var rowd=document.getElementById("row-"+rmxId(selectedlisting)+"_dummy");if(row||rowd){var h="";h+="<div id='imageandaddressspan' style='text-align:center;width:"+(miniwidth)+"px'>";h+="<div class='singlelistingpictureandbuttondiv'>";if(searchgriddiv.style.display==""){h+="<div style='text-align:center;overflow:hidden;margin:0px;padding:0px;width:"+(miniwidth_srch-1)+"px'>"}else{h+="<div style='text-align:center;overflow:hidden;margin:0px;padding:0px;width:"+(miniwidth-1)+"px'>"}if(singlelistingviewtype=="map"){h+="<center><img height=200 id='singlelistingpicture' border=0 src=\""+drawMap(mapserver_miniZoom)+'" onload="this.style.opacity = \'1\';" onerror="this.src=\'/images/srch_rs/nomap_single.jpg\';" title="Click for larger map" onclick="jumpToMap();"></center>'}else{h+="<center><img height=200 id='singlelistingpicture' border=0 src=\""+selListObj.image.replace("-t.jpg",".jpg")+'" onerror="this.src=\'/images/srch_rs/nophoto_single.png\';" title="Click for larger image" onclick="jumpToMediaPhoto();"></center>'}h+="</div>";h+='<table border="0" cellpadding="0" cellspacing="1" width="'+(miniwidth)+'" class="singlelistingbuttontable"><tr>';if(interfaceObj.show_map&&interfaceObj.print_map){h+='<td align="center" width=30 nowrap class="singlelistingpicturebutton" onMouseOver="this.className=\'singlelistingpicturebuttonhover\';" onMouseOut="this.className=\'singlelistingpicturebutton\';" onClick="switchSingleListingView(\'pics\');" title="View Photos">Pics</td>';h+='<td align="center" width=30 nowrap class="singlelistingpicturebutton" onMouseOver="this.className=\'singlelistingpicturebuttonhover\';" onMouseOut="this.className=\'singlelistingpicturebutton\';" onClick="switchSingleListingView(\'map\');" title="View Map">Map</td>'}if(singlelistingviewtype=="map"){h+='<td id="singlelistingcaption" align="center" nowrap class="singlelistingphotocounters">&nbsp;</td>';h+='<td id="singlelistingviewbutton1" align="center" width=30 nowrap class="singlelistingpicturebutton" onMouseOver="this.className=\'singlelistingpicturebuttonhover\';" onMouseOut="this.className=\'singlelistingpicturebutton\';" onClick="miniZoom(\'zoomin\', \'drawMap\');" title="Zoom In">+</td>';h+='<td id="singlelistingviewbutton2" align="center" width=30 nowrap class="singlelistingpicturebutton" onMouseOver="this.className=\'singlelistingpicturebuttonhover\';" onMouseOut="this.className=\'singlelistingpicturebutton\';" onClick="miniZoom(\'zoomout\', \'drawMap\');" title="Zoom Out">-</td>'}else{h+='<td id="singlelistingcaption" align="center" nowrap class="singlelistingphotocounters" title="Current Photo Index"><span id="singlephotoindex">0</span>&nbsp;of&nbsp;<span id="singlephotocount">0</span></td>';h+='<td id="singlelistingviewbutton1" align="center" width=30 nowrap class="singlelistingpicturebutton" onMouseOver="this.className=\'singlelistingpicturebuttonhover\';" onMouseOut="this.className=\'singlelistingpicturebutton\';" onClick="prevPhoto();" title="Previous Photo"><img src="/images/srch_rs/arrowleft.gif" border=0></td>';h+='<td id="singlelistingviewbutton2" align="center" width=30 nowrap class="singlelistingpicturebutton" onMouseOver="this.className=\'singlelistingpicturebuttonhover\';" onMouseOut="this.className=\'singlelistingpicturebutton\';" onClick="nextPhoto();" title="Next Photo"><img src="/images/srch_rs/arrowright.gif" border=0></td>'}h+="</tr></table>";h+="</div>";var temphtml="";if(smilies=="true"){var nodes=selListObj.childNodes[minicol-1].childNodes[1].childNodes}else{var nodes=selListObj.childNodes[minicol-1].childNodes[0].childNodes}if(nodes){var ls_price="";var ls_address="";var ls_csz="";var ls_sl="";for(var n=0;n<nodes.length;n++){if(nodes[n].getAttribute("ls")=="price"){ls_price=nodes[n].innerHTML}if(nodes[n].getAttribute("ls")=="address"){ls_address=nodes[n].innerHTML}if(nodes[n].getAttribute("ls")=="csz"){ls_csz=nodes[n].innerHTML}if(nodes[n].getAttribute("ls")=="sl"){ls_sl=nodes[n].innerHTML}}temphtml+="<table border=0 align='center' cellspacing=0 cellpadding=0 width="+(miniwidth)+"><tr class='singlelistingpricerow'><td class='singlelistingprice'>&nbsp;"+ls_price+"</td><td align='right' class='singlelistingaddress'>"+ls_address+"&nbsp;</td></tr></table>";temphtml+="<table border=0 align='center' cellspacing=0 cellpadding=0 width="+(miniwidth)+"><tr><td class='singlelistingstatusline'>&nbsp;"+ls_sl+"</td><td align='right' class='singlelistingstatusline'>"+ls_csz+"&nbsp;</td></tr></table>"}h+=temphtml;h+="</div>";h+="<div id='singlepaneoverflow'>";h+="<table border=0 cellpadding=1 cellspacing=0>";if(row&&row.singlechangedesc){h+="<tr><td align='right' class='singlelistinglefttable'>Recent Change:</td><td>"+row.singlechangedesc+"</td></tr>"}else{if(rowd&&rowd.singlechangedesc){h+="<tr><td align='right' class='singlelistinglefttable'>Recent Change:</td><td>"+rowd.singlechangedesc+"</td></tr>"}}var toprow=thegrid.rows[0];for(var x=minicol;x<selListObj.childNodes.length;x++){if(browser_type=="IE"){h+="<tr><td align='right' class='singlelistinglefttable'>"+toprow.childNodes[x-minicol+(gridphoto?3:2)].innerText+":</td><td>"+selListObj.childNodes[x].innerHTML+"</td></tr>"}else{h+="<tr><td align='right' class='singlelistinglefttable'>"+toprow.childNodes[x-minicol+(gridphoto?3:2)].textContent+":</td><td>"+selListObj.childNodes[x].innerHTML+"</td></tr>"}}h+="</table>";h+="<hr class='singlelistinghr'> "+selListObj.remark1;h+="</div>";singlegriddiv.innerHTML=h;photoIndex=0;if(singlelistingviewtype!="map"){if(!photoobj[selectedlisting]){loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/getSingleListingView.html&list_tech_id="+selectedlisting+additional_ajax_params,false)}else{document.getElementById("singlephotocount").innerHTML=photoobj[selectedlisting].length;if(photoobj[selectedlisting].length>0){document.getElementById("singlephotoindex").innerHTML=1}else{document.getElementById("singlephotoindex").innerHTML=0}}}if(searchgriddiv.style.display==""){document.getElementById("singlepaneoverflow").style.height=getWindowHeight()-document.getElementById("imageandaddressspan").clientHeight-(browser_type=="IE"?113:121)-2}else{document.getElementById("singlepaneoverflow").style.height=getWindowHeight()-document.getElementById("imageandaddressspan").clientHeight-(browser_type=="IE"?143:151)-2}singlegriddiv_blackout.style.display="none";if(!(interfaceObj.publicside&&results_totallistings==1)){tabcheckdiv.style.display=""}var tleft=(listingrotatordiv?listingrotatordiv.clientWidth:130);if(gridwidth==15){tabcheckdiv.style.backgroundImage="none";if(smilies=="true"){floatingsmilies.style.display="";floatingsmilies.style.backgroundImage="none"}if(document.getElementById("agt_out")&&document.getElementById("agt_out").style.display=="none"){floatingsmilies.style.left=tleft+15+(tabcheckdiv.style.display==""?91:0)}else{floatingsmilies.style.left=tleft+15+(tabcheckdiv.style.display==""?70:0)}floatingsmilies.style.top="45px"}else{tabcheckdiv.style.backgroundImage="url(/images/srch_rs/tabcheckbg.png)";if(smilies=="true"){floatingsmilies.style.display="";floatingsmilies.style.backgroundImage="url(/images/srch_rs/floatingsmiliesbg.png)"}if(document.getElementById("agt_out")&&document.getElementById("agt_out").style.display=="none"){floatingsmilies.style.left="256px"}else{floatingsmilies.style.left="235px"}floatingsmilies.style.top="105px"}}else{updateSingleListingFromMap(selectedlisting)}}var shownidxsinglegridimage=false;var shownidxcontactusfilemenu=false;var shownidxsavelink=false;function selectL(rr,move,dodelayedsrchlog){if(!forprint){idxlistingsviewedcounter++;if(interfaceObj.idx&&interfaceObj.publicside&&smilies&&keepprompting&&prtl_reg_req_lstngs!="N"&&idxlistingsviewedcounter>(parseInt(prtl_reg_req_lstngs)+1)){portallogon(null,null,"prtl_reg_req_lstngs","You need to be logged in to keep looking at listings");return false}if((interfaceObj.idx||interfaceObj.portal)&&interfaceObj.publicside&&idxlistingsviewedcounter>5&&tabIndex!=0&&!shownidxsinglegridimage){shownidxsinglegridimage=true;loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[document.getElementById("singlegridimage"),{id:"idxsinglegridimage",html:"<img src='/images/down_16.gif' align='absmiddle' style='margin-right:5px'> Click the <img src='/images/srch_rs/singlegrid_hover.png' align='absmiddle' style='margin-right:5px;margin-left:5px;'> to view one listing at a time.",close:true,orientation:"above",width:300,cancelCookie:"idxsinglegridimage",closeTimer:10000}],{dependencyAlias:"spotlight",cancelCookie:"idxsinglegridimage"})}if((interfaceObj.idx||interfaceObj.portal)&&interfaceObj.publicside&&smilies&&idxlistingsviewedcounter>5&&idxsearchcounter>1&&!shownidxsavelink){shownidxsavelink=true;loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[document.getElementById("savelink"),{id:"idxsavelink",html:"<img src='/images/up_16.gif' align='absmiddle' style='margin-right:5px'> Click here to save your search and get automatic email updates.",close:true,orientation:"below",width:175,cancelCookie:"idxsavelink",closeTimer:10000}],{dependencyAlias:"spotlight",cancelCookie:"idxsavelink"})}if((interfaceObj.idx||interfaceObj.portal)&&interfaceObj.publicside&&idxlistingsviewedcounter==11&&!portallogonlaunched&&!shownidxcontactusfilemenu){shownidxcontactusfilemenu=true;if(document.getElementById("contactusfilemenu")){loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[document.getElementById("contactusfilemenu"),{id:"idxcontactusfilemenu",html:"<img src='/images/up_16.gif' align='absmiddle' style='margin-right:5px'> Click here to ask "+idxownername+" any questions you have about these listings or your search.",close:true,orientation:"below",width:300,cancelCookie:"idxcontactusfilemenu",closeTimer:10000}],{dependencyAlias:"spotlight",cancelCookie:"idxcontactusfilemenu"})}}var row=document.getElementById("row-"+selectedlisting);if(row){for(var x=0;x<row.childNodes.length;x++){row.childNodes[x].className="gridtd"+(x>=minicol?" extracolumns":"")}var strid=row.id+"";row.className="rowunsel";row.onmouseover=function(){document.getElementById(strid).className="rowunsel_hover"};row.onmouseout=function(){document.getElementById(strid).className="rowunsel"}}prev_selectedlisting=selectedlisting;selectedlisting=rr;if(dodelayedsrchlog){srchlog("select another listing","mouse",true)}businessCardPanel.style.display="none";row=document.getElementById("row-"+rr);if(row){if(interfaceObj.show_approvereject){if(pendingapprove){var tempobj=selListObj;fireApprove(tempobj)}document.getElementById("approvelistnbr").innerHTML=row.list_nbr}selectedInd=row.mind;selListObj=row;for(var x=0;x<row.childNodes.length;x++){row.childNodes[x].className="gridtdsel"+(x>=minicol?" extracolumns":"")}row.className="rowsel";row.onmouseover=function(){};row.onmouseout=function(){};tabcheck.src=document.getElementById("check-"+rmxId(selectedlisting)).src;if(smilies=="true"){document.getElementById("fav_out").src=document.getElementById("fav_"+rmxId(selectedlisting)).src;document.getElementById("pos_out").src=document.getElementById("pos_"+rmxId(selectedlisting)).src;document.getElementById("rej_out").src=document.getElementById("rej_"+rmxId(selectedlisting)).src;document.getElementById("agt_out").src=document.getElementById("agt_"+rmxId(selectedlisting)).src;if(!prospect_tech_id_4_messages){document.getElementById("agt_out").style.display=document.getElementById("agt_"+rmxId(selectedlisting)).style.display}}if(gridwidth!=1000){changeSelectedTab()}if(singlegriddiv.style.display==""){updateSingleView()}if(move){scrollcause=true;if(!(row.offsetTop>gridelem.scrollTop&&row.offsetTop<(gridelem.scrollTop+gridelem.clientHeight-70))){if(move=="up"){gridelem.scrollTop=row.offsetTop-50}else{gridelem.scrollTop=row.offsetTop-gridelem.clientHeight+70}}}results_totaldiv.innerHTML=": "+((!results_totallistings)?"0":results_totallistings.format(0,true));cart_totaldiv.innerHTML=": "+((!cart_totallistings)?"0":cart_totallistings.format(0,true));selectedinput.value=selectedInd?selectedInd:"";srch.set_counts(((!results_totallistings)?"0":results_totallistings.format(0,true)));setTimeout("scrollcause = false;",400)}else{selectListingBySpinMemCache(selectedlisting)}}}function selectListingBySpinMemCache(techidToFind,returnOnlyOne){if(!alreadyrunning){alreadyrunning=true;var tempstr="cmd=srv+srch_rs/memcacheSpinToSelectListing.html";tempstr+="&allwherestr="+allwherestr;tempstr+="&additionalcond="+additionalcond;tempstr+="&useopenhouseview="+useopenhouseview;tempstr+="&allorderby="+allorderby;tempstr+="&uniquet="+uniquet+srmode;tempstr+="&srmode="+srmode;tempstr+="&dbfetchamt="+dbfetchamt;tempstr+="&totallistings="+current_grid_totallistings;tempstr+="&techidToFind="+techidToFind;tempstr+="&returnOnlyOne="+returnOnlyOne;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}}function firehotsheetviewchange(){fireOverlay("/cgi-bin/mainmenu.cgi?cmd=url+preferences/hotsheet/index.html&fsr=y","hotsheetview")}function fireOverlay(url,fire){if(srchWarningId!=null){closeWarning(srchWarningId)}document.getElementById("approvepanel").style.display="none";businessCardPanel.style.display="none";lastfire=fire;var o_url=url+additional_ajax_params+"&newbgcolor="+newbgcolor;if(o_url.split("&").length>100){var u=o_url.split("?")[0];var param_arr=o_url.split("?").length>1?o_url.split("?")[1].split("&"):[];var params=[];document.getElementById("overlaysubmitform").innerHTML="";for(var x=0;x<param_arr.length;x++){var this_param=param_arr[x].split("=");var hid=document.createElement("input");hid.type="hidden";hid.name=this_param[0];hid.value=this_param[1];document.getElementById("overlaysubmitform").appendChild(hid)}document.getElementById("overlaysubmitform").submit()}else{overlayframe.src=o_url}overlayPanel.style.display=""}function closeOverlay(){setHelpFile();if(overlayframe.contentWindow&&overlayframe.contentWindow.helpfile&&overlayframe.contentWindow.helpfile=="unmapped_search_results.html"&&overlayframe.contentWindow.listing_was_geocoded){setTimeout("whereStringChanged_map = true;whereStringChanged_stats = true;resetGrid(false,true);",500)}else{if(overlayPanel&&overlayPanel.listing_was_changed){overlayPanel.listing_was_changed=false;tab_tour_listing=null;setTimeout("whereStringChanged_map = true;whereStringChanged_stats = true;resetGrid(false,true);",500)}}if(lastfire=="hotsheetview"){setTimeout("resetGrid(false,true)",500)}overlayframe.src="/blankCancel4SR.html";if(interfaceObj.show_approvereject){document.getElementById("approvepanel").style.display=""}if(searchmode=="fs_return"){searchmode="";changeSearchSubTab("searchtab_fullsearch")}squelchKeyCheck=false}function closeOverlaySub(){if(confirmcancelled){if(lastfire=="edit"&&listingchanged=="yes"){setTimeout("resetGrid(false,true)",500);lastfire="";listingchanged="no"}overlayPanel.style.display="none";confirmcancelled=false}}function fireEmail(no_interim,listings,contacts){if(editingFullSearch()){fullsearchgridframe.contentWindow.update_count_from_edit("fs_popout||email");return}if(dirtysearch){compile();stallForFire="email";return}else{if(!noListingMode){srchlog("email","success");if(no_interim||interfaceObj.skip_interim_email){setHelpFile("new_search_results_email.html");var listingchoice="";if(listings){switch(listings){case"current":case"cart":case"all":listingchoice="&emaillistings="+listings;break;default:listingchoice="";break}}var contactlist="";if(contacts){contactlist=contacts.join("'&return_to_prospect_id=x'");contactlist="&return_to_prospect_id=x'"+contactlist+"'"}fireOverlay("/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/email.html&report_puborpriv="+report_pubpriv+listingchoice+contactlist,"email")}else{setHelpFile("new_search_results_emailInterim.html");fireOverlay("/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/emailInterim.html&report_puborpriv="+report_pubpriv,"email")}squelchKeyCheck=true}else{srchlog("email","fail");writeToWarningDiv("Your search has 0 listings","attention",5000)}}}function firePrint(){if(editingFullSearch()){fullsearchgridframe.contentWindow.update_count_from_edit("fs_popout||print");return}if(dirtysearch){compile();stallForFire="print";return}else{if(!noListingMode){srchlog("print","success");setHelpFile("new_search_results_print.html");if(interfaceObj.can_print){fireOverlay("/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/print.html&report_puborpriv="+report_pubpriv+additional_ajax_params,"print")}}else{srchlog("print","fail");writeToWarningDiv("Your search has 0 listings","attention",5000)}}stallForFire=false;squelchKeyCheck=true}function fireTransfer(){if(!noListingMode){setHelpFile("transferlistings3.html");businessCardPanel.style.display="none";if(cart_totallistings>0){srchlog("transfer","success");overlayPanel.style.display="";document.transferform.c1.value="x'"+sellistings.join("',x'")+"'";document.transferform.tech_id_str.value=document.transferform.c1.value;document.transferform.submit()}else{srchlog("transfer","fail");writeToWarningDiv("Please choose 1 or more listings","attention",5000)}}}function fireCMA(){var html=new Array();html.push("<center>Which listings would you like to send?<br>");html.push("<br><a href='javascript:void(0);' onclick='fireActualCMA(\"all\");hidePrettyDialog();' style='font-size:10pt;'>All Results</a>&nbsp;&nbsp;&nbsp;");html.push("<a href='javascript:void(0);' onclick='fireActualCMA(\"cart\");hidePrettyDialog();' style='font-size:10pt;'>Selected</a>");if(js_ma_tech_id=="20070913202326493241000000"){html.push("<div class='businesscardtable' style='font-weight:bold;padding:4px;background-color:#fff;margin:16px 0;text-align:left;'>One-Click CMA</div><a href='javascript:void(0);' onclick='fireActualCMA(\"armls\");hidePrettyDialog();' style='font-size:10pt;'>Statistical Buyer's CMA</a>")}html.push("</center><br>");showPrettyDialog("Send to CMA",html.join(""),{height:"100px",width:"250px",right:"100px",top:"25px"})}function fireActualCMA(mode){if(editingFullSearch()){fullsearchgridframe.contentWindow.update_count_from_edit("fs_popout||cma_"+mode);return}if(dirtysearch){compile();stallForFire="cma_"+mode;return}setHelpFile("cma_type.html");businessCardPanel.style.display="none";if(mode=="cart"){if(cart_totallistings>0){srchlog("cma selected","success");overlayPanel.style.display="";document.cmaform.ma_tech_id.value="x'"+js_ma_tech_id+"'";document.cmaform.ma_search_list.value="";for(var x=0;x<srch_mls.length;x++){document.cmaform.ma_search_list.value+=(document.cmaform.ma_search_list.value!="")?","+xId(srch_mls[x].tech_id):xId(srch_mls[x].tech_id)}document.cmaform.card_fmt_list.value="'!!'";document.cmaform.prop_type_list.value="";var html=new Array();for(var e=0;e<cart_totallistings;e++){html.push("<input type='hidden' name='rs' value='"+sellistings[e]+"'>")}html.push('<input type="hidden" name="tb1" value="list">');html.push('<input type="hidden" name="f1" value="tech_id">');html.push('<input type="hidden" name="o1" value="in">');html.push('<input type="hidden" name="c1" value="'+("x'"+sellistings.join("',x'")+"'")+'">');html.push('<input type="hidden" name="qcount" value="1">');document.getElementById("cmainputcontainer").innerHTML=html.join("");document.cmaform.new_sd_tech_id.value=document.getElementById("new_sd_tech_id").options[document.getElementById("new_sd_tech_id").selectedIndex].value;document.cmaform.e_additionalcond.value=additionalcond;document.cmaform.e_orderby.value=allorderby;document.cmaform.submit();squelchKeyCheck=true}else{srchlog("cma selected","fail");writeToWarningDiv("Please choose 1 or more listings","attention",5000)}}else{if(mode=="armls"){if(cart_totallistings>0){srchlog("cma one-click stat","success");document.cmaform.cmd.value="url search/reports/cma/step2.html";document.cmaform.target="_blank";document.cmaform.ma_tech_id.value="x'"+js_ma_tech_id+"'";document.cmaform.ma_search_list.value=ma_search_list;document.cmaform.card_fmt_list.value=(card_fmt_list=="'!!'")?"":card_fmt_list;document.cmaform.prop_type_list.value=prop_type_list;var html=new Array();for(var e=0;e<cart_totallistings;e++){html.push("<input type='hidden' name='rs' value='"+sellistings[e]+"'>")}html.push('<input type="hidden" name="tb1" value="list">');html.push('<input type="hidden" name="f1" value="tech_id">');html.push('<input type="hidden" name="o1" value="in">');html.push('<input type="hidden" name="c1" value="'+("x'"+sellistings.join("',x'")+"'")+'">');html.push('<input type="hidden" name="qcount" value="1">');html.push('<input type="hidden" name="oneclick" value="Y">');html.push('<input type="hidden" name="html_title_text" value="Statistical CMA">');html.push('<input type="hidden" name="from_search_results" value="true">');html.push('<input type="hidden" name="stat_field" value="'+((card_fmt_list=="'C'")?"lot_acres":"total_sqft")+'">');html.push('<input type="hidden" name="statistics" value="true">');html.push('<input type="hidden" name="listinginfo" value="true">');html.push('<input type="hidden" name="totalrow" value="true">');html.push('<input type="hidden" name="groupby" value="status">');html.push('<input type="hidden" name="new_sd_tech_id" value="x\''+((card_fmt_list=="'C'")?"20080811215543911791000000":"20080723150519695731000000")+"'\">");document.getElementById("cmainputcontainer").innerHTML=html.join("");document.cmaform.new_sd_tech_id.value=document.getElementById("new_sd_tech_id").options[document.getElementById("new_sd_tech_id").selectedIndex].value;document.cmaform.e_additionalcond.value=additionalcond;document.cmaform.e_orderby.value=allorderby;document.cmaform.submit();squelchKeyCheck=true;setTimeout('document.cmaform.cmd.value = "url search/reports/cma/index.html"',100);setTimeout('document.cmaform.target = "overlayframe"',100)}else{srchlog("cma one-click stat","fail");writeToWarningDiv("Please choose 1 or more listings","attention",5000)}}else{if(!noListingMode){srchlog("cma search","success");overlayPanel.style.display="";document.cmaform.ma_tech_id.value="x'"+js_ma_tech_id+"'";document.cmaform.ma_search_list.value=ma_search_list;document.cmaform.card_fmt_list.value=card_fmt_list;document.cmaform.prop_type_list.value=prop_type_list;var html=new Array();html=pushSearchParams(html,true);document.getElementById("cmainputcontainer").innerHTML=html.join("");document.cmaform.new_sd_tech_id.value=document.getElementById("new_sd_tech_id").options[document.getElementById("new_sd_tech_id").selectedIndex].value;document.cmaform.e_additionalcond.value=additionalcond;document.cmaform.e_orderby.value=allorderby;document.cmaform.submit();squelchKeyCheck=true}else{srchlog("cma search","fail");writeToWarningDiv("Your search has 0 listings","attention",5000)}}}stallForFire=false}function pushSearchParams(arr,qcount,noBlankC){for(var s=0;s<search.length;s++){arr.push('<input type="hidden" name="tb'+(s+1)+'" value="'+search[s].tb+'">');arr.push('<input type="hidden" name="f'+(s+1)+'" value="'+search[s].f+'">');arr.push('<input type="hidden" name="o'+(s+1)+'" value="'+search[s].o+'">');arr.push('<input type="hidden" name="c'+(s+1)+'" value="'+search[s].c.replace(/[\"]/g,"&quot;")+'">');arr.push('<input type="hidden" name="d'+(s+1)+'" value="'+search[s].d+'">');arr.push('<input type="hidden" name="g'+(s+1)+'" value="'+search[s].g+'">');arr.push('<input type="hidden" name="r'+(s+1)+'" value="'+search[s].r+'">')}if(qcount){arr.push('<input type="hidden" name="qcount" value="'+(search.length)+'">')}return arr}function fireBack2Address(){document.backtoaddressform.submit()}function fireExport(){if(hotsheet&&combined_hotsheet_count<0){srchlog("export","fail - not avail for search");writeToWarningDiv("Export is not available for this search");return false}if(editingFullSearch()){fullsearchgridframe.contentWindow.update_count_from_edit("fs_popout||export");return}if(dirtysearch){compile();stallForFire="export";return}else{if(!noListingMode){var chkcount;if(hotsheet){chkcount=combined_hotsheet_count}else{chkcount=results_totallistings}if(exportlimit==0||(chkcount<=exportlimit&&cart_totallistings==0)||(cart_totallistings<=exportlimit&&cart_totallistings>0)){srchlog("export","success");setHelpFile("export.html");businessCardPanel.style.display="none";overlayPanel.style.display="";if(hotsheet){document.exportform.where.value=combined_hotsheet_sql;document.exportform.countall.value=combined_hotsheet_count}else{document.exportform.where.value=results_allwherestr;document.exportform.additionalcond.value=additionalcond;document.exportform.countall.value=results_totallistings}document.exportform.countselected.value=cart_totallistings;var tempr="";for(var e=0;e<cart_totallistings;e++){tempr+="<input type='hidden' name='r' value='"+sellistings[e]+"'>"}document.getElementById("exportrcontainer").innerHTML=tempr;document.exportform.submit();squelchKeyCheck=true}else{srchlog("export","fail - cant export more than "+exportlimit);writeToWarningDiv("You can not export more than "+exportlimit+" listings","attention",5000)}}else{srchlog("export","fail");writeToWarningDiv("Your search has 0 listings","attention",5000)}}stallForFire=false}function firecromford(xtyp){window.open("/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/cromford.html&stattype="+xtyp+"&listingzip="+selListObj.zip+"&listingcity="+selListObj.city)}function fireTaxLookup(){if(dirtysearch){compile();stallForFire="tax";return}else{if(!noListingMode){if(cart_totallistings>200){srchlog("tax","fail - max 200");writeToWarningDiv("A maximum of 200 listings may be selected for tax lookup","attention",5000)}else{if(cart_totallistings!=0){srchlog("tax","success");overlayPanel.style.display="";var tempr="";for(var e=0;e<cart_totallistings;e++){if(tempr==""){tempr="x'"+sellistings[e]+"'"}else{tempr+=",x'"+sellistings[e]+"'"}}document.taxlookupform.c1.value=tempr;document.taxlookupform.submit();squelchKeyCheck=true}else{srchlog("tax","fail");writeToWarningDiv("There are no listings selected to view tax information","attention",5000)}}}else{srchlog("tax","fail");writeToWarningDiv("Your search has 0 listings","attention",5000)}}stallForFire=false}function fireDirections(){if(cart_totallistings<=25){var saddr="";var daddr="";var rowx;var viaajax=false;var tadd="";if(cart_totallistings!=0){for(var x=0;x<cart_totallistings;x++){rowx=document.getElementById("row-"+sellistings[x]);if(rowx){tadd=((rowx.geo_lat&&rowx.geo_lon)?((rowx.geo_lat/latLonDivisor)+",+"+(rowx.geo_lon/latLonDivisor)):(encodeURIComponent(rowx.address.striphtml().trim())+",+"+encodeURIComponent(rowx.city.striphtml().trim())+",+"+encodeURIComponent(rowx.state.striphtml().trim())))+"+("+encodeURIComponent(rowx.address.striphtml().trim())+",+"+encodeURIComponent(rowx.city.striphtml().trim())+",+"+encodeURIComponent(rowx.state.striphtml().trim())+")";if(x==0){saddr=tadd}else{if(daddr==""){daddr=tadd}else{daddr+="+to:"+tadd}}}else{viaajax=true;break}}if(viaajax){loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/ajaxdriving.html&latLonDivisor="+latLonDivisor+"&tech_id_list=x'"+sellistings.join("',x'")+"'"+additional_ajax_params,false)}else{window.open("http://maps.google.com/maps?saddr="+saddr+"&daddr="+daddr)}}else{tadd=((selListObj.geo_lat&&selListObj.geo_lon)?((selListObj.geo_lat/latLonDivisor)+",+"+(selListObj.geo_lon/latLonDivisor)):(encodeURIComponent(selListObj.address.striphtml().trim())+",+"+encodeURIComponent(selListObj.city.striphtml().trim())+",+"+encodeURIComponent(selListObj.state.striphtml().trim())))+"+("+encodeURIComponent(selListObj.address.striphtml().trim())+",+"+encodeURIComponent(selListObj.city.striphtml().trim())+",+"+encodeURIComponent(selListObj.state.striphtml().trim())+")";if(x==0){saddr=tadd}else{if(daddr==""){daddr=tadd}else{daddr+="+to:"+tadd}}window.open("http://maps.google.com/maps?saddr="+saddr+"&daddr="+daddr)}}else{srchlog("route","fail - max 25");writeToWarningDiv("A maximum of 25 listings may be selected for driving directions","attention",5000)}}function fireSave(type){if(dirtysearch){compile();stallForFire="save";return}stallForFire=false;if(interfaceObj.can_save){if(editingFullSearch()){fullsearchgridframe.contentWindow.update_count_from_edit("fs_popout||save");return}if((interfaceObj.limited_save&&cart_totallistings!=0)||!interfaceObj.limited_save||(listingcart=="true"&&cart_techid_list.length==1)){setHelpFile("new_search_results_save.html");businessCardPanel.style.display="none";var html=new Array();var quietcompile=false;if(document.getElementById("searchList")&&document.getElementById("searchList").disableNewNodes){var old_dis_val=document.getElementById("searchList").disableNewNodes;enableAllNodesButMe(null);document.getElementById("searchList").disableNewNodes=old_dis_val;quietcompile=true}if(interfaceObj.can_search&&dirtysearch){compile(null,false,false,{ignoreNoListings:quietcompile});dirtysearch=false}var too_long_list=new Array();for(var x=0;x<search.length;x++){if(search[x].t&&search[x].t!="S"&&search[x].t!="T"){continue}if(search[x].c.length>10000){too_long_list.push(search[x].d)}}if(too_long_list.length>0){var too_long_fields=too_long_list.join(", ");writeToWarningDiv("The search parameters supplied for the following fields are too long to save: <br>"+too_long_fields,"attention",5000);return false}if(!type||type=="search"){html=pushSearchParams(html,true);html.push('<input type="hidden" name="qcount" value="'+search.length+'">')}else{if(type=="selected"||type=="cart"){html.push('<input type="hidden" name="qcount" value="1">')}}if(type=="selected"){var temp_ma_cart_list="";for(var x=0;x<srch_mls.length;x++){temp_ma_cart_list+=(temp_ma_cart_list!="")?","+xId(srch_mls[x].tech_id):xId(srch_mls[x].tech_id)}html.push('<input type="hidden" name="ma_search_list" value="'+temp_ma_cart_list+'">')}else{html.push('<input type="hidden" name="ma_search_list" value="'+ma_search_list+'">')}html.push('<input type="hidden" name="new_sd_tech_id" value="'+new_sd_tech_id.options[new_sd_tech_id.selectedIndex].value+'">');html.push('<input type="hidden" name="card_fmt_list" value="'+card_fmt_list+'">');html.push('<input type="hidden" name="prop_type_list" value="'+prop_type_list+'">');html.push('<input type="hidden" name="limited_save" value="'+interfaceObj.limited_save+'">');html.push('<input type="hidden" name="new_srch_rs_module" value="true">');if(type=="cart"&&cart_techid_list.length<2){html.push('<input type="hidden" name="cart_id" value="'+cart_techid_list.join(",")+'">')}else{html.push('<input type="hidden" name="cart_techid_list" value="'+cart_techid_list.join(",")+'">')}if(interfaceObj.editing_prospect_seller){html.push('<input type="hidden" name="editing_prospect_seller" value="true">');html.push('<input type="hidden" name="prospect_id" value="'+rmxId(prospect_id)+'">')}if(interfaceObj.portal){html.push('<input type="hidden" name="portal" value="'+interfaceObj.portal+'">');html.push('<input type="hidden" name="client_id" value="'+client_id+'">');html.push('<input type="hidden" name="prospect_id" value="'+prospect_id+'">');html.push('<input type="hidden" name="po_tech_id" value="'+xId(js_tech_id)+'">');html.push('<input type="hidden" name="tech_id" value="'+xId(js_tech_id)+'">');html.push('<input type="hidden" name="ma_tech_id" value="'+xId(js_ma_tech_id)+'">');html.push('<input type="hidden" name="new_sd_tech_id" value="'+xId(print_sd_tech_id)+'">')}var select_list="";for(var x=0;x<cart_totallistings;x++){select_list+=(select_list!="")?",x'"+sellistings[x]+"'":"x'"+sellistings[x]+"'"}if(type=="selected"){html.push('<input type="hidden" name="c1" value="'+select_list+'">')}else{html.push('<input type="hidden" name="select_list" value="'+select_list+'">')}if(listingcart=="true"){fixCartOrder()}var cart_list="";if(type=="cart"){if(original_cart_listings===null||original_cart_listings.length===0){writeToWarningDiv("Your cart has no listings to save.");return false}for(var x=0;x<original_cart_listings.length;x++){cart_list+=(cart_list!="")?",x'"+original_cart_listings[x]+"'":"x'"+original_cart_listings[x]+"'"}html.push('<input type="hidden" name="c1" value="'+cart_list+'">')}else{for(var x=0;x<resultslistings.length;x++){cart_list+=(cart_list!="")?",x'"+resultslistings[x]+"'":"x'"+resultslistings[x]+"'"}html.push('<input type="hidden" name="cart_list" value="'+cart_list+'">')}if(document.getElementById("searchList")&&document.getElementById("searchList").disableNewNodes){var list=document.getElementById("searchList");if(list.disableNewNodes!="cart"){var listings=null;for(var x=0;x<list.childNodes.length;x++){if(list.childNodes[x].kind=="specifiedlistings"){listings=list.childNodes[x]}}if(listings){disableAllNodesButMe(listings)}}else{disableAllNodesButCarts()}}document.getElementById("saveformcontainer").innerHTML=html.join("");overlayPanel.style.display="";var orig_cmd=document.saveform.cmd.value;if(type=="search"){document.saveform.cmd.value="url+search/saved/save/step1.html"}else{if(type=="selected"||type=="cart"){document.saveform.cmd.value="url+search/cart/save/searchresults_save2.html"}}srchlog("save","success - "+type);document.saveform.submit();document.saveform.cmd.value=orig_cmd;squelchKeyCheck=true}else{srchlog("save","fail");writeToWarningDiv("There are no listings selected to save","attention",5000)}}else{if(smilies=="true"){tempsave=true;portallogon(null,null,"Save");tempsave=false}else{srchlog("save","fail - disabled");writeToWarningDiv("Saving has been disabled","attention",5000)}}}function fireBookAShowing(useCurrent){var basListings;var params="cmd=srv+srch_rs/bookashowing.html";if(useCurrent){basListings=[];basListings[0]=selectedlisting}else{basListings=sellistings.slice(0)}if(basListings.length>0){srchlog("schedule showing","success");for(var i=0;i<basListings.length&&i<10;++i){params+="&list"+(i+1)+"="+basListings[i]}params+="&listcount="+Math.min(basListings.length,10);if(basListings.length>10){writeToWarningDiv("The first ten selected listings will be sent to BookAShowing","attention",5000)}loadJavaScriptDoc("querystring","mainmenu.cgi",params,false,false)}else{srchlog("schedule showing","fail");writeToWarningDiv("Please choose 1 or more listings","attention",5000)}}function fireShowingTime(ddelement){var node=document.getElementById("row-"+ddelement.attributes.getNamedItem("listing").value);if(!node){writeToWarningDiv("Error while preparing information for ShowingAssist","warning",5000);return}var params="cmd=srv+srch_rs/showingtime.html";params+="&listing="+encodeURIComponent(node.list_nbr);params+="&listingagent="+encodeURIComponent(node.me_tech_id.tech_id);params+="&listingoffice="+encodeURIComponent(node.list_agency_id.tech_id);params+="&address="+encodeURIComponent(node.address.trim().replace(/[ ]+/g," "));params+="&city="+encodeURIComponent(node.city);params+="&state="+encodeURIComponent(node.state);params+="&zip="+encodeURIComponent(node.zip);params+="&price="+encodeURIComponent(node.price.replace(/[^.\d]/g,""));loadJavaScriptDoc("querystring","mainmenu.cgi",params,false,false)}function addAgentPref(agent_id,pref_name,pref_value){agent_id=(agent_id+"").replace(/[^0-9]/g,"");if(typeof agent_prefs[agent_id]!="object"){agent_prefs[agent_id]={}}agent_prefs[agent_id][pref_name]=pref_value}function showBusinessCard(techid,e){if(interfaceObj.privatemode){var html=new Array();html.push("<center>");html.push("<div style='text-align:center; padding-top:3px;font-weight:bold;");if(!agent_prefs[techid]||!agent_prefs[techid].disable_showing_req){html.push("display:none;")}html.push("'  id='buscard_no_schedule'><img src='/images/yui/warn16_1.gif'> To Schedule a Showing, Contact this Agent Directly</div>");html.push("<div style='padding:3px; background-color:#F7F7C1; border:1px solid #999'>");html.push("<div style='text-align:center; padding-top:3px;'><a href='javascript:void(0);' onclick=\"messContactAgent();hidePrettyDialog();businessCardPanel.style.display='none';\" style='font-size:10pt;'>Contact Agent</a></div>");html.push("<div style='text-align:center; padding-top:3px;");if((agent_prefs[techid]&&agent_prefs[techid].disable_showing_req)||hideShow4someMLS){html.push("display:none;")}html.push("' id='buscard_schedule_single'><a href='javascript:void(0);' onclick=\"messScheduleSingle(null,event);hidePrettyDialog();businessCardPanel.style.display='none';\" style='font-size:10pt;'>Schedule a Showing</a></div>");if(!hideShow4someMLS){html.push("<div style='text-align:center; padding-top:3px;'><a href='javascript:void(0);' onclick=\"messShowingFeedback();hidePrettyDialog();businessCardPanel.style.display='none';\" style='font-size:10pt;'>Send Showing Feedback</a></div>")}html.push("<div style='text-align:center; padding-top:3px;'><a href='javascript:void(0);' onclick=\"messOpenhouseFeedback();hidePrettyDialog();businessCardPanel.style.display='none';\" style='font-size:10pt;'>Send Open House Feedback</a></div>");html.push("</div></center>");buscardlinks.innerHTML=html.join("")}else{if(interfaceObj.portal){var html=new Array();html.push("<center>");html.push("<div style='padding:3px; background-color:#F7F7C1; border:1px solid #999'>");html.push("<div style='text-align:center; padding-top:3px;'><a href='javascript:void(0);' onclick=\"messContactAgent();hidePrettyDialog();businessCardPanel.style.display='none';\" style='font-size:10pt;'>Contact Agent</a></div>");html.push("</div></center>");buscardlinks.innerHTML=html.join("")}}businessCardPanel.style.display="none";buscardinnerds.innerHTML="";if(busCardHolder[techid]){buscardinnerds.innerHTML=busCardHolder[techid];setTimeout("businessCardPanel.style.display=''",500)}else{var tempstr="cmd=srv+srch_rs/getBusCard.html";tempstr+="&lkup_tech_id="+techid;tempstr+="&lkuptype=public";tempstr+="&divtowritetoo=buscardinnerds";tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}if(e){if(getWindowWidth()-e.clientX<300){businessCardPanel.style.left=e.clientX-300}else{businessCardPanel.style.left=e.clientX}if((gridelem.clientHeight-e.clientY<100&&singlegriddiv.style.display=="none")||getWindowHeight()-e.clientY<100){businessCardPanel.style.top=e.clientY-105}else{businessCardPanel.style.top=e.clientY+5}}else{var oldDisplay=businessCardPanel.style.display||"";businessCardPanel.style.display="";var cH=businessCardPanel.clientHeight;if(cH<300){cH=300}var cW=businessCardPanel.clientWidth;if(cW<250){cW=250}businessCardPanel.style.top=(document.body.clientHeight-cH)/2;businessCardPanel.style.left=(document.body.clientWidth-cW)/2;businessCardPanel.style.display=oldDisplay}}function compileReset(){if(search_need_display_change){search_need_display_change=false;resetGrid(true,true)}else{resetGrid(true,false)}}function resetGrid(listchange,displaychange,sd_tech_id,keep_custom_sort){if(!forprint){showLargeLoading();if(!sd_tech_id){sd_tech_id=new_sd_tech_id.options[new_sd_tech_id.selectedIndex].value}else{for(var i=0;i<new_sd_tech_id.options.length;++i){if(sd_tech_id==new_sd_tech_id.options[i].value){new_sd_tech_id.selectedIndex=i;break}}}}if(srmode=="cart"||(srmode=="results"&&results_allorderby=="")){listchange=true}var tbody=thegrid;if(tbody.rows.length>0){alreadyrunning=true;var ttp=tbody.rows.length;for(var r=1;r<=ttp;r++){tbody.deleteRow(0)}}begindex=1;endindex=howmanytoinit;dirtysearch=false;if(listchange){prev_selectedlisting="";selectedlisting="";selectedInd=-1}if(sd_tech_id!=print_sd_tech_id||displaychange){print_sd_tech_id=sd_tech_id;if(!keep_custom_sort){using_custom_sort=false}var tempstr="cmd=srv+srch_rs/getView.html";tempstr+="&sd_tech_id="+sd_tech_id;if(hotsheet){tempstr+="&hotsheet="+hotsheet;var tmpstr2="";for(var o in hotsheetSqlobj){tmpstr2+=o+"|"}if(tmpstr2.length>0){tmpstr2=tmpstr2.substring(0,tmpstr2.length-1)}tempstr+="&hotsheetparts="+tmpstr2;tempstr+="&last_hotsheet="+last_hotsheet;tempstr+="&hs_force_mls_view="+hs_force_mls_view}tempstr+="&listchange="+listchange;tempstr+="&force_list_agency="+force_list_agency;tempstr+="&ma_search_list="+ma_search_list;tempstr+="&card_fmt_list="+card_fmt_list;tempstr+="&cart_techid_list="+cart_techid_list.join(",");tempstr+="&prop_type_list="+prop_type_list;tempstr+="&listingcart="+listingcart;if(using_custom_sort){var s_order=buildSortOrderString();tempstr+="&custom_sort="+s_order}tempstr+="&sortranonce="+sortranonce;tempstr+="&approvereject="+approvereject;tempstr+="&approverejectlistnbr="+approverejectlistnbr;tempstr+="&oneline="+oneline;tempstr+="&forprint="+forprint;tempstr+="&srmode="+srmode;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}else{getAllListings(listchange)}}function seeIfSelected(tid){for(var x=0;x<cart_totallistings;x++){if(sellistings[x]==tid){return true}}return false}function showtip(e,mess){document.getElementById("searchtip").style.top=e.clientY+15;document.getElementById("searchtip").innerHTML=mess;if(getWindowWidth()-e.clientX<100){document.getElementById("searchtip").style.left=e.clientX-100}else{document.getElementById("searchtip").style.left=e.clientX+5}document.getElementById("searchtip").style.display=""}function hidetip(){document.getElementById("searchtip").style.display="none"}function writeToWarningDiv(message,typex,timer,prevId){if(!timer&&timer!=0){timer=3000}if(!typex){typex="warning"}if(prevId){var index=null;for(var x=0;x<warnings.length;x++){if(warnings[x].id==prevId){index=x;break}}if(index!=null){var id=warnings[x].id;warnings[index].message=message;warnings[index].timer=timer;warnings[index].type=typex}else{var id=Math.floor(Math.random()*1000000000000);warnings.push({message:message,timer:timer,type:typex,id:id})}}else{var id=Math.floor(Math.random()*1000000000000);warnings.push({message:message,timer:timer,type:typex,id:id})}renderWarningDiv();if(timer>0){warningid=setTimeout("closeWarning("+id+")",timer)}return id}function renderWarningDiv(){if(warnings.length==0){warningdiv.style.display="none"}else{var html=new Array("<table border=0 cellpadding=0 cellspacing=0>");var color,border,colspan;for(var x=0;x<warnings.length;x++){if(warnings[x].type=="warning"){color="#FFD5D5"}else{if(warnings[x].type=="attention"){color="#FFFFB0"}else{if(warnings[x].type=="success"){color="#A8FFA8"}else{if(warnings[x].type=="map_message"){color="#FFFFFF"}else{color="#CCCCCC"}}}}if(warnings[x].type=="map_message"){border="style='padding:3px;'"}else{border=(x>0)?"style='border-top:1px solid #999;'":""}colspan=(warnings[x].timer==0)?"colspan='3'":"";html.push("<tr style='background-color:"+color+";'>");html.push("<td "+colspan+" "+border+">"+warnings[x].message+"</td>");if(warnings[x].timer>0&&warnings[x].type!="map_message"){html.push("<td "+border+">&nbsp;</td><td "+border+" onclick='closeWarning("+warnings[x].id+")' class='pointer' style='font-weight:normal'>X</td>")}html.push("</tr>")}html.push("</table>");warningdiv.innerHTML=html.join("");if(warnings[warnings.length-1].type=="map_message"){if(browser_type=="IE"){warningdiv.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=85)"}else{warningdiv.style.opacity=0.85}var thisNode=iframe_map;var left=0;while(thisNode){left+=(!isNaN(parseInt(thisNode.offsetLeft))?parseInt(thisNode.offsetLeft):0);thisNode=thisNode.parentNode}warningdiv.style.display="";var warnwidth=warningdiv.scrollWidth;var warnheight=warningdiv.clientHeight;warningdiv.style.display="none";warningdiv.style.left=left+((iframe_map.clientWidth/2)-(warnwidth/2));warningdiv.style.top=iframe_map.offsetTop+(iframe_map.clientHeight/2-warnheight/2);warningdiv.style.borderStyle="dashed";warningdiv.style.display=""}else{warningdiv.style.display="";var divwidth=warningdiv.clientWidth;var wwidth=getWindowWidth();warningdiv.style.left=(wwidth-divwidth)/2;warningdiv.style.top="";if(browser_type=="IE"){warningdiv.style.filter=""}else{warningdiv.style.opacity=1}warningdiv.style.borderStyle="solid"}}}function mapToolWarn(){if(tabIndex==MapTabIndex&&!map_haveWarned){map_haveWarned=true;writeToWarningDiv("Using the map search tools will take you to the Edit Search tab","attention",5000)}}function resize_map_message(){if(srchWarningId!=null&&warnings[warnings.length-1]&&warnings[warnings.length-1].type=="map_message"){var thisNode=iframe_map;var left=0;while(thisNode){left+=(!isNaN(parseInt(thisNode.offsetLeft))?parseInt(thisNode.offsetLeft):0);thisNode=thisNode.parentNode}warningdiv.style.display="";warningdiv.style.left=left+((iframe_map.clientWidth/2)-(warningdiv.scrollWidth/2));warningdiv.style.top=iframe_map.offsetTop+(iframe_map.clientHeight/2-warningdiv.clientHeight/2)}}function closeWarning(id){for(var x=0;x<warnings.length;x++){if(warnings[x].id==id){warnings.splice(x,1);break}}renderWarningDiv()}function messScheduleSingle(checktemp,e){var tRow=null;if(checktemp&&useTempScheduleId){tRow=document.getElementById("row-"+useTempScheduleId);var tmpObj={msgTyp:"showingRequest",lstgs:[{id:useTempScheduleId}]}}else{if(selectedlisting){tRow=document.getElementById("row-"+selectedlisting);var tmpObj={msgTyp:"showingRequest",lstgs:[{id:selectedlisting}]}}}if(tRow){if(!tRow.disable_showing_request){openNewMsg(tmpObj)}else{showBusinessCard(tRow.me_tech_id.tech_id,e)}}else{writeToWarningDiv("Please select a listing to request a showing","attention",5000)}}function messScheduleMulti(){var tmpArr=new Array();for(var x=0;x<sellistings.length;x++){tmpArr.push({id:sellistings[x]})}var tmpObj={msgTyp:"showingRequest",lstgs:tmpArr};openNewMsg(tmpObj)}function icon_schedule(img,e){if(!interfaceObj.publicside){if(extended_showing=="Y"&&sellistings.length>0&&!(sellistings.length==1&&selectedlisting==sellistings[0])){var html=new Array();html.push("<center>Which listings would you like to schedule?");html.push("<div style='padding:5px;'>");html.push("<div style='text-align:center; padding-top:5px;'><a href='javascript:void(0);' onclick=\"srchlog('schedule single','click');messScheduleSingle(null);hidePrettyDialog();\" style='font-size:10pt;'>Highlighted Listing</a></div>");html.push("<div style='text-align:center; padding-top:5px;'><a href='javascript:void(0);' onclick=\"srchlog('schedule multi','click');messScheduleMulti();hidePrettyDialog();\" style='font-size:10pt;'>Selected Listings ("+(sellistings.length>10?"max of 10":sellistings.length)+")</a></div>");html.push("</div></center>");showPrettyDialog("Schedule a Showing",html.join(""),{height:"100px",width:"250px",left:(e.clientX-5)+"px",top:(e.clientY-5)+"px"})}else{messScheduleSingle(null,e)}}else{if(interfaceObj.portal){messScheduleSingle(null,e)}else{if(interfaceObj.idx){messScheduleSingle(null,e)}else{messScheduleSingle(null,e)}}}}function messContactAgent(){if(selectedlisting){var tmpObj={msgTyp:"contactMe",lstgs:[{id:selectedlisting}]};openNewMsg(tmpObj)}else{writeToWarningDiv("Please select a listing to contact the agent","attention",5000)}}function messContactClient(){if(selectedlisting){var tmpObj={msgTyp:"message",lstgs:[{id:selectedlisting}]};openNewMsg(tmpObj)}else{writeToWarningDiv("Please select a listing to contact the client","attention",5000)}}function messShowingFeedback(){if(selectedlisting){var tmpObj={msgTyp:"showingFdbk",lstgs:[{id:selectedlisting}]};openNewMsg(tmpObj)}else{writeToWarningDiv("Please select a listing to add feedback","attention",5000)}}function messOpenhouseFeedback(){if(selectedlisting){var tmpObj={msgTyp:"openHouseFdbk",lstgs:[{id:selectedlisting}]};openNewMsg(tmpObj)}else{writeToWarningDiv("Please select a listing to add feedback","attention",5000)}}function icon_contact(img,e){if(!interfaceObj.publicside){var html=new Array();html.push("<center>Please select from the following");html.push("<div style='padding:5px;'>");html.push("<div style='text-align:center; padding-top:5px;'><a href='javascript:void(0);' onclick=\"srchlog('contact agent','click');messContactAgent();hidePrettyDialog();\" style='font-size:10pt;'>Contact Agent</a></div>");html.push("<div style='text-align:center; padding-top:5px;'><a href='javascript:void(0);' onclick=\"srchlog('contact client','click');messContactClient();hidePrettyDialog();\" style='font-size:10pt;'>Contact Client</a></div>");if(!hideShow4someMLS){html.push("<div style='text-align:center; padding-top:5px;'><a href='javascript:void(0);' onclick=\"srchlog('showing feedback','click');messShowingFeedback();hidePrettyDialog();\" style='font-size:10pt;'>Send Showing Feedback</a></div>")}html.push("<div style='text-align:center; padding-top:5px;'><a href='javascript:void(0);' onclick=\"srchlog('open house feedback','click');messOpenhouseFeedback();hidePrettyDialog();\" style='font-size:10pt;'>Send Open House Feedback</a></div>");html.push("</div></center>");showPrettyDialog("Contact or Feedback",html.join(""),{height:"100px",width:"250px",left:(e.clientX-5)+"px",top:(e.clientY-5)+"px"})}else{if(interfaceObj.portal){messContactAgent()}else{if(interfaceObj.idx){messContactAgent()}else{messContactAgent()}}}}function icon_private(img,e){if(selectedlisting){var tmpObj={msgTyp:"note",lstgs:[{id:selectedlisting}]};openNewMsg(tmpObj)}else{writeToWarningDiv("Please select a listing to add a note","attention",5000)}}function get_random(){var ranNum=Math.floor(Math.random()*5);return ranNum+1}function markListing(tech,fpr){if(client_id||prospect_tech_id_4_messages){if(fpr=="fav"){if(document.getElementById("fav_"+tech).src.indexOf("fav.")!=-1){document.getElementById("fav_"+tech).src="/images/srch_rs/fav_bw."+img_ext;for(var x=0;x<favlistings.length;x++){if(favlistings[x]==tech){favlistings.splice(x,1)}}fpr=""}else{document.getElementById("fav_"+tech).src="/images/srch_rs/fav."+img_ext;if(favlistings.indexOf(tech)==-1){favlistings.push(tech)}}document.getElementById("pos_"+tech).src="/images/srch_rs/pos_bw."+img_ext;document.getElementById("rej_"+tech).src="/images/srch_rs/rej_bw."+img_ext;for(var x=0;x<poslistings.length;x++){if(poslistings[x]==tech){poslistings.splice(x,1)}}for(var x=0;x<rejlistings.length;x++){if(rejlistings[x]==tech){rejlistings.splice(x,1)}}}else{if(fpr=="pos"){if(document.getElementById("pos_"+tech).src.indexOf("pos.")!=-1){document.getElementById("pos_"+tech).src="/images/srch_rs/pos_bw."+img_ext;for(var x=0;x<poslistings.length;x++){if(poslistings[x]==tech){poslistings.splice(x,1)}}fpr=""}else{document.getElementById("pos_"+tech).src="/images/srch_rs/pos."+img_ext;if(poslistings.indexOf(tech)==-1){poslistings.push(tech)}}document.getElementById("fav_"+tech).src="/images/srch_rs/fav_bw."+img_ext;document.getElementById("rej_"+tech).src="/images/srch_rs/rej_bw."+img_ext;for(var x=0;x<favlistings.length;x++){if(favlistings[x]==tech){favlistings.splice(x,1)}}for(var x=0;x<rejlistings.length;x++){if(rejlistings[x]==tech){rejlistings.splice(x,1)}}}else{if(fpr=="rej"){if(document.getElementById("rej_"+tech).src.indexOf("rej.")!=-1){document.getElementById("rej_"+tech).src="/images/srch_rs/rej_bw."+img_ext;for(var x=0;x<rejlistings.length;x++){if(rejlistings[x]==tech){rejlistings.splice(x,1)}}fpr=""}else{document.getElementById("rej_"+tech).src="/images/srch_rs/rej."+img_ext;if(rejlistings.indexOf(tech)==-1){rejlistings.push(tech)}}document.getElementById("fav_"+tech).src="/images/srch_rs/fav_bw."+img_ext;document.getElementById("pos_"+tech).src="/images/srch_rs/pos_bw."+img_ext;for(var x=0;x<favlistings.length;x++){if(favlistings[x]==tech){favlistings.splice(x,1)}}for(var x=0;x<poslistings.length;x++){if(poslistings[x]==tech){poslistings.splice(x,1)}}}else{if(fpr=="agt"){if(document.getElementById("agt_"+tech).src.indexOf("agt.")!=-1){document.getElementById("agt_"+tech).src="/images/srch_rs/agt_bw."+img_ext;for(var x=0;x<agtlistings.length;x++){if(agtlistings[x]==tech){agtlistings.splice(x,1)}}}else{document.getElementById("agt_"+tech).src="/images/srch_rs/agt."+img_ext;if(agtlistings.indexOf(tech)==-1){agtlistings.push(tech)}}}}}}if(rmxId(tech)==rmxId(selectedlisting)){document.getElementById("fav_out").src=document.getElementById("fav_"+rmxId(selectedlisting)).src;document.getElementById("pos_out").src=document.getElementById("pos_"+rmxId(selectedlisting)).src;document.getElementById("rej_out").src=document.getElementById("rej_"+rmxId(selectedlisting)).src;document.getElementById("agt_out").src=document.getElementById("agt_"+rmxId(selectedlisting)).src;if(!prospect_tech_id_4_messages){document.getElementById("agt_out").style.display=document.getElementById("agt_"+rmxId(selectedlisting)).style.display}}loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/markListing.html&tech="+tech+(prospect_tech_id_4_messages?("&client_id="+client_id):"")+"&fpr="+fpr+additional_ajax_params,false)}else{portallogon(tech,fpr,"rating")}}var tempmarktech;var tempmarkfpr;var tempsave;var portallogonlaunched=false;function portallogon(tech,fpr,why,idxreason){if(prtl_reg_bypass=="Y"){keepprompting=false}srchlog("portal lead",why);if(tech){tempmarktech=tech}if(fpr){tempmarkfpr=fpr}portallogonlaunched=true;var wh=getWindowHeight();var ww=getWindowWidth();document.getElementById("portallogonframe").style.width=(ww>790?790:(ww-20));document.getElementById("portallogonframe").style.height=(wh>450?450:(wh-40));document.getElementById("portallogonframe").style.left=(ww>790?((ww/2)-395):10);document.getElementById("portallogonframe").style.display="";backshadowlayer.style.display="";window.frames.portallogonframe.location="/cgi-bin/mainmenu.cgi?cmd=srv+portal/login.html&po_tech_id="+js_tech_id+"&why="+why+"&fromsearch=true"+(tech?"&errormessage=You need to log in to mark listings":"")+(tempsave?"&errormessage=You need to log in to save listings":"")+(idxreason?"&errormessage="+idxreason+"&prb="+prtl_reg_bypass:"")}function portallogonreturn(memid,prospect_id,fromcookie){keepprompting=false;backshadowlayer.style.display="none";if(document.getElementById("loginlink")){document.getElementById("loginlink").style.display="none"}if(interfaceObj.can_search){interfaceObj.limited_save=false}else{interfaceObj.limited_save=true}interfaceObj.can_save=true;interfaceObj.portal=true;document.getElementById("savelink").style.display="";document.getElementById("dashboardlink").style.display="";document.getElementById("dashboardlink").href="/cgi-bin/mainmenu.cgi?cmd=srv+portal/dashboard.html&memid="+memid+"&email_link_tech_id="+public_link_tech_id;document.getElementById("logofflink").style.display="";document.getElementById("logofflink").href="/cgi-bin/mainmenu.cgi?cmd=srv+portal/logoff.html&memid="+memid;if(!fromcookie&&portal_client_name){loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[document.getElementById("dashboardlink"),{id:"idxhomespot",html:"<b>Welcome, "+portal_client_name+"!</b>  You have successfully logged into the portal of <b>"+portalownername+'</b>.<br><br>You may now save searches using "Save" and rank your listings using the icons next to each listing. Also, you may go to your dashboard by clicking "Home".<br><br><center><a href="javascript:spotlight.hide(\'idxhomespot\');">Click here to start using your portal</a></center>',close:true,orientation:"below",width:300,cancelCookie:"idxhomespot",closeTimer:20000}],{dependencyAlias:"spotlight",cancelCookie:"idxhomespot"})}if(portal_client_name){var srtitle=document.getElementById("resultsheader").innerHTML.trim();document.getElementById("resultsheader").innerHTML=srtitle+"<i> for "+portal_client_name+"</i>"}var sp=memid.split("_");client_id=xId(sp[1]);prospect_id=xId(prospect_id);additional_ajax_params+="&client_id="+client_id+"&prospect_id="+prospect_id+"&pubwebflag=false&portal=true&upv=true&ups=true";loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/loadfavcarts.html"+additional_ajax_params,false);loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/resetTabsByPortalPref.html&fetchNewMsgParams=true"+additional_ajax_params,false);if(tempsave){fireSave();tempsave=false}changecss(".publicmessageicon","display","");changecss(".privatemessageicon","display","");var l_t_i=((selectedlisting)?selectedlisting:"");iframe_notes.src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/discussTab.html&memid="+memid+additional_ajax_params+"&list_tech_id="+l_t_i;resize();if(parent&&parent.sndLoc=="idx"){parent.extShwgs=false;parent.sndLoc="prtl";parent.clientId=sp[1];parent.sndId=prospect_id;parent.sndTyp="prospect";parent.sndNm="";parent.sndMaId=js_ma_tech_id;parent.isTmMem=false;parent.tmId="";parent.tmNm="";parent.clntCnt=0}else{extShwgs=false;sndLoc="prtl";clientId=sp[1];sndId=prospect_id;sndTyp="prospect";sndNm="";sndMaId=js_ma_tech_id;isTmMem=false;tmId="";tmNm="";clntCnt=0}}var shownidxrectangle_tool=false;function showmapspotlight(){if((interfaceObj.idx||interfaceObj.portal)&&interfaceObj.publicside&&!shownidxrectangle_tool){shownidxrectangle_tool=true;if(iframe_map.contentWindow.document.getElementById("rectangle_tool")){loadOnDemand.execute(function(){spotlight.show(arguments[0],arguments[1])},[iframe_map.contentWindow.document.getElementById("rectangle_tool"),{id:"idxrectangle_tool",html:"<img src='/images/down_16.gif' align='absmiddle' style='margin-right:5px'> Click <img src='/images/mapping/Rectangle.png' align='absmiddle' style='margin-right:0px;margin-left:5px;'>, <img src='/images/mapping/Circle.png' align='absmiddle' style='margin-right:2px;margin-left:2px;'> or <img src='/images/mapping/Polygon.png' align='absmiddle' style='margin-right:5px;margin-left:2px;'> and search by drawing on the map.",close:true,orientation:"above",top:100,left:340,width:250,cancelCookie:"idxrectangle_tool",closeTimer:10000}],{dependencyAlias:"spotlight",cancelCookie:"idxrectangle_tool"})}}}function spintablesmilies(){for(var x=1;x<(thegrid.rows.length-minusextrarow());x++){tid=thegrid.rows[x].id.substr(4,30);if(favlistings.indexOf(tid)!=-1){document.getElementById("fav_"+tid).src="/images/srch_rs/fav."+img_ext}if(poslistings.indexOf(tid)!=-1){document.getElementById("pos_"+tid).src="/images/srch_rs/pos."+img_ext}if(rejlistings.indexOf(tid)!=-1){document.getElementById("rej_"+tid).src="/images/srch_rs/rej."+img_ext}}if(tempmarktech&&tempmarkfpr){markListing(tempmarktech,tempmarkfpr);tempmarktech=null;tempmarkfpr=null}}function agentOfficeColumnText(column,listing,column_list){if(listing[column]){var link_part1="";var link_part2="";var link_close="";if(!interfaceObj.publicside||interfaceObj.public_grid_buscard||(rmxId(js_tech_id)==rmxId(listing.me_tech_id.tech_id)&&column=="me_tech_id")||(rmxId(js_tech_id)==rmxId(listing.list_agency_id.tech_id)&&column=="list_agency_id")){var link_part1='<a class="columnlink" href="javascript:void(0)" onclick="showBusinessCard(\'';var link_part2="',event);\">";var link_close="</a>"}if(column=="me_tech_id"||column=="co_list_agent"||column=="sell_agent_id"||column=="co_sell_agent_id"){if(listing[column].label){if(interfaceObj.portal&&porthidecontactinfo=="Y"&&(column=="me_tech_id"||column=="co_list_agent")){var tmpa=""}else{var tmpa=listing[column].label!="Inactive Member"?(link_part1+(link_part1?listing[column].tech_id:"")+link_part2+listing[column].label+link_close):listing[column].label;if(print_contact_info=="Y"){tmpa+=listing[column].phone&&listing[column].phone!="undefined"?("<br>"+listing[column].phone):"";tmpa+=listing[column].email&&listing[column].email!="undefined"?("<br>"+listing[column].email):"";tmpa+=listing[column].url&&listing[column].url!="undefined"?("<br>"+listing[column].url):""}}switch(column){case"me_tech_id":if(column_list.indexOf("list_agency_id")==-1){if(interfaceObj.portal&&porthidecontactinfo=="Y"){tmpa+=listing.list_agency_id.label}else{tmpa+="<br>"+link_part1+(link_part1?listing.list_agency_id.tech_id:"")+link_part2+listing.list_agency_id.label+((pref_show_ids=="Y"&&!interfaceObj.publicside)?(" ("+listing.list_agency_id.short_id+")"):"")+link_close}}if(listing.co_list_agent&&column_list.indexOf("co_list_agent")==-1){if(interfaceObj.portal&&porthidecontactinfo=="Y"){tmpa+=""}else{tmpa+=listing.co_list_agent.label!="Inactive Member"?("<br>"+link_part1+(link_part1?listing.co_list_agent.tech_id:"")+link_part2+listing.co_list_agent.label+link_close):("<br>"+listing.co_list_agent.label)}if(listing.co_list_agency_id&&column_list.indexOf("co_list_agency_id")==-1&&listing.co_list_agency_id.tech_id!=listing.list_agency_id.tech_id){if(interfaceObj.portal&&porthidecontactinfo=="Y"){tmpa+='<br style="line-height:0"/>'+listing.co_list_agency_id.label}else{tmpa+="<br>"+link_part1+(link_part1?listing.co_list_agency_id.tech_id:"")+link_part2+listing.co_list_agency_id.label+((pref_show_ids=="Y"&&!interfaceObj.publicside)?(" ("+listing.co_list_agency_id.short_id+")"):"")+link_close}}}break;case"co_list_agent":if(column_list.indexOf("co_list_agency_id")==-1){if(interfaceObj.portal&&porthidecontactinfo=="Y"){tmpa+=listing.co_list_agency_id.label}else{tmpa+="<br>"+link_part1+(link_part1?listing.co_list_agency_id.tech_id:"")+link_part2+listing.co_list_agency_id.label+((pref_show_ids=="Y"&&!interfaceObj.publicside)?(" ("+listing.co_list_agency_id.short_id+")"):"")+link_close}}break;case"sell_agent_id":if(column_list.indexOf("sell_agency_id")==-1){tmpa+="<br>"+link_part1+(link_part1?listing.sell_agency_id.tech_id:"")+link_part2+listing.sell_agency_id.label+((pref_show_ids=="Y"&&!interfaceObj.publicside)?(" ("+listing.sell_agency_id.short_id+")"):"")+link_close}break;case"co_sell_agent_id":if(column_list.indexOf("co_sell_agency_id")==-1){tmpa+="<br>"+link_part1+(link_part1?listing.co_sell_agency_id.tech_id:"")+link_part2+listing.co_sell_agency_id.label+((pref_show_ids=="Y"&&!interfaceObj.publicside)?(" ("+listing.co_sell_agency_id.short_id+")"):"")+link_close}break}if(tmpa){return tmpa.replace(/\(undefined\)/gi,"").replace(/undefined/gi,"")}else{return"\u00a0"}}else{return"\u00a0"}}else{if(column=="list_agency_id"&&interfaceObj.idx&&mlsArray[listing.ma_tech_id].list_agency_logo_id!=""&&rmxId(js_tech_id)!=rmxId(listing.me_tech_id.tech_id)&&rmxId(js_tech_id)!=rmxId(listing.list_agency_id.tech_id)){return'<img src="'+mlsArray[listing.ma_tech_id].picPath+listing.list_ma_login_name+"/"+mlsArray[listing.ma_tech_id].list_agency_logo_id+'.jpg" border=0>'}else{if(column=="list_agency_id"&&interfaceObj.idx&&rmxId(listing.ma_tech_id)=="20040823192259049809000000"){return link_part1+(link_part1?listing[column].tech_id:"")+link_part2+listing[column].label+link_close+"<br>Phone: "+listing.list_agency_id_phone}else{if(interfaceObj.portal&&porthidecontactinfo=="Y"&&(column=="list_agency_id"||column=="co_list_agency_id")){return listing[column].label}else{if(print_contact_info=="Y"&&!interfaceObj.idx){var tmpx=link_part1+(link_part1?listing[column].tech_id:"")+link_part2+listing[column].label+((pref_show_ids=="Y"&&!interfaceObj.publicside)?(" ("+listing[column].short_id+")"):"")+link_close;tmpx+=listing[column].phone&&listing[column].phone!="undefined"?("<br>"+listing[column].phone):"";tmpx+=listing[column].email&&listing[column].email!="undefined"?("<br>"+listing[column].email):"";tmpx+=listing[column].url&&listing[column].url!="undefined"?("<br>"+listing[column].url):"";return tmpx}else{if(listing[column].label){return link_part1+(link_part1?listing[column].tech_id:"")+link_part2+listing[column].label+((pref_show_ids=="Y"&&!interfaceObj.publicside)?(" ("+listing[column].short_id+")"):"")+link_close}else{return"\u00a0"}}}}}}}else{return"\u00a0"}}var thumbphotoarr=new Array("http://cdn0.photos.flexmls.com/","http://cdn1.photos.flexmls.com/","http://cdn2.photos.flexmls.com/","http://cdn3.photos.flexmls.com/");var thumbphotoarr_metro=new Array("http://photos0.mlswis.com/","http://photos1.mlswis.com/","http://photos2.mlswis.com/","http://photos3.mlswis.com/");var thumbphotoarr_nef=new Array("http://photos0.nefmls.com/","http://photos1.nefmls.com/","http://photos2.nefmls.com/","http://photos3.nefmls.com/");var thumbphoto_x_nef=0;function addListingToGrid(LO,direction,disCodes,dummy){var prnthide="";var uncookedtech=rmxId(LO.tech_id);if(forprint){prnthide="style='display:none'"}if(direction=="down"){var tbody=dummy?thegrid_dummy.tBodies[0]:thegrid.tBodies[0];var row=document.createElement("TR")}else{var tbody=dummy?thegrid_dummy:thegrid;var row=tbody.insertRow(1)}row.id="row-"+uncookedtech+(dummy?"_dummy":"");row.mind=LO.mind;row.geo_lat=LO.geo_lat;row.geo_lon=LO.geo_lon;row.ma_approved=LO.ma_approved;if(interfaceObj.display_address){row.address=LO.shortaddress}else{row.address=""}row.city=LO.city;row.state=LO.state;row.zip=LO.zip;row.onmouseover=function(){document.getElementById("row-"+uncookedtech+(dummy?"_dummy":"")).className="rowunsel_hover"};row.onmouseout=function(){document.getElementById("row-"+uncookedtech+(dummy?"_dummy":"")).className="rowunsel"};if(LO.picture1_id&&LO.picture1_id!=""){row.image=mlsArray[LO.ma_tech_id].picPath+LO.list_ma_login_name+"/"+LO.picture1_id+"-t.jpg"}else{row.image="/images/srch_rs/nophoto_single.jpg"}row.price=mlsArray[LO.ma_tech_id].currencySymbol+LO.list_price;row.sold_price=mlsArray[LO.ma_tech_id].currencySymbol+LO.sold_price;row.remark1=LO.remark1;row.remark2=LO.remark2;row.me_tech_id=LO.me_tech_id;row.listexportidx_id=LO.listexportidx_id;row.disable_showing_request=LO.disable_showing_request;row.co_list_agency_id=LO.co_list_agency_id;row.co_list_agent=LO.co_list_agent;row.co_sell_agency_id=LO.co_sell_agency_id;row.co_sell_agent_id=LO.co_sell_agent_id;row.list_agency_id=LO.list_agency_id;row.sell_agency_id=LO.sell_agency_id;row.sell_agent_id=LO.sell_agent_id;row.status=mlsArray[LO.ma_tech_id].status[LO.status];row.list_nbr=(mlsArray[LO.ma_tech_id].useListPrefix=="Y")?LO.prefix+"-"+LO.list_nbr:LO.list_nbr;row.propertyType=mlsArray[LO.ma_tech_id].proptype[LO.card_fmt];row.propertyGroupType=mlsArray[LO.ma_tech_id].propgroup[LO.card_fmt];row.style.height="1%";row.ma_tech_id=LO.ma_tech_id;if(interfaceObj.show_approvereject){if(approvehides[uncookedtech]){row.style.backgroundImage="url(/images/srch_rs/"+approvehides[uncookedtech]+".png)"}}var cell;cell=document.createElement("TD");cell.className="gridtd";cell.style.width="20px";cell.style.textAlign="center";cell.style.whiteSpace="nowrap";cell.style.verticalAlign="middle";cell.title="Select listing";cell.onmousedown=function(){checkClick(this.firstChild,this.parentNode.id.substr(4,30));return false};cell.onselectstart=function(){return false};if(interfaceObj.check_all){addselectedlisting(uncookedtech)}if(seeIfSelected(uncookedtech)){if(srmode!="cart"){chk_counter++}cell.innerHTML='<img id="check-'+uncookedtech+'" src="/images/srch_rs/check.png" class="pointer" '+prnthide+"><div class='colnum' id='rowpos-"+uncookedtech+"'>"+LO.mind+"</div>"}else{cell.innerHTML='<img id="check-'+uncookedtech+'" src="/images/srch_rs/check_u.png" class="pointer" '+prnthide+"><div class='colnum' id='rowpos-"+uncookedtech+"'>"+LO.mind+"</div>"}row.appendChild(cell);if(!oneline){if(gridphoto){cell=document.createElement("TD");cell.className="gridtd";cell.style.width="1%";cell.style.textAlign="center";cell.style.verticalAlign="middle";cell.style.whiteSpace="nowrap";cell.onmouseover=function(){cell.border="1px solid #1569c7"};cell.onmouseout=function(){cell.border="1px solid #1569c7"};cell.onclick=function(){if(interfaceObj.show_tour){if(tabIndex==0){selectL(this.parentNode.id.substr(4,30),false,true);clickTab("tab_tour",false)}else{if(tabIndex==TourTabIndex){selectL(this.parentNode.id.substr(4,30),false,true)}else{selectL(this.parentNode.id.substr(4,30),false,true);clickTab("tab_tour",false)}}srchlog("listing thumbnail","click",true)}else{selectL(this.parentNode.id.substr(4,30),false,true)}};var pic_count=LO.pic_count?LO.pic_count:0;cell.title="View photos ("+pic_count+")";if(LO.picture1_id&&LO.picture1_id!=""){if(mlsArray[LO.ma_tech_id].picPath=="http://photos.flexmls.com/"){var ppath=thumbphotoarr[(LO.picture1_id?LO.picture1_id.toString().charAt(6):"0")];if(interfaceObj.thumbphoto_dev){ppath=interfaceObj.thumbphoto_dev}cell.innerHTML='<img width=65 height=42 border=0 class="gridtd_photo" onmouseover="this.className=\'gridtd_photo_hover\';" onmouseout="this.className=\'gridtd_photo\';" src="'+ppath+LO.list_ma_login_name+"/"+LO.picture1_id+'-t.jpg" onerror="this.src=\'/images/srch_rs/nophoto.jpg\';">'}else{if(mlsArray[LO.ma_tech_id].picPath=="http://photos.mlswis.com/"){cell.innerHTML='<img width=65 height=42 border=0 class="gridtd_photo" onmouseover="this.className=\'gridtd_photo_hover\';" onmouseout="this.className=\'gridtd_photo\';" src="'+thumbphotoarr_metro[(LO.picture1_id?LO.picture1_id.toString().charAt(6):"0")]+LO.list_ma_login_name+"/"+LO.picture1_id+'-t.jpg" onerror="this.src=\'/images/srch_rs/nophoto.jpg\';">'}else{if(mlsArray[LO.ma_tech_id].picPath=="http://photos.nefmls.com/"){cell.innerHTML='<img width=65 height=42 border=0 class="gridtd_photo" onmouseover="this.className=\'gridtd_photo_hover\';" onmouseout="this.className=\'gridtd_photo\';" src="'+thumbphotoarr_nef[thumbphoto_x_nef]+LO.list_ma_login_name+"/"+LO.picture1_id+'-t.jpg" onerror="this.src=\'/images/srch_rs/nophoto.jpg\';">';thumbphoto_x_nef=0}else{cell.innerHTML='<img width=65 height=42 border=0 class="gridtd_photo" onmouseover="this.className=\'gridtd_photo_hover\';" onmouseout="this.className=\'gridtd_photo\';" src="'+mlsArray[LO.ma_tech_id].picPath+LO.list_ma_login_name+"/"+LO.picture1_id+'-t.jpg" onerror="this.src=\'/images/srch_rs/nophoto.jpg\';">'}}}}else{cell.innerHTML='<img width=65 height=42 border=0 class="gridtd_photo" onmouseover="this.className=\'gridtd_photo_hover\';" onmouseout="this.className=\'gridtd_photo\';" src="/images/srch_rs/nophoto.jpg">'}if(LO.major_change_desc&&LO.major_change_ts){var tmpdate=new Date(Date.parse(LO.major_change_ts));var curdate=new Date();if((Math.round((curdate-tmpdate)/(1000*60*60*24)))<=3){cell.innerHTML+='<div style="color:green;font-weight:bold">'+LO.major_change_desc+"</div>";row.singlechangedesc='<div style="color:green;font-weight:bold">'+LO.major_change_desc+"</div>"}else{row.singlechangedesc=""}}row.appendChild(cell)}cell=document.createElement("TD");cell.className="gridtd";cell.onclick=function(){selectL(this.parentNode.id.substr(4,30),false,true)};var temphtml="";if(smilies=="true"&&!forprint){temphtml+='<div class="smilediv">';temphtml+='<img src="/images/srch_rs/agt'+(agtlistings.indexOf(uncookedtech)==-1?"_bw":"")+"."+img_ext+'" id="agt_'+uncookedtech+'"';if(prospect_tech_id_4_messages){temphtml+=" onClick=\"markListing('"+uncookedtech+"','agt');event.cancelBubble=true;\" title=\"Click here to mark this listing as a recommended\""}else{temphtml+=" onClick=\"writeToWarningDiv('This listing has been recommended by "+portalownername+"','attention',10000);\" title=\"Recommended by "+portalownername+'" style="'+(agtlistings.indexOf(uncookedtech)==-1?"display:none":"")+'"'}temphtml+=">";temphtml+='<img src="/images/srch_rs/fav'+(favlistings.indexOf(uncookedtech)==-1?"_bw":"")+"."+img_ext+'" id="fav_'+uncookedtech+'" onClick="markListing(\''+uncookedtech+"','fav');event.cancelBubble=true;\" title=\"Click here to mark this listing as a favorite\">";temphtml+='<img src="/images/srch_rs/pos'+(poslistings.indexOf(uncookedtech)==-1?"_bw":"")+"."+img_ext+'" id="pos_'+uncookedtech+'" onClick="markListing(\''+uncookedtech+"','pos');event.cancelBubble=true;\" title=\"Click here to mark this listing as a possibility\">";temphtml+='<img src="/images/srch_rs/rej'+(rejlistings.indexOf(uncookedtech)==-1?"_bw":"")+"."+img_ext+'" id="rej_'+uncookedtech+'" onClick="markListing(\''+uncookedtech+"','rej');event.cancelBubble=true;\" title=\"Click here to mark this listing as a reject\">";temphtml+="</div>"}if(LO.status=="C"){temphtml+='<div class="addressdiv"><span style="font-weight: bold;" ls=\'price\'>'+mlsArray[LO.ma_tech_id].currencySymbol+LO.sold_price+"</span><br />"}else{temphtml+='<div class="addressdiv"><span style="font-weight: bold;" ls=\'price\'>'+mlsArray[LO.ma_tech_id].currencySymbol+LO.list_price+"</span><br />"}if(interfaceObj.display_address&&((!interfaceObj.idx&&!interfaceObj.portal)||((interfaceObj.idx||interfaceObj.portal)&&!LO.listexportidx_id))){temphtml+="<span ls='address'>"+LO.shortaddress+"</span><br />";temphtml+="<span ls='csz'>"+LO.city+", "+LO.state+" "+LO.zip+"</span><br />"}temphtml+="<span ls='sl'>";if(js_ma_tech_id!=LO.ma_tech_id&&show_datashare_badge=="Y"){temphtml+='<span class="abbrmls" style=\'font-size:7pt;\' title="'+LO.list_ma_full_name+'">'+LO.list_ma_login_name.toUpperCase()+"</span> "}var statdisp="<span class='status_"+LO.status.toUpperCase()+"'>"+row.status+"</span>";if(interfaceObj.awc_status==true&&row.status=="Active"&&LO.contingent&&LO.contingent!="N"){statdisp="<span class='status_A'>"+interfaceObj.contingent_code_pfx+LO.contingent_description+"</span>"}if(forprint||!interfaceObj.show_detail){temphtml+=statdisp+" / <span style='white-space: nowrap;'>"+row.list_nbr+"</span>"}else{temphtml+=statdisp+" / <span style='white-space: nowrap;'><a href=\"javascript:clickTab('tab_detail',false);srchlog('listing number','click',true);\" class=\"columnlink\">"+row.list_nbr+"</a></span>"}if(forprint||!interfaceObj.publicside){temphtml+='&nbsp;<img src="/images/srch_rs/arrowdown_big.gif" width="15" height="10" listing="'+uncookedtech+'" list_nbr="'+LO.list_nbr+'" prefix="'+LO.prefix+"\" border=0 align='absmiddle' onClick=\"srchlog('listing options triangle','click',false,'"+uncookedtech+"');useTempScheduleId='"+LO.tech_id+"';dropdownmenu(this, event, listfunctionsmenu, '150px');gridDropMenu(event,'"+LO.tech_id+"','"+LO.list_nbr+"', '"+mlsArray[LO.ma_tech_id].status[LO.status]+"', '"+LO.me_tech_id.tech_id+"', '"+LO.list_agency_id.tech_id+"');\" onMouseout=\"delayhidemenu();this.src='/images/srch_rs/arrowdown_big.gif';\" onmouseover=\"this.src='/images/srch_rs/arrowdown_hover_big.gif';\" class='pointer' "+prnthide+' title="Additional actions">&nbsp;'}if(LO.contingent){LO.contingent=LO.contingent.trim()}if(show_contingent_act=="Y"&&(!interfaceObj.idx||interfaceObj.idx_showconting)&&(!interfaceObj.portal||interfaceObj.portal_showconting)&&LO.status=="A"&&LO.contingent&&LO.contingent!=""&&LO.contingent.toUpperCase()!="N"){var titlemess=contingent_disp_val;if(!LO.contingent_description||LO.contingent_description==""){titlemess+=": "+LO.contingent}else{titlemess+=": "+LO.contingent_description}if(show_contingent_rem=="Y"&&LO.contingent_rem&&LO.contingent_rem!=""){titlemess+="\n"+LO.contingent_rem}temphtml+='<span title="'+titlemess+'" class="'+((show_contingent_code=="Y"&&LO.contingent=="S")?"cont_show":"cont")+'">&nbsp;'+interfaceObj.contingent_code_pfx+(show_contingent_code=="Y"?LO.contingent:"C")+"&nbsp;</span>"}if((!interfaceObj.idx||interfaceObj.idx_showconting)&&(!interfaceObj.portal||interfaceObj.portal_showconting)&&LO.status=="P"&&LO.contingent&&LO.contingent!=""&&(LO.contingent!=2||js_ma_tech_id!="20000626161909466294000000")&&LO.contingent.toUpperCase()!="N"){var titlemess="Contingent";if(!LO.contingent_description||LO.contingent_description==""){titlemess+=": "+LO.contingent}else{titlemess+=": "+LO.contingent_description}if(show_contingent_rem=="Y"&&LO.contingent_rem&&LO.contingent_rem!=""){titlemess+="\n"+LO.contingent_rem}temphtml+='<span title="'+titlemess+'" class="'+((show_contingent_code=="Y"&&LO.contingent=="S")?"cont_show":"cont")+'">&nbsp;'+(show_contingent_code=="Y"?LO.contingent:"C")+"&nbsp;</span>"}if(show_contingent_pend=="Y"&&(!interfaceObj.idx||interfaceObj.idx_showconting)&&(!interfaceObj.portal||interfaceObj.portal_showconting)&&LO.status=="P"&&(!LO.contingent||LO.contingent==""||(LO.contingent==2&&js_ma_tech_id=="20000626161909466294000000")||LO.contingent.toUpperCase()=="N")){temphtml+='<label title="Pended: No Contingencies" class="cont">&nbsp;P&nbsp;</label>'}if(js_ma_tech_id==="20041207163840134580000000"&&(!interfaceObj.idx||interfaceObj.idx_showconting)&&(!interfaceObj.portal||interfaceObj.portal_showconting)&&LO.status==="W"&&LO.contingent!==""){var titlemess="Contingent";if(!LO.contingent_description||LO.contingent_description==""){titlemess+=": "+LO.contingent}else{titlemess+=": "+LO.contingent_description}temphtml+='<label title="'+titlemess+'" class="cont">&nbsp;'+LO.contingent+"</span>"}if(show_rental_badge=="Y"&&row.propertyGroupType=="T"){temphtml+=' <label title="Rental: '+rental_badge_label+'" class="rentbadge">'+rental_badge_label+"</label>"}temphtml+="</div>";if(!gridphoto&&LO.major_change_desc&&LO.major_change_ts){var tmpdate=new Date(Date.parse(LO.major_change_ts));var curdate=new Date();if((Math.round((curdate-tmpdate)/(1000*60*60*24)))<=3){temphtml+='<div style="color:green;font-weight:bold">'+LO.major_change_desc+"</div>";row.singlechangedesc='<div style="color:green;font-weight:bold">'+LO.major_change_desc+"</div>"}else{row.singlechangedesc=""}}cell.innerHTML=temphtml;row.appendChild(cell)}for(var tdcnt=0;tdcnt<tablecolumns.length;tdcnt++){cell=document.createElement("TD");cell.className="gridtd extracolumns";if(tdcnt==tablecolumns.length-1&&browser_type!="IE"){cell.style.paddingRight="20px"}if(colArray[LO.ma_tech_id+"-"+LO.card_fmt]){colArraytemp=colArray[LO.ma_tech_id+"-"+LO.card_fmt]}else{colArraytemp=colArray["default"]}if(colArraytemp[tablecolumns[tdcnt]]&&(colArraytemp[tablecolumns[tdcnt]].typex=="N"||colArraytemp[tablecolumns[tdcnt]].typex=="I"||tablecolumns[tdcnt]=="dom"||tablecolumns[tdcnt]=="cdom")){cell.style.textAlign="right"}cell.onclick=function(){selectL(this.parentNode.id.substr(4,30),false,true)};if(colArraytemp[tablecolumns[tdcnt]]&&((disCodes.indexOf(colArraytemp[tablecolumns[tdcnt]].confdnt_code)!=-1&&mlsArray[LO.ma_tech_id].bdsexclude.indexOf((LO.card_fmt+"-"+tablecolumns[tdcnt]))==-1)||(tablecolumns[tdcnt]=="list_agency_id"&&force_list_agency)||(interfaceObj.idx&&(tablecolumns[tdcnt]=="me_tech_id"||tablecolumns[tdcnt]=="list_agency_id")&&rmxId(js_ma_tech_id)==rmxId(js_tech_id)))){switch(tablecolumns[tdcnt]){case"address":cell.innerHTML=LO.shortaddress+", "+LO.city;break;case"list_nbr":cell.innerHTML=row.list_nbr;break;case"dateadded2cart":if(LO.dateadded2cart){var tmpdate=new Date(Date.parse(LO.dateadded2cart.substring(4,6)+"/"+LO.dateadded2cart.substring(6,8)+"/"+LO.dateadded2cart.substring(0,4)));cell.innerHTML=tmpdate.formatDate("mm/dd/yyyy")}else{cell.innerHTML="\u00a0"}break;case"card_fmt":cell.innerHTML=mlsArray[LO.ma_tech_id].proptype[LO.card_fmt];break;case"status":cell.innerHTML=mlsArray[LO.ma_tech_id].status[LO[tablecolumns[tdcnt]].trim()]?mlsArray[LO.ma_tech_id].status[LO[tablecolumns[tdcnt]].trim()]:"\u00a0";break;case"me_tech_id":case"list_agency_id":case"co_list_agent":case"co_list_agency_id":case"sell_agent_id":case"sell_agency_id":case"co_sell_agent_id":case"co_sell_agency_id":cell.innerHTML=agentOfficeColumnText(tablecolumns[tdcnt],LO,tablecolumns);break;case"openhouse":if(LO.o_event_date){celltemp=new Date(LO.o_event_date).formatDate("dddd, mmmm d yyyy")+"<br>";celltemp+=new Date(LO.o_start_time).formatTime()+" to "+new Date(LO.o_end_time).formatTime();var hohc=false;if(interfaceObj.idx&&(idx_hideohc=="Y"||idx_hideohc=="P")){hohc=true}if(LO.o_comment&&LO.o_comment!=""&&!hohc){celltemp+="<br>Comments: "+LO.o_comment+(LO.o_comment.length>250?" ... ":"")}if(!forprint&&interfaceObj.show_detail&&interfaceObj.show_openhouse){cell.innerHTML="<a href=\"javascript:clickTab('tab_detail',false);detailChoice('openhouse');\" title=\"Click to see more Open Houses\">"+celltemp+"</a>"}else{cell.innerHTML=celltemp}}else{cell.innerHTML="\u00a0"}break;case"tourofhomes":if(LO.t_event_date){celltemp=new Date(LO.t_event_date).formatDate("dddd, mmmm d yyyy")+"<br>";celltemp+=new Date(LO.t_start_time).formatTime()+" to "+new Date(LO.t_end_time).formatTime();if(LO.t_comment&&LO.t_comment!=""){celltemp+="<br>Comments: "+LO.t_comment}if(!forprint&&interfaceObj.show_detail&&interfaceObj.show_tourhomes){cell.innerHTML="<a href=\"javascript:clickTab('tab_detail',false);detailChoice('tourofhomes');\" title=\"Click to see more Tour of Homes\">"+celltemp+"</a>"}else{cell.innerHTML=celltemp}}else{cell.innerHTML="\u00a0"}break;case"history":var hist_time_msg="";var hist_message="";var days=(new Date()-new Date(LO.hist_time))/1000/60/60/24;if(days<=3){hist_time_msg=LO.hist_time_usa+"&nbsp;"+timezonedesc+"<br>"}else{hist_time_msg="<br>"}var hist_field_lbl=LO.hist_field_lbl;if(hist_field_lbl=="picture"){hist_field_lbl="Picture"}if(hist_field_lbl=="document"){hist_field_lbl="Document"}if(LO.hist_field_id=="new"){hist_message="<i>new</i>"}else{if(LO.hist_field_id=="text"){hist_message="<i>text change</i>"}else{hist_message=hist_field_lbl+": "+(LO.hist_prev_value!=""?LO.hist_prev_value+"&rarr;":"")+LO.hist_new_value}}if(LO.hist_date){if(forprint||!interfaceObj.show_detail||!interfaceObj.show_history){cell.innerHTML=new Date(LO.hist_date).formatDate("mm/dd/yyyy")+" "+hist_time_msg+hist_message}else{cell.innerHTML='<a class="columnlink" href="javascript:clickTab(\'tab_detail\',false);detailChoice(\'history\');" title="See the history of this property">'+new Date(LO.hist_date).formatDate("mm/dd/yyyy")+" "+hist_time_msg+hist_message+"</a>"}}else{cell.innerHTML="\u00a0"}break;case"directions":if(address_include.indexOf("directions")!=-1){if(interfaceObj.display_address&&((!interfaceObj.idx&&!interfaceObj.portal)||((interfaceObj.idx||interfaceObj.portal)&&!LO.listexportidx_id))){LO[tablecolumns[tdcnt]]=LO[tablecolumns[tdcnt]].trim();cell.innerHTML=LO[tablecolumns[tdcnt]]?LO[tablecolumns[tdcnt]]:"\u00a0"}else{cell.innerHTML="\u00a0"}}else{LO[tablecolumns[tdcnt]]=LO[tablecolumns[tdcnt]].trim();cell.innerHTML=LO[tablecolumns[tdcnt]]?LO[tablecolumns[tdcnt]]:"\u00a0"}break;default:LO[tablecolumns[tdcnt]]=LO[tablecolumns[tdcnt]].trim();cell.innerHTML=LO[tablecolumns[tdcnt]]?LO[tablecolumns[tdcnt]]:"\u00a0";break}}else{cell.innerHTML="\u00a0"}row.appendChild(cell)}if(direction=="down"){tbody.appendChild(row)}if(!dummy){var tbodyd=thegrid;if(tbodyd.rows.length-1>howmanytoshow){if(direction=="down"){tbodyd.deleteRow(1)}else{tbodyd.deleteRow(-1)}}if(!forprint){if(tbodyd.rows[1]){begindexdiv.innerHTML=tbodyd.rows[1].mind}if(tbodyd.rows[(tbodyd.rows.length-minusextrarow())-1]){endindexdiv.innerHTML=tbodyd.rows[(tbodyd.rows.length-minusextrarow())-1].mind}if(LO.tech_id==selectedlisting){selectL(selectedlisting)}}}else{if(selectedlisting!=LO.tech_id){var oldrow=document.getElementById("row-"+selectedlisting);if(oldrow){for(var x=0;x<oldrow.childNodes.length;x++){oldrow.childNodes[x].className="gridtd"+(x>=minicol?" extracolumns":"")}var oldid=oldrow.id+"";oldrow.className="rowunsel";oldrow.onmouseover=function(){document.getElementById(oldid).className="rowunsel_hover"};oldrow.onmouseout=function(){document.getElementById(oldid).className="rowunsel"}}}selListObj=row;prev_selectedlisting=selectedlisting;selectedlisting=LO.tech_id;if(iframe_map&&iframe_map.contentWindow&&iframe_map.contentWindow.changeListing){iframe_map.contentWindow.changeListing(selectedlisting,selListObj.geo_lat,selListObj.geo_lon,selListObj.list_nbr)}if(singlegriddiv.style.display==""){switchtoSingleTimer()}}}function idx_get_help(){var openurl;var f;try{f=helpfile;if(f){openurl="/html/help/idx_"+f}else{openurl="/html/help/idx_searchresults.html"}}catch(er){openurl="/html/help/no_help.html"}var w=window.open(openurl,"FlexHelp","status=no,width=640,height=480,menubar=no,resizable=yes,scrollbars=yes,toolbar=yes")}function gridprintstop(){loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/gridprintstop.html&uniquet="+uniquet,false)}var previousedits=new Object();function gridDropMenu(e,list_tech_id,list_nbr,status,me_tech_id,list_agency_id){list_tech_id=rmxId(list_tech_id);var st_params="";st_params+="&list_tech_id="+xId(list_tech_id);st_params+="&listing="+list_nbr;st_params+="&status="+status;st_params+="&listingagent="+me_tech_id;st_params+="&listingoffice="+list_agency_id;if(gridelem.clientHeight-e.clientY<25&&singlegriddiv.style.display=="none"){dropmenudiv.style.top=e.clientY-dropmenudiv.clientHeight}else{dropmenudiv.style.top=e.clientY+5}if(previousedits[list_tech_id+"_"+list_nbr+"_"+me_tech_id+"_"+list_agency_id]){changeeditlist(previousedits[list_tech_id+"_"+list_nbr+"_"+me_tech_id+"_"+list_agency_id])}else{loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/checkedit.html"+st_params+additional_ajax_params,false)}}function changeeditlist(OB){if(OB.showingtimelink&&document.getElementById("showingtimelink")){document.getElementById("showingtimelink").style.display=""}if(OB.editlistinglink&&document.getElementById("editlistinglink")){document.getElementById("editlistinglink").style.display=""}if(OB.listactivitylink&&document.getElementById("listactivitylink")){document.getElementById("listactivitylink").style.display=""}if(OB.showinghistorylink&&document.getElementById("showinghistorylink")){document.getElementById("showinghistorylink").style.display=""}if(document.getElementById("calculatinglink")){document.getElementById("calculatinglink").style.display="none"}}function buildSortOrderString(){var s_order="";for(var x=0;x<sortorder.length;x++){if(x>0){s_order+=";"}s_order+=sortorder[x]+"|"+sortobj[sortorder[x]]}return s_order}function changeOrderby(gridwasreset){using_custom_sort=true;var resetstr="";if(gridwasreset){resetstr="&gridwasreset=true"}var sortstr="";for(var s=0;s<sortorder.length;s++){sortstr+=sortorder[s]+"|"+sortobj[sortorder[s]]+";"}sortstr=sortstr.substr(0,sortstr.length-1);loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/changeOrderby.html&sortorder="+sortstr+resetstr+additional_ajax_params,false)}function setSortCheck(index,mode){for(var x=0;x<cust_sort_menu.length;x++){if(cust_sort_menu[x].indexOf("check_16.gif")>-1){cust_sort_menu[x]=cust_sort_menu[x].substr(0,cust_sort_menu[x].toLowerCase().lastIndexOf("<img"))+"</a>"}}var chgIndex=null;if(mode=="index"){chgIndex=index}else{if(mode=="id"){for(var x=0;x<cust_sort_menu.length;x++){if(cust_sort_menu[x].indexOf(index)>=0){if(cust_sort_menu[x].indexOf("/images/check_16.gif")>-1){return}else{chgIndex=x;break}}}}}if(chgIndex!=null){var ind=cust_sort_menu[chgIndex].toLowerCase().indexOf("</a>");cust_sort_menu[chgIndex]=cust_sort_menu[chgIndex].substr(0,ind)+" <img src='/images/check_16.gif' height=16 width=16>"+cust_sort_menu[chgIndex].substr(ind)}}function changeCustomOrderby(tech_id){using_custom_sort=true;setSortCheck(tech_id,"id");loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/changeOrderby.html&customsort=true&custsortid="+tech_id+additional_ajax_params,false)}function updateSelArrayAfterColumnSort(largestring){var tmparr=splitN(largestring,26);var tmparr2=new Array();for(var x=0;x<tmparr.length;x++){if(sellistings.indexOf(tmparr[x])!=-1){tmparr2.push(tmparr[x])}}sellistings=tmparr2}function columnSort(typ,fid){if(fid){clickedHeader=fid}if(!fid){srchlog("sort order header",clickedHeader+";"+clickedHeaderLabel+";"+typ)}if(clickedHeader=="list_nbr"&&mlsArray[js_ma_tech_id].useListPrefix=="Y"){sortobj=new Object();sortobj.prefix=typ;sortobj[clickedHeader]=typ;sortorder=new Array();sortorder.push("prefix");sortorder.push(clickedHeader)}else{sortobj=new Object();sortobj[clickedHeader]=typ;sortorder=new Array();sortorder.push(clickedHeader)}if(clickedHeader=="current_price"){setSortCheck((typ=="A"?1:0),"index")}else{if(clickedHeader=="major_change_ts"){setSortCheck(2,"index")}else{setSortCheck()}}changeOrderby()}function dropdowmenusort(a,b,fieldid,fieldlabel){if(srmode=="results"&&hotsheet){return false}else{clickedHeader=fieldid;clickedHeaderLabel=fieldlabel;dropdownmenu(a,b,sortmenu,"125px")}}function flipCheck(onOff){var img=document.getElementById("chk_img");if(!img){return}if(onOff=="off"){img.src="/images/srch_rs/grid_toolbar/new_deselect.png";img.onmouseover=function(){document.getElementById(img.id).src="/images/srch_rs/grid_toolbar/new_deselect_hover.png"};img.onmouseout=function(){document.getElementById(img.id).src="/images/srch_rs/grid_toolbar/new_deselect.png"};img.title="Select Listings";img.checked=false}else{if(onOff=="on"){img.src="/images/srch_rs/grid_toolbar/new_select.png";img.onmouseover=function(){document.getElementById(img.id).src="/images/srch_rs/grid_toolbar/new_select_hover.png"};img.onmouseout=function(){document.getElementById(img.id).src="/images/srch_rs/grid_toolbar/new_select.png"};img.title="Deselect all Listings";img.checked=true}}}function toggleCheck(onOff){var img=document.getElementById("chk_img");if(!img){return}if(onOff&&onOff=="cart"){if(typeof(img.checked)=="undefined"){img.checked=true}onOff=false}if(onOff||current_grid_totallistings<=magicnumtoacton){if((!onOff&&img.checked)||(onOff&&onOff=="off")){flipCheck("off");uncheckLoaded()}else{flipCheck("on");checkLoaded()}}else{var html=new Array();html.push("<center><b>Only the first 200 listings may be automatically selected</b><br>");html.push("<br><a href='javascript:void(0);' onclick='toggleCheck(\"on\");hidePrettyDialog();' style='font-size:10pt;'>Select the first 200 listings</a><br>");html.push("<a href='javascript:void(0);' onclick='toggleCheck(\"off\");hidePrettyDialog();' style='font-size:10pt;'>Deselect all listings</a></center><br>");var l=img.offsetLeft;p=img;while(p=p.parentNode){l+=(p.offsetLeft?p.offsetLeft:0)}showPrettyDialog("Select Listings",html.join(""),{height:"100px",width:"250px",left:l+"px",top:"102px"})}}function addHeadersToGrid(){var thead=thegrid.tHead;var row=document.createElement("TR");row.id="header_for_grid";var header;var scnt=0;for(var s in sortobj){scnt++}header=document.createElement("TH");header.className="gridth";header.style.width="20px";header.style.textAlign="center";if(srmode=="cart"&&!forprint){header.innerHTML="<img id='chk_img' src='/images/srch_rs/grid_toolbar/new_select.png' onmouseover=\"this.src='/images/srch_rs/grid_toolbar/new_select_hover.png'\" onmouseout=\"this.src='/images/srch_rs/grid_toolbar/new_select.png'\" border='0' title=\"Deselect Listings\" class=\"pointer\" style=\"padding:0px;\" onclick=\"srchlog('select all','click');toggleCheck('cart');\">"}else{if(!forprint){header.innerHTML="<img id='chk_img' src='/images/srch_rs/grid_toolbar/new_deselect.png' onmouseover=\"this.src='/images/srch_rs/grid_toolbar/new_deselect_hover.png'\" onmouseout=\"this.src='/images/srch_rs/grid_toolbar/new_deselect.png'\" border='0' title=\"Select Listings\" class=\"pointer\" style=\"padding:0px;\" onclick=\"srchlog('select all','click');toggleCheck();\">"}else{header.innerHTML="&nbsp;"}}row.appendChild(header);if(!oneline){if(gridphoto){header=document.createElement("TH");header.className="gridth";header.innerHTML="&nbsp;";row.appendChild(header)}header=document.createElement("TH");header.colSpan=minicol-(gridphoto?2:1);header.className="gridth";var tempheadf="";if(forprint){tempheadf+="<span>Price&nbsp;/&nbsp;Status&nbsp;/&nbsp;MLS #</span>"}else{tempheadf+="<span class='gridth_pointer' "+((srmode=="cart"||!hotsheet)?"title='Click to Sort by Price'":"")+" ";if(browser_type=="Safari"){tempheadf+=' onmouseover=\'menu_mouse_in_elem="current_price";this.className="gridth_pointer_hover";\' '}else{tempheadf+=" onmouseover='this.className=\"gridth_pointer_hover\";' "}tempheadf+="onmouseout="+(browser_type=="Safari"?'\'menu_mouse_in_elem="";setTimeout("delayhidemenu(\\"current_price\\");", 100);this.className="gridth_pointer";\'':"'delayhidemenu();this.className=\"gridth_pointer\";'");tempheadf+=" onclick=\"dropdowmenusort(this, event, 'current_price', 'Price');\">";if(sortobj.current_price&&scnt==1){tempheadf+='<img src="/images/srch_rs/'+(sortobj.current_price=="A"?"up":"down")+'arrow.png" border=0 align="absmiddle">'}tempheadf+="Price</span>";tempheadf+="&nbsp;/&nbsp;";tempheadf+="<span class='gridth_pointer' "+((srmode=="cart"||!hotsheet)?"title='Click to Sort by Status'":"")+' style="white-space: nowrap;"';if(browser_type=="Safari"){tempheadf+=' onmouseover=\'menu_mouse_in_elem="status";this.className="gridth_pointer_hover";\' '}else{tempheadf+=" onmouseover='this.className=\"gridth_pointer_hover\";' "}tempheadf+="onmouseout="+(browser_type=="Safari"?'\'menu_mouse_in_elem="";setTimeout("delayhidemenu(\\"status\\");", 100);this.className="gridth_pointer";\'':"'delayhidemenu();this.className=\"gridth_pointer\";'");tempheadf+=" onclick=\"dropdowmenusort(this, event, 'status', 'Status');\">";if(sortobj.status&&scnt==1){tempheadf+='<img src="/images/srch_rs/'+(sortobj.status=="A"?"up":"down")+'arrow.png" border=0 align="absmiddle">'}tempheadf+="Status</span>";tempheadf+="&nbsp;/&nbsp;";tempheadf+="<span class='gridth_pointer' "+((srmode=="cart"||!hotsheet)?"title='Click to Sort by MLS #'":"")+' style="white-space: nowrap;"';if(browser_type=="Safari"){tempheadf+=' onmouseover=\'menu_mouse_in_elem="list_nbr";this.className="gridth_pointer_hover";\' '}else{tempheadf+=" onmouseover='this.className=\"gridth_pointer_hover\";' "}tempheadf+="onmouseout="+(browser_type=="Safari"?'\'menu_mouse_in_elem="";menu_mouse_to_id=setTimeout("delayhidemenu(\\"list_nbr\\");", 100);this.className="gridth_pointer";\'':"'delayhidemenu();this.className=\"gridth_pointer\";'");tempheadf+=" onclick=\"dropdowmenusort(this, event, 'list_nbr', 'List Nbr');\">";if(sortobj.list_nbr&&scnt==2){tempheadf+='<img src="/images/srch_rs/'+(sortobj.list_nbr=="A"?"up":"down")+'arrow.png" border=0 align="absmiddle">'}tempheadf+="MLS&nbsp;#</span>"}header.innerHTML=tempheadf;row.appendChild(header)}for(var thcnt=0;thcnt<tablecolumns.length;thcnt++){header=document.createElement("TH");header.className="gridthextra";if(thcnt==tablecolumns.length-1&&browser_type!="IE"){header.style.paddingRight="20px"}var temphead="";var tempheadlabel="";if(viewCustomLabels[tablecolumns[thcnt]]){tempheadlabel=viewCustomLabels[tablecolumns[thcnt]]}else{if(colArray["default"][tablecolumns[thcnt]]){if(colArray["default"][tablecolumns[thcnt]].label=="Date Added to Cart"){tempheadlabel="Added"}else{tempheadlabel=colArray["default"][tablecolumns[thcnt]].label}}else{tempheadlabel=""}}if(forprint){temphead+="<span>"}else{temphead+="<span class='gridth_pointer' "+((srmode=="cart"||!hotsheet)?("title='Click to Sort by "+(viewCustomLabels[tablecolumns[thcnt]]?viewCustomLabels[tablecolumns[thcnt]]:(colArray["default"][tablecolumns[thcnt]]?colArray["default"][tablecolumns[thcnt]].label:""))+"'"):"")+" ";if(browser_type=="Safari"){temphead+=" onmouseover='menu_mouse_in_elem=\""+tablecolumns[thcnt]+'";this.className="gridth_pointer_hover";\' '}else{temphead+=" onmouseover='this.className=\"gridth_pointer_hover\";'"}temphead+=" onmouseout="+(browser_type=="Safari"?'\'menu_mouse_in_elem="";setTimeout("delayhidemenu(\\"'+tablecolumns[thcnt]+'\\");", 100);this.className="gridth_pointer";\'':"'delayhidemenu();this.className=\"gridth_pointer\";'");temphead+=" onclick=\"dropdowmenusort(this, event, '"+tablecolumns[thcnt]+"', '"+tempheadlabel.quote("js")+"');\">"}if(sortobj[tablecolumns[thcnt]]&&scnt==1){temphead+='<img src="/images/srch_rs/'+(sortobj[tablecolumns[thcnt]]=="A"?"up":"down")+'arrow.png" border=0 align="absmiddle">'}temphead+=tempheadlabel;temphead+="</span>";header.innerHTML=temphead;if(colArray["default"][tablecolumns[thcnt]]&&(colArray["default"][tablecolumns[thcnt]].typex=="N"||colArray["default"][tablecolumns[thcnt]].typex=="I")){header.style.textAlign="right"}row.appendChild(header)}if(hotsheet&&srmode=="results"){changecss(".gridth_pointer","color","#000000");changecss(".gridth_pointer","cursor","default");changecss(".gridth_pointer","textDecoration","none");changecss(".gridth_pointer_hover","color","#000000");changecss(".gridth_pointer_hover","cursor","default");changecss(".gridth_pointer_hover","textDecoration","none")}else{changecss(".gridth_pointer","color","#1569c7");changecss(".gridth_pointer","cursor","pointer");changecss(".gridth_pointer","textDecoration","underline");changecss(".gridth_pointer_hover","color","#7777db");changecss(".gridth_pointer_hover","cursor","pointer");changecss(".gridth_pointer_hover","textDecoration","underline")}thead.appendChild(row)}function setActiveDetailLink(){for(var d in detail_links){if(document.getElementById("detail_"+detail_links[d].keystr+"_link")&&document.getElementById("detail_"+detail_links[d].keystr+"_link").className){if(detail_links[d].keystr==last_detail_ran){document.getElementById("detail_"+detail_links[d].keystr+"_link").className="subTab_selected"}else{document.getElementById("detail_"+detail_links[d].keystr+"_link").className="subTab"}}}if(document.getElementById("detail_reports_link")&&document.getElementById("detail_reports_link").className){if(last_detail_ran=="reports"){document.getElementById("detail_reports_link").className="subTab_selected";if(document.getElementById("detail_reports_link_img")){document.getElementById("detail_reports_link_img").style.display="";document.getElementById("detail_reports_link").title="Select a different report"}}else{document.getElementById("detail_reports_link").className="subTab";if(document.getElementById("detail_reports_link_img")){document.getElementById("detail_reports_link_img").style.display="none";document.getElementById("detail_reports_link").title="View a detailed report"}}}}function setActiveGridLink(typ){gridlink_results.className="subTab";gridlink_cart.className="subTab";eval("gridlink_"+typ).className="subTab_selected"}function sortMaxCheck(tabz){if((tabz=="cart"&&cart_totallistings<=sortmax)||(tabz=="results"&&listingcart=="true"&&results_totallistings<=sortmax)){fetchamount=sortmax/2;howmanytoinit=sortmax;howmanytoshow=sortmax}else{fetchamount=25;howmanytoinit=50;howmanytoshow=50}begindex=1;endindex=howmanytoinit}function showSelected(){if(!alreadyrunning){if(cart_totallistings>0){srchlog("selected tab","success");sortMaxCheck("cart");chk_counter=cart_totallistings;if(cart_totallistings>sortmax){orderbuttons_dead.style.display="";orderbuttons.style.display="none"}else{orderbuttons.style.display="";orderbuttons_dead.style.display="none"}if((singlegriddiv.style.display==""&&srmode=="cart")||searchgriddiv.style.display==""){switchGridView("grid")}if(srmode=="results"||cart_totallistings!=current_grid_totallistings){srmode="cart";current_grid_totallistings=cart_totallistings;allwherestr=cart_allwherestr;allorderby=cart_allorderby;loadJavaScriptDoc("querystring","mainmenu.cgi","cmd=srv+srch_rs/showSelected.html&tech_id_list=x'"+sellistings.join("',x'")+"'"+additional_ajax_params,false)}}else{srchlog("selected tab","fail");writeToWarningDiv("Please choose 1 or more listings","attention",5000)}}}function showResults(){if(!alreadyrunning){chk_counter=0;sortMaxCheck("results");if(listingcart=="true"){if(results_totallistings>sortmax){orderbuttons_dead.style.display="";orderbuttons.style.display="none"}else{orderbuttons.style.display="";orderbuttons_dead.style.display="none"}}else{orderbuttons.style.display="none";orderbuttons_dead.style.display="none"}if(singlegriddiv.style.display==""&&srmode=="results"){switchGridView("grid")}else{if(srmode=="cart"){if(hotsheet){fireHot(last_hotsheet,hotsheetlabel.innerHTML)}else{srmode="results";if(interfaceObj.can_search&&dirtysearch){compile(null);dirtysearch=false}else{current_grid_totallistings=results_totallistings;allwherestr=results_allwherestr;allorderby=results_allorderby;whereStringChanged_map=true;whereStringChanged_stats=true;resetGrid(false,false)}switchGridView("grid")}}else{if(searchgriddiv.style.display==""){hideFieldPicker();clickTab("tab_grid",false,false)}}}}}function showLoad(){loadingdiv.style.display="block"}function hideLoad(){loadingdiv.style.display="none"}function enableLSelector(skipset){if(!forprint){selectedinput.disabled=false;if(!skipset){selectedinput.value=(selListObj&&selListObj.mind)?selListObj.mind:""}Lselectorenabled=true}}function disableLSelector(){if(!forprint){selectedinput.disabled=true;Lselectorenabled=false;selectedinput.value="---"}}function showquickload(direction){if(direction=="up"){morelistingstop.style.display=""}else{morelistingsbot.style.display=""}}function hidequickload(){morelistingstop.style.display="none";morelistingsbot.style.display="none"}function getListings(bindex,eindex,direction,selind){if(!forprint){showquickload(direction)}var tempstr="cmd=srv+srch_rs/search.html";tempstr+="&allwherestr="+allwherestr;tempstr+="&print_contact_info="+print_contact_info;tempstr+="&moreinfomap_tech_id="+moreinfomap_tech_id;tempstr+="&howmanytoshow="+howmanytoshow;tempstr+="&additionalcond="+additionalcond;tempstr+="&useopenhouseview="+useopenhouseview;tempstr+="&idx="+interfaceObj.idx;tempstr+="&por="+interfaceObj.portal;tempstr+="&inact_noshow_lst_agt="+inact_noshow_lst_agt;tempstr+="&allorderby="+allorderby;tempstr+="&serv_forprint="+forprint;tempstr+="&serv_fetchamount="+fetchamount;tempstr+="&serv_current_grid_totallistings="+current_grid_totallistings;tempstr+="&serv_uniquet="+uniquet;if(forprint){tempstr+="&smjsruntime=30"}tempstr+="&uniquet="+uniquet+srmode;tempstr+="&srmode="+srmode;tempstr+="&sellistingscount="+sellistings.length;tempstr+="&dbfetchamt="+dbfetchamt;tempstr+="&columns="+neededcolumns.join(",");tempstr+="&privatemode="+interfaceObj.privatemode;tempstr+="&skip_tech_id="+skip_tech_id;tempstr+="&viewexpired_end_date="+viewexpired_end_date;tempstr+="&direction="+direction;tempstr+="&bindex="+bindex;tempstr+="&eindex="+eindex;var tc="";for(var x=0;x<neededcolumns.length;x++){tc+=(tc==""?"":",")+(colArray["default"][neededcolumns[x]]?colArray["default"][neededcolumns[x]].typex:"X")}tempstr+="&columntypes="+tc;tempstr+="&totallistings="+current_grid_totallistings;if(hotsheet){tempstr+="&hotsheet="+hotsheet;var tmpstr2="";for(var o in hotsheetSqlobj){tmpstr2+=o+"|"}if(tmpstr2.length>0){tmpstr2=tmpstr2.substring(0,tmpstr2.length-1)}tempstr+="&hotsheetparts="+tmpstr2;tempstr+="&last_hotsheet="+last_hotsheet;tempstr+="&hs_force_mls_view="+hs_force_mls_view}tempstr+="&selind="+selind;tempstr+="&oneline="+oneline;tempstr+="&show_contingent_code="+show_contingent_code;tempstr+="&show_contingent_act="+show_contingent_act;tempstr+="&show_contingent_pend="+show_contingent_pend;tempstr+="&show_contingent_rem="+show_contingent_rem;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}function getAllListings(listchange){var tempstr="cmd=srv+srch_rs/allsearch.html";tempstr+="&allwherestr="+allwherestr;tempstr+="&additionalcond="+encodeURIComponent(additionalcond);tempstr+="&useopenhouseview="+useopenhouseview;tempstr+="&print_contact_info="+print_contact_info;tempstr+="&idx="+interfaceObj.idx;tempstr+="&por="+interfaceObj.portal;tempstr+="&serv_forprint="+forprint;tempstr+="&serv_fetchamount="+fetchamount;tempstr+="&serv_current_grid_totallistings="+current_grid_totallistings;tempstr+="&serv_uniquet="+uniquet;tempstr+="&inact_noshow_lst_agt="+inact_noshow_lst_agt;tempstr+="&allorderby="+allorderby;if(forprint){tempstr+="&smjsruntime=30"}tempstr+="&moreinfomap_tech_id="+moreinfomap_tech_id;tempstr+="&sellistingscount="+sellistings.length;tempstr+="&howmanytoshow="+howmanytoshow;tempstr+="&listchange="+listchange;tempstr+="&columns="+neededcolumns.join(",");tempstr+="&uniquet="+uniquet+srmode;tempstr+="&srmode="+srmode;tempstr+="&oneline="+oneline;if(listingcart=="true"){tempstr+="&listingcart="+listingcart;tempstr+="&cart_techid_list="+cart_techid_list.join(",")}tempstr+="&dbfetchamt="+dbfetchamt;if(fromemail_manualorder){tempstr+="&manualorder="+fromemail_manualorder}else{if(srmode=="cart"&&cart_allorderby==""){tempstr+="&manualorder="+sellistings.join("")}if(srmode=="results"&&results_allorderby==""){tempstr+="&manualorder="+resultslistings.join("")}}tempstr+="&privatemode="+interfaceObj.privatemode;tempstr+="&skip_tech_id="+skip_tech_id;tempstr+="&viewexpired_end_date="+viewexpired_end_date;tempstr+="&direction=down";tempstr+="&bindex="+begindex;tempstr+="&eindex="+endindex;var tc="";for(var x=0;x<neededcolumns.length;x++){tc+=(tc==""?"":",")+(colArray["default"][neededcolumns[x]]?colArray["default"][neededcolumns[x]].typex:"X")}tempstr+="&columntypes="+tc;tempstr+="&totallistings="+current_grid_totallistings;if(hotsheet){tempstr+="&hotsheet="+hotsheet;var tmpstr2="";for(var o in hotsheetSqlobj){tmpstr2+=o+"|"}if(tmpstr2.length>0){tmpstr2=tmpstr2.substring(0,tmpstr2.length-1)}tempstr+="&hotsheetparts="+tmpstr2;tempstr+="&last_hotsheet="+last_hotsheet;tempstr+="&hs_force_mls_view="+hs_force_mls_view}tempstr+="&selind=1";tempstr+="&show_contingent_code="+show_contingent_code;tempstr+="&show_contingent_act="+show_contingent_act;tempstr+="&show_contingent_pend="+show_contingent_pend;tempstr+="&show_contingent_rem="+show_contingent_rem;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}function scrollCall(tt){var fetchstart,fetchend;if(tt.scrollTop<(tt.scrollHeight*0.1)&&!alreadyrunning){if(begindex>1){alreadyrunning=true;if((begindex-fetchamount)>1){fetchstart=begindex-fetchamount;fetchend=begindex-1;begindex-=fetchamount;endindex-=fetchamount}else{fetchstart=1;fetchend=begindex-1;begindex=1;endindex=howmanytoshow}if(scrollcause){getListings(fetchstart,fetchend,"up",selectedInd);scrollcause=false}else{getListings(fetchstart,fetchend,"up")}}}if(tt.scrollHeight<(tt.scrollTop+tt.clientHeight+(tt.scrollHeight*0.1))&&!alreadyrunning){if(endindex<current_grid_totallistings){alreadyrunning=true;if((endindex+fetchamount)<current_grid_totallistings){fetchstart=endindex+1;fetchend=endindex+fetchamount;begindex+=fetchamount;endindex+=fetchamount}else{fetchstart=endindex+1;fetchend=current_grid_totallistings;endindex=current_grid_totallistings;begindex=endindex-howmanytoshow+1}if(scrollcause){getListings(fetchstart,fetchend,"down",selectedInd);scrollcause=false}else{getListings(fetchstart,fetchend,"down")}}}}function updateSingleListingFromMap(techid,justSelect){moreinfomap_tech_id=techid;if(tabIndex==7){if(justSelect==undefined||singlegriddiv.style.display==""){clickTab("tab_map",false,false,techid);switchGridView("single")}return}var row=document.getElementById("row-"+rmxId(techid));if(row){selectL(techid,true);if(justSelect==undefined||singlegriddiv.style.display==""){switchtoSingleTimer()}enableLSelector()}else{disableLSelector();listing_in_focus_not_in_grid=true;selectedInd=-1;var rowd=document.getElementById("row-"+rmxId(techid)+"_dummy");if(rowd){selListObj=rowd;prev_selectedlisting=selectedlisting;selectedlisting=techid;if(iframe_map&&iframe_map.contentWindow&&iframe_map.contentWindow.changeListing){iframe_map.contentWindow.changeListing(selectedlisting,selListObj.geo_lat,selListObj.geo_lon)}if(justSelect==undefined||singlegriddiv.style.display==""){switchtoSingleTimer()}}else{if(neededcolumns.length==0){var tempstr="cmd=srv+srch_rs/getView.html";tempstr+="&sd_tech_id="+new_sd_tech_id.options[new_sd_tech_id.selectedIndex].value;tempstr+="&listchange=false";tempstr+="&force_list_agency="+force_list_agency;tempstr+="&ma_search_list="+ma_search_list;tempstr+="&card_fmt_list="+card_fmt_list;tempstr+="&cart_techid_list="+cart_techid_list.join(",");tempstr+="&prop_type_list="+prop_type_list;tempstr+="&listingcart="+listingcart;if(using_custom_sort){var s_order=buildSortOrderString();tempstr+="&custom_sort="+s_order}tempstr+="&sortranonce="+sortranonce;tempstr+="&approvereject="+approvereject;tempstr+="&approverejectlistnbr="+approverejectlistnbr;tempstr+="&oneline=false";tempstr+="&forupdatesinglelisting=true";tempstr+="&singletech_id="+techid;tempstr+="&forprint=false";tempstr+="&srmode="+srmode;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}else{var tempstr="cmd=srv+srch_rs/search.html";tempstr+="&singletech_id="+techid;tempstr+="&print_contact_info="+print_contact_info;tempstr+="&idx="+interfaceObj.idx;tempstr+="&por="+interfaceObj.portal;tempstr+="&moreinfomap_tech_id="+moreinfomap_tech_id;tempstr+="&inact_noshow_lst_agt="+inact_noshow_lst_agt;tempstr+="&howmanytoshow="+howmanytoshow;tempstr+="&columns="+neededcolumns.join(",");tempstr+="&sellistingscount="+sellistings.length;tempstr+="&privatemode="+interfaceObj.privatemode;tempstr+="&skip_tech_id="+skip_tech_id;tempstr+="&viewexpired_end_date="+viewexpired_end_date;tempstr+="&direction=down";var tc="";for(var x=0;x<neededcolumns.length;x++){tc+=(tc==""?"":",")+(colArray["default"][neededcolumns[x]]?colArray["default"][neededcolumns[x]].typex:"X")}tempstr+="&columntypes="+tc;tempstr+="&show_contingent_code="+show_contingent_code;tempstr+="&show_contingent_act="+show_contingent_act;tempstr+="&show_contingent_pend="+show_contingent_pend;tempstr+="&show_contingent_rem="+show_contingent_rem;tempstr+=additional_ajax_params;loadJavaScriptDoc("querystring","mainmenu.cgi",tempstr,false)}}}}function checkkeyonlistingswitcher(e,v){e=e||window.event;if(e.keyCode==13){getListingFromInput(v);return false}return true}function getListingFromInput(inw){enableLSelector(true);if(!alreadyrunning&&!noListingMode){var half=howmanytoshow/2;if(parseInt(inw)){var inx=parseInt(inw)}else{return false}if(inx>=begindex&&inx<=endindex){selectLbyIndex(inx,"up")}else{selectedinput.value="loading";if(inx-half+1>1&&inx+half<current_grid_totallistings){getAnySet(inx-half+1,inx+half,inw)}else{if(inx-half+1>1){getAnySet(current_grid_totallistings-howmanytoshow+1,current_grid_totallistings,inw)}else{if(inx+half<current_grid_totallistings){getAnySet(1,howmanytoshow,inw)}}}}}}function getAnySet(beg,end,selind){begindex=beg;endindex=end;setTimeout("detShowLoad();",2000);alreadyrunning=true;getListings(begindex,endindex,"down",selind)}function detShowLoad(){if(morelistingsbot.style.display==""){showLoad()}}function editListing(ddelement){fireOverlay("/cgi-bin/mainmenu.cgi?cmd=url+brokerload/changelisting/step1a.html&comingfrom=searchresults&prefix="+ddelement.attributes.getNamedItem("prefix").value+"&list_nbr="+ddelement.attributes.getNamedItem("list_nbr").value,"edit")}function listactivity(ddelement){fireOverlay("/cgi-bin/mainmenu.cgi?cmd=srv+tracking/listing.html&forid="+ddelement.attributes.getNamedItem("listing").value,"listactivity")}function fireShowingHistory(ddelement){fireOverlay("/cgi-bin/mainmenu.cgi?cmd=srv+flexcal/showing_report.html&list_id="+ddelement.attributes.getNamedItem("listing").value,"showinghistory")}function matchProspects(ddelement){fireOverlay("/cgi-bin/mainmenu.cgi?cmd=url+reports/prospectmatch/index.html&l="+ddelement.attributes.getNamedItem("listing").value,"match")}function errorForm(list_tech_id,prefix,list_nbr){if(!prefix){var prefix=""}if(!list_nbr){var list_nbr=""}fireOverlay("/cgi-bin/mainmenu.cgi?cmd=url+search/reports/mlserror.html&list_tech_id=x'"+list_tech_id+"'&prefix="+prefix+"&list_nbr="+list_nbr,"error")}function feedbackForm(ddelement){fireOverlay("/cgi-bin/mainmenu.cgi?cmd=url+search/reports/pmarreport.html&l=x'"+ddelement.attributes.getNamedItem("listing").value+"'","feedback")}function returnToCMA(){if(cart_totallistings==0){srchlog("return to cma","fail");alert("Currently, there are no listings selected.  Please select listings before attempting to bring listings back to a CMA.");return}srchlog("return to cma","success");var s='<input type="hidden" name="cmd" value="url other/geojet_send_to_cma.html">';s+='<input type="hidden" name="previous_system" value="cma">';var count=0;for(var i=1;i<=cart_totallistings;i++){s+='<input type="hidden" name="list'+i+'" value="'+sellistings[i-1]+'">';s+='<input type="hidden" name="rs'+i+'" value="'+sellistings[i-1]+'">'}s+='<input type="hidden" name="list_count" value="'+cart_totallistings+'">';s+='<input type="hidden" name="rs_count" value="'+cart_totallistings+'">';document.getElementById("returnformcontainer").innerHTML=s;window.setTimeout("document.returnform.submit();",100);opener.focus();window.blur();return}function confirmExit(){if(pendingapprove){return"THERE IS A APPROVAL ENTRY THAT HAS NOT BEEN SAVED"}}if(!forprint){window.onload=onloadCall;window.onresize=resize;window.onbeforeunload=confirmExit}var more_detail_menu=new Array();function DetailLink(title,descr,href,mls_allow,keystr){this.title=title;this.descr=descr;this.href=href;this.mls_allow=mls_allow;this.list_allow=false;this.keystr=keystr}function specialdrop(){document.getElementById("dropmenudiv").innerHTML=cromfordmenu.join("")}function fitDetailMenu(){var options_detail=document.getElementById("options_detail");var options_detail_right=document.getElementById("options_detail_right");var icons_detail_left=document.getElementById("icons_detail_left");var more=document.getElementById("options_detail_more");var BUFFER_ICONS_TABS_PX=15;var tWidth=options_detail_right.scrollWidth;var maxSize=options_detail.scrollWidth-icons_detail_left.scrollWidth-BUFFER_ICONS_TABS_PX;if(tWidth>=maxSize){more.style.display="";tWidth+=more.scrollWidth;var tmparr=new Array();for(var i in detail_links){tmparr.push(i)}for(var r=tmparr.length-1;r>=0;r--){i=tmparr[r];var elem=document.getElementById("detail_"+detail_links[i].keystr+"_link");if(!elem||elem.style.display=="none"||!detail_links[i].mls_allow||!detail_links[i].list_allow){continue}if(detail_links[i].keystr=="statistics"){more_detail_menu.unshift('<a href="javascript:;" onclick="specialdrop();">'+detail_links[i].title+"</a>")}else{more_detail_menu.unshift('<a href="javascript:;" onclick="'+detail_links[i].href+'">'+detail_links[i].title+"</a>")}tWidth-=elem.scrollWidth;elem.style.display="none";if(tWidth<maxSize){break}}}else{if(more.style.display!="none"){for(var i in detail_links){if(!detail_links[i].mls_allow||!detail_links[i].list_allow){i++;continue}var elem=document.getElementById("detail_"+detail_links[i].keystr+"_link");if(elem&&elem.style.display=="none"){elem.style.display="";tWidth+=elem.scrollWidth;if(tWidth<maxSize){for(var x=0;x<more_detail_menu.length;x++){if(more_detail_menu[x].indexOf(detail_links[i].title)>=0){more_detail_menu.splice(x,1);break}}}else{elem.style.display="none";break}}i++}}}if(more_detail_menu.length<1){document.getElementById("options_detail_more").style.display="none"}}function generateDetailMenu(){var SHOWING_INDEX="showing";var stIcon=document.getElementById("showingtimeicon");if(stIcon){if(detail_links[SHOWING_INDEX].mls_allow&&detail_links[SHOWING_INDEX].list_allow){stIcon.style.display=""}else{stIcon.style.display="none"}}document.getElementById("options_detail_more").style.display="none";var cell=document.getElementById("options_detail_right_inner");if(!cell){return}more_detail_menu=new Array();while(cell.hasChildNodes()){cell.removeChild(cell.firstChild)}for(var list_idx in detail_links){if((detail_links[list_idx].mls_allow&&detail_links[list_idx].list_allow)||detail_links[list_idx].keystr==last_detail_ran){var tmpspan=document.createElement("span");var anchor='<a id="detail_'+detail_links[list_idx].keystr+'_link" href="javascript:;" onclick="'+detail_links[list_idx].href+'" class="subTab" title="'+detail_links[list_idx].descr+'">'+detail_links[list_idx].title+"</a>";tmpspan.innerHTML=anchor;cell.appendChild(tmpspan)}}fitDetailMenu()}function detailChoice(action){switch(action){case"documents":currentlyviewing="documents";last_detail_ran="documents";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=url+reports/documents/documentviewer.html&srch_rs=true&list_tech_id=x'"+selectedlisting+"'"+additional_ajax_params;break;case"officerem":currentlyviewing="details";last_detail_ran="officerem";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=url+reports/office_remarks/index.html&list_tech_id=x'"+selectedlisting+"'"+additional_ajax_params;break;case"supplement":currentlyviewing="details";last_detail_ran="supplement";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/supplement.html&list_tech_id=x'"+selectedlisting+"'"+additional_ajax_params;break;case"taxes":currentlyviewing="tax";last_detail_ran="taxes";var msg='<div style="text-align:center;font-family:Arial,sans-serif;font-size:10pt;font-weight:bold;margin-top:10px;">Loading <img src="/images/srch_rs/loading.gif" align="absmiddle"></div>';try{document.getElementById("iframe_detail").contentWindow.document.body.innerHTML=msg}catch(e){document.getElementById("iframe_detail").src="about:blank"}document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/taxReport.html&no_html_header=true&list_tech_id="+selectedlisting+additional_ajax_params;break;case"history":currentlyviewing="details";last_detail_ran="history";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/addr_hist.html&list_tech_id=x'"+selectedlisting+"'&srch=Y&ma_search_list="+ma_search_list+additional_ajax_params;break;case"tourofhomes":currentlyviewing="details";last_detail_ran="tourofhomes";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/touropen.html&list_tech_id="+selectedlisting+"&type=T&p="+!interfaceObj.privatemode+"&i="+interfaceObj.idx+"&ps="+interfaceObj.publicside+additional_ajax_params;break;case"openhouse":currentlyviewing="openhouse";last_detail_ran="openhouse";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/touropen.html&list_tech_id="+selectedlisting+"&type=O&p="+!interfaceObj.privatemode+"&i="+interfaceObj.idx+"&ps="+interfaceObj.publicside+additional_ajax_params;break;case"calculator":currentlyviewing="calculator";last_detail_ran="calculator";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/calculator.html&list_tech_id="+selectedlisting+additional_ajax_params;break;case"showingtime":clickTab("tab_detail");currentlyviewing="showingtime";last_detail_ran="showingtime";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/showingtime.html&list_tech_id="+selectedlisting+additional_ajax_params;break;case"transactiondesk":clickTab("tab_detail");currentlyviewing="transactiondesk";last_detail_ran="transactiondesk";document.getElementById("iframe_detail").src="/cgi-bin/mainmenu.cgi?cmd=srv+srch_rs/detail/transactiondesk.html&list_tech_id="+selectedlisting+additional_ajax_params;break;default:changeDetail();break}setActiveDetailLink()}function dl(listing,idx,val){detail_links[idx].list_allow=val;var row=document.getElementById("row-"+listing);if(!row){return}if(!row.detail_links){row.detail_links=new Object()}row.detail_links[idx]=val}function sr(show){interfaceObj.show_report=show;var row=document.getElementById("row-"+selectedlisting);if(!row){return}row.i_show_rpt_cache=true;row.i_show_rpt=show}function enableDisableFullSearch(forceHidden){var fullSearchVisible=false;if(interfaceObj.idx){forceHidden=true}if(document.fullsearchform&&document.fullsearchform.fullsearchmode&&document.fullsearchform.fullsearchmode.value=="old"&&document.saveform&&document.saveform.contactMgmtBasedSearch&&document.saveform.contactMgmtBasedSearch.value=="true"){forceHidden=true}if(!forceHidden&&!interfaceObj.idx){fullSearchVisible=true;var list=document.getElementById("searchList");for(var x=0;x<list.childNodes.length;x++){if(list.childNodes.range){fullSearchVisible=false;break}}}document.getElementById("searchtab_fullsearch").style.display=(fullSearchVisible)?"":"none"};