var ns6 = (document.styleSheets && !document.all) ? 1 : 0
var ie = document.all ? 1 : 0
var ns = document.layers ? 1 : 0
var ie6 = ie && document.implementation;

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

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

topColor = "#00ccff"
subColor = "#ffffff"

if(ie){
 Ex = "event.x"
 Ey = "event.y"
}

if(ns){
 Ex = "e.pageX"
 Ey = "e.pageY"
 window.captureEvents(Event.MOUSEMOVE)
 window.onmousemove=overhere
}

/*
(isIE6) ? event.clientY +
                     document.documentElement.scrollTop +
                     document.body.scrollTop :
           (isIE)  ? event.clientY + window.scrollY :
                     E.clientY + window.pageYOffset;
}
*/

function MoveToolTip(layerName, FromTop, FromLeft, e){ 

 if (ie6) {eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.documentElement.scrollTop + document.body.scrollTop))}
 else if (ie) {eval(doc + layerName + sty + ".top = "  + (eval(FromTop) + document.body.scrollTop))}

 if(ns){eval(doc + layerName + sty + ".top = "  +  eval(FromTop))}
 if(!ns6) eval(doc + layerName + sty + ".left = " + (eval(FromLeft) + 15))
 if(ns6) document.getElementById("ToolTip").style.top = FromTop + 10 + "px"
 if(ns6) document.getElementById("ToolTip").style.left = FromLeft + "px"
}

function ReplaceContent(layerName){

 if(ie){ document.all[layerName].innerHTML = ContentInfo; }

 if(ns){
  with(document.layers[layerName].document)
  {
   open();
   write(ContentInfo);
   close();
  }
 }

 if (ns6) { document.getElementById(layerName).innerHTML = ContentInfo; }
}

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

function overhere(e){
 if(initialize){

  if(ns6) {
   Event = e;
   Ex = Event.pageX;
   Ey = Event.pageY;
  }

  MoveToolTip("ToolTip", Ey, Ex, e)
  if (!ns6) eval(doc + "ToolTip" + sty + ".visibility = 'visible'")
  if (ns6) eval(doc + sty + ".visibility = 'visible'")
 } else {
  MoveToolTip("ToolTip", 0, 0)
  if (!ns6) eval(doc + "ToolTip" + sty + ".visibility = 'hidden'")
  if (ns6) eval(doc + sty + ".visibility = 'hidden'")
 }
}


function EnterContent(layerName, TTitle, TContent){

 ContentInfo = '<table border="0" width="140" height="60" cellspacing="0" cellpadding="0" style="background-image:url(rj/pic/woelk/tt_bg.gif);">'+
 '<tr><td width="100%">'+

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

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

 '<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)
}




