  function changeImgOn(root,path,img,type) {
    document.images[img].src = root + 'img/template/'+ path + img + '-on'+ type;
  }
  
  function changeImgOff(root,path,img,type) {
    document.images[img].src = root + 'img/template/'+ path + img + '-off'+ type;
  }
  
  function changeIconOn(root,img) {
    document.images[img].src = root + 'img/icons/'+ img + '-on.gif';
  }
  
  function changeIconOff(root,img) {
    document.images[img].src = root + 'img/icons/'+ img + '-off.gif';
  }

  // in_array
  Array.prototype.contains = function (elem) {
    var i;
    for(i = 0; i < this.length; i++) {
     if(this[i] === elem) {
        return true;
      }
    }
    return false;
  };
