var ie5 = false;
try {
    ie5 = ((document.getElementById) && (document.all));
}
catch (e) { ie5 = false; }

var ns6 = false;
try {
    ns6 = ((document.getElementById) && (!document.all));
}
catch (e) { ns6 = false; }

if (ie5 == 'undefined') {
    ie5 = false;
}

if (ns6 == 'undefined') {
    ns6 = false;
}

var index = 0;
var mouseX = 10;
var mouseY = 15;

function shTip(index) {
    //alert(index);   
    if (document.getElementById("InstantHelp1_hidHelp")) {
        if (Math.abs(document.getElementById("InstantHelp1_hidHelp").value) == 1) {
            var oTip = document.getElementById("box");
            var oFrm = document.getElementById("DivShim");
            if (oTip == null)
                return;
            oTip.style.display = "block";

            //commented for Atulr@ecotech : 02Nov09 Purpose : show Alert by passing string parameter. */    
            
            oTip.innerHTML = sTip[index];

            /* Added by : Atulr@ecotech : 02Nov09 Purpose : show Alert by passing string parameter. */                  
            //starts
            /*if (parseInt(index) >= 0) {                
                oTip.innerHTML = sTip[index];
            }
            else {
                oTip.innerHTML = index;
            }*/
            //ends
            if (oFrm != undefined) {
                oFrm.style.width = oTip.offsetWidth + 'px';
                oFrm.style.height = oTip.offsetHeight + 'px';
                oFrm.style.display = "block";
            }
        }
    }
}

/* Added by : atulr@ecotech : 19Nov09
   Purpose  : To display "string text" on mouse hover. */
function shTipStr(strText) {
    //alert(strText);   
    if (document.getElementById("InstantHelp1_hidHelp")) {
        if (Math.abs(document.getElementById("InstantHelp1_hidHelp").value) == 1) {
            var oTip = document.getElementById("box");
            var oFrm = document.getElementById("DivShim");
            if (oTip == null)
                return;
            oTip.style.display = "block";
            oTip.innerHTML = strText;
            if (oFrm != undefined) {
                oFrm.style.width = oTip.offsetWidth + 'px';
                oFrm.style.height = oTip.offsetHeight + 'px';
                oFrm.style.display = "block";
            }
        }
    }
}

function hdTip() {
    var oTip = document.getElementById("box");
    var oFrm = document.getElementById("DivShim");
    if (oTip == null)
        return;
    oTip.style.display = "none";
    if (oFrm != undefined) {
        oFrm.style.display = "none";
    }

}

function getMouseMove(e) {
    if (e == "undefined")
        return;

    var oTip = document.getElementById("box");
    var oFrm = document.getElementById("DivShim");
    if (oTip == null)
        return;
    var ieX = false;
    try {
        ieX = ((document.getElementById) && (document.all));
    }
    catch (e) { ieX = false; }

    if (ieX) {
        if (event == null)
            return;
        oTip.style.left = document.body.scrollLeft + event.clientX + 10; //mouseX;

        if (oTip.style.left > "780px") {
            oTip.style.left = "740px";
        }

        //if ((document.body.scrollTop + event.clientY + mouseY) < 1000){
        oTip.style.top = document.body.scrollTop + event.clientY + 15; //mouseY; 
        /*}else{
        oTip.style.top = "900px"  ;       
        } */


    }
    else {
        oTip.style.left = window.pageXOffset + e.clientX + 10; //mouseX;
        if (oTip.style.left > "780px")      // added
        {
            oTip.style.left = "740px";
        }

        oTip.style.top = window.pageYOffset + e.clientY + 15; //mouseY;
    }
    if (oFrm != undefined) {
        oFrm.style.border = '0px';
        oFrm.style.left = oTip.style.left;
        oFrm.style.top = oTip.style.top;
    }

}

document.onmousemove = getMouseMove;