//ACCORDION
jQuery(function() {
	jQuery('dl#sidenav>dd').hide();
	jQuery('dl#sidenav>dt.opened').nextUntil('dl#sidenav>dt').show('slow');
	jQuery('dl#sidenav>dt').click(function(e) {
		jQuery('dl#sidenav>dt').not(this).removeClass('opened');
		jQuery(this).toggleClass('opened');
		jQuery('dl#sidenav>dt').not(this).nextUntil('dl#sidenav>dt').hide('slow');
		jQuery(this).nextUntil('dl#sidenav>dt').toggle('slow');
	});
});

//ROLLOVER
jQuery.fn.rollover = function() {
   return this.each(function() {
      var src = jQuery(this).attr('src');
      if (src.match('_on.')) return;
      var src_on = src.replace(/^(.+)(\.[a-z]+)$/, "$1_on$2");
      jQuery('').attr('src', src_on);
      jQuery(this).hover(
         function() { jQuery(this).attr('src', src_on); },
         function() { jQuery(this).attr('src', src); }
      );
   });
};

jQuery(function() { jQuery('.btn').rollover(); });
