var phpbase = "/index.php";
/*********************************
Map 搜索列表切换
作者:gyf
日期:2010-1-27
版本:1.0
**********************************/
//搜索 地图随动控制
var D2dbuildMapSearchLock=1;
//控制是否执行新房栏目search
var map_housesign=1;
//控制是否执行栏目search后的map show
var map_menusign=1;
 businessareaArray=[];
	businessareaArray[0]=['空港新城',530900,405888,6];
	businessareaArray[1]=['经开',512120,409604,4];
	businessareaArray[2]=['两路-回兴',543880,406136,6];
	businessareaArray[3]=['保税',508544,414700,6];
	businessareaArray[4]=['大竹林',484712,400008,6];
	businessareaArray[5]=['人和',487896,408616,4];
	businessareaArray[6]=['新牌坊',486432,408408,4];
	businessareaArray[7]=['龙头寺',498344,412048,4];
	businessareaArray[8]=['加州',486904,411664,3];
	businessareaArray[9]=['观音桥',484912,414760,3];
	businessareaArray[10]=['松树桥',483008,411024,3];
	businessareaArray[11]=['五里店',493648,417504,4];
	businessareaArray[12]=['江北嘴',495048,422472,4];
	businessareaArray[13]=['滨江',490760,419704,6];
	businessareaArray[14]=['石马河',473656,403368,4];
	businessareaArray[15]=['南桥寺',475872,406488,4];
	businessareaArray[16]=['冉家坝',482328,406904,4];
	businessareaArray[17]=['鸿恩寺',482520,415276,4];
	businessareaArray[18]=['大坪板块',471608,417872,4];
	businessareaArray[19]=['杨家坪',463256,422480,3];
	businessareaArray[20]=['黄桷坪',462160,430272,4];
	businessareaArray[21]=['高九路',464536,412424,4];
	businessareaArray[22]=['石桥辅',461264,414864,3];
	businessareaArray[23]=['沙坪坝',463664,407792,4];
	businessareaArray[24]=['大学城',441536,377776,5];
	businessareaArray[25]=['二郎',448272,416704,4];
	businessareaArray[26]=['大渡口',446960,422192,4];
	businessareaArray[27]=['南坪商圈',480672,426416,3];
	businessareaArray[28]=['弹子石',501184,422688,4];
	businessareaArray[29]=['学府大道',471000,433800,4];
	businessareaArray[30]=['渝南',461072,436000,4];
	businessareaArray[31]=['茶园',484032,435136,6];
	businessareaArray[32]=['轻轨',450368,421728,4];
	businessareaArray[33]=['地铁',471244,416260,4];
	businessareaArray[34]=['山居',479380,419412,4];

function housemapmenchange(menu,value){
//change menu 
if(!menu)return;
  var search_keytemp=$("#search_keytemp").val()?$("#search_keytemp").val():"请输入关键字";
if(menu=="esf")
{
	$("#map_esfkey").val(search_keytemp);
	$("#searmoneymenu,#searhistorymenu").show();
	 //控制对比UI
	 $("#housecompare").hide().empty();
}
else if(menu=="cate")
{
	$("#map_catekey").val(search_keytemp);
	$("#searmoneymenu,#searhistorymenu").hide();
}						
else if(menu=="movie")
{
 var str='';
 map_moviesearch();
 $("#searmoneymenu,#searhistorymenu,#d2dsearchfy").hide();
}
else if(menu=="house")
{
 $("#map_housekey").val(search_keytemp);			
$("#searmoneymenu,#searhistorymenu").show();
 //控制对比UI
 $("#housecompare").hide().empty();	

}else if(menu=="businessarea")
{
	//所属商圈['空港新城',0(X),0(Y),4(显示地图层数)]
	 var businessareasign=1;
	 var tempvalue="";
	$("#map_businessareacondition span").each(function(){
	//已经存在选中项
		if($(this).css("color")=="#0c0")
		{
			businessareasign=2;
			tempvalue=$(this).text();
		}
	});
	//未选中 默认选中第一个
	if(businessareasign==1)
	{

		$($("#map_businessareacondition span")[0]).css("color","#0c0");
		//tempvalue=$($(str)[0]).text();	
	}

	$("#searmoneymenu,#searhistorymenu,#searhistorymenu").hide();

}else if(menu=="transit")
{
//公交
$("#searmoneymenu,#searhistorymenu").hide();
}else if(menu=="enterprisepage")
{
//企业黄页
 var str='';
 $("#searmoneymenu,#searhistorymenu").hide();
  window.open(MapinitVO.maindatapath+"/index.php/yellowpage/");
}else if(menu=="mapsearch")
{
//地图搜索 
 $("#mapsearch_key").val(search_keytemp);
 $("#searmoneymenu,#searhistorymenu").hide();

}			

//类型menu house esf cate movie businessarea 
//D2dMenu_house

$('div.mapbox_sh ul li').each(function(){

	if(this.id=="D2dMenu_"+menu)$(this).addClass("hover");
	else $(this).removeClass("hover");
});

$("#searchtype").val(menu);
//$("#d2dsearchlistnum,#d2dsearchfy,#d2dsearchlistcontent").hide();
/*
if(str=="")$("#housemapsearchcondition").empty().hide();
else $("#housemapsearchcondition").show().html(str);
*/
map_menuallhide();
$("#map_"+menu+"condition").show();
$("#seardefaultmenu").attr("class","hover");
$("#searmoneymenu").attr("class","");	
$("#searhistorymenu").attr("class","");	
if(menu=="house"&&map_housesign!=1)
{
	$("#map_"+menu+"submit").click();	
}
else if(menu!="house")$("#map_"+menu+"submit").click();

if(menu=="house"&&search_keytemp)
{
	$("#map_"+menu+"submit").click();	
}


map_housesign=2;
Map_Line.Dele();
Multi.Dele();
Lable.tags_DeleIDfun();
}
function menu_delmap_lable()
{
	Map_Line.Dele();
	Multi.Dele();
	Lable.tags_DeleIDfun();
}
function map_menuallhide()
{
//all condition hide
$("#map_housecondition,#map_esfcondition,#map_catecondition,#map_moviecondition,#map_businessareacondition,#map_transitcondition,#map_mapsearchcondition").hide();
}
function changemenu(o){
	//改变菜单
	$(o).attr("class","hover");
	var menuid=$(o).attr("id");
	var searchtype=$("#searchtype").val();
	if(menuid=="seardefaultmenu")
	{
		$("#orderby").val("no");
		$("#searmoneymenu").attr("class","");
		$("#searhistorymenu").attr("class","");		
	}
	else if(menuid=="searmoneymenu")
	{
		$("#orderby").val("money");
		$("#seardefaultmenu").attr("class","");
		$("#searhistorymenu").attr("class","");	
	}
	else if(menuid=="searhistorymenu")
	{
		$("#orderby").val("history");
		$("#searmoneymenu").attr("class","");
		$("#seardefaultmenu").attr("class","");	
		
		
		if(searchtype=="esf")cookiereturn(searchtype);
		else if(searchtype=="cate")cookiereturn(searchtype);
		else if(searchtype=="house")cookiereturn(searchtype);
		return;
	}
	
	if(searchtype=="esf")map_esfsearch();
	else if(searchtype=="cate")map_catesearch();
	else if(searchtype=="house")map_housesearch();
}
function cookiereturn(type)
{
	//cookie return
	if(!type)return;
	var historydata=d2dcookie.getCookie(type);
	var strhtml="";
	if(historydata)
	{
	historydatatemp=historydata.split("|");
	var n=0;
	
	for(var i=0;i<historydatatemp.length;i++)
	{
		if(!historydatatemp[i])continue;
		var historydatatempa=historydatatemp[i].split(";");
		n++;
		var  dirname=Math.floor(historydatatempa[0]/100)||1;

		 strhtml+='<div class="info_box_map">'
			 +'<div class="info_box_map_l">'
				 +'<div class="mark_btn">'+n+'</div>'
				 +'<h2><a href="'+MapinitVO.maindatapath+'/html/newhouse/'+dirname+'/'+historydatatempa[0]+'.html" target="_blank">'+historydatatempa[1]+'</a></h2>'
			 +'</div>'
			 +'<div class="info_box_map_r">'
			 +'</div>'
		+'</div>';
	}
	
	$("#d2dsearchlistcontent").html(strhtml).show();
	$("#d2dsearchlistnum").html(n+"条信息").show();	
	}else{
	strhtml="暂无信息";
	$("#d2dsearchlistcontent").html(strhtml).show();	
	$("#d2dsearchlistnum").hide();

	}	
		$("#d2dsearchfy").hide();


}
function esfcookiereturn()
{
	var url=phpbase+"/map?type=esfcookiereturn";
	$.ajax({
 			type: "POST",
 			url: url,
 			data: "",
		    success: function(msg){
				
				$("#d2dsearchlistnum").hide();
				$("#d2dsearchfy").hide();	
				if(msg==-1)
				{
					$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
					 return;
				}
				
				try{eval("var ob=" +msg);} catch(e){};
				if(!ob)return;
				var strhtml="";
				var i=1;
				for(var key in ob)
				{
					var temp1=ob[key].split("|");
					var  dirname=Math.floor(temp1[0]/100)||1;
					strhtml=strhtml+'<div class="info_box_map">'
						 +'<div class="info_box_map_l">'
							 +'<div class="mark_btn">'+i+'</div>'
							 +'<h2><a href="'+MapinitVO.maindatapath+'/html/esf/'+dirname+'/'+temp1[0]+'.html" target="_blank">'+temp1[1]+'</a></h2>'
							 +'<input name="" type="checkbox" value="" class="mark_check" />'
						 +'</div>'
						 +'<div class="info_box_map_r">'
						 +'<li>电话：'+temp1[2]+'</li>'
						 +'<li>类型：'+temp1[3]+'</li>'
						 +'<li>地址：'+temp1[1]+'</li>'
						 +'</div>'
					+'</div>';
					i++;
				}

				$("#d2dsearchlistcontent").html(strhtml).show();		
									
									
			} 
		});
}
function catecookiereturn()
{
	var url=phpbase+"/map?type=catecookiereturn";
	$.ajax({
 			type: "POST",
 			url: url,
 			data: "",
		    success: function(msg){
				$("#d2dsearchlistnum").hide();
				$("#d2dsearchfy").hide();	
				if(msg==-1)
				{
					$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
					 return;
				}
				
				try{eval("var ob=" +msg);} catch(e){};
				if(!ob)return;
				var strhtml="";
				var i=1;
				for(var key in ob)
				{
				//$value['ID']."|".$value['Name']."|".$value['ClassName']."|".$value['District']."|".$value['Consume']."|".$value['Dish']."|".$value['Address']
					var temp1=ob[key].split("|");
					strhtml=strhtml+'<div class="info_box_map">'
						 +'<div class="info_box_map_l">'
							 +'<div class="mark_btn">'+i+'</div>'
							 +'<h2><a href="'+MapinitVO.maindatapath+'/blog/index.php/blog/'+temp1[0]+'" target="_blank">'+temp1[1]+'</a></h2>'
						 +'</div>'
						 +'<div class="info_box_map_r">'
						 +'<li>美食类型：'+temp1[2]+'</li>'
						 +'<li>区　　域：'+(temp1[3]?temp1[3]:"")+'</li>'
						 +'<li>人均消费：'+temp1[4]+'</li>'
						 +'<li>招 牌 菜：'+temp1[5]+'</li>'
						 +'<li>地　　址：'+temp1[6]+'</li>'
						 +'</div>'
					+'</div>';
					i++;
				}

				$("#d2dsearchlistcontent").html(strhtml).show();;		
									
									
			} 
		});
}

