// Accessible Scroller by Mike Foskett (http://www.websemantics.co.uk/). Retain this message and you may use the code freely.
// clvproperties.Com

var speed=100      // speed of scroller
var step=1        // smoothness of movement
var ecrans=('t1|t2|t3|t4');
var ecran=ecrans.split('|');

var x, scroll, divW, sText=""

function onclickIE(idAttr,handler,call)
{
  if ((document.all)&&(document.getElementById)){idAttr[handler]=new Function(call)}
}

function stopScroller()
{
	clearTimeout(scroll)
}

function startScroller(scrollerDiv)
{
  document.getElementById('tag_'+scrollerDiv).style.whiteSpace='nowrap'
  var p=document.createElement('p')
  p.id='testP_'+scrollerDiv
  p.style.fontSize='25%' //fix for mozilla. multiply by 4 before using
  x-=step
  if (document.getElementById('tag_'+scrollerDiv).className) p.className=document.getElementById('tag_'+scrollerDiv).className
  p.appendChild(document.createTextNode(sText))
  document.body.appendChild(p)
  pw=p.offsetWidth
  document.body.removeChild(p)
  if (x<(pw*4)*-1){x=divW}
  document.getElementById('tag_'+scrollerDiv).style.left=x+'px'
  scroll=setTimeout('startScroller("'+scrollerDiv+'")',speed)
}

function initScroller()
{
	for (var ii=0; ii<ecran.length; ii++)
	{
		var scrollerDiv=ecran[ii];
		if (document.getElementById && document.createElement && document.body.appendChild)
		{
			divW=document.getElementById(scrollerDiv).offsetWidth
			x=divW
			document.getElementById('tag_'+scrollerDiv).style.position='relative'
			document.getElementById('tag_'+scrollerDiv).style.left=divW+'px'
			var ss=document.getElementById('tag_'+scrollerDiv).childNodes
			for (i=0;i<ss.length;i++)
			{
				sText+=ss[i].nodeValue+" "
			}
			scroll=setTimeout('startScroller("'+scrollerDiv+'")',speed)
		}
	}
}

function addLoadEvent(func)
{
  if (!document.getElementById | !document.getElementsByTagName) return
  var oldonload = window.onload
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload()
      func()
    }
  }
}
addLoadEvent(initScroller)