var flag=false; 
function DrawImage(ImgD,twidth,theight){ 
var image=new Image(); 
image.src=ImgD.src; 
if(image.width>0 && image.height>0){ 
  flag=true; 
  if(image.width/image.height>= twidth/theight){ 
   if(image.width>twidth){
    ImgD.width=twidth; 
    ImgD.height=(image.height*theight)/image.width; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
   /*ImgD.alt="bigpic"  */
  } 
  else{ 
   if(image.height>theight){
    ImgD.height=theight; 
    ImgD.width=(image.width*theight)/image.height; 
   }else{ 
    ImgD.width=image.width;
    ImgD.height=image.height; 
   } 
    /*ImgD.alt="bigpic"  */ 
  } 
}
}

function imageView(strImage)
{
	this.document.images['mainImage'].src = strImage;
}
