  function goToByScroll(element) {
    var el = $.browser.opera ? $("html") : $("html, body");
    el.animate({ scrollTop: $(element).offset().top }, 'slow');
}

 
 $(document).ready(function(){
	$(".newsbody2").hide();
	$("div.newstitle>a").click(function(){
		$('.floatingbox').removeClass('floatingbox').find('.newsbody2:visible').slideUp('slow',function (){
   		// IE 8 fix. This forces a reflow after everything is done, otherwise we lose important margins.
   		// Recheck later to see if future jquery versions can overcome this 
   		if (jQuery.browser.msie && jQuery.browser.version.substring(0,1) == '8'){
   			$('.hubbox').css('display', 'none').css('display', 'block');
   		}
   }); // close other opened stories
		$(this).parent('div').next('.newsbody2:hidden').show('slow').parent('div').addClass('floatingbox'); // open story
	   return false;
   });
   
   
   //    Now we look to see if a particular news story has been requested
//    by adding its #ID number to the URL. This generally happens
//    from click-thru's from RSS feeds.
   	if (location.hash) {
   		var found=jQuery(location.hash).length == 1;
			// Do nothing if it's a recognised anchor
			// such as #calendar ...
		if (location.hash == '#calendar') { found = -1;}

   		if (found == 1){
   			jQuery(location.hash).trigger('click');
   			goToByScroll(location.hash);
   		}  else {
   			if (found != -1) {
				alert ("The news story requested is no longer available: "+location.hash);
			}
   		}
   	}
   
 });