/*
 * JTip
 */

//on page load (as soon as its ready) call JT_init
function JT_show(linkId, title){
	//alert ("Got in!");
	if(title == false)title="&nbsp;";
	var de = document.documentElement;
	var w = self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
	var hasArea = w - getAbsoluteLeft(linkId);
	var clickElementy = getAbsoluteTop(linkId) - 24;
	$("body").append("<div id='JT'><div id='JT_copy'></div></div>");
	$('#JT_copy').html(title);
	var arrowOffset = 0 - getElementWidth("JT") + getElementWidth(linkId) + 20;
	var clickElementx = getAbsoluteLeft(linkId) + arrowOffset; //set x position
	$('#JT').css({left: clickElementx+"px", top: clickElementy+"px"});
	$('#JT').show();
}


function getElementWidth(objectId) {
	x = document.getElementById(objectId);
	return x.offsetWidth;
}

