/* JAVASCRIPT */

/* Function for initiating the dropdown navs. Make sure to call this function properly below in onload handler */
function initNavs(which) {
	$(which).find('li ul').each(function(){
		$(this).parent().find('a:first').addClass('parent');
		var busy=0;
		$(this).parent().hover(function(){
			if (busy==0) {
				busy=1;
				$(this).addClass('over');
				$(this).find('ul:first').fadeIn("fast",function(){busy=0;});
			}
		},function(){
			if (busy==0) {
				$(this).removeClass('over');
				$(this).find('ul:first').fadeOut("fast");
			}
		});
	});
}

function initSplash() {
	$("div#splash_images").cycle({timeout: 4000, pause:true, pager:'div#splash_controls'});
	$("#splash_controls").css('opacity','0.3');
	$("#splash_holder").hover(function(){
		$("#splash_controls").fadeTo("normal", 0.9);
	},function(){
		$("#splash_controls").fadeTo("normal", 0.3);
	});
}

/* This specifies what happens when the page loads. Call all functions that need to initiate behavior here. */
$(function(){
	initNavs('ul#nav_list');
	initSplash();
});
