//Standard getFlashTags
function getFlashTags(flashMovie, height, width, alt, flashvars, requiredMajorVersion, requiredMinorVersion, requiredRevision) {
	if (loop == null) loop=true;
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		var oeTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
		+ 'width="' + width + '" height="' + height + '"'
		+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<param name="movie" value="/flash/' + flashMovie + '.swf" /><param name="loop" value="'+loop+'" />'
		+ '<param name="FlashVars" value="' + flashvars + '"/>'
		+ '<param name="quality" value="high" />'
		+ '<param name="bgcolor" value="#ffffff" />'
		+ '<param name="scale" value="noborder" />'
		+ '<embed src="/flash/' + flashMovie + '.swf" loop="false" quality="high" '
		+ 'bgcolor="#ffffff" '
		+ 'width="' + width + '" height="' + height + '" name="' + flashMovie + '" align="middle" '
		+ 'play="true" '
		+ 'loop="'+loop+'" '
		+ 'quality="high" scale="noborder" '
		+ 'allowScriptAccess="sameDomain" '
		+ 'FlashVars="'+flashvars+'" '
		+ 'type="application/x-shockwave-flash" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
		+ '<\/embed>'
		+ '<\/object>';
		document.write(oeTags);   // embed the flash movie
		
	  }
	  else {  // flash is too old or we can't detect the plugin
		var alternateContent = '<div style="height:'+ height +'px; width:' + width + 'px; border:solid 1px black; padding-left:20px;padding-top:20px">'
		  + '<p><a href=http://www.macromedia.com/go/getflash/><img border=0 src="/images/get_flash.gif" width="74" height="27"/></a></p>'
		  + '<p>This content requires the Macromedia Flash Player, Version '+ requiredMajorVersion + '.'+ requiredMinorVersion + '.</p>'
		  + '<p><a target=_blank href=http://www.macromedia.com/go/getflash/>Click here to get Flash (free)</a></p></div>';
		if (alt.length>0)  {  
		    document.write(alt);  // insert custom non-flash content
		}
		else {
		    document.write(alternateContent);  // insert standard non-flash content
		}
    }
}

//Action-script safe getFlashTags
function asGetFlashTags(flashMovie, height, width, alt, flashvars, requiredMajorVersion, requiredMinorVersion, requiredRevision, loop) {
	if (loop == null) loop=true;
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		// embed the flash movie
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', width,
			'height', height,
			'src', '/flash/' + flashMovie,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', loop,
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', flashMovie,
			'bgcolor', '#ffffff',
			'name', 'omws',
			'menu', 'true',
			'FlashVars',flashvars,
			'allowScriptAccess','sameDomain',
			'movie', '/flash/' + flashMovie,
			'salign', ''
			); //end AC code
		
	  }
	  else {  // flash is too old or we can't detect the plugin
		var alternateContent = '<div style="height:'+ height +'px; width:' + width + 'px; border:solid 1px black; padding-left:20px;padding-top:20px">'
		  + '<p><a href=http://www.macromedia.com/go/getflash/><img border=0 src="/images/get_flash.gif" width="74" height="27"/></a></p>'
		  + '<p>This content requires the Macromedia Flash Player, Version '+ requiredMajorVersion + '.'+ requiredMinorVersion + '.</p>'
		  + '<p><a target=_blank href=http://www.macromedia.com/go/getflash/>Click here to get Flash (free)</a></p></div>';
		if (alt.length>0)  {  
		    document.write(alt);  // insert custom non-flash content
		}
		else {
		    document.write(alternateContent);  // insert standard non-flash content
		}
    }
}
//Standard getFlashTags with a BG color
function getFlashTagsWithBG(flashMovie, height, width, alt, flashvars, requiredMajorVersion, requiredMinorVersion, requiredRevision,bgcolor, loop) {
	if (loop == null) loop=true;
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		var oeTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
		+ 'width="' + width + '" height="' + height + '"'
		+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<param name="movie" value="/flash/' + flashMovie + '.swf" /><param name="loop" value="'+loop+'" />'
		+ '<param name="FlashVars" value="' + flashvars + '"/>'
		+ '<param name="quality" value="high" />'
		+ '<param name="bgcolor" value="'+bgcolor+'" />'
		+ '<param name="scale" value="noborder" />'
		+ '<embed src="/flash/' + flashMovie + '.swf" loop="' + loop + '" quality="high" '
		+ 'bgcolor="' + bgcolor +'" '
		+ 'width="' + width + '" height="' + height + '" name="' + flashMovie + '" align="middle" '
		+ 'play="true" '
		+ 'loop="' + loop + '"'
		+ 'quality="high" scale="noborder" '
		+ 'allowScriptAccess="sameDomain" '
		+ 'FlashVars="'+flashvars+'" '
		+ 'type="application/x-shockwave-flash" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
		+ '<\/embed>'
		+ '<\/object>';
		document.write(oeTags);   // embed the flash movie
		
	  }
	  else {  // flash is too old or we can't detect the plugin
		var alternateContent = '<div style="height:'+ height +'px; width:' + width + 'px; border:solid 1px black; padding-left:20px;padding-top:20px">'
		  + '<p><a href=http://www.macromedia.com/go/getflash/><img border=0 src="/images/get_flash.gif" width="74" height="27"/></a></p>'
		  + '<p>This content requires the Macromedia Flash Player, Version '+ requiredMajorVersion + '.'+ requiredMinorVersion + '.</p>'
		  + '<p><a target=_blank href=http://www.macromedia.com/go/getflash/>Click here to get Flash (free)</a></p></div>';
		if (alt.length>0)  {  
		    document.write(alt);  // insert custom non-flash content
		}
		else {
		    document.write(alternateContent);  // insert standard non-flash content
		}
    }
}
//Action-script safe getFlashTags with Background color
function asGetFlashTagsWithBG(flashMovie, height, width, alt, flashvars, requiredMajorVersion, requiredMinorVersion, requiredRevision,bgcolor, loop) {
	if (loop == null) loop=true;
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		// embed the flash movie
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0',
			'width', width,
			'height', height,
			'src', '/flash/' + flashMovie,
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', loop,
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', flashMovie,
			'bgcolor', bgcolor,
			'name', 'omws',
			'menu', 'true',
			'FlashVars',flashvars,
			'allowScriptAccess','sameDomain',
			'movie', '/flash/' + flashMovie,
			'salign', ''
			); //end AC code
		
	  }
	  else {  // flash is too old or we can't detect the plugin
		var alternateContent = '<div style="height:'+ height +'px; width:' + width + 'px; border:solid 1px black; padding-left:20px;padding-top:20px">'
		  + '<p><a href=http://www.macromedia.com/go/getflash/><img border=0 src="/images/get_flash.gif" width="74" height="27"/></a></p>'
		  + '<p>This content requires the Macromedia Flash Player, Version '+ requiredMajorVersion + '.'+ requiredMinorVersion + '.</p>'
		  + '<p><a target=_blank href=http://www.macromedia.com/go/getflash/>Click here to get Flash (free)</a></p></div>';
		if (alt.length>0)  {  
		    document.write(alt);  // insert custom non-flash content
		}
		else {
		    document.write(alternateContent);  // insert standard non-flash content
		}
    }
}

