
function detectFlash(){
	 var requiredVersion = 4;                  // version the user needs to view site 
	 var useRedirect = false;                   // "true" loads new flash or non-flash page into browser
                                                     // "false" embeds movie or alternate html code into current page
	 var hasRightVersion = false;            // boolean. true if it's safe to embed the flash movie in the page
     
	 if (navigator.plugins){                                                // does navigator.plugins exist?
           if (navigator.plugins["Shockwave Flash 2.0"]       // yes>> then is Flash 2 
           || navigator.plugins["Shockwave Flash"]){            // or flash 3+ installed?

                 // set convenient references to flash 2 and the plugin description
                 var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
                 var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
                 // a flash plugin-description looks like this: Shockwave Flash 4.0 r5
                 // so we can get the major version by grabbing the character before the period
                 // note that we don't bother with minor version detection. do that in your movie with $version
                 var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
           }
     }
 
     // if we're on webtv, the version supported is 2 (pre-summer2000, or 3, post-summer2000)
     // note that we don't bother sniffing varieties of webtv. you could if you were sadistic...
     if(navigator.userAgent.indexOf("WebTV") != -1) flashVersion = 2;      
     
     // uncomment next line to display flash version during testing
      //alert("flashVersion: "+flashVersion);

     // we're finished getting the version. time to take the appropriate action
     if (flashVersion >= requiredVersion) {             // user has a new enough version
           hasRightVersion = true;                                    // flag: it's okay to write out the object/embed tags later
		   document.cookie="hasflash=1";
     } else {      // user doesn't have a new enough version.
		   document.cookie="hasflash=0";
     }
	 return hasRightVersion;
}

// nicht benutzt 
function showFlash(file) {
	/* random part */
	var oeTags='<OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH=788 HEIGHT=353><PARAM NAME=movie VALUE="'+file+'"> <PARAM NAME=loop VALUE=false> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=salign VALUE=LT> <PARAM NAME=bgcolor VALUE=#003300><EMBED src="'+file+'" loop=false menu=false quality=high salign=LT bgcolor=#003300  WIDTH=788 HEIGHT=353 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>';
	document.write(oeTags);
}

// nicht benutzt
function showImage(file) {
	var htmlTags='<img src="file" />\n';
	document.write(htmlTags);
}
