var haveqt  = false;
var haveqt5 = false;
var haveqt5ax = false;
var haveflash4 = false;
var haveflash5 = false;
var havejava = false;
var OSName = "unknown";
var bName = "unknown";
var bVer = 0.0;
var didVB = false;

if (navigator.appVersion.indexOf("Mac") > 0) OSName = "Mac";
if (navigator.appVersion.indexOf("Win") > 0) OSName = "Win";
if (navigator.appName.substring(0,8) == "Netscape") bName = "NN";
if (navigator.appName.substring(0,9) == "Microsoft") bName = "IE";
if(navigator.platform.indexOf("Mac")>=0) OSName = "Mac";

// Opera fix
if(navigator.userAgent.indexOf("Opera")>=0){
	bName = "OP";
}

if (bName == "NN") {
 bVer=parseFloat(navigator.appVersion);
};

if (bName == "IE") {
 vStart=navigator.appVersion.indexOf("MSIE")+4;
 bVer=parseFloat(navigator.appVersion.substr(vStart,255));
};

if (bVer >= 4.0) {
 havejava=navigator.javaEnabled(); // doesn't do it's job ...
 // geht bei Mac-NN 4.5 ziemlich gut
};

if ((bName == "IE") && (OSName == "Win")) {
 document.writeln('<script type="text/vbscript" language="VBscript">');
 document.writeln('On Error Resume Next');
 document.writeln('Set theObject = CreateObject("QuickTimeCheckObject.QuickTimeCheck.1")');
 document.writeln('On Error goto 0');
 document.writeln('If IsObject(theObject) Then');
 document.writeln('  interest = theObject.QuickTimeVersion');
 document.writeln('  If theObject.IsQuickTimeAvailable(0) Then');
 document.writeln('    haveqt = true');
 document.writeln('    If (theObject.QuickTimeVersion > 69206016) Then');
 document.writeln('      haveqt5 = true');
 document.writeln('    End If');
 document.writeln('  End If');
 document.writeln('End If');
 document.writeln('</'+'script>');
 document.writeln('<script type="text/vbscript" language="VBscript">');
 document.writeln('On Error Resume Next');
 document.writeln('haveqt5ax = (IsObject(CreateObject("QuickTime.QuickTime.1")))');
 document.writeln('</'+'script>');
 document.writeln('<script type="text/vbscript" language="VBscript">');
 document.writeln('On Error Resume Next');
 document.writeln('haveflash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4")))');
 document.writeln('</'+'script>');
 document.writeln('<script type="text/vbscript" language="VBscript">');
 document.writeln('On Error Resume Next');
 document.writeln('haveflash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5")))');
 document.writeln('</'+'script>');
 document.writeln('<script type="text/vbscript" language="VBscript">');
 document.writeln('On Error Resume Next');
 document.writeln('haveflash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6")))');
 document.writeln('</'+'script>');
 document.writeln('<script type="text/vbscript" language="VBscript">');
 document.writeln('On Error Resume Next');
 document.writeln('didVB = true');
 document.writeln('</'+'script>');
}

if ((bName == "NN" || OSName == "Mac") && navigator.plugins) {
 for (i=0; i < navigator.plugins.length; i++ ) {
  p = navigator.plugins[i].name;
  if (p.indexOf("QuickTime") >= 0) {
   haveqt = true;
   for (k=0; k<p.length; k++) {
    qv = parseFloat(p.substring(k, p.length));
    if (qv!= "NaN" && qv > 4.1) {
     haveqt5 = true;
    }
   }
  }
 }
 if (navigator.plugins["Shockwave Flash"]){
  var flashDescription = navigator.plugins["Shockwave Flash"].description;
  var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
  haveflash4 = flashVersion == 4;
  haveflash5 = flashVersion == 5;
 }
}

if ((bName == "NN" || OSName == "Mac") && navigator.mimeTypes) {
 for(var i=0; i<navigator.mimeTypes.length; i++) {
  if(navigator.mimeTypes[i].type=="application/x-shockwave-flash" && navigator.mimeTypes[i].enabledPlugin) {
   haveflash4 = true;
  }
 };
}

if((OSName=="Mac")){
	haveqt5=true;
}


if (bName == "OP"){
 for (i=0; i < navigator.plugins.length; i++ ) {
  p = navigator.plugins[i].name;
  if (p.indexOf("QuickTime") >= 0) {
   haveqt = true;
   if((index=p.indexOf("."))>0){
   	qv = parseFloat(p.substring(index-1, index+1));
   	if (qv!= "NaN" && qv > 4.1) {
     		haveqt5ax = true;
    	}
   }else{
  	for (k=0; k<p.length; k++) {
	    qv = parseFloat(p.substring(k, p.length));
	    if (qv!= "NaN" && qv > 4.1) {
	     haveqt5ax = true;
	    }
  	}
   }
  }
 }	
}
 
/////////////////////////   Evaluation of the findings
state3z="noqt";

qt5axNeededButNotThere=false;
if ((bVer>=5.5) && (bName == "IE") && (OSName == "Win") && (haveqt5 == true) && (haveqt5ax == false)) { qt5axNeededButNotThere=true; };

if (qt5axNeededButNotThere == true) {
 // state3z="noqtax";
 state3z="qtax";
} else if (haveqt5ax == true) {
 state3z="qtax";
} else if (haveqt5 == true) {
 state3z="qtbed";
} else {
	if(navigator.javaEnabled()){
		state3z="java";
	}else{
 		state3z="noqt";
 	}
};

