// JavaScript Document
//头部图片滚动的代码 PicRoll 方法没有使用
function PicRoll()
{	
var speed=3
demo2.innerHTML=demo1.innerHTML
function Marquee(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
		demo.scrollLeft-=demo1.offsetWidth
else{demo.scrollLeft++}}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}

<!--向右滚动<script>
/*var speed=30
demo2.innerHTML=demo1.innerHTML
demo.scrollLeft=demo.scrollWidth
function Marquee(){
if(demo.scrollLeft<=0)
demo.scrollLeft+=demo2.offsetWidth
else{
demo.scrollLeft--
}
}
var MyMar=setInterval(Marquee,speed)
demo.onmouseover=function() {clearInterval(MyMar)}
demo.onmouseout=function() {MyMar=setInterval(Marquee,speed)}
</script>-->*/
}

function Time()
{
	document.getElementById("time").innerHTML = new Date().toLocaleString();
	setTimeout("Time()",1000);
}

//等比例缩放图片 
 function DrawImageSon(ImgD)
 {	
     var image=new Image();
     image.src=ImgD.src;
	 if(ImgD.width > ImgD.height)
	 {
		FitWidth = "200";	//如果图片的宽度大于高度 缩放比例为 200：150
		FitHeight = "150";
	 }
	 else
	 {
		 FitWidth = "150";	//否则 缩放比例为 150：200
		 FitHeight = "200";
	  }
     if(image.width>0 && image.height>0){
         if(image.width/image.height>= FitWidth/FitHeight){
             if(image.width>FitWidth){
                 ImgD.width=FitWidth;
                 ImgD.height=(image.height*FitWidth)/image.width;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             }
         } else{
             if(image.height>FitHeight){
                 ImgD.height=FitHeight;
                 ImgD.width=(image.width*FitHeight)/image.height;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             } 
        }
     }
 }
 
 //大图页面等比例缩放图片 
 function DrawBigImageSon(ImgD)
 {	
     var image=new Image();
     image.src=ImgD.src;
	 if(ImgD.width > ImgD.height)
	 {
		FitWidth = "950";	//如果图片的宽度大于高度 缩放比例为 950：950
		FitHeight = "950";
	 }
	 else
	 {
		 FitWidth = "950";	//否则 缩放比例为 950：2000
		 FitHeight = "2000";
	  }
     if(image.width>0 && image.height>0){
         if(image.width/image.height>= FitWidth/FitHeight){
             if(image.width>FitWidth){
                 ImgD.width=FitWidth;
                 ImgD.height=(image.height*FitWidth)/image.width;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             }
         } else{
             if(image.height>FitHeight){
                 ImgD.height=FitHeight;
                 ImgD.width=(image.width*FitHeight)/image.height;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             } 
        }
     }
 }
 
 //教师格言页面等比例缩放图片 
 function DrawTcImageSon(ImgD)
 {	
     var image=new Image();
     image.src=ImgD.src;
	 if(ImgD.width > ImgD.height)
	 {
		FitWidth = "140";	//如果图片的宽度大于高度 缩放比例为 950：950
		FitHeight = "98";
	 }
	 else
	 {
		 FitWidth = "98";	//否则 缩放比例为 950：2000
		 FitHeight = "140";
	  }
     if(image.width>0 && image.height>0){
         if(image.width/image.height>= FitWidth/FitHeight){
             if(image.width>FitWidth){
                 ImgD.width=FitWidth;
                 ImgD.height=(image.height*FitWidth)/image.width;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             }
         } else{
             if(image.height>FitHeight){
                 ImgD.height=FitHeight;
                 ImgD.width=(image.width*FitHeight)/image.height;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             } 
        }
     }
 }
 
  //等比例缩放图片 
 function DrawImageCanShuSon(ImgD,wd,hx,wx,hd)
 {	
     var image=new Image();
     image.src=ImgD.src;
	 if(ImgD.width > ImgD.height)
	 {
		FitWidth = wd;	//如果图片的宽度大于高度 缩放比例为 950：950
		FitHeight = hx;
	 }
	 else
	 {
		 FitWidth = wx;	//否则 缩放比例为 950：2000
		 FitHeight = hd;
	  }
     if(image.width>0 && image.height>0){
         if(image.width/image.height>= FitWidth/FitHeight){
             if(image.width>FitWidth){
                 ImgD.width=FitWidth;
                 ImgD.height=(image.height*FitWidth)/image.width;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             }
         } else{
             if(image.height>FitHeight){
                 ImgD.height=FitHeight;
                 ImgD.width=(image.width*FitHeight)/image.height;
             }else{
                 ImgD.width=image.width; 
                ImgD.height=image.height;
             } 
        }
     }
 }
 

