

var ie = navigator.appName.indexOf("Microsoft") != -1;
var mac = navigator.appVersion.indexOf("Mac") != -1
var dom = document.getElementById ? true:false;
var nn4 = document.layers ? true:false;

function inet_pop_win(pageToLoad, winName, width, height, center, ramme) {
	xposition=0; yposition=0;
	if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
		xposition = (screen.width - width) / 2;
		yposition = (screen.height - height) / 2;
		}
	width = width + ramme * 2
	args = "width=" + width + "," 
	+ "height=" + height + "," 
	+ "location=0," 
	+ "menubar=0,"
	+ "resizable=0,"
	+ "scrollbars=0,"
	+ "status=0," 
	+ "titlebar=0,"
	+ "toolbar=0,"
	+ "hotkeys=0,"
	+ "left=" + xposition + ","
	+ "top=" + yposition;

	window.open(pageToLoad+"&ramme="+ramme,winName,args );
}

function inet_open_win() {
	if (ua["dom"]) {
		var url = "";
		var target = "";

		var attributes = "";


		if (arguments.length > 0) {
			url = arguments[0];
		}

		//Target attribute:
		if (arguments.length > 1) {
			target = arguments[1];
		}
			
		//Optional attributes:
		if (arguments.length > 2) {
			attributes = arguments[2];
		}
	
		win = window.open(url, target, attributes);
		win.focus();
		return false;
	}
}

function toggleMenuLink(obj) {
	parobj = obj.parentNode;

	parclasses = parobj.className.split(" ");

	for (i=0; i<parclasses.length; i++) {
		if (parclasses[i] == "closed") {
			parclasses[i] = "open";
			parobj.className = parclasses.join(" ");
			i = parclasses.length;
		}
		else if (parclasses[i] == "open") {
			parclasses[i] = "closed";
			parobj.className = parclasses.join(" ");


			i = parclasses.length;


		}
	}

	return false;
}


/**** INIT ****/

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != "function") {
		window.onload = func;
	}
	else {
		window.onload = function() {
			oldonload();
			func();
		}
	}
}


/**** MENU ****/
function inet_menu_delay_hide() {
	if (ua["dom"]) {
		delayhide=setTimeout("inet_menu_show_default()",500)
	}
}

function inet_menu_clear_hide() {
	if (ua["dom"]) {
		if (window.delayhide) clearTimeout(delayhide)
	}
}

function inet_menu_over(id) {
	if (ua["dom"]) {
		if (window.delayhide) clearTimeout(delayhide)
		inet_show_sub(id);
	}
}

function inet_menu_out() {
	if (ua["dom"]) {
		inet_menu_delay_hide();
	}
}

function inet_show_sub(id) {
	if (ua["dom"]) {
		submenudiv = document.getElementById("inet_submenus");
		aDIV = submenudiv.getElementsByTagName("div");
		for (i=0; i<aDIV.length; i++) {
			aDIV[i].style.visibility = (aDIV[i].id == "submenu"+id ? "visible" : "hidden");
			aDIV[i].style.display = (aDIV[i].id == "submenu"+id ? "block" : "none");
		}
	}
}

function inet_menu_show_default() {
	if (ua["dom"]) {
		submenudiv = document.getElementById("inet_submenus");
		aDIV = submenudiv.getElementsByTagName("div");
		for (i=0; i<aDIV.length; i++) {
			is_default = hasClassName(aDIV[i], "default");
			aDIV[i].style.visibility = (is_default ? "visible" : "hidden");
			aDIV[i].style.display = (is_default ? "block" : "none");
		}
	}
}




function hasClassName(elm, cname) {
	if (ua["dom"]) {
		aCname = elm.className.split(" ");
		for (j=0; j<aCname.length; j++) {
			if (aCname[j] == cname) return true;
		}
	}
	return false;
}




