var selected=null;
function select(e,name){
	var h;
	if(selected!=null) {
		selected.onmouseout=selected.mouseout;
		if(h=document.getElementById(selected.name+'content')) h.style.display='none';
		selected.onmouseout();
	}
	if(h=document.getElementById(name+'content')) h.style.display='';
	selected=e;
	e.mouseout=e.onmouseout;
	e.onmouseout=function(){this.src='/images/buttons/'+name+'_sel.gif';};
	e.onmouseout();
	location.href='#'+name;
	//document.title='Trillium Ontario CFO';
	//alert('putting '+ name+'into location' );
	e.onmouseout();
}
function checkback(){
	//alert(window.location.hash);
	var p=window.location.hash.substring(1)

	if(p!=lastpage){
		if (lastpage=='home'&&p!=startpage){
			if(h=document.getElementById('homecontent')) h.style.display='none';
		}

		lastpage=p;
		select(document.getElementById('btn'+p),p);
	}
}
