/* --------------------------------------------------------- 	
	Jen's Hack for show hide abstract on toggle 
	and for the relinking of show hide list on hrefs 
	on research page.
	Thanks for that Jen, works great!
------------------------------------------------------------ */
	
function toggleAbs(id)
	{
		var abstractid = id + "Abs";
		var text = document.getElementById(abstractid);
		if(text.style.display == "none")
		{
			text.style.display = "";
			document.getElementById(id).innerHTML = "Hide Abstract";
		}
		else
		{
			text.style.display = "none";
			document.getElementById(id).innerHTML = "Show Abstract";
		}
	}
	
// when the page is first loaded, decide which section to show

function loadSection(aName)
	{
		var link;
		
		if(aName != null)
		{
			link = aName;
		}
		else
		{
			link = window.location.hash.replace("#","") || "Published";
		}
		
		if(link.length > 0) window.location.hash = link;
		
		var sections = ["Current","Published","Unpublished"];
	
		var l = sections.length;

		for(var i=0; i<l; i++)
		{
			var id = sections[i];
			var abstractid = id + "Abs";
			var text = document.getElementById(abstractid);
			
			text.style.display = (id == link)? "" : "none";
			document.getElementById(id).innerHTML = (id == link)? "Hide List" : "Show List";
		}
	}
	
// show hide list of publications 

function toggleList(id)
	{
		var abstractid = id + "Abs";
		var text = document.getElementById(abstractid);
		if(text.style.display == "none")
		{
			text.style.display = "";
			document.getElementById(id).innerHTML = "Hide List";
		}
		else
		{
			text.style.display = "none";
			document.getElementById(id).innerHTML = "Show List";
		}
	}


function togglebirth(id)
	{
		var abstractid = id + "Abs";
		var text = document.getElementById(abstractid);
		if(text.style.display == "none")
		{
			text.style.display = "";
			document.getElementById(id).innerHTML = "Hide Birth Story";
		}
		else
		{
			text.style.display = "none";
			document.getElementById(id).innerHTML = "Read Birth Story";
		}
	}
	
function togglelocaltimes(id)
	{
		var abstractid = id + "Abs";
		var text = document.getElementById(abstractid);
		if(text.style.display == "none")
		{
			text.style.display = "";
			document.getElementById(id).innerHTML = "Hide Local Times in";
		}
		else
		{
			text.style.display = "none";
			document.getElementById(id).innerHTML = "Show Local Times in";
		}
	}	