<!--
function Hint(obj, attrName) {

	// user-defined settings
	this.className = 'customHint';
	this.textAttributeName = attrName;

	this.obj = obj;
	this.text = this.obj.getAttribute(this.textAttributeName);
	this.body = document.body;

	var oSelf = this;

	this.obj.setAttribute(this.textAttributeName, '');
	this.create();
	this.obj.onmouseout = function() {
		oSelf.destroy()
	}
}

Hint.prototype.create = function() {
	var textArr, i, position;

	this.cont = document.createElement('div');
	this.cont.className = this.className;

	textArr = this.text.split(/; /);
	for (i = 0; i < textArr.length; i++) {
		this.cont.appendChild(document.createTextNode(textArr[i]));
		if (i < textArr.length - 1)
			this.cont.appendChild(document.createElement('BR'));
	}

	this.cont.style.left = 0;
	this.cont.style.top = 0;
	this.body.appendChild(this.cont);

	position = this.getContPosition();
	this.cont.style.left = position.left + 'px';
	this.cont.style.top = position.top + 'px';
	this.cont.style.visibility = 'visible';
}

Hint.prototype.destroy = function() {
	this.obj.setAttribute(this.textAttributeName, this.text);
	this.body.removeChild(this.cont);
}

Hint.prototype.getContPosition = function() {

	var windowWidth, windowHeight, offset;
	var position = new Object;
	var offset = this.getAbsOffset(this.obj);

	position.left = offset.left + this.obj.offsetWidth + 10;
	position.top = offset.top;

	if (window.innerWidth) {
		windowWidth = window.innerWidth;
		windowHeight = window.innerHeight;
	} else {
		windowWidth = document.body.clientWidth;
		windowHeight = document.body.clientHeight;
	}

	var correctX = windowWidth < position.left + this.cont.offsetWidth;
	var correctY = windowHeight < position.top + this.cont.offsetHeight;

	if (correctX) {
		position.left -= this.cont.offsetWidth;
		position.top += this.obj.offsetHeight + 10;
	}

	return position;
}

Hint.prototype.getAbsOffset = function(el) {
	var offset = new Object;
	offset.left = 0;
	offset.top = 0;

	for (var temp = el; temp.offsetParent; temp = temp.offsetParent) {
		offset.left += temp.offsetLeft;
		offset.top += temp.offsetTop;
	}
	return offset;
}

//-->