/*
###################################################################
#This javascript was made on January 31, 2003.
#It is responsible for a MEDAL Co,Ltd.
#Responsibility is not taken although use is free.
###################################################################
#Environment(browser name & varsion) check constructor &  method
###################################################################
*/

function Is_env(){
	/* os check */
	this.MAC = (navigator.userAgent.indexOf("Mac") != -1);
	this.MAC68K = (this.MAC && (navigator.userAgent.indexOf("68") != -1)); //Mac 68000, 68K
	this.PPC = (this.MAC && (navigator.userAgent.indexOf("PC") != -1)); //Mac_PowerPC, Mac PowerPC, PPC
	this.OSX = (this.PPC && (navigator.userAgent.indexOf("OS X") != -1)); //Mac OSX
	this.INTEL = (this.MAC && (navigator.userAgent.indexOf("Intel") != -1) && this.OSX); //Intel Mac OSX
	this.WIN = (navigator.userAgent.indexOf("Win") != -1);
	this.UNIX = (navigator.userAgent.indexOf("X11") != -1);
	this.LINUX = (this.UNIX && (navigator.userAgent.indexOf("Linux") != -1));
	this.SUNOS = (this.UNIX && (navigator.userAgent.indexOf("SunOS") != -1));

	this.GECKO = (navigator.userAgent.indexOf("Gecko") != -1);
	this.NETSCAPE = (navigator.userAgent.indexOf("Netscape") != -1);
	this.MICROSOFT = (navigator.appName.indexOf("Microsoft") != -1);

	this.LAYERS = (document.layers);
	this.DOCUMENT_ALL = (document.all);
	this.GET_ELEMENT_ID = (document.getElementById);

	if(window.ActiveXObject){
		try {
			this.XML_HTTP_REQUEST = (new ActiveXObject("Msxml2.XMLHTTP")) ? true : false;
		}catch(e){
			try {
				this.XML_HTTP_REQUEST = (new ActiveXObject("Microsoft.XMLHTTP")) ? true : false;
			} catch (e2){}
		}
	}else{
		this.XML_HTTP_REQUEST = window.XMLHttpRequest;
	}
	this.ROUTEEVENT = document.routeEvent;
	this.EVALUATE = document.evaluate;
	this.UNIQUEID = window.uniqueID;
	this.CREATEPOPUP = window.createPopup;

	/* version check */
	this.major = parseInt( navigator.appVersion );
	this.miner = parseFloat( navigator.appVersion );
	this.VENDOR = (navigator.vendorSub);

	//sniffer
	this.NN4_LOWER = (document.layers) ? true : false;
	this.NN6_UPPER = (document.getElementById && !document.all) ? true : false;
	this.IE4_LOWER = (document.all) ? true : false;
	this.IE5_UPPER = (document.getElementById && document.all) ? true : false;

	/* browser check */
	//netscape
	this.NN = (navigator.appName.charAt(0)=="N");
	this.IS_MOZILLA = (navigator.userAgent.indexOf('Mozilla')!=-1);

	this.NN3X = (this.NN && (this.major<=3) && this.IS_MOZILLA);
	this.NN4X = (this.NN && (this.major==4) && this.IS_MOZILLA);
	//this.NN401 = (this.NN4X && (this.miner==4.01));
	//this.NN403 = (this.NN4X && (this.miner==4.03));
	//this.NN404 = (this.NN4X && (this.miner==4.04));
	//this.NN405 = (this.NN4X && (this.miner==4.05));
	//this.NN406 = (this.NN4X && (this.miner==4.06));
	this.NN40X_LOW = (this.NN4X && (this.miner<=4.06));
	//this.NN45X_UP  = (this.NN4X && (this.miner>=4.5));
	//this.NN45X = (this.NN4X && (navigator.userAgent.indexOf("4.5") != -1));
	//for_english_&_UNIX_version_only
	//this.NN46X = (this.NN4X && (navigator.userAgent.indexOf("4.6") != -1));
	//this.NN47X = (this.NN4X (navigator.userAgent.indexOf("4.7") != -1));
	//this.NN470 = (this.NN4X && (this.miner==4.7));
	//this.NN473 = (this.NN4X && (this.miner==4.73));
	//this.NN475 = (this.NN4X && (this.miner==4.75));
	//this.NN478 = (this.NN4X && (this.miner==4.78));
	//not_japanese_version
	//this.NN48X = (this.NN4X && (this.miner==4.8));
	this.NN6X_UP = (this.NN && (this.major==5) && this.IS_MOZILLA || (parseInt(this.getBrowserVersion()) >= 6));
	this.NN6X = (this.NN && (this.major==5) && this.IS_MOZILLA && (navigator.userAgent.indexOf("Netscape6/") != -1) && this.VENDOR);
	//this.NN60 = (this.NN6X && (navigator.userAgent.indexOf("6.0") != -1));
	//this.NN601 = (this.NN6X && (navigator.userAgent.indexOf("6.01") != -1));
	//this.NN61 = (this.NN6X && (navigator.userAgent.indexOf("6.1") != -1));
	//this.NN62 = (this.NN6X (navigator.userAgent.indexOf("6.2") != -1));
	//this.NN621 = (this.NN6X && (navigator.userAgent.indexOf("6.2.1") != -1));
	//this.NN623 = (this.NN6X && (navigator.userAgent.indexOf("6.2.3") != -1));
	this.NN7X = (this.NN && (this.major==5) && this.IS_MOZILLA && (navigator.userAgent.indexOf("Netscape/7") != -1) && this.VENDOR);
	//this.NN70X = (this.NN7X &&  (navigator.vendorSub == "7.0"));
	//this.NN701 = (this.NN7X && (navigator.vendorSub == "7.01"));
	//this.NN702 = (this.NN7X && (navigator.vendorSub == "7.02"));
	//this.NN71X = (this.NN7X && (navigator.vendorSub == "7.1"));
	//this.NN72X = (this.NN7X && (navigator.vendorSub == "7.2"));
	//this.NN80B = (this.NN && (this.major>=5) && this.GECKO || (navigator.userAgent.indexOf("rv:1.7.5") != -1));
	this.NN8X = (this.NN && (this.major>=5) && this.GECKO && (navigator.userAgent.indexOf("Netscape/8") != -1) && this.VENDOR);
	//this.NN801 = (this.NN8X && (navigator.userAgent.indexOf("8.0.1") != -1) || (navigator.vendorSub == "8.0.1"));
	//this.NN802 = (this.NN8X && (navigator.userAgent.indexOf("8.0.2") != -1) || (navigator.vendorSub == "8.0.2"));
	//this.NN8033 = (this.NN8X && (navigator.userAgent.indexOf("8.0.3.3") != -1) || (navigator.vendorSub == "8.0.3.3"));
	//this.NN804 = (this.NN8X && (navigator.userAgent.indexOf("8.0.4") != -1) || (navigator.vendorSub == "8.0.4"));
	//this.NN81 = (this.NN8X && (navigator.userAgent.indexOf("8.1") != -1) || (navigator.vendorSub == "8.1"));
	//this.NN813 = (this.NN8X && (navigator.userAgent.indexOf("8.13") != -1));
	this.NN9X = (this.NN && (this.major>=5) && this.GECKO && (navigator.userAgent.indexOf("Netscape/9") != -1) && !this.VENDOR);
	//this.NN9BX = (this.NN9X && (navigator.userAgent.indexOf("9.0b3") != -1) || (navigator.userAgent.indexOf("rv:1.8.1.7") != -1));
	//this.NN9001X = (this.NN9X && (navigator.userAgent.indexOf("9.0.0.1") != -1) || (navigator.userAgent.indexOf("rv:1.8.1.8") != -1));
	//this.NN9002X = (this.NN9X && (navigator.userAgent.indexOf("9.0.0.2") != -1) || (navigator.userAgent.indexOf("rv:1.8.1.8") != -1));
	//this.NN9003X = (this.NN9X && (navigator.userAgent.indexOf("9.0.0.3") != -1) || (navigator.userAgent.indexOf("rv:1.8.1.9") != -1));
	//this.NN9004X = (this.NN9X && (navigator.userAgent.indexOf("9.0.0.4") != -1) || (navigator.userAgent.indexOf("rv:1.8.1.10") != -1));
	//this.NN9005X = (this.NN9X && (navigator.userAgent.indexOf("9.0.0.5") != -1) || (navigator.userAgent.indexOf("rv:1.8.1.11") != -1));
	//this.NN9006X = (this.NN9X && (navigator.userAgent.indexOf("9.0.0.6") != -1) || (navigator.userAgent.indexOf("rv:1.8.1.12") != -1));

	//ie
	this.EXPLORER = (navigator.appName.charAt(0)=="M");
	this.COMPATI  = (navigator.userAgent.indexOf("compatible") != -1);
	this.IS_MSIE  = (navigator.userAgent.indexOf('MSIE')!=-1);
	this.IE = (this.EXPLORER && this.COMPATI && this.IS_MSIE);

	//Is WinIE6 self-styled severity Mode
	this.CSS1COMP = (document.compatMode == "CSS1Compat");
	//Downward compatibility mode
	this.BACKCOMP = (document.compatMode == "BackCompat");

	this.IE3X = (this.IE && (this.major<4));
	this.IE4X = (this.IE && (this.major==4) && (navigator.userAgent.indexOf("MSIE 4") != -1));
	this.IE45 = (this.IE4X && this.MAC && (navigator.userAgent.indexOf("4.5") != -1));
	this.IE5X = (this.IE && (this.major==4) && (navigator.userAgent.indexOf("MSIE 5") != -1));
	this.IE5X_LOW = (this.IE && parseInt(this.getBrowserVersion()) < 5 );
	this.IE5X_UP = (this.IE && parseInt(this.getBrowserVersion()) >= 5 );
	this.IE501 = (this.WIN && this.IE5X && (navigator.userAgent.indexOf("5.01") != -1));
	this.IE51X = (this.IE5X && this.MAC && this.PPC && (navigator.userAgent.indexOf("5.1") != -1));
	//this.IE516 = (this.IE5X && this.PPC && (navigator.userAgent.indexOf("5.16") != -1));
	//this.IE517 = (this.IE5X && this.PPC && (navigator.userAgent.indexOf("5.17") != -1));
	this.IE52X = (this.IE5X && this.MAC && this.PPC && (navigator.userAgent.indexOf("5.2") != -1));
	//this.IE522 = (this.IE5X && this.PPC && (navigator.userAgent.indexOf("5.22") != -1));
	//this.IE523 = (this.IE5X && this.PPC && (navigator.userAgent.indexOf("5.23") != -1));
	this.IE55X = (this.IE5X && (navigator.userAgent.indexOf("5.5") != -1));
	this.IE6X_LOW = (this.IE && parseInt(this.getBrowserVersion()) < 6 );
	this.IE6X_UP = (this.IE && parseInt(this.getBrowserVersion()) >= 6 );
	this.IE6X = (this.IE && (this.major==4) && (navigator.userAgent.indexOf("MSIE 6") != -1));
	this.IE7X = (this.IE && (this.major==4) && (navigator.userAgent.indexOf("MSIE 7") != -1));
	this.IE8X = (this.IS_MOZILLA && this.IS_MSIE && (this.major==4) && (navigator.userAgent.indexOf("MSIE 8") != -1));

	//mozilla
	this.MOZILLA = (this.GECKO && !this.NETSCAPE);
	//this.MOZI_11X = (this.MOZILLA && (navigator.userAgent.indexOf("rv:1.1") != -1));
	//this.MOZI_12X = (this.MOZILLA && (navigator.userAgent.indexOf("rv:1.2") != -1));
	//this.MOZI_14X = (this.MOZILLA && (navigator.userAgent.indexOf("rv:1.4") != -1));
	//this.MOZI_15X = (this.MOZILLA && (navigator.userAgent.indexOf("rv:1.5") != -1));
	//this.MOZI_16X = (this.MOZILLA && (navigator.userAgent.indexOf("rv:1.6") != -1));
	//this.MOZI_171 = (this.MOZILLA && (navigator.userAgent.indexOf("rv:1.7.1") != -1));
	//this.MOZI_175 = (this.MOZILLA && (navigator.userAgent.indexOf("rv:1.7.5") != -1));

	//opera
	this.OPERA = ((window.opera)||(this.COMPATI && (navigator.userAgent.indexOf("Opera") != -1)) && !this.VENDOR);
	this.OPERA5XLOW =(this.OPERA && !(document.plugins) && !(document.getElementById));
	this.OPERA6X =(this.OPERA && !(document.plugins) && (document.getElementById));
	this.OPERA7X =(this.OPERA && (document.plugins) && (document.getElementById) && !(document.createCDATASection));
	this.OPERA8X =(this.OPERA && (document.plugins) && (document.getElementById) && (document.createCDATASection) && !(window.Audio));
	this.OPERA9X =(this.OPERA && (document.plugins) && (document.getElementById) && (document.createCDATASection) && (window.Audio));
	//this.OPERA801X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("8.01") != -1));
	//this.OPERA85X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("8.5") != -1));
	//this.OPERA852X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("8.52") != -1));
	//this.OPERA854X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("8.54") != -1));
	//this.OPERA90X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.00") != -1));
	//this.OPERA902X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.02") != -1));
	//this.OPERA910X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.10") != -1));
	//this.OPERA920X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.20") != -1));
	//this.OPERA921X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.21") != -1));
	//this.OPERA922X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.22") != -1));
	//this.OPERA923X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.23") != -1));
	//this.OPERA924X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.24") != -1));
	//this.OPERA925X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.25") != -1));
	//this.OPERA926X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.26") != -1));
	//this.OPERA927X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.27") != -1));
	//this.OPERA950X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.50") != -1));
	//this.OPERA951X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.51") != -1));
	//this.OPERA952X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.52") != -1));
	//this.OPERA960X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.6") != -1));
	//this.OPERA963X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.63") != -1));
	//this.OPERA964X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("9.64") != -1));
	//this.OPERA10X =(this.OPERA && (document.plugins) && (navigator.userAgent.indexOf("Version/10") != -1));

	//firefox
	//this.FIREBIRD = (this.GECKO && (navigator.userAgent.indexOf("Firebird/") != -1));
	this.FIREFOX = (this.MOZILLA && (navigator.userAgent.indexOf("Firefox/") != -1) || this.VENDOR || this.XML_HTTP_REQUEST && this.ROUTEEVENT);
	//this.FIREFOX08X = this.FIREFOX && (navigator.vendorSub == "0.8") && (navigator.userAgent.indexOf("rv:1.6") != -1);
	//this.FIREFOX08X = this.FIREFOX && (navigator.vendorSub == "0.9");
	//this.FIREFOX09X = this.FIREFOX && (navigator.vendorSub == "0.9.2") && (navigator.userAgent.indexOf("rv:1.7") != -1);
	//this.FIREFOX09X = this.FIREFOX && (navigator.vendorSub == "0.9.3");
	//this.FIREFOX10X = this.FIREFOX && (navigator.vendorSub == "1.0") && (navigator.userAgent.indexOf("rv:1.7.5") != -1);
	//this.FIREFOX106X = this.FIREFOX && (navigator.vendorSub == "1.0.6") && (navigator.userAgent.indexOf("rv:1.7.10") != -1);
	//this.FIREFOX154X = this.FIREFOX && (navigator.userAgent.indexOf("1.5.0.4") != -1) && (navigator.userAgent.indexOf("rv:1.8.0.4") != -1);
	//this.FIREFOX155X = this.FIREFOX && (navigator.userAgent.indexOf("1.5.0.5") != -1) && (navigator.userAgent.indexOf("rv:1.8.0.5") != -1);
	//this.FIREFOX156X = this.FIREFOX && (navigator.userAgent.indexOf("1.5.0.6") != -1) && (navigator.userAgent.indexOf("rv:1.8.0.6") != -1);
	//this.FIREFOX157X = this.FIREFOX && (navigator.userAgent.indexOf("1.5.0.7") != -1) && (navigator.userAgent.indexOf("rv:1.8.0.7") != -1);
	//this.FIREFOX157X = this.FIREFOX && (navigator.userAgent.indexOf("1.5.0.8") != -1) && (navigator.userAgent.indexOf("rv:1.8.0.8") != -1);
	//this.FIREFOX20BX = this.FIREFOX && (navigator.userAgent.indexOf("2.0b1") != -1) && (navigator.userAgent.indexOf("rv:1.8.1b1") != -1);
	//this.FIREFOX20X = this.FIREFOX && (navigator.userAgent.indexOf("2.0") != -1) && (navigator.userAgent.indexOf("rv:1.8.1") != -1);
	//this.FIREFOX2003X = this.FIREFOX && (navigator.userAgent.indexOf("2.0.0.3") != -1) && (navigator.userAgent.indexOf("rv:1.8.1.3") != -1);
	//this.FIREFOX2007X = this.FIREFOX && (navigator.userAgent.indexOf("2.0.0.7") != -1) && (navigator.userAgent.indexOf("rv:1.8.1.7") != -1);
	//this.FIREFOX301X = this.FIREFOX && (navigator.userAgent.indexOf("3.0.1") != -1) && (navigator.userAgent.indexOf("rv:1.9.0.1") != -1) && (navigator.userAgent.indexOf("SPOENP/1.0") != -1);
	//this.FIREFOX303X = this.FIREFOX && (navigator.userAgent.indexOf("3.0.3") != -1) && (navigator.userAgent.indexOf("rv:1.9.0.3") != -1) && (navigator.userAgent.indexOf("SPOENP/1.0") != -1);
	//this.FIREFOX304X = this.FIREFOX && (navigator.userAgent.indexOf("3.0.4") != -1) && (navigator.userAgent.indexOf("rv:1.9.0.4") != -1) && (navigator.userAgent.indexOf("SPOENP/1.0") != -1);
	//this.FIREFOX305X = this.FIREFOX && (navigator.userAgent.indexOf("3.0.5") != -1) && (navigator.userAgent.indexOf("rv:1.9.0.5") != -1) && (navigator.userAgent.indexOf("SPOENP/1.0") != -1);
	//this.FIREFOX3010X = this.FIREFOX && (navigator.userAgent.indexOf("3.0.10") != -1) && (navigator.userAgent.indexOf("rv:1.9.0.10") != -1) && (navigator.userAgent.indexOf("SPOENP/1.0") != -1);


	//iCab
	this.ICAB_NAME = (navigator.appName.indexOf("iCab") != -1);
	this.ICAB_J = (navigator.userAgent.indexOf("iCab J") != -1);
	this.ICAB_MOZ45 = (navigator.userAgent.indexOf("iCab") != -1);
	this.ICAB_MOZ40 = (this.IS_MSIE && (this.major==5) && (this.miner==5));
	this.ICAB_MOZ476 =(!this.GECKO && !this.NETSCAPE && (navigator.userAgent.indexOf("Mozilla/4.76") != -1));
	this.ICAB = (this.COMPATI && this.ICAB_NAME || this.ICAB_MOZ45 || this.ICAB_MOZ40 || this.ICAB_J || this.ICAB_MOZ476);

	//other
	this.SAFARI = (this.GECKO && (navigator.userAgent.indexOf("KHTML") != -1) && (navigator.userAgent.indexOf("Safari/") != -1));
	//this.SAFARI_856 = this.SAFARI && (navigator.userAgent.indexOf("85.6") != -1);
	//this.SAFARI_857 = this.SAFARI && (navigator.userAgent.indexOf("85.7") != -1);
	//this.SAFARI_8581 = this.SAFARI && (navigator.userAgent.indexOf("85.8.1") != -1);
	//this.SAFARI_1001 = this.SAFARI && (navigator.userAgent.indexOf("100.1") != -1);
	//this.SAFARI_124 = this.SAFARI && (navigator.userAgent.indexOf("125.12") != -1);
	//this.SAFARI_1251 = this.SAFARI && (navigator.userAgent.indexOf("125.1") != -1);
	//this.SAFARI_1258 = this.SAFARI && (navigator.userAgent.indexOf("125.8") != -1);
	//this.SAFARI_1259 = this.SAFARI && (navigator.userAgent.indexOf("125.9") != -1);
	//this.SAFARI_13 = this.SAFARI && (navigator.userAgent.indexOf("312") != -1);
	//this.SAFARI_2X = this.SAFARI && (navigator.userAgent.indexOf("412") != -1);
	//this.SAFARI_3X = this.SAFARI && this.XML_HTTP_REQUEST && this.EVALUATE && !this.ROUTEEVENT;
	//this.SAFARI_4X = this.SAFARI && this.XML_HTTP_REQUEST && this.EVALUATE && !this.ROUTEEVENT;

	//Google Chrome
	this.CHROME = this.MOZILLA && this.SAFARI && (navigator.userAgent.indexOf("Chrome/") != -1);

	this.CAMINO = (this.OSX && this.GECKO && ((navigator.userAgent.indexOf("Chimera") != -1)));

	this.LUNASCAPE = this.COMPATI && (navigator.userAgent.indexOf("FunWebProducts") != -1);
	this.LUNASCAPE_MOZ = this.GECKO && (navigator.userAgent.indexOf("rv:1.7.2") != -1);

	this.GOOGLE_CHROME = this.MOZILLA && (navigator.userAgent.indexOf("KHTML") != -1) && (navigator.userAgent.indexOf("Chrome/") != -1);

	//this.OMNIWEB = (this.COMPATI && navigator.userAgent.indexOf("OmniWeb") != -1);
	//this.HOTJAVA = (navigator.userAgent.indexOf("HotJava") != -1);
	//this.WEBTV = (this.COMPATI && (avigator.userAgent.indexOf("WebTV") != -1));
}

