function display(mode, id){
var el = document.getElementById(id);
el.style.display = mode;
return false;
}

function addRevealLink(id){
	var el = document.getElementById(id);
	var elID = el.getAttribute("id") + "_content";
	var alink = document.createElement('a');
	alink.setAttribute("href","#"+elID);	
	alink.setAttribute("title","Show more");
	
	// use DOM 0 method to be kind to IE 5,6,7
	
	alink.onclick=function(){
	display('block', elID);
	}		
	
	//->
	
	var alinkCopy = document.createTextNode("More");
	alink.appendChild(alinkCopy);
	el.appendChild(alink);
}

function addCloseLink(id){
	var el = document.getElementById(id);
	var elID = el.getAttribute("id");
	var alink = document.createElement('a');
	alink.setAttribute("href","#"+elID);
	alink.setAttribute("title","Close this panel");
	
	// use DOM 0 method to be kind to IE 5,6,7
	
	alink.onclick=function(){
	display('none', elID);
	}	
	
	// ->
	var alinkCopy = document.createTextNode("Close detail");
	alink.appendChild(alinkCopy);
	el.appendChild(alink);
}

function init(){
	
// set up the page, hiding panels from javascript enabled browsers
// and adding the controls for the show/hide 

addRevealLink('sga');
display('none','sga_content');
addCloseLink('sga_content');

addRevealLink('sbr');
display('none','sbr_content');
addCloseLink('sbr_content');

addRevealLink('sbd');
display('none','sbd_content');
addCloseLink('sbd_content');


}
