function showmenu(elmnt)
{
	document.getElementById(elmnt).style.visibility="visible";
}
function hidemenu(elmnt)
{
	//setTimeout("document.getElementById('"+elmnt+"').style.visibility=\"hidden\"", 1500);
	//setTimeout("alert(\"hidden\")", 1000);
	
	document.getElementById(elmnt).style.visibility="hidden";

}

function toggleLogin()
{
	if(document.getElementById("loginScreen").style.visibility=="hidden")
	{
		document.getElementById("loginScreen").style.visibility="visible";
		document.getElementById("inUsername").focus();
	}
	else
		document.getElementById("loginScreen").style.visibility="hidden";
}

function showSUHelp(tekst)
{
	document.getElementById("helpdiv").innerHTML = tekst;
}

// Checks if a form is completely filled.
function validateRegForm(formname)
{
	var returnvalue = true;
	var i;
	for(i=0; i < (document.getElementById(formname).length); i++)
	{
		if(document.getElementById(formname)[i].type == "text")
		{
			if(document.getElementById(formname)[i].value == "")
			{
				returnvalue = false;
			}
		}
		
	}
	if(!returnvalue)
		alert("Please fill out all fields");

	if(document.regform.password.value != document.regform.confirmpassword.value)
	{
		returnvalue = false;
		alert("Password not the same as confirmation password.");
	}
		
	return returnvalue;
}

function checkPw()
{
	if(document.chform.password.value != document.chform.confirmpassword.value)
	{
		alert("Password and confirm password should have the same value");
		return false;
	}
	else
		return true;
}

// 
function delAd(itemId)
{
	if( window.confirm("Are you sure you wish to delete this item?") )
		document.location = "framework.php?module=13&itemid="+itemId;
}

function stdLoad()
{
}