Is_env.prototype.getBrowserName = function(){
	var userBrowser = "";

	if( this.FIREFOX ) userBrowser = "Firefox";
	else if( this.MOZILLA ) userBrowser = "Mozilla";
	else if( this.OPERA ) userBrowser = "Opera";
	else if( this.NN4_LOWER || this.NN6_UPPER ) userBrowser = "Netscape";
	else if( this.MICROSOFT ) userBrowser = "Explorer";
	else if( this.ICAB ) userBrowser = "iCab";
	else if( this.SAFARI ) userBrowser = "Safari";

	return userBrowser;
}

Is_env.prototype.getBrowserVersion = function(){
	var version    = "";
	var start      = 0;
	var end        = 0;
	var usrBrowser = this.getBrowserName();
	var usrAgent   = navigator.userAgent.toUpperCase();
	var appVersion = navigator.appVersion;
	
	if( this.MOZILLA ){ //Mozilla
		start   = usrAgent.indexOf("RV:") +3;
		end     = usrAgent.indexOf(")", start);
		version = usrAgent.substring(start, end);
	}else if( this.FIREFOX ){
		start   = usrAgent.indexOf("FIREFOX/",0) +8;
		end     = usrAgent.length;
		version = usrAgent.substring(start, end);
	}else if( this.NN4_LOWER ){
		start   = appVersion.indexOf(" ",0);
		version = appVersion.substring(0, start);
	}else if( this.NN6X_UP ){
		if(parseInt(appVersion) < 9){
			version = this.VENDOR;
		}else if(parseFloat(appVersion) >= 9){
			start   = usrAgent.indexOf("NAVIGATOR/",0) +10;
			end     = usrAgent.length;
			version = usrAgent.substring(start, end);
		}
	}else if( this.OPERA && (parseInt(appVersion) < 9)){
		start   = usrAgent.indexOf("OPERA ",0) +6;
		end     = usrAgent.indexOf(" ",start);
		version = usrAgent.substring(start, end);
	}else if( this.OPERA && (parseFloat(appVersion) >= 9)){
		start   = usrAgent.indexOf("OPERA",0) +6;
		end     = usrAgent.indexOf(" ",start);
		version = usrAgent.substring(start, end);
	}else if( this.IE ){
		start   = appVersion.indexOf("MSIE ",0) +5;
		end     = appVersion.indexOf(";",start);
		version = appVersion.substring(start, end);
	}else if( this.ICAB ){
		start   = usrAgent.indexOf("iCab ",0) +8;
		end     = usrAgent.indexOf("(",start);
		version = usrAgent.substring(start, end);
	}else if( this.SAFARI ){
		var ver = navigator.userAgent.split("/")[3];
		var n = eval(ver);
		if(n > 528) version = "4.0";
		if(n > 500) version = "3.0";
		if(n > 400) version = "2.0";
		if(n > 300) version = "1.3";
		if(n > 120) version = "1.2";
		if(n > 100) version = "1.1";
		if(n > 86)  version = "1.0";
	}else{
		return false;
	}

	return version;
}

