﻿/*
author:char
date:2009.12.1
*/
function t_maquee(c_name,r_name,l_name,speed,fn){
    this.n_speed=speed;
    this.c=document.getElementById(c_name);
    this.r=document.getElementById(r_name);
    this.l=document.getElementById(l_name);
    this.n_timer=null;
    this.init=function(){
        this.r.innerHTML=this.l.innerHTML;
        this.n_timer=setInterval(fn+".n_marquee()",this.n_speed);
        this.c.onmouseover=function() {clearInterval(this.n_timer)}
        this.c.onmouseout=function() {this.n_timer=setInterval(fn+".n_marquee()",this.n_speed)}
    }
    this.n_marquee=function(){
       if(this.r.offsetTop-this.c.scrollTop<=0) this.c.scrollTop-=this.l.offsetHeight;
       else this.c.scrollTop++;
    }
}
