(function() {

var IE = document.all;

var EL = function(tag) {return document.createElement(tag)};

var ID = function(id) {return document.getElementById(id)};

var pX = pY = 0;

var pos = function(e) {
  var e = e || window.event;
  if (e.pageX !== undefined) {
    pX = e.pageX;
    pY = e.pageY;
  }
  else if (e.clientX !== undefined) {
    pX = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
    pY = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
  }
  if (tt.obj) {
    tt.obj.style.left = pX + 20 + 'px';
    tt.obj.style.top = pY - 20 + 'px';
  }
};

var tt = {};
tt.init = function() {
  if (tt.obj) return;
  document.onmousemove = pos;
  tt.obj = EL('div');
  tt.obj.id = 'tooltip';
  tt.obj.style.position = 'absolute';
  tt.inn = EL('div');
  tt.inn.id = 'tooltip-inner';
  tt.obj.appendChild(tt.inn);
  document.body.appendChild(tt.obj);
};
tt.show = function(html, cname) {
  if (!tt.obj) tt.init();
  if (tt.obj) {
    tt.inn.innerHTML = html;
    tt.obj.className = cname || '';
    tt.obj.style.display = 'block';
  }
};
tt.hide = function() {
  if (tt.obj) tt.obj.style.display = 'none';
};

var load = function() {
  var areas = document.getElementsByTagName('area');
  for (var A, i = 0; A = areas[i]; i++) {
    A._title = A.title;
    A.title = A.alt = '';
    A.onmouseover = function() {
      tt.show(this._title.split(' * ').join('<br />'), this.id);
    };
    A.onmouseout = function() {
      tt.hide();
    };
  }
  tt.init();
  if (IE) {
    ID('logo').alt = '';
  }
};

window.onload = load;

})();
