﻿// JScript 文件

    var proMaxHeight=100;  //图片最大高度
    var proMaxWidth=150;   //图片最大宽度
    function ImgAuto(ImgD)
    {
    var image=new Image();
    image.src=ImgD.src;
    image.onload = function(){
    if(image.width>0&&image.height>0)
    {
    var rate=(proMaxWidth/image.width<proMaxHeight/image.height)?proMaxWidth/image.width:proMaxHeight/image.height;
    if(rate<=1)
    {
    ImgD.width=image.width*rate;
    ImgD.height=image.height*rate
    }
    else
    {
    ImgD.width=image.width;
    ImgD.height=image.height;
    }
    }
    };
    image.onload();
    };　
    
    
     function showPic(sUrl,evt){ 
     var x,y; 
     x = evt.clientX; 
     y = evt.clientY; 
     document.getElementById("Layer1").style.left = x; 
     document.getElementById("Layer1").style.top = y+20; 
     document.getElementById("Layer1").innerHTML = "<img src=\"" + sUrl + "\">"; 
     document.getElementById("Layer1").style.display = "block"; 
    } 
    function hiddenPic(){ 
     document.getElementById("Layer1").innerHTML = ""; 
     document.getElementById("Layer1").style.display = "none"; 
    } 