/*******************************************************
FLASH DETECT 2.5
All code by Ryan Parman and mjac, unless otherwise noted.
(c) 1997-2004 Ryan Parman and mjac
http://www.skyzyx.com (http://www.skyzyx.com/scripts/flash.php)
*******************************************************/

// This script will test up to the following version.
flash_versions = 20;

// Initialize variables and arrays
var flash = new Object();
flash.installed=false;
flash.version='0.0';

// Dig through Netscape-compatible plug-ins first.
if (navigator.plugins && navigator.plugins.length) {
    for (x=0; x < navigator.plugins.length; x++) {
        if (navigator.plugins[x].name.indexOf('Shockwave Flash') != -1) {
            flash.version = navigator.plugins[x].description.split('Shockwave Flash ')[1];
            flash.installed = true;
            break;
        }
    }
}

// Then, dig through ActiveX-style plug-ins afterwords
else if (window.ActiveXObject) {
    for (x = 2; x <= flash_versions; x++) {
        try {
            oFlash = eval("new ActiveXObject('ShockwaveFlash.ShockwaveFlash." + x + "');");
            if(oFlash) {
                flash.installed = true;
                flash.version = x + '.0';
            }
        }
        catch(e) {}
    }
}

// Create sniffing variables in the following style: flash.ver[x]
// Modified by mjac
flash.ver = Array();
for(i = 4; i <= flash_versions; i++) {
    eval("flash.ver[" + i + "] = (flash.installed && parseInt(flash.version) >= " + i + ") ? true : false;");
}



// Based on
// http://www.quirksmode.org/js/detect.html

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
    browser = "Konqueror";
    OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (!checkIt('compatible'))
{
    browser = "Netscape Navigator"
    version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

if (!OS)
{
    if (checkIt('linux')) OS = "Linux";
    else if (checkIt('x11')) OS = "Unix";
    else if (checkIt('mac')) OS = "Mac"
    else if (checkIt('win')) OS = "Windows"
    else OS = "Unknown";
}

function checkIt(string)
{
    place = detect.indexOf(string) + 1;
    thestring = string;
    return place;
}


function addField( name, value )
{
    document.write( "<input type='hidden' value='"+value+"' name='detect_"+name+"'/>" );
}

addField( 'UserAgent', navigator.userAgent ); 
addField( 'OS', OS );  
addField( 'Browser', browser );
addField( 'Version', version );

addField( 'Screen', screen.width + 'x' + screen.height  );
addField( 'Flash', parseFloat(flash.version) ); 






