function GoToProduct(elem) {
  if (elem.options[elem.selectedIndex].value > 0) {
    location='mt_product.php?id='+elem.options[elem.selectedIndex].value+'#cur';
  }
}

function GoToNews(elem) {
  if (elem.options[elem.selectedIndex].value > 0) {
    location='mt_infoitem.php?id='+elem.options[elem.selectedIndex].value;
  }
}

function GoToEigenschap(elem) {
  if (elem.options[elem.selectedIndex].value > 0) {
    location='mt_eigensch.php?id='+elem.options[elem.selectedIndex].value;
  }
}

function GoToProdgroep(elem) {
  if (elem.options[elem.selectedIndex].value > 0) {
    location='mt_prodgroep.php?id='+elem.options[elem.selectedIndex].value;
  }
}

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="index2.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 ResetCursor() {
  document.body.style.cursor='default';
}

function EnableSearchButton() {
  button = document.getElementById('zoeken');
  if (this.value == '') {
    button.style.background = "url(Image/nav/zoeken1.png) white";
    button.style.border = "none";
  } else {
    button.style.background = "url(Image/nav/zoeken2.png) #FF3300";
    button.style.border = "thin #FF3300";
  }
}


function Highlight(menu, selected, aantal, level) {
  for (i=1; i<=aantal; i++) {
    if (i != selected &&  document.getElementById('sep_line'+i)) {
      document.getElementById('sep_line'+i).style.visibility='hidden';
    }
    if (document.getElementById('submenu'+i)) {
      document.getElementById('submenu'+i).style.visibility='hidden';
    }
  }
  if (menu > 0 || (level==2 && menu==selected)) {
  if (document.getElementById('sep_line'+menu) && document.getElementById('submenu'+menu)) {
    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='index2.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 config = new Object();    // create new config object
config.bodyStyle = 'font-family: Verdana, Tahoma, sans-serif; font-size: 10px; font-weight: none; background-image: none; background-color: #FFFFFF; margin: 0 0 0 0px; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;';
config.debug = 0;

// NOTE:  You can remove any of these blocks and use the default config!

config.toolbar = [
    ['fontname'],
    ['fontsize'],
    ['fontstyle'],
    ['linebreak'],
    ['bold','italic','underline','separator'],
  ['strikethrough','subscript','superscript','separator'],
    ['justifyleft','justifycenter','justifyright','separator'],
    ['OrderedList','UnOrderedList','Outdent','Indent','separator'],
    ['forecolor','backcolor','separator'],
    ['HorizontalRule','Createlink','InsertImage','InsertTable','htmlmode','separator'],
//    ['about','help','popupeditor'],
];

config.fontnames = {
    "Verdana":         "Verdana, Tahoma, sans-serif",
    "Courier New":     "courier new, courier, mono",
    "Times New Roman": "times new roman, times, serif",
    "WingDings":       "WingDings"
};
config.fontsizes = {
    " 1 ( 6px)": "1",
    " 2 ( 8px)": "2",
    " 3 (10px)": "3",
    " 4 (11px)": "4",
    " 5 (12px)": "5",
    " 6 (14px)": "6",
    " 7 (16px)": "7",
    " 8 (18px)": "8",
    " 9 (22px)": "9",
    "10 (24px)": "10"
  };

config.stylesheet = "http://www.isotron.eu/gin.css";
//config.stylesheet = "http://www.vanessensensors.nl/gin/gin.css";

config.fontstyles = [   // make sure classNames are defined in the page the content is being display as well in or they won't work!
// leave classStyle blank if it's defined in config.stylesheet (above), like this:
//  { name: "verdana blue", className: "headline4", classStyle: "" }
];

var medconfig = new Object();    // create new config object
medconfig.bodyStyle = 'font-family: Verdana, Tahoma, sans-serif; font-size: 10px; font-weight: none; background-image: none; background-color: #FFFFFF; margin: 0 0 0 0px; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;';
medconfig.debug = 0;
medconfig.toolbar = [
    ['fontname','fontsize'],
    ['bold','italic','underline','separator'],
    ['justifyleft','justifycenter','justifyright','separator'],
    ['OrderedList','UnOrderedList','separator'],
    ['forecolor','backcolor','separator'],
    ['HorizontalRule','Createlink','htmlmode','separator'],
];
// NOTE:  You can remove any of these blocks and use the default config!
medconfig.fontnames = {
    "Verdana":         "Verdana, Tahoma, sans-serif",
    "WingDings":       "WingDings"
};
medconfig.fontsizes = {
    " 1 ( 6px)": "1",
    " 2 ( 8px)": "2",
    " 3 (10px)": "3",
    " 4 (11px)": "4",
    " 5 (12px)": "5",
    " 6 (14px)": "6",
    " 7 (16px)": "7",
    " 8 (18px)": "8",
    " 9 (22px)": "9",
    "10 (24px)": "10"
};

medconfig.stylesheet = "http://www.isotron.eu/gin.css";
//medconfig.stylesheet = "http://www.vanessensensors.nl/gin/gin.css";

medconfig.fontstyles = [   // make sure classNames are defined in the page the content is being display as well in or they won't work!
// leave classStyle blank if it's defined in config.stylesheet (above), like this:
//  { name: "verdana blue", className: "headline4", classStyle: "" }
];



var minconfig = new Object();    // create new config object
minconfig.bodyStyle = 'font-family: Verdana, Tahoma, sans-serif; font-size: 10px; font-weight: none; background-image: none; background-color: #FFFFFF; margin: 0 0 0 0px; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;';
minconfig.debug = 0;
minconfig.toolbar = [
    ['fontname','fontsize'],
    ['bold','italic','underline','separator'],
    ['OrderedList','UnOrderedList','htmlmode'],
];
// NOTE:  You can remove any of these blocks and use the default config!
minconfig.fontnames = {
    "Verdana":         "Verdana, Tahoma, sans-serif",
    "WingDings":       "WingDings"
};
minconfig.fontsizes = {
    " 1 ( 6px)": "1",
    " 2 ( 8px)": "2",
    " 3 (10px)": "3",
    " 4 (11px)": "4",
    " 5 (12px)": "5",
    " 6 (14px)": "6",
    " 7 (16px)": "7",
    " 8 (18px)": "8",
    " 9 (22px)": "9",
    "10 (24px)": "10"
};

minconfig.stylesheet = "http://www.isotron.eu/gin.css";
//minconfig.stylesheet = "http://www.vanessensensors.nl/gin/gin.css";

minconfig.fontstyles = [   // make sure classNames are defined in the page the content is being display as well in or they won't work!
// leave classStyle blank if it's defined in config.stylesheet (above), like this:
//  { name: "verdana blue", className: "headline4", classStyle: "" }
];


var actueelconf = new Object();    // create new config object
actueelconf.width = "160px";
actueelconf.height = "125px";
actueelconf.bodyStyle = 'font-family: Verdana, Tahoma, sans-serif; font-size: 10px; font-weight: none; background-image: none; background-color: #FFFFFF; margin: 0 0 0 0px; margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px;';
actueelconf.debug = 0;
actueelconf.toolbar = [
    ['fontname','fontsize'],
    ['bold','italic','underline','separator'],
    ['justifyleft','justifycenter','justifyright','separator'],
    ['OrderedList','UnOrderedList','separator'],
    ['forecolor','backcolor','separator'],
    ['HorizontalRule','Createlink','htmlmode','separator'],
];
// NOTE:  You can remove any of these blocks and use the default config!
actueelconf.fontnames = {
    "Verdana":         "Verdana, Tahoma, sans-serif",
    "WingDings":       "WingDings"
};
actueelconf.fontsizes = {
    " 1 ( 6px)": "1",
    " 2 ( 8px)": "2",
    " 3 (10px)": "3",
    " 4 (11px)": "4",
    " 5 (12px)": "5",
    " 6 (14px)": "6",
    " 7 (16px)": "7",
    " 8 (18px)": "8",
    " 9 (22px)": "9",
    "10 (24px)": "10"
};

actueelconf.stylesheet = "http://www.isotron.eu/gin.css";
//actueelconf.stylesheet = "http://www.vanessensensors.nl/gin/gin.css";

actueelconf.fontstyles = [   // make sure classNames are defined in the page the content is being display as well in or they won't work!
// leave classStyle blank if it's defined in config.stylesheet (above), like this:
//  { name: "verdana blue", className: "headline4", classStyle: "" }
];

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 = '';
}
