
<!-- //

/*******************************************************************************
  ENVIROMENT
*******************************************************************************/

function env() {

	var self = this;

	this.browser = checkBrowser();
	
	this.isIE = (self.browser.match(/ie/) !== null);

	this.flashVer = checkFlash();
	
	this.os = checkOS();

	
	
	function checkOS() {
		
		var agt = navigator.userAgent.toLowerCase();
		
		if (agt.indexOf("macintosh") != -1) return "mac";
		if (agt.indexOf("windows") != -1) return "win";
		
		return null;
	}


	function checkBrowser() {

		var agt = navigator.userAgent.toLowerCase();
	
		if (agt.indexOf("msie 8.0") != -1) return "ie8";
		if (agt.indexOf("msie 7.0") != -1) return "ie7";
		if (agt.indexOf("msie 6.0") != -1) return "ie6";
		if (agt.indexOf("firefox") != -1) return "firefox";
		if (agt.indexOf("safari/4") != -1) return "safari";
		if (agt.indexOf("safari/5") != -1) return "safari"; 
		if (agt.indexOf("safari") != -1) return "safari"; 
		if ((agt.indexOf("netscape/8") != -1) && (agt.indexOf("msie") != -1)) return "ns8-ie";
		if ((agt.indexOf("netscape/8") != -1) && (agt.indexOf("msie") == -1)) return "ns8-gecko";
		if (agt.indexOf("netscape/7") != -1) return "ns7";
		if (agt.indexOf("opera") != -1) return "opera";
		if (agt.indexOf("camino") != -1) return "camino";
		return null;
	}
	
	
	
	function checkFlash() {

		if (self.browser.match(/ie/) !== null) {
			
			if (typeof window.ActiveXObject != 'UNDEFINED') {

				var v = 0;
				var d = null;
				var a = null;
				var crash = false;
				
				try {
					
					a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
				}
				
				catch(e) {
				
					try { 
						
						a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
						v = [6,0,21];
						a.AllowScriptAccess = "always";
					}
					
					catch(e) {
						
						if (v[0] == 6) crash = true;
					}
					
					if (!crash) {
						
						try {
							
							a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
						}
						
						catch(e) {}
					}
				}
				
				if (!crash && a) { 

					try {
						
						d = a.GetVariable("$version");	
						if (d) return parseInt(d.split(" ")[1].split(",")[0]);
					}
					
					catch(e) {}
				}
			}
		}
		
		
		else {
			
			for (var i=0; i<navigator.plugins.length; i++) {
				
				if (navigator.plugins[i]['name'] == 'Shockwave Flash') {
				
					return navigator.plugins[i]['description'].split('Shockwave Flash ')[1].split('.')[0];
				}
			}
			
		}
	
		return 0;
	}
	

}

var env = new env();

// -->
