useragent = new (function() {

	this.uastring = navigator.userAgent.toLowerCase();

	// Gecko engine browsers
	this.isGecko = (this.uastring.indexOf('gecko') != -1);
	this.isFirefox = this.isGecko && (this.uastring.indexOf('firefox') != -1);
	this.isCamino = (this.uastring.indexOf('camino') != -1);

	// Presto engine browser
	this.isOpera = (this.uastring.indexOf('opera') != -1);

	if (this.uastring && window.opera != undefined && window.opera.version != undefined)
		this.versionOpera = parseFloat(opera.version());

	// Trident engine browsers
	this.isIE = (typeof document.attachEvent != 'undefined') && (!this.isOpera);
	if (this.isIE)
	{
		this.versionIE = getIEVersion();
		this.versionTrident = getTridentVersion();
	}
	// Internet Explorer 8 Compatibility View
	this.modeIE8CV = this.isIE && this.versionIE == 7 && this.versionTrident >= 4;

	// KHTML & Webkit engine based browsers
	this.isWebkit = (this.uastring.indexOf('applewebkit') != -1); // Safari or compatible, using WebKit engine
	this.isSafari = (this.uastring.indexOf('safari') != -1) && (this.uastring.indexOf('chrome') == -1);
	this.isKonqueror = (this.uastring.indexOf('konqueror') != -1);
	this.isChrome = (this.uastring.indexOf('chrome') != -1);	

	

	if (this.isGecko)
	{
	  this.versionGecko = getGeckoVersion();

	  // if the gecko version was not found, it's very likely the browser lied
	  // or the user agent string contains KHTML/Webkit's '(KHTML, like Gecko)'
	  if (this.versionGecko == 0)
	    this.isGecko = false;
	}


	// Platforms
	this.platformIsWin = (this.uastring.indexOf('windows') != -1); // navigator.platform == 'Win32' / 'Win64'
	this.platformIsMac = (this.uastring.indexOf('macintosh') != -1);


	this.csssupport = get_css_capabilities();
	
	return this;

	
	function getIEVersion()
	{
	  // See: http://support.microsoft.com/kb/167820
	  var ua = window.navigator.userAgent
	  var msie = ua.indexOf ( "MSIE " )

	  if ( msie > 0 )      // If Internet Explorer, return version number
	    return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
	  else                 // If another browser, return 0
	    return 0
	}

	function getTridentVersion()
	{
	  // "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
	  var ua = window.navigator.userAgent
	  var trident = ua.indexOf ( "Trident/" )

	  if ( trident > 0 )      // If Trident browser, return version number
	    return parseInt (ua.substring (trident+8, ua.indexOf (".", trident )))
	  else                 // If another browser, return 0
	    return 0
	}

	function getGeckoVersion()
	{
	  // For references see:
	  //   - https://developer.mozilla.org/en/User_Agent_Strings_Reference
	  //   - http://www.useragentstring.com/pages/useragentstring.php
      var ua = window.navigator.userAgent
	  var vStart = ua.indexOf(' rv:');
	  var vEnd   = vStart>-1 ? ua.indexOf(')',vStart+1) : -1;

	  // set of numbers separated by periods, possibly followed by a pre-release indicator
	  // (parseFloat will pick up till the first non number/dot or second dot)
	  if (vStart==-1 || vEnd-vStart<3)
	    return 0;
	  else
	    return parseFloat(ua.substring(vStart+4,vEnd));
	};

	function get_css_capabilities()
	{
		// a browser should ignore rules which it cannot understand, so try which CSS properties are supported
		var test = document.createElement('div');
		
		var csssupport = {};
		
		test.style.cssText = 'background-color: rgba(0,0,0,0.8);';
		csssupport.rgba = (test.style.cssText=='')?false:true;

		test.style.cssText = 'max-width: 500px;';
		csssupport.maxsize = (test.style.cssText=='')?false:true;

	//	spcApp.maxWidthSupport = typeof(d.style.maxWidth)=='string';
		
	//	if(typeof(d.style.maxWidth)=='string'){ spcApp.maxWidthSupport = true } };		

		return csssupport;	
	}
	
})();



// 5.7.17184
/*
    if ( typeof ScriptEngineBuildVersion != 'undefined' ) {

        var major = ScriptEngineMajorVersion();
        var minor = ScriptEngineMinorVersion();
        var build = ScriptEngineBuildVersion();
        
        if ( major == 5 && minor == 6 && build == 8820 ) {
            alert('De versie van jscript.dll die je hebt veroorzaakt crashes en is een beveiligingsrisico.');
        }
        
        alert('Je hebt jscript.dll versie '+major+'.'+minor+'.'+build);
    } else {
        alert('Geen Internet Explorer.');
    }
*/
