function $(id){
    return typeof id==='string'?document.getElementById(id):id;
}

window.onload=function(){
    //获取鼠标滑过或点击的标签和要切换内容的元素
    var titles=$('t').getElementsByTagName('li');
        divs=$('c').getElementsByTagName('div');	
	if(titles.length!=divs.length)
    return;
    for(var t=0;t<titles.length;t++){
	titles[t].id=t;
	titles[t].onmouseover=function(){
          //清除所有li上的class
          for(var j=0;j<titles.length;j++){
            divs[j].style.display='none';
           }
		    divs[this.id].style.display='block';
	    }
    }
    var title=$('t1').getElementsByTagName('li');
         div=$('c1').getElementsByTagName('div');
	  if(title.length!=div.length)
    return;
    for(var t1=0;t1<title.length;t1++){
	title[t1].id=t1;
	title[t1].onmouseover=function(){
          //清除所有li上的class
          for(var z=0;z<title.length;z++){
            div[z].style.display='none';
           }
		    div[this.id].style.display='block';
	    }
    }
    var titlee=$('t2').getElementsByTagName('li');
         dive=$('c2').getElementsByTagName('div');
	  if(titlee.length!=dive.length)
    return;
    for(var t2=0;t2<titlee.length;t2++){
	titlee[t2].id=t2;
	titlee[t2].onmouseover=function(){
          //清除所有li上的class
          for(var x=0;x<titlee.length;x++){
            dive[x].style.display='none';
           }
		    dive[this.id].style.display='block';
	    }
    }
    var titlec=$('t3').getElementsByTagName('li');
         divc=$('c3').getElementsByTagName('div');
	  if(titlec.length!=divc.length)
    return;
    for(var t3=0;t3<titlec.length;t3++){
	titlec[t3].id=t3;
	titlec[t3].onmouseover=function(){
          //清除所有li上的class
          for(var b=0;b<titlec.length;b++){
            divc[b].style.display='none';
           }
		    divc[this.id].style.display='block';
	    }
    }
}


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?"h3on":"";
		con.style.display=i==cursel?"block":"none";
	}
}
//function setTop(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?"h3on":"";
//		con.style.display=i==cursel?"block":"none";
//		var cob=document.getElementById("cob_"+name+"_"+i);
//		menu.className=i==cursel?"h3on":"";
//		cob.style.display=i==cursel?"none":"block";
//	}
//}
function tr(id){
	if(id=='1'){
		document.getElementById('tr_1').style.display="none";
		document.getElementById('tr_2').style.display="block";
		document.getElementById('tr_c').style.display="block";
		}
	if(id=='2'){
		document.getElementById('tr_1').style.display="block";
		document.getElementById('tr_2').style.display="none";
		document.getElementById('tr_c').style.display="none";
		}
}
//幻灯片
function SlideShow(c) {
    var a = document.getElementById("slideContainer"), f = document.getElementById("slidesImgs").getElementsByTagName("li"), h = document.getElementById("slideBar"), n = h.getElementsByTagName("li"), d = f.length, c = c || 3000, e = lastI = 0, j, m;
    function b() {
        m = setInterval(function () {
            e = e + 1 >= d ? e + 1 - d : e + 1;
            g()
        }, c)
    }
    function k() {
        clearInterval(m)
    }
    function g() {
        f[lastI].style.display = "none";
        n[lastI].className = "";
        f[e].style.display = "block";
        n[e].className = "on";
        lastI = e
    }
    f[e].style.display = "block";
    a.onmouseover = k;
    a.onmouseout = b;
    h.onmouseover = function (i) {
        j = i ? i.target : window.event.srcElement;
        if (j.nodeName === "LI") {
            e = parseInt(j.innerHTML, 10) - 1;
            g()
        }
    };
    b()
}
;

//图片缓冲加载
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(5($){$.J.L=5(r){8 1={d:0,A:0,b:"h",v:"N",3:4};6(r){$.D(1,r)}8 m=9;6("h"==1.b){$(1.3).p("h",5(b){8 C=0;m.t(5(){6(!$.k(9,1)&&!$.l(9,1)){$(9).z("o")}j{6(C++>1.A){g B}}});8 w=$.M(m,5(f){g!f.e});m=$(w)})}g 9.t(5(){8 2=9;$(2).c("s",$(2).c("i"));6("h"!=1.b||$.k(2,1)||$.l(2,1)){6(1.u){$(2).c("i",1.u)}j{$(2).K("i")}2.e=B}j{2.e=x}$(2).T("o",5(){6(!9.e){$("<V />").p("X",5(){$(2).Y().c("i",$(2).c("s"))[1.v](1.Z);2.e=x}).c("i",$(2).c("s"))}});6("h"!=1.b){$(2).p(1.b,5(b){6(!2.e){$(2).z("o")}})}})};$.k=5(f,1){6(1.3===E||1.3===4){8 7=$(4).F()+$(4).O()}j{8 7=$(1.3).n().G+$(1.3).F()}g 7<=$(f).n().G-1.d};$.l=5(f,1){6(1.3===E||1.3===4){8 7=$(4).I()+$(4).U()}j{8 7=$(1.3).n().q+$(1.3).I()}g 7<=$(f).n().q-1.d};$.D($.P[\':\'],{"Q-H-7":"$.k(a, {d : 0, 3: 4})","R-H-7":"!$.k(a, {d : 0, 3: 4})","S-y-7":"$.l(a, {d : 0, 3: 4})","q-y-7":"!$.l(a, {d : 0, 3: 4})"})})(W);',62,62,'|settings|self|container|window|function|if|fold|var|this||event|attr|threshold|loaded|element|return|scroll|src|else|belowthefold|rightoffold|elements|offset|appear|bind|left|options|original|each|placeholder|effect|temp|true|of|trigger|failurelimit|false|counter|extend|undefined|height|top|the|width|fn|removeAttr|lazyload|grep|show|scrollTop|expr|below|above|right|one|scrollLeft|img|jQuery|load|hide|effectspeed'.split('|'),0,{}))


$(function(){
	$("img").lazyload({placeholder:"/skin/tangdouban/images/jquery-lazyload.gif",effect:"fadeIn"});
})
