<!--
// browser check
var agt=navigator.userAgent.toLowerCase();
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
var is_mac    = (agt.indexOf("mac")!=-1);
var is_win    = (agt.indexOf("win")!=-1); 
var is_major = parseInt(navigator.appVersion);
var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
var is_ie7	  = (agt.indexOf('msie 7') != -1)
var is_ie8	  = (agt.indexOf('msie 8') != -1)
var is_opera  = ((agt.indexOf("opera") != -1) || is_ie7 || is_ie8); // korriger for IE7+8
var is_ie3    = (is_ie && (is_major < 4));
var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 4")!=-1) );
var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
var is_ie55up = (is_ie && !is_ie3 && !is_ie4 && !is_ie5);
var is_nav6up = (is_nav && is_major >= 5);

function ns4_reload(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=ns4_reload; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
ns4_reload(true);

function trc(url) {
	if(document.images){
	  if(url.childNodes) {
		new Image().src= "admin/trc.asp?url="+escape(url)+"&linkname="+escape(url.childNodes[0].nodeValue);
	  } else {
	  	new Image().src= "admin/trc.asp?url="+escape(url);
	  }
	}
	return true;
}

function openWin(billed_id,billednavn) {
	if (is_ie7) {
	var newwin = window.open('admin/inc/billede.asp?billedid='+billed_id+'&bnavn='+billednavn,'_blank','menubar=yes,resizable=yes,width=591,height=532');
	} else if (is_opera || is_nav6up) {
	var newwin = window.open('admin/inc/billede.asp?billedid='+billed_id+'&bnavn='+billednavn,'_blank','menubar=yes,width=591,height=512');
	} else {
	var newwin = window.open('admin/inc/billede.asp?billedid='+billed_id+'&bnavn='+billednavn,'_blank','menubar=yes,width=591,height=493');
	}
}

//function setActiveStyleSheet(title,reset){
//	if(!W3CDOM){return false};
//	var i,a,main;
//	for(i=0;(a=document.getElementsByTagName("link")[i]);i++){
//		if(a.getAttribute("rel").indexOf("style")!=-1&&a.getAttribute("title")){
//		a.disabled=true;
//		if(a.getAttribute("title")==title){a.disabled=false}
//		}
//	}
//	if(reset==1){
//	createCookie("wstyle",title,365)
//	}
//};
//function setStyle(){
//	var style=readCookie("wstyle");
//	if(style!=null){
//	setActiveStyleSheet(style,0)
//}
//};
///* cookie */
//function createCookie(name,value,days){
//	if(days){
//	var date=new Date();
//	date.setTime(date.getTime()+(days*24*60*60*1000));
//	var expires="; expires="+date.toGMTString()
//	} else{expires=""}
//document.cookie=name+"="+escape(value)+expires+"; path=/;"};
//function readCookie(name){
//	var nameEQ=name+"=";
//	var ca=document.cookie.split(';');
//	for(var i=0;i<ca.length;i++){
//	var c=ca[i];while(c.charAt(0)==' '){
//	c=c.substring(1,c.length)}
//	if(c.indexOf(nameEQ)==0){
//	return unescape(c.substring(nameEQ.length,c.length))
//	}
//	}
//return null
//};

function encodemail(country,domain,name,linktekst,strclass) {
	var strEncodedMail = '<a ';
		if(strclass != "") strEncodedMail = strEncodedMail + 'class="'+strclass+'" ';
	strEncodedMail = strEncodedMail + 'href="&#109;&#97;&#105;&#108;'
		+ '&#116;&#111;&#58;'+name+'&#064;'+domain+'&#46;'+country+'">';
		if(linktekst != "") strEncodedMail = strEncodedMail + linktekst;
		else strEncodedMail = strEncodedMail + linktekst + name+'&#064;'+domain+'&#46;'+country;
	strEncodedMail = strEncodedMail + '</a>';
	document.write(strEncodedMail);
}

// show/hide visibility
function aliaShow(targetId){
  if (document.getElementById){
  		target = document.getElementById(targetId);
		target.style.display = "block";
  	}
}
function aliaHide(targetId){
  if (document.getElementById){
  		target = document.getElementById(targetId);
		target.style.display = "none";
  	}
}
function getPageSize(){ // getSize()
	var xScroll, yScroll;
	if (window.innerHeight && window.scrollMaxY) {
	 xScroll = document.body.scrollWidth;
	 yScroll = window.innerHeight + window.scrollMaxY;
	 } else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
	 xScroll = document.body.scrollWidth;
	 yScroll = document.body.scrollHeight;
	 } else if (document.documentElement && document.documentElement.scrollHeight > document.documentElement.offsetHeight){ // Explorer 6 strictmode
	 xScroll = document.documentElement.scrollWidth;
	 yScroll = document.documentElement.scrollHeight;
	 } else { // Explorer Mac...would also work in Mozilla and Safari
	 xScroll = document.body.offsetWidth;
	 yScroll = document.body.offsetHeight;
	 }
	 var windowWidth, windowHeight, myScroll; // myWidth, myHeight
	 if (self.innerHeight) { // all except Explorer
	 windowWidth = self.innerWidth;
	 windowHeight = self.innerHeight;
	 myScroll = window.pageYOffset;
	 } else if (document.documentElement && document.documentElement.clientHeight) { // IE6 Strict
	 windowWidth = document.documentElement.clientWidth;
	 windowHeight = document.documentElement.clientHeight;
	 myScroll = document.documentElement.scrollTop;
	 } else if (document.body) { // other IE, IE7 etc.
	 windowWidth = document.body.clientWidth;
	 windowHeight = document.body.clientHeight;
	 myScroll = document.body.scrollTop;
	 }
	 // for small pages with total height less then height of the viewport
	 if(yScroll < windowHeight){
	 pageHeight = windowHeight;
	 } else {
	 pageHeight = yScroll;
	 }
	 // for small pages with total width less then width of the viewport
	 if(xScroll < windowWidth){
	 pageWidth = windowWidth;
	 } else {
	 pageWidth = xScroll;
	 }
	 arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight,myScroll)
	 return arrayPageSize;
}