/**
*新房
**/
function d2dmapoutmovefun(checkedsign){
	//alert(123);
	//alert($("#d2dbuildsalelock").val());
//alert(D2dbuildMapSearchLock);$("#searchtype").val()=="businessarea"||
	var d2dbuildsalelock=$("#d2dbuildsalelock").val();
	if(($("#searchtype").val()=="house"&&d2dbuildsalelock!=-1&&D2dbuildMapSearchLock>2)||checkedsign)
	{
	//新房搜索
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=housenew&LIMIT=200";

	//房屋类型
	 var search_housetype=encodeURI($("#search_housetype").val());
	//区域
	var search_area=$("#search_area").val();
	//价格
	var search_housemoney=$("#search_housemoney").val();	
	//search key
	var search_key=encodeURI($("#map_housekey").val());	
	var orderby=$("#orderby").val()&&$("#orderby").val()=="money"?2:1;
	
	//if($.trim($("#search_key").val())==""||!search_key||$("#search_key").val()=="请输入关键字")
	//{
	try{	
	var MapX=cqh_GetAbsXYapi(_cqh_map.MapinitVO.relx),MapY=cqh_GetAbsXYapi(_cqh_map.MapinitVO.rely);
	var MapW=cqh_GetAbsXYapi(getMapWapi()), MapH=cqh_GetAbsXYapi(getMapHapi());
	}catch(e){MapX=487072;MapW=14624;MapY=417328;MapH=11792;}
	
	//销售状态 是否锁定搜索结果
	var d2dbuildsaleout=$("#d2dbuildsaleout").attr('checked')?$("#d2dbuildsaleout").val():-1;
	var d2dbuildsaleon=$("#d2dbuildsaleon").attr('checked')?$("#d2dbuildsaleon").val():-1;
	var d2dbuildsalelock=$("#d2dbuildsalelock").attr('checked')?$("#d2dbuildsalelock").val():-1;
	//}	//alert(MapinitVO.relx+","+getMapHapi()+"|"+cqh_GetAbsXYapi(MapinitVO.relx)+","+_cqh_map.MapinitVO.rely);
	$.ajax({
 			type: "GET",
 			url: url,
 			data: "page="+page+"&order="+orderby+"&MapX="+MapX+"&MapY="+MapY+"&MapW="+MapW+"&MapH="+MapH+"&d2dbuildsaleout="+d2dbuildsaleout+"&d2dbuildsaleon="+d2dbuildsaleon+"&d2dbuildsalelock="+d2dbuildsalelock,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum,#d2dsearchfy").hide();
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
								Lable.tags_DeleIDfun();
							 return;
						}
						
								
						try{eval("var ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var strhtml='';
						var i=0;
						pagecount=ob['pageinfo']['pagecount'];
							//新房分页配置
							var house_opt = {callback: house_pageselectCallback_move};
								house_opt["items_per_page"]=1;
								house_opt["num_display_entries"]=2;
								house_opt["num_edge_entries"]=1;
								house_opt["prev_text"]="<<";
								house_opt["next_text"]=">>";
							$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();
							$("#broker_esfalltotalPage").text('共'+pagecount+'页');
							$("#data_page").pagination(pagecount, house_opt);
							//if(!obj)
							//{
							Lable.tags_DeleIDfun();//删除地图定位点
							Lable.tagsnew(contents,"house");
							//}
						}
								
					} 
		});		
			
	}
	D2dbuildMapSearchLock++;
}
function house_pageselectCallback_move(page_index, jq)
{
	var d2dbuildsalelock=$("#d2dbuildsalelock").attr('checked')?-1:$("#d2dbuildsalelock").val();
	var checkedsign=true;
	if(($("#searchtype").val()=="house"&&d2dbuildsalelock!=-1&&D2dbuildMapSearchLock>2)||checkedsign)
	{
	//新房搜索
	page=page_index+1;
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=housenew";

	//房屋类型
	 var search_housetype=encodeURI($("#search_housetype").val());
	//区域
	var search_area=$("#search_area").val();
	//价格
	var search_housemoney=$("#search_housemoney").val();	
	//search key
	var search_key=encodeURI($("#map_housekey").val());	
	var orderby=$("#orderby").val()&&$("#orderby").val()=="money"?2:1;
	
	//if($.trim($("#search_key").val())==""||!search_key||$("#search_key").val()=="请输入关键字")
	//{
	try{	
	var MapX=cqh_GetAbsXYapi(_cqh_map.MapinitVO.relx),MapY=cqh_GetAbsXYapi(_cqh_map.MapinitVO.rely);
	var MapW=cqh_GetAbsXYapi(getMapWapi()), MapH=cqh_GetAbsXYapi(getMapHapi());
	}catch(e){MapX=487072;MapW=14624;MapY=417328;MapH=11792;}
	
	//销售状态 是否锁定搜索结果
	var d2dbuildsaleout=$("#d2dbuildsaleout").attr('checked')?$("#d2dbuildsaleout").val():-1;
	var d2dbuildsaleon=$("#d2dbuildsaleon").attr('checked')?$("#d2dbuildsaleon").val():-1;
	var d2dbuildsalelock=$("#d2dbuildsalelock").attr('checked')?$("#d2dbuildsalelock").val():-1;
	//}	//alert(MapinitVO.relx+","+getMapHapi()+"|"+cqh_GetAbsXYapi(MapinitVO.relx)+","+_cqh_map.MapinitVO.rely);
	$.ajax({
 			type: "GET",
 			url: url,
 			data: "page="+page+"&order="+orderby+"&MapX="+MapX+"&MapY="+MapY+"&MapW="+MapW+"&MapH="+MapH+"&d2dbuildsaleout="+d2dbuildsaleout+"&d2dbuildsaleon="+d2dbuildsaleon+"&d2dbuildsalelock="+d2dbuildsalelock,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum,#d2dsearchfy").hide();
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
								Lable.tags_DeleIDfun();
							 return;
						}
						
								
						try{eval("var ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var strhtml='';
						var i=0;
						for(counter=contents.length;i<counter;i++)//分解JSON数据
						{
							contents[i].TypeName=contents[i].TypeName?contents[i].TypeName:"无";
							contents[i].X=contents[i].x?contents[i].x:0;
							contents[i].Y=contents[i].y?contents[i].y:0;
							contents[i].Name=contents[i].name?contents[i].name:"";
							contents[i].ID=contents[i].id?contents[i].id:"0";
							contents[i].gosign="house";
						   var dirname =Math.floor(contents[i].id/100)||1;

							strhtml=strhtml+'<div class="HouseNo off" onmouseover="$(this).addClass(\'on\')"; onmouseout="$(this).removeClass(\'on\')";>'
							  +'<input name="housenamecheck'+contents[i].id+'" id="housenamecheck'+contents[i].id+'"" type="checkbox" value=""  class="" onclick="housecompare(this);"/>'
							  +'<div class="No">'+(i+1)+'</div>'
							  +'<a class="HouseName"  href="javascript:void(0);"  onclick="Locaobj.newhouseShow({Name:\''+contents[i].name+'\',ID:\''+contents[i].id+'\',HouseName:\''+contents[i].name+'\',X:\''+contents[i].x+'\',Y:\''+contents[i].y+'\',Title:\''+contents[i].name+'\',salestel:\''+contents[i].salestel+'\',nowprice:\''+contents[i].nowprice+'\',housestype:\''+contents[i].housestype+'\',imageurl:\''+contents[i].imageurl+'\',menu:\'house\'})" id="housename'+contents[i].id+'">'+contents[i].name+'</a>'
							  +'<ul class="morInfo">'
								+'<li>物业类型:'+contents[i].housestype+'</li>'
								+'<li>均价:'+contents[i].nowprice+'元/平方米</li>'
							  +'</ul>'
							  +'<ul class="address">'
								+'<li><a href="'+MapinitVO.maindatapath+'/html/newhouse/'+dirname+'/'+contents[i].id+'.html" title="'+contents[i].address+'" target="_blank">详情</a>地址:'+contents[i].address+'</li>'
							  +'</ul>'
							+'</div>';
						}
							pagecount=ob['pageinfo']['pagecount'];
							$("#house_list_context").html(strhtml).show();//把数据加载到页0页
							//if(!obj)
							//{
							Lable.tags_DeleIDfun();//删除地图定位点
							Lable.tagsnew(contents,"house");
							//}
						}
								
					} 
		});		
			
	}
	D2dbuildMapSearchLock++;
	 return false;
}
function house_pageselectCallback_map_housesearch(page_index, jq)
{
	page_index=page_index+1;
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=housenew";
	if(D2dbuildMapSearchLock>2)D2dbuildMapSearchLock=2;
	//房屋类型
	 var search_housetype=encodeURI($("#search_housetype").val());
	//区域
	var search_area=$("#search_area").val();
	//价格
	var search_housemoney=$("#search_housemoney").val();	
	//search key
	var search_key=encodeURI($("#map_housekey").val());
	var orderby=($("#orderby").size()==1)&&$("#orderby").val()=="money"?2:1;
	//销售状态 是否锁定搜索结果
	var d2dbuildsaleout=$("#d2dbuildsaleout").attr('checked')?$("#d2dbuildsaleout").val():-1;
	var d2dbuildsaleon=$("#d2dbuildsaleon").attr('checked')?$("#d2dbuildsaleon").val():-1;
	var d2dbuildsalelock=$("#d2dbuildsalelock").attr('checked')?$("#d2dbuildsalelock").val():-1;
	
	//alert(MapinitVO.relx+","+getMapHapi()+"|"+cqh_GetAbsXYapi(MapinitVO.relx)+","+_cqh_map.MapinitVO.rely);
	$.ajax({
 			type: "GET",
 			url: url,
 			data: "page="+page_index+"&search_housetype="+search_housetype+"&search_area="+search_area+"&search_housemoney="+search_housemoney+"&search_key="+search_key+"&order="+orderby+"&d2dbuildsaleout="+d2dbuildsaleout+"&d2dbuildsaleon="+d2dbuildsaleon+"&d2dbuildsalelock="+d2dbuildsalelock,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum,#d2dsearchfy").hide();
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
								return;
						}
						
								
						try{eval("var ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var strhtml='';
						var i=0;
						for(counter=contents.length;i<counter;i++)//分解JSON数据
						{
							contents[i].TypeName=contents[i].TypeName?contents[i].TypeName:"无";
							contents[i].X=contents[i].x?contents[i].x:0;
							contents[i].Y=contents[i].y?contents[i].y:0;
							contents[i].Name=contents[i].name?contents[i].name:"";
							contents[i].ID=contents[i].id?contents[i].id:"0";
							contents[i].gosign="house";
							var  dirname=Math.floor(contents[i].id/100)||1;
							
							strhtml=strhtml+'<div class="HouseNo off" onmouseover="$(this).addClass(\'on\')"; onmouseout="$(this).removeClass(\'on\')";>'
							  +'<input name="housenamecheck'+contents[i].id+'" id="housenamecheck'+contents[i].id+'"" type="checkbox" value=""  class="" onclick="housecompare(this);"/>'
							  +'<div class="No">'+(i+1)+'</div>'
							  +'<a class="HouseName"  href="javascript:void(0);"  onclick="Locaobj.newhouseShow({Name:\''+contents[i].name+'\',ID:\''+contents[i].id+'\',HouseName:\''+contents[i].name+'\',X:\''+contents[i].x+'\',Y:\''+contents[i].y+'\',Title:\''+contents[i].name+'\',salestel:\''+contents[i].salestel+'\',nowprice:\''+contents[i].nowprice+'\',housestype:\''+contents[i].housestype+'\',imageurl:\''+contents[i].imageurl+'\',menu:\'house\'})" id="housename'+contents[i].id+'">'+contents[i].name+'</a>'
							  +'<ul class="morInfo">'
								+'<li>物业类型:'+contents[i].housestype+'</li>'
								+'<li>均价:'+contents[i].nowprice+'元/平方米</li>'
							  +'</ul>'
							  +'<ul class="address">'
								+'<li><a href="'+MapinitVO.maindatapath+'/html/newhouse/'+dirname+'/'+contents[i].id+'.html" title="'+contents[i].address+'" target="_blank">详情</a>地址:'+contents[i].address+'</li>'
							  +'</ul>'
							+'</div>';
						}
							pagecount=ob['pageinfo']['pagecount'];
							
							$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();
							$("#broker_esfalltotalPage").text('共'+pagecount+'页');
							$("#house_list_context").html(strhtml).show();//把数据加载到页0页
						
						}}
						});
	 return false;
}
function map_moviesearch(page)
{
	//楼市地图movie搜索
	//auth:gyf
	if (page==null||page==0) page=1;
	var orderby=$("#orderby").val()?$("#orderby").val():"no";	
	
	var url=phpbase+"/map?type=movie";
	
	$.ajax({
 			type: "POST",
 			url: url,
 			data: "page="+page,
		     success: function(msg){
					try{eval("var msgobj=" +msg);} catch(e){}
					
					var contents=msgobj.cinema;
					var strhtml='';
					for(i=0;i<contents.length;i++)//分解JSON数据
					{
						contents[i].Name=contents[i].name;
						contents[i].ID=contents[i].id;
						contents[i].gosign="movie";
						strhtml+='<div class="info_box_map">'
							 +'<div class="info_box_map_l">'
								 +'<div class="mark_btn">'+((page-1)*20+(i+1))+'</div>'
								 +'<h2><a href="'+MapinitVO.maindatapath+'/movie/index.php/cinemashow/'+contents[i].id+'" target="_blank">'+contents[i].name+'</a></h2>'
							 +'</div>'
							 +'<div class="info_box_map_r">'
							 +'<li>地　　址：'+contents[i].address+'</li>'
							 +'<a href="javascript:void(0);" onclick="Locaobj.movieShow({Name:\''+contents[i].name+'\',ID:\''+contents[i].id+'\',imageurl:\''+contents[i].headimage+'\',cinemahall:\''+contents[i].cinemahall+'\',Address:\''+contents[i].address+'\',X:\''+contents[i].X+'\',Y:\''+contents[i].Y+'\'})">地图显示</a>&nbsp;&nbsp;&nbsp;<a href="'+MapinitVO.maindatapath+'/movie/index.php/cinemashow/'+contents[i].id+'" target="_blank">查看详情</a>'
							 +'</div>'
						+'</div>';
					}
						
					$("#d2dsearchlistnum").text('共'+(contents.length-1)+'条信息').show();
					$("#d2dsearchlistcontent").html(strhtml).show();
					
					var tempstr="";
					for(var i=0;i<msgobj.movie.length;i++)
					{
						tempstr+="<span><a target='_blank' href='"+MapinitVO.maindatapath+"/movie/index.php/search/?typeid=1&cinemaid=0&starttime=&endtime=&key="+encodeURIComponent(msgobj.movie[i].title)+"' title='"+msgobj.movie[i].title+"'>"+msgobj.movie[i].title+"</a></span>&nbsp;&nbsp;";
					}
					tempstr="<div id='moviedivid'>"+tempstr+"</div>"
					$("#map_moviecondition").html(tempstr).show();
					if(map_menusign==2)Lable.tagsnew(contents,"movie");
					map_menusign=2;							
			} 
		});
}

