var xmlHttpMaciAkcio;
var IE = document.all?true:false;
if (!IE) document.captureEvents(Event.MOUSEMOVE);
document.onmousemove = getMouseXY;
var tempX = 0
var tempY = 0


function getMaciDatas(ev,ho,nap){
	document.frmMaciAkcio.maev.value=ev;
	document.frmMaciAkcio.mahonap.value=ho;
	document.frmMaciAkcio.manap.value=nap;

	idp=prompt("Időpont:","");
	mjs=prompt("Megjegyzés:","");

	document.frmMaciAkcio.idopont.value=(idp!=null)?idp:"";
	document.frmMaciAkcio.megjegyzes.value=(mjs!=null)?mjs:"";
	document.frmMaciAkcio.submit();
}

function editMaciDatas(ip,mj,id){
	document.frmMaciAkcio.idopont.value=prompt("Időpont:",ip);
	document.frmMaciAkcio.megjegyzes.value=prompt("Megjegyzés:",mj);
	document.frmMaciAkcio.mID.value=id;
	document.frmMaciAkcio.submit();
}

function getToolTip(id){
	xmlHttpMaciAkcio=getXmlHttpObject();
	if (xmlHttpMaciAkcio==null) {
		window.status="A böngésződ nem támogatja az AJAX-ot!";
		return;
	}

	var	url="inc/showMaciDatas.php?mID="+id+"&rnd="+Math.random();
	xmlHttpMaciAkcio.onreadystatechange=showToolTip;
	xmlHttpMaciAkcio.open("GET",url,true);
	xmlHttpMaciAkcio.send(null);
}

function showToolTip(){
	var tip=document.getElementById("ajaxToolTip").style;
	var tipsh=document.getElementById("ajaxToolTipShadow").style;

	if (xmlHttpMaciAkcio.readyState==4){
		document.getElementById("ajaxToolTip").innerHTML=codereplace(xmlHttpMaciAkcio.responseText);
		tip.top=tempY+"px";
		tip.left=(tempX+30)+"px";
		tip.visibility="visible";
		tip.display="block";

		tipsh.top=(tempY+6)+"px";
		tipsh.left=(tempX+36)+"px";
		tipsh.visibility="visible";
		tipsh.display="block";
	}
}

function hideToolTip(){
	var tip=document.getElementById("ajaxToolTip").style;
	var tipsh=document.getElementById("ajaxToolTipShadow").style;

	tip.visibility="hidden";
	tip.display="none";
	tipsh.visibility="hidden";
	tipsh.display="none";
}

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}
  return true
}