//Standard getFlashTags with black background
function getFlashTagsBlack(flashMovie, height, width, alt, flashvars, requiredMajorVersion, requiredMinorVersion, requiredRevision, loop) {
	if (loop == null) loop=true;
	var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if(hasRightVersion) {  // if we've detected an acceptable version
		var oeTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"'
		+ 'width="' + width + '" height="' + height + '"'
		+ 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
		+ '<param name="movie" value="/flash/' + flashMovie + '.swf" /><param name="loop" value="'+loop+'" />'
		+ '<param name="FlashVars" value="' + flashvars + '"/>'
		+ '<param name="quality" value="high" />'
		+ '<param name="bgcolor" value="#000000" />'
		+ '<param name="scale" value="noborder" />'
		+ '<embed src="/flash/' + flashMovie + '.swf" loop="false" quality="high" '
		+ 'bgcolor="#000000" '
		+ 'width="' + width + '" height="' + height + '" name="' + flashMovie + '" align="middle" '
		+ 'play="true" '
		+ 'loop="'+loop+'" '
		+ 'quality="high" scale="noborder" '
		+ 'allowScriptAccess="sameDomain" '
		+ 'FlashVars="'+flashvars+'" '
		+ 'type="application/x-shockwave-flash" '
		+ 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
		+ '<\/embed>'
		+ '<\/object>';
		document.write(oeTags);   // embed the flash movie
		
	  }
	  else {  // flash is too old or we can't detect the plugin
		var alternateContent = '<div style="height:'+ height +'px; width:' + width + 'px; border:solid 1px black; padding-left:20px;padding-top:20px">'
		  + '<p><a href=http://www.macromedia.com/go/getflash/><img border=0 src="/images/get_flash.gif" width="74" height="27"/></a></p>'
		  + '<p>This content requires the Macromedia Flash Player, Version '+ requiredMajorVersion + '.'+ requiredMinorVersion + '.</p>'
		  + '<p><a target=_blank href=http://www.macromedia.com/go/getflash/>Click here to get Flash (free)</a></p></div>';
		if (alt.length>0)  {  
		    document.write(alt);  // insert custom non-flash content
		}
		else {
		    document.write(alternateContent);  // insert standard non-flash content
		}
    }
}
//Below is the contents of AC_RunActiveContent.js
//v1.0
//Copyright 2006 Adobe Systems, Inc. All rights reserved.
function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '<object ';
  for (var i in objAttrs)
    str += i + '="' + objAttrs[i] + '" ';
  str += '>';
  for (var i in params)
    str += '<param name="' + i + '" value="' + params[i] + '" /> ';
  str += '<embed ';
  for (var i in embedAttrs)
    str += i + '="' + embedAttrs[i] + '" ';
  str += ' ></embed></object>';

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "id":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