function map_catesearch(page)
{
	//楼市地图美食搜索
	//auth:gyf
	if (page==null||page==0) page=1;
	var orderby=$("#orderby").val()?$("#orderby").val():"no";	
	
	var url=phpbase+"/map?type=cate";
	var strhtml='';
	var key=$("#map_catekey").val();
	if (key.indexOf('如：解放碑')>=0|| key.indexOf('关键字')>=0)key='';
	var catetype=$("#catetype").val();
	var District=$("#District").val();
	var Consume=$("#Consume").val();
	var Discount=$("#Discount").val();

	$.ajax({
 			type: "POST",
 			url: url,
 			data: "page="+page+"&key="+key+"&orderby="+orderby+"&catetype="+catetype+"&District="+District+"&Consume="+Consume+"&Discount="+Discount,
		     success: function(msg){

						try{eval("var ob=" +msg);} catch(e){}
						if(!ob||!ob.contents)
						{
								$("#d2dsearchlistnum").hide();
								$("#d2dsearchfy").hide();	
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
							 return;							
						}
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						pagecount=ob['pageinfo']['pagecount'];
							var house_opt = {callback: cate_pageselectCallback_move};
								house_opt["items_per_page"]=1;
								house_opt["num_display_entries"]=2;
								house_opt["num_edge_entries"]=1;
								house_opt["prev_text"]="<<";
								house_opt["next_text"]=">>";
							$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();
							$("#broker_esfalltotalPage").text('共'+pagecount+'页');
							$("#data_page").pagination(pagecount, house_opt);
							if(map_menusign==2)Lable.tagsnew(contents,"cate");
							map_menusign=2;						
									
								
					} 
		});
}
function cate_pageselectCallback_move(page_index, jq)
{
	page=page_index+1;
	if (page==null||page==0) page=1;
	var orderby=$("#orderby").val()?$("#orderby").val():"no";	
	
	var url=phpbase+"/map?type=cate";
	var strhtml='';
	var key=$("#map_catekey").val();
	if (key.indexOf('如：解放碑')>=0|| key.indexOf('关键字')>=0)key='';
	var catetype=$("#catetype").val();
	var District=$("#District").val();
	var Consume=$("#Consume").val();
	var Discount=$("#Discount").val();

	$.ajax({
 			type: "POST",
 			url: url,
 			data: "page="+page+"&key="+key+"&orderby="+orderby+"&catetype="+catetype+"&District="+District+"&Consume="+Consume+"&Discount="+Discount,
		     success: function(msg){

						try{eval("var ob=" +msg);} catch(e){}
						if(!ob||!ob.contents)
						{
								$("#d2dsearchlistnum").hide();
								$("#d2dsearchfy").hide();	
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
							 return;							
						}
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
				
						for(i=0;i<contents.length;i++)//分解JSON数据
						{
						
							strhtml=strhtml+'<div class="HouseNo off" onmouseover="$(this).addClass(\'on\')"; onmouseout="$(this).removeClass(\'on\')";>'
							 // +'<input name="housenamecheck'+contents[i].ID+'" id="housenamecheck'+contents[i].ID+'"" type="checkbox" value=""  class="" onclick="housecompare(this);"/>'
							  +'<div class="No">'+(i+1)+'</div>'
							  +'<a class="HouseName"  href="javascript:void(0);"  onclick="Locaobj.cateShow({Name:\''+contents[i].Name+'\',ID:\''+contents[i].ID+'\',X:\''+contents[i].X+'\',Y:\''+contents[i].Y+'\',ClassName:\''+contents[i].ClassName+'\',Discount:\''+contents[i].Discount+'\',Consume:\''+contents[i].Consume+'\',Telephone:\''+contents[i].Telephone+'\',imageurl:\''+contents[i].imageurl+'\'})" id="housename'+contents[i].ID+'">'+contents[i].Name+'</a>'
							  +'<ul class="morInfo">'
								 +'<li>美食类型：'+contents[i].ClassName+'</li>'
								 +'<li>区　　域：'+(contents[i].District?contents[i].District:"")+'</li>'
								 +'<li>人均消费：'+contents[i].Consume+'</li>'
								 +'<li>招 牌 菜：'+contents[i].Dish+'</li>'
								// +'<li>地　　址：'+contents[i].Address+'</li>'
							  +'</ul>'
							  +'<ul class="address">'
								+'<li><a href="'+MapinitVO.maindatapath+'/blog/index.php/blog/'+contents[i].ID+'"  title="'+contents[i].Address+'" target="_blank">详情</a>地址:'+contents[i].Address+'</li>'
							  +'</ul>'
							+'</div>';
						}
							pagecount=ob['pageinfo']['pagecount'];
							$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();
							$("#house_list_context").html(strhtml).show();//把数据加载到页0页
							if(map_menusign==2)Lable.tagsnew(contents,"cate");
							map_menusign=2;						
									
								
					} 
		});	
}
function housecompareclose(id)
{
//close
if(!id)return;
$("#housenamecheck"+id).attr("checked","");
housecompare();

}


