
// ======================================================
// This javascript and html code works in coordination with
// RightClickAnimation.swf - a program that can be 
// added to Captivate to handle a right click.  Without
// this code and some other changes to the html to run
// the captivate flash file, the flash context menu will not be blocked.
// 
// IMPORTANT: You will need to change all occurrences of MyProgram 
// to the name of your flash program for this to work.  

// For example, if your 
// program is called MyFlash.swf then you will need to change
// MyProgram to MyFlash.  This will load  your Captivate Flash 
// file while and handle the right click appropriately.

// You will probably also need to reset the size of  your file.  
// Do a search for height and width and change them to whatever
// the html generated by Captivate creates.
// =======================================================
function right_mouse_click() {
	oOwnCapture.setCapture(true);
	return false;
}
function handleError() {
	return false;
}
window.onerror = handleError;


function handleclick() {
  if (event.button==2) 
    {
      showAboutBox();
    }
}

function showAboutBox(e) {
  if (ns) {
       window.document.MyProgram.SetVariable("_wlh_Netscape_RightClick", "RightClick");
  } 
}
function SetStatus() {
oOwnCapture.releaseCapture();
window.status='Right Click';
clearInterval(resetstatus);
}
var ns = (navigator.appName == "Netscape");

function rightClick(e)
{
	if (ns && ((e.which == 2) || (e.which == 3)))
	{
		showAboutBox(e);
	} else {
		if (event.button == 2 || event.button == 3) {
			oOwnCapture.setCapture(true);
			resetstatus=setInterval("SetStatus()", 300);
			return false;
		}
		else { 
		   oOwnCapture.releaseCapture();
		   return true;
		   }
	}
}

function init() {

	if (ns)
	{
		document.captureEvents(Event.MOUSEDOWN);
		el = document.getElementById("Captivate1");
		el.addEventListener("mousedown", stopEvent, true);
	} else {
		 document.onmousedown=rightClick;
		 document.body.oncontextmenu = right_mouse_click;
	}
}

function stopEvent(e) {
	if (e.which == 3) {
		e.stopPropagation();
		showAboutBox(e);
	}
}

 

