//Detect non-IE browser plug-in function
function hasPlugin( name) {
name = name.toLowerCase();
for (var i=0 ; i < navigator.plugins.length ; i ) {
if (navigator.plugins[i].name. toLowerCase().indexOf(name) >-1) {
return true;
}
}
return false;
}
//Detect IE browser Plug-in function
function hasIEPlugin(name) {
try {
new ActiveXObject(name);
return true;
}
catch (ex) {
return false;
}
}
//Detect Flash in all browsers
function hasFlash() {
var result = hasPlugin("Flash");
if (!result) {
result = hasIEPlugin("ShockwaveFlash.ShockwaveFlash");
}
return result;
}
//Detect QuickTime in all browsers
function hasQuickTime() {
var result = hasPlugin("QuickTime");
if (!result) {
result = hasIEPlugin("QuickTime.QuickTime");
}
return result;
}
alert(hasFlash());
alert(hasQuickTime());