var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) {  // if we've detected an acceptable version
	//Global function file


	function createFlashControl(strContainerId, strClassId, strObjId, strWidth, strHeight, strUrl, strAutoStart,
								strAllowScriptAccess, strQuality, strBgColor, strWmode, strQryStrParams, strAlign, strCodeBase,
								strFlashVars)
	{

	//4/7/2006 IMA
	//creates a flash movie on page load.
	//this will ensure that the object is active when the page is rendered
	//otherwise the user has to click once on the object before it responds to normal events.

		//alert('inside embed function')

		var d = document.getElementById(strContainerId);
		var strHtml='';

		//alert('strFlashVars: ' + strFlashVars)

		//set some defaults
		if(strContainerId == '')
			 strContainerId = 'div_Container';

		if(strWidth == '')
			 strWidth = '200';

		if(strHeight == '')
			 strHeight = '290';

		if(strAutoStart == '')
			 strAutoStart = '-1';

		if(strAllowScriptAccess == '')
			 strAllowScriptAccess = 'sameDomain';

		if(strAlign == '')
			 strAlign = 'middle';

	 if(strCodeBase=='')
			 strCodeBase = '"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"'	

		// set the variable
		strHtml = '<object classid="' + strClassId + '" codebase="' + strCodeBase + '" id="' + strObjId + '" width="' + strWidth + '" height="' + strHeight +'">\n';
		strHtml += '	<param name="movie" value="' + strUrl + '">\n';
		strHtml += '	<param name="quality" value="' + strQuality + '">\n';
		strHtml += '	<param name="allowScriptAccess" value="' + strAllowScriptAccess + '">\n';
		strHtml += '	<param name="bgcolor" value="' + strBgColor + '">\n';
		strHtml += '	<param name="wmode" value="' + strWmode + '">\n';
		strHtml += '	<param name="URL" value="' + strUrl + '">\n';
		strHtml += '	<param name="autoStart" value="' + strAutoStart + '">\n';
		strHtml += '	<param name="flashvars" value="' + strFlashVars + '">\n';
		strHtml += '	<embed src = "' + strUrl + strQryStrParams + '" " quality="' + strQuality + '" bgcolor="' + strBgColor + ' " wmode="' + strWmode + '" width="' + strWidth + '" height="' + strHeight +  '" name="' + strObjId + '" align="' + strAlign + '" allowScriptAccess="' + strAllowScriptAccess + '" flashvars="' + strFlashVars + '" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n';
		strHtml += '</object>\n'

		//alert(d.id);

		//now set the inner html
		d.innerHTML = strHtml;

	//	alert('d.innerHtml: ' + d.innerHTML);

	}

	// IE button overlay check
	if (document.all)
		var vis = 0;
	else
		var vis = 1;

	function createFlashControlObj(strContainerId, strObjId, p_strFlashVars,p_AryProperties,  p_AryParams)
	{

	//4/10/2006 IMA  -- uses arrays to pass in parameters and properties
	//creates a flash movie on page load.
	//this will ensure that the object is active when the page is rendered
	//otherwise the user has to click once on the object before it responds to normal events.

	/*
	strContainerId: The div that will contain the flash movie
	strObjId: The name to be given to the flash movie
	p_AryProperties: An array of properties and their values
	p_AryParams: An array containing all the parameters passed in by the caller file
	*/


		var d = document.getElementById(strContainerId);
		var strHtml='';
		var strQuality, strMovieUrl;
		var strBgColor, strWmode, strAllowScriptAccess;


		//set some defaults
		if(strContainerId == '')
			 strContainerId = 'div_Container';

		if(p_AryProperties.width == '')
			 p_AryProperties.width = '200';

		if(p_AryProperties.height == '')
			 p_AryProperties.height = '290';


		if(p_AryProperties.strAlign == '')
			 p_AryPropertiesstrAlign = 'middle';

	 if(p_AryProperties.strCodeBase=='')
			 p_AryProperties.strCodeBase = '"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"'	

		// set the variable
		strHtml = '<object classid="' + p_AryProperties.strClassId +
			'" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"'
			+ ' id="' + strObjId + 
			'" width="' + p_AryProperties.width + '" height="' + p_AryProperties.height +'"> \n' 


		//cycle through the parameter array
		for (var i=0; i< p_AryParams.length; i++){

			strHtml += ' <param name="' + p_AryParams[i].name + '" value="' + p_AryParams[i].value  + '"> \n' ; 

			if(p_AryParams[i].name == 'quality')
					strQuality = p_AryParams[i].value; 
			else if( p_AryParams[i].name == 'movie')
				strMovieUrl = p_AryParams[i].value;
			else if( p_AryParams[i].name == 'bgcolor')
				strBgColor = p_AryParams[i].value;
			else if( p_AryParams[i].name == 'wmode')
				strWmode = p_AryParams[i].value;
			else if( p_AryParams[i].name == 'allowscriptAccess')
				strAllowScriptAccess = p_AryParams[i].value;	

			//set some defaults on the parameters
			if( p_AryParams[i].name == 'autoStart' && p_AryParams[i].value == '')
				p_AryParams[i].value == '-1';

			if( p_AryParams[i].name == 'allowscriptAccess' && p_AryParams[i].value == '')
				p_AryParams[i].value == 'sameDomain';


		}

		strHtml += ' <embed src = "' + strMovieUrl  + p_AryProperties.queryparams  + '" " quality="' + strQuality  + '" bgcolor="' + strBgColor  + 
		' " wmode="' + strWmode  + '" width="' + p_AryProperties.width  + '" height="' + p_AryProperties.height  +  '" name="' + strObjId + '" align="' + p_AryProperties.align  + '" ' +
		' allowScriptAccess="' + strAllowScriptAccess  + '" flashvars="' + p_strFlashVars + '" type="application/x-shockwave-flash"' +
		' pluginspage="http://www.macromedia.com/go/getflashplayer" />' +
		'</object>'


		//alert(strHtml);
		//now set the inner html
		d.innerHTML = strHtml;


	}
}