$(document).ready(function(){
	

	/* ACORDDION 
		$('h2.accordion').click(function(){
			$(this).next().slideToggle("slow");
			$('.calendario').remove();
		});
	*/
	$('#data_1').focus(function(){
		hoje = new Date()
		dia = hoje.getDate()
		mes = hoje.getMonth()
		ano = hoje.getFullYear()
		if (dia < 10)
		  dia = "0" + dia
		if (ano < 2000)
		  ano = "19" + ano
		//O mes começa em Zero, então soma-se 1
		var minDate_aux = dia+"/"+(mes+1)+"/"+ano
		var maxDate_aux = dia+"/"+(mes+1)+"/"+(ano+1)
		
		$(this).calendario({ 
			target :'#data_1',
			//dateDefault:$(this).val(),
			minDate: minDate_aux,
			maxDate: maxDate_aux
		});
	});
	$('#data_2').focus(function(){
		hoje = new Date()
		dia = hoje.getDate()
		mes = hoje.getMonth()
		ano = hoje.getFullYear()
		if (dia < 10)
		  dia = "0" + dia
		if (ano < 2000)
		  ano = "19" + ano
		//O mes começa em Zero, então soma-se 1
		var minDate_aux = dia+"/"+(mes+1)+"/"+ano
		var maxDate_aux = dia+"/"+(mes+1)+"/"+(ano+1)
		
		$(this).calendario({ 
			target :'#data_2',
			//dateDefault:$(this).val(),
			minDate: minDate_aux,
			maxDate: maxDate_aux
		});
	});
	$('#data_3').focus(function(){
		hoje = new Date()
		dia = hoje.getDate()
		mes = hoje.getMonth()
		ano = hoje.getFullYear()
		if (dia < 10)
		  dia = "0" + dia
		if (ano < 2000)
		  ano = "19" + ano
		//O mes começa em Zero, então soma-se 1
		var minDate_aux = dia+"/"+(mes+1)+"/"+ano
		var maxDate_aux = dia+"/"+(mes+1)+"/"+(ano+1)
		
		$(this).calendario({ 
			target :'#data_3',
			//dateDefault:$(this).val(),
			minDate: minDate_aux,
			maxDate: maxDate_aux
		});
	});
});
