// JavaScript Document
$(document).ready(function(){
						   
		centerCredits();
		
		//loading bar
		//$('#content').append('<img class="loadBar" src="css/img/loader.gif" alt="Loading...">');
		
		$('#navBar li a').click(function(){
				$('#mid').html('<p>Loading content....<br /><img class="loadBar" src="css/img/loader.gif"></p>');
			});
		
		$('.navHome a').click(function(){
			$('#mid').load('page/index.phtml',function(){$('#content').removeClass('loading')});
			$('body').removeClass().addClass('home');
			return false;
		});
		$('.navBio a').click(function(){	
			$('#mid').load('page/bio.phtml',function(){$('#content').removeClass('loading')});
			$('body').removeClass().addClass('bio');
			return false;
		});
		$('.navStore a').click(function(){	
			$('#mid').load('page/store.php',function(){$('#content').removeClass('loading')});
			$('body').removeClass().addClass('store');
			return false;
		});
		$('.navVideo a').click(function(){	
			$('#mid').load('page/video.phtml',function(){$('#content').removeClass('loading')});
			$('body').removeClass().addClass('video');
			return false;
		});
		$('.navContact a').click(function(){	
			$('#mid').load('page/contact.php',function(){$('#content').removeClass('loading')});
			$('body').removeClass().addClass('contact');
			return false;
		});
		
		//store table hover
		$('.storeTbl tbody tr').hover(
			function(){$(this).addClass('hover')},
			function(){$(this).removeClass('hover')}
		);
		

});

//center the credits
function centerCredits(){
var wrapTopMargin;
var windowHeight = $(window).height();
var wrapperHeight = $('#credits').height();

if(wrapperHeight > windowHeight){
	wrapTopMargin = 10;
}else{
	wrapTopMargin = (windowHeight - wrapperHeight)/2;
}
//set the wrapper top margin 
$('#credits').css({"margin-top":wrapTopMargin});
}
//end centerWrapper()