
var activeMenu = null;

var ie5=document.all&&document.getElementById   
var ns6=document.getElementById&&!document.all   
  
  
function wsc_showmenu(sender)
{  
  var hidSelectedItemId;

  var menuobj=document.getElementById(sender.curDivDate);    
  menuobj.style.position = "absolute";


    window.event.cancelBubble = true;   
  if (activeMenu != null)
   activeMenu.style.display='none';  
  menuobj.style.display='block';  
  activeMenu = menuobj;

  
  
  var bottomedge=ie5? document.body.clientHeight-event.clientY   
    :window.innerHeight-e.clientY   
  //if the horizontal distance isn't enough to accomodate the width of the context menu   
  if (sender.parentElement.cellIndex>3){   
    menuobj.style.left=event.clientX-menuobj.offsetWidth;
  }   
  else{   
    //position the horizontal position of the menu where the mouse was clicked   
    menuobj.style.left=ie5? document.body.scrollLeft+event.clientX   
    :window.pageXOffset+e.clientX   
  }  

  
    menuobj.style.top=ie5? document.body.scrollTop+event.clientY + 3   
    :window.pageYOffset+e.clientY + 10  
  





  return false ; 
}

function wsc_hidediv()
{
   if (activeMenu != null)
     activeMenu.style.display='none';  
}

function wsc_hidemenu(sender)
{
      if (window.event.toElement.indiv != null)
       return;
      sender.style.display='none'; 
} 