// JavaScript Document
 //<![CDATA[   
var currentPage="block1";
var pageLinks="";
// create the dynamicPaginator object
var dynamicPaginator = {
	
	showPage:function(thisLinkObj, linkItem){
		if(currentPage!="")
			{
			$(currentPage).hide();
			}
		$(linkItem).appear();
		// reinstate all original links
		$$("#monthNav").each(function(s){s.outerHTML=pageLinks});
		// remove the current link 
		$(thisLinkObj).outerHTML = $(thisLinkObj).innerHTML;
		currentPage=linkItem;
		return false;
	}
	}
	
// set up the begin function to run on page load ..	
// this is really a bit late, we want to do something like
// the jQuery $(document).ready()

window.onload = begin;
 
function begin()
{
//clean up the page
//hide all the news blocks apart from the first one
	$$("div.AutoIndexSlot>div.newsBlock:not(#block1)").each(function(s){
		//check the item is visible first
		if(s.visible())s.hide();
		});
//back up all the page links because they get removed when clicked on
	$$("#monthNav").each(function(s){pageLinks = pageLinks + s.outerHTML});
}
   

 //]]>
