function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=500,height=400,left = 390,top = 200');");
}

function OpenAsPopup(link) {
	var url = link.href;
	
	if (url.indexOf("popup=") == -1) {
		if (url.indexOf("?") == -1) {
			url += "?popup=true";
		} else {
			url += "&popup=true";
		}
	}
	
	popup(url, "popup", 550, 350, 1);
	
	return false;
}


// Dialogboks til at bekræfte sletning
function sikker(strMsg)
{
	if (confirm(strMsg) == true)
	{
		return true
	}	
	else	
	{	
		return false
	}
}

function submitonce(theform)
{
	//if IE 4+ or NS 6+
	if (document.all||document.getElementById)
	{
		//screen thru every element in the form, and hunt down "submit" and "reset"
		for (i=0;i<theform.length;i++)
		{
			var tempobj=theform.elements[i]
			if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
			//disable em
			tempobj.disabled=true
		}
	}
}


function hideElement(elementId) {
  var element = document.getElementById(elementId);
  element.style.display = "none";
}



//foldud menu
function showMnu(id) {
	var styleCheck = document.getElementById("mnu" + id).style.display;
	//alert(styleCheck);
	
	if (styleCheck == "inline") {
		document.getElementById("mnu" + id).style.display = "none";
	}
	if (styleCheck == "none") {
		document.getElementById("mnu" + id).style.display = "inline";
	} 
}

//popup 
function vindue(url) 
{
	vindue = window.open(url,'','toolbar=yes,copyhistory=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizeable=yes,width=350,height=400');
	return true;
  //  vindue.focus();
}


