// ZEBRA STRIPES FOR TABLES////////////////////////

$(document).ready(function(){
	$(".stripeMe tr").mouseover(function() {$(this).addClass("over");}).mouseout(function() {$(this).removeClass("over");});
	$(".stripeMe tr:even").addClass("alt");
});

// SUB NAV DROPDOWN MENU////////////////////////

$(document).ready(function(){
	
	$(".page_item ul").hide();
	$(".current_page_item ul:first").slideDown();
	$(".current_page_item").parents("ul, li")
	
	.map(function () {
		$(this).show();
	});
	
});


// SPOTLIGHT SLIDER////////////////////////

$(document).ready(function(){

	$('#spotthumbs a:first').addClass('selected'); 
    $('#spotthumbs a').click(function(){
        
        // GET THE CURRENT URL
        var url = $(this).attr('href');
        
        $('#spotthumbs a').each(function()
        {
        	// REMOVE CLASS
    		$(this).removeClass('selected');
    		
    		// ADD CLASS ON SELECTED
    		if (url == $(this).attr('href'))
    		{
				$(this).addClass('selected');     
   			}
    	});

        // Show Loading div
        $('.loading').fadeTo(200, 1);

        // load in div from page
        $('.spotlight .loader').load(url + ' .flex', function(){
            // Once content has loaded, hide loading div
            $('.loading').fadeTo(500, 0);

            // Show loader div (loaded content)
            $('.spotlight .loader').fadeTo(500, 1);
        });
    // return false so the link doesnt redirect the browser
    return false;
    });
});