Is_env.prototype.checkenv = function(){
	/* browser branch */
	if( this.MAC ){
		if( this.SAFARI ) return "mac_safari";
		else if( this.OPERA ) return "mac_opera";
		else if( this.MOZILLA ) return "mac_mozilla";
		else if( this.OSX && this.FIREFOX ) return "mac_firefox";
		else if( this.ICAB ) return "mac_icab";
		else if( this.IE3X ) return "mac_ie3_lower";
		else if( this.IE45 ) return "mac_ie45";
		else if( this.IE5X ) return "mac_ie5";
		else if( this.NN3X ) return "mac_ns3_lower";
		else if( this.NN4X ) return "mac_ns4";
		else if( this.NN6X ) return "mac_ns6";
		else if( this.NN7X ) return "mac_ns7";
		else if( this.NN8X ) return "mac_ns8";
		else if( this.NN9X ) return "mac_ns9";
	}else if( this.WIN ){
		if( this.OPERA ) return "win_opera";
		else if( this.MOZILLA ) return "win_mozilla";
		else if( this.FIREFOX ) return "win_firefox";
		else if( this.IE3X ) return "win_ie3_lower";
		else if( this.IE4X ) return "win_ie4";
		else if( this.IE5X ) return "win_ie5";
		else if( this.IE6X ) return "win_ie6";
		else if( this.IE7X ) return "win_ie7";
		else if( this.IE8X ) return "win_ie8";
		else if( this.NN3X ) return "win_ns3_lower";
		else if( this.NN4X ) return "win_ns4";
		else if( this.NN6X ) return "win_ns6";
		else if( this.NN7X ) return "win_ns7";
		else if( this.NN8X ) return "win_ns8";
		else if( this.NN9X ) return "win_ns9";
		else if( this.SAFARI ) return "win_safari";
	}else if( this.UNIX ){
		if( this.OPERA ) return "unix_opera";
		else if( this.MOZILLA ) return "unix_mozilla";
		else if( this.FIREFOX ) return "unix_firefox";
		else if( this.NN4X ) return "unix_ns4";
		else if( this.NN6X ) return "unix_ns6";
		else if( this.NN7X ) return "unix_ns7";
		else if( this.NN8X ) return "unix_ns8";
		else if( this.NN9X ) return "unix_ns9";
	}else{
		return "other_brws";
	}
}

