var XmlHttp;
var typeid;
var reActionValueForMap=-1;
var subLocationFlag=-1;
var selectionFlag=-1;
var divBasicService="<table width='100%' cellpadding=0 cellspacing=0>";
var soldorleased="已售";

if (window.XMLHttpRequest) {
	XmlHttp = new XMLHttpRequest()
	 if (XmlHttp.overrideMimeType) {
        XmlHttp.overrideMimeType('text/xml');
     }
} else if (window.ActiveXObject) {
			var versions = ['Microsoft.XMLHTTP', 'MSXML.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.7.0', 'Msxml2.XMLHTTP.6.0', 'Msxml2.XMLHTTP.5.0', 'Msxml2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP'];
			for(var i=0; i<versions.length; i++) {
				try {
					XmlHttp = new ActiveXObject(versions[i]);
					if(XmlHttp) {
						break;
					}
				} catch(e) {
					//alert(e.message);
				}
			}
}

function getData(url,id) {
   typeid=id;

   XmlHttp.open("GET", url, true);
   XmlHttp.onreadystatechange = praseXml;
   XmlHttp.send(null);
}

function praseXml() {
   if (XmlHttp.readyState == 4) {
      if (XmlHttp.status == 200) {
		  var xmldoc = XmlHttp.responseXML;
		  var root=xmldoc.getElementsByTagName('data').item(0);
		  var root0=root.childNodes.item(0);
		  var paramsubstring,mainphotodiv,listphotodiv,suggestiondiv,agentdiv,individualdiv,navdivlist;
          var propertyflist;

		  if(typeid==1){
		    paramsubstring="<select id='ddlPropertyType' size=1 onChange='subLocationFlag=-1;changeAction(this.options[this.selectedIndex].value,2);' style='width:170px;'>";
		    if(selectionFlag==-1) paramsubstring=paramsubstring+"<option value=0 selected>物业类别</option>";else paramsubstring=paramsubstring+"<option value=0 selected>所有物业的类别</option>";
		  }else if(typeid==2){
		    paramsubstring="<select id='ddlPropertySubType' size=1 style='width:170px;' onChange='subLocationFlag=-1;changeAction(this.options[this.selectedIndex].value,-10);'>";
		    if(selectionFlag==-1) paramsubstring=paramsubstring+"<option value=0 selected>物业类型</option>";else paramsubstring=paramsubstring+"<option value=0 selected>所有物业类型</option>";
		  }else if(typeid==3){
		  	paramsubstring="<select id='ddlPropertyLocation' size=1 onChange='changeAction(this.options[this.selectedIndex].value,4);' style='width:170px;'>";
		  }else if(typeid==4){
		    paramsubstring="<select id='ddlPropertySubLocation' size=1 style='width:170px;' onChange='subLocationFlag=0;changeAction(this.options[this.selectedIndex].value,-10);'>";
		    paramsubstring=paramsubstring+"<option value=0 selected>所有社区</option>";
		  }else if(typeid==9){
		    paramsubstring="<select id='ddlPropertySubLocation' size=1 style='width:170px;' onChange='changeSubAction(this.options[this.selectedIndex].value,1);'>";
		    paramsubstring=paramsubstring+"<option value=0 selected>所有社区</option>";
		  }else if(typeid==99){
		    paramsubstring="<select id='ddlPropertySubLocation' size=1 style='width:250px;' onChange='changeSubAction(this.options[this.selectedIndex].value,1);'>";
		    paramsubstring=paramsubstring+"<option value=0 selected>所有社区</option>";
		  }else if(typeid==-1){
		    paramsubstring="<select id='ddlPropertyType_ul' size=1 onChange='changeAction(this.options[this.selectedIndex].value,-2);' style='width:170px;'>";
		    if(selectionFlag==-1) paramsubstring=paramsubstring+"<option value=0 selected>物业类别</option>";else paramsubstring=paramsubstring+"<option value=0 selected>所有物业的类别</option>";
		  }else if(typeid==-2){
		    paramsubstring="<select id='ddlPropertySubType_ul' size=1 style='width:170px;' onChange='changeSubAction(this.options[this.selectedIndex].value,2);'>";
		    if(selectionFlag==-1) paramsubstring=paramsubstring+"<option value=0 selected>物业类型</option>";else paramsubstring=paramsubstring+"<option value=0 selected>所有物业类型</option>";
		  }else if(typeid==-4){
		    paramsubstring="<select id='ddlPropertySubLocation_ul' size=1 style='width:170px;' onChange='changeSubAction(this.options[this.selectedIndex].value,1);'>";
		    paramsubstring=paramsubstring+"<option value=0 selected>所有社区</option>";
		  }else if(typeid==-5){
		    paramsubstring="<select id='ddlPropertySubLocation' size=1 style='width:130px;' onChange='contentChange(9,this.options[this.selectedIndex].value,this.selectedIndex);'>";
		    paramsubstring=paramsubstring+"<option value=0 selected>所有社区</option>";
		  }else if(typeid==66){
		    paramsubstring="<select id='ddlPropertyBranchList' size=1 style='width:250px;' onChange='branchChange(this.options[this.selectedIndex].value)'>";
		    paramsubstring=paramsubstring+"<option value=0 selected>选择分行</option>";
		  }else if(typeid==67){
		    paramsubstring="<select id='ddlPropertyBranchList' size=1 style='width:130px;' onChange='contentChange(11,this.options[this.selectedIndex].value,this.selectedIndex);'>";
		    paramsubstring=paramsubstring+"<option value=0 selected>所有分行</option>";
		  }else if(typeid==68){
		    paramsubstring="<select id='ddlPropertyBranchList' size=1 style='width:170px;' onChange='reloadMark(0);'>";
		    paramsubstring=paramsubstring+"<option value=0 selected>所有分行</option>";
		  }

		  if((typeid<5) || (typeid==9) || (typeid==99)){
			  var id,content;

			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "content"){
	          	 	   content=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  }
	            }
	            paramsubstring=paramsubstring+"<option value="+id+">"+content+"</option>";
		      }
          	  paramsubstring=paramsubstring+"</select>";
          }else if(typeid==66){
			  var id,title;

			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "title"){
	          	 	   title=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  }
	            }
	            paramsubstring=paramsubstring+"<option value='"+title+"'>"+title+"</option>";
		      }
		      paramsubstring=paramsubstring+"<option value=-1>其它分行</option>";
          	  paramsubstring=paramsubstring+"</select>";
          }else if((typeid==67)||(typeid==68)){
			  var id,title;
			  var i=0;

			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "title"){
	          	 	   title=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  }
	            }
	            paramsubstring=paramsubstring+"<option value='"+title+"'>"+title+"</option>";
	            i++;
		      }
		      //if(i>0) paramsubstring=paramsubstring+"<option value=-1>Other Branches</option>";
          	  paramsubstring=paramsubstring+"</select>";
          }else if(typeid==999){
			  var id,name,phone;
			  var page,totalpage,records;
			  var i=0;
              
              paramsubstring="<table width='760' cellpadding=0 cellspacing=0 border=0>";              
              
			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "name"){
	          	 	   name=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "phone"){
	          	 	   phone=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "page"){
	          	 	   page=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "totalpage"){
	          	 	   totalpage=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "records"){
	          	 	   records=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  }
	            }
	            
	            /*
	            var buttonObj=document.createElement('input');
				buttonObj.type='button';
				buttonObj.value=name;
				document.body.appendChild(buttonObj);
				var range=buttonObj.createTextRange(); 
				var r1=range.boundingWidth;
				var r2=430-r1;
				document.body.removeChild(buttonObj);
	            var dotString="";
	            for(var i=1;i<parseInt(r2/3);i++){
	               dotString=dotString+".";
	            }
	            */	
	            paramsubstring=paramsubstring+"<tr height=20 valign=bottom><td width=120></td>";
	           // paramsubstring=paramsubstring+"  <td align=left onmouseover='divAction(1,"+iRoot+")' onmouseout='divAction(2,"+iRoot+")'><span style='width:430px;text-align:left'><a style='text-decoration:none;' href='#' onclick=\"openwindow(\'directorydetail.aspx?id="+id+"\')\">"+name+"<font color=#3c3c3c>"+dotString+"</font></a></span><span style='width:70px;text-align:right'><a style='text-decoration:none;' href='#' onclick=\"openwindow(\'directorydetail.aspx?id="+id+"\')\">"+phone+"</a></span></td><td width=120></td></tr>";
	            paramsubstring=paramsubstring+"  <td align=left onmouseover='divAction(1,"+iRoot+")' onmouseout='divAction(2,"+iRoot+")'><a style='text-decoration:none;' href='#' onclick=\"openwindow(\'directorydetail.aspx?id="+id+"\')\">"+name+"</a></td><td align=right onmouseover='divAction(1,"+iRoot+")' onmouseout='divAction(2,"+iRoot+")'><a style='text-decoration:none;' href='#' onclick=\"openwindow(\'directorydetail.aspx?id="+id+"\')\">"+phone+"</a></td><td width=120></td></tr>";
	            paramsubstring=paramsubstring+"<tr height=1><td width=120></td><td width=520 colspan=2><div id='p_div"+iRoot+"' style='display:none;'><table width=520 cellpadding=0 cellspacing=0 border=0><tr height=1 bgcolor=#515a9f><td></td></tr></table></div></td><td width=120></td></tr>"
	            i++;
		      }
		      
		      var navstring="<table width='250' cellpadding=0 cellspacing=0 border=0>";
              var tempage=(page-1)*30;
              tempage++;
              var tempage001=page*30;
              var next_page=parseInt(page)+1;
              var previous_page=page-1;
              if(next_page>totalpage) next_page=totalpage;
              if(previous_page<1) previous_page=1;
                            
              if(page*30>records) tempage001=records;
               
              if(tempage>=0){
                  if((page==1)&&(totalpage>page))
	          		navstring=navstring+"<tr><td align=left><b><font color=#3c3c3c style='font-family:Courier;'><<</font>&nbsp;&nbsp;&nbsp;&nbsp;<font color=#3c3c3c style='font-family:Courier;'><</font>&nbsp;&nbsp;</b></td><td style='padding-top:2px;' align=middle width='60%'><b><font color=#3c3c3c>"+tempage+" To "+tempage001+" Of "+records+"</font>&nbsp;&nbsp;</b></td><td align=right><b><a href=# onclick='pageChange("+ordertype+","+next_page+")'><font color=#515A9F style='font-family:Courier;'>></font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=# onclick='pageChange("+ordertype+","+totalpage+")'><font color=#515A9F style='font-family:Courier;'>>></font></a></b></td></tr>";
                  else if((page==totalpage)&&(totalpage>1))
	          		navstring=navstring+"<tr><td align=left><b><a href=# onclick='pageChange("+ordertype+",1)'><font color=#515A9F style='font-family:Courier;'><<</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=# onclick='pageChange("+ordertype+","+previous_page+")'><font color=#515A9F style='font-family:Courier;'><</font></a>&nbsp;&nbsp;</b></td><td style='padding-top:2px;' align=middle width='60%'><b><font color=#3c3c3c>"+tempage+" To "+tempage001+" Of "+records+"</font>&nbsp;&nbsp;</b></td><td align=right><b><font color=#3c3c3c style='font-family:Courier;'>></font>&nbsp;&nbsp;&nbsp;&nbsp;<font color=#3c3c3c style='font-family:Courier;'>>></font></b></td></tr>";
                  else if((page==1)&&(page==totalpage))
	          		navstring=navstring+"<tr><td align=left><b><font color=#3c3c3c style='font-family:Courier;'><<</font>&nbsp;&nbsp;&nbsp;&nbsp;<font color=#3c3c3c style='font-family:Courier;'><</font>&nbsp;&nbsp;</b></td><td style='padding-top:2px;' align=middle width='60%'><b><font color=#3c3c3c>"+tempage+" To "+tempage001+" Of "+records+"</font>&nbsp;&nbsp;</b></td><td align=right><b><font color=#3c3c3c style='font-family:Courier;'>></font>&nbsp;&nbsp;&nbsp;&nbsp;<font color=#3c3c3c style='font-family:Courier;'>>></font></b></td></tr>";
                  else
	          		navstring=navstring+"<tr><td align=left><b><a href=# onclick='pageChange("+ordertype+",1)'><font color=#515A9F style='font-family:Courier;'><<</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=# onclick='pageChange("+ordertype+","+previous_page+")'><font color=#515A9F style='font-family:Courier;'><</font></a>&nbsp;&nbsp;</b></td><td style='padding-top:2px;' align=middle width='60%'><b><font color=#3c3c3c>"+tempage+" To "+tempage001+" Of "+records+"</font>&nbsp;&nbsp;</b></td><td align=right><b><a href=# onclick='pageChange("+ordertype+","+next_page+")'><font color=#515A9F style='font-family:Courier;'>></font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href=# onclick='pageChange("+ordertype+","+totalpage+")'><font color=#515A9F style='font-family:Courier;'>>></font></a></b></td></tr>";
		      }
		      navstring=navstring+"</table>"
		      
		      
          	  paramsubstring=paramsubstring+"</table><BR><BR>";
          	  paramsubstring=paramsubstring;
          	  document.getElementById('divListNav').innerHTML=navstring;
          	  
          }else if((typeid==5) || (typeid==55) || (typeid==56) || (typeid==57)){
          	  var listid,propertytile,propertyaddress,propertykind,propertytype,propertysubtype,propertylocation,propertysublocation,propertyprice,propertyzoning,propertbedroom,propertbathroom,propertfeature,propertfilename,propertycarparking,propertycarparkingport,propertycarparkingoff,propertyref,propertydate,propertlandarea,propertfloorarea,propertturnover,propertflatmate,propertstatus,propertrefcode;
          	  var page,previous_page,next_page,totalpage,records,ordertype,stringAmount,stringAgentInfo;
              var displayTitle,displayContent;
              var propertyaddons=0;
			  
          	  paramsubstring="<table cellSpacing='0' cellPadding='0' width='100%' border='0'>";
              propertyflist="<table cellSpacing='0' cellPadding='0' width='100%' border='0'><tr height=143 valign=top>";
          	  
		      for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            stringAmount="";propertyaddress="";propertyprice="";propertykind="";
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   listid=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertytitle"){
	          	 	   propertytitle=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyaddress"){
	          	 	   propertyaddress=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertykind"){
	          	 	   propertykind=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertytype"){
	          	 	   propertytype=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertysubtype"){
	          	 	   propertysubtype=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertylocation"){
	          	 	   propertylocation=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertysublocation"){
	          	 	   propertysublocation=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyprice"){
	          	 	   propertyprice=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyzoning"){
	          	 	   propertyzoning =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertbedroom"){
	          	 	   propertbedroom=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertbathroom"){
	          	 	   propertbathroom=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertfeature"){
	          	 	   propertfeature=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertfilename"){
	          	 	   propertfilename=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertcarparking"){
	          	 	   propertcarparking=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertcarparkingport"){
	          	 	   propertcarparkingport=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertcarparkingoff"){
	          	 	   propertcarparkingoff=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "stringAgentTitle"){
	          	 	   propertyref=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertrefcode"){
	          	 	   propertrefcode=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertlandarea"){
	          	 	   propertlandarea=item_node.childNodes.item(iItem).nodeValue;
	          	 	   if((propertlandarea==" sqm")||(propertlandarea==" sqf")) propertlandarea="";
				    }else if(item_node.nodeName == "propertfloorarea"){
	          	 	   propertfloorarea=item_node.childNodes.item(iItem).nodeValue;
	          	 	   if((propertfloorarea==" sqm")||(propertlandarea==" sqf")) propertfloorarea="";
	          	  	}else if(item_node.nodeName == "propertdate"){
	          	 	   propertdate=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertturnover"){
	          	 	   propertturnover=item_node.childNodes.item(iItem).nodeValue;
	          	 	}else if(item_node.nodeName == "propertflatmate"){
	          	 	   propertflatmate=item_node.childNodes.item(iItem).nodeValue;
	          	 	}else if(item_node.nodeName == "propertstatus"){
	          	 	   propertstatus=item_node.childNodes.item(iItem).nodeValue;
	          	 	}else if(item_node.nodeName == "propertyaddons"){
	          	 	   propertyaddons=item_node.childNodes.item(iItem).nodeValue;
	          	 	}else if(item_node.nodeName == "page"){
	          	 	   page=item_node.childNodes.item(iItem).nodeValue;
	          	 	   previous_page=page-1;
	          	 	   next_page=page;
	          	 	   next_page++;
	          	  	}else if(item_node.nodeName == "totalpage"){
	          	 	   totalpage=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "records"){
	          	 	   records=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "ordertype"){
	          	 	   ordertype=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "stringAmount"){
	          	 	   stringAmount=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "stringAgentInfo"){
	          	 	   stringAgentInfo=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	            }
                 
           if(listid>0){

                
	          	 	   if(IsNumericAjax(propertyprice)) propertyprice="$"+number_format(propertyprice);else if((propertykind=="For Lease")||(propertykind=="2")) propertyprice="$"+propertyprice;
	          	 	   propertyprice=propertyprice.replace("Auction","拍卖");
	          	 	   propertyprice=propertyprice.replace("Tender","限时投标");
	          	 	   propertyprice=propertyprice.replace("POA","询价");
	          	 	   propertyprice=propertyprice.replace("Private Treaty","个别协议");
	          	 	   propertyprice=propertyprice.replace("Price by Negotiation","议价");
	          	 	   propertyprice=propertyprice.replace("Expressions of Interest","投标");
	          	 	   
	          	 	   propertyprice=propertyprice.replace("of","of<BR>");
	          	 	   propertyprice=propertyprice.replace("by","by<BR>");
	          	 	   propertyprice=propertyprice.replace(" per ","/");
	          	 	   if((propertyprice=="$/week")||(propertyprice=="$/month")||(propertyprice=="$/year")||(propertyprice=="$0")||(propertyprice=="")||(propertyprice=="0")) propertyprice="请詢价";
	          	 	   if((propertyprice=="/week")||(propertyprice=="/month")||(propertyprice=="/year")) propertyprice="请詢价";
	          	 	   if((propertyprice=="per week")||(propertyprice=="per month")||(propertyprice=="per year")) propertyprice="请詢价";
	          	 	   
	          	 	   if(propertyaddons==1) propertyprice="<font color=#ff0000><b>1元最低价拍卖</b></font>";
	          	 	   if(((propertyprice.indexOf("/week")>0)||(propertyprice.indexOf("/month")>0)||(propertyprice.indexOf("/year")>0))&&(propertyprice.indexOf("$")<0)) propertyprice="$"+propertyprice;
					
                	   if(propertcarparking==0) propertcarparking="";
                	   if(propertbedroom==0) propertbedroom="";
                	   if(propertbathroom==0) propertbathroom="";
                
						if(propertyaddress!="  "){
						   var propertyaddressArray=propertyaddress.split(" ");
						   var unitAddress="";
						   var roadAddress="";
						    
						   if(propertyaddressArray[0]!="") unitAddress=propertyaddressArray[0].replace("_"," ")+", ";
						  
						   for(var i=1;i<propertyaddressArray.length;i++){
						   	  roadAddress=roadAddress+" "+propertyaddressArray[i];
						   }
						   
						   
						   if((unitAddress=="Unit , ")||(unitAddress=="Level , ")||(unitAddress=="Suite , ")||(unitAddress=="Apartment , ")||(unitAddress=="Lot , "))
						       propertyaddress=roadAddress+",&nbsp;";
						   else
						       propertyaddress=unitAddress+roadAddress+",&nbsp;";
						   
						   if(propertyaddress=="  ,&nbsp;") propertyaddress="";
						   
						}
						
                var photodisplay="<div id='propertyListings'>";
                var soldorleased="已售";
                photodisplay=photodisplay+"<div class='propertyListing'>";
                photodisplay=photodisplay+"<div class='image-s'>";
                var propertfilename_bottom="";
                if(propertfilename.indexOf("LoveKiwi_")>=0){
                    propertfilename_bottom="<img src='http://www.lovekiwi.com/productpic/photo_original/"+propertfilename+"' border=0 width=190 height=143>";                	
                    propertfilename="<img src='http://www.lovekiwi.com/productpic/photo_original/"+propertfilename.replace("LoveKiwi_","")+"' style='border:0 outset #e6e7e9' width=80 height=60>";
                }else{
                	propertfilename_bottom="<img src='/upload/upload/images/"+propertfilename+"' border=0 width=190 height=143>";
                	propertfilename="<img src='/upload/upload/images/small/"+propertfilename+"' style='border:0 outset #e6e7e9' width=80 height=60>";
                }
                photodisplay=photodisplay+"<a href='/ch/prop.aspx?listid="+listid+"' target='_blank' class='noUnderline'>"+propertfilename+"</a>";
                if((propertyaddons==2)&&(propertstatus!=1)) photodisplay=photodisplay+"<a href='/ch/prop.aspx?listid="+listid+"' target='_blank' class='noUnderline'><img src='/images/hot.png' class='sold-s'></a>";
                
                if(propertstatus==1){
                  if((propertykind=="For Lease")||(propertykind=="2")){
                	  photodisplay=photodisplay+"<a href='/ch/prop.aspx?listid="+listid+"' target='_blank' class='noUnderline'><img src='/ch/images/leased.png' class='sold-s'></a>";
                	  soldorleased="已租";
                  }else{
                  	  photodisplay=photodisplay+"<a href='/ch/prop.aspx?listid="+listid+"' target='_blank' class='noUnderline'><img src='/ch/images/sold.png' class='sold-s'></a>";
                  	  soldorleased="已售";
                  }
                }else{
                  if((propertykind=="For Lease")||(propertykind=="2")){
                	  soldorleased="已租";
                  }else{
                  	  soldorleased="已售";
                  }                	
                }
                photodisplay=photodisplay+"</div></div></div>";
                                	
          	    if(previous_page<1) previous_page=1;
          	    if(next_page>totalpage) next_page=totalpage;
          	    
                var a_f="<a href='/ch/results.aspx?listid="+listid+"&favoriteid=1'><font color='#515a9f'>添加</font></a>";
                
                if(typeid==55) a_f="<a href='/ch/users/usermain_fav.aspx?delID="+listid+"'><font color='#0066CC'>Remove</font></a>";

                if(typeid==56){
                  displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td width=10></td><td align=middle width=84>"+photodisplay+"</td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertrefcode.replace("TMP","PVT")+"</a></td><td align=middle width=180><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyaddress+"<BR>"+propertysublocation+"</a></td><td align=middle width=80><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=90><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertdate+"</a></td><td align=middle width=40><input type=button value='编辑' style='width:40px;' onclick=\"openwindow('/ch/users/usermain_ue.aspx?listid="+listid+"')\"></td><td align=middle width=80><input type=button style='width:70px;' value='"+soldorleased+"' onclick='deList("+listid+",1,\""+soldorleased+"\")'><BR><font color=#888888><small>或者</small></font><BR><input type=button style='width:70px;' value='撤回' onclick='deList("+listid+",2,\""+soldorleased+"\")'></td></tr></table>";
                }else if(typeid==57){
                  var statustitle="撤回";
                  if(propertstatus==1){
                  	  statustitle=soldorleased;
                      status=2;
                  }else if(propertstatus==2){
                  	  statustitle="撤回";
                  	  status=1;
                  }
                  displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td width=10></td><td align=middle width=84>"+photodisplay+"</td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertrefcode.replace("TMP","PVT")+"</a></td><td align=middle width=130><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyaddress+"<BR>"+propertysublocation+"</a></td><td align=middle width=70><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=90><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertdate+"</a></td><td align=middle width=60><input type=button value='"+statustitle+"' style='width:60px;' onclick='changeStatus("+listid+","+status+",\""+statustitle+"\")'></td><td align=middle width=60><input type=button style='width:60px;' value='重新发布' onclick=\"if(confirm('Do you want to Re-List it?')) top.location='/ch/users/usermain_lh.aspx?backID="+listid+"'\"></td><td align=middle width=60><input type=button value='删除' style='width:60px;' onclick=\"if(confirm('Are you sure you want to delete this listing completely from our system?')) top.location='/ch/users/usermain_lh.aspx?delID="+listid+"'\"></td></tr></table>";
                }else{
		          if(subtype!=0){
                    if((type==8)||(type==14)){
						displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=90><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=right width=35><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertbedroom+"</td><td width=35 align=left><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/images/bedroom.gif' border=0></a></td><td align=right width=35><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertbathroom+"</td><td width=35 align=left><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/images/bathroom.gif' border=0></a></td><td align=middle width=70><table width='100%' cellpadding=0 cellspacing=0><tr><td width=35 align=right><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertcarparking+"</td><td width=35 align=left><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/images/garage.gif' border=0></a></td></tr></table></td><td align=middle width=142><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
                    }else if((type==5)||(type==4)||(type==3)||(type==11)||(type==12)||(type==13)){
						displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=90><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=right width=35><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertbedroom+"</td><td width=35 align=left><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/images/bedroom.gif' border=0></a></td><td align=right width=35><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertbathroom+"</td><td width=35 align=left><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/images/bathroom.gif' border=0></a></td><td align=middle width=70><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertlandarea+"</a></td><td align=middle width=142><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
                    }else if((type==2)||(type==10)){
						displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=90><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=70><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertfloorarea+"</a></td><td align=middle width=70><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertlandarea+"</a></td><td align=right width=35><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertcarparking+"</td><td width=35 align=left><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/images/garage.gif' border=0></a></td><td align=middle width=142><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td></a><td width=60 align=middle>"+a_f+"</td></tr></table>";
                    }else if(type==1){
						displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=90><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=70><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertturnover+"</a></td><td align=middle width=70><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>回报率</a></td><td align=right width=35><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertcarparking+"</td><td width=35 align=left><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/images/garage.gif' border=0></a></td><td align=middle width=142><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
                    }else if(type==44){
						displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=90><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=70><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertflatmate+"</a></td><td align=middle width=70><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>家具</a></td><td align=right width=35><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertcarparking+"</td><td width=35 align=left><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/images/garage.gif' border=0></a></td><td align=middle width=142><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>All inclusive</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
                    }

		            if((subtype==16) || (subtype==1552) || (subtype==1553) || (subtype==13) || (subtype==1520) || (subtype==1473)|| (subtype==1486)|| (subtype==1512) || (subtype==1556) || (subtype==1557)){
						displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertlandarea+"</a></td><td align=middle width=100><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyzoning+"</a></td><td align=middle width=142><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
		            }
		            
		          }else{
		          	if(type==0){
		          	  if(kind==0)
						  displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertytype+" "+propertysubtype+"<BR>"+propertykind+"</a></td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=162><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
					  else
					  	  displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertytype+" "+propertysubtype+"</a></td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=162><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
					}else{
					  if(kind==0)
						  displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysubtype+"<BR>"+propertykind+"</a></td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=162><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
					  else
					  	  displayContent="<table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=64><td align=middle width=104>"+photodisplay+"</td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysublocation+"<BR>"+propertylocation+"</a></td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertysubtype+"</a></td><td align=middle width=150><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyprice+"</a></td><td align=middle width=162><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'>"+propertyref+"</a></td><td width=60 align=middle>"+a_f+"</td></tr></table>";
				    }
		          } 
		            
                }

                    if(iRoot==0){
                      if(propertyaddons==0)
	                      paramsubstring=paramsubstring+"<tr height=25><td width='100%' style='border-left:#EFEFEF 1px solid;border-right:#EFEFEF 1px solid;'><table width='100%' cellpadding=0 cellspacing=0><tr height=7><td colspan=2></td></tr><tr><td width=10></td><td onmouseover=this.className='class006' onmouseout=this.className='class005' class='class005'>"+displayContent+"</td></tr></table></td></tr>";
	                  else
	                  	  paramsubstring=paramsubstring+"<tr height=25><td width='100%' style='border-left:#EFEFEF 1px solid;border-right:#EFEFEF 1px solid;'><table width='100%' cellpadding=0 cellspacing=0><tr height=7><td colspan=2></td></tr><tr><td width=10></td><td class='classAddOns'>"+displayContent+"</td></tr></table></td></tr>";
                    }else{
                      if(propertyaddons==0)
	                      paramsubstring=paramsubstring+"<tr height=25><td width='100%' style='border-left:#EFEFEF 1px solid;border-right:#EFEFEF 1px solid;'><table width='100%' cellpadding=0 cellspacing=0><tr><td width=10></td><td onmouseover=this.className='class006' onmouseout=this.className='class005' class='class005'>"+displayContent+"</td></tr></table></td></tr>";
	                  else
	                  	  paramsubstring=paramsubstring+"<tr height=25><td width='100%' style='border-left:#EFEFEF 1px solid;border-right:#EFEFEF 1px solid;'><table width='100%' cellpadding=0 cellspacing=0><tr><td width=10></td><td class='classAddOns'>"+displayContent+"</td></tr></table></td></tr>";
                    }
                                        
                    if(iRoot==root0.childNodes.length-1)
                       paramsubstring=paramsubstring+"<tr height=8><td style='border-left:#EFEFEF 1px solid;border-right:#EFEFEF 1px solid;border-bottom:#EFEFEF 1px solid;font-size:1px;'>&nbsp;</td></tr>";
                    else
                       paramsubstring=paramsubstring+"<tr height=2><td style='border-left:#EFEFEF 1px solid;border-right:#EFEFEF 1px solid;'><hr size=1 noshade style='border-style:dotted;color:#cccccc;' width='100%'></td></tr>";

                    if(iRoot<2){
                         propertyflist=propertyflist+"<td width=5></td><td><table width=190 cellpadding=0 cellspacing=0 border=0><tr><td width=190 style='border-left:#71A7CD 1px solid;border-right:#71A7CD 1px solid;border-top:#71A7CD 1px solid;border-bottom:#71A7CD 1px solid;'><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><img src='/upload/upload/images/"+propertfilename_bottom+"' border=0 width=190 height=143></a></td></tr><tr height=20><td bgcolor=#71A7CD align=middle><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><font color=#ffffff><u><b>"+propertytitle.substring(0,25)+"</b></u></font></a></td></tr></table></td><td width=5></td><td style='padding-left:10px;'><table width=180 cellpadding=0 cellspacing=0 border=0><tr><td><font color=#676767><u>"+propertysublocation+"</u></font></td></tr><tr><td><font color=#676767><u>"+propertylocation+"</u></font></td></tr><tr height=5><td></td></tr><tr><td><font color=#676767>"+propertytype+" "+propertysubtype+"<BR>"+propertykind+"</font></td></tr><tr height=5><td></td></tr><tr><td><font color=#676767>"+propertyprice.replace("<BR>","")+"</font></td></tr><tr height=5><td></td></tr><tr><td><font color=#676767>"+propertbedroom+" Beds,"+propertbathroom+" Baths,"+propertcarparking+" Cars</font></td></tr><tr height=42><td></td></tr><tr><td><a href='/ch/prop.aspx?listid="+listid+"' target='_blank'><font color=#515a9f>More...</font></a></td></tr></table>";
                    }

		      }
           }
		      var navstring="<table width='750' cellpadding=0 cellspacing=0 border=0><tr><td width='20%'></td>";
		      var prestring="<td width=50 align=middle style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+previous_page+")'>上一页</a></td><td width=2></td>";
		      var nextstring="<td width=50 align=middle style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+next_page+")'>下一页</a></td>";
		      var p_i;
		      var p_count=1;
		      
		      if(page==1) prestring="";
		      if(page==totalpage) nextstring="";
		      
		      navstring=navstring+prestring;
		      var m_p_v=7;
		      if(m_p_v>=totalpage) m_p_v=totalpage;
		      if(page<=m_p_v){
		      	 for(p_i=1;p_i<=m_p_v;p_i++){
		      	 	if(page==p_i){
		      	       navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+p_i+")'><font color='#515a9f'><b>"+p_i+"</b></font></a></td><td width=2></td>";
		      	    }else{
		      	       navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+p_i+")'>"+p_i+"</a></td><td width=2></td>";
		      	    }
		      	    p_count++;
		      	 }
		      }else{
		      	 navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+",1)'>1</a></td><td width=2></td><td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+",2)'>2</a></td><td width=2></td><td align=middle width=20>...</td><td width=2></td>";
		      	 p_count++;p_count++;
		      	 for(p_i=(page-3);p_i<page;p_i++){
		      	 	if(page==p_i){		      	 	 
		      	      navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+p_i+")'><font color='#515a9f'><b>"+p_i+"</b></font></a></td><td width=2></td>";
		      	    }else{
		      	      navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+p_i+")'>"+p_i+"</a></td><td width=2></td>";
		      	    }
		      	    p_count++;
		      	 }
		      }
		      if((page>totalpage-7)&&(totalpage>14)){
		      	 for(p_i=page;p_i<=totalpage;p_i++){
		      	 	if(page==p_i){		      	 	 
		      	      navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+p_i+")'><font color='#515a9f'><b>"+p_i+"</b></font></a></td><td width=2></td>";
		      	    }else{
		      	      navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+p_i+")'>"+p_i+"</a></td><td width=2></td>";
		      	    }
		      	    p_count++;
		      	 }
		      }else{
		      	 var from_page=page;
		      	 var to_page=parseInt(page)+3;
		      	 
		      	 if(page<8){
		      	 	 from_page=8;
		      	 	 to_page=11;
		      	 }
		      	 if(totalpage<to_page) to_page=totalpage;
		      	 
		      	 for(p_i=from_page;p_i<=to_page;p_i++){
		      	 	if(page==p_i){
		      	      navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+p_i+")'><font color='#515a9f'><b>"+p_i+"</b></font></a></td><td width=2></td>";
		      	    }else{
		      	      navstring=navstring+"<td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+p_i+")'>"+p_i+"</a></td><td width=2></td>";
		      	    }
		      	    p_count++;
		      	 }
		      	 if(totalpage>11){
		      	   navstring=navstring+"<td align=middle width=20>...</td><td width=2></td><td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+(totalpage-1)+")'>"+(totalpage-1)+"</a></td><td width=2></td><td align=middle width=20 style='border-left:#666666 1px solid;border-right:#666666 1px solid;border-top:#666666 1px solid;border-bottom:#666666 1px solid;'><a href=# onclick='pageChange("+ordertype+","+totalpage+")'>"+totalpage+"</a></td><td width=2></td>";		      	 
		      	   p_count++;p_count++;
		      	 }
		      }
		      navstring=navstring+nextstring;
		      for(var p_i=p_count;p_i<=15;p_i++){
		      	  navstring=navstring+"<td width=20></td>"
		      }		      
		      navstring=navstring+"<td width='20%'></td></tr>";
		      
          	  var paramsubstring001="";
		      var orderselect="<select name=sortID id=sortID onchange='orderChange(this.options[this.selectedIndex].value)'>";
		      if(ordertype==1){
		      	  orderselect=orderselect+"<option value=1 selected>Price - High to Low</option><option value=2>Price - Low to High</option><option value=3>Location - A to Z</option><option value=4>Bedroom - Hight to Low</option></select>";
		      }else if(ordertype==2){
		      	  orderselect=orderselect+"<option value=1>Price - High to Low</option><option value=2 selected>Price - Low to High</option><option value=3>Location - A to Z</option><option value=4>Bedroom - Hight to Low</option></select>";
		      }else if(ordertype==3){
		      	  orderselect=orderselect+"<option value=1>Price - High to Low</option><option value=2>Price - Low to High</option><option value=3 selected>Location - A to Z</option><option value=4>Bedroom - Hight to Low</option></select>";
		      }else if(ordertype==4){
		      	  orderselect=orderselect+"<option value=1>Price - High to Low</option><option value=2>Price - Low to High</option><option value=3>Location - A to Z</option><option value=4 selected>Bedroom - Hight to Low</option></select>";
		      }
		      
		      if(subtype!=0){
	              if((type==8)||(type==14)){
			      	 paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td align=middle width=104><font color=#808080><b>图片</b></font></td><td align=middle width=100><a href=# onclick='orderChange(3)'><font color='#808080'><b>社区</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=90><a href=# onclick='orderChange(2)'><font color='#808080'><b>价格</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70 cospan=2><a href=# onclick='orderChange(4)'><font color='#808080'><b>卧室</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70 cospan=2><a href=# onclick='orderChange(6)'><font color='#808080'><b>浴室</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70 cospan=2><a href=# onclick='orderChange(7)'><font color='#808080'><b>车位</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=142><a href=# onclick='orderChange(8)'><font color='#808080'><b>广告发布</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td width=60 align=left><font color='#808080'><b>我的喜爱</b></font></td></tr><tr height=1><td colspan=8 bgcolor=#EFEFEF></td></tr></table></td></tr>";
	              }else if((type==5)||(type==4)||(type==3)||(type==11)||(type==12)||(type==13)){
			      	 paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td align=middle width=104><font color=#808080><b>图片</b></font></td><td align=middle width=100><a href=# onclick='orderChange(3)'><font color='#808080'><b>社区</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=90><a href=# onclick='orderChange(2)'><font color='#808080'><b>价格</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70 cospan=2><a href=# onclick='orderChange(4)'><font color='#808080'><b>卧室</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70 cospan=2><a href=# onclick='orderChange(6)'><font color='#808080'><b>浴室</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70><a href=# onclick='orderChange(9)'><font color='#808080'><b>占地面积</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=142><a href=# onclick='orderChange(8)'><font color='#808080'><b>广告发布</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td width=60 align=left><font color='#808080'><b>我的喜爱</b></font></td></tr><tr height=1><td colspan=8 bgcolor=#EFEFEF></td></tr></table></td></tr>";
	              }else if((type==2)||(type==10)){
			      	 paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td align=middle width=104><font color=#808080><b>图片</b></font></td><td align=middle width=100><a href=# onclick='orderChange(3)'><font color='#808080'><b>社区</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=90><a href=# onclick='orderChange(2)'><font color='#808080'><b>价格</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70><a href=# onclick='orderChange(10)'><font color='#808080'><b>楼面面积</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70><a href=# onclick='orderChange(9)'><font color='#808080'><b>占地面积</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70 cospan=2><a href=# onclick='orderChange(7)'><font color='#808080'><b>车位</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=142><a href=# onclick='orderChange(8)'><font color='#808080'><b>广告发布</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td width=60 align=left><font color='#808080'><b>我的喜爱</b></font></td></tr><tr height=1><td colspan=8 bgcolor=#EFEFEF></td></tr></table></td></tr>";
	              }else if(type==1){
			      	 paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td align=middle width=104><font color=#808080><b>图片</b></font></td><td align=middle width=100><a href=# onclick='orderChange(3)'><font color='#808080'><b>社区</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=90><a href=# onclick='orderChange(2)'><font color='#808080'><b>价格</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70><a href=# onclick='orderChange(11)'><font color='#808080'><b>销售额</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70><a href=# onclick='orderChange(9)'><font color='#808080'><b>回报率</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70>&nbsp;</td><td align=middle width=142><a href=# onclick='orderChange(8)'><font color='#808080'><b>广告发布</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td width=60 align=left><font color='#808080'><b>我的喜爱</b></font></td></tr><tr height=1><td colspan=8 bgcolor=#EFEFEF></td></tr></table></td></tr>";
	              }else if(type==44){
			      	 paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td align=middle width=104><font color=#808080><b>图片</b></font></td><td align=middle width=100><a href=# onclick='orderChange(3)'><font color='#808080'><b>社区</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=90><a href=# onclick='orderChange(2)'><font color='#808080'><b>价格</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70 cospan=2><a href=# onclick='orderChange(4)'><font color='#808080'><b>卧室</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=70><font color='#808080'><b>家具</b></font></td><td align=middle width=70>&nbsp;</td><td align=middle width=142><font color='#808080'><b>All inclusive</b></font></td><td width=60 align=left><font color='#808080'><b>我的喜爱</b></font></td></tr><tr height=1><td colspan=8><hr size=1 noshade style='border-style:dotted;color:#B1D8FF;' width='100%'></td></tr></table></td></tr>";
	              }
	              
	              if((subtype==16) || (subtype==1552) || (subtype==1553) || (subtype==13) || (subtype==1520) || (subtype==1473)|| (subtype==1486)|| (subtype==1512) || (subtype==1556) || (subtype==1557)){
			      	 paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td align=middle width=104><font color=#808080><b>图片</b></font></td><td align=middle width=100><a href=# onclick='orderChange(3)'><font color='#808080'><b>社区</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=100><a href=# onclick='orderChange(2)'><font color='#808080'><b>价格</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=100><a href=# onclick='orderChange(4)'><font color='#808080'><b>占地面积</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=100><a href=# onclick='orderChange(6)'><font color='#808080'><b>Zoning</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=142><a href=# onclick='orderChange(8)'><font color='#808080'><b>广告发布</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td width=60 align=left><font color='#808080'><b>我的喜爱</b></font></td></tr><tr height=1><td colspan=8 bgcolor=#EFEFEF></td></tr></table></td></tr>";
	              }
              }else{
			      	 paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td align=middle width=104><font color=#808080><b>图片</b></font></td><td align=middle width=150><a href=# onclick='orderChange(3)'><font color='#808080'><b>社区</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=150><a href=# onclick='orderChange(5)'><font color='#808080'><b>物业类型</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=150><a href=# onclick='orderChange(2)'><font color='#808080'><b>价格</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td align=middle width=162><a href=# onclick='orderChange(8)'><font color='#808080'><b>广告发布</b></font> <img src='/images/arrowflag.gif' border=0></a></td><td width=60 align=left><font color='#808080'><b>我的喜爱</b></font></td></tr><tr height=1><td colspan=8 bgcolor=#EFEFEF></td></tr></table></td></tr>";
              }
              

              
              if(typeid==56) paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td width=10></td><td align=middle width=84><font color=#808080><b>图片</b></font></td><td align=middle width=100><font color=#808080><b>ID</b></font></td><td align=middle width=180><font color='#808080'><b>地址</b></font></td><td align=middle width=80><font color='#808080'><b>价格</b></font></td><td align=middle width=90><font color='#808080'><b>发布时间</b></font></td><td align=middle width=40><font color='#808080'><b>编辑</b></font></td><td align=middle width=80><font color='#808080'><b>修改状态到</b></font></td></tr><tr height=1><td colspan=8 bgcolor=#EFEFEF></td></tr></table></td></tr>";
              if(typeid==57) paramsubstring001="<tr><td width='100%' align=right align=right><table width='100%' cellpadding=0 cellspacing=0 border=0><tr height=25 bgcolor=#F8FFFF><td width=10></td><td align=middle width=84><font color=#808080><b>图片</b></font></td><td align=middle width=100><font color=#808080><b>ID</b></font></td><td align=middle width=130><font color='#808080'><b>地址</b></font></td><td align=middle width=70><font color='#808080'><b>价格</b></font></td><td align=middle width=90><font color='#808080'><b>发布时间</b></font></td><td align=middle width=60><font color='#808080'><b>状况</b></font></td><td align=middle width=60><font color='#808080'><b>重新发布</b></font></td><td align=middle width=60><font color='#808080'><b>删除</b></font></td></tr><tr height=1><td colspan=9 bgcolor=#EFEFEF></td></tr></table></td></tr>";
              	  
		      paramsubstring="<table width='100%' cellpadding=0 cellspacing=0 border=0 style='border-left:#EFEFEF 1px solid;border-right:#EFEFEF 1px solid;'>"+paramsubstring001+paramsubstring+"</table>";
              propertyflist=propertyflist+"<td width=5></td></tr></table>";
              navdivlist=navstring+"</table>";
              if((totalpage<=1)||(totalpage==undefined)) navdivlist="<table></table>";
              
              if((typeid==5)||(typeid==55)||(typeid==56)||(typeid==57)) amountChange(stringAmount);
              
              if((typeid==5)&&(stringAgentInfo!="|||||")){
              	  var stringAgentInfoArray=stringAgentInfo.split("|");
              	  //var agentDisplayString="<table width=230 cellpadding=0 cellspacing=0 border=0><tr height=85><td align=middle>";
              	  var agentDisplayString="<table width=183 cellpadding=0 cellspacing=0 border=0><tr><td align=middle>";
              	  if((stringAgentInfoArray[4]!="")&&(stringAgentInfoArray[4]!=null))
              	      //agentDisplayString=agentDisplayString+"<a href='"+stringAgentInfoArray[4]+"' target='_blank'><img src='/upload/upload/vipads/"+stringAgentInfoArray[5]+"' border=0></a>";
              	      agentDisplayString=agentDisplayString+"<a href='"+stringAgentInfoArray[4]+"' target='_blank'><img src='/upload/upload/images/small/"+stringAgentInfoArray[1]+"' border=0></a>";
              	  else
              	  	  //agentDisplayString=agentDisplayString+"<img src='/upload/upload/vipads/"+stringAgentInfoArray[5]+"' border=0>";
              	      agentDisplayString=agentDisplayString+"<img src='/upload/upload/images/small/"+stringAgentInfoArray[1]+"' border=0>";

                  agentDisplayString=agentDisplayString+"</td></tr></table>";
              	  //var agentObject=document.getElementById("agentDisplay");
              	  var agentObject=document.getElementById("agentSmallLogo");
              	  if(agentObject!=null){
              	    agentObject.innerHTML=agentDisplayString;
              	  }
              }

              if((document.getElementById("agentDisplay")!=null)&&(userid==0)){
                  document.getElementById("agentDisplay").innerHTML="<table width=230 cellpadding=0 cellspacing=0 border=0><tr height=85><td align=right style='padding-right:20px;'><img src='/ads/ad2.jpg' border=0></td></tr></table>";
              }
              
              if((stringAgentInfo=="|||||")&&(document.getElementById("agentSmallLogo")!=null)&&(userid==0)) document.getElementById("agentSmallLogo").innerHTML="<table width=183 cellpadding=0 cellspacing=0 border=0><tr><td align=middle><input type=button value='我要放免费广告' onclick='top.location=\"/ch/users/usermain_ul.aspx\"' style='width:120px;font-size:9pt;'></td></tr></table>";
              

          }else if((typeid==6) || (typeid==61) || (typeid==62)){
              var fileid,filename,filemain,filenamegroup;
              var propertykind,propertyprice,propertytype,propertysubtype,propertybedroom,propertybathroom,propertyfloorarea,propertylandarea,propertyparking,propertyview,propertybuiltyear,propertytitle,propertytitle_en,propertyarea,propertyarea_en,propertyzoning,propertyrentalincome,propertybusinessrent,propertyturnover,propertyrentvalue,propertyoutgoings,propertyflatmate,propertyfurniture,propertycommercialoe,propertytenantshare,propertyaddress,propertyfeature,propertyfeature_en,propertygv,propertyev,propertygst,propertyjoin;
              var propertytypevalue,propertysubtypevalue,propertylocationvalue,propertysublocationvalue,propertyhits;
              var photoEditDiv,photoEditDivRemove;

              filenamegroup="";propertyjoin="";propertybuiltyear="";propertycommercialoe="";propertygv="";propertyaddress=" ";propertyarea="";propertyprice="";propertytitle_en="";propertyfeature_en="";propertyarea_en="";
              photoEditDivRemove="<tr valign=middle>";
              listphotodiv="<table cellSpacing='0' cellPadding='0' width='100%' border='0'>";
              listphotodiv=listphotodiv+"<tr valign=middle>";
              photoEditDiv=listphotodiv;
              
              
	      for (var iRoot = 0; iRoot < root0.childNodes.length-1; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   fileid=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "filename"){
	          	 	   filename=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "filemain"){
	          	 	   filemain=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	             }
	             if((iRoot==0)&&((typeid==6)||(typeid==62))){
	             	 if(filename.indexOf("LoveKiwi_")>=0){
	                	mainphotodiv="<table cellSpacing='0' cellPadding='0' width='380' border='0'><tr><td class='smallPhotoStyle'><div id='propertyListings'><div class='propertyListing'><div class='image-b'><img id=mainPhoto src='http://www.lovekiwi.com/productpic/photo_original/"+filename.replace("LoveKiwi_","")+"' width=380 height=260>"+agentcompare4+"</div></div></div></td></tr></table>";
	                 }else{
	                 	mainphotodiv="<table cellSpacing='0' cellPadding='0' width='380' border='0'><tr><td class='smallPhotoStyle'><div id='propertyListings'><div class='propertyListing'><div class='image-b'><img id=mainPhoto src='/upload/upload/images/"+filename+"' width=380 height=260>"+agentcompare4+"</div></div></div></td></tr></table>";
	                 }
	             }
				 if(fileid==0) listphotodiv=listphotodiv+"<td width=40>&nbsp;</td><td width=2></td>";
				
	             if((iRoot<12)&&(fileid!=0)){
	               if(filename.indexOf("LoveKiwi_")>=0){	 
	                 listphotodiv=listphotodiv+"<td class='smallPhotoStyle' width=40 onmouseover=this.className='focusPhotoStyle' onmouseout=this.className='smallPhotoStyle'><a href=java"+"script:onclick=changePhoto(\'"+filename+"\')><img src='http://www.lovekiwi.com/productpic/photo_original/"+filename.replace("LoveKiwi_","")+"' border=0 width=40 height=30></a></td><td width=2></td>";
	               }else{
	                 listphotodiv=listphotodiv+"<td class='smallPhotoStyle' width=40 onmouseover=this.className='focusPhotoStyle' onmouseout=this.className='smallPhotoStyle'><a href=java"+"script:onclick=changePhoto(\'"+filename+"\')><img src='/upload/upload/images/small/"+filename+"' border=0 width=40 height=30></a></td><td width=2></td>";
	               }
	             }
	             if(iRoot<12){
	             	if(filename.indexOf("LoveKiwi_")>=0){
	                  photoEditDiv=photoEditDiv+"<td width=4></td><td class='smallPhotoStyle' width=40 onmouseover=this.className='focusPhotoStyle' onmouseout=this.className='smallPhotoStyle' id='removePhotoTD"+fileid+"'><img src='http://www.lovekiwi.com/productpic/photo_original/"+filename.replace("LoveKiwi_","")+"' border=0 width=40 height=30></td><td width=4></td>";
	                }else{
	                  photoEditDiv=photoEditDiv+"<td width=4></td><td class='smallPhotoStyle' width=40 onmouseover=this.className='focusPhotoStyle' onmouseout=this.className='smallPhotoStyle' id='removePhotoTD"+fileid+"'><img src='/upload/upload/images/small/"+filename+"' border=0 width=40 height=30></td><td width=4></td>";
	                }
	                
	                if(filemain==1)
	                	photoEditDivRemove=photoEditDivRemove+"<td width=4></td><td width=40 id='removePhotoTDWord"+fileid+"' align=middle><a href=java"+"script:onclick=removePhotoEdit("+fileid+")><u>remove</u></a><BR><input type=radio name=rdoPhoto onclick='makeMainPhoto("+fileid+")' checked> Main photo</td><td width=4></td>";
	                else
	                    photoEditDivRemove=photoEditDivRemove+"<td width=4></td><td width=40 id='removePhotoTDWord"+fileid+"' align=middle><a href=java"+"script:onclick=removePhotoEdit("+fileid+")><u>remove</u></a><BR><input type=radio name=rdoPhoto onclick='makeMainPhoto("+fileid+")'> Main photo</td><td width=4></td>";
	                
	                if((iRoot==0)&&(typeid==61)) makeMainPhoto(fileid);
	             }
	             
	             filenamegroup=filenamegroup+filename+"|";
	      }
 
 	             for(var d=iRoot;d<12;d++){
	             	photoEditDiv=photoEditDiv+"<td width=40></td><td width=4></td>";
	             	photoEditDivRemove=photoEditDivRemove+"<td width=40></td><td width=4></td>";
	             }
	             
              data_node=root0.childNodes.item(root0.childNodes.length-1);
	            for (iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  item_node=data_node.childNodes.item(iData);
	          	  for (iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "propertyprice"){
	          	  	   propertyprice=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertygst"){
	          	 	   propertygst=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertykind"){
	          	 	   propertykind=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertytype"){
	          	 	   propertytype=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertysubtype"){
	          	 	   propertysubtype=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertybedroom"){
	          	 	   propertybedroom=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertybathroom"){
	          	 	   propertybathroom=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyfloorarea"){
	          	 	   propertyfloorarea=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertylandarea"){
	          	 	   propertylandarea=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyparking"){
	          	 	   propertyparking=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyparkingport"){
	          	 	   propertyparkingport=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyparkingoff"){
	          	 	   propertyparkingoff=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyview"){
	          	 	   propertyview=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertybuiltyear"){
	          	 	   propertybuiltyear=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertytitle"){
	          	 	   propertytitle=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyarea"){
	          	 	   propertyarea=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyfeature"){
	          	 	   propertyfeature=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertytitle_english"){
	          	 	   propertytitle_en=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyarea_english"){
	          	 	   propertyarea_en=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyfeature_english"){
	          	 	   propertyfeature_en=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyzoning"){
	          	 	   propertyzoning =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyrentalincome"){
	          	 	   propertyrentalincome =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyturnover"){
	          	 	   propertyturnover =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertybusinessrent"){
	          	 	   propertybusinessrent =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyrentvalue"){
	          	 	   propertyrentvalue =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyoutgoings"){
	          	 	   propertyoutgoings =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyflatmate"){
	          	 	   propertyflatmate =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyfurniture"){
	          	 	   propertyfurniture =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertytenantshare"){
	          	 	   propertytenantshare =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertycommercialoe"){
	          	 	   propertycommercialoe =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertytypevalue"){
	          	 	   propertytypevalue =item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertysubtypevalue"){
	          	 	   propertysubtypevalue=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertylocationvalue"){
	          	 	   propertylocationvalue=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertysublocationvalue"){
	          	 	   propertysublocationvalue=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyaddress"){
	          	 	   propertyaddress=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertygv"){
	          	 	   propertygv=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyev"){
	          	 	   propertyev=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyjoin"){
	          	 	   propertyjoin=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "propertyhits"){
	          	 	   propertyhits=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  }
	             }

              if(fileid!=0)
                listphotodiv=listphotodiv+"<td width=10>&nbsp;</td><td width='100%' align=left></td></tr></table>";
              else
                listphotodiv=listphotodiv+"<td width=10>&nbsp;</td><td width='100%' align=left></td></tr></table>";
              
              var filterPrice=propertyprice;
              if(IsNumericAjax(propertyprice)) filterPrice="$"+number_format(propertyprice);
              if((filterPrice=="")||(filterPrice=="$0")||(filterPrice=="0")) filterPrice="请詢价";
      	 	  filterPrice=filterPrice.replace("Auction","拍卖");
      	 	  filterPrice=filterPrice.replace("Tender","限时投标");
      	 	  filterPrice=filterPrice.replace("POA","询价");
      	 	  filterPrice=filterPrice.replace("Private Treaty","个别协议");
      	 	  filterPrice=filterPrice.replace("Price by Negotiation","议价");
      	 	  filterPrice=filterPrice.replace("Expressions of Interest","投标");
	          	 	                 
              var filterKind="出售";
              if(propertykind==2) filterKind="出租";
              var individualdiv1='<tr height=25><td align=right width=100><font color=#6D6B6C><b>价格</b>:&nbsp&nbsp</td><td width=219 align=left>'+filterPrice+'</font><td></tr>';
              var individualdiv2='<tr height=25><td align=right width=100><font color=#6D6B6C><b>物业类型</b>:&nbsp&nbsp</td><td width=219 align=left>'+propertytype+' '+propertysubtype+' '+filterKind+'</font><td></tr>';
              var individualdiv2_1='<tr height=25><td align=right width=100><font color=#6D6B6C><b>物业类型</b>:&nbsp&nbsp</td><td width=219 align=left>'+propertytype+'</font><td></tr>';
              
              var filterRooms=propertybedroom+' 卧室, '+propertybathroom+' 浴室';
              if((propertybedroom==0)&&(propertybathroom==0)) filterRooms=''; else if(propertybedroom==0) filterRooms=propertybathroom+' 浴室'; else if(propertybathroom==0) filterRooms=propertybedroom+' 卧室';
              
              var individualdiv3='<tr height=25><td align=right width=100><font color=#6D6B6C><b>卧室</b>:&nbsp&nbsp</td><td width=219 align=left>'+filterRooms+'</font><td></tr>';
              var individualdiv3_1='<tr height=25><td align=right width=100><font color=#6D6B6C><b>卧室</b>:&nbsp&nbsp</td><td width=219 align=left>'+propertyflatmate+'</font><td></tr>';

              var filterFloor=propertyfloorarea;
              if((propertyfloorarea==" sqm")||(propertyfloorarea==" sqf")){
                  filterFloor="";
              }else{
              	  var floorareaArray=propertyfloorarea.split(" ");
              	  if(IsNumericAjax(floorareaArray[0])) filterFloor=number_format(floorareaArray[0])+" "+floorareaArray[1]; else filterFloor=propertyfloorarea;
              }
              
              var individualdiv4='<tr height=25><td align=right width=100><font color=#6D6B6C><b>楼面面积</b>:&nbsp&nbsp</td><td width=219 align=left>'+filterFloor+'</font><td></tr>';
              var filterLand=propertylandarea;
              if((propertylandarea==" sqm")||(propertylandarea==" sqf")){
                  filterLand="";
              }else{
              	  var landareaArray=propertylandarea.split(" ");
              	  if(IsNumericAjax(landareaArray[0])) filterLand=number_format(landareaArray[0])+" "+landareaArray[1]; else filterLand=propertylandarea;
              }
              
              var individualdiv5='<tr height=25><td align=right width=100><font color=#6D6B6C><b>占地面积</b>:&nbsp&nbsp</td><td width=219 align=left>'+filterLand+'</font><td></tr>';

              var parking,parkingport,parkingoff;
              parking="";
              parkingport="";
              parkingoff="";

              if(propertyparking!=0) parking="车位 "+propertyparking;
              if(propertyparkingport!=0){
                if(propertyparking!=0)
                   parkingport=", 车棚 "+propertyparkingport;
                else
                   parkingport="车棚 "+propertyparkingport;
              }

              if(propertyparkingoff!=0){
                 if((propertyparking==0)&&(propertyparkingport==0))
                   parkingoff="院内停车位 "+propertyparkingoff;
                 else
                   parkingoff=", 院内停车位 "+propertyparkingoff;
              }
              var individualdiv6='<tr height=25><td align=right width=100><font color=#6D6B6C><b>车位</b>:&nbsp&nbsp</td><td width=219 align=left>'+parking+parkingport+parkingoff+'</font><td></tr>';
              var individualdiv7='<tr height=25><td align=right width=100><font color=#6D6B6C><b>景观</b>:&nbsp&nbsp</td><td width=219 align=left>'+getViewChineseName(propertyview)+'</font><td></tr>';
              var individualdiv8='<tr height=25><td align=right width=100><font color=#6D6B6C><b>建筑时间</b>:&nbsp&nbsp</td><td width=219 align=left>'+propertybuiltyear+'</font><td></tr>';
              var individualdiv9='<tr height=25 valign=top><td align=right width=100><font color=#6D6B6C><b>在该地区内有</b>:&nbsp&nbsp</td><td width=219 align=left>'+propertyarea+'<td></tr>';
              var individualdiv9_1='<tr height=25 valign=top><td align=right width=100><font color=#6D6B6C><b>家具</b>:&nbsp&nbsp</td><td width=219 align=left>'+propertyfurniture+'<td></tr>';
              if(propertyzoning==null) propertyzoning='';
              var individualdiv10='<tr height=25><td align=right width=100><font color=#6D6B6C><b>分区</b>:&nbsp&nbsp</td><td width=219 align=left>'+propertyzoning+'</font><td></tr>';
              var propertyrentalincomefilter=propertyrentalincome;
              if((propertyrentalincome=="0 (NZ$) per week")||(propertyrentalincome=="0 (NZ$) per month")||(propertyrentalincome=="0 (NZ$) per year")){
                propertyrentalincomefilter="";
              }else{
              	var propertyrentalincometmp=propertyrentalincome.split(" (NZ$)");
              	propertyrentalincomefilter="$"+number_format(propertyrentalincometmp[0])+propertyrentalincometmp[1];
              }
              
              var individualdiv11='<tr height=25><td align=right width=100><font color=#6D6B6C><b>租赁收入</b>:&nbsp&nbsp</td><td width=219 align=left>'+propertyrentalincomefilter+'</font><td></tr>';
              var filterTurnover=propertyturnover;
              if((propertyturnover==" (NZ$) per week")||(propertyturnover==" (NZ$) per month")||(propertyturnover==" (NZ$) per year")){
                  filterTurnover="";
              }else{
              	  var filterTurnoverArray=filterTurnover.split(" ");
              	  filterTurnover="$"+number_format(filterTurnoverArray[0])+" "+filterTurnoverArray[2]+" "+filterTurnoverArray[3]
              }
              
              var individualdiv12='<tr height=25><td align=right width=100><font color=#6D6B6C><b>销售额</b>:&nbsp&nbsp</td><td width=219 align=left>'+filterTurnover+'</font><td></tr>';
              
              var rentpricefilter="$"+propertyrentvalue.replace(" per ","/");
              if((rentpricefilter=="$/week")||(propertyturnover=="$/month")||(propertyturnover=="$/year")||(propertyturnover=="")) rentpricefilter="请詢价";
              if((rentpricefilter=="$0/week")||(rentpricefilter=="$0/month")||(rentpricefilter=="$0/year")) rentpricefilter="请詢价";
              if((rentpricefilter=="per week")||(rentpricefilter=="per month")||(rentpricefilter=="per year")) rentpricefilter="请詢价";
              
              var individualdiv13='<tr height=25><td align=right width=100><font color=#6D6B6C><b>租赁价格</b>:&nbsp&nbsp</td><td width=219 align=left>'+rentpricefilter+'</font><td></tr>';
              var filterOutgoings=propertyoutgoings;
              if((propertyoutgoings==" (NZ$) per week")||(propertyoutgoings==" (NZ$) per month")||(propertyoutgoings==" (NZ$) per year")) filterOutgoings="";
              var individualdiv14='<tr height=25><td align=right width=100><font color=#6D6B6C><b>支出</b>:&nbsp&nbsp</td><td width=219 align=left>'+filterOutgoings+'</font><td></tr>';
              var individualdiv14_1='<tr height=25><td align=right width=100><font color=#6D6B6C><b>Rates</b>:&nbsp&nbsp</td><td width=219 align=left>'+filterOutgoings+'</font><td></tr>';
              var filterTenantshare=propertytenantshare;
              if(propertytenantshare=="%") filterTenantshare="";
              var individualdiv15='<tr height=25><td align=right width=100><font color=#6D6B6C><b>租客分享</b>:&nbsp&nbsp</td><td width=219 align=left>'+filterTenantshare+'</font><td></tr>';

              if((propertytypevalue==4)||(propertytypevalue==5)||(propertytypevalue==8)){
			  if((propertysubtypevalue==16)||(propertysubtypevalue==1552)||(propertysubtypevalue==1553)){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv1+individualdiv2+individualdiv5+individualdiv7+individualdiv10+individualdiv9+'</table>';
                }else{
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv1+individualdiv2+individualdiv3+individualdiv4+individualdiv5+individualdiv6+individualdiv7+individualdiv8+individualdiv9+'</table>';
                }
              }else if(propertytypevalue==3){
		if(propertysubtypevalue==1473){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv1+individualdiv2+individualdiv5+individualdiv7+individualdiv9+'</table>';
                }else{
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv1+individualdiv2+individualdiv3+individualdiv5+individualdiv7+individualdiv9+'</table>';
                }
              }else if(propertytypevalue==2){
		if(propertysubtypevalue==13){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv1+individualdiv2+individualdiv5+individualdiv7+individualdiv10+individualdiv9+'</table>';
                }else{
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv1+individualdiv2+individualdiv11+individualdiv4+individualdiv5+individualdiv6+individualdiv7+individualdiv8+individualdiv9+'</table>';
                }
              }else if(propertytypevalue==1){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv1+individualdiv2+individualdiv12+individualdiv13+individualdiv14+individualdiv9+'</table>';
              }else if(propertytypevalue==44){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv13+individualdiv2_1+individualdiv3_1+individualdiv7+individualdiv9_1+individualdiv9+'</table>';
              }else if((propertytypevalue==14)||(propertytypevalue==12)||(propertytypevalue==13)){
		if((propertysubtypevalue==1486) || (propertysubtypevalue==1556) || (propertysubtypevalue==1557)){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv13+individualdiv2+individualdiv7+individualdiv9_1+individualdiv9+'</table>';
                }else{
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv13+individualdiv2+individualdiv3+individualdiv4+individualdiv6+individualdiv7+individualdiv9_1+individualdiv9+'</table>';
                }
              }else if(propertytypevalue==11){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv13+individualdiv2+individualdiv5+individualdiv3+individualdiv7+individualdiv9+'</table>';
              }else if(propertytypevalue==10){
		if(propertysubtypevalue==1520){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv13+individualdiv2+individualdiv5+individualdiv7+individualdiv14_1+individualdiv10+individualdiv9+'</table>';
                }else{
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv13+individualdiv2+individualdiv5+individualdiv4+individualdiv6+individualdiv7+individualdiv8+individualdiv14+individualdiv15+individualdiv9+'</table>';
                }
              }else if(propertytypevalue==9){
                   individualdiv='<table width="309" cellpadding=0 cellspacing=0 border=0>'+individualdiv13+individualdiv2+individualdiv3+individualdiv4+individualdiv5+individualdiv6+individualdiv7+individualdiv8+individualdiv9+'</table>';
              }
              if((typeid==6)||(typeid==62)){
                if(document.all) document.getElementById('lblPropertyHits').innerText=propertyhits;else document.getElementById('lblPropertyHits').textContent=propertyhits;
              }
              if(typeid==61){
              	  //layout the page
              	  changeActionInitial(propertytypevalue,-2);
              	  changeSubAction(propertysubtypevalue,2);
              	  changeActionInitial(propertylocationvalue,-4);
              	  changeSubAction(propertysublocationvalue,1);
              	  
              	  if(propertykind==1){
              	  	   document.getElementById('RadioButton1').checked=true;
				       document.getElementById('gvDiv').style.display="";
				       document.getElementById('divPriceOption').style.display="";
				       document.getElementById('priceDiv').innerHTML="Selling by";
				       document.getElementById('divRentForLet').style.display="none";              	  	  
              	  }else{
              	  	   document.getElementById('RadioButton2').checked=true;
				       document.getElementById('gvDiv').style.display="none";
				       document.getElementById('divPriceOption').style.display="none";
				       document.getElementById('priceDiv').innerHTML="Rent";
				       document.getElementById('divRentForLet').style.display="";              	  	   
                  }
              	  
              	  var propertyaddressArray=propertyaddress.split(" ");
              	  var unitArray=propertyaddressArray[0].split("_");
              	  if(unitArray.length>0){
              	    document.getElementById('txtPropertyAddressUnit').value=unitArray[1];
              	    if(unitArray[0]=="Unit")
              	    	document.getElementById("ddlUnitCategory").options[0].selected=true;
              	    else if(unitArray[0]=="Floor")
              	    	document.getElementById("ddlUnitCategory").options[1].selected=true;
              	    else if(unitArray[0]=="Suite")
              	    	document.getElementById("ddlUnitCategory").options[2].selected=true;
              	    else if(unitArray[0]=="Level")
              	    	document.getElementById("ddlUnitCategory").options[3].selected=true;
              	  }else{
              	    document.getElementById('txtPropertyAddressUnit').value=(propertyaddressArray[0]==null?"":propertyaddressArray[0]);
              	  }
              	  document.getElementById('txtPropertyAddressStreet').value=propertyaddressArray[1];
              	  for(var a=2;a<propertyaddressArray.length;a++){
              	  	 if(a==2)
              	  	     document.getElementById('txtPropertyAddress').value=propertyaddressArray[a];
              	  	 else
              	  	     document.getElementById('txtPropertyAddress').value=document.getElementById('txtPropertyAddress').value+" "+propertyaddressArray[a];
              	  }
              	  
              	  propertybedroomInt=parseInt(propertybedroom);
              	  var ddlBedroomName="ddlBedroom_1";
              	  if((propertytype==3)||(propertytype==11)) ddlBedroomName="ddlBedroom_3"
              	  	  
              	  if(propertybedroomInt!=50)
              	      document.getElementById(ddlBedroomName).options[propertybedroomInt].selected=true;
              	  else
              	      document.getElementById(ddlBedroomName).options[5].selected=true;
              	 
              	  propertybathroomInt=parseInt(propertybathroom);              	  
              	  if(propertybathroomInt!=50)              	  
              	      document.getElementById("ddlBathroom").options[propertybathroomInt].selected=true;
              	  else
              	      document.getElementById("ddlBathroom").options[6].selected=true;
              	  
              	  var ddlViewName="ddlView_1";
              	  var txtPropertyLandAreaName="txtPropertyLandArea_1";
              	  var LandAreaMeasureName="ddlLandAreaMeasure_1";
              	  var txtPropertyFloorAreaName="txtPropertyFloorArea_1";
              	  var FloorAreaMeasureName="ddlFloorAreaMeasure_1";
              	  var txtBuiltYearName="txtBuiltYear_1";
              	  
              	  if((propertytypevalue==2)||(propertytypevalue==10)){ddlViewName="ddlView_2";txtPropertyLandAreaName="txtPropertyLandArea_2";LandAreaMeasureName="ddlLandAreaMeasure_2";txtPropertyFloorAreaName="txtPropertyFloorArea_2";FloorAreaMeasureName="ddlFloorAreaMeasure_2";txtBuiltYearName="txtBuiltYear_2";}
              	  else if((propertytypevalue==3)||(propertytypevalue==11)){ddlViewName="ddlView_3";txtPropertyLandAreaName="txtPropertyLandArea_3";LandAreaMeasureName="ddlLandAreaMeasure_3";}
               	  if((propertysubtypevalue==16)||(propertysubtypevalue==1552)||(propertysubtypevalue==1553)||(propertysubtypevalue==13)||(propertysubtypevalue==1520)||(propertysubtypevalue==1473)||(propertysubtypevalue==1486)||(propertysubtypevalue==1512)||(propertysubtypevalue==1556)||(propertysubtypevalue==1557)){ddlViewName="ddlView_4";txtPropertyLandAreaName="txtPropertyLandArea_4";LandAreaMeasureName="ddlLandAreaMeasure_4";}
             	  	  
              	  if(propertyview=="No View") document.getElementById(ddlViewName).options[0].selected=true;
              	  else if(propertyview=="Bush View") document.getElementById(ddlViewName).options[1].selected=true;
              	  else if(propertyview=="Forest View") document.getElementById(ddlViewName).options[2].selected=true;
              	  else if(propertyview=="Mountain View") document.getElementById(ddlViewName).options[3].selected=true;
              	  else if(propertyview=="Water View") document.getElementById(ddlViewName).options[4].selected=true;
              	  else if(propertyview=="Reserve") document.getElementById(ddlViewName).options[5].selected=true;
              	  else if(propertyview=="Park View") document.getElementById(ddlViewName).options[6].selected=true;
              	  else if(propertyview=="Rural View") document.getElementById(ddlViewName).options[7].selected=true;
              	  else if(propertyview=="City View") document.getElementById(ddlViewName).options[8].selected=true;

              	  if(propertyparking<7) document.getElementById('ddlCarParking_1').options[propertyparking].selected=true;
              	  if(propertyparkingport<7) document.getElementById('ddlCarParkingPort_1').options[propertyparkingport].selected=true;
              	  if(propertyparkingoff<7) document.getElementById('ddlCarParkingOff_1').options[propertyparkingoff].selected=true;
              	  document.getElementById('txtCarParkCount').value=propertyparking;
              	  
              	  var propertylandareaArray=propertylandarea.split(" ");
              	  var propertyfloorareaArray=propertyfloorarea.split(" ");
              	  
              	  document.getElementById(txtPropertyLandAreaName).value=propertylandareaArray[0];
              	  document.getElementById(txtPropertyFloorAreaName).value=propertyfloorareaArray[0];
              	  
              	  if(propertylandareaArray[1]=="sqm") document.getElementById(LandAreaMeasureName).options[0].selected=true;
              	  else if(propertylandareaArray[1]=="sqf") document.getElementById(LandAreaMeasureName).options[1].selected=true;
              	  else if(propertylandareaArray[1]=="acres") document.getElementById(LandAreaMeasureName).options[2].selected=true;
              	  else if(propertylandareaArray[1]=="hetares") document.getElementById(LandAreaMeasureName).options[3].selected=true;

              	  if(propertyfloorareaArray[1]=="sqm") document.getElementById(FloorAreaMeasureName).options[0].selected=true;
              	  else if(propertyfloorareaArray[1]=="sqf") document.getElementById(FloorAreaMeasureName).options[1].selected=true;
                  
                  document.getElementById(txtBuiltYearName).value=propertybuiltyear;
                  
                  var propertyrentalincomeArray=propertyrentalincome.split(" ");
                  document.getElementById('txtRentalIncome').value=propertyrentalincomeArray[0];
                  if(propertyrentalincomeArray[3]=="week") document.getElementById('businessRentPeriod4').options[0].selected=true;
                  else if(propertyrentalincomeArray[3]=="month") document.getElementById('businessRentPeriod4').options[1].selected=true;
                  else if(propertyrentalincomeArray[3]=="year") document.getElementById('businessRentPeriod4').options[2].selected=true;
                  
                  var propertyturnoverArray=propertyturnover.split(" ");
                  document.getElementById('txtPropertyTurnOver').value=propertyturnoverArray[0];
                  if(propertyturnoverArray[3]=="week") document.getElementById('businessRentPeriod1').options[0].selected=true;
                  else if(propertyturnoverArray[3]=="month") document.getElementById('businessRentPeriod1').options[1].selected=true;
                  else if(propertyturnoverArray[3]=="year") document.getElementById('businessRentPeriod1').options[2].selected=true;
                  
                  var propertybusinessrentArray=propertybusinessrent.split(" ");
                  document.getElementById('txtPropertyBusinessRent').value=propertybusinessrentArray[0];
                  if(propertybusinessrentArray[3]=="week") document.getElementById('businessRentPeriod2').options[0].selected=true;
                  else if(propertybusinessrentArray[3]=="month") document.getElementById('businessRentPeriod2').options[1].selected=true;
                  else if(propertybusinessrentArray[3]=="year") document.getElementById('businessRentPeriod2').options[2].selected=true;
                  
                  var propertyoutgoingsArray=propertyoutgoings.split(" ");
                  document.getElementById('txtPropertyBusinessOperating').value=propertyoutgoingsArray[0];
                  if(propertyoutgoingsArray[3]=="week") document.getElementById('businessRentPeriod3').options[0].selected=true;
                  else if(propertyoutgoingsArray[3]=="month") document.getElementById('businessRentPeriod3').options[1].selected=true;
                  else if(propertyoutgoingsArray[3]=="year") document.getElementById('businessRentPeriod3').options[2].selected=true;
                  
                  document.getElementById('txtOperatingExpenses').value=propertycommercialoe;
                  document.getElementById('txtTenantShare').value=(propertytenantshare=="%"?"":propertytenantshare);
                  if(propertyflatmate=="single") document.getElementById('RadioButton4').checked=true;
                  else if(propertyflatmate=="double") document.getElementById('RadioButton3').checked=true;
                  else document.getElementById('RadioButton5').checked=true;
                  
                  document.getElementById('txtFunitures').value=propertyfurniture;
                  document.getElementById('txtPropertySummary').value=propertyarea;
                  document.getElementById('txtPropertyTitle').value=propertytitle;
                  document.getElementById('txtAreaFeature').value=propertyfeature;
                  document.getElementById('txtPropertyGV').value=number_format(propertygv);
                  document.getElementById('txtPropertyZoning').value=propertyzoning;
                  
                   
                  if(propertyev=="0,200000") document.getElementById('ddlPriceRange').options[1].selected=true;
                  else if(propertyev=="200000,300000") document.getElementById('ddlPriceRange').options[2].selected=true;
                  else if(propertyev=="300000,400000") document.getElementById('ddlPriceRange').options[3].selected=true;
                  else if(propertyev=="400000,600000") document.getElementById('ddlPriceRange').options[4].selected=true;
                  else if(propertyev=="600000,800000") document.getElementById('ddlPriceRange').options[5].selected=true;
                  else if(propertyev=="800000,1000000") document.getElementById('ddlPriceRange').options[6].selected=true;
                  else if(propertyev=="1000000,1500000") document.getElementById('ddlPriceRange').options[7].selected=true;
                  else if(propertyev=="1500000,15000000") document.getElementById('ddlPriceRange').options[8].selected=true;
                  
                  if(propertyprice=="Auction") document.getElementById('priceSelect').options[1].selected=true;
                  else if(propertyprice=="Tender") document.getElementById('priceSelect').options[2].selected=true;
                  else if(propertyprice=="POA") document.getElementById('priceSelect').options[3].selected=true;
                  else if(propertyprice=="Private Treaty") document.getElementById('priceSelect').options[4].selected=true;
                  else if(propertyprice=="Price by Negotiation") document.getElementById('priceSelect').options[5].selected=true;
                  else if(propertyprice=="Expressions of Interest") document.getElementById('priceSelect').options[6].selected=true;
                  else{document.getElementById('priceSelect').options[0].selected=true;changeActionForPrice("Price");document.getElementById('txtPropertyPrice').value=number_format(propertyprice);}
                  
                  if(propertygst=="included") document.getElementById('RadioButton6').checked=true;
                  else if(propertygst=="excluded") document.getElementById('RadioButton7').checked=true;
                  
                  var propertyrentvalueArray=propertyrentvalue.split(" ");
              	  document.getElementById('txtRentForLet').value=propertyrentvalueArray[0];              	  
              	  
              	  if(propertytype==9){
	                  if(propertyrentvalueArray[2]=="day") document.getElementById('rentPeriodB').options[0].selected=true;
	                  else if(propertyrentvalueArray[2]=="week") document.getElementById('rentPeriodB').options[1].selected=true;
	                  else if(propertyrentvalueArray[2]=="month") document.getElementById('rentPeriodB').options[2].selected=true;
	                  else if(propertyrentvalueArray[2]=="year") document.getElementById('rentPeriodB').options[3].selected=true;
                  }else{
	                  if(propertyrentvalueArray[2]=="week") document.getElementById('rentPeriodA').options[0].selected=true;
	                  else if(propertyrentvalueArray[2]=="month") document.getElementById('rentPeriodA').options[1].selected=true;
	                  else if(propertyrentvalueArray[2]=="year") document.getElementById('rentPeriodA').options[2].selected=true;
                  }
                  
                  
                  if(propertyjoin!=""){
                    var propertyjoinArray=propertyjoin.split("|");
                    for(var p=0;p<propertyjoinArray.length;p++){
                    	if(propertyjoinArray[p]!=""){
                           joinEmailPersonInitial(propertyjoinArray[p]);
                        }
                    }
                  }
                  document.getElementById('photoEditDiv').innerHTML=photoEditDiv+"</tr>"+photoEditDivRemove+"</tr></table>";
                  if(propertytitle_en!=""){
                  	  document.getElementById('rdoEnglish1').checked=true;
                  	  englishtextaction(1);
                   	  document.getElementById('txtPropertyTitle_English').value=propertytitle_en;
                      document.getElementById('txtPropertySummary_English').value=propertyarea_en;
                      document.getElementById('txtAreaFeature_English').value=propertyfeature_en;
                  }                  
                  getLocationMapPointAction();
              }

          }else if(typeid==7){
              var p_id;
              var p_title="";
              var p_agenttile="";
              
              suggestiondiv="<table width=180 cellpadding=0 cellspacing=0>";
                            	  
			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   p_id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "title"){
	          	 	   p_title=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "agenttitle"){
	          	 	   p_agenttile=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	            }
	            if(p_agenttile=="TMP") p_agenttile="Private";
	            if(filterID=="")
	                suggestiondiv=suggestiondiv+"<tr height=25><td style='padding-left:5px;' onmouseover=this.className='class002' onmouseout=this.className='class003'><a href=java"+"script:onclick=window.location='/ch/results.aspx?f=1&userid="+p_id+"'><font color=#000000 style='font-size:8pt;'>"+p_title.substr(0,20)+" ("+p_agenttile+")</font></a></td></tr>";
	            else
	                suggestiondiv=suggestiondiv+"<tr height=25><td style='padding-left:5px;' onmouseover=this.className='class002' onmouseout=this.className='class003'><a href=java"+"script:onclick=window.location='/ch/prop.aspx?listid="+p_id+"'><font color=#000000 style='font-size:8pt;'>"+p_title.substr(0,40)+"</font></a></td></tr>";
		      }
              suggestiondiv=suggestiondiv+"</table>";
              if((p_title=="")||(p_title==null)) suggestiondiv="";
          }else if(typeid==8){
              var a_id,a_title;
              agentdiv="<select name=propertyAgentList id=propertyAgentList style='width:300px;'>";
                            	  
			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   a_id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "title"){
	          	 	   a_title=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	            }
	            agentdiv=agentdiv+"<option value="+a_id+">"+a_title+"</option>";
	            
		      }
		      if(a_id==null){
		      	agentdiv=agentdiv+"<option value=0>No agent found!You can create new one below.</option>";
		      }
              agentdiv=agentdiv+"</select>";
          }else if(typeid==20){
              var emailresultvalue,emailaddress;
              
              emailresultvalue="0";
              paramsubstring="<img src='/images/check_error.gif'> <font color=red>Not valid input</font>";
                            	  
		      for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
		            var data_node=root0.childNodes.item(iRoot);
		            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
		          	  var item_node=data_node.childNodes.item(iData);
		          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
		          	  	if(item_node.nodeName == "emailresultvalue"){
		          	  	   emailresultvalue=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "email"){
		          	 	   emailaddress=item_node.childNodes.item(iItem).nodeValue;
		          	  	}
		          	  }
		            }
		            
		      }
         
              if(emailresultvalue=="1"){
              	if(verifyRepeatEmail(emailaddress)==1){
              		paramsubstring="<img src='/images/check_error.gif'> <font color=red>Repeat</font>";
                }else if(verifyRepeatEmail(emailaddress)==2){
                	paramsubstring="<img src='/images/check_error.gif'> <font color=red>Max:3</font>";
                }else{
                     paramsubstring="";
					 var str1 = '<div id="nest'+i+'"><INPUT type="text" size="34" id="txtPropertyAssociation'+i_join+'" onchange="updateJointValue(this.value)">&nbsp;&nbsp;<a href="#span1"><span onclick="addJoint()" id="span'+i_join+'"><font color=#515a9f><u>add</u></font></span></a></div>';
					 document.getElementById('MyJoint').insertAdjacentHTML("beforeEnd",str1);
					    
					 var spanObjectUp="span"+(i_join-1);
					 var str2='<font color=#515a9f onclick="delJoint('+(i_join-1)+')"><u>remove</u></font>';
					 document.getElementById(spanObjectUp).innerHTML=str2;
					    
					 i_join++;
                }
              }
          }else if(typeid==88){
              var emailnotificationid="0";
              var searchtype,propertyType,propertySubType,location,sublocation,setdate,price;
              
              paramsubstring="<table cellSpacing='0' cellPadding='0' width='100%' border='0'>";
              paramsubstring=paramsubstring+"<tr><td align=middle><b>广告类别</b></td><td align=middle><b>物业类型</b></td><td align=middle><b>地区</b></td><td align=middle><b>价格</b></td><td align=middle><b>日期</b></td><td align=middle><b>编辑</b></td><td align=middle><b>删除</b></td></tr><tr><td colspan=7><hr size=1 noshade style='border:1 dotted #B1D8FF' width='100%'></td></tr>";
              var hrstring="<hr size=1 noshade style='border:1 dotted #cccccc' width='100%'>";
		      for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
		            var data_node=root0.childNodes.item(iRoot);
		            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
		          	  var item_node=data_node.childNodes.item(iData);
		          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
		          	  	if(item_node.nodeName == "id"){
		          	  	   emailnotificationid=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "searchtype"){
                           searchtype=item_node.childNodes.item(iItem).nodeValue;
                        }else if(item_node.nodeName == "propertyType"){
                           propertyType=item_node.childNodes.item(iItem).nodeValue;
                        }else if(item_node.nodeName == "propertySubType"){
                           propertySubType=item_node.childNodes.item(iItem).nodeValue;
                        }else if(item_node.nodeName == "location"){
                           location=item_node.childNodes.item(iItem).nodeValue;
                        }else if(item_node.nodeName == "sublocation"){
                           sublocation=item_node.childNodes.item(iItem).nodeValue;
                        }else if(item_node.nodeName == "setdate"){
                           setdate=item_node.childNodes.item(iItem).nodeValue;
                        }else if(item_node.nodeName == "price"){
                           price=item_node.childNodes.item(iItem).nodeValue;
                        }
		          	  }
		            }
		            if(iRoot==(root0.childNodes.length-1)) hrstring="";
		            var priceArray=price.split(",");
		            var pricefilterstring="$"+number_format(priceArray[0])+" - $"+number_format(priceArray[1]);
		            if(emailnotificationid=="0") paramsubstring=paramsubstring+"<tr height=50><td colspan=6 align=middle>&nbsp;</td></tr>";else paramsubstring=paramsubstring+"<tr height=50><td align=middle>"+searchtype+"</td><td align=middle>"+propertyType+"<BR>"+propertySubType+"</td><td align=middle>"+sublocation+"<br>"+location+"</td><td align=middle>"+pricefilterstring+"</td><td align=middle>"+setdate+"</td><td align=middle><a href=# onclick=\"openwindowedit('/ch/users/useremail_e.aspx?id="+emailnotificationid+"')\"><font color=#515a9f>编辑</font></a></td><td align=middle><a href='?delID="+emailnotificationid+"' onclick=\"return confirm('Are you sure to delete this email notification rule?')\"><font color=#515a9f>Delete</font></a></td></tr><tr><td colspan=7>"+hrstring+"</td></tr>";
		      }
		      paramsubstring=paramsubstring+"</table>";
		      if(iRoot==5) addCode=1;else addCode=0;
          }else if(typeid==83){
          	  var maplocation="";
          	  var mapsublocation="";
          	  
          	  paramsubstring="";
		      for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
		            var data_node=root0.childNodes.item(iRoot);
		            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
		          	  var item_node=data_node.childNodes.item(iData);
		          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
		          	  	if(item_node.nodeName == "location"){
		          	  	   maplocation=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "sublocation"){
		          	 	   mapsublocation=item_node.childNodes.item(iItem).nodeValue;
		          	  	}
		          	  }
		            }
		      }
		      if((maplocation=="　Auckland Central")||(maplocation=="　Auckland North")||(maplocation=="　Auckland South")||(maplocation=="　Auckland West")||(maplocation=="　Auckland East")||(maplocation=="　Auckland Islands")) maplocation="Auckland";
		      paramsubstring=mapsublocation+","+maplocation;


          }else if(typeid==84){
          	  var m_address="Auckland";

          	  var m_id,m_title,m_price,m_photo,m_location,m_sublocation,m_locationvalue,m_sublocationvalue,m_bedroom,m_bathroom,m_carpark,m_landarea,m_floorwarea,m_point;
          	  var m_kind,m_type,m_subtype;
          	  var stringAmount="";
          	  
		      for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
		            var data_node=root0.childNodes.item(iRoot);
		            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
		          	  var item_node=data_node.childNodes.item(iData);
		          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
		          	  	if(item_node.nodeName == "id"){
		          	  	   m_id=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertytitle"){
		          	 	   m_title=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertyaddress"){
		          	 	   m_address=item_node.childNodes.item(iItem).nodeValue;
		          	 	   m_address=m_address.replace("_"," ");
		          	  	}else if(item_node.nodeName == "propertyprice"){
		          	 	   m_price=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertfilename"){
		          	 	   m_photo=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertylocation"){
		          	 	   m_location=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertysublocation"){
		          	 	   m_sublocation=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertylocationvalue"){
		          	 	   m_locationvalue=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertysublocationvalue"){
		          	 	   m_sublocationvalue=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertbedroom"){
		          	 	   m_bedroom=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertbathroom"){
		          	 	   m_bathroom=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertcarparking"){
		          	 	   m_carpark=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertlandarea"){
		          	 	   m_landarea=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertfloorarea"){
		          	 	   m_floorwarea=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "propertykind"){
	          	 	       m_kind=item_node.childNodes.item(iItem).nodeValue;
	          	  	    }else if(item_node.nodeName == "propertytype"){
	          	 	       m_type=item_node.childNodes.item(iItem).nodeValue;
	          	  	    }else if(item_node.nodeName == "propertysubtype"){
	          	 	       m_subtype=item_node.childNodes.item(iItem).nodeValue;
	          	  	    }else if(item_node.nodeName == "propertpoint"){
	          	 	       m_point=item_node.childNodes.item(iItem).nodeValue;
	          	  	    }
		          	  }
		            }

		            if(m_id!="0"){
			           if((m_location=="　Auckland Central")||(m_location=="　Auckland North")||(m_location=="　Auckland South")||(m_location=="　Auckland West")||(m_location=="　Auckland East")||(m_location=="　Auckland Islands")) m_location="Auckland";
			           if((m_address!=" ")&&(m_address!="")&&(m_address!=null)&&(m_address!="  ")){
				           var m_address_array=m_address.split(" ");
				           var unitAddress="";roadAddress="";
				           if(m_address_array[0]!="") unitAddress=m_address_array[0].replace("_"," ")+", ";
						   for(var i=1;i<m_address_array.length;i++){
						   	  roadAddress=roadAddress+" "+m_address_array[i];
						   }
						   if((unitAddress=="Unit, ")||(unitAddress=="Level, ")||(unitAddress=="Suite, ")||(unitAddress=="Apartment, ")||(unitAddress=="Lot, "))
				               m_address=roadAddress+",&nbsp;";
				           else
				           	   m_address=unitAddress+roadAddress+",&nbsp;";
			           }else{
			           	   m_address="";
			           }

			           if((m_point!="0,0")&&(m_point!=null)&&(m_point!="")){
			             setupHouseMarkers(m_kind,m_type,m_subtype,m_address,m_point,m_id,m_title,m_price,m_photo,m_location,m_sublocation,m_bedroom,m_bathroom,m_carpark,m_landarea,m_floorwarea,m_locationvalue,m_sublocationvalue);
			             m_address="";
			           }
			        }
		      }
		      var a_agentvalue=document.getElementById("ddlPropertyAgentList").value;
		      var a_branchvalue=document.getElementById("ddlPropertyBranchList").value;
		      
		      if((a_agentvalue!="0")&&(a_agentvalue!="-1")&&(a_agentvalue!="-2")&&(a_branchvalue=="0")) changeActionForBranch(a_agentvalue,68);
		      	  
          }else if(typeid==21){
              var emailresultvalue,emailaddress;
              emailresultvalue="0";
              paramsubstring="<img src='/images/check_error.gif'> <font color=red>Not valid input</font>";
                            	  
		      for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
		            var data_node=root0.childNodes.item(iRoot);
		            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
		          	  var item_node=data_node.childNodes.item(iData);
		          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
		          	  	if(item_node.nodeName == "emailresultvalue"){
		          	  	   emailresultvalue=item_node.childNodes.item(iItem).nodeValue;
		          	  	}else if(item_node.nodeName == "email"){
		          	 	   emailaddress=item_node.childNodes.item(iItem).nodeValue;
		          	  	}
		          	  }
		            }
		            
		      }
              if(emailresultvalue=="1"){
              	if(verifyRepeatEmail(emailaddress)==1){
              		paramsubstring="<img src='/images/check_error.gif'> <font color=red>Repeat</font>";
              	}else if(verifyRepeatEmail(emailaddress)==2){
                	paramsubstring="<img src='/images/check_error.gif'> <font color=red>Max:3</font>";
                }else{
                    paramsubstring="";
                }
              }
          }else if(typeid==201){
              var p_id;
              var p_title="";
              var p_fees="(Free)";
              
              var divPayoption="<select id=PayOption1>";
                    	  
			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   p_id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "title"){
	          	 	   p_title=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "fees"){
	          	 	   p_fees=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	            }
	            if(p_fees=="0") 
	                divPayoption=divPayoption+"<option value='"+p_id+"_0'>"+p_title+" (Free)</option>";
	            else 
	            	divPayoption=divPayoption+"<option value='"+p_id+"_"+p_fees+"'>"+p_title+" ($"+p_fees+")</option>";
		      }
              divPayoption=divPayoption+"</select>";
              var returnBool_step1=false;
              var current_creditvalue;
              
              if(document.all) current_creditvalue=document.getElementById('lblCreditValue').innerText.replace(",","");else current_creditvalue=document.getElementById('lblCreditValue').textContent.replace(",","");
              if(parseFloat(current_creditvalue)>=parseFloat(p_fees)){
              	  returnBool_step1=confirm("Our basic service allows you to list your property for up to three months with up to six photos!");
              	  if(returnBool_step1){
              	  	  document.getElementById("div_payoption").style.display="none";
	              	  document.getElementById("div_payoption").innerHTML=divPayoption;
	              	  divChange(2);
	              }
              }else{
              	  returnBool_step1=confirm("Sorry that you do not have sufficient fund to use this service, would you like to recharge your account now?");
              	  if(returnBool_step1) top.location='/ch/users/usercredit.aspx';
              }
              
          }else if(typeid==202){
              var p_id;
              var p_title="";
              var p_fees="(Free)";
              var countID=1;
              
              var divPayoption="";
                    	  
			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   p_id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "title"){
	          	 	   p_title=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "fees"){
	          	 	   p_fees=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "keyword"){
	          	 	   p_keyword=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	            }
	            
	            if(iRoot=="0")
	              if((p_fees=="0")||(p_fees=="0.00"))
	            	  divPayoption=divPayoption+"<tr height=22><td width=150 align=left>&nbsp;&nbsp;<b>附加服务:</b></td><td width=180 align=left><a href=# onclick=\"changeDes('div_add_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox onclick='feesChange()' id=PayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50 align=left><select disabled style='width:40px;' name='a_q' id='a_q' onchange=\"changeActionService('a_q_f',this.options[this.selectedIndex].value,"+p_fees+")\"><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option></select></td><td width=50 align=right><span id='a_q_f'>Free</span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_add_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
	              else
	              	  divPayoption=divPayoption+"<tr height=22><td width=150 align=left>&nbsp;&nbsp;<b>附加服务:</b></td><td width=180 align=left><a href=# onclick=\"changeDes('div_add_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox onclick='feesChange()' id=PayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50 align=left><select disabled style='width:40px;' name='a_q' id='a_q' onchange=\"changeActionService('a_q_f',this.options[this.selectedIndex].value,"+p_fees+")\"><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option></select></td><td width=50 align=right><span id='a_q_f'>$"+p_fees+"</span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_add_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
	            else
	              if((p_fees=="0")||(p_fees=="0.00"))	            	
	            	  divPayoption=divPayoption+"<tr height=22><td width=150 align=left></td><td width=180 align=left><a href=# onclick=\"changeDes('div_add_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox onclick='feesChange()' id=PayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50></td><td width=50 align=right><span id='a_q_f"+countID+"' style='display:none;'>Free</span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_add_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
				  else
				  	  divPayoption=divPayoption+"<tr height=22><td width=150 align=left></td><td width=180 align=left><a href=# onclick=\"changeDes('div_add_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox onclick='feesChange()' id=PayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50></td><td width=50 align=right><span id='a_q_f"+countID+"' style='display:none;'>$"+p_fees+"</span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_add_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
	            countID++;
	            serviceFeesCount++;
		      }
              divBasicService=divBasicService+divPayoption+"<tr height=10><td colspan=6></td></tr>";
              var url="/ch/include/getXMLData.aspx?servicekindid=3";
    		  getData(url,203);
          }else if(typeid==203){
              var p_id;
              var p_title="";
              var p_fees="(Free)";
              var countID=1;
              
              var divPayoption="";
                    	  
			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   p_id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "title"){
	          	 	   p_title=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "fees"){
	          	 	   p_fees=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "keyword"){
	          	 	   p_keyword=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	            }
	            
	            if(iRoot=="0")
	              if((p_fees=="0")||(p_fees=="0.00"))	    
	            	  divPayoption=divPayoption+"<tr height=22><td width=150 align=left>&nbsp;&nbsp;<b>其它服务</b></td><td width=180 align=left><a href=# onclick=\"changeDes('div_other_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox onclick='feesChange()' id=OtherPayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50 align=left><select disabled style='width:40px;' name='o_q' id='o_q' onchange=\"changeActionService('o_q_f',this.options[this.selectedIndex].value,"+p_fees+")\"><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option><option value=11>11</option><option value=12>12</option></select></td><td width=50 align=right><span id='o_q_f'>Free</span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_other_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
	              else
	              	  divPayoption=divPayoption+"<tr height=22><td width=150 align=left>&nbsp;&nbsp;<b>其它服务</b></td><td width=180 align=left><a href=# onclick=\"changeDes('div_other_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox onclick='feesChange()' id=OtherPayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50 align=left><select disabled style='width:40px;' name='o_q' id='o_q' onchange=\"changeActionService('o_q_f',this.options[this.selectedIndex].value,"+p_fees+")\"><option value=1>1</option><option value=2>2</option><option value=3>3</option><option value=4>4</option><option value=5>5</option><option value=6>6</option><option value=7>7</option><option value=8>8</option><option value=9>9</option><option value=10>10</option><option value=11>11</option><option value=12>12</option></select></td><td width=50 align=right><span id='o_q_f'>$"+p_fees+"</span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_other_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
	            else
	              if((p_fees=="0")||(p_fees=="0.00"))
	            	  divPayoption=divPayoption+"<tr height=22><td width=150 align=left></td><td width=180 align=left><a href=# onclick=\"changeDes('div_other_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox onclick='feesChange()' id=OtherPayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50></td><td width=50 align=right><span id='o_q_f"+countID+"' style='display:none;'>Free</span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_other_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
	              else
	              	  divPayoption=divPayoption+"<tr height=22><td width=150 align=left></td><td width=180 align=left><a href=# onclick=\"changeDes('div_other_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox onclick='feesChange()' id=OtherPayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50></td><td width=50 align=right><span id='o_q_f"+countID+"' style='display:none;'>$"+p_fees+"</span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_other_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";

	            countID++;
	            otherserviceFeesCount++;
		      }
		      divBasicService=divBasicService+divPayoption+"</table>";
              document.getElementById("divBasicService").innerHTML=divBasicService;
              feesChange();
          }else if(typeid==204){
              var p_id;
              var p_title="&nbsp;";
              var p_fees="(Free)";
              var countID=1;
              var p_keyword="";
              var p_others="";
              
              var divPayoption="";
                    	  
			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   p_id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "title"){
	          	 	   p_title=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "fees"){
	          	 	   p_fees=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "keyword"){
	          	 	   p_keyword=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "others"){
	          	 	   p_others=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	            }
	            
	            p_othersarray=p_others.split("|");
	            p_fees=p_othersarray[0];
	            	
	            if((p_fees=="0")||(p_fees=="0.00"))
	                divPayoption=divPayoption+"<tr height=22><td width=150 align=left>&nbsp;&nbsp;<b>基本服务:</b></td><td width=180 align=left><a href=# onclick=\"changeDes('div_basic_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox checked disabled onclick='feesChange()' id=BasicPayOption"+countID+" name=chkboxAddOns value='"+p_id+"_0'></td><td width=15>&nbsp;</td><td width=50 align=left>&nbsp;</td><td width=50 align=right><span id='span_basicfees'></span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_basic_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
	            else
	            	divPayoption=divPayoption+"<tr height=22><td width=150 align=left>&nbsp;&nbsp;<b>基本服务:</b></td><td width=180 align=left><a href=# onclick=\"changeDes('div_basic_des"+countID+"')\"><font color=#515a9f>"+p_keyword+"</font></a></td><td width=51 align=left><input type=checkbox checked disabled onclick='feesChange()' id=BasicPayOption"+countID+" name=chkboxAddOns value='"+p_id+"_"+p_fees+"'></td><td width=15>&nbsp;</td><td width=50>&nbsp;</td><td width=50 align=right><span id='span_basicfees'></span></td></tr><tr><td width=150></td><td colspan=4 style='line-height:1.5' width=300><div id='div_basic_des"+countID+"' style='display:none'><font color=#3c3c3c>"+p_title+"</font></div></td><td width=50></td></tr>";
	            countID++;
				basicserviceFeesCount++;
				
				
		      }
              divBasicService=divBasicService+divPayoption+"<tr height=10><td colspan=6></td></tr>";;
              
              var url="/ch/include/getXMLData.aspx?servicekindid=2";
              getData(url,202);		      

          }else if(typeid==210){
              var p_id,p_description,p_date,p_value,p_kind,p_balance,p_transid;
              p_value=0;
              p_balance=0;
              
              
              var divTransaction="<table width='100%' cellpadding=1 cellspacing=1>";
              divTransaction=divTransaction+"<tr bgcolor='#eeeeee' height=30><td align=middle>日期</td><td align=middle>明细</td><td align=middle>支出</td><td align=middle>充入</td><td align=middle>余额</td></tr>";
                    	  
			  for (var iRoot = 0; iRoot < root0.childNodes.length; iRoot++) {
	            var data_node=root0.childNodes.item(iRoot);
	            for (var iData = 0; iData < data_node.childNodes.length; iData++) {
	          	  var item_node=data_node.childNodes.item(iData);
	          	  for (var iItem = 0; iItem < item_node.childNodes.length; iItem++) {
	          	  	if(item_node.nodeName == "id"){
	          	  	   p_id=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "description"){
	          	 	   p_description=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "date"){
	          	 	   p_date=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "value"){
	          	 	   p_value=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "kind"){
	          	 	   p_kind=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "balance"){
	          	 	   p_balance=item_node.childNodes.item(iItem).nodeValue;
	          	  	}else if(item_node.nodeName == "transid"){
	          	 	   p_transid=item_node.childNodes.item(iItem).nodeValue;
	          	  	}
	          	  	
	          	  }
	            }
	            p_value="$"+parseFloat(p_value).toFixed(2);
	            p_balance="$"+parseFloat(p_balance).toFixed(2);
	            
	            if(p_kind==1)
	                divTransaction=divTransaction+"<tr bgcolor='#ffffff'><td align=left>"+p_date+"</td><td align=left>"+p_description+"</td><td align=right>"+p_value+"</td><td>&nbsp;</td><td align=right>"+p_balance+"</td></tr>";
                else
                	divTransaction=divTransaction+"<tr bgcolor='#ffffff'><td align=left>"+p_date+"</td><td align=left>"+p_description+"</td><td>&nbsp;</td><td align=right>"+p_value+"</td><td align=right>"+p_balance+"</td></tr>";
				divTransaction=divTransaction+"<tr><td colspan=5><hr size=1 color='#3c3c3c'></td></tr>";
				
		      }
		      
		      divTransaction=divTransaction+"<tr height=30><td colspan=4 align=right style='font-size:13px;'><b>现有余额:</b></td><td align=right style='font-size:13px;'><b>"+p_balance+"</b></td></tr>";
              divTransaction=divTransaction+"</table>";
              document.getElementById("transList").innerHTML=divTransaction;
          }

	  }

	  
	  if(typeid==1){
	    document.getElementById('divDDL001').innerHTML=paramsubstring;
	    document.getElementById('divDDL002').innerHTML="<select id='ddlPropertySubType' size=1 style='width:170px;' onChange='subLocationFlag=-1;changeAction(this.options[this.selectedIndex].value,-10);'><option value=0 selected>物业类型</option></select>";
	    if(reActionValueForMap!=-1) changeAction(reActionValueForMap,2);
	    if(reActionValue==-1) initialList(1,1);else if(reActionValue==-2) initialList(1);else initialList(1,1);
	  }else if(typeid==2){
	    document.getElementById('divDDL002').innerHTML=paramsubstring;
	    if(reActionValue==-1) initialList(1,1);else if(reActionValue==-2) initialList(1);else initialList(1,1);
	  }else if(typeid==3){
	  	document.getElementById('divDDL003').innerHTML=paramsubstring;
	  }else if(typeid==4){
	  	document.getElementById('divDDL004').innerHTML=paramsubstring;
	  }else if(typeid==5){
	  	document.getElementById('divList').innerHTML=paramsubstring;
        document.getElementById('divListNav').innerHTML=navdivlist;
        document.getElementById("ddlBedroom").options[selectedItem2].selected=true;
        document.getElementById("ddlPriceRange").options[selectedItem3].selected=true;
        document.getElementById("ddlPropertyAgentList").options[selectedItem4].selected=true;
        document.getElementById("ddlTurnover").options[selectedItem5].selected=true;
        document.getElementById("ddlLand").options[selectedItem6].selected=true;
        document.getElementById("ddlFloor").options[selectedItem7].selected=true;
	  	if(selectedFlag==0){
        document.getElementById("ddlPropertyLocation").options[selectedItem8].selected=true;
        document.getElementById("ddlPropertySubLocation").options[selectedItem9].selected=true;
        }
        document.getElementById("ddlView").options[selectedItem10].selected=true;
        document.getElementById("ddlPropertyBranchList").options[selectedItem11].selected=true;

        if((reActionValue>=0)||(reActionValue==-1)) changeAction(reActionValue,-5);
        if(reActionForAgentREF!="") changeActionForBranch(reActionForAgentREF,67);
	  }else if((typeid==55) || (typeid==56) || (typeid==57)){
	  	document.getElementById('divList').innerHTML=paramsubstring;
	  	document.getElementById('divListNav').innerHTML=navdivlist;
	  }else if((typeid==6)||(typeid==62)){
	  	document.getElementById('divMainPhoto').innerHTML=mainphotodiv;
	  	document.getElementById('divListPhoto').innerHTML=listphotodiv;
        document.getElementById('divIndividual').innerHTML=individualdiv;
	  }else if(typeid==7){
	  	if((suggestiondiv!='')&&(suggestiondiv!=null)){
	  	   document.getElementById('suggestion').style.visibility='visible';
	  	   document.getElementById('suggestion').innerHTML=suggestiondiv;
	  	}else{
	  	   document.getElementById('suggestion').style.visibility='hidden';
	  	}
	  }else if(typeid==8){
	  	document.getElementById('divDDL005').innerHTML=agentdiv;
	  }else if((typeid==66)||(typeid==67)||(typeid==68)){
	  	document.getElementById('divDDL006').innerHTML=paramsubstring;
	  }else if((typeid==9) || (typeid==99)){
	  	document.getElementById('divDDL004_1').innerHTML=paramsubstring;
	  }else if(typeid==999){
	  	document.getElementById('divlist').innerHTML=paramsubstring;
	  	if(g_action>0) changeAction(g_action,9);
	  }else if(typeid==-1){
	    document.getElementById('divDDL001_ul').innerHTML=paramsubstring;
	    document.getElementById('divDDL002_ul').innerHTML="<select id='ddlPropertySubType_ul' size=1 disabled style='width:170px' onChange='subLocationFlag=-1;changeAction(this.options[this.selectedIndex].value,-10);'><option value=0 selected>物业类型</option></select>";
	  }else if(typeid==-2){
	    document.getElementById('divDDL002_ul').innerHTML=paramsubstring;
	  }else if(typeid==-4){
	  	document.getElementById('divDDL004_ul').innerHTML=paramsubstring;
	  	getLocationMapPointAction();
	  }else if(typeid==-5){
	  	document.getElementById('divDDL004').innerHTML=paramsubstring;
	  }else if(typeid==20){
	  	document.getElementById('divCheck').innerHTML=paramsubstring;
	  }else if(typeid==21){
	  	document.getElementById('divCheck').innerHTML=paramsubstring;
	  }else if(typeid==83){
	  	showAddress(paramsubstring);
	  	if(reAddressMapAction==-1) reloadMark(0);
	  }else if(typeid==88){
	  	document.getElementById('divList').innerHTML=paramsubstring;
	  }else if(typeid==-10){
	    if(reActionValue==-1) initialList(1,1);else if(reActionValue==-2) initialList(1);else if(reActionValue==-3);else initialList(1,1);
	  }
	  
   }
   
}

