﻿//Tab选项卡JS
$(function(){
   var index=0;
   $(".searchTab ul li").click(function(){
    index=$(".searchTab ul").children().index(this);
	$(this).addClass("current").siblings().removeClass("current")

    $(".tabBox").children().eq(index).slideDown('1500').siblings().slideUp('1500');
 })
   })
//Tab选项卡 126 mail
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className=i==cursel?"hover":"";
con.style.display=i==cursel?"block":"none";
}
}


//Logo City
$(document).ready(function(){
    $(".fshow").click(function(){
	    $("#switchCity").slideToggle("slow");
    });
});
$(document).ready(function(){
    $(".close").click(function(){
        $("#switchCity").slideToggle("hide");
    });
});
//Logo City
$(document).ready(function(){
    $(".shopsNavabcd").mouseover(function(){
	    $("#shopsNoneNav").css({display:"block"});
	    $("#gd").css({display:"none"});
    });
    $(".shopsNavabcd").mouseout(function(){
	    $("#shopsNoneNav").css({display:"none"});
	    $("#gd").css({display:"block"});
    });
});
//行业资讯锚导航动画JQuery
    $(document).ready(function(){
	    $(".anchorNav a").mouseover(function(){
		    $(this).animate({margin:"6px"},{queue:false, duration:200});
	    });
	    $(".anchorNav a").mouseout(function(){
		    $(this).animate({margin:"0"},{queue:false, duration:200});
	    });
	    $(".fshow").click(function(){
	    $("html,body").animate({scrollTop: $("#box").offset().top}, 1000);
	    $("#box h1").css({color:"#f00"});
	    });
	    $(".top").click(function(){
	    $("html,body").animate({scrollTop: $("#wraper").offset().top}, 1000);
	    });
    });
//行业资讯页面滚动条引导JQuery
$(document).ready(function(){
    //写字楼
	$(".ao_1").click(function(){
	$("html,body").animate({scrollTop: $("#offices_anchor").offset().top}, 1000);
	});
	$(".ao_2").click(function(){
	$("html,body").animate({scrollTop: $("#offices_anchor").offset().top}, 1000);
	});
	$(".ao_3").click(function(){
	$("html,body").animate({scrollTop: $("#offices_anchor").offset().top}, 1000);
	});
	//商铺
	$(".as_1").click(function(){
	$("html,body").animate({scrollTop: $("#shops_anchor").offset().top}, 1000);
	});
	$(".as_2").click(function(){
	$("html,body").animate({scrollTop: $("#shops_anchor").offset().top}, 1000);
	});
	$(".as_3").click(function(){
	$("html,body").animate({scrollTop: $("#shops_anchor").offset().top}, 1000);
	});
	//装修大家帮
	$(".az_1").click(function(){
	$("html,body").animate({scrollTop: $("#zx_anchor").offset().top}, 1000);
	});
	$(".az_2").click(function(){
	$("html,body").animate({scrollTop: $("#zx_anchor").offset().top}, 1000);
	});
	$(".az_3").click(function(){
	$("html,body").animate({scrollTop: $("#zx_anchor").offset().top}, 1000);
	});
	//房产百科
	$(".ae_1").click(function(){
	$("html,body").animate({scrollTop: $("#baike_anchor").offset().top}, 1000);
	});
	$(".ae_2").click(function(){
	$("html,body").animate({scrollTop: $("#baike_anchor").offset().top}, 1000);
	});
	$(".ae_3").click(function(){
	$("html,body").animate({scrollTop: $("#baike_anchor").offset().top}, 1000);
	});
	$(".ae_4").click(function(){
	$("html,body").animate({scrollTop: $("#baike_anchor").offset().top}, 1000);
	});
	//返回顶部
	$(".goTop").click(function(){
	$("html,body").animate({scrollTop: $(".zt_box").offset().top}, 1000);
	});
});


//js操作剪贴板
function copyToClipboard(){var d=document.all("source").value;window.clipboardData.setData('text', d);} 
function aaa(){var str = window.clipboardData.getData('text')+'  本文来自地产网，转载请标明出处：http://www.dcwzg.com';window.clipboardData.setData('text',str);}
function capLock(){if(event.keyCode == 67 && event.ctrlKey){aaa();}}
//首页热门楼盘排行榜自适应高度判断
$(document).ready(function() {
var _leftheight = $(".topNo").height();
_rightheight = $(".topList").height();
if(_leftheight > _rightheight ) {
$(".topList").height(_leftheight);
}
else {
$(".topNo").height(_rightheight);
}
})

//Table隔行换色
function SetColor(o,a,b,c,d){
 var t=document.getElementById(o).getElementsByTagName("tr");
 for(var i=0;i<t.length;i++){
  t[i].style.backgroundColor=(t[i].sectionRowIndex%2==0)?a:b;
  t[i].onclick=function(){
   if(this.x!="1"){
    this.x="1";
    this.style.backgroundColor=d;
   }else{
    this.x="0";
    this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
   }
  }
  t[i].onmouseover=function(){
   if(this.x!="1")this.style.backgroundColor=c;
  }
  t[i].onmouseout=function(){
   if(this.x!="1")this.style.backgroundColor=(this.sectionRowIndex%2==0)?a:b;
  }
 }
}  


//Tab选项卡 鼠标滑过切换
function scrollDoor(){
}
scrollDoor.prototype = {
	sd : function(menus,divs,openClass,closeClass){
		var _this = this;
		if(menus.length != divs.length)
		{
			alert("菜单层数量和内容层数量不一样!");
			return false;
		}				
		for(var i = 0 ; i < menus.length ; i++)
		{	
			_this.$(menus[i]).value = i;				
			_this.$(menus[i]).onmouseover = function(){
					
				for(var j = 0 ; j < menus.length ; j++)
				{						
					_this.$(menus[j]).className = closeClass;
					_this.$(divs[j]).style.display = "none";
				}
				_this.$(menus[this.value]).className = openClass;	
				_this.$(divs[this.value]).style.display = "block";				
			}
		}
		},
	$ : function(oid){
		if(typeof(oid) == "string")
		return document.getElementById(oid);
		return oid;
	}
}
window.onload = function(){
	var SDmodel = new scrollDoor();
	SDmodel.sd(["m01","m02"],["c01","c02"],"sd01","sd02");
}


//error hide
function hide(){
    document.getElementById("error").style.display = "none";
                }
    setTimeout(hide,"6000");
    
//HTML5
document.createElement('header');
document.createElement('nav');
document.createElement('footer');

//浮动工具条
$(document).ready(function(){
	$(".btnClick").click(function(){
		$(".toolsBox").slideToggle("slow");
		$(this).toggleClass("active"); return false;
	});
});


//楼盘切换
function slideTab(a,b,c) {
 for(i=1; i<5; i++) {
 if (i==c) {
 document.getElementById(a+i).className="menuon";document.getElementById(b+i).className="dison";}
 else {
 document.getElementById(a+i).className="menuno";document.getElementById(b+i).className="disno";}
 }
 }
