/** FLEX **/
var src = "/player/flex/PolymediaShow";
var id = "player";
var width = "693";
var height = "324";
var flashvars = "configUrl=local://page/GetFXConfig&playlist=local://page/GetPlaylist&sequenceUri=local://page/GetAdvSequence";

//xml di configurazione flex
var fxConfig  = null;

function GetFXConfig() {
	//alert("getConfig: " + fxConfig);
	return fxConfig;
}

function CreateFXPlayer() {
	$.ajax({
		type: "GET",
		url: "/player/flex/playerFlexConfig.xml",
		dataType: "text",
		success: function(data) {
			fxConfig = data;
			CreateFXPlayerObject();
		}
	});
}

function CreateFXPlayerObject() {
	

	document.getElementById(id).innerHTML = AC_FL_RunContent_fds(
			"src", src,
			"flashVars", flashvars,
			"allowFullScreen", "true",
			"width", width,
			"height", height,
			"align", "middle",
			"id", "PolymediaShow",
			"quality", "high",
			"bgcolor", "#869ca7",
			"name", "PolymediaShow",
			"allowScriptAccess","sameDomain",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
	);
		
}

function GetFlashPlayer() {
	var hasProductInstall = DetectFlashVer(6, 0, 65);

	if ( hasProductInstall ) {
		// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
		// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
		// DO NOT MODIFY THE FOLLOWING FOUR LINES
		// Location visited after installation is complete if installation is required
		var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
		var MMredirectURL = encodeURI(window.location);
		document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		var MMdoctitle = document.title;

		document.getElementById(id).innerHTML = AC_FL_RunContent(
			"src", "/player/flex/playerProductInstall",
			"flashVars", "MMredirectURL="+MMredirectURL+"&MMplayerType="+MMPlayerType+"&MMdoctitle="+MMdoctitle+"",
			"width", width,
			"height", height,
			"align", "middle",
			"id", "PolymediaShow",
			"quality", "high",
			"bgcolor", "#869ca7",
			"name", "PolymediaShow",
			"allowScriptAccess","sameDomain",
			"type", "application/x-shockwave-flash",
			"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
	} else {
		var alternateContent = 'This content requires the Adobe Flash Player. '
		+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
		document.getElementById(id).innerHTML.write(alternateContent);  // insert non-flash content
	}
}
