/* - - - - - - - - - - - - - - - - - - - - -

Description : Dropper javascript // fix for
IE list-item hovers and clear for the top
border in the dropper - under the button

- - - - - - - - - - - - - - - - - - - - - */

dropper={

  startList:function() {
  
    if (document.all&&document.getElementById) {
    
      navRoot = document.getElementById("nav");
      
        for (i=0; i<navRoot.childNodes.length; i++) {
        
          node = navRoot.childNodes[i];
                          
          if (node.nodeName=="LI" && node.hasChildNodes) {
                 
            node.onmouseover=function() {
            this.className+=" hovered";
            }
            
            node.onmouseout=function() {
            this.className=this.className.replace(" hovered", "");
            }
        }
      }
    }
  },

  
  
  createBorder:function(){

    navRoot = document.getElementById("nav");
      
      for (i=0; i<navRoot.childNodes.length; i++) {
        
        button = navRoot.childNodes[i];
          
        if (button.nodeName=="LI") {
        
          for (j=0; j<button.childNodes.length; j++) {
        
            node = button.childNodes[j];
              
            if (node.nodeName=="UL") {
        
              border = document.createElement('span');
      				border.className = 'border';
      				border.style.width = button.offsetWidth-2+'px';

      				node.appendChild(border);
      			
      		}
      	}
      }
    } 
  },
  
  
  quicklinkDropper:function() {
  
    if (document.all&&document.getElementById) {
    
      navRoot = document.getElementById("inner");
      
        for (i=0; i<navRoot.childNodes.length; i++) {
        
          node = navRoot.childNodes[i];
                          
          if (node.nodeName=="LI" && node.hasChildNodes) {
                 
            node.onmouseover=function() {
            this.className+=" hovered";
            }
            
            node.onmouseout=function() {
            this.className=this.className.replace(" hovered", "");
            }
        }
      }
    }
  }  
  
};




/* From scottandrew.com: */
function addEvent(obj, evType, fn, useCapture){
  if (obj.addEventListener) {
    obj.addEventListener(evType, fn, useCapture);
    return true;
  } else if (obj.attachEvent){
    var r = obj.attachEvent("on"+evType, fn);
    return r;
  } else {
    // alert('Handler could not be attached');
    return false;
  }
}

addEvent(window, 'load', dropper.startList, false);
/*addEvent(window, 'load', dropper.createBorder, false);*/
addEvent(window, 'load', dropper.quicklinkDropper, false);


/* menu voor o.a. shop */
function MM_jumpMenu(targ,selObj,restore){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;}