function amountChange(aArray){
	var amount_array =aArray.split(",");
    
    var amountvalue1=parseInt(amount_array[0])+parseInt(amount_array[1])+parseInt(amount_array[2])+parseInt(amount_array[3])+parseInt(amount_array[4])+parseInt(amount_array[5]);
    var amountvalue2=parseInt(amount_array[60])+parseInt(amount_array[61])+parseInt(amount_array[62])+parseInt(amount_array[63])+parseInt(amount_array[64])+parseInt(amount_array[65])+parseInt(amount_array[66]);
    var amountvalue=amountvalue1+amountvalue2;
    var o_searchtype=document.getElementById('ddlSearchType');
    var o_propertytype=document.getElementById('ddlPropertyType');
    var o_propertysubtype=document.getElementById('ddlPropertySubType');
    
    o_searchtype.options[0].text="所有广告类别 ("+amountvalue+")";
    o_searchtype.options[1].text=o_searchtype.options[1].text.split(" (")[0]+" ("+amountvalue1+")";
    o_searchtype.options[2].text=o_searchtype.options[2].text.split(" (")[0]+" ("+amountvalue2+")";
    
    if(kind==1){
    	o_propertytype.options[0].text="所有物业的类别 ("+amountvalue1+")";
	    for(var i=1;i<o_propertytype.options.length;i++){
	    	o_propertytype.options[i].text=o_propertytype.options[i].text.split(" (")[0]+" ("+amount_array[i-1]+")";
	    }
	    document.getElementById('divDDL001').style.display="";
    }else if(kind==2){
    	o_propertytype.options[0].text="所有物业的类别 ("+amountvalue2+")";
	    for(var i=1;i<o_propertytype.options.length;i++){
	    	o_propertytype.options[i].text=o_propertytype.options[i].text.split(" (")[0]+" ("+amount_array[i+59]+")";
	    }
	    document.getElementById('divDDL001').style.display="";
    }else{
    	o_propertytype.options[0].text="所有物业的类别";
    	o_propertysubtype.options[0].text="所有物业类型";
    	document.getElementById('divDDL001').style.display="none";
    	document.getElementById('divDDL002').style.display="none";
    }
    
    if(type==8){
    	var amount_array_8=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+5]+")";
	    	amount_array_8=parseInt(amount_array_8)+parseInt(amount_array[i+5]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_8+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==5){
    	var amount_array_5=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+13]+")";
	    	amount_array_5=parseInt(amount_array_5)+parseInt(amount_array[i+13]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_5+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==4){
    	var amount_array_4=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+21]+")";
	    	amount_array_4=parseInt(amount_array_4)+parseInt(amount_array[i+21]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_4+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==3){
    	var amount_array_3=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+29]+")";
	    	amount_array_3=parseInt(amount_array_3)+parseInt(amount_array[i+29]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_3+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==2){
    	var amount_array_2=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+37]+")";
	    	amount_array_2=parseInt(amount_array_2)+parseInt(amount_array[i+37]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_2+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==1){
    	var amount_array_1=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+44]+")";
	    	amount_array_1=parseInt(amount_array_1)+parseInt(amount_array[i+44]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_1+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==44){
    	var amount_array_44=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+66]+")";
	    	amount_array_44=parseInt(amount_array_44)+parseInt(amount_array[i+66]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_44+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==14){
    	var amount_array_14=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+73]+")";
	    	amount_array_14=parseInt(amount_array_14)+parseInt(amount_array[i+73]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_14+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==13){
    	var amount_array_13=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+81]+")";
	    	amount_array_13=parseInt(amount_array_13)+parseInt(amount_array[i+81]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_13+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==12){
    	var amount_array_12=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+89]+")";
	    	amount_array_12=parseInt(amount_array_12)+parseInt(amount_array[i+89]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_12+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==11){
    	var amount_array_11=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+97]+")";
	    	amount_array_11=parseInt(amount_array_11)+parseInt(amount_array[i+97]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_11+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==10){
    	var amount_array_10=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+105]+")";
	    	amount_array_10=parseInt(amount_array_10)+parseInt(amount_array[i+105]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_10+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else if(type==9){
    	var amount_array_9=0;
	    for(var i=1;i<o_propertysubtype.options.length;i++){
	    	o_propertysubtype.options[i].text=o_propertysubtype.options[i].text.split(" (")[0]+" ("+amount_array[i+111]+")";
	    	amount_array_9=parseInt(amount_array_9)+parseInt(amount_array[i+111]);
	    }
	    o_propertysubtype.options[0].text="所有物业类型 ("+amount_array_9+")";
	    if(kind!=0) document.getElementById('divDDL002').style.display="";
    }else{
    	o_propertysubtype.options[0].text="所有物业类型";
    	document.getElementById('divDDL002').style.display="none";
    }
    document.getElementById('lblPropertySelectionAmount').innerHTML=" ("+amountvalue+")";
    if(userid==0) document.getElementById('lblPropertySelection').innerHTML="选择中的物业广告";
    
    if((typeid==55)||(typeid==56)||(typeid==57)) document.getElementById('lblPropertyTotalAmount').innerHTML=" ("+amountvalue+")";
}

function IsNumericAjax(sText)
{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var NullFlag=true;
   var Char;

   for (c = 0; c < sText.length && IsNumber == true; c++) { 
      Char = sText.charAt(c); 
      if (ValidChars.indexOf(Char) == -1) {
         IsNumber = false;
      }
      NullFlag=false;
   }
   if(NullFlag) IsNumber=false;
   
   return IsNumber;
   
}

function getAgentLogo(ref){
   var returnstring="Bayleys Realty";
   
   if(ref=="BAY") 
     returnstring="Bayleys Realty";
   else if(ref=="RWU") 
     returnstring="Ray White";
   else if(ref=="B&T") 
     returnstring="Barfoot & Thompson";
   else if(ref=="HAV") 
     returnstring="Harveys New Zealand";
   else if(ref=="CEN") 
     returnstring="Century 21";
   else if(ref=="HAC") 
     returnstring="Harcouts Realty";
   else if(ref=="ULP") 
     returnstring="Unlimited Potential";
   else if(ref=="LJH") 
     returnstring="LJ Hooker";
   else if(ref=="ACT")
     returnstring="Action Realty";
   else if(ref=="Private") 
     returnstring="Private Lister";
   
   return returnstring;
}

function number_format(num) {
  num = num.toString().replace(/\$|\,/g,'');
  if(isNaN(num)) {
    num = "0";
  }
  sign = (num == (num = Math.abs(num)));
  num = Math.floor(num*100+0.50000000001);
  num = Math.floor(num/100).toString();
  for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
  num = num.substring(0,num.length-(4*i+3))+','+
  num.substring(num.length-(4*i+3));
  return (((sign)?'':'-') + num);
}

function chooseObjectOption(object,value){
  for(var i=0;i<object.options.length;i++){
    if(object.options[i].value==value) object.options[i].selected=true;
  }
}

function getViewChineseName(value){
  var result="";
  if(value=="Bush View") 
  	result="低矮丛林";
  else if(value=="Forest View") 
  	result="低矮丛林";
  else if(value=="Mountain View") 
  	result="山岭";
  else if(value=="Water View") 
  	result="水景";  
  else if(value=="Reserve") 
  	result="保留地";   
  else if(value=="Park View") 
  	result="公园";
  else if(value=="Rural View") 
  	result="乡村";  
  else if(value=="City View") 
  	result="都市";
  
  return result;
}