﻿$(function(){

getSessionValue();
 addCookie($("#floors_id").val(),$("#floor_name").val());
$.post("../user/userTeamBuy.do?d=firstLoadUserTeamBuy&floors_id="+document.getElementById("floors_id").value,{},function(xml){
		$("#userTeamBuyDiv").html(xml);
	});
	$.post("../floor/score.do?d=toScoreView2&floor_id="+document.getElementById("floors_id").value,{},function(xml){
		$("#pingji").html(xml);
	////////////////////////////////////////////
	$("div[id=pingji]").find("img").hover(
	function (){
		var thiz = $( this );
		saveStatus(thiz);
		thiz.prevAll().andSelf().attr("src",star_1);
		thiz.nextAll().attr("src",star_0);
	},
	function(){
		var thiz = $( this );
		var imgs = thiz.parent().find(" img ");
		imgs.each(function(i){
			 imgs.eq(i).attr("src",old_star_arr[i]);
		});
	}
	);
	//////////////////////////程序挺好用
	
	$("div[id=pingji]").find("img").bind("click",function (){
	var thiz = $( this );
	changeImgs(thiz);
	var uri = "../floor/score.do?d=getScoreJSON"; 
	var item = thiz.parent().find("i:first").attr("item");
	var itemF=3;
	if(item==1){
		itemF=3;
	}else if(item==2){
		itemF=2;
	}else if(item==3){
		itemF=1.6;
	}else if(item==4){
		itemF=1.6;
	}else if(item==5){
		itemF=4;
	}else if(item==6){
		itemF=2.4;
	}else if(item==7){
		itemF=3;
	}else if(item==8){
		itemF=2;
	}else if(item==9){
		itemF=2.4;
	}else if(item==10){
		itemF=2;
	}
	var each_score = ($(this).parent().find(" img ").index(thiz)+1) *itemF;
	var dangqianf=document.getElementById("viewFloors_pingfen_dangqian").innerText;
	var dangqianf_int= parseFloat(dangqianf);
	if(dangqianf_int>=120 || dangqianf_int+each_score >120 ){
		alert("评分失败，当前分数达到上限！");return;
	}
	document.getElementById("viewFloors_pingfen_dangqian").innerText=(dangqianf_int+each_score);
	var floor_id = $("input[name=floors_id]").val();
	//alert(item+"  "+floor_id+"  "+each_score+"  ");
	$.getJSON(uri,{each_score:each_score,item:item,floor_id:floor_id},function(json){
		//alert(thiz.find(" ~ i :first > font").html());
	//	alert(json.person_num);
		if(json.person_num == -1){
			alert("请不要重复评分");return;
		}else{
			thiz.find(" ~ i :first > font").html(json.person_num);
			thiz.find(" ~ i :last > font").html(json.avg);
		}
		
	});
	if(dangqianf_int>=120 || dangqianf_int+each_score >120 ){
		alert("评分失败，当前分数达到上限！");return;
	}
	
	document.getElementById("viewFloors_pingfen_dangqian").innerText=(dangqianf_int+each_score);
	});
	
	///////////////////////
	});
});
$().ready(function(){//loaddalert
	var userName = $("#userName");
	if(1==1){	
		$.post("../user/user.do?d=getSessionUserName",{},function(xml){
			if(xml==null || xml==""){
				$("#loginDiv").load("../logoutSuccess3.jsp");
				$("#welcome_words").html("");
			}else{
				$("#loginDiv").load("../loginSuccess3.jsp");
				$("#welcome_words").html(userName.val()+"您好！这里是");			
			}
		});
	}
/*	if(userName.val() == "" || userName.val()==null){
		$("#loginDiv").load("../logoutSuccess3.jsp");
		$("#welcome_words").html("");
	}else{
		$("#loginDiv").load("../loginSuccess3.jsp");
		$("#welcome_words").html(userName.val()+"您好！这里是");
	}*/
});
$(function() {
      $('.tt a').lightBox();
      $('.xgt_xx').lightBox();
});
function changeImgs(thiz){
	thiz.prevAll().andSelf().each(function(i){
		thiss = $( this );
		thiss.attr("src",star);
	});
	thiz.nextAll().attr("src",star_0);
	saveStatus(thiz);
};
function saveStatus(thiz){
	var imgs = thiz.parent().find(" img ");
	imgs.each(function(i){
		old_star_arr[i] = imgs.eq(i).attr("src");
	});
}
var old_star_arr = new Array();
var star_1 = "../images/star_1.gif";//little color
var star = "../images/star.gif";//all color
var star_0 = "../images/star_0.gif";//empty color


