
function getHabitaciones(form)
{
	var numHab= document.getElementById(form).habitaciones.value;

	if (numHab==1){
		$('#' + form).find('#habitacion_2').hide();
		$('#' + form).find('#habitacion_3').hide();
                getNinos(form,'1');
	} 
	if (numHab==2){
		$('#' + form).find('#habitacion_2').show();
		$('#' + form).find('#habitacion_3').hide();
                getNinos(form,'1');
                getNinos(form,'2');
	} 
	if (numHab==3) 
	{ 
		$('#' + form).find('#habitacion_2').show();
		$('#' + form).find('#habitacion_3').show();
                getNinos(form,'1');
                getNinos(form,'2');
                getNinos(form,'3');
	}
}

function getNinos(form,num)
{
	var nameform = document.getElementById(form);
        var idpersona =eval('nameform.personas_'+num+'.value');
	var datos=idpersona.split('_');

        var nino1 = $('#' + form).find('#edad_'+num+'_1').val();
        var nino2 = $('#' + form).find('#edad_'+num+'_2').val();
        
	if (datos[3]==0)
        {
            $('#' + form).find('.label-ninos_'+num).hide();
            $('#' + form).find('#edad_'+num+'_1').hide();
            $('#' + form).find('#edad_'+num+'_2').hide();
	}
	if (datos[3]==1)
        {
            $('#' + form).find('.label-ninos_'+num).show();

            $('#' + form).find('#edad_'+num+'_1').show();

            $('#' + form).find('#edad_'+num+'_2').hide();
            

	}
	if (datos[3]==2)
        {
            $('#' + form).find('.label-ninos_'+num).show();
            $('#' + form).find('#edad_'+num+'_1').show();
            $('#' + form).find('#edad_'+num+'_2').show();
	} 
}
