<!--
//
// 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(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);
		}
	}
//-->
