








$().ready(function() {  
	 			$("#indulas_datum").datepicker({dateFormat: 'yy-mm-dd'});
	 			$("#hirlevel_form").ajaxForm();
	 			
	 			
	 	$(".fm").mouseover(function () {
      	
			$("#"+$("#"+this.id+" a")[0].id).css('background','#ff6000');
			$("#"+$("#"+this.id+" a")[0].id).css('color','#fff');
		});
    
   		$(".fm").mouseout(function () {
      	
			$("#"+$("#"+this.id+" a")[0].id).css('background','');
			$("#"+$("#"+this.id+" a")[0].id).css('color','#666');
    	});
});

function honap_link(id) {
	$(".honap_linkek a").css({background:'#fff', color:'#ff5300'});
	$("#"+id).css({background:'#ff5300', color:'#fff'});
}

function adat_link(id) {
	$(".ajanlat_nav a").css({background:'#fff', color:'#ff5300'});
	$(".ajanlat_nav a").css('text-decoration','underline');
	$("#"+id).css({background:'#ff5300', color:'#fff'});
	$("#"+id).css('text-decoration','none');
	
}



function sorszin() {

	
	var cl = $(".aktiv_datum_td").next().attr("class");
	$(".aktiv_datum_td").attr("class",cl);
	
}


function block_ui(id, txt) {
             //alert(txt);   
            $('#'+id).block({
                message: txt,
                css: { width:'220px',border: '2px solid #777',background:'#eee',margin:'0px 0px 0px 0px',padding:'10px' }
            });
}


	
	var gy_szamlal;
 	function gysz_ell(max_gysz, sel) {
 		//alert(sel);
 		gy_szamlal=0;
 		$(".gysz_select").each(function (i) {
	        //alert($("#"+this.id).val()+max_gysz);
	        gy_szamlal = gy_szamlal+parseInt($("#"+this.id).val());
      });
 		
 		if(gy_szamlal>max_gysz) {
 			$("#"+sel.id).val(0);
 			alert("Összesen legfeljebb "+max_gysz+" személy választható ki.");
 			
 		}
 		else {
 			$("#op").val("artabla_frissites");$("#foglalas_form").ajaxSubmit();
 		}
 	}
 	
 	
 	function tartozkodas(min) {
 		
 		var opciok="";
 		
 		i=min;
 		while(i<22) {
 			opciok += "<option value=\'"+i+"\'>"+i;
			if(min==7) i=i+min;
			else i++;
 		}
 		$("#tartozkodas").html(opciok);
 	}
 	function nap_kivalasztas(datum,min, nap_tms, szallas_id,gyk,szoba_id) {
 		
 		$("#erkezes_tarolo").html(datum);
 		tartozkodas(min);
 		$.post("/ajax/_foglalas.php", { op:"celdatum_kivalasztas", nap_tms:nap_tms, szallas_id:szallas_id, gyk:gyk, szoba_id:szoba_id, mintart:min });
 	}
