var boolNS4 = navigator.appVersion.indexOf("Nav") > 0 && parseInt(navigator.appVersion) == 4;

function mailnospam(user, site, cssclass) {
   document.write('<a href=\"mailto:' + user + '@' + site + '\">');
   document.write(user + '@' + site + '</a>');
}
function mailnamenospam(user, site, name, cssclass) {
   document.write('<a href=\"mailto:' + user + '@' + site + '\">');
   document.write(name + '</a>');
}
function addrnospam(user, site) {
   document.write(user + '@' + site);
}

function toggleDesc(strProgramID)
{
   if(boolNS4) return false;

 //  objCurrentShort = GetElement("Desc"+strProgramID+"Short");
 //  objCurrentShort.style.display = (objCurrentShort.style.display=="none" ? "block" : "none");

   objCurrentLong = GetElement("Desc"+strProgramID+"Long");
   objCurrentLong.style.display = (objCurrentLong.style.display=="none" ? "block" : "none");

}

function OpenWindow(strURL, strTitle, intWidth, intHeight, boolScrollbar)
{
	var intMyLeft = eval(screen.width-intWidth)/2;
	var intMyTop  = eval(screen.height-intHeight)/2;
	window.open(strURL,strTitle,'toolbar=no,location=no,status=no,menubar=no,scrollbars='+(boolScrollbar ? 'yes' : 'no')+',resizable=no,width='+intWidth+',height='+intHeight+',left='+intMyLeft+',top='+intMyTop);
}
function OpenDialog(strFile, strTagplace, intWidth, intHeight)
{
	window.showModalDialog( strFile, strTagplace,'dialogHeight: '+intHeight+'; dialogWidth: '+intWidth+'px;  dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: Yes; status: No;');
}
function SetStatusMsg($strText)
{
   window.status = $strText;
}

function ClearStatusMsg()
{
   window.status = "";
}

function GetElement(strElement)
{
	if (document.getElementById)
	{
		// IE5+, Netscape 6, Mozilla
		return (document.getElementById(strElement));
	}
	else if (document.all)
	{
		// IE4
		return (eval("document.all." + strElement));
	}
	else if (document.layers)
	{
		// Netscape 4
		return (eval("document." + strElement));
	}
	else
	{
		// Nothing
		return (null);
	}
}

function GetFormElement(strForm, strElement)
{
   // If strElement is empty, then get the form.
	if (strElement != "") {
		strElement = "." + strElement;
	}
	return (eval("document.forms['" + strForm + "']" + strElement));
}

function GetParentElement(strElement)
{
	if (document.getElementById)
	{
		// IE5+, Netscape 6, Mozilla
		return (parent.document.getElementById(strElement));
	}
	else if (document.all)
	{
		// IE4
		return (eval("parent.document.all."+strElement));
	}
	else if (boolNS4)
	{
		// Netscape 4
		return (eval("document."+strElement));
	}
	else
	{
		// Nothing
		return (null);
	}
}
function mouseovermenutr (o){
	// o.style.backgroundColor= "#70a0cF";
	o.style.cursor="hand";	
}
function mouseoutmenutr(o){
	//o.style.backgroundColor="#000000";
}
function mouseovermenutd (o){
	// o.style.borderStyle="solid";
	// o.style.borderColor="#ffffff";
	//o.style.backgroundColor= "#4a4a4a";
	//o.style.color="#ffffff";
}
function mouseoutmenutd (o){
	//o.style.color="#ffffff";
	//o.style.borderColor="#31659C";
	//o.style.backgroundColor="black";
	//o.style.backgroundColor="transparent";
	//o.style.backgroundImage="url(../images/MenuBlackBackground.gif)";
	//o.style.backgroundRepeat="repeat-x";
}
function mouseovertr (o){
	// o.style.backgroundColor= "#70a0cF";
	o.style.cursor="hand";	
}
function mouseouttr(o){
	o.style.backgroundColor="#D8D8D8";
}
function mouseovertd (o){
	o.style.backgroundColor= "#E5E5E5";
	o.style.borderWidth= "1px";
	o.style.borderStyle= "solid";
	o.style.borderColor= "gray";
	

	//o.style.color="#ffffff";
	//o.style.filter = "progid:DXImageTransform.Microsoft.gradient(GradientType=1,endColorstr=#ffffff, startColorstr=#D8D8D8);";
}
function mouseouttd (o){
	//o.style.color="#ffffff";
	o.style.backgroundColor="#D8D8D8";
	o.style.borderWidth= "1px";
	o.style.borderStyle= "solid";
	o.style.borderColor= "#D8D8D8";


	//o.style.filter = "progid:DXImageTransform.Microsoft.gradient(GradientType=1,endColorstr=#D8D8D8, startColorstr=#D8D8D8);";
}
function hoverTitle (o) {
//	o.class = 
}
function mouseoverMenu(sProgramID)
{
   if(boolNS4) return false;
   
	objCurrentTop = GetElement("Top"+sProgramID);
	objCurrentTop.style.textDecoration = "underline"; 
	objCurrentTop.style.color = "#BB1F24";
}
function mouseoutMenu(sProgramID)
{
   if(boolNS4) return false;
   
	objCurrentTop = GetElement("Top"+sProgramID);
	objCurrentTop.style.textDecoration = "none"; 	
	objCurrentTop.style.color = "black";
}
function email(n,d,c) 
{
    if(c) {
        document.write("<a href=\"mailto");
        document.write(":" + n+ "@");
        document.write(d + "\">" + c + "<\/a>");
   }
   else
   {
        document.write("<a href=\"mailto");
        document.write(":" + n+ "@");
        document.write(d + "\">" + n+ "@" + d+ "<\/a>");
   }
}
function ShowHide(elementId)
{
	var element = document.getElementById(elementId);
	if(element.style.display != "block")
	{
		element.style.display = "block";
	}
	else
	{
		element.style.display = "none";
	}
}
function UpdateText(element)
{
	if(element.innerHTML.indexOf("Show") != -1)
	{
		element.innerHTML = "Vis mere <img src='frwimages/arrowdown.gif' border='0' alt=''>";
	}
	else
	{
		element.innerHTML = "";
	}
}

