// Quicktime Detection  v1.0
// documentation: http://www.dithered.com/javascript/quicktime_detect/index.html
// license: http://creativecommons.org/licenses/by/1.0/
// code by Chris Nott (chris[at]dithered[dot]com)


//**** Check for Quicktime *****************************************
var quicktimeVersion = 0;
function getQuicktimeVersion() {
   var agent = navigator.userAgent.toLowerCase(); 
   
   // NS3+, Opera3+, IE5+ Mac (support plugin array):  check for Quicktime plugin in plugin array
   if (navigator.plugins != null && navigator.plugins.length > 0) {
      for (i=0; i < navigator.plugins.length; i++ ) {
         var plugin =navigator.plugins[i];
         if (plugin.name.indexOf("QuickTime") > -1) {
            quicktimeVersion = parseFloat(plugin.name.substring(18));
         }
      }
   }
   
   // IE4+ Win32:  attempt to create an ActiveX object using VBScript
   else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	document.write('<scr' + 'ipt language="VBScript"\> \n');
	document.write('on error resume next \n');
	document.write('dim obQuicktime \n');
	document.write('set obQuicktime = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1") \n');
	document.write('if IsObject(obQuicktime) then \n');
	document.write('   if obQuicktime.IsQuickTimeAvailable(0) then \n');
	document.write('      quicktimeVersion = CInt(Hex(obQuicktime.QuickTimeVersion) / 1000000) \n');
	document.write('   end if \n');
	document.write('end if \n');
	document.write('</scr' + 'ipt\> \n');
  }

   // Can't detect in all other cases
   else {
      quicktimeVersion = quicktimeVersion_DONTKNOW;
   }

   return quicktimeVersion;
}

quicktimeVersion_DONTKNOW = -1;
//********************************************************************


//**** Generate Error Massages ***************************************
function CallQuicktimeCheck() 
{

	var requiredVersion = 5;
	var quicktimeVersion = getQuicktimeVersion();
	
	if (quicktimeVersion >= requiredVersion) {
	//document.write('<p><br />You have Quicktime ' + quicktimeVersion + ' installed on the current browser.</p>');
	}
	else if (quicktimeVersion > 0) {
	document.write('<p><br />The version of Quicktime installed on the current browser is ' + quicktimeVersion + '.</p>');
	}
	else if (quicktimeVersion == 0) {
	document.write('<p><div class="boxerror">');
	document.write('<div class="bodyText">');
	document.write('<p>You dont have QuickTime installed on this computer. You need QuickTime to view the videos in the modules.</p>');
	document.write('<a href="http://www.apple.com/quicktime/download/" target="_blank">Click here</a> to get QuickTime.');
	document.write('</div>');
	document.write('</div></p>');
	}
	else if (quicktimeVersion == quicktimeVersion_DONTKNOW || quicktimeVersion == null) {
	//document.write('<p><br />This browser does not support Javascript-based Quicktime detection.</p>');
	}

}
//********************************************************************

<!--
//CallQuicktimeCheck()
-->
