/***********************************************
* DHTML Billboard script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var tickspeed=6000;
var effectduration=500;
var effects=["Inset", "Pixelate(MaxSquare=5 enabled=false)", "GradientWipe(GradientSize=1.0 Duration=0.7)", "RandomBars", "Stretch"];
var filterid=Math.floor(Math.random()*effects.length);
var selectedDiv=0;
var totalDivs=0;


document.write('<style type="text/css">\n');
if (document.getElementById)
	document.write('.quotecontent{display:none;\n'+'filter:progid:DXImageTransform.Microsoft.'+effects[filterid]+'}\n');
document.write('</style>\n');


function contractboard()
{
	var inc=0;
	while (document.getElementById("quote"+inc))
	{
		document.getElementById("quote"+inc).style.display="none";
		inc++;
	}
}

function expandboard()
{
	var lastDiv=0;
	var selectedDivObj;
	
	selectedDivObj=document.getElementById("quote"+selectedDiv);
	contractboard();
	if (selectedDivObj.filters)
	{
		if (effects.length>1)
		{
			filterid=Math.floor(Math.random()*effects.length);
			selectedDivObj.style.filter="progid:DXImageTransform.Microsoft."+effects[filterid];
		}
		selectedDivObj.filters[0].duration=effectduration/1000;
		selectedDivObj.filters[0].Apply();
	}
	selectedDivObj.style.display="block";
	if (selectedDivObj.filters)
		selectedDivObj.filters[0].Play();
	selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0	
	//lastDiv = selectedDiv;
	//selectedDiv = Math.floor(Math.random()*totalDivs);
	//if (lastDiv == selectedDiv)
	//	selectedDiv = Math.floor(Math.random()*totalDivs);

	setTimeout("expandboard()",tickspeed);
}

function startbill()
{
	while (document.getElementById("quote"+totalDivs)!=null)
		totalDivs++;
	selectedDiv = Math.floor(Math.random()*totalDivs);		
	if (document.getElementById("quote0").filters)
		tickspeed+=effectduration;		
	expandboard();
}


if (window.addEventListener)
	window.addEventListener("load", startbill, false);
else if (window.attachEvent)
	window.attachEvent("onload", startbill);
else if (document.getElementById)
	window.onload=startbill;






