var core = core || {};

core.imgInfo = null;

core.imgWrapper = null;

core._ = function (id) {
  return document.getElementById(id);
};

core.addEvent = function (id, event, func) {
  if (id.attachEvent) {
    id.attachEvent('on' + event, func);
  } else {
    id.addEventListener(event, func, false);
  }
};

core.setCss = function (sel, attr, val) {
  var tmp = attr + ':' + val;
  
  if (sel.cssText) {
    sel.css = tmp;
  } else {
    sel.setAttribute('style', tmp);
  }
};

core.hide = function () {
  core.setCss(core.imgInfo, 'display', 'none');
};

core.show = function () {
  core.setCss(core.imgInfo, 'display', 'block');
};

(function () {
  core.imgInfo = core._('imgInfo');
  core.imgWrapper = core._('imgWrapper');

  core.addEvent(core.imgWrapper, 'mouseover', function () {
    core.show();
  });

  core.addEvent(core.imgWrapper, 'mouseout', function () {
    core.hide();
  });
})();
