// JavaScript Document
<!-- // 说明：用 JavaScript 实现网页图片等比例缩放 // 
整理：http://www.CodeBit.cn  
function changesize(ImgD,FitWidth,FitHeight){     
	var image=new Image();
    image.src=ImgD.src;
	if(image.width>0 && image.height>0){
		if(image.width/image.height>= FitWidth/FitHeight){
			if(image.width>FitWidth){
				ImgD.width=FitWidth;
				ImgD.height=(image.height*FitWidth)/image.width;
            }else{
			    ImgD.width=image.width;
				ImgD.height=image.height;
				}
			} else{
			     if(image.height>FitHeight){
				 	ImgD.height=FitHeight;
				 	ImgD.width=(image.width*FitHeight)/image.height;
				 }else{
				 	ImgD.width=image.width; 
					ImgD.height=image.height;
				}
			}
		}
	} 
	
	function changpic(obj,picpath){
		obj.src = picpath;	
	
	}


//选项卡函数
function secBoard(n,secTab,mainTab)

{

 for(i=0;i<secTab.cells.length;i++)

  secTab.cells[i].className="sec1";
  
  

 secTab.cells[n].className="sec2";


 for(i=0;i<mainTab.tBodies.length;i++)

  mainTab.tBodies[i].style.display="none";

 mainTab.tBodies[n].style.display="block";

}



//系统登陆函数
 function sys_logon(obj){
			  	obj.submit()
				obj.userid.value = '';
				obj.PAW.value = '';
			  
			  
			  }
			  
			  
function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
   var img = document.images[i]
   var imgName = img.src.toUpperCase()
   if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
      {
   var imgID = (img.id) ? "id='" + img.id + "' " : ""
   var imgClass = (img.className) ? "class='" + img.className + "' " : ""
   var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
   var imgStyle = "display:inline-block;" + img.style.cssText 
   if (img.align == "left") imgStyle = "float:left;" + imgStyle
   if (img.align == "right") imgStyle = "float:right;" + imgStyle
   if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle  
   var strNewHTML = "<span " + imgID + imgClass + imgTitle
   + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
      + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
   + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
   img.outerHTML = strNewHTML
   i = i-1
      }
      }
   }
   
   
   
   function GetHGDate(obj){
  MInfo = window.showModalDialog("../function/getdate.php","","dialogHeight : 240px; dialogWidth: 235px; help: no; status: no");
  if (MInfo!=null)
  {
	obj.value = MInfo[0];
	
	
	
	
	}
}
function GetMInfo_select(a,b,c){
  MInfo = window.showModalDialog("get_select_list.php?tab_name="+ b +"&field_name="+c,"","dialogHeight : 610px; dialogWidth: 400px; help: no; status: no");
  if (MInfo!=null)
  {
	a.value = MInfo[0];
	
	
	}
}

function Change(child,image){
	if(child.style.display==''){
		child.style.display='none';
		image.src='../oas_pic/icon_plus.gif';
	}
	else{
		child.style.display='';
		image.src='../oas_pic/icon_minus.gif';
	}
}