<!--
/*****************************************************
 *                                                   *
 *            QuickTime Plugin Check v1.01           *
 *                                                   *
 *              Written by Steve Vachon              *
 *                  (a.k.a Prometh)                  *
 *                                                   *
 *              www.svachon.com/scripts              *
 *                                                   *
 *****************************************************/

/*
 In order to keep file size down, you may remove all
 comments in this file and the html file EXCEPT the
 above marquee.

 If you merge this file with your html file, you must
 include the marquee in that html document.

 http://www.gnu.org/licenses/gpl.txt
*/


var targetVersion = 6.0;	// The version you want to detect - can contain decimals

// Leave the following untouched unless you know what you're doing
var hasQuickTime = false,
    hasActiveX = false,
    navPlugins = (navigator.plugins.length > 0),
    quickTimeVersion = 0,
    isIE = (navigator.appVersion.indexOf("MSIE") > -1),
    ieVer = parseFloat(navigator.appVersion.split("MSIE")[1]),
    isWin = (navigator.appVersion.indexOf("Windows") > -1),
    isMac = (navigator.appVersion.indexOf("Mac") > -1);

if(navPlugins || (isIE && isMac && ieVer >= 5)) {	// less than IE5 on the MAC have no plugins object
	for(var i=0; i<navigator.plugins.length; i++) {
		var name = navigator.plugins[i].name;
		if(name.indexOf("QuickTime") > -1) {
			quickTimeVersion = parseFloat(name.substring(name.lastIndexOf(" "), name.length));
			hasQuickTime = (quickTimeVersion >= targetVersion);
			if(hasQuickTime) break;
		}
	}
}
else if(isWin && isIE) {
	document.write('<script language=VBScript\>\n');
	document.write('function isHere(chk)\n');
	document.write('  isHere = false\n');
	document.write('  on error resume next\n');
	document.write('  if ScriptEngineMajorVersion > 1 then\n');
	document.write('    isHere = IsObject(CreateObject(chk))\n');
	document.write('  end if\n');
	document.write('end function\n');
	document.write('</script\>');

	try {
		hasActiveX = isHere("msxml");
		if(!hasActiveX) hasActiveX = isHere("Microsoft.ActiveXPlugin.1");
	} catch(e) {
		hasActiveX = false;
	}
	if(hasActiveX) {
		document.write('<script language=VBScript\>\n');
		document.write('on error resume next\n');
		document.write('Set obj = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")\n');
		document.write('if IsObject(obj) then\n');
		document.write('  if obj.IsQuickTimeAvailable(0) then\n');
		document.write('    quickTimeVersion = parseFloat(Hex(obj.QuickTimeVersion)/1000000)\n');
		document.write('    if quickTimeVersion >= targetVersion then hasQuickTime = true\n');
		document.write('  end if\n');
		document.write('end if\n');
		document.write('</script\>');
	}
}
//-->