/* if the visitor is coming from pubs.html, gets the CSS region to show and the anchor to jump to */
function pubsLink(){
	var searchstring = window.location.search;
	searchstring = searchstring.substr(1);
	var separator = '=';
	var searcharray = searchstring.split(separator);
	var hiddenregion = searcharray[0];
	var article = searcharray[1];	
	WM_toggle(hiddenregion);
	location.hash = article;
}

/* function to toggle each sub-section of the outline - stolen from webmonkey.com */
function WM_toggle(id){
    if (document.all){
	if (document.all[id])
	{
	if(document.all[id].style.display == 'none'){
	    document.all[id].style.display = '';
	} else {
	    document.all[id].style.display = 'none';
	}
	}
	return false;
    } else if (document.getElementById){
	if(document.getElementById(id).style.display == 'none'){
	    document.getElementById(id).style.display = 'block';
	} else {
	    document.getElementById(id).style.display = 'none';
	}
	return false;
    }
}

pubsLink();
