﻿function isElementOfClass(DOMNode,sClass){
	var a=getClassName(DOMNode);
	var b=a.split(" ");
	for(var i=b.length-1; i>=0; i--)if(b[i]==sClass)return(true);
	return(false);
}
function attachEvents(){
	var h=document.getElementsByTagName("a");
	if(h){
		for(var i=h.length-1;i >= 0;i--){
			var v=h[i];
			if(isElementOfClass(v,"targetblank"))v.onclick=function(){open(this.href,'','');return(false);};
		}
	}
}

if(window.addEventListener){
	window.addEventListener("load",attachEvents,false);
}else{
	window.attachEvent("onload",attachEvents);
}

var map = null;

function loadproductmap() {
  if (GBrowserIsCompatible() && typeof LatLng == 'function') {
	try {
		var geocoord = LatLng();
	}catch(er) {}
	if(geocoord[0]!=0&&geocoord[1]!=0) {
		var map = new GMap2(document.getElementById("TellusProductGoogleMap"));
		var koordinater = new GLatLng(geocoord[0],geocoord[1]);
		map.setCenter(new GLatLng(60.115514,6.039734), 7);
		map.addOverlay(new GMarker(koordinater));
		map.addControl(new GSmallMapControl());
	}
  }
}
window.onload = loadproductmap;

function hide(){
	var divs = document.getElementsByTagName('div');
	for (var i = 0, ele; ele = divs[i]; i++) {
		if (ele.className == "menus") {
			document.getElementById(ele.id).style.visibility = 'hidden';
		}
	}
	document.getElementById('home').style.backgroundColor = '#152C7F';
	document.getElementById('home').style.color = '#FFF';
	document.getElementById('mnu720000202').style.backgroundColor = '#152C7F';
	document.getElementById('mnu720000202').style.color = '#FFF';
	document.getElementById('mnu720000203').style.backgroundColor = '#152C7F';
	document.getElementById('mnu720000203').style.color = '#FFF';
	document.getElementById('mnu720000204').style.backgroundColor = '#152C7F';
	document.getElementById('mnu720000204').style.color = '#FFF';
	document.getElementById('mnu720000205').style.backgroundColor = '#152C7F';
	document.getElementById('mnu720000205').style.color = '#FFF';
	document.getElementById('contact').style.backgroundColor = '#152C7F';
	document.getElementById('contact').style.color = '#FFF';
}


function checkform(form){
	if (form.Navn.value == ""){
		alert("Type your name");
		form.Navn.focus();
		return(false);
	}
	if (form.Epost.value == ""){
		alert("Type your e-mail");
		form.Epost.focus();
		return (false);
	}
}

function PopupPic(sPicURL) { 
	window.open(sPicURL, "", 'resizable=yes,HEIGHT=1,WIDTH=227,scrollbars=yes,status=no,titlebar=no,toolbar=no;');
}
