var vnum = navigator.appVersion.substring(0,1)
mac = false;
var n4 = (document.layers)? true:false;
var e4 = (document.all)? true:false;
var n6 = (document.getElementById)? true:false;
if (e4) n6=false;

// ---------get browser version-------------------------------------------------
function getAppVersion(){
	this.version=parseInt(navigator.appVersion);
	this.agent=navigator.userAgent.toLowerCase();
	this.platform=navigator.platform.toLowerCase();
	this.mac=(this.platform.indexOf('mac') != -1) ? 1 : 0;
	this.win=(this.platform.indexOf('win') != -1) ? 1 : 0;
	this.dom1=(document.getElementById) ? 1 : 0;
	this.dom2event=(document.addEventListener && document.removeEventListener) ? 1 : 0;

	this.op=((this.agent.indexOf('opera') != -1)||window.op) ? 1 : 0;;
	if (this.op){
		this.op5=this.agent.indexOf('opera 5') ? 1 : 0;
		this.op6=this.agent.indexOf('opera 6') ? 1 : 0;
		return this;
	}
	this.ie=((this.agent.indexOf('msie') != -1) && !this.op) ? 1 : 0;;
	if (this.ie){
		this.ie4=((this.agent.indexOf('msie 4') != -1) && !this.dom1) ? 1 :0;
		this.ie5=((this.agent.indexOf('msie 5') != -1) && this.dom1) ? 1 : 0;
		this.ie55=(this.ie5 && window.createPopup) ? 1 : 0;
		this.ie6=((this.agent.indexOf('msie 6') != -1) && this.dom1) ? 1 : 0;
		this.ie6s=(this.ie6 && (document.compatMode=="CSS1Compat")) ? 1 : 0;
		this.ie4up=(this.version >= 4) ? 1 : 0;
		this.ie5up=((this.version >= 4) && !this.ie4) ? 1 : 0;
		this.ie55up=((this.version >= 4) && !this.ie4 && !this.ie5) ? 1 : 0;
		this.ie6up=((this.version >= 4) && !this.ie4 && !this.ie55) ? 1 : 0;
		return this;
	}
	this.ns=	(((this.agent.indexOf('netscape') != -1)||
		(this.agent.indexOf('mozilla') != -1)) && !this.op) ? 1 : 0;
	if (this.ns){
		this.ns4=(document.layers && !this.dom1) ? 1 : 0;
		this.ns6=((this.version >= 5) && this.dom2event) ? 1 : 0;
		this.ns4up=(this.version >= 4) ? 1 : 0;
		this.ns6up=((this.version >= 5) && !this.ns4) ? 1 : 0;
		return this;
	}
	return this;
}
var appVer=new getAppVersion;


//---------  CSS files ---------------------------
//------ for Mac
if(navigator.userAgent.indexOf('Mac') != -1) {document.write('<LINK REL="stylesheet" TYPE="text/Css" HREF="css/mac.css" TITLE="CSS for Mac">');}
else{
//------ for Win IE
	if(e4){document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="css//basic.css" TITLE="CSS for Win-IE">');}
//------ for Win NS
	if(n4){document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="css/mac.css" TITLE="CSS for Win-NN">');document.close();}
	if(n6){document.write('<LINK REL="stylesheet" TYPE="text/css" HREF="css//basic.css" TITLE="CSS for Win-NN">');}
}
function errorhandle() {return true;}
//--------- CSS protection for NS ---------------------------
if (navigator.appName=="Netscape" && parseInt(navigator.appVersion)==4) {
	widthCheck = window.innerWidth
	heightCheck = window.innerHeight
	window.onResize = resizeFix
}
function resizeFix() {
	if (widthCheck != window.innerWidth || heightCheck != window.innerHeight)
	document.location.href = document.location.href
}

