/****************************************************************************************************/
/*                           			CORCORAN MAPS/CorcoranMapFormatter							*/
/* 						This file contains formatting functions. Data retrieved from  				*/
/*								CorcoranMapXMLHTTPClient are processed here 						*/
/*											Date Created: 09/06/2006		 						*/
/*																			 						*/
/*						Copyright © 2007-2008 The Corcoran Group, Inc. All Rights Reserved 				*/
/****************************************************************************************************/
	
var 	 total_listings=0;					//the total amount of listings returned each time
var		_neighborhoods="";
var		_nghbdropdown;					//used to store the built html select box consisting of neighborhoods.
var		_nghbdropdownstate="";
var 	category="";					//temporarily stores manhattan, brooklyn etc which are then moved to var subRequest
var 	category1="";                   //temporarily stores open house date  
var		_selectedNgbh="";				//stores selected neighborhoods
var 	ngbhinfo_areas="";				//stores selected neighborhoods before _selectedNgbh is modified
var		ohdate="";
var 	itinerary_items=new Array();
var 	_page=(document.URL.toLowerCase().match("openhouseplanner"))?"ohplanner":"mapsearch";
var 	startingAdr="";
var 	HopStopAdr="";
var 	destAdr="";
var 	borough="";
var 	boroughA="";
var 	ohdatehtml="";
var		oh_results="";
var		initialTblSrch="";
var 	browser="";
var 	selectedDate="";
var   dpdownctl = "";
var   checkboxsavesrch="";
var   chkSearch=false;
var   SrchsaveDate="";
var   SrchName="";
var   Srchborough = "";
var   srchType="";
var   txtsavesrchName="",searchdt_tr="";
var   hdnsrch1="",hdnsrch2="",hdnsrch3="";
var   showtableidimg="",showtableid="",showtableid2="",showtableid3="",showpanel="",div_panel1="",div_panel2="",div_panel3="";
var   link_type1="",link_type2="",link_type3="",spanel1=0,spanel2=0,spanel3=0,sp1=0,sp2=0,sp3=0,preg="";
var   btnimgsave="",flgsave=0,hidelink="",hidelink2="",hidelnk2="",hidelnk22="",hidelnk3="",hidelnk33="";
var   bflgpgload="",spnload1=0,spnload2=0,spnload3=0,spn1=0,spn2=0,spn3=0,chomeborough1="",chomeborough2="",chomeborough3="";
var   chcookie1="",chcookie2="",chcookie3="",vgstrList="",vgstrOpenhseList="",resErrorHtml="",bsavehflg=0;
var   vArrcookies = new Array();
var   vArrLinkcookies = new Array();
var   vbphmp = "";
var   tdln11="",tdln22="",tdln33="",tdlid11="",tdlid22="",tdlid33="",tddt11="",tddt22="",tddt33="";
var   tdline11="",tdline22="",tdline33="",dvline11 = "",dvline22="",dvline33="";
var	  brent="",bprewar="",bpostwar="",bopenhouseflag="";
var		boutdoor="",bfireplace="",bpets="",bdoorman="",bdiningroom="",brooms=-1,bsubway=-1;
var		barea=-1,bflgbeds=-1,bflgbaths=-1,bprice=-1;
var	  bapmt="",bmulfam="",bsingle="",btwnhse="",bloft="",bcoop="",bcondos="",btennis="",bsouthofhighway="",bpool="",bdock="";
var	  ccntoutdoor=0,ccntprewar=0,ccntpostwar=0,ccntopenhouseflag=0,ccnttennis=9,ccntsouthofhighway=0,ccntpool=0,ccntdock=0;
var		ccntrent=0,ccntfireplace=0,ccntpetsallowed=0,ccntdoorman=0,ccntdiningroom=0,ccntrooms=0,ccntsubway=0;
var		ccntarea=0,ccntflgbeds=0,ccntflgbaths=0,ccntprice=0;
var	  ccntapmt=0,ccntmulfam=0,ccntsingle=0,ccnttwnhse=0,ccntloft=0,ccntcoop=0,ccntcondos=0,vflgldall=0;
var	  vpath = "",vlink1click="",vlink1click2="",vngbh="";

function StartMap(stype,subtype)
{
	if(document.getElementById("map"))load();	
	if(stype!="" && subtype!="")
	{
		document.getElementById("div_loading").style.display='block';
		document.getElementById("TblSearch").style.visibility='hidden';
		ChangeMapLocation(subtype);//corcoranMapAPI function
		SendXmlHttpRequest(stype,subtype,category1);
	}
	/*
	if (navigator.appVersion.indexOf("MSIE")!=-1){//IE
		browser="IE";
	if(navigator.userAgent.indexOf("Firefox")!=-1){//firefox
		browser="FX";
	*/
}

/*function LoadAllListings(cb) {
	var elements		=	document.getElementsByTagName('input');
	var chkbox			=	document.getElementById(cb);
	var temp			=	cb.split('_');
	if(_page=="ohplanner")ohdatehtml=document.getElementById("div_topoptions").innerHTML;
	if(document.getElementById('div_TblSearch'))	initialTblSrch=document.getElementById('div_TblSearch').innerHTML;
	if(ChkDate()){			
		category=temp[0];		
		if(chkbox.checked==true){
			document.getElementById("div_"+category+"_loading").style.display='block';
		}else{document.getElementById("div_"+category+"_loading").style.display='none';}
		
		//uncheck all other checkboxes
		for(var i=0;i<elements.length;i++){
			if((elements[i].getAttribute('type')=='checkbox') && (elements[i].getAttribute('id')!=cb)){
				elements[i].checked=false;
			}
		}
		if(chkbox.checked==true){		
			SendXmlHttpRequest("ListingsCount",category);
		}	
	}else chkbox.checked=false;
}*/
function DisplayModifiedSrch(res)
{

////////alert('DisplayModifiedSrch');
/*if(res == "SearchFull")
    {
    ////alert('Maximum 3 searches are allowed, delete one of the searches to save this search');
    checkboxsavesrch.checked = false;
    txtsavesrchName = document.getElementById('ctl00_ContentMain_txtSrchname');
    txtsavesrchName.value = "";
    return false;
    }*/
 ////////alert('res');
 ////////alert(res);
 ////////alert('V');
 	 if(document.getElementById("tr_div_savesearch"))
		document.getElementById("tr_div_savesearch").style.display = 'none';
 var strresult = res;
 var vSrchname="",vReg="",vNoofListing="",vDateadded="";
 var strarrRes="";
    strarrRes = strresult.split(',');
    vSrchname = strarrRes[0];
    vReg = strarrRes[1];
    vNoofListing = strarrRes[2];
    vDateadded = strarrRes[3];
////////alert(vSrchname);
 ////////alert('V1');
////////alert(vReg);
 ////////alert('V2');
////////alert(vNoofListing);
 ////////alert('V3');
////////alert(vDateadded);
 ////////alert('V4');
	            var searchcnt1 = document.getElementById('srchdata1ML_td');
				var searchcnt2 = document.getElementById('srchdata2ML_td');
				var searchcnt3 = document.getElementById('srchdata3ML_td');
				
			//	var hdnsrchname1 = document.getElementById(hddate).value;
			//	var hdnsrchname2 = document.getElementById('hdSrchname2');
			//	var hdnsrchname3 = document.getElementById('hdSrchname3');
			//	var hdnsrchname4 = document.getElementById('hdSrchname4');
				
				var searchName1 = document.getElementById('srchdata1SN_td');
				var searchName2 = document.getElementById('srchdata2SN_td');
				var searchName3 = document.getElementById('srchdata3SN_td');
				 
				var searchReg1 = document.getElementById('srchdata1REG_td');
				var searchReg2 = document.getElementById('srchdata2REG_td');
				var searchReg3 = document.getElementById('srchdata3REG_td');
				 
				var searchDat1 = document.getElementById('srchdata1SD_td');
				var searchDat2 = document.getElementById('srchdata2SD_td');
				var searchDat3 = document.getElementById('srchdata3SD_td');
				
				var searchDel1=document.getElementById('srchdata1DEL_td');
				var searchDel2=document.getElementById('srchdata2DEL_td');
				var searchDel3=document.getElementById('srchdata3DEL_td');
				
				 //searchcnt1.display = true;
			
				//var innerhtm1 = searchcnt1.innerHTML;
				
			   /* ////alert('hdnname 1');
			    ////alert(hdnsrch1);
                ////alert('hdnname 2');
			   ////alert(hdnsrch2);
			     ////alert('hdnname 3');
			   ////alert(hdnsrch3);*/
			    
				if(hdnsrch1 == vSrchname){
				
				    searchcnt1.innerHTML="";               
		            searchName1.innerHTML="";
		            searchReg1.innerHTML="";
		            searchDat1.innerHTML="";
		            searchDel1.innerHTML="";
		            
		            searchcnt1.innerHTML=vNoofListing;               
		            searchName1.innerHTML="<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname+"','"+vDateadded+"','"+vReg+"')\" >"+vSrchname+"</a>";
		            searchReg1.innerHTML=vReg;
		            searchDat1.innerHTML=vDateadded;
		            searchDel1.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname+"')\" >"+"Delete"+"</a>";	
		        }
		        else if(hdnsrch2 == vSrchname){
		            searchcnt2.innerHTML="";               
		            searchName2.innerHTML="";
		            searchReg2.innerHTML="";
		            searchDat2.innerHTML="";
		            searchDel2.innerHTML="";
		            
                    searchcnt2.innerHTML=vNoofListing;
                    searchName2.innerHTML= "<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname+"','"+vDateadded+"','"+vReg+"')\" >"+vSrchname+"</a>";
		            searchReg2.innerHTML=vReg;
		            searchDat2.innerHTML=vDateadded;
                    searchDel2.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname+"')\" >"+"Delete"+"</a>";	
		        }
		        else if (hdnsrch3 == vSrchname) {
		            searchcnt3.innerHTML="";               
		            searchName3.innerHTML="";
		            searchReg3.innerHTML="";
		            searchDat3.innerHTML="";
		            searchDel3.innerHTML="";
		            
		            searchcnt3.innerHTML=vNoofListing;
		            searchName3.innerHTML="<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname+"','"+vDateadded+"','"+vReg+"')\" >"+vSrchname+"</a>";
		            searchReg3.innerHTML=vReg;
		            searchDat3.innerHTML=vDateadded;
		            searchDel3.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname+"')\" >"+"Delete"+"</a>";	
		        }

	if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx"))	
		window.location.reload(true); 				
}

function  DisplaySaveSrch(res)
{
////////alert('DisplaySaveSrch');
	 if(document.getElementById("tr_div_savesearch"))
		document.getElementById("tr_div_savesearch").style.display = 'none';
if(res == "SearchFull")
    {
    ////alert('Maximum 3 searches are allowed, delete one of the searches to save this search');
    checkboxsavesrch.checked = false;
    txtsavesrchName = document.getElementById('ctl00_ContentMain_txtSrchname');
    txtsavesrchName.value = "";
    return false;
    }
		
		if(document.getElementById("Savesrch"))
			 document.getElementById("Savesrch").style.display = 'block';
			 
		if(document.getElementById("txtSrchname"))
			document.getElementById("txtSrchname").Value = "";

		if(document.getElementById("chkSaveSearch"))
			document.getElementById("chkSaveSearch").checked = false;
			
	
 var strresult = res;
 var vSrchname="",vReg="",vNoofListing="",vDateadded="";
 var strarrRes="";
    strarrRes = strresult.split(',');
    vSrchname = strarrRes[0];
    vReg = strarrRes[1];
    vNoofListing = strarrRes[2];
    vDateadded = strarrRes[3];
////////alert(vSrchname);
 ////////alert('V1');
////////alert(vReg);
 ////////alert('V2');
////////alert(vNoofListing);
 ////////alert('V3');
////////alert(vDateadded);
 ////////alert('V4');
	            var searchcnt1 = document.getElementById('srchdata1ML_td');
				var searchcnt2 = document.getElementById('srchdata2ML_td');
				var searchcnt3 = document.getElementById('srchdata3ML_td');
				
				var searchName1 = document.getElementById('srchdata1SN_td');
				var searchName2 = document.getElementById('srchdata2SN_td');
				var searchName3 = document.getElementById('srchdata3SN_td');
				 
				var searchReg1 = document.getElementById('srchdata1REG_td');
				var searchReg2 = document.getElementById('srchdata2REG_td');
				var searchReg3 = document.getElementById('srchdata3REG_td');
				 
				var searchDat1 = document.getElementById('srchdata1SD_td');
				var searchDat2 = document.getElementById('srchdata2SD_td');
				var searchDat3 = document.getElementById('srchdata3SD_td');
				
				var searchDel1=document.getElementById('srchdata1DEL_td');
				var searchDel2=document.getElementById('srchdata2DEL_td');
				var searchDel3=document.getElementById('srchdata3DEL_td');
				
				 //searchcnt1.display = true;
			
				//var innerhtm1 = searchcnt1.innerHTML;
				
			
				if(searchcnt1.innerHTML == ""){
		            searchcnt1.innerHTML=vNoofListing;               
		            searchName1.innerHTML="<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname+"','"+vDateadded+"','"+vReg+"')\" >"+vSrchname+"</a>";
		            searchReg1.innerHTML=vReg;
		            searchDat1.innerHTML=vDateadded;
		            searchDel1.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname+"')\" >"+"Delete"+"</a>";	
		        }
		        else if(searchcnt2.innerHTML == ""){
                    searchcnt2.innerHTML=vNoofListing;
                    searchName2.innerHTML= "<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname+"','"+vDateadded+"','"+vReg+"')\" >"+vSrchname+"</a>";
		            searchReg2.innerHTML=vReg;
		            searchDat2.innerHTML=vDateadded;
                    searchDel2.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname+"')\" >"+"Delete"+"</a>";	
		        }
		        else if (searchcnt3.innerHTML == "") {
		        searchcnt3.innerHTML=vNoofListing;
		            searchName3.innerHTML="<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname+"','"+vDateadded+"','"+vReg+"')\" >"+vSrchname+"</a>";
		            searchReg3.innerHTML=vReg;
		            searchDat3.innerHTML=vDateadded;
		            searchDel3.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname+"')\" >"+"Delete"+"</a>";	
		        }
    if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx"))	
		window.location.reload(true); 				
}

function Search_Change(chkbx,txtbxsrchname,bed,bath,price,area,rooms,apmt ,mulfam ,single ,twnhse,coop ,condos,prewar,postwar,loft,pets,outdoor,doorman,rent,opnhse,fireplace,diningroom,subwayline,tennis,southofthehwy,pool,dock)
{
var specialChars="\\(\\)<>@,;:^'!`~#$%&*-+={}?/|\\\\\\\"\\.\\[\\]";

 //alert('in search change function');
 //alert(subRequest);
 //alert(document.getElementById(area).value);
 
	if(document.getElementById(txtbxsrchname))
	{
		if(document.getElementById(txtbxsrchname).value == "")
		{
			alert('Provide Search Name !!');
			document.getElementById(chkbx).checked = false;
			document.getElementById('ctl00_ContentMain_txtSrchname').focus();
			return false;
		}
	}
      
    if(total_listings == 0)
    {
		alert('Search list empty,Please try again!!');
		document.getElementById(chkbx).checked = false;
		return false;
	}
        
		
    if(document.getElementById(txtbxsrchname))
     txtsavesrchName = document.getElementById(txtbxsrchname).value;

	if(document.getElementById(txtbxsrchname)){
	if(txtsavesrchName.length > 25)
	{
		alert('Maximum Length for Search Name is 25 Characters!!');
		document.getElementById(chkbx).checked = false;
		document.getElementById('ctl00_ContentMain_txtSrchname').focus();
		return false;
	}
	}
	
	if(document.getElementById(txtbxsrchname)){
		for (var i = 0; i < document.getElementById(txtbxsrchname).value.length; i++) {
			if (specialChars.indexOf(document.getElementById(txtbxsrchname).value.charAt(i)) != -1) 
			{
				alert('Special Characters are not allowed.Please remove them and try again!!');
				document.getElementById(chkbx).checked = false;
				document.getElementById('ctl00_ContentMain_txtSrchname').focus();
				return false;
			}
		}	
	}
	
	//hdSrchname
	if(document.getElementById(txtbxsrchname)){
	var vhdsrch1 = "",vhdsrch2 = "",vhdsrch3 = "";
	
	if(document.getElementById("hdSrchname"))
		vhdsrch1 = document.getElementById("hdSrchname").value;
	
	if(document.getElementById("hdSrchname2"))
		vhdsrch2 = document.getElementById("hdSrchname2").value;
	
	if(document.getElementById("hdSrchname3"))
		vhdsrch3 = document.getElementById("hdSrchname3").value;
	
//	alert('s1');
//	alert(vhdsrch1);
//	alert('s2');
//	alert(vhdsrch2);
//	alert('s3');
//	alert(vhdsrch3);
	
	if(document.getElementById(txtbxsrchname).value == vhdsrch1 ||
	document.getElementById(txtbxsrchname).value == vhdsrch2 ||
	document.getElementById(txtbxsrchname).value == vhdsrch3)
	{
		alert("Search Name already exists, Please Provide a different name!!");
		document.getElementById(chkbx).checked = false;
		document.getElementById('ctl00_ContentMain_txtSrchname').focus();
		return false;
	}
	
	}

    var dpdnroom = document.getElementById(rooms);
    var dpdnsubwline = document.getElementById(subwayline);

    if(document.getElementById(bed))
        beds =document.getElementById(bed).value;
    
    if(document.getElementById(dpdnroom))
	rooms=dpdnroom.options[dpdnroom.selectedIndex].value;	

    if(document.getElementById(dpdnsubwline))
	subwayline=dpdnsubwline.options[dpdnsubwline.selectedIndex].value;
	
	if(document.getElementById(bath))
	baths=document.getElementById(bath).value;
	if(document.getElementById(apmt))
	apmt=document.getElementById(apmt).checked;
	
	if(document.getElementById(area).value != "" && document.getElementById(area).value != "all")
	ngbh=document.getElementById(area).value;
	
	if(document.getElementById(price))
	price=document.getElementById(price).value;
	
	if(document.getElementById(mulfam))
	mulfam=document.getElementById(mulfam).checked;
	
	if(document.getElementById(single))
	single=document.getElementById(single).checked;
	
	if(document.getElementById(twnhse))
	twnhse=document.getElementById(twnhse).checked;
	
	if(document.getElementById(coop))
	coop=document.getElementById(coop).checked;
	
	if(document.getElementById(condos))
	condos=document.getElementById(condos).checked;
	
	if(document.getElementById(loft))
	loft=document.getElementById(loft).checked;
	
	if(document.getElementById(prewar))
	prewar=document.getElementById(prewar).checked;
	
	if(document.getElementById(postwar))
	postwar=document.getElementById(postwar).checked;
	
	if(document.getElementById(pets))
	pets=document.getElementById(pets).checked;
	
	if(document.getElementById(outdoor))
	outdoor=document.getElementById(outdoor).checked;
	
	if(document.getElementById(doorman))
	doorman=document.getElementById(doorman).checked;
	
	if(document.getElementById(rent))
	rent=document.getElementById(rent).checked;
	
	if(document.getElementById(opnhse))
	opnhse=document.getElementById(opnhse).checked;
	
	if(document.getElementById(fireplace))
	fireplace=document.getElementById(fireplace).checked;
	
	if(document.getElementById(diningroom))
	diningroom=document.getElementById(diningroom).checked;
	
	//tennis  southofthehwy pool dock
	if(document.getElementById(tennis))
	tennis=document.getElementById(tennis).checked;
	
	if(document.getElementById(southofthehwy))
	southofthehwy=document.getElementById(southofthehwy).checked;		
	
	if(document.getElementById(pool))
	pool=document.getElementById(pool).checked;

	if(document.getElementById(dock))
	dock=document.getElementById(dock).checked;		
	
/*rooms
apmt
mulfam
single
twnhse
coop
condos
prewar
postwar
loft
pets
outdoor
doorman
rentsale
opnhse
fireplace
diningroom*/

  if(document.getElementById(bed)){
        if(document.getElementById(bed).value != "")
        BStrSecured('beds',document.getElementById(bed).value);
    }
    
    if(document.getElementById(bath)){   
    if(document.getElementById(bath).value != "")
        BStrSecured('baths',document.getElementById(bath).value);
    }
    
    if(document.getElementById(dpdnroom)){
    if(dpdnroom.options[dpdnroom.selectedIndex].value != "")
        BStrSecured('Rooms',dpdnroom.options[dpdnroom.selectedIndex].value);
    }
    
    if(document.getElementById(dpdnsubwline)){
    if(dpdnsubwline.options[dpdnsubwline.selectedIndex].value != "")
        BStrSecured('subway',dpdnsubwline.options[dpdnsubwline.selectedIndex].value);
    }
    
    if(document.getElementById(tennis)){
        if(document.getElementById(tennis).value != "")
        BStrSecured('tennis',document.getElementById(tennis).value);
    }
    
  	if(document.getElementById(southofthehwy)){
        if(document.getElementById(southofthehwy).value != "")
        BStrSecured('southofthehwy',document.getElementById(southofthehwy).value);
    }
    
  	if(document.getElementById(pool)){
        if(document.getElementById(pool).value != "")
        BStrSecured('pool',document.getElementById(pool).value);
    }    
    
  	if(document.getElementById(dock)){
        if(document.getElementById(dock).value != "")
        BStrSecured('dock',document.getElementById(dock).value);
    }    
        
    if(document.getElementById(price)){
    if(document.getElementById(price).value != ""){
    	  alert('BtrSecured');
    	  alert(document.getElementById(price).value);
        BStrSecured('price',document.getElementById(price).value);
      }
    }
//	alert('vflgldall');
//	alert(vflgldall);
	//if(vflgldall == 1){
		if(document.getElementById(area)){ 
		if(document.getElementById(area).value != "" && document.getElementById(area).value != "all")
           BStrSecured('area',document.getElementById(area).value);
    }
	//}

 
   
 	{
 
 	checkboxsavesrch = document.getElementById(chkbx);
 if(checkboxsavesrch.checked){
 	
 	var Now = new Date();
 	var vDay=Now.getDate();
	var vMonth =Now.getMonth()+1;
 	var vYear=Now.getYear();
 	SrchsaveDate =vMonth+'/'+ vDay+'/'+vYear;
 	
    chkSearch  = true;
    
 	if(document.getElementById(txtbxsrchname))
 	    SrchName = document.getElementById(txtbxsrchname).value;
 
			q_detail=CompileQ();
			if (srchType == "AllListings") {
			
			 count_by="ngbh";
			  ////////alert('search_change');
             ////////alert(count_by);
		    }
//			alert('search_change');
//		    alert('q_detail');
//		    alert(q_detail);
			//SendPreciseXmlHttpRequest("ListingsCount",subRequest,q_detail,"");
			SendSavePreciseXmlHttpRequest("ListingsCount",subRequest,q_detail,"");
    }
    }
	if(document.getElementById("tr_div_savesearch"))
		document.getElementById("tr_div_savesearch").style.display = 'block';
		
	if(document.getElementById("tr_tbl_searchdetail"))
		document.getElementById("tr_tbl_searchdetail").style.display = 'none';
		
}

function view_result(v1,v2,v3)
{
    //q_detail=CompileQ();
    SendViewListPreciseXmlHttpRequest("ViewasList","",v1,v2,v3);
}

function Search_EditChange(imgbtn,editsrch,editsrchtd,bed,bath,price,area,rooms,apmt ,mulfam ,single ,twnhse,coop ,condos,prewar,postwar,loft,pets,outdoor,doorman,rent,opnhse,fireplace,diningroom,subwayline,hdn1,hdn2,hdn3,srchdetail,tennis,southofthehwy,pool,dock)
{
 ////////alert('in Search_EditChange function');
 ////////alert(subRequest);
 ////////alert(ngbhinfo_areas);
 //document.getElementById(srchdetail).style.visibility='visible';
     if(total_listings == 0)
    {
		alert('Search list empty,Please try again!!');
		return false;
	}
	txtsavesrchName = document.getElementById(editsrchtd).innerHTML; //document.getElementById(txtbxsrchname).value;
	////////alert('search name');
	////////alert(txtsavesrchName);
	 if(document.getElementById("tr_div_savesearch"))
		document.getElementById("tr_div_savesearch").style.display = 'block';
		
     if (document.getElementById(srchdetail)) {
    searchdt_tr = document.getElementById(srchdetail);
    document.getElementById(srchdetail).style.visibility='visible';
    }
    
    if (document.getElementById(editsrch)) {
    document.getElementById(editsrch).style.visibility='hidden';
    }
    
    hdnsrch1 = document.getElementById(hdn1).value;
    hdnsrch2 = document.getElementById(hdn2).value;
    hdnsrch3 = document.getElementById(hdn3).value;
    
    
var dpdnroom = document.getElementById(rooms);
var dpdnsubwline = document.getElementById(subwayline);

//if(document.getElementById(bed).value != "" && document.getElementById(bed).value != "all")
//{
    if(document.getElementById(bed))
     beds ="beds ="+document.getElementById(bed).value;
//}

//if(dpdnroom.options[dpdnroom.selectedIndex].value != "" && dpdnroom.options[dpdnroom.selectedIndex].value != "all")
//{
    if(document.getElementById(dpdnroom))
	 rooms="rooms ="+dpdnroom.options[dpdnroom.selectedIndex].value;	
//}
	
//if(dpdnsubwline.options[dpdnsubwline.selectedIndex].value != "" && dpdnsubwline.options[dpdnsubwline.selectedIndex].value != "all"){
	if(document.getElementById(dpdnsubwline))
	    subwayline="subwayline ="+dpdnsubwline.options[dpdnsubwline.selectedIndex].value;
	//}
	
	baths="baths ="+document.getElementById(bath).value;
	apmt="apmt ="+document.getElementById(apmt).checked;
	
	if(document.getElementById(area).value != "" && document.getElementById(area).value != "all")
	    ngbh="area ='"+document.getElementById(area).value+"'";
	    
	if(document.getElementById(price))
	price="price ="+document.getElementById(price).value;
	
	if(document.getElementById(mulfam))
	mulfam="mulfam ="+document.getElementById(mulfam).checked;
	
	if(document.getElementById(single))
	single="single ="+document.getElementById(single).checked;
	
	if(document.getElementById(twnhse))
	twnhse="twnhse ="+document.getElementById(twnhse).checked;
	
	if(document.getElementById(coop))
	coop="coop ="+document.getElementById(coop).checked;
	
	if(document.getElementById(condos))
	condos="condos ="+document.getElementById(condos).checked;
	
	if(document.getElementById(loft))
	loft="loft ="+document.getElementById(loft).checked;
	
	if(document.getElementById(prewar))
	prewar="prewar ="+document.getElementById(prewar).checked;
	
	if(document.getElementById(postwar))
	postwar="postwar ="+document.getElementById(postwar).checked;
	
	if(document.getElementById(pets))
	pets="pets ="+document.getElementById(pets).checked;
	
	if(document.getElementById(outdoor))
	outdoor="outdoor ="+document.getElementById(outdoor).checked;
	
	if(document.getElementById(doorman))
	doorman="doorman ="+document.getElementById(doorman).checked;
	
	if(document.getElementById(rent))
	rent="rent ="+document.getElementById(rent).checked;
	
	if(document.getElementById(opnhse))
	opnhse="opnhse ="+document.getElementById(opnhse).checked;
	
	if(document.getElementById(fireplace))
	fireplace="fireplace ="+document.getElementById(fireplace).checked;
	
	if(document.getElementById(diningroom))
	diningroom="diningroom ="+document.getElementById(diningroom).checked;

	if(document.getElementById(tennis))
	tennis="tennis ="+document.getElementById(tennis).checked;
	
	if(document.getElementById(southofthehwy))
	southofthehwy="southofthehwy ="+document.getElementById(southofthehwy).checked;
	
	if(document.getElementById(pool))
	pool="pool ="+document.getElementById(pool).checked;
	
	if(document.getElementById(dock))
	dock="dock ="+document.getElementById(dock).checked;			

    if(document.getElementById(bed)){
        if(document.getElementById(bed).value != "")
        BStrSecured('beds',document.getElementById(bed).value);
    }
    
    if(document.getElementById(bath)){   
    if(document.getElementById(bath).value != "")
        BStrSecured('baths',document.getElementById(bath).value);
    }
    
    if(document.getElementById(dpdnroom)){
    if(dpdnroom.options[dpdnroom.selectedIndex].value != "")
        BStrSecured('Rooms',dpdnroom.options[dpdnroom.selectedIndex].value);
    }
    
    if(document.getElementById(dpdnsubwline)){
    if(dpdnsubwline.options[dpdnsubwline.selectedIndex].value != "")
        BStrSecured('subway',dpdnsubwline.options[dpdnsubwline.selectedIndex].value);
    }
    
    if(document.getElementById(price)){
    if(document.getElementById(price).value != "")
        BStrSecured('price',document.getElementById(price).value);
    }
    
	if(document.getElementById(area)){
    if(document.getElementById(area).value != "" && document.getElementById(area).value != "all")
        BStrSecured('area',document.getElementById(area).value);
    }
    /* if(document.getElementById(txtbxsrchname).value == "")
    {
    document.getElementById(chkbx).checked = false;
    ////alert('Provide a name for the search');
    return false;
    }
    */
    
    if(total_listings == 0)
        {
        //document.getElementById(chkbx).checked = false;
          ////alert('Search list is empty');
          return false;
        }
        
   
 	{
 
 //	checkboxsavesrch = document.getElementById(chkbx);
// if(checkboxsavesrch.checked)
{
 	
 	var Now = new Date();
 	var vDay=Now.getDate();
 	var vMonth =Now.getMonth();
 	var vYear=Now.getYear();
 	SrchsaveDate =vMonth+'/'+ vDay+'/'+vYear;
 	
   // chkSearch  = true;
    
 	//if(document.getElementById(txtbxsrchname))
 	  SrchName = txtsavesrchName;
 
			q_detail=CompileQ();
			if (srchType == "AllListings") {
			
			 count_by="ngbh";
			//alert('count_by');
            //alert(count_by);
		    }
		   //alert('q_detail');
		   //alert(q_detail);
			//SendPreciseXmlHttpRequest("ListingsCount",subRequest,q_detail,"");
			SendEditPreciseXmlHttpRequest("EditMapSearch",subRequest,q_detail,"",dpdnsubwline.options[dpdnsubwline.selectedIndex].value);
    }
    }
}


function LoadAllListings(cb,cbOhDate) {
	
	//alert('cb is');
	//////alert(cb);
	var elements		=	document.getElementsByTagName('input');
	var chkbox			=	document.getElementById(cb);
	var elements1		=	document.getElementsByTagName('input');

	vflgldall = 1;
	dpdownctl = cbOhDate;
	
	vpath="searchText";
	
	var temp			=	cb.split('_');
	if(_page=="ohplanner"){if(document.getElementById("div_topoptions")){ohdatehtml=document.getElementById("div_topoptions").innerHTML;}}
	if(document.getElementById('div_TblSearch'))	initialTblSrch=document.getElementById('div_TblSearch').innerHTML;
	if(ChkDate()){			
		category=temp[0];
	//alert(category);   
	    if(cbOhDate == "ctl00_ContentMain_OHDate"){
	            var DrpDn1 = document.getElementById(cbOhDate);
	            var ohd1=document.getElementById("ctl00_ContentMain_OHDate");
			    ohdate=(ohd1.options[ohd1.selectedIndex].value!="")?" ohdate='"+ohd1.options[ohd1.selectedIndex].value+"' ":"";
		        category1 = DrpDn1.options[DrpDn1.selectedIndex].value; 	
	     }
	 
		
		if(chkbox.checked==true){
			document.getElementById("div_"+category+"_loading").style.display='block';
		}else{document.getElementById("div_"+category+"_loading").style.display='none';}
		
		//uncheck all other checkboxes
		for(var i=0;i<elements.length;i++){
			if((elements[i].getAttribute('type')=='checkbox') && (elements[i].getAttribute('id')!=cb)){
				elements[i].checked=false;
			}
		}
		
		if(chkbox.checked==true){		
//			if(document.getElementById("tbl_searchdetail"))
//				document.getElementById("tbl_searchdetail").style.display = 'block';
			SendXmlHttpRequest("ListingsCount",category,category1);
		}	
	}else chkbox.checked=false;
}


function ProcessLoading(cnt){

//////alert(category);
	
//	if(cnt == "Search Name already exists,Provide a different Name.")
//	  {
//	    alert('Search Name already exists,Provide a different Name.');
//	    checkboxsavesrch.checked = false;
//	    if(document.getElementById('ctl00_ContentMain_txtSrchname'))
//	      document.getElementById('ctl00_ContentMain_txtSrchname').focus();
//	    return false;
//	  }
	
	var searchtype="SrchAllListings";
	if(cnt==0){
	alert("Sorry, there are no open houses available\nfor the date selected, please try again.");
		document.getElementById("div_"+category+"_loading").innerHTML="";
	}else{
		if(category!=null && category!=undefined && category!="")
		{document.getElementById("div_"+category+"_loading").innerHTML="Loading "+cnt+" Listings... Please Wait";}
    if(document.URL.toLowerCase().match("cmembers"))
	{ 
	  if(chkSearch){
	    searchtype="SaveSrchAllListings";	   
	    //SendXmlHttpSaveRequest(searchtype,category,category1,q_detail);
	    }
	    else
	        SendXmlHttpRequest(searchtype,category,category1);
	}
	else
		SendXmlHttpRequest(searchtype,category,category1);
	}	
}
function SetNonNYCDirections(){
alert('SetNonNYCDirections');
	document.getElementById("divMapLoading").style.display="none";
	var html="";
	var clr_1 = "#D6D6D6";
   	var clr_2 = "#FFFFFF";
	var cnt=0;
	var bg_color = "";
	var mpAdr="";
	html="<table class='text11px' width=270>";
	var newAdr=new Array();
	newAdr.adr=startingAdr;
	for(var i=0;i<itinerary_items.length;i++){
		if (cnt==0){
        	bg_color = "bgcolor=" + clr_1;
			cnt = 1;
        }else{
    		bg_color = "bgcolor=" + clr_2;
        	cnt = 0;
        }
		mpAdr=itinerary_items[i][11]+", "+GetHopStopRegion();
		html+="<tr "+bg_color+" onmouseover=\"this.style.cursor='pointer'\"><td>";
		html+="<a class='graylink' target='_blank' href='http://maps.google.com/maps?saddr="+newAdr.adr;
		html+="&daddr="+mpAdr+"'>";
		html+="Directions from "+newAdr.adr +"<br>to ";
		html+=itinerary_items[i][11]+", "+GetHopStopRegion()+"</a></td></tr>";
		newAdr.adr=itinerary_items[i][11];
	}
	html+="</table>";	
	document.getElementById("divLoading").style.display="none";
	document.getElementById('TblSearchResults_div').innerHTML=html;
}
function RequestAllListings(val,type){
//alert('RequestAllListings');
//alert(val);
srchType = val;
category = type;
	if(document.getElementById('div_TblSearch'))
		initialTblSrch=document.getElementById('div_TblSearch').innerHTML;
	ChangeMapLocation(type);//a corcoranMapAPI function 
	SendXmlHttpRequest(val,type,category1);
}
function ChkDate(){
	if(_page=="ohplanner")
	{
	//////alert('in ohplanner');
	
	//////alert(_page);
	if(document.getElementById("ctl00_ContentMain_OHDate")){
		if(document.getElementById("ctl00_ContentMain_OHDate").selectedIndex==0){
			////alert("Please select a day for your open house planner\nfrom the dropdown list above");
			document.getElementById("ctl00_ContentMain_OHDate").focus();return false;
		}else{ return true;}
		}
	}else{ return true;}
}
	
function RequestPreciseListings(val,type,s_detail){
//alert('RequestPreciseListings');
//alert(val);
//alert(s_detail);

if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx"))
{
//if(document.getElementById)

}

if(document.getElementById("ctl00_ContentMain_OHDate")){

	SendPreciseXmlHttpRequest(val,subRequest,s_detail,document.getElementById("ctl00_ContentMain_OHDate").options[document.getElementById("ctl00_ContentMain_OHDate").selectedIndex].value);	
	}
	else
	{
	if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx"))
	{
	    SendSavePreciseXmlHttpRequest(val,subRequest,s_detail,"");
	}
	else if(document.URL.toLowerCase().match("cmembers/mysubscriptions.aspx"))
	{
	    SendSavePreciseXmlHttpRequest(val,subRequest,s_detail,"");
	}
	else if(document.URL.toLowerCase().match("property/openhouseplanner"))
	{
	    if(category1 != "")
	    {	   
	        SendPreciseXmlHttpRequest(val,subRequest,s_detail,category1);
	    }
	}
	else
	    SendPreciseXmlHttpRequest(val,subRequest,s_detail,"");	
	}
	similarlistings="";//clear onetime search terms
}



function RequestThisNgbhInfo(id,ngbhinfo_areas){
	SendNgbhInfoXmlHttpRequest(id,ngbhinfo_areas);
}
function ProcessHopStopInfo(r){
	
	document.getElementById("divLoading").style.display="none";
	if(document.getElementById('TblSearchResults_div'))
	{
		document.getElementById('TblSearchResults').style.display = "block";
		document.getElementById('TblSearchResults_div').style.display = "block";
		document.getElementById('TblSearchResults_div').innerHTML=r;
	}
}
function ChangeDateFormat(){
	var s=document.getElementById("ctl00_ContentMain_OHDate");
	for(var i=0;i<s.options.length;i++)
		s.options[i].innerHTML=DFC(s.options[i].innerHTML);//dateformatchange
}
function DFC(d){
	var date="Select One";
	if(d!="Select One"){
		var s=d.split("."),day,month;
		var p=s[0].split("-");
		day=FormatDay(p[0]);
		month=FormatMonth(s[1]);
		date=day+" "+month+" "+s[2]+", "+p[1];
	}
	return date;
}
function FormatMonth(d){
	var mon="";
	switch(d){
		case "01":
			mon="January";
			break;
		case "02":
			mon="February";
			break;
		case "03":
			mon="March";
			break;
		case "04":
			mon="April";
			break;
		case "05":
			mon="May";
			break;
		case "06":
			mon="June";
			break;
		case "07":
			mon="July";
			break;		
		case "08":
			mon="August";
			break;	
		case "09":
			mon="September";
			break;	
		case "10":
			mon="October";
			break;	
		case "11":
			mon="November";
			break;	
		case "12":
			mon="December";
			break;	
	}
	return mon;
}

function P2showpicture4(listid4,region)
{
 //alert(listid4);
  window.location.href = "property/listing.aspx?Region="+region+"&ListingID="+ listid4;
}

function FormatDay(d){
	var day="";
	switch(d){
		case "Sun":
			day="Sunday";
			break;
		case "Mon":
			day="Monday";
			break;
		case "Tue":
			day="Tuesday";
			break;
		case "Wed":
			day="Wednesday";
			break;
		case "Thu":
			day="Thursday";
			break;
		case "Fri":
			day="Friday";
			break;
		case "Sat":
			day="Saturday";
			break;		
	}
	return day;
}
function ShowHideNeighborhood(m,b,q,f,h)
{    
    sendxmlngbhdisplayrequest(m,b,q,f,h);
}
function Displayngbhplanner(results)
{
    var vres = results.split("~");
    
    if(vres.length > 0)
    {
        //manhattan
        if(vres[0] == "Y")
            document.getElementById("TblAllManhattan").style.display='block';
        else if(vres[0] == "N")
            document.getElementById("TblAllManhattan").style.display='none';    
            
        //brooklyn
        if(vres[1] == "Y")
            document.getElementById("TblAllBrooklyn").style.display='block';
        else if(vres[1] == "N")
            document.getElementById("TblAllBrooklyn").style.display='none';        
        
        //queens            
        if(vres[2] == "Y")
            document.getElementById("TblAllQueens").style.display='block';
        else if(vres[2] == "N")
            document.getElementById("TblAllQueens").style.display='none';       
            
        //florida            
        if(vres[3] == "Y")
            document.getElementById("TblAllFlorida").style.display='block';
        else if(vres[3] == "N")
            document.getElementById("TblAllFlorida").style.display='none';    
                
        //hamptons              
        if(vres[4] == "Y")
            document.getElementById("TblAllHamptons").style.display='block';
        else if(vres[4] == "N")
            document.getElementById("TblAllHamptons").style.display='none';     
              
                  
    }
    
}
//show neighborhoods
function ProcessAllListings(data,subtype)
{

    if(data=="No Open Houses Available")
    {
        document.getElementById("TblAllFlorida").visibility='hidden';
        return;
    }
    // document.getElementById(srchdetail).style.visibility='visible';
   // if (searchdt_tr != "")) {
     // searchdt_tr.style.visibility = 'visible';
   // }
   
    
	var dataList=new Array();
	var tag=document.getElementById(subtype+'_tr');
	var tr=document.getElementsByTagName('tr');
	var tagW=document.getElementById('TblWeath');
	
	var firstNodeIndex;
	var secondNodeIndex;
	var chkunchkStyle="style=\"cursor:pointer;\"";//the style of the check and uncheck links
	var chkClick="onClick=\"SetCheckedVal(1)\"";//the click attribute of the check link
	var unChkClick="onClick=\"SetCheckedVal(0)\"";//the click attribute of the uncheck link
	dataList=data.split('~');
	
	
	//arrange the neighborhoods from top to bottom, on the left and top to bottom on the right
	var dataList_left=(dataList.length)/2;
	var dataList_string="'"+dataList_left+"'";
	if(dataList_string.indexOf(".5")!=-1){dataList_left+=0.5;}
	/***********************************************************/
	tag.style.display='block';
	//detect browser especially firefox to solve the space as node problem
	if (navigator.appVersion.indexOf("MSIE")!=-1){//IE
		firstNodeIndex=0;
		secondNodeIndex=1;
	}
	if(navigator.userAgent.indexOf("Firefox")!=-1){//firefox
		firstNodeIndex=1;
		secondNodeIndex=3;
	}
	
	/*var k=0
	do
	{
		//ng2+=(dataList[j]!=undefined)?"<input type=\"checkbox\" id=\""+subtype+"_cb_"+j+"\" value=\""+dataList[j]+"\" class=\"mapCheckBox\" /> <label for='"+subtype+"_cb_"+j+"'>"+dataList[j]+"</label><br>":"";
		if(dataList[k].indexOf("<table>")!=-1){
            
            	tagW.childNodes[firstNodeIndex].innerHTML="<font size=\"1\" "+chkunchkStyle+" "+chkClick+">Check All</font> | <font size=\"1\" "+chkunchkStyle+" "+unChkClick+">Uncheck All</font><BR>";
	            tagW.childNodes[secondNodeIndex].innerHTML="<BR>";
	            tagW.childNodes[secondNodeIndex].style.padding='0px';	
		}
		k++;
	}
	while (k<dataList.length);  */
	
	
	tag.childNodes[firstNodeIndex].innerHTML="<font size=\"1\" "+chkunchkStyle+" "+chkClick+">Check All</font> | <font size=\"1\" "+chkunchkStyle+" "+unChkClick+">Uncheck All</font><BR>";
	tag.childNodes[secondNodeIndex].innerHTML="<BR>";
	tag.childNodes[secondNodeIndex].style.padding='0px';
	//show neighborhoods
	var ng='';
	var ng2='';
	var i=0;//fill in the left
	do
	{		
		ng+=(dataList[i].indexOf("No Open")!=-1)?"<input type=\"checkbox\" id=\""+subtype+"_cb_"+i+"\" value=\""+dataList[i]+"\" class=\"mapCheckBox\" disabled/> <label for='"+subtype+"_cb_"+i+"'>"+dataList[i]+"</label><br>":"<input type=\"checkbox\" id=\""+subtype+"_cb_"+i+"\" value=\""+dataList[i]+"\" class=\"mapCheckBox\" /> <label for='"+subtype+"_cb_"+i+"'>"+dataList[i]+"</label><br>";
		i++;		
	}
	while (i<dataList_left);
	var j=i;//continues from where the Left ended on the right
	do
	{
		ng2+=(dataList[j]!=undefined)?"<input type=\"checkbox\" id=\""+subtype+"_cb_"+j+"\" value=\""+dataList[j]+"\" class=\"mapCheckBox\" /> <label for='"+subtype+"_cb_"+j+"'>"+dataList[j]+"</label><br>":"";
		j++;
	}
	while (j<dataList.length);
	ng2+="<p><img align=\"right\" src=\"/gfx/search_main_manh_btn_02.gif\" onClick=\"SearchByNeighborhoods()\" style=\"cursor:pointer;\" border=\"0\"></p>";
	ng+="<p><div id=\"div_"+subtype+"_loading\" style=\"display:none; color:#CC3300\">Loading... Please Wait</div>";
	tag.childNodes[firstNodeIndex].innerHTML+=ng;
	tag.childNodes[secondNodeIndex].innerHTML+=ng2;
	//dont render other tr tags
	
	for(var i=0;i<tr.length;i++)
	{	//alert(tr[i].getAttribute('id'));
		if((tr[i].getAttribute('id')!=null) && (tr[i].getAttribute('id').indexOf('_tr')!=-1) && (tr[i].getAttribute('id')!=subtype+'_tr'))
		{
			tr[i].style.display='none';
			tr[i].style.height='0px';
		}
		//this is a fix for a firefox problem
	//	if(tr[i].getAttribute('id')==subtype+'_tr'){
	
	//		document.getElementById(subtype+"_tbody").style.display='block';
	//	}
	}
}

function BrowseResults(direction){
	switch(direction)
	{
		case "n":
			start=increment;
			if((s_limit+increment)>total_listings){
				increment=total_listings;
			}else{
				increment+=s_limit;
			}			
			break;
		case "p":
			increment=start;	
			start-=s_limit;			
			break;
	} 
	if(document.getElementById("ctl00_ContentMain_OHDate")){
	SendPreciseXmlHttpRequest(requestType,subRequest,q_detail,document.getElementById("ctl00_ContentMain_OHDate").options[document.getElementById("ctl00_ContentMain_OHDate").selectedIndex].value);//sends the current request
	}
	else
	{
	SendPreciseXmlHttpRequest(requestType,subRequest,q_detail,"");//sends the current request
	}
}
function CreatePlanner(){	
	if(validateInput()){		
		document.getElementById("divMapLoading").style.display="block";
		if(subRequest!="hamptons" && subRequest!="palmbeach") borough=document.getElementById("s_city").options[document.getElementById("s_city").selectedIndex].value;
		startingAdr=(subRequest=="palmbeach" || subRequest=="hamptons")?document.getElementById("s_address").value+", "+borough+" "+document.getElementById("s_zip").value:document.getElementById("s_address").value+", NY "+document.getElementById("s_zip").value;		
		HopStopAdr=document.getElementById("s_address").value+"%New York%"+document.getElementById("s_zip").value;
		document.getElementById("div_topoptions").innerHTML=TopOptionsHtml(selectedDate);	
		document.getElementById("td_header_img").innerHTML +="<font class='text11px' style=\"padding-left:10px;\" id=\"font_dir\"><a href=\"javascript:void(0)\" class=\"graylink\" onClick=\"StartDirectionsFromEnd()\"><img id=\"StartLocationImg\" src=\"/gfx/btn_start_far_away.gif\" border=0 key=\"on\"></b></a></font>";
		document.getElementById('sortoptions_td').innerHTML="";
		document.getElementById('searchOptions_td').innerHTML="";
		document.getElementById('td_howto').innerHTML="";
		document.getElementById('itinerary_td').innerHTML="";
		document.getElementById('location_td').innerHTML="";
		document.getElementById('TblSearchResults_div').innerHTML="";
		GetStartPoint();
	}
}
function validateInput(){
	var z=document.getElementById("s_zip").value;
	var zp=parseInt(z);
	if(document.getElementById("s_address").value==""){
		alert("Please provide your starting street address");
		document.getElementById("s_address").focus();
		return false;
	}
	if(document.getElementById("s_city").value==""){
		alert("Please provide your starting city");
		document.getElementById("s_city").focus();
		return false;
	}
	if(isNaN(zp)){
		////alert("Incorrect Entry: \nYour location zip code must be a 5-digit number");
		document.getElementById("s_zip").focus();
		return false;
	}
	if(z.length<5 || z.length>5){
		////alert("Incorrect Entry: \nPlease provide a valid zip code");
		document.getElementById("s_zip").focus();
		return false;
	}	
	return true;
}
function GenericShowText(id){
	var p=document.getElementById(id);
	switch (p.value){
		case "Enter Your Email Address":
			p.value="";
			break;
		case "Enter Your 10-Digit Phone":
			p.value="";
			break;
		case "Enter Your 10-Digit Fax #":
			p.value="";
			break;
	}
}

function GenericHideText(id){
	var p=document.getElementById(id);
	switch (id){
		case "txt_email":
			if(p.value=="")p.value="Enter Your Email Address";
			break;
		case "txt_phone":
			if(p.value=="")p.value="Enter Your 10-Digit Phone";
			break;
		case "txt_fax":
			if(p.value=="")p.value="Enter Your 10-Digit Fax #";
			break;
	}
}
function ShowOptsDiv(t){
	if(document.getElementById("tr_send"))document.getElementById("tr_send").style.display="none";
	if(document.getElementById("tr_phone"))document.getElementById("tr_phone").style.display="none";
	if(document.getElementById("tr_fax"))document.getElementById("tr_fax").style.display="none";
	if(document.getElementById("divSendOptions"))document.getElementById("divSendOptions").style.display="none";
	if(t=="email"){document.getElementById("td_NewSendOptions").innerHTML=EmailInputHtml();document.getElementById("tr_send").style.display="block";}
	if(t=="phone"){document.getElementById("td_NewSendOptions").innerHTML=PhoneInputHtml();document.getElementById("tr_phone").style.display="block";}
	if(t=="fax"){document.getElementById("td_NewSendOptions").innerHTML=FaxInputHtml();document.getElementById("tr_fax").style.display="block";}
}
function ShowHideSendOptions(t){
	var s=(t=="show")?"block":"none";
	document.getElementById("divSendOptions").style.display="block";
}
function HideSendOptions(t){
	if(t=="hide")	document.getElementById("divSendOptions").style.display="none";
		else	var t=setTimeout("HideSendOptions('hide')",2000);
}
function SendEmail(){	
	var r=document.getElementById("txt_email").value;
	document.getElementById("td_NewSendOptions").innerHTML="<font class='text12pxred' style='padding-left:15px;'>Sending Email... Please Wait &nbsp;&nbsp;&nbsp;</font>";	
	SendMailXmlHttpRequest("email",r,"");
}
function SendToPhone(){	
	var r=document.getElementById("txt_phone").value;
	var p=document.getElementById("provider").options[document.getElementById("provider").selectedIndex].value;
	document.getElementById("td_NewSendOptions").innerHTML="<font class='text12pxred' style='padding-left:15px;'>Sending To Phone... Please Wait &nbsp;&nbsp;&nbsp;</font>";	
	SendMailXmlHttpRequest("phone",r,p);
}
function SendToFax(){	
	var r=document.getElementById("txt_fax").value;
	document.getElementById("td_NewSendOptions").innerHTML="<font class='text12pxred' style='padding-left:15px;'>Sending Fax... Please Wait &nbsp;&nbsp;&nbsp;</font>";	
	SendMailXmlHttpRequest("fax",r,"");
}
function ProcessSendMailResponse(r){
	document.getElementById("td_NewSendOptions").innerHTML="<font class='text12pxred' style='padding-left:15px;'>Itinerary Sent Successfully &nbsp;&nbsp;&nbsp;</font>";
	var t=setTimeout("ResetTag()",2000);
}
function ResetTag(){
	document.getElementById("td_NewSendOptions").innerHTML=EmailInputHtml();
}
function ProcessNeighborhoodInfo(data){

	document.getElementById("divMapLoading").style.display="none";
	var		ngbhD = new Array();
	var		dataArray = new Array();
	var		busname = new Array();
	var		bustreet =new Array();
	var		buscity=new Array();
	var		busstate=new Array();
	var		buszip=new Array();
	var		buslong=new Array();
	var		buslat=new Array();
	
	dataArray=data.split('*$');
	
	busname = dataArray[0].split('~');
	bustreet =dataArray[1].split('~');
	buscity=dataArray[2].split('~');
	busstate=dataArray[3].split('~');
	buszip=dataArray[4].split('~');
	buslong=dataArray[5].split('~');
	buslat=dataArray[6].split('~');
	
	for(var i=0;i<busname.length;i++) 
	{
		ngbhD[i]=new Array();
		ngbhD[i][0]=busname[i].toLowerCase();
		ngbhD[i][1]=bustreet[i].toLowerCase();
		ngbhD[i][2]=buscity[i].toLowerCase();
		ngbhD[i][3]=busstate[i].toLowerCase();
		ngbhD[i][4]=buszip[i];
		ngbhD[i][5]=buslong[i];
		ngbhD[i][6]=buslat[i];
	}	
	ShowNeighborhoodInfoOnMap(ngbhD);
}
function ProcessListingsData(data,subtype)
{ 
	//alert('ProcessListingsData');
//alert(data);

	if(data != ""){
	
	if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx") != null || document.URL.toLowerCase().match("cmembers/mysubscriptions.aspx") != null)
	{
		document.getElementById("div_loading").style.display='none';
		if(document.getElementById("divMapLoading"))document.getElementById("divMapLoading").style.display='none';

		  
	}
	
  if(document.getElementById('TblSearchResults_tr'))
		var		searchResults_tr = document.getElementById('TblSearchResults_tr');
	var		searchResults = document.getElementById('TblSearchResults');
	var		searchTable = document.getElementById('TblSearch');
	var		searchResultsDiv = document.getElementById('TblSearchResults_div');
	var 	searchopt = document.getElementById('searchOptions_td');//the show options TD
	var 	sortopt = document.getElementById('sortoptions_td');	
	var		dataArray = new Array();
	var		resultsHtml = "";
	var		nolistings="";
	
	//get each field for all listings
	var		listings = new Array();
	var		webid =new Array();
	var		RentSale=new Array();
	var		Photo1=new Array();
	var		Beds=new Array();
	var		Baths=new Array();
	var		Units=new Array();
	var		Floors=new Array();
	var		PropertyType=new Array();
	var		Rooms=new Array();
	var		Price=new Array();
	var		SqFt=new Array();
	var		address=new Array();
	var		Doorman=new Array();
	var		InContract=new Array();
	var		Outdoor=new Array();	
	var		longitude=new Array();
	var		latitude=new Array();
	var		ngbhood=new Array();
	var		zip=new Array();
	var		listingData=new Array();
	var		ohinfo=new Array();
	var     ohHit = new Array();
	var     ohLot = new Array();
	var     ohSky = new Array();
	var     ohdate = new Array();
	
	var 	listings_length;
	var 	new_start;
	var		new_endt;
	
	clearMap();
	if(_map != null){
	_map.addOverlay(trafficInfo);
	}
	if(data.indexOf("criteria")!=-1){
		//alert('in criteria NOT -1');
		//reset counters
		total_listings="0";
		start=0;
		increment=50;
		new_start=start;
		new_end=increment;
		//display message
		nolistings=data;
		var isSet=NeighborhoodDropDown();
		if(isSet==true){sortopt.innerHTML = ReturnSortOptionsHtml(total_listings,new_start,new_end);}
		resultsHtml='<font class="text12px">'+nolistings+'</font>';		
		document.getElementById('TblSearchResults_div').innerHTML = "";
	}
	else
	{
		dataArray=data.split('*$');
		
		var i1 = 0;
	 
		Photo1=dataArray[1].split('~');
	
		webid =dataArray[0].split('~');	
		Photo1=dataArray[1].split('~');
		RentSale=dataArray[2].split('~');
		Beds=dataArray[3].split('~');
		Baths=dataArray[4].split('~');
		Units=dataArray[5].split('~');
		Floors=dataArray[6].split('~');
		PropertyType=dataArray[7].split('~');
		Rooms=dataArray[8].split('~');
		Price=dataArray[9].split('~');
		SqFt=dataArray[10].split('~');
		address=dataArray[11].split('~');
		Doorman=dataArray[12].split('~');
		InContract=dataArray[13].split('~');
		Outdoor=dataArray[14].split('~');	
		longitude=dataArray[15].split('~');
		latitude=dataArray[16].split('~');
		ngbhood=dataArray[17].split('~');
		zip=dataArray[18].split('~');
		total_listings=dataArray[19];		
		
		listings_length=webid.length;
		
		ohinfo=dataArray[20].split('~');
		ohHit=dataArray[22].split('~');
		ohLot=dataArray[23].split('~');
		ohSky=dataArray[24].split('~');
		ohdate=dataArray[25].split('~');
		//build the neighborhoods dropdown
	
		_neighborhoods=dataArray[21].split('~');		
		new_start=start;
		new_end=increment;
		//sortopt_tr.style.display='block';
		//searchopt_tr.style.display='block';
		//alert('bed' + Beds);
		if(searchTable)
		searchTable.style.display='none';
		if(searchResults){
		 //alert('in display block');
		 searchResults.style.display='block';
		 //alert(searchResults.style.display);
		}
		if(searchResults_tr){
		searchResults_tr.style.display='block';
		//alert('in display block');
		//alert(searchResults_tr.style.display);
		}
		if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx") != null ||
		   document.URL.toLowerCase().match("cmembers/mysubscriptions.aspx") != null || 
		   document.URL.toLowerCase().match("property/maps/") != null)
		{
		//dont reload srch options if they're already loaded
		//if(document.URL.toLowerCase().match("cmembers/mysubscriptions.aspx") == null){
		if(!srchOpLoaded){
			if(searchopt)
				searchopt.innerHTML = ReturnSearchOptionsHtml();srchOpLoaded=true;
		}
		var isSetNgbh=NeighborhoodDropDown();
		if(isSetNgbh==true){sortopt.innerHTML = ReturnSortOptionsHtml(total_listings,new_start,new_end);}
		//}
		
		if(vlink1click == "true")
		{
			//alert('vlink1click TRUE');
			document.getElementById("apmt").checked = false;
			document.getElementById("mulfam").checked = false;
			document.getElementById("single").checked = false;
			document.getElementById("twnhse").checked = false;
			document.getElementById("loft").checked = false;
			document.getElementById("Coop").checked = false;
			document.getElementById("Condos").checked = false;
			document.getElementById("rentsale").checked = false;
			document.getElementById("prewar").checked = false;
			document.getElementById("postwar").checked = false;
			document.getElementById("opnhse").checked = false;
			document.getElementById("outdoor").checked = false;
			document.getElementById("fireplace").checked = false;
			document.getElementById("pets").checked = false;
			document.getElementById("doorman").checked = false;
			if(document.getElementById("diningroom"))
			 document.getElementById("diningroom").checked = false;
			if(document.getElementById("rooms")){
				document.getElementById("rooms").selectedIndex = 0;
				sel('rooms',document.getElementById("rooms").options[1].value,1);
			}

			if(document.getElementById("subway")){	
				document.getElementById("subway").selectedIndex = 0;
				sel('subway',document.getElementById("subway").options[0].value,0);
			}
			
			if(document.getElementById("area")){
				vngbh = "1";
				document.getElementById("area").selectedIndex = 0;
				if(document.getElementById("area"))
				 {sel('area',document.getElementById("area").options[0].value,0);
				 vngbh = "";}
			}
			
			if(document.getElementById("price"))
			{
				//alert('price 1');
				//alert(document.getElementById("price").options[document.getElementById("price").length-1].value);
				document.getElementById("price").selectedIndex = document.getElementById("price").length-1;
				sel('price',document.getElementById("price").options[document.getElementById("price").length-1].value,document.getElementById("price").length-1);
			}
			
			if(document.getElementById("beds"))	{
				document.getElementById("beds").selectedIndex = 0;
				sel('beds',document.getElementById("beds").options[0].value,0);
			}
			
			if(document.getElementById("baths")){
				document.getElementById("baths").selectedIndex = 0;
				sel('baths',document.getElementById("baths").options[0].value,0);
			}
			
			//vlink1click = "";
		
		
		if(bapmt == "true")
		{
			//alert('apmt flag true');
			if(document.getElementById("apmt")){
			   document.getElementById("apmt").checked = true;
			   if(ccntapmt == 0){
				chk("apmt","bldgtype","Apartment");
				ccntapmt = 1 ;
				}
			}   
		}

		if(btennis == "true")
		{
			if(document.getElementById("tennis")){
			   document.getElementById("tennis").checked = true;
			   if(ccnttennis == 0){
				chk("tennis","tennis","Y");
				ccnttennis = 1 ;
				}
			}   
		}
		
		if(bsouthofhighway == "true")
		{
			//alert('apmt flag true');
			if(document.getElementById("southofthehwy")){
			   document.getElementById("southofthehwy").checked = true;
			   if(ccntsouthofhighway == 0){
				chk("southofthehwy","southofthehwy","Y");
				ccntsouthofhighway = 1 ;
				}
			}   
		}
		
		if(bpool == "true")
		{
			//alert('apmt flag true');
			if(document.getElementById("pool")){
			   document.getElementById("pool").checked = true;
			   if(ccntpool == 0){
				chk("pool","pool","Y");
				ccntpool = 1 ;
				}
			}   
		}				

		if(bdock == "true")
		{
			//alert('apmt flag true');
			if(document.getElementById("dock")){
			   document.getElementById("dock").checked = true;
			   if(ccntdock == 0){
				chk("dock","dock","Y");
				ccntdock = 1 ;
				}
			}   
		}
		
		if(bmulfam == "true")
		{
			//alert('mulfam flag true');
			if(document.getElementById("mulfam")){
			   document.getElementById("mulfam").checked = true;
			   if(ccntmulfam == 0){
				chk("mulfam","bldgtype","Townhouse M%");
				ccntmulfam = 1 ;
				}
			}   
		}

		
		if(bsingle == "true")
		{
			//alert('single flag true');
			if(document.getElementById("single")){
			   document.getElementById("single").checked = true;
			   if(ccntsingle == 0){
				chk("single","bldgtype","Townhouse S%");
				ccntsingle = 1 ;
				}
			}   
		}

		
		if(btwnhse == "true")
		{
			//alert('twnhse flag true');
			if(document.getElementById("twnhse")){
			   document.getElementById("twnhse").checked = true;
			   if(ccnttwnhse == 0){
				chk("twnhse","bldgtype","Townhouse %");
				ccnttwnhse = 1 ;
				}
			}   
		}

		
		
		if(bloft == "true")
		{
			//alert('loft flag true');
			if(document.getElementById("loft")){
			   document.getElementById("loft").checked = true;
			   if(ccntloft == 0){
				chk("loft","bldgtype","Loft");
				ccntloft = 1 ;
				}
			}   
		}

		
		
		if(bcoop == "true"){
			//alert('coop flag true');
			if(document.getElementById("Coop")){
			   document.getElementById("Coop").checked = true;
			   if(ccntcoop == 0){
			   chk("Coop","propertytype","Coop");
			   ccntcoop = 1;
			   }
			}
		}

		
		if(bcondos == "true"){
			//alert('condos flag true');
			if(document.getElementById("Condos")){
			   document.getElementById("Condos").checked = true;
			   if(ccntcondos == 0){
				chk("Condos","propertytype","Condo");
				ccntcondos = 1;
			   } 
			}
		}

		
		if(brent == "true")
		{
			//alert('rentsale flag true');
			if(document.getElementById("rentsale"))
			   document.getElementById("rentsale").checked = true;
			   if(ccntrent == 0){
				chk("rentsale","rentsale","RU");
				ccntrent = 1;
			   }
			   
		}

		
		
		if(bprewar == "true")
		{
			//alert('prewar flag true');
			if(document.getElementById("prewar"))
			   document.getElementById("prewar").checked = true;
			   if(ccntprewar == 0){
				chk("prewar","prewar","Y");
				ccntprewar = 1;
			   }
		}

		
		if(bpostwar == "true")
		{
			//alert('postwar flag true');
			if(document.getElementById("postwar"))
			   document.getElementById("postwar").checked = true;
				if(ccntpostwar == 0){
				chk("postwar","postwar","Y");
				ccntpostwar = 1;
			   }
		}

		
		if(bopenhouseflag == "true")
		{
			//alert('openhouseflag flag true');
			if(document.getElementById("opnhse"))
			   document.getElementById("opnhse").checked = true;
			   if(ccntopenhouseflag == 0){
				chk("opnhse","openhouseflag","Y");
				ccntopenhouseflag = 1;
			   }
		}

		
		if(boutdoor == "true")
		{
			//alert('outdoor flag true');
			if(document.getElementById("outdoor"))
			   document.getElementById("outdoor").checked = true;
			if(ccntoutdoor == 0){
			   chk("outdoor","outdoor","Y");
			   ccntoutdoor = 1;
		   }
		}

		
		
		if(bfireplace == "true")
		{
			//alert('fireplace flag true');
			if(document.getElementById("fireplace"))
			   document.getElementById("fireplace").checked = true;
			   if(ccntfireplace == 0){
			   chk("fireplace","fireplace","Y");
			   ccntfireplace = 1;
		   }
		}

		
		if(bpets == "true")
		{
			//alert('petsallowed flag true');
			if(document.getElementById("pets"))
			   document.getElementById("pets").checked = true;
			 if(ccntpetsallowed == 0){
			   chk("pets","petsallowed","Y");
			   ccntpetsallowed = 1;
		   }
		}

		
		if(bdoorman == "true")
		{
			//alert('doorman flag true');
			if(document.getElementById("doorman"))
			   document.getElementById("doorman").checked = true;
			if(ccntdoorman == 0){
			   chk("doorman","doorman","yes");
			   ccntdoorman = 1;
		   }
		}

		
		if(bdiningroom == "true")
		{
			//alert('diningroom flag true');
			if(document.getElementById("diningroom"))
			   document.getElementById("diningroom").checked = true;
			if(ccntdiningroom == 0){
			   chk("diningroom","diningroom","Y");
			   ccntdiningroom = 1;
		   }
		}

		//alert('brooms flag');
		//alert(brooms);
		//alert('bsubway flag');
		//alert(bsubway);
		if(brooms == 0)
		{
			//alert('rooms flag true');
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 2;
			if(ccntrooms == 0){
			 
			 if(document.getElementById("rooms"))	
			 	sel('rooms',document.getElementById("rooms").options[2].value,2);
			 ccntrooms = 1;
			}
		}
		else if(brooms == 1)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 3;
			if(ccntrooms == 0){
			if(document.getElementById("rooms"))				
			 sel('rooms',document.getElementById("rooms").options[3].value,3);
			 ccntrooms = 1;
			}
		}
		else if(brooms == 2)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 5;
			if(ccntrooms == 0){
			 if(document.getElementById("rooms"))
			  sel('rooms',document.getElementById("rooms").options[5].value,5);
			 ccntrooms = 1;
			}
		}
		else if(brooms == 3)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 7;
			if(ccntrooms == 0){
			 
			 if(document.getElementById("rooms"))
			 	sel('rooms',document.getElementById("rooms").options[7].value,7);
			 ccntrooms = 1;
			}
		}
		else if(brooms == 4)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 9;
			if(ccntrooms == 0){
			 if(document.getElementById("rooms"))
			 	sel('rooms',document.getElementById("rooms").options[9].value,9);
			 ccntrooms = 1;
			}
		}
		else if(brooms == 5)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 11;
			if(ccntrooms == 0){
			 if(document.getElementById("rooms"))
			 	sel('rooms',document.getElementById("rooms").options[11].value,11);
			 ccntrooms = 1;
			}
		}
		else if(brooms == 11)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 4;
			if(ccntrooms == 0){
			 if(document.getElementById("rooms"))
			  sel('rooms',document.getElementById("rooms").options[4].value,4);
			 ccntrooms = 1;
			 }
		}
		else if(brooms == 22)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 6;
			if(ccntrooms == 0){
			 if(document.getElementById("rooms"))
			 	sel('rooms',document.getElementById("rooms").options[6].value,6);
			 ccntrooms = 1;
			}
		}
		else if(brooms == 33)
		{
			
			if(document.getElementById("rooms")){
			//alert('in selected index 33');
			   document.getElementById("rooms").selectedIndex = 8;
			  }
			if(ccntrooms == 0){
			 if(document.getElementById("rooms"))
			 	sel('rooms',document.getElementById("rooms").options[8].value,8);
			 ccntrooms = 1;
			 }
		}
		else if(brooms == 44)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 10;
			if(ccntrooms == 0){
			 if(document.getElementById("rooms"))
			 	sel('rooms',document.getElementById("rooms").options[10].value,10);
			 ccntrooms = 1;
			}
		}
		else if(brooms == 55)
		{
			
			if(document.getElementById("rooms"))
			   document.getElementById("rooms").selectedIndex = 12;
			if(ccntrooms == 0){
			 if(document.getElementById("rooms"))
			 sel('rooms',document.getElementById("rooms").options[12].value,12);
			 ccntrooms = 1;
			}
		}
		
		if(bsubway == 1)
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 1;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
				sel('subway',document.getElementById("subway").options[1].value,1);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 2)
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 2;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			   sel('subway',document.getElementById("subway").options[2].value,2);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 3)
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 3;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			  sel('subway',document.getElementById("subway").options[3].value,3);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 4)
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 4;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[4].value,4);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 5)
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 5;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[5].value,5);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 6)
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 6;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[6].value,6);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 7)
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 7;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[7].value,7);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'A')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 8;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[8].value,8);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'B')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 9;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[9].value,9);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'C')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 10;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[10].value,10);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'D')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 11;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[11].value,11);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'E')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 12;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[12].value,12);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'F')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 13;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[13].value,13);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'G')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 14;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[14].value,14);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'J')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 15;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[15].value,15);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'L')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 16;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[16].value,16);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'M')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 17;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[17].value,17);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'N')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 18;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[18].value,18);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'Q')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 19;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[19].value,19);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'R')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 20;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[20].value,20);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'S')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 21;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[21].value,21);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'V')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 22;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[22].value,22);
			 ccntsubway = 1;
			}
		}
		else if(bsubway == 'W')
		{
			//alert('bsubway flag true');
			if(document.getElementById("subway"))
			   document.getElementById("subway").selectedIndex = 23;
			if(ccntsubway == 0){
			if(document.getElementById("subway"))
			 sel('subway',document.getElementById("subway").options[23].value,23);
			 ccntsubway = 1;
			}
		}
		
		//alert('After subway flag true');
		//alert('barea');
		//alert(barea);
		if(barea != "" && barea != "all" & barea != -1 & barea != null)
		{
		    //alert('area array');
			//alert(_neighborhoods.length);
			//alert(barea);
			for(var i1=0;i1<_neighborhoods.length;i1++)
			{
  			    //alert(_neighborhoods[i1]);
				if(barea.match( _neighborhoods[i1]))
				{
				 
				  //alert('EQUAL NGBH');
				  //alert(i1);
				  document.getElementById("area").options[i1+1].value=_neighborhoods[i1];
				  if(ccntarea == 0){
				  sel('area',_neighborhoods[i1],i1+1);
				  ccntarea = 1;
				  }
//				  
				 //options[document.getElementById("ctl00_ContentMain_OHDate").selectedIndex].value
				}
			}
		
		}
		else
		{
			//document.getElementById("neighborhoods").selectedIndex = 0;
		}
		
		if(bprice != -1)
		{
			//alert('idxprice Value');
			//alert(idxprice);
			if(document.getElementById("price"))
			{
			  //document.getElementById("price").selectedIndex = idxprice;
			  //alert('dropdown price length');  
			  //alert(document.getElementById("price").length);
			  //alert(bprice);
			  for(var k1=0;k1<document.getElementById("price").length-1;k1++)
			  {
				
				//alert(document.getElementById("price").options[k1].value);
				if(bprice != "" && bprice != -1 && bprice != "all"){
				if(bprice.match(document.getElementById("price").options[k1].value))
				{
					//alert('bprice');
					//alert(bprice);
					document.getElementById("price").selectedIndex = k1;
				  if(ccntprice == 0)
					{
						sel('price',document.getElementById("price").options[k1].value,k1);
						ccntprice = 1;
					}
				}
				}
				else
				{
					//document.getElementById("price").selectedIndex = 0;
				}
		
			  }
			
			
			}
		}
		
		if(document.getElementById("beds"))
		{
				//alert('beds');
				//alert(bflgbeds);

			 for(var k2=0;k2<document.getElementById("beds").length-1;k2++)
			  {
				//alert(document.getElementById("price").options[k1].value);
				if(bflgbeds != "" && bflgbeds != -1 && bflgbeds != "all"){
				if(bflgbeds == (document.getElementById("beds").options[k2].value))
				{	
					//alert(document.getElementById("beds").options[k2].value);
					//alert('bedsflg equal');
					document.getElementById("beds").selectedIndex = k2;
				    if(ccntflgbeds == 0)
					{
						sel('beds',document.getElementById("beds").options[k2].value,k2);
						ccntflgbeds = 1;
					}
				}
				}
				else
				{
					//document.getElementById("beds").selectedIndex = 0;
				}
			  }
		}
		if(document.getElementById("baths"))
		{
			 for(var k4=0;k4<document.getElementById("baths").length-1;k4++)
			  {
			  if(bflgbaths != "" &&bflgbaths != -1 && bflgbaths != "all"){
				if(bflgbaths == (document.getElementById("baths").options[k4].value))
				{	
					document.getElementById("baths").selectedIndex = k4;
				    if(ccntflgbaths == 0)
					{
						sel('baths',document.getElementById("baths").options[k4].value,k4);
						ccntflgbaths = 1;
					}
				}
				}
				else
				{
					//document.getElementById("baths").selectedIndex = 0;
				}
				
			  }

		}
		/*
		if(barea == "true")
		{
			alert('area flag true');
			if(document.getElementById("area"))
			   document.getElementById("area").checked = true;
		}
		if(bflgbeds == "true")
		{
			alert('beds flag true');
			if(document.getElementById("beds"))
			   document.getElementById("beds").checked = true;
		}
		if(bflgbaths == "true")
		{
			alert('baths flag true');
			if(document.getElementById("baths"))
			   document.getElementById("baths").checked = true;
		}
		if(bprice == "true")
		{
			alert('price flag true');
			if(document.getElementById("price"))
			   document.getElementById("price").checked = true;
		}*/
	  vlink1click = "";
	  }
	}
		for(var i=0;i<listings_length;i++) 
		{
			listings[i]=new Array();
			listings[i][0]=webid[i];
			listings[i][1]=Photo1[i];
			listings[i][2]=RentSale[i];
			listings[i][3]=Beds[i];
			listings[i][4]=Baths[i];
			listings[i][5]=Units[i];
			listings[i][6]=Floors[i];
			listings[i][7]=PropertyType[i];
			listings[i][8]=Rooms[i];
			listings[i][9]=Price[i];
			listings[i][10]=SqFt[i];
			listings[i][11]=address[i];
			listings[i][12]=Doorman[i];//*
			listings[i][13]=InContract[i];//*
			listings[i][14]=Outdoor[i];//*
			listings[i][15]=longitude[i];
			listings[i][16]=latitude[i];
			listings[i][17]=ngbhood[i];
			listings[i][18]=ohinfo[i];
			listings[i][19]=zip[i];			
			listings[i][20]=ohHit[i];
			listings[i][21]=ohLot[i];
			listings[i][22]=ohSky[i];
			listings[i][23]=ohdate[i];			
		}
	
	
	if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx") != null ||
	document.URL.toLowerCase().match("cmembers/mysubscriptions.aspx") != null || document.URL.toLowerCase().match("property/maps") != null)
	{
		var k=0;
		do
		{
			resultsHtml+=(listings[k][0]!=undefined || listings[k][0]!=null)?ThumbnailHtmlLeft(listings[k]):"<tr><td></td>";
			k++;
			resultsHtml+=(k<listings.length && (listings[k][0]!=undefined || listings[k][0]!=null))?ThumbnailHtmlRight(listings[k]):"<td></td></tr>";
			k++;
		}
		while (k<listings.length);
		resultsHtml="<table>"+resultsHtml+"</table>";
	
		
	   // searchResultsDiv.innerHTML=resultsHtml;
	   document.getElementById('TblSearchResults_div').innerHTML = resultsHtml;
	   //alert(document.getElementById('TblSearchResults_div').innerHTML);
	 }
	 else{
	  //alert('in else');
	  }
	}
	
	if(ShowNgbhInfoTable())
	{
		ShowListingsOnMap(listings);//markers of listings in the resultset	
	}
	
	
	var tf=new GTrafficOverlay();
	
	if(_map != null)
		_map.addOverlay(tf);
		
		
	if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx") != null || document.URL.toLowerCase().match("cmembers/mysubscriptions.aspx") != null)
	{
		if(document.getElementById("tr_div_LoadSearch"))
			document.getElementById("tr_div_LoadSearch").style.display = 'none';
	
		//tr_div_Loadsubscription
		if(document.getElementById("tr_div_Loadsubscription"))
			document.getElementById("tr_div_Loadsubscription").style.display = 'none';
			
		if(vpath="searchText"){
		if(document.getElementById("tbl_searchdetail"))
			document.getElementById("tbl_searchdetail").style.display = 'block';
		vpath = "";	
		}
		

	if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx") != null)
	{
		if(document.getElementById("Editsearch_tr"))
		{
			if(document.getElementById("tr_tbl_searchdetail"))
			{
					if(document.getElementById("tr_tbl_searchdetail").style.display == 'none')
						document.getElementById("Editsearch_tr").style.display = 'block';
			}
			
		}
	}
	}
	if(document.URL.toLowerCase().match("cmembers/mysubscriptions.aspx") != null)
	{
		if(document.getElementById("Editsearch_tr"))
			document.getElementById("Editsearch_tr").style.display = 'block';

	
		if(document.getElementById("Tblemailschedule"))
		document.getElementById("Tblemailschedule").style.display = 'block';

	}
	}
	else
	return false;
	

}
	
	function ShowNgbhInfoTable(){	
	if(document.getElementById('div_ngbhinfo')){
		document.getElementById("div_ngbhinfo").innerHTML=NgbhInfoHtml();
		return true;
	}
	
	
	}
	function ProcessOpenhouseData(data,subtype)
	{
	//alert('ProcessOpenhouseData');
	
	document.getElementById("div_loading").style.display='none';
	if(document.getElementById("divMapLoading"))document.getElementById("divMapLoading").style.display='none';
	selectedDate=(selectedDate!="")?(document.getElementById("ctl00_ContentMain_OHDate"))?document.getElementById("ctl00_ContentMain_OHDate").options[document.getElementById("ctl00_ContentMain_OHDate").selectedIndex].innerHTML:"":selectedDate;
	var vopenhdat = (document.getElementById("ctl00_ContentMain_OHDate"))?document.getElementById("ctl00_ContentMain_OHDate").options[document.getElementById("ctl00_ContentMain_OHDate").selectedIndex].value:"";
	
	document.getElementById("div_topoptions").innerHTML="";
	oh_results=true;
	var     idata;
	var		searchResults_tr = document.getElementById('TblSearchResults_tr');
	var		searchResults = document.getElementById('TblSearchResults');
	var		searchTable = document.getElementById('TblSearch');
	var		searchResultsDiv = document.getElementById('TblSearchResults_div');
	var 	searchopt = document.getElementById('searchOptions_td');//the show options TD
	var 	sortopt = document.getElementById('sortoptions_td');
	var		topnotes=(document.getElementById('td_howto'))?document.getElementById('td_howto'):"";
	var		dataArray = new Array();
	var		resultsHtml = "";
	var		nolistings="";

	if(document.getElementById('div_topoptions'))
	   document.getElementById('div_topoptions').style.display = 'none';
    if(document.getElementById('div_TblWeath'))
	       document.getElementById('div_TblWeath').style.display = 'block';


	var WeathResultsDiv = document.getElementById('div_TblWeath');
	idata = data;
	
		//ng2+=(dataList[j]!=undefined)?"<input type=\"checkbox\" id=\""+subtype+"_cb_"+j+"\" value=\""+dataList[j]+"\" class=\"mapCheckBox\" /> <label for='"+subtype+"_cb_"+j+"'>"+dataList[j]+"</label><br>":"";
		if(idata.indexOf("<table>")!=-1){	
			//document.getElementById("td_Control").width="60%";
			WeathResultsDiv.innerHTML = idata.substring(idata.indexOf("<table>"));
			document.getElementById("txt_change").innerHTML="Change Day";
		}
	
	var nIndxdata = data.indexOf("<table>");
	if(nIndxdata >= 0)
	{
		data = data.substring(0,data.indexOf("<table>"));
	}
	//get each field for all listings
	var		listings = new Array();
	var		webid =new Array();
	var		RentSale=new Array();
	var		Photo1=new Array();
	var		Beds=new Array();
	var		Baths=new Array();
	var		Units=new Array();
	var		Floors=new Array();
	var		PropertyType=new Array();
	var		Rooms=new Array();
	var		Price=new Array();
	var		SqFt=new Array();
	var		address=new Array();
	var		Doorman=new Array();
	var		InContract=new Array();
	var		Outdoor=new Array();	
	var		longitude=new Array();
	var		latitude=new Array();
	var		ngbhood=new Array();
	var		zip=new Array();
	var		listingData=new Array();
	var		ohinfo=new Array();
	var 	listings_length;
	var 	new_start;
	var		new_endt;
	//var     ohHit = new Array();
	//var     ohLot = new Array();
	//var     ohSky = new Array();
	//var     ohdate = new Array();
	
	clearMap();
	if(data.indexOf("criteria")!=-1){
		//reset counters
		total_listings="0";
		start=0;
		increment=50;
		new_start=start;
		new_end=increment;
		//display message
		nolistings=data;
		var isSet=NeighborhoodDropDown();
		if(isSet==true){sortopt.innerHTML = ReturnSortOptionsHtml(total_listings,new_start,new_end);}
		resultsHtml='<font class="text12px">'+nolistings+'</font>';		
	}
	else
	{
	//data=data.replace("'","&#39;");
	
		dataArray=data.split('*$');
		
		webid =dataArray[0].split('~');	
		Photo1=dataArray[1].split('~');
		RentSale=dataArray[2].split('~');
		Beds=dataArray[3].split('~');
		Baths=dataArray[4].split('~');
		Units=dataArray[5].split('~');
		Floors=dataArray[6].split('~');
		PropertyType=dataArray[7].split('~');
		Rooms=dataArray[8].split('~');
		Price=dataArray[9].split('~');
		SqFt=dataArray[10].split('~');
		//address=dataArray[11].split('~');
		Doorman=dataArray[12].split('~');
		InContract=dataArray[13].split('~');
		Outdoor=dataArray[14].split('~');	
		longitude=dataArray[15].split('~');
		latitude=dataArray[16].split('~');
		ngbhood=dataArray[17].split('~');
		zip=dataArray[18].split('~');
		total_listings=dataArray[19];		
		listings_length=webid.length;
		ohinfo=dataArray[20].split('~');	
//    	alert(escape(dataArray[11]));
        // dataArray[11] = dataArray[11].replace("'","\'");
        // alert('h'+dataArray[11]);
         address=dataArray[11].split('~');
	   // ohHit =dataArray[21].split('~');
		//ohLot=dataArray[22].split('~');
		//ohSky=dataArray[23].split('~');
	   // ohdate=dataArray[24].split('~');
		//build the neighborhoods dropdown
		_neighborhoods=dataArray[21].split('~');		
		new_start=start;
		new_end=increment;
		//sortopt_tr.style.display='block';
		//searchopt_tr.style.display='block';
		
		searchTable.style.display='none';
		searchResults.style.display='block';
		searchResults_tr.style.display='block';
		topnotes.innerHTML=GetNotes();
	
		//dont reload srch options if they're already loaded
		if(!srchOpLoaded){searchopt.innerHTML = ReturnSearchOptionsHtml();srchOpLoaded=true;}
		var isSetNgbh=NeighborhoodDropDown();
		if(isSetNgbh==true){sortopt.innerHTML = ReturnSortOptionsHtml(total_listings,new_start,new_end);}
		
		//organize data for each listing
		//used for continous referencing
		for(var i=0;i<listings_length;i++) 
		{
			//chkBox_all.innerHTML='<br>loading listing '+i+' of'+listings_length;
			listings[i]=new Array();
			listings[i][0]=webid[i];
			listings[i][1]=Photo1[i];
			listings[i][2]=RentSale[i];
			listings[i][3]=Beds[i];
			listings[i][4]=Baths[i];
			listings[i][5]=Units[i];
			listings[i][6]=Floors[i];
			listings[i][7]=PropertyType[i];
			listings[i][8]=Rooms[i];
			listings[i][9]=Price[i];
			listings[i][10]=SqFt[i];
			listings[i][11]=address[i];
			listings[i][12]=Doorman[i];//*
			listings[i][13]=InContract[i];//*
			listings[i][14]=Outdoor[i];//*
			listings[i][15]=longitude[i];
			listings[i][16]=latitude[i];
			listings[i][17]=ngbhood[i];
			listings[i][18]=ohinfo[i];
			listings[i][19]=zip[i];
			listings[i][20]=(longitude[i]!="" && longitude[i]!=null && longitude[i]!="undefined" && longitude[i]!=" ")?eval(latitude[i]+longitude[i]):0;
			listings[i][21]="";
			listings[i][22]="";
			listings[i][23]=vopenhdat;
		  //  listings[i][21]=ohHit[i];
		//	listings[i][22]=ohLot[i];
			//listings[i][23]=ohSky[i];
			//listings[i][24]=ohdate[i];
		}
		var k=0;
		do
		{
            if(listings[k][11]!=undefined || listings[k][11]!=null)
                listings[k][11]=escape(listings[k][11]);
		
			resultsHtml+=(listings[k][0]!=undefined || listings[k][0]!=null)?ThumbnailOphseHtmlLeft(listings[k]):"<tr><td></td>";
			k++;
            
            if(k<listings.length)
            {
                if(listings[k][11]!=undefined || listings[k][11]!=null)
                    listings[k][11]=escape(listings[k][11]);
             }   
			resultsHtml+=(k<listings.length && (listings[k][0]!=undefined || listings[k][0]!=null))?ThumbnailOphseHtmlRight(listings[k]):"<td></td></tr>";
			k++;
		}
		while (k<listings.length);
		resultsHtml="<table>"+resultsHtml+"</table>";
	}
	var tf=new GTrafficOverlay();
	_map.addOverlay(tf);
	//;
	searchResultsDiv.innerHTML=resultsHtml;
	if(ShowNgbhInfoTable())ShowListingsOnMap(listings);//markers of listings in the resultset
	
}
function ThumbnailHtmlLeft(r){
	var s="";
	s+="<tr class=\"text10px\">";
	s+="<td style=\"padding-right:1px;\">";
	s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+r+"')\">";
	s+="<img src="+r[1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='120' height='75' border='0'>";
	s+="</a><br>";
	
    if(document.URL.toLowerCase().match("cmembers"))	
    s+="<a class=\"graylink\" style=\"cursor:pointer;\" href=\"/property/listing.aspx?Region="+r[2]+"&ListingID="+r[3]+"&OhDat=\">"+unescape(r[11])+"</a><br>";
	else
	s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+r+"')\" title=\"View this listing on the map\">"+unescape(r[11])+"</a><br>";
	
	s+="<strong>"+r[17]+"</strong></td>";
	return s;
}
function ThumbnailHtmlRight(r){
	var s="";
	s+="<td style=\"padding-right:1px;\">";
	s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+r+"')\">";
	s+="<img src="+r[1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='120' height='75' border='0'>";
	s+="</a><br>";
	s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+r+"')\" title=\"View this listing on the map\">"+ReduceAddrLength(unescape(r[11]))+"</a><br>";
	s+="<strong>"+r[17]+"</strong></td>";
	return s;
}
function ThumbnailOphseHtmlLeft(r){


	var s="";
	s+="<tr class=\"text10px\">";
	s+="<td style=\"padding-right:1px;\">";
	s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+r+"')\">";
	s+="<img src="+r[1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='120' height='75' border='0'>";
	s+="</a><br>";
	s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+r+"')\">"+ReduceAddrLength(unescape(r[11]))+"</a><br>";
	s+="<strong>"+r[17]+"</strong>";
	s+="<div style=\"height:2px;line-height:2px;\"></div>";
	s+="<div id='div_itLeft_"+r[0]+"'>";
	s+="<div title=\"Add This Listing To My Itinerary\" style=\"background-color:de6747;color:#FFFFFF;padding-left:2px;cursor:pointer;\" onclick=\"AddListing('"+r+"','div_itLeft_"+r[0]+"')\">+ Add To My Itinerary</div>";
	s+="</div>";
	s+="</td>";
	return s;
}
function ThumbnailOphseHtmlRight(r){
	var s="";
	s+="<td style=\"padding-right:1px;\">";
	s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+r+"')\">";
	s+="<img src="+r[1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='120' height='75' border='0'>";
	s+="</a><br>";
	s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+r+"')\">"+ReduceAddrLength(unescape(r[11]))+"</a><br>";
	s+="<strong>"+r[17]+"</strong>";
	s+="<div style=\"height:2px;line-height:2px;\"></div>";
	s+="<div id='div_itRight_"+r[0]+"'>";
	s+="<div title=\"Add This Listing To My Itinerary\" style=\"background-color:de6747;color:#FFFFFF;padding-left:2px;cursor:pointer;\" onclick=\"AddListing('"+r+"','div_itRight_"+r[0]+"')\">+ Add To My Itinerary</div>";
	s+="</div>";
	s+="</td>";
	return s;
}
function ReduceAddrLength(r){
 if(document.URL.toLowerCase().match("cmembers"))
 {
 	var s=(r && r.length>21)?r.substring(0,21)+"...":r;
 }
 else if(document.URL.toLowerCase().match("cmembers/searchlistings.aspx") != null ||
         document.URL.toLowerCase().match("cmembers/mysubscriptions.aspx") != null)
 {
 var s=(r && r.length>21)?r.substring(0,21)+"...":r;
 }
 else{

if(chcookie1 != "" || chcookie2 != "" || chcookie3 != "")
    var s=(r && r.length>21)?r.substring(0,21)+"...":r;
else
	var s=(r && r.length>21)?r.substring(0,21)+"...":r;
}
	return s;
}
function AddListing(r,t){

    
    
	var LData=new Array();
	var w=itinerary_items.length;
	LData=r.split(',');	
	itinerary_items[w]=new Array();
	itinerary_items[w]=LData;
	if(UpdateItinerary())document.getElementById(t).innerHTML=AddRemoveItemDiv(r,'remove',t);
	if(document.getElementById("div_itMap_"+LData[0]))document.getElementById("div_itMap_"+LData[0]).innerHTML=AddRemoveItemDiv(r,'remove',"div_itMap_"+LData[0]);
	if(document.getElementById("div_itLeft_"+LData[0]))document.getElementById("div_itLeft_"+LData[0]).innerHTML=AddRemoveItemDiv(r,'remove',"div_itLeft_"+LData[0]);
	if(document.getElementById("div_itRight_"+LData[0]))document.getElementById("div_itRight_"+LData[0]).innerHTML=AddRemoveItemDiv(r,'remove',"div_itRight_"+LData[0]);
}
function RemoveListing(r,t){
	var LData=new Array();
	var tmp;
	LData=r.split(',');	
	for (var i=0;i<itinerary_items.length;i++)
		if(LData[0]==itinerary_items[i][0])
			tmp=itinerary_items.splice(i,1);
	if(RemoveItem())document.getElementById(t).innerHTML=AddRemoveItemDiv(r,'add',t);
	if(document.getElementById("div_itMap_"+LData[0]))document.getElementById("div_itMap_"+LData[0]).innerHTML=AddRemoveItemDiv(r,'add',"div_itMap_"+LData[0]);
	if(document.getElementById("div_itLeft_"+LData[0]))document.getElementById("div_itLeft_"+LData[0]).innerHTML=AddRemoveItemDiv(r,'add',"div_itLeft_"+LData[0]);
	if(document.getElementById("div_itRight_"+LData[0]))document.getElementById("div_itRight_"+LData[0]).innerHTML=AddRemoveItemDiv(r,'add',"div_itRight_"+LData[0]);
}
//ERROR
function MapItineraryDivDisplay(r,t){	
	var lk=new Array();
	lk=r;//.split(',');
	var d="<div title=\"Add This Listing To My Itinerary\" style=\"background-color:de6747;color:#FFFFFF;padding-left:2px;cursor:pointer;\" onclick=\"AddListing('"+r+"','"+t+"')\">+ Add To My Itinerary</div>";
	for (var i=0;i<itinerary_items.length;i++){	
		if(lk[0]==itinerary_items[i][0]){
			d="<div class=\"text10px\" title=\"Remove This Listing From My Itinerary\" style=\"background-color:#999999;color:#FFFFFF;padding-left:2px;cursor:pointer;\" onclick=\"RemoveListing('"+r+"','"+t+"')\">- Remove From My List</div>";
		}
	}	
	return d;
}
//ERROR

function RemoveListingAndLink(r){
	var LData=new Array();
	var tmp;
	LData=r.split(',');	
	for (var i=0;i<itinerary_items.length;i++)
		if(LData[0]==itinerary_items[i][0])
			tmp=itinerary_items.splice(i,1);
	if(RemoveItem())DocumentDivAdd(LData);
}
function DocumentDivAdd(r){
	if(document.getElementById("div_itRight_"+r[0]))document.getElementById("div_itRight_"+r[0]).innerHTML=AddRemoveItemDiv(r,'add',"div_itRight_"+r[0]);
	if(document.getElementById("div_itLeft_"+r[0]))document.getElementById("div_itLeft_"+r[0]).innerHTML=AddRemoveItemDiv(r,'add',"div_itLeft_"+r[0]);
	if(document.getElementById("div_itMap_"+r[0]))document.getElementById("div_itMap_"+r[0]).innerHTML=AddRemoveItemDiv(r,'add',"div_itMap_"+r[0]);
}
function DocumentDivRemove(r){
	if(document.getElementById("div_itMap_"+r[0]))document.getElementById("div_itMap_"+r[0]).innerHTML=AddRemoveItemDiv(r,'remove',"div_itMap_"+r[0]);
	if(document.getElementById("div_itRight_"+r[0]))document.getElementById("div_itRight_"+r[0]).innerHTML=AddRemoveItemDiv(r,'remove',"div_itRight_"+r[0]);
	if(document.getElementById("div_itLeft_"+r[0]))document.getElementById("div_itLeft_"+r[0]).innerHTML=AddRemoveItemDiv(r,'remove',"div_itLeft_"+r[0]);
}
function SearchForSimilarListings(lid){
	if(document.getElementById("divMapLoading"))document.getElementById("divMapLoading").style.display="block";
	similarlistings="listingid <>"+lid;
	q_detail=CompileQ();
	RequestPreciseListings(requestType,subRequest,q_detail);
	similarlistings="";//reset
}
function AddRemoveItemDiv(r,v,t){
	var adrm_div=(v=="add")?"<div title=\"Add This Listing To My Itinerary\" style=\"background-color:de6747;color:#FFFFFF;padding-left:2px;cursor:pointer;\" onclick=\"AddListing('"+r+"','"+t+"')\">+ Add To My Itinerary</div>":"<div class=\"text10px\" title=\"Remove This Listing From My Itinerary\" style=\"background-color:#999999;color:#FFFFFF;padding-left:2px;cursor:pointer;\" onclick=\"RemoveListing('"+r+"','"+t+"')\">- Remove From My List</div>";
	return adrm_div;
}
function link1_Click(hdname,hddate,hdborough,editsrch,srchdetail,editsrchtd)
{
	//alert('link1_click');
	//alert(document.getElementById(hdborough).value);  
	brent="";
	bprewar=""
	bpostwar=""
	bopenhouseflag="";
	boutdoor="";
	bfireplace="";
	bpets="";
	bdoorman="";
	bdiningroom="";
	brooms=-1;
	bsubway=-1;
	barea=-1;
	bflgbeds=-1;
	bflgbaths=-1;
	bprice=-1;
	bapmt="";
	bmulfam="";
	bsingle="";
	bloft="";
	bcoop="";
	bcondos="";
	btwnhse="";
	bflgbeds="";
	bflgbaths="";
	btennis="";
	bsouthofhighway="";
	bpool="";
	bdock="";
	
	
	vlink1click = "true";
	vlink1click2 = "true";

	ccntoutdoor=0;
	ccntprewar=0;
	ccntpostwar=0;
	ccntopenhouseflag=0;
	ccntrent=0;
	ccntfireplace=0;
	ccntpetsallowed=0;
	ccntdoorman=0;
	ccntdiningroom=0;
	ccntrooms=0;
	ccntsubway=0;
	ccntarea=0;
	ccntflgbeds=0;
	ccntflgbaths=0;
	ccntprice=0;
	ccntapmt=0;
	ccntmulfam=0;
	ccntsingle=0;
	ccnttwnhse=0;
	ccntloft=0;
	ccntcoop=0;
	ccntcondos=0;
	ccnttennis=0;
	ccntsouthofhighway = 0;
	ccntpool=0;
	ccntdock=0;


	if(document.getElementById("tbl_searchdetail"))
		document.getElementById("tbl_searchdetail").style.display = 'block';
		
	if(document.getElementById("tr_tbl_searchdetail"))
		document.getElementById("tr_tbl_searchdetail").style.display = 'none';
		
	if(document.getElementById("tr_div_LoadSearch"))
		document.getElementById("tr_div_LoadSearch").style.display = 'block';

	if(document.getElementById("tr_div_Loadsubscription"))
		document.getElementById("tr_div_Loadsubscription").style.display = 'block';		
		
	if(document.getElementById("td_goBack"))
		document.getElementById("td_goBack").style.display = 'block';	
		
  if(document.getElementById("Editsearch_tr"))
		document.getElementById("Editsearch_tr").style.display = 'none';
	
	if(document.getElementById("tr_createsearch"))
		document.getElementById("tr_createsearch").style.display = 'none';

	if(document.getElementById("Tblemailschedule"))
		document.getElementById("Tblemailschedule").style.display = 'none';
		
	if(document.getElementById(hdborough))
    category = document.getElementById(hdborough).value;
    
    if(document.getElementById(hddate))
        SrchsaveDate=document.getElementById(hddate).value;
    else
       SrchsaveDate=hddate;
    
    if(document.getElementById(hdname))
        SrchName=document.getElementById(hdname).value;
    else
        SrchName=hdname;
 
        if(document.getElementById(editsrchtd))
            document.getElementById(editsrchtd).innerHTML = SrchName;
     
     ////   ////alert(SrchName);
////        ////alert('====');
    if(document.getElementById(hdborough))
        Srchborough = document.getElementById(hdborough).value;
     else
        Srchborough = hdborough;
        
 
//            if (document.getElementById(srchdetail)) {
//    searchdt_tr = document.getElementById(srchdetail);
//    document.getElementById(srchdetail).style.visibility='hidden';
//    }
//    
//    if (document.getElementById(editsrch)) {
//    document.getElementById(editsrch).style.visibility='visible';
//    }
 
    subRequest = Srchborough;
   ////alert(Srchborough);
    checkboxsavesrch.checked = false;
   if(document.getElementById('ctl00_ContentMain_txtSrchname'))
   {
    txtsavesrchName = document.getElementById('ctl00_ContentMain_txtSrchname');
    txtsavesrchName.value = "";
   }
   
SendXmlLoadHttpRequest("LoadArea",subRequest,"");

}

function DisplaySearchtable()
{
//alert('in step1');
sendDisplaySrchtableRequest("DisplaySavesrchtable","","","");
}

function DisplaySavesrchtble(res)
{
	//alert('DispTable');
	//alert(res);
	if(res == "1" || res == "2" || res == "3")
	   document.getElementById("Savesrch").style.display = 'block';
	else
	   document.getElementById("Savesrch").style.display = 'none';
}

function DisplayData(res)
{
//alert('display data');
//alert(res);

if(res == "")
	document.getElementById("Savesrch").style.display = 'none';

	
var vresult="";
 vresult = res;
  var vSrchname="",vReg="",vNoofListing="",vDateadded="";
  var vSrchname2="",vReg2="",vNoofListing2="",vDateadded2="";
  var vSrchname3="",vReg3="",vNoofListing3="",vDateadded3="";
 var strarrRes="",spres1="",spres2="",spres3="",strspc="",strspc2="",strspc3="";
 var nindx1=0,nindx2=0,nindx3=0;
 
                var searchcnt1 = document.getElementById('srchdata1ML_td');
				var searchcnt2 = document.getElementById('srchdata2ML_td');
				var searchcnt3 = document.getElementById('srchdata3ML_td');
				
				var searchName1 = document.getElementById('srchdata1SN_td');
				var searchName2 = document.getElementById('srchdata2SN_td');
				var searchName3 = document.getElementById('srchdata3SN_td');
				 
				var searchReg1 = document.getElementById('srchdata1REG_td');
				var searchReg2 = document.getElementById('srchdata2REG_td');
				var searchReg3 = document.getElementById('srchdata3REG_td');
				 
				var searchDat1 = document.getElementById('srchdata1SD_td');
				var searchDat2 = document.getElementById('srchdata2SD_td');
				var searchDat3 = document.getElementById('srchdata3SD_td');
				
				var searchDel1=document.getElementById('srchdata1DEL_td');
				var searchDel2=document.getElementById('srchdata2DEL_td');
				var searchDel3=document.getElementById('srchdata3DEL_td');
				
 //strarrRes = vresult.split('-');

/* nindx1 = vresult.Indexof('-');
 ////alert('nindx1');
 ////alert(nindx1);
 if(nindx1 != 0)
    spres1 = vresult.substring(0,nindx1 - 1);
    ////alert('spres1');
    ////alert(spres1);
    vresult = vresult.substring(nindx1+1,vresult.length);
    ////alert('vresult');
     ////alert(vresult);
 nindx2 = vresult.Indexof('-');
 ////alert('nindx2');
  ////alert(nindx2);
 if(nindx2 != 0)
    spres2 = vresult.substring(0,nindx2 - 1);
 ////alert('spres2');
 ////alert(spres2);
 spres3 = vresult.substring(nindx2+1,vresult.length - nindx2);
 ////alert('spres3');
  ////alert(spres3);*/
  
    strarrRes = vresult.split('-');
    
    spres1 = strarrRes[0];
    spres2 = strarrRes[1];
    spres3 = strarrRes[2];
    
   /* ////alert('spres1');
    ////alert(spres1);
    ////alert('spres2');
    ////alert(spres2);
    ////alert('spres3');
    ////alert(spres3);
    */
          
    if(spres1 != null)
    {
    strspc = spres1.split(',');
    vSrchname = strspc[0];
    vReg = strspc[1];
    vNoofListing = strspc[2];
    vDateadded = strspc[3];
    }
    if(spres2 != null)
    {
    strspc2 = spres2.split(',');
    vSrchname2 = strspc2[0];
    vReg2 = strspc2[1];
    vNoofListing2 = strspc2[2];
    vDateadded2 = strspc2[3];
    }
    
   if(spres3 != null)
    {
        strspc3 = spres3.split(',');
        vSrchname3 = strspc3[0];
        vReg3 = strspc3[1];
        vNoofListing3 = strspc3[2];
        vDateadded3 = strspc3[3];
    }
        
              
				//if(searchcnt1.innerHTML == ""){
		           if(vSrchname != ""){
		            searchcnt1.innerHTML=vNoofListing;               
		            searchName1.innerHTML="<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname+"','"+vDateadded+"','"+vReg+"','Editsearch_tr','tbl_searchdetail')\" >"+vSrchname+"</a>";
		            searchReg1.innerHTML=vReg;
		            searchDat1.innerHTML=vDateadded;
		            searchDel1.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname+"')\" >"+"Delete"+"</a>";	
		            }
		            else
		            {
		            searchcnt1.innerHTML="";               
		            searchName1.innerHTML="";
		            searchReg1.innerHTML="";
		            searchDat1.innerHTML="";
		            searchDel1.innerHTML="";
		            }
		       // }
		       // else if(searchcnt2.innerHTML == ""){
		            if(vSrchname2 != ""){
                    searchcnt2.innerHTML=vNoofListing2;
                    searchName2.innerHTML= "<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname2+"','"+vDateadded2+"','"+vReg2+"','Editsearch_tr','tbl_searchdetail')\" >"+vSrchname2+"</a>";
		            searchReg2.innerHTML=vReg2;
		            searchDat2.innerHTML=vDateadded2;
                    searchDel2.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname2+"')\" >"+"Delete"+"</a>";	
                    }
                    else
                    {
                    searchcnt2.innerHTML="";
                    searchName2.innerHTML="";
		            searchReg2.innerHTML="";
		            searchDat2.innerHTML="";
                    searchDel2.innerHTML="";
            
                    }
		        //}
		        //else if (searchcnt3.innerHTML == "") {
		         if(vSrchname3 != ""){
		            searchcnt3.innerHTML=vNoofListing3;
		            searchName3.innerHTML="<a href=\"javascript:void(0)\" onclick=\"link1_Click('"+vSrchname3+"','"+vDateadded3+"','"+vReg3+"','Editsearch_tr','tbl_searchdetail')\" >"+vSrchname3+"</a>";
		            searchReg3.innerHTML=vReg3;
		            searchDat3.innerHTML=vDateadded3;
		            searchDel3.innerHTML="<a href=\"javascript:void(0)\" onclick=\"deleteSrch('"+vSrchname3+"')\" >"+"Delete"+"</a>";	
		            }
		            else
		            {
		       		searchcnt3.innerHTML="";
		            searchName3.innerHTML="";
		            searchReg3.innerHTML="";
		            searchDat3.innerHTML="";
		            searchDel3.innerHTML="";
		            }
		        //}
window.location.reload(true);
}

//collect selected neighborhoods
function SendSearchByNeighborhoods(cnt){
	count_by="";
	//////alert('SendSearchByNeighborhoods');
	//////alert(cnt);
//	if(cnt == "Search Name already exists,Provide a different Name.")
//	  {
//	    ////alert('Search Name already exists,Provide a different Name.');
//	    checkboxsavesrch.checked = false;
//	    //if(document.getElementById('ctl00_ContentMain_txtSrchname'))
//	        //document.getElementById('ctl00_ContentMain_txtSrchname').focus();
//	    return false;
//	  }
	
	  
	if(cnt==0){
		alert("Sorry, there are no open houses available\nfor the date selected, please try again.");
		//alert(subRequest);
		//document.getElementById("div_"+subRequest+"_loading").innerHTML="Sorry, there is no openhouse for the date selected";

        document.getElementById("div_"+subRequest+"_loading").innerHTML="";	}else{
	if(document.URL.toLowerCase().match("cmembers"))
	{
	
			if(checkboxsavesrch.checked == true){
				//////alert('in cmembers SendSearchByNeighborhoods');
				/*var searchcnt1 = document.getElementById('srchdata1ML_td');
				var searchcnt2 = document.getElementById('srchdata2ML_td');
				var searchcnt3 = document.getElementById('srchdata3ML_td');
				 searchcnt1.display = true;
			
				var innerhtm1 = searchcnt1.innerHTML;
				
			
				if(searchcnt1.innerHTML == ""){
		            searchcnt1.innerHTML=cnt;
		        }
		        else if(searchcnt2.innerHTML == ""){
                searchcnt2.innerHTML=cnt;		
		        }
		        else if (searchcnt3.innerHTML == "") {
		        searchcnt3.innerHTML=cnt;
		        }*/
		        //alert('before RequestPreciseListings');
		        //alert(q_detail);
		        RequestPreciseListings("SaveSrchAllListings",subRequest,q_detail);
				}
				else
				{
				  ////  ////alert('in cmembers NOT checked SendSearchByNeighborhoods');
					document.getElementById("div_"+subRequest+"_loading").innerHTML="Loading "+cnt+" Listings... Please Wait";
		            RequestPreciseListings("SrchAllListings",subRequest,q_detail);
				}
				
	
	
	}
	else
	{
		document.getElementById("div_"+subRequest+"_loading").innerHTML="Loading "+cnt+" Listings... Please Wait";
		RequestPreciseListings("SrchAllListings",subRequest,q_detail);
	}
	}	
}

//collect selected neighborhoods
function SearchByNeighborhoods(){
//alert('SearchByNeighborhoods 2');
	if(ChkDate()){
//		if(document.getElementById("tbl_searchdetail"))
//		   document.getElementById("tbl_searchdetail").style.display = 'block';
		
		vpath="searchText";
		//checkboxsavesrch.disabled = false;
		//////alert('in SearchByNeighborhoods ENABLE');
		//document.getElementById(chkboxSavesrchname).disabled = false;
		 //checkboxsavesrch.disabled=false;
		 //////alert(chkboxSavesrchname);
		_selectedNgbh="";
		ohdate="";
		if(_page=="ohplanner")ohdatehtml=document.getElementById("div_topoptions").innerHTML;
		if(document.getElementById("ctl00_ContentMain_OHDate"))	{
			var ohd=document.getElementById("ctl00_ContentMain_OHDate");
			ohdate=(ohd.options[ohd.selectedIndex].value!="")?" ohdate='"+ohd.options[ohd.selectedIndex].value+"' ":"";
			category1 = ohd.options[ohd.selectedIndex].value;
		}
		document.getElementById("div_"+subRequest+"_loading").style.display='block';
		var checkboxes=document.getElementsByTagName('input');
		if(requestType=="AllListings"){requestType="SrchAllListings";}//?
		for(var d=0;d<checkboxes.length;d++){
			if(checkboxes[d].getAttribute('type')=='checkbox'){
				if(checkboxes[d].checked==true){
					_selectedNgbh+=(_selectedNgbh=="")?"'"+checkboxes[d].value+"'":",'"+checkboxes[d].value+"'";				
				}
			}
		}
		ngbhinfo_areas=_selectedNgbh;
		if(_selectedNgbh==""){
			////alert("Please select your areas");
		}
		else{	
			_selectedNgbh="area in ("+_selectedNgbh+")";
			q_detail=CompileQ();
			count_by="ngbh";
			
		
			if(document.getElementById("ctl00_ContentMain_OHDate")){
			SendPreciseXmlHttpRequest("ListingsCount",subRequest,q_detail,document.getElementById("ctl00_ContentMain_OHDate").options[document.getElementById("ctl00_ContentMain_OHDate").selectedIndex].value);	
			}
			else
			{
			SendPreciseXmlHttpRequest("ListingsCount",subRequest,q_detail,"");
			}
		}	
	}
}

function deleteSrch(searchName)
{
 var Srchname = "";
 var vconfirm = 0;
 vconfirm = confirm('Do you want to delete this search?');

if(vconfirm == 0)
	return false;

if(document.getElementById(searchName))
    Srchname = document.getElementById(searchName).value;
else
    Srchname = searchName;
sendDelSearchRequest(Srchname,"Delserach");
}
function showEmailSubscription()
{
	if(document.getElementById("div_savesubscription"))
	   document.getElementById("div_savesubscription").innerHTML = "<font color='red'><b>Subscription Successsful.</b></font>";

	if(document.getElementById("RdoemaildailyY"))
	{
		if(document.getElementById("RdoemaildailyY").checked)
			document.getElementById("RdoemaildailyY").checked = false;
	}
	
	if(document.getElementById("RdoemailNotifyY"))
	{
				if(document.getElementById("RdoemailNotifyY").checked)
			document.getElementById("RdoemailNotifyY").checked = false;
	}
	
	
	if(document.getElementById("RdoemaildailyN")) 
	{
				if(document.getElementById("RdoemaildailyN").checked)
			document.getElementById("RdoemaildailyN").checked = false;
	}
	if(document.getElementById("RdoemailNotifyN"))
	{
				if(document.getElementById("RdoemailNotifyN").checked)
			document.getElementById("RdoemailNotifyN").checked = false;
	}
	if(document.getElementById("RdoDailyemail"))
	{
				if(document.getElementById("RdoDailyemail").checked)
			document.getElementById("RdoDailyemail").checked = false;
	}
	if(document.getElementById("Rdoweeklyemail"))
	{
				if(document.getElementById("Rdoweeklyemail").checked)
			document.getElementById("Rdoweeklyemail").checked = false;
	}
	
	var vtimeout = setTimeout("setTime()",1000);
  //alert('showEmailSubscription');

}

function setTime()
{
  	if(document.getElementById("div_savesubscription")){
	   	document.getElementById("div_savesubscription").innerHTML = "";
	   	document.getElementById("div_savesubscription").style.display = 'none';
	  }	
}

function btnEmailsubscription(ptype)
{
  
	var vemaildailyY = "", vemailNotifydailyY = "", vDailyemail = "", vWeeklyemail = "";
	var vemaildailyNo = "",vemailNotifydailyNo = "";
	

		 
	//alert(document.getElementById("RdoemailNotifyY").checked);
	if(document.getElementById("RdoemaildailyN")) 
	{	
		    //alert('in Radio Button Present');
			if(document.getElementById("RdoemaildailyN").checked)
				vemaildailyNo = "true";
	}

	if(document.getElementById("RdoemailNotifyN"))
	{
		   if(document.getElementById("RdoemailNotifyN").checked)
				vemailNotifydailyNo = "true";
	}
	
	if(document.getElementById("RdoemaildailyY") && document.getElementById("RdoemailNotifyY"))
	{
			if(document.getElementById("RdoemaildailyY").checked)
				vemaildailyY = "true";
			
			if(document.getElementById("RdoemailNotifyY").checked)
			vemailNotifydailyY = "true";


			
		    if(document.getElementById("RdoemaildailyY").checked  == true ||
		       document.getElementById("RdoemailNotifyY").checked == true ||
			   document.getElementById("RdoemaildailyN").checked  == true ||
			   document.getElementById("RdoemailNotifyN").checked == true ||
			   document.getElementById("RdoDailyemail").checked   == true ||
			   document.getElementById("Rdoweeklyemail").checked  == true )
			   
		    {
		    }
		    else
		    {
				alert('Please Select One of the Options for subscription');
				return false;
			}
	}
	
	//tr_div_savesubscription
	if(document.getElementById("tr_div_savesubscription"))
		 document.getElementById("tr_div_savesubscription").style.display = 'block';
		 
	if(document.getElementById("div_savesubscription"))
		 document.getElementById("div_savesubscription").style.display = 'block';  
	if(document.getElementById("RdoDailyemail"))
	{
	  if(document.getElementById("RdoDailyemail").checked)
		vDailyemail = "true";
	}

	if(document.getElementById("Rdoweeklyemail"))
	{
		  if(document.getElementById("Rdoweeklyemail").checked)
		  vWeeklyemail = "true";
	}
	
	SendXmlEmailHttpRequest("EmailSubscription",subRequest,"",ptype,vemaildailyY,vemailNotifydailyY,vDailyemail,vWeeklyemail,vemaildailyNo,vemailNotifydailyNo);
}

function SearchbyArea(res){
	
	//alert('SearchbyArea Res');
	//alert(res);
	var vspstr="";
	//if(ChkDate())
	var vspers = "";
	var vspand = "";
	var vdashsp = "";
	var vindexSep = "";
	var vat = "";
	var vtblno = "";
	var vspSep = "";
	var vRegion = "";
	var vindexat = res.indexOf('@');
	var vindexunds = res.indexOf('_');
	var vindexpert = res.indexOf('!');
	vindexSep = res.indexOf('|');
	
	
	var vflag = false;
	
	if(vindexat != -1)
	{
	 //alert('INDEX @ Present');
	if(vindexSep != -1)
	{
	 	vspSep = res.split('|');
	 	vRegion = vspSep[1].toString();
	 	vat = vspSep[0].toString().split('@');
	 	vtblno = vat[1];	 	
	}
	else
	{
	 	vat = res.split('@');
	 	vtblno = vat[1];
	}
	 var vsendtblno = 0;
	 //alert('table no');
	 //alert(vtblno);
	 if(vtblno.match(1)){vsendtblno = 100;}else if(vtblno.match(2)){vsendtblno = 101;}else if(vtblno.match(3)){vsendtblno = 111;}
	 if(vindexunds!=-1){
		vdashsp = vat[0].toString().split('_');
		//alert('After underscore split');
		//alert(vdashsp);
		vspers = vdashsp[0].split('!');
		//alert('After percentage split');
		//alert(vspers);
	}
	else
	{
		if(vindexpert!=-1){
		vspers = vat[0].toString().split('!');
		//alert('No underscore after percentage split');
		//alert(vspers[1]);
		}
		else{
		vspers = vat[0];
		//alert('No underscore No percentage split');
		//alert(vspers);
		}
	}
	}
	else{
	if(vindexunds!=-1){
		vdashsp = res.split('_');
		vspers = vdashsp[0].split('!');
	}
	else
	{
		if(vindexpert!=-1){
		vspers = res.split('!');
		}
		else{
		vspers = res;
		}
	}
	}
	var strrst=vspers[1];

	//alert('Result');
	//alert(strrst);
	//alert(vspers[0]);
	//alert(vspers[1]);
	
	if(vspers[1]!=null){
	var vindexand = vspers[1].toString().indexOf("and");
	if(vindexand!=-1)
	{
		vspand = vspers[1].split('and');
	}
	else
	{
		vspand = vspers[1];
		//alert('vspand');
		//alert(vspand);
	}
	}
	else
	{
	 var vindexandaeq = vspers.toString().indexOf("and area=");
	 if(vindexandaeq!=-1)
	 {
		vspand = vspers.split("=");
	 }
	 else
	 {
		vflag = true;
		vspand = vspers;
		//alert('vspand');
		//alert(vspand);
	 }
	}
	//vdashsp[1].replace(''",'');
	
	
	//alert('vdashsp');
	//alert(vdashsp[1]);
	var vsubstr = "";
	//alert(vspand);
	/*bldgtype
	propertytype
	rentsale
	prewar
	postwar
	openhouseflag
	outdoor
	fireplace
	petsallowed
	doorman
	diningroom
	rooms
	subway
	area
	beds
	baths
	price
	*/
  /*
	var dpdnroom = document.getElementById(rooms);
    var dpdnsubwline = document.getElementById(subwayline);

    if(document.getElementById(bed))
        beds =document.getElementById(bed).value;
    
    if(document.getElementById(dpdnroom))
	rooms=dpdnroom.options[dpdnroom.selectedIndex].value;	

    if(document.getElementById(dpdnsubwline))
	subwayline=dpdnsubwline.options[dpdnsubwline.selectedIndex].value;
	
	if(document.getElementById(bath))
	baths=document.getElementById(bath).value;
	if(document.getElementById(apmt))
	apmt=document.getElementById(apmt).checked;
	
	if(document.getElementById(area).value != "" && document.getElementById(area).value != "all")
	    ngbh=document.getElementById(area).value;
	
	if(document.getElementById(price))
	price=document.getElementById(price).value;
	
	if(document.getElementById(mulfam))
	mulfam=document.getElementById(mulfam).checked;
	
	if(document.getElementById(single))
	single=document.getElementById(single).checked;
	
	if(document.getElementById(twnhse))
	twnhse=document.getElementById(twnhse).checked;
	
	if(document.getElementById(coop))
	coop=document.getElementById(coop).checked;
	
	if(document.getElementById(condos))
	condos=document.getElementById(condos).checked;
	
	if(document.getElementById(loft))
	loft=document.getElementById(loft).checked;
	
	if(document.getElementById(prewar))
	prewar=document.getElementById(prewar).checked;
	
	if(document.getElementById(postwar))
	postwar=document.getElementById(postwar).checked;
	
	if(document.getElementById(pets))
	pets=document.getElementById(pets).checked;
	
	if(document.getElementById(outdoor))
	outdoor=document.getElementById(outdoor).checked;
	
	if(document.getElementById(doorman))
	doorman=document.getElementById(doorman).checked;
	
	if(document.getElementById(rent))
	rent=document.getElementById(rent).checked;
	
	if(document.getElementById(opnhse))
	opnhse=document.getElementById(opnhse).checked;
	
	if(document.getElementById(fireplace))
	fireplace=document.getElementById(fireplace).checked;
	
	if(document.getElementById(diningroom))
	diningroom=document.getElementById(diningroom).checked;
*/
		if(vindexunds != -1){
            if(vdashsp[1].match(1)){
	            //alert('in subway 1');
	            bsubway = 1;
	            }
	        else if(vdashsp[1].match(2))
	            bsubway = 2;
            else if(vdashsp[1].match(3))
	            bsubway = 3;    	            
	        else if(vdashsp[1].match(4))
	            bsubway = 4;
	        else if(vdashsp[1].match(5))
	            bsubway = 5;
	        else if(vdashsp[1].match(6))
	            bsubway = 6;
	        else if(vdashsp[1].match(7))
	            bsubway = 7;
	        else if(vdashsp[1].match("A"))
	            bsubway = A;
	       else if(vdashsp[1].match("B"))
	            bsubway = B;
	       else if(vdashsp[1].match("C"))
	            bsubway = C;
	       else if(vdashsp[1].match("D"))
	            bsubway = D;
	       else if(vdashsp[1].match("E"))
	            bsubway = E;
	       else if(vdashsp[1].match("F"))
	            bsubway = F;
           else if(vdashsp[1].match("G"))
	            bsubway = G;
	       else if(vdashsp[1].match("J"))
	            bsubway = J;
           else if(vdashsp[1].match("L"))
	            bsubway = L;
	       else if(vdashsp[1].match("M"))
	            bsubway = M;	                 	            
           else if(vdashsp[1].match("N"))
	            bsubway = N;
	       else if(vdashsp[1].match("Q"))
	            bsubway = Q;
	       else if(vdashsp[1].match("R"))
	            bsubway = R;	
           else if(vdashsp[1].match("S"))
	            bsubway = S;		                        
	       else if(vdashsp[1].match("V"))
	            bsubway = V;	
	       else if(vdashsp[1].match("W"))
	            bsubway = W;	
		}
		
	var alink=document.getElementById("lnkViewList");
	if(alink)
		alink.setAttribute("href","/property/search.aspx?region=NYC&RentSale=SU&sdetail="+vsendtblno+"&rtype=maplist&borough="+vRegion+"&sline="+bsubway);		
		//alert('before For loop vspand');
		//alert(vspand[0]);
		//alert(vspand[1]);
		
	for(var j1=0;j1<vspand.length;j1++)
	{
	  if(vspand != "")
	  {
		if(vflag)
			vsubstr = vspand.substring(0,5);
	    else  
			vsubstr = vspand[j1].substring(0,5);
		
	  }
	  //alert('vsubstr');
	  //alert(vsubstr);
	  if(vsubstr.match("bldg"))
	  {
	    var vspbldgtype = "";
	    vspand[j1] = vspand[j1].replace('~','');
	    vspand[j1] = vspand[j1].replace('~','');
	    //alert('vspand[j1]');
		//alert(vspand[j1]);
		if(vspand[j1].toString().indexOf('=')!=-1){
			vspbldgtype = vspand[j1].split('=');
		}
		else
			vspbldgtype = vspand[j1];
			
//		alert('vspbldgtype');
//		alert(vspbldgtype[0]);
//		alert(vspbldgtype[1]);
		
		if(vspand[j1].toString().indexOf('=')!=-1){
			if(vspbldgtype[1].match("Apartment")){
			 if(vflgclear != 1)
				bapmt = "true";
			}
			else if(vspbldgtype[1].match("Townhouse M%")){
			 if(vflgclear != 1)
				bmulfam = "true";
			}
			else if(vspbldgtype[1].match("Townhouse S%")){
			 if(vflgclear != 1) 
				bsingle = "true";
			}
			else if(vspbldgtype[1].match("Townhouse %")){
			 if(vflgclear != 1) 
				btwnhse = "true";
			}
			else if(vspbldgtype[1].match("Loft")){
			 if(vflgclear != 1)
				bloft = "true";
			}
		}
		else
		{
			var vsptbldgtype = "";
			//alert('in else');
			//alert(vspbldgtype);
			if(vspbldgtype.toString().indexOf("like")!=-1){
				vsptbldgtype = vspbldgtype.split("like");
			}
			
			if(vspbldgtype.toString().indexOf("like")!=-1)
			{
				if(vsptbldgtype[1].match("Apartment")){
				 if(vflgclear != 1)
					bapmt = "true";
				}
				else if(vsptbldgtype[1].match("Townhouse M")){
				 if(vflgclear != 1)
					bmulfam = "true";
				//alert('bmulfam');
				//alert(bmulfam);
				}
				else if(vsptbldgtype[1].match("Townhouse S")){
				 if(vflgclear != 1) 
					bsingle = "true";
				}
				else if(vsptbldgtype[1].match("Townhouse ")){
				 if(vflgclear != 1) 
					btwnhse = "true";
				}
				else if(vsptbldgtype[1].match("Loft")){
				 if(vflgclear != 1)
					bloft = "true";
				}
			}
			else
			{
				 if(vspbldgtype.match("Apartment")){
				 if(vflgclear != 1)
					bapmt = "true";
				}
				else if(vspbldgtype.match("Townhouse M")){
				 if(vflgclear != 1)
					bmulfam = "true";
				//alert('bmulfam');
				//alert(bmulfam);
				}
				else if(vspbldgtype.match("Townhouse S")){
				 if(vflgclear != 1) 
					bsingle = "true";
				}
				else if(vspbldgtype.match("Townhouse ")){
				 if(vflgclear != 1) 
					btwnhse = "true";
				}
				else if(vspbldgtype.match("Loft")){
				 if(vflgclear != 1)
					bloft = "true";
				}
			}
		}
	  }
	  else if(vsubstr.match("prop"))
	  {
	   var vspbldgtype = "";
	    vspand[j1] = vspand[j1].replace('\'','');
	    vspand[j1] = vspand[j1].replace('\'','');
	    
	    vspand[j1] = vspand[j1].replace('~','');
	    vspand[j1] = vspand[j1].replace('~','');
	    vspbldgtype = vspand[j1].split('=');
		//alert('In condo property');
		//alert(vspbldgtype[1]);
	    if(vspbldgtype[1].match("Coop")){
         if(vflgclear != 1)
            bcoop = "true";
        }
	    else if(vspbldgtype[1].match("Condo")){
	    if(vflgclear != 1) 
	        bcondos = "true";
	    }
	  }
	  else if(vsubstr.match("rent"))
	  {
	  
	  if(vflgclear != 1)
	        brent = "true";
	  }
	  else if(vsubstr.match("prew"))
	  {
	  if(vflgclear != 1)
	        bprewar = "true";
	  }
	  else if(vsubstr.match("post"))
	  {
	  if(vflgclear != 1)
	        bpostwar = "true";
	  }
	  else if(vsubstr.match("open"))
	  {
	  if(vflgclear != 1)
	        bopenhouseflag = "true";
	  }
	  else if(vsubstr.match("outd"))
	  {
	  if(vflgclear != 1)
	        boutdoor = "true";
	  }
	  else if(vsubstr.match("fire"))
	  {
	  if(vflgclear != 1)
	        bfireplace = "true";
	  }
	  else if(vsubstr.match("pets"))
	  { //alert('in pets allowed');
	  if(vflgclear != 1){
	        bpets = "true";
			//alert('in pets allowed TRUE');
			}
	  }
	  else if(vsubstr.match("door"))
	  {
	  if(vflgclear != 1)
	        bdoorman = "true";
	  }
	  else if(vsubstr.match("dini"))
	  {
	  if(vflgclear != 1)
	        bdiningroom = "true";
	  }
	  else if(vsubstr.match("tenn"))
	  {
	  if(vflgclear != 1)
	        btennis = "true";
	  }
	  else if(vsubstr.match("sout"))
	  {
	  if(vflgclear != 1)
	        bsouthofhighway = "true";
	  }
	  else if(vsubstr.match("pool"))
	  {
	  if(vflgclear != 1)
	        bpool = "true";
	  }
	  else if(vsubstr.match("dock"))
	  {
	  if(vflgclear != 1)
	        bdock = "true";
	  }	  	  	  	  
	  else if(vsubstr.match("room"))
	  {
	  
	    var nindex = "";
	     var vspno = "";
	    nindex = vspand[j1].indexOf('>');
	    if(nindex != -1)
	    {
	        vspno = vspand[j1].split('=');
	        //alert('vspno[1]');
	        //alert(vspno[1]);
	        //brooms
	        if(vspno[1] == 0)
	            brooms = 0;
	        else if(vspno[1] == 1)
	            brooms = 11;
            else if(vspno[1] == 2)
	            brooms = 22;
            else if(vspno[1] == 3)
	            brooms = 33;
            else if(vspno[1] == 4)
	            brooms = 44;
            else if(vspno[1] == 5)
	            brooms = 55;	                	            
	        //if(vspno[1].match("1"))
	    }
	    else
	    {
	        vspno = vspand[j1].split('=');
	        if(vspno[1] == 1)
	            brooms = 1;
            else if(vspno[1] == 2)
	            brooms = 2;
            else if(vspno[1] == 3)
	            brooms = 3;
            else if(vspno[1] == 4)
	            brooms = 4;
            else if(vspno[1] == 5)
	            brooms = 5;	 
	        //if(vspno[1].match("1"))
	    }
	    
	  }
	  else if(vsubstr.match("area"))
	  {
		var vsparea = "";
		//alert('in neighbourhood area value');
	    //alert(vspand[j1]);
	    vspand[j1] = vspand[j1].replace('~','');
	    vspand[j1] = vspand[j1].replace('~','');
	    vsparea = vspand[j1].split('=');
	    if(vsparea[1] != "" && vsparea[1] != "all")
			barea = vsparea[1];
		//alert('barea');
	    //alert(barea);
	  //document.getElementById("area").SelectedIndex.value = ;
	  
	  }
	  else if(vsubstr.match("subw"))
	  {
	    var nindex1 = "";
	    var vspno1 = "";
	    //nindex1 = vspand[j1].indexOf('>');
	    //if(nindex1 != -1)
	    //{
	    //      vspno1 = vspand[j1].split('=');
	          //if(vspno[1].match("1"))
	    //}
	    //else
	    {
	         //vspno1 = vspand[j1].split('=');
	         
	      
	    }
	  }
	  else if(vsubstr.match("pric"))
	  {
		//bprice = idxprice;
	 	var spprice = "";
		spprice = vspand[j1].split('=');
		if(spprice[1] != "" && spprice[1] != null)
			bprice = spprice[1];
	
		//alert('bprice value is');
		//alert(bprice);
	  }
	  else if(vsubstr.match("beds"))
	  {
		var nindex2 = "";
	     var vspno2 = "";
	    nindex2 = vspand[j1].indexOf('>');
	   //alert('vspand  ----'+vspand[j1]);
	    if(nindex2 != -1)
	    {
	        vspno2 = vspand[j1].split('=');
	        //alert('vspno2[1]');
	        //alert(vspno2[1]);
			if(vspno2[1].match(1)) bflgbeds = 1;
			else if(vspno2[1].match(2)) bflgbeds = 2;
			else if(vspno2[1].match(3)) bflgbeds = 3;
			else if(vspno2[1].match(4)) bflgbeds = 4;
			else if(vspno2[1].match(5)) bflgbeds = 5;
			else if(vspno2[1].match(6)) bflgbeds = 6;
			else if(vspno2[1].match(7)) bflgbeds = 7;
			else if(vspno2[1].match(8)) bflgbeds = 8;
			else if(vspno2[1].match(9)) bflgbeds = 9;
			else if(vspno2[1].match(10)) bflgbeds = 10;
		}
		else
		{
		    vspno2 = vspand[j1].split('=');
	        //alert('vspno2[1]');
	        //alert(vspno2[1]);
			if(vspno2[1].match(0)) bflgbeds = 0;
			else if(vspno2[1].match(1)) bflgbeds = "only_1";
			else if(vspno2[1].match(2)) bflgbeds = "only_2";
			else if(vspno2[1].match(3)) bflgbeds = "only_3";
			else if(vspno2[1].match(4)) bflgbeds = "only_4";
			else if(vspno2[1].match(5)) bflgbeds = "only_5";
			else if(vspno2[1].match(6)) bflgbeds = "only_6";
		}
	  }
	   else if(vsubstr.match("bath"))
	  {
		var nindex4 = "";
	     var vspno4 = "";
	    nindex4 = vspand[j1].indexOf('>');
	    if(nindex4 != -1)
	    {
	        vspno4 = vspand[j1].split('=');
	        //alert('vspno4[1]');
	        //alert(vspno4[1]);
			if(vspno4[1].match(1)) bflgbaths = 1;
			else if(vspno4[1].match(2)) bflgbaths = 2;
			else if(vspno4[1].match(3)) bflgbaths = 3;
			else if(vspno4[1].match(4)) bflgbaths = 4;
			else if(vspno4[1].match(5)) bflgbaths = 5;
			else if(vspno4[1].match(6)) bflgbaths = 6;
			else if(vspno4[1].match(7)) bflgbaths = 7;
			else if(vspno4[1].match(8)) bflgbaths = 8;
			else if(vspno4[1].match(9)) bflgbaths = 9;
			
		}
		else
		{
		    vspno4 = vspand[j1].split('=');
	        //alert('vspno4[1]');
	        //alert(vspno4[1]);
			if(vspno4[1].match(1)) bflgbaths = "only_1";
			else if(vspno4[1].match(2)) bflgbaths = "only_2";
			else if(vspno4[1].match(3)) bflgbaths = "only_3";
			else if(vspno4[1].match(4)) bflgbaths = "only_4";
			else if(vspno4[1].match(5)) bflgbaths = "only_5";
			else if(vspno4[1].match(6)) bflgbaths = "only_6";
			else if(vspno4[1].match(6)) bflgbaths = "only_6";
		}
	  }
	  /*else if(vsubstr == "")
	  {
	  
	  }
	  else if(vsubstr == "")
	  {
	  
	  }
	  else if(vsubstr == "")
	  {
	  
	  }
	  else if(vsubstr == "")
	  {
	  
	  }
	 */
	}
	
	
	
	{
	////////alert('SearchbyArea');
		_selectedNgbh="";
		//ohdate="";
		/*if(_page=="ohplanner")ohdatehtml=document.getElementById("div_topoptions").innerHTML;
		if(document.getElementById("ctl00_ContentMain_OHDate"))	{
			var ohd=document.getElementById("ctl00_ContentMain_OHDate");
			ohdate=(ohd.options[ohd.selectedIndex].value!="")?" ohdate='"+ohd.options[ohd.selectedIndex].value+"' ":"";
			category1 = ohd.options[ohd.selectedIndex].value;
		}*/
		//document.getElementById("div_"+subRequest+"_loading").style.display='block';
		//var checkboxes=document.getElementsByTagName('input');
		if(requestType=="AllListings"){requestType="SrchAllListings";}//?
		//for(var d=0;d<checkboxes.length;d++){
			//if(checkboxes[d].getAttribute('type')=='checkbox'){
			//	if(checkboxes[d].checked==true){
				//	_selectedNgbh+=(_selectedNgbh=="")?"'"+checkboxes[d].value+"'":",'"+checkboxes[d].value+"'";
				//}
			//}
		//}
		if(vindexunds!=-1){
			 vspstr = vdashsp[0].split('!');
			_selectedNgbh=vspstr[0];
		}
		else
		{
			 //alert('res');
			 //alert(res);
			 var vatsp = res.split('@');
			 var vspresngh = vatsp[0].split('!');
			 var vspresngh = vatsp[0].split('!');
			 _selectedNgbh=vspresngh[0];
			 //alert('vspresngh[1]');
			 //alert(vspresngh[1]);
		}
		
			
		////////alert(subRequest);
		//if(_selectedNgbh != "")
		  //  _selectedNgbh="area in ("+_selectedNgbh+")";		
		    
		ngbhinfo_areas=_selectedNgbh; //_selectedNgbh;
        
		if(_selectedNgbh==""){
			////alert("Please select your areas");
		}
		else{
			_selectedNgbh="area in ("+_selectedNgbh+")";
			////////alert('_selectedNgbh');
		   ////alert(_selectedNgbh);
			//q_detail=CompileQ();
			
			
			//if(_selectedNgbh!=""){
			//q_detail ="and "+_selectedNgbh;
			//}
			//alert('vspstr');
			//alert(vspstr[1]);
			if(vindexunds!=-1){
				//alert('in QDetail undefined');
				//alert(q_detail);
				q_detail = vspstr[1];
			}
			else
			{
				
				q_detail = vspresngh[1]; 
				
			}
			count_by="ngbh";
			//alert('qDetail');
			//alert(q_detail);
			
			//if(document.getElementById("ctl00_ContentMain_OHDate")){
			//SendPreciseXmlHttpRequest("ListingsCount",subRequest,q_detail,document.getElementById("ctl00_ContentMain_OHDate").options[document.getElementById("ctl00_ContentMain_OHDate").selectedIndex].value);	
			//}
			//else
			//{
			//SendPreciseXmlHttpRequest("ListingsCount",subRequest,q_detail,"");
			
	       
			RequestPreciseListings("SrchAllListings",subRequest,q_detail);
			//}
		}	
	}
}

//check all checkboxes
function SetCheckedVal(val)
{
	var mkChk;
	mkChk=(val==1)?true:false;
	var elements=document.getElementsByTagName('input');
	for(var i=0;i<elements.length;i++)
		if(elements[i].getAttribute('type')=='checkbox')
			elements[i].checked=mkChk;
}

function Brk_Newlistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
  if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
     if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    
    showpanel=panel;
    var vtrdiv ="",vtrdiv="",vtrdiv3 ="";
   //////alert('showpanel');
   //////alert(showpanel);
    var strtb="";
	{
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	    vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink2){	    
	   hidelink2.style.display='block';
       document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
	    //if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		//strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
		//else
		//strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
     
        vtrdiv2 = "tr_"+document.getElementById(tblid).id;
     
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
       document.getElementById(divid).style.overflowY = 'hidden';	   
       }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
       document.getElementById(vtrdiv2).style.display='block';
       }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid)){
            showtableidimg=document.getElementById(tblid);
            //////alert('2 - tblid');
            //////alert(tblid);
           }
            
     }	   
     else if (showpanel == 3)
     {
        vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
        // strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   //  strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
	   if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}

          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Brk_NewestListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
	           //alert('show panel');
	   //////alert(spanel1);
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Brk_NewestListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Brk_NewestListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
			//	document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
	   }
    }
	 if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

function Hmp_Openhselistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
 {
 //alert('in Hamptons OpenHouse Listings');
 if(document.getElementById(imgsave))
       btnimgsave = document.getElementById(imgsave);
     
     
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"229\" height=\"78\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top;\">";
	   strtb+="<tr class=\"text10px\">";
	   //strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\" width=\"270\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src=\"../mycorcoran/img/homepage_selectedpanel.jpg\" width=\"270\" height=\"198.5\" border=\"0\"></td>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'></td>";

		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
			
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'></td>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
	    //alert('tblid id');
		//alert(tblid.id);
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
//	alert('hidelink id');
//	alert(hidelnk33.id);
//	alert('vtrdiv3 id');
//	alert(vtrdiv3);
	
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;padding-right:0px;\" align=\"left\" valign=\"top\" width='270'>";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='270' height='200' border='0'></td>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}

          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</tr>";
	   strtb+="</table>";
//	   alert(strtb);
	
	   if(showtableidimg){//alert('btn IMG save');
       //alert(showtableidimg.id);
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Hmp_OpenhseListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	//			document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Hmp_OpenhseListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
		//		document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Hmp_OpenhseListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
    }
	
  		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

function pmb_Openhselistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
 {
 if(document.getElementById(imgsave))
       btnimgsave = document.getElementById(imgsave);
     
     
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	      
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}


          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){//alert('btn IMG save');
       //////alert(showtableidimg.value);
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "pmb_OpenhseListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "pmb_OpenhseListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "pmb_OpenhseListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";					
	   }
    }
	
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(showpanel == 3){
			   if(document.getElementById(btl3))
				document.getElementById(btl3).width="248px";
			}
			else
			{
				if(document.getElementById(btl3))
				document.getElementById(btl3).width="247px";
			}
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

 function Man_Openhselistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
 {
 if(document.getElementById(imgsave))
       btnimgsave = document.getElementById(imgsave);
     
     
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
       // if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//            strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//        else	    
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
	        
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
      //  strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	 //   strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";

		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}

          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){ //////alert('btn IMG save');
       //////alert(showtableidimg.value);
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Man_OpenhseListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
				//document.getElementById(btl1).width="248.9px";
//				if(document.getElementById(btl2))
//					document.getElementById(btl2).width="249px";
			//	document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Man_OpenhseListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
//				document.getElementById(btl2).width="249px";
//				if(document.getElementById(btl1))
//					document.getElementById(btl1).width="248.9px";
			//	document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Man_OpenhseListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
              //  document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="245px";								
	   }
    }
	 if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}
function Brk_Mostviewedlistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
 if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";

		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
			
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
     var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}

		if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Brk_MostViewedNow";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Brk_MostViewedNow";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Brk_MostViewedNow";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
//		    document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
 
	   }
    }
	   if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

function Brk_MostviewedThisWklistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	    var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
	      if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
			
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Brk_MostViewedThisWeek";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Brk_MostViewedThisWeek";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Brk_MostViewedThisWeek";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
			//	document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
    }
	 if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

function Hmp_MostviewedThisWklistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
 if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
	 }
     else if (showpanel == 2) 
     {
     var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
        if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Hmp_MostViewedThisWeek";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
//				document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Hmp_MostViewedThisWeek";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Hmp_MostViewedThisWeek";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
	   }
    }
	
  		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}
function pmb_MostviewedThisWklistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
 if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	   
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
	 }
     else if (showpanel == 2) 
     {
     var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";

		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
//          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "pmb_MostViewedThisWeek";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "pmb_MostViewedThisWeek";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "pmb_MostViewedThisWeek";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";		
	   }
    }
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

function Man_MostviewedThisWklistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
    if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
	  // if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	   else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";

		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	   if(document.getElementById(tblid))
          showtableidimg=document.getElementById(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
       // strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	  //  strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Man_MostViewedThisWeek";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
//				document.getElementById(btl1).width="248.9px";
//				if(document.getElementById(btl2))
//					document.getElementById(btl2).width="249px";
				//document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Man_MostViewedThisWeek";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
//				document.getElementById(btl2).width="249px";
//				if(document.getElementById(btl1))
//					document.getElementById(btl1).width="248.9px";
				//document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Man_MostViewedThisWeek";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
			//	document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="245px";
	   }
    }
	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

function Hmp_Mostviewedlistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
 if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	   if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	   else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
     var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
     var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Hmp_MostViewedNow";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
//				document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Hmp_MostViewedNow";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Hmp_MostViewedNow";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";


	   }
    }
	
  		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

function pmb_Mostviewedlistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
 if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	    var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";

		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";

	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}


          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "pmb_MostViewedNow";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "pmb_MostViewedNow";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "pmb_MostViewedNow";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
//		    	document.getElementById(btl1).width="256px";
//		    	document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";		
			
	   }
    }
	  	if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}
function Man_Mostviewedlistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
 if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
		var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
	  //  if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	      
	     if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
		var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
		var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
        //strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
		//strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}

          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Man_MostViewedNow";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
		  //document.getElementById(btl1).width="248.9px";
		  //if(document.getElementById(btl2))
		  //document.getElementById(btl2).width="249px";
		  //document.getElementById(btl1).width="255px";
		  //document.getElementById(btl2).width="256px";
		  //if(document.getElementById(btl3))
		  //document.getElementById(btl3).width="246px";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Man_MostViewedNow";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
			//document.getElementById(btl2).width="249px";
			//if(document.getElementById(btl1))
			//document.getElementById(btl1).width="248.9px";
			//document.getElementById(btl1).width="256px";
			//document.getElementById(btl2).width="256px";
			//if(document.getElementById(btl3))
			//document.getElementById(btl3).width="246px";

       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Man_MostViewedNow";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
			//document.getElementById(btl1).width="255px";
			//document.getElementById(btl2).width="256px";
			//if(document.getElementById(btl3))
			//document.getElementById(btl3).width="245px";
	   }
    }
	 if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
	
}

function Brk_Openhselistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
 {
 if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
    var strtb="";
    {
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	    var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
	//    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";

		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
			
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Brk_OpenhseListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Brk_OpenhseListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Brk_OpenhseListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
		//	document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
	
	   }
    }
	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}

function Hmp_Newlistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
  if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
   
    var strtb="";
	{
	   strtb="<table width=\"242\" height=\"85\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"middle\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246px' height='198px' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243px' height='198px' border='0'>";
		
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
			
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
           //alert('2');
           //alert(tblid);
            
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Hmp_NewestListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
			//	document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Hmp_NewestListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
			//	document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Hmp_NewestListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
    }
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}
function pmb_Newlistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
  if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
   
    var strtb="";
	{
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	    var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
       }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
           //alert('2');
           //alert(tblid);
            
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "pmb_NewestListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "pmb_NewestListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "pmb_NewestListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
    }
	  		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
}
function setd(n)
{
    for(var i=0;i<divs.length;i++)
    {
        if(div[i].getAttribute("id").indexOf(basename)!=-1)
        {
            if(div[i])div[i].style.display = 'block';
        }
    }
}

function setDisplayStyle(ccookieval,ckno,ftype)
{
//alert('setDisplayStyle');
//alert(ccookieval);
//alert(ckno);
//alert(ftype);


if(ftype == 1){
if(ccookieval != "" || ccookieval != null){

if(ckno == 2)
{
   if(document.getElementById(tdlid22)){
      //alert('tdlid set before');
      //alert(document.getElementById(tdlid22).id);
        document.getElementById(tdlid22).style.display='none';
     // alert('tdlid set before');
     // alert(document.getElementById(tdlid22).style.display);
        }
        
    if(document.getElementById(tddt22)){
    //alert('tdlid set');
    //alert(document.getElementById(tddt22).id);
        document.getElementById(tddt22).style.display='block';
        }
   
     if(document.getElementById(tdln22)){
       //alert('tdLn set before');
    //alert(document.getElementById(tdln22).id);
        document.getElementById(tdln22).style.display='none';
        //alert('tdLn set before');
        //alert(document.getElementById(tdln22).style.display);
        }
        
    if(document.getElementById(tdline22)){
        //alert('tdLine set before');
    //alert(document.getElementById(tdline22).id);
        document.getElementById(tdline22).style.display='block';
        //alert('tdLine set After');
         //alert(document.getElementById(tdline22).style.display);
        }
    
    if(document.getElementById(dvline22))
        document.getElementById(dvline22).style.display='none';     
}
else if(ckno == 3)
{
   if(document.getElementById(tdlid33))
        document.getElementById(tdlid33).style.display='none';
        
    if(document.getElementById(tddt33))
        document.getElementById(tddt33).style.display='block';
   
     if(document.getElementById(tdln33))
        document.getElementById(tdln33).style.display='none';
        
    if(document.getElementById(tdline33))
        document.getElementById(tdline33).style.display='block';
    
    if(document.getElementById(dvline33))
        document.getElementById(dvline33).style.display='none';    
}

var vsub1="";
if(ccookieval != null)
    vsub1 = ccookieval.substring(0,7);
    

var vf1 = vsub1.replace('_','');
var vfn1 = "div_"+vf1;
var vsubck1 = "";
 var gdiv=document.getElementsByTagName('div');
 var gtrdiv=document.getElementsByTagName('tr');
 
 if(ccookieval != null)
	vsubck1 = ccookieval.substring(ccookieval.length-4,ccookieval.length);
	
 //alert('gdiv length');
 //alert(gdiv.length);
 for(var i=0;i<gdiv.length;i++)
    {
    
     var vsubpno = gdiv[i].getAttribute("id").substring(gdiv[i].getAttribute("id").length-1,gdiv[i].getAttribute("id").length)
     
     var vgivval = gdiv[i].getAttribute("id");
     var vtrDiv = "tr_" + vgivval;
     
     if(gdiv[i].getAttribute("id").substring(10,8) == "Mos"){         

        if(gdiv[i].getAttribute("id").substring(0,10) == vfn1 && ckno == 1)
        {
         if(gdiv[i].getAttribute("id").substring(gdiv[i].getAttribute("id").length-6,gdiv[i].getAttribute("id").length) == "edList" && vsubck1 == "dNow")
         {
           if(vsubpno != 2 && vsubpno != 3)
           {
           
            for(var j=0;j<gtrdiv.length;j++)
            {
                if(vtrDiv == gtrdiv[j].getAttribute("id").value)
                {
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                }
            }
            
            if(gdiv[i])gdiv[i].style.display = 'block';
            
            
           }
         }
         else if(gdiv[i].getAttribute("id").substring(gdiv[i].getAttribute("id").length-6,gdiv[i].getAttribute("id").length) == "WkList" && vsubck1 == "week")
         {
           if(vsubpno != 2 && vsubpno != 3)
           {
            for(var j=0;j<gtrdiv.length;j++)
            {
                if(vtrDiv == gtrdiv[j].getAttribute("id").value)
                {
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                }
            }
            
            if(gdiv[i])gdiv[i].style.display = 'block';
           }
         }
        }
        else if(gdiv[i].getAttribute("id").substring(0,10) == vfn1 && ckno == 2)
        {
          if(gdiv[i].getAttribute("id").substring(gdiv[i].getAttribute("id").length-6,gdiv[i].getAttribute("id").length) == "edList" && vsubck1 == "dNow")
          {
            if(vsubpno == 2)
           {
           for(var j=0;j<gtrdiv.length;j++)
            {
                if(vtrDiv == gtrdiv[j].getAttribute("id").value)
                {
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                }
            }
            
            if(gdiv[i])gdiv[i].style.display = 'block';
           }
          }
          else if(gdiv[i].getAttribute("id").substring(gdiv[i].getAttribute("id").length-6,gdiv[i].getAttribute("id").length) == "WkList" && vsubck1 == "week")
          {
            if(vsubpno == 2)
           {
           for(var j=0;j<gtrdiv.length;j++)
            {
                if(vtrDiv == gtrdiv[j].getAttribute("id").value)
                {
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                }
            }
            
            if(gdiv[i])gdiv[i].style.display = 'block';
           }
          }
        }
        else if(gdiv[i].getAttribute("id").substring(0,10) == vfn1 && ckno == 3)
        {
         if(gdiv[i].getAttribute("id").substring(gdiv[i].getAttribute("id").length-6,gdiv[i].getAttribute("id").length) == "edList" && vsubck1 == "dNow")
          {
            if(vsubpno == 3)
           {
           for(var j=0;j<gtrdiv.length;j++)
            {
                if(vtrDiv == gtrdiv[j].getAttribute("id").value)
                {
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                }
            }
            
            if(gdiv[i])gdiv[i].style.display = 'block';
           }
          }
          else if(gdiv[i].getAttribute("id").substring(gdiv[i].getAttribute("id").length-6,gdiv[i].getAttribute("id").length) == "WkList" && vsubck1 == "week")
          {
          for(var j=0;j<gtrdiv.length;j++)
            {
                if(vtrDiv == gtrdiv[j].getAttribute("id").value)
                {
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                }
            }
            
            if(vsubpno == 3)
           {
            if(gdiv[i])gdiv[i].style.display = 'block';
           }
          }
        }
        }
        else
        {
        
        if(gdiv[i].getAttribute("id").substring(0,10) == vfn1 && ckno == 1)
        {
        //alert('value comparision');
        //alert(gdiv[i].getAttribute("id").length-2);
        //alert(gdiv[i].length-1);
        //alert(gdiv[i].getAttribute("id").substring(gdiv[i].getAttribute("id").length-1,gdiv[i].getAttribute("id").length));
        
       
           if(vsubpno != 2 && vsubpno != 3)
           {
           //alert('length gtrdiv');
            //alert(gtrdiv.length);
            //alert('value');
            //alert(vtrDiv);
            for(var j=0;j<gtrdiv.length;j++)
            {
            //alert('value');
            //alert(vtrDiv);
           
           
                if(vtrDiv == gtrdiv[j].getAttribute("id"))
                {
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                     //alert('tr Name');
                     //alert(gtrdiv[j].getAttribute("id"));
                     //alert(gtrdiv[j].style.display);
                }
            }
            
            if(gdiv[i])gdiv[i].style.display = 'block';
            //alert(gdiv[i].getAttribute("id"));
            //alert(gdiv[i].style.display);
           }
        }
        else if(gdiv[i].getAttribute("id").substring(0,10) == vfn1 && ckno == 2)
        {
        
        if(gdiv[i].getAttribute("id") == "div_ManNewList2"){
         /*alert('vtrdiv');
         alert(vtrDiv);
         alert('substring');
         alert(gdiv[i].getAttribute("id").substring(0,10));
         alert('vfn');
         alert(vfn1);
         alert('vsubpno');
         alert(vsubpno);
         alert('ckno');
         alert(ckno);*/
         }
           if(vsubpno == 2)
           {
           // alert('vsubpno is 2');
            //alert('gtrdiv.length');
            //alert(gtrdiv.length);
            for(var j=0;j<gtrdiv.length;j++)
            {
            // alert('gtrdiv[j].getAttribute("id").value');
            // alert(gtrdiv[j].getAttribute("id").value);
                if(vtrDiv == gtrdiv[j].getAttribute("id"))
                {
                   //alert('vtrdiv match');
                   //alert(vtrDiv);
                   //alert(gtrdiv[j].getAttribute("id"));
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                }
            }
            
            if(gdiv[i])gdiv[i].style.display = 'block';
           }
        }
        else if(gdiv[i].getAttribute("id").substring(0,10) == vfn1 && ckno == 3)
        {
           if(vsubpno == 3)
           {
           //alert('gtrdiv3 ID');
           //alert(vtrDiv);
            for(var j=0;j<gtrdiv.length;j++)
            {
             //alert('gtrdiv3 ID LOOP');
             //alert(gtrdiv[j].getAttribute("id"));
                if(vtrDiv == gtrdiv[j].getAttribute("id"))
                {
                    //alert('gtrdiv3 Similarity');
                    //alert(gtrdiv[j].id);
                    if(gtrdiv[j])gtrdiv[j].style.display = 'block';
                }
            }
            
            if(gdiv[i])gdiv[i].style.display = 'block';
           }
        }
       }
    }

/*switch(ccookieval)
{
    case "Man_NewestListings":
    {
     if(ckno == 1){
     if(document.getElementById('div_ManNewList'))
        document.getElementById('div_ManNewList').style.display = 'block';
    }
    else if(ckno == 2)
    {
     if(document.getElementById('div_ManNewList2'))
        document.getElementById('div_ManNewList2').style.display = 'block'; 
    }
    else if(ckno == 3)
    {
     if(document.getElementById('div_ManNewList3'))
        document.getElementById('div_ManNewList3').style.display = 'block';
    }
    }
    break;
    case "Man_FeaturedListings":
    {
    if(ckno == 1){
     if(document.getElementById('div_ManFeaturedList'))
        document.getElementById('div_ManFeaturedList').style.display = 'block';
     }
     else if(ckno == 2)
     {
     if(document.getElementById('div_ManFeaturedList2'))
        document.getElementById('div_ManFeaturedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
     if(document.getElementById('div_ManFeaturedList3'))
        document.getElementById('div_ManFeaturedList3').style.display = 'block';
     }   
    }
    break;
    case "Brk_NewestListings":
    {
    if(ckno == 1){
      if(document.getElementById('div_BrkNewList'))
        document.getElementById('div_BrkNewList').style.display = 'block';
    }  
    else if(ckno == 2)
    {
       if(document.getElementById('div_BrkNewList2'))
        document.getElementById('div_BrkNewList2').style.display = 'block';
    }
    else if(ckno == 3)
    {
       if(document.getElementById('div_BrkNewList3'))
        document.getElementById('div_BrkNewList3').style.display = 'block';
    }     
    }
    break; 
    case "Brk_FeaturedListings":
    {
     if(ckno == 1){
      if(document.getElementById('div_BrkFeaturedList'))
        document.getElementById('div_BrkFeaturedList').style.display = 'block';
     }
     else if(ckno == 2)
     {
     if(document.getElementById('div_BrkFeaturedList2'))
        document.getElementById('div_BrkFeaturedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
     if(document.getElementById('div_BrkFeaturedList3'))
        document.getElementById('div_BrkFeaturedList3').style.display = 'block';
     }  
    }
    break;
    case "Man_OpenhseListings":
    {
     if(ckno == 1){
      if(document.getElementById('div_ManOpenhseList'))
        document.getElementById('div_ManOpenhseList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_BrkFeaturedList2'))
        document.getElementById('div_BrkFeaturedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_BrkFeaturedList3'))
        document.getElementById('div_BrkFeaturedList3').style.display = 'block'; 
     }  
    }
    break;
    case "Brk_OpenhseListings":
    {
     if(ckno == 1){
      if(document.getElementById('div_BrkOpenhseList'))
        document.getElementById('div_BrkOpenhseList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_BrkOpenhseList2'))
        document.getElementById('div_BrkOpenhseList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_BrkOpenhseList3'))
        document.getElementById('div_BrkOpenhseList3').style.display = 'block';
     }  
    }
    break;
    case "Man_MostViewedNow":
    {
     if(ckno == 1){
      if(document.getElementById('div_ManMostviewedList'))
        document.getElementById('div_ManMostviewedList').style.display = 'block';
      }
     else if(ckno == 2)
     {
       if(document.getElementById('div_ManMostviewedList2'))
        document.getElementById('div_ManMostviewedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
       if(document.getElementById('div_ManMostviewedList3'))
        document.getElementById('div_ManMostviewedList3').style.display = 'block';
     }  
  
    }
    break;
    case "Brk_MostViewedNow":
    {
     if(ckno == 1){
      if(document.getElementById('div_BrkMostviewedList'))
        document.getElementById('div_BrkMostviewedList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_BrkMostviewedList2'))
        document.getElementById('div_BrkMostviewedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_BrkMostviewedList3'))
        document.getElementById('div_BrkMostviewedList3').style.display = 'block';
     }  

    }
    break;
    case "Man_MostViewedThisweek":
    {
     if(ckno == 1){
      if(document.getElementById('div_ManMostviewedThisWkList'))
        document.getElementById('div_ManMostviewedThisWkList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_ManMostviewedThisWkList2'))
        document.getElementById('div_ManMostviewedThisWkList2').style.display = 'block';  
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_ManMostviewedThisWkList3'))
       document.getElementById('div_ManMostviewedThisWkList3').style.display = 'block'; 
     }  

    }
    break;
    case "Brk_MostViewedThisweek":
    {
     if(ckno == 1){
      if(document.getElementById('div_BrkMostviewedThisWkList'))
        document.getElementById('div_BrkMostviewedThisWkList').style.display = 'block';
     }
     else if(ckno == 2)
     {
       if(document.getElementById('div_BrkMostviewedThisWkList2'))
        document.getElementById('div_BrkMostviewedThisWkList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
       if(document.getElementById('div_BrkMostviewedThisWkList3'))
        document.getElementById('div_BrkMostviewedThisWkList3').style.display = 'block';
     }  

    }
    break;
     case "Hmp_NewestListings"://HmpNewList
    {
     if(ckno == 1){
      if(document.getElementById('div1_HmpNewList'))
        document.getElementById('div1_HmpNewList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div2_HmpNewList2'))
        document.getElementById('div2_HmpNewList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div3_HmpNewList3'))
        document.getElementById('div3_HmpNewList3').style.display = 'block';
     }  
    var divs=document.getElementsByTagname("div");
    
    }
    break;
    case "Hmp_FeaturedListings":
    {
     if(ckno == 1){
      if(document.getElementById('div_HmpFeaturedList'))
        document.getElementById('div_HmpFeaturedList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_HmpFeaturedList2'))
        document.getElementById('div_HmpFeaturedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_HmpFeaturedList3'))
        document.getElementById('div_HmpFeaturedList3').style.display = 'block';
     }  

    }
    break;
    case "Hmp_OpenhseListings":
    {
     if(ckno == 1){
      if(document.getElementById('div_HmpOpenhseList'))
        document.getElementById('div_HmpOpenhseList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_HmpOpenhseList2'))
        document.getElementById('div_HmpOpenhseList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_HmpOpenhseList3'))
        document.getElementById('div_HmpOpenhseList3').style.display = 'block';
     }  
   }
    break;
    case "Hmp_MostViewedThisweek":
    {
     if(ckno == 1){
      if(document.getElementById('div_HmpMostviewedThisWkList'))
        document.getElementById('div_HmpMostviewedThisWkList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_HmpMostviewedThisWkList2'))
        document.getElementById('div_HmpMostviewedThisWkList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_HmpMostviewedThisWkList3'))
        document.getElementById('div_HmpMostviewedThisWkList3').style.display = 'block';
     }  
    }
    break;
    case "Hmp_MostViewedNow":
    {
     if(ckno == 1){
      if(document.getElementById('div_HmpMostviewedList'))
        document.getElementById('div_HmpMostviewedList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_HmpMostviewedList2'))
        document.getElementById('div_HmpMostviewedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_HmpMostviewedList3'))
        document.getElementById('div_HmpMostviewedList3').style.display = 'block';
     }  
   }
    break;          
    case "pmb_NewestListings":
    {
     if(ckno == 1){
      if(document.getElementById('div_pmbNewList'))
        document.getElementById('div_pmbNewList').style.display = 'block';
     }
     else if(ckno == 2)
     {
       if(document.getElementById('div_pmbNewList2'))
        document.getElementById('div_pmbNewList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
     if(document.getElementById('div_pmbNewList3'))
        document.getElementById('div_pmbNewList3').style.display = 'block';
     }  
   }
    break; 
    case "pmb_FeaturedListings":
    {
     if(ckno == 1){
      if(document.getElementById('div_pmbFeaturedList'))
        document.getElementById('div_pmbFeaturedList').style.display = 'block';
     }
     else if(ckno == 2)
     {
       if(document.getElementById('div_pmbFeaturedList2'))
        document.getElementById('div_pmbFeaturedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
       if(document.getElementById('div_pmbFeaturedList3'))
        document.getElementById('div_pmbFeaturedList3').style.display = 'block';
     }  
    }
    break; 
    case "pmb_OpenhseListings":
    {
     if(ckno == 1){
      if(document.getElementById('div_pmbOpenhseList'))
        document.getElementById('div_pmbOpenhseList').style.display = 'block';
     }
     else if(ckno == 2)
     {
      if(document.getElementById('div_pmbOpenhseList2'))
        document.getElementById('div_pmbOpenhseList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
      if(document.getElementById('div_pmbOpenhseList3'))
        document.getElementById('div_pmbOpenhseList3').style.display = 'block';
     }  
   }
    break; 
    case "pmb_MostViewedThisweek":
    {
     if(ckno == 1){
      if(document.getElementById('div_pmbMostviewedThisWkList'))
        document.getElementById('div_pmbMostviewedThisWkList').style.display = 'block';
    }
    else if(ckno == 2)
    {
        if(document.getElementById('div_pmbMostviewedThisWkList2'))
        document.getElementById('div_pmbMostviewedThisWkList2').style.display = 'block';
    }
    else if(ckno == 3)
    {
        if(document.getElementById('div_pmbMostviewedThisWkList3'))
        document.getElementById('div_pmbMostviewedThisWkList3').style.display = 'block';
    }  
    }
    break; 
    case "pmb_MostViewedNow":
    {
     if(ckno == 1){
      if(document.getElementById('div_pmbMostviewedList'))
        document.getElementById('div_pmbMostviewedList').style.display = 'block';
     }
     else if(ckno == 2)
     {
        if(document.getElementById('div_pmbMostviewedList2'))
        document.getElementById('div_pmbMostviewedList2').style.display = 'block';
     }
     else if(ckno == 3)
     {
        if(document.getElementById('div_pmbMostviewedList3'))
        document.getElementById('div_pmbMostviewedList3').style.display = 'block';
     }  

    }
    break; 
    default :
    {
    
    }
    break; 
}*/
}
}
else if(ftype == 0)
{
 if(ckno == 1)
 {
  if(document.getElementById('div_ManNewList'))
     document.getElementById('div_ManNewList').style.display = 'none';
  if(document.getElementById('div_ManFeaturedList'))
     document.getElementById('div_ManFeaturedList').style.display = 'none';
  if(document.getElementById('div_BrkNewList'))
     document.getElementById('div_BrkNewList').style.display = 'none';
  if(document.getElementById('div_BrkFeaturedList'))
     document.getElementById('div_BrkFeaturedList').style.display = 'none';
  if(document.getElementById('div_ManOpenhseList'))
     document.getElementById('div_ManOpenhseList').style.display = 'none';
  
  if(document.getElementById('div_BrkOpenhseList'))
     document.getElementById('div_BrkOpenhseList').style.display = 'none';
     
  if(document.getElementById('div_ManMostviewedList'))
     document.getElementById('div_ManMostviewedList').style.display = 'none';
     
  if(document.getElementById('div_BrkMostviewedList'))
     document.getElementById('div_BrkMostviewedList').style.display = 'none';
     
  if(document.getElementById('div_ManMostviewedThisWkList'))
     document.getElementById('div_ManMostviewedThisWkList').style.display = 'none';
     
  if(document.getElementById('div_BrkMostviewedThisWkList'))
     document.getElementById('div_BrkMostviewedThisWkList').style.display = 'none';
     
  if(document.getElementById('div_HmpNewList'))
     document.getElementById('div_HmpNewList').style.display = 'none'; 
     
  if(document.getElementById('div_HmpFeaturedList'))
     document.getElementById('div_HmpFeaturedList').style.display = 'none';
     
  if(document.getElementById('div_HmpOpenhseList'))
     document.getElementById('div_HmpOpenhseList').style.display = 'none';
     
  if(document.getElementById('div_HmpMostviewedThisWkList'))
     document.getElementById('div_HmpMostviewedThisWkList').style.display = 'none'; 
     
  if(document.getElementById('div_HmpMostviewedList'))
     document.getElementById('div_HmpMostviewedList').style.display = 'none';
     
  if(document.getElementById('div_pmbFeaturedList'))
     document.getElementById('div_pmbFeaturedList').style.display = 'none';
     
  if(document.getElementById('div_pmbOpenhseList'))
     document.getElementById('div_pmbOpenhseList').style.display = 'none';
     
  if(document.getElementById('div_pmbMostviewedThisWkList'))
     document.getElementById('div_pmbMostviewedThisWkList').style.display = 'none';
     
  if(document.getElementById('div_pmbMostviewedList'))
     document.getElementById('div_pmbMostviewedList').style.display = 'none';
     
  if(document.getElementById('div_pmbNewList'))
     document.getElementById('div_pmbNewList').style.display = 'none';
 }
 else if(ckno == 2)
 {
  if(document.getElementById('div_ManNewList2'))
     document.getElementById('div_ManNewList2').style.display = 'none';
  if(document.getElementById('div_ManFeaturedList2'))
     document.getElementById('div_ManFeaturedList2').style.display = 'none';
  if(document.getElementById('div_BrkNewList2'))
     document.getElementById('div_BrkNewList2').style.display = 'none';
  if(document.getElementById('div_BrkFeaturedList2'))
     document.getElementById('div_BrkFeaturedList2').style.display = 'none';
  if(document.getElementById('div_ManOpenhseList2'))
     document.getElementById('div_ManOpenhseList2').style.display = 'none';
  
  if(document.getElementById('div_BrkOpenhseList2'))
     document.getElementById('div_BrkOpenhseList2').style.display = 'none';
     
  if(document.getElementById('div_ManMostviewedList2'))
     document.getElementById('div_ManMostviewedList2').style.display = 'none';
     
  if(document.getElementById('div_BrkMostviewedList2'))
     document.getElementById('div_BrkMostviewedList2').style.display = 'none';
     
  if(document.getElementById('div_ManMostviewedThisWkList2'))
     document.getElementById('div_ManMostviewedThisWkList2').style.display = 'none';
     
  if(document.getElementById('div_BrkMostviewedThisWkList2'))
     document.getElementById('div_BrkMostviewedThisWkList2').style.display = 'none';
     
  if(document.getElementById('div_HmpNewList2'))
     document.getElementById('div_HmpNewList2').style.display = 'none'; 
     
  if(document.getElementById('div_HmpFeaturedList2'))
     document.getElementById('div_HmpFeaturedList2').style.display = 'none';
     
  if(document.getElementById('div_HmpOpenhseList2'))
     document.getElementById('div_HmpOpenhseList2').style.display = 'none';
     
  if(document.getElementById('div_HmpMostviewedThisWkList2'))
     document.getElementById('div_HmpMostviewedThisWkList2').style.display = 'none'; 
     
  if(document.getElementById('div_HmpMostviewedList2'))
     document.getElementById('div_HmpMostviewedList2').style.display = 'none';
     
  if(document.getElementById('div_pmbFeaturedList2'))
     document.getElementById('div_pmbFeaturedList2').style.display = 'none';
     
  if(document.getElementById('div_pmbOpenhseList2'))
     document.getElementById('div_pmbOpenhseList2').style.display = 'none';
     
  if(document.getElementById('div_pmbMostviewedThisWkList2'))
     document.getElementById('div_pmbMostviewedThisWkList2').style.display = 'none';
     
  if(document.getElementById('div_pmbMostviewedList2'))
     document.getElementById('div_pmbMostviewedList2').style.display = 'none';
     
  if(document.getElementById('div_pmbNewList2'))
     document.getElementById('div_pmbNewList2').style.display = 'none';
 }
 else if(ckno == 3)
 {
  if(document.getElementById('div_ManNewList3'))
     document.getElementById('div_ManNewList3').style.display = 'none';
  if(document.getElementById('div_ManFeaturedList3'))
     document.getElementById('div_ManFeaturedList3').style.display = 'none';
  if(document.getElementById('div_BrkNewList3'))
     document.getElementById('div_BrkNewList3').style.display = 'none';
  if(document.getElementById('div_BrkFeaturedList3'))
     document.getElementById('div_BrkFeaturedList3').style.display = 'none';
  if(document.getElementById('div_ManOpenhseList3'))
     document.getElementById('div_ManOpenhseList3').style.display = 'none';
  
  if(document.getElementById('div_BrkOpenhseList3'))
     document.getElementById('div_BrkOpenhseList3').style.display = 'none';
     
  if(document.getElementById('div_ManMostviewedList3'))
     document.getElementById('div_ManMostviewedList3').style.display = 'none';
     
  if(document.getElementById('div_BrkMostviewedList3'))
     document.getElementById('div_BrkMostviewedList3').style.display = 'none';
     
  if(document.getElementById('div_ManMostviewedThisWkList3'))
     document.getElementById('div_ManMostviewedThisWkList3').style.display = 'none';
     
  if(document.getElementById('div_BrkMostviewedThisWkList3'))
     document.getElementById('div_BrkMostviewedThisWkList3').style.display = 'none';
     
  if(document.getElementById('div_HmpNewList3'))
     document.getElementById('div_HmpNewList3').style.display = 'none'; 
     
  if(document.getElementById('div_HmpFeaturedList3'))
     document.getElementById('div_HmpFeaturedList3').style.display = 'none';
     
  if(document.getElementById('div_HmpOpenhseList3'))
     document.getElementById('div_HmpOpenhseList3').style.display = 'none';
     
  if(document.getElementById('div_HmpMostviewedThisWkList3'))
     document.getElementById('div_HmpMostviewedThisWkList3').style.display = 'none'; 
     
  if(document.getElementById('div_HmpMostviewedList3'))
     document.getElementById('div_HmpMostviewedList3').style.display = 'none';
     
  if(document.getElementById('div_pmbFeaturedList3'))
     document.getElementById('div_pmbFeaturedList3').style.display = 'none';
     
  if(document.getElementById('div_pmbOpenhseList3'))
     document.getElementById('div_pmbOpenhseList3').style.display = 'none';
     
  if(document.getElementById('div_pmbMostviewedThisWkList3'))
     document.getElementById('div_pmbMostviewedThisWkList3').style.display = 'none';
     
  if(document.getElementById('div_pmbMostviewedList3'))
     document.getElementById('div_pmbMostviewedList3').style.display = 'none';
     
  if(document.getElementById('div_pmbNewList3'))
     document.getElementById('div_pmbNewList3').style.display = 'none';
 }
}
}
//function LoadPersonalHome(bldphpage,tdid1,tdid2,tdid3,tbdt1,tbdt2,tbdt3,tdln1,tdline1,tdln2,tdline2,tdln3,tdline3,dvline1,dvline2,dvline3)
//{
//var vCookies = "",vspcookies="",vtempCookie1="",vtempCookie2="",vtempCookie3="",vLogin="";
//var vspck1 ="",vspck2 ="",vspck3 ="";
// vbphmp = bldphpage;
// tdln11 = tdln1;
// tdln22 = tdln2;
// tdln33 = tdln3;
// tddt11 = tbdt1;
// tddt22 = tbdt2;
// tddt33 = tbdt3;
// tdlid11 = tdid1;
// tdlid22 = tdid2;
// tdlid33 = tdid3;
// tdline11=tdline1;
// tdline22=tdline2;
// tdline33=tdline3;
// dvline11=dvline1;
// dvline22=dvline2;
// dvline33=dvline3;
// 
// //alert('LoadPersonalHome');
//if(document.getElementById(tbdt1))
//    showtableid = document.getElementById(tbdt1);
//   
// if(document.getElementById(tbdt2))
//    showtableid2 = document.getElementById(tbdt2);
//    
// if(document.getElementById(tbdt3))
//    showtableid3 = document.getElementById(tbdt3); 
//   
//   
//  if(document.getElementById(tbdt1))
//    hidelink2 = document.getElementById(tbdt1);
//    
//  if(document.getElementById(tbdt2))
//    hidelnk22 = document.getElementById(tbdt2);
//  
//  if(document.getElementById(tbdt3))
//    hidelnk33 = document.getElementById(tbdt3);  
//    
//    
//   alert(document.cookie);
//   vCookies = document.cookie;
//   //alert('all cookies');
//   //alert(vCookies)
//  //alert(document.Forms['Form1'].Cookies);
//   if(vCookies != "" && vCookies != null){
//   vspcookies = vCookies.split(';');
//   
//   for(var j1=0;j1<vspcookies.length;j1++)
//   {
//	var vArrLinkcookies1;
//	if(vspcookies[j1].toString().match("WT_FPC"))
//	{
//	}
//	else
//	{
//	 vArrLinkcookies1 =  vspcookies[j1].toString().split('=');
//	 //alert('Login comparision');
//	 //alert(vArrLinkcookies1[1]);
//     if( vspcookies[j1].toString().indexOf("mycorcoranlogin") != -1)
//     {
//        vLogin = vArrLinkcookies1[1];
//		//alert('vLogin');
//		//alert(vLogin);
//     }
//	}
//   }
//   
//   for(var j=0; j < vspcookies.length;j++ )
//   {
//     vArrcookies[j] = vspcookies[j];
//     //alert('cookie value');
//     //alert(vArrcookies[j]);
//    
//     vtempCookie = vArrcookies[j].toString();
//	 if(vtempCookie.match("WT_FPC"))
//	 {
//		//alert('in WT_FPC');
//	 }
//	 else
//	 {
//     vArrLinkcookies = vArrcookies[j].toString().split('=');
//    
//     
//     if(vArrcookies[j].toString().indexOf("mycorcoranhomep1") != -1)
//     {
//        vspck1 = vArrLinkcookies[1].toString().split(',');
//        if(vspck1[0] == vLogin)
//        {
//		    //alert('cookie1 login match');
//            link_type1 = vspck1[1];
//            vtempCookie1 = vspck1[1];
//            spnload1 = 1;
//        }
//        
//     }
//     if(vArrcookies[j].indexOf("mycorcoranhomep2") != -1)
//     { 
//        vspck2 = vArrLinkcookies[1].toString().split(',');
//        if(vspck2[0] == vLogin)
//        {
//            link_type2 = vspck2[1];
//            vtempCookie2 = vspck2[1];
//            spnload2 = 2;
//        }
//     }
//     if(vArrcookies[j].indexOf("mycorcoranhomep3") != -1)
//     {
//        vspck3 = vArrLinkcookies[1].toString().split(',');
//        
//        if(vspck3[0] == vLogin)
//        {
//            link_type3 = vspck3[1];
//            vtempCookie3 = vspck3[1];
//            spnload3 = 3;
//        }
//     }
//     
//     }
//   }
//    
//    chcookie1 = "";
//    chcookie2 = "";
//    chcookie3 = "";
//    
//   if(vtempCookie1 != "")
//   {
//    chcookie1 = vtempCookie1;
//    
//   } 
//    if(vtempCookie2 != "")
//   {
//    chcookie2 = vtempCookie2;
//   }
//   if(vtempCookie3 != "")
//   {
//    chcookie3 = vtempCookie3;
//   }
//   
//  if(vtempCookie1 != "")
//   {
//    chcookie1 = vtempCookie1;
//   if(vtempCookie2 != "")
//   {
//    chcookie2 = vtempCookie2;
//   }
//   if(vtempCookie3 != "")
//   {
//    chcookie3 = vtempCookie3;
//   }
//   
//   if(document.getElementById("tr_td_Mannyc1"))
//    document.getElementById("tr_td_Mannyc1").style.display='none';
//        document.getElementById(tdid1).style.display='none';
//    if(document.getElementById(tdid1))
//        document.getElementById(tdid1).style.display='none';
//        
//    if(document.getElementById(tbdt1))
//        document.getElementById(tbdt1).style.display='block';
//   
//     if(document.getElementById(tdln1))
//        document.getElementById(tdln1).style.display='none';
//        
//    if(document.getElementById(tdline1))
//        document.getElementById(tdline1).style.display='block';
//    
//    if(document.getElementById(dvline1))
//        document.getElementById(dvline1).style.display='block';   
//    setDisplayStyle(vtempCookie1,1,1);
//   }
//   else
//   {
//    if(document.getElementById("tr_td_Mannyc1"))
//    document.getElementById("tr_td_Mannyc1").style.display='block';
//    if(document.getElementById(tdid1))
//        document.getElementById(tdid1).style.display='block';
//        
//    if(document.getElementById(tbdt1))
//        document.getElementById(tbdt1).style.display='block';
//   
//     if(document.getElementById(tdln1))
//        document.getElementById(tdln1).style.display='block';
//        
//    if(document.getElementById(tdline1))
//        document.getElementById(tdline1).style.display='none';
//    
//    if(document.getElementById(dvline1))
//        document.getElementById(dvline1).style.display='none';    
//     setDisplayStyle(vtempCookie1,1,0);  
//   }
//   
//   
//   if(vtempCookie2 != "")
//   {
//    chcookie2 = vtempCookie2;
//    //alert('Ck 2');
//    //alert(vtempCookie2);
//     if(document.getElementById("tr_td_FLpb1"))
//    document.getElementById("tr_td_FLpb1").style.display='none';
//    if(document.getElementById(tdid2))
//        document.getElementById(tdid2).style.display='none';
//    if(document.getElementById(tbdt2))
//        document.getElementById(tbdt2).style.display='block';
//   
//     if(document.getElementById(tdln2))
//        document.getElementById(tdln2).style.display='block';
//        
//    if(document.getElementById(tdline2))
//        document.getElementById(tdline2).style.display='none';
//    
//    if(document.getElementById(dvline2))
//        document.getElementById(dvline2).style.display='none';        
//     setDisplayStyle(vtempCookie2,2,1);
//   }
//   else
//   {
//    if(document.getElementById("tr_td_FLpb1"))
//    document.getElementById("tr_td_FLpb1").style.display='block';
//    if(document.getElementById(tdid2))
//        document.getElementById(tdid2).style.display='block';
//        
//    if(document.getElementById(tbdt2))
//        document.getElementById(tbdt2).style.display='block';
//   
//     if(document.getElementById(tdln2))
//        document.getElementById(tdln2).style.display='block';
//        
//    if(document.getElementById(tdline2))
//        document.getElementById(tdline2).style.display='none';
//    
//    if(document.getElementById(dvline2))
//        document.getElementById(dvline2).style.display='none';    
//     setDisplayStyle(vtempCookie2,2,0);  
//   }
//   
//   
//   if(vtempCookie3 != "")
//   {
//    chcookie3 = vtempCookie3;
//    
//    if(document.getElementById("tr_td_Hmphee1"))
//    document.getElementById("tr_td_Hmphee1").style.display='none';
//    if(document.getElementById(tdid3))
//        document.getElementById(tdid3).style.display='none';
//          if(document.getElementById(tdid3))
//        document.getElementById(tdid3).style.display='none';
//    if(document.getElementById(tbdt3))
//        document.getElementById(tbdt3).style.display='block';
//   
//     if(document.getElementById(tdln3))
//        document.getElementById(tdln3).style.display='block';
//        
//    if(document.getElementById(tdline3))
//        document.getElementById(tdline3).style.display='none';
//    
//    if(document.getElementById(dvline3))
//        document.getElementById(dvline3).style.display='none';        
//     setDisplayStyle(vtempCookie3,3,1);
//   }
//   else
//   {
//   if(document.getElementById("tr_td_Hmphee1"))
//    document.getElementById("tr_td_Hmphee1").style.display='block';
//    
//    if(document.getElementById(tdid3))
//        document.getElementById(tdid3).style.display='block';
//        
//    if(document.getElementById(tbdt3))
//        document.getElementById(tbdt3).style.display='block';
//   
//     if(document.getElementById(tdln3))
//        document.getElementById(tdln3).style.display='block';
//        
//    if(document.getElementById(tdline3))
//        document.getElementById(tdline3).style.display='none';
//    
//    if(document.getElementById(dvline3))
//        document.getElementById(dvline3).style.display='none';    
//     setDisplayStyle(vtempCookie3,3,0);  
//   }
//
//   }
// //Save_homepage('true','<%=strP1Cookie1%>','<%=strP2Cookie2%>','<%=strP3Cookie3%>','tbl_Links','tbl_Detail','tbl_Links2','tbl_Detail2','tbl_Links3','tbl_Detail3','div_ManNewList','div_ManNewList2','div_ManNewList3')
// Save_homepage('true',vtempCookie1,vtempCookie2,vtempCookie3,'tbl_Links','tbl_Detail','tbl_Links2','tbl_Detail2','tbl_Links3','tbl_Detail3','div_ManNewList','div_ManNewList2','div_ManNewList3');
//}


function LoadPersonalHome(bldphpage,tdid1,tdid2,tdid3,tbdt1,tbdt2,tbdt3,tdln1,tdline1,tdln2,tdline2,tdln3,tdline3,dvline1,dvline2,dvline3)
{
//var vCookies = "",vspcookies="",vtempCookie1="",vtempCookie2="",vtempCookie3="",vLogin="";
//var vspck1 ="",vspck2 ="",vspck3 ="";
 vbphmp = bldphpage;
 tdln11 = tdln1;
 tdln22 = tdln2;
 tdln33 = tdln3;
 tddt11 = tbdt1;
 tddt22 = tbdt2;
 tddt33 = tbdt3;
 tdlid11 = tdid1;
 tdlid22 = tdid2;
 tdlid33 = tdid3;
 tdline11=tdline1;
 tdline22=tdline2;
 tdline33=tdline3;
 dvline11=dvline1;
 dvline22=dvline2;
 dvline33=dvline3;
 
 //alert('LoadPersonalHome');
if(document.getElementById(tbdt1))
    showtableid = document.getElementById(tbdt1);
   
 if(document.getElementById(tbdt2))
    showtableid2 = document.getElementById(tbdt2);
    
 if(document.getElementById(tbdt3))
    showtableid3 = document.getElementById(tbdt3); 
   
   
  if(document.getElementById(tbdt1))
    hidelink2 = document.getElementById(tbdt1);
    
  if(document.getElementById(tbdt2))
    hidelnk22 = document.getElementById(tbdt2);
  
  if(document.getElementById(tbdt3))
    hidelnk33 = document.getElementById(tbdt3);  
	sendHomepageXMLHttpRequest("HomepagePanel");
}

function setHomepage(res)
{
	
	//alert('setHomepage');
	//alert(res)
	if(res != "<h1>Length Required</h1>")
	{
		//alert('setHomepage 1');
	var vressp="";
    chcookie1 = "";
    chcookie2 = "";
    chcookie3 = ""; 
	//alert('setHomepage');
	//alert(res);
	if(res != "")
	{
		var vindx = res.indexOf(',');
		if(vindx != -1)
		{
			vressp = res.split(',');
			//alert(vressp[0]);
			//alert(vressp[1]);
			//alert(vressp[2]);
//			if(vressp[0] != "")
//				chcookie1 = vressp[0];
//			if(vressp[1] != "")
//				chcookie2 = vressp[1];
//			if(vressp[2] != "")
//				chcookie3 = vressp[2];
		}
	
 if(vressp[0] != "" && vressp[0] != null)
   {
    chcookie1 = vressp[0];
   if(vressp[1] != "")
   {
    chcookie2 = vressp[1];
   }
   if(vressp[2] != "")
   {
    chcookie3 = vressp[2];
   }
   
 //vbphmp = bldphpage;
// tdln11 = tdln1;
// tdln22 = tdln2;
// tdln33 = tdln3;
// tddt11 = tbdt1;
// tddt22 = tbdt2;
// tddt33 = tbdt3;
// tdlid11 = tdid1;
// tdlid22 = tdid2;
// tdlid33 = tdid3;
// tdline11=tdline1;
// tdline22=tdline2;
// tdline33=tdline3;
// dvline11=dvline1;
// dvline22=dvline2;
// dvline33=dvline3;
 
   if(document.getElementById("tr_td_Mannyc1"))
    document.getElementById("tr_td_Mannyc1").style.display='none';
    
    if(document.getElementById(tdlid11))
        document.getElementById(tdlid11).style.display='none';
        
    if(document.getElementById(tddt11))
        document.getElementById(tddt11).style.display='block';
   
     if(document.getElementById(tdln11))
        document.getElementById(tdln11).style.display='none';
        
    if(document.getElementById(tdline11))
        document.getElementById(tdline11).style.display='block';
    
    if(document.getElementById(dvline11))
        document.getElementById(dvline11).style.display='block';   
    setDisplayStyle(vressp[0],1,1);
   }
   else
   {
    if(document.getElementById("tr_td_Mannyc1"))
    document.getElementById("tr_td_Mannyc1").style.display='block';
    if(document.getElementById(tdlid11))
        document.getElementById(tdlid11).style.display='block';
        
    if(document.getElementById(tddt11))
        document.getElementById(tddt11).style.display='block';
   
     if(document.getElementById(tdln11))
        document.getElementById(tdln11).style.display='block';
        
    if(document.getElementById(tdline11))
        document.getElementById(tdline11).style.display='none';
    
    if(document.getElementById(dvline11))
        document.getElementById(dvline11).style.display='none';    
     setDisplayStyle(vressp[0],1,0);  
   }
   
   
   if(vressp[1] != "" && vressp[1] != null)
   {
    chcookie2 = vressp[1];
    //alert('Ck 2');
    //alert(vtempCookie2);
     if(document.getElementById("tr_td_FLpb1"))
    document.getElementById("tr_td_FLpb1").style.display='none';
    if(document.getElementById(tdlid22))
        document.getElementById(tdlid22).style.display='none';
    if(document.getElementById(tddt22))
        document.getElementById(tddt22).style.display='block';
   
     if(document.getElementById(tdln22))
        document.getElementById(tdln22).style.display='block';
        
    if(document.getElementById(tdline22))
        document.getElementById(tdline22).style.display='none';
    
    if(document.getElementById(dvline22))
        document.getElementById(dvline22).style.display='none';        
     setDisplayStyle(vressp[1],2,1);
   }
   else
   {
    if(document.getElementById("tr_td_FLpb1"))
    document.getElementById("tr_td_FLpb1").style.display='block';
    if(document.getElementById(tdlid22))
        document.getElementById(tdlid22).style.display='block';
        
    if(document.getElementById(tddt22))
        document.getElementById(tddt22).style.display='block';
   
     if(document.getElementById(tdln22))
        document.getElementById(tdln22).style.display='block';
        
    if(document.getElementById(tdline22))
        document.getElementById(tdline22).style.display='none';
    
    if(document.getElementById(dvline22))
        document.getElementById(dvline22).style.display='none';    
     setDisplayStyle(vressp[1],2,0);  
   }
   
   
   if(vressp[2] != "" && vressp[2] != null)
   {
   //alert('in ck3 present');
   //alert(vressp[2]);
    chcookie3 = vressp[2];
    
    if(document.getElementById("tr_td_Hmphee1"))
    document.getElementById("tr_td_Hmphee1").style.display='none';
    if(document.getElementById(tdlid33))
        document.getElementById(tdlid33).style.display='none';
  
    if(document.getElementById(tddt33))
        document.getElementById(tddt33).style.display='block';
   
     if(document.getElementById(tdln33))
        document.getElementById(tdln33).style.display='block';
        
    if(document.getElementById(tdline33))
        document.getElementById(tdline33).style.display='none';
    
    if(document.getElementById(dvline33))
        document.getElementById(dvline33).style.display='none';        
     setDisplayStyle(vressp[2],3,1);
   }
   else
   {
   if(document.getElementById("tr_td_Hmphee1"))
    document.getElementById("tr_td_Hmphee1").style.display='block';
    
    if(document.getElementById(tdlid33))
        document.getElementById(tdlid33).style.display='block';
        
    if(document.getElementById(tddt33))
        document.getElementById(tddt33).style.display='block';
   
     if(document.getElementById(tdln33))
        document.getElementById(tdln33).style.display='block';
        
    if(document.getElementById(tdline33))
        document.getElementById(tdline33).style.display='none';
    
    if(document.getElementById(dvline33))
        document.getElementById(dvline33).style.display='none';    
     setDisplayStyle(vressp[2],3,0);  
   }

 
 //Save_homepage('true','<%=strP1Cookie1%>','<%=strP2Cookie2%>','<%=strP3Cookie3%>','tbl_Links','tbl_Detail','tbl_Links2','tbl_Detail2','tbl_Links3','tbl_Detail3','div_ManNewList','div_ManNewList2','div_ManNewList3')
 Save_homepage('true',vressp[0],vressp[1],vressp[2],'tbl_Links','tbl_Detail','tbl_Links2','tbl_Detail2','tbl_Links3','tbl_Detail3','div_ManNewList','div_ManNewList2','div_ManNewList3');
 }
}
}

function Man_Newlistings(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
    if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    showpanel=panel;
   
    var strtb="";
	{
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	  var vtrdiv = "tr_"+document.getElementById(tblid).id;
	
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	    }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	      
	      if(document.getElementById(tblid)){
            showtableidimg=document.getElementById(tblid);
            }
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22)	{    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	  }
	    
		strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='253' height='198.5' border='0'>";

          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
           //alert('2');
           //alert(tblid);
            
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
        
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
			
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	   if(showtableidimg){
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Man_NewestListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
				//document.getElementById(btl1).width="248.9px";
//				 if(document.getElementById(btl2))
//				document.getElementById(btl2).width="249px";
//				document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Man_NewestListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
				
			//	if(document.getElementById(btl1))
//					document.getElementById(btl1).width="248.9px";
//				document.getElementById(btl2).width="249px";
		//		document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Man_NewestListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
		//		document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="245px";

	   }
	   
	   if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
    }
}

function Man_Featuredlisting(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
	//var showtableidimg = "";
    //alert('Man_Featuredlisting');
    if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    
  
    
    showpanel=panel;
    var vtrdiv ="",vtrdiv2 ="",vtrdiv3 ="";
   
    var strtb="";
	{
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\" align=\"left\">";
	   strtb+="<tr class=\"text10px\">";
	  // strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	    vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
         document.getElementById(vtrdiv).style.display='block';
         hidelink2.style.display='block';
	   }
	   
			strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
			if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    //if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	    //    strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
	    //else
	     //   strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	    hidelnk2.style.display='none';
	    document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	  }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
           //alert('2');
           //alert(tblid);
            
     }	   
     else if (showpanel == 3)
     {
    
        vtrdiv3 = "tr_"+document.getElementById(tblid).id;   
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
	   
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
        //strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
		 //if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	     //   strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		 //else
		 //	strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
		 if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   //alert('in show table');
	   //alert(showtableidimg.id);
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Man_FeaturedListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
				//document.getElementById(btl1).width="248.9px";
//				if(document.getElementById(btl2))
//				document.getElementById(btl2).width="249px";
		//		document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
				
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Man_FeaturedListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
				//document.getElementById(btl2).width="249px";
//				if(document.getElementById(btl1))
//				document.getElementById(btl1).width="248.9px";
		//		document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Man_FeaturedListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Manhattan";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
		//		document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";
	   }
    }
	
	 if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
    
   //alert(spanel1);
   //alert(spanel2);
   //alert(spanel3);
}
function Hmp_Featuredlisting(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
    //////alert('Hmp_Featuredlisting');
    if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    
  
    
    showpanel=panel;
   
    var strtb="";
	{
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	    var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
			
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	    hidelnk2.style.display='none';
	    document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
       document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
           //alert('2');
           //alert(tblid);
            
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
	   
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}

          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   //////alert('in show table');
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Hmp_FeaturedListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
//				document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Hmp_FeaturedListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	//			document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";document.getElementById(btl1).width="255px";
	   }
	   else if(showpanel == 3){
	        
	        link_type3 = "Hmp_FeaturedListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Hamptons";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
    }
    
  		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
    //////alert(spanel1);
   //alert(spanel2);
   //alert(spanel3);
}

function pmb_Featuredlisting(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
   //alert('pmb_Featuredlisting');
    if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    
  
    
    showpanel=panel;
   
    var strtb="";
	{
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	    var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink){	    
	   hidelink2.style.display='block';
       document.getElementById(vtrdiv).style.display='block';
	  }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
//	    if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//            strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//        else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	    hidelnk2.style.display='none';
	    document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
           // alert('2');
           //alert(tblid);
            
     }	   
     else if (showpanel == 3)
     {
        var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
	   
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
//        strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='248' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}

          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   ////alert('in show table');
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "pmb_FeaturedListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "pmb_FeaturedListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	   }
	   else if(showpanel == 3){
	        
	        link_type3 = "pmb_FeaturedListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "PalmBeaches";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
//				document.getElementById(btl1).width="256px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";	
	   }
    }
	
  		if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
    
    ////alert(spanel1);
    ////alert(spanel2);
    ////alert(spanel3);
}

function Brk_Featuredlisting(reg,panel,tblid,linkid,lid2,btl1,btl2,btl3,divid,imgsave)
{
    ////alert('Brk_Featuredlisting');
    if(document.getElementById(imgsave))
        btnimgsave = document.getElementById(imgsave);
        
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div1"){ 
          div_panel1 = document.getElementById(divid);}
    }
    
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div2"){
            div_panel2 = document.getElementById(divid).value;
        }
    }
     
    if(document.getElementById(divid))
    {
        if(document.getElementById(divid).value == "div3"){
            div_panel3 = document.getElementById(divid).value;
        }
    }
    
    preg = reg;
    
    showpanel=panel;
   
    var strtb="";
	{
	   strtb="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
	   strtb+="<tr class=\"text10px\">";
	   strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
	   
	 if(showpanel == 1)
	 {
	 
        var vtrdiv = "tr_"+document.getElementById(tblid).id;
	    if(document.getElementById(linkid))
            hidelink = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelink2 = document.getElementById(lid2);
            
	   if(hidelink){
	   hidelink.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelink2){	    
	   hidelink2.style.display='block';
	   document.getElementById(vtrdiv).style.display='block';
	   }
	   
	    strtb+="<td style=\"padding-left:0px;\" align=\"center\" valign=\"top\">";
	    //if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
//	    else
//	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='243' height='198.5' border='0'>";

		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	    else
	        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='245' height='198.5' border='0'>";
	      
	      if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
            //////alert('1');
            //////alert(tblid);
	 }
     else if (showpanel == 2) 
     {
        var vtrdiv2 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk2 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk22 = document.getElementById(lid2);
          
        if(hidelnk2){
	   hidelnk2.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
       if(hidelnk22){	    
	   hidelnk22.style.display='block';
	   document.getElementById(vtrdiv2).style.display='block';
	   }
	     
        strtb+="<td style=\"padding-left:0px;\" align=\"left\" valign=\"top\">";
        strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='254' height='198.5' border='0'>";
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
           //alert('2');
           //alert(tblid);
            
     }	   
     else if (showpanel == 3)
     {
      var vtrdiv3 = "tr_"+document.getElementById(tblid).id;
        if(document.getElementById(linkid))
            hidelnk3 = document.getElementById(linkid);
    
        if(document.getElementById(lid2))
            hidelnk33 = document.getElementById(lid2);
           
       if(hidelnk3){
	   hidelnk3.style.display='none';
	   document.getElementById(divid).style.overflowY = 'hidden';
	   }
	   
       if(hidelnk33){	    
	   hidelnk33.style.display='block';
	   document.getElementById(vtrdiv3).style.display='block';
	   }
	    
      //  strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
//        if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
//            //alert(navigator.appVersion);
//            strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+" width='270' align='left' height='198.5' border='0'>";
//        }
//        else
//            strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg'"+"width='246' height='198.5' border='0'>";
		if(navigator.appVersion.indexOf("MSIE 7.0") > 0)
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='249' height='198.5' border='0'>";
		}
		else
		{
			strtb+="<td style=\"padding-left:0px;\" align=\"right\" valign=\"top\">";
			strtb+="<img src='../mycorcoran/img/homepage_selectedpanel.jpg' width='246' height='198.5' border='0'>";
		}
          if(document.getElementById(tblid))
            showtableidimg=document.getElementById(tblid);
     }
	 
	   strtb+="</td></tr>";
	   strtb+="</table>";
	  
	
	   if(showtableidimg){
	   ////alert('in show table');
	   showtableidimg.innerHTML = "";
	   showtableidimg.innerHTML = strtb;
	  }
	   if(showpanel == 1){
	   
	        link_type1 = "Brk_FeaturedListings";
	        spanel1 = 1;
	        sp1=1;
	        chomeborough1 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid=document.getElementById(tblid);
 	        if(document.getElementById(btl1))
	            document.getElementById(btl1).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	   }
	   else if(showpanel == 2)  {
	        
	        link_type2 = "Brk_FeaturedListings";
	        spanel2 = 2;
	        sp2=2;
	        chomeborough2 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid2=document.getElementById(tblid);
            if(document.getElementById(btl2))
	            document.getElementById(btl2).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
       }
	   else if(showpanel == 3){
	        
	        link_type3 = "Brk_FeaturedListings";
	        spanel3 = 3;
	        sp3=3;
	        chomeborough3 = "Brooklyn";
	        if(document.getElementById(tblid))
                showtableid3=document.getElementById(tblid);
            if(document.getElementById(btl3))
	            document.getElementById(btl3).innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
				//document.getElementById(btl1).width="255px";
//				document.getElementById(btl2).width="256px";
//				if(document.getElementById(btl3))
//					document.getElementById(btl3).width="246px";

	   }
    }
	  if(navigator.appVersion.indexOf("MSIE 7.0") > 0){
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="256px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="259px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="247px";
		}
		else
		{
		   if(document.getElementById(btl1))
			document.getElementById(btl1).width="250px";
		   if(document.getElementById(btl2))
			document.getElementById(btl2).width="255px";
		   if(document.getElementById(btl3))
			document.getElementById(btl3).width="240px";
		
		}
    ////alert(spanel1);
    ////alert(spanel2);
    ////alert(spanel3);
}
function getChomeReqType(lnktype)
{
     var vlnktype = "",reslnktype="";
     vlnktype = lnktype;
     ////alert('IN getChomeReqType');
     ////alert(vlnktype);
     switch(vlnktype)
     {
      //Manhattan
      case "Man_NewestListings":
      reslnktype = "CHome_NewestListings";
      break;
      case "Man_FeaturedListings":
      reslnktype = "CHome_FeaturedListings";
      break;
      case "Man_OpenhseListings":
      reslnktype = "CHome_Openhouses";
      break;
      case "Man_MostViewedNow":
      reslnktype = "CHome_MostViewedNow";
      break;
      case "Man_MostViewedThisWeek":
      reslnktype = "CHome_MostViewedThisweek";
      break;
      
      //Brooklyn
      case "Brk_NewestListings":
      reslnktype = "CHome_NewestListings";
      break;
      case "Brk_FeaturedListings":
      reslnktype = "CHome_FeaturedListings";
      break;
      case "Brk_OpenhseListings":
      reslnktype = "CHome_Openhouses";
      break;
      case "Brk_MostViewedNow":
      reslnktype = "CHome_MostViewedNow";
      break;
      case "Brk_MostViewedThisWeek":
      reslnktype = "CHome_MostViewedThisweek";
      break;
      
      //Hamptons
      case "Hmp_NewestListings":
       reslnktype = "CHome_NewestListings";
      break;
      case "Hmp_FeaturedListings":
       reslnktype = "CHome_FeaturedListings";
      break;
      case "Hmp_OpenhseListings":
       reslnktype = "CHome_Openhouses";
      break;
      case "Hmp_MostViewedNow":
       reslnktype = "CHome_MostViewedNow";
      break;
      case "Hmp_MostViewedThisWeek":
       reslnktype = "CHome_MostViewedThisweek";
      break;
      
      //palm beach
      case "pmb_NewestListings":
       reslnktype = "CHome_NewestListings";
      break;
      case "pmb_FeaturedListings":
       reslnktype = "CHome_FeaturedListings";
      break;
      case "pmb_OpenhseListings":
       reslnktype = "CHome_Openhouses";
      break;
      case "pmb_MostViewedNow":
       reslnktype = "CHome_MostViewedNow";
      break;
      case "pmb_MostViewedThisWeek":
       reslnktype = "CHome_MostViewedThisweek";
      break;
      
      default:
      reslnktype = "";
      break;
     }
     
return reslnktype;
}

function Clearedit_Save()
{
//////alert('Clearedit_Save');
//////alert(bflgpgload);
if(bsavehflg == 0)
    return false;
    
if(bflgpgload == 'false'){
if(sp1 == 0 && sp2 == 0 && sp3 == 0){
  return false;
}
}

if(bflgpgload == 'true'){
if(spn1 == 0 && spn2 == 0 && spn3 == 0)
{
  return false;
}
}

 sp1 = 0;
 sp2 = 0;
 sp3 = 0;
 bsavehflg = 0;
 spanel1= 0;
 spanel2= 0;
 spanel3= 0;
 flgsave = 0;
 
 var k1=0;
 var vsublnk1 ="",vsublnk2 ="",vsublnk3 ="";
/*
     if(link_type1   != "")
        vsublnk1 = link_type1.replace('_','');
    if(link_type2 != "")
        vsublnk2 = link_type2.replace('_','');
    if(link_type3 != "")
        vsublnk3 = link_type3.replace('_','');    
    var vtrlnk1 = "",vtrlnk2 = "",vtrlnk3 = "";        
    
    vtrlnk1 = "div_"+vsublnk1;
    vtrlnk2 = "div_"+vsublnk2;
    vtrlnk3 = "div_"+vsublnk3;
    
    var vgDiv = document.getElementsByTagName('div');
    alert(vtrlnk2.substring(0,10));
     var vlnks1="",vlnks2="",vlnks3="";
      var vdivs1="";
      var vindxlnk1 ="",vindxlnk2="",vindxlnk3="";
   
    for(k1=0;k1<vgDiv.length;k1++)
    {
        var vindxdiv1 = vgDiv[k1].getAttribute("id").indexOf('This');
        
        if(link_type1 != "")
        {
          vindxlnk1 = vtrlnk1.indexOf('This');
         }
         
          if(link_type2 != "")
        {
          vindxlnk2 = vtrlnk2.indexOf('This');
         }
         
          if(link_type3 != "")
        {
          vindxlnk3 = vtrlnk3.indexOf('This');
         } 
      
        if(vindxlnk1 != -1)
        {
         if(vindxdiv1 != -1)
            {
             vlnks1 = vtrlnk1.substring(0,18);
             vdivs1  = vgDiv[k1].getAttribute("id").substring(0,18);
             if(vdivs1 == "div_ManMostviewedT")
              vdivs1 = vdivs1.replace("div_ManMostviewedT","div_ManMostViewedT");
             else if(vdivs1 == "div_BrkMostviewedT")
                vdivs1 = vdivs1.replace("div_BrkMostviewedT","div_BrkMostViewedT");
             else if(vdivs1 == "div_HmpMostviewedT")
                vdivs1 = vdivs1.replace("div_HmpMostviewedT","div_HmpMostViewedT");
             else if(vdivs1 == "div_pmbMostviewedT")
                vdivs1 = vdivs1.replace("div_pmbMostviewedT","div_pmbMostViewedT");
             
             //alert('This vlnks1');
             //alert(vlnks1);
             //alert('This vdivs1');
             //alert(vdivs1);
            }
            else
            {
                vlnks1 = "";
                vdivs1 = "";
            }
        }
        else
        {
            vlnks1 = vtrlnk1.substring(0,10);
            vdivs1  = vgDiv[k1].getAttribute("id").substring(0,10);
        }
        
        // Two
         if(vindxlnk2 != -1)
        {
         if(vindxdiv1 != -1)
            {
             vlnks2 = vtrlnk2.substring(0,18);
             vdivs2  = vgDiv[k1].getAttribute("id").substring(0,18);
             
              if(vdivs2 == "div_ManMostviewedT")
              vdivs2 = vdivs2.replace("div_ManMostviewedT","div_ManMostViewedT");
             else if(vdivs2 == "div_BrkMostviewedT")
                vdivs2 = vdivs2.replace("div_BrkMostviewedT","div_BrkMostViewedT");
             else if(vdivs1 == "div_HmpMostviewedT")
                vdivs2 = vdivs2.replace("div_HmpMostviewedT","div_HmpMostViewedT");
             else if(vdivs2 == "div_pmbMostviewedT")
                vdivs2 = vdivs2.replace("div_pmbMostviewedT","div_pmbMostViewedT");
            }
            else
            {
                vlnks2 = "";
                vdivs2 = "";
            }
        }
        else
        {
            vlnks2 = vtrlnk2.substring(0,10);
            vdivs2  = vgDiv[k1].getAttribute("id").substring(0,10);
        }
        
        //Three
         if(vindxlnk3 != -1)
        {
         if(vindxdiv1 != -1)
            {
          
             vlnks3 = vtrlnk3.substring(0,18);
             vdivs3  = vgDiv[k1].getAttribute("id").substring(0,18);
              if(vdivs3 == "div_ManMostviewedT")
              vdivs3 = vdivs3.replace("div_ManMostviewedT","div_ManMostViewedT");
             else if(vdivs3 == "div_BrkMostviewedT")
                vdivs3 = vdivs3.replace("div_BrkMostviewedT","div_BrkMostViewedT");
             else if(vdivs3 == "div_HmpMostviewedT")
                vdivs3 = vdivs3.replace("div_HmpMostviewedT","div_HmpMostViewedT");
             else if(vdivs3 == "div_pmbMostviewedT")
                vdivs3 = vdivs3.replace("div_pmbMostviewedT","div_pmbMostViewedT");
            }
            else
            {
          
                vlnks3 = "";
                vdivs3 = "";
            }
        }
        else
        {
            vlnks3 = vtrlnk3.substring(0,10);
            vdivs3  = vgDiv[k1].getAttribute("id").substring(0,10);
        }
        
   if(vlnks1 != "" && vdivs1 != ""){
    if(link_type1 != ""){
  //if(vdivs1 == "div_ManMostViewedT"){
  //alert('vlnks1 Mos viewed');
 // alert(vlnks1);
  //alert('vdivs1 Mos viewed');
  //alert(vdivs1);
    
    if(vlnks1 == vdivs1)
    {
        //alert('Equal link and div'); 
        var vsubpno = vgDiv[k1].getAttribute("id").substring(vgDiv[k1].getAttribute("id").length-1,vgDiv[k1].getAttribute("id").length)
       
        if(vsubpno != 2 && vsubpno != 3)
        {
            alert('in Delete Div One');
            document.getElementById(vgDiv[k1].getAttribute("id")).innerHTML = "";
            continue;
        }
    }
    //}
    }
    
    }
    
     if(vlnks2 != "" && vdivs2 != ""){
    if(link_type2 != ""){
      if( vlnks2 == vdivs2)
        {
         var vsubpno2 = vgDiv[k1].getAttribute("id").substring(vgDiv[k1].getAttribute("id").length-1,vgDiv[k1].getAttribute("id").length)
         if(vsubpno2 == 2)
        {
            //alert('in Delete Div TWO');
            //alert(vgDiv[k1].getAttribute("id"));
            document.getElementById(vgDiv[k1].getAttribute("id")).innerHTML = "";
            continue;
        }
        }
    }
    }
    
    
     if(vlnks3 != "" && vdivs3 != ""){
    if(link_type3 != ""){
   
     if( vlnks3 == vdivs3)
        {
      var vsubpno3 = vgDiv[k1].getAttribute("id").substring(vgDiv[k1].getAttribute("id").length-1,vgDiv[k1].getAttribute("id").length)
     
        if(vsubpno3 == 3)
        { //alert('in Delete Div THREE');
            document.getElementById(vgDiv[k1].getAttribute("id")).innerHTML = "";
        }
        }
    }
    }
    }
 */
 SendChomeXmlHttpCookieRequest("Clearcookies");
}

function LnkLogout1Click()
{
	//alert('LnkLogout1Click');
	SendXMLHttpLogoutRequest("LnkbtnLogoutRequest",preg,category1,1);
}

function setDefaultPage()
{
  window.location = "http://dev.corcoran.com/cmembers/index.aspx";
}


function DisplayHomemenu()
{

  {
     if(hidelink)
        hidelink.style.display='block';
     
     if(hidelink2)	    
        hidelink2.style.display='none';
   
     document.getElementById('div1').style.overflowY = 'scroll';
     document.getElementById('div1').style.width = '243px';
     document.getElementById('div1').style.height = '199px';
     
     document.getElementById('td_bline1').innerHTML="<td style=\"border-bottom-color:Black;\" \"border-bottom-style:solid;\" \"border-bottom-width:1px;\" \"border-top-color:Black;\" \"border-top-style:solid;\" \"border-top-width:1px;\" \"border-left-style:solid;\" \"border-left-width:1px;\" \"border-right-color:Black;\" \"border-right-style:solid;\" \"border-right-width:1px;\" \"font-family:Arial;\" \"font-size:1px;\" \"font-style:normal;\" \"font-weight:500\">Choose A Homepage Item</td>";
     
   }
   {
     if(hidelnk2)
        hidelnk2.style.display='block';
     if(hidelnk22)
        hidelnk22.style.display='none';

     document.getElementById('div2').style.overflowY = 'scroll';
     document.getElementById('div2').style.width = '247px';
     document.getElementById('div2').style.height = '199px';
     document.getElementById('td_bline2').innerHTML="<td style=\"border-bottom-color:Black;\" \"border-bottom-style:solid;\" \"border-bottom-width:1px;\" \"border-top-color:Black;\" \"border-top-style:solid;\" \"border-top-width:1px;\" \"border-left-style:solid;\" \"border-left-width:1px;\" \"border-right-color:Black;\" \"border-right-style:solid;\" \"border-right-width:1px;\" \"font-family:Arial;\" \"font-size:1px;\" \"font-style:normal;\" \"font-weight:500\">Choose A Homepage Item</td>";
   }
   
   {
     if(hidelnk3)
        hidelnk3.style.display='block';
     if(hidelnk33)
        hidelnk33.style.display='none';
  
     document.getElementById('div3').style.overflowY = 'scroll';
     document.getElementById('div3').style.width = '247px';
     document.getElementById('div3').style.height = '199px';
     document.getElementById('td_bline3').innerHTML="<td style=\"border-bottom-color:Black;\" \"border-bottom-style:solid;\" \"border-bottom-width:1px;\" \"border-top-color:Black;\" \"border-top-style:solid;\" \"border-top-width:1px;\" \"border-left-style:solid;\" \"border-left-width:1px;\" \"border-right-color:Black;\" \"border-right-style:solid;\" \"border-right-width:1px;\" \"font-family:Arial;\" \"font-size:1px;\" \"font-style:normal;\" \"font-weight:500\">Choose A Homepage Item</td>";
   }
window.location.reload(true);
}

function Save_homepage(bflgp,chck1,chck2,chck3,tbln1,tbdt1,tbln2,tbdt2,tbln3,tbdt3,dv1,dv2,dv3)
{
    //alert('save_homepage');
    bflgpgload = bflgp;
    bsavehflg = 1;
    //alert('save_homepage');
    //alert('bflgpgload');
    //alert(bflgpgload);
    //alert(chck1);
    //alert(chck2);
    //alert(chck3);
        
    if(bflgpgload == 'false')
    {
        //alert('Flgsave');
        //alert(flgsave); 
        ////alert(chomeborough1);
        ////alert(chomeborough2);
        ////alert(chomeborough3);
        ////alert('linktype1');
        ////alert(link_type1);
        ////alert('linktype2');
        ////alert(link_type2);
        ////alert('linktype3');
        ////alert(link_type3);
        
        ////alert(spanel1);
        ////alert(spanel2);
        ////alert(spanel3);
        
        if(flgsave == 1)
        return false; 
 
        if(spanel1 == 0 && spanel2 == 0 && spanel3 == 0)
        {
            alert('Select One of the Items from the List');
            return false;
        }
        var vsublnktype="";
        if(link_type1 != "" && spanel1 == 1)
        {
            vsublnktype = link_type1.substring(0,3);
            if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'block';
            document.getElementById('tbl_divload1').style.display = 'block';
            document.getElementById('div_pnl1').style.display = 'block';
            if(link_type2 != "" && spanel2 == 2)
            {
                if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'block';
                document.getElementById('tbl_divload2').style.display = 'block';
                document.getElementById('div_pnl2').style.display = 'block';
            }
            if(link_type3 != "" && spanel3 == 3)
            {
            if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'block';
                document.getElementById('tbl_divload3').style.display = 'block';
                document.getElementById('div_pnl3').style.display = 'block';
            }
            stype = getChomeReqType(link_type1);
            
            if(vsublnktype == "Man")
            {
                 chomeborough1 = "Manhattan";
            }
          
            if(vsublnktype == "Man" || vsublnktype == "Brk")
            {
                if(vsublnktype == "Man")
                {
                    chomeborough1 = "Manhattan";
                }  
                else if (vsublnktype == "Brk") 
                {
                  chomeborough1 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktype == "Hmp")
            {
                chomeborough1 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktype == "pmb")  
            {
                 chomeborough1 = "PalmBeaches";
                 preg = "FL";
            }            
            SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
         }
        
        else if(link_type2 != "" && spanel2 == 2)
        { 
           
           if(spanel1 == 1){

             vsublnktype = link_type1.substring(0,3);
            if (link_type1 != "") 
            {
            if(vsublnktype == "Man")
            {
                 chomeborough1 = "Manhattan";
            }
            if(vsublnktype == "Man" || vsublnktype == "Brk")
            {
                if(vsublnktype == "Man")
                {
                    chomeborough1 = "Manhattan";
                }  
                else if (vsublnktype == "Brk") 
                {
                  chomeborough1 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktype == "Hmp")
            {
                chomeborough1 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktype == "pmb")  
            {
                 chomeborough1 = "PalmBeaches";
                 preg = "FL";
            }            
                //if(spanel1 == 1){
                if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'block';
                document.getElementById('tbl_divload1').style.display = 'block';
                document.getElementById('div_pnl1').style.display = 'block';
                if(link_type2 != "" && spanel2 == 2)
                {
                if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'block';
                    document.getElementById('tbl_divload2').style.display = 'block';
                    document.getElementById('div_pnl2').style.display = 'block';
                }
                if(link_type3 != "" && spanel3 == 3)
                {
                    if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'block';
                    document.getElementById('tbl_divload3').style.display = 'block';
                    document.getElementById('div_pnl3').style.display = 'block';
                }
                stype = getChomeReqType(link_type1);
                SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
                //}
            } 
           }
           else
           {
              if(spanel2 == 2){
               vsublnktype = link_type2.substring(0,3);
            if(vsublnktype == "Man" || vsublnktype == "Brk")
            {
                if(vsublnktype == "Man")
                {
                    chomeborough2 = "Manhattan";
                }  
                else if (vsublnktype == "Brk") 
                {
                  chomeborough2 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktype == "Hmp")
            {
                chomeborough2 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktype == "pmb")  
            {
                 chomeborough2 = "PalmBeaches";
                 preg = "FL";
            }            
               if(link_type1 != "" && spanel1 == 1)
                {
                if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'block';
                    document.getElementById('tbl_divload1').style.display = 'block';
                    document.getElementById('div_pnl1').style.display = 'block';
                }
                if(link_type3 != "" && spanel3 == 3)
                {
                if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'block';
                    document.getElementById('tbl_divload3').style.display = 'block';
                    document.getElementById('div_pnl3').style.display = 'block';
                }
                if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'block';
               document.getElementById('tbl_divload2').style.display = 'block';
               document.getElementById('div_pnl2').style.display = 'block';
               stype = getChomeReqType(link_type2);
               SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
              }
           }
        }
        else if (link_type3 != "" && spanel3 == 3) 
        {
         
          if(spanel1 == 1){
              if (link_type1 != "") 
              { 
            vsublnktype = link_type1.substring(0,3);
            if(vsublnktype == "Man" || vsublnktype == "Brk")
            {
                if(vsublnktype == "Man")
                {
                    chomeborough1 = "Manhattan";
                }  
                else if (vsublnktype == "Brk") 
                {
                  chomeborough1 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktype == "Hmp")
            {
                chomeborough1 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktype == "pmb")  
            {
                 chomeborough1 = "PalmBeaches";
                 preg = "FL";
            }                   
                document.getElementById('tbl_divload1').style.display = 'block';
                document.getElementById('div_pnl1').style.display = 'block';
                if(link_type2 != "" && spanel2 == 2)
                {
                if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'block';
                    document.getElementById('tbl_divload2').style.display = 'block';
                    document.getElementById('div_pnl2').style.display = 'block';
                }
                if(link_type3 != "" && spanel3 == 3)
                {
                if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'block';
                    document.getElementById('tbl_divload3').style.display = 'block';
                    document.getElementById('div_pnl3').style.display = 'block';
                }
                  stype = getChomeReqType(link_type1);
                  SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
                 
              } 
            }
            else
            {   
             if(spanel2 == 2){
              if (link_type2 != "") 
              {
               vsublnktype = link_type2.substring(0,3);
            if(vsublnktype == "Man" || vsublnktype == "Brk")
            {
                if(vsublnktype == "Man")
                {
                    chomeborough2 = "Manhattan";
                }  
                else if (vsublnktype == "Brk") 
                {
                  chomeborough2 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktype == "Hmp")
            {
                chomeborough2 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktype == "pmb")  
            {
                 chomeborough2 = "PalmBeaches";
                 preg = "FL";
            }                   
                if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'block';
                document.getElementById('tbl_divload2').style.display = 'block';
                document.getElementById('div_pnl2').style.display = 'block';
                 if(link_type1 != "" && spanel1 == 1)
                {
                if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'block';
                    document.getElementById('tbl_divload1').style.display = 'block';
                    document.getElementById('div_pnl1').style.display = 'block';
                }
                if(link_type3 != "" && spanel3 == 3)
                {
                if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'block';
                    document.getElementById('tbl_divload3').style.display = 'block';
                    document.getElementById('div_pnl3').style.display = 'block';
                }
                stype = getChomeReqType(link_type2);
                SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
               
              }
             }
             else
             {  
               if(spanel3 == 3){
                vsublnktype = link_type3.substring(0,3);
            if(vsublnktype == "Man" || vsublnktype == "Brk")
            {
                if(vsublnktype == "Man")
                {
                    chomeborough3 = "Manhattan";
                }  
                else if (vsublnktype == "Brk") 
                {
                  chomeborough3 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktype == "Hmp")
            {
                chomeborough3 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktype == "pmb")  
            {
                 chomeborough3 = "PalmBeaches";
                 preg = "FL";
            }                   
                if(link_type1 != "" && spanel1 == 1)
                {
                if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'block';
                    document.getElementById('tbl_divload1').style.display = 'block';
                    document.getElementById('div_pnl1').style.display = 'block';
                }
                if(link_type2 != "" && spanel2 == 2)
                {
                if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'block';
                    document.getElementById('tbl_divload2').style.display = 'block';
                    document.getElementById('div_pnl2').style.display = 'block';
                }
                if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'block';
                document.getElementById('tbl_divload3').style.display = 'block';
			    document.getElementById('div_pnl3').style.display = 'block';
                stype = getChomeReqType(link_type3);
                SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
			//}
             }
           }
        }
    }
	}
    else if(bflgpgload == 'true')
    {
        var spstrck="",spstrck1="",spstrck2="",spreg="",spborough="";
//            alert('save_homepage'); 
//            alert(chck1);
//            alert('cookie2'); 
//            alert(chck2);
//            alert('cookie3'); 
//            alert(chck3);
            ////alert('borough');
   
   
        if(chck1 != ""){
       // alert('ch ck PRESENT');
            chcookie1 = chck1;
            link_type1 = chcookie1;
            if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'block';
            document.getElementById('tbl_divload1').style.display = 'block';
            document.getElementById('div_pnl1').style.display = 'block';
            if(document.getElementById('div1'))document.getElementById('div1').style.overflowY = 'hidden';
            if(document.getElementById('tbl_Links'))document.getElementById('tbl_Links').style.display = 'none';
            
            }
        if(chck2 != ""){
            chcookie2 = chck2;
            link_type2 = chcookie2;
            spnload2 = 2;
              hidelnk2 = document.getElementById(tbln2);
            hidelnk22 = document.getElementById(tbdt2);
            showtableid2 = document.getElementById(dv2);
            if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'block';
            document.getElementById('tbl_divload2').style.display = 'block';
            document.getElementById('div_pnl2').style.display = 'block';
            if(document.getElementById('div2'))document.getElementById('div2').style.overflowY = 'hidden';
            if(document.getElementById('tbl_Links2'))document.getElementById('tbl_Links2').style.display = 'none';
            }
        if (chck3 != "") {
            chcookie3 = chck3;
            link_type3 = chcookie3;
            spnload3 = 3;
             hidelnk3 = document.getElementById(tbln3);
            hidelnk33 = document.getElementById(tbdt3);
            showtableid3 = document.getElementById(dv3);
            if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'block';
            document.getElementById('tbl_divload3').style.display = 'block';
            document.getElementById('div_pnl3').style.display = 'block';
            if(document.getElementById('div3'))document.getElementById('div3').style.overflowY = 'hidden';
            if(document.getElementById('tbl_Links3'))document.getElementById('tbl_Links3').style.display = 'none';
            }
      
        if(chcookie1)
        {
            //alert('in cookie1 not NULL');
			hidelink = document.getElementById(tbln1);
            hidelink2 = document.getElementById(tbdt1);
            showtableid = document.getElementById(dv1);
            
            spstrck = chcookie1.split('_');
           
            if(spstrck[0] == "Man")
            {
                chomeborough1 = "Manhattan";
            }
          
            if(spstrck[0] == "Man" || spstrck[0] == "Brk")
            {
                if(spstrck[0] == "Man")
                {
                    chomeborough1 = "Manhattan";
                }  
                else if (spstrck[0] == "Brk") 
                {
                   chomeborough1 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(spstrck[0] == "Hmp")
            {
                chomeborough1 = "Hamptons";
                preg = "LI";
            }
            else if(spstrck[0] == "pmb")  
            {
                chomeborough1 = "PalmBeaches";
                preg = "FL";
            }
           
            link_type1 = chcookie1;
            spnload1 = 1;
            spn1=1;
            ////alert('link_type1');
            ////alert(link_type1);
            ////alert('link_type2');
            ////alert(link_type2);
            ////alert('link_type3');
            ////alert(link_type3);
            
            if(link_type1 == "Man_FeaturedListings" || link_type1 == "Brk_FeaturedListings" ||
               link_type1 == "Hmp_FeaturedListings" || link_type1 == "pmb_FeaturedListings"){
            if(chomeborough1 == "Manhattan")
            {
                if(document.getElementById('td_bline1'))
	                {
	                if(document.URL.toLowerCase().match("cmembers"))
	                    document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
	                else
	                    document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Manhattan_Featured.gif' width='249' border='0' align='top'></a></font>";    
	                }
	        }
	        else if(chomeborough1 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline1')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	                else
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='../nyc.aspx'><img src='mycorcoran/img/MC_Brooklyn_Featured.gif' width='249' border='0' align='top'></a></font>";    
	                }
	                
	        }
	        else if(chomeborough1 == "Hamptons")
	        {
	          if(document.getElementById('td_bline1')){
	             
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	                else
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='../hee.aspx'><img src='mycorcoran/img/MC_Hamptons_Featured.gif' width='249' border='0' align='top'></a></font>";    
	            }
	        }
	        else if(chomeborough1 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline1')){
	                if(document.URL.toLowerCase().match("cmembers"))
	                    document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	                else
	                    document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='../palmbeach.aspx'><img src='mycorcoran/img/MC_PalmBeaches_Featured.gif' width='249' border='0' align='top'></a></font>";    
	                }
	        }
	         //////alert(chomeborough1);
            stype = getChomeReqType(link_type1);
            SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
            }
            else if (link_type1 == "Man_NewestListings" || link_type1 == "Brk_NewestListings" || 
                     link_type1 == "Hmp_NewestListings" || link_type1 == "pmb_NewestListings") {
             if(chomeborough1 == "Manhattan")
            {
                if(document.getElementById('td_bline1')){
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
	              else{
	                //document.getElementById('td_ln1').style.display = 'none';
	                document.getElementById('td_bline1').innerHTML = "<a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='mycorcoran/img/MC_Manhattan_NewestListings.gif' width='249' height='27' border='0' align='top'></a>";    
	                }
	            }
	        }
	        else if(chomeborough1 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline1')){
	           if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
                else
                    document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='249' border='0' align='top'></a></font>";    
              }  	                
	        }
	        else if (chomeborough1 == "Hamptons") {
	        if(document.getElementById('td_bline1')){
	         
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
             else
                    document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='mycorcoran/img/MC_Hamptons_NewestListings.gif' width='249' border='0' align='top'></a></font>";                    	                
	        }         
	        }
	        else if (chomeborough1 == "PalmBeaches") {
	        if(document.getElementById('td_bline1')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	         else
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='249' border='0' align='top'></a></font>";                    	                
	        
	        }
	        }
	        //alert(chomeborough1);
	        
            stype = getChomeReqType(link_type1);
            SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
            }
            else if (link_type1 == "Man_OpenhseListings" || link_type1 == "Brk_OpenhseListings" || 
                     link_type1 == "Hmp_OpenhseListings" || link_type1 == "pmb_OpenhseListings") {
             if(chomeborough1 == "Manhattan")
            {
                if(document.getElementById('td_bline1')){
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
                 else
                    document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='249' border='0' align='top'></a></font>";                    	                 
                }	                
	        }
	        else if(chomeborough1 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline1')){
	                if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	                else
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='249' border='0' align='top'></a></font>";                    	                 
	                }
	        }
	        else if(chomeborough1 == "Hamptons")
	        {
	          if(document.getElementById('td_bline1')){
	                if(document.URL.toLowerCase().match("cmembers"))   
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	                else
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/property/openhse.aspx?region=LI'><img src='mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='249' border='0' align='top'></a></font>";                    	                 
	            }
	        }
	        else if(chomeborough1 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline1')){
	          if(document.URL.toLowerCase().match("cmembers"))   
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	           else
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/property/openhse.aspx?region=FL'><img src='mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='249' border='0' align='top'></a></font>";                    	                  
	            
	            }
	        }
	        //alert(chomeborough1);
            stype = getChomeReqType(link_type1);
            SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
            }
           else if (link_type1 == "Man_MostViewedNow" || link_type1 == "Brk_MostViewedNow" ||
                    link_type1 == "Hmp_MostViewedNow" || link_type1 == "pmb_MostViewedNow") {
             if(chomeborough1 == "Manhattan")
            {
                if(document.getElementById('td_bline1')){
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
                 else
                     document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";                    	                        	                
	            }
	        }
	        else if(chomeborough1 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline1')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	         else
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough1 == "Hamptons")
	        {
	          if(document.getElementById('td_bline1')){
	           if(document.URL.toLowerCase().match("cmembers"))   
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
	        else
    	        document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough1 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline1')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	         else
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        //alert(chomeborough1);
            stype = getChomeReqType(link_type1);
            SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
            }
            else if (link_type1 == "Man_MostViewedThisWeek" || link_type1 == "Brk_MostViewedThisWeek" ||
                     link_type1 == "Hmp_MostViewedThisWeek" || link_type1 == "pmb_MostViewedThisWeek") {
             if(chomeborough1 == "Manhattan")
            {
                if(document.getElementById('td_bline1')){
	                if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
	                else 
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";                    	                        	                
	                }
	        }
	        else if(chomeborough1 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline1')){
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	              else
	              document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";                    	                        	                
	            }
	        }
	        else if(chomeborough1 == "Hamptons")
	        {
	          if(document.getElementById('td_bline1')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
	            else
	            document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";                    	                        	                
	            }
	        }
	        else if(chomeborough1 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline1')){
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	             else
	             document.getElementById('td_bline1').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:0px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";                    	                        	                
	            }
	        }  
	        //alert(chomeborough1);
            stype = getChomeReqType(link_type1);
            SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
            }
        }
        else if(chcookie2)
        {
            ////alert('in CHCOOKIE2');
            hidelnk2 = document.getElementById(tbln2);
            hidelnk22 = document.getElementById(tbdt2);
            showtableid2 = document.getElementById(dv2);
            spstrck2 = chcookie2.split('_');
           
            if(spstrck2[0] == "Man")
            {
                 chomeborough2 = "Manhattan";
            }
          
            if(spstrck2[0] == "Man" || spstrck2[0] == "Brk")
            {
                if(spstrck2[0] == "Man")
                {
                    chomeborough2 = "Manhattan";
                }  
                else if (spstrck2[0] == "Brk") 
                {
                  chomeborough2 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(spstrck2[0] == "Hmp")
            {
                chomeborough2 = "Hamptons";
                preg = "LI";
            }
            else if(spstrck2[0] == "pmb")  
            {
                 chomeborough2 = "PalmBeaches";
                 preg = "FL";
            }
            link_type2 = chcookie2;
            spnload2 = 2;
            spn2=2;
            ////alert('linkTYPE2');
            ////alert(link_type2);
            ////alert('chomeborough2');
            ////alert(chomeborough2);
            if(link_type2 == "Man_FeaturedListings" || link_type2 == "Brk_FeaturedListings" ||
               link_type2 == "Hmp_FeaturedListings" || link_type2 == "pmb_FeaturedListings" ){
            if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	            
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
	            else
    	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='mycorcoran/img/MC_Manhattan_Featured.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	            }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	        else
                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='mycorcoran/img/MC_Brooklyn_Featured.gif' width='252' border='0' align='top'></a></font>";                    	                        	                	            
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	         else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='mycorcoran/img/MC_Hamptons_Featured.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	           if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	           else
	              document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='mycorcoran/img/MC_PalmBeaches_Featured.gif' width='252' border='0' align='top'></a></font>";                    	                        	                    
              }	                
	        }
            stype = getChomeReqType(link_type2);
            SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
            }
            else if(link_type2 == "Man_NewestListings" || link_type2 == "Brk_NewestListings" ||
                    link_type2 == "Hmp_NewestListings" || link_type2 == "pmb_NewestListings")
            {
             if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
	            else{
    	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='mycorcoran/img/MC_Manhattan_NewestListings.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
    	            }
	            }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	             if(document.URL.toLowerCase().match("cmembers"))	         
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
	            else
	                 document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	             if(document.URL.toLowerCase().match("cmembers"))	          
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
	            else
	             document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='mycorcoran/img/MC_Hamptons_NewestListings.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	             if(document.URL.toLowerCase().match("cmembers"))	         
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	            else
	                 document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	      
            stype = getChomeReqType(link_type2);
            SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
            }
            else if(link_type2 == "Man_OpenhseListings" || link_type2 == "Brk_OpenhseListings" ||
                    link_type2 == "Hmp_OpenhseListings" || link_type2 == "pmb_OpenhseListings")
            {
             if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
	              else
	                 document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	        if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	        else
	        document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	        else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
                if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	            else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	      
            stype = getChomeReqType(link_type2);
            SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
            }
            else if(link_type2 == "Man_MostViewedNow" || link_type2 == "Brk_MostViewedNow" ||
                    link_type2 == "Hmp_MostViewedNow" || link_type2 == "pmb_MostViewedNow")
            {
            ////alert('in hmp Condition true');
             if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
	         else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	         else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	            if(document.URL.toLowerCase().match("cmembers"))    
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
	            else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	            }
	        }
            else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	        else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";                    	                        	               
	        }
	        }
	        	      
            stype = getChomeReqType(link_type2);
            SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
            }
            else if(link_type2 == "Man_MostViewedThisWeek" || link_type2 == "Brk_MostViewedThisWeek" ||
                    link_type2 == "Hmp_MostViewedThisWeek" || link_type2 == "pmb_MostViewedThisWeek")
            {
             if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
	            else
    	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	          else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
	         else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";                    	                        	                
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	          if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	          else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";                    	                        	                 
	        }
	    }  
            stype = getChomeReqType(link_type2);
            SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
            }
        }
        else if (chcookie3) {
		//alert('in Cookie3 not NULL');
            hidelnk3 = document.getElementById(tbln3);
            hidelnk33 = document.getElementById(tbdt3);
            showtableid3 = document.getElementById(dv3);
          
            spstrck3 = chcookie3.split('_');
           
            if(spstrck3[0] == "Man")
            {
                 chomeborough3 = "Manhattan";
            }
          
            if(spstrck3[0] == "Man" || spstrck3[0] == "Brk")
            {
                if(spstrck3[0] == "Man")
                {
                    chomeborough3 = "Manhattan";
                }  
                else if (spstrck3[0] == "Brk") 
                {
                  chomeborough3 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(spstrck3[0] == "Hmp")
            {
                chomeborough3 = "Hamptons";
                preg = "LI";
            }
            else if(spstrck3[0] == "pmb")  
            {
                 chomeborough3 = "PalmBeaches";
                 preg = "FL";
            }
            link_type3 = chcookie3;
            spnload3 = 3;
            spn3=3;
            if(link_type3 == "Man_FeaturedListings" || link_type3 == "Brk_FeaturedListings" ||
               link_type3 == "Hmp_FeaturedListings" || link_type3 == "pmb_FeaturedListings" ){
            if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	             if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
	             else{
	             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='mycorcoran/img/MC_Manhattan_Featured.gif' width='251' border='0' align='top'></a></font>";    
	             else
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='mycorcoran/img/MC_Manhattan_Featured.gif' width='249' border='0' align='top'></a></font>";    
	            
	            }
	            }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	        if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	        else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='mycorcoran/img/MC_Brooklyn_Featured.gif' width='251' border='0' align='top'></a></font>";    
	         else
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='mycorcoran/img/MC_Brooklyn_Featured.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	        else{
	        if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='mycorcoran/img/MC_Hamptons_Featured.gif' width='251' border='0' align='top'></a></font>";    
	        else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='mycorcoran/img/MC_Hamptons_Featured.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='mycorcoran/img/MC_PalmBeaches_Featured.gif' width='251' border='0' align='top'></a></font>";    
             else
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='mycorcoran/img/MC_PalmBeaches_Featured.gif' width='249' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        }
            //////alert(chomeborough3);        
            stype = getChomeReqType(link_type3);
            SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if (link_type3 == "Man_NewestListings" || link_type3 == "Brk_NewestListings" ||
                     link_type3 == "Hmp_NewestListings" || link_type3 == "pmb_NewestListings")
            {
			 //alert('in link type 3 MannewestListings');
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
				//alert('in bottom line 3');
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
	            else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='mycorcoran/img/MC_Manhattan_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	            
             else
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='mycorcoran/img/MC_Manhattan_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	            
	         
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
	        else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='251' border='0' align='top'></a></font>";    
	         else
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
           if(document.URL.toLowerCase().match("cmembers"))
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
	        else{
	        if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='mycorcoran/img/MC_Hamptons_NewestListings.gif' width='251' border='0' align='top'></a></font>";    
	        else
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='mycorcoran/img/MC_Hamptons_NewestListings.gif' width='249' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	        if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	        else{
	        if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='251' border='0' align='top'></a></font>";    
	        else    
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='249' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        }
            //////alert(chomeborough3);        
            stype = getChomeReqType(link_type3);
            SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if (link_type3 == "Man_OpenhseListings" || link_type3 == "Brk_OpenhseListings" ||
                     link_type3 == "Hmp_OpenhseListings" || link_type3 == "pmb_OpenhseListings")
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
	        else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    
	         else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    
	         else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	           document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    
	         else
	           document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	        else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    
	         else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
            //////alert(chomeborough3);        
            stype = getChomeReqType(link_type3);
            SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if (link_type3 == "Man_MostViewedNow" || link_type3 == "Brk_MostViewedNow" || 
                     link_type3 == "Hmp_MostViewedNow" || link_type3 == "pmb_MostViewedNow")
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
	            else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    
	         else   
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	        else{
	        if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    
	        else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
	        else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    
	         else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	         
             else  
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	         
	        }
	        }
	        }
            //////alert(chomeborough3);        
            stype = getChomeReqType(link_type3);
            SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if (link_type3 == "Man_MostViewedThisWeek" || link_type3 == "Brk_MostViewedThisWeek" ||
                     link_type3 == "Hmp_MostViewedThisWeek" || link_type3 == "pmb_MostViewedThisWeek")
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
	            else{
	            if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    
	            else
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    
	           
	           } 
	            }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	         else {
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    
	         else
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    
             else	                    
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	            else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	        
             else
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	        
            }
	        }
	        }
            //////alert(chomeborough3);    
            //alert('LinkType3 in save_home');    
            //alert(link_type3);
            stype = getChomeReqType(link_type3);
            SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
        }
}
}

function ProcessCHomeMostviewedListing(data)
{
//alert('ProcessCHomeMostviewedListing');
//alert(data);
    var		vadd =new Array();
	var		vReg=new Array();
	var		vArea=new Array();
	var		vListingid=new Array();
	var		dataArray = new Array();
	var		listings = new Array();
	
	clearMap();
	if(_map != null){
	_map.addOverlay(trafficInfo);
	}
	if(data.indexOf("criteria")!=-1){
	//alert('data');
	//alert(data);
    
	////alert('in criteria');
		//reset counters
		total_listings="0";
		start=0;
		increment=50;
		new_start=start;
		new_end=increment;
		//display message
		nolistings=data;
		//var isSet=NeighborhoodDropDown();
		//if(isSet==true){sortopt.innerHTML = ReturnSortOptionsHtml(total_listings,new_start,new_end);}
		resErrorHtml='<font face="Arial" size="2px" color="#ffffff">'+nolistings+'</font>';		
		/*alert('Panel Number in empty list');
		alert(spnload1);
		alert(spnload2);
		alert(spnload3);
		if(link_type1 != ""){
		if(document.getElementById('tbl_divload1'))
		    document.getElementById('tbl_divload1').style.display = 'none';
        if(document.getElementById('div_pnl1'))
        document.getElementById('div_pnl1').style.display = 'none';
        
        document.getElementById('tbl_errorp1').style.display = 'block';
        document.getElementById('div_error1').style.display = 'block';
       }
       if(link_type2 != ""){
		if(document.getElementById('tbl_divload2'))
		    document.getElementById('tbl_divload2').style.display = 'none';
        if(document.getElementById('div_pnl2'))
        document.getElementById('div_pnl2').style.display = 'none';
        
        document.getElementById('tbl_errorp2').style.display = 'block';
        document.getElementById('div_error2').style.display = 'block';
       }
       if(link_type3 != ""){
		if(document.getElementById('tbl_divload3'))
		    document.getElementById('tbl_divload3').style.display = 'none';
        if(document.getElementById('div_pnl3'))
        document.getElementById('div_pnl3').style.display = 'none';
        
        document.getElementById('tbl_errorp3').style.display = 'block';
        document.getElementById('div_error3').style.display = 'block';*/
       //}
	}
	//else
	{
	if(data != "" && data != null){
    if(data.indexOf("criteria") == -1){
    
		dataArray=data.split('*$');
		vadd =dataArray[0].split('~');	
		vArea=dataArray[1].split('~');
		vReg=dataArray[2].split('~');
		vListingid=dataArray[3].split('~');
		
		new_start=start;
		new_end=increment;
		listings_length=vadd.length;	
		//alert('First listings_length');
		//alert(listings_length);
		//alert('listings');
		//alert(vListingid);
		for(var i=0;i<listings_length;i++) 
		{
			listings[i]=new Array();
			listings[i][0]=vadd[i];
			listings[i][1]=vArea[i];
			listings[i][2]=vReg[i];
			listings[i][3]=vListingid[i];
		}

    }
    }
    
    if(bflgpgload == 'false')
	{
        var stropenhselist="";
      
      if(data.indexOf("criteria")==-1){  
        if((link_type1 == "Man_MostViewedNow" || link_type1 == "Man_MostViewedThisWeek"  && spanel1 == 1) || (link_type1 == "Hmp_MostViewedNow" || link_type1 == "Hmp_MostViewedThisWeek"  && spanel1 == 1) ||   (link_type1 == "pmb_MostViewedNow" || link_type1 == "pmb_MostViewedThisWeek"  && spanel1 == 1)||
         (link_type1 == "Brk_MostViewedNow" || link_type1 == "Brk_MostViewedThisWeek" && spanel1 == 1)||
         (link_type2 == "Man_MostViewedNow" || link_type2 == "Man_MostViewedThisWeek" && spanel2 == 2 && spanel1 == 0)|| (link_type2 == "Hmp_MostViewedNow" || link_type2 == "Hmp_MostViewedThisWeek" && spanel2 == 2 && spanel1 == 0) || (link_type2 == "pmb_MostViewedNow" || link_type2 == "pmb_MostViewedThisWeek" && spanel2 == 2 && spanel1 == 0) ||
	     (link_type2 == "Brk_MostViewedNow" ||link_type2 == "Brk_MostViewedThisWeek" && spanel2 == 2 && spanel1 == 0) ||
	     (link_type3 == "Man_MostViewedNow" || link_type3 == "Man_MostViewedThisWeek" && spanel3 == 3 && spanel1 == 0 && spanel2 == 0)|| (link_type3 == "Brk_MostViewedNow" || link_type3 == "Brk_MostViewedThisWeek" && spanel3 == 3 && spanel1 == 0 && spanel2 == 0) ||  (link_type3 == "Hmp_MostViewedNow" || link_type3 == "Hmp_MostViewedThisWeek" && spanel3 == 3 && spanel1 == 0 && spanel2 == 0)|| (link_type3 == "pmb_MostViewedNow" || link_type3 == "pmb_MostViewedThisWeek" && spanel3 == 3 && spanel1 == 0 && spanel2 == 0))
	    {
        //open house string
	    switch(listings_length)
	    {
	    case 1:
	    {
	        if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 2:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 3:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
               if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
               else
                stropenhselist+="<table width=\"251\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 4:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers") 
                stropenhselist+="<table width=\"246\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 5:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    case 6:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                 stropenhselist+="<table width=\"251\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 7:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 8:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 9:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"254\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    default:
	    {
	     if(spanel1 == 1){
		    stropenhselist+="<table width=\"242\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
        }
        else if(spanel2 == 2){
        stropenhselist+="<table width=\"252\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
        }
        else if (spanel3 == 3) {
        if(document.URL.toLowerCase().match("cmembers") == "cmembers")
            stropenhselist+="<table width=\"246\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
        else
            stropenhselist+="<table width=\"251\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
        }
	    }
	    break;
	    }
	    
	    
       var k1 = 0;
       //stropenhselist+="<tr><td>&nbsp;</td></tr>";
       for(var k=0;k<listings_length;k++) {
       k1 ++;
       if(k == 0){
        if(listings[k][0] != null && listings[k][0] != ""){
        stropenhselist+="<tr class=\"text10px\" style=\"padding-top:1px\">";
        stropenhselist+="<td width=\"6%\" bgcolor=\"#FFFFFF\" ><div align=\"center\" valign=\"top\"><strong>"+k1+"</strong></div></td>";
	    stropenhselist+="<td style=\"padding-left:5px;\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a style=\"text-decoration:none\" href='/property/listing.aspx?Region="+listings[k][2]+"&ListingID="+listings[k][3]+"&OhDat="+"'><font color=\"white\">"+ReduceAddrLength(listings[k][0])+","+ReduceAddrLength(listings[k][1])+"</font></a></td>";
        //stropenhselist+="<td  style=\"padding-left:2px;\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"top\"><font color=\"white\">";
        //stropenhselist+=ReduceAddrLength(listings[k][1])+"</font></td>";
        stropenhselist+="</tr>";
        }
        }
        else
        {
          if(listings[k][0] != null && listings[k][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
        stropenhselist+="<td width=\"6%\" bgcolor=\"#FFFFFF\" style=\"padding-top:0px\"><div align=\"center\" valign=\"top\"><strong>"+k1+"</strong></div></td>";
	    stropenhselist+="<td  style=\"padding-left:5px;padding-top:0px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\"  align=\"left\" valign=\"middle\"><font color=\"white\">";
        stropenhselist+="<a style=\"text-decoration:none\" href='/property/listing.aspx?Region="+listings[k][2]+"&ListingID="+listings[k][3]+"&OhDat="+"'><font color=\"white\">"+ReduceAddrLength(listings[k][0])+","+ReduceAddrLength(listings[k][1])+"</font></a></td>";
        //stropenhselist+="<td  style=\"padding-left:2px;padding-top:0px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\"><font color=\"white\">";
        //stropenhselist+=ReduceAddrLength(listings[k][1])+"</font></td>";
        stropenhselist+="</tr>";
        }
        }
        
        }
         stropenhselist+="</table>";
         
         vgstrOpenhseList = stropenhselist;
        /*
        if(listings[1][0] != null && listings[1][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[1][2]+"&ListingID="+listings[1][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[1][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[1][1]+"</font></td>";
        stropenhselist+="</tr>";
        }
        
        if(listings[2][0] != null && listings[2][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[2][2]+"&ListingID="+listings[2][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[2][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[2][1]+"</font></td></tr>";
        }
        
        if(listings[3][0] != null && listings[3][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[3][2]+"&ListingID="+listings[3][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[3][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[3][1]+"</font></td></tr>";
        }
        
        if(listings[4][0] != null && listings[4][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[4][2]+"&ListingID="+listings[4][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[4][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[4][1]+"</font></td></tr>";
        }
        
        if(listings[5][0] != null && listings[5][0] != ""){
        
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[5][2]+"&ListingID="+listings[5][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[5][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[5][1]+"</font></td></tr>";
        }
        
        if(listings[6][0] != null && listings[6][0] != ""){
       
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[6][2]+"&ListingID="+listings[6][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[6][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[6][1]+"</font></td></tr>";
        }
        
        
        if(listings[7][0] != null && listings[7][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[7][2]+"&ListingID="+listings[7][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[7][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[7][1]+"</font></td></tr>";
        }
        
        if(listings[8][0] != null && listings[8][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[8][2]+"&ListingID="+listings[8][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[8][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[8][1]+"</font></td></tr>";
        }
        
        if(listings[9][0] != null && listings[9][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[9][2]+"&ListingID="+listings[9][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[9][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[9][1]+"</font></td></tr>";
        }
        */
       
        }
        }
		/* if(spanel1 == 1){
		    s+="<table width=\"242\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";
        }
        else
            s+="<table width=\"250\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";
        */
       
        //if(link_type1 == "Man_OpenhseListings")

	   if(spanel1 == 1)
	   {
	     ////alert('spanel1 is ONE');
	     ////alert(link_type1);
	    if(link_type1 == "Man_NewestListings" || link_type1 == "Brk_NewestListings" ||
	       link_type1 == "Hmp_NewestListings" || link_type1 == "pmb_NewestListings")
	    {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	      {
	        document.getElementById('div1').style.overflowY = 'hidden';
	        //showtableid.innerHTML = s;
	        if(data.indexOf("criteria")!=-1)
	            setNewListHtmltable(link_type1,1,0);
	        else
	            setNewListHtmltable(link_type1,1,1);
          }
	     
	    }
	    else if(link_type1 == "Man_FeaturedListings" || link_type1 == "Brk_FeaturedListings" ||
	            link_type1 == "Hmp_FeaturedListings" || link_type1 == "pmb_FeaturedListings")
	    {
	       if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = s;
	       if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type1,1,0);
	       else
	        setFeaturedListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_OpenhseListings" || link_type1 == "Brk_OpenhseListings" ||
	             link_type1 == "Hmp_OpenhseListings" || link_type1 == "pmb_OpenhseListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = stropenhselist;
	       if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type1,1,0);
	       else
	        setOpenhseListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_MostViewedNow" || link_type1 == "Brk_MostViewedNow" ||
	             link_type1 == "Hmp_MostViewedNow" || link_type1 == "pmb_MostViewedNow") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type1,1,0);	       
	      else
	        setMviewedListHtmltable(link_type1,1,1);
	      ////alert('in MOSTVIEWED IF TRUE');
	      ////alert(showtableid.innerHTML);
	     }
	    }
	    else if (link_type1 == "Man_MostViewedThisWeek" || link_type1 == "Brk_MostViewedThisWeek" ||
	             link_type1 == "Hmp_MostViewedThisWeek" || link_type1 == "pmb_MostViewedThisWeek") {
	    //alert('in MOSTVIEWED THIS WEEK');
	    //alert(stropenhselist);
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1){
	      //alert('in Criteria error');
	        setMvwThiswkListHtmltable(link_type1,1,0);
	        }
	      else
	        setMvwThiswkListHtmltable(link_type1,1,1);
	      ////alert('in MOSTVIEWED THIS WEEK IF TRUE');
	      ////alert(showtableid.innerHTML);
	     }
	    }
	    spanel1 = 0;
	   }
	   else if (spanel2 == 2) 
	   {
	     ////alert('spanel2 IS TWO');
	     ////alert(link_type2);
	    if(link_type2 == "Man_NewestListings" || link_type2 == "Brk_NewestListings" ||
	       link_type2 == "Hmp_NewestListings" || link_type2 == "pmb_NewestListings")
	     {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid2)
	     {
	    
	      document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setNewListHtmltable(link_type2,2,0);
	      else
	        setNewListHtmltable(link_type2,2,1);
	     }
	     
	    }
	    else if(link_type2== "Man_FeaturedListings" || link_type2== "Brk_FeaturedListings" ||
	            link_type2== "Hmp_FeaturedListings" || link_type2== "pmb_FeaturedListings")
	    {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid2)
	     {
	      document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type2,2,0);
	      else
	        setFeaturedListHtmltable(link_type2,2,1);
	     }
	    }
	    else if (link_type2 == "Man_OpenhseListings" || link_type2 == "Brk_OpenhseListings" ||
	             link_type2 == "Hmp_OpenhseListings" || link_type2 == "pmb_OpenhseListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid2)
	     {
	      document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type2,2,0); 
	      else
	        setOpenhseListHtmltable(link_type2,2,1); 
	     }
	    }
	    else if (link_type2 == "Man_MostViewedNow" || link_type2 == "Brk_MostViewedNow" ||
	             link_type2 == "Hmp_MostViewedNow" || link_type2 == "pmb_MostViewedNow") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid2)
	     {
	      document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type2,2,0);
	      else
	        setMviewedListHtmltable(link_type2,2,1);
	     }
	    }
	    else if (link_type2 == "Man_MostViewedThisWeek" || link_type2 == "Brk_MostViewedThisWeek" ||
	             link_type2 == "Hmp_MostViewedThisWeek" || link_type2 == "pmb_MostViewedThisWeek") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      ////alert('in most viewed this week');
	      ////alert(stropenhselist);
	      if(showtableid2)
	     {
	      document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMvwThiswkListHtmltable(link_type2,2,0);
	      else
	        setMvwThiswkListHtmltable(link_type2,2,1);
	     }
	    }
	    spanel2 = 0;
	   }
	   else if (spanel3 == 3) 
	   {
	    //////alert('spanel3 IS THREE');
	    //////alert(link_type3);
	    if(link_type3 == "Man_NewestListings" ||link_type3 == "Brk_NewestListings" ||
	       link_type3 == "Hmp_NewestListings" || link_type3 == "pmb_NewestListings")
	     {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setNewListHtmltable(link_type3,3,0);
	      else
	        setNewListHtmltable(link_type3,3,1);
	     }
	     
	    }
	    else if(link_type3 == "Man_FeaturedListings" || link_type3 == "Brk_FeaturedListings" ||
	            link_type3 == "Hmp_FeaturedListings" || link_type3 == "pmb_FeaturedListings")
	    {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type3,3,0);
	      else
	        setFeaturedListHtmltable(link_type3,3,1);
	     }
	    }
	    else if (link_type3 == "Man_OpenhseListings" || link_type3 == "Brk_OpenhseListings" ||
	             link_type3 == "Hmp_OpenhseListings" || link_type3 == "pmb_OpenhseListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type3,3,0);
	      else
	        setOpenhseListHtmltable(link_type3,3,1);
	     }
	    }
	    else if (link_type3 == "Man_MostViewedNow" || link_type3 == "Brk_MostViewedNow" ||
	             link_type3 == "Hmp_MostViewedNow" || link_type3 == "pmb_MostViewedNow") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type3,3,0);
	      else
	        setMviewedListHtmltable(link_type3,3,1);
	     }
	    }
	    else if (link_type3 == "Man_MostViewedThisWeek" || link_type3 == "Brk_MostViewedThisWeek" ||
	             link_type3 == "Hmp_MostViewedThisWeek" || link_type3 == "pmb_MostViewedThisWeek") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMvwThiswkListHtmltable(link_type3,3,0);
	      else
	        setMvwThiswkListHtmltable(link_type3,3,1);
	     }
	    }
	    spanel3 = 0;
	   }
	
	 if(ShowNgbhInfoTable())
	{
	ShowListingsOnMap(listings);//markers of listings in the resultset	
	}
	
	
	var tf=new GTrafficOverlay();
	
	if(_map != null)
	    _map.addOverlay(tf);
	    
	  if(bflgpgload == 'false'){
	   /* ////alert('spanel1');
	    ////alert(spanel1);
	    ////alert('spanel2');
	    ////alert(spanel2);
	    ////alert('spanel3');
	    ////alert(spanel3);
	  */
	  var vsublnktpm = "";
	    if(spanel1 != 0)
	    {
	     vsublnktpm = link_type1.substring(0,3);
            if (link_type1 != "") 
            {
            if(vsublnktpm == "Man")
            {
                 chomeborough1 = "Manhattan";
            }
            if(vsublnktpm == "Man" || vsublnktpm == "Brk")
            {
                if(vsublnktpm == "Man")
                {
                    chomeborough1 = "Manhattan";
                }  
                else if (vsublnktpm == "Brk") 
                {
                  chomeborough1 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktpm == "Hmp")
            {
                chomeborough1 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktpm == "pmb")  
            {
                 chomeborough1 = "PalmBeaches";
                 preg = "FL";
            }            
	     stype = getChomeReqType(link_type1);
	     SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
	    }
	    }
	    else if(spanel2 != 0)
	    {
	     vsublnktpm = link_type2.substring(0,3);
            if (link_type2 != "") 
            {
            if(vsublnktpm == "Man")
            {
                 chomeborough2 = "Manhattan";
            }
            if(vsublnktpm == "Man" || vsublnktpm == "Brk")
            {
                if(vsublnktpm == "Man")
                {
                    chomeborough2 = "Manhattan";
                }  
                else if (vsublnktpm == "Brk") 
                {
                  chomeborough2 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktpm == "Hmp")
            {
                chomeborough2 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktpm == "pmb")  
            {
                 chomeborough1 = "PalmBeaches";
                 preg = "FL";
            }         
	     stype = getChomeReqType(link_type2);
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }   
	    }
	    else if(spanel3 != 0)
	    {
	      vsublnktpm = link_type3.substring(0,3);
            if (link_type3 != "") 
            {
            if(vsublnktpm == "Man")
            {
                 chomeborough3 = "Manhattan";
            }
            if(vsublnktpm == "Man" || vsublnktpm == "Brk")
            {
                if(vsublnktpm == "Man")
                {
                    chomeborough3 = "Manhattan";
                }  
                else if (vsublnktpm == "Brk") 
                {
                  chomeborough3 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktpm == "Hmp")
            {
                chomeborough3 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktpm == "pmb")  
            {
                 chomeborough3 = "PalmBeaches";
                 preg = "FL";
            }         
	     stype = getChomeReqType(link_type3);
	     SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	    }
	    }
        if(sp1 == 1 && sp2 == 2 && sp3 == 3)
        {
              flgsave = 1;
        } 
	}
	}
	else if(bflgpgload == 'true')
	{
	    ////alert(spnload1);
	    ////alert(spnload2);
	    ////alert(spnload3);
	    ////alert(link_type1);
	    ////alert(link_type2);
	    ////alert(link_type3);
	    
	    var stropenhselist="";
	
		
	 ////alert('check values');
	 ////alert(link_type1);
	 ////alert(spnload1);
	 ////alert(link_type2);
	 ////alert(spnload2);
    if(data.indexOf("criteria")==-1){	 
	    if((link_type1 == "Man_MostViewedNow" || link_type1 == "Man_MostViewedThisWeek" && spnload1 == 1) || (link_type1 == "Brk_MostViewedNow" || link_type1 == "Brk_MostViewedThisWeek" && spnload1 == 1) || (link_type1 == "Hmp_MostViewedNow" || link_type1 == "Hmp_MostViewedThisWeek" && spnload1 == 1) || (link_type1 == "pmb_MostViewedNow" || link_type1 == "pmb_MostViewedThisWeek" && spnload1 == 1)||
	       (link_type2 == "Man_MostViewedNow" || link_type2 == "Man_MostViewedThisWeek" && spnload2 == 2 && spnload1 == 0)||(link_type2 == "Brk_MostViewedNow" || link_type2 == "Brk_MostViewedThisWeek" && spnload2 == 2 && spnload1 == 0)|| (link_type2 == "Hmp_MostViewedNow" || link_type2 == "Hmp_MostViewedThisWeek" && spnload2 == 2 && spnload1 == 0) || (link_type2 == "pmb_MostViewedNow" || link_type2 == "pmb_MostViewedThisWeek" && spnload2 == 2 && spnload1 == 0)||
	       (link_type3 == "Man_MostViewedNow" || link_type3 == "Man_MostViewedThisWeek" && spnload3 == 3 && spnload1 == 0 && spnload2 == 0) || (link_type3 == "Brk_MostViewedNow" || link_type3 == "Brk_MostViewedThisWeek" && spnload3 == 3 && spnload1 == 0 && spnload2 == 0) || (link_type3 == "Hmp_MostViewedNow" || link_type3 == "Hmp_MostViewedThisWeek" && spnload3 == 3 && spnload1 == 0 && spnload2 == 0) || (link_type3 == "pmb_MostViewedNow" || 
	       link_type3 == "pmb_MostViewedThisWeek" && spnload3 == 3 && spnload1 == 0 && spnload2 == 0) )
	    {
	    //open house string
	    switch(listings_length)
	    {
	    case 1:
	    {
	     if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
        }
        break;
        case 2:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                 stropenhselist+="<table width=\"251\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
        }
        case 3:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
        }
        break;
        case 4:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
        }
        break;
        case 5:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
        }
        break;
        case 6:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
              if(document.URL.toLowerCase().match("cmembers") == "cmembers") 
                stropenhselist+="<table width=\"246\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
              else
               stropenhselist+="<table width=\"251\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">"; 
            }
        }
        break;
        case 7:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
           if(document.URL.toLowerCase().match("cmembers") == "cmembers") 
                stropenhselist+="<table width=\"246\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
           else
                stropenhselist+="<table width=\"251\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">"; 
            }
        }
        break;
        case 8:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers") 
                stropenhselist+="<table width=\"246\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
        }
        break;
        case 9:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers") 
                stropenhselist+="<table width=\"246\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
        }
        break;
       default:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers") 
                stropenhselist+="<table width=\"246\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
        }
        break;
       }
        //stropenhselist+="<tr><td>&nbsp;</td></tr>";
        var k11 = 0;
        //alert('listings_length');
        //alert(listings_length);
        for(var k1=0;k1<listings_length;k1++) {
        k11 ++;
        //stropenhselist+="<tr><td>&nbsp;</td></tr>";
        if(listings[k1][0] != null && listings[k1][0] != ""){
        if(k1 == 0)
        {
        stropenhselist+="<tr class=\"text10px\" style=\"padding-top:1px\">";
        stropenhselist+="<td width=\"6%\" bgcolor=\"#FFFFFF\"><div align=\"center\" valign=\"top\"><strong>"+k11+"</strong></div></td>";
	    stropenhselist+="<td style=\"padding-left:5px;\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\" style=\"padding-top:0px\"><font color=\"white\">";
        stropenhselist+="<a style=\"text-decoration:none\" href='/property/listing.aspx?Region="+listings[k1][2]+"&ListingID="+listings[k1][3]+"&OhDat="+"' class=\"\"><font color=\"white\">"+ReduceAddrLength(listings[k1][0])+","+ReduceAddrLength(listings[k1][1])+"</font></a></td>";
       // stropenhselist += "<a href='#' style=\"text-decoration:none\">Link Click</a>";
        //stropenhselist+="<td style=\"padding-left:2px;\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\" style=\"padding-top:0px\"><font color=\"white\">";
        //stropenhselist+=ReduceAddrLength(listings[k1][1])+"</font></td>";
        stropenhselist+="</tr>";
        }
        else
        {
        stropenhselist+="<tr class=\"text10px\">";
        stropenhselist+="<td width=\"6%\"  bgcolor=\"#FFFFFF\" style=\"padding-top:0px\"><div align=\"center\" valign=\"top\"><strong>"+k11+"</strong></div></td>";
	    stropenhselist+="<td style=\"padding-left:5px;padding-top:0px\"\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\"><font color=\"white\">";
        stropenhselist+="<a style=\"text-decoration:none\" href='/property/listing.aspx?Region="+listings[k1][2]+"&ListingID="+listings[k1][3]+"&OhDat="+"' class=\"\"><font color=\"white\">"+ReduceAddrLength(listings[k1][0])+","+ReduceAddrLength(listings[k1][1])+"</font></a></td>";
        //stropenhselist+="<td style=\"padding-left:2px;\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\" style=\"padding-top:0px\"><font color=\"white\">";
        //stropenhselist+=ReduceAddrLength(listings[k1][1])+"</font></td>";
        stropenhselist+="</tr>";
        }
        }
        }
       stropenhselist+="</table>";
       //alert('stropenhselist');
       //alert(stropenhselist);
       vgstrOpenhseList = stropenhselist;
       /* if(listings[0][0] != null && listings[0][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;margin-top:15px\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[0][2]+"&ListingID="+listings[0][3]+"&OhDat="+"' class=\"graylink\"> <font color=\"white\">"+listings[0][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;margin-top:15px\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[0][1]+"</font></td>";
        stropenhselist+="</tr>";
        }
        
        if(listings[1][0] != null && listings[1][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[1][2]+"&ListingID="+listings[1][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[1][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[1][1]+"</font></td>";
        stropenhselist+="</tr>";
        }
        
        if(listings[2][0] != null && listings[2][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[2][2]+"&ListingID="+listings[2][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[2][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[2][1]+"</font></td></tr>";
        }
        
        if(listings[3][0] != null && listings[3][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[3][2]+"&ListingID="+listings[3][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[3][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[3][1]+"</font></td></tr>";
        }
        if(listings[4][0] != null && listings[4][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[4][2]+"&ListingID="+listings[4][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[4][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[4][1]+"</font></td></tr>";
        }
        
        if(listings[5][0] != null && listings[5][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[5][2]+"&ListingID="+listings[5][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[5][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[5][1]+"</font></td></tr>";
        }
        
        if(listings[6][0] != null && listings[6][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[6][2]+"&ListingID="+listings[6][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[6][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[6][1]+"</font></td></tr>";
        }
        
        if(listings[7][0] != null && listings[7][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[7][2]+"&ListingID="+listings[7][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[7][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[7][1]+"</font></td></tr>";
        }
        if(listings[8][0] != null && listings[8][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[8][2]+"&ListingID="+listings[8][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[8][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[8][1]+"</font></td></tr>";
        }
        
        if(listings[9][0] != null && listings[9][0] != ""){
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[9][2]+"&ListingID="+listings[9][3]+"&OhDat="+"' class=\"graylink\"><font color=\"white\">"+listings[9][0]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[9][1]+"</font></td></tr>";
        }
        */
        
        
        ////alert('stropenhselist');
        ////alert(stropenhselist);
        }
       }
	   if(spnload1 == 1)
	   {
	   
	     if(link_type1 == "Man_NewestListings" || link_type1 == "Brk_NewestListings" ||
	        link_type1 == "Hmp_NewestListings" || link_type1 == "pmb_NewestListings")
	     {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      //alert('showtableid in PANEL 1');
	      //alert(showtableid.id);
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setNewListHtmltable(link_type1,1,0);
	      else
	        setNewListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_FeaturedListings" || link_type1 == "Brk_FeaturedListings" ||
	             link_type1 == "Hmp_FeaturedListings" || link_type1 == "pmb_FeaturedListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type1,1,0);
	      else
	        setFeaturedListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_OpenhseListings" || link_type1 == "Brk_OpenhseListings" ||
	             link_type1 == "Hmp_OpenhseListings" || link_type1 == "pmb_OpenhseListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type1,1,0);
	      else
	        setOpenhseListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_MostViewedNow" || link_type1 == "Brk_MostViewedNow" ||
	             link_type1 == "Hmp_MostViewedNow" || link_type1 == "pmb_MostViewedNow"   ) {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      if(document.getElementById('div1'))
	        document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type1,1,0);
	      else
	        setMviewedListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_MostViewedThisWeek" || link_type1 == "Brk_MostViewedThisWeek" ||
	             link_type1 == "Hmp_MostViewedThisWeek" || link_type1 == "pmb_MostViewedThisWeek") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	        if(document.getElementById('div1'))document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = stropenhselist;
	       if(data.indexOf("criteria")!=-1)
	        setMvwThiswkListHtmltable(link_type1,1,0);
	       else
	        setMvwThiswkListHtmltable(link_type1,1,1);
	     }
	    }
	    spnload1 = 0;
	   }
	   else if (spnload2 == 2) 
	   {
	    //alert('spnload2');
	    //alert(spnload2);
	    //alert(showtableid2);
	     if(link_type2 == "Man_NewestListings" ||link_type2 == "Brk_NewestListings" ||
	        link_type2 == "Hmp_NewestListings" || link_type2 == "pmb_NewestListings" )
	     {
	      if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	      {
	        if(document.getElementById('div2'))document.getElementById('div2').style.overflowY = 'hidden';
	        //showtableid2.innerHTML = s;
	        if(data.indexOf("criteria")!=-1)
	            setNewListHtmltable(link_type2,2,0);
	        else
	            setNewListHtmltable(link_type2,2,1);
	      }
	    }
	    else if (link_type2 == "Man_FeaturedListings" || link_type2 == "Brk_FeaturedListings" ||
	             link_type2 == "Hmp_FeaturedListings" || link_type2 == "pmb_FeaturedListings") {
	    
	     if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	     {
	      if(document.getElementById('div2'))document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type2,2,0);
	      else
	        setFeaturedListHtmltable(link_type2,2,1);
	     }
	    }
	    else if (link_type2 == "Man_OpenhseListings" || link_type2 == "Brk_OpenhseListings" ||
	             link_type2 == "Hmp_OpenhseListings" || link_type2 == "pmb_OpenhseListings") {
	     if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	     {
	      if(document.getElementById('div2'))document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type2,2,0);
	      else
	        setOpenhseListHtmltable(link_type2,2,1);
	     }
	    }
	    else if (link_type2 == "Man_MostViewedNow" || link_type2 == "Brk_MostViewedNow" ||
	             link_type2 == "Hmp_MostViewedNow" || link_type2 == "pmb_MostViewedNow") {
	    if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	     {
	      if(document.getElementById('div2'))document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type2,2,0);
	      else
	        setMviewedListHtmltable(link_type2,2,1);
	     }
	    }
	     else if (link_type2 == "Man_MostViewedThisWeek" || link_type2 == "Brk_MostViewedThisWeek" ||
	              link_type2 == "Hmp_MostViewedThisWeek" || link_type2 == "pmb_MostViewedThisWeek") {
	    if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	     {
	      if(document.getElementById('div2'))document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMvwThiswkListHtmltable(link_type2,2,0);
	      else
	        setMvwThiswkListHtmltable(link_type2,2,1);
	     }
	    }
	    
	    spnload2 = 0;
	   }
	   else if (spnload3 == 3) 
	   {
	   
	    if(link_type3 == "Man_NewestListings" || link_type3 == "Brk_NewestListings" ||
	       link_type3 == "Hmp_NewestListings" || link_type3 == "pmb_NewestListings")
	     {
	      if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	      {
	       if(document.getElementById('div3'))document.getElementById('div3').style.overflowY = 'hidden';
	       //showtableid3.innerHTML = s;
	       if(data.indexOf("criteria")!=-1)
	        setNewListHtmltable(link_type3,3,0);
	       else
	        setNewListHtmltable(link_type3,3,1);
	      }
	    }
	   else if (link_type3 == "Man_FeaturedListings" || link_type3 == "Brk_FeaturedListings" ||
	            link_type3 == "Hmp_FeaturedListings" || link_type3 == "pmb_FeaturedListings") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	      if(document.getElementById('div3'))document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type3,3,0);
	      else
	        setFeaturedListHtmltable(link_type3,3,1);
	     }
	    }
	    else if (link_type3 == "Man_OpenhseListings" || link_type3 == "Brk_OpenhseListings" ||
	             link_type3 == "Hmp_OpenhseListings" || link_type3 == "pmb_OpenhseListings") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	      if(document.getElementById('div3'))document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type3,3,0);
	      else
	        setOpenhseListHtmltable(link_type3,3,1);
	     }
	    }
	    else if (link_type3 == "Man_MostViewedNow" || link_type3 == "Brk_MostViewedNow" ||
	             link_type3 == "Hmp_MostViewedNow" || link_type3 == "pmb_MostViewedNow") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	      if(document.getElementById('div3'))document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type3,3,0);
	      else
	        setMviewedListHtmltable(link_type3,3,1);
	     }
	     }
	     else if (link_type3 == "Man_MostViewedThisWeek" || link_type3 == "Brk_MostViewedThisWeek" ||
	              link_type3 == "Hmp_MostViewedThisWeek" || link_type3 == "pmb_MostViewedThisWeek") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	      if(document.getElementById('div3'))document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMvwThiswkListHtmltable(link_type3,3,0);
	      else
	        setMvwThiswkListHtmltable(link_type3,3,1);
	     }
	     }
	    spnload3 = 0;
	   }
	   if(ShowNgbhInfoTable())
	{
	ShowListingsOnMap(listings);//markers of listings in the resultset	
	}
	
	
	var tf=new GTrafficOverlay();
	
	if(_map != null)
	    _map.addOverlay(tf);
	    
	  if(bflgpgload == 'false'){
	   /* ////alert('spanel1');
	    ////alert(spanel1);
	    ////alert('spanel2');
	    ////alert(spanel2);
	    ////alert('spanel3');
	    ////alert(spanel3);
	  */
	  
	    if(spanel1 != 0)
	    {
	     stype = getChomeReqType(link_type1);
	     SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
	    }
	    else if(spanel2 != 0)
	    {
	     stype = getChomeReqType(link_type2);
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	       
	    }
	    else if(spanel3 != 0)
	    {
	       
	     stype = getChomeReqType(link_type3);
	     SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	    }
	    
        if(sp1 == 1 && sp2 == 2 && sp3 == 3)
        {
              flgsave = 1;
        }
    }
    else
    {
    /*alert('loadpanel');
    alert(spnload1);
    alert(spnload2);
    alert(spnload3);*/
        if(spnload1 != 0)
	    {
	     stype = getChomeReqType(link_type1);
	     SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
	    }
	    else if(spnload2 != 0)
	    {
	       //alert('in MVIEWED PANEL 2');
            spstrck2 = chcookie2.split('_');
           
            if(spstrck2[0] == "Man")
            {
                 chomeborough2 = "Manhattan";
            }
          
            if(spstrck2[0] == "Man" || spstrck2[0] == "Brk")
            {
                if(spstrck2[0] == "Man")
                {
                    chomeborough2 = "Manhattan";
                }  
                else if (spstrck2[0] == "Brk") 
                {
                  chomeborough2 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(spstrck2[0] == "Hmp")
            {
                chomeborough2 = "Hamptons";
                preg = "LI";
            }
            else if(spstrck2[0] == "pmb")  
            {
                chomeborough2 = "PalmBeaches";
                 preg = "FL";
            }
            //link_type2 = chcookie2;
            //spnload2 = 2;
            spn2=2;
            //alert('linkTYPE2');
            //alert('initial'+link_type2+'check');
            if(link_type2 == "Man_FeaturedListings" || link_type2 == "Brk_FeaturedListings" ||
               link_type2 == "Hmp_FeaturedListings" || link_type2 == "pmb_FeaturedListings" ){
            if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
	         else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Manhattan_Featured.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	        else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Brooklyn_Featured.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	        else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='/mycorcoran/img/MC_Hamptons_Featured.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	        else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='/mycorcoran/img/MC_PalmBeaches_Featured.gif' width='250' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        //////alert(chomeborough2);
            stype = getChomeReqType(link_type2);
            SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
            }
            else if(link_type2 == "Man_NewestListings" || link_type2 == "Brk_NewestListings" ||
                    link_type2 == "Hmp_NewestListings" || link_type2 == "pmb_NewestListings" )
            {
             if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
	        else
	        document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='/mycorcoran/img/MC_Manhattan_NewestListings.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='/mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2'))
	         {
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
	         else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='/mycorcoran/img/MC_Hamptons_NewestListings.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='/mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	     stype = getChomeReqType(link_type2);
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }
	     else if(link_type2 == "Man_OpenhseListings" || link_type2 == "Brk_OpenhseListings" ||
	             link_type2 == "Hmp_OpenhseListings" || link_type2 == "pmb_OpenhseListings"   )
            {
             if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	        else
	        document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='/mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='250' border='0' align='top'></a></font>";    
	        }
	        } 
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	        else
                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='/mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='250' border='0' align='top'></a></font>";    	        
	        }
	        }
	     stype = getChomeReqType(link_type2);
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }
	     else if(link_type2 == "Man_MostViewedNow" || link_type2 == "Brk_MostViewedNow" ||
	             link_type2 == "Hmp_MostViewedNow" || link_type2 == "pmb_MostViewedNow")
         {
            ////alert('in most viewed now');
             if(chomeborough2 == "Manhattan")
            {////alert('in most viewed now');
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
	         else
                   document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='250' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	        else
	        document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='250' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	         else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='250' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	     stype = getChomeReqType(link_type2);
	     ////alert('in most viewed now stype');
	     ////alert(stype);
	     
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }
	     else if(link_type2 == "Man_MostViewedThisWeek" || link_type2 == "Brk_MostViewedThisWeek" ||
	             link_type2 == "Hmp_MostViewedThisWeek" || link_type2 == "pmb_MostViewedThisWeek")
         {
            ////alert('in most viewed now');
             if(chomeborough2 == "Manhattan")
            {////alert('in most viewed now');
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
	        else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	          else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='250' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
	         else
	             document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='250' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	         else
	                 document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='250' border='0' align='top'></a></font>";    	        	            
	        }
	        } 
	     stype = getChomeReqType(link_type2);
	     ////alert('in most viewed now stype');
	     ////alert(stype);
	     
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }
	    }
	    else if(spnload3 != 0)
	    {
	    
            spstrck3 = chcookie3.split('_');
           
            if(spstrck3[0] == "Man")
            {
                 chomeborough3 = "Manhattan";
            }
          
            if(spstrck3[0] == "Man" || spstrck3[0] == "Brk")
            {
                if(spstrck3[0] == "Man")
                {
                    chomeborough3 = "Manhattan";
                }  
                else if (spstrck3[0] == "Brk") 
                {
                  chomeborough3 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(spstrck3[0] == "Hmp")
            {
                preg = "LI";
                chomeborough3 = "Hamptons";
            }
            else if(spstrck3[0] == "pmb")  
            {
                 preg = "FL";
                 chomeborough3 = "PalmBeaches";
            }
            //link_type3 = chcookie3;
            //spnload3 = 3;
            spn3=3;
           
            if(link_type3 == "Man_FeaturedListings" || link_type3 == "Brk_FeaturedListings" ||
               link_type3 == "Hmp_FeaturedListings" || link_type3 == "pmb_FeaturedListings" ){
            if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
	            else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Manhattan_Featured.gif' width='251' border='0' align='top'></a></font>";    
	         else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Manhattan_Featured.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Brooklyn_Featured.gif' width='251' align='top'></a></font>";    	        
             else
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Brooklyn_Featured.gif' width='249' align='top'></a></font>";    	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
            
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='/mycorcoran/img/MC_Hamptons_Featured.gif' width='251' border='0' align='top'></a></font>";    	        
             else
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='/mycorcoran/img/MC_Hamptons_Featured.gif' width='249' border='0' align='top'></a></font>";    	        
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	         else{
	        if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='/mycorcoran/img/MC_PalmBeaches_Featured.gif' width='251' border='0' align='top'></a></font>";    
	        else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='/mycorcoran/img/MC_PalmBeaches_Featured.gif' width='249' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        }
            //////alert(chomeborough3);        
            stype = getChomeReqType(link_type3);
            SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if (link_type3 == "Man_NewestListings" || link_type3 == "Brk_NewestListings" ||
                     link_type3 == "Hmp_NewestListings" || link_type3 == "pmb_NewestListings")
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='/mycorcoran/img/MC_Manhattan_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	         
             else
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='/mycorcoran/img/MC_Manhattan_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	         
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
	         else{
                 if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))   
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='/mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	         	         
                 else                 
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='/mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	         	         
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))        
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='/mycorcoran/img/MC_Hamptons_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	         	        
             else                   
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='/mycorcoran/img/MC_Hamptons_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	         	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))        
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='/mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	         	        
             else
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='/mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	         	        
	        
	        }
	        }
	        }
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	       }
	        else if (link_type3 == "Man_OpenhseListings" || link_type3 == "Brk_OpenhseListings" ||
	                 link_type3 == "Hmp_OpenhseListings" || link_type3 == "pmb_OpenhseListings"   )
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3'))
                {
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    	         
	         else
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    	         
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    	         
             else
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    	         
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	          if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	          else
	          {
                if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='/mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    	         	        
                else
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='/mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    	         	        
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	         else{
                if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                   document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='/mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    	         	         
                else
                   document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='/mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    	         	         
	        }
	        }
	        }
	        
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	       }
	        else if(link_type3 == "Man_MostViewedNow" || link_type3 == "Brk_MostViewedNow" ||
	                link_type3 == "Hmp_MostViewedNow" || link_type3 == "pmb_MostViewedNow")
            {
            ////alert('in hamptons mviewed now');
              if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
                if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
	            else{
	                if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	                   document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	                         	            
	                 else   
	                   document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	                         	            
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	         else{
                if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	                         	            	         
                else
                    document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	                         	            	         
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
	            else{
	            if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	                         	            
	            else
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	                         	            
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	          if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	          else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	          document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	                         	            
	         else 
	          document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	                         	            
	        }
	        }
	        }
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if(link_type3 == "Man_MostViewedThisWeek" || link_type3 == "Brk_MostViewedThisWeek" ||
                    link_type3 == "Hmp_MostViewedThisWeek" || link_type3 == "pmb_MostViewedThisWeek")
            {
              if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
	            else{
                    if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                        document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	                         	            	            
                    else    
                        document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	                         	            	            
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	                         	            	            
	         else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	                         	            	            
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
               document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	                         	            	            
             else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	                         	            	            
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	         else{
	           if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != "")) 
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	                         	            	            
	            else
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	                         	            	            
	        
	        }
	        }
	        }
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
	    }
        if(spn1 == 1 && spn2 == 2 && spn3 == 3)
        {
              flgsave = 1;
        }
    }
	}
    }
}

function ProcessCHomeNewListing(data)
{
    //alert('ProcessCHomeNewListing');
    //alert(data);
    var		searchResults = document.getElementById('TblSearchResults');
	var		searchTable = document.getElementById('TblSearch');
	var		searchResultsDiv = document.getElementById('TblSearchResults_div');
	var 	searchopt = document.getElementById('searchOptions_td');//the show options TD
	var 	sortopt = document.getElementById('sortoptions_td');	
	var		dataArray = new Array();
	var		resultsHtml = "";
	var		nolistings="";
  	
	//get each field for all listings
	var		listings = new Array();
	var		webid =new Array();
	var		RentSale=new Array();
	var		Photo1=new Array();
	var		Beds=new Array();
	var		Baths=new Array();
	var		Units=new Array();
	var		Floors=new Array();
	var		PropertyType=new Array();
	var		Rooms=new Array();
	var		Price=new Array();
	var		SqFt=new Array();
	var		address=new Array();
	var		Doorman=new Array();
	var		InContract=new Array();
	var		Outdoor=new Array();	
	var		longitude=new Array();
	var		latitude=new Array();
	var		ngbhood=new Array();
	var		zip=new Array();
	var		listingData=new Array();
	var		ohinfo=new Array();
	var     ohHit = new Array();
	var     ohLot = new Array();
	var     ohSky = new Array();
	var     ohdate = new Array();
	var     vReg   = new Array();
	
	var 	listings_length;
	var 	new_start;
	var		new_endt;
	
	clearMap();
	if(_map != null){
	_map.addOverlay(trafficInfo);
	}
	if(data.indexOf("criteria")!=-1){
		//reset counters
		total_listings="0";
		start=0;
		increment=50;
		new_start=start;
		new_end=increment;
		//display message
		nolistings=data;
		//var isSet=NeighborhoodDropDown();
		//if(isSet==true){sortopt.innerHTML = ReturnSortOptionsHtml(total_listings,new_start,new_end);}
		resErrorHtml='<font class="text12px" color="White">'+ '123456'+nolistings+'</font>';		
		
		/*alert('Panel Number in empty list');
		alert(spnload1);
		alert(spnload2);
		alert(spnload3);
		if(link_type1 != ""){
		if(document.getElementById('tbl_divload1'))
		    document.getElementById('tbl_divload1').style.display = 'none';
        if(document.getElementById('div_pnl1'))
        document.getElementById('div_pnl1').style.display = 'none';
        
        document.getElementById('tbl_errorp1').style.display = 'block';
        document.getElementById('div_error1').style.display = 'block';
       }
       if(link_type2 != ""){
		if(document.getElementById('tbl_divload2'))
		    document.getElementById('tbl_divload2').style.display = 'none';
        if(document.getElementById('div_pnl2'))
        document.getElementById('div_pnl2').style.display = 'none';
        
        document.getElementById('tbl_errorp2').style.display = 'block';
        document.getElementById('div_error2').style.display = 'block';
       }
       if(link_type3 != ""){
		if(document.getElementById('tbl_divload3'))
		    document.getElementById('tbl_divload3').style.display = 'none';
        if(document.getElementById('div_pnl3'))
        document.getElementById('div_pnl3').style.display = 'none';
        
        document.getElementById('tbl_errorp3').style.display = 'block';
        document.getElementById('div_error3').style.display = 'block';*/
       //}
       
	}
	//else
	{
	    if(data.indexOf("criteria")==-1){
		dataArray=data.split('*$');
		var i1 = 0;
		webid =dataArray[0].split('~');	
		Photo1=dataArray[1].split('~');
		RentSale=dataArray[2].split('~');
		Beds=dataArray[3].split('~');
		Baths=dataArray[4].split('~');
		Units=dataArray[5].split('~');
		Floors=dataArray[6].split('~');
		PropertyType=dataArray[7].split('~');
		Rooms=dataArray[8].split('~');
		Price=dataArray[9].split('~');
		SqFt=dataArray[10].split('~');
		address=dataArray[11].split('~');
		Doorman=dataArray[12].split('~');
		InContract=dataArray[13].split('~');
		Outdoor=dataArray[14].split('~');	
		longitude=dataArray[15].split('~');
		latitude=dataArray[16].split('~');
		ngbhood=dataArray[17].split('~');
		zip=dataArray[18].split('~');
		total_listings=dataArray[19];		
		
		listings_length=webid.length;
		ohinfo=dataArray[20].split('~');
	
	//if(dataArray[22] != "")
		ohHit =dataArray[22].split('~');

    //if(dataArray[23] != "")		
		ohLot=dataArray[23].split('~');
		
    //if(dataArray[24] != "")				
		ohSky=dataArray[24].split('~');
		
    //if(dataArray[25] != "")				
	    ohdate=dataArray[25].split('~');
			//build the neighborhoods dropdown
	    vReg=dataArray[26].split('~');
	
		_neighborhoods=dataArray[21].split('~');		
		new_start=start;
		new_end=increment;
		//sortopt_tr.style.display='block';
		//searchopt_tr.style.display='block';
		
	
  		//organize data for each listing
		//used for continous referencing
		//alert(listings_length);
		for(var i=0;i<listings_length;i++) 
		{
			listings[i]=new Array();
			listings[i][0]=webid[i];
			listings[i][1]=Photo1[i];
			listings[i][2]=RentSale[i];
			listings[i][3]=Beds[i];
			listings[i][4]=Baths[i];
			listings[i][5]=Units[i];
			listings[i][6]=Floors[i];
			listings[i][7]=PropertyType[i];
			listings[i][8]=Rooms[i];
			listings[i][9]=Price[i];
			listings[i][10]=SqFt[i];
			listings[i][11]=address[i];
			listings[i][12]=Doorman[i];//*
			listings[i][13]=InContract[i];//*
			listings[i][14]=Outdoor[i];//*
			listings[i][15]=longitude[i];
			listings[i][16]=latitude[i];
			listings[i][17]=ngbhood[i];
			listings[i][18]=ohinfo[i];
			listings[i][19]=zip[i];			
			listings[i][20]=ohHit[i];
			listings[i][21]=ohLot[i];
			listings[i][22]=ohSky[i];
			listings[i][23]=ohdate[i];	
      listings[i][24]=vReg[i];
      
		}
  }		

	if(bflgpgload == 'false')
	{
        var s="",stropenhselist="";
        
        if(data.indexOf("criteria")==-1)
        {
         if((link_type1 == "Man_OpenhseListings" && spanel1 == 1) || (link_type1 == "Brk_OpenhseListings" && spanel1 == 1)||(link_type1 == "Hmp_OpenhseListings" && spanel1 == 1)|| (link_type1 == "pmb_OpenhseListings" && spanel1 == 1)||(link_type2 == "Man_OpenhseListings" && spanel2 == 2 && spanel1 == 0)|| (link_type2 == "Hmp_OpenhseListings" && spanel2 == 2 && spanel1 == 0) ||
          (link_type2 == "pmb_OpenhseListings" && spanel2 == 2 && spanel1 == 0) || (link_type2 == "Brk_OpenhseListings" && spanel2 == 2 && spanel1 == 0) ||(link_type3 == "Man_OpenhseListings" && spanel3 == 3 && spanel1 == 0 && spanel2 == 0) || (link_type3 == "Brk_OpenhseListings" && spanel3 == 3 && spanel1 == 0 && spanel2 == 0) || (link_type3 == "Hmp_OpenhseListings" && spanel3 == 3 && spanel1 == 0 && spanel2 == 0) ||
          (link_type3 == "pmb_OpenhseListings" && spanel3 == 3 && spanel1 == 0 && spanel2 == 0))
	    {
        
        switch(listings_length)
	    {
	    case 1:
	    {
	        if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers") 
                stropenhselist+="<table width=\"246\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 2:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
              if(document.URL.toLowerCase().match("cmembers") == "cmembers") 
                stropenhselist+="<table width=\"246\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
              else
                stropenhselist+="<table width=\"251\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 3:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
              if(document.URL.toLowerCase().match("cmembers") == "cmembers")  
                stropenhselist+="<table width=\"246\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
              else
                stropenhselist+="<table width=\"251\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 4:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")  
                stropenhselist+="<table width=\"246\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 5:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers")   
                stropenhselist+="<table width=\"246\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    case 6:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers")    
                stropenhselist+="<table width=\"246\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 7:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")    
                stropenhselist+="<table width=\"246\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 8:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers")    
                stropenhselist+="<table width=\"246\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 9:
	    {
	          if(spanel1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spanel2 == 2){
                stropenhselist+="<table width=\"252\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spanel3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")    
                stropenhselist+="<table width=\"246\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    default:
	    {
	     if(spanel1 == 1){
		    stropenhselist+="<table width=\"242\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
        }
        else if(spanel2 == 2){
        stropenhselist+="<table width=\"252\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
        }
        else if (spanel3 == 3) {
       if(document.URL.toLowerCase().match("cmembers") == "cmembers")    
            stropenhselist+="<table width=\"246\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
       else
            stropenhselist+="<table width=\"251\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";         
        }
	    }
	    break;
	    }
        //open house string
	    /* if(spanel1 == 1){
		    stropenhselist+="<table width=\"242\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:top\">";
        }
        else if(spanel2 == 2){
        stropenhselist+="<table width=\"254\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"vertical-align:top\">";
        }
        else if (spanel3 == 3) {
        stropenhselist+="<table width=\"246\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:top\">";
        }
       */
       //stropenhselist+="<tr><td>&nbsp;</td></tr>";
       for(var j1 = 0;j1 < listings_length; j1++){
        
        if(j1 == 0)
        {
        stropenhselist+="<tr class=\"text10px\" >";
	     if(document.URL.toLowerCase().match("cmembers") == "cmembers")
	        stropenhselist+="<td style=\"padding-left:5px;margin-top:8px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\"><font color=\"white\">";
         else
            stropenhselist+="<td style=\"padding-left:5px;margin-top:1px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\"><font color=\"white\">";            	        
        stropenhselist+="<a style=\"text-decoration:none\" href='/property/listing.aspx?Region="+listings[j1][24]+"&ListingID="+listings[j1][0]+"&OhDat="+listings[j1][18]+"'><font color=\"white\">"+ReduceAddrLength(listings[j1][11])+","+ReduceAddrLength(listings[j1][17])+"</font></a></td>";
//        if(document.URL.toLowerCase().match("cmembers") == "cmembers")
//            stropenhselist+="<td style=\"padding-left:5px;margin-top:8px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\"><font color=\"white\">";
//        else
//            stropenhselist+="<td style=\"padding-left:5px;margin-top:1px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\"><font color=\"white\">";
//        stropenhselist+=ReduceAddrLength(listings[j1][17])+"</font></td>";
        stropenhselist+="</tr>";
        }
        else
        {
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;margin-top:8px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\"><font color=\"white\">";
        stropenhselist+="<a style=\"text-decoration:none\" href='/property/listing.aspx?Region="+listings[j1][24]+"&ListingID="+listings[j1][0]+"&OhDat="+listings[j1][18]+"'><font color=\"white\">"+ReduceAddrLength(listings[j1][11])+","+ReduceAddrLength(listings[j1][17])+"</font></a></td>";
        //stropenhselist+="<td style=\"padding-left:5px;margin-top:8px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\"><font color=\"white\">";
        //stropenhselist+=ReduceAddrLength(listings[j1][17])+"</font></td>";
        stropenhselist+="</tr>";
        }
        }
        stropenhselist+="</table>";
        vgstrOpenhseList = stropenhselist;
        /*stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[1][24]+"&ListingID="+listings[1][0]+"&OhDat="+listings[1][18]+"' class=\"graylink\"><font color=\"white\">"+listings[1][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[1][17]+"</font></td>";
        stropenhselist+="</tr>";
        
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[2][24]+"&ListingID="+listings[2][0]+"&OhDat="+listings[2][18]+"' class=\"graylink\"><font color=\"white\">"+listings[2][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[2][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[3][24]+"&ListingID="+listings[3][0]+"&OhDat="+listings[3][18]+"' class=\"graylink\"><font color=\"white\">"+listings[3][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[3][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[4][24]+"&ListingID="+listings[4][0]+"&OhDat="+listings[4][18]+"' class=\"graylink\"><font color=\"white\">"+listings[4][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[4][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[5][24]+"&ListingID="+listings[5][0]+"&OhDat="+listings[5][18]+"' class=\"graylink\"><font color=\"white\">"+listings[5][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[5][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhsvelist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[6][24]+"&ListingID="+listings[6][0]+"&OhDat="+listings[6][18]+"' class=\"graylink\"><font color=\"white\">"+listings[6][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[6][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[7][24]+"&ListingID="+listings[7][0]+"&OhDat="+listings[7][18]+"' class=\"graylink\"><font color=\"white\">"+listings[7][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[7][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[8][24]+"&ListingID="+listings[8][0]+"&OhDat="+listings[8][18]+"' class=\"graylink\"><font color=\"white\">"+listings[8][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[8][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[9][24]+"&ListingID="+listings[9][0]+"&OhDat="+listings[9][18]+"' class=\"graylink\"><font color=\"white\">"+listings[9][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[9][17]+"</font></td></tr>";*/
        
        }
       }
       
        var vsublnk1 = link_type1.substring(4,8);//link_type1 == "Man_OpenhseListings"
        var vsublnk2 = link_type2.substring(4,8);//link_type1 == "Man_OpenhseListings"
        var vsublnk3 = link_type3.substring(4,8);//link_type1 == "Man_OpenhseListings"
        //alert('substring');
        
        //alert(vsublnk1);
        //alert(vsublnk2);
        //alert(vsublnk3);
       
       if(data.indexOf("criteria")==-1){
        if((vsublnk1 != "Open" && spanel1 == 1) || (vsublnk2 != "Open" && spanel2 == 2) ||
        (vsublnk3 != "Open" && spanel3 == 3))// || vsublnk2 != "Open" || vsublnk3 != "Open" )
        {
        //alert('Not in OPEN string');
        if(spanel1 == 1){
        //s+="<table width=\"242\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";        
		//241
		if(document.URL.toLowerCase().match("cmembers") == "cmembers")
        s+="<table width=\"241\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";		
		else
		s+="<table width=\"249\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";
        }
        else if(spanel2 == 2){
        //253
        if(document.URL.toLowerCase().match("cmembers") == "cmembers")
        s+="<table width=\"253\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"vertical-align:middle\">";        
        else
        s+="<table width=\"248\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"vertical-align:middle\">";
        }
        else if (spanel3 == 3) {
        //245
        if(document.URL.toLowerCase().match("cmembers") == "cmembers")
        s+="<table width=\"245\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:middle\">";
        else
        s+="<table width=\"251\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:middle\">";
        }
            
        s+="<tr class=\"text10px\">";
	   if(spanel1 == 1){
	    s+="<td style=\"padding-left:2px;\" align=\"center\">"; //valign=\"middle\"
	   }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:2px;\" align=\"center\">";
	    }
	    else if(spanel3 == 3){
	     s+="<td style=\"padding-left:2px;\" align=\"center\">";
	     }
	    if(listings_length > 0){
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\">";
	    s+="<img src="+listings[0][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+ReduceAddrLength([0][11])+"</font></td>";
	    }
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:2px;\" align=\"center\">";
	    }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:2px;\" align=\"center\">";
	    }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:2px;\" align=\"center\">";
	     }
	     
	    if(listings_length > 1){ 
	    s+="<a href=\"/property/listing.aspx?Region="+listings[1][24]+"&ListingID="+listings[1][0]+"&OhDat=\" class=\"graylink\" style=\"cursor:pointer;\">";
	    s+="<img src="+listings[1][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+ReduceAddrLength(listings[1][11])+"</font>";
	   }
	    s+="</td>";
	    s+="</tr>";
	    s+="<tr class=\"text10px\">";
	    
	    
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:2px;\" align=\"center\">"; //top
	    }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:2px;\" align=\"center\">";
	    }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:2px;\" align=\"center\">";
	     }
	     if(listings_length > 2){
	    s+="<a href=\"/property/listing.aspx?Region="+listings[2][24]+"&ListingID="+listings[2][0]+"&OhDat=\" class=\"graylink\" style=\"cursor:pointer;\">";
	    s+="<img src="+listings[2][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+ReduceAddrLength(listings[2][11])+"</font></td>";
	    }
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:2px;\" align=\"center\">"; //top
	    }
	     else if(spanel2 == 2){
	     s+="<td style=\"padding-left:2px;\" align=\"center\">";
	     }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:2px;\" align=\"center\">";
	      }
	    if(listings_length > 3){
	    s+="<a href=\"/property/listing.aspx?Region="+listings[3][24]+"&ListingID="+listings[3][0]+"&OhDat=\" class=\"graylink\" style=\"cursor:pointer;\">";
	    s+="<img src="+listings[3][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+ReduceAddrLength(listings[3][11])+"</font></td>";
	    s+="</tr></table>";
        }
        vgstrList = s;
        }
        /*else if(vsublnk2 != "Open")
        {
        if(spanel1 == 1){
        //s+="<table width=\"242\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";        
		s+="<table width=\"241\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";
        }
        else if(spanel2 == 2){
        s+="<table width=\"253\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"vertical-align:middle\">";
        }
        else if (spanel3 == 3) {
        s+="<table width=\"245\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:middle\">";
        }
            
        s+="<tr class=\"text10px\">";
	   if(spanel1 == 1){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">"; //valign=\"middle\"
	   }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">";
	    }
	    else if(spanel3 == 3){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	     }
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+listings[0][11]+"')\">";
	    s+="<img src="+listings[0][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+listings[0][11]+"</font></td>";
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">";
	    }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">";
	    }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	     }
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+listings[1][1]+"')\">";
	    s+="<img src="+listings[1][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+listings[1][11]+"</font></td>";
	    s+="</tr>";
	    s+="<tr class=\"text10px\">";
	    
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">"; //top
	    }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">";
	    }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	     }
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+listings[2][11]+"')\">";
	    s+="<img src="+listings[2][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+listings[2][11]+"</font></td>";
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">"; //top
	    }
	     else if(spanel2 == 2){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	     }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	      }
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+listings[3][1]+"')\">";
	    s+="<img src="+listings[3][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+listings[3][11]+"</font></td>";
	    s+="</tr></table>";
        
        vgstrList = s;
        }*/
        /*else if(vsublnk3 != "Open")
        {
        if(spanel1 == 1){
        //s+="<table width=\"242\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";        
		s+="<table width=\"241\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";
        }
        else if(spanel2 == 2){
        s+="<table width=\"253\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"vertical-align:middle\">";
        }
        else if (spanel3 == 3) {
        s+="<table width=\"245\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:middle\">";
        }
            
        s+="<tr class=\"text10px\">";
	   if(spanel1 == 1){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">"; //valign=\"middle\"
	   }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">";
	    }
	    else if(spanel3 == 3){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	     }
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+listings[0][11]+"')\">";
	    s+="<img src="+listings[0][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+listings[0][11]+"</font></td>";
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">";
	    }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">";
	    }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	     }
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+listings[1][1]+"')\">";
	    s+="<img src="+listings[1][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+listings[1][11]+"</font></td>";
	    s+="</tr>";
	    s+="<tr class=\"text10px\">";
	    
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">"; //top
	    }
	    else if(spanel2 == 2){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">";
	    }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	     }
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+listings[2][11]+"')\">";
	    s+="<img src="+listings[2][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+listings[2][11]+"</font></td>";
	    if(spanel1 == 1){
	    s+="<td style=\"padding-left:1px;\" align=\"center\">"; //top
	    }
	     else if(spanel2 == 2){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	     }
	     else if(spanel3 == 3){
	     s+="<td style=\"padding-left:1px;\" align=\"center\">";
	      }
	    s+="<a class=\"graylink\" style=\"cursor:pointer;\" onclick=\"SearchByMap('"+listings[3][1]+"')\">";
	    s+="<img src="+listings[3][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"View this listing on the map\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+listings[3][11]+"</font></td>";
	    s+="</tr></table>";
        vgstrList = s;
        }*/
        }
	
	   if(spanel1 == 1)
	   {
	   var vCkexpiryDate = "10/31/2050 00:00:00";
	   
	    if(link_type1 == "Man_NewestListings" || link_type1 == "Brk_NewestListings" ||
	       link_type1 == "Hmp_NewestListings" || link_type1 == "pmb_NewestListings")
	    {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setNewListHtmltable(link_type1,1,0);
	      else{
	     // alert('criteria not minus ONE');
	        setNewListHtmltable(link_type1,1,1);
	       }
	     }
	     
	    }
	   else if(link_type1 == "Man_FeaturedListings" || link_type1 == "Brk_FeaturedListings" ||
	            link_type1 == "Hmp_FeaturedListings" || link_type1 == "pmb_FeaturedListings")
	    {
	       if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type1,1,0);
	      else
	        setFeaturedListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_OpenhseListings" || link_type1 == "Brk_OpenhseListings" ||
	             link_type1 == "Hmp_OpenhseListings" || link_type1 == "pmb_OpenhseListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type1,1,0);
	      else
	        setOpenhseListHtmltable(link_type1,1,1);
	     }
	    }
	    spanel1 = 0;
	   }
	   else if (spanel2 == 2) 
	   {
	   if(link_type2 == "Man_NewestListings" || link_type2 == "Brk_NewestListings" ||
	       link_type2 == "Hmp_NewestListings" || link_type2 == "pmb_NewestListings")
	     {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid2)
	     {
	    
	      document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setNewListHtmltable(link_type2,2,0);
	      else
	        setNewListHtmltable(link_type2,2,1);
	     }
	    }
	    else if(link_type2== "Man_FeaturedListings" || link_type2== "Brk_FeaturedListings" ||
	            link_type2== "Hmp_FeaturedListings" || link_type2== "pmb_FeaturedListings")
	    {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid2)
	     {
	      document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type2,2,0);
	      else
	        setFeaturedListHtmltable(link_type2,2,1);
	     }
	    }
	    else if (link_type2 == "Man_OpenhseListings" || link_type2 == "Brk_OpenhseListings" ||
	             link_type2 == "Hmp_OpenhseListings" || link_type2 == "pmb_OpenhseListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid2)
	     {
	      document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type2,2,0);
	      else
	        setOpenhseListHtmltable(link_type2,2,1);
	     }
	    }
	    
	    spanel2 = 0;
	   }
	   else if (spanel3 == 3) 
	   {
	    if(link_type3 == "Man_NewestListings" || link_type3 == "Brk_NewestListings" ||
	       link_type3 == "Hmp_NewestListings" || link_type3 == "pmb_NewestListings")
	     {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setNewListHtmltable(link_type3,3,0);
	      else
	        setNewListHtmltable(link_type3,3,1);
	     }
	     
	    }
	    else if(link_type3 == "Man_FeaturedListings" || link_type3 == "Brk_FeaturedListings" ||
	            link_type3 == "Hmp_FeaturedListings" || link_type3 == "pmb_FeaturedListings")
	    {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type3,3,0);
	      else
	        setFeaturedListHtmltable(link_type3,3,1);
	     }
	    }
	    else if (link_type3 == "Man_OpenhseListings" || link_type3 == "Brk_OpenhseListings" ||
	            link_type3 == "Hmp_OpenhseListings"  || link_type3 == "pmb_OpenhseListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type3,3,0);
	      else
	        setOpenhseListHtmltable(link_type3,3,1);
	     }
	    }
	    spanel3 = 0;
	   }
	 
	}
	else if(bflgpgload == 'true')
	{
	    ////alert(spnload1);
	    ////alert(spnload2);
	    ////alert(spnload3);
	    ////alert(link_type1);
	    ////alert(link_type2);
	    ////alert(link_type3);
	    var s="",stropenhselist="";
        
        if(data.indexOf("criteria")==-1){	
		 if((link_type1 == "Man_OpenhseListings" && spnload1 == 1) || (link_type1 == "Brk_OpenhseListings" && spnload1 == 1) || (link_type1 == "Hmp_OpenhseListings" && spnload1 == 1) || (link_type1 == "pmb_OpenhseListings" && spnload1 == 1) ||
	       (link_type2 == "Man_OpenhseListings" && spnload2 == 2 && spnload1 == 0)||(link_type2 == "Brk_OpenhseListings" && spnload2 == 2 && spnload1 == 0)|| (link_type2 == "Hmp_OpenhseListings" && spnload2 == 2 && spnload1 == 0) || (link_type2 == "pmb_OpenhseListings" && spnload2 == 2 && spnload1 == 0) ||
	       (link_type3 == "Man_OpenhseListings" && spnload3 == 3 && spnload1 == 0 && spnload2 == 0) || (link_type3 == "Brk_OpenhseListings" && spnload3 == 3 && spnload1 == 0 && spnload2 == 0) || (link_type3 == "Hmp_OpenhseListings" && spnload3 == 3 && spnload1 == 0 && spnload2 == 0)|| (link_type3 == "pmb_OpenhseListings" && spnload3 == 3 && spnload1 == 0 && spnload2 == 0) )
	    {
	   //alert(listings_length);
	    switch(listings_length)
	    {
	    case 1:
	    {
	        if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")    
                stropenhselist+="<table width=\"246\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"20\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 2:
	    {
	          if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"55\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 3:
	    {
	          if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"75\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 4:
	    {
	          if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"95\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 5:
	    {
	          if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"115\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    case 6:
	    {
	          if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
            if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            else
                stropenhselist+="<table width=\"251\" height=\"135\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 7:
	    {
	          if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"147\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 8:
	    {
	          if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"162\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    case 9:
	    {
	          if(spnload1 == 1){
		        stropenhselist+="<table width=\"242\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if(spnload2 == 2){
                stropenhselist+="<table width=\"252\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
            else if (spnload3 == 3) {
             if(document.URL.toLowerCase().match("cmembers") == "cmembers")
                stropenhselist+="<table width=\"246\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
             else
                stropenhselist+="<table width=\"251\" height=\"175\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
            }
	    }
	    break;
	    default:
	    {
	     if(spnload1 == 1){
		    stropenhselist+="<table width=\"242\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  style=\"vertical-align:top;margin-top:8px;\">";
        }
        else if(spnload2 == 2){
        stropenhselist+="<table width=\"252\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\" align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
        }
        else if (spnload3 == 3) {
         if(document.URL.toLowerCase().match("cmembers") == "cmembers")
            stropenhselist+="<table width=\"246\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
         else
            stropenhselist+="<table width=\"252\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"3\"  align=\"left\" style=\"vertical-align:top;margin-top:8px;\">";
        }
	    }
	    break;
	    }
	    //open house string
	    /* if(spnload1 == 1){
		    stropenhselist+="<table width=\"242\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:top\">";
        }
        else if(spnload2 == 2){
        stropenhselist+="<table width=\"254\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"vertical-align:top\">";
        }
        else if (spnload3 == 3) {
        stropenhselist+="<table width=\"246\" height=\"185\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:top\">";
        }
        */
        //stropenhselist+="<tr><td>&nbsp;</td></tr>";
        for(j11=0; j11 < listings_length ; j11++){
        if(j11 == 0){
        stropenhselist+="<tr class=\"text10px\">";
        if(document.URL.toLowerCase().match("cmembers") == "cmembers")
	        stropenhselist+="<td style=\"padding-left:5px;margin-top:8px;padding-top:0px;vertical-align:top;\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\">";
	    else
	        stropenhselist+="<td style=\"padding-left:5px;margin-top:5px;padding-top:0px;vertical-align:top;\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"middle\">";
	        
        stropenhselist+="<a style=\"text-decoration:none\" href='/property/listing.aspx?Region="+listings[j11][24]+"&ListingID="+listings[j11][0]+"&OhDat="+listings[j11][18]+"'> <font color=\"white\">"+ReduceAddrLength(listings[j11][11])+","+ReduceAddrLength(listings[j11][17])+"</font></a></td>";
//         if(document.URL.toLowerCase().match("cmembers") == "cmembers")
//            stropenhselist+="<td style=\"padding-left:5px;margin-top:8px;padding-top:0px;vertical-align:top;\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"top\"><font color=\"white\">";
//         else
//            stropenhselist+="<td style=\"padding-left:5px;margin-top:5px;padding-top:0px;vertical-align:top;\" align=\"left\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" valign=\"top\"><font color=\"white\">";
//        stropenhselist+=listings[j11][17]+"</font></td>";
        stropenhselist+="</tr>";
        }
        else
        {
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;margin-top:8px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a style=\"text-decoration:none\" href='/property/listing.aspx?Region="+listings[j11][24]+"&ListingID="+listings[j11][0]+"&OhDat="+listings[j11][18]+"'> <font color=\"white\">"+ReduceAddrLength(listings[j11][11])+","+ReduceAddrLength(listings[j11][17])+"</font></a></td>";
        //stropenhselist+="<td style=\"padding-left:5px;margin-top:8px\" onMouseOver=\"this.style.backgroundColor='#4d4d4d'\" onMouseOut=\"this.style.backgroundColor='#000000'\" align=\"left\" valign=\"top\"><font color=\"white\">";
        //stropenhselist+=ReduceAddrLength(listings[j11][17])+"</font></td>";
        stropenhselist+="</tr>";
        }
        }
        stropenhselist+="</table>";
        /*stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[1][24]+"&ListingID="+listings[1][0]+"&OhDat="+listings[1][18]+"' class=\"graylink\"><font color=\"white\">"+listings[1][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[1][17]+"</font></td>";
        stropenhselist+="</tr>";
        
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[2][24]+"&ListingID="+listings[2][0]+"&OhDat="+listings[2][18]+"' class=\"graylink\"><font color=\"white\">"+listings[2][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[2][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[3][24]+"&ListingID="+listings[3][0]+"&OhDat="+listings[3][18]+"' class=\"graylink\"><font color=\"white\">"+listings[3][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[3][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[4][24]+"&ListingID="+listings[4][0]+"&OhDat="+listings[4][18]+"' class=\"graylink\"><font color=\"white\">"+listings[4][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[4][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[5][24]+"&ListingID="+listings[5][0]+"&OhDat="+listings[5][18]+"' class=\"graylink\"><font color=\"white\">"+listings[5][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[5][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[6][24]+"&ListingID="+listings[6][0]+"&OhDat="+listings[6][18]+"' class=\"graylink\"><font color=\"white\">"+listings[6][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[6][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[7][24]+"&ListingID="+listings[7][0]+"&OhDat="+listings[7][18]+"' class=\"graylink\"><font color=\"white\">"+listings[7][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[7][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[8][24]+"&ListingID="+listings[8][0]+"&OhDat="+listings[8][18]+"' class=\"graylink\"><font color=\"white\">"+listings[8][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[8][17]+"</font></td></tr>";
        stropenhselist+="<tr class=\"text10px\">";
	    stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+="<a href='/property/listing.aspx?Region="+listings[9][24]+"&ListingID="+listings[9][0]+"&OhDat="+listings[9][18]+"' class=\"graylink\"><font color=\"white\">"+listings[9][11]+"</font></a></td>";
        stropenhselist+="<td style=\"padding-left:5px;\" align=\"left\" valign=\"top\"><font color=\"white\">";
        stropenhselist+=listings[9][17]+"</font></td></tr>";*/
        ////alert('stropenhselist');
        ////alert(stropenhselist);
        vgstrOpenhseList = stropenhselist;
        }
        else
        {
        if(spnload1 == 1){
        //242
        if(document.URL.toLowerCase().match("cmembers") == "cmembers")
        s+="<table width=\"242\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";        
        else
		s+="<table width=\"249\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  style=\"vertical-align:middle\">";
        }
        else if(spnload2 == 2){
        //254
        if(document.URL.toLowerCase().match("cmembers") == "cmembers")
        s+="<table width=\"254\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"vertical-align:middle\">";        
        else
        s+="<table width=\"248\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"left\" style=\"vertical-align:middle\">";
        }
        else if (spnload3 == 3) {
        //246
        if(document.URL.toLowerCase().match("cmembers") == "cmembers")
        s+="<table width=\"246\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:middle\">";        
        else
        s+="<table width=\"251\" height=\"200\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  align=\"left\" style=\"vertical-align:middle\">";
        }
            
        s+="<tr class=\"text10px\">";
	    s+="<td style=\"padding-left:2px;\" align=\"center\">";
	    if(listings_length > 0){
	    s+="<a href=\"/property/listing.aspx?Region="+listings[0][24]+"&ListingID="+listings[0][0]+"&OhDat=\" class=\"graylink\" style=\"cursor:pointer;\">";
	    s+="<img src="+listings[0][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='113' height='63' border='0'></a><br>";
	  	}
	    if(listings_length > 1){
	    s+="<font color=\"white\">"+ReduceAddrLength(listings[0][11])+"</font></td><td style=\"padding-left:1px;\" align=\"center\">";
	    s+="<a href=\"/property/listing.aspx?Region="+listings[1][24]+"&ListingID="+listings[1][0]+"&OhDat=\" class=\"graylink\" style=\"cursor:pointer;\">";
	    s+="<img src="+listings[1][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+ReduceAddrLength(listings[1][11])+"</font>";
	    }
	    s+="</td>";
	    s+="</tr>";

	    s+="<tr class=\"text10px\">";
	    s+="<td style=\"padding-left:2px;\" align=\"center\">";
	    if(listings_length > 2){
	    s+="<a href=\"/property/listing.aspx?Region="+listings[2][24]+"&ListingID="+listings[2][0]+"&OhDat=\" class=\"graylink\" style=\"cursor:pointer;\">";
	    s+="<img src="+listings[2][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='113' height='63' border='0'></a><br>";
	  	
	    s+="<font color=\"white\">"+ReduceAddrLength(listings[2][11])+"</font></td><td style=\"padding-left:1px;\" align=\"center\">";
	  	}
	  	if(listings_length > 3){
	    s+="<a href=\"/property/listing.aspx?Region="+listings[3][24]+"&ListingID="+listings[3][0]+"&OhDat=\" class=\"graylink\" style=\"cursor:pointer;\">";
	    s+="<img src="+listings[3][1]+" style=\"border-style:solid;border-width:1px;border-color:#666666;\" alt=\"\" width='113' height='63' border='0'>";
	    s+="</a><br><font color=\"white\">"+ReduceAddrLength(listings[3][11])+"</font>";
	    }
	    
	    s+="</td>";
	    s+="</tr></table>";
	     
	 ////alert('check values');
	 ////alert(s);
	 ////alert(link_type1);
	 ////alert(spnload1);
	 ////alert(link_type2);
	 ////alert(spnload2);
	 
        vgstrList = s;
        }
        }
        /*alert('in spnload values');
        alert(spnload1);
        alert(spnload2);
        alert(spnload3);*/
        
	   if(spnload1 == 1)
	   {
	   //alert('in SPNLOAD1 First');
	  // alert(link_type1);
	     if(link_type1 == "Man_NewestListings" || link_type1 == "Brk_NewestListings" ||
	        link_type1 == "Hmp_NewestListings" || link_type1 == "pmb_NewestListings")
	     {
	      if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    {
          hidelink2.style.display='block';
	      }
	      //if(showtableid)
	     {
	      if(document.getElementById('div1'))
	        document.getElementById('div1').style.overflowY = 'hidden';
           //showtableid.innerHTML = s;
	     //document.getElementById('div_ManNewList').innerHTML=s;
	    if(data.indexOf("criteria")!=-1)
	      setNewListHtmltable(link_type1,1,0);
	    else
	      setNewListHtmltable(link_type1,1,1);  
	     }
	    }
	    else if (link_type1 == "Man_FeaturedListings" || link_type1 == "Brk_FeaturedListings" ||
	             link_type1 == "Hmp_FeaturedListings" || link_type1 == "pmb_FeaturedListings") {
	     if(hidelink){
	      hidelink.style.display='none';
	      }
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
           if(document.getElementById('div1'))
	       document.getElementById('div1').style.overflowY = 'hidden';
	       //showtableid.innerHTML = s;
	       if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type1,1,0);
	       else
	        setFeaturedListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_OpenhseListings" || link_type1 == "Brk_OpenhseListings" ||
	             link_type1 == "Hmp_OpenhseListings" || link_type1 == "pmb_OpenhseListings") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	     if(document.getElementById('div1'))
	        document.getElementById('div1').style.overflowY = 'hidden';
	     // showtableid.innerHTML = stropenhselist;
	     if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type1,1,0);
	     else
	        setOpenhseListHtmltable(link_type1,1,1);
	     }
	    }
	     else if (link_type1 == "Man_MostViewedNow" || link_type1 == "Brk_MostViewedNow" ||
	             link_type1 == "Hmp_MostViewedNow" || link_type1 == "pmb_MostViewedNow") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      if(document.getElementById('div1'))
	         document.getElementById('div1').style.overflowY = 'hidden';
	     // showtableid.innerHTML = stropenhselist;
	     if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type1,1,0);
	     else
	        setMviewedListHtmltable(link_type1,1,1);
	     }
	    }
	    else if (link_type1 == "Man_MostViewedThisWeek" || link_type1 == "Brk_MostViewedThisWeek" ||
	             link_type1 == "Hmp_MostViewedThisWeek" || link_type1 == "pmb_MostViewedThisWeek") {
	     if(hidelink)
	      hidelink.style.display='none';
          if(hidelink2)	    
	      hidelink2.style.display='block';
	      if(showtableid)
	     {
	      if(document.getElementById('div1'))
	        document.getElementById('div1').style.overflowY = 'hidden';
	      //showtableid.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMvwThiswkListHtmltable(link_type1,1,0);
	      else
	        setMvwThiswkListHtmltable(link_type1,1,1);
	     }
	    }
	    spnload1 = 0;
	   }
	   else if (spnload2 == 2) 
	   {
	    //alert('spnload2');
	    //////alert(spnload2);
	    //////alert(showtableid2);
	     if(link_type2 == "Man_NewestListings" || link_type2 == "Brk_NewestListings" ||
	        link_type2 == "Hmp_NewestListings" || link_type2 == "pmb_NewestListings")
	     {
	      if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	      {
	      //alert('IN showtableid2');
	      
	      if(document.getElementById('div2'))
	        document.getElementById('div2').style.overflowY = 'hidden';
	        //showtableid2.innerHTML = s;
	        //alert(showtableid2.innerHTML);
	        if(data.indexOf("criteria")!=-1)
	            setNewListHtmltable(link_type2,2,0);
	        else
	            setNewListHtmltable(link_type2,2,1);
	      }
	    }
	    else if (link_type2 == "Man_FeaturedListings" || link_type2 == "Brk_FeaturedListings" ||
	             link_type2 == "Hmp_FeaturedListings" || link_type2 == "pmb_FeaturedListings") {
	    
	     if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	     {
	      if(document.getElementById('div2'))
	       document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type2,2,0);
	      else
	        setFeaturedListHtmltable(link_type2,2,1);
	     }
	    }
	    else if (link_type2 == "Man_OpenhseListings" || link_type2 == "Brk_OpenhseListings" ||
	             link_type2 == "Hmp_OpenhseListings" || link_type2 == "pmb_OpenhseListings") {
	     if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	     {
	       if(document.getElementById('div2'))
	         document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type2,2,0);
	      else
	        setOpenhseListHtmltable(link_type2,2,1);
	     }
	    }
	    else if (link_type2 == "Man_MostViewedNow" || link_type2 == "Brk_MostViewedNow" ||
	             link_type2 == "Hmp_MostViewedNow" || link_type2 == "pmb_MostViewedNow") {
	     if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	     {
	      if(document.getElementById('div2'))
	         document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type2,2,0);
	      else
	        setMviewedListHtmltable(link_type2,2,1);
	     }
	    }
	     else if (link_type2 == "Man_MostViewedThisWeek" || link_type2 == "Brk_MostViewedThisWeek" ||
	             link_type2 == "Hmp_MostViewedThisWeek" || link_type2 == "pmb_MostViewedThisWeek") {
	     if(hidelnk2)
	      hidelnk2.style.display='none';
          if(hidelnk22)	    
	      hidelnk22.style.display='block';
	      if(showtableid2)
	     {
	      if(document.getElementById('div2'))
	       document.getElementById('div2').style.overflowY = 'hidden';
	      //showtableid2.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMvwThiswkListHtmltable(link_type2,2,0);
	      else
	        setMvwThiswkListHtmltable(link_type2,2,1);
	     }
	    }
	    spnload2 = 0;
	   }
	   else if (spnload3 == 3) 
	   {
	    // alert('spnload3');
		// alert(spnload3);
		// alert(showtableid3);
	    if(link_type3 == "Man_NewestListings" || link_type3 == "Brk_NewestListings" ||
	       link_type3 == "Hmp_NewestListings" || link_type3 == "pmb_NewestListings" )
	     {
	      if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	      {
	      if(document.getElementById('div3'))
	        document.getElementById('div3').style.overflowY = 'hidden';
	       //showtableid3.innerHTML = s;
	      if(data.indexOf("criteria")!=-1)
	        setNewListHtmltable(link_type3,3,0);
	      else
	        setNewListHtmltable(link_type3,3,1);
	      }
	    }
	   else if (link_type3 == "Man_FeaturedListings" || link_type3 == "Brk_FeaturedListings" ||
	            link_type3 == "Hmp_FeaturedListings" || link_type3 == "pmb_FeaturedListings") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	     //alert('table 3 visible');
	     //alert(showtableid3.id);
	       if(document.getElementById('div3'))
	         document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = s;
	      //alert(showtableid3.innerHTML);
	      if(data.indexOf("criteria")!=-1)
	        setFeaturedListHtmltable(link_type3,3,0);
	      else
	        setFeaturedListHtmltable(link_type3,3,1);
	     }
	    }
	    /*else if (link_type3 == "Brk_FeaturedListings") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	      document.getElementById('div3').style.overflowY = 'hidden';
	      showtableid3.innerHTML = s;
	     }
	    }*/
	    else if (link_type3 == "Man_OpenhseListings" || link_type3 == "Brk_OpenhseListings" ||
	             link_type3 == "Hmp_OpenhseListings" || link_type3 == "pmb_OpenhseListings") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	      if(document.getElementById('div3'))
	       document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setOpenhseListHtmltable(link_type3,3,0);
	      else
	        setOpenhseListHtmltable(link_type3,3,1);
	     }
	    }
	    else if (link_type3 == "Man_MostViewedNow" || link_type3 == "Brk_MostViewedNow" ||
	             link_type3 == "Hmp_MostViewedNow" || link_type3 == "pmb_MostViewedNow") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	      if(document.getElementById('div3'))
	        document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMviewedListHtmltable(link_type3,3,0);
	      else
	        setMviewedListHtmltable(link_type3,3,1);
	     }
	    }
	     else if (link_type3 == "Man_MostViewedThisWeek" || link_type3 == "Brk_MostViewedThisWeek" ||
	             link_type3 == "Hmp_MostViewedThisWeek" || link_type3 == "pmb_MostViewedThisWeek") {
	     if(hidelnk3)
	      hidelnk3.style.display='none';
          if(hidelnk33)	    
	      hidelnk33.style.display='block';
	      if(showtableid3)
	     {
	      if(document.getElementById('div3'))
	        document.getElementById('div3').style.overflowY = 'hidden';
	      //showtableid3.innerHTML = stropenhselist;
	      if(data.indexOf("criteria")!=-1)
	        setMvwThiswkListHtmltable(link_type3,3,0);
	      else
	        setMvwThiswkListHtmltable(link_type3,3,1);
	     }
	    }
	    spnload3 = 0;
	   }
	}
	}
	
	if(ShowNgbhInfoTable())
	{
	ShowListingsOnMap(listings);//markers of listings in the resultset	
	}
	
	
	
	
		if(_map != null)
		{
			  var tf=new GTrafficOverlay();
		    _map.addOverlay(tf);
		}    
	    
	  if(bflgpgload == 'false'){
	   /* ////alert('spanel1');
	    ////alert(spanel1);
	    ////alert('spanel2');
	    ////alert(spanel2);
	    ////alert('spanel3');
	    ////alert(spanel3);
	  */
	  
	  var vsublnktp = "";
	  
	    if(spanel1 != 0)
	    {
	      vsublnktp = link_type1.substring(0,3);
            if (link_type1 != "") 
            {
            if(vsublnktp == "Man")
            {
                 chomeborough1 = "Manhattan";
            }
            if(vsublnktp == "Man" || vsublnktp == "Brk")
            {
                if(vsublnktp == "Man")
                {
                    chomeborough1 = "Manhattan";
                }  
                else if (vsublnktp == "Brk") 
                {
                  chomeborough1 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktp == "Hmp")
            {
                chomeborough1 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktp == "pmb")  
            {
                 chomeborough1 = "PalmBeaches";
                 preg = "FL";
            }            
	     stype = getChomeReqType(link_type1);
	     SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);//,s,stropenhselist);
	     }
	    }
	    else if(spanel2 != 0)
	    {
	        vsublnktp = link_type2.substring(0,3);
            if (link_type2 != "") 
            {
            if(vsublnktp == "Man")
            {
                 chomeborough2 = "Manhattan";
            }
            if(vsublnktp == "Man" || vsublnktp == "Brk")
            {
                if(vsublnktp == "Man")
                {
                    chomeborough2 = "Manhattan";
                }  
                else if (vsublnktp == "Brk") 
                {
                  chomeborough2 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(vsublnktp == "Hmp")
            {
                chomeborough2 = "Hamptons";
                preg = "LI";
            }
            else if(vsublnktp == "pmb")  
            {
                 chomeborough2 = "PalmBeaches";
                 preg = "FL";
            }            
	     stype = getChomeReqType(link_type2);
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);//,s,stropenhselist);
	        }   
	    }
	    else if(spanel3 != 0)
	    {
	      vsublnktp = link_type3.substring(0,3);
            if (link_type3 != "") 
            {
            if(vsublnktp == "Man")
            {
                 chomeborough3 = "Manhattan";
         }
         if(vsublnktp == "Man" || vsublnktp == "Brk")
         {
                if(vsublnktp == "Man")
                {
                    chomeborough3 = "Manhattan";
                }  
                else if (vsublnktp == "Brk") 
                {
                  chomeborough3 = "Brooklyn";
                }
                preg = "NYC";
         }
         else if(vsublnktp == "Hmp")
         {
                chomeborough3 = "Hamptons";
                preg = "LI";
         }
         else if(vsublnktp == "pmb")  
         {
                 chomeborough3 = "PalmBeaches";
                 preg = "FL";
         }              
	     stype = getChomeReqType(link_type3);
	     SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);//,s,stropenhselist);
	    }
	    }
        if(sp1 == 1 && sp2 == 2 && sp3 == 3)
        {
              flgsave = 1;
        }
    }
    else
    {
//    alert('loadpanel in TRUE');
//    alert(spnload1);
//    alert(spnload2);
//    alert(spnload3);
   
        if(spnload1 != 0)
	    {
	     //alert('in send PANEL 1');
	     stype = getChomeReqType(link_type1);
	     SendChomeXmlHttpRequest(stype,preg,category1,1,chomeborough1);
	    }
	    else if(spnload2 != 0)
	    {
	       
            spstrck2 = chcookie2.split('_');
            if(spstrck2[0] == "Man")
            {
                 chomeborough2 = "Manhattan";
            }
          
            if(spstrck2[0] == "Man" || spstrck2[0] == "Brk")
            {
                if(spstrck2[0] == "Man")
                {
                    chomeborough2 = "Manhattan";
                }  
                else if (spstrck2[0] == "Brk") 
                {
                  chomeborough2 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(spstrck2[0] == "Hmp")
            {
                chomeborough2 = "Hamptons";
                preg = "LI";
            }
            else if(spstrck2[0] == "pmb")  
            {
                 chomeborough2 = "PalmBeaches";
                 preg = "FL";
            }
            //link_type2 = chcookie2;
            //spnload2 = 2;
            spn2=2;
            //alert('linkTYPE2');
            //alert(link_type2);
            //alert(chomeborough2);
            if(vbphmp == 'true'){
         
             setDisplayStyle(chcookie2,2,1);
            
            }
            //alert('linkTYPE2 -- After style link2');
            //alert(link_type2);
                 if(link_type2 == "Man_FeaturedListings" || link_type2 == "Brk_FeaturedListings" ||
               link_type2 == "Hmp_FeaturedListings" || link_type2 == "pmb_FeaturedListings" ){
            if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
	         else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Manhattan_Featured.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	        else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Brooklyn_Featured.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	        else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='/mycorcoran/img/MC_Hamptons_Featured.gif' width='252' border='0' align='top'></font></a>";    
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	        else
	            document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='/mycorcoran/img/MC_PalmBeaches_Featured.gif' width='252' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        //////alert(chomeborough2);
            stype = getChomeReqType(link_type2);
            SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
            }
            else if(link_type2 == "Man_NewestListings" || link_type2 == "Brk_NewestListings" ||
                    link_type2 == "Hmp_NewestListings" || link_type2 == "pmb_NewestListings" )
            {
             if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
	        else
	        document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='/mycorcoran/img/MC_Manhattan_NewestListings.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='/mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2'))
	         {
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
	         else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='/mycorcoran/img/MC_Hamptons_NewestListings.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='/mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        }
	     stype = getChomeReqType(link_type2);
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }
	     else if(link_type2 == "Man_OpenhseListings" || link_type2 == "Brk_OpenhseListings" ||
	             link_type2 == "Hmp_OpenhseListings" || link_type2 == "pmb_OpenhseListings"   )
            {
             if(chomeborough2 == "Manhattan")
            {
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	        else
	        document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='/mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='252' border='0' align='top'></a></font>";    
	        }
	        } 
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	        else
                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='/mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='252' border='0' align='top'></a></font>";    	        
	        }
	        }
	     stype = getChomeReqType(link_type2);
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }
	     else if(link_type2 == "Man_MostViewedNow" || link_type2 == "Brk_MostViewedNow" ||
	             link_type2 == "Hmp_MostViewedNow" || link_type2 == "pmb_MostViewedNow")
         {
            ////alert('in most viewed now');
             if(chomeborough2 == "Manhattan")
            {////alert('in most viewed now');
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
	         else
                   document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	        else
	        document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'<a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	         else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	     stype = getChomeReqType(link_type2);
	     ////alert('in most viewed now stype');
	     ////alert(stype);
	     
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }
	     
	      else if(link_type2 == "Man_MostViewedThisWeek" || link_type2 == "Brk_MostViewedThisWeek" ||
	             link_type2 == "Hmp_MostViewedThisWeek" || link_type2 == "pmb_MostViewedThisWeek")
         {
            ////alert('in most viewed now');
             if(chomeborough2 == "Manhattan")
            {////alert('in most viewed now');
                if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
	         else
                   document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	        else
	        document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "Hamptons")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
	         else
	         document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	        else if(chomeborough2 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline2')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	         else
	                document.getElementById('td_bline2').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='252' border='0' align='top'></a></font>";    	        	            
	        }
	        }
	     stype = getChomeReqType(link_type2);
	     ////alert('in most viewed now stype');
	     ////alert(stype);
	     
	     SendChomeXmlHttpRequest(stype,preg,category1,2,chomeborough2);
	     }
	    }
	    else if(spnload3 != 0)
	    {
	       // alert('Hmp Featured listings spnload3');
			
            spstrck3 = chcookie3.split('_');
           
            if(spstrck3[0] == "Man")
            {
                 chomeborough3 = "Manhattan";
            }
          
            if(spstrck3[0] == "Man" || spstrck3[0] == "Brk")
            {
                if(spstrck3[0] == "Man")
                {
                    chomeborough3 = "Manhattan";
                }  
                else if (spstrck3[0] == "Brk") 
                {
                  chomeborough3 = "Brooklyn";
                }
                preg = "NYC";
            }
            else if(spstrck3[0] == "Hmp")
            {
                chomeborough3 = "Hamptons";
                preg = "LI";
            }
            else if(spstrck3[0] == "pmb")  
            { 
                 chomeborough3 = "PalmBeaches";
                 preg = "FL";
            }
            //link_type3 = chcookie3;
            //spnload3 = 3;
            spn3=3;
            
            if(vbphmp == 'true'){
         
             setDisplayStyle(chcookie3,3,1);
            
            }
        
        /*
            if(link_type3 == "Man_FeaturedListings" || link_type3 == "Brk_FeaturedListings" ||
               link_type3 == "Hmp_FeaturedListings" || link_type3 == "pmb_FeaturedListings" )
           {
            //alert('Hmp Featured listings');
            //alert(chomeborough3);
            if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	         //alert('linkTYPE2 -- After style link2 Manhattan');
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	        } 
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	        }
            //////alert(chomeborough3);        
            stype = getChomeReqType(link_type3);
            SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if (link_type3 == "Man_NewestListings" || link_type3 == "Brk_NewestListings" ||
                     link_type3 == "Hmp_NewestListings" || link_type3 == "pmb_NewestListings")
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	        }
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	       }
	        else if (link_type3 == "Man_OpenhseListings" || link_type3 == "Brk_OpenhseListings" ||
	                 link_type3 == "Hmp_OpenhseListings" || link_type3 == "pmb_OpenhseListings")
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	        }
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	       }
	       else if (link_type3 == "Man_MostViewedNow" || link_type3 == "Brk_MostViewedNow" ||
	                link_type3 == "Hmp_MostViewedNow" || link_type3 == "pmb_MostViewedNow")
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	        } 
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	       }
	       else if (link_type3 == "Man_MostViewedThisWeek" || link_type3 == "Brk_MostViewedThisWeek" ||
	                link_type3 == "Hmp_MostViewedThisWeek" || link_type3 == "pmb_MostViewedThisWeek")
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3'))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	        } 
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	       }
	       */
	           if(link_type3 == "Man_FeaturedListings" || link_type3 == "Brk_FeaturedListings" ||
               link_type3 == "Hmp_FeaturedListings" || link_type3 == "pmb_FeaturedListings" ){
            if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Featured Listings</b></font>";
	            else
	            {
	            if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Manhattan_Featured.gif' width='251' border='0' align='top'></a></font>";    
	            else
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Manhattan_Featured.gif' width='249' border='0' align='top'></a></font>";    
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Featured Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Brooklyn_Featured.gif' width='251' border='0' align='top'></a></font>";    	        
             else                
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../nyc.aspx'><img src='/mycorcoran/img/MC_Brooklyn_Featured.gif' width='249' border='0' align='top'></a></font>";    	        
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
            
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Featured Listings</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='/mycorcoran/img/MC_Hamptons_Featured.gif' width='251' border='0' align='top'></a></font>";    	        
             else
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../hee.aspx'><img src='/mycorcoran/img/MC_Hamptons_Featured.gif' width='249' border='0' align='top'></a></font>";    	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Featured Listings</b></font>";
	         else{
	        if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='/mycorcoran/img/MC_PalmBeaches_Featured.gif' width='251' border='0' align='top'></a></font>";    
	        else    
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='../palmbeach.aspx'><img src='/mycorcoran/img/MC_PalmBeaches_Featured.gif' width='249' border='0' align='top'></a></font>";    
	        
	        }
	        }
	        }
            //////alert(chomeborough3);        
            stype = getChomeReqType(link_type3);
            SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if (link_type3 == "Man_NewestListings" || link_type3 == "Brk_NewestListings" ||
                     link_type3 == "Hmp_NewestListings" || link_type3 == "pmb_NewestListings")
            {
            if(chomeborough3 == "Manhattan")
            {
		         if(document.getElementById('td_bline3')){
		    if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Newest Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='/mycorcoran/img/MC_Manhattan_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	         
             else
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Manhattan'><img src='/mycorcoran/img/MC_Manhattan_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	         
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Newest Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='/mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	         	                                
             else   
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=NYC&FP=NL&SRType=S&borough=Brooklyn#Brklistings'><img src='/mycorcoran/img/MC_Brooklyn_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	         	         
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Newest Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='/mycorcoran/img/MC_Hamptons_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	         	        
             else
               document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=LI&FP=NL&SRType=S&borough=Hamptons'><img src='/mycorcoran/img/MC_Hamptons_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	         	        
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Newest Listings</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='/mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='251' border='0' align='top'></a></font>";    	         	                               
             else  
               document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/latestlistings.aspx?Region=FL&FP=NL&SRType=S&borough=PalmBeaches'><img src='/mycorcoran/img/MC_PalmBeaches_NewestListings.gif' width='249' border='0' align='top'></a></font>";    	         	        
	        
	        }
	        }
	        }
	        stype = getChomeReqType(link_type3);
			//alert('send newlisting request');
			//alert(stype);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	       }
	        else if (link_type3 == "Man_OpenhseListings" || link_type3 == "Brk_OpenhseListings" ||
	                 link_type3 == "Hmp_OpenhseListings" || link_type3 == "pmb_OpenhseListings"   )
            {
             if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3'))
                {
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Open Houses</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    	         	                   
             else	                
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Manhattan_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    	         
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Open Houses</b></font>";
	         else{
             
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    	         
             else
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=NYC&p=main'><img src='/mycorcoran/img/MC_Brooklyn_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    	         
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	          if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Open Houses</b></font>";
	          else{
                if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))    
                   document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='/mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    	         	        
                else
                   document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=LI'><img src='/mycorcoran/img/MC_Hamptons_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    	         	        
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
			//alert('in palm beaches openhouses');
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Open Houses</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='/mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='251' border='0' align='top'></a></font>";    	         	         
             else  
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/property/openhse.aspx?region=FL'><img src='/mycorcoran/img/MC_PalmBeaches_OpenHouse.gif' width='249' border='0' align='top'></a></font>";    	         	         
                	        
	        }
	        }
	        }
	        
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
	       }
	        else if(link_type3 == "Man_MostViewedNow" || link_type3 == "Brk_MostViewedNow" ||
	                link_type3 == "Hmp_MostViewedNow" || link_type3 == "pmb_MostViewedNow")
            {
            ////alert('in hamptons mviewed now');
              if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
                if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed Now</b></font>";
	            else{
	            if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                 document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	                         	            	                   
	            else
	             document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><<a href='/guides/index.aspx?page=MostViewed&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	                         	            
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed Now</b></font>";
	         else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	                         	            	         
             else   
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	                         	            	         
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed Now</b></font>";
	            else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	                         	            
	         else   
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	                         	            
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	          if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed Now</b></font>";
	          else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	         document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='251' border='0' align='top'></a></font>";    	                         	            
	         else
	           document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewed&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedNow.gif' width='249' border='0' align='top'></a></font>";    	                         	            
	         
	        }
	        }
	        }
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
            else if(link_type3 == "Man_MostViewedThisWeek" || link_type3 == "Brk_MostViewedThisWeek" ||
                    link_type3 == "Hmp_MostViewedThisWeek" || link_type3 == "pmb_MostViewedThisWeek")
            {
              if(chomeborough3 == "Manhattan")
            {
                if(document.getElementById('td_bline3')){
	            if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Manhattan Most Viewed This Week</b></font>";
	            else{
             if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	                         	            	                                
             else       
                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Manhattan#ManMviewedlistings'><img src='/mycorcoran/img/MC_Manhattan_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	                         	            	            
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Brooklyn")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Brooklyn Most Viewed This Week</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	                         	            	            
	         else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Brooklyn#BrkMviewedlistings'><img src='/mycorcoran/img/MC_Brooklyn_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	                         	            	            
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "Hamptons")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Hamptons Most Viewed This Week</b></font>";
	         else{
	         if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	                         	            	            
	         else
	            document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=Hamptons#HmpMviewedlistings'><img src='/mycorcoran/img/MC_Hamptons_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	                         	            	            
	        
	        }
	        }
	        }
	        else if(chomeborough3 == "PalmBeaches")
	        {
	          if(document.getElementById('td_bline3')){
	         if(document.URL.toLowerCase().match("cmembers"))
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:6px'><b>Palm Beaches Most Viewed This Week</b></font>";
	         else{
                if(chcookie3 != "" || chcookie2 != "" || (chcookie1 !="" && chcookie3 != "") || (chcookie2 !="" && chcookie3 != ""))	            
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='251' border='0' align='top'></a></font>";    	                         	            	            
	            else    
	                document.getElementById('td_bline3').innerHTML = "<font color='#000000' face='Arial' size='1.8' style='padding-left:1px'><a href='/guides/index.aspx?page=MostViewedWeek&borough=PalmBeaches#pmbMviewedlistings'><img src='/mycorcoran/img/MC_PalmBeaches_MostViewedWeek.gif' width='249' border='0' align='top'></a></font>";    	                         	            	            
	        
	        }
	        }
	        }
	        stype = getChomeReqType(link_type3);
	        SendChomeXmlHttpRequest(stype,preg,category1,3,chomeborough3);
            }
	    }
        if(spn1 == 1 && spn2 == 2 && spn3 == 3)
        {
              flgsave = 1;
        }
    }
}

function setNewListHtmltable(lnktype,pnlno,bErrflg)
{
    //alert('in setNewListHtmltable');
    //alert(vgstrList);
   
    var vlnktype = lnktype;
    var vsublnk = vlnktype.substring(0,3);
    //alert(vsublnk);
    switch(vsublnk)
    {
        case "Man":
        {
        if(pnlno == 1){
             if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
             document.getElementById('tbl_divload1').style.display = 'none';
             document.getElementById('div_pnl1').style.display = 'none';
             
             if(bErrflg == 0){
                //document.getElementById('div_ManNewList').innerHTML=resErrorHtml;
                if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                document.getElementById('tbl_errorp1').style.display = 'block';
                document.getElementById('div_error1').style.display = 'block';
             }
             else
             {
             document.getElementById('tr_div_ManNewList').style.display = 'block';
             document.getElementById('div_ManNewList').innerHTML=vgstrList;
             }
               
            }
        else if(pnlno == 2){
        if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                document.getElementById('tbl_errorp2').style.display = 'block';
                document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_ManNewList2').style.display = 'block';
                document.getElementById('div_ManNewList2').innerHTML=vgstrList;
            }
            
            }
        else if(pnlno == 3){
        if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                document.getElementById('tbl_errorp3').style.display = 'block';
                document.getElementById('div_error3').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_ManNewList3').style.display = 'block';
                document.getElementById('div_ManNewList3').innerHTML=vgstrList;
            }
            }
        
        }
        break;
        case "Brk":
        {
        if(pnlno == 1){
        if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_BrkNewList').style.display = 'block';
                document.getElementById('div_BrkNewList').innerHTML=vgstrList;
            }
            }
        else if(pnlno == 2){
        if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_BrkNewList2').style.display = 'block';
                document.getElementById('div_BrkNewList2').innerHTML=vgstrList;                
            }
            }
        else if(pnlno == 3){
        if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_BrkNewList3').style.display = 'block';
                document.getElementById('div_BrkNewList3').innerHTML=vgstrList;
            }
            }
        }
        break;
        case "Hmp":
        {
        if(pnlno == 1){
        if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_HmpNewList').style.display = 'block';
                document.getElementById('div_HmpNewList').innerHTML=vgstrList;
            }
            }
        else if(pnlno == 2){
        if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
                  if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';            
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_HmpNewList2').style.display = 'block';
                document.getElementById('div_HmpNewList2').innerHTML=vgstrList;
            }
            }
        else if(pnlno == 3){
        if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_HmpNewList3').style.display = 'block';
                document.getElementById('div_HmpNewList3').innerHTML=vgstrList;
            }
            }
        }
        break;
        case "pmb":
        {
        if(pnlno == 1){
        if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_pmbNewList').style.display = 'block';
                document.getElementById('div_pmbNewList').innerHTML=vgstrList;
            }
            }
        else if(pnlno == 2){
        if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
               if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_pmbNewList2').style.display = 'block';
                document.getElementById('div_pmbNewList2').innerHTML=vgstrList;
            }
            }
        else if(pnlno == 3){
        if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
             document.getElementById('tbl_divload3').style.display = 'none';
             document.getElementById('div_pnl3').style.display = 'none';
             
             if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block';
             }
             else{
                document.getElementById('tr_div_pmbNewList3').style.display = 'block';
                document.getElementById('div_pmbNewList3').innerHTML=vgstrList;
             }
             }
        }
        break;
        default:
        break;
    }
}

function setFeaturedListHtmltable(lnktype,pnlno,bErrflg)
{
    //alert('in setFeaturedListHtmltable');
    var vlnktype = lnktype;
    var vsublnk = vlnktype.substring(0,3);
    //alert(vsublnk);
    //alert(document.getElementById('tr_div_BrkFeaturedList').style.display);
    switch(vsublnk)
    {
        case "Man":
        {
         if(pnlno == 1){
         if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block';
            }
            else{
                document.getElementById('div_ManFeaturedList').innerHTML=vgstrList;
                document.getElementById('tr_div_ManFeaturedList').style.display = 'block';
            }
            }
         else if(pnlno == 2){
         if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_ManFeaturedList2').style.display = 'block';  
                document.getElementById('div_ManFeaturedList2').innerHTML=vgstrList;
            }      
         }
         else if(pnlno == 3){
         if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
             if(bErrflg == 0){
              if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block';
             }
             else{
                document.getElementById('tr_div_ManFeaturedList3').style.display = 'block';
                document.getElementById('div_ManFeaturedList3').innerHTML=vgstrList;
             }
            }
        }
        break;
        case "Brk":
        {
         if(pnlno == 1){
         if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_BrkFeaturedList').style.display = 'block';
                document.getElementById('div_BrkFeaturedList').innerHTML=vgstrList;
            }
            }
         else if(pnlno == 2){
         if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_BrkFeaturedList2').style.display = 'block';  
                document.getElementById('div_BrkFeaturedList2').innerHTML=vgstrList;
            }
         }
         else if(pnlno == 3){
         if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_BrkFeaturedList3').style.display = 'block';
                document.getElementById('div_BrkFeaturedList3').innerHTML=vgstrList;
            }
            }
        
        }
        break;
        case "Hmp":
        {
         if(pnlno == 1){
         if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_HmpFeaturedList').style.display = 'block';
                document.getElementById('div_HmpFeaturedList').innerHTML=vgstrList;
             }
            }
         else if(pnlno == 2){
         if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
              if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_HmpFeaturedList2').style.display = 'block';  
                document.getElementById('div_HmpFeaturedList2').innerHTML=vgstrList;   
             }   
            
            }
         else if(pnlno == 3){
         if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_HmpFeaturedList3').style.display = 'block';
                document.getElementById('div_HmpFeaturedList3').innerHTML=vgstrList;
            }
            }
        }
        break;
        case "pmb":
         {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_pmbFeaturedList').style.display = 'block';
                document.getElementById('div_pmbFeaturedList').innerHTML=vgstrList;
             }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
            if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_pmbFeaturedList2').style.display = 'block'; 
                document.getElementById('div_pmbFeaturedList2').innerHTML=vgstrList;   
            }
           }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_pmbFeaturedList3').style.display = 'block';
                document.getElementById('div_pmbFeaturedList3').innerHTML=vgstrList;
            }    
            }
         }
        break;
        default:
        break;
    }
}

function setOpenhseListHtmltable(lnktype,pnlno,bErrflg)
{
    //alert('in setOpenhseListHtmltable');
    var vlnktype = lnktype;
    
    var vsublnk = vlnktype.substring(0,3);
  
    switch(vsublnk)
    {
        case "Man":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_ManOpenhseList').style.display = 'block';
                document.getElementById('div_ManOpenhseList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0) {
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_ManOpenhseList2').style.display = 'block';
                document.getElementById('div_ManOpenhseList2').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_ManOpenhseList3').style.display = 'block';
                document.getElementById('div_ManOpenhseList3').innerHTML=vgstrOpenhseList;  
            }
            }
        }     
        break;
        case "Brk":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_BrkOpenhseList').style.display = 'block';
                document.getElementById('div_BrkOpenhseList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_BrkOpenhseList2').style.display = 'block'; 
                document.getElementById('div_BrkOpenhseList2').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_BrkOpenhseList3').style.display = 'block';
                document.getElementById('div_BrkOpenhseList3').innerHTML=vgstrOpenhseList;
            }
            }
        }
        break;
        case "Hmp":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                document.getElementById('tbl_errorp1').style.display = 'block';
                document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_HmpOpenhseList').style.display = 'block';
                document.getElementById('div_HmpOpenhseList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                 document.getElementById('tbl_errorp2').style.display = 'block';
                 document.getElementById('div_error2').style.display = 'block';              
            }
            else{
                document.getElementById('tr_div_HmpOpenhseList2').style.display = 'block';
                document.getElementById('div_HmpOpenhseList2').innerHTML=vgstrOpenhseList;  
            }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                 document.getElementById('tbl_errorp3').style.display = 'block';
                 document.getElementById('div_error3').style.display = 'block';                              
            }
            else{
                document.getElementById('tr_div_HmpOpenhseList3').style.display = 'block';
                document.getElementById('div_HmpOpenhseList3').innerHTML=vgstrOpenhseList;
            }
            }
        }
        break;
        case "pmb":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                 document.getElementById('tbl_errorp1').style.display = 'block';
                 document.getElementById('div_error1').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_pmbOpenhseList').style.display = 'block';
                document.getElementById('div_pmbOpenhseList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
            if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                 document.getElementById('tbl_errorp2').style.display = 'block';
                 document.getElementById('div_error2').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_pmbOpenhseList2').style.display = 'block'; 
                document.getElementById('div_pmbOpenhseList2').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                 document.getElementById('tbl_errorp3').style.display = 'block';
                 document.getElementById('div_error3').style.display = 'block';
            }
            else{
                document.getElementById('tr_div_pmbOpenhseList3').style.display = 'block';
                document.getElementById('div_pmbOpenhseList3').innerHTML=vgstrOpenhseList;  
            }
            }
        }
        break;
        default:
        break;
    }
}

function setMviewedListHtmltable(lnktype,pnlno,bErrflg)
{
    //alert('in setMviewedListHtmltable');
    var vlnktype = lnktype;
    var vsublnk = vlnktype.substring(0,3);
    //alert(vsublnk);
   // alert('vgstrOpenhseList');
   // alert(vgstrOpenhseList);
    //alert(document.getElementById('tr_div_BrkFeaturedList').style.display);
    switch(vsublnk)
    {
        case "Man":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                document.getElementById('tbl_errorp1').style.display = 'block';
                document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_ManMostviewedList').style.display = 'block';
                document.getElementById('div_ManMostviewedList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';

            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                document.getElementById('tbl_errorp2').style.display = 'block';
                document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
                document.getElementById('div_ManMostviewedList2').innerHTML=vgstrOpenhseList;
                document.getElementById('tr_div_ManMostviewedList2').style.display = 'block'; 
            }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
           
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block'; 
            }
            else{
                 document.getElementById('tr_div_ManMostviewedList3').style.display = 'block';
                document.getElementById('div_ManMostviewedList3').innerHTML=vgstrOpenhseList;   
            }
            }
        }
        break;
        case "Brk":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_BrkMostviewedList').style.display = 'block';
                document.getElementById('div_BrkMostviewedList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
           
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_BrkMostviewedList2').style.display = 'block'; 
                document.getElementById('div_BrkMostviewedList2').innerHTML=vgstrOpenhseList;
            }    
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
          
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_BrkMostviewedList3').style.display = 'block';
                document.getElementById('div_BrkMostviewedList3').innerHTML=vgstrOpenhseList;
            }    
            }
        }
        break;
        case "Hmp":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_HmpMostviewedList').style.display = 'block';
                document.getElementById('div_HmpMostviewedList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
           
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block';              
            }
            else{
                document.getElementById('tr_div_HmpMostviewedList2').style.display = 'block'; 
                document.getElementById('div_HmpMostviewedList2').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 3){  
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';

            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block';   
            }
            else{
                document.getElementById('tr_div_HmpMostviewedList3').style.display = 'block';
                document.getElementById('div_HmpMostviewedList3').innerHTML=vgstrOpenhseList;
            }
            }
        }
        break;
        case "pmb":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                  document.getElementById('tbl_errorp1').style.display = 'block';
                  document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_pmbMostviewedList').style.display = 'block';
                document.getElementById('div_pmbMostviewedList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){   
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_pmbMostviewedList2').style.display = 'block'; 
                document.getElementById('div_pmbMostviewedList2').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                  document.getElementById('tbl_errorp3').style.display = 'block';
                  document.getElementById('div_error3').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_pmbMostviewedList3').style.display = 'block';
                document.getElementById('div_pmbMostviewedList3').innerHTML=vgstrOpenhseList;
            }
            }
        }
        break;
        default:
        break;
    }
}

function setMvwThiswkListHtmltable(lnktype,pnlno,bErrflg)
{
    //alert('in setMvwThiswkListHtmltable');
    var vlnktype = lnktype;
    var vsublnk = vlnktype.substring(0,3);
    //alert(pnlno);
    //alert(document.getElementById('tr_div_BrkFeaturedList').style.display);
    switch(vsublnk)
    {
        case "Man":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                document.getElementById('tbl_errorp1').style.display = 'block';
                document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_ManMostviewedThisWkList').style.display = 'block';
                document.getElementById('div_ManMostviewedThisWkList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
         
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                document.getElementById('tbl_errorp2').style.display = 'block';
                document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
           
                document.getElementById('tr_div_ManMostviewedThisWkList2').style.display = 'block'; 
                document.getElementById('div_ManMostviewedThisWkList2').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                document.getElementById('tbl_errorp3').style.display = 'block';
                document.getElementById('div_error3').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_ManMostviewedThisWkList3').style.display = 'block';
                document.getElementById('div_ManMostviewedThisWkList3').innerHTML=vgstrOpenhseList;
            }
            }
            
        }
        break;
        case "Brk":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                 document.getElementById('tbl_errorp1').style.display = 'block';
                 document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_BrkMostviewedThisWkList').style.display = 'block';
                document.getElementById('div_BrkMostviewedThisWkList').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
          
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                 document.getElementById('tbl_errorp2').style.display = 'block';
                 document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
                  document.getElementById('tr_div_BrkMostviewedThisWkList2').style.display = 'block'; 
                document.getElementById('div_BrkMostviewedThisWkList2').innerHTML=vgstrOpenhseList;
             }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                 document.getElementById('tbl_errorp2').style.display = 'block';
                 document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_BrkMostviewedThisWkList3').style.display = 'block';
                document.getElementById('div_BrkMostviewedThisWkList3').innerHTML=vgstrOpenhseList;
            }
            }
        
        
        }
        break;
        case "Hmp":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
            
            if(bErrflg == 0){
             if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
                 document.getElementById('tbl_errorp1').style.display = 'block';
                 document.getElementById('div_error1').style.display = 'block'; 
            }
            else
            {   document.getElementById('tr_div_HmpMostviewedThisWkList').style.display = 'block';
                document.getElementById('div_HmpMostviewedThisWkList').innerHTML=vgstrOpenhseList;
            }
          }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0) {
             if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                 document.getElementById('tbl_errorp2').style.display = 'block';
                 document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
            
                document.getElementById('tr_div_HmpMostviewedThisWkList2').style.display = 'block';
                document.getElementById('div_HmpMostviewedThisWkList2').innerHTML=vgstrOpenhseList;
            }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                  document.getElementById('tbl_errorp2').style.display = 'block';
                  document.getElementById('div_error2').style.display = 'block'; 
            }
            else
            {
                document.getElementById('tr_div_HmpMostviewedThisWkList3').style.display = 'block';
                document.getElementById('div_HmpMostviewedThisWkList3').innerHTML=vgstrOpenhseList;
            }
            }
        }
        break;
        case "pmb":
        {
          if(pnlno == 1){
          if(document.getElementById('tr_tbl_divload1'))document.getElementById('tr_tbl_divload1').style.display = 'none';
            document.getElementById('tbl_divload1').style.display = 'none';
            document.getElementById('div_pnl1').style.display = 'none';
  
            if(bErrflg == 0){
               if(document.getElementById('tr_tbl_errorp1'))document.getElementById('tr_tbl_errorp1').style.display = 'block';
               document.getElementById('tbl_errorp1').style.display = 'block';
               document.getElementById('div_error1').style.display = 'block'; 
            }
            else{
           
            document.getElementById('tr_div_pmbMostviewedThisWkList').style.display = 'block';
            document.getElementById('div_pmbMostviewedThisWkList').innerHTML=vgstrOpenhseList; 
            }
            }
          else if(pnlno == 2){
          if(document.getElementById('tr_tbl_divload2'))document.getElementById('tr_tbl_divload2').style.display = 'none';
            document.getElementById('tbl_divload2').style.display = 'none';
            document.getElementById('div_pnl2').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp2'))document.getElementById('tr_tbl_errorp2').style.display = 'block';
                 document.getElementById('tbl_errorp2').style.display = 'block';
                 document.getElementById('div_error2').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_pmbMostviewedThisWkList2').style.display = 'block'; 
                document.getElementById('div_pmbMostviewedThisWkList2').innerHTML=vgstrOpenhseList;
                }
            }
          else if(pnlno == 3){
          if(document.getElementById('tr_tbl_divload3'))document.getElementById('tr_tbl_divload3').style.display = 'none';
            document.getElementById('tbl_divload3').style.display = 'none';
            document.getElementById('div_pnl3').style.display = 'none';
            
            if(bErrflg == 0){
                if(document.getElementById('tr_tbl_errorp3'))document.getElementById('tr_tbl_errorp3').style.display = 'block';
                 document.getElementById('tbl_errorp3').style.display = 'block';
                 document.getElementById('div_error3').style.display = 'block'; 
            }
            else{
                document.getElementById('tr_div_pmbMostviewedThisWkList3').style.display = 'block';
                document.getElementById('div_pmbMostviewedThisWkList3').innerHTML=vgstrOpenhseList;
            }
            }
       }
        break;
        default:
        break;
    }
}

function Emailmylistings(ctlname)
{
dml=document.Form1;
len = dml.elements.length;
var strid="";
var s="";
var ltotal=0;
var i=0;
	for( i=0 ; i<len ; i++) {
		s=dml.elements[i].name;

		if (s.indexOf(ctlname)>=0) 
		{
			if (dml.elements[i].checked) 
			{
				//if(dml.elements[i+1].name.indexOf(ctlname)>=0)
				{
					if (dml.elements[i+1].checked) 
						strid=strid + dml.elements[i].value +',';
					else
					  strid=strid + dml.elements[i].value;		
				}
				//else
				//	alert(dml.elements[i+1].name);
					
				ltotal++;			
			}
		}
	} 
	//alert('strid');
	//alert(strid);
 if (strid=="")
 	alert("Please check one or more saved listings");
 else
 	{
		if(document.getElementById("tr_div_sendemail"))
	 		document.getElementById("tr_div_sendemail").style.display = 'block';
		SendXMLMyListingRequest("EmailMyListings",strid);
	}
}

function ShowConfirmation()
{
	if(document.getElementById("div_sendemail"))
		document.getElementById("div_sendemail").innerHTML = "<font color='red'><b>Email Sent Successfully.</b></font>";
}


function ShowMyListings()
{
	//ChkboxListingID
	dml=document.Form1;
len = dml.elements.length;
var strid="";
var s="";

var i=0;
	for( i=0 ; i<len ; i++) {
		s=dml.elements[i].name;

		if (s.indexOf("ChkboxListingID")>=0) 
		{
			if (dml.elements[i].checked) 
			{
				strid=strid + dml.elements[i].value +',';
			}
		}
	} 
	window.location.href= "mylistings.aspx?deleteid=" + strid.substring(0,strid.length-1);
}