function housecompare(o)
{
//房产对比
var tempname=[];
$("#house_list_context").find("input:checked").each(function(i){
	
   //alert(this.name.replace("housenamecheck",""));
	var tempid=this.name.replace("housenamecheck","");
   tempname[tempname.length]={name:$("#housename"+tempid).html(),id:tempid};
 });
if(tempname.length>5){
$(o).attr("checked","");
alert("你最多只能选择5条房源");return;
}
var searchtype=$("#searchtype").val();
var urlact=searchtype=="house"?"http://newhouse.d2d.cn/index.php/house/compare":urlact;
	urlact=searchtype=="esf"?"http://esf.d2d.cn/index.php/compare/":urlact;
var str='<FORM method=POST id="housecompare_from_s_list" name=CompareForm action="'+urlact+'" target=_blank>'
     +'<div class="contrastBox" >'
  	 +'<a class="offWin" href="javascript:void(0);" title="关闭 房源对比" onclick="$(\'#housecompare\').html(\'\')" ></a>'
	 +'<input name="type" type="hidden" value="housecompare"/><input name="housecomparetype" type="hidden" value="'+searchtype+'"/>'
  	 +'<p class="color_Gray666">你已经选择了 <span class="color_Orange bf">'+tempname.length+'</span>条房源</p>'
  	 +'<ul>'
    for(i=0;i<tempname.length;i++)
			  {
              str=str+'<li><a class="delHouse" href="javascript:void(0);"   onclick="housecompareclose(\''+tempname[i].id+'\')"></a><a href="'+tempname[i].href+'" title="" target="_blank">'+tempname[i].name+'</a><input name="housecompareid[]"  type="hidden" value="'+tempname[i].id+'"/></li>'
			  }
	str=str+'</ul>'
     +'<div  style="text-align:center;"><input type="submit" name="SubmitButton" value="开始对比"  class="contrastButton"></div>'
	 +'</div>'
	 +'</FORM>';


$("#housecompare").show().html(str);


 
}
var map_housesearch_lable_var=false;
var map_housesearch_lable_var_nofi=false;
function map_housesearch(page,sign)
{  	if(!map_housesearch_lable_var_nofi)
		{map_housesearch_lable_var_nofi=true;
		return ;
		}
	//新房搜索
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=housenew";
	if(D2dbuildMapSearchLock>2)D2dbuildMapSearchLock=2;
	//房屋类型
	 var search_housetype=encodeURI($("#search_housetype").val());
	//区域
	var search_area=$("#search_area").val();
	//价格
	var search_housemoney=$("#search_housemoney").val();	
	//search key
	var search_key=encodeURI($("#map_housekey").val());
	var orderby=($("#orderby").size()==1)&&$("#orderby").val()=="money"?2:1;
	
	/*
	var MapX=cqh_GetAbsXYapi(_cqh_map.MapinitVO.relx),MapY=cqh_GetAbsXYapi(_cqh_map.MapinitVO.rely);
	var MapW=cqh_GetAbsXYapi(getMapWapi()), MapH=cqh_GetAbsXYapi(getMapHapi());
	*/
	//销售状态 是否锁定搜索结果
	var d2dbuildsaleout=$("#d2dbuildsaleout").attr('checked')?$("#d2dbuildsaleout").val():-1;
	var d2dbuildsaleon=$("#d2dbuildsaleon").attr('checked')?$("#d2dbuildsaleon").val():-1;
	var d2dbuildsalelock=$("#d2dbuildsalelock").attr('checked')?$("#d2dbuildsalelock").val():-1;
	
	//alert(MapinitVO.relx+","+getMapHapi()+"|"+cqh_GetAbsXYapi(MapinitVO.relx)+","+_cqh_map.MapinitVO.rely);
	$.ajax({
 			type: "GET",
 			url: url,
 			data: "page="+page+"&search_housetype="+search_housetype+"&search_area="+search_area+"&search_housemoney="+search_housemoney+"&search_key="+search_key+"&order="+orderby+"&d2dbuildsaleout="+d2dbuildsaleout+"&d2dbuildsaleon="+d2dbuildsaleon+"&d2dbuildsalelock="+d2dbuildsalelock,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum,#d2dsearchfy").hide();
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
								return;
						}
						
								
						try{eval("var ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var strhtml='';
						var i=0;
						pagecount=ob['pageinfo']['pagecount'];
						var house_opt = {callback: house_pageselectCallback_map_housesearch};
								house_opt["items_per_page"]=1;
								house_opt["num_display_entries"]=2;
								house_opt["num_edge_entries"]=1;
								house_opt["prev_text"]="<<";
								house_opt["next_text"]=">>";
								$("#data_page").pagination(pagecount, house_opt);
							if(contents[0]&&contents[0].X&&contents[0].Y){
								gocurapi(contents[0]);
								Lable.tagsnew([contents[0]],"house");
							}
							
							
						}		
					} 
		});
}


