var delayb4scroll = 2000; //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed = 3; //Specify marquee scroll speed (larger is faster 1-10)
var pauseit = 1; //Pause marquee onMousever (0=no. 1=yes)?
////NO NEED TO EDIT BELOW THIS LINE////////////
var copyspeed = marqueespeed;
var pausespeed = (pauseit == 0)? copyspeed: 0;
var actualWidth = '';
function scrollmarquee(){
	$("vmarquee").style.left = parseInt($("vmarquee").style.left) - copyspeed+"px";
	$("newOne").style.left = parseInt($("newOne").style.left) - copyspeed+"px";
	if ( parseInt($("vmarquee").style.left) + 10  <= actualWidth*(-1) ) {
	   $("vmarquee").style.left = actualWidth+"px";					
	}
	if ( parseInt($("newOne").style.left) + 10  <= actualWidth*(-1)  ) {
	   $("newOne").style.left = actualWidth+"px";					
	}
}
function initializemarquee(){
    // calculate width
    //alert('referer' + window.parent.location.href);
	var oldw = $('outerMost').style.width;
	$('outerMost').style.width = '5000px';
    var widdd = 0;
    
	paras = $A($('vmarquee').getElementsByClassName('dummyClass')); 
	paras.each(function(elm){ widdd = widdd + parseInt(elm.offsetWidth); }); 
	//$('vmarquee').getElementsByClassName('dummyClass').each(function(elm) { widdd = widdd + parseInt(elm.offsetWidth); }); 
    
	$('marqueecontainer').style.width = (widdd * 2) + 'px';
    $('vmarquee').style.width = widdd + 'px';
    $('outerMost').style.width = oldw;
	
	$("vmarquee").style.left = 0;
	containerWidth = $("marqueecontainer").offsetWidth;
	actualWidth = $("vmarquee").offsetWidth;
	if ( containerWidth > actualWidth ) { $("marqueecontainer").style.width = actualWidth; }
	if (!$("newOne")) {
		newUl = document.createElement('div');
		newUl.id = "newOne";
		$('marqueecontainer').appendChild(newUl);
		$('newOne').innerHTML = $("vmarquee").innerHTML;
		$('newOne').style.position = $("vmarquee").style.position;
		$('newOne').style.padding = $("vmarquee").style.padding;
		$('newOne').style.margin = $("vmarquee").style.margin;
		$('newOne').style.width = $("vmarquee").style.width;
		$('newOne').style.display = 'block';
	    $("newOne").style.left = actualWidth+'px';
	}
	//alert($("marqueecontainer").innerHTML)
   /*if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1) { //if Opera or Netscape 7x, add scrollbars to scroll and exit
		$("vmarquee").style.Width = containerWidth+"px";
		$("vmarquee").style.overflow = "scroll";
		$("newOne").style.width = containerWidth+"px";
		$("newOne").style.overflow = "scroll";
		//return;
	}*/
    setTimeout('lefttime=setInterval("scrollmarquee()",80)', delayb4scroll);
}