Is_env.prototype.checkNN6UP = function(){
	//var varsion = navigator.vendorSub;
	var varsion = (parseInt(this.getBrowserVersion()) >= 6) ? true : false;
	if( this.NN6X_UP || this.FIREFOX ){
		if((varsion != "undefined")||(varsion != null)||(varsion != false)){
			return true;
		}
	}else{
		return false;
	}
}


/*
##########################################################################
#platform check constructor & method
#windows ME and XP have an inaccurate return value from NN4X or NN6.0.
########################################################################## 
*/
function Is_os(){
	var nv_usagnt = navigator.userAgent.toLowerCase();
	this.NN = (navigator.appName.charAt(0)=="N");
	this.IE = (navigator.appName.charAt(0)=="M");

	//Mac (68K, PPC, OSX, IntelMac)
	this.MAC = (nv_usagnt.indexOf("mac") != -1);
	this.MAC68K = (this.MAC && (nv_usagnt.indexOf("68") != -1)); //Mac 68000, 68K
	this.PPC = (this.MAC && (nv_usagnt.indexOf("pc") != -1)); //Mac_PowerPC, Mac PowerPC, PPC
	this.OSX = (this.MAC && (nv_usagnt.indexOf("os x") != -1));
	this.INTELMAC = (this.MAC && this.OSX && (nv_usagnt.indexOf("Intel") != -1)); //IntelMac

	//Windows 9x (95, 98)
	this.WIN = ((nv_usagnt.indexOf("win") != -1) || (nv_usagnt.indexOf("windows ") != -1));
	this.WIN95 = (this.WIN && (nv_usagnt.indexOf("95") != -1));
	this.WIN98 = (this.WIN && (nv_usagnt.indexOf("98") != -1));

	//Windows CE
	this.COMPATI = (nv_usagnt.indexOf("compatible") != -1);
	this.WINCE = (this.WIN && this.COMPATI && (nv_usagnt.indexOf("ce") != -1));

	//Windows Me
	this.ME = (this.WIN98 && (nv_usagnt.indexOf("9x 4.90") != -1)); //for ie only
	this.ME_N6 = (this.WIN && (nv_usagnt.indexOf("9x 4.90") != -1)); //for nn6Up or mozilla only
	this.ME_OP = (this.WIN && (nv_usagnt.indexOf("me") != -1)); //for Opera only
	this.WINME = (this.ME || this.ME_N6 || this.ME_OP);

	//Windows NT4
	this.NT = (this.WIN && (nv_usagnt.indexOf("nt") != -1)); //for opera, ie
	this.NT4 = (this.NT && (nv_usagnt.indexOf("nt 4.0") != -1)); //ie 5.5
	this.WINNT = (this.WIN && (nv_usagnt.indexOf("winnt") != -1)); //for nn4.7Up only
	this.NT4X = (this.NT || this.NT4 || this.WINNT);

	//Windows 2000 (NT5)
	this.NT5 = (this.NT && (nv_usagnt.indexOf("nt 5.0") != -1)); //for ie or nn6.1Up only
	this.WIN2K_OP = (this.WIN && (nv_usagnt.indexOf("2000") != -1)); //for Opera only
	this.WIN2K = (this.NT5 || this.WIN2K_OP);
	
	//Windows XP (NT5.1)
	this.NT51 = (this.NT && (nv_usagnt.indexOf("nt 5.1") != -1)); //for ie or nn6.1Up only
	this.OP_XP = (this.WIN && (nv_usagnt.indexOf("xp") != -1)); //for Opera only
	this.WINXP = (this.NT51 || this.OP_XP);

	//Windows XP SP1
	this.WINXP_SP1 = this.IE && this.NT51 && (navigator.appMinorVersion.indexOf("SP1") != -1);

	//Windows XP SP2
	this.WINXPSP2 = this.IE && (navigator.appMinorVersion.indexOf("SP2") != -1);
	this.WINXP_SP2 = (this.NT51 && (navigator.userAgent.indexOf("SV1") != -1) || this.WINXPSP2);

	//Windows XP SP3
	this.WINXPSP3 = this.IE && (navigator.appMinorVersion.indexOf("SP3") != -1);
	this.WINXP_SP3 = (this.NT51 && (navigator.userAgent.indexOf("SV1") != -1) || this.WINXPSP3);

	//Windows XP x64 Edition && Windows Server 2003
	this.NTX64 = (this.IE && this.NT && (nv_usagnt.indexOf("nt 5.2") != -1));

	//Windows Vista
	this.WINVISTA = (this.IE && this.NT && (nv_usagnt.indexOf("nt 6.0") != -1));

	//Windows 7
	this.WIN7 = (this.IE && this.NT && (nv_usagnt.indexOf("nt 6.1") != -1) && (navigator.userAgent.indexOf("MSIE 8") != -1));

	//UNIX for NN or mozilla or Opera
	this.UNIX = (nv_usagnt.indexOf("x11") != -1);
	this.LINUX = (this.UNIX && (nv_usagnt.indexOf("linux") != -1));
	this.SUNOS = (this.UNIX && (nv_usagnt.indexOf("sunos") != -1));
	this.HP_UX = (this.UNIX && (nv_usagnt.indexOf("hp-ux") != -1));
	this.OSF1 = (this.UNIX && (nv_usagnt.indexOf("osf1") != -1));
	this.FREEBSD = (this.UNIX && (nv_usagnt.indexOf("freebsd") != -1));
	this.NETBSD = (this.UNIX && (nv_usagnt.indexOf("netbsd") != -1));
	this.IRIX = (this.UNIX && (nv_usagnt.indexOf("irix") != -1));

}


