/**
 * Javascript - jQuery enabled
 * 
 * @package WPFramework
 * @subpackage Media
 */

/* Example jQuery
jQuery(document).ready(function($) {
	alert('jQuery + screen.js is loaded and ready to go!');
});
*/

//Main Menu

jQuery(document).ready(function($) {	

	function showworksub() {
		$(this).animate({
			width: "310px"
		}, 300, 'easeInOutQuad', function () {
			$('.sub-menu',this).slideDown();
		});
	}
	
	function hideworksub() {
		$('.sub-menu',this).slideUp('normal', function () {
			$('#work-page-link').animate({
				width: "40px"
			}, 300, 'easeInOutQuad' );
		}); 
	}
	
	function showaboutsub() {
		$(this).animate({
			width: "180px"
		}, 300, 'easeInOutQuad', function () {
			$('.sub-menu',this).slideDown();
		});
	}
	
	function hideaboutsub() {
		$('.sub-menu',this).slideUp('normal', function () {
			$('#about-page-link').animate({
				width: "50px"
			}, 300, 'easeInOutQuad' );
		}); 
	}
	
	function showblogsub() { 
		$(this).animate({
			width: "205px"
		}, 300, 'easeInOutQuad', function () {
			$('.sub-menu',this).slideDown();
		});
	}
	
	function hideblogsub() {
		$('.sub-menu',this).slideUp('normal', function () {
			$('#blog-page-link').animate({
				width: "40px"
			}, 300, 'easeInOutQuad' );
		}); 
	}
	
	// Work Menu		
	$('.home #work-page-link').hoverIntent({
		over: showworksub, 
		timeout: 250, 
		out: hideworksub
	});
	
	$('.page #work-page-link').hoverIntent({
		over: showworksub, 
		timeout: 250, 
		out: hideworksub
	});
	
	$('.category-blog #work-page-link').hoverIntent({
		over: showworksub, 
		timeout: 250, 
		out: hideworksub
	});
	
	$('.category-uncategorized #work-page-link').hoverIntent({
		over: showworksub, 
		timeout: 500, 
		out: hideworksub
	});
	
	$('.s-category-announcement #work-page-link').hoverIntent({
		over: showworksub, 
		timeout: 500, 
		out: hideworksub
	});
	
	$('.error404 #work-page-link').hoverIntent({
		over: showworksub, 
		timeout: 250, 
		out: hideworksub
	});
		
	// Blog Menu	
	$('.home #blog-page-link').hoverIntent({
		over: showblogsub, 
		timeout: 500, 
		out: hideblogsub
	});
	
	$('.page #blog-page-link').hoverIntent({
		over: showblogsub, 
		timeout: 500, 
		out: hideblogsub
	});

	$('.category-work #blog-page-link').hoverIntent({
		over: showblogsub, 
		timeout: 250, 
		out: hideblogsub
	});
	
	$('.category-uncategorized #blog-page-link').hoverIntent({
		over: showblogsub, 
		timeout: 250, 
		out: hideblogsub
	});
	
	$('.s-category-announcement #blog-page-link').hoverIntent({
		over: showblogsub, 
		timeout: 250, 
		out: hideblogsub
	});
	
	$('.error404 #blog-page-link').hoverIntent({
		over: showblogsub, 
		timeout: 250, 
		out: hideblogsub
	});
	
	// About Page Menu
	/*
$('.home #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 500, 
		out: hideaboutsub
	});	
	
	$('.pageid-10 #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 500, 
		out: hideaboutsub
	});
	
	$('.pageid-26 #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 500, 
		out: hideaboutsub
	});
	
	$('.category #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 250, 
		out: hideaboutsub
	});
	
	$('.category-uncategorized #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 250, 
		out: hideaboutsub
	});
	
	$('.s-category-work #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 250, 
		out: hideaboutsub
	});
	
	$('.s-category-blog #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 250, 
		out: hideaboutsub
	});
	
	$('.s-category-announcement #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 250, 
		out: hideaboutsub
	});
	
	$('.error404 #about-page-link').hoverIntent({
		over: showaboutsub, 
		timeout: 250, 
		out: hideaboutsub
	});
*/
	
	//Feature Slideshow
	$('#feature-list').nivoSlider({
		effect:'fade',
		slices:10,
		animSpeed:500,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
	});
	
	/*
	$('#feature-list').cycle({
		prev:   '#feature-prev', 
    	next:   '#feature-next',
		pause:	1	// true to enable "pause on hover"
	});
	*/
	
	$('.feature-item').hoverIntent(
	function () {
		$('.feature-info',this).fadeIn('fast');
	},
	function () {
		$('.feature-info',this).fadeOut('fast');
	});
	
	/*
	$('#feature-list-wrapper').hoverIntent(
	function () {
		$('#slide-control').fadeIn('fast');
	},
	function () {
		$('#slide-control').fadeOut('fast');
	});

	$('.s-category-work .post').hoverIntent(
	function () {
		$('#slide-control').fadeIn('fast');
	},
	function () {
		$('#slide-control').fadeOut('fast');
	});
	*/
	
	//Work Page
	/*
	$('.s-category-work .entry-content p').cycle({
		prev:   '#feature-prev', 
    	next:   '#feature-next',
		pause:	1	// true to enable "pause on hover"
	});
	*/
	
	$('.s-category-work .entry-content p:first-child').nivoSlider({
		effect:'fade',
		slices:10,
		animSpeed:500,
		pauseTime:3000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNavThumbs:true, //Use thumbnails for Control Nav
		controlNavThumbsReplace: '-125x125.jpg',
		pauseOnHover:true
	});
	
	//idTabs
	$('.idTabs').idTabs('!mouseover');
				
});