/* page.js|global */
// page object
var Page = new function(){

	// Utility functions object (all functions declared in utilities)
	this.Util = new Object();
	// Page element Objects array
	this.Objects = new Array();

	// defining Page.HOST, Page.GFX based on hosts page.js inclusion path
	this.SRC = document.getElementById("page.js") ? document.getElementById("page.js").src : false;
	if(this.SRC){
		this.HOST = this.SRC.replace("/page.js", "");
		this.GFX = this.HOST+"/img";
	}else{
		alert("Fejl i inkluderingen af page.js");
	}

}
/* util_stats.js|customers */
var RE={"%09":/\t/g,"%20":/ /g,"%23":/\#/g,"%26":/\&/g,"%2B":/\+/g,"%3F":/\?/g,"%5C":/\\/g};

var DCS = new Object();
var WT = new Object();
var DCSext = new Object();

var gDomain = "statistik.3f.dk";
var gDcsId = "dcsg4elv8svvt9qtu630b0her_4p9k";


function dcsVar(){
	var dCurrent = new Date();
	WT.tz = dCurrent.getTimezoneOffset()/60*-1;
	WT.bh = dCurrent.getHours();
	WT.ul = (navigator.appName == "Netscape") ? navigator.language : navigator.userLanguage; 
	if(typeof(screen) == "object"){
		WT.cd = screen.colorDepth;
		WT.sr = screen.width+"x"+screen.height;
	}
	if(typeof(navigator.javaEnabled()) == "boolean"){
		WT.jo = navigator.javaEnabled() ? "Yes" : "No";
	}
	if(document.title){
		WT.ti=document.title;
	}
	WT.js = "Yes";

	DCS.dcsdat = dCurrent.getTime();
	DCS.dcssip = window.location.hostname;
	DCS.dcsuri = window.location.pathname;
	if(window.location.search){
		DCS.dcsqry = window.location.search;
	}
	if((window.document.referrer != "") && (window.document.referrer != "-")){
		if(!(navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) < 4)){
			DCS.dcsref = window.document.referrer;
		}
	}
}

function A(N,V){
	return "&" + N + "=" + dcsEscape(V);
}

function dcsEscape(S){
	if(typeof(RE) != "undefined"){
		var retStr = new String(S);
		for(R in RE){
			retStr = retStr.replace(RE[R],R);
		}
		return retStr;
	}else{
		return escape(S);
	}
}

function dcsCreateImage(dcsSrc){
	if(document.images){
		var gImages = new Image();
		gImages.src = dcsSrc;
	}else{
		document.write('<img border="0" name="DCSIMG" width="1" height="1" src="' + dcsSrc + '">');
	}
}

function dcsMeta(){
	var myDocumentElements;
	if(document.all){
		myDocumentElements = document.all.tags("meta");
	}else if(document.documentElement){
		myDocumentElements = document.getElementsByTagName("meta");
	}
	if(typeof(myDocumentElements) != "undefined"){
		for(var i = 1; i <= myDocumentElements.length; i++){
			var myMeta = myDocumentElements.item(i-1);
			if(myMeta.name){
				if(myMeta.name.indexOf('WT.') == 0){
					WT[myMeta.name.substring(3)] = myMeta.content;
				}else if(myMeta.name.indexOf('DCSext.') == 0){
					DCSext[myMeta.name.substring(7)] = myMeta.content;
				}else if(myMeta.name.indexOf('DCS.') == 0){
					DCS[myMeta.name.substring(4)] = myMeta.content;
				}
			}
		}
	}
}

function dcsTag(){
	var P = "http" + (window.location.protocol.indexOf('https:') == 0 ? 's' : '') + "://" + gDomain + (gDcsId == "" ? '' : '/' + gDcsId) + "/dcs.gif?";
	for(N in DCS){
		if(DCS[N]){
			P += A(N,DCS[N]);
		}
	}
	for(N in WT){
		if(WT[N]){
			P += A("WT." + N,WT[N]);
		}
	}
	for(N in DCSext){
		if(DCSext[N]){
			P += A(N,DCSext[N]);
		}
	}
	if(P.length > 2048 && navigator.userAgent.indexOf('MSIE') >= 0){
		P = P.substring(0,2040) + "&WT.tu=1";
	}
	dcsCreateImage(P);
}

if(location.href.match(/3fi.dk|3f.dk|tillid.dk/g)){
	dcsVar();
	dcsMeta();
	dcsTag();
}
/* Stats end */
/* util_basics.js|global */
/* START browser definition utilities */
Page.Util.explorer = function(){
	if(document.all){
		return true;
	}
	return false;
}
Page.Util.safari = function(){
	if(navigator.appVersion.indexOf("Safari") >= 0){
		return true;
	}
	return false;
}
Page.Util.firefox = function(){
	if(navigator.userAgent.indexOf("Firefox") >= 0){
		return true;
	}
	return false;
}
/* END browser definition utilities */

// kills click (to prevent click from bubbling)
Page.Util.nonClick = function(event){
	event = event ? event : window.event;
	if(event.preventDefault){event.preventDefault();}
	if(event.stopPropagation){event.stopPropagation();}
	event.returnValue = false;
	event.cancelBubble = true;
}

// add event handler ...
Page.Util.addEventHandler = function(element, eventType, action){
	if(Page.Util.explorer()){
		element.attachEvent("on" + eventType, action);
	}else{
		element.addEventListener(eventType, action, false);
	}
}
// remove event handler 
Page.Util.removeEventHandler = function(element, eventType, action){
	if(Page.Util.explorer()){
		element.detachEvent("on" + eventType, action);
	}else{
		element.removeEventListener(eventType, action, false);
	}
}

// extracting variable from location search
Page.Util.getVar = function(string){
	var startIndex = (location.search.indexOf("&" + string + "=") > -1) ? location.search.indexOf("&" + string + "=") + string.length + 2 : ((location.search.indexOf("?" + string + "=") > -1) ? location.search.indexOf("?" + string + "=") + string.length + 2 : false);
	var endIndex = (location.search.substring(startIndex).indexOf("&") > -1) ? location.search.substring(startIndex).indexOf("&")+startIndex : false;
	var returnString = (startIndex) ? location.search.substring(startIndex,((endIndex) ? endIndex : location.search.length)): "";
	return returnString;
}

