var dcurrent = 1;
var rint;

function rotateDemo( dindex, manual )
{
	if( dindex == null )
		dindex = dcurrent == 4 ? 1 : dcurrent + 1;
	
	if( manual )
		clearInterval( rint );
	
	document.getElementById( 'demo_content_'+dcurrent ).style.display = 'none';
	document.getElementById( 'demo_link_'+dcurrent ).className = document.getElementById( 'demo_link_'+dcurrent ).className.replace( ' current', '' ); 
	
	document.getElementById( 'demo_content_'+dindex ).style.display = 'block';
	document.getElementById( 'demo_link_'+dindex ).className += ' current';
	
	dcurrent = dindex;
}

function startDemoRotation()
{
	rint = setInterval( "rotateDemo()", 4000 );
}

window.onload = function() {
//	setLinks();
	startDemoRotation();
}



