
	timerMenu = null;
	mostMutat = 0;


	function mutasdANaptart(e)
	{
		if ( mostMutat != 0 )
			return; 
		
		mostMutat = 1;
		
		document.getElementById("naptarStilus").style.visibility = "visible";
		
		if (!e) var e = window.event;
		if (e.pageX || e.pageY)
		{
			document.getElementById("naptarStilus").style.left = e.pageX - 30;
			if (document.getElementById("naptarStilus").style.left.indexOf("-") != "-1")
				document.getElementById("naptarStilus").style.left = 0;
			document.getElementById("naptarStilus").style.top = e.pageY - 90;
		}
		else if (e.clientX || e.clientY)
		{
			document.getElementById("naptarStilus").style.left = document.body.scrollLeft + event.clientX - 30;
			if (document.getElementById("naptarStilus").style.left.indexOf("-") != "-1")
				document.getElementById("naptarStilus").style.left = 0;
			document.getElementById("naptarStilus").style.top = document.body.scrollTop + event.clientY - 90;
		}
		
//		timerMenu = setTimeout("lassanMutasdaptart()", 1);
		
	}
	
	function lassanMutasdaptart()
	{
	}
	
	function rejtsdelANaptart()
	{
		clearTimeout(timerMenu);
		timerMenu = setTimeout("lassanRejtsdElaptart()", 400);
	}
	
	function lassanRejtsdElaptart()
	{
		document.getElementById("naptarStilus").style.visibility = "hidden";
		mostMutat = 0;
	}

	function maxDays(mm, yyyy)
	{
		var mDay;
		if((mm == 3) || (mm == 5) || (mm == 8) || (mm == 10))
		{
			mDay = 30;
		}
		else
		{
			mDay = 31
			if(mm == 1){
				if (yyyy/4 - parseInt(yyyy/4) != 0)
				{
					mDay = 28
				}
				else
				{
					mDay = 29
				}
			}
		}
		return mDay;
	}
	
	var kezdoSzam = 0

	function getUjUtolsoLatogatas(id)
	{
		var nap = id.substring(2) - kezdoSzam + 1;
		var nap1 = nap;
		if (parseInt(nap1)<10)
			nap1 = "0" + nap;
		var honap = (document.calForm.selMonth.value)
		var honap1 = parseInt(honap) + 1;
		if (parseInt(honap1)<10)
			honap1 = "0" + honap1;
		var ev = (document.calForm.selYear.value)
		
		var now = new Date
		var dd = now.getDate()
		var mm = parseInt(now.getMonth()) + 1
		var dow = now.getDay()
		var yyyy = now.getFullYear()

		if (yyyy > parseInt(ev))
			return ev+honap1+nap1;
		
		if (mm > honap1)
			return ev+honap1+nap1;
	
		if ((mm == honap1) && (dd >= parseInt(nap)))
			return ev+honap1+nap1;				
		
		return 0;

	}

	function changeCal()
	{
		var now = new Date
		var dd = now.getDate()
		var mm = now.getMonth()
		var dow = now.getDay()
		var yyyy = now.getFullYear()
		var currM = parseInt(document.calForm.selMonth.value)
		var prevM
	
		if (currM!=0)
		{
			prevM = currM - 1
		}
		else
		{
			prevM = 11
		}
	
		var currY = parseInt(document.calForm.selYear.value)
		var mmyyyy = new Date()
		mmyyyy.setFullYear(currY)
		mmyyyy.setMonth(currM)
		mmyyyy.setDate(1)
		var day1 = mmyyyy.getDay()
	
		if (day1 == 0)
		{
			day1 = 7
		}
	
		var arrN = new Array(41)
		var aa
	
		for (ii=0;ii<day1;ii++)
		{
			arrN[ii] = maxDays((prevM),currY) - day1 + ii + 1
		}
		aa = 1
		for (ii=day1;ii<=day1+maxDays(currM,currY)-1;ii++)
		{
			arrN[ii] = aa
			aa += 1
		}
		aa = 1
		for (ii=day1+maxDays(currM,currY);ii<=41;ii++)
		{
			arrN[ii] = aa
			aa += 1
		}
		for (ii=0;ii<=41;ii++)
		{
			eval("sp"+ii).style.backgroundColor = "#FFFFFF"
		}
		
		var dCount = 0
		kezdoSzam = 0
		for (ii=0;ii<=41;ii++)
		{
			if (((ii<7)&&(arrN[ii]>20))||((ii>27)&&(arrN[ii]<20)))
			{
				eval("sp"+ii).innerHTML = " " //arrN[ii]
	//			eval("sp"+ii).className = "c3"
				
				if (ii<7)
					kezdoSzam++
			}
			else
			{
				eval("sp"+ii).innerHTML = arrN[ii]
				if ((dCount==0)||(dCount==6))
				{
					eval("sp"+ii).className = "c2"
				}
				else
				{
					eval("sp"+ii).className = "c1"
				}
				if ((arrN[ii]==dd)&&(mm==currM)&&(yyyy==currY))
				{
					eval("sp"+ii).style.backgroundColor= "#f0f000"//"#90EE90"
				}
				else
				{
					eval("sp"+ii).style.backgroundColor=0
				}
				
			}
			
			dCount += 1
			
			if (dCount>6)
			{
				dCount=0
			}
		}
	}
	
	