var inet_map_zoomsize = 1;
function inet_mapzoom(size) {
	if (size==-1) {
		if (inet_map_zoomsize>1) {
			inet_map_zoomsize = inet_map_zoomsize + size;
			if (inet_map_zoomsize==1) {
				document.getElementById("inet_img_map").src = "http://sanovoeng.inet-designer.dk/images/66_sanovo_zoom_01.gif";
			} else if (inet_map_zoomsize==2) {
				document.getElementById("inet_img_map").src = "http://sanovoeng.inet-designer.dk/images/70_sanovo_zoom_02.gif";
			}
		}
	} else {
		if (inet_map_zoomsize<3) {
			inet_map_zoomsize = inet_map_zoomsize + size;
			if (inet_map_zoomsize==3) {
				document.getElementById("inet_img_map").src = "http://sanovoeng.inet-designer.dk/images/74_sanovo_zoom_03.gif";
			} else if (inet_map_zoomsize==2) {
				document.getElementById("inet_img_map").src = "http://sanovoeng.inet-designer.dk/images/70_sanovo_zoom_02.gif";
			}
		}
	}
}



var current_zoom = 0;
function inet_zoommap(i) {
	if (document.getElementById) {
		var max = zoomimgs.length - 1;
		if (current_zoom + i >= 0 && current_zoom + i <= max) {
			current_zoom += i;
			document.getElementById("inet_zoomimg").src = zoomimgs[current_zoom];
		}
	}
}



function checkFAQ() {
	return true;
}

function doSubmitFAQ() {
	if (checkFAQ()) {
		document.Form_FAQ.submit();
	}
}

function submitFAQ() {
	return checkFAQ();
}	



function initMilestones() {
	if (dom) {
		hms = document.getElementById("history_milestonesbody");
		if (!(ie && mac)) {
			if (hms) {
				loc = window.location + "";
				re = /^.+\/.+\?.*o=(\d+)$/;
				if (loc.match(re)) {
					pos = RegExp.$1;
					hms.scrollLeft = pos;
				}
			}
		}

		aD = hms.getElementsByTagName("div");
		minh = 135;
		for (i=0; i<aD.length; i++) {
			if (aD[i].className == "milestone" || aD[i].className == "current milestone") {
				minh = (aD[i].offsetHeight > minh ? aD[i].offsetHeight : minh);
			}
		}
		for (i=0; i<aD.length; i++) {
			if (aD[i].className == "milestone" || aD[i].className == "current milestone") {
				aD[i].style.height = minh + "px";
			}
		}
	}
}

function getMileStone(theurl) {
	if (!(ie && mac)) {
		hms = document.getElementById("history_milestonesbody");
		if (hms) {
			offset = hms.scrollLeft;
			window.location = theurl + "?o="+offset;

		}
	}
	return true;
}

function hlMileStone(obj,mode) {
	if (obj.className != "current milestone") {
		aD = obj.getElementsByTagName("div");
		for (i=0; i < aD.length; i++) {
			if (aD[i].className == "header") {
				(mode 
					? aD[i].style.backgroundColor = "#ffba00"
					: aD[i].style.backgroundColor = "#c7c8ca"
				);
			}
		}
		(mode 
			? obj.style.backgroundColor = "#dddddd"
			: obj.style.backgroundColor = "transparent"
		);
	}
}

var inet_map_zoomsize = 1;
function inet_mapzoom(size) {
	if (size==-1) {
		if (inet_map_zoomsize>1) {
			inet_map_zoomsize = inet_map_zoomsize + size;
			if (inet_map_zoomsize==1) {
				document.getElementById("inet_img_map").src = "http://sanovoeng.inet-designer.dk/images/66_sanovo_zoom_01.gif";
			} else if (inet_map_zoomsize==2) {
				document.getElementById("inet_img_map").src = "http://sanovoeng.inet-designer.dk/images/70_sanovo_zoom_02.gif";
			}
		}
	} else {
		if (inet_map_zoomsize<3) {
			inet_map_zoomsize = inet_map_zoomsize + size;
			if (inet_map_zoomsize==3) {
				document.getElementById("inet_img_map").src = "http://sanovoeng.inet-designer.dk/images/74_sanovo_zoom_03.gif";
			} else if (inet_map_zoomsize==2) {
				document.getElementById("inet_img_map").src = "http://sanovoeng.inet-designer.dk/images/70_sanovo_zoom_02.gif";
			}
		}
	}
}



var current_zoom = 0;
function inet_zoommap(i) {
	if (document.getElementById) {
		var max = zoomimgs.length - 1;
		if (current_zoom + i >= 0 && current_zoom + i <= max) {
			current_zoom += i;
			document.getElementById("inet_zoomimg").src = zoomimgs[current_zoom];
		}
	}
}