function map_businessareasearch(page,sign,search_housetext)
{	
//sign:businessarea 定位区域 不定位信息
	//alert(document.getElementById("businessareaselect").options[$("#businessareaselect").attr("selectedIndex")].text);
	//alert($("#businessareaselect").val());
	//所属区域搜索 businessareaselect
	var search_housetextnew='';
		$("#map_businessareacondition span").each(function(){
			if(search_housetext)
			{
				if($(this).text()==search_housetext)
				{
					$(this).css('color',"#0c0");
					search_housetextnew=search_housetext;
				}
				else $(this).css('color',"");
				
			}else
			{
				if($(this).css('color')=="#0c0")search_housetextnew=$(this).text();
			}
		});
	
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=housenew";

	/*
	//select value
	 search_housevalue=$("#businessareaselect").val();	
	 if(search_housevalue<0){alert("请选择区域！");return;}
	//select text
	var search_housetext=encodeURI(document.getElementById("businessareaselect").options[$("#businessareaselect").attr("selectedIndex")].text);	
	*/
	var orderby=$("#orderby").val()&&$("#orderby").val()=="money"?2:"";
	var search_housevalue="";
	//层数跳转
	 for(var key in businessareaArray)
	 {
		if(search_housetextnew&&search_housetextnew==businessareaArray[key][0])
		{
			search_housevalue=key;
			if(businessareaArray[key][1]&&businessareaArray[key][2])
			gocurapi({X:businessareaArray[key][1],Y:businessareaArray[key][2]});
			cqh_Zotoapi(businessareaArray[key][3]);
		}
	 }			

	 /*
	var MapX=cqh_GetAbsXYapi(_cqh_map.MapinitVO.relx),MapY=cqh_GetAbsXYapi(_cqh_map.MapinitVO.rely);
	var MapW=cqh_GetAbsXYapi(getMapWapi()), MapH=cqh_GetAbsXYapi(getMapHapi());

	//销售状态 是否锁定搜索结果
	var d2dbuildsaleout=$("#d2dbuildsaleout").attr('checked')?$("#d2dbuildsaleout").val():-1;
	var d2dbuildsaleon=$("#d2dbuildsaleon").attr('checked')?$("#d2dbuildsaleon").val():-1;
	var d2dbuildsalelock=$("#d2dbuildsalelock").attr('checked')?$("#d2dbuildsalelock").val():-1;
	+"&MapX="+MapX+"&MapY="+MapY+"&MapW="+MapW+"&MapH="+MapH+"&d2dbuildsaleout="+d2dbuildsaleout+"&d2dbuildsaleon="+d2dbuildsaleon+"&d2dbuildsalelock="+d2dbuildsalelock
	*/
	$.ajax({
 			type: "GET",
 			url: url,
 			data: "page="+page+"&search_housevalue="+search_housevalue+"&search_housetext="+search_housetextnew+"&order="+orderby,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum").hide();
								$("#d2dsearchfy").hide();	
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
								Lable.tags_DeleIDfun();
							 return;
						}
						
								
						try{eval("var ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var strhtml='';
						var i=0;
						pagecount=ob['pageinfo']['pagecount'];
							
							$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();
							var house_opt = {callback: bus_pageselectCallback_map_housesearch};
							house_opt["items_per_page"]=1;
							house_opt["num_display_entries"]=2;
							house_opt["num_edge_entries"]=1;
							house_opt["prev_text"]="<<";
							house_opt["next_text"]=">>";
							$("#data_page").pagination(pagecount, house_opt);
							
							if(map_menusign==2)Lable.tagsnew(contents,sign,search_housevalue);
						}
									
								
					} 
		});
		
}
function bus_pageselectCallback_map_housesearch(page_index, jq,search_housetext)
{
	//所属区域搜索 businessareaselect
	
	var search_housetextnew='';
		$("#map_businessareacondition span").each(function(){
			if(search_housetext)
			{
				if($(this).text()==search_housetext)
				{
					$(this).css('color',"#0c0");
					search_housetextnew=search_housetext;
				}
				else $(this).css('color',"");
				
			}else
			{
				if($(this).css('color')=="#0c0")search_housetextnew=$(this).text();
			}
		});
	page=page_index+1;
	
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=housenew";
	var orderby=$("#orderby").val()&&$("#orderby").val()=="money"?2:"";
	var search_housevalue="";
	//层数跳转
	 for(var key in businessareaArray)
	 {
		if(search_housetextnew&&search_housetextnew==businessareaArray[key][0])
		{
			search_housevalue=key;
			if(businessareaArray[key][1]&&businessareaArray[key][2])
			gocurapi({X:businessareaArray[key][1],Y:businessareaArray[key][2]});
			cqh_Zotoapi(businessareaArray[key][3]);
		}
	 }		
	$.ajax({
 			type: "GET",
 			url: url,
 			data: "page="+page+"&search_housevalue="+search_housevalue+"&search_housetext="+search_housetextnew+"&order="+orderby,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum").hide();
								$("#d2dsearchfy").hide();	
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
								Lable.tags_DeleIDfun();
							 return;
						}
						
								
						try{eval("var ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var strhtml='';
						var i=0;
						for(counter=contents.length;i<counter;i++)//分解JSON数据
						{
							contents[i].TypeName=contents[i].TypeName?contents[i].TypeName:"无";
							contents[i].X=contents[i].x?contents[i].x:0;
							contents[i].Y=contents[i].y?contents[i].y:0;
							contents[i].Name=contents[i].name?contents[i].name:"";
							contents[i].ID=contents[i].id?contents[i].id:"0";
							contents[i].gosign="house";
							var  dirname=Math.floor(contents[i].id/100)||1;
							
							
							
							strhtml=strhtml+'<div class="HouseNo off" onmouseover="$(this).addClass(\'on\')"; onmouseout="$(this).removeClass(\'on\')";>'
							  +'<input name="housenamecheck'+contents[i].id+'" id="housenamecheck'+contents[i].id+'"" type="checkbox" value=""  class="" onclick="housecompare(this);"/>'
							  +'<div class="No">'+(i+1)+'</div>'
							  +'<a class="HouseName"  href="javascript:void(0);"  onclick="Locaobj.newhouseShow({Name:\''+contents[i].name+'\',ID:\''+contents[i].id+'\',HouseName:\''+contents[i].name+'\',X:\''+contents[i].x+'\',Y:\''+contents[i].y+'\',Title:\''+contents[i].name+'\',salestel:\''+contents[i].salestel+'\',nowprice:\''+contents[i].nowprice+'\',housestype:\''+contents[i].housestype+'\',imageurl:\''+contents[i].imageurl+'\',menu:\'house\'})" id="housename'+contents[i].id+'">'+contents[i].name+'</a>'
							  +'<ul class="morInfo">'
								+'<li>物业类型:'+contents[i].housestype+'</li>'
								 +'<li>电话：'+contents[i].salestel+'</li>'
								 +'<li>开发商：'+contents[i].developer+'</li>'
							  +'</ul>'
							  +'<ul class="address">'
								+'<li><a href="'+MapinitVO.maindatapath+'/html/newhouse/'+dirname+'/'+contents[i].id+'.html" title="'+contents[i].address+'" target="_blank">详情</a>地址:'+contents[i].address+'</li>'
							  +'</ul>'
							+'</div>';
							
						}
							pagecount=ob['pageinfo']['pagecount'];
							
							$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();
							//alert(strhtml);
							$("#house_list_context").html(strhtml).show();//把数据加载到页0页
							if(map_menusign==2)Lable.tagsnew(contents,sign,search_housevalue);
						}
									
								
					} 
		});
}

