// JavaScript Document


//
function mozravi_div(e, uid)
	{

	infodiv = document.getElementById("infodiv");
	// Get the mouse position
	e = e || window.event;
	var cursor = {x:0, y:0};
	if (e.pageX || e.pageY) {
		cursor.x = e.pageX;
		cursor.y = e.pageY;
		} 
		else {
		var de = document.documentElement;
		var b = document.body;
		cursor.x = e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
		cursor.y = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    		}
    		
	// Get the size of Popup
	var popupWidth = infodiv.clientWidth;
	var popupHeight = infodiv.clientHeight;

	// Get the size of Window
	var viewportwidth;
	var viewportheight;
 
	if (typeof window.innerWidth != 'undefined') {
      	viewportwidth = window.innerWidth,
      	viewportheight = window.innerHeight
		}
	else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) {
		viewportwidth = document.documentElement.clientWidth,
		viewportheight = document.documentElement.clientHeight
		}
		else {
			viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
			viewportheight = document.getElementsByTagName('body')[0].clientHeight
			}
		
// Move popup to the left if there is no room
		infodiv.style.left=cursor.x+15+"px";
		infodiv.style.top=cursor.y+15+"px";

		if (cursor.x + popupWidth > viewportwidth - 20) {
		infodiv.style.left=cursor.x-popupWidth-10+"px";
		}
		if (cursor.y + popupHeight > viewportheight - 20) {
		infodiv.style.top=cursor.y-popupHeight-10+"px";
		}

	draw_div(uid);
	

	infodiv.style.visibility="visible";
	}

function gaaqre_div(e, uid)
{
	infodiv.style.visibility="hidden";
}

///////////////////////////////////////