




$(document).ready(function(){

//Dropdown Navigation
						   

	
//Flow Player
/*
if ($('#player1').length !== 0){
	// setup player without "internal" playlists
	$f("player1", "http://yankee.sierrabravo.net/~jward/TEEL/teel/assets/media/vids/flowplayer-3.2.2.swf", {
		clip: {baseUrl: 'http://yankee.sierrabravo.net/~jward/TEEL/teel/assets/media/vids/'} 
		
	// use playlist plugin. again loop is true
	}).playlist("div.petrol", {loop:true});
};
*/

//Home Page Slideshow

	$('#slideshow').cycle({
        fx: 'fade',
        speed: 'fast',
        timeout: 6000,
        pager: '#nav',
        pagerAnchorBuilder: function (idx, slide) {
            // return sel string for existing anchor
            return '#nav li:eq(' + (idx) + ') a';
        },
        before: function(currSlideElement, nextSlideElement, options, forwardFlag) {
            var index = $(this).index();
            var tab = $('#nav li:eq('+ index +')');
            tab.find('a').addClass('activeSlideCustom');
        },
        after: function(currSlideElement, nextSlideElement, options, forwardFlag) {
            var index = $(this).index();
            var tab = $('#nav li:eq('+ index +')');
            
            if( tab.is(':visible') )
            {
                last_active_slide = tab;
                tab.siblings('li').find('a').removeClass('activeSlideCustom');
            }
            else
            {
                last_active_slide.find('a').addClass('activeSlideCustom');
            }
        }
    });

    $('#nav a').click(function () {
        $('#slideshow').cycle('pause');
    });

	$('#direct').click(function () {
        $('#nav li:eq(2) a').triggerHandler('click');
        return false;
    });
});
