﻿// JScript 文件

function changeimg_100_80(obj)
{
   var imgWidth=obj.width;
   var imgHeight=obj.height;
   
   if ( imgWidth>100 || imgHeight>100 )
   {
      if (imgWidth>imgHeight)
      {
        imgHeight=(imgHeight*100)/imgWidth+'px';
        imgWidth='100px';
      }
      else
      {
        imgWidth=(imgWidth*100)/imgHeight+'px';
        imgHeight='100px';
      }
   }
   obj.style.width=imgWidth;
   obj.style.height=imgHeight;
}
function changeimg_120_120(obj)
{
   var imgWidth=obj.width;
   var imgHeight=obj.height;
   
   if ( imgWidth>120 || imgHeight>120 )
   {
      if (imgWidth>imgHeight)
      {
        imgHeight=(imgHeight*120)/imgWidth+'px';
        imgWidth='120px';
      }
      else
      {
        imgWidth=(imgWidth*120)/imgHeight+'px';
        imgHeight='120px';
      }
   }
   obj.style.width=imgWidth;
   obj.style.height=imgHeight;
}

function CopyImgUrl()
{
    var txt='showphoto_Rptphoto_ctl00_TImgUrl';
    var urlstr=$get(txt).value;
    clipboardData.setData('Text',urlstr);
    alert('已经将地址复制');
}

function ChangImgSize(obj,w,h)
{
   var imgWidth=obj.width;
   var imgHeight=obj.height;
   
   if ( imgWidth>w || imgHeight>h )
   {
      if (imgWidth>imgHeight)
      {
        imgHeight=(imgHeight*w)/imgWidth+'px';
        imgWidth=w+'px';
      }
      else
      {
        imgWidth=(imgWidth*h)/imgHeight+'px';
        imgHeight=h+'px';
      }
   }
   
   obj.style.width=imgWidth;
   obj.style.height=imgHeight;
}
