$(function($){
   $("#nasc").mask("99/99/9999");
   $("#data").mask("99/99/9999");	   
   $("#fone_1").mask("(99) 9999-9999");
   $("#fone_2").mask("(99) 9999-9999");
   $("#cpf").mask("999.999.999-99");
   $("#inicio").mask("99/9999");
   $("#conclusao").mask("99/9999");
   $("#inicio_prof").mask("99/9999");
   $("#conclusao_prof").mask("99/9999");
   $("#inicio_curso").mask("99/9999");
   $("#conclusao_curso").mask("99/9999");
});
$().ready(function() {
	$("select[@name=estado]").change(function(){
		$('select[@name=cidade]').html('<option value="sda">Procurando ...</option>');
		$.post('query_cadastro.php', 
			{ estado : $(this).val() }, 
			function(resposta){
				$('select[@name=cidade]').attr({disabled: false});						
				$('select[@name=cidade]').html(resposta);
			}
		);
	});
	$("select[@name=estado_curso]").change(function(){
		$('select[@name=cidade_curso]').html('<option value="sda">Procurando ...</option>');
		$.post('query_cadastro.php', 
			{ estado : $(this).val() }, 
			function(resposta){
				$('select[@name=cidade_curso]').attr({disabled: false});						
				$('select[@name=cidade_curso]').html(resposta);
			}
		);
	});
	$("select[@name=nivel_esc]").change(function(){
		$('select[@name=id_curso]').html('<option value="0">Procurando ...</option>');
		$.post('query_cadastro.php', 
			{ nivel_esc : $(this).val() }, 
			function(resposta){
				$('select[@name=id_curso]').attr({disabled: false});						
				$('select[@name=id_curso]').html(resposta);
			}
		);
	});
	$("select[@name=area_prof]").change(function(){
		$('select[@name=especializacao_prof]').html('<option value="0">Procurando ...</option>');
		$.post('query_cadastro.php', 
			{ especializacao_prof : $(this).val() }, 
			function(resposta){
				$('select[@name=especializacao_prof]').attr({disabled: false});						
				$('select[@name=especializacao_prof]').html(resposta);
			}
		);
	});
	
	$("#aceito").click(function(){
		if(this.checked){
			$('#btnIniciar').attr('src', 'img/btn-iniciar.png');
			$('#btnIniciar').attr('disabled', false);	
		} else {
			$('#btnIniciar').attr('src', 'img/btn-iniciar-off.png');	
			$('#btnIniciar').attr('disabled', true);	
}
	});
	$("#radioSim").click(function(){
		$('#conclusao').attr({disabled: false});
	});
	$("#radioNao").click(function(){
		$('#conclusao').attr({disabled: true});
	});

});
