//////////////////////////////////////////////////////
//
//	The purpose of this file is to
//	apply a hover class on mouseover
//	on the <li> elements in the nav.
//	This is because IE doesn't put
//	the pseudo class :hover on <li> elements
//
//	This is code that uses the
//	jquery javascript library (http://jquery.com/)
//
//////////////////////////////////////////////////////

$(document).ready(function(){
	$("ul.navtop").superfish({
			hoverClass	: "hover",
			delay: 100,
			animation : { opacity:"show", height:"show" },
			speed		: "normal"
		});
});
$(window).load(function() {

	
		
	


	$('#home_section_photos li a, #mainNav li a').each(function(){
		var img = $(this).children('img')[0];
		var w =  img.width;
		var h =  img.height;
		var screen = $(this).append('<div class="screen" style="width: ' + w + 'px;height: ' + h +  'px;"></div>');
		//fade screen out for IE
		$(this).children('.screen').fadeTo(0,0);
		$(this).hover(function(){
			$(this).children('.screen').fadeTo('slow',0.55);
		}, function(){
			$(this).children('.screen').fadeTo('slow', 0);
		});
	});
	
	if($('#imageNav li a').length > 0)
		$('#imageHolder').load($('#imageNav li a')[0].href + ' .content p' );
	$('#imageNav li a').hover(function(){
		$('#imageHolder').load(this.href + ' .content p' );
	}, function(){});
	$('#imageNav li a').click(function(){
		return false;
	});

	/*(if (document.all&&document.getElementById) {
		// this is needed for the IE 6 pseudo hover class bug
		$(".navtop > li").hover(function() {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
		});
		
		$(".navtop > li li ").hover(
		function () {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
			
		});
		
		
	} else {
		// this is need for safari when nav covers flash
		$(".navtop li ul").mouseover(function () {
			$(this).addClass("redraw");
		});
		$(".navtop li ul").mouseout(function () {
			$(this).removeClass("redraw");
		});
	}*/
});