// compiles mailto link based on name and domain
Page.Util.otliam = function(name, domain){
	document.write('<a href="mailto:'+name+'@'+domain+'">'+name+"@"+domain+'</a>');
}
/* head_order.js|customers */
// creating page header
Page.getHeadOrder = function(){
	var html = '';

	// HEAD MENU begin
	html += (typeof(this.Menu) == "object") ? Page.Menu.createTop() : '';
	// HEAD MENU end

	// BANNER begin
	html += (typeof(this.createBanner) == "function" && this.getLayout().ext.match(/headBanner/g)) ? this.createBanner() : '';
	// BANNER end

	// PATH begin
	html += (typeof(this.createPath) == "function" && !this.getLayout().frontpage) ? this.createPath() : '';
	// PATH end
	
	// HEAD end
	return html;
}
/* head.js|global */
// creating page header
Page.getHeader = function(){
	var header_root_url, header_root_title, header_logo, header_image, html;

	html = '';
	// HEAD begin
	html += '<div id="mdHead">';
	html += '<div id="mdHeadSub">';

	html += '<div id="mdHeadSubInner">';
	
	// HEAD LEFT begin
	html += '<div id="mdHead1">';
	html += '<div id="mdHead1Sub">';
	html += '<div id="mdHead1SubInner">';

	// LOGO begin
	header_root_url = Page.XMLVars.getShellNodeValue("header_root_url");
	header_root_url = header_root_url ? header_root_url : '/';
	header_root_title = Page.XMLVars.getShellNodeValue("header_root_title");
	header_root_title = header_root_title ? header_root_title : 'Tilbage til forsiden';
	header_logo = Page.XMLVars.getShellNodeValue("header_logo");
	header_logo = header_logo ? header_logo : Page.GFX+'/logo.png';
	header_image = Page.XMLVars.getShellNodeValue("header_image");

	html += '<a href="'+header_root_url+'" title="'+header_root_title+'" id="mdLogo">';
	html += '<img src="'+header_logo+'" id="mdLogo1" alt="Logo" />';
	html += header_image ? '<img src="' + header_image + '" id="mdLogo2" alt="Logo" />' : '';
	html += '</a>';
	// LOGO end

	html += '<h1 class="mdAccess">'+this.getTitle()+'</h1>';

	// LANGUAGE begin
	html += (typeof(this.createLanguage) == "function") ? this.createLanguage() : '';
	// LANGUAGE end

	html += '<hr class="mdAccess" />';

	html += '</div>';
	html += '</div>';
	html += '</div>';
	// HEAD LEFT end

	// HEAD RIGHT begin -->
	html += '<div id="mdHead2">';
	html += '<div id="mdHead2Sub">';
	html += '<div id="mdHead2SubInner">';

	html += (typeof(this.HeaderSearch) == "object") ? this.HeaderSearch.createSearch() : '';
	html += (typeof(this.createHeadMisc) == "function") ? this.createHeadMisc() : '';

	html += '</div>';
	html += '</div>';
	html += '</div>';
	// HEAD RIGHT end
	
	html += '</div>';

	// local head-order
	if(typeof(this.getHeadOrder) == "function"){
		html += this.getHeadOrder();
	// default head-order
	}else{
		// HEAD MENU begin
		html += (typeof(this.Menu) == "object") ? this.Menu.createTop() : '';
		// HEAD MENU end

		// PATH begin
		html += (typeof(this.createPath) == "function" && !this.getLayout().frontpage) ? this.createPath() : '';
		// PATH end
	}

	html += '</div>';
	html += '</div>';
	// HEAD end
	return html;
}
/* obj_sitemap.js|global */
Page.Objects["sitemap"] = new function(){
	
	// default query to false
	this.query = false;
	this.indent = 0;
	this.sitemap = false;

	this.checkForMatch = function(name, desc){
		if(name.match(this.query_regexp)){
			return true;
		}
		return false;
	}

	// iterates through all children
	this.iteratePages = function(content){
		var i, url, name, children, child, html;
		// local html container
		html = '';
		if(content){
			// loop through children
			this.indent++;
			for(i = 0; child = content.childNodes[i]; i++){
				
				url = Page.XMLVars.getChildNodeValue(child, "url");
				name = Page.XMLVars.getChildNodeValue(child, "name");

				children = Page.XMLVars.getChildren(child);
				children = this.iteratePages(children);

				// if no sort query, children or matching query, start item
				if(!this.query || children || (this.checkForMatch(name) && url)){
					html += '<li>';
					html += (url ? '<a href="'+url+'" title="'+name+'">' : '')+name.cutString(20 - this.indent*3)+(url ? '</a>' : '');
					// if children, add container with children
					if(children){
						html += '<ul>';
						html += children;
						html += '</ul>';
					}
					html += '</li>';
				}
			}
			this.indent--;
		}
		return html;
	}

	// iterates through top level children (sub_frontpages)
	this.iterateFrontpages = function(content){
		var i, url, name, children, child, html;
		// local html container
		html = '';
		if(content){
			// loop through top level children
			for(i = 0; child = content.childNodes[i]; i++){
				if(child.nodeName.toLowerCase() == "menuitem"){
					url = Page.XMLVars.getChildNodeValue(child, "url");
					name = Page.XMLVars.getChildNodeValue(child, "name");

					children = Page.XMLVars.getChildren(child);
					children = this.iteratePages(children);

					// if no sort query, children or matching query
					if(!this.query || children || (this.checkForMatch(name) && url)){
						html += '<li>';
						html += (url ? '<a href="'+url+'" class="altLink1" title="'+name+'">' : '' )+name.cutString(20)+(url ? '</a>' : '');

						// if children, add container with children
						if(children){
							html += '<ul>';
							html += children;
							html += '</ul>';
						}

						html += '</li>';
					}
				}
			}
		}
		return html;
	}

	// initiates 
	this.search = function(element){
		var i, url, name, children, child, html;
		
		if(this.sitemap){

			// reset html
			html = '';

			// define query
			this.query = (element ? (element.value != "" ? element.value : false) : false);
			this.query_regexp = new RegExp(this.query, "i");

			if(Page._sitemap){
	
				// loop through top level
				for(i = 0; child = Page._sitemap.childNodes[i]; i++){
					if(child.nodeName.toLowerCase() == "menuitem"){
					
						url = Page.XMLVars.getChildNodeValue(child, "url");
						name = Page.XMLVars.getChildNodeValue(child, "name");

						children = Page.XMLVars.getChildren(child);
						children = this.iterateFrontpages(children);

						html += '<div class="mdColumn1">';
						html += '<h3>'+(url ? '<a href="'+url+'" class="altLink1" title="'+name+'">' : '')+name.cutString(20)+(url ? '</a>' : '')+'</h3>';

						// do we have any children
						if(children){
							// get first level children
							html += '<ul>';
							html += children;
							html += '</ul>';
							html += '<div class="hr"><hr/></div>';
						}
						html += '</div>';
					}
				}
			}

			// write html to container
			this.sitemap_content.innerHTML = html;
		}
	}

	// initiates 
	this.init = function(element){

		this.sitemap_search = Page.Util.getElementsByClassName("sitemap:search", element) ? Page.Util.getElementsByClassName("sitemap:search", element)[0] : false;
		this.sitemap_content = Page.Util.getElementsByClassName("sitemap:content", element) ? Page.Util.getElementsByClassName("sitemap:content", element)[0] : false;
		if(this.sitemap_search && this.sitemap_content){
			this.sitemap = element;

			this.sitemap_search.onkeyup = function(){
				Page.Objects["sitemap"].search(this);
			}

			// do we have any content
			if(Page._sitemap){
				this.search(this.sitemap_search);
			}else if(Page._menucontent){
				Page._sitemap = Page._menucontent;
				this.search(this.sitemap_search);
			}
		}
	}
}
/* menu.js|global */
Page.Menu = new Object();
/* obj_message.js|global */
Page.Message = new function(){

	// content
	this._subject = false;
	this._header = false;
	this._body = new Array();
	this._buttons = new Array();
	this._return_focus = false;

	// containers
	this.mdMessage = false;
	this.mdMessageWrap = false;
	
	// set message subject
	this.setSubject = function(text){
		this._subject = text;
	}
	// set message header
	this.setHeader = function(text){
		this._header = text;
	}
	// add bodytext element
	this.addBodyText = function(text){
		this._body[this._body.length] = text;
	}
	// add button
	this.addButton = function(label, action){
		this._buttons[this._buttons.length] = {label:label, action:action};
	}

	// set return focus (return focus to element on close)
	this.setReturnFocus = function(element){
		this._return_focus = element;
	}

	this.open = function(type){
		var html, i, mdMessage, mdMessageSub, subject, mdMessageBody, page_scroll, line;
		// if messageWrap element doesn't exist, create it
		if(!this.messageWrap){
			this.messageWrap = document.createElement('div');
			this.messageWrap.id = "mdMessageWrap";
			this.messageWrap.style.height = document.getElementById('mdWrap') ? document.getElementById('mdWrap').offsetHeight+"px" : "100%";
			this.messageWrap.style.filter = 'alpha(opacity=60)';
			this.messageWrap.style.MozOpacity = '0.6';
			document.body.appendChild(this.messageWrap);

			
			this.message = document.createElement('div');
			this.message.id = "mdMessage";
			document.body.appendChild(this.message);
		}

		// add default types
		this._icon = (type == "error" || type == "warning") ? type+"Box" : "infoBox";
		this._subject = this._subject ? this._subject : "Besked";
		this._header = this._header ? this._header : "Besked";

		// if no buttons declared, insert default ok-button to close window
		if(this._buttons.length == 0){
			this._buttons[0] = {label:"OK", action:"Page.Message.close()"};
		}

		mdMessage = document.createElement("div");
		mdMessage.className = "mdMessage "+this._icon;
		this.message.appendChild(mdMessage);

		mdMessageSub = document.createElement("div");
		mdMessageSub.className = "mdMessageSub";
		mdMessage.appendChild(mdMessageSub);

	 	subject = document.createElement("h1");
		subject.innerHTML = this._subject;
		mdMessageSub.appendChild(subject);

		mdMessageBody = document.createElement("div");
		mdMessageBody.className = "mdMessageBody";
		mdMessageSub.appendChild(mdMessageBody);
		
		html = '';
		html += '<h2>'+this._header+'</h2>';

		html += '<p>';
		// create body element
		for(i = 0; line = this._body[i]; i++){
			html += line.replace("\n", "<br />")+'<br />';
		}
		html += '</p>';

		// create button elements
		for(i = this._buttons.length-1; i >= 0; i--){
			html += '<button class="inputHalf" onclick="'+this._buttons[i].action+'">'+this._buttons[i].label+'</button>';
		}

		mdMessageBody.innerHTML = html;

		// is the page scrolled
		page_scroll = window.scrollY ? window.scrollY : document.body.parentNode.scrollTop;

		// fix append scrolling error i firefox, by displaying none at append, and making sure element is in viewable area before displaying block
		this.message.style.top = page_scroll + 'px';
		this.messageWrap.style.display = 'block';
		this.message.style.display = 'block';
		Page.Obstructions.hideObstructions(this.messageWrap);

		// position elements and show them
		this.message.style.left = (this.messageWrap.offsetWidth-this.message.offsetWidth)/2+'px';
		this.message.style.top = ((Page.Util.docHeight()-this.message.offsetHeight)/2)+page_scroll+'px';
		this.messageWrap.style.visibility = 'visible';
		this.message.style.visibility = 'visible';

		this.message.getElementsByTagName("button")[0].focus();
	}

	this.close = function(){
		var i;
		Page.Obstructions.restoreObstructions(this.messageWrap);
		// hide elements
		this.messageWrap.style.visibility = 'hidden';
		this.message.style.visibility = 'hidden';
		this.messageWrap.style.display = 'none';
		this.message.style.display = 'none';

		for(i = 0; i < this.message.childNodes.length; i){
			Page.Message.message.removeChild(Page.Message.message.childNodes[i]);
		}

		// reset 
		this._title = false;
		this._icon = false;
		this._header = false;
		this._body = new Array();
		this._buttons = new Array();

		// return focus to given element, if defined
		if(this._return_focus){
			this._return_focus.focus();
		}
		this._return_focus = false;
	}
}
/* obj_hint.js|global */
Page.Objects["hint"] = new function(){

	this.init = function(element){
		var container = Page.Util.getElementsByClassName("hint", element) ? Page.Util.getElementsByClassName("hint", element)[0] : false;
		if(container){
			element.container = document.body.appendChild(element.removeChild(container));
		}

		element.onmouseover = function(event){
			if(this.container){
				var page_scroll;
				event = event ? event : (window.event) ? window.event : false;
				page_scroll = window.scrollY ? window.scrollY : document.body.parentNode.scrollTop;
				if(event){
					this.container.style.left = event.clientX+5+"px";
					this.container.style.top = event.clientY+5+page_scroll+"px";
				}
				this.container.style.display = "block";
			}
		}
		element.onmouseout = function(){
			this.container.style.display = "none";
		}
	}
}

