// fancy jQuery effects for NARSC


// hide slideshow until page loads to prevent leaking images
$(document).ready(function() { 
  $("#slider").show();
});

// members box
$(document).ready(function(){
		$('#footerBarInner ul li.membersLink a').click(function(){
			$("#memberBox").animate({'height':'360px','top':'-355px','border':'1px solid #000','border-bottom':'0','opacity':'1'}),
			$("#footerBarInner ul li.membersLink a, #footerBarInner ul li").css({'color':'#fff'});return false;
		});
		$('#memberBox div#closeBox a').click(function(){
			$("#memberBox").animate({'height':'1px','top':'4px'}).delay(40).animate({'border':'0','opacity':'0'},40),
			$("#footerBarInner ul li.membersLink a, #footerBarInner ul li").css({'color':'#428CE7'});return false;
		});
		
				
});


/* back to top scroll
$(function(){
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
        && location.hostname == this.hostname) {
            var $target = $(this.hash);
            $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                $('html,body').animate({scrollTop: targetOffset}, 0700);
                return false;
            }
        }
    });
}); */



// this controls the tab functionality

$(document).ready(function(){
	$('.tab').click(function () {

  // Remove the 'active' class from the active tab.
  $('#tabs_container > .tabs > li.active')
	  .removeClass('active');
	  
  // Add the 'active' class to the clicked tab.
  $(this).parent().addClass('active');
    
  // Remove the 'tab_contents_active' class from the visible tab contents.
  $('#tabs_container > .tab_contents_container > div.tab_contents_active')
	  .removeClass('tab_contents_active');
    
  // Add the 'tab_contents_active' class to the associated tab contents.
  $(this.rel).addClass('tab_contents_active');
    
 });
});




