//Developed by Insite (www.EasyNet.com.co)
function marquee(name,top,left,width,height,lineHeight,delay){
this.name=name;
this.top=top;
this.left=left;
this.width=width;
this.height=height;
this.delay=delay*850;
this.step=2;
this.ITEM_WIDTH=width;
this.ITEM_HEIGHT=lineHeight;
this.DELAY_LINE=60;
this.content="<tr><td colspan=\"2\" height=\""+this.height+"\" width=\""+this.ITEM_WIDTH+"\">&nbsp;</td></tr>";
this.contentHeight=this.height;
this.cantItems=0;
this.clipTop=0;
this.clipLeft=0;
this.clipRight=width;
this.clipBottom=this.height;
this.timer;
this.stop=true;
this.addItem=addItem;
this.init=init;
this.initPosition=initPosition;
this.scrollUp=scrollUp;
this.scrollStart=scrollStart;
this.scrollStop=scrollStop;
this.scrollUpAux=scrollUpAux;
this.style=style;
this.layer=layer;
this.reload=false;
this.ns=(document.layers)? true:false
this.ie=(document.all)? true:false
}

function addItem(misc, contenido){
this.content+="<tr><td  height=\""+this.ITEM_HEIGHT+"\" width=\"12\" align=\"left\" valign=\"top\"><img src=../../Easynet/images//%22%22%2Bmisc%2B%22/%22 width=\"6\" height=\"7\" vspace=\"3\" alt=\" \"></td><td align=\"left\" valign=\"top\" height=\""+this.ITEM_HEIGHT+"\" width=\""+(this.ITEM_WIDTH - 12)+"\">"+contenido+"</td></tr>";
this.contentHeight+=this.ITEM_HEIGHT;
this.cantItems++;
}

function style(){
document.writeln("<style type=\"text/css\">");
document.write("#"+this.name+" { position:absolute; left:"+this.left+"px; top:"+this.top+"px; width:"+this.width+"px; height:"+this.height+"px; z-index:1; clip: rect(0 "+this.width+" "+this.height+" 0) };");
document.write("</style>");
}

function init(){
document.writeln("<div id=\""+this.name+"\" ><table width=\""+this.ITEM_WIDTH+"\" height=\""+this.height+"\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"+this.content+ "</table></div>");
this.initPosition();
}

function scrollUp(){
this.stop=false;
this.timer= setTimeout( this.name+".scrollUpAux("+this.step+","+this.height+")",this.DELAY_LINE);
}

function scrollUpAux(step,limit){
if ( this.clipTop + step <= limit) {
this.clipTop+=step;
this.clipBottom+=step; 
if (this.ie) {
this.layer().style.posTop-=step;
this.layer().style.clip="rect("+this.clipTop+" "+this.clipRight+" "+this.clipBottom+" "+this.clipLeft+")";
}
if (this.ns) {
this.layer().top-=step;
this.layer().clip.top=this.clipTop;
this.layer().clip.left=this.clipLeft;
this.layer().clip.right= this.clipRight;
this.layer().clip.bottom=this.clipBottom;
}	
if (! this.stop) { this.timer= setTimeout(this.name+".scrollUpAux("+step+","+limit+")",this.DELAY_LINE); }
}else{
if (limit+this.height <= this.contentHeight) {
if (! this.stop) { this.timer= setTimeout(this.name+".scrollUpAux("+step+","+(this.height+limit)+")",this.delay); }
}else{
this.initPosition();
this.timer= setTimeout(this.name+".scrollUpAux("+step+","+this.height+")",0);
}
}
}

function scrollStart(){
this.stop=false;
this.timer= setTimeout("this.scrollUp()",this.delay);
}

function scrollStop(){
this.stop=true;
}

function layer(){
if (this.ns) return document.layers[this.name];
if (this.ie) return document.all[this.name];
}

function initPosition(){
this.clipTop=0;
this.clipLeft=0;
this.clipRight=this.width;
this.clipBottom=this.height;

if (this.ie) {
this.layer().style.posTop=this.top;
this.layer().style.posLeft=this.left;
this.layer().style.width=this.width;
this.layer().style.height=this.height;
this.layer().style.clip="rect("+this.clipTop+" "+this.clipRight+" "+this.clipBottom+" "+this.clipLeft+")";
}

if (this.ns) {
this.layer().top=this.top;
this.layer().left=this.left;
this.layer().width=this.width;
this.layer().height=this.height;
this.layer().clip.top=this.clipTop;
this.layer().clip.left=this.clipLeft;
this.layer().clip.right= this.clipRight;
this.layer().clip.bottom=this.clipBottom;
}	
}
