/**
 * Javascript Marquee
 * Author :  Mathieu Bautista, IRCF (www.ircf.fr)
 * This copyright must be conserved
 */
function Marquee(_id,_isVertical,_speed,_pause){
	this.id=_id
	this.speed=_speed
	this.pause=_pause
	this.isVertical=_isVertical
	this.copyspeed=this.speed
	this.pausespeed=(this.pause)?0:this.speed
	this.actualheight=''
	this.actualwidth=''
	this.container=document.getElementById(this.id)
	this.content=this.container.firstChild
	while (this.content.nodeType!=1)
		this.content=this.content.nextSibling
	Marquee.instanceId = Marquee.Instances.length;
	Marquee.Instances[this.instanceId] = this;
	if (this.isVertical){
		this.content.style.top=0;
		this.marqueeheight=this.container.offsetHeight
		this.actualheight=this.content.offsetHeight
	}else{
		this.content.style.left=0;
		this.marqueewidth=this.container.offsetWidth
		this.actualwidth=this.content.offsetWidth
	}
}
Marquee.Instances = new Array();
Marquee.prototype.start = function (){
	setInterval("Marquee.Instances["+this.instanceId+"].scroll()",10)
}
Marquee.prototype.scroll = function (){
	if (this.isVertical){
		if (parseInt(this.content.style.top)>(this.actualheight*(-1)+8))
			this.content.style.top=parseInt(this.content.style.top)-this.copyspeed+"px"
		else
			this.content.style.top=parseInt(this.marqueeheight)+8+"px"
	}else{
		if (parseInt(this.content.style.left)>(this.actualwidth*(-1)+8))
			this.content.style.left=parseInt(this.content.style.left)-this.copyspeed+"px"
		else
			this.content.style.left=parseInt(this.marqueewidth)+8+"px"	
	}
}