

/*
// Intialize Galleria
$('#gallery').galleria({
	autoplay: 8000,
	transition:'fade',
	transitionSpeed:'600',
	thumbnails: false,
	imageTimeout: 90000,
	showInfo: false
});*/



// Toggle content off/ on on icon click
$('.gallery_cover').toggle(
	function() {
		$("#content").stop().delay(10).animate({opacity: 0}, 800 );
		$("#detail_header").stop().delay(10).animate({opacity: 0}, 800 );
		
		$("#nav_main_on").stop().delay(300).animate({opacity: 0}, 800 );
		$("#nav_main_off").stop().delay(300).animate({opacity: 0}, 800 );
		$("#nav_sub_on").stop().delay(150).animate({opacity: 0}, 800 );
		$("#nav_sub_off").stop().delay(150).animate({opacity: 0}, 800 );
		
		$("#footer").stop().delay(300).animate({opacity: 0}, 800 );
		$("#tagline").stop().delay(300).animate({opacity: 0}, 800 );
		$("#search").stop().delay(300).animate({opacity: 0}, 800 );
		$("#news_next").stop().delay(300).animate({opacity: 0}, 800 );
	},
	function() {
		$("#content").stop().delay(300).animate({opacity: 1}, 800 );
		$("#detail_header").stop().delay(300).animate({opacity: 1}, 800 );
		
		$("#nav_main_on").stop().animate({opacity: 1}, 800 );
		$("#nav_main_off").stop().animate({opacity: 1}, 800 );
		$("#nav_sub_on").stop().delay(150).animate({opacity: 1}, 800 );
		$("#nav_sub_off").stop().delay(150).animate({opacity: 1}, 800 );
		
		$("#footer").stop().delay(300).animate({opacity: 1}, 800 );
		$("#tagline").stop().delay(300).animate({opacity: 1}, 800 );
		$("#search").stop().delay(300).animate({opacity: 1}, 800 );
		$("#news_next").stop().delay(300).animate({opacity: 1}, 800 );
	}
);


// Toggle content off/ on on icon click
$('.galleria-image-nav-icon-over').toggle(
	function() {
		$("#content").stop().delay(10).animate({opacity: 0}, 800 );
		$("#detail_header").stop().delay(10).animate({opacity: 0}, 800 );
		
		$("#nav_main_on").stop().delay(300).animate({opacity: 0}, 800 );
		$("#nav_main_off").stop().delay(300).animate({opacity: 0}, 800 );
		$("#nav_sub_on").stop().delay(150).animate({opacity: 0}, 800 );
		$("#nav_sub_off").stop().delay(150).animate({opacity: 0}, 800 );
		
		$("#footer").stop().delay(300).animate({opacity: 0}, 800 );
		$("#tagline").stop().delay(300).animate({opacity: 0}, 800 );
		$("#search").stop().delay(300).animate({opacity: 0}, 800 );
		$("#news_next").stop().delay(300).animate({opacity: 0}, 800 );
	},
	function() {
		$("#content").stop().delay(300).animate({opacity: 1}, 800 );
		$("#detail_header").stop().delay(300).animate({opacity: 1}, 800 );
		
		$("#nav_main_on").stop().animate({opacity: 1}, 800 );
		$("#nav_main_off").stop().animate({opacity: 1}, 800 );
		$("#nav_sub_on").stop().delay(150).animate({opacity: 1}, 800 );
		$("#nav_sub_off").stop().delay(150).animate({opacity: 1}, 800 );
		
		$("#footer").stop().delay(300).animate({opacity: 1}, 800 );
		$("#tagline").stop().delay(300).animate({opacity: 1}, 800 );
		$("#search").stop().delay(300).animate({opacity: 1}, 800 );
		$("#news_next").stop().delay(300).animate({opacity: 1}, 800 );
	}
);




// first make elements invisible					   
$("#gallery").css({ opacity:0 });
$("#detail_header").css({ opacity:0 });
$("#content").css({ opacity:0 });
$("#search").css({ opacity:0 });

// Fade gallery images on after page loads
$(document).ready(function() {
	$('#detail_header').css('display', 'block');
	$('#content').css('display', 'block');
	$('#search').css('display', 'block');
	
	$("#gallery").delay(100).animate({opacity: 1}, 200 );
	$("#detail_header").delay(600).animate({opacity: 1}, 1000 );
	$("#content").delay(600).animate({opacity: 1}, 400 );
	$("#search").delay(900).animate({opacity: 1}, 1000 );
	
	// IE form focus hack
	if (jQuery.browser.msie === true) {
        jQuery('input')
                .bind('focus', function() {
                        $(this).addClass('ieFocusHack');
                }).bind('blur', function() {
                        $(this).removeClass('ieFocusHack');
                });
    }
});
