var contentVersion = 6;
var contentString = "6,0,0,0";
var pluginVersion = 0;
var mimeType = "application/x-shockwave-flash";
var productName = "Shockwave Flash";
var flashCanPlay = false;
var plugin = (navigator.mimeTypes && navigator.mimeTypes [mimeType]) ? navigator.mimeTypes [mimeType].enabledPlugin : 0;
var descriptionParts;
if (plugin) {
	descriptionParts = navigator.plugins [productName].description.split (" ");
	for (var i = 0; i < descriptionParts.length; i++) {
		if (!isNaN (parseFloat (descriptionParts [i]))) {
			pluginVersion = parseFloat (descriptionParts [i]);
			break;
		}
	}
	flashCanPlay = (pluginVersion >= contentVersion);
}
else if (navigator.userAgent && (navigator.userAgent.indexOf ("MSIE") >= 0) && (navigator.appVersion.indexOf("Win") != -1)) {
	// IE doesn't use the mimeTypes collection, so we have to try creating an object.
	document.write ('<scr' + 'ipt language="vbscript" type="text/vbscript"> \n'); // Hide this from IE4.5 Mac by splitting the tag
	document.write ('on error resume next \n');
	document.write ('flashCanPlay = (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash." & contentVersion))) \n');
	document.write ('</scr' + 'ipt\> \n');
}

function getFlashPlayerCode (controllerSwfSource, contentSwfSource, imageSource, forceAlternate, height, width, alignment, autoPlay, loop, showMenu, quality, backgroundColor) {
	var ieCode;
	var nsCode;
	var imageCode;
	var widthAttribute = 'width="' + width.toString () + '" ';
	var heightAttribute = 'height="' + height.toString () + '" ';
	var alignAttribute = 'align="' + ((alignment != null) ? alignment : '') + '" ';
	if ((flashCanPlay) && (controllerSwfSource) && (controllerSwfSource != '') && (!forceAlternate)) {
		ieCode = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + contentString + '" id="flashController" ';
		nsCode = '<embed type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" name="flashController" ';
		// Add positioning parameters
		ieCode += widthAttribute;
		nsCode += widthAttribute;
		ieCode += heightAttribute;
		nsCode += heightAttribute;
		ieCode += alignAttribute + '> \n'; // Last attribute inside the <object> tag
		nsCode += alignAttribute;
		// Add source specification
		ieCode += '<param name="movie" value="' + controllerSwfSource + '"> \n';
		nsCode += 'src="' + controllerSwfSource + '" ';
		if ((contentSwfSource) && (contentSwfSource != '')) {
			ieCode += '<param name="FlashVars" value="contentURL=' + escape (contentSwfSource) + '&autoPlay=' + autoPlay.toString () + '"> \n';
			nsCode += 'FlashVars="contentURL=' + escape (contentSwfSource) + '&autoPlay=' + autoPlay.toString () + '" ';
		}
		// Add optional parameters
		if (autoPlay != null) {
			ieCode += '<param name="play" value="' + autoPlay.toString () + '"> \n';
			nsCode += 'play="' + autoPlay.toString () + '" ';
		}
		if (loop != null) {
			ieCode += '<param name="loop" value="' + loop.toString () + '"> \n';
			nsCode += 'loop="' + loop.toString () + '" ';
		}
		if (showMenu != null) {
			ieCode += '<param name="menu" value="' + showMenu.toString () + '"> \n';
			nsCode += 'menu="' + showMenu.toString () + '" ';
		}
		if (quality != null) {
			ieCode += '<param name="quality" value="' + quality + '"> \n';
			nsCode += 'quality="' + quality + '" ';
		}
		if (backgroundColor != null) {
			ieCode += '<param name="bgcolor" value="' + backgroundColor + '"> \n';
			nsCode += 'bgcolor="' + backgroundColor + '" ';
		}
		// Close the tags
		nsCode += '></embed>';
		ieCode += nsCode + ' \n</object> \n'; // The <embed> tag is a child of the <object> tag 
		return ieCode;
	}
	else if ((imageSource) && (imageSource != '')) {
	}{
		imageCode = '<img src="' + imageSource + '" ' + alignAttribute + 'border="0" />';
		return imageCode;
	}
}
