function restorePage() {
	if (Nav4) {
		if (startWidth != window.innerWidth || startHeight != window.innerHeight) {
			history.go(0);
		}
	} else {
		history.go(0);
	}
}

function selectproduct() {
var list = document.forms[0].gekoppeld_product;
  if (list.selectedIndex >= 0) {
    var prodID = list.options[list.selectedIndex].value;
    if (prodID > 0) {
    location='mt_product.php?product_id='+prodID;
  } else if (prodID = -2) {
    alert("Selecteer een product in plaats van een merk!");
  } else {
    alert("Er is geen product geselecteerd uit de lijst met gekoppelde producten!");
  }
  } else {
      alert("Er is geen product geselecteerd uit de lijst met gekoppelde producten!");
  }
}

function getWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
      //Non-IE
      myWidth = window.innerWidth;
  } else if( document.documentElement && document.documentElement.clientWidth ) {
    //IE 6+ in 'standards compliant mode'
      myWidth = document.documentElement.clientWidth;
  } else if( document.body && document.body.clientWidth ) {
      //IE 4 compatible
      myWidth = document.body.clientWidth;
  }
//	window.status = "schermbreedte: "+myWidth+"px";
  return(myWidth);
}

function SendOffset(id, lng, x_offset) {
	location.href="index.php?id="+id+"&lng="+lng+"&ofs=" + x_offset;
}


function getHeight() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement &&
      document.documentElement.clientHeight ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && document.body.clientHeight ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return(myHeight);
}

function Highlight(menu, selected, aantal, level) {
  for (i=1; i<=aantal; i++) {
  	if (i != selected) {
  	  document.getElementById('sep_line'+i).style.visibility='hidden';
		}
		document.getElementById('submenu'+i).style.visibility='hidden';
  }
  if (menu > 0 || (level==2 && menu==selected)) {
  	document.getElementById('sep_line'+menu).style.visibility='visible';
	document.getElementById('submenu'+menu).style.visibility='visible';
//	window.status = "element: "+menu+" is zichtbaar (selected="+selected+")";
	}
}

function BP() {
	this.plat = (navigator.platform.indexOf('Mac') > -1) ? 'mac' : 'pc';
	if (navigator.appName.indexOf('Microsoft') > -1) {
	 	this.brow = 'ie'; 
	} else {
		this.brow ='ns';
	}
  return this;
} 

function GoToStart() {
	document.location='index.php?id=1';
}
	
function setHeight(myHeight) {
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    window.innerHeight = myHeight;
  } else if( document.documentElement &&
      document.documentElement.clientHeight ) {
    //IE 6+ in 'standards compliant mode'
  document.documentElement.clientHeight = myHeight;
  } else if( document.body && document.body.clientHeight ) {
    //IE 4 compatible
    document.body.clientHeight = myHeight;
  }
}

var windowNote;
function showImage(image, title, width, height) {
  windowNote = window.open('','Image','toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + width + ',height='+height);
  text = '<HTML><HEAD><TITLE>' + title + '</TITLE></HEAD><BODY alink="ff0000" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0">';
  text += '<IMG SRC="' + image + '" BORDER=0 ALIGN=LEFT>';
  text += '</BODY></HTML>';
  windowNote.document.write(text);
  windowNote.focus();
  windowNote.document.close();
  return false;
}

function openwindow(url, width, height) {
   window.open(url,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=auto, resizable=yes, left=90, top=160, width=" + width + ", height=" + height)
}

function createwindow(data)  {
   extraWindow = window.open("","extraWindow", "toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=auto, resizable=yes, left=90, top=160, width=800, height=600");
   extraWindow.document.write(data);
}

  _editor_url = "";                     // URL to htmlarea files
  var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
  if (navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver = 0; }
  if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
  if (navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver = 0; }
  if (win_ie_ver >= 5.5) {
    document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
    document.write(' language="Javascript1.2"></scr' + 'ipt>');
  } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>');
}

/*Browsercheck object - we have to move this into the page to prevent an error in NS4*/
function cm_bwcheck(){
  this.ver=navigator.appVersion
  this.agent=navigator.userAgent.toLowerCase()
  this.dom=document.getElementById?1:0
  this.op5=(this.agent.indexOf("opera 5")>-1 || this.agent.indexOf("opera/5")>-1) && window.opera
  this.op6=(this.agent.indexOf("opera 6")>-1 || this.agent.indexOf("opera/6")>-1) && window.opera
  this.ie5 = (this.agent.indexOf("msie 5")>-1 && !this.op5 && !this.op6)
  this.ie55 = (this.ie5 && this.agent.indexOf("msie 5.5")>-1)
  this.ie6 = (this.agent.indexOf("msie 6")>-1 && !this.op5 && !this.op6)
  this.ie4=(this.agent.indexOf("msie")>-1 && document.all &&!this.op5 &&!this.op6 &&!this.ie5&&!this.ie6)
  this.ie = (this.ie4 || this.ie5 || this.ie6)
  this.mac=(this.agent.indexOf("mac")>-1)
  this.ns6=(this.agent.indexOf("gecko")>-1 || window.sidebar)
  this.ns4=(!this.dom && document.layers)?1:0;
  this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.op5 || this.op6)
  this.usedom= this.ns6//Use dom creation
  this.reuse = this.ie||this.usedom //Reuse layers
  this.px=this.dom&&!this.op5?"px":""
  return this
}
var bw=new cm_bwcheck()
/***
This is the menu creation code - place it right after you body tag
Feel free to add this to a stand-alone js file and link it to your page.
**/

function HideBox(obj) {
  if (obj.style.display == '')
   obj.style.display = 'none';
}
function ShowBox(obj) {
  if (obj.style.display == 'none')
  obj.style.display = '';
}

