	var searchfield_touched = false;

	var dropDowns = {}
	function sm(menuName)
	{
		if(dropDowns[menuName])clearTimeout(dropDowns[menuName]);
		g(menuName).style.display = '';
	}

	function hm(menuName)
	{
		dropDowns[menuName] = setTimeout(function(){
			document.getElementById(menuName).style.display = 'none';
		},50)
	}

	var g = function(x)
	{
		if( document.getElementById )
		{
			// IE5+, Netscape 6, Mozilla
			return( document.getElementById(x) );
		}
		else if( document.all )
		{
			// IE4
			return( eval("document.all." + x) );
		}
		else if( document.layers )
		{
			// Netscape 4
			return( eval("document." + x) );
		}
		else
		{
			// Nothing to return :(
			return( null );
		}
	}

	var showNews = function(id) {
	
		for(i=0; (c = document.getElementsByTagName("div")[i]); i++) {
			var h = c.id;
			if( h.substring(0,5)=='news_' ){
				c.style.display = 'none';
			}
			
		}
		g("news_" + id).style.display = 'block';
	
		for(i=0; (c = document.getElementsByTagName("td")[i]); i++) {
			var h = c.id;
			if( h.substring(0,8)=='newstab_' ){
				c.style.borderTop = '0px';
				c.style.borderLeft = '0px';
				c.style.borderRight = '0px';
				c.style.borderBottom = '1px solid #970C13';
			}
		}
		g("newstab_" + id).style.borderTop = '1px solid #970C13';
		g("newstab_" + id).style.borderLeft = '1px solid #970C13';
		g("newstab_" + id).style.borderRight = '1px solid #970C13';
		g("newstab_" + id).style.borderBottom = '0px';
	}

function changeContentFontSize(type) {
	var fs;
	if (type) 
	{
		g("content").style.fontSize = '13px';
		fs = "13";

	} 
	else 
	{
		g("content").style.fontSize = '11px';
		fs = "11";
	}
	
	setCookie("fontsize", fs, 365);
}

function setCookie( NameOfCookie, value, expiredays )
{
	var ExpireDate = new Date ();
	ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 * 1000));
	document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays == null) ? "" : "; expires=" + ExpireDate.toGMTString());
}

function getCookie(NameOfCookie)
{

	if (document.cookie.length > 0)
	{
		var begin = document.cookie.indexOf(NameOfCookie+"=");
		if (begin != -1) 
		{
			begin += NameOfCookie.length+1;
			end = document.cookie.indexOf(";", begin);
			if (end == -1) end = document.cookie.length;
			return unescape(document.cookie.substring(begin, end)); 
		}
	}
	return null;

}

function validateHTML() 
{
	if (document.location.href.indexOf("localhost") == -1) {

		document.write('<');
		document.write('a href="http://validator.w3.org/check?uri=' + document.location.href + '">validér html');
		document.write('<');
		document.write('/a>');	
	}
}

function clear_searchfield()
{
	if( !searchfield_touched )
	{
		g('searchfieldinput').value='';
		searchfield_touched = true;
	}
}

function popup( fn, title ) 
{ 
	var imageWin = window.open('',"imgwin",'height=130,width=130,top=100,left=150,scrollbars=no,resizable=yes');
	imageWin.document.open(); 
	imageWin.document.write( 
	'<html>'+ 
	'<head>'+ 
	'<title>'+ title + '</title>'+ 
	'<\script type="text/javascript">'+ 
	'function myResize() {'+ 
	'	var picW = document.images["pic"].width;'+ 
	'	var picH = document.images["pic"].height;'+ 
	'	picW = picW+10;'+
	'	picH = picH+25;'+
	'	window.resizeTo(picW,picH);'+ 
	'}'+ 
	'<\/script>'+ 
	'</head>'+ 
	'<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="myResize();">'+ 
	'<a href="#" onclick="self.close();">'+
	'<img src="' + fn + '" name="pic" border="0"></a>'+ 
	'</body>'+ 
	'</html>' ); 
	imageWin.focus();
	imageWin.document.close(); 
} 