
$(document).ready(function() {	  

function addMega(){  
      $(this).addClass("hovering");
      }  
function removeMega(){  
      $(this).removeClass("hovering");  
      }  
	  
var megaConfig = {  
    interval: 0,  
    sensitivity: 4,
	over: addMega, 
	timeout: 0,  
	out: removeMega  
}; 

$("li.mega").hoverIntent(megaConfig) 

/*

	var imgWrapper = $('.slideshow_slide > div');
	// only show the first image, hide the rest
	imgWrapper.hide().filter(':first').show();

	$('ul.recentlist li a').click(function () {

		// check if this item doesn't have class "current"
		// if it has class "current" it must not execute the script again
		if (this.className.indexOf('current') == -1){
			imgWrapper.hide();
			imgWrapper.filter(this.hash).fadeIn(500);
			$('ul.recentlist li a').removeClass('current');
			$(this).addClass('current');
		}
		return false;
	});

	
		$(".slideshow_slide").cycle({
			fx: 'fade',
			pause: 1,
			prev: '#slideshow_prev',
			next: '#slideshow_next'
		});

*/

		/*$(".slideshow_slide").cycle({
			fx: 'fade',
			speed: 500,
			pause: 1,
			timeout: 4000,
			//prev: '#slideshow_prev',
			//next: '#slideshow_next',
			pager: '#nav',
			
		});*/
		






// set up the slideshow
$('#gallerySlides')
.cycle({
    fx:     'fade',
    speed:  880,
    timeout: 5500,
    pager:  '#galleryNav'
    });
	
// stop the slideshow with any nav link clicked
/*$('#galleryNavWrap').not('.stopped').find('a').click(function(){
$('#gallerySlides').cycle('pause');
$('#galleryNavWrap').addClass('stopped');
return false;
});*/


// next arrow
 $('a#nav1').click(function(){
 var nextClick = $('#galleryNav a.activeSlide').next('a');
 $(nextClick).click();

 return false;
 })
// back arrow
 $('a#nav0').click(function(){
 var prevClick = $('#galleryNav a.activeSlide').prev('a');
 $(prevClick).click();

 return false;
 })
//end jQuery


		

});
