///////////////////////////////////////////////////////////////////////////////////////////////////
// *** flashdetect ***
// works with:
// NETSCAPE 3.0 - 6.0
// IE 3.0 - 6.0
// Opera 8.0 - 9.0
//   
// returns variable flashversion    
// (c)2001 Ogilvy Interactive, Frankfurt
// (c)2006 D Gaenko, Ukraine
///////////////////////////////////////////////////////////////////////////////////////////////////
		
// GLOBAL VARIABLES
var ns,ie;
var platform = navigator.appVersion.indexOf('Mac') != -1 ? "mac" : "pc";
var browser = navigator.appName.indexOf('Netscape') != -1 ? (ns=1) : (ie=1);
var bver = parseFloat(navigator.appVersion);
var ns6 = navigator.userAgent.indexOf('Netscape6/');
if(navigator.appVersion.indexOf('MSIE 5') != -1){bver = 5;}
if(ns6 != -1){bver = navigator.userAgent.substring(ns6 + 10,navigator.userAgent.length);}
var flashversion = 0;
		
// COMPREHENSIVE FLASH DETECT
ActiveX = '<SCRIPT LANGUAGE="VBScript">\n';
ActiveX += 'Function GetFlashValue\n';
ActiveX += 'on error resume next\n';
for (i=2; i<11; i++)
  ActiveX += 'if IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'")) then FlashInstalled = '+i+'\n';
ActiveX += 'GetFlashValue = FlashInstalled\n';
ActiveX += 'End Function\n';
ActiveX += '<\/SCRIPT>\n';
	
if(ns|| platform == "mac" || window.opera){
	nparray = navigator.plugins;
	nparraylen = nparray.length;
	for (i=0;i<nparraylen;i++){
		npplugin = nparray[i];
		npname   = npplugin.name;
		npdesc   = npplugin.description;
                if (/Shockwave Flash ([0-9]+)/i.test(npdesc)) { 
                  flashversion = RegExp.$1; 
                  break
                }
	}
} else if(ie && platform != "mac"){
		document.write(ActiveX);
		flashversion = GetFlashValue();
}
