// JavaScript Document

//点击隐藏和打开
function changemenu(mydiv){
	var obj = document.getElementById(mydiv);
		if (obj.style.display=='none'){
			obj.style.display='block';
		 }
		else{
		 	obj.style.display='none';
		 }
	}
	
//控制图片大小
var flag=false;
function DrawImage(ImgD,imageWidth,imageHeight) {
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
		flag=true;
		if(image.width/image.height>= imageWidth/imageHeight){
			if(image.width>imageWidth){
		    ImgD.width=imageWidth;
			ImgD.height=(image.height*imageWidth)/image.width;
		}
		else{
			ImgD.width=image.width;
			ImgD.height=image.height;
			}
	}
    else{
		if(image.height>imageHeight){
		ImgD.height=imageHeight;
		ImgD.width=(image.width*imageHeight)/image.height;
		}
		else{
			ImgD.width=image.width;
			ImgD.height=image.height;
			}
		}
	}
}


//栏目切换
function nTabs(thisObj,Num){
	if(thisObj.className == "active")return;
	var tabObj = thisObj.parentNode.id;
	var tabObjmu = thisObj.parentNode.id;
	tabObjmu=tabObjmu.substring(0,tabObjmu.length);
	var tabList = document.getElementById(tabObj).getElementsByTagName("li");
	for(i=0; i <tabList.length; i++) {
		if (i == Num) {
			thisObj.className = "active"; 
			document.getElementById(tabObjmu+"_Content"+i).style.display = "block";
			}
		else{
			tabList[i].className = "normal"; 
			document.getElementById(tabObjmu+"_Content"+i).style.display = "none";
			}
	} 
}


//切换样式
function selchecktd(tbid,moreid) {
	var itab=document.getElementById(tbid);
	var moreab=document.getElementById(moreid);
		if(itab.className=="cont"){
			itab.className="contmore";
			moreab.className="catmore";
			return ;
			}  
		 if(itab.className=="contmore") {
			itab.className="cont";}
			moreab.className="more";
			return ;
			}
