// JavaScript Document
$(document).ready(function() {
	
	$('#slideshow').after('<div id="nav" class="nav">Go to page:</div>').cycle({
        fx:     'fade',
        speed:  'slow',
        timeout: 6000,
        pager:  '#nav',
		pause:1
    });
	
	$('#nav a').click(function () {
		// I stop the slideshow as the user wants to manually click through pages
		$('#slideshow').cycle('pause');
	});

	function addMega(){
        $(this).addClass("hovering");
    }

    function removeMega(){
    $(this).removeClass("hovering");
    }

    var megaConfig = {
         interval: 100,
         sensitivity: 4,
         over: addMega,
         timeout: 300,
         out: removeMega
    };

    $("li.mega").hoverIntent(megaConfig)
	
});
