function Set_Cookie( name, value, expires, path, domain, secure )
{
// set time, it's in milliseconds
var today = new Date();
today.setTime( today.getTime() );

/*
if the expires variable is set, make the correct
expires time, the current script below will set
it for x number of days, to make it for hours,
delete * 24, for minutes, delete * 60 * 24
*/
if ( expires )
{
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );

document.cookie = name + "=" +escape( value ) +
( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) +
( ( path ) ? ";path=" + path : "" ) +
( ( domain ) ? ";domain=" + domain : "" ) +
( ( secure ) ? ";secure" : "" );
}

function lenyil(level,melyik,osszes)
	{
		//alert(level+' '+melyik+' oks');
		szint = parseInt(level) + 1;
		if($('.level_'+szint+'.'+melyik).css('display') == 'none')
			{
				//alert('sima');
				$('.level_'+szint+'.'+melyik).css('display', '');
				//Set_Cookie("absonic-"+melyik,"ok",365,"/nicopro_v2","nicopro.hu",0);
				//alert(szint);
				ajaxcontent('inc/menu_hu_ajax.php?melyik='+melyik+'&action=ok', 'ajaxhidden');
			}
		else if(osszes == 'ok')
			{
				//alert('vanosszes');
				for(i=szint;i<5;i++)
					{
						$('.level_'+i+'.'+melyik).css('display', 'none');
						//Set_Cookie("absonic-"+melyik,"no",365,"/nicopro_v2","nicopro.hu",0);
					}
				ajaxcontent('inc/menu_hu_ajax.php?melyik='+melyik+'&action=no', 'ajaxhidden');
			}
		else
			{
				//alert('nincsosszes');
				$('.level_'+szint+'.'+melyik).css('display', 'none');
				ajaxcontent('inc/menu_hu_ajax.php?melyik='+melyik+'&action=no', 'ajaxhidden');
			}
		
		/*
		if('<?=$_COOKIE["absonic-"+melyik];?>' == 'ok')
			{
				Set_Cookie("absonic-arlistak","no",365,"/nicopro_v2","nicopro.hu",0);
			}
		else
			{
				Set_Cookie("absonic-arlistak","ok",365,"/nicopro_v2","nicopro.hu",0);
			}
			*/
	}


function ajaxcontent(url, id)
	{
	var AJAX = null;
	if(window.XMLHttpRequest)
		{
		AJAX=new XMLHttpRequest();
		}
	else
		{
		AJAX=new ActiveXObject("Microsoft.XMLHTTP");
		};
	if(AJAX==null)
		{
		alert("Your browser doesn't support AJAX.");
		return false
		};
	AJAX.onreadystatechange = function()
		{
		if(AJAX.readyState==4 || AJAX.readyState==200)
			{
			identity=document.getElementById(id);
		 	identity.innerHTML = '';
			identity.innerHTML = (identity.innerHTML + AJAX.responseText);
			};
		};
	//If ajax doesn't work, change POST to GET!
	AJAX.open("POST", url, true);
	AJAX.send(null);
	};