// AJAX
function doAjaxResponse(http_request,response_type,error_function) {
	if (http_request.readyState == 4) { 
		if (http_request.status == 200) {
			if(response_type=='xml') return (http_request.responseXML);
			else return (http_request.responseText);
			/*
			text: simple text using the responseText
			xml: you can traverse its DOM, performing functions on the elements, attributes, and text nodes.
			*/	
		} else {
			if(error_function != '') return eval(error_function+"('status: ' + http_request.status)");
		 }
	} else {
		// if(error_function != '') eval(error_function+"('readyState: ' + http_request.readyState)");
	 }
}
//function handleDivTag(divtag) { //   var divtag; //   return divtag; //} 
function AJAX(send_method,send_url,postvars,response_type,targetid,run_function,error_function) {
	// run_function og error_function er VALGFRI
	if (window.XMLHttpRequest) { // IE 7, Mozilla, Safari, ...//
    var http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType) {http_request.overrideMimeType('text/xml');}
	}
	else if (window.ActiveXObject) { // IE 6
	  	try {var http_request = new ActiveXObject("Msxml2.XMLHTTP");}
			catch (e) {
			     try {var http_request = new ActiveXObject("Microsoft.XMLHTTP");}
				 catch (e) {}
            }
	}
	if (!http_request) return false; // alert('Giving up :( Cannot create an XMLHTTP instance');
	//Create the Divtag Handler -- Mainly an IE 6 Fix // var divhandler = new handleDivTag(null);
	http_request.onreadystatechange = function(){
		if(doAjaxResponse(http_request,response_type,error_function)) { // 2x doAjaxResponse
			var ajaxresponse = doAjaxResponse(http_request,response_type);
			if(run_function != '') { eval(run_function+"(ajaxresponse)");} // speciel ok-funktion
			// http://www.quirksmode.org/dom/innerhtml.html
			else if(ajaxresponse != null) {
			 document.getElementById(targetid).innerHTML = ajaxresponse; // default
			 }
		}
	}
	http_request.open(send_method,send_url,true); // If TRUE, the execution will continue while the response of the server has not yet arrived
	http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=iso-8859-1"); 
	http_request.send(postvars); //  null, name=value&anothername=othervalue&so=on
}

var infoboks_w, infoboks_h
function showInfoBoks(pagetoload,getvars,postvars,boks_w,boks_h) {
var info_content, info_function, info_errorfunction;
getPageSize() // arrayPageSize[pageWidth,pageHeight,windowWidth,windowHeight,myScroll]
if (getvars != '') getvars = '?' + getvars;
if (!postvars != '') postvars = null;
pagetoload = pagetoload + getvars;
infoboks_w = parseInt(boks_w);
infoboks_h = parseInt(boks_h);
// send_method,send_url,postvars,response_type,run_function,error_function
AJAX('GET',pagetoload,postvars,'text','infoboks_container','showInfoBoksContent','showInfoBoksError');
}
function showInfoBoksContent(ajax_response) {
	if(ajax_response != null) {
	document.getElementById('infoboks_container').innerHTML = ajax_response;
	document.getElementById('infoboks_baggrund').style.height = arrayPageSize[1] + "px";
	document.getElementById('infoboks_baggrund').style.width = arrayPageSize[2] + "px";
	document.getElementById('infoboks_front').style.top = arrayPageSize[4] + (arrayPageSize[3]/6) + "px";
	if(!isNaN(infoboks_w)) document.getElementById('infoboks_front').style.width = infoboks_w + "px";
	if(!isNaN(infoboks_h)) document.getElementById('infoboks_front').style.height = infoboks_h + "px";
	document.getElementById('infoboks_front').style.display='block';
	document.getElementById('infoboks_baggrund').style.display='block';
	//alert(escape(ajax_response));
	//alert(ajaxresponse.getElementsByTagName('root').item(0).firstChild.data)
	}
}
function showInfoBoksError(fejlbesked) {
  alert(fejlbesked + '\nDer opstod en fejl.\nDet vil hjælpe os meget, hvis du sender os en e-mail.\nSkriv gerne navnet på siden og beskriv kort hvordan fejlen opstod.\n\nPå forhånd tak!')
}
function hideInfoBoks() {
document.getElementById('infoboks_baggrund').style.display='none';
document.getElementById('infoboks_front').style.display='none';
}

