$(document).ready(function(){
	$('#nav ul li.pri-nav').hoverIntent(
		function () {
				$('#nav ul li a.picture img:visible').not($(this).children('a.picture').children('img')).hide();
				$('#nav ul li ul:visible').not($(this).children('ul')).hide();
				$(this).children('a.picture').children('img:hidden').show( 'slide', {direction: 'down'}, 100 );
				$(this).children('ul:hidden').show('blind', 100);
		}, 
		function () {
			$('#nav ul li a.picture').children('img').hide();
			$(this).children('ul').hide();
		}
	);
	
	if(navigator.platform == "iPhone" || navigator.platform == "iPad") {
		$('li.active-nav').children('a.picture').children('img').show( 'slide', {direction: 'down'}, 100 );
		$('li.active-nav').siblings().children('a.picture').children('img').hide();
		$('li.active-nav').children('ul').show('blind', 100);
    }
	
	$('.video a').hover(
		function () {
			$(this).children('div').fadeIn();
		},
		function () {
			$(this).children('div').hide();
		}
	);
	
	$(".pages").scrollable({
		next: '.next',
		prev: '.prev',
		speed: 750, //adjust in milliseconds
		easing: 'swing', //can be 'swing' or 'linear',
		keyboard: false
	});
});

$(document).ready(function() {
    $('#slider').nivoSlider({
        effect:'sliceDown', 
        animSpeed:500, // Slide transition speed
        pauseTime:3000, // How long each slide will show
        directionNav:true, // Next & Prev navigation
        prevText: '', // Prev directionNav text
        nextText: '', // Next directionNav text
    });

	$('#play-image').click(function(){
		$(this).hide();
		$('#hidden-video').show();
	});
});
