﻿// JavaScript Document
function  DrawImage(ImgD,Iwidth,Iheight){  
     var  image=new  Image();  
     image.src=ImgD.src;  
     if(image.width>0  &&  image.height>0){  
       flag=true;  
       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;  
         }  
       }  
}
sfHover = function() {
var sfEls = document.getElementById("nav").getElementsByTagName("li");
for (var i=0; i<sfEls.length; i++) {
sfEls[i].onmouseover=function() {
this.className=" sfhover";
}
sfEls[i].onmouseout=function() {
this.className='';
}
}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);