function menuFixIE() { // fix the dropdown menu for IE6
  if (navigator.userAgent.indexOf('MSIE 6.0') < 0) return;

  navRoot = document.getElementById("navlist");
  for (i = (navRoot.childNodes.length - 1); i >= 0; i--) {
    node = navRoot.childNodes[i];
    if (node.nodeName.toLowerCase() == "li") {
      node.onmouseover = function() {
        if (this.className.indexOf(' IEhover') < 0)
          this.className += " IEhover";
      }
      node.onmouseout = function() {
        this.className = this.className.replace(" IEhover", "");
      }
    }
  }
}

function init() {
	// is the browser DOM1 compliant? if not, exit
	if (!document.getElementsByTagName) return;

        menuFixIE();

	// fetch all <a> tags in the document
	var links = document.getElementsByTagName('a');

	// loop through the a elements
	for (var i = (links.length - 1); i >= 0; i--) {
		// the element for this iteration
		var a = links[i];
		
		// if the link is external, attach the onclick handler.
		if (!a.href.indexOf('http://')
		    && a.href.indexOf('http://www.brillen-fendt.de/'))
			a.onclick = OpenWindow;
	}
}

function OpenWindow(event) {
	// open a new window with the link's href.
	var success = window.open(this.href, "",
        'toolbar=1,status=1,titlebar=1,menubar=1,scrollbars=1,'
        +'directories=1,location=1,fullscreen=0,resizable=1');

        // if the new window did not open then return true
        // so the link is followed normally
	return !success; 
  }


onload = init;
