// JavaScript Document

/*按比例生成缩略图==================================================================*/
function DrawImage(ImgD,W,H){ 
  var flag=false; 
  var image=new Image(); 
  image.src=ImgD.src; 
  if(image.width>0 && image.height>0){ 
    flag=true; 
    if(image.width/image.height>= W/H){ 
      if(image.width>W){
        ImgD.width=W; 
        ImgD.height=(image.height*H)/image.width; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt= ""; 
    } 
    else{ 
      if(image.height>H){
        ImgD.height=H; 
        ImgD.width=(image.width*W)/image.height; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt=""; 
    } 
  }
}
/*按比例生成缩略图结束==================================================================*/


//menu display start========================================================================
function closewin() {
   if (opener!=null && !opener.closed) {
      opener.window.newwin=null;
      opener.openbutton.disabled=false;
      opener.closebutton.disabled=true;
   }
}

var count=0;//做计数器
var limit=new Array();//用于记录当前显示的哪几个菜单
var countlimit=1;//同时打开菜单数目，可自定义

function expandIt(el) {
   obj = eval("sub" + el);
   if (obj.style.display == "none") {
      obj.style.display = "block";//显示子菜单
      if (count<countlimit) {//限制2个
         limit[count]=el;//录入数组
         count++;
      }
      else {
         eval("sub" + limit[0]).style.display = "none";
         for (i=0;i<limit.length-1;i++) {limit[i]=limit[i+1];}//数组去掉头一位，后面的往前挪一位
         limit[limit.length-1]=el;
      }
   }
   else {
      obj.style.display = "none";
      var j;
      for (i=0;i<limit.length;i++) {if (limit[i]==el) j=i;}//获取当前点击的菜单在limit数组中的位置
      for (i=j;i<limit.length-1;i++) {limit[i]=limit[i+1];}//j以后的数组全部往前挪一位
      limit[limit.length-1]=null;//删除数组最后一位
      count--;
   }
}
//menu display end=============================================================================================

//Start Menu Support_IE6
//--><![CDATA[//><!--
//	  startList = function() {
//	  if (document.all&&document.getElementById) {
//	  navRoot = document.getElementById("menu");
//	  var allli = navRoot.getElementsByTagName("li")
//	  for (i=0; i<allli.length; i++) {
//	  node = allli[i];
//	  node.onmouseover=function() {
//	  this.className+=" current";
//	  }
//	  node.onmouseout=function() {
//	  this.className=this.className.replace(" current", "");
//	  }
//	  }
//	  }
//	  }
//	  window.onload=function(){ startList()}
//<!]]>
//End Menu Support_IE6

//三级下拉JS#############################################################################################

function w(vd)
{
  var ob=document.getElementById(vd);
  if(ob.style.display=="block" || ob.style.display=="")
  {
     ob.style.display="none";
     var ob2=document.getElementById('s'+vd);
     ob2.style.backgroundImage="url(images/ico080426_open.gif)";
  }
  else
  {
    ob.style.display="block";
    var ob2=document.getElementById('s'+vd);
    ob2.style.backgroundImage="url(images/ico080426_close.gif)";
  }
}
function k(vd)
{
  var ob=document.getElementById(vd);  
  if(ob.style.display=="block")
  {
     ob.style.display="none";
     var ob2=document.getElementById('s'+vd);
     ob2.style.backgroundImage="url(images/ico080426_open.gif)";
  }
  else
  {
    ob.style.display="block";
    var ob2=document.getElementById('s'+vd);
    ob2.style.backgroundImage="url(images/ico080426_close.gif)";
  }
}
//三级下拉结束#########################################################################################



// 首页 tab菜单效果所需代码
function changeShowBox(boxname,nowid,maxid){
	for(i=1;i<=maxid;i++){
		e = document.getElementById(boxname+''+i);
		e1 = document.getElementById(boxname+'_bt'+i);
		if (i == nowid){
			e.style.display = '';
			e1.className = "nonce";
		}else{
			e.style.display = 'none';
			e1.className = '';
		}
	}
}




		
// 结束 tab菜单效果所需代码	
