// JavaScript Document

function formatText(index, panel) {

    		  return index + "";

    	  }; 

$(function () {

	$('body').addClass('js-active'); // Activate JS Specific CSS

	$('.anythingSlider').anythingSlider({

                easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin

                autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.

                delay: 6000,                    // How long between slide transitions in AutoPlay mode

                startStopped: false,            // If autoPlay is on, this can force it to start stopped

                animationTime: 600,             // How long the slide transition takes

                hashTags: true,                 // Should links change the hashtag in the URL?

                buildNavigation: false,          // If true, builds and list of anchor links to link to each slide

            		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover

            		startText: "Play",                // Start text

    		        stopText: "Stop",               // Stop text

    		        navigationFormatter: formatText // Details at the top of the file on this use (advanced use)

    });

            

    $("a.station").click(function(e){

          $('.anythingSlider').anythingSlider(1);

		  e.preventDefault();

    });

	$("a.pcc").click(function(e){

          $('.anythingSlider').anythingSlider(2);

		  e.preventDefault();

    });

	$("a.street").click(function(e){

          $('.anythingSlider').anythingSlider(3);

		  e.preventDefault();

    });

	$("a.underground").click(function(e){

          $('.anythingSlider').anythingSlider(4);

		  e.preventDefault();

    });

	

	//Configure the HoverIntent Parameters

	var config = {

		sensitivity: 1, // number = sensitivity threshold (must be 1 or higher)

		interval: 50, // number = milliseconds for onMouseOver polling interval

		over: doOpen, // function = onMouseOver callback (REQUIRED)

		timeout: 50, // number = milliseconds delay before onMouseOut

		out: doClose // function = onMouseOut callback (REQUIRED)

	}; 

	function doOpen() {

		$(this).addClass('hover');

        	$('ul:first',this).slideDown('fast', function(){

				$(this).parent().addClass("active");										

		});

	}

	function doClose() {

		$(this).removeClass("hover");

        $('ul:first',this).slideUp('fast', function(){

				$(this).parent().removeClass("active");										

		});  

	}

	

    $('#globalNav li').hoverIntent(config);

	$('li:last-child').addClass('last');

	$('.project-gallery a').lightBox({fixedNavigation:true});
	$('.project-gallery-before a').lightBox({fixedNavigation:true});
	$('.project-gallery-after a').lightBox({fixedNavigation:true});



});
