
function flashDetect(){
	
	actualVersion = 0;
	maxVersion = 9;
	
	if (navigator.plugins) {
    // ...then check for flash 2 or flash 3+.
    if (navigator.plugins["Shockwave Flash 2.0"]
        || navigator.plugins["Shockwave Flash"]) {

      
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;

      // DEBUGGING: uncomment next line to see the actual description.
      // alert("Flash plugin description: " + flashDescription);
      
      // A flash plugin-description looks like this: Shockwave Flash 4.0 r5
      
      var flashVersion = parseInt(flashDescription.substring(16));

      flash2Installed = flashVersion == 2;    
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion >= 9;
    }
  }
		
  for (var i = 2; i <= maxVersion; i++) {  
    if (eval2("window.flash" + i + "Installed") == true) actualVersion = i;
  }
  
  if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 4;  

  return actualVersion;

}  

function eval2(x) {
	try{
		return eval(x);
	}catch(e){ return -1;
	}
}

function doFlashDetect(){

	if (flashDetect() < 8){
		document.getElementById("htmlWarning").style.display = "";
	}else{
		document.getElementById("flashVersionDiv").style.display = "";
	}
}
function showFlash(){
	document.getElementById('htmlWarning').style.display='none';
	document.getElementById('flashVersionDiv').style.display='';
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}