/* <a href="http://www.kts.dk/net/" onclick="javascript:addHomePage('http://www.kts.dk/net/','da');return false;" onkeypress="javascript:addHomePage('http://www.kts.dk/net/','da');return false;">Vælg som startside</a> */
function addHomePage(pagelink,language) {
	if (document.all) {
	document.body.style.behavior="url(#default#homepage)";
	document.body.setHomePage(pagelink);
	}
	else {
		if(language=='da') {
			alert('Vælg som startside:\n\nTræk linket du netop har trykket på, over på \"Hjem\"-ikonet (huset) i browserens topmenu.\nBrug venstre muse-knap.');
		}
		if(language=='') {
			alert('Change your Homepage:\n\nDrag the link to the \"Home\"-icon (the house) in the browser menu.\nUse the left mouse button.');
		}
	}
}

function aliaFlash(flashdata,flashwidth,flashheight,hmtlcontent) {
	hmtlcontent = hmtlcontent.replace(/&lt;/g,"<");
	hmtlcontent = hmtlcontent.replace(/&gt;/g,">");
	strFlash = '<object type="application/x-shockwave-flash" data="'+flashdata+'" width="'+flashwidth+'" height="'+flashheight+'">\n'
		+ '<param name="movie" value="'+flashdata+'" />'
		+ hmtlcontent
		+ '</object>'
	document.write(strFlash);
}

function aliaFLV(flashdata,flashwidth,flashheight,autostart,startimage) {
	hmtlcontent = '<a class="nohover" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" onclick="this.target=\'_blank\'"><img src="pics/hent_flash.gif" border="0" width="89" height="85" alt="Hent Flash" /></a>';
	hmtlcontent = hmtlcontent.replace(/&lt;/g,"<");
	hmtlcontent = hmtlcontent.replace(/&gt;/g,">");
	flashdata = escape(flashdata);
	//if (startimage !='') {flashdata = "flvplayer.swf?autostart="+autostart+"&file="+flashdata+"&image=pics%2Fbilleder%2F"+startimage;}
	if (startimage !='') {flashdata = "flvplayer.swf?autostart="+autostart+"&file="+flashdata+"&image=pics%2F"+startimage;}
	else flashdata = "flvplayer.swf?autostart="+autostart+"&file="+flashdata;
	strFlash = '<object type="application/x-shockwave-flash" data="'+flashdata+'" width="'+flashwidth+'" height="'+flashheight+'">\n'
		+ '<param name="movie" value="'+flashdata+'" />'
		+ hmtlcontent
		+ '</object><br />';
	document.write(strFlash);
}

function aliaNoFLV(flashdata,flashwidth,flashheight,autostart,startimage) {
	hmtlcontent = '<div style="height:'+flashheight+'px;"><a class="nohover" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW" onclick="this.target=\'_blank\'"><img src="pics/hent_flash.gif" border="0" width="89" height="85" alt="Hent Flash" /></a></div>';
	hmtlcontent = hmtlcontent.replace(/&lt;/g,"<");
	hmtlcontent = hmtlcontent.replace(/&gt;/g,">");
	document.write(hmtlcontent);
}

// fra http://www.adobe.com/devnet/flash/articles/fp8_detection.html //
//var jsVersion = 1.0; // The version of JavaScript supported
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function JSGetSwfVer(i){
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      		var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			descArray = flashDescription.split(" ");
			tempArrayMajor = descArray[2].split(".");
			versionMajor = tempArrayMajor[0];
			versionMinor = tempArrayMajor[1];
			if ( descArray[3] != "" ) {
				tempArrayMinor = descArray[3].split("r");
			} else {
				tempArrayMinor = descArray[4].split("r");
			}
      		versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
            flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
      	} else {
			flashVer = -1;
		}
	}
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else {
		flashVer = -1;
	}
	return flashVer;
} 
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision) 
{
 	reqVer = parseFloat(reqMajorVer + "." + reqRevision);
	for (i=25;i>0;i--) {	
		if (isIE && isWin && !isOpera) {
			versionStr = VBGetSwfVer(i);
		} else {
			versionStr = JSGetSwfVer(i);		
		}
		if (versionStr == -1 ) { 
			return false;
		} else if (versionStr != 0) {
			if(isIE && isWin && !isOpera) {
				tempArray         = versionStr.split(" ");
				tempString        = tempArray[1];
				versionArray      = tempString .split(",");				
			} else {
				versionArray      = versionStr.split(".");
			}
			versionMajor      = versionArray[0];
			versionMinor      = versionArray[1];
			versionRevision   = versionArray[2];
			versionString     = versionMajor + "." + versionRevision;
			versionNum        = parseFloat(versionString);
			if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
				//alert(versionNum)
				return true;
			} else {
				//alert(versionNum)
				return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );
			}
		}
	}	
	//return (reqVer ? false : 0.0);
	return true;
}
//-->