<!-- Hide
function killErrors() {
return true;
}
window.onerror = killErrors;
// -->
function voidNum(argValue) 
 {
  var flag1=false;
  var compStr="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
  var length2=argValue.length;
  for (var iIndex=0;iIndex<length2;iIndex++)
  	{
		var temp1=compStr.indexOf(argValue.charAt(iIndex));
		if(temp1==-1) 
		{
			flag1=false;
			break;							
		}
		else
		{flag1=true;}
	}
	return flag1;
}
function Check()
{
   var check; 
	if (!voidNum(document.login.LoginName.value))
	{ alert("請正確輸入管理員名稱。");
			document.login.LoginName.focus();
			return false;
			exit; }    
   if (!voidNum(document.login.Password.value))
	{ alert("請正確輸入管理員密碼。");
			document.login.Password.focus();
			return false;
			exit; }
   if (!voidNum(document.login.VCodes.value))
	{ alert("請正確輸入驗證碼。");
			document.login.VCodes.focus();
			return false;
			exit; }
   return true;
}
//产品菜单
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--;
   }
}
 //图片按比例缩放,可输入参数设定初始大小
function resizeimg(ImgD,iwidth,iheight) {
     var image=new Image();
     image.src=ImgD.src;
     if(image.width>0 && image.height>0){
        if(image.width/image.height>= iwidth/iheight){
           if(image.width>iwidth){
               ImgD.width=iwidth;
               ImgD.height=(image.height*iwidth)/image.width;
           }else{
                  ImgD.width=image.width;
                  ImgD.height=image.height;
                }
               //ImgD.alt=image.width+"×"+image.height;
        }
        else{
                if(image.height>iheight){
                       ImgD.height=iheight;
                       ImgD.width=(image.width*iheight)/image.height;
                }else{
                        ImgD.width=image.width;
                        ImgD.height=image.height;
                     }
                //ImgD.alt=image.width+"×"+image.height;
            }
　　　　　ImgD.style.cursor= "pointer"; //改变鼠标指针
　　　　　//ImgD.onclick = function() { window.open(this.src);} //点击打开大图片
　　　　if (navigator.userAgent.toLowerCase().indexOf("ie") > -1) { //判断浏览器，如果是IE
　　　　　　//ImgD.title = "點擊查看詳細信息...";
　　　　　　ImgD.onmousewheel = function img_zoom() //滚轮缩放
　　　　　 {
　　　　　　　　　　var zoom = parseInt(this.style.zoom, 10) || 100;
　　　　　　　　　　zoom += event.wheelDelta / 12;
　　　　　　　　　　if (zoom= 0)　this.style.zoom = zoom + "%";
　　　　　　　　　　//'如要鼠标滚动缩放反上面的转换这句
　　　　　　　　　　//if (zoom> 0)　this.style.zoom = zoom + "%";
　　　　　　　　　　return false;
　　　　　 }
　　　  } else { //如果不是IE
　　　　　　　     //ImgD.title = "點擊查看詳細信息...";
　　　　　　   }
    }
}
//--> 