//News Scroller***********************
function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,scrolldir){
//**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.speed=parseInt(speed,10);
this.scrolldir=scrolldir;
this.timer=name+"Timer";
this.scrolldelay=2000;
//**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(this.scrolldir=='up'){if(parseInt(this.elem.style.top,10)>(this.elem.offsetHeight*(-1))){
  this.elem.style.top=parseInt(this.elem.style.top,10)-this.speed+'px';
  } else {this.elem.style.top=this.initH+'px';}}
  else{if(parseInt(this.elem.style.left,10)>(this.elem.offsetWidth*(-1))){
  this.elem.style.left=parseInt(this.elem.style.left,10)-this.speed+'px';
  } else {this.elem.style.left=this.initW+'px';}}
  if(this.scrolldelay > 30){this.timer=setTimeout(this.name+'.scrollLayer()',this.scrolldelay);
  this.scrolldelay = 30;
  return;}
  if(this.scrollLayer){this.timer=setTimeout(this.name+'.scrollLayer()',this.scrolldelay);}
}
function getElement(){this.elem=document.getElementById(this.name);}
function createLayer(){
document.write('<div id="layer'+this.name+'" style="position:relative;overflow:hidden');
document.write(';background-color:#'+this.initBg+';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+')">');
if(this.scrolldir=='up'){document.write('<div id="'+this.name+'" style="position:absolute;top:');
document.write('0px;left:0px;border:0px solid black;width:');}
else{document.write('<div id="'+this.name+'" style="position:absolute;white-space:nowrap;left:');
document.write('0px;top: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>');
//if(this.scrollLayer){this.timer=setInterval(this.name+'.scrollLayer()','30');}
}
