function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "MSIE";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isIE = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  s = "Netscape6/";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = parseFloat(ua.substr(i + s.length));
    return;
  }

  // Treat any other "Gecko" browser as NS 6.1.

  s = "Gecko";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isNS = true;
    this.version = 6.1;
    return;
  }
}

var browser = new Browser();

function go(link) {
	location.href = link;
}

function mover(obj) {
	if (obj.className == "menuitem") {
		obj.style.background = 'url(\'/media/menutile_over.png\') no-repeat';
	}
	else if (obj.className == "submenuitem") {
		obj.style.color = '#9ae047';
	}
	if (browser.isIE)
		document.body.style.cursor = "hand";
	if (browser.isNS)
		obj.style.cursor = "pointer";
}

function mout(obj) {
	if (obj.className == "menuitem") {
		obj.style.background='url(\'/media/menutile.png\') no-repeat';
	}
	else if (obj.className == "submenuitem") {
		obj.style.color = '#ffffff';
	}
	if (browser.isIE)
		document.body.style.cursor = "";
	if (browser.isNS)
		obj.style.cursor = "";
}

function pover(obj) {
	obj.style.background = '#6e80a6';
}

function pout(obj) {
	obj.style.background = '';
}

function openWin(url, width, height) {
	var posx = (window.screen.availWidth - width)/2;
	var posy = (window.screen.availHeight - height)/2;
	var pwin = window.open(url, "win", "top="+posy+",left="+posx+",width="+width+",height="+height+",menubar=0,toolbar=0,status=0,location=0,scrollbars=auto,resizable=no,directories=no,dependent=yes");
	pwin.focus();
}

function submitOut(objButton) {
	objButton.className = "submitout";
}

function submitOver(objButton) {
	objButton.className = "submitover";
}

function submitDown(objButton) {
	objButton.className = "submitdown";
}

function orderinfo() {
	alert("Bestillingen er ikke åben endnu.\n\nØnsker du at blive skrevet op til vores åbningstilbud bedes du skrive til info@dsrack.dk, commler komme ind på vores IRC kanal på quakenet, hvor vi også kan besvare andre spørgsmål.\n\nVi åbner 1. maj, hvor du vil kunne bestille via denne side.");
}

function updateprice(price) {
	document.getElementById("totalprice").innerHTML = price;
}

function payinfo(paym) {
	alert("Det er endnu ikke muligt at vælge " + paym + " som betalingsmetode.");
}
