﻿// Set global browser boolean flags

var isIE	= document.all;
var isIE7	= isIE && window.XMLHttpRequest &&
         	  window.ActiveXObject;
var isIE6	= isIE && document.implementation;
var isgteIE6	= isIE7 || isIE6;
var isIE5	= isIE && window.print && !isgteIE6;
var isIEDOM2	= isIE5 || isgteIE6;
var isIE4	= isIE && !isIEDOM2 &&
         	  navigator.cookieEnabled;
var isIE3	= isIE && !isIE4 && !isIEDOM2;
var isNS	= navigator.mimeTypes && !isIE;
var isNS3	= isNS && !navigator.language;
var isNS4	= document.layers;
var isNS6	= document.getElementById && !isIE;
var isNS7	= isNS6;
var isNS71	= document.designMode;
var isNSDOM2	= isNS6;
var isDOM2	= isIEDOM2 || isNSDOM2;

/*-----------------------------------------------------------------------------
 * Navigator
 *  Example Source
	document.write(
		(Navigator.isWinIE())  ? 'IE' + Navigator.isWinIE() + ' (Win)' :
		(Navigator.isMacIE())  ? 'IE' + Navigator.isMacIE() + ' (Mac)' :
		(Navigator.isGecko())  ? 'Mozilla (' + Navigator.isGecko() + ')' :
		(Navigator.isSafari()) ? 'Safari (' + Navigator.isSafari() + ')' :
		(Navigator.isKDE())    ? 'KDE (' + Navigator.isKDE() + ')' :
		(Navigator.isOpera())  ? 'Opera' + Navigator.isOpera() :
		(Navigator.isNN4())    ? 'NN4' :
		"I don't know."
	);
 *-------------------------------------------------------------------------- */

var Navigator = {
	_getVersion: function (a, b) {
		var t = navigator.userAgent.split(a)[1];
		return (t) ? t.split(b)[0] : false;
	},
	isOpera: function () {
		return (
			(window.opera) ?
				(document.createElementNS) ?
					(document.createCDATASection) ?
						(document.styleSheets) ? 9 : 8
					: 7
				: 6
			: false
		);
	},
	isSafari: function () {
		return (document.createCDATASection && document.createElementNS) ? Navigator._getVersion('AppleWebKit/', '(') : false;
	},
	isKDE: function () {
		return (document.createCDATASection && document.createElementNS) ? Navigator._getVersion('Konqueror/', ';') : false;
	},
	isGecko: function () {
		return (document.createCDATASection && document.createElementNS) ? Navigator._getVersion('Gecko/', ' ') : false;
	},
	isNN4: function () {
		return (document.layers && typeof document.layers == 'object') ? true : false;
	},
	isWinIE: function () {
		return (
			/*@cc_on @if (@_win64 || @_win32 || @_win16)
			(document.getElementsByTagName) ?
				(@_jscript_version > 5.6) ? 7 :
				(@_jscript_version == 5.6) ? 6 :
				(@_jscript_version == 5.5) ? 5.5 :
				5
			: 4
			@else@*/false/*@end @*/
		);
	},
	isMacIE: function () {
		return (
			/*@cc_on @if (@_mac && (@_PowerPC || @_mc680x0))
				(document.getElementsByTagName) ? 5 : 4
			@else@*/false/*@end @*/
		);
	}
};