// MC Media Player: JavaScript Implementation, v0.01
// 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.mediacollege.com/flash/media-player

// Variables - Enter values to customize your player:
// MC Video Gallery (http://www.mediacollege.com/video-gallery/mcmp720x360.js)
mcplayerfile = "../media-gallery/mcmp720x360_player.swf";
playlist = "mcmp720x360_playlist.xml";
mediadir = "";
dfile = "";
dfilep = "";
infotype = "swf";
infohead = "";
infotxt = "";
definfo = "../media-gallery/info/mcmp720x360_definfo.swf";
bgcolor = "";
buf = "";
zoom = "";
dlinks = "";
aseq = "";
aseqd = "";
imgdur = "";
swfdur = "";
directlinkURL = "http://www.mediacollege.com/video-gallery/index.html";
directlinkDIR = "";

//////////////////////////////
// Nothing below here needs to be edited.
//////////////////////////////
// If there's a query string value for dfile, use it.
qs = document.location.search.slice(7);
if (qs.length>=1) {
	dfile = qs;
	}
// Flashvars:
//mcflashvars = 'dfile='+dfile+'&infotype='+infotype+'&directlinkURL='+directlinkURL+'&directlinkDIR='+directlinkDIR;
mcflashvars = 'playlist='+playlist;
//if (playlist) { mcflashvars += 'playlist='+playlist; }
if (mediadir) { mcflashvars += '&mediadir='+mediadir; }
if (dfile) { mcflashvars += '&dfile='+dfile; }
if (dfilep) { mcflashvars += '&dfilep='+dfilep; }
if (infotype) { mcflashvars += '&infotype='+infotype; }
if (infohead) { mcflashvars += '&infohead='+infohead; }
if (infotxt) { mcflashvars += '&infotxt='+infotxt; }
if (definfo) { mcflashvars += '&definfo='+definfo; }
if (bgcolor) { mcflashvars += '&bgcolor='+bgcolor; }
if (buf) { mcflashvars += '&buf='+buf; }
if (zoom) { mcflashvars += '&zoom='+zoom; }
if (dlinks) { mcflashvars += '&dlinks='+dlinks; }
if (aseq) { mcflashvars += '&aseq='+aseq; }
if (aseqd) { mcflashvars += '&aseqd='+aseqd; }
if (imgdur) { mcflashvars += '&imgdur='+imgdur; }
if (swfdur) { mcflashvars += '&swfdur='+swfdur; }
if (directlinkURL) { mcflashvars += '&directlinkURL='+directlinkURL; }
if (directlinkDIR) { mcflashvars += '&directlinkDIR='+directlinkDIR; }
// Write the code to the page:
mccode();
function mccode() {
	var str='';
	str+='<div align="center">';
	str+='<div style="width: 728px; background-color:#202028; margin: 0px 0px 0px 0px; padding: 4px 0px 3px 0px;">\n';
	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="720" height="360">\n';
	str+='<param name="movie" value="'+mcplayerfile+'">';
	str+='<param name="quality" value="high">';
	str+='<param name="FlashVars" value="'+mcflashvars+'">\n';
	str+='<embed src="'+mcplayerfile+'" width="720" height="360" quality="high" pluginspage="http:\/\/www.macromedia.com\/go\/getflashplayer" type="application\/x-shockwave-flash" FlashVars="'+mcflashvars+'"><\/embed>\n';
	str+='<\/object>';
	str+='<\/div>';
	document.write(str);
}

// Uncomment for testing:
//document.write(mcflashvars);
