var cX = 0; var cY = 0;
function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;}

function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;}
if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; }
else { document.onmousemove = UpdateCursorPosition; }

function AssignPosition(d) {
  scrollVar = parseFloat(document.documentElement.scrollTop);
  
  if(navigator.appName == 'Microsoft Internet Explorer'){
    if ((cY - 150 + scrollVar + d.clientHeight) > document.body.clientHeight){
    //alert('mike');
      d.style.top = (document.body.clientHeight - d.clientHeight + 100) + "px";
    }else{
      d.style.top = (cY - 150 + scrollVar) + "px";
    }
  }else{
    if ((cY-150 + d.clientHeight) > window.innerHeight){
      d.style.top = (window.innerHeight - d.clientHeight + 150) + "px";
    }else{
      d.style.top = (cY-150) + "px";
    }
  }                                         
  d.style.left = (cX+5) + "px";        
}

function HideContent(d) {
  if(d.length < 1) { return; }
  document.getElementById(d).style.display = "none";
}

function ShowContent(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
dd.style.display = "block";
AssignPosition(dd);
}

function ReverseContentDisplay(d) {
if(d.length < 1) { return; }
var dd = document.getElementById(d);
AssignPosition(dd);
if(dd.style.display == "none") { dd.style.display = "block"; }
else { dd.style.display = "none"; }
}


