function hidePreloader() {
  var preloader = document.getElementById('preloader');
  preloader.style.display = 'none';
}

function addActive(obj) {
  var re = /-active.png/;
  if (obj.style.background && !re.test(obj.style.background)) {
    obj.style.zIndex = 13; /* mark as altered */
    obj.style.background = obj.style.background.replace('.png', '-active.png');
  }
  if (obj.style.filter && !re.test(obj.style.filter)) {
    obj.style.zIndex = 13; /* mark as altered */
    obj.style.filter = obj.style.filter.replace('.png', '-active.png');
  }
}

function delActive(obj) {
  if (obj.style.background && (obj.style.zIndex == 13)) {
    /* object was altered and needs to be reverted */
    obj.style.zIndex = 0;
    obj.style.background = obj.style.background.replace('-active.png', '.png');
  }
  if (obj.style.filter && (obj.style.zIndex == 13)) {
    /* object was altered and needs to be reverted */
    obj.style.zIndex = 0;
    obj.style.filter = obj.style.filter.replace('-active.png', '.png');
  }
}
