// Global variables
var qtMode = false;

// Functions
detectWindowsQT();
detectQT();

// Windows IE plugin detection
function detectWindowsQT() {
	var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;

	// vbscript code
	if(isIE && isWin){
		document.write('<scr' + 'ipt language="vbscript"\> \n');
		document.write('On Error Resume Next \n');
		document.write('Set theObject = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1") \n');
		document.write('On Error goto 0 \n');
		document.write('If IsObject(theObject) Then \n');
		document.write('If theObject.IsQuickTimeAvailable(0) Then \n');
		document.write('qtMode = true \n');
		document.write('End If \n');
		document.write('End If \n');
		document.write('</scr' + 'ipt\> \n');
	}
}

// Netscape & Mac IE plugin detection
function detectQT() {
	var i;

	if (navigator.plugins) {
		for (i = 0; i < navigator.plugins.length; i++) {
			if (navigator.plugins[i].name.indexOf('QuickTime') >= 0) {
				qtMode = true;
			}
		}
	}
}