	// cookie kezeles...
	function readLatogatas() 
	{
		var expDays = 365; // number of days the cookie should last
		var expDate = new Date();
		expDate.setTime(expDate.getTime() +  (24 * 60 * 60 * 1000 * expDays)); 

		var maiDatum = getDatum();

		var utLat = GetCookie('utLat');
		if (utLat == null || utLat == "no id") 
		{
//			if (location.search.length > 1) 
	//			utLat = location.search.substring(1, location.search.length);
		//	else 
				utLat = maiDatum;
			if (utLat != GetCookie('utLat')) 
				SetCookie('utLat', utLat, expDate);
		}

		var utElLat = GetCookie('utElLat');
		if (utElLat == null || utElLat == "no id") 
		{
//			if (location.search.length > 1) 
	//			utElLat = location.search.substring(1, location.search.length);
		//	else 
				utElLat = maiDatum;
			if (utElLat != GetCookie('utElLat')) 
				SetCookie('utElLat', utElLat, expDate);
		}

		var utolsoLatogatas = utLat;
		if (  utolsoLatogatas == maiDatum  )
		{
			// ma mar voltunk itt ...
			utolsoLatogatas = utElLat;
		}
		else
		{
			// ma meg nem voltunk itt...
			// atirom az utolso elottibe az utolsot...
			SetCookie('utElLat', utLat, expDate);
			SetCookie('utLat', maiDatum, expDate);
		}
	}
	
	function getCookieVal(offset) 
	{  
		var endstr = document.cookie.indexOf (";", offset);  
		if (endstr == -1)    
			endstr = document.cookie.length;  
		return unescape(document.cookie.substring(offset, endstr));
	}
	
	function GetCookie(name) 
	{  
		var arg = name + "=";  
		var alen = arg.length;  
		var clen = document.cookie.length;  
		var i = 0;  
		while (i < clen) 
		{    
			var j = i + alen;    
			if (document.cookie.substring(i, j) == arg)      
				return getCookieVal (j);    
			i = document.cookie.indexOf(" ", i) + 1;    
			if (i == 0) 
				break;   
		}  
		return null;
	}
	
	function SetCookie(name, value) 
	{  
		var argv = SetCookie.arguments;  
		var argc = SetCookie.arguments.length;  
		var expires = (argc > 2) ? argv[2] : null;  
		var path = (argc > 3) ? argv[3] : null;  
		var domain = (argc > 4) ? argv[4] : null;  
		var secure = (argc > 5) ? argv[5] : false;  
		document.cookie = name + "=" + escape (value) + 
		((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + 
		((path == null) ? "" : ("; path=" + path)) +  
		((domain == null) ? "" : ("; domain=" + domain)) +    
		((secure == true) ? "; secure" : "");
	}

	function formatUtolsoLatogatas( utolsoLatIdeje )
	{
		if (utolsoLatIdeje.length != 8 )
			return "Ismeretlen";
		var months=new Array(13);
		months[1]="január";
		months[2]="február";
		months[3]="március";
		months[4]="április";
		months[5]="május";
		months[6]="június";
		months[7]="július";
		months[8]="augusztus";
		months[9]="szeptember";
		months[10]="október";
		months[11]="november";
		months[12]="december";

		var Ev = utolsoLatIdeje.substring(0, 4);
		var Honap = utolsoLatIdeje.substring(4, 6);
		if ( Honap.substring( 0, 1 ) == "0" )
			Honap = Honap.substring( 1, 2 );
		var Nap = utolsoLatIdeje.substring(6, 8);
		var lmonth=months[Honap];
			
		return Ev + " " + lmonth + " " + Nap;
	}
	
	function getDatum()
	{
		var ido=new Date();
		
		var year=ido.getYear();
		if (year < 2000)
			year = year + 1900;
		var formaltDatum=year;
		
		var honap=ido.getMonth()+1;
		if ( honap < 10 )
			formaltDatum += "0" + honap;
		else 
			formaltDatum += "" + honap;

		var nap=ido.getDate();
		if ( nap < 10 )
			formaltDatum += "0" + nap;
		else 
			formaltDatum += "" + nap;
		
		return formaltDatum;
	}
	


