function PSFX_GenerateObjString(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		str += '>';
  		for (var i in params)
  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '</object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
  		str += '> </embed>';
    }

	return str;
}

function PSFX_GetContentString()
{
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  return PSFX_GenerateObjString(ret.objAttrs, ret.params, ret.embedAttrs);
}

function PSFX_GetPlayerCode(width, height, videoUrl, shareUrl)
{

	var hasProductInstall = DetectFlashVer(6, 0, 65);

	var hasPlayerRequestedVersion = DetectFlashVer(10, 0, 0);

	if ( hasProductInstall && !hasPlayerRequestedVersion ) {
		// 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;

		var output;
		if (isIE) 
			output = PSFX_GetContentString (
				"src", "/res/swf/playerProductInstall?MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle,
				"width", width,
				"height", height,
				"align", "middle",
				"id", "PolymediaShowFX_MediasetPremium",
				"quality", "high",
				"bgcolor", "#000",
				"name", "PolymediaShowFX_MediasetPremium",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				"pluginspage", "http://www.adobe.com/go/getflashplayer"
			);
		else
			output = PSFX_GetContentString (
				"src", "/res/swf/playerProductInstall",
				"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
				"width", width,
				"height", height,
				"align", "middle",
				"id", "PolymediaShowFX_MediasetPremium",
				"quality", "high",
				"bgcolor", "#000",
				"name", "PolymediaShowFX_MediasetPremium",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				"pluginspage", "http://www.adobe.com/go/getflashplayer"
			);
		
		return output;
	} else if (hasPlayerRequestedVersion) {
		var output;
		if (isIE) 
			output = PSFX_GetContentString (
				"src", "/res/swf/PolymediaShowFX_MediasetPremium?configUrl=/res/swf/PolymediaShowFX_MediasetPremiumConfig.xml&videoUrl=" + escape(videoUrl) + "&shareVideoURL=" + escape(),
				"width", width,
				"height", height,
				"align", "middle",
				"id", "PolymediaShowFX_MediasetPremium",
				"quality", "high",
				"bgcolor", "#000",
				"name", "PolymediaShowFX_MediasetPremium",
				"allowFullscreen","true",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				"pluginspage", "http://www.adobe.com/go/getflashplayer"
			);
		else
			output = PSFX_GetContentString (
				"src", "/res/swf/PolymediaShowFX_MediasetPremium",
				"FlashVars", "configUrl=/res/swf/PolymediaShowFX_MediasetPremiumConfig.xml&videoUrl=" + escape(videoUrl) + "&shareVideoURL=" + escape(shareUrl),
				"width", width,
				"height", height,
				"align", "middle",
				"id", "PolymediaShowFX_MediasetPremium",
				"quality", "high",
				"bgcolor", "#000",
				"name", "PolymediaShowFX_MediasetPremium",
				"allowFullscreen","true",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
		return output;
	} else {  
		return 'This content requires the Adobe Flash Player. <a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
	}
}


function PSFX2_GenerateObjString(objAttrs, params, embedAttrs) 
{ 
    var str = '';
    if (isIE && isWin && !isOpera)
    {
  		str += '<object ';
  		for (var i in objAttrs)
  			str += i + '="' + objAttrs[i] + '" ';
  		str += '>';
  		for (var i in params)
  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  		str += '</object>';
    } else {
  		str += '<embed ';
  		for (var i in embedAttrs)
  			str += i + '="' + embedAttrs[i] + '" ';
  		str += '> </embed>';
    }

	return str;
}

function PSFX2_GetContentString()
{
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  return PSFX2_GenerateObjString(ret.objAttrs, ret.params, ret.embedAttrs);
}

function PSFX2_GetPlayerCode(width, height, videoUrl, shareUrl)
{

	var hasProductInstall = DetectFlashVer(6, 0, 65);

	var hasPlayerRequestedVersion = DetectFlashVer(10, 0, 0);

	if ( hasProductInstall && !hasPlayerRequestedVersion ) {
		// 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;

		var output;
		if (isIE) 
			output = PSFX2_GetContentString (
				"src", "/res/swf/playerProductInstall?MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle,
				"width", width,
				"height", height,
				"align", "middle",
				"id", "PolymediaShowFX2_MediasetPremium",
				"quality", "high",
				"bgcolor", "#000",
				"name", "PolymediaShowFX2_MediasetPremium",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				"pluginspage", "http://www.adobe.com/go/getflashplayer"
			);
		else
			output = PSFX2_GetContentString (
				"src", "/res/swf/playerProductInstall",
				"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
				"width", width,
				"height", height,
				"align", "middle",
				"id", "PolymediaShowFX2_MediasetPremium",
				"quality", "high",
				"bgcolor", "#000",
				"name", "PolymediaShowFX2_MediasetPremium",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				"pluginspage", "http://www.adobe.com/go/getflashplayer"
			);
		
		return output;
	} else if (hasPlayerRequestedVersion) {
		var output;
		if (isIE) 
			output = PSFX2_GetContentString (
				"src", "/res/swf/PolymediaShowFX2_MediasetPremium?configUrl=/res/swf/PolymediaShowFX2_MediasetPremiumConfig.xml&videoUrl=" + escape(videoUrl) + "&shareVideoURL=" + escape(),
				"width", width,
				"height", height,
				"align", "middle",
				"id", "PolymediaShowFX2_MediasetPremium",
				"quality", "high",
				"bgcolor", "#000",
				"name", "PolymediaShowFX2_MediasetPremium",
				"allowFullscreen","true",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				"pluginspage", "http://www.adobe.com/go/getflashplayer"
			);
		else
			output = PSFX2_GetContentString (
				"src", "/res/swf/PolymediaShowFX2_MediasetPremium",
				"FlashVars", "configUrl=/res/swf/PolymediaShowFX2_MediasetPremiumConfig.xml&videoUrl=" + escape(videoUrl) + "&shareVideoURL=" + escape(shareUrl),
				"width", width,
				"height", height,
				"align", "middle",
				"id", "PolymediaShowFX2_MediasetPremium",
				"quality", "high",
				"bgcolor", "#000",
				"name", "PolymediaShowFX2_MediasetPremium",
				"allowFullscreen","true",
				"allowScriptAccess","sameDomain",
				"type", "application/x-shockwave-flash",
				"pluginspage", "http://www.adobe.com/go/getflashplayer"
		);
		return output;
	} else {  
		return 'This content requires the Adobe Flash Player. <a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
	}
}
