var cur_quote = -1;

function quote_timer()
{
	//alert("in");
	if ( typeof QUOTES == 'undefined' || typeof QUOTES[0] == 'undefined')
	{
		$("#quote").css('display','none');
		return false;
	}

	if (cur_quote != -1)
	{
		//next_quote();
	}
	else
	{
		//cur_quote++;
	}
	next_quote();
  //setTimeout("quote_timer();", 5000);
}

function next_quote()
{	
	
	//if ( typeof QUOTES[cur_quote] == 'undefined' )
	//{
	//	alert("in");
	//	cur_quote = 0;
	//}
	if (QUOTES.length-1 == cur_quote)
	{
		//alert("in");
		cur_quote=0;
	}
//	alert(cur_quote);
//	alert(QUOTES.length);
	swap_quote();
}

function swap_quote()
{
	//$("#quote").fadeOut("fast");		
	setTimeout("show_quote();", 500);
	cur_quote++;
}

function show_quote()
{
	//document.getElementById('auth-img2').src = QUOTES[cur_quote][3];
	//$("#auth-who").html(unescape(QUOTES[cur_quote][0]));
	//$("#auth-info").html(unescape(QUOTES[cur_quote][1]));
	//$("#the-quote").html(unescape(QUOTES[cur_quote][2]));
	//$("#quote").fadeIn("fast");



 document.getElementById('auth-img2').src = QUOTES[cur_quote][3];	
  document.getElementById('auth-about2').innerHTML = unescape(QUOTES[cur_quote][0])
   document.getElementById('auth-who2').innerHTML = unescape(QUOTES[cur_quote][1])
   document.getElementById('the-quote').innerHTML = unescape(QUOTES[cur_quote][2])
   
   setTimeout("quote_timer();", 5000);
 

}


function last_quote()
{
	cur_quote--;
	if ( typeof QUOTES[cur_quote] == 'undefined' )
		cur_quote = QUOTES.length-1;
	swap_quote();
}

/*


function quote_timer()
{

	if ( typeof SLIDES == 'undefined' || typeof SLIDES[0] == 'undefined')
	{
		$("#slide-show-container").css('display','none');
		return false;
	}

	next_image();
	setTimeout("quote_timer();", 5000);
}

function next_image()
{
	cur_quote++;
	if ( typeof SLIDES[cur_slide] == 'undefined' )
		cur_quote = 0;
	swap_image();
}

function last_image()
{
	cur_quote--;
	if ( typeof SLIDES[cur_quote] == 'undefined' )
		cur_quote = SLIDES.length-1;
	swap_image();
}

function swap_image()
{
	$("#quote").fadeOut("fast");		
	setTimeout("show_image();", 500);
}

function show_image()
{
	document.getElementById('slide-pic').src = SLIDES[cur_slide][1];
	$("#person").html(SLIDES[cur_slide][2]);
	$("#carbon-saved").html('Carbon saved '+SLIDES[cur_slide][3]);
	$("#num-cars").html('Cars off the road '+SLIDES[cur_slide][4]);
	$("#slide").fadeIn("fast");
}

*/