/***********function to display ToolTip on mouseClick**************/
var _intBPHTTDelayTimerID;
var _blnBPHTTVisible = false;

function showRatingsBreakupToolTip(e, intProjectCount){
	window.clearTimeout(_intBPHTTDelayTimerID);
	if(_blnBPHTTVisible) {
		//Uncomment if you dnt want to toggle DivToolTip. 
		//return;
	}
		
	document.getElementById("tdValuable").innerHTML = intProjectCount.toString();
	var agt = navigator.userAgent.toLowerCase();
	var is_mozilla = (navigator.product == "Gecko");
	var is_opera = (agt.indexOf("opera")!= -1);
	var is_konqueror = (agt.indexOf("konqueror")!= -1);
	var is_webtv = (agt.indexOf("webtv")!= -1);
	var is_ie = ((agt.indexOf("msie")!= -1) && (!is_opera) && (!is_webtv));
	var is_netscape = ((agt.indexOf("compatible") == -1) && (agt.indexOf("mozilla")!= -1) && (!is_opera) && (!is_webtv));
	var is_win = (agt.indexOf("win"!= -1));
	var is_mac = (agt.indexOf("mac")!= -1);
	if (is_ie){
		eltag = e.srcElement.tagName;
	}else{
		eltag = e.target.tagName;
	}
	
	var divToolTip = document.getElementById("divToolTip");

	if(eltag != 'AREA'){
		divToolTip.style.top = (getRelativeMouseY(e) + -30).toString() + "px";
		divToolTip.style.left = (getRelativeMouseX(e) + 5).toString() + "px";
	}
	else{
		divToolTip.style.top = (getRelativeMouseY(e) + -160).toString() + "px";;
		divToolTip.style.left = (getRelativeMouseX(e) + 5).toString() + "px";
	}
	divToolTip.style.display = "block";
	
	_blnBPHTTVisible = true;
	delayRatingsBreakupToolTip();
	//return false;
}

function delayRatingsBreakupToolTip(){
	if(!_blnBPHTTVisible) return;    
	_intBPHTTDelayTimerID = window.setTimeout("hideRatingsBreakupToolTip()", 30000);
	return false;
}		

function hideRatingsBreakupToolTip(){
	document.getElementById("divToolTip").style.display = "none";
	_blnBPHTTVisible = false;
}

function getRelativeMouseY(e){
	if(document.documentElement.scrollTop)
		return e.clientY + document.documentElement.scrollTop;
	else
		return e.clientY;
}

function getRelativeMouseX(e){
	if(document.documentElement.scrollLeft)
		return e.clientX + document.documentElement.scrollLeft;
	else
		return e.clientX
}
