function addFavorite(){
    var vDomainName=window.location.href;
    var description=document.title;
    try{//IE
        window.external.AddFavorite(vDomainName,description);
    }catch(e){//FF
        window.sidebar.addPanel(description,vDomainName,"");
    }
}
function switchcitem(num,total,cname,lname){
	for(var id = 1;id<=total;id++)
	{	
		document.getElementById(cname+id).className="noshowitempic";
		document.getElementById(lname+id).className="isshowitem";
	}
	document.getElementById(cname+num).className="isshowitempic";
	document.getElementById(lname+num).className="noshowitem";
}

function selectTag(id){
	// 操作标签
	document.getElementById('tagContent1').style.display = "none";
	document.getElementById('tagContent2').style.display = "none";
	
	document.getElementById('selectTagMenu1').className = "";
	document.getElementById('selectTagMenu2').className = "";
	
	document.getElementById('tagContent'+id).style.display = "block";
	
	document.getElementById('selectTagMenu'+id).className = "selectTag";
}

function selectTag1(showContent,selfObj){
	// 操作标签
	var tag = document.getElementById("zhuanjialib").getElementsByTagName("li");
	var taglength = tag.length;
	for(i=0; i<taglength; i++){
		tag[i].className = "";
	}
	selfObj.parentNode.className = "selectTag";
	// 操作内容
	for(i=0; j=document.getElementById("tagCon"+i); i++){
		j.style.display = "none";
	}
	document.getElementById(showContent).style.display = "block";	
}

function switchCards (num){
	for(var id = 1;id<=4;id++)
	{
		if(id==num)
		{
			document.getElementById("show_divs"+id).style.display="block";
			document.getElementById("show_menu_"+id).className="divisshow";
		}
		else
		{
			document.getElementById("show_divs"+id).style.display="none";
			document.getElementById("show_menu_"+id).className="divnoshow";
		}
	}
}

function switchItems (num,total,centername){
	
	for(var id = 1;id<=total;id++)
	{
		document.getElementById("center_"+centername+"_"+id).style.display="none";
		document.getElementById(centername+"_c_"+id).style.display="none";
		document.getElementById(centername+"_menu_"+id).className="";
	}
	
	document.getElementById("center_"+centername+"_"+num).style.display="block";
	document.getElementById(centername+"_c_"+num).style.display="block";
	document.getElementById(centername+"_menu_"+num).className="selectTag";
}

function switchClassItem(num,total){
	for(var id = 1;id<=total;id++)
	{
		document.getElementById("itemimg_"+id).style.display="none";
		document.getElementById("itemmenu_"+id).style.display="block";
		document.getElementById("itemintro_"+id).style.display="none";
	}
	
	document.getElementById("itemimg_"+num).style.display="block";
	document.getElementById("itemmenu_"+num).style.display="none";
	document.getElementById("itemintro_"+num).style.display="block";
}

function getScrollTop() {   
    var scrollPos = 0;    
    if (typeof window.pageYOffset != 'undefined') {    
       scrollPos = window.pageYOffset;    
    }else if (typeof window.document.compatMode != 'undefined' &&  window.document.compatMode != 'BackCompat') {    
        scrollPos = window.document.documentElement.scrollTop;    
    }else if (typeof window.document.body != 'undefined') {    
        scrollPos = window.document.body.scrollTop;    
    }    
    return scrollPos;   
}  



function setTab(/*string*/name,/*int*/ itemCnt,/*int*/ curItem, /**/classHide, /**/classShow)
{
	 for(i=1;i<=itemCnt;i++)
	{
		eval("document.getElementById('tab_" + name + "_" + i + "').className='" + classHide + "'");
	} 
	eval("document.getElementById('tab_" + name + "_" + curItem + "').className='" + classShow + "'");
 
 for(i=1;i<=itemCnt;i++)
 {
  eval("ele_hide = document.getElementById('con_" + name + "_" + i +"')");
  if(ele_hide) ele_hide.style.display = "none";
 }
 eval("ele_play = document.getElementById('con_" + name + "_" + curItem + "')");
 if(ele_play) ele_play.style.display = "block";
}

//经典案例页切换
function switchCase (num,total,centername){
	for(var id = 1;id<=total;id++)
	{
		if(id==num)
		{
			document.getElementById(centername+"_"+id).style.display="block";
		}
		else
		{
			document.getElementById(centername+"_"+id).style.display="none";
		}
	}
}