/* specialcolumn.js|global */
Page.insertSpecialColumns = function(){
	// check for existance of special object
	if(this.getLayout().special){
		if(this.getLayout().special.match(/specialLeft/g) && document.getElementById("specialLeft")){
			var specialLeft = document.getElementById("specialLeft").parentNode.removeChild(document.getElementById("specialLeft"));
			specialLeft.id = "";
			document.getElementById("mdBodyLeftSubInner").appendChild(specialLeft);
		}
		if(this.getLayout().special.match(/specialRight/g) && document.getElementById("specialRight")){
			var specialRight = document.getElementById("specialRight").parentNode.removeChild(document.getElementById("specialRight"));
			specialRight.id = "";
			document.getElementById("mdBodyRightSubInner").appendChild(specialRight);
		}
	}
}
/* body.js|global */
// create the content body
Page.getBody = function(){
	var html = '';

	// BODY begin
	html += '<div id="mdBody"'+(this.getLayout().special ? ' class="'+this.getLayout().special+'"' : '')+'>';
	html += '<div id="mdBodySub">';
	html += '<div id="mdBodySubInner">';
	html += '<div id="mdBodySubInnerBody">';
	html += '<div id="mdBodySubInnerBodySub">';
	html += '<div id="mdBodySubInnerBodySubInner">';

	// BODY MAIN begin
	html += '<div id="mdBodyMain">';
	html += '<div id="mdBodyMainSub">';
	html += '<div id="mdBodyMainSubInner">';

	// insert left column?
	if(!this.getLayout().no_left){
		// BODY LEFT begin
		html += '<div id="mdBodyLeft">';
		html += '<div id="mdBodyLeftSub">';
		html += '<div id="mdBodyLeftSubInner">';

		// BODY LEFT MENU begin
		if(!this.getLayout().no_menu){
			html += Page.Menu.createLeftMenu((Page.Menu._selected_top !== false ? Page.XMLVars.getChildNode(Page.Menu._selected_top, "children") : Page._menucontent));
		}
		// BODY LEFT MENU end

		html += '</div>';
		html += '</div>';
		html += '</div>';
		// BODY LEFT end
	}

	// BODY CONTENT begin
	html += '<div id="mdBodyContent">';
	html += '<hr class="mdAccess" />';	
	html += '<div id="mdBodyContentSub">';
	html += '<div id="mdBodyContentSubInner">';
		
	return html;
}

Page.endBody = function(){
	var html = '';

	html += '</div>';
	html += '</div>';

	html += '</div>';
	// BODY CONTENT end

	html += '</div>';
	html += '</div>';
	html += '</div>';
	// BODY MAIN end

	// BODY RIGHT begin
	if(!this.getLayout().no_right){
		html += '<div id="mdBodyRight">';
		html += '<div id="mdBodyRightSub">';
		html += '<div id="mdBodyRightSubInner">';
		
		html += '</div>';
		html += '</div>';
		html += '</div>';
	}
	// BODY RIGHT end

	html += '</div>';
	html += '</div>';
	html += '</div>';
	html += '</div>';
	html += '</div>';
	html += '</div>';
	// BODY end

	return html;
}
/* foot.js|global */
Page.createFoot = function(){
	var html
	html = '';
	// FOOT begin
	html += '<div id="mdFoot">';
	html += '<div id="mdFootSub">';
	html += '<div id="mdFootSubInner">';
	html += '<hr class="mdAccess" />';

	// PUBLISHER begin
	html += (typeof(this.createFootPublisher) == "function") ? this.createFootPublisher() : '';
	// PUBLISHER end

	// LINKS begin
	html += (typeof(this.createFootLinks) == "function") ? this.createFootLinks() : '';
	// LINKS end

	html += '</div>';
	html += '</div>';
	html += '</div>';
	// FOOT end
	return html;
}

/* popup.js|global */
// open popup window
Page.Util.popUp = function(url, name, w, h, extras){
	name = (name) ? name : "POPUP_" + new Date().getHours() + "_" + new Date().getMinutes() + "_" + new Date().getMilliseconds();
	w = (w) ? w : 600;
	h = (h) ? h : 600;
	var parameters = "width=" + w + ",height=" + h;
	parameters += ",scrollbars=0,left=" + (screen.width-w)/2;
	parameters += ",top=" + ((screen.height-h)-20)/2;
	if(extras){
		parameters += "," + extras;
	}else{
		parameters += ",scrollbars";
	}
	document[name] = window.open(url, name, parameters);
}
/* util_string.js|global */
// limits length of string and adds dots
String.prototype.cutString = function(strLength){
	var entityReducer = function(tempString, start){
		var reducing;
		if(tempString.substring(start, strLength).indexOf("&") != -1){
			if(tempString.substring(start, strLength).indexOf("&") == tempString.substring(start, strLength).indexOf("& ")){
				reducing = entityReducer(tempString, (tempString.substring(start, strLength).indexOf("&")+1+start));
			}else{
				strLength = strLength + (tempString.indexOf(";") != -1 ? (tempString.indexOf(";")) - tempString.indexOf("&") : 0);
				reducing = entityReducer(tempString, (tempString.indexOf(";") != -1 ? (tempString.substring(start, strLength).indexOf(";")+1+start) : (tempString.substring(start, strLength).indexOf("&")+1+start)));
			}
		}else{
			return true;
		}
		return reducing;
	}
	if(this.length > strLength){
		var reduced = entityReducer(this, 0);
	}
	return this.substring(0, strLength) + (this.length > strLength ? "..." : "");
}

// trim whitespace and crlf
String.prototype.trim = function(string) {
	return this.replace(/^\s+|\s+$/g, "");
}
/* util_position.js|global */
/* START position utilities */
Page.Util.absoluteLeft = function(e){
	if(Page.Util.safari() && e.nodeName == "TR"){
		return e.getElementsByTagName("TD")[0].offsetLeft + Page.Util.absoluteLeft(Page.Util.getParentTag("TABLE",e));
	}else if(e.offsetParent){
		return e.offsetLeft + Page.Util.absoluteLeft(e.offsetParent);
	}
	return e.offsetLeft;
} 
Page.Util.absoluteTop = function(e){
	if(Page.Util.safari() && e.nodeName == "TR"){
		return e.getElementsByTagName("TD")[0].offsetTop + Page.Util.absoluteTop(Page.Util.getParentTag("TABLE",e));
	}else if(e.offsetParent){
		return e.offsetTop + Page.Util.absoluteTop(e.offsetParent);
	}
	return e.offsetTop;
}
Page.Util.docWidth = function(){
	var width;
	if(self.innerHeight){
		width = self.innerWidth;
	}else if(document.documentElement && document.documentElement.clientHeight){
		width = document.documentElement.clientWidth;
	}else if(document.body){
		width = document.body.clientWidth;
	}
	return width;
}
Page.Util.docHeight = function(){
	var height;
	if(self.innerHeight){
		height = self.innerHeight;
	}else if(document.documentElement && document.documentElement.clientHeight){
		height = document.documentElement.clientHeight;
	}else if(document.body){
		height = document.body.clientHeight;
	}
	return height;
}
/* END position utilities */
/* page_basic.js|global */
// include stylesheets
document.write('<link rel="stylesheet" href="'+Page.HOST+'/page.css" media="all" type="text/css">');
document.write('<!--[if lte IE 7]><link rel="stylesheet" type="text/css" media="all" href="'+Page.HOST+'/ie.css" /><![endif]-->');
document.write('<link rel="stylesheet" href="'+Page.HOST+'/print.css" media="print" type="text/css">');

// include default icons
document.write('<link rel="icon" href="'+Page.GFX+'/favicon.ico" type="image/x-icon" />');
document.write('<link rel="shortcut icon" href="'+Page.GFX+'/favicon.ico" type="image/x-icon" />');

// page object vars
Page._layout = new Object();        // layout object

Page._menucontent = false;
Page._shellcontent = new Array();
Page._sitemap = false;

// page identification handlers
Page._trail = new Array();          // containing trail names
Page._trailSuccess = false;         // is the page identified

// basic page variables
Page._username = "";                // page username (otherwise set in menu.aspx)
Page._title = "";                   // page title (otherwise set by chosen menu item)
Page._browsertitle = false;         // browser title (otherwise set by title)
Page._dogtag = "";                  // page identification

// set page layout
// typ = layout type : 1-9
// ext = special setting : specielLeft|specielRight|specialBoth|frontPage
Page.setLayout = function(typ, ext){

	this._layout.typ = typ;
	this._layout.ext = (ext == undefined) ? "" : ext;
	
	this._layout.special = false;
	this._layout.no_menu = false;
	this._layout.frontpage = false;
	
	if(this._layout.typ == 1){
		this._layout.no_left = true;
		this._layout.no_menu = true;
	}
	if(this._layout.typ == 1 || this._layout.typ == 2){
		this._layout.no_right = true;
	}
	if(this._layout.typ == 7 || this._layout.typ == 9){
		this._layout.no_lefthead = true;
	}
	if(this._layout.typ == 7 || this._layout.typ == 9){
		this._layout.no_contenthead = true;
	}

	// check extension parameter, ext
	if(this._layout.ext.match(/specialLeft/g)){
		this._layout.special = "specialLeft";
		this._layout.no_lefthead = true;
		this._layout.no_menu = true;
	}else if(this._layout.ext.match(/specialRight/g)){
		this._layout.special = "specialRight";
	}else if(this._layout.ext.match(/specialBoth/g)){
		this._layout.special = "specialLeft specialRight";
		this._layout.no_lefthead = true;
		this._layout.no_menu = true;
	}else if(this._layout.ext.match(/frontPage/g)){
		this._layout.frontpage = true;
	}else if(this._layout.ext.match(/popup/g)){
		document.write('<link rel="stylesheet" href="'+Page.HOST+'/popup.css" media="all" type="text/css">');
	}

	// include devevelopment css
	if(typeof(Page.XMLVars) == "object" && Page.XMLVars.getShellNode("dev")){
		document.write('<link rel="stylesheet" href="'+Page.XMLVars.getShellNodeValue("dev")+'" media="all" type="text/css">');
	}

}

