$(document).ready(function () {
    $("#footerRows table table").hover(
		function () {
		    $(this).addClass("highlight");
		},
		function () {
		    $(this).removeClass("highlight");
		}
	)

    $(".swapImage").hover(
		function () {
		    this.src = this.src.replace("-0", "-1");
		},
		function () {
		    this.src = this.src.replace("-1", "-0");
		}
	);

    $(".bioSwap").hover(
		function () {
		    $(this).children("div").show();
		},
		function () {
		    $(this).children("div").hide();
		}
	);

    ShowHideSubNav();
    $("ul#topnav li").hover(
		function () { //Hover over event on list item
		    HideCurrentSubNav();
		    $(this).css({ 'background': '#b55105' }); //Add background color + image on hovered list item
		    $(this).find("span").show(); //Show the subnav
		},
		function () { //on hover out...
		    ShowHideSubNav();
		}
	);
    function HideCurrentSubNav() {
        $("ul#topnav li").each(function () {           
            if (window.location.toString().indexOf($(this).find("a").attr("href")) > -1) {
                $(this).css({ 'background': 'none' }); //Ditch the background
                $(this).find("span").hide(); //Hide the subnav
            }
        });
    }
    function ShowHideSubNav() {
        $("ul#topnav li").each(function () {
            if (window.location.toString().indexOf($(this).find("a").attr("href")) > -1) {
                $(this).css({ 'background': '#b55105' }); //Add background color + image on hovered list item
                $(this).find("span").show(); //Show the subnav
            } else {
                $(this).css({ 'background': 'none' }); //Ditch the background
                $(this).find("span").hide(); //Hide the subnav
            }
        });
    }

    $("ul#topnav li a").each(
		function () {
		    if (window.location.toString().indexOf(this.href) == 0) {
		        $(this).css({ 'background': '#781eb1' });
		    }
		});


    $('#randomizeBios .randomizeImage').shuffle()
});



	
$(window).load(function () { 
	$('.slide-out-feeds').tabSlideOut({
		tabHandle: '.handle',                     					//class of the element that will become your tab
		pathToTabImage: '/library/images/common/see-us-at-work.gif',//path to the image for the tab //Optionally can be set using css
		imageHeight: '162px',                     					//height of tab image           //Optionally can be set using css
		imageWidth: '37px',                       					//width of tab image            //Optionally can be set using css
		tabLocation: 'left',                      					//side of screen where tab lives, top, right, bottom, or left
		speed: 300,                               					//speed of animation
		action: 'click',                          					//options: 'click' or 'hover', action to trigger animation
		topPos: '180px',                          					//position from the top/ use if tabLocation is left or right
		leftPos: '20px',                          					//position from left/ use if tabLocation is bottom or top
		fixedPosition: false                      					//options: true makes it stick(fixed position) on scroll
	});
});
