var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

function writeFlash(file,width,height,background,noFlash,redirect) {
	if (hasReqestedVersion) { 
		var newTags = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+width+'" height="'+height+'" id="flashFile" 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"  id="flashFile"  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" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" />';
			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);
	  }
}