function sekrak() {
		var wind;var krak = window.open('http://www.krak.dk/scripts/kort/viskort.asp?id=539276&idx=39330',
			wind,
			'width=600,height=600,toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1');
}
function serejse() {
		var wind;
		var rejse = window.open('http://kort.krak.dk/ml/link.asp?id=8aa47ea7d0764375bcacbedb6b71a396',
			wind,
			'width=600,height=600,toolbar=0,directories=0,menubar=0,status=0,resizable=0,location=0,scrollbars=1');
}
function $() {return document.getElementById(arguments[0]);}
function $$() {return document.getElementsByTagName(arguments[0]);}
function startup(){	reconstructContent(0);reconstructTheMenu();act();}
function reconstructContent(iColHeight) {
	
	var o1 = $("c1_container");
	var o2 = $("c2_container");
	var o3 = $("endbox");
	var o4 = $("document");
	if (o4) { with(o4.style) {
		display = "none";
		left = (document.body.clientWidth/2)-(938/2)+"px";
		display = "block";
	} }
	
	var iHeight = 0;
	if (o3){
		o3.style.display = "none";
	}
	if (o1){
		var t1 = $("c1_column1");
		var t2 = $("c1_column2");
		var t3 = $("c1_column3");
		iHeight = Math.max(Math.max(t1.clientHeight + 30,t2.clientHeight),t3.clientHeight + 30);
		
		if (iHeight < 180){ iHeight = 180 }
		if (iHeight < iColHeight){ iHeight = iColHeight}
		o1.style.height = iHeight+30 + "px";
		t1.style.height = iHeight+30 + "px";
		t2.style.height = iHeight+30 + "px";
		t3.style.height = iHeight+30 + "px";
		
		
	} else { 
		if (o2){
			var t4 = $("c2_column1");
			var t5 = $("c2_column2");
			iHeight = Math.max(t4.clientHeight,t5.clientHeight);
			if (iHeight < 380){ iHeight = 380 }
			if (iHeight < iColHeight){ iHeight = iColHeight}
			o2.style.height = iHeight+30+ "px";
			t4.style.height = iHeight+30+ "px";
			t5.style.height = iHeight + "px";
		}
	}
	if (o3){
		o3.style.display = "block";
	}
	
	fixshortcuts();
	fixborder();
}

function reconstructTheMenu(){

	var o = $("menubox");
	var o2 = $("shortcuts");
	
	if (o) { with(o.style) {
		display = "none";
		
		//left = (document.body.clientWidth/2)-(938/2)+"px";
		display = "block";
		
	} }
		var o4 = $("document");
	if (o4) { with(o4.style) {
		left = (document.body.clientWidth/2)-(938/2)+"px";
	} }
}

function fixshortcuts() {
	var o = $("links");
	if(o) {
		var as = o.getElementsByTagName("A");
		if(as.length) {
			var fontheight = as[0].clientHeight;
			var rest = o.clientHeight - as.length * fontheight;
			var sepheight = Math.round((rest / (as.length-1)));
			
			for(var it in as) {
				
				if(as[it].style) {
					as[it].style.height = (sepheight-2) + fontheight  + "px";
					
				}
			}
			//var links = o.getElementsByTagName("div")[0];
			
		}
	}
}

function fixborder() {
	var list = $$('DIV');
	
	for(var it in list) {
		switch(list[it].className) {
			case "right":
				list[it].style.height = (list[it].parentNode.parentNode.getElementsByTagName("IMG")[0].clientHeight - 8) + "px";
				break;
			case "bottom":
				list[it].style.top = (list[it].parentNode.parentNode.getElementsByTagName("IMG")[0].clientHeight) + "px";
				break;
		}
	}
}

