// JavaScript Document
$(document).ready(function(){

   jQuery().hideAllExcept.init();


   $("a").hover(function(){
	$(this).parents("h3").removeClass("contactBttn");
	$(this).parents("h3").addClass("contactBttnHL");
    },function(){
    $(this).parents("h3").removeClass("contactBttnHL");
	$(this).parents("h3").addClass("contactBttn");
   });

});

jQuery.fn.hideAllExcept = {
    init: function() {
        var hash = window.location.hash;

        (!hash) ?  
            jQuery().hideAllExcept.hideShow('#' + jQuery('#swapThis > div:first').attr('id')) 
                : jQuery().hideAllExcept.hideShow(window.location.hash);

        jQuery('a.swap').mouseover(function() {
            var href = jQuery(this).attr('href');
            jQuery().hideAllExcept.hideShow(href);
            return false; // prevents the window from scrolling to the anchor
        });
        
    },
    hideShow: function(el) {
        jQuery(el).removeClass('hide').siblings().addClass('hide');
    
        jQuery('a.swap').removeClass('active');
        jQuery('a[href="' + el + '"]').addClass('active');
    }
}

