﻿// *** Global Vars ******************************************************************************************************
var xmlHttp;
var gblEvtDescTimeout = 0;
// *** End Global Vars **************************************************************************************************


// Create HTTP Object
function createXMLHttpRequest() {
    if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
}


// *** Event Description routines ***************************************************************************************
// Set Div position and show Event Description text
function showEvtDesc(inObj, inEvtDesc) {
    var offsets = Position.cumulativeOffset($(inObj));
    $("pnlEventDesc").style.left = offsets[0] + "px";
    $("pnlEventDesc").style.top = (1 + offsets[1] + $(inObj).getHeight()) + "px";
    $("pnlEventDesc").style.width = inEvtDesc.length * 4;
    $("pnlEventDesc").style.height = 40;

    $("pnlEventDesc").innerHTML = "<table id='EvtDesc'><tr><td>" + inEvtDesc + "</td></tr></table>";
    $("pnlEventDesc").show();
    
    var pause = ((inEvtDesc.length / 10) * 1000) + 1000;
    gblEvtDescTimeout = setTimeout("hideEvtDesc()", pause);
}

function hideEvtDesc() {
    clearTimeout(gblEvtDescTimeout);
    $("pnlEventDesc").hide();
}
// *** End Event Description routines ***********************************************************************************