// creating header based on layout
Page.header = function(){
	// identify page
	if(this.getLayout().ext != "popup"){
		this.identifyPage();
	}
	// set browser title
	this.setDocumentTitle();

    var html = '';
    html += this.getPageWrap();
    html += (this.getLayout().ext != "popup") ? (typeof(this.getHeader) == "function" ? this.getHeader() : '') : '';
    html += this.getBody();
    document.write(html);
}

// creating footer
Page.footer = function(){
	
    var html = '';
    html += this.endBody();
    html += (this.getLayout().ext != "popup") ? (typeof(this.createFoot) == "function" ? this.createFoot() : '') : '';
    html += this.endPageWrap();
    document.write(html);

	// insert special columns if function exists
	if(typeof(this.insertSpecialColumns) == "function"){
		this.insertSpecialColumns();
	}

	// global initiation of button and input effects
	if(typeof(this.Util.awakeInterface) == "function"){
		this.Util.awakeInterface();
	}
}

// identifying the current page in menucontent based on dogtag
Page.identifyPage = function(){
	var node;
	// iterator identifying page position
	this.iterate = function(element){

		if(element.parentNode.nodeName.toLowerCase() == "menuitem"){
			this._trail = this._trail.unshiftElement(element.parentNode);
			return this.iterate(element.parentNode);
		}else if(element.parentNode.nodeName.toLowerCase() == "children"){
			return this.iterate(element.parentNode);
		}else if(element.parentNode.nodeName.toLowerCase() == "menucontent"){
			if(this._trail.length){
				return true;
			}else{
				return false;
			}
		}

		// loop ended, page still unidentified
		return false;
	}
	// if menucontent exists, try to identify page
	if(this._menucontent){
		node = Page.XMLVars.getElementByDogtag(this.getDogtag(), this._menucontent);
		if(node){
			this._trailSuccess = this.iterate(node);
		}else if(!this.getLayout().no_menu){
			// submit error?
		}
	}else{
		// submit error?
	}
}

// set dogtag, NOT optional, identifies this page to secure writeout of correct menu
Page.setDogtag = function(string){
	this._dogtag = string;
}
// set username in hostpage head, optional
Page.setUsername = function(string){
	this._username = string;
}
// set title in hostpage head, optional
Page.setTitle = function(string){
	this._title = string;
}
// set browser title, called from header function
Page.setBrowserTitle = function(string){
	this._browsertitle = string;
}
// set document title, updates browser title if new title has been assigned
Page.setDocumentTitle = function(){
	var title = false;
	if(document.title.length < 2){
		title = this.getBrowserTitle();
	}
	document.title = title ? title : document.title;
}
// overwrite default fav icon, called from head
Page.setFavIcon = function(icon){
	document.write('<link rel="icon" href="'+icon+'" type="image/x-icon" />');
	document.write('<link rel="shortcut icon" href="'+icon+'" type="image/x-icon" />');
}

// returns dogtag
Page.getDogtag = function(){
	return this._dogtag;
}
// returns layout
Page.getLayout = function(){
	return this._layout;
}
// getting page title
Page.getTitle = function(){
	// if set by hostpage
	if(this._title != ''){
		return this._title;
	// else if found through dogtag
	}else if(this._trailSuccess){
		return Page.XMLVars.getChildNodeValue(this._trail[this._trail.length-1], "name");
	}else{
		return "";
	}
}
// return browsertitle if set, or page title
Page.getBrowserTitle = function(){
	if(this._browsertitle){
		return this._browsertitle;
	}else{
		return this.getTitle();
	}
}
// getting page title
Page.getTitleUrl = function(){
	if(this._trailSuccess){
		return Page.XMLVars.getChildNodeValue(this._trail[this._trail.length-1], "url");
	}else{
		return false;
	}
}
// getting page title
Page.getMenuTitle = function(){
	if(this._trailSuccess && this._trail.length >= 1){
		return Page.XMLVars.getChildNodeValue(this._trail[0], "name");
	}else{
		return "";
	}
}
// getting page title
Page.getMenuTitleUrl = function(){
	if(this._trailSuccess && this._trail.length >= 1){
		return Page.XMLVars.getChildNodeValue(this._trail[0], "url");
	}else{
		return false;
	}
}

/* page_wrap.js|global */
// creating page wrap div
Page.getPageWrap = function(){
	var html = '<div id="mdWrap" class="mdSt'+this.getLayout().typ+'">';
	html += '<div id="mdWrapSub">';
	html += '<div id="mdWrapSubInner">';
	return html;
}
Page.endPageWrap = function(){
	var html = '</div>';
	html += '</div>'
	html += '</div>'
	return html;
}
/* load_variables.js|global */
// load xml variables for menu and shell
Page.loadXMLVariables = function(file){
	Page.Ajax.send(file, Page.XMLVars.parse, Page.XMLVars, "", false, "GET");
}

// load xml variables for menu and shell as a string
Page.loadXMLStringVariables = function(string){
	var xml = new Object();
	if(Page.Util.safari()){
		xml.resultText = string;
	}else if(Page.Util.explorer()){
		xml.result = new ActiveXObject("Microsoft.XMLDOM") 
		xml.result.async="false"; 
		xml.result.loadXML(string);
	}else{
		xml.result = (new DOMParser()).parseFromString(string, "text/xml");
	}
	Page.XMLVars.parse(xml);
}
/* obj_xmlvars.js|global */
Page.XMLVars = new function(){

	this.parse = function(response){
		if(response){
			var container;
			// pass response to html (to avoid xml dom issues in safari)
			if(Page.Util.safari()){
				container = document.createElement("div");
				container.innerHTML = response.resultText;

			// otherwise just pass xml object
			}else{
				container = response.result;
			}

			// menucontent => menu structure
			if(container.getElementsByTagName("menucontent").length){
				Page._menucontent = container.getElementsByTagName("menucontent")[0];
			}
			// menuextension (directly append elements to menucontent)
			if(container.getElementsByTagName("menuextension").length){
				this.appendToMenucontent(container.getElementsByTagName("menuextension"));
			}
			// shellvars => array of childelements (each will be overwritten)
			if(container.getElementsByTagName("shellcontent").length){
				this.updateShellcontent(container.getElementsByTagName("shellcontent"));
			}
			// menucontent => menu structure
			if(container.getElementsByTagName("sitemap").length){
				Page._sitemap = container.getElementsByTagName("sitemap")[0];
			}
		}
	}

	// update shell content variables by overwriting existing entries
	this.updateShellcontent = function(shellcontents){
		var shellcontent, element, i;
		for(i = 0; shellcontent = shellcontents[i]; i++){	
			for(i = 0; element = shellcontent.childNodes[i]; i++){
				if(element.nodeType != 3){
					Page._shellcontent[element.nodeName.toLowerCase()] = element;
				}
			}
		}
	}
	// extend the base menustructure
	this.appendToMenucontent = function(menuextensions){
		var menuextension, i, u, dogtag, append_dogtag, append_menuitem, append_children, child;
		if(Page._menucontent){
			for(i = 0; menuextension = menuextensions[i]; i++){
				dogtag = menuextension.getAttribute("dogtag");
				append_dogtag = this.getElementByDogtag(dogtag, Page._menucontent);
				append_menuitem = append_dogtag && append_dogtag.parentNode.nodeName.toLowerCase() == "menuitem" ? append_dogtag.parentNode : false;
				// extension-point found
				if(append_menuitem){
					append_children = this.getChildNode(append_menuitem, "children");
					if(!append_children){
						// IE cannot add a new element to XML object using document.createElement
						// because the two elements will have different ownerDocument
						// Instead I find an existing element with the right owner and clone it
						if(Page.Util.explorer()){
							append_children = Page._menucontent.getElementsByTagName("children")[0].cloneNode(false);
						}else{
							append_children = document.createElement("children");
						}
						append_menuitem.appendChild(append_children);
					}
					// append extension children
					for(u = 0; child = menuextension.childNodes[u]; u++){
						if(child.nodeName.toLowerCase() == "menuitem"){
							append_children.appendChild(child.cloneNode(true));
						}
					}
				}else{
					//append to root?
					//append_children = Page._menucontent;
					alert("extending unidentified menuitem?");
				}
			}
			
		}else{
			// alert("error til Klaus");
		}
	}

	// get shell var node value
	this.getShellNodeValue = function(which){
		if(Page._shellcontent[which]){
			return this.getNodeValue(Page._shellcontent[which]);
		}else{
			return "";
		}
	}
	// get shell var node
	this.getShellNode = function(which){
		if(Page._shellcontent[which]){
			return Page._shellcontent[which];
		}else{
			return false;
		}
	}

	// get element with correct dogtag value
	this.getElementByDogtag = function(dogtag, content){
		var dogtag_node, i, dogtags;
		dogtags = content.getElementsByTagName("dogtag");
		for(i = 0; dogtag_node = dogtags[i]; i++){
			if(this.getNodeValue(dogtag_node) == dogtag){
				return dogtag_node;
			}
		}
		return false;
	}

	// get child element of type
	this.getChildNode = function(menuitem, type){
		var i, child;
		for(i = 0; child = menuitem.childNodes[i]; i++){
			if(child.nodeName.toLowerCase() == type){
				return child;
			}
		}
		return false;
	}
	// get value of item
	this.getNodeValue = function(node){
		if(node.firstChild && node.firstChild.nodeValue){
			return node.firstChild.nodeValue;
		}else{
			return "";
		}
	}
	// get value of child node
	this.getChildNodeValue = function(menuitem, type){
		var child;
		child = this.getChildNode(menuitem, type);
		if(child){
			return this.getNodeValue(child);
		}
		return "";
	}
	// get menuitem children
	this.getChildren = function(menuitem){
		var children = this.getChildNode(menuitem, "children");
		if(children && children.childNodes.length){
			return children;
		}
		return false;
	}
}

