// show-hide menus on right click
//***********  Search for //!! to find all lines that need to be edited when adding menus or right clickable objects

var message="";

function clickIE() 
{
  if (document.all) 
  {
    (message);
    return false;
  }
}
function clickNS(e) 
{
	var MenuToPopUp = "";

  //everything for Netscape
  if (document.layers||(document.getElementById&&!document.all)) 
  {
      var NSTargetName = "undefined";
	  NSTargetName = e.target.name+"String";
	  if (NSTargetName.charAt(0) == "M")
		MenuToPopUp = "HM_" + e.target.name
      else
        MenuToPopUp = "HM_Menu99";

      if (e.which==2||e.which==3) 
	{
	  popUp(MenuToPopUp,e);
	  return false;
	}
  
      if (e.which==1)
	{
	//!! copy line below for each menu that you use
	  popDown("HM_" + e.target.name);
        popDown("HM_Menu99");
	  return false;
	}
  } 


	//everything for IE
  if (document.all) 
	{
        var NSTargetName = "undefined";
        NSTargetName = event.srcElement.name + "String";
        if (NSTargetName.charAt(0) == "M")
          MenuToPopUp = "HM_" + event.srcElement.name
        else
          MenuToPopUp = "HM_Menu99";

		if (event.button == 2) 
		{
			popUp(MenuToPopUp,event);
			return true;
		}
		if (event.button == 1)
		{
			//!! copy line below for each menu that you use
			popDown("HM_" + event.srcElement.name);
			popDown("HM_Menu99");
			return true;
		}
	}

}
//disable rightclick for ie5-6, ns4-6.1; mac? ie4?
document.oncontextmenu = function(){return false}
if (document.layers) 
{
    window.captureEvents(Event.MOUSEDOWN);
	window.onmousedown = function(e){
	if (e.target==document||e.target!=document)
		return false;
  }
}
else
{
//  document.onmousedown = function(clickIE){return false}
  document.onmousedown = function(){return false}
}
//Catch mouse click on window objects
document.onmouseup=clickNS; //this is the document object
//!! copy line below for each object that right click should work with
//document.Menu1.onmouseup=clickNS;
//document.Menu2.onmouseup=clickNS;
//document.Menu3.onmouseup=clickNS;
//document.Menu4.onmouseup=clickNS;

//document.oncontextmenu = function(){return false}
//if(document.layers) {
//	window.captureEvents(Event.MOUSEDOWN);
//	window.onmousedown = function(e){
//		if(e.target==document)return false;
//	}
//}
//else {
//	document.onmousedown = function(){return false}
//}