var SCR_navn,SCR_fnc,SCR_tlf,SCR_bilde,SCR_w,SCR_h,SCR_alt,SCR_epost;

function msieVer()
{
	var ua = window.navigator.userAgent
	var msie = ua.indexOf("MSIE ")
	if(msie>0)
	   return parseInt(ua.substring(msie+5,ua.indexOf(".",msie)))
	else
	   return 0
}

function nav(){return document.layers?1:0;}
function ie(){return document.all?1:0;}
function layersEnabled(){return (msieVer()>=5?1:0);}
function clientHeight(){return nav()? window.innerHeight + document.scrollTop : document.body.clientHeight + document.body.scrollTop;}
function clientWidth(){return nav()? window.innerWidth + document.scrollLeft : document.body.clientWidth + document.body.scrollLeft;}
function switchToPage(name){parent.mid.location=name+".html";}
function switchToAsp(name){parent.mid.location=name+".asp";}
function GoBack(){history.go(-1);}
function GotoPos(pos){document.location="#" + pos;}
function wr(tekst){document.write(tekst);}

function AktHeader(aktname)
{
	wr("<table width='98%' border='0' cellspacing='0' cellpadding='0' bgcolor='#ffffcc' class='aktTop'><tr><td>")
	wr(aktname + "</td><td class='Hovedtekst' align='right'><a href='javascript:GoBack()'><img src='images/back.gif' border=0 width='30' height='22' alt='Tilbake til ...'></a></td></tr></table>")
}

function makeDocRef(img,urlName,url,width,height,altText)
{
	var v;
	v="<A HREF=\"javascript:parent.createWindow('" + url + "','"+urlName+"');\"";
	v+=">";
	v+="<img src=\""+img+"\" WIDTH="+width+" HEIGHT="+height+" BORDER=0 ALT=\""+altText+"\"></A>";
	return (v);
}

function makeTn(img,width,height,alt)
{
	var v;
	v="<A HREF=\"javascript:parent.createWindow('" + img + "','"+'bilde'+"');\"";
	v+=">";
	v+="<img src=\""+img+"\" WIDTH="+width+" HEIGHT="+height+" BORDER=0 ALT=\""+alt+"\"></A>";
	return v;
}

function createWindow(cUrl,cName,cFeatures){var xWin = window.open(cUrl,cName,"resizable, menubar, scrollbars,status,toolbar,copyhistory,location,directories")}
function openCalendar(){newWin=window.open("calendar.asp?Date="+document.frm.dato.value,"Kalender","width=340,height=300,resizable");}
function openAdsWindow(){newWin=window.open("visads.asp","Reklamebannere","width=440, height=480,resizable,scrollbars");}
function openVareWindow(pict){newWin=window.open("visvarer.asp?img=" + pict,"Varebilder","width=440, height=480,resizable,scrollbars");}
function newWindow(href,tittel,width,height,resize,scrollbars)
{
	var rz="",sb="";
	if (resize!=0) rz=",resizable";
	if (scrollbars!=0) sb=",scrollbars";
	newWin=window.open(href,tittel,"width="+width+",height="+height+rz+sb);
}
function newWindowExt(href,tittel,width,height)
{
	newWin=window.open(href,tittel,"width="+width+",height="+height+",resizable, menubar, scrollbars,status,toolbar,copyhistory,location,directories");
}
function Msg(txt,style,w,h)
{
	newWindow("ShowMessage.asp?cls=" + style + "&tekst=" + txt ,"Melding", w, h,1,1);
}
function highlight(ele){ele.style.color="blue";}
function normal(ele){ele.style.color="black";}
function makeFullName(){document.frm.fulltnavn.value=document.frm.fornavn.value+" "+document.frm.etternavn.value;}

function GetCookie(sName)
{
	var aCookie = document.cookie.split("; ");
	for (var i=0; i < aCookie.length; i++)
	{
		var aCrumb = aCookie[i].split("=");
		if (sName == aCrumb[0])
			return unescape(aCrumb[1]);
	}
	return null;
} 

function DelCookie(sName)
{
	var dato = new Date();
	dato.setMinutes(0);
	dato.setHours(0);
	var v=GetCookie(sName);
	if (v!=null)
		document.cookie = sName + "=" + escape(v) + "; expires=" + dato.toGMTString();
} 

function SetCookie(sName, sValue, hours)
{
	var dato = new Date();
	var h=dato.getHours();
	h+=hours;
	dato.setHours(h);
	document.cookie = sName + "=" + escape(sValue) + "; expires=" + dato.toGMTString();
} 
