

function showSubMenu() {
	
	$('div.subnav').slideUp('fast');
		
	$(this).children('div.subnav').stop().slideDown('fast');
	
}

function hideSubMenu() {
	
	
	$(this).children('div.subnav').slideUp('fast');
	
}

$(document).ready (function() {
	
	
	//hide the ajax loader the ajax loader
	
	$("#submit").click( function(){
		
		$("#load").show().fadeIn(500);
		
	});
	
	$("#submit-footer").click( function(){
		
		$("#load-footer").show().fadeIn(500);
		
	});
	
	$("#submit-sidebar").click( function(){
		
		$("#load-sidebar").show().fadeIn(500);
		
	});
		
	// add news archive link to the footer whats new
		
	$("#home-subfooter .addlink p").append(' | <a href="/news" class="newsarchive">News Archive</a>');
	
	$("#footer .addlink p").append(' | <a href="/news" class="newsarchive">News Archive</a>');

	//initialized image slider on homepage
	
	if ($('#slideshow').length > 0)
	{
		
		$('#slideshow').cycle({
			fx: 'fade',
			cleartype: true,
			cleartypeNoBg: true,
			startingSlide: 0,  // start on the slide that was in the markup
			timeout:  6000,
			speed:    900,
			prev:    '#prev',
			next:    '#next',
			after:     function() {
				$('#caption').html(this.alt);
				Cufon.refresh('.title1');
				Cufon.refresh('.title2');
			}
		});
		
	}
	
	if ($('#gallery-images').length > 0)
	{
		
		$('#gallery-images').cycle({
			fx: 'fade',
			timeout:  6000,
			speed:    900
		});
		
	}
		
	$('#menu li:last-child').css('margin-right',0);
	
	$('#menu li.parent').hoverIntent({
		over: showSubMenu, 
		timeout: 500, 
		out: hideSubMenu,
		interval: 0,
		sensitivity: 1
	});

		
});

Shadowbox.init({
	language: 'en',
	players:  ['img', 'html', 'iframe', 'qt', 'wmp', 'swf', 'flv']
});
