// custom jquery for PFRA
$(function(){
    $('a[rel=external]').attr('target','_blank');  
});


/* quote rotation timer */
function rotateQuotes( element ) {
	t = setTimeout( "changeQuote("+ element +")", timer );
}


/* change the quote text on the front page with fade */
function changeQuote( element ) {

	if( element==quoteBank.length )
		element = 0;
		
	$('div.didyouknow').find('blockquote.ontop').fadeOut("slow", function() {				
			$('blockquote.ontop').html(quoteBank[ element ]); 
			$('blockquote.ontop').fadeIn("slow");  
    });
	nextelement = element+1; 
	rotateQuotes( nextelement ); 
}

    /* rotation timer */
    timer = 3000; // 3 seconds

    /* handle the quotes for the front page and rotate....*/
    quoteBank = new Array(); var j=0; 
	
    $('div.didyouknow').find('blockquote.quotebank').each(function (i) {
			quoteBank[j] = $(this).html(); 
			j++;
    });
	
	if( quoteBank.length > 1 )
		rotateQuotes( 0 ); 


