/* checked with jsLint 2003 09 07 */
/* created: 11/02/03 by len dierickx  */
/* http://n.one.port5.com             */
/* contact: webmaster@n.one.port5.com */
/* Supported: Win/Mac: NN6+, IE4+, Op6+, Mozilla */
var p6='<h1 class="scroll">News!!!<\/h1><p>Any important message goes here<\/p>';
   p6+='<p><em>Note:<\/em> This effect does not function in netscape 4!';
   p6+=' Yet another reason to upgrade.<\/p>';
function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){
//**data**//
this.name=name; this.initH=initH; this.initW=initW; this.heightB=heightB;
this.widthB=widthB; this.content=content; this.initBg=initBg;
this.Bg=Bg; this.iniFl=initFl; this.speed=parseInt(speed);
this.timer = name + "Timer"; 
//**methods**//
this.getElement = getElement; this.createLayer=createLayer;
this.scrollLayer = scrollLayer; this.scrollLoop=scrollLoop;
//**initiate methods**// 
this.createLayer(); this.getElement(); this.scrollLayer();
}
//**call this method to stop scrolling**//
function scrollLoop(s){this.speed = s;}
function scrollLayer(){
if(parseInt(this.elem.style.top)>(this.elem.offsetHeight*(-1))){
  this.elem.style.top = parseInt(this.elem.style.top)-this.speed;
  //alert(parseInt(this.elem.style.top)+"\n"+this.elem.id);
  }
  else {this.elem.style.top = this.initH;}
}
function getElement(){ // if dom use correct call
if (document.getElementById){this.elem = document.getElementById(this.name);
  } else {this.elem = document.layers[name];}
}
//**pretty obvious - if NS4 - please upgrade to a standard compliant browser**//
function createLayer(){
if(document.getElementById){ // its domable
document.write('<div id="layer'+this.name+'" style="position:relative;overflow:hidden;float:');
document.write(this.initFl+';background-color:#'+this.initBg+';border:1px solid black;width:');
document.write(this.initW+'px;height:'+this.initH+'px;" onmouseover="');
document.write(this.name+'.scrollLoop(0)" onmouseout="'+this.name+'.scrollLoop(');
document.write(this.speed+')">');

document.write('<div id="'+this.name+'" style="position:absolute;top:');
document.write(this.initH+'px;left:0px;border:0px solid black;width:');
document.write(this.widthB+'px;height:'+this.heightB+'px;background-color:#');
document.write(this.Bg+'">');
document.write(this.content);
document.write('<\/div><\/div>');}
else { // its ns4
document.write('<ilayer name="'+this.name+'" bgcolor="#'+this.Bg+'" width="');
document.write(this.widthB+'" height="'+this.heightB+'">'+this.content+'<\/ilayer>');
return;
}
if(this.scrollLayer){
  this.timer = setInterval(this.name+'.scrollLayer()','30');
  }
}