/* util_array.js|global */
// array.pop for IE
Array.prototype.popElement = function(){
	var newArray = new Array();
	for(var i = 0; i < this.length-1; i++){
		newArray[i] = this[i];
	}
	return newArray;
}

// array.unshift for IE
Array.prototype.unshiftElement = function(element){
	var newArray = new Array();
	newArray[0] = element;
	for(var i = 0; i < this.length; i++){
		newArray[newArray.length] = this[i];
	}
	return newArray;
}
/* util_cookie.js|global */
// Get cookie
Page.Util.getCookie = function(name){
	var goodCook = document.cookie;
	var cookCon = name + "=";
	var pos = goodCook.indexOf(cookCon);
	if(pos != -1){
		var start = pos + cookCon.length;
		var end = goodCook.indexOf(";",start);
		if(end == -1)
			end = goodCook.length;
		var cookieValue = goodCook.substring(start, end);
		return unescape(cookieValue);
	}
	return null;
}
// Delete cookie
Page.Util.delCookie = function(name){
	document.cookie = name + "=" + ";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
/* util_dom.js|global */
// returns the first parent tag (which)
Page.Util.getParentTag = function(which, element){
	 if(element.nodeName != which && element.nodeName != "BODY"){
		  element = Page.Util.getParentTag(which,element.parentNode);
	 } 
	 return element;
}

// check for type definition of element. Defined by identifier:type
Page.Util.getTypeDefinitionByClassName = function(identifier, element){
	var regexp = new RegExp(identifier+":[?=\\w/\\#~:.?+=?&%@!\\-]*");
	if(element.className.match(regexp)){
		return element.className.match(regexp)[0].replace(identifier+":", "");
	}else{
		return false;
	}
}

// get elements in optional content with classname (default content is mdBodyContent)
Page.Util.getElementsByClassName = function(classname, content){
	var element, i, elements;
	var returnArray = new Array();
	elements = content ? (typeof(content) == "string" ? document.getElementById(content).getElementsByTagName("*") : content.getElementsByTagName("*")) : document.getElementById("mdBodyContent").getElementsByTagName("*");
	// IE < 6 needs a bit of help getting elements
	elements = (elements.length ? elements : (Page.Util.explorer() ? document.all : elements));
	var regexp = new RegExp("(^|\\s)" + classname + "(\\s|$|\:)");
	for(i = 0;(element = elements[i]); i++){
		if(regexp.test(element.className)){
			returnArray[returnArray.length] = element;
		}
	}
	return returnArray;
}

// get elements in optional content with attribute (default content is mdBodyContent)
Page.Util.getElementsByAttribute = function(attribute, content){
	var element, i, elements;
	var returnArray = new Array(); 
	elements = content ? (typeof(content) == "string" ? document.getElementById(content).getElementsByTagName("*") : content.getElementsByTagName("*")) : document.getElementById("mdBodyContent").getElementsByTagName("*");
	// IE < 6 needs a bit of help getting elements
	elements = (elements.length ? elements : (Page.Util.explorer() ? document.all : elements));
	for(i = 0;(element = elements[i]); i++){
		if(element.getAttribute(attribute)){
			returnArray[returnArray.length] = element;
		}
	}
	return returnArray;
}

// returns previous sibling, not counting text nodes as siblings (also ignoring optional exclude=classname or exclude=nodeName)
Page.Util.previousRealSibling = function(element, exclude){
	var regexp, previous;
	exclude = typeof(exclude) != "undefined" ? exclude : false;
	regexp = new RegExp("(^|\\s)" + exclude + "(\\s|$)");
	previous = element.previousSibling;
	if(exclude){
		while(previous && (previous.nodeType == 3 || previous.className.match(regexp) || previous.nodeName == exclude)){
			previous = previous.previousSibling;
		}
	}else{
		while(previous && previous.nodeType == 3){
			previous = previous.previousSibling;
		}
	}
	return previous;
}

// returns next sibling, not counting text nodes as siblings (also ignoring exclude=classname or exclude=nodeName)
Page.Util.nextRealSibling = function(element, exclude){
	var regexp, next;
	exclude = typeof(exclude) != "undefined" ? exclude : false;
	regexp = new RegExp("(^|\\s)" + exclude + "(\\s|$)");
	next = element.nextSibling;
	if(exclude){
		while(next && (next.nodeType == 3 || next.className.match(regexp) || next.nodeName == exclude)){
			next = next.nextSibling;
		}
	}else{
		while(next && next.nodeType == 3){
			next = next.nextSibling;
		}
	}
	return next;
}

// get elements computed style value for css attribute
Page.Util.getStyleValue = function(element, attribute){

	// Correct W3C method (Mozilla)
	if (document.defaultView && document.defaultView.getComputedStyle) {
		return document.defaultView.getComputedStyle(element, null).getPropertyValue(attribute);

	// Internet Explorer only
	}else if(document.body.currentStyle) {
		attribute = attribute.replace(/(-\w)/g, function(word){return word.replace(/-/, "").toUpperCase()});
		return element.currentStyle[attribute];
	}else{
		return false;
	}
}
/* util_interface.js|global */
// parses document and enables buttons and more
Page.Util.awakeInterface = function(){

	if(document.getElementById("mdTm")){
		Page.Util.unSelectify(document.getElementById("mdTm"));
	}
	if(document.getElementById("mdHm")){
		Page.Util.unSelectify(document.getElementById("mdHm"));
	}
	if(document.getElementById("mdLm")){
		Page.Util.unSelectify(document.getElementById("mdLm"));
	}
	if(typeof(Page.Util.initButtons) == "function"){
		Page.Util.initButtons();
	}
	if(typeof(Page.Util.initInputs) == "function"){
		Page.Util.initInputs();
	}
	if(typeof(Page.Util.initComponents) == "function"){
		Page.Util.initComponents(document.getElementById("mdBody"));
	}
	if(typeof(Page.Util.localAwakening) == "function"){
		Page.Util.localAwakening();
	}
}

// make elements unselectable
Page.Util.unSelectify = function(element){
	if(Page.Util.explorer()){
		element.onselectstart = function(){return false;}
	}else{
		element.onmousedown = function(){return false;}
	}
}

// fake submits form on key "Enter", calls function "action"
Page.Util.submitOnEnter = function(event, action){
	event = event ? event : window.event;
	if(event.keyCode == 13){
		if(event.preventDefault){event.preventDefault();}
		if(event.stopPropagation){event.stopPropagation();}
		event.returnValue = false;
		event.cancelBubble = true;
		action();
	}
}

/* util_debug.js|global */
/* START debug functionality */
Page.Util.debuggerz = null;
Page.Util.openDebugger = function(){
	Page.Util.debuggerz = window.open("","debuggerz","width=600, height=400, scrollbars=yes, resizable=yes");
}
Page.Util.debug = function(output){
	if(Page.Util.debuggerz){
		var element = Page.Util.debuggerz.document.createTextNode(output);
		Page.Util.debuggerz.document.body.appendChild(element);
		var br = Page.Util.debuggerz.document.createElement('br');
		Page.Util.debuggerz.document.body.appendChild(br);

		Page.Util.debuggerz.scrollBy(0,1000);
	 }else{
		Page.Util.openDebugger();
		if(!Page.Util.debuggerz){
			alert("Disable popup blocker!");
		}else{
			Page.Util.debug(output);
		}
	}
}
/* END debug functionality */
/* headindex.js|global */
// create index view
Page.createHeadIndex = function(){
	var child, i, u, item, header_index, title, url, text, moreurl, moretext, moretitle;

	var html = '';
	// HEAD INDEX begin
	html += '<div id="mdHeadIndex">';
	html += '<div id="mdHeadIndexSub">';
	html += '<div id="mdHeadIndexSubInner">';

	html += '<hr class="mdAccess" />';
	html += '<h2 class="mdAccess">Indeks</h2>';
	html += '<div id="mdHeadIndexSubInnerBody">';

	header_index = Page.XMLVars.getShellNode("header_index");
	if(header_index){
		for(i = 0; child = header_index.childNodes[i]; i++){
			if(child.nodeName.toLowerCase() == "menuitem"){
				html += '<div class="mdHeadIndexColumns">';
				html += '<ul>';
				for(u = 0; item = child.childNodes[u]; u++){
					if(item.nodeName.toLowerCase() == "item"){
						url = Page.XMLVars.getChildNodeValue(item, "url");
						text = Page.XMLVars.getChildNodeValue(item, "text");
						title = Page.XMLVars.getChildNodeValue(item, "title");
						html += '<li><a href="'+url+'" title="'+title+'">'+text+'</a></li>';
					}
				}
				html += '</ul>';
				html += '</div>';
				
			}else if(child.nodeName.toLowerCase() == "moreitem"){
				moreurl = Page.XMLVars.getChildNodeValue(child, "url");
				moretext = Page.XMLVars.getChildNodeValue(child, "text");
				moretitle = Page.XMLVars.getChildNodeValue(child, "title");
			}
		}
	}

	html += '<div class="mdHeadIndexColumnsBottom">';
	html += '<div class="listMore"><a href="'+moreurl+'" title="'+(moretitle ? moretitle : text)+'">'+moretext+'</a> &#187;</div>';
	html += '</div>';

	html += '</div>';

	html += '</div>';
	html += '</div>';
	html += '</div>';
	// HEAD INDEX end
	return html;
}

// show index view
Page.showHeadIndex = function(event){
	if(document.getElementById('mdHeadIndex').style.display != "block"){
		Page.Util.nonClick(event);
		document.getElementById('mdHeadIndex').style.display = "block";
		document.onclick = Page.hideHeadIndex;
	}
}
// hide index view
Page.hideHeadIndex = function(){
	document.onclick = null;
	document.getElementById('mdHeadIndex').style.display = "none";
}
/* banner.js|customers */
// create mdHeadBanner element
Page.createBanner = function(){
	var html, header_banner;
	html = '';

	// BANNER begin
	header_banner = Page.XMLVars.getShellNodeValue("header_banner");
	if(header_banner && typeof(dynamik) != "undefined"){
		html += '<div id="mdHeadBanner">';
		html += eval(header_banner);
		html += '</div>';
	}
	// BANNER end

	return html;
}

/* language.js|global */
// create mdLang element
Page.createLanguage = function(){
	var html, i, child, header_language, url, text, title;
	html = '';

	// LANGUAGE begin
	html += '<div id="mdLang">';
	header_language = Page.XMLVars.getShellNode("header_language");
	if(header_language){
		for(i = 0; child = header_language.childNodes[i]; i++){
			url = Page.XMLVars.getChildNodeValue(child, "url");
			text = Page.XMLVars.getChildNodeValue(child, "text");
			html += (url && text ? (i > 0 ? '<span>&#124;</span>' : '')+'<a href="'+url+'" title="'+text+'">'+text+'</a>' : '');
		}
	}
	html += '</div>';
	// LANGUAGE end

	return html;
}

/* util_buttons.js|global */
Page.Util.initButtons = function(){
	var buttons, button, i;
	buttons = document.getElementsByTagName('button');
	for(i = 0; button = buttons[i]; i++){
		// change focus and blur of all button elements
		Page.Util.addEventHandler(button, "mouseover", Page.Util.buttonOver);
		Page.Util.addEventHandler(button, "mouseout", Page.Util.buttonOut);
		Page.Util.addEventHandler(button, "mousedown", Page.Util.buttonDown);
	}
}
// button activity
Page.Util.buttonOver = function(){
	var element = (window.event ? window.event.srcElement : this);
	element.className += (element.className) ? ' over' : 'over';
}
Page.Util.buttonDown = function(){
	var element = (window.event ? window.event.srcElement : this);
	element.className += (element.className) ? ' down' : 'down';
}
Page.Util.buttonOut = function(){
	var element = (window.event ? window.event.srcElement : this);
	element.className = element.className.replace(/ over| down|over|down/g,"");
}
/* util_components.js|global */
// initialize components
Page.Util.initComponents = function(container){
	var i, element, elements, definition;
	// additional initializations based on class name
	elements = Page.Util.getElementsByClassName("init([:a-z])+", container);
	for(i = 0; element = elements[i]; i++){
		// get init definition
		definition = Page.Util.getTypeDefinitionByClassName("init", element);
		// if object exists, init element
		if(definition && typeof(Page.Objects[definition]) == "object"){
			Page.Objects[definition].init(element);
		}
	}
}
/* obj_ajax.js|global */

Page.Ajax = new function(){

	// container to hold the requests
	this.requests = new Array();

	// Send request to url, calls the specified notify function on object on response
	this.send = function(url, notify, object, parameters, async, type){

		// set request id
		var id = this.requests.length;
		this.requests[id] = new Object();
		// save request parameters
		this.requests[id].url = url;
		this.requests[id].notifier = notify;
		this.requests[id].object = (typeof(object) != "undefined" ? object : window);
		this.requests[id].parameters = (typeof(parameters) != "undefined" ? parameters : "");
		this.requests[id].async = (typeof(async) != "undefined" ? async : true);
		this.requests[id].type = (typeof(type) != "undefined" ? type : "POST");

		// get request object, and verify it
		this.requests[id].xmlHttp = this.createRequestObject();
		if(!this.requests[id].xmlHttp || typeof(this.requests[id].xmlHttp.send) == 'undefined'){
			this.responder(id, false);
			return;
		}
		this.requests[id].xmlHttp.open(this.requests[id].type, this.requests[id].url, this.requests[id].async);
		//this.requests[id].xmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
		//this.requests[id].xmlHttp.setRequestHeader("Content-Type","text/xml");
		try{
			this.requests[id].xmlHttp.send(parameters);
		}catch(e){
			this.responder(id, false);
			return;
		}
		if(this.requests[id].async){
			this.requests[id].xmlHttp.onreadystatechange = function(){
				if(Page.Ajax.requests[id].xmlHttp.readyState == 4){
					Page.Ajax.responder(id, true);
				}
			}
		}else{
			Page.Ajax.responder(id, true);
		}
		return;
	}

	// create xmlhttprequest object 
	this.createRequestObject = function(){
		var request_object = false;
		if(typeof(window.ActiveXObject) == "function"){
			try{
				request_object = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
				return false;
			}
		}else if(window.XMLHttpRequest){
			try{
				request_object = new XMLHttpRequest();
			}catch(e){
				return false;
			}
		}
		return request_object;
	}		
	
	// XML load responder, calls notifier function specified in notify
	this.responder = function(id, state){
		var response_object, response;
		// get respond-to object and free the ressource
		response_object = this.requests[id].object;
		response_object.exe = this.requests[id].notifier;
		this.requests[id].object = null;
		this.requests[id].notifier = null;
		
		// if request could not be executed
		if(!state){
			response_object.exe(false);
		}else{
			try{
				this.requests[id].xmlHttp.status;

				if(this.requests[id].xmlHttp.status == 200){
					this.requests[id].status = this.requests[id].xmlHttp.status;
					this.requests[id].statusText = this.requests[id].xmlHttp.statusText;
					this.requests[id].result = this.requests[id].xmlHttp.responseXML;
					this.requests[id].resultText = this.requests[id].xmlHttp.responseText;
					this.requests[id].xmlHttp = null;
					// relocate request to response
					response = this.requests[id];
					response_object.exe(response);
				}else{
					response_object.exe(false);
				}
			}catch(e){
				if(this.requests[id]){
					response_object.exe(false);
				}
			}
		}
		// reset request
		Page.Ajax.requests[id] = null;
	}

	// check the returned value (for debugging purposes)
	this.check = function(response){
		if(response){
			Page.Util.debug(response.status+","+response.resultText+","+response.result);
		}else{
			alert("failed");
		}
	}
}
/* obj_onload.js|global */
// onload event handler object
Page.OL = new function(){
	// actions to be preformed on onload
	this.actions = new Array();

	// add new funtion to onload 
	this.addOnloadAction = function(action){
		this.actions[this.actions.length] = action;
	}
	// execute added function on onload
	this.execute = function(){
		var i;
		// Always listen for default events default events
		// catch keydown event
		if(typeof(shortcutCatcher) == "function"){
			Page.Util.addEventHandler(document, "keydown", shortcutCatcher);
		}
		// catch resize event
		if(typeof(onresizeCatcher) == "function"){
			Page.Util.addEventHandler(window, "resize", onresizeCatcher);
		}
		// functions kept in actions array
		for(i = 0; i < this.actions.length; i++){
			// decide haw it has been added
			if(typeof(this.actions[i]) == "function"){
				this.actions[i]();
			}else{
				eval(this.actions[i]);
			}
		}
	}
}
// redirect funtion to get away from window object
var onloadCatcher = function(e){Page.OL.execute(e);}
// catch onload event
Page.Util.addEventHandler(window, "load", onloadCatcher);
/* obj_obstructions.js|global */
// obstruction Utility
Page.Obstructions = new function(){

	this.selects = false;
	this.objects = false;
	this.applets = false;

	// hide obstructions based on element
	this.hideObstructions = function(element){
		var i, select, object, applet;
		
		element.x = Page.Util.absoluteLeft(element);
		element.y = Page.Util.absoluteTop(element);
		element.obstructed_by = new Array();

		if(Page.Util.explorer()){
			this.selects = this.selects ? this.selects : document.getElementsByTagName("select");
			for(i = 0; select = this.selects[i]; i++){
				this.resolveObstruction(select, element);
			}
			this.objects = this.objects ? this.objects : document.getElementsByTagName("object");
			for(i = 0; object = this.objects[i]; i++){
				this.resolveObstruction(object, element);
			}
		}
			
		this.applets = this.applets ? this.applets : document.getElementsByTagName("applet");
		for(i = 0; applet = this.applets[i]; i++){
			this.resolveObstruction(applet, element);
		}
	}

	// resolve obstruction based on element
	this.resolveObstruction = function(obstruction, element){
		obstruction.x = Page.Util.absoluteLeft(obstruction);
		obstruction.y = Page.Util.absoluteTop(obstruction);

		if(obstruction.x + obstruction.offsetWidth > element.x && element.x + element.offsetWidth > obstruction.x && obstruction.y + obstruction.offsetHeight > element.y && element.y + element.offsetHeight > obstruction.y){
			obstruction.style.visibility = "hidden";
			obstruction.obstructing = obstruction.obstructing ? ++obstruction.obstructing : 1;
			element.obstructed_by[element.obstructed_by.length] = obstruction;
		}
	}

	// restore obstructions, element (optional false to restore all)
	this.restoreObstructions = function(element){
		var i, obstruction, select, object, applet;

		// for one element
		if(element){
			for(i = 0; obstruction = element.obstructed_by[i]; i++){
				obstruction.obstructing--;
				if(obstruction.obstructing <= 0){
					obstruction.style.visibility = "visible";
				}
			}
		// or all
		}else{
			if(Page.Util.explorer()){
				for(i = 0; select = this.selects[i]; i++){
					select.obstructing = 0;
					select.style.visibility = "visible";
				}
				for(i = 0; object = this.objects[i]; i++){
					object.obstructing = 0;
					object.style.visibility = "visible";
				}
			}
			for(i = 0; applet = this.applets[i]; i++){
				applet.obstructing = 0;
				applet.style.visibility = "visible";
			}
		}
	}
}

/* obj_headsearch.js|global */
Page.HeaderSearch = new function(){
	
	this._node = false;
	this._elements = new Array();
	this._button = false;
	this._selected = 0;
	this._error_nourl = false;
	this._error_nostring = false;
	
	this._search_string = false;
	this._search_select = false;

	this._initiated = false;
	
	// get search option info
	this.populate = function(child){
		var url;
		var entry = new Object()
		entry.selected = child.getAttribute("selected") ? child.getAttribute("selected") : false;

		url = Page.XMLVars.getChildNode(child, "url");
		entry.target = url ? url.getAttribute("target") ? url.getAttribute("target") : false : false;
		entry.url = url ? Page.XMLVars.getNodeValue(url) : false;

		entry.inputtext = Page.XMLVars.getChildNodeValue(child, "inputtext");
		entry.optiontext = Page.XMLVars.getChildNodeValue(child, "optiontext");
		
		return entry;
	}

	// create search element
	this.createSearch = function(){
		var html, i, child, element;

		html = '';
		this._node = Page.XMLVars.getShellNode("header_search");
		if(this._node){
			for(i = 0; child = this._node.childNodes[i]; i++){
				if(child.nodeName.toLowerCase() == "item"){
					this._elements[this._elements.length] = this.populate(child);
				}else if(child.nodeName.toLowerCase() == "button"){
					this._button = Page.XMLVars.getNodeValue(child);
				}else if(child.nodeName.toLowerCase() == "errors"){
					this._error_nourl = Page.XMLVars.getChildNodeValue(child, "nourl");
					this._error_nostring = Page.XMLVars.getChildNodeValue(child, "nostring");
				}
			}

			// SEARCH begin
			if(this._elements.length){
				html += '<div id="mdHeadSearch">';
				html += '<div id="mdHeadSearchSub">';
				html += '<div id="mdHeadSearchSubInner">';
				html += '<h2 class="mdAccess">Søg</h2>';
				if(this._elements.length > 1){
					html += '<select style="" name="header_search_select" id="header_search_select" onchange="Page.HeaderSearch.changeSelect(this);">';
					for(i = 0; element = this._elements[i]; i++){
						this._selected = element.selected ?  i : this._selected;
						html += (element.optiontext) ? '<option value="'+i+'"'+(element.selected ? ' selected="selected"' : '')+'>'+element.optiontext+'</option>' : '';
					}
					html += '</select>';
				}
				html += '<input name="header_search_string" id="header_search_string" value="'+this._elements[this._selected].inputtext+'" onfocus="Page.HeaderSearch.initInput();" type="text" />';
				html += '<button type="button" onclick="Page.HeaderSearch.submit();">'+this._button+'</button>';
				html += '</div>';
				html += '</div>';
				html += '</div>';
			}
			// SEARCH end
		}
	
		return html;
	}

	// init input
	this.initInput = function(){

		this._search_string = document.getElementById("header_search_string");
		this._search_select = document.getElementById("header_search_select");

		this._search_string.defaultValue = this._search_string.value;
		this._search_string.value = '';

		// clear default value on focus
		this._search_string.onfocus = function(){
			this.value = ((this.value == this.defaultValue) ? '' : this.value);
		}
		// show default value on blur if nothing has been typed
		this._search_string.onblur = function(){
			this.value = ((this.value == '') ? this.defaultValue : this.value);
		}
		// catch "enter" to fake form submission
		this._search_string.onkeydown = function(event){
			event = event ? event : window.event;
			if(event.keyCode == 13){
				if(event.preventDefault){event.preventDefault();}
				if(event.stopPropagation){event.stopPropagation();}
				event.returnValue = false;
				event.cancelBubble = true;
				Page.HeaderSearch.submit();
			}
		}
		this._initiated = true;
	}

	// change selected search-area
	this.changeSelect = function(element){
		if(!this._initiated){
			this.initInput();
		}
		// set cookie ??

		// change value if it is unchanged
		if(this._search_string.value == this._search_string.defaultValue){
			this._search_string.value = this._elements[element.options[element.selectedIndex].value].inputtext;
		}
		// set new defaultvalue for input
		this._search_string.defaultValue = this._elements[element.options[element.selectedIndex].value].inputtext;
	}

	// submit search
	this.submit = function(){
		var index, url, target;

		if(!this._initiated){
			this.initInput();
		}

		// if select exists
		if(this._search_select){
			index = this._search_select.options[this._search_select.selectedIndex].value;
		// otherwise just use first url
		}else{
			index = 0;
		}
		
		url = this._elements[index].url;
		target = this._elements[index].target;

		if((this._search_string.value == this._search_string.defaultValue || this._search_string.value == "") && this._error_nostring){
			alert(this._error_nostring);
		}else if(!url && this._error_nourl){
			alert(this._error_nourl);
		}else{
			var searchstring =  url+escape(this._search_string.value);
			if(target){
				window.open(searchstring, target);
			}else{
				location.href = searchstring;
			}
		}
		return false;
	}

}
/* path.js|global */
// create mdHeadPath element
Page.createPath = function(){
	var html, i, child, url, name, header_root_url, header_root_name, header_root_title, header_greeting;
	html = '';

	// PATH begin
	html += '<div id="mdHeadPath">';
	html += '<div id="mdHeadPathSub">';
	html += '<div id="mdHeadPathSubInner">';
	html += '<ul id="mdPath">';

	header_root_url = Page.XMLVars.getShellNodeValue("header_root_url");
	header_root_url = header_root_url ? header_root_url : '/';
	header_root_name = Page.XMLVars.getShellNodeValue("header_root_name");
	header_root_name = header_root_name ? header_root_name : 'Forsiden';
	header_root_title = Page.XMLVars.getShellNodeValue("header_root_title");
	header_root_title = header_root_title ? header_root_title : 'Tilbage til forsiden';

	header_greeting = Page.XMLVars.getShellNodeValue("header_greeting");
	header_greeting = header_greeting ? header_greeting : 'Goddag';

	if(this._trailSuccess){
		html += '<li><a href="'+header_root_url+'" title="'+header_root_title+'"><span>'+header_root_name+'</span></a></li>';
		for(i = 0; child = this._trail[i]; i++){
			name = Page.XMLVars.getChildNodeValue(child, "name");
			url = Page.XMLVars.getChildNodeValue(child, "url");
			html += '<li>';
			if(i == this._trail.length-1){
				html += name;
			}else if(url){
				html += '<a href="'+url+'" title="'+name+'"><span>'+name+'</span></a>';
			}else{
				html += '<span>'+name+'</span>';
			}
			html += '</li>';
		}
	}else{
		html += '<li><span>'+header_greeting+'</span></li>';
	}
	html += '</ul>';
	html += '</div>';
	html += '</div>';
	html += '</div>';
	// PATH end

	return html;
}

/* vars.js|global */
Page.Menu.img_minus =		Page.GFX+'/leftmenu/lm_minus.gif';
Page.Menu.img_plus = 		Page.GFX+'/leftmenu/lm_plus.gif';
Page.Menu.img_plus_ext =	Page.GFX+'/leftmenu/lm_plus.gif';
Page.Menu.img_vinkel = 		Page.GFX+'/leftmenu/lm_angle.gif';

// selected top level menu, if page is identified
Page.Menu._selected_top = false;
/* publisher.js|global */
Page.createFootPublisher = function(){
	var child, html, i, url, title, text, footer_publisher;
	
	html = '';
	html += '<div id="mdFootSubInner1">';

	footer_publisher = Page.XMLVars.getShellNode("footer_publisher");
	if(footer_publisher){
		for(i = 0; child = footer_publisher.childNodes[i]; i++){
			if(child.nodeName.toLowerCase() == "item"){
				url = Page.XMLVars.getChildNodeValue(child, "url");
				text = Page.XMLVars.getChildNodeValue(child, "text");
				title = Page.XMLVars.getChildNodeValue(child, "title");
				html += (url ? '<a href="'+url+'" title="'+(title ? title : text)+'">' : '')+text+(url ? '</a>' : '');
			}else if(child.nodeName.toLowerCase() == "separator"){
				html += '<span>&middot;</span>';
			}
		}
	}

	html += '</div>';
	return html;
}
/* headmisc.js|global */
// create mdHeadMisc element
Page.createHeadMisc = function(){
	var html, i, child, header_links, target, url_node, url, text, title, header_index, linktext, linktitle;
	html = '';

	// MISC begin
	html += '<div id="mdHeadMisc">';
	html += '<div id="mdHeadMiscSub">';
	html += '<div id="mdHeadMiscSubInner">';
	html += '<ul>';
	
	header_links = Page.XMLVars.getShellNode("header_links");
	if(header_links){
		for(i = 0, u = 0; child = header_links.childNodes[i]; i++){
			url_node = Page.XMLVars.getChildNode(child, "url");
			target = url_node ? url_node.getAttribute("target") ? url_node.getAttribute("target") : false : false;
			url = url_node ? Page.XMLVars.getNodeValue(url_node) : false;

			text = Page.XMLVars.getChildNodeValue(child, "text");
			title = Page.XMLVars.getChildNodeValue(child, "title");
			html += (url && text ? '<li id="mdMisc'+(u++)+'"><a href="'+url+'" title="'+(title ? title : text)+'"'+(target ? ' target="'+target+'"' : '')+'><span>'+text+'</span></a></li>' : '');
		}
	}
	html += '</ul>';
	html += '</div>';
	html += '</div>';
	html += '</div>';
	// MISC end

	return html;
}

/* links.js|global */
Page.createFootLinks = function(){
	var child, html, i, u, url, title, text, target, url_node, footer_links;
	html = '';
	html += '<div id="mdFootSubInner2">';

	footer_links = Page.XMLVars.getShellNode("footer_links");
	if(footer_links){
		u = 0;
		for(i = 0; child = footer_links.childNodes[i]; i++){
			if(child.nodeName.toLowerCase() == "item"){
				url_node = Page.XMLVars.getChildNode(child, "url");
				target = url_node ? url_node.getAttribute("target") ? url_node.getAttribute("target") : false : false;
				url = url_node ? Page.XMLVars.getNodeValue(url_node) : false;

				text = Page.XMLVars.getChildNodeValue(child, "text");
				title = Page.XMLVars.getChildNodeValue(child, "title");
				html += (url && text) ? (u > 0 ? '<span>&#124;</span>' : '')+'<a href="' + url + '" title="'+(title ? title : text)+'"'+(target ? ' target="'+target+'"' : '')+'>'+text+'</a>' : '';
				u++;
			}
		}
	}

	html += '</div>';
	return html;
}

/* phpbb.js|global */
function NewWindow(width,height,url) {
	window.open(url,"PopUp","menubars=0,scrollbars=1,resizable=1,height="+height+",width="+width);
}

function CheckInputData(frm) {
 var skip = false;
 var hobbyselected = false;
 if (!skip && frm.email.value == "") {
 	alert("E-Mail address is required");
 	skip = true;
 }
 
 
 if (!skip && frm.pwd.value =="") {
 	alert("Password is required");
 	skip = true;
 }

 if (!skip && (frm.pwd.value != frm.pwdr.value) ) {
 	alert("Passwords do not match.");
 	skip = true;
 }
  
 if (!skip) {
        InitCookieSearchParams(frm);
 	pbsSetCookie(frm);
 	
 	}
 return (!skip);
}



function choosedate () {
 window.open('/g/kalender_eng.html?searchform.dateselected','','menubar=0,titlebar=0,width=268,height=236');
 document.searchform.Interval.options[document.searchform.Interval.options.length-1].selected = true;
}
function ResetDate () {
 if (document.searchform.Interval.selectedIndex != (document.searchform.Interval.options.length-1))
 {
  document.searchform.dateselected.value = "";
 }
}

function DoPrint () {
 var f = document.searchform;
 f.action = "events?category=print";
 f.submit();
}

function EatCookie() {
document.cookie="usernamepassword=;Path=/"
document.cookie="UserRegID=;Path=/"
document.location="/apps/pbcs.dll/frontpage?RegLogout=1&NoCache=1"
}
/* obj_tabs.js|global */
Page.Objects["tabs"] = new function(){

	this.init = function(tabset){

		var tab, i;
		// select tab, closing open panels before opening new
		tabset.selectTab = function(tab){
			tab = typeof(tab) == "object" ? tab : this.tabs[tab];
			// unselect previously selected tab
			if(this.selectedTab){
				this.selectedTab.className = this.selectedTab.className.replace(/ selected|selected/g,"");
				this.selectedTab.panel.className = this.selectedTab.panel.className.replace(/ open|open/g,"");
			}
			// enable tab (in case is was inactive)
			this.enableTab(tab);
			// select tab
			tab.className += (tab.className) ? " selected" : "selected";
			tab.panel.className += (tab.panel.className) ? " open" : "open";
			this.selectedTab = tab;
		}

		// enable tab button
		tabset.enableTab = function(tab){
			tab = typeof(tab) == "object" ? tab : this.tabs[tab];
			tab.className = tab.className.replace(/ inactive|inactive/g,"");
			// set mouseover
			tab.onmouseover = function(){
				if(!this.className.match(/selected|inactive/g)){
					this.className += (this.className) ? " over" : "over";
				}
			}
			// set mouseout
			tab.onmouseout = function(){
				this.className = this.className.replace(/ over|over/g,"");
			}
			// if element has a panel, set mousedown
			if(tab.panel){
				tab.onclick = function(event){
					this.tabset.selectTab(this);
				}
			}
		}
		// disable tab button
		tabset.disableTab = function(tab){
			var i, replacement;
			tab = typeof(tab) == "object" ? tab : this.tabs[tab];
			tab.className = tab.className.replace(/ selected|selected/g,"");
			tab.className = tab.className.replace(/ over|over/g,"");
			tab.className += tab.className ? " inactive" : "inactive";
			// remove events
			tab.onmouseout = null;
			tab.onmouseover = null;
			tab.onclick = null;

			// check if panel is open
			if(tab == this.selectedTab){
				// try to replace open panel
				for(i = 0; replacement = this.tabs[i]; i++){
					if(replacement != tab){
						this.selectTab(replacement);
						break;
					}
				}
			}
		}
		
		tabset.tabs = Page.Util.getElementsByClassName("tab:([a-zA-Z0-9])+", tabset);
		for(i = 0; tab = tabset.tabs[i]; i++){
			Page.Util.unSelectify(tab);
			// tell each tab which tabset it belongs to and find its panel
			tab.tabset = tabset;
			tab.panel = this.getPanel(Page.Util.getTypeDefinitionByClassName("tab", tab), tabset);
			if(tab.className.match(/selected/g)){
				tabset.selectTab(tab);
			}
			if(!tab.className.match(/inactive/g)){
				tabset.enableTab(tab);
			}
		}
	}

	// get panel based on class/id relation
	this.getPanel = function(identifier, tabset){
		var i, panel;
		if(identifier){
			tabset.panels = Page.Util.getElementsByClassName("panel:([a-zA-Z0-9])+", tabset);
			for(i = 0; panel = tabset.panels[i]; i++){
				if(Page.Util.getTypeDefinitionByClassName("panel", panel) == identifier){
					return panel;
				}
			}
		}
		return false;
	}

}
/* creation.js|global */
// selected left menu item, if page is identified
Page.Menu._selected_left = null;
// indent level (to adjust text length and identify open elements)
Page.Menu._level = 0;

// add toggle control
Page.Menu.addControl = function(isOpen){
	return '<img src="' + (isOpen ? this.img_minus : this.img_plus) + '" alt="" onclick="Page.Menu.toggle(this, event)" />';
}
// add toggle control for extended 
Page.Menu.addExtControl = function(){
	return '<img src="' + this.img_plus_ext + '" alt="" />';
}
// add angle image for childless subentries
Page.Menu.addAngle = function(){
	return '<img src="' + this.img_vinkel + '" alt="" />';
}

// add a general entry
Page.Menu.addElement = function(indent, menuitem){
	var html = '';

	if(menuitem.nodeName.toLowerCase() == "separator"){
		html += "<li><hr></li>";
		
	}else if(menuitem.nodeName.toLowerCase() == "menuitem"){

		var name = Page.XMLVars.getChildNodeValue(menuitem, "name");
		var url = Page.XMLVars.getChildNodeValue(menuitem, "url");
		var open = menuitem.getAttribute("open") ? true : menuitem == Page._trail[this._level+indent];
		var children = Page.XMLVars.getChildren(menuitem);
		var sel = (menuitem == Page._trail[Page._trail.length-1]);
		// does the item have a extension indicator
		var ext = menuitem.getAttribute("ext") ? menuitem.getAttribute("ext") : false;
		var i, child;

		html += '<li'+(sel || open ? ' class="'+(open ? ' open' : '')+(sel ? ' selected' : '')+'"' : '') +'>';
		html += url ? '<a href="'+url+'" title="'+name+'">' : '<a class="nolink" title="'+name+'">';
		html += children ? this.addControl(open) : (ext ? this.addExtControl() : this.addAngle());
		html += '<span><span>'+name+'</span></span>';
		html += '</a>';

		if(children){
			html += '<ul>';
			indent++;
			for(i = 0; child = children.childNodes[i]; i++){
				html += this.addElement(indent, child);
			}
			html += '</ul>';
			indent--;
		}

		html += '</li>';
		
	}
	return html;
}

Page.Menu.createLeftMenu = function(children){
	var i, child;
	var html = '';
	if(children){

		html += '<div id="mdBodyLeftMenu">';
		html += '<div id="mdBodyLeftMenuSub">';
		html += '<hr class="mdAccess"><h2>'+Page.getMenuTitle()+'</h2>';
		html += '<div id="mdBodyLeftMenuSubInner">';			
		html += '<ul id="mdLm">';
		for(i = 0; child = children.childNodes[i]; i++){
			html += this.addElement(0, child);
		}
		html += '</ul>';
		html += '</div>';
		html += '</div>';
		html += '</div>';
	}
	return html;
}
/* function.js|global */
Page.Menu.toggle = function(element, event){
	var parent;
	Page.Util.nonClick(event);
	parent = Page.Util.getParentTag("LI", element);
	
	if(parent.className.match(/open/g)){
		element.src = this.img_plus;
		parent.className = parent.className.replace(/open |open/g, "");
	}else{
		element.src = this.img_minus;
		parent.className = (parent.className ? parent.className + " open" : "open");
	}
}
/* creation.js|global */
// top menu functions
Page.Menu.createTop = function(){
	var u, i, element;
	var html = '';
	html += '<div id="mdHeadMenu">';
	html += '<div id="mdHeadMenuSub">';

	html += '<hr class="mdAccess" />';
	html += '<h2 class="mdAccess">Hovedmenu</h2>';

	html += '<div id="mdHeadMenuSubInner">';
	html += '<ul id="mdHm">';
	if(Page._menucontent){
		for(i = 0, u = 0; element = Page._menucontent.childNodes[i]; i++){
			if(element.nodeName.toLowerCase() == "menuitem"){
				if(Page._trail.length > 0 && Page._trail[0] == element){
					this._selected_top = element;
					html += '<li id="mdHm'+(u++)+'" class="selected">';
				}else{
					html += '<li id="mdHm'+(u++)+'">';
				}
				html += '<a href="'+Page.XMLVars.getChildNodeValue(element, "url")+'"><span><span>'+Page.XMLVars.getChildNodeValue(element, "name").cutString(25)+'</span></span></a></li>';
			}
		}
	}else{
		html += '<li id="mdHm0"><a><span><span>No Menu</span></span></a></li>';
	}
	html += '</ul>';
	html += '</div>';

	html += '</div>';
	html += '</div>';
	this._level = 1;
	return html;
}


