﻿// JScript File
// voor het openhouden van het menu

$(document).ready(function() {

  //  sUrl = "" + window.location;
  //  sUrl = sUrl.toLowerCase();

  if (document.all) {
    FixFooter();
  }

  //  $('#dsMenu li').each(function(){

  //    // Controleer of de categorie in een van de LI's voorkomt.
  //    if (this.getElementsByTagName("a")[0] != null) {
  //        //alert (this.getElementsByTagName("a")[0].innerHTML.toLowerCase());
  //        //console.log(this.getElementsByTagName("a")[0].getAttribute('title') + ' UNDJETZT ' +  sUrl);
  //      if (sUrl.indexOf(this.getElementsByTagName("a")[0].getAttribute('title')) != -1) {
  //        // Klap deze UL open, die gematched is.
  //        
  //        
  //        // Vervolgens dienen alle parents geopend te worden, die te maken hebben met de gematchte LI.
  //        var oCurrentNode = this.parentNode;
  //        
  //        while(oCurrentNode.id != 'dsMenu') {
  //          if (oCurrentNode.tagName == 'UL') {
  //            $(oCurrentNode).show("fast");
  //          }
  //          oCurrentNode = oCurrentNode.parentNode;
  //        }
  //        console.log(this.getElementsByTagName("a")[0].getAttribute('title') + ' en ' + sUrl);
  //        $(this.getElementsByTagName("ul")[0]).show("fast");
  //      }
  //    }
  //  });

  $("#shopcartMenu").click(function() {
    location.href = '/winkelwagen.aspx';
  });

  $('#dsMenu a').click(function() {
    var ul = $(this).parent().next()[0];
    if (ul.nodeName == "UL") {
      if (ul.style.display == "") {
        ul.style.display = 'none';
        return false;
      }
    }
  });

  $('#dsMenu a').hover(function() {
    $(this).addClass('hover');
  }, function() {
    $(this).removeClass('hover');
  });

});



