﻿//Basic utility JavaScript functions


// PopInfo1
// popup window with bunch of things turned off; also adds a close link
// use <a href="page.html" onClick="popInfo1(this.href); return false;">Pop it</a>  in html to open the popup
//	newwindow.document.writeln("<a href="javascript:window.close()">Close</a>")
var newwindow;


//pop a window with fixed height, width, and other properties
function popinfo1(url)

{
	newwindow=window.open(url,'poppage','height=400,width=500,scrollbars=yes,menubar=no,location=no,toolbar=no,directories=no');
	if (window.focus) {newwindow.focus()};
}

//pop a window with passed params, and auto-center
function popinfo2(url,name,windowWidth,windowHeight)
{    
	myleft=(screen.width)?(screen.width-windowWidth)/2:100;	
	mytop=(screen.height)?(screen.height-windowHeight)/2:100;	
	properties = "width="+windowWidth+",height="+windowHeight+",scrollbars=yes, menubar=no,location=no,directories=0,resize=yes,top="+mytop+",left="+myleft;
	newwindow = window.open(url,name,properties);
	if (window.focus) {newwindow.focus()};
}


//togge visibility of an entire layer
function toggleLayer(whichLayer) 
{	
	if (document.getElementById)	
	{		
		var style2 = document.getElementById(whichLayer).style;
		style2.visibility = style2.visibility? "":"hidden";	
	} 	
	else if (document.all)	
	{
		var style2 = document.all[whichLayer].style;
		style2.visibility = style2.visibility ? "":"hidden";
	}	
	else if (document.layers)
	{
		var style2 = document.layers[whichLayer].style;
		style2.visibility = style2.visibility ? "":"hidden";
	}
}


function toggleSpecific(elementid) 
{
        var node = document.getElementById(elementid);
        if(node.style.display == '') {
          node.style.display='none';
        }
        else {
          node.style.display = '';
        }
      }

//useful info
//<script type="text/javascript">
//<!--
//if (!document.getElementById)
//{
//  document.write('<p><big>Warning! Your browser does not support the Level 1 DOM, so clicking on these buttons will result in an error. Please <a href="/browserupgrades.html">upgrade your browser</a>.</big></p>');
//}
//// -->
//</script>
//
//<a href="#" onclick="document.getElementById('introduction').style.visibility='hidden'; return false;">Invisibilise</a>&nbsp;


