/**
 * Description:    Generate random integer in the specified interval.
 *
 * ARGUMENT        TYPE      DESCRIPTION
 *
 * rMin            Number    Start of the interval.
 *
 *                           If rMax is not defined the function treats the [0, rMin] interval.
 * 
 * rMax            Number    End of the interval [OPTIONAL]
 *
 * Returns:        Number
*/
function getRandom(rMin, rMax)
{
	// Checking Defaults...
	var rMn = ((rMax != null) && (rMin <= rMax))? Math.floor(rMin) : 0;
	var rMx = ((rMax != null) && (rMin <= rMax)) ? Math.floor(rMax) : Math.floor(rMin);
	// Go...
	var diff = rMx - rMn;
	var tRand = Math.floor((diff + 1) * Math.random());
	var rNum = tRand + rMn;
	return(rNum);
}

/**
 * Description:    Check user's Flash player version, and redirect it to the alternative content if required
 *
 * ARGUMENT        TYPE      DESCRIPTION
 *
 * rVersion        Number    Required major Flash version for the page
 *
 * aContent        String    Link to the alternative content
 *
 * Returns:        None
*/
function checkFlash(rVersion, aPage)
{
	// Get the JavaScript Flash version object
	var playerVersion = swfobject.getFlashPlayerVersion();
	// Redirect to the alternative content if the minumum required version is not available
	if (Number(playerVersion.major) < rVersion) {document.location.href = aPage;}
}

