//	strz="Hello, cruel world where everything is cruel!";
//	strz=strz.replace(/cruel/g, "nice");
//	alert(strz);
	// -- This section of code is to detect a flash plugin. Use VB script for MSIE Windows
	
	function flashDetectPlugin() {
		for (i=0; i<navigator.plugins.length; i++)
			if (navigator.plugins[i].description.indexOf("Flash")>=0 && navigator.plugins[i].description.indexOf("Shockwave")>=0) return true;
		return false;
	}
	
	if ((navigator.userAgent.indexOf('MSIE') != -1) && (navigator.userAgent.indexOf('Win') != -1)) {
		document.writeln('<script language="VBscript">');
	
		document.writeln('detectableWithVB = False');
		document.writeln('If ScriptEngineMajorVersion >= 2 then');
		document.writeln('  detectableWithVB = True');
		document.writeln('End If');
	
		document.writeln('Function detectActiveXControl(activeXControlName)');
		document.writeln('  on error resume next');
		document.writeln('  detectActiveXControl = False');
		document.writeln('  If detectableWithVB Then');
		document.writeln('     detectActiveXControl = IsObject(CreateObject(activeXControlName))');
		document.writeln('  End If');
		document.writeln('End Function');
		document.writeln('</scr' + 'ipt>');
	}
	
	// ************************
	// flash_detect(yesFlash, noFlash)
	//
	// If the agent has flash, then write the content of yesFlash
	// If not, or if ?flash=no, write the content of noFlash
	// ************************
	function flash_detect(yesFlash, noFlash, passMe) {
		if (document.URL.split('?')[1]=='flash=no') { dett=false; }
		else {
			if (navigator.plugins && navigator.plugins.length>0) { dett=flashDetectPlugin(); }
			else {
				if(detectableWithVB) { dett = detectActiveXControl('ShockwaveFlash.ShockwaveFlash.1'); }
			}
		}
		if (dett) { document.write(yesFlash.replace(/flashpass/gi, passMe)) } else { document.write(noFlash); }
	}
	
	// -- END OF FLASH DETECTION CODE
	