var ie = document.all ? 1 : 0
var ns = (document.getElementById && !document.all) ? 1 : 0

if(ns){doc = "document.getElementById(\"ToolTip\")"; sty = ""}
if(ie){doc = "document.all."; sty = ".style"}

var initialize = 0
var Ex, Ey, topColor, subColor, ContentInfo

if(ie){
Ex = "event.x"
Ey = "event.y"
topColor = "#92A5B5"
subColor = "#dee3e7"
}

function MoveToolTip(layerName, FromTop, FromLeft, e){
if(ie){
eval(doc + layerName + sty + ".top = " + (eval(FromTop) + document.body.scrollTop))
eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15))
}
if(ns){
document.getElementById("ToolTip").style.top = FromTop
document.getElementById("ToolTip").style.left = FromLeft + 15
}
}

function ReplaceContent(layerName){
if(ie){document.all[layerName].innerHTML = ContentInfo}
if(ns){document.getElementById("ToolTip").innerHTML = ContentInfo}
}

function Activate(){initialize=1}
function deActivate(){initialize=0}

function overhere(e){
if (!e) var e = window.event;
if(initialize){
if (ns) {
window.captureEvents(Event.MOUSEMOVE)
window.onmousemove=overhere
Ex = window.pageXOffset+e.clientX
Ey = window.pageYOffset+e.clientY
topColor = "#92A5B5"
subColor = "#dee3e7"
}
MoveToolTip("ToolTip", Ey, Ex, e)
document.getElementById("ToolTip").style.visibility = 'visible'
}
else{
MoveToolTip("ToolTip", 0, 0)
document.getElementById("ToolTip").style.visibility = 'hidden'
}
}

function EnterContent(layerName, TTitle, TContent){

ContentInfo = '<table border="0" width="155" cellspacing="0" cellpadding="0">'+
'<tr><td width="100%" bgcolor="#000000">'+

'<table border="0" width="100%" cellspacing="1" cellpadding="0">'+
'<tr><td width="100%" bgcolor='+topColor+'>'+

'<table border="0" width="90%" cellspacing="0" cellpadding="0" align="center">'+
'<tr><td width="100%">'+

'<font class="tooltiptitle"> '+TTitle+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+

'<tr><td width="100%" bgcolor='+subColor+'>'+

'<table border="0" width="90%" cellpadding="0" cellspacing="1" align="center">'+

'<tr><td width="100%">'+

'<font class="tooltipcontent">'+TContent+'</font>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>'+

'</td></tr>'+
'</table>';

ReplaceContent(layerName)
}
