﻿// JScript 文件

function Marquee(obj,frist_child,last_child,direction,speed,MyMar)
{ 
  last_child.innerHTML=frist_child.innerHTML   
  with(obj)
  { 
      onmouseover=function(){clearInterval(MyMar)} 
      onmouseout=function()
      { 
         MyMar=setInterval(
           function()
           {
             with(obj)
              switch(direction) 
              { 
               case "up": 
                 scrollTop+=(scrollTop<=last_child.offsetTop?1:-last_child.offsetHeight)
               break 
               case "down": 
                 scrollTop+=(scrollTop>0?-1:last_child.offsetTop)
               break 
               case "left": 
                 scrollLeft+=(scrollLeft<=last_child.offsetWidth?1:-last_child.offsetWidth)
               break 
               case "right": 
                 scrollLeft+=(scrollLeft>0?-1:last_child.offsetWidth)
               break 
               default: 
              
              } 
 
            }
         ,speed)
      } 
      fireEvent("onmouseout") 
  } 
} 