var sDivFPWrongVersion = 'divFPWrongVersion';
var sDivFPBlocked = 'divFPBlocked';
var sDivFPWrongVersionContent = '<p class="error-fp-message">Your Adobe(tm) Flash Player version is incompatible with the required one.<br />For full functionality please install the latest version from <a href="http://www.adobe.com/go/EN_US-H-GET-FLASH" target="_blank">here</a></p>';
var sDivFPBlockedContent = '<p class="error-fp-message">You have a Flash Player blocker plugin/application installed on your system. Please disable it for enabling full functionality of the website.</p>';

var reqFPMajorVer = 9;
var reqFPMinorVer = 0;
var reqRevision = 0;

var iEnableCheckFPWrongVersion = 1;
var iEnableCheckFPBlocker = 0;

var iFPBlockerTimeoutClear = 0;
var iFPBlockerCheckTimeout = 10000; //in ms
var tFPBlockerTimeout;


function checkFPWrongVersion()	{

	if ( !iEnableCheckFPWrongVersion ) return;

	if ( !DetectFlashVer(reqFPMajorVer, reqFPMinorVer, reqRevision) )	{
		displayObject(sDivFPWrongVersion, 1, sDivFPWrongVersionContent);
	}

}

function checkFPBlocker()	{

	if ( !iEnableCheckFPBlocker ) return;

	if ( !iFPBlockerTimeoutClear )	{
		tFPBlockerTimeout = setTimeout("displayObject('"+sDivFPBlocked+"', 1, '"+sDivFPBlockedContent+"')", iFPBlockerCheckTimeout);
	}

}

// this function is accesed from Flash to hide (if showed) the message or disable FlashBlocker check
function hideFPBlocker()	{

	if ( !iFPBlockerTimeoutClear )	{
		if ( tFPBlockerTimeout )	{
			clearTimeout(tFPBlockerTimeout);
		}

		iEnableCheckFPBlocker = 0;
		iFPBlockerTimeoutClear = 1;
	}

	displayObject(sDivFPBlocked, 0, '');

}

// this function is the old function JS that Flash acceses, please do not use in the future implementations
function hideAlternativeContent()	{

	 hideFPBlocker()

}

function displayObject(sObjID, iShow, sTextInner)	{

	if ( (obj = document.getElementById(sObjID)) )	{
		obj.style.display = ( iShow ? 'block' : 'none' );
		obj.innerHTML = ( sTextInner=='' ? obj.innerHTML : sTextInner );
	}

}

window.onload = function()	{
	checkFPWrongVersion();
	checkFPBlocker();
}