Is_os.prototype.checkPlatform = function(){

	myPlatform = new Array(
		new Array("Mac68K","MacPPC","MacOSX","IntelMac"), //mac
		new Array("WinCE","Win95","Win98","WinMe","WinNT4","Win2000","WinXP","WinX64","WinVista","Win7"), //win
		new Array("Linux","SunOS","HP-UX","OSF1","FreeBSD","NetBSD","IRIX"), //unix
		new Array("otherOS") //other
	);

	if(this.MAC68K) return myPlatform[0][0];
	else if(this.INTEL) return myPlatform[0][3];
	else if(this.OSX) return myPlatform[0][2];
	else if(this.PPC) return myPlatform[0][1];

	else if(this.WINCE) return myPlatform[1][0];
	else if(this.WIN95) return myPlatform[1][1];
	else if(this.WINME) return myPlatform[1][3];
	else if(this.WIN98) return myPlatform[1][2];
	else if(this.WIN2K) return myPlatform[1][5];
	else if(this.WINXP) return myPlatform[1][6];
	else if(this.NTX64) return myPlatform[1][7];
	else if(this.WINVISTA) return myPlatform[1][8];
	else if(this.WIN7) return myPlatform[1][9];
	else if(this.NT4X) return myPlatform[1][4];

	else if(this.LINUX) return myPlatform[2][0];
	else if(this.SUNOS) return myPlatform[2][1];
	else if(this.HP_UX) return myPlatform[2][2];
	else if(this.OSF1) return myPlatform[2][3];
	else if(this.FREEBSD) return myPlatform[2][4];
	else if(this.NETBSD) return myPlatform[2][5];
	else if(this.IRIX) return myPlatform[2][6];

	else return myPlatform[3][0];
}

