function CreateFlash(targetElement, flashData, flashWidth, flashHeight) {
  var innerHtml;

	obj = document.getElementById(targetElement);

	if (obj != null)
	{  
		innerHtml = '<object type="application/x-shockwave-flash" data="'+flashData+'" width="'+flashWidth+'" height="'+flashHeight+'">';
		innerHtml += '<param name="movie" value="'+flashData+'" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" />';
		innerHtml += '<a href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" onclick="window.open(this.href,\'_blank\');return false;"><img src="noflash.gif" width="'+flashWidth+'" height="'+flashHeight+'" alt="Your browser doesn\'t support Flash! Click here to upgrade to Flash free." /></a>';
		innerHtml += '</object>';
	  
		obj.innerHTML = innerHtml;
  }
}

function CreateFlash(targetElement, flashData, flashWidth, flashHeight, flashvarsAndOther) {
  var innerHtml;
  var i;
  var prevHTML;

  obj = document.getElementById(targetElement);
  prevHTML = obj.innerHTML;
  
  if (obj != null)
  {
		innerHtml = '<object type="application/x-shockwave-flash" data="'+flashData+'" width="'+flashWidth+'" height="'+flashHeight+'">';
		innerHtml += '<param name="movie" value="'+flashData+'" /><param name="menu" value="false" /><param name="quality" value="high" /><param name="wmode" value="transparent" />';
		if(typeof(flashvarsAndOther) == 'object' && flashvarsAndOther.length > 0)
		{
			for(i=0; i< flashvarsAndOther.length; i++)
			{
				innerHtml += flashvarsAndOther[i];
			}
		}
		innerHtml += '</object>';
	  
		obj.innerHTML = innerHtml;
		
		// IE6 does not allow setting the innerHTML property of an element if the HTML contains an object element that
		// is not currently available in the browser (for example flash is not installed or is disabled) - it is a security issue.
		// Thus we revert to the original content of the object so that we have a link to download flash.
		if (obj.innerHTML == "")
		{
			obj.innerHTML = prevHTML;
		}
  }
}