//-----------------------------------------------------
 function skins(id,w,h,s){

    this.paustime = 10000;
    this.gettime;
    this.mytime;
    this.width  = w;
    this.height = h;
    this.speed  = s;
    this.border = 0;
    this.fontsize = 16
    this.stoptime = 3;
    this.name = id;
    this.open = show;
    this.news = new Array();
    this.addnews = addnewsLine;
    this.nownews = 0;
    this.skinLayer = 'document.all.' + this.name + 'skin.style';
    this.moveNewsLayer = 'document.all.' + this.name + 'news.style';
    this.start = scrollrun;
    this.stop = scrollstop;
    this.timID;
    this.inifit = inif;
    this.paus =0;
 } 

 function inif(){  
      eval(this.moveNewsLayer).top = eval(this.skinLayer).height;    
 }


 function scrollrun(){

   if (eval(this.moveNewsLayer).pixelTop == 0) 
   {
     this.mytime = new Date();
     if ((this.mytime - this.gettime) > this.paustime)
     {
       eval(this.moveNewsLayer).pixelTop = eval(this.moveNewsLayer).pixelTop - 4;

     } 
   }
   else
   {
     eval(this.moveNewsLayer).pixelTop = eval(this.moveNewsLayer).pixelTop - 4;
     this.gettime = new Date();
   }
   
   if (eval(this.moveNewsLayer).pixelTop < -120)
     {  
      if (this.nownews < this.news.length-1)
      {this.nownews ++;} 
      else 
      {this.nownews=0;}
     
        var trsLayer = 'document.all.' + this.name + 'news';
        
        eval(trsLayer).innerHTML = this.news[this.nownews];
        
        this.inifit();}
    
    //document.writeln(eval(ks).style.pixelTop)
  
}

 
 function scrollstop(){
          clearInterval(this.timID);
 }
 
 function show(){  
  
  var div_skin;
  var skinLayer;
  var moveNewsLayer;
  var tID = this.name + ".stop()" 
 
 
  div_skin = '<div id="' + this.name + 'skin" style="overflow: hidden;width:' + this.width + ';height:' + this.height 
           + ';border:' + this.border + ' outset #99CCFF" onMouseover="'+ tID +'" onMouseOut="goScroll(\''+this.name+'\')">'  
           + '<div id="' + this.name + 'news" style="position: relative;font-size:' + this.fontsize + ';top:0;left:0;width:' + this.width + ';height:">'
           + this.news[this.nownews] + '</div></div>'
           
  document.write(div_skin);
   
  this.inifit();
  
  var ds = this.name + ".start()";
  var ss = this.speed;
  
  eval(this.name).timID = setInterval(ds,ss)
  
 }
 
 function goScroll(src){
 
   var ds = src+".start()";   
   eval(src).timID = setInterval(ds,eval(src).speed);
 
 }
 
 function addnewsLine(str){
 
    this.news[this.news.length] = str;
    
    //alert(this.news[this.news.length-1]);
 }




