$(document).ready(function(){
		var loc = window.location.toString().split("/")
    	loc = loc[loc.length - 1]
    	$(".nav a[href=\""+loc+"\"]").addClass("on"); //adds the on class to top links
		
		$("#moreList tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");});
		$('a:not(.pdf)[target=_blank]').after(" <img class='externalURL' src='images/icon_externalURL.gif' />");
		
		//Default Action
		$(".tab_content").hide(); //Hide all content
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content

		//On Click Event
		$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	}); 
	
		$(".toggle_container").hide();
 
		$("h2.trigger").toggle(function(){
			$(this).addClass("active"); 
			}, function () {
			$(this).removeClass("active");
		});
	
		$("h2.trigger").click(function(){
		$(this).next(".toggle_container").slideToggle("fast");
	});
});

$(function() {
    $('#slideshow').cycle({
        fx:       'fade',
		prev:   '#prev', 
    	next:   '#next',
        timeout:   0,
        after:    function() {
            $('#caption').html(this.alt);
        }
    });
	
	$('#slideshow2').cycle({
        fx:       'fade',
		prev:   '#prev2', 
    	next:   '#next2', 
		timeout: 	0,
		after:     function() {
            $('#caption2').html(this.alt);
        }
    });
	$('#slideshow3').cycle({
        fx:       'fade',
		prev:   '#prev3', 
    	next:   '#next3', 
        timeout:   0,
        after:     function() {
            $('#caption3').html(this.alt);
        }
    });
	$('#slideshow4').cycle({
        fx:       'fade',
		prev:   '#prev4', 
    	next:   '#next4', 
        timeout:   0,
        after:     function() {
            $('#caption4').html(this.alt);
        }
    });
	$('#slideshow5').cycle({
        fx:       'fade',
		prev:   '#prev5', 
    	next:   '#next5', 
        timeout:   0,
        after:     function() {
            $('#caption5').html(this.alt);
        }
    });
	$('#slideshow6').cycle({
        fx:       'fade',
		prev:   '#prev6', 
    	next:   '#next6', 
        timeout:   0,
        after:     function() {
            $('#caption6').html(this.alt);
        }
    });
});
