﻿// JScript File
ContentInfo = "";

var mouse_X;
var mouse_Y;
var tip_active = 0;
function update_tip_pos() {

    var x = (mouse_X - 100) + 'px';
    var y = (mouse_Y - 180) + 'px';
    document.getElementById('ToolTip').style.left = x;
    document.getElementById('ToolTip').style.top = y;

}
var ie = document.all ? true : false;
if (!ie) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;

function getMouseXY(e) { //e) {
    if (ie) { // grab the x-y pos.s if browser is IE
        //document.onmousemove = null ;
        mouse_X = window.event.clientX + document.documentElement.scrollLeft;
        mouse_Y = window.event.clientY + document.documentElement.scrollTop;
    }
    else { // grab the x-y pos.s if browser is NS

        mouse_X = 0; mouse_Y = 0;
        var ev = (!e) ? window.event : e; //Moz:IE
        if (ev.pageX) { mouse_X = ev.pageX; mouse_Y = ev.pageY } //Mozilla or compatible
    
 
     
    }

    if (mouse_X < 0) { mouse_X = 0; }
    if (mouse_Y < 0) { mouse_Y = 0; }

    if (tip_active) { update_tip_pos(); }
}

function EnterContent(TTitle, TContent, TPicUrl, perfix) {

    if (TPicUrl == '-1') {
        ContentInfo = '<table  width="100%" class="tblClass">' +
'<tr><td width="100%" >' +

'<table border="0" width="100%" cellspacing="0" cellpadding="0">' +
'<tr><td width="100%" class="tooltipTop" >' +

'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">' +
'<tr><td width="100%" align="center" >' +

'<font class="tooltiptitle">&nbsp;' + TTitle + '</font>' +

'</td></tr>' +
'</table>' +

'</td></tr>' +

'<tr><td width="100%" class = "toolTipsub" >' +

  '<table border="0" width="90%" cellpadding="0" cellspacing="0" align="center" clas="tooltipcontent">' +
         '<tr>' +
                '<td noWrap class="tooltipcontent" style="padding-right: 4px; padding-left: 4px" >' +
                                                TContent +
                                                '</td> </tr>  ' +


                                    '</table>' +

'</td></tr>' +
'</table>';
    }
    else {

        ContentInfo = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' +
'<tr><td width="100%" >' +

'<table border="0" width="100%" cellspacing="0" cellpadding="0">' +
'<tr><td width="100%" class="tooltipTop" >' +

'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">' +
'<tr><td width="100%" align="center">' +

'<font class="tooltiptitle">&nbsp;' + TTitle + '</font>' +

'</td></tr>' +
'</table>' +

'</td></tr>' +

'<tr><td width="100%" class = "toolTipsub" >' +

  '<table border="0" width="90%" cellpadding="0" cellspacing="0" align="center">' +
         '<tr>' +
                '<td><img src="' + TPicUrl + ' "> </td>' +

                '<td noWrap class="tooltipcontent" style="padding-right: 4px; padding-left: 4px" > ' +
                                                TContent +
                                                '</td> </tr>  ' +

                                    '</table>' +

'</td></tr>' +
'</table>';

    }

}

function tip_it(which, TTitle, TContent, TPicUrl, perfix) {

    if (which) {

        document.onmousemove = getMouseXY;

        update_tip_pos();
      

        document.getElementById('ToolTip').style.visibility = "visible";

        EnterContent(TTitle, TContent, TPicUrl, perfix);

        document.getElementById('ToolTip').innerHTML = ContentInfo;
		  tip_active = 1;


    } else {
        //document.onmousemove = null;
        tip_active = 0;
        document.getElementById('ToolTip').style.visibility = "hidden";
    }

}

//-->


