﻿
 
  htmlurl="/club.html";  
  imgpath="/image/hyk.gif";  
  imgTrans="/image/hyk.gif";  
  imgWidth=170;//指定图片宽  
  imgHeight=110;//指定图片高  
  //注意：你的两张图片宽和高必须一样  
   
   
  document.write("<div   id=img   style=\"position:   absolute;   left:   0;   top:   0;index:0\"   >");                                    
  document.write("<img   width="+imgWidth+"height="+imgHeight+"   id=SampleID   src=\""+imgpath+"\"   onmouseover=imgstop()   onmouseout=imgstart()   onclick=\"window.open('"+htmlurl+"')\"       style=\"cursor:hand;filter:blendTrans(duration=0.2)\"   >");  
  document.write("</div>");  
  var   xPos   =   20;  
  var   yPos   =  500;  
  var   step   =   1;  
  var   delay   =   30;    
  var   height   =   0;  
  var   Hoffset   =   0;  
  var   Woffset   =   30;  
  var   yon   =   0;  
  var   xon   =   0;  
  var   pause   =   true;  
  var   interval;  
  img.style.top   =   yPos;  
  interval=null;  
   
  function   start()   {  
  width   =   document.body.clientWidth;  
  height   =   500;  
  Hoffset   =   img.offsetHeight;  
  Woffset   =   img.offsetWidth;  
  img.style.left   =   xPos   +   document.body.scrollLeft;  
  img.style.top   =   yPos   +   document.body.scrollTop;  
  if   (yon)   yPos   =   yPos   +   step;  
  else   yPos   =   yPos   -   step;  
  if   (yPos   <   0)   {yon   =   1;yPos   =   0;}  
  if   (yPos   >=   (height   -   Hoffset))   {  
  yon   =   0;  
  yPos   =   (height   -   Hoffset);  
  }  
  if   (xon)   xPos   =   xPos   +   step;  
  else   xPos   =   xPos   -   step;  
  if   (xPos   <   0)   { xon   =   1;xPos   =   0;}  
  if   (xPos   >=   (width   -   Woffset))   {  
  xon   =   0;  
  xPos   =   (width   -   Woffset);  
  }  
  interval=setTimeout("start()",delay);  
  }  
   
  function   imgstart()   {  
                  SampleID.filters.blendTrans.Apply();  
                  SampleID.src   =   imgpath;  
                  SampleID.filters.blendTrans.Play()  
                  interval   =   setTimeout('start()',   delay);  
  }  
  function   imgstop(){  
                  SampleID.filters.blendTrans.Apply();  
                  SampleID.src   =   imgTrans;  
                  SampleID.filters.blendTrans.Play()  
                  if(interval!=null)   {clearTimeout(interval);interval=null}  
   
  }  
  start();  
   


