var d_tooltip = null;
function initialize_documentation_table() {
	var d_tooltip = document.getElementById("documentation-tooltip");
	d_tooltip.show = function(i) {
		clearTimeout(this.hideTimeout);
		if (this.currentI != i) {
			this.currentI = i;
			this.style.visibility = "hidden";
			this.style.display = "block";
			this.innerHTML = '<span>'+documentation_table_tooltip_labels[i]+'</span>';
			this.style.left = "0px";
			this.style.width = (this.offsetWidth - 10) + "px";
			this.style.left = (i*56+10)+"px";
			this.style.visibility = "visible";
		}
		else {
			this.style.display = "block";
		}
	}
	d_tooltip.hideDelay = function() {
		var extra = this;
		this.hideTimeout = setTimeout(function() {extra.hide();}, 100);
	}
	d_tooltip.hide = function() {
		this.style.display = "none";
	}
	d_tooltip.onmouseout = function() {
		this.hideDelay();
	}
	d_tooltip.onmouseover = function() {
		this.show(this.currentI);
	}
	var dt = document.getElementById("documentation-table");
	for (var i=0; i<dt.childNodes.length; i++) if (dt.childNodes[i].tagName == "TBODY") dt=dt.childNodes[i];
	for (var i=0; i<dt.childNodes.length; i++) {
		if (dt.childNodes[i].tagName == "TR") {
			for (var j=0; j<dt.childNodes[i].childNodes.length; j++) {
				if (dt.childNodes[i].childNodes[j].tagName == "TD") {
					if (dt.childNodes[i].childNodes[j].className == "logo") td_counter = -2;
					else if (dt.childNodes[i].childNodes[j].className == "name") td_counter = -1;
					if (td_counter >= 0) {
						dt.childNodes[i].childNodes[j].labelCounter = td_counter;
						dt.childNodes[i].childNodes[j].onmouseover = function() {
							d_tooltip.show(this.labelCounter);
						}
						dt.childNodes[i].childNodes[j].onmouseout = function() {
							d_tooltip.hide();
						}
					}
					td_counter++;
				}
			}
		}
	}
	var dth = document.getElementById("documentation-table-header");
	var counter = 0;
	for (var i=0; i<dth.childNodes.length; i++) {
		if (dth.childNodes[i].tagName == "DIV") {
			dth.childNodes[i].labelCounter = counter;
			dth.childNodes[i].onmouseover = function() {
				d_tooltip.show(this.labelCounter);
			}
			dth.childNodes[i].onmouseout = function() {
				d_tooltip.hide();
			}
			counter++;
		}
	}
}