function map_rentsearch(page)
{
	
	//rent
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=rent";
	var strhtml='';
	var i=0;
	var typeid=1;
	var typenamne;
	var tname;
	var Structure=$("#RENTTypeListhtype").val(); //户型
	var mtype=$("#RENTmtype").val(); //房屋价格 
	var innerarea="all"; //套内面积 	
	var key=new String($("#map_rentkey").val()).toString(); 	//搜索字符
	if (key.indexOf('如：解放碑')>=0|| key.indexOf('关键字')>=0)key='';
	var housetypeid=($("#HouseType").val())?$("#HouseType").val():-1;//房屋类型 出租 出售 
	var housedistrict=$("#RENTTypeListmtypeDistrict").val();//区域选择 
	var Title=$("#broker_mpacatehoustitle").val(); 

	var orderby=$("#orderby").val()?$("#orderby").val():"no";
	$.ajax({
 			type: "POST",
 			url: url,
 			data: "page="+page+"&htype="+housetypeid+"&Structure="+Structure+"&mtype="+mtype+"&value="+key+"&housedistrict="+housedistrict+"&innerarea="+innerarea+"&orderby="+orderby,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum").hide();
								$("#d2dsearchfy").hide();	
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
							 return;
						}
						var ob;
						var ob0;
						var Name="";
						try{eval("ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var i=0;
						pagecount=ob['pageinfo']['pagecount'];
						$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();						
							pagecount=ob['pageinfo']['pagecount'];
							var house_opt = {callback: rent_pageselectCallback_map_housesearch};
								house_opt["items_per_page"]=1;
								house_opt["num_display_entries"]=2;
								house_opt["num_edge_entries"]=1;
								house_opt["prev_text"]="<<";
								house_opt["next_text"]=">>";
								$("#data_page").pagination(pagecount, house_opt);
								
							//curPages.show().html(option);
							if(map_menusign==2)Lable.tagsnew(contents,"esf");
							map_menusign=2;
							}
									
								
					} 
		});
}
function rent_pageselectCallback_map_housesearch(page_index, jq)
{
	page=page_index+1;
	//rent
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=rent";
	var strhtml='';
	var i=0;
	var typeid=1;
	var typenamne;
	var tname;
	var Structure=$("#RENTTypeListhtype").val(); //户型
	var mtype=$("#RENTmtype").val(); //房屋价格 
	var innerarea="all"; //套内面积 	
	var key=new String($("#map_rentkey").val()).toString(); 	//搜索字符
	if (key.indexOf('如：解放碑')>=0|| key.indexOf('关键字')>=0)key='';
	var housetypeid=($("#HouseType").val())?$("#HouseType").val():-1;//房屋类型 出租 出售 
	var housedistrict=$("#RENTTypeListmtypeDistrict").val();//区域选择 
	var Title=$("#broker_mpacatehoustitle").val(); 

	var orderby=$("#orderby").val()?$("#orderby").val():"no";
	$.ajax({
 			type: "POST",
 			url: url,
 			data: "page="+page+"&htype="+housetypeid+"&Structure="+Structure+"&mtype="+mtype+"&value="+key+"&housedistrict="+housedistrict+"&innerarea="+innerarea+"&orderby="+orderby,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum").hide();
								$("#d2dsearchfy").hide();	
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
							 return;
						}
						var ob;
						var ob0;
						var Name="";
						try{eval("ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var i=0;
						for(counter=contents.length;i<counter;i++)//分解JSON数据
						{
							contents[i].HouseName=contents[i].HouseName?contents[i].HouseName:"暂无名称";
							contents[i].Name=contents[i].HouseName+"/"+contents[i].InnerArea+"㎡/"+contents[i].Money;
							contents[i].ID=contents[i].HouseID;
							contents[i].gosign="rent";
							var  dirname=Math.floor(contents[i].HouseID/100)||1;
							
							strhtml=strhtml+'<div class="HouseNo off" onmouseover="$(this).addClass(\'on\')"; onmouseout="$(this).removeClass(\'on\')";>'
							  +'<input name="housenamecheck'+contents[i].HouseID+'" id="housenamecheck'+contents[i].HouseID+'"" type="checkbox" value=""  class="" onclick="housecompare(this);"/>'
							  +'<div class="No">'+(i+1)+'</div>'
							  +'<a class="HouseName"  href="javascript:void(0);"  onclick="Locaobj.esfShow({Name:\''+contents[i].Title+'\',ID:\''+contents[i].HouseID+'\',HouseName:\''+contents[i].HouseName+'\',X:\''+contents[i].X+'\',Y:\''+contents[i].Y+'\',Money:\''+contents[i].Money+'\',Structure:\''+contents[i].Structure+'\',InnerArea:\''+contents[i].InnerArea+'\',Title:\''+contents[i].Title+'\',Telephone:\''+contents[i].Tel+'\',imageurl:\''+contents[i].imageurl+'\',menu:\'rent\'})" id="housename'+contents[i].HouseID+'">'+contents[i].HouseName+'</a>'
							  +'<ul class="morInfo">'
								 +'<li>电话：'+contents[i].Tel+'</li>'
								 +'<li>类型：'+contents[i].TypeName+'</li>'
								 +'<li>价格：'+contents[i].Money+'</li>'
								// +'<li>地址：'+contents[i].Title+'</li>'	
							  +'</ul>'
							  +'<ul class="address">'
								+'<li><a  href="http://rent.d2d.cn/html/'+dirname+'/'+contents[i].HouseID+'.html" title="'+contents[i].Titles+'" target="_blank">详情</a>地址:'+contents[i].Titles+'</li>'
							  +'</ul>'
							+'</div>';
						}
						$("#house_list_context").html(strhtml).show();//把数据加载到页0页
							if(map_menusign==2&&(!go_esf_temp))Lable.tagsnew(contents,"rent");
							map_menusign=2;
							}
									
								
					} 
		});
}
function map_esfsearch(page)
{
	
	//esf
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=esf";
	var strhtml='';
	var i=0;
	var typeid=1;
	var typenamne;
	var tname;
	var Structure=$("#ESFTypeListhtype").val(); //户型
	var mtype=$("#mtype").val(); //房屋价格 
	var innerarea="all"; //套内面积 	
	var key=new String($("#map_esfkey").val()).toString(); 	//搜索字符
	if (key.indexOf('如：解放碑')>=0|| key.indexOf('关键字')>=0)key='';
	var housetypeid=($("#HouseType").val())?$("#HouseType").val():-1;//房屋类型 出租 出售 
	var housedistrict=$("#ESFTypeListmtypeDistrict").val();//区域选择 
	var Title=$("#broker_mpacatehoustitle").val(); 

	var orderby=$("#orderby").val()?$("#orderby").val():"no";
	$.ajax({
 			type: "POST",
 			url: url,
 			data: "page="+page+"&htype="+housetypeid+"&Structure="+Structure+"&mtype="+mtype+"&value="+key+"&housedistrict="+housedistrict+"&innerarea="+innerarea+"&orderby="+orderby,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum").hide();
								$("#d2dsearchfy").hide();	
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
							 return;
						}
						var ob;
						var ob0;
						var Name="";
						try{eval("ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var i=0;
						pagecount=ob['pageinfo']['pagecount'];
						$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();						
							pagecount=ob['pageinfo']['pagecount'];
							var house_opt = {callback: esf_pageselectCallback_map_housesearch};
								house_opt["items_per_page"]=1;
								house_opt["num_display_entries"]=2;
								house_opt["num_edge_entries"]=1;
								house_opt["prev_text"]="<<";
								house_opt["next_text"]=">>";
								$("#data_page").pagination(pagecount, house_opt);
								
							//curPages.show().html(option);
							if(map_menusign==2)Lable.tagsnew(contents,"esf");
							map_menusign=2;
							}
									
								
					} 
		});
}
function esf_pageselectCallback_map_housesearch(page_index, jq)
{
	page=page_index+1;
	if (page==null||page==0) page=1;
	var url=phpbase+"/map?type=esf";
	var strhtml='';
	var i=0;
	var typeid=1;
	var typenamne;
	var tname;
	var Structure=$("#ESFTypeListhtype").val(); //户型
	var mtype=$("#mtype").val(); //房屋价格 
	var innerarea="all"; //套内面积 	
	var key=new String($("#map_esfkey").val()).toString(); 	//搜索字符
	if (key.indexOf('如：解放碑')>=0|| key.indexOf('关键字')>=0)key='';
	var housetypeid=($("#HouseType").val())?$("#HouseType").val():-1;//房屋类型 出租 出售 
	var housedistrict=$("#ESFTypeListmtypeDistrict").val();//区域选择 
	var Title=$("#broker_mpacatehoustitle").val(); 

	var orderby=$("#orderby").val()?$("#orderby").val():"no";
	$.ajax({
 			type: "POST",
 			url: url,
 			data: "page="+page+"&htype="+housetypeid+"&Structure="+Structure+"&mtype="+mtype+"&value="+key+"&housedistrict="+housedistrict+"&innerarea="+innerarea+"&orderby="+orderby,
		     success: function(msg){
						if(msg==-1)
						{
								$("#d2dsearchlistnum").hide();
								$("#d2dsearchfy").hide();	
								$("#d2dsearchlistcontent").html('抱歉,没有找到相关的内容').show();
							 return;
						}
						var ob;
						var ob0;
						var Name="";
						try{eval("ob=" +msg);} catch(e){}
						if(ob){
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						contentsinfo=ob['contents'];
						page=ob['pageinfo']['pagenow'];	
						var i=0;
						for(counter=contents.length;i<counter;i++)//分解JSON数据
						{
							contents[i].HouseName=contents[i].HouseName?contents[i].HouseName:"暂无名称";
							contents[i].Name=contents[i].HouseName+"/"+contents[i].InnerArea+"㎡/"+contents[i].Money;
							contents[i].ID=contents[i].HouseID;
							contents[i].gosign="esf";
							var  dirname=Math.floor(contents[i].HouseID/100)||1;
							
							strhtml=strhtml+'<div class="HouseNo off" onmouseover="$(this).addClass(\'on\')"; onmouseout="$(this).removeClass(\'on\')";>'
							  +'<input name="housenamecheck'+contents[i].HouseID+'" id="housenamecheck'+contents[i].HouseID+'"" type="checkbox" value=""  class="" onclick="housecompare(this);"/>'
							  +'<div class="No">'+(i+1)+'</div>'
							  +'<a class="HouseName"  href="javascript:void(0);"  onclick="Locaobj.esfShow({Name:\''+contents[i].Title+'\',ID:\''+contents[i].HouseID+'\',HouseName:\''+contents[i].HouseName+'\',X:\''+contents[i].X+'\',Y:\''+contents[i].Y+'\',Money:\''+contents[i].Money+'\',Structure:\''+contents[i].Structure+'\',InnerArea:\''+contents[i].InnerArea+'\',Title:\''+contents[i].Title+'\',Telephone:\''+contents[i].Tel+'\',imageurl:\''+contents[i].imageurl+'\',menu:\'esf\'})" id="housename'+contents[i].HouseID+'">'+contents[i].HouseName+'</a>'
							  +'<ul class="morInfo">'
								 +'<li>电话：'+contents[i].Tel+'</li>'
								 +'<li>类型：'+contents[i].TypeName+'</li>'
								 +'<li>价格：'+contents[i].Money+'</li>'
								// +'<li>地址：'+contents[i].Title+'</li>'	
							  +'</ul>'
							  +'<ul class="address">'
								+'<li><a  href="http://esf.d2d.cn/html/'+dirname+'/'+contents[i].HouseID+'.html" title="'+contents[i].Titles+'" target="_blank">详情</a>地址:'+contents[i].Titles+'</li>'
							  +'</ul>'
							+'</div>';
						}
						$("#house_list_context").html(strhtml).show();//把数据加载到页0页
							if(map_menusign==2&&(!go_esf_temp))Lable.tagsnew(contents,"esf");
							map_menusign=2;
							}
									
								
					} 
		});
}
function D2dtransitsite_line_change(sign){
	//线路 换乘 切换
	if(!sign)return;
	if(sign=='site')
	{
		$("#D2dtransitline").hide();
		$("#D2dtransitsite").show();
	}
	else if(sign=='line')
	{
		$("#D2dtransitline").show();
		$("#D2dtransitsite").hide();		
	}
	
}



