function getPageOffsetLeft(el) {

  var x;

  // Return the x coordinate of an element relative to the page.

  x = el.offsetLeft;
  if (el.offsetParent != null)
    x += getPageOffsetLeft(el.offsetParent);

  return x;
}

function getPageOffsetTop(el) {

  var y;

  // Return the x coordinate of an element relative to the page.

  y = el.offsetTop;
  if (el.offsetParent != null)
    y += getPageOffsetTop(el.offsetParent);

  return y;
}

function Browser() {

  var ua, s, i;

  this.isIE    = false;  // Internet Explorer
  this.isOP    = false;  // Opera
  this.isOP8   = false;  // Opera less than version 9
  this.isSA    = false;  // Safari
  this.isNS    = false;  // Netscape
  this.version = null;

  ua = navigator.userAgent;

  s = "Opera";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isOP = true;
    this.version = parseFloat(ua.substr(i + s.length));
	tmpnm = ua.indexOf("Opera");
	var v_opera = ua.substring(tmpnm+6, ua.length);
	v_opera = Number(v_opera.substring(0,1));
	v_opera = v_opera + 0;
	if (v_opera < 9) {
	this.isOP8 = true;
	}
    return;
  }

// Detect Safari for special case positioning fix
  s = "Safari";
  if ((i = ua.indexOf(s)) >= 0) {
    this.isSA = true;
    this.version = parseFloat(ua.substr(i + s.length));
  }


  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 Netscape 6.1.

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

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

var browser = new Browser();

function showmenu(show) {
	button = document.getElementById("systems_button");
	x = getPageOffsetLeft(button);
	y = getPageOffsetTop(button) + button.offsetHeight;
	
	if (browser.isIE) {
		x += button.offsetParent.clientLeft;
		y += button.offsetParent.clientTop;
	}
	
	//menu = document.getElementById("menu");
	
	document.getElementById("menu").style.left = x + "px";
	document.getElementById("menu").style.top  = y + "px";
	document.getElementById("menu").style.visibility = show ? "visible" : "hidden";
}