function popitup(url, name, properties) {
	newwindow=window.open(url, name, properties);
	if (window.focus) {
		newwindow.focus()
	}
	return false;
}

$ = function(objId) {
	return document.getElementById(objId);
}

_fx = function () {
	this._id = 1;
	this._fx = new Array();
	
	this.addFx = function(object, clsNormal, clsHover, clsFocused, clsClicked) {
		this._fx[this._id] = new applyClassName(object, clsNormal, clsHover, clsFocused, clsClicked);
		++this._id;
	}
	
	this.clearMouseDown = function() {
		for (i = 1; i < this._fx.length; ++i) {
			this._fx[i]._beginMouseDown = false;
		}
	}
}

fx = new _fx();

applyClassName = function(object, clsNormal, clsHover, clsFocused, clsClicked) {
	if (!$(object)) {
		return;
	}
	
	this._object = $(object);
	this._clsNormal = clsNormal;
	this._clsHover = clsHover ;
	this._clsFocused = clsFocused;
	this._clsClicked = clsClicked;
	
	this._beginMouseDown = false;
	
	this._isHover = false;
	this._isClicked = false;
	this._isFocused = false;
	
	var oThis = this;
	
	this._object.className = this._clsNormal;
	
	this._object.onmouseoverOther = this._object.onmouseover;
	this._object.onmouseover = function() {
		try {
			oThis._object.onmouseoverOther();
		} catch(err){}
		oThis._isHover = true;
		if (oThis._beginMouseDown == true) {
			oThis._isClicked = true;
		}
		oThis.setClassName();
	}
	this._object.onmouseoutOther = this._object.onmouseout;
	this._object.onmouseout = function() {
		try {
			oThis._object.onmouseoutOther();
		} catch(err){}
		oThis._isHover = false;
		oThis._isClicked = false;
		oThis.setClassName();
	}
	this._object.onmousedownOther = this._object.onmousedown;
	this._object.onmousedown = function() {
		try {
			oThis._object.onmousedownOther();
		} catch(err){}
		oThis._isClicked = true;
		oThis._beginMouseDown = true;
		oThis.setClassName();
	}
	this._object.onmouseupOther = this._object.onmouseup;
	this._object.onmouseup = function() {
		try {
			oThis._object.onmouseupOther();
		} catch(err){}
		oThis._isClicked = false;
		oThis.setClassName();
	}
	this._object.onfocusOther = this._object.onfocus;
	this._object.onfocus = function() {
		try {
			oThis._object.onfocusOther();
		} catch(err){}
		oThis._isFocused = true;
		oThis.setClassName();
	}
	this._object.onblurOther = this._object.onblur;
	this._object.onblur = function() {
		try {
			oThis._object.onblurOther();
		} catch(err){}
		oThis._isFocused = false;
		oThis.setClassName();
	}
	this.setClassName = function() {
		this.temp0 = this._clsNormal;
		if (this._isHover == true) {
			this.temp0 = this.temp0 + ' ' + this._clsHover;
		}
		if (this._isFocused == true) {
			this.temp0 = this.temp0 + ' ' + this._clsFocused;
		}
		if (this._isClicked == true) {
			this.temp0 = this.temp0 + ' ' + this._clsClicked;
		}
		this._object.className = this.temp0;
	}
}

setMouseDown = function(event) {
	if (!event) {
		event = window.event;
	}
}