/*********************************
描述:地图的搜索功能,用户输入值搜索
作者:gyf
日期:20010-5-4
**********************************/
function map_search(page)
{
	
//return 0;
if (page==null||page==0) page=1;

	var YPSearchBoxSearchname=$("#mapsearch_key").val(); 
	if(!YPSearchBoxSearchname)return false;
	var url=phpbase+"/map/?type=mapsearch";
	var strhtml='';
	var ahtml='';
	if (YPSearchBoxSearchname=="")
	{
		$("#d2dsearchlistnum,#d2dsearchfy").hide();	
		strhtml='<BR>抱歉您没有输入搜索信息，请输入搜索信息再试<BR><BR>';
		$("#d2dsearchlistcontent").html(strhtml).show();
	}
	$.ajax({
 			type: "POST",
 			url: url,
 			data:  "value="+YPSearchBoxSearchname+"&typeid=10&page="+page,
 			success: function(msg){
					try{ eval("var ob=" +msg);} catch(e){}
					if(msg==-1 || ob['contents']==-1){
						$("#d2dsearchlistnum,#d2dsearchfy").hide();
						strhtml='<BR>抱歉，本站没有找到与'+$("#mapsearch_key").val()+' 相关的内容<BR><BR>';
						$("#d2dsearchlistcontent").html(strhtml).show();
						
						}else
						{
							$("#d2dsearchlistnum,#d2dsearchfy").show();					
						}
						/*
						if(ob['AIS'].length>0)
						{
								var acontent=ob['AIS'];
								ahtml="<li class='f14 list_h24'><span>您可以尝试使用智能搜索以下为您提供的快速搜索关键字进行搜索！</span></li><BR>";
								for(i=0,icount=acontent.length;i<icount;i++)
								{
									var strname=acontent[i].toString();
									ahtml=ahtml+'<li class="f14 list_h24"><span><a href="Javascript:" onclick=\'MapSearchAI(0,"'+strname+'");\'>'+strname+'</a></span></li>';
								}
							$("#SearchResultInfoAI").html(ahtml);	
						}else
						{
							$("#SearchResultInfoAI").html(' ');
						}
						*/
					if(!ob)return;
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						//strhtml='<ul>';
					//strhtml+='</ul>';	

						pagecount=ob['pageinfo']['pagecount'];
						page=pageinfo.pagenow;
						$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();	
						var house_opt = {callback: base_pageselectCallback_map_housesearch};
								house_opt["items_per_page"]=1;
								house_opt["num_display_entries"]=2;
								house_opt["num_edge_entries"]=1;
								house_opt["prev_text"]="<<";
								house_opt["next_text"]=">>";
								$("#data_page").pagination(pagecount, house_opt);


							
					
				} 
		});
}
function base_pageselectCallback_map_housesearch(page_index, jq)
{
	page=page_index+1;
	if (page==null||page==0) page=1;

	var YPSearchBoxSearchname=$("#mapsearch_key").val(); 
	if(!YPSearchBoxSearchname)return false;
	var url=phpbase+"/map/?type=mapsearch";
	var strhtml='';
	var ahtml='';
	if (YPSearchBoxSearchname=="")
	{
		$("#d2dsearchlistnum,#d2dsearchfy").hide();	
		strhtml='<BR>抱歉您没有输入搜索信息，请输入搜索信息再试<BR><BR>';
		$("#d2dsearchlistcontent").html(strhtml).show();
	}
	$.ajax({
 			type: "POST",
 			url: url,
 			data:  "value="+YPSearchBoxSearchname+"&typeid=10&page="+page,
 			success: function(msg){
					try{ eval("var ob=" +msg);} catch(e){}
					if(msg==-1 || ob['contents']==-1){
						$("#d2dsearchlistnum,#d2dsearchfy").hide();
						strhtml='<BR>抱歉，本站没有找到与'+$("#mapsearch_key").val()+' 相关的内容<BR><BR>';
						$("#d2dsearchlistcontent").html(strhtml).show();
						
						}else
						{
							$("#d2dsearchlistnum,#d2dsearchfy").show();					
						}
					if(!ob)return;
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						//strhtml='<ul>';
						for(i=0, counter=contents.length;i<counter;i++)//分解JSON数据
						{
							contents[i].typenamne=contents[i].typenamne||"暂无";
							contents[i].Address=contents[i].Address||"暂无";
							contents[i].Telephone=contents[i].Telephone||"暂无";
							strhtml=strhtml+'<div class="HouseNo off" onmouseover="$(this).addClass(\'on\')"; onmouseout="$(this).removeClass(\'on\')";>'
							//  +'<input name="housenamecheck'+contents[i].id+'" id="housenamecheck'+contents[i].id+'"" type="checkbox" value=""  class="" onclick="housecompare(this);"/>'
							  +'<div class="No">'+(i+1)+'</div>'
							  +'<a class="HouseName"  href="javascript:void(0);"  onclick=\'posinfoapi('+contents[i].JosnValue+')\' id="housename'+contents[i].ID+'">'+contents[i].Title+'</a>'
							  +'<ul class="morInfo">'
								 +'<li>类型：'+contents[i].typenamne+'</li>'
								 +'<li>电话：'+contents[i].Telephone+'</li>'
							  +'</ul>'
							  +'<ul class="address">'
								+'<li><a href="'+MapinitVO.maindatapath+'/blog/index.php/blog/'+contents[i].ID+'" target="_blank">详情</a>地址:'+contents[i].Address+'</li>'
							  +'</ul>'
							+'</div>';
							
							
		
						}
					//strhtml+='</ul>';	
						$("#house_list_context").html(strhtml).show();//把数据加载到页0页
							
					
				} 
		});
}
var map_tercelsearch_typeid="";//特色地图类型全局变量
function map_tercelsearch(typeid,page)
{
	if (page==null||page==0) page=1;
	map_tercelsearch_typeid=typeid;
	var url=phpbase+"/map/?type=map_tercelsearch";
	var strhtml='';
	$.ajax({
 			type: "POST",
 			url: url,
 			data:  "typeid="+map_tercelsearch_typeid+"&page="+page,
 			success: function(msg){
					if(msg==-1){$("#house_list_context").html("<div class='HouseNo off'>&nbsp;&nbsp;没有数据!</div>").show(); return}
					try{ eval("var ob=" +msg);} catch(e){}
					if(!ob)return;
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						pagecount=ob['pageinfo']['pagecount'];
						page=pageinfo.pagenow;
						$("#d2dsearchlistnum").text(''+pageinfo.count+'').show();	
						var house_opt = {callback: base_pageselectCallback_map_tercelsearch};
								house_opt["items_per_page"]=1;
								house_opt["num_display_entries"]=2;
								house_opt["num_edge_entries"]=1;
								house_opt["prev_text"]="<<";
								house_opt["next_text"]=">>";
								$("#data_page").pagination(pagecount, house_opt);


							
					
				} 
		});
}
function base_pageselectCallback_map_tercelsearch(page_index, jq)
{	
	page=page_index+1;
	if (page==null||page==0) page=1;
	var url=phpbase+"/map/?type=map_tercelsearch";
	var strhtml='';
	$.ajax({
 			type: "POST",
 			url: url,
 			data:  "typeid="+map_tercelsearch_typeid+"&page="+page,
 			success: function(msg){
					try{ eval("var ob=" +msg);} catch(e){alert(e);}
					if(!ob){return;}
						pageinfo=ob['pageinfo'];
						contents=ob['contents'];
						var strhtml='';
						for(i=0, counter=contents.length;i<counter;i++)//分解JSON数据
						{
							
							strhtml=strhtml+'<div class="HouseNo off" onmouseover="$(this).addClass(\'on\')"; onmouseout="$(this).removeClass(\'on\')";>'
							//  +'<input name="housenamecheck'+contents[i].ID+'" id="housenamecheck'+contents[i].ID+'"" type="checkbox" value=""  class="" onclick="housecompare(this);"/>'
							  +'<div class="No">'+(i+1)+'</div>'
							  +'<a class="HouseName"  href="javascript:void(0);"  onclick="Locaobj.cateShow({Name:\''+contents[i].Name+'\',ID:\''+contents[i].ID+'\',X:\''+contents[i].X+'\',Y:\''+contents[i].Y+'\',ClassName:\'288\',Discount:\'无\',Consume:\'无\',Telephone:\''+contents[i].Telephone+'\',imageurl:\''+contents[i].imageurl+'\',address:\''+contents[i].Address+'\'})" id="housename'+contents[i].id+'">'+contents[i].Name+'</a>'
							  +'<ul class="morInfo">'
								//+'<li>物业类型:'+contents[i].housestype+'</li>'
								//+'<li>均价:'+contents[i].nowprice+'元/平方米</li>'
							  +'</ul>'
							  +'<ul class="address">'
								+'<li><a  href="'+MapinitVO.maindatapath+'/blog/index.php/blog/'+contents[i].ID+'" target="_blank">详情</a>地址:'+contents[i].Address+'</li>'
							  +'</ul>'
							+'</div>';
 
		
						}
					//strhtml+='</ul>';	
						$("#house_list_context").html(strhtml).show();//把数据加载到页0页
							
					
				} 
		});
}

