function P7_swapClass()
{
	var i,x,tB,j=0,tA=new Array(),arg=P7_swapClass.arguments;
 	if(document.getElementsByTagName)
 	{
 		for(i=4;i<arg.length;i++)
 		{
 			tB=document.getElementsByTagName(arg[i]);
  			for(x=0;x<tB.length;x++)
  			{
  				tA[j]=tB[x];j++;
  			}
  		}
  		for(i=0;i<tA.length;i++)
  		{
  			if(tA[i].className)
  			{
  				if(tA[i].id==arg[1])
  				{
  					if(arg[0]==1)
  					{
  						tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
  					}
  					else
  					{
  						tA[i].className=arg[2];
  					}
  				}
  				else if(arg[0]==1 && arg[1]=='none')
  				{
  					if(tA[i].className==arg[2] || tA[i].className==arg[3])
  					{
  						tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
  					}
  				}
  				else if(tA[i].className==arg[2])
  				{
  					tA[i].className=arg[3];
  				}
  			}
  		}
  	}
}

function setCounter()
{
	today = (new Date()).getTime();
	the_day = (new Date('Jul 30, 2005 00:00:00')).getTime();
	time = (the_day - today);
	days = (time - (time % 86400000)) / 86400000;
	if (time > 0)
		days = days + 1;
	if (days<=-6)
		out = "Takk for bes&oslash;ket!"
	else if (days<=0) {
		day = -1 * days + 1;
		out = day + ". dag";
		if (day == 2)
			out = out + " - HL";
	}
	else if(days==1) 
		out = "1 dag igjen";
	else 
		out = days + ' dager igjen';

	document.getElementById("counter").innerHTML = out;
}

function setStyle(objId, style, value) 
{
    document.getElementById(objId).style[style] = value;
}


function selectMenu2(menu,menuImg,arg1,arg2,arg3,arg4,arg5)
{
	if (menu.match('http://'))
	{
		document.getElementById("contentframe").src = menu;
		document.getElementById("leftcolframe").src = 'l_' + menuImg + '.html';
		document.getElementById("headerImg").src = "images/header_" + menuImg + ".jpg";
	}
	else
	{
		document.getElementById("contentframe").src = 'c_' + menu + '.html';
		document.getElementById("leftcolframe").src = 'l_' + menu + '.html';
		document.getElementById("headerImg").src = "images/header_" + menuImg + ".jpg";
	}
			  
	P7_swapClass(arg1, arg2, arg3, arg4, arg5);
	return false;
}

function selectMenu(menu,arg1,arg2,arg3,arg4,arg5)
{
	return selectMenu2(menu,menu,arg1,arg2,arg3,arg4,arg5); 
}

function resize_iframe()
{
	try	{
		var height=window.frames["contentframe"].document.body.scrollHeight;
		height=height+25;
		if (height<435) height=435;
	}
	catch ( exc ) {
		height = 435;
		document.getElementById("contentframe").scrolling="yes";
	}
	document.getElementById("contentframe").height=null // required for Moz bug, value can be "", null, or integer
	document.getElementById("contentframe").height=height;
}