var isIE = !(document.layers || navigator.userAgent.indexOf('Opera'));
var isMoz = (navigator.product == "Gecko");


// Supershort helpers!
function gEI(n){return document.getElementById(n);}
function hEI(n){document.getElementById(n).style.display='none';}
function sIEI(n){document.getElementById(n).style.display='inline';}
function sBEI(n){document.getElementById(n).style.display='block';}
function go(u){window.location.href=u;}

function initPage() {
  if(document.layers) { // NN
  }
  else {
    if (navigator.userAgent.indexOf('Opera') != -1) { //Opera
	}
	else { //IE
	}
  }
  
}

/**
 * Sets CSS for super page (consisting of overview, selection and product details.)
 */
function setCSS() {
  // First check browser version and adapt style sheet to that.
  var ieVersion = 0;
  var userAg = navigator.userAgent;
  if (userAg.indexOf("MSIE") > 0) {
    ieVersion = parseFloat(userAg.substring(userAg.indexOf("MSIE") + 5, userAg.indexOf(";", userAg.indexOf("MSIE"))));
  }
  if (userAg.indexOf("Firefox") >= 0 || userAg.indexOf("Opera") >= 0 || userAg.indexOf("Safari") >= 0) {
  }
  else if (ieVersion < 7) {
  }
  else {
  }
}

/**
 * Used to switch on and off help boxes.
 */
function toggleHelp(on, off) {
  if (off != null) {
    document.getElementById("help" + off).style.display="none";
  }
  if (on != null) {
    document.getElementById("help" + on).style.display="inline";
  }
}


/**
 * Toggles expandable text section of buying guide
 */
function tGT(e) {toggleGuideText(e);}
function toggleGuideText(elementId) {
  var gText = gEI(elementId);
  if (gText.style.display != "none") {
    gText.style.display = "none";
  }
  else {
    gText.style.display = "block";
  }
}

/**
 * Used to get x-coordinate of an object
 */
function getXCoordinate(obj) {
  var xTot = 0;
  if (obj != null) {
	if (obj.offsetParent) {			
  	  while (obj.offsetParent) {
		xTot += obj.offsetLeft;
		obj = obj.offsetParent;
	  }
	}
	else if (obj.x) {
	  xTot += obj.x;
	}
  }
  return xTot;
}

/**
 * Used to get y-coordinate of an object
 */
function getYCoordinate(obj) {
  var yTot = 0;
  if (obj != null) {
	if (obj.offsetParent) {			
  	  while (obj.offsetParent) {
		yTot += obj.offsetTop;
		obj = obj.offsetParent;
	  }
	}
	else if (obj.y) {
	  yTot += obj.y;
	}
  }
  return yTot;
}

/**
 * Used to set x-coordinate of an object
 */
function setXCoordinate(obj, x) {
  if(document.layers) { // NN
   obj.left = x;
  }
  else {
    if (navigator.userAgent.indexOf('Opera') != -1) { //Opera
	  obj.style.pixelLeft = x;
	}
	else { //IE
	  obj.style.left = '' + x + 'px';
	}
  }
}

/**
 * Used to set y-coordinate of an object
 */
function setYCoordinate(obj, y) {
  if(document.layers) { // NN
   obj.top = y;
  }
  else {
    if (navigator.userAgent.indexOf('Opera') != -1) { //Opera
	  obj.style.pixelTop = y;
	}
	else { //IE
	  obj.style.top = '' + y + 'px';
	}
  }
}


