// Coded by Travis Beckham, modified by Teevio
// http://www.squidfingers.com | http://www.podlob.com
// If want to use this code, feel free to do so, but please leave this message intact
tooltip = { name: "pic_tooltips", offsetX: -230, offsetY: -20, tip: null };
tooltip.init = function () {
	if (document.getElementById) {
		//create tip
		this.tip = document.getElementById(this.name);
		
		//assign functions
		var anchors = document.getElementsByTagName("a");
		for (var i = 0; i < anchors.length; i ++) { 
			if (anchors[i].className == "tooltip") {
				anchors[i].onmouseover = function () {
					tooltip.show(this.name);
				};
				anchors[i].onmouseout = function () {
					tooltip.hide();
				};
			}
		}
	}
};
tooltip.move = function (evt) {
	if (this.tip) {
		if (this.tip.style.visibility != 'visible' || this.tip.style.display != "block") {
			this.tip.style.visibility = "visible";
			this.tip.style.display = "block";
		}
		
		var x = 0;
		var y = 0;
		if (document.all) {
			x = (document.documentElement && document.documentElement.scrollLeft) ? document.documentElement.scrollLeft : document.body.scrollLeft;
			y = (document.documentElement && document.documentElement.scrollTop) ? document.documentElement.scrollTop : document.body.scrollTop;
			x += window.event.clientX;
			y += window.event.clientY;
		} else {
			x = evt.pageX;
			y = evt.pageY;
		}
		
		this.tip.style.left = (x + this.offsetX) + "px";
		this.tip.style.top = (y + this.offsetY) + "px";
	}
};
tooltip.show = function(text) {
	if (this.tip) {
		document.onmousemove = function(evt) { tooltip.move(evt) };
		this.tip.innerHTML = ''+text+'';
	}
};
tooltip.hide = function () {
	if (this.tip) {
		this.tip.style.visibility = "hidden";
		this.tip.style.display = "none";
		this.tip.innerHTML = "";
		document.onmousemove = '';
	}
};
window.onload = function () {
	tooltip.init();
}