
var scrllTmr;
window.onload = function(){
	document.getElementById('scrollme').style.display='';
	//set style
	document.getElementById('scroll').style.overflow = 'hidden';
	document.getElementById('scrollme').style.float = 'left';
	document.getElementById('scrollme').style.position = 'relative';

	//get canvas
	cw = parseInt(document.getElementById('scroll').offsetWidth);
	w = parseInt(document.getElementById('scrollme').offsetWidth);
	
	//start scroll
	lft = cw; // + w;
	document.getElementById('scrollme').style.left = lft + "px";
	scrollStep(cw,w,lft);
}
function scrollStep(cw,w,lft){
	//calc and do step
	if(lft == w * -1)
		lft = cw; // + w;
	document.getElementById('scrollme').style.left = lft + "px";
	
	//wait and do next...
	if(scrllTmr)
		clearTimeout(scrllTmr);
	scrllTmr = setTimeout('scrollStep(cw,w,' + (lft - 1) + ')',10);
}
function writeScroll(t, w, h, c, bg, f, fs, fw) {
	document.write("<div id='scroll' style='width:"+w+"; height:"+h+"; color:"+c+"; background-color:"+bg+"; font:"+ f +"; font-size:" + fs + "; font-weight: " + fw + "; vertical-align:middle;'><div id='scrollme' style='white-space:nowrap;display:none;'>" + t + "</div></div>");
}