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) {          
    if (document.getElementById("ctl00_cphMain_InstantHelp1_hidHelp")) {
        if (Math.abs(document.getElementById("ctl00_cphMain_InstantHelp1_hidHelp").value) == 1) {
            var oTip = document.getElementById("box");            
            var oFrm = document.getElementById("DivShim");
            if (oTip == null)
                return;
            oTip.style.display = "block";
            //oTip.innerHTML = sTip[index];
            /* Altered by : Atulr@ecotech : 02Nov09 : Start
               Purpose    : show Alert by passing string parameter. */
             if(parseInt(index) >= 0)            
                oTip.innerHTML = sTip[index];
            else
            {
                oTip.innerHTML = index;                
            }
            // Altered by : Atulr@ecotech : 02Nov09 : End
            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) {
    
    if (document.getElementById("ctl00_cphMain_InstantHelp1_hidHelp")) {
        if (Math.abs(document.getElementById("ctl00_cphMain_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");*/
    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 > "970px") {
            oTip.style.left = "930px";
        }

        //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 > "970px")      // added 780 px
        {
            oTip.style.left = "930px";         // 740 px
        }

        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;
