// JavaScript Document

function pdfIndicator() {
	$('a').each(function(){
		href=$(this).attr('href');
		if (href.substring((href.length-3),href.length)=='pdf') {
			$(this).addClass('pdf');
			$(this).attr('title','Download PDF document.');
		}
	});
}

function initCycles() {
	$('div.splash').each(function(index){
		cycleid='cycle_'+index;
		$(this).attr('id',cycleid);
		if ($(this).children('.splash_controls').length>0) {
			$(this).children('.splash_controls').append('<a id="left_link" href="#">Previous</a><a id="right_link" href="#">Next</a>').hide();
			$('div#'+cycleid).hover(function(){
				$(this).find('div.splash_controls').fadeIn('slow');
			},function(){
				$(this).find('div.splash_controls').fadeOut('slow');
			});
		}
		$(this).children('div.cycle').cycle({
			fx:			'scrollHorz',
			speed:		1500,
			timeout:	10000,
			next:		'#right_link',
			prev:		'#left_link'
		});
		
	});
		
}

$(function(){
	pdfIndicator();
	initCycles();
});