
	/***************************GLOBAL AREA************/
	posLayer='p1'
	w = 200
	h = 100
	addx=1
	addy=15
	showTimer = 5*50
	closeTimer = 5*50
	lastLayer=''
	var IE = document.all?true:false
	if (!IE) document.captureEvents(Event.MOUSEMOVE)
	document.onmousemove = getMouseXY;
	var tempX = 0
	var tempY = 0
	/***************************GLOBAL AREA************/
	
	function getMouseXY(e) {
		if (IE) {
	    	tempX = event.clientX + document.body.scrollLeft
    		tempY = event.clientY + document.body.scrollTop
  		} 
		else {
		    tempX = e.pageX
		    tempY = e.pageY
		}  
	  if (tempX < 0){tempX = 0}
	  if (tempY < 0){tempY = 0}  
	}
	
	function setDiv(CallerID,Message)
	{
		
		if (lastLayer == CallerID) return;
		lastLayer = CallerID;
		posLayer = CallerID;
		hideDiv(0);
		setTimeout("showDiv('"+Message+"')",showTimer);
		
	}
	function GetTopLeft(elm)
	{
	    var x,y =0;
	    x = elm.offsetLeft;
	    y = elm.offsetTop;
	    elm = elm.offsetParent;
	    
	    while(elm != null)
	    {
	        x= parseInt(x)+parseInt(elm.offsetLeft);
	        y= parseInt(y)+parseInt(elm.offsetTop);
	        elm = elm.offsetParent;
	    }
	    
	    return {Top:y,Left:x};
	}
	function f_clientWidth() {
	
			// window.innerWidth;
			// document.documentElement.clientWidth;
			return document.body.clientWidth;
	}

	
	function showDiv(content)
	{	
		vposDiv= document.getElementById(posLayer);
		vmainDiv= document.getElementById("mainDiv");
		

		var left_top = GetTopLeft(vposDiv); 
		vmainDiv.style.width=w;
		vmainDiv.style.height=h;
		vmainDiv.style.top=left_top.Top+ addy;
		vmainDiv.style.left =left_top.Left +addx ;
		var winW = f_clientWidth();
		if(left_top.Left>(winW-w))
		{
			vmainDiv.style.left = winW-w +addx;
			
			
		}
		//Html dosyasinda tooltip metninin yazilacagi yer için Sample Text yazan alan olmalidir.
		vmainDiv.innerHTML = ToolTipContent.replace('Sample Text',content);
		vmainDiv.style.display='';
		setTimeout("hideDiv(0)",closeTimer) ;
	}

	function hideDiv(clink)
	{	
		vmainDiv= document.getElementById("mainDiv")
		vposDiv= document.getElementById(posLayer)
		if (clink==0 && ((tempX > vmainDiv.offsetLeft && tempX < vmainDiv.offsetLeft+vmainDiv.offsetWidth	&& tempY > vmainDiv.offsetTop-addy && tempY  < vmainDiv.offsetTop+vmainDiv.offsetHeight) 
		   || (tempX > vposDiv.offsetLeft && tempX < vposDiv.offsetLeft+vposDiv.offsetWidth	&& tempY > vposDiv.offsetTop -25 && tempY  < vposDiv.offsetTop+vposDiv.offsetHeight) ))
			{
			setTimeout("hideDiv(0)",closeTimer) 
			}
		else
			{
				vmainDiv.style.display='none'
				lastLayer =''
			}
	}
	
	
	
