
/* new on mouse over function */
function over (obj){
	obj.className=obj.className+'_over';
}

/* new on mouse out function */
function out (obj){
	var str=obj.className;
	var pos=str.indexOf("_over")
	obj.className=str.substr(0,pos);
}

function checkSearch(){
	if (document.search.search.value==''){
		alert('Vær vennlig å skriv inn søkeord før du utfører søk.');
	}
	else{
		document.search.submit();
	}
}

function logg_inn(){
	document.LOGIN.CMD.value="LOGIN";
	document.LOGIN.submit();
}

// Function that executes function inside input string when enter is pressed.
function doKey(sFunc) {
	if (document.all) {
		whichASC = event.keyCode;
		if(whichASC==13){
			eval(sFunc);
		}       
	}
}

// Popupwindow for sms and email sending functionalit.
	function open_sms(s){
		loc = 'sms.asp?pers='+s;
		myWin = window.open(loc, "displayWindow2","width=600,height=400,resizeable=auto,status=no,toolbar=no,menubar=no,scrollbars=1");
		myWin.focus();
	}

	function open_mail(){
		loc = 'mail.asp';
		myWin = window.open(loc, "displayWindow2","width=600,height=400,resizeable=auto,status=no,toolbar=no,menubar=no,scrollbars=1");
		myWin.focus();
	}

	function news_over(a,b)
	{
		a.style.background = '#999999';
		document.getElementById(b).style.display = 'block';
	}
	function news_out(a,b)
	{
		a.style.background = '#EDEBEC';
		document.getElementById(b).style.display = 'none';
	}
	function navigateTo(sURL,target) {

		window.open(sURL, target);
				return false;

	}

	function startclock()
	{
		var thetime=new Date();

		var nhours=thetime.getHours();
		var nmins=thetime.getMinutes();
		var nsecn=thetime.getSeconds();
		var nDate=thetime.getDate();
		var nMonth=thetime.getMonth();
		var nYear=thetime.getYear();

		var temp = "";

		nMonth = parseInt(nMonth+1)

		temp = "" + nhours;
		if (temp.length == 1)
		{
			nhours = "0"+nhours
		}
		temp = "" + nmins;
		if (temp.length == 1)
		{
			nmins = "0"+nmins
		}
		temp = "" + nsecn;
		if (temp.length == 1)
		{
			nsecn = "0"+nsecn
		}

		document.getElementById('clockspot').value=nhours+":"+nmins+":"+nsecn+" "+nDate+"/"+nMonth+"/"+nYear;

		setTimeout('startclock()',1000);
	}