// More / Hide Effect

$(document).ready(function() {
 // hides all objects with class of "more" as soon as the DOM is ready
 // (a little sooner than page load)
  $('.more').hide();

 // shows the n-more on clicking the noted link
  $('.show').click(function() {
	$(this).parent().hide();
	$(this).parent().next('.more').fadeIn('slow');
	return false;
  });
});

// OLD More / Hide Effect for Legacy Support

// This script should be fixed to generically pick n-more elements, rather than specifically and redundantly.

$(document).ready(function() {
 // hides n-more content as soon as the DOM is ready
 // (a little sooner than page load)
  $('#1-more').hide();
  $('#2-more').hide();
  $('#3-more').hide();
  $('#4-more').hide();
  $('#5-more').hide();
  $('#6-more').hide();

 // shows the n-more on clicking the noted link
  $('a#1-show').click(function() {
	$('#1-show').hide();
	$('#1-more').fadeIn('slow');
	return false;
  });
  $('a#2-show').click(function() {
	$('#2-show').hide();
	$('#2-more').fadeIn('slow');
	return false;
  });
  $('a#3-show').click(function() {
	$('#3-show').hide();
	$('#3-more').fadeIn('slow');
	return false;
  });
  $('a#4-show').click(function() {
	$('#4-show').hide();
	$('#4-more').fadeIn('slow');
	return false;
  });
  $('a#5-show').click(function() {
	$('#5-show').hide();
	$('#5-more').fadeIn('slow');
	return false;
  });
  $('a#6-show').click(function() {
	$('#6-show').hide();
	$('#6-more').fadeIn('slow');
	return false;
  });
});

// Highlight Effect

$(document).ready(function(){
    
  $(".note").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}, 1000, function() {
		  $(".notelegend").animate({"backgroundColor": "#E8FF97"}, 50, function() {
			  $(".notelegend").animate({"backgroundColor": "white"}, 1000);
		  });
		  
        });
	  }
	}
	return false;
  });

});

// Sponsors Rotator

$(document).ready(function() {
	$('#sponsors').cycle({ 
		fx: 'fade',
		pause: 1,
		random:  1,
		timeout: 6000
	});
});