var loadstatustext="Requesting content..."
var TTxmlHttp = false;
var tTipDiv = false;
var tTipContent = false;

function TTcreateXmlHttp() {
	if (window.ActiveXObject)
		TTxmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	else if (window.XMLHttpRequest) {
		TTxmlHttp = new XMLHttpRequest();
	}
}

function toolTip(fileName, url){
	var fname=fileName;
	var location=url;
	if (!tTipDiv && !tTipContent) {
		tTipDiv = document.createElement("DIV");
		tTipDiv.style.position = "absolute";
		tTipDiv.id = "toolTipID";
		document.body.appendChild(tTipDiv);

		tTipContent = document.createElement("DIV");
		tTipContent.id = "tTipContent";
		tTipDiv.appendChild(tTipContent);
	}
		tTipDiv.style.display="block";
		var hname = "http://" + window.location.host + "/sample/cricket/" + fname;
		document.getElementById("tTipContent").innerHTML = "Content not available, please send details plus image to group";
		
		TTcreateXmlHttp();
		var ulTTList = url.parentNode.parentNode.getElementsByTagName("li");
		var contentId = "tTipContent";
		TTxmlHttp.onreadystatechange=function(){
			loadToolTip(TTxmlHttp, contentId)
		}
		TTxmlHttp.open('GET', fileName, true);
		TTxmlHttp.send(null);

		if (navigator.userAgent.match('MSIE')) {
			var divLeft = url.offsetLeft + url.offsetWidth + 200 + 'px';
			var divTop = url.offsetTop+150;
			tTipDiv.style.left = divLeft;
			tTipDiv.style.top = divTop + 'px';
		}
		else {		
			var addPx = 10;		
			var divLeft = url.offsetLeft + url.offsetWidth + 70 + 'px';
			var divTop = url.offsetTop;
			tTipDiv.style.left = divLeft;
			tTipDiv.style.top = divTop + 'px';
		}
}

function loadToolTip(TTxmlHttp, contentId) {
		if ((TTxmlHttp.readyState == 4) && (TTxmlHttp.status==200)) {
			document.getElementById("tTipContent").innerHTML ="";
			document.getElementById("tTipContent").innerHTML=TTxmlHttp.responseText;
		}
}

function ajax_hideTooltip()
{
	tTipDiv.style.display='none';
}
