$(function(){

/* menu animation ****/

	$('#header #nav ul li').hover(function(){
	
		$(this).css('cursor','default');
		
		$(this).find('ul.submenu').css('display','block').css('z-index', '99');
	},function () {
		$(this).find('ul.submenu').css('display','none').css('z-index','1');
	});
	
	
	/*
	$hover = 0;
	
	$('#nav').css('height','0px').css('min-height','0px');
	$('.submenu').css('display','none');
	
	$('#nav').hover(function(){
		$('#nav').animate({height: '115px'}, 300,'easeOutCirc');
		$('.submenu').animate({height: '115px', display:'block'}, 	300,'easeOutCirc');	
		$hover = 1;
		
	
	}, function(){
		t = setTimeout(fadeUP, 2000);
		$hover = 0;		
			
	});
		
	
	function fadeUP(){
	
		if($hover == '0'){
		$('#nav').animate({height: '0px'}, 600,'easeInCirc');
		$('.submenu').animate({height: '0px', display:'none'}, 600,'easeInCirc');	
		}
	}
	
	*/
	
	$('.slideshow').cycle();
	
	$('.submenu a').click(function(){
	
		$title = $(this).html();
		if($title == 'Shop'){ 
			window.open('http://kinetica-museum.org/store2/index.php?cPath=73');
			return false;
		}
	});
	
	$('#share').live('click', function(){
		$('#footerShare').animate({bottom:'40px'}, 500, 'easeInCirc');
		$('#footerShareInner').animate({height:'40px'}, 500, 'easeInCirc');
		
		$(this).html('<a href="#" id="closeShare">Close</a>');
		return false;
	});
	
	$('#closeShare').live('click', function(){
		$('#footerShare').animate({bottom:'0px'}, 500, 'easeInCirc');
		$('#footerShareInner').animate({height:'0px'}, 500, 'easeInCirc');
		
		$(this).html('<a href="#" id="share">Share</a>');
		return false;
	});

});
