// Used to detect flash version
// Requires AC_OETags.js be included
// TODO modify this to check for any version of flash
function FlashDetection(){
}
// Major version of Flash required
FlashDetection.requiredMajorVersion = 9;
// Minor version of Flash required
FlashDetection.requiredMinorVersion = 0;
// Minor version of Flash required
FlashDetection.requiredRevision = 28;
// Does user have proper version
FlashDetection.hasReqestedVersion = null;
FlashDetection.hasRequiredVer = function() {
	if(FlashDetection.hasReqestedVersion == null)
		FlashDetection.hasReqestedVersion = DetectFlashVer(FlashDetection.requiredMajorVersion, FlashDetection.requiredMinorVersion,FlashDetection.requiredRevision);
	return FlashDetection.hasReqestedVersion;
}

FlashDetection.getFlashStr = function(w, h, baseUrl) {
	baseUrl = baseUrl || "images/";
	var versionStr = FlashDetection.requiredMajorVersion + '.'
		+ FlashDetection.requiredMinorVersion + '.'
		+ FlashDetection.requiredRevision 
		+ '.0';
	var rtnStr = '<a class="lnkWhite" href="' + ResourceBundle.getString('getFlashLink','media') + '"><div class="txtSmall" style="width:' + w + 'px;height:' + h + 'px;cursor:pointer;cursor:hand;background:black;color:white;text-align:left">'
		+ ResourceBundle.getString('getFlashTxt','media').replace('{0}', versionStr)
		+ '<img class="ImgButton" src="' + baseUrl + 'get_flash_player.gif" />'
		+ '</div></a>';
	return rtnStr;
}

// Alternative get flash string, used in the syndication app
FlashDetection.getFlashStr2 = function(w, h, baseUrl) {
	baseUrl = baseUrl || "images/";
	var versionStr = FlashDetection.requiredMajorVersion + '.'
		+ FlashDetection.requiredMinorVersion + '.'
		+ FlashDetection.requiredRevision 
		+ '.0';
	var rtnStr = '<div style="position:relative;width:0px;height:0px;">'
		+ '<div style="position:absolute;top:0px;left:0px;width:' + w + 'px;height:' + h + 'px;">'
		+ '<a class="lnkBlack" href="' + ResourceBundle.getString('getFlashLink','media') + '"><div class="txtSmall" style="width:' + w + 'px;height:' + h + 'px;cursor:pointer;cursor:hand;background:white;color:black;text-align:left">'
		+ ResourceBundle.getString('getFlashTxt2','media').replace('{0}', versionStr)
		+ '<img class="ImgButton" src="' + baseUrl + 'get_flash_player.gif" />'
		+ '</div></a></div></div>';
	return rtnStr;
}

// Used for thumbnails
FlashDetection.getFlashStrSmall = function(w, h, baseUrl) {
	baseUrl = baseUrl || "images/";
	var rtnStr = '<center><a class="lnkWhite" href="' + ResourceBundle.getString('getFlashLink','media') + '"><div class="txtSmall" style="width:' + w + 'px;height:' + h + 'px;cursor:pointer;cursor:hand;background:black;color:white;text-align:center">'
		+ ResourceBundle.getString('getFlashTxtSmall','media')
		+ '<img class="ImgButton" src="' + baseUrl + 'get_flash_player.gif" />'
		+ '</div></a></center>';
	return rtnStr;
}