var gPAVideoTitle = null;
var gPAVideoFile = null;
var gPAContent = null;
var gPAPlayer = null;
var gPATryCount = 0;

/* try to show the flash, if we fail, try again in two seconds - this is a firefox workaround */
function showMyFlashWorker() {
	try {
		gPATryCount++;
		gPAPlayer.showFlash(gPAVideoTitle, gPAVideoFile);

	}
	catch (ex) {
		if (gPATryCount < 2)
		window.setTimeout("showMyFlashWorker()", 2000);
	}
}

/* set global variables and call the real flash function */
function showMyFlash( objContent, objPlayer, sTitle, sFile ) {
	gPAPlayer = objPlayer;
	gPAVideoTitle = sTitle;
	gPAVideoFile = sFile;
	gPAContent = objContent;
	gPAContent.style.zIndex='200';
	gPAContent.style.left="50%";
	showMyFlashWorker();
}

/* swap out the trigger image and blank out the href */
function swapInFlashTriggerWorker( sPath, objTrigger ) {
	var img = objTrigger.getElementsByTagName("img");
		img[0].src="/images/"+sPath+"-vid-thumb.jpg";
	var a = objTrigger.getElementsByTagName("a");
		a[0].href="#";
}

/* hide the player window and reset trycount */
function onPlayerClose() {
	gPAContent.style.zIndex='-1';
	gPAContent.style.left="-50%";
	gPATryCount = 0;
}