function generateValidateImage(){
	document.getElementById("validateImg").src = "subject.do?d=getValidateImage&rnd="+Math.random();
}
function submitUserTeamBuy(){
	var floor_id = $("#floor_id");
		if(floor_id.val()==null || floor_id.val()==""){
		document.getElementById("floor_id").value=document.getElementById("floors_id").value;}
	var user_name = $("#user_name");
	var user_type = $("#user_type");
	var real_name = $("#real_name");
	var sex = $("input[name=sex][checked]");
	var age = $("#age");
	var mobile = $("#mobile");
	var e_mail = $("#e_mail");
	var comm_addr = $("#comm_addr");
	var buy_goal = $("#buy_goal");
	var buy_area = $("#buy_area");
	var room_type = $("#room_type");
	var remark = $("#remark");
	var floor_id = $("#floor_id");
	var decide_buy = $("input[name=decide_buy][checked]");
	var flag = $("#userTeamBuyForm1").valid();
	if(!flag) return;
	$.post("../user/userTeamBuy.do?d=saveUserTeamBuy",{
			floor_id:floor_id.val(),
			user_name:user_name.val(),
			user_type:user_type.val(),
			real_name:real_name.val(),
			sex:sex.val(),
			age:age.val(),
			mobile:mobile.val(),
			e_mail:e_mail.val(),
			comm_addr:comm_addr.val(),
			buy_goal:buy_goal.val(),
			buy_area:buy_area.val(),
			room_type:room_type.val(),
			remark:remark.val(),
			floor_id:floor_id.val(),
			decide_buy:decide_buy.val()
			},function(xml){
		if(xml == -1){
			alert("参加团购失败！");
		}else{
			alert("参加团购成功！");
			$("#userTeamBuyDiv").html(xml);
		}
	});
	
}
//动态获取评论方法 author wxm.
function getComment(){
	$.post("../floor/floors.do?d=getCommentForAJAX&floors_id="+document.getElementById("floors_id").value,{},function(xml){
	var commentConntent="";
	if(xml!=null && xml!=""){
		var fC=xml.split("^#");
		document.getElementById("ViewFloors_comment_span").innerHTML="网友评论("+fC[2]+")&nbsp;&nbsp;热点("+fC[3]+")&nbsp;&nbsp;最新评论:"+fC[1].substring(0,11);
		var commentDiv=document.getElementById("FloorCommentDiv");
		var commentlist=fC[0].split("$#");
			for (var i = 0; i < commentlist.length - 1; i++) {
				var comment=commentlist[i].split("%#");
					commentConntent=commentConntent+'<div class="xgnews">'+
						'<div class="xgtitle">'+
							'<a target="_blank" href="http://comment.funba.sdfdc.com/comment/comment_funba.htm?channelid=1&aid=$'+document.getElementById("floors_id").value+'&type_url=&type=1&subject='+document.getElementById("floor_name_url").value+'" class="font_blue1">房吧网友：'+comment[1]+'</a>'+
						'</div>'+
						'<div class="xgtext">'+
							'<font class="font_black5">'+comment[2]+'</font>'+
						'</div>'+
											
					'</div>';
			}
		}else{
			commentConntent='<li><span class="font_black4">暂无评论！</span></li>';
		}
		commentConntent=commentConntent+'<div class="more"><a target="_blank" href="http://comment.funba.sdfdc.com/comment/comment_funba.htm?channelid=1&aid='+document.getElementById("floors_id").value+'&type_url=&type=1&subject='+document.getElementById("floor_name_url").value+'" class="font_blue1">[更多..]</a></div>';
		commentDiv.innerHTML=commentConntent;
	});
}
//动态获取评论方法 author wxm.
function getComment2(){
	$.post("../floor/floors.do?d=getCommentForAJAX&floors_id="+document.getElementById("floors_id").value,{},function(xml){
	var commentConntent="";
	if(xml!=null && xml!=""){
		var fC=xml.split("^#");
		var floors_id=document.getElementById("floors_id").value;
		var floor_name_url=document.getElementById("floor_name_url").value;
		document.getElementById("reDianPingLun").innerHTML="&nbsp;&nbsp;热点(<font class='font_10'>"+fC[3]+"</font>)&nbsp;&nbsp;<a target=_blank href='http://comment.funba.sdfdc.com/comment/comment_funba.htm?channelid=1&aid="+floors_id+"&type_url=&type=1&subject="+floor_name_url+"' >网友评论(<font class='font_10'>"+fC[2]+"</font>)</a>&nbsp;&nbsp;";
		if (fC[1]!=null && fC[1]!="" && fC[1]!="null" ){
		document.getElementById("zuiXinPingLun").innerHTML="最新评论："+fC[1].substring(0,11);
		}if(fC[4]!=null && fC[4]!="" && fC[4]!="null"){
			document.getElementById("pinjizhonghepingfen").innerHTML=fC[4];
		}if(fC[5]!=null && fC[5]!="" && fC[5]!="null"){
			document.getElementById("pingfen_zpfrs_lable").innerHTML=fC[5];//动态评分
		}if(fC[6]!=null && fC[6]!="" && fC[6]!="null"){
			document.getElementById("floorsTuanGouCount").innerHTML="团购(<font class='font_10'>"+fC[6]+"</font>)";//动态团购
		}if(fC[7]!=null && fC[7]!="" && fC[7]!="null"){
	//	alert(fC[7]);
			document.getElementById("zuiJinGengXinShiJian").innerHTML="最近更新时间："+fC[7];//动态团购
		}
		var commentDiv=document.getElementById("FloorCommentDiv");
		var commentDiv2=document.getElementById("FloorCommentDiv2");
		var commentlist=fC[0].split("$#");
			for (var i = 0; i < commentlist.length - 1; i++) {
				var comment=commentlist[i].split("%#");
					commentConntent=commentConntent+'<div class="xgnews">'+
						'<div class="xgtitle">'+
							'<a target="_blank" href="http://comment.funba.sdfdc.com/comment/comment_funba.htm?channelid=1&aid=$'+document.getElementById("floors_id").value+'&type_url=&type=1&subject='+document.getElementById("floor_name_url").value+'" class="font_blue2">房吧网友：'+comment[1]+'<span style="margin-left:380px;">'+(fC[2]--)+'楼</span></a>'+
						'</div>'+
						'<div class="xgtext">'+
							'<font class="font_black5">'+comment[2]+'</font>'+
						'</div>'+
											
					'</div>';
			}
		}else{
			commentConntent='<li><span class="font_black4">暂无评论！</span></li>';
		}
		commentConntent=commentConntent+'<div class="more"><a target="_blank" href="http://comment.funba.sdfdc.com/comment/comment_funba.htm?channelid=1&aid='+document.getElementById("floors_id").value+'&type_url=&type=1&subject='+document.getElementById("floor_name_url").value+'" class="font_blue2">[更多..]</a></div>';
		commentDiv2.innerHTML=commentConntent;
		document.getElementById("FloorCommentDiv").innerHTML=commentConntent;
	});
}
//动态获取评论方法 author wxm.
function getDianPing(){
	$.post("../floor/floors.do?d=getDianPingForAJAX&floors_id="+document.getElementById("floors_id").value,{},function(xml){
	var commentConntent="";
	if(xml!=null && xml!=""){
		var fC=xml;
		var commentDiv=document.getElementById("FloorDianPingDIV");
		var FloorsDianPingTitle=document.getElementById("FloorsDianPingTitle");
		FloorsDianPingTitle.innerHTML='<div class="bofg" align="left" style="color:#c00;font-size:14px;font-weight:bold; text-indent:20px; line-height:30px; margin-top:10px; border-bottom:1px dashed #f60;"><span class="flo" style="float:left;">专家点评：</span><a href="#" onclick="dianping();"  style="float:right; color:#c00; text-decoration: underline; margin-top:5px; margin-right:15px;">专家点评</a><div style="clear:both;"></div></div>'
		var commentlist=fC.split("$#");
			for (var i = 0; i < commentlist.length - 1; i++) {
				var comment=commentlist[i].split("%#");
					commentConntent=commentConntent+'<div class="xgnews">'+
						'<div class="xgtitle">'+
							'<a href="#" class="font_blue2">楼盘专家：'+comment[1]+'</a>'+
						'</div>'+
						'<div class="xgtext">'+
							'<font class="font_black5">'+comment[2]+'</font>'+
						'</div>'+
											
					'</div>';
			}
		}else{
			commentConntent='<li><span class="font_black4">专家点评！</span></li>';
		}
		commentDiv.innerHTML=commentConntent;
	});
}
//动态获取评论方法 author wxm.
function getFloorPic(){
	$.post("../floor/floors.do?d=getFloorPicForAJAX&floors_id="+document.getElementById("floors_id").value,{},function(xml){
		var picContent="";
		var hxtContent="";
		var sjtContent="";
		if(xml!=null && xml!=""){
			var pic=xml.split("$$");
			if(pic[0]!="" && pic[0]!=null){
				var hxt=pic[0].split("$#");
				for (var i = 0; i <hxt.length - 1; i++) {
					var h=hxt[i].split("%#");
					if(h[2]==null || h[2]=="" || h[2]==0.0){
					h[2]="不详";
					}
					hxtContent+='<div class="img" onmousemove="this.className=\'loC\'" onmouseout="this.className=\'img\'">';
					hxtContent+='<div class="xmimg tt" style="margin-top:5px;">';
					hxtContent+='<a target="_blank" href="http://funba.sdfdc.com/upload/old/'+h[0]+'"><img src="http://funba.sdfdc.com/upload/small/'+h[0]+'"  height="108" width="148"  /></a>'
					hxtContent+='</div>';
					hxtContent+='<div class="xmtext">';
					hxtContent+=' <p class="font_blue3">户型:'+h[1]+'</p>';
					hxtContent+='<p><span class="font_black6">建筑面积：</span>';
					hxtContent+='<span class="font_orange2">'+h[2]+'</span> <span class="font_blue3">m<sup style="font-size:9px;">2</sup></span></p>';
					hxtContent+='	</div></div>	';
				}
			}else{
				hxtContent+='		<li>	<div  id="myMap"  style=" width:447px; height:248px; font-size: 12px;"><center>暂无户型图信息...</center></div></li>';
			}
				hxtContent+='<div style="clear:both; font-size:0px; line-height:0px; overflow:hidden;"></div>	';
				$("#FloorPicHXT").html(hxtContent);
			if(pic[1]!=""&&pic[1]!=null){
				var sjt=pic[1].split("$#");
				for (var i = 0; i <sjt.length - 1; i++) {
					var s=sjt[i].split("%#");
					sjtContent+='<div class="img" onmousemove="this.className=\'loC\'" onmouseout="this.className=\'img\'">';
					sjtContent+='<div class="xmimg tt"><a href="http://funba.sdfdc.com/upload/old/'+s[0]+'"><img src="http://funba.sdfdc.com/upload/small/'+s[0]+'" width="148" height="108" /></a></div>';
					sjtContent+='<div class="xmtext"><p><font class="font_blue3">'+s[1]+'</font></p></div>';
					sjtContent+='</div>	';					
				}
			}else{
				sjtContent+='		<li>	<div  id="myMap"  style=" width:447px; height:248px; font-size: 12px;"><center>暂无实景图信息...</center></div></li>';
			}
				sjtContent+='<div style="clear:both; font-size:0px; line-height:0px; overflow:hidden;"></div>	';
				$("#FloorPicSJT").html(sjtContent);
		}
		$('.tt a').lightBox();
      	$('.xgt_xx').lightBox();
	});
}
//动态获取新闻方法 author wxm.
function getNews(){
	$.post("../floor/floors.do?d=getNewsForAJAX&floors_id="+document.getElementById("floors_id").value,{},function(xml){
	var newsConntent="";
		if(xml!=null && xml!=""){
		var newsDiv=document.getElementById("FloorNewsDiv");
		var newslist=xml.split("&#");
			for (var i = 0; i < newslist.length - 1; i++) {
				var news=newslist[i].split("%#");
					newsConntent=newsConntent+'<div class="xgnews">'+
								'<div class="xgtitle">'+
									'<a target="_blank" href="'+news[0]+'" class="font_blue1">'+news[1]+'</a>'+
								'</div>'+
								'<div class="xgtext">'+
								'<font class="font_black5">'+news[2]+
								'</font>'+
								'</div>'+
								'<div class="xgtime font_orange1">'+news[3]+'</div>'+
							'</div>';
				}
		}else{
			newsConntent='<li><span class="font_black4">暂无评论！</span></li>';
		}
		newsConntent=newsConntent+'<div class="more"><a target="_blank" href="http://so.sdfdc.com" class="font_blue1">[更多..]</a></div>';
		newsDiv.innerHTML=newsConntent;
	});
}
//动态获取新闻方法 author wxm.
function getNews2(){
	$.post("../floor/floors.do?d=getNewsForAJAX&floors_id="+document.getElementById("floors_id").value,{},function(xml){
	var newsConntent="";	
	var newsDiv=document.getElementById("FloorNewsDiv");
		if(xml!=null && xml!=""){
		
		var newslist=xml.split("&#");
			for (var i = 0; i < newslist.length - 1; i++) {
				var news=newslist[i].split("%#");
				if(news[1]==null|| news[2]==null || news[1]=="undefined" || news[2]=='undefined'){continue;  }
					newsConntent=newsConntent+'<div class="xgnews">'+
								'<div class="xgtitle">'+
									'<a target="_blank" href="'+news[0]+'" class="font_blue2">'+news[1]+'</a>&nbsp;&nbsp;&nbsp;<span style="color:#666;">'+news[3]+'</span>'+
								'</div>'+
								'<div class="xgtext">'+
								'<font class="font_black5">'+news[2]+
								'</font>'+
								'</div>'+
								//''+
							'</div>';
				}
		}else{
			newsConntent='<li><span class="font_black4">暂无新闻</span></li>';
		}
		newsConntent=newsConntent+'<div class="more"><a target="_blank" href="http://so.sdfdc.com" class="font_blue2">[更多..]</a></div>';
		newsDiv.innerHTML=newsConntent;
	});
}
/*

//动态获取二手房方法 author wxm.
function getErShou(){
	$.post("../floor/floors.do?d=getErShouForAJAX&floors_id="+document.getElementById("floors_id").value,{},function(xml){
	var newsConntent="";
	var strA1=xml.split("&#")
		for(var i=ErShouFangListTable.rows.length-1;i>0;i--){ 
		        ErShouFangListTable.deleteRow(i); 
		} 
		for (var i = 0; i < strA1.length - 1; i++) {
			ef = strA1[i].split("%#");
					
			var newTr = ErShouFangListTable.insertRow();
			newTr.classname="li1";	
			var newTd0 = newTr.insertCell();
			newTd0.innerHTML ='<div class="font_3">出售</div>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML= '<div align="left"><a target="_blank" href="http://esf.sdfdc.com/house/houseRemark.do?d=turn&house_id='+ef[0]+'&remark_type=1&wd=sf" class="font_blue3">'+ef[1]+'</a></div>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML=ef[2]+"";
			newTd0 = newTr.insertCell();
			newTd0.innerHTML =ef[3]+'<sup>2</sup>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML= '<font class="font_orange2">'+ef[4]+'万</font>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML= '<font class="font_black4">'+ef[5]+'</font>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML='<a target="_blank" href="http://esf.sdfdc.com/house/houseRemark.do?d=turn&house_id='+ef[0]+'&remark_type=1&wd=sf" class="font_10">详细</a>';
		}
	});
}
*/
//动态获取二手房方法 author wxm.
function getErShou(){
	var addr=$("#floor_name_url").val();
	var area_code=$("#area_code").val();
	var str="";
	var url="";
	if(area_code.indexOf("016001") >= 0) url = "esf.jn.sdfdc";
	else if(area_code.indexOf("016002") >= 0) url = "esf.lc.sdfdc";
	else if(area_code.indexOf("016003") >= 0) url = "esf.dz.sdfdc";
	else if(area_code.indexOf("016004") >= 0) url = "esf.dy.sdfdc";
	else if(area_code.indexOf("016005") >= 0) url = "esf.zb.sdfdc";
	else if(area_code.indexOf("016005") >= 0) url = "esf.zbfdc";
	else if(area_code.indexOf("016006") >= 0) url = "esf.wf.sdfdc";
	else if(area_code.indexOf("016007") >= 0) url = "esf.yt.sdfdc";
	else if(area_code.indexOf("016008") >= 0) url = "esf.wh.sdfdc";
	else if(area_code.indexOf("016009") >= 0) url = "esf.qdfdc";
	else if(area_code.indexOf("016010") >= 0) url = "esf.rz.sdfdc";
	else if(area_code.indexOf("016011") >= 0) url = "esf.ly.sdfdc";
	else if(area_code.indexOf("016012") >= 0) url = "esf.zz.sdfdc";
	else if(area_code.indexOf("016013") >= 0) url = "esf.jin.sdfdc";
	else if(area_code.indexOf("016014") >= 0) url = "esf.ta.sdfdc";
	else if(area_code.indexOf("016015") >= 0) url = "esf.lw.sdfdc";
	else if(area_code.indexOf("016016") >= 0) url = "esf.bz.sdfdc";
	else if(area_code.indexOf("016017") >= 0) url = "esf.hz.sdfdc";
	else url = "esf.sdfdc";
	var act = "http://"+url+".com/fanba.php?callback=?&area_code="+area_code+"&addr="+addr;
	for(var i=ErShouFangListTable.rows.length-1;i>0;i--){ 
		        ErShouFangListTable.deleteRow(i); 
	} 
	var area_code="016001";
	$.getJSON(act,{},function(json){
		$.each(json,function(i,item){
			var newTr = ErShouFangListTable.insertRow();
			newTr.classname="li1";	
			var newTd0 = newTr.insertCell();
			newTd0.innerHTML ='<div class="font_3">出售</div>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML= '<div align="left"><a target="_blank" href="http://'+url+'.com/house/'+item.linkman+'" class="font_blue3">'+item.addr+'</a></div>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML=item.room_type+"";
			newTd0 = newTr.insertCell();
			newTd0.innerHTML =item.area_size+'m<sup>2</sup>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML= '<font class="font_orange2">'+item.price+'万</font>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML= '<font class="font_black4">'+item.sort_time+'</font>';
			newTd0 = newTr.insertCell();
			newTd0.innerHTML='<a target="_blank"  href="http://'+url+'.com/house/'+item.linkman+'" class="font_10">详细</a>';
		});
	});
		$("#House_More_Link").html('<a href="http://'+url+'.com" target="_blank" class="font_blue2">[更多..]</a>');
}

function addCookie(floors_id,floor_name){
	 var lps = get_cookie('lps');
//	 $.cookie('lps', null);return;	
	 if(lps==null || lps=='' || lps==undefined|| lps=="null"|| lps=='undefined'){
	 	 set_cookie('lps', floors_id+"#"+floor_name,24*360);
	 }else{
	  	var c= lps.split("#$");
	 	for (var i = 0; i < c.length; i++) {
			var floor=c[i].split("#");
			if(floors_id==floor[0])
			return;
			if(i>=10){
				var s=lps.indexOf('#$');				
				lps=lps.substring(s+2,lps.length);
			}
		}
	 	lps=lps+"#$"+floors_id+"#"+floor_name;
	 	set_cookie('lps',lps,24*360);
	 }
	 
}

////////////////////////////////////////////
function addCookie22(floors_id,floor_name){
	 var pls = get_cookie('pls');
	 if(pls==null || pls=='null'|| pls=='' || pls=='undefined'|| pls==undefined){
	 	 set_cookie('pls', floors_id+"#"+floor_name,24*360);
	 }else{
	  	var c= pls.split("#$");
	 	for (var i = 0; i < c.length; i++) {
			var floor=c[i].split("#");
			if(floors_id==floor[0])
			return;
			if(i>=7){
				var s=pls.indexOf('#$');				
				pls=pls.substring(s+2,pls.length);
			}
		}
	 	pls=pls+"#$"+floors_id+"#"+floor_name;
	 	set_cookie('pls',pls,24*360);
	 }
	 
}
function set_cookie(name,value,expireHours){
	var cookieString=name+"="+encodeURIComponent(value);
	//判断是否设置过期时间
	if(expireHours>0){
		var date=new Date();
		date.setTime(date.getTime() + expireHours*3600*1000);
		cookieString=cookieString+"; expire="+date.toUTCString();
	}
	cookieString=cookieString+"; path=/; domain=sdfdc.com";
//	alert(cookieString);
	document.cookie=cookieString;
} 
function get_cookie(name){
//alert(document.cookie);
	var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split('; ');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = cookies[i];
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
           }
        }
   }
   return unescape(cookieValue);
}
function deleteCookie(name){
	var date=new Date();
	date.setTime(date.getTime()-10000);
	document.cookie=name+"=v; expire="+date.toUTCString()+"; domain=sdfdc.com";
}
