var core = core || {};

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

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

core.changeCircleImage = function (img) {
  core.circleImage.src = '/businesshub/templates/businesshub/img/' + img;
};

(function () {
  var welcomeContentSections = core._('welcome-content-sections'),
    consultingSection = core._('consulting-section'),
    financeLawSection = core._('finance-law-section'),
    itSection = core._('it-section'),
    marketingSection = core._('marketing-section'),
    serviceSection = core._('service-section');

  core.circleImage = core._('circle-image');

  core.addEvent(consultingSection, 'mouseover', function () {
    core.changeCircleImage('circle-consulting.png');
  });

  core.addEvent(financeLawSection, 'mouseover', function () {
    core.changeCircleImage('circle-finance.png');
  });

  core.addEvent(itSection, 'mouseover', function () {
    core.changeCircleImage('circle-it.png');
  });

  core.addEvent(marketingSection, 'mouseover', function () {
    core.changeCircleImage('circle-marketing.png');
  });

  core.addEvent(serviceSection, 'mouseover', function () {
    core.changeCircleImage('circle-service.png');
  });

  core.addEvent(welcomeContentSections, 'mouseout', function () {
    core.changeCircleImage('circle.png');
  });
})();
