var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(neededVersion==null) var neededVersion=0;
hasReqestedVersion=(versionMajor>=neededVersion);
function writeFlash(file,width,height,background,noFlash,redirect) {
	if (hasReqestedVersion) { 
		var newTag = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="flash" menu="false" align="middle">';
			newTag += '<param name="allowScriptAccess" value="sameDomain" />';
			newTag += '<param name="movie" value="'+file+'" /><param name="quality" value="high" /><param name="bgcolor" value="'+background+'" /><embed src="'+file+'" quality="high" bgcolor="'+background+'" width="'+width+'" height="'+height+'" menu="false"  name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
			newTag += '</object>';
		document.write(newTag); // embed the Flash Content SWF when all tests are passed
	  } else {  // flash is too old or we can't detect the plugin
		(arguments[5] && redirect == "window" ) ? document.location = noFlash : document.write(noFlash);
	  }
}

function writeFlashWithVars(file,width,height,background,noFlash,redirect) {
	if (hasReqestedVersion) { 
		var newTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="flash" menu="false" align="middle">';
			newTags += '<param name="allowScriptAccess" value="sameDomain" />';
			newTags += '<param name="movie" value="'+file+'" />';
			newTags += '<param name="quality" value="high" />';
			newTags += '<param name="bgcolor" value="'+background+'" />';
			if(arguments.length>6){
			newTags += '<param name="FlashVars" value="';
				for(i=6;i<arguments.length;i++){
				newTags += arguments[i];
				if(i<arguments.length-1) newTags += '&';
				}
				newTags += '">';			
			} 
			newTags += '<embed src="'+file+'" quality="high" bgcolor="'+background+'" width="'+width+'" height="'+height+'" menu="false"  name="flash" align="middle" ';
			if(arguments.length>6){
			newTags += 'FlashVars="';
				for(i=6;i<arguments.length;i++){
				newTags += arguments[i];
				if(i<arguments.length-1) newTags += '&';
				}
				newTags += '" ';			
			} 
			newTags += 'allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
			newTags += '</object>';
		document.write(newTags); // embed the Flash Content SWF when all tests are passed
	  } else {
	  		if (arguments[5] && redirect == "window" ){  // flash is too old or we can't detect the plugin
				document.location = noFlash;
	  		} else if (arguments[5] && redirect == "include" ){
	  			document.write('<iframe src="'+noFlash+'" height="'+height+'" width="'+width+'" frameborder="0" scrolling="no"></iframe>');
	  		} else {
	  			document.write(noFlash);
			}
	  }
}

function writeFlashDiv(file,width,height,background,noFlash,whchDiv) {
	if (hasReqestedVersion) { 
		var newTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="flash" menu="false" align="middle">';
			newTags += '<param name="allowScriptAccess" value="sameDomain" />';
			newTags += '<param name="movie" value="'+file+'" /><param name="quality" value="high" /><param name="bgcolor" value="'+background+'" /><embed src="'+file+'" quality="high" bgcolor="'+background+'" width="'+width+'" height="'+height+'" menu="false"  name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
			newTags += '</object>';
		document.getElementById('mainTbl').innerHTML=(newTags); // embed the Flash Content SWF when all tests are passed
	  } else {  // flash is too old or we can't detect the plugin
		document.getElementById('mainTbl').innerHTML=noFlash;
	  }
}


function writeFlashTransparent(file,width,height,background,noFlash,redirect) {
	if (hasReqestedVersion) { 
		var newTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'" id="flash" menu="false" align="middle">';
			newTags += '<param name="allowScriptAccess" value="sameDomain" />';
			newTags += '<param name="wmode" value="opaque">';
			newTags += '<param name="movie" value="'+file+'" /><param name="quality" value="high" />'
			if(arguments.length>6){
			newTags += '<param name="FlashVars" value="';
				for(i=6;i<arguments.length;i++){
				newTags += arguments[i];
				if(i<arguments.length-1) newTags += '&';
				}
				newTags += '">';			
			}
			newTags += '<embed src="'+file+'" quality="high" wmode="opaque" width="'+width+'" height="'+height+'" menu="false"  name="flash" align="middle"';
			if(arguments.length>6){
			newTags += 'FlashVars="';
				for(i=6;i<arguments.length;i++){
				newTags += arguments[i];
				if(i<arguments.length-1) newTags += '&';
				}
				newTags += '" ';			
			}
			newTags += 'allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
			newTags += '</object>';
		document.write(newTags); // embed the Flash Content SWF when all tests are passed
	  } else {  // flash is too old or we can't detect the plugin
		(arguments[5] && redirect == "window" ) ? document.location = noFlash : document.write(noFlash);
	  }
}

function writeFlash8(file,width,height,background,noFlash,redirect) {
	if (hasReqestedVersion) { 
		var newTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'" id="flash" menu="false" align="middle">';
			newTags += '<param name="allowScriptAccess" value="sameDomain" />';
			newTags += '<param name="movie" value="'+file+'" /><param name="quality" value="high" /><param name="bgcolor" value="'+background+'" /><embed src="'+file+'" quality="high" bgcolor="'+background+'" width="'+width+'" height="'+height+'" menu="false"  name="flash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
			newTags += '</object>';
		document.write(newTags); // embed the Flash Content SWF when all tests are passed
	  } else {  // flash is too old or we can't detect the plugin
		(arguments[5] && redirect == "window" ) ? document.location = noFlash : document.write(noFlash);
	  }
}