(function($) {
	$(document).ready(function() {
		// SEARCH FORM
		$("#SearchForm_SearchForm_Search").focus(function() {
			if($(this).val() == "Search") $(this).attr("value", "");
		});
		
		// HOMEPAGE
		$('#Scroller').cycle({ 
		    delay:  5000,
			timeout: 8000,
		    speed:  1500,
			after: updateScrollTitle
		}); 

		function updateScrollTitle() { 
			$("#ScrollerTitle").html(this.alt);
		};
		
		// hide paragraphs
		$(".collapsableSection .section").hide();
		$(".collapsableSection h4").show();
		$(".collapsableSection h4").click(function() {
			if($(this).hasClass("viewing")) {
				$(this).removeClass("viewing");
				$(this).next(".section").slideUp("fast");
			}
			else {
				$(this).addClass("viewing");
				$(this).next(".section").slideDown("fast");
			}
		});
		
		$("#ArticlePage #CenterCol a").each(function() {
			var href = $(this).attr('href');
			if(href.substr(0,1) == "#") {
				$(this).attr('href', window.location + $(this).attr('href'));
			}
		});
	})
})(jQuery);