
/*按比例生成缩略图*/
function DrawImage(ImgD,imageW,imageH){			//控制照片长、宽
	//imageW=130;
	//imageH=130;
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= imageW/imageH){
     if(image.width>imageW){
     ImgD.width=imageW;
     ImgD.height=(image.height*imageW)/image.width;
     }else{
     ImgD.width=image.width;
     ImgD.height=image.height;
     }
     }
    else{
     if(image.height>imageH){
     ImgD.height=imageH;
     ImgD.width=(image.width*imageH)/image.height;
     }else{
     ImgD.width=image.width;
     ImgD.height=image.height;
     }
     }
    }
  }

	var count=0;//做计数器
	var limit=new Array();//用于记录当前显示的哪几个菜单
	var countlimit=1;//同时打开菜单数目，可自定义
function expandIt(el) {
   obj = eval("sub" + el);
   obj.style.display = "block";//显示子菜单
	for (i=1;i<20;i++){
		
		if (i!=el){
			obs=eval("sub"+i);
			obs.style.display = "none";
		}
	}
}


function showmax(el){
	
	for(i=1;i<5;i++){
		boj_divs = eval("leve0" + i);
		boj_divs.style.display="none";
		}
		boj_div = eval("leve0" + el);
		boj_div.style.display="block";

}


function showmax2(el,obj){
	
	for (i=1;i<4;i++){
		boj_div = eval("menu0" + i);
		if (i!=el){
		boj_div.style.display="none";

		}
		else{
			boj_div.style.display="block";

			}
	}
	obj.style.background="url(../BNimages/menB.gif)"; 
}


function hidb(obj){
	
	obj.style.background=""; 
	
	}


function hidmax(el){
	alert("ok");
	obj_sub = eval("subs" + el);
	obj_div = eval("div" + el);
	obj_sub.style.display="none";
	obj_div.style.backgroundImage ="";		
}

function hidmax2(el){
	//alert("OK");
	el.style.display="none";
}



function showda(obj,recN){
	obj_div = eval("da" + obj);
	if (obj_div.style.display=="none"){
		obj_div.style.display="block";
	}
	else if (obj_div.style.display=="block"){
		obj_div.style.display="none";	
		return;
	 }
}


function showtypeid(ids,l01,l02){

	id=ids.value;
	document.form1.action="?lei01=" + l01 + "&lei02=" + l02 + "&curpage="+id;
	document.form1.submit(); 
//	if (id==4){
//		typeid.style.display="";
//	}
//	else{
//		typeid.style.display="none";
//	}
}


function showtypeid02(id,ids){
	ids=ids.value;
	document.form1.action="?id="+id+"&curpage="+ids;
	document.form1.submit(); 
//	if (id==4){
//		typeid.style.display="";
//	}
//	else{
//		typeid.style.display="none";
//	}
}