// JavaScript Document
function cross_marquee( marqueecontent, marqueewidth, marqueeheight, marqueespeed, marqueebgcolor, pauseit ){

	if(!cross_marquee.ar)
	{
		cross_marquee.ar=[];
	}
	
	cross_marquee.ar[this.mqid=cross_marquee.ar.length]=this;
	
	this.marqueecontent=marqueecontent;
	
	this.marqueewidth=marqueewidth;
	
	this.marqueeheight=marqueeheight;
	
	this.marqueespeed=marqueespeed;
	
	this.marqueebgcolor=marqueebgcolor;
	
	this.pauseit=pauseit;

	this.marqueespeed=(document.all)? this.marqueespeed : Math.max(1, this.marqueespeed-1) //slow speed down by 1 for NS
	
	this.copyspeed=this.marqueespeed
	
	this.pausespeed=(this.pauseit==0)? this.copyspeed: 0
	
	this.iedom=document.all||document.getElementById
	
	this.begun = document.getElementById("begun");
	
	this.begun.innerHTML = '<span id="temp'+this.mqid+'" style="visibility:hidden;position:absolute;">'+this.marqueecontent+'</span>';
	
	this.actualwidth=''
	
	
	
	this.begun_contener = document.getElementById( "begun_contener" );
	
	this.begun_contener.innerHTML = '<div style="position:relative;width:'+this.marqueewidth+';height:'+this.marqueeheight+';overflow:hidden;"><div style="position:absolute;width:100%;height:'+this.marqueeheight+';" onMouseover="cross_marquee.ar['+this.mqid+'].copyspeed=cross_marquee.ar['+this.mqid+'].pausespeed" onMouseout="cross_marquee.ar['+this.mqid+'].copyspeed=cross_marquee.ar['+this.mqid+'].marqueespeed" id="marwidth'+this.mqid+'" ><div id="iemarquee'+this.mqid+'" style="position:absolute;left:0px;top:0px"></div></div></div>';
	
	this.populate();

}

cross_marquee.prototype.populate=function(){
	
	this.cross_marquee=document.getElementById? document.getElementById("iemarquee"+this.mqid) : document.all['iemarquee'+this.mqid];
	this.cross_marquee.style.left=this.getOffsetWidth()+8+"px"
	this.cross_marquee.innerHTML=this.marqueecontent
	this.actualwidth=document.all? document.all['temp'+this.mqid].offsetWidth : document.getElementById("temp"+this.mqid).offsetWidth;
	
	var cacheobj=this;
	
	this.lefttime=setInterval( function(){cacheobj.scrollmarquee();} ,18 )
}

cross_marquee.prototype.scrollmarquee=function(){

	if ( parseInt( this.cross_marquee.style.left ) > ( this.actualwidth*(-1)+8 ) )
	{
		this.cross_marquee.style.left=parseInt(this.cross_marquee.style.left)-this.copyspeed+"px"
	}
	else
	{
		this.cross_marquee.style.left=this.getOffsetWidth()+8+"px"
	}
}

cross_marquee.prototype.getOffsetWidth = function(){

	return document.getElementById( "marwidth"+this.mqid ).offsetWidth;
}

var marqueecontent='<nobr>Вложение в себя - гарантия 100% окупаемости!</nobr>';
