var c=520;
var t;
var timer_is_on=0;
var len;


function timedCount()
{
document.getElementById('rtxt').style.left = c + "px";
if ( c > len ) c = c-1;
else c = 520;
t=setTimeout("timedCount()",30);
}

function doTimer()
{
if (!timer_is_on)
  {
	len = document.getElementById('rtxt').innerHTML.length;
	len = -5 * len;
	//alert(len);
	timer_is_on=1;
	timedCount();
  }
}

function stopCount()
{
clearTimeout(t);
timer_is_on=0;
}

function makeDoubleDelegate(function1, function2) {
    return function() {
        if (function1)
            function1();
        if (function2)
            function2();
    }
}

window.onload = makeDoubleDelegate(window.onload, doTimer);

