function Is() {
	var appName = navigator.appName.toLowerCase();
	var version = navigator.appVersion.toLowerCase();
	var agent   = navigator.userAgent.toLowerCase();
	var platform = navigator.platform.toLowerCase();
	this.major = parseInt(version);
	this.minor = parseFloat(version);
	this.nsa = (agent.indexOf('netscape') != -1);
	this.mza = (agent.indexOf('mozilla') != -1);
	this.gla = (agent.indexOf('galeon') != -1);
	this.mza = (this.mza && !this.nsa);

	if (this.mza) {
		version = agent.substring(agent.indexOf("rv:")+3,agent.indexOf(")"));
		this.nsa = false;
		if (agent.indexOf("rv:") != -1) {
			this.major = parseInt(version);
			this.minor = parseFloat(version);
			this.mz1 = (this.mza && (this.major == 1));
		} else {
			this.mza = false;
			version = this.minor;
		}
	}

  	if (this.gla) {
  		version = agent.substring(agent.indexOf("galeon/")+7,agent.indexOf("(")-1);
  		this.nsa = false;
  		if (agent.indexOf("galeon/") != -1) {
  			this.major = parseInt(version);
  			this.minor = parseFloat(version);
  			this.gl1 = (this.gla && (this.major == 1));
  		} else {
  			this.gla = false;
  			version = this.version;
  		}
  	}

	this.version = version;

	this.nsn = (appName.indexOf('netscape') != -1);
	this.ns2 = (this.nsn && (this.major == 2));
	this.ns3 = (this.nsn && (this.major == 3));
	this.ns4 = (this.nsn && (this.major == 4));
	this.ns6 = (this.nsa && (this.major >= 5));
	if (this.ns6) {
		this.version = agent.slice(agent.indexOf("netscape6/")+10,agent.length);
	}

	this.ie = ((appName.indexOf("internet explorer") != -1)
		&& (agent.indexOf("opera") == -1));
	this.ie3 = (this.ie && (this.major == 3));
	this.ie4 = (this.ie && (this.major == 4)
		&& (agent.indexOf("msie 4.") != -1));
	this.ie5 = (this.ie && (this.major == 4)
		&& (agent.indexOf("msie 5.") != -1));
	this.ie6 = (this.ie && (this.major == 4)
		&& (agent.indexOf("msie 6.") != -1));
	if (this.ie4 || this.ie5 || this.ie6) {
		this.version = agent.slice(agent.indexOf("msie ")+5,agent.length);
		this.version = this.version.slice(0,this.version.indexOf(";"));
	}
	this.ieX = (this.ie && !this.ie3 && !this.ie4);

	this.op  = (agent.indexOf('opera') != -1);
	this.op4 = (this.op && (this.major == 4)
		&& (agent.indexOf("opera 4.") != -1));
	this.op5 = (this.op && (this.major == 4)
		&& (agent.indexOf("opera 5.") != -1));
	this.op6 = (this.op && (this.major == 4)
		&& (agent.indexOf("opera 6.") != -1));
	if (this.op) {
		this.ie = false;
		this.ie4 = false;
		this.ie5 = false;
		this.ie6 = false;
		this.version = agent.slice(agent.indexOf("opera")+6,agent.length)
		this.version = parseFloat(this.version);
	}

	this.kq  = (agent.indexOf("konqueror") != -1);
	if (this.kq) {
		this.version = agent.substring(agent.indexOf("konqueror/")+10,agent.length);
		this.version = this.version.substring(0,this.version.indexOf(";"));
		this.major = parseInt(this.version);
		this.minor = parseFloat(this.version);
		this.mza = false;
	}
	this.kq2 = (this.kq && (this.major == 2));
	this.kq3 = (this.kq && (this.major == 3));

	this.w3c = (!(!(document.getElementById)));
	this.win32 = (platform.indexOf("win32") != -1);
	this.linux = (platform.indexOf("linux") != -1);
	this.bsd   = (platform.indexOf("bsd") != -1);
}

var is = new Is();

function setTagFontColor(tag, color) {

	if (is.ie4 || is.w3c) {
		tag.style.color = color;
	} else if (is.ns4) {
		tag.color = color;
	} else {
		return;
	}
}

function setTagFontStyle(tag, style) {

	if (is.ie4 || is.w3c) {
		tag.style.fontStyle = style;
	} else if (is.ns4) {
		tag.fontStyle = style;
	} else {
		return;
	}
}

function mousePosLeft(event) {

	var leftPos;

	if (is.ie4 || (is.w3c && !(is.ns6 || is.mza))) {
		leftPos = event.clientX;
		//alert("event.clientX = " + event.clientX);
	} else if (is.ns4 || is.ns6 || is.mza) {
		leftPos = event.pageX;
	}
	return leftPos;
}

function mousePosTop(event) {

	var topPos;

	if (is.ie4 || (is.w3c && !(is.ns6 || is.mza))) {
		topPos = event.clientY;
		//alert("mousePosTop is clientY = " + event.clientY);
	} else if (is.ns4 || is.ns6 || is.mza) {
		topPos = event.pageY;
		//alert("mousePosTop is pageX = " + event.pageX);
	}
	return topPos;
}