var current = 0;
var t;
var restart = 0;
var slideShowSpeed;
function start_show()
{
	slideShowSpeed = 8000
	t = setTimeout('show(\'timed\',\'notfirst\')', slideShowSpeed)	
}
function end_show()
{
	clearTimeout(t);
	document.getElementById('resume').style.display = "block";
}
function show(which,evt)
{
	var divhide = 'quotation'+current;
	
	if(which == 'prev' && current != 0)
	{
		current--;
		var divdisplay = 'quotation'+current;
		change_quote(divhide,divdisplay);
		end_show()
	}
	if(which == 'next' && current != 6)
	{
		current++;
		var divdisplay = 'quotation'+current;
		change_quote(divhide,divdisplay);
		end_show()
	}
	if(current == 6)
	{
		restart = 'yes'
	}
	if(which == 'timed')
	{
		if(evt == 'notfirst')
		{
			if(restart == 'yes')
			{
				current = 0;
				restart = 'no';
			}
			else
			{
				current++;
			}
			var divdisplay = 'quotation'+current;
			change_quote(divhide,divdisplay);
		}
		document.getElementById('resume').style.display = "none";
		start_show()
	}
}

function change_quote(divhide,divdisplay)
{
	document.getElementById(divhide).style.display = "none";
	document.getElementById(divdisplay).style.display = "block";
}
