﻿var InfoYouke="0",InfoLogin="0";
jQuery(function($){
	$(".AntHouseCity").hover(function(){
		
	},function(){
		$(".AntHouseCity_").fadeOut();
	});
	$(".AntHouseCity").click(function(){
		 $(".AntHouseCity_").fadeIn();
	});
	$("#HouseAntCityH").hover(function(){
		
	},function(){
		$(".AntHouseCity_").fadeOut();
	});
	$("#HouseAntCityH").click(function(){
		$(".AntHouseCity_").fadeIn();
	});
	if(InfoYouke=="0" && InfoLogin=="-1"){
		ShowDailog('温馨提示',301,301,'HouseYouke.aspx','true','AntClassBg.gif','AntTuanclose.gif','AntClassTips.gif','66a3dd','F6F9FF','3f80c1','3f80c1');//提示游客发布，还是需要登录
		//return false;
	}
	else if(InfoLogin=="-1"){
		ShowDailog('会员登陆',301,301,'DialogLogin.aspx','false','AntClassBg.gif','AntTuanclose.gif','AntUserTips.gif','66a3dd','F6F9FF','3f80c1','3f80c1');
		//return false;
	}
	
	$("#InfoEdit").click(function(){
		var tt= $(this).attr("rel");
		var infoid=$("#hiddenSaleID").val();
		if(tt==0 || tt==-1)
		{
			ShowDailog('修改信息',301,301,'InfoLogin.aspx?action=edit&infoid='+infoid,'true','AntClassBg.gif','AntTuanclose.gif','AntUserTips.gif','66a3dd','F6F9FF','3f80c1','3f80c1');
			return false;
		}
		else{
			setTimeout(function(){window.location.href=SiteWebUrl+"Account/MemberHouseSaleEdit.aspx?SaleID="+infoid+"&from=Account/MemberHouse.aspx";},10);
		}
	});
	$("#InfoDelete").click(function(){
		var tt= $(this).attr("rel");
		var infoid=$("#hiddenSaleID").val();
		if(tt==0 || tt==-1)
		{
			ShowDailog('删除信息',301,301,'InfoLogin.aspx?action=del&infoid='+infoid,'true','AntClassBg.gif','AntTuanclose.gif','AntUserTips.gif','66a3dd','F6F9FF','3f80c1','3f80c1');
			return false;
		}
		else{
			setTimeout(function(){window.location.href=SiteWebUrl+"Account/MemberHouse.aspx?SearchKeyWord="+escape($("#Title"+infoid).val());},10);
		}
	});
	$("#houseselectform").submit(function(){
		var searchflag=false;
		if($.trim($("#HouseTopKeyword").val()) != "请输入房源特征，地点或小区名..."  && $.trim($("#HouseTopKeyword").val()) !="")								 
		{
			searchflag=true;
		}
		else{
			$("#HouseTopKeyword").val("");
		}
		var cc=$("#HouseTopSelected").val();
		var aa=$("#Househiddenvalue").val();
		var bb=aa.split(",");
		if(searchflag){
			var url="Sale.aspx?SearchKeyword="+escape($("#HouseTopKeyword").val());
			if(bb[0]=="0")
				var url=$("#hiddenurl1").val()+encodeURIComponent("Sale-0-0-0-0-0-0-0-0-0-"+$("#HouseTopKeyword").val()+"-p0"+bb[1]);
			if(cc=="1")
			{
				url="Building.aspx?SearchKeyword="+escape($("#HouseTopKeyword").val());
				if(bb[0]=="0")
					url=encodeURIComponent("Building-0-0-0-0-0-100-0-"+$("#HouseTopKeyword").val()+"-p0"+bb[1]);
			}
			else if(cc=="2")
			{
				url="Rent.aspx?SearchKeyword="+escape($("#HouseTopKeyword").val());
				if(bb[0]=="0")
					url=$("#hiddenurl2").val()+encodeURIComponent("Rent-0-0-0-0-0-0-0-0-0-"+$("#HouseTopKeyword").val()+"-p0"+bb[1]);
			}
			else if(cc=="3")
			{
					url="Community.aspx?SearchKeyword="+escape($("#HouseTopKeyword").val());
				if(bb[0]=="0")
					url=encodeURIComponent("Community-0-0-0-0-0-100-0-"+$("#HouseTopKeyword").val()+"-p0"+bb[1]);
			}
			window.open(url,"_self");
			return false;	
		}
		else{
			var url="Sale.aspx";
			if(bb[0]=="0")
				var url=$("#hiddenurl1").val()+encodeURIComponent("Sale"+bb[1]);
			if(cc=="1")
			{
				url="Building.aspx";
				if(bb[0]=="0")
					url=encodeURIComponent("Building"+bb[1]);
			}
			else if(cc=="2")
			{
				url="Rent.aspx";
				if(bb[0]=="0")
					url=$("#hiddenurl2").val()+encodeURIComponent("Rent"+bb[1]);
			}
			else if(cc=="3")
			{
				url="Community.aspx";
				if(bb[0]=="0")
					url=encodeURIComponent("Community"+bb[1]);
			}
			window.open(url,"_self");
			return false;
		}
		return false;							  
	});
	$("#HouseAccountButton").click(function(){
		var username = $.trim($("#HouseAccountUsername").val());							   
		var userpwd = $.trim($("#HouseAccountUserpwd").val());
		if(username.length==0)
		{
			alert("对不起，请输入您的用户名！");
			$("#HouseAccountUsername").focus();
			return false;
		}	
		if(userpwd.length==0)
		{
			alert("对不起，请输入您的密码！");
			$("#HouseAccountUserpwd").focus();
			return false;
		}
		var tt="";
		if($("input[name='HouseAccountCheckbox']:checked").val()=="1"){
			tt="true";	
		}
		$("#HouseAccountButton").attr("disabled", true); //设置为不可点
		AntLoginUsers(username,userpwd,"",tt,4);
		return false;							
	});
	$("#HouseTopKeyword").focus(function(){
		if($.trim(this.value) == "请输入房源特征，地点或小区名...")
			this.value = "";
	}).blur(function(){
		if($.trim(this.value) == "")
			this.value = "请输入房源特征，地点或小区名...";												  
	});
	$("#RentSaleKeyWord").focus(function(){
		if($.trim(this.value) == "请输入要搜索的关键词...")
			this.value = "";
	}).blur(function(){
		if($.trim(this.value) == "")
			this.value = "请输入要搜索的关键词...";												  
	});
	$("#NewsListKeyWord").focus(function(){
		if($.trim(this.value) == "请输入文章关键字...")
			this.value = "";
	}).blur(function(){
		if($.trim(this.value) == "")
			this.value = "请输入文章关键字...";												  
	});
	$("#BuildListKeyWord").focus(function(){
		if($.trim(this.value) == "请输入楼盘或者地址...")
			this.value = "";
	}).blur(function(){
		if($.trim(this.value) == "")
			this.value = "请输入楼盘或者地址...";												  
	});
	$("#CommunityListKeyWord").focus(function(){
		if($.trim(this.value) == "请输入小区名或路名...")
			this.value = "";
	}).blur(function(){
		if($.trim(this.value) == "")
			this.value = "请输入小区名或路名...";												  
	});
	$("#SaleListKeyWord,#RentListKeyWord").focus(function(){
		if($.trim(this.value) == "请输入房源特征,地点或小区名...")
			this.value = "";
	}).blur(function(){
		if($.trim(this.value) == "")
			this.value = "请输入房源特征,地点或小区名...";												  
	});
	$("#AgentListKeyWord").focus(function(){
		if($.trim(this.value) == "请输入经纪人姓名,中介公司门店...")
			this.value = "";
	}).blur(function(){
		if($.trim(this.value) == "")
			this.value = "请输入经纪人姓名,中介公司门店...";												  
	});
	$("#AgentShopKeyword").focus(function(){
		if($.trim(this.value) == "请输入关键词...")
			this.value = "";
	}).blur(function(){
		if($.trim(this.value) == "")
			this.value = "请输入关键词...";												  
	});
	$("#HouseAgentShopSearchForm").submit(function(){
		var searchflag=false;
		if($.trim($("#AgentShopKeyword").val()) != "请输入关键词..."  && $.trim($("#AgentShopKeyword").val()) !="")								 
		{
			searchflag=true;
		}
		else{
			$("#AgentShopKeyword").val("");
		}
		var cc=$("#AgentTypeid").val();
		var aa=$("#Househiddenvalue").val();
		var dd=$("#AgentIDHidden").val();
		var bb=aa.split(",");
		if(searchflag){
			var url="AgentSale.aspx?ID="+dd+"&Ac="+escape($("#AgentShopKeyword").val());
			if(bb[0]=="0")
				var url=encodeURIComponent("AgentSale-"+dd+"-A"+$("#AgentShopKeyword").val()+"A-0-0-p0"+bb[1]);
			if(cc=="1")
			{
				url="AgentRent.aspx?ID="+dd+"&Ac="+escape($("#AgentShopKeyword").val());
				if(bb[0]=="0")
					var url=encodeURIComponent("AgentRent-"+dd+"-A"+$("#AgentShopKeyword").val()+"A-0-0-p0"+bb[1]);
			}
			window.open(url,"_self");
			return false;	
		}
		else{
			var url="AgentSale.aspx?id="+dd;
			if(bb[0]=="0")
				var url=encodeURIComponent("AgentSale-"+dd+""+bb[1]);
			if(cc=="1")
			{
				url="AgentRent.aspx";
				if(bb[0]=="0")
					var url=encodeURIComponent("AgentRent-"+dd+bb[1]);
			}
			window.open(url,"_self");
			return false;
		}
		return false;
	});
	$("#HouseSaleSearchForm").submit(function(){
		var searchflag=false;
		if($.trim($("#SaleListKeyWord").val()) != "请输入房源特征,地点或小区名..."  && $.trim($("#SaleListKeyWord").val()) !="")								 
		{
			searchflag=true;
		}
		else{
			$("#SaleListKeyWord").val("");
		}
		var aa=$("#Househiddenvalue").val();
		var bb=aa.split(",");
		if(searchflag){
			var url="Sale.aspx?SearchKeyword="+escape($("#SaleListKeyWord").val());
			if(bb[0]=="0")
				var url=encodeURIComponent("Sale-0-0-0-0-0-0-0-0-0-"+$("#SaleListKeyWord").val()+"-p0"+bb[1]);
			window.open(url,"_self");
			return false;	
		}
		else{
			var url="Sale.aspx";
			if(bb[0]=="0")
				var url=encodeURIComponent("Sale"+bb[1]);
			window.open(url,"_self");
			return false;
		}
	});
	$("#HouseAgentSearchForm").submit(function(){
		var searchflag=false;
		if($.trim($("#AgentListKeyWord").val()) != "请输入经纪人姓名,中介公司门店..."  && $.trim($("#AgentListKeyWord").val()) !="")								 
		{
			searchflag=true;
		}
		else{
			$("#AgentListKeyWord").val("");
		}
		var aa=$("#Househiddenvalue").val();
		var bb=aa.split(",");
		if(searchflag){
			var url="Agent.aspx?SearchKeyword="+escape($("#AgentListKeyWord").val());
			if(bb[0]=="0")
				var url=encodeURIComponent("Agent-0-0-0-"+$("#AgentListKeyWord").val()+"-p0"+bb[1]);
			window.open(url,"_self");
			return false;	
		}
		else{
			var url="Agent.aspx";
			if(bb[0]=="0")
				var url=encodeURIComponent("Agent"+bb[1]);
			window.open(url,"_self");
			return false;
		}
	});
	$("#HouseRentSearchForm").submit(function(){
		var searchflag=false;
		if($.trim($("#RentListKeyWord").val()) != "请输入房源特征,地点或小区名..."  && $.trim($("#RentListKeyWord").val()) !="")								 
		{
			searchflag=true;
		}
		else{
			$("#RentListKeyWord").val("");
		}
		var aa=$("#Househiddenvalue").val();
		var bb=aa.split(",");
		if(searchflag){
			var url="Rent.aspx?SearchKeyword="+escape($("#RentListKeyWord").val());
			if(bb[0]=="0")
				var url=encodeURIComponent("Rent-0-0-0-0-0-0-0-0-0-"+$("#RentListKeyWord").val()+"-p0"+bb[1]);
			window.open(url,"_self");
			return false;	
		}
		else{
			var url="Rent.aspx";
			if(bb[0]=="0")
				var url=encodeURIComponent("Rent"+bb[1]);
			window.open(url,"_self");
			return false;
		}
	});
	$("#HouseBuildingSearchForm").submit(function(){
		var searchflag=false;
		if($.trim($("#BuildListKeyWord").val()) != "请输入楼盘或者地址..."  && $.trim($("#BuildListKeyWord").val()) !="")								 
		{
			searchflag=true;
		}
		else{
			$("#BuildListKeyWord").val("");
		}
		var aa=$("#Househiddenvalue").val();
		var bb=aa.split(",");
		if(searchflag){
			var url="Building.aspx?SearchKeyword="+escape($("#BuildListKeyWord").val());
			if(bb[0]=="0")
				var url=encodeURIComponent("Building-0-0-0-0-0-100-0-"+$("#BuildListKeyWord").val()+"-p0"+bb[1]);
			window.open(url,"_self");
			return false;	
		}
		else{
			var url="Building.aspx";
			if(bb[0]=="0")
				var url=encodeURIComponent("Building"+bb[1]);
			window.open(url,"_self");
			return false;
		}
	});
	$("#HouseCommunitySearchForm").submit(function(){
		var searchflag=false;
		if($.trim($("#CommunityListKeyWord").val()) != "请输入小区名或路名..."  && $.trim($("#CommunityListKeyWord").val()) !="")								 
		{
			searchflag=true;
		}
		else{
			$("#CommunityListKeyWord").val("");
		}
		var aa=$("#Househiddenvalue").val();
		var bb=aa.split(",");
		if(searchflag){
			var url="Community.aspx?SearchKeyword="+escape($("#CommunityListKeyWord").val());
			if(bb[0]=="0")
				var url=encodeURIComponent("Community-0-0-0-0-0-100-0-"+$("#CommunityListKeyWord").val()+"-p0"+bb[1]);
			window.open(url,"_self");
			return false;	
		}
		else{
			var url="Community.aspx";
			if(bb[0]=="0")
				var url=encodeURIComponent("Community"+bb[1]);
			window.open(url,"_self");
			return false;
		}
	});
	$("#HouseNewsListSearchForm").submit(function(){
		var searchflag=false;
		if($.trim($("#NewsListKeyWord").val()) == "请输入文章关键字..."  || $.trim($("#NewsListKeyWord").val())=="")								 
		{
			$("#NewsListKeyWord").val("");
		}
		else
		{
			searchflag=true;
		}
		if($.trim($("#NewsListKey").val()) !="100")
		{
			searchflag=true;	
		}	
		if(searchflag){
			var aa=$("#Househiddenvalue").val();
			var bb=aa.split(",");
			var url="HouseNewsList.aspx?key="+$("#NewsListKey").val()+"&SearchKeyword"+escape($("#NewsListKeyWord").val());
			if(bb[0]=="0")
				var url=encodeURIComponent("HouseNewsList-"+$("#NewsListKey").val()+"-"+$("#NewsListKeyWord").val()+"-p0"+bb[1]);
			window.open(url,"_self");
			return false;	
		}
		else{
			alert("请输入您想搜索的条件！");	
			$("#NewsListKey").focus();
			return false;
		}
	});
	$("#RentSaleSearchForm").submit(function(){
		if($.trim($("#RentSaleKeyWord").val()) == "请输入要搜索的关键词..."  || $.trim($("#RentSaleKeyWord").val())=="")								 
		{
			$("#RentSaleKeyWord").val("");
		}
		var aa=$("#Househiddenvalue").val();
		var bb=aa.split(",");
		var url="RentSale.aspx?SearchKeyword="+escape($("#RentSaleKeyWord").val());
		if(bb[0]=="0")
			var url=encodeURIComponent("RentSale-100-0-0-"+$("#RentSaleKeyWord").val()+"-p0"+bb[1]);
		window.open(url,"_self");
		return false;
	});
	$("#tishibottomclose").click(function(){
		$("#AntHouseLink_").html("");
		$("#AntHouseLink_").removeClass("AntHouseLink_");
		$("#AntHouseLink_").css("padding-bottom","8px");
	});
	if($("#ISL_Cont_1").length>0){
		GetObj("List2_1").innerHTML=GetObj("List1_1").innerHTML;
		GetObj('ISL_Cont_1').scrollLeft=fill_1>=0?fill_1:GetObj('List1_1').scrollWidth-Math.abs(fill_1);
		GetObj("ISL_Cont_1").onmouseover=function(){clearInterval(autoPlayObj_1)}
		GetObj("ISL_Cont_1").onmouseout=function(){AutoPlay_1()}
		autoPlayObj_1 = setTimeout(function(){AutoPlay_1()},3000);	
	}
	$("#AntHouseIndexSale_").mouseover(function(){
		$("#AntHouseIndexSale").show();
		$("#AntHouseIndexRent").hide();
		$(this).addClass("a_");
		$("#AntHouseIndexRent_").removeClass("a_");
	});
	$("#AntHouseIndexRent_").mouseover(function(){
		$("#AntHouseIndexRent").show();
		$("#AntHouseIndexSale").hide();
		$(this).addClass("a_");
		$("#AntHouseIndexSale_").removeClass("a_");
	});
	$('#big_font').click(function(){
		$('#NewsContent').css({'font-size':'16px'});
	});
	$('#mid_font').click(function(){
		$('#NewsContent').css({'font-size':'14px'});
	});
	$('#sma_font').click(function(){
		$('#NewsContent').css({'font-size':'12px'});
	});
	$("#ClassTabSale1").mouseover(function(){
		$("#ClassTabSale1").addClass("a_");							   
		$("#ClassTabSale2").removeClass("a_");							   
		$("#ClassTabSale3").removeClass("a_");
		$("#ClassListSale1").show();
		$("#ClassListSale2").hide();
		$("#ClassListSale3").hide();
	});
	$("#ClassTabSale2").mouseover(function(){
		$("#ClassTabSale2").addClass("a_");							   
		$("#ClassTabSale1").removeClass("a_");							   
		$("#ClassTabSale3").removeClass("a_");							   
		$("#ClassListSale2").show();
		$("#ClassListSale1").hide();
		$("#ClassListSale3").hide();
	});
	$("#ClassTabSale3").mouseover(function(){
		$("#ClassTabSale3").addClass("a_");							   
		$("#ClassTabSale1").removeClass("a_");							   
		$("#ClassTabSale2").removeClass("a_");							   
		$("#ClassListSale3").show();
		$("#ClassListSale1").hide();
		$("#ClassListSale2").hide();
	});
	$("#ClassTabRent1").mouseover(function(){
		$("#ClassTabRent1").addClass("a_");							   
		$("#ClassTabRent2").removeClass("a_");							   
		$("#ClassTabRent3").removeClass("a_");
		$("#ClassListRent1").show();
		$("#ClassListRent2").hide();
		$("#ClassListRent3").hide();
	});
	$("#ClassTabRent2").mouseover(function(){
		$("#ClassTabRent2").addClass("a_");							   
		$("#ClassTabRent1").removeClass("a_");							   
		$("#ClassTabRent3").removeClass("a_");							   
		$("#ClassListRent2").show();
		$("#ClassListRent1").hide();
		$("#ClassListRent3").hide();
	});
	$("#ClassTabRent3").mouseover(function(){
		$("#ClassTabRent3").addClass("a_");							   
		$("#ClassTabRent1").removeClass("a_");							   
		$("#ClassTabRent2").removeClass("a_");							   
		$("#ClassListRent3").show();
		$("#ClassListRent1").hide();
		$("#ClassListRent2").hide();
	});
	if($_D("SlideNum"))
	{
		function Each(list, fun){
			for (var i = 0, len = list.length; i < len; i++) { fun(list[i], i); }
		};
		var objs = $_D("SlideNum").getElementsByTagName("li");
		var tv = new TransformView("SlidePlayer", "idSlider", 300, objs.length, {
			onStart : function(){ Each(objs, function(o, i){ o.className = tv.Index == i ? "on" : ""; }) }//按钮样式
		});
		tv.Start();
		Each(objs, function(o, i){
			o.onmouseover = function(){
				o.className = "on";
				tv.Auto = false;
				tv.Index = i;
				tv.Start();
			}
			o.onmouseout = function(){
				o.className = "";
				tv.Auto = true;
				tv.Start();
			}
		})	
	}
	if($("#buildidhidden").length>0)
	{
		ShowAjaxPage("../ShowAjaxPage.aspx?action=showbuildcomment&currentid="+$("#buildidhidden").val(),"AntHouseBuildDianPing");
	}
	if($("#communityidhidden").length>0)
	{
		ShowAjaxPage("../ShowAjaxPage.aspx?action=showcommunitycomment&currentid="+$("#communityidhidden").val(),"AntHouseCommunityDianPing");
	}
	$("#Buildcomentform").submit(function(){
		var username = $.trim($("#AntUserName").val());							   
		var userpwd = $.trim($("#AntUserPwd").val());
		var content = $.trim($("#AntUserContent").val());
		var Code = $.trim($("#AntUserCode").val());
		if($_D("AntUserName")){
			if(username.length==0)
			{
				alert("对不起，请输入您的用户名！");
				$("#AntUserName").focus();
				return false;
			}
			if(userpwd.length==0)
			{
				alert("对不起，请输入您的密码！");
				$("#AntUserPwd").focus();
				return false;
			}
		}
		if(Code.length==0)
		{
			alert("对不起，请输入验证码！");
			$("#AntUserCode").focus();
			return false;
		}
		if(content.length==0)
		{
			alert("对不起，请输入内容！");
			$("#AntUserContent").focus();
			return false;
		}
		var InfoIDS=$("#buildidhidden").val();
		var curl="/public/ajax.aspx?action=addbuildcomment";
		curl +="&chrname="+escape(username);
		curl +="&chrpwd="+escape(userpwd);
		curl +="&Code="+escape(Code);
		curl +="&content="+escape(content);
		curl +="&BuildID="+escape(InfoIDS);
		$.ajax({
			  url: curl,
			  cache: false,
			  success:function(data)
			  {
				  if(data=="0")
				  {	
				  	 alert("\u606d\u559c\u60a8\uff0c\u53d1\u5e03\u6210\u529f\uff0c\u8bf7\u7b49\u5f85\u5ba2\u670d\u5ba1\u6838\uff01");	
					 window.location.href=window.location.href;
				  }
				  else if(data=="1")
				  {	
					 alert("\u606d\u559c\u60a8\uff0c\u7559\u8a00\u6210\u529f\uff01");//SUCCESS
					 window.location.href=window.location.href;
				  }
				  else{
					  alert(data);
				  }
			  }
		});	
		return false;
	});
	
	$("#Communitycomentform").submit(function(){
		var username = $.trim($("#AntUserName").val());							   
		var userpwd = $.trim($("#AntUserPwd").val());
		var content = $.trim($("#AntUserContent").val());
		var Code = $.trim($("#AntUserCode").val());
		if($_D("AntUserName")){
			if(username.length==0)
			{
				alert("对不起，请输入您的用户名！");
				$("#AntUserName").focus();
				return false;
			}
			if(userpwd.length==0)
			{
				alert("对不起，请输入您的密码！");
				$("#AntUserPwd").focus();
				return false;
			}
		}
		if(Code.length==0)
		{
			alert("对不起，请输入验证码！");
			$("#AntUserCode").focus();
			return false;
		}
		if(content.length==0)
		{
			alert("对不起，请输入内容！");
			$("#AntUserContent").focus();
			return false;
		}
		var InfoIDS=$("#communityidhidden").val();
		var curl="/public/ajax.aspx?action=addhousecomment";
		curl +="&chrname="+escape(username);
		curl +="&chrpwd="+escape(userpwd);
		curl +="&Code="+escape(Code);
		curl +="&content="+escape(content);
		curl +="&Communityid="+escape(InfoIDS);
		$.ajax({
			  url: curl,
			  cache: false,
			  success:function(data)
			  {
				  if(data=="0")
				  {	
				  	 alert("\u606d\u559c\u60a8\uff0c\u53d1\u5e03\u6210\u529f\uff0c\u8bf7\u7b49\u5f85\u5ba2\u670d\u5ba1\u6838\uff01");	
					 window.location.href=window.location.href;
				  }
				  else if(data=="1")
				  {	
					 alert("\u606d\u559c\u60a8\uff0c\u7559\u8a00\u6210\u529f\uff01");//SUCCESS
					 window.location.href=window.location.href;
				  }
				  else{
					  alert(data);
				  }
			  }
		});	
		return false;
	});
	$("#AntSaleMarkcc").click(function(){
		var y=$("#AntSaleMarkShow").offset().top ;
		$(document.documentElement).animate({"scrollTop": y}, {duration:"slow"});								  
	});
	$("#AntSaleMapcc,#AntSaleMapcc1").click(function(){
		var y=$("#AntSaleMapShow").offset().top ;
		$(document.documentElement).animate({"scrollTop": y}, {duration:"slow"});								  
	});
	$("#AntSaleMapcc,#morequancc1").click(function(){
		var y=$("#morequanshow").offset().top ;
		$(document.documentElement).animate({"scrollTop": y}, {duration:"slow"});								  
	});
	$("#morepiclinkcc,#morepiclinkcc1").click(function(){
		var y=$("#morepiclinkshow").offset().top ;
		$(document.documentElement).animate({"scrollTop": y}, {duration:"slow"});								  
	});
	
	$("#share-link").click(function(){
		$.copyText("\u770b\u770b\u8fd9\u5957\u623f\u5b50\uff1a"+document.title+"\uff08"+window.location.href+"\uff09");
	});
	
	$("#SaleReport").click(function(){
		ShowDailog('举报房源',301,301,'SaleJubao.aspx?id='+$("#hiddenSaleID").val(),'true' ,'AntClassBg.gif','AntTuanclose.gif','AntClassReport.gif','66a3dd','F6F9FF','3f80c1','3f80c1');
		return false;
	});
	$("#communitypinfenclose").click(function(){
		closepinfen();
	});
	$("#communitypinfensubmit").click(function(){
		$.ajax({
		  url: "../public/ajax.aspx?action=communitypinfengadd&fen="+$("input[name='score']:checked").val()+"&id="+$("#communityidtophidden").val(),
		  cache: false,
		  success:function(data)
		  {
			  if(data.indexOf("@")!=-1)
			  {
				var datastr=data.split("@");
				$("#pingfencontent_1").hide();
				$("#pingfencontent_2").show();
				$("#pingfencontent_21").show();
				$("#pingfencontent_22").hide();
				$("#CommunityPingfenNum").html(datastr[0]);
				var tt=(parseFloat(datastr[1])*10).toFixed("2")+"%";
				tt = tt.replace("00%","")
				tt = tt.replace("0%","")
				if(tt.indexOf("%")==-1)
					tt =tt +"%";
				tt = tt.replace(".%","")
				if(tt.indexOf("%")==-1)
					tt =tt +"%";
				$("#CommunityPingfenwidthtop").html(tt);
				$("#CommunityPingfenwidth").css("width",(parseFloat(datastr[1]) /10 * 75 ).toFixed("2")+"px");
				setTimeout("closepinfen()",3000);
			  }
			  else{
				 alert(data);
			  }
		  }
	   });	
	   return false;
	});										
	$("#communitypinfenxinxin,#communitypinfen").click(function(){
		$.ajax({
		  url: "../public/ajax.aspx?action=communitypinfeng&id="+$("#communityidtophidden").val(),
		  cache: false,
		  success:function(data)
		  {
			  if(data=="0")
			  {
				$(".AntHouse_Content_Div").show();
				$("#pingfencontent_1").show();
				$("#pingfencontent_2").hide();
				$("#pingfencontent_21").hide();
				$("#pingfencontent_22").hide();
			  }
			  else{
				$(".AntHouse_Content_Div").show();
				$("#pingfencontent_1").hide();
				$("#pingfencontent_2").show();  
				$("#pingfencontent_21").hide();
				$("#pingfencontent_22").show();
				setTimeout("closepinfen()",3000);
		  	}
		  }
	   });	
	   return false;
	});
	$("#buildpricemobile").click(function(){	
		ShowDailog('楼盘降价通知',300,200,'Buildmobile.aspx?action=buildding&id='+$(this).attr("rel"),'true','AntClassBg.gif','AntTuanclose.gif','AntClassphone.gif','66a3dd','F6F9FF','3f80c1','3f80c1');	
  		return false;
	});
	$("#communitymobile").click(function(){	
		ShowDailog('订阅新房源通知',300,200,'Communitymobile.aspx?action=communityding&id='+$(this).attr("rel"),'true','AntClassBg.gif','AntTuanclose.gif','AntClassphone.gif','66a3dd','F6F9FF','3f80c1','3f80c1');	
  		return false;
	});
	$("#salemobilesend").click(function(){	
		ShowDailog('将房源发布到手机',301,301,'SaleSend.aspx?id='+$(this).attr("rel"),'true','AntClassBg.gif','AntTuanclose.gif','AntClassTips.gif','66a3dd','F6F9FF','3f80c1','3f80c1');//发送到手机短信
  		return false;
	});
	$("#lefttuangou").submit(function(){
		var TgName = $.trim($("#txtTgName").val());							   
		var TgSex = $("input[name='txtTgSex']:checked").val();;
		var TgTel = $.trim($("#txtTgTel").val());
		var TgMark = $.trim($("#txtTgMark").val());
		if(TgName.length<2)
		{
			alert("对不起，请正确输入您的姓名，长度至少2个字符！");
			$("#txtTgName").focus();
			return false;
		}
		if(TgTel.length<6)
		{
			alert("对不起，请正确输入您的联系电话，电话号码太短！");
			$("#txtTgTel").focus();
			return false;
		}
		var BuildID=$("#buildidhidden").val();
		var curl="/public/ajax.aspx?action=addbuildtg";
		curl +="&TgName="+escape(TgName);
		curl +="&TgSex="+escape(TgSex);
		curl +="&TgTel="+escape(TgTel);
		curl +="&TgMark="+escape(TgMark);
		curl +="&BuildID="+escape(BuildID);
		$.ajax({
			  url: curl,
			  cache: false,
			  success:function(data)
			  {
				  if(data=="0")
				  {	
				  	 alert("团购报名成功，我们将会尽快与您取得联系！");	
					 $("#txtTgName").val("");
					 $("#txtTgTel").val("");
					 $("#txtTgMark").val("");
				  }
				  else{
					  alert(data);
				  }
			  }
		});	
		return false;
	});
	$("#righttuangou").submit(function(){
		var TgName = $.trim($("#righttxtTgName").val());							   
		var TgTel = $.trim($("#righttxtTgTel").val());
		if(TgName.length==0 || TgName.length>20)
		{
			alert("对不起，请正确输入您的姓名！");
			$("#txtTgName").focus();
			return false;
		}
		if(TgTel.length==0 || TgTel.length>30)
		{
			alert("对不起，请正确输入您的联系电话！");
			$("#txtTgTel").focus();
			return false;
		}
		var BuildID=$("#buildidhidden").val();
		var curl="/public/ajax.aspx?action=addbuildtg";
		curl +="&TgName="+escape(TgName);
		curl +="&TgSex=";
		curl +="&TgTel="+escape(TgTel);
		curl +="&TgMark=";
		curl +="&BuildID="+escape(BuildID);
		$.ajax({
			  url: curl,
			  cache: false,
			  success:function(data)
			  {
				  if(data=="0")
				  {	
				  	 alert("团购报名成功，我们将会尽快与您取得联系！");	
					 $("#righttxtTgName").val("");
					 $("#righttxtTgTel").val("");
				  }
				  else{
					  alert(data);
				  }
			  }
		});	
		return false;
	});
	$("#comparebutton").click(function(){
		var str=$.trim($("#comparetext").val());
		if(str.length == 0){
			alert("对不起，请输入要比较的楼盘名称！");
			$("comparetext").focus();
			return false;
		}
		$.ajax({
			  url: "/public/ajax.aspx?action=addcomparebuild&cname="+escape(str),
			  cache: false,
			  success:function(data)
			  {
				  if(data.indexOf("|")==-1){
					  alert(data);
				  }
				  else{
					  var strarr=data.split("|");
					  $("#comparecont").html(strarr[0]);
					  if(strarr[1]=='compared'){
							alert('抱歉，比较列表已满，请至少删除一个才能继续添加。');
					  }
				  }
			  }
		});	
		return false;
	});
});
function closepinfen(){
	$(".AntHouse_Content_Div").hide();
	$("#pingfencontent_1").hide();
	$("#pingfencontent_2").hide();  
	$("#pingfencontent_21").hide();
	$("#pingfencontent_22").hide();
}
function ShowCommunityListZ(aa)
{
	if($("#AntXqAlt-01"+aa).css("display")=="none"){
		$("#AntXqAlt-01"+aa).fadeIn();
	}
	else{
		$("#AntXqAlt-01"+aa).fadeOut();
	}
}
var AntFocus=function(){
		this.id=jQuery(arguments[0].id);
		this.bigImgW=arguments[0].bigImgW;
		this.bigImgH=arguments[0].bigImgH;
		this.smallImgW=arguments[0].smallImgW;
		this.smallImgH=arguments[0].smallImgH;	
		this.speed=arguments[0].speed||5000;
		this.focusData=arguments;
		this.autoPlay;
	};
	AntFocus.prototype={
		init:function(){
			var that=this;
			this.id.css({"width":"321px"});
			this.id.append('<div style="width:'+(parseInt(this.bigImgW)+6)+'px;position:relative;cursor:pointer;padding-top:'+(parseInt(this.bigImgH)+2)+'px"><div style="position:absolute;top:0;left:2px;z-index:1"><span style="border:1px #fff solid;display:block"><img width="'+this.bigImgW+'" height="'+this.bigImgH+'" /></span></div><div style="position:absolute;height:57px;width:'+this.bigImgW+'px;top:'+(parseInt(this.bigImgH)-56)+'px;left:3px;z-index:2"></div><div style="position:absolute;height:57px;width:'+this.bigImgW+'px;top:'+(parseInt(this.bigImgH)-56)+'px;left:3px;z-index:3"></div><div style="width:'+(parseInt(this.bigImgW)+16)+'px;height:64px;overflow:hidden;position:relative"><span style="width:76px;height:64px;background:url(/public/images/AntFocus_bg.gif);display:block;position:absolute;top:0;"></span><dl style="width:'+(parseInt(this.bigImgW)+13)+'px;padding-left:2px"></dl></div></div>');
			for(var i=1;i<that.focusData.length;i++){
				if(i==4){
					that.id.find("dl").append('<dd style="height:62px;padding-top:9px;display:inline;float:left;"><img src="'+that.focusData[i][0]+'" style="border:1px #fff solid" width="'+(this.smallImgW)+'" height="'+this.smallImgH+'" alt="" /></dd>');
				}
				else{
					that.id.find("dl").append('<dd style="height:62px;padding-top:9px; margin-right:12px;display:inline;float:left;"><img src="'+that.focusData[i][0]+'" style="border:1px #fff solid" width="'+(this.smallImgW)+'" height="'+this.smallImgH+'" alt="" /></dd>');

				}
			};
			this.id.find("dd img").css("opacity",0.5);
			this.a()
		},
		a:function(){
			var _tab=this.id.find("dd"),that=this;
			var gogo=function(i){
				that.b(i);
			};
			gogo();
			_tab.find("img").each(function(i){
				(function(i){
					_tab.find("img").eq(i).mouseenter(function(){
						clearTimeout(that.autoPlay);					
						gogo(i+1);
						return false;
					})
				})(i)
			});
			this.id.click(function(){
				var y=$("#morepiclinkshow").offset().top ;
				$(document.documentElement).animate({"scrollTop": y}, {duration:"slow"});		
				//window.open(that.id.find("img:eq(0)").attr("open"));
			})
		},
		b:function(i){
			var _index=i||1;
			var that=this;
			this.id.find("img:eq(0)").attr({"src":that.focusData[_index][0],"open":that.focusData[_index][1]}).css({"display":"block","opacity":0}).stop().animate({opacity:1},300);
			this.id.find("h2:eq(0)").html(that.focusData[_index][2]);
			this.id.find("dd img").css("opacity",0.5);
			this.id.find("dd img").eq(_index-1).css("opacity",1);
			this.id.find("div > div:eq(3)").find("span").stop().animate({"left":(_index-1)*83},300);
			this.autoPlay=setTimeout(function(){
				that.b(_index==that.focusData.length-1?_index=1:++_index);
			},that.speed);
		}
	}
	
