
// IE fix for hover
function addOver(nodeId) {
  if (document.all && document.getElementById){
    node = document.getElementById(nodeId);
    if (node){
      node.onmouseover = function(){
        this.className += " over";
      }
      node.onmouseout=function(){
        this.className=this.className.replace(" over", "");
      }
    }
  }
}

// addEventListener
// elObiect - objekt, elType - typ zdarzenia (click, change itp.), elFunction - funkcja(arg, um, enty)
// funkcja otrzymuje parametry (zdarzenie, arg, um, enty)
function addEL(elObiect, elType, elFunction){
  var elArgs = Array.prototype.slice.call(arguments, 3);
  elObiect[elType + elFunction] = function(evFunc){
    if (elFunction.apply(elObiect, [evFunc || window.event].concat(elArgs)) === !1){
      if (evFunc.preventDefault){
        return evFunc.preventDefault();
      }
      else {
        return false;
      }
    }
    else {
      return true;
    }
  }
  if (elObiect.evLstn = elObiect.addEventListener){
    return elObiect.evLstn(elType, elObiect[elType + elFunction], !1)
  }
  else {
    if (elObiect.evLstn = elObiect.attachEvent){
      return elObiect.evLstn('on' + elType, elObiect[elType + elFunction]);
    }
    else {
      return false;
    }
  }
}

//------------------------------------------------------------------------------------

function initEvents(){
  var naviSelect = document.getElementById('catID')
  addEL(naviSelect, 'change', quickNavi);
}

function quickNavi(){
  var naviForm   = document.getElementById('naviForm');
  var naviSelect = document.getElementById('catID');
  if (naviSelect.value){
    naviForm.submit();
  }
}

