// MC Media Player: JavaScript file v 0.6
// This script performs two functions:
// (1) It writes the HTML code which embeds the Flash media player file on your web page.
// (2) It allows you to customize your player by editing variables.
// More information: www.mcmediaplayer.com

/* Config Variables - Uncomment and edit values to customize your player.
Note: Config variables are normally defined on the web page for maximum versatility, which is why they are commented out in this file.
Any variables defined below will override web page variables and affect all instances of the player that refer to this file.
If you define the variables on the web page instead, you can configure each player differently. */

//playerFile = "http://www.mcmediaplayer.com/publicmc/mcmp_0.6.swf";
//streamingServerURL = "";
//fpFileURL = "";
//fpPreviewImageURL = "";
//fpAction = "";
//cpBackgroundColor = "000000";
//cpBackgroundOpacity = "60";
//cpButtonsOpacity = "100";
//cpCounterPosition = "330x4";
//cpFullscreenBtnPosition = "454x12";
//cpHidePanel = "button";
//cpHideDelay = "0";
//cpInfoBtnPosition = "470x12";
//cpPlayBtnPosition = "60x12";
//cpPosition = "0x246";
//cpRepeatBtnPosition = "438x12";
//cpScrubberPosition = "194x8";
//cpVolumeStart = "100";
//cpStopBtnPosition = "85x12";
//cpVolumeBtnPosition = "118x2";
//cpSize = "480x24";
//defaultBufferLength = "1";
//defaultEndAction = "previewImage";
//defaultStopAction = "previewImage";
//fpButtonOpacity = "60";
//fpButtonPosition = "240x118";
//fpButtonSize = "126x126";
//fpPreviewImageSize = "fit";
//msgBackgroundColor = "000000";
//msgBackgroundOpacity = "90";
//playerBackgroundColor = "525252";
//playerSize = "480x270";
//playerResizeElements = "1";
//videoBufferLength = "1";
//videoScreenPosition = "0x0";
//videoScreenSize = "480x270";


