﻿var currentTip = null;

function clearTimer()
{
  if(currentTip != null)
   {
       window.clearTimeout(currentTip);
       currentTip = null; 
   } 
}

function hideTip()
{
   clearTimer();
   tipShowing = false;
   oTip.style.visibility ="hidden";
   oTip.style.left = "-5000px";
   oTip.style.bgColor = ""; 
   oTip.style.border = "";  
   oTip.style.width = '';
   return false;
}

function loadTipHtml(tipHtml, tipWidth, tipColor, tipBorder)
{
    if(typeof tipWidth != "undefined" && tipWidth != null)
        oTip.style.width = tipWidth = "px";
           
    if(typeof tipColor != "undefined" && tipColor != null)
        oTip.style.bgColor = tipColor;
        
    if(typeof tipBorder != "undefined" && tipBorder != null)
        oTip.style.border = tipBorder;  
        
    oTip.innerHTML = tipHtml;
    tipShowing = true;
    setObjectPosition(oTip);
    return false;   
}

function setTip()
{
    oTip = getObj("emsTip");
}

function displayTip(itemId, router) {
    loadTipHtml(ems_PauseToLoadMsg, null, "", "2px solid black");
    currentTip = window.setTimeout("getTip(" + itemId + ", '" + router + "')", 1000);
    return;
}

function getTip(itemId, router) {
   setEmsData(true);
   emsData.tipItemId = itemId;
   makeCallback(router);  
   return;
}

function showDetails(page, qs, w, h) {
    var link = PathToRoot + page + "?" + qs;
    var width = w || 500;
    var height = h || 550;
    showPopWin(link, width, height, null, true);
    return false; 
}


document.write("<div id='emsTip'></div>");


addEvent(window, "load", setTip);



