function displayPopUp (popId) {
//  alert ("Running");
  document.getElementById(popId).style.display = "block";
}

function test() {
  alert("Running");
}

function hidePopUp (popId) {
//  alert ("Running");
  document.getElementById(popId).style.display = "none";
}

function showhtml ()
{
	document.write ('<p>Some text</p>');
}

function getcookie (cookiename)
{
	var prefix = cookiename + "=";
	var cookieStartIndex = document.cookie.indexOf (prefix);
	if (cookieStartIndex == -1)
		return null
	var cookieEndIndex = document.cookie.indexOf (";", cookieStartIndex + prefix.length);
	if (cookieEndIndex == -1)
		cookieEndIndex = document.cookie.length;
	return unescape (document.cookie.substring (cookieStartIndex +prefix.length, 
		cookieEndIndex));
}

function checklogin ()
{
	var loginstatus = document.getElementById ("LoginStatus");
	if (loginstatus)
	{
		var cookieval = getcookie ("login");
		if (cookieval)
		{
			var cookieparts = cookieval.split (" ");
			loginstatus.innerHTML = "<p><a href='/sponsorship.php'>My Account</a> | <a href='/cgi-bin/logout.cgi'>Logout</a> "
+cookieparts [0]+"</p>";
		}
		else loginstatus.innerHTML = "<p><a href='https://epsilon.securesslhost.net/~frijond/cgi-bin/login.cgi'>Login</a></p>";
	}
}