//////////////////////////////
// Nothing below here needs to be edited.
//////////////////////////////
if (typeof playerFile == 'undefined') { playerFile = 'mcmp.swf'; }
if (typeof fpFileURL != 'undefined') { mcflashvars = 'fpFileURL='+fpFileURL; }
if (typeof playerSize == 'undefined') { playerSize = '480x270'; }
var psep = playerSize.indexOf("x");
var playerWidth = playerSize.substring(0,psep);
var playerHeight = playerSize.substring(psep+1);
if (typeof streamingServerURL != 'undefined') { mcflashvars += '&streamingServerURL='+streamingServerURL; }// New in v0.6
if (typeof fpAction != 'undefined') { mcflashvars += '&fpAction='+fpAction; }// New in v0.6
if (typeof fpPreviewImageURL != 'undefined') { mcflashvars += '&fpPreviewImageURL='+fpPreviewImageURL; }
if (typeof cpBackgroundColor != 'undefined') { mcflashvars += '&cpBackgroundColor='+cpBackgroundColor; }
if (typeof cpBackgroundOpacity != 'undefined') { mcflashvars += '&cpBackgroundOpacity='+cpBackgroundOpacity; }
if (typeof cpButtonsOpacity != 'undefined') { mcflashvars += '&cpButtonsOpacity='+cpButtonsOpacity; }
if (typeof cpCounterPosition != 'undefined') { mcflashvars += '&cpCounterPosition='+cpCounterPosition; }
if (typeof cpFullscreenBtnPosition != 'undefined') { mcflashvars += '&cpFullscreenBtnPosition='+cpFullscreenBtnPosition; }
if (typeof cpHideDelay != 'undefined') { mcflashvars += '&cpHideDelay='+cpHideDelay; }
if (typeof cpHidePanel != 'undefined') { mcflashvars += '&cpHidePanel='+cpHidePanel; }
if (typeof cpInfoBtnPosition != 'undefined') { mcflashvars += '&cpInfoBtnPosition='+cpInfoBtnPosition; }
if (typeof cpPlayBtnPosition != 'undefined') { mcflashvars += '&cpPlayBtnPosition='+cpPlayBtnPosition; }
if (typeof cpPosition != 'undefined') { mcflashvars += '&cpPosition='+cpPosition; }
if (typeof cpRepeatBtnPosition != 'undefined') { mcflashvars += '&cpRepeatBtnPosition='+cpRepeatBtnPosition; }
if (typeof cpScrubberPosition != 'undefined') { mcflashvars += '&cpScrubberPosition='+cpScrubberPosition; }
if (typeof cpVolumeStart != 'undefined') { mcflashvars += '&cpVolumeStart='+cpVolumeStart; }
if (typeof cpStopBtnPosition != 'undefined') { mcflashvars += '&cpStopBtnPosition='+cpStopBtnPosition; }
if (typeof cpVolumeBtnPosition != 'undefined') { mcflashvars += '&cpVolumeBtnPosition='+cpVolumeBtnPosition; }
if (typeof cpSize != 'undefined') { mcflashvars += '&cpSize='+cpSize; }
if (typeof defaultBufferLength != 'undefined') { mcflashvars += '&defaultBufferLength='+defaultBufferLength; }// New in v0.6
if (typeof defaultEndAction != 'undefined') { mcflashvars += '&defaultEndAction='+defaultEndAction; }// New in v0.6
if (typeof defaultStopAction != 'undefined') { mcflashvars += '&defaultStopAction='+defaultStopAction; }// New in v0.6
if (typeof fpButtonOpacity != 'undefined') { mcflashvars += '&fpButtonOpacity='+fpButtonOpacity; }
if (typeof fpButtonPosition != 'undefined') { mcflashvars += '&fpButtonPosition='+fpButtonPosition; }
if (typeof fpButtonSize != 'undefined') { mcflashvars += '&fpButtonSize='+fpButtonSize; }
if (typeof fpPreviewImageSize != 'undefined') { mcflashvars += '&fpPreviewImageSize='+fpPreviewImageSize; }
if (typeof msgBackgroundColor != 'undefined') { mcflashvars += '&msgBackgroundColor='+msgBackgroundColor; }
if (typeof msgBackgroundOpacity != 'undefined') { mcflashvars += '&msgBackgroundOpacity='+msgBackgroundOpacity; }
if (typeof playerBackgroundColor != 'undefined') { mcflashvars += '&playerBackgroundColor='+playerBackgroundColor; }
if (typeof playerResizeElements != 'undefined') { mcflashvars += '&playerResizeElements='+playerResizeElements; }
if (typeof playerSize != 'undefined') { mcflashvars += '&playerSize='+playerSize; }
if (typeof videoScreenSize != 'undefined') { mcflashvars += '&videoScreenSize='+videoScreenSize; }
if (typeof videoScreenPosition != 'undefined') { mcflashvars += '&videoScreenPosition='+videoScreenPosition; }

function mccode() {
	var str='';
	str+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http:\/\/download.macromedia.com\/pub\/shockwave\/cabs\/flash\/swflash.cab#version=7,0,19,0" width="'+playerWidth+'" height="'+playerHeight+'">\n';
	str+='<param name="movie" value="'+playerFile+'">';
	str+='<param name="allowScriptAccess" value="always">';
	str+='<param name="quality" value="high">';
	str+='<param name="allowFullScreen" value="true">';
	str+='<param name="FlashVars" value="'+mcflashvars+'">\n';
	str+='<embed src="'+playerFile+'" width="'+playerWidth+'" height="'+playerHeight+'" quality="high" allowFullScreen="true" allowscriptaccess="always" pluginspage="http:\/\/www.macromedia.com\/go\/getflashplayer" type="application\/x-shockwave-flash" FlashVars="'+mcflashvars+'"><\/embed>\n';
	str+='<\/object>';
	document.write(str);
}
mccode();
