/* CMSdragon 2008, powered by Alexander Shatalov http://cmsdragon.com 
	CMSDRAGON Marguee effect, can be multiple, all rigths reserved
*/

var MG={
	t:[],o:[],w:[],p:[],h:[],l:[],f:[],s:[],x:[],sep:'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',speed:2,tim:18,
	start:function(isp){this.isp=isp;this.win=isp?window.parent:window;var o=this.win.getElementsByClass('marguee',this.win.document,'DIV');for(i=0;i<o.length;i++){if(o[i]){this.move(o[i],i)}}},
	move:function(o,i){
		clearTimeout(this.t[i]);this.o[i]=o;this.h[i]=o.innerHTML;if(this.isp){o.style.left=o.rel}else{this.f[i]=parseInt(o.style.left);this.o[i].rel=this.f[i]}this.o[i].innerHTML=this.h[i]+this.sep+this.h[i]+this.sep;this.w[i]=o.offsetWidth;this.s[i]=0;this.x[i]=this.tim;this.p[i]=this.speed;this.l[i]=this.speed;this.s[i]=0;this.go(i)},
	go:function(i){
		if(!this.o[i]){return false}
		if(this.s[i]==1){clearTimeout(this.t[i]);this.x[i]+=2}else if(this.x[i]>this.tim+1){clearTimeout(this.t[i]);this.x[i]-=2}
		if(this.l[i]>this.w[i]){this.o[i].innerHTML+=this.h[i]+this.sep+this.h[i]+this.sep;this.l[i]=this.speed}else{this.l[i]+=this.speed}
		this.p[i]+=this.speed;
		this.o[i].style.left=(this.f[i]-this.p[i])+'px';
		if(this.x[i]<=this.tim*2){
			if(this.isp){this.t[i]=setTimeout("window.parent.MG.go("+i+")",this.x[i])}else{this.t[i]=setTimeout("window.self.MG.go("+i+")",this.x[i])}
		}else{this.s[i]=0}
	},
	find:function(o){for(i=0;i<this.o.length;i++){if(o==this.o[i]){return i}}},
	over:function(o){var i=this.find(o);this.s[i]=1;this.go(i)},
	out:function(o){var i=this.find(o);this.s[i]=0;this.go(i)}
}