/*
*  CCMS Website: www.chchmusic.co.uk
*
*  JavaScript behaviour using the jQuery library (www.jquery.com)
*/
var expandText="Click to expand this section";
var collapseText="Click to collapse this section";
var hideColour="#ba1616";
var showColour="#106112";
$(document).ready(function(){

// Tell links that appear to be external to open in a new window:
 $("a[href^=http://www],a[@href^=https://www]").attr("target", "_blank");


// Add the Wikipedia-style "external" link image to (text) links that open in a new window:
  $("img").parent("a").addClass("no_decoration");
  $("a[target=_blank]:not(.no_decoration):not(.e_gc)").addClass("external");

// Copy image alt text to image titles:
 $("img[alt]:not([@title])").attr("title", function() { return this.alt; });

// Colour alternate rows of tables:
 $("#organ tr:even,#committee .tdr:even,table.standard tr:even").css("background-color", "#fff");
 $("#organ tr:odd,#committee .tdr:odd,table.standard tr:odd").css("background-color", "#efefef");

 $(".hide").hide();
 $(".rm").remove();

});
function notices(){
   $("#notices h2").css("cursor", "pointer").html("Notices <img src=\"images/ajax-loader3.gif\" alt=\"Loading...\" style=\"position:absolute;right:2pt;top:3pt;\">");
   setTimeout('$("#notices h2").next("div").load("code/notices.php")', 1000);
   setTimeout('$("#notices h2").html("Notices");', 1000);
}
/*
*  THE FOLLOWING CODE IS BY AARON SCHMIDT
*  http://www.learningjquery.com/2007/09/animated-scrolling-with-jquery-12
*/
jQuery.fn.extend({
  ScrollTo : function(speed, easing) {
    return this.each(function() {
      var targetOffset = $(this).offset().top;
      $('html,body').animate({scrollTop: targetOffset}, speed, easing);
    });
  }
});