function act(){
	
	if (document.getElementById) {
		var oRoot = $("TopMenu");
		if(!oRoot)
			return;
		for (var i=0; i<oRoot.childNodes.length; i++) {
			node = oRoot.childNodes[i];
			if (node.nodeName=="LI") {
				var nodeitem;
				if(nodeitem = node.getElementsByTagName("UL")[0]){
					
						
					node.onmousemove=function() {h();}
					node.onmouseover=function() {
						setTimeout("s()", 300);
						this.getElementsByTagName("UL")[0].style.display = "block";
						this.getElementsByTagName("UL")[0].style.visibility = "visible";
						var nodeitems = this.getElementsByTagName("LI");
						for(var j = 0 ; j < nodeitems.length ; j ++) {
							var arrSpans = nodeitems[j].getElementsByTagName("SPAN");
							for(var it in arrSpans) {
								
								switch(arrSpans[it].className) { 
									case 	'righttop': 
									case	'lefttop': 
									case  'left': 
									case  'right': 
									case  'leftbottom': 
									case 	'rightbottom': 
									var temp = nodeitems[j].getElementsByTagName("A")[0]; 
									if(temp.clientHeight) { 
										arrSpans[it].style.height = (parseInt(temp.clientHeight, 10) + 2) + "px";
									}
									break;
									default:break;
								}
								//alert(arrSpans[it].className);
							}
						}
					

					}
					node.onmouseout=function() {
						this.getElementsByTagName("UL")[0].style.display = "none";
						this.getElementsByTagName("UL")[0].style.visibility = "hidden";
						setTimeout("h()", 300); 
					}
				}
			}
		}
	}
}
window.onload = function(){	reconstructTheMenu();act();}
window.onresize = function(){	reconstructTheMenu();}

function s() {
	k = $$('select');
	for(i in k) if(k[i].type) {k[i].style.visibility = "visible";}
}

function h() {
	k = $$('select');
	for(i in k)	if(k[i].type) k[i].style.visibility = "hidden";
}
window.onload = function()  {startup();}

function initSound() {
	var autostart = inits;
	/*$('sound').innerHTML = ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="17" height="17" id="sound" align="middle">' +
		'<param name="allowScriptAccess" value="sameDomain" />' +
		'<param name="allowFullScreen" value="false" />' +
		'<param name="FlashVars" value="playsound=' + autostart + '" />' +
		'<param name="movie" value="/media/sound.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />	<embed src="/media/sound.swf" FlashVars="playsound=' + autostart + '" quality="high" bgcolor="#ffffff" width="17" height="17" name="sound" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
		'</object>');
		*/
	if($('main_front_images')) { $('main_front_images').innerHTML = ('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="938" height="400px" align="middle">'+
			'<param name="allowScriptAccess" value="sameDomain" />'+
			'<param name="movie" value="/media/frontpanel.swf?file=/da" />'+
			'<param name="quality" value="high" />'+
			'<param name="wmode" value="transparent" />'+
			'<param name="bgcolor" value="#FFFFFF" />'+
			'<embed src="/media/frontpanel.swf?file=/da" quality="high" wmode="transparent" bgcolor="#FFFFFF" width="938" height="400px" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'+
			'</object>');
		}
}


function toggleSound(bSound) {
	
	new Ajax.Request(bSound ? "/media/toggleSound.asp?play=1&t=" + Math.random(10000000) : "/media/toggleSound.asp?play=&t=" + Math.random(10000000), {
  method: 'get',
  onComplete: function(transport) {
  }
});
}

function PopWin(mypage,myname,w,h,scroll,pos){
	if(pos=="random")	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}

	if(pos=="center")	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}

	else if((pos!="center" && pos!="random") || pos==null)	{
		LeftPosition=0;TopPosition=0
	}

	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	myname1 = myname + Math.round(1099999999*Math.random());

	win=window.open('about:blank',myname1,settings);
	
	win.document.write("<html><head><title>Billedvisning</title></head><body><div style=\"position:absolute;top:0px;left:0px;Height:480px;width:640px;background:URL(" + mypage + ");\"><img height=640 width=480 src=\"/img/sp.gif\"/></div></body></html>");
	win.status = 'Done';
	
	
}

function PopWindow(mypage,myname,w,h,scroll,pos){
	if(pos=="random")	{
		LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;
		TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;
	}

	if(pos=="center")	{
		LeftPosition=(screen.width)?(screen.width-w)/2:100;
		TopPosition=(screen.height)?(screen.height-h)/2:100;
	}

	else if((pos!="center" && pos!="random") || pos==null)	{
		LeftPosition=0;TopPosition=0
	}

	settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
	myname1 = myname + Math.round(1099999999*Math.random());

	win=window.open(mypage,myname1,settings);
	
	
}
