﻿/*按比例生成缩略图*/
function DrawImage(ImgD,W,H){ 
  var flag=false; 
  var image=new Image(); 
  image.src=ImgD.src; 
  if(image.width>0 && image.height>0){ 
    flag=true; 
    if(image.width/image.height>= W/H){ 
      if(image.width>W){
        ImgD.width=W; 
        ImgD.height=(image.height*H)/image.width; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt= ""; 
    } 
    else{ 
      if(image.height>H){
        ImgD.height=H; 
        ImgD.width=(image.width*W)/image.height; 
      }
	  else{ 
        ImgD.width=image.width;
        ImgD.height=image.height; 
      } 
      ImgD.alt=""; 
    } 
  }
}
<!--//--><![CDATA[//><!--
function menuFix() {
 var sfEls = document.getElementById("nav").getElementsByTagName("li");
 for (var i=0; i<sfEls.length; i++) {
  sfEls[i].onmouseover=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseDown=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onMouseUp=function() {
  this.className+=(this.className.length>0? " ": "") + "sfhover";
  }
  sfEls[i].onmouseout=function() {
  this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),
"");
  }
 }
}
window.onload=menuFix;
//--><!]]>
<!--
if (window.navigator.userAgent.indexOf("MSIE")>=1) 
{ 
var IE1024="CssHtml.css"; 
var IE800="CssHtml1.css"; 
var IE1440="CssHtml2.css"; 
var IEother="CssHtml3.css"; 
ScreenWidth(IE1024,IE800,IE1440,IEother) 
}else{ 
if (window.navigator.userAgent.indexOf("Firefox")>=1) 
{ 
//如果浏览器为Firefox 
var Firefox1024="CssHtml4.css"; 
var Firefox800="CssHtml4.css"; 
var Firefox1440="CssHtml4.css"; 
var Firefoxother="CssHtml4.css"; 
ScreenWidth(Firefox1024,Firefox800,Firefox1440,Firefoxother) 
}else{ 
//如果浏览器为其他 
var Other1024="CssHtml3.css"; 
var Other800="CssHtml3.css"; 
var Other1440="CssHtml3.css"; 
var Otherother="CssHtml3.css"; 
ScreenWidth(Other1024,Other800,Other1440,Otherother) 
} 
} 
function ScreenWidth(CSS1,CSS2,CSS3,CSS4){ 
if ((screen.width == 1024) && (screen.height == 768)){ 
setActiveStyleSheet(CSS1); 
}else{ 
if ((screen.width == 800) && (screen.height == 600)){ 
setActiveStyleSheet(CSS2); 
}else{ 
if ((screen.width == 1440) && (screen.height == 900)){ 
setActiveStyleSheet(CSS3); 
}else{ 
setActiveStyleSheet(CSS4); 
}}} 
} 
function setActiveStyleSheet(title){document.getElementsByTagName("link")[1].href="../images/"+title;} 
//-->