function SetCommunityUpLow(aa,bb)
{
	$.ajax({
		  url: "../public/ajax.aspx?action=communityadd&id="+bb+"&cc="+aa,
		  cache: false,
		  success:function(data)
		  {
			  if(parseInt(data)>0)
			  {
				 if(aa=="0"){
					 $("#Ant-Ding"+bb).html( "顶("+data+")" );
					 $("#alt_"+bb).css("display","block");
					 $("#alt_"+bb).html("您顶了一下！");
				 }  
				 else{
					$("#Ant-Cai"+bb).html( "踩("+data+")" );	 
					$("#alt_"+bb).css("display","block");
					$("#alt_"+bb).html("您踩了一下！");
				 }
			  }
			  else if(data=="-1")
			  {
					$("#alt_"+bb).css("display","block");
					$("#alt_"+bb).html("您已经顶过了！");
			  }  
			 else if(data=="0"){
					 $("#alt_"+bb).css("display","block");
					$("#alt_"+bb).html("您已经踩过了！");
			  }
		  }
	});	
	return false;
}
function SetBuildUpLow(aa,bb)
{
	$.ajax({
		  url: "../public/ajax.aspx?action=buindding&id="+bb+"&cc="+aa,
		  cache: false,
		  success:function(data)
		  {
			  if(parseInt(data)>0)
			  {
				 if(aa=="0"){
					 $("#Ant-Ding"+bb).html( "顶("+data+")" );
					 $("#alt_"+bb).css("display","block");
					 $("#alt_"+bb).html("您顶了一下！");
				 }  
				 else{
					$("#Ant-Cai"+bb).html( "踩("+data+")" );	 
					$("#alt_"+bb).css("display","block");
					$("#alt_"+bb).html("您踩了一下！");
				 }
			  }
			  else if(data=="-1")
			  {
					$("#alt_"+bb).css("display","block");
					$("#alt_"+bb).html("您已经顶过了！");
			  }  
			 else if(data=="0"){
					 $("#alt_"+bb).css("display","block");
					$("#alt_"+bb).html("您已经踩过了！");
			  }
		  }
	});	
	return false;
}
function SetCommunityHeight()
{
	var y=$("#AntCommunityBasic_reply").offset().top ;
	$(document.documentElement).animate({"scrollTop": y}, {duration:"slow"});	
}
function SetBuildHeight(){
	var y=$("#AntInfoBasic_reply").offset().top ;
	$(document.documentElement).animate({"scrollTop": y}, {duration:"slow"});	
}
function SetCoummunityIndex(aa,obj){
	for(var tt =0; tt<11;tt++){
		$("#CommunityIndexTop"+tt).removeClass("a_");
		if(tt== aa)
			$("#CommunityIndex"+tt).show();
		else
			$("#CommunityIndex"+tt).hide();
	}
	$(obj).addClass("a_");
}
var layerName="compare";
function closediv(sid){
	document.getElementById("" + sid + "").style.display="none";
}
function initEcAd(layerName) {
	document.getElementById(layerName).style.posTop = -200;
	document.getElementById(layerName).style.visibility = 'visible'
	MoveLeftLayer(layerName);
}
function MoveLeftLayer(layerName) {
	try{
			divHeight = parseInt(document.getElementById("" + layerName + "").offsetHeight,10);
			divWidth = parseInt(document.getElementById("" + layerName + "").offsetWidth,10);
			docWidth = document.documentElement.clientWidth;
			docHeight = document.documentElement.clientHeight;
			scrollTop = document.documentElement.scrollTop;
			scrollLeft = document.documentElement.scrollLeft;

			document.getElementById("" + layerName + "").style.top = (parseInt(scrollTop,10) + docHeight - divHeight-300) + 'px';
			document.getElementById("" + layerName + "").style.left = ((docWidth - divWidth)/2) + 'px'
			document.getElementById("" + layerName + "").style.visibility="visible";
			setTimeout("MoveLeftLayer('" + layerName + "');", 20);
	 }
	 catch(e){}
}
function getContent(lpid,act){
	var curl = "/public/ajax.aspx?action=addcompare&id="+lpid+"&act="+act+"&t="+Math.random();
	$.ajax({
		  url:curl,
		  cache: false,
		  success:function(data)
		  {
			var strarr=data.split("|");
			$("#comparecont").html(strarr[0]);
			if(strarr[1]=='compared'){
				alert('抱歉，比较列表已满，请至少删除一个才能继续添加。');
			}
		  }
	});
}
function deletefromcompare(lpid){
	var curl = "/public/ajax.aspx?action=addcompare&id="+lpid+"&act=2&t="+Math.random();
	$.ajax({
		  url:curl,
		  cache: false,
		  success:function(data)
		  {
			 window.location.href=window.location.href;
		  }
	});
}
function addtocompare(o,lpid){
	document.getElementById("compare").style.display="";
	initEcAd("compare");
	getContent(lpid,1);
	//obj.onclick=new Function("delfromcompare("+o+","+lpid+")");
}
function delfromcompare(o,lpid){
	document.getElementById("compare").style.display="";
	initEcAd("compare");
	getContent(lpid,2);
	//obj.onclick=new Function("addtocompare("+o+","+lpid+")");
}
function clearcompare(){
	document.getElementById("compare").style.display="";
	initEcAd("compare");
	getContent(1,3);
}
function showcompare(){
	document.getElementById("compare").style.display="";
	initEcAd("compare");
	getContent(1,4);
}
function SetAgentIndex(aa,obj){
	for(var tt =0; tt<11;tt++){
		$("#AgentIndexTop"+tt).removeClass("a_");
		if(tt== aa)
			$("#AgentIndex"+tt).show();
		else
			$("#AgentIndex"+tt).hide();
	}
	$(obj).addClass("a_");
}
function   killErrors()   
{   
  return   true;   
}   
window.onerror   =   killErrors; 
