function pager(actual) {
    $('#p').val(actual);
    $('#pagerform').submit();
}

function pager2(actual) {
    document.getElementById('p').value = actual;
    document.getElementById('pagerform').submit();
}
// ezek az alap autocomlete-s kimenetformazo fgv-ek
function formatItem(row) {
    return row[0] + " (<strong>id: " + row[1] + "</strong>)";
}
function formatResult(row) {
    return row[0];
}

function setCookie(c_name,value,expiredays) {
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+"; path=/";
}

function getCookie(c_name) {
    if (document.cookie.length>0) {
        c_start=document.cookie.indexOf(c_name + "=");
        if (c_start!=-1) {
            c_start=c_start + c_name.length+1;
            c_end=document.cookie.indexOf(";",c_start);
            if (c_end==-1) c_end=document.cookie.length;
            return unescape(document.cookie.substring(c_start,c_end));
        }
    }
    return "";
}
$(document).ready(function () {
	Cufon.replace('h1, h2, h3, h5');
	Cufon.replace('#menu a, .button, .special, button, .header', {hover: 'true'});
	totalHeight=$('.userMenu ul').height();
	$('.userMenu ul').children().each(function(){
		totalHeight = (totalHeight + $(this).height());
	});
	userMenuOpened=false;	 	
    $('.userMenu .first, #adminbutton').click(function() {
		if(userMenuOpened){
		$('.userMenu ul').animate({ 
			height:'40px',
		  }, 500);
		  userMenuOpened=false;
		}else{
		$('.userMenu ul').animate({ 
			height: totalHeight+'px',
		  }, 500);
		  userMenuOpened=true;	 
		  return false;
		}
	});	

});
