/*
 * JTip
 * By Cody Lindley (http://www.codylindley.com)
 * Under an Attribution, Share Alike License
 * JTip is built on top of the very light weight jquery library.
 */
 
/*Modification by Jack Born
(http://15daysofjquery.com)

// mod for Alzonline Steve Clay
*/

$(document).ready(function(){
	//alert($("#sideBar li a").size());
	$("#sideBar li a").hover(
		function(){
			if (this.id && this.id == 'toCEU') return;
			this.nicetitle = this.nicetitle || this.title || '';
			if (!this.nicetitle) {
				return;
			} else {
				this.title = '';
			}
			var 
				pos = getPosition(this);
			$("#container").append("<div id='JD'><div id='JDw'>" + this.nicetitle + "</div><div id='JDco'></div></div>");
			$('#JD').css({top: (pos.top - 7) + "px"});
			$('#JD').show();
		},
		function(){$('#JD').remove();}
	);
});

function getPosition(o) {
	oTop = o.offsetTop;
	oLeft = o.offsetLeft;
	while (o.offsetParent!=null) {
		oParent = o.offsetParent;
		oTop += oParent.offsetTop;
		oLeft += oParent.offsetLeft;
		o = oParent;
	}
	return {top:oTop, left:oLeft};
}