_scroll=document.createElement('div');
_scroll.id='scrollpane';
_scroll.style.position='absolute';
_scroll.move=slide;
_instance=document.createElement('div');
_instance.style.position='absolute';
_msie=navigator.userAgent.toLowerCase().indexOf('msie') + 1;
_iwidth=0;
_spos=get_cookie('spos');
//alert(_spos==0);
for(_line in _ticker){
	if(_ticker[_line].link!=undefined){
		_text=document.createElement('a');
		_text.appendChild(document.createTextNode(_ticker[_line].text));
		_text.href=_ticker[_line].link;
	} else {
		_text=document.createElement('span');
		_text.appendChild(document.createTextNode(_ticker[_line].text));
	}
	if(_ticker[_line].color!=undefined) _text.style.color=_ticker[_line].color;
	if(_ticker[_line].weight!=undefined) _text.style.fontWeight=_ticker[_line].weight;
	if(_ticker[_line].style!=undefined) _text.style.fontStyle=_ticker[_line].style;
	if(_ticker[_line].decoration!=undefined) _text.style.textDecoration=_ticker[_line].decoration;
	_instance.appendChild(_text);
}
_scroll.appendChild(_instance);
/*
if(window.attachEvent){
	window.attachEvent('onload',init_ticker);
} else {
	window.addEventListener('load',init_ticker,false);
}
*/
window.onload=init_ticker;
window.onbeforeunload=function(){document.cookie='spos='+_spos};
function init_ticker(){
	//alert("Ticker starting");
	_root=document.getElementById('ticker');
	_root.appendChild(_scroll);
	for(var _cnt=0;_cnt < _instance.childNodes.length; _cnt++){
		_iwidth=_iwidth+_instance.childNodes[_cnt].offsetWidth;
	}
	if(_msie) _iwidth=_iwidth+10;
	var _mul=_root.offsetWidth/_iwidth;
	_rep=Math.ceil(_mul)+1;
	for(var _cnt=1; _cnt < _rep; _cnt++){
		var _clone=_scroll.appendChild(_instance.cloneNode(true));
		_clone.style.position='absolute';
		_clone.style.left=_cnt*_iwidth+'px';
	}
	_scroll.swidth=_cnt*_iwidth;
	_scroll.style.width=_cnt*_iwidth+'px';
	_scroll.iwidth=_iwidth;
	_scroll.move();
}

function slide(){
	if(_spos!=0) {
		this.style.left=_spos+'px';
		_spos=0;
	}
	if(this.offsetLeft>(0-this.iwidth)){
		this.style.left=this.offsetLeft-_xinc+'px';
	} else {
		this.style.left='0px';
	}
	_spos=this.offsetLeft;
	setTimeout('objCall("scrollpane","move()")',_mrate);
}

function objCall(_id,_fnc){
	_obj=document.getElementById(_id);
	eval('document.getElementById("'+_id+'").'+_fnc);
}

//Get cookie routine by Shelley Powers 
function get_cookie(Name) {
	var search = Name + "="
	var returnvalue = "";
	if (document.cookie.length > 0) {
	offset = document.cookie.indexOf(search)
	if (offset != -1) { 
		offset += search.length
		end = document.cookie.indexOf(";", offset);
		if (end == -1) end = document.cookie.length;
		returnvalue=unescape(document.cookie.substring(offset, end))
		}
	}
	return returnvalue;
}