function initICIT()
{
  //showTooltip();
}

window.onload = function () {
  LoadStyle();
  buildSubMenus ();
  if (tooltipTheWords != null) {
    tooltipWords = new TooltipWords(tooltipTheWords, 'content');  
  }  
}


function showSub(mainName){

}

function showLibraryInfo(elm, info) {
  lDiv = document.getElementById('libraryDiv');

  wt = 240;
  w = 7 * info.length + 6;
  h = 140;

  if (info.length > 0) {
    lDiv.style.height = h + "px";
    leftOff = -40;
    topOff = -145;
    tElm = elm;
    while (tElm = tElm.offsetParent) {
      topOff += tElm.offsetTop;
      leftOff += tElm.offsetLeft;
      tElm2 = tElm;
    }
    if (leftOff > tElm2.clientWidth / 2) {
      leftOff = leftOff - lDiv.clientWidth;
    } else {
      leftOff = leftOff + elm.clientWidth;
    }
    topOff = $(elm).getPosition().y -145;
    leftOff = $(elm).getPosition().x;
    cntDiv = document.getElementById('infoContent');

    //elm.style.backgroundColor = '#dceeff';
    cntDiv.innerHTML = '<p style="margin: 0px;">' + info + '</p>';
    lDiv.style.left = leftOff + "px";
    lDiv.style.top = ( topOff + elm.clientHeight ) + "px";
    lDiv.style.visibility = "visible";
    lDiv.style.display = "block";
  } else {
    lDiv.style.visibility = "hidden";
    lDiv.style.display = "none";
    //elm.style.backgroundColor = '';
  }
}


function showTooltip()
{
  spans = document.getElementsByTagName ( 'span' );
  for ( a = 0; a < spans.length; a ++ )
  {
    if ( spans [ a ].className == 'tooltip' && spans [ a ].title.length > 0 )
    {
      while ( ( b = spans [ a ].title.indexOf ( '  ' ) ) != -1 )
        spans [ a ].title = spans [ a ].title.substring ( 0, b ) + '<br />' + spans [ a ].title.substring ( b + 2, spans [ a ].title.length );

      eval ( 'spans [ a ].onmouseover = function () {showLibraryInfo ( this, \'' + spans [ a ].title + '\' );}' );
      spans [ a ].onmouseout = function () {
        setTimeout("showLibraryInfo ( this, '' );",1000);
      }
      spans [ a ].title = '';
    }
  }
}