// Detect if the browser is IE or not.
// If it is not IE, we assume that the browser is NS.
var isIE = document.all?true:false
var mouseX = 0
var mouseY = 0

// If NS -- that is, !IE -- then set up for mouse capture
if (!isIE) document.captureEvents(Event.MOUSEMOVE)
document.onmousemove = getMouseXY;
function getMouseXY(e) {
  if (isIE) { // grab the x-y pos.s if browser is IE
    mouseX = event.clientX + document.body.scrollLeft
    mouseY = event.clientY + document.body.scrollTop
  } else {  // grab the x-y pos.s if browser is NS
    mouseX = e.pageX
    mouseY = e.pageY
  }
  // catch possible negative values in NS4
  if (mouseX < 0){mouseX = 0}
  if (mouseY < 0){mouseY = 0}
  return true
}
var visible=0;
var lastT='';
function popup(t) {
 var f1style=document.getElementById('floater');
 var shadow=document.getElementById('floater-shadow');
 var shadow2=document.getElementById('floater-shadow2');
 t='<a href="javascript:visible=0;hideit()"><img src="/vm/close.png" border=0 align=right valign="absmiddle"></a>'+t;
 // don't do it if it's already up.
 if(lastT == t && f1style.display=='') return;
 shadow2.innerHTML=shadow.innerHTML=f1style.innerHTML=t;
 f1style=f1style.style;
 shadow=shadow.style;
 shadow2=shadow2.style;
 //shadow.left=10+(f1style.left=mouseX > 150? mouseX-150:0);
 shadow2.left=2+(shadow.left=6+(f1style.left=mouseX > document.body.clientWidth * .6? mouseX-325:mouseX+5));
 shadow2.top=2+(shadow.top=6+(f1style.top=mouseY+5));
 f1style.filter='alpha(opacity=10)';
 f1style.opacity=0.1;
 shadow2.filter=shadow.filter='alpha(opacity=5)';
 shadow2.opacity=shadow.opacity=0.05;
 //shadow.height=f1style.height=f2.style.height;
 shadow2.display=shadow.display=f1style.display='';
 visible |= 1;
 setTimeout('fadein()',20);
 lastT=t;
}
function fadein() {
 var f1style=document.getElementById('floater').style;
 var shadow=document.getElementById('floater-shadow').style;
 var shadow2=document.getElementById('floater-shadow2').style;
 var t= parseFloat(f1style.opacity);
 t+=.1;
 f1style.opacity=t;
 shadow.opacity=t/4;
 shadow2.opacity=t/4;
 f1style.filter='alpha(opacity='+Math.floor(t*100+.5)+')';
 shadow.filter='alpha(opacity='+Math.floor(t*25+.5)+')';
 shadow2.filter='alpha(opacity='+Math.floor(t*25+.5)+')';
 if(t < 1)
  setTimeout('fadein()',20);
}
function popout(n) {
 visible &= ~ n;
 setTimeout("hideit()",3000); // make it go away after 3 seconds
}
function hideit() {
 if(visible==0) {
  document.getElementById('floater').style.display='none';
  document.getElementById('floater-shadow').style.display='none';
  document.getElementById('floater-shadow2').style.display='none';
 } else
  setTimeout("hideit()",2000);
}
function SetPopup(element,text) {
 var e=document.getElementById(element);
 if(e) {
  eval("e.onmouseover=function() {popup('"+text.replace(/'/g,"\\'")+"')}");
  e.onmouseout=function() {popout(1)};
 }
}
document.write('<div id="floater" onMouseover="visible|=2" onMouseout="popout(2)"\
 style="width: 300px; background-color: #CEF; position: absolute; padding: 10px; z-index: 3; display: none; border: #9CF 1px solid;"></div>\
<div id="floater-shadow" style="width: 300px; background-color: #222; color: #222; position: absolute; padding: 10px; z-index: 2; display: none;"></div>\
<div id="floater-shadow2" style="width: 300px; background-color: #222; color: #222; position: absolute; padding: 10px; z-index: 2; display: none;"></div>\
');