

// Modification History:
//	??	??		- created
// 	02/03/05 Duncan Grant 	- extra options to facilitate user palettes

// <script>

	var options = '';
	var setoptions = '';	

	options += (getSearch('gammas') != null) ? '&gammas=' + escape(getSearch('gammas')) : '';
	options += (getSearch('colortemp') != null) ? '&colortemp=' + getSearch('colortemp') : '';
	options += (getSearch('userpalette') != null) ? '&userpalette=' + escape(getSearch('userpalette')) : '';

	
	// These should go at the beginning of the options 
   	// string so that any truncation is done to the userpalette
	if (options != '') setoptions = '?browser=true';	
	setoptions += ((setoptions == '') ? '?' : '&');
	setoptions += 'configfile=' + escape('config.xml');
	
	options = setoptions + options;

	// truncate query sting to max length allowed by typical browsers (i.e. IE ~2048)
	options = options.substring(0,2040);

	if (actualVersion >= 6) {	
		// if we've detected an acceptable version
		var oeTags =  					  
		'<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH="860" HEIGHT="580" id="ShockwaveFlash1">' +
		'<PARAM NAME=movie VALUE="CP4Explorer.swf' + options + '">' +
		'<PARAM NAME=quality VALUE="high">' +
		'<PARAM NAME=bgcolor VALUE="#ffffff">' +
		'<EMBED src="CP4Explorer.swf' + options + '" quality="high" bgcolor="#ffffff" WIDTH="860" HEIGHT="580" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>' +
		'</OBJECT>';
		// embed the flash movie
		document.write(oeTags); 	
	} else {	
		// flash is too old or we can't detect the plugin
		window.location.replace('noflash.html');
	}
	
// </script>