// JavaScript Document
jQuery(function(){
	jQuery.preloadImages(
		"images/background/bg_white.png",
		"images/home/out/small.png",
		"images/home/out/large.png",
		"images/home/over/small.png",
		"images/home/over/large.png"
	);	
$("#navigation .content").css('display', 'none');

$("#navigation img.out").mouseover(function(){
	$("#navigation img.out").show();
	$(this).hide();
	$(this).parent().find('h2').css('visibility','hidden');
	$("div.content").css('display','none');
	$(this).next("div.content").fadeIn("slow");
});

$("#navigation .content").hover(function(){
},function(){
	$("#navigation img.out").show();
	$("#navigation img.out").parent().find('h2').css('visibility','visible');
	$("div.content").css('display','none');
});
		

$("#tagline").hover(function(){
	$(this).attr("src",$(this).attr("src").replace("/out/","/over/"));
},
function(){
	$(this).attr("src",$(this).attr("src").replace("/over/","/out/"));
});

jQuery.setNavigation();

$(window).bind('resize', function () { 
    jQuery.setNavigation();
});

});

(function($){
		$.setNavigation = function(){
			if($(window).height() > 700){
				$("#navigation").css("top", $(window).height() - 325);
				//$("#tagline").attr("src", $("#tagline").attr("src").replace("small.png","large.png"));
				//$("#tagline").css("margin-top", 50 + ($(window).height() - 700) / 2);
			}else{
				$("#navigation").removeAttr("style");
				//$("#tagline").removeAttr("style");
				//$("#tagline").attr("src", $("#tagline").attr("src").replace("large.png","small.png"));				
			}
			
			if($(window).height() > 800){
				$("#tagline").attr("src", $("#tagline").attr("src").replace("small.png","large.png"));
				$("#tagline").css("margin-top", 50 + ($(window).height() - 700) / 2);
			}else{
				$("#tagline").removeAttr("style");
				$("#tagline").attr("src", $("#tagline").attr("src").replace("large.png","small.png"));				
			}
			
		}	
})(jQuery);

