// THIS DOC WRITE FLASH CONTENT

function write_flash(flash_file, width, height) {

  document.write('<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="' + width + '" height="' + height + '">');
  document.write('<param name="movie" value="' + flash_file + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="LOOP" value="true" />');
  document.write('<param name="wmode" value="transparent" />');
  document.write('<embed src="' + flash_file + '" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
  document.write('</object>');
}

function write_gallery(flash_file) {
  document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="433" height="450" id="CoffeeCup" align="middle">');
  document.write('<param name="movie" value="gallery/' + flash_file + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<param name="scale" value="noscale" />');
  document.write('<param name="salign" value="lt" />');
  document.write('<param name="bgcolor" value="#ffffff" />');
  document.write('<embed src="gallery/' + flash_file + '" quality="high" bgcolor="#ffffff" width="433" height="450"');
  document.write(' name="CoffeeCup" scale="noscale" salign="lt" align="middle" type="application/x-shockwave-flash"');
  document.write(' pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
}

function write_flash_vars(flash_file, width, height, vars) {
  document.write('<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="' + width + '" height="' + height + '">');
  document.write('<PARAM NAME="FlashVars" VALUE="'+vars+'">');
  document.write('<param name="movie" value="' + flash_file + '" />');
  document.write('<param name="quality" value="high" />');
  document.write('<embed src="' + flash_file + '" flashvars="'+vars+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '"></embed>');
  document.write('</object>');
}

function write_videoplayer(file_name, div_id, width, height, play) {
  var content;
  content = '<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="'+width+'" height="'+height+'">';
  content = content + '<param name="movie" value="/flash/video_player.swf?video=/videos/'+file_name+'&onstart='+play+'" />';
  content = content + '<param name="quality" value="high" />';
  content = content + '<embed src="/flash/video_player.swf?video=/videos/'+file_name+'&onstart='+play+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed>';
  content = content + '</object>';
  
  document.getElementById(div_id).innerHTML = content;
}

<!--
//
// Write-Flash Include - version 2.5
// By: Joey Fowler
//
// Using a javascript call, you can display a flash file inside a div of your choice!
// If the user doesn't have flash, or a more recent version, this include will attemp
// to automatically update their flash (if expressInstall is true), and if anything
// else, it will simply display what is currently in the div tag!
	
	// function to replace the specified div with the specified flash file using code from SWFObject()
	// required: flash_file, width, height
	// optional: div_id, flash_id, version, bg_color, quality, wmode, align, salign, scale, menu, swliveconnect, arVariables
	//
	// for a complete list of attributes: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_12701&sliceId=1
	function write_flash_new(flash_file, width, height, div_id, flash_id, version, bg_color, quality, wmode, align, salign, scale, menu, swliveconnect, arVariables) {
		if ((flash_file == null) || (div_id == null) || ((width == null) || (width == 0)) || ((height == null) || (height == 0))) {
			alert('Cannot write flash! Invalid parameters passed.');
			return false;
		} else {
			if ((flash_id == null) || (flash_id == ''))
				flash_id = 'flash_object';	
			if ((quality == null) || (quality == ''))
				quality = 'high';		
			if ((wmode == null) || (wmode == ''))
				wmode = 'transparent';	
			if (align == null)
				align = false;			
			if (menu == null)
				menu = false;			
			if (salign == null)
				salign = false;			
			if (swliveconnect == null)
				swliveconnect = false;	
			if (version == null)
				version = '9.0.0';			

			var flash_vars = false;
			if (arVariables != null) {
				flash_vars = '';
				for (i=0; i < arVariables.length; i++) {
					if (flash_vars != '')
						flash_vars = flash_vars + '&';
					flash_vars = flash_vars + arVariables[i][0] + '=' + arVariables[i][1];
				}
			}

			var flashvars	= false;
			var params		= {
				align: align,
				flashvars: flash_vars,
				menu: menu,
				quality: quality,
				salign: salign,
				scale: scale,
				swliveconnect: swliveconnect,
				wmode: wmode
			};
			var attributes	= {
				id: flash_id,
				name: flash_id
			};
			
			swfobject.embedSWF(flash_file, div_id, width, height, version, false, flashvars, params, attributes);
		}
	}
//-->

