bphover = 
{
  thumbs: [],
  current: 0,
  original_image: "",

  Make_Cover: function(p, el)
  {
    var cover_container = ljg.make("div", { css: "portfolio_cover_container" });
    cover_container.appendChild(el);
    p.appendChild(cover_container);
  },
  
  Add: function(thumb)
  {
    try { thumb.el = ljg.get(thumb.id); } catch(e) { return; }
    thumb.cover = ljg.make("div", { id: 'cover.' + thumb.id, css: "portfolio_cover" });
    ljg.add({ el: thumb.cover, on: "mouseover", fn: function() { var id = ((ljg.isUndef(window.event)) ? this.id : window.event.srcElement.id); bphover.Change_Hover(id.split(".").pop()); }});
    this.Make_Cover(thumb.el.parentNode.parentNode, thumb.cover);
    this.thumbs.push(thumb);
  },

  Initialize: function()
  {
    if (this.thumbs.length == 0) { return; }
    for (var i = 0; i < this.thumbs.length; i++)
    {
      if (i == this.current) { continue; }
      var thumb = this.thumbs[i];
      thumb.cover.style.visibility = 'visible';      
    }
  },

  Change_Hover: function(to)
  {
    for (var i = 0; i < this.thumbs.length; i++)
    { this.thumbs[i].cover.style.visibility = (+to == i) ? "hidden" : "visible"; }

    this.current = to;
  },
  
  Set_Selected: function (index) { this.current = +index; }
}
