
	function validaForm(){
		//validar nome
		d = document.reservas;
		if (d.quarto_tipo.value == "" || d.entrada.value =="" || d.saida.value =="" || d.num_criancas.value =="" || d.num_adultos.value =="")
		{
			alert("Todos os campos são obrigatórios.");
			
			return false;
		}
		
	}
	
	//calendarios..........................................................................
	//$('quarto_tipo').observe('click', respondToClick);

	function SetDataEntrada(valor) { 
	    document.reservas.entrada.value=valor; 
	}
	
	function SetDataSaida(valor) { 
	    document.reservas.saida.value=valor; 
	}

	function fechaDiv(Thisdiv)
    {
        divstyle = document.getElementById(Thisdiv).style.visibility;
        document.getElementById(Thisdiv).style.visibility = "hidden";
    }
	
	function abreDiv(Thisdiv)
    {
        divstyle = document.getElementById(Thisdiv).style.visibility;
        document.getElementById(Thisdiv).style.visibility = "visible";
    }
	
	function highlightCalendarCell(element) {
		$(element).style.border = '1px solid #999999';
	}

	function resetCalendarCell(element, color) {
		$(element).style.border = '1px solid #000000';
	}
	
	function startCalendar(month, year) {
		//var quartoid = $(quarto_tipo).getValue();
		//document.getElementById("quarto_tipo").value;
	
	new Ajax.Updater('calendarEntrada', 'calendario_disp_entrada.php', {method: 'post', postBody: 'action=startCalendar&month='+month+'&year='+year+'&id='+document.getElementById("quarto_tipo").value+''});
	}
	
	function startCalendarSaida(month_s, year_s) {
			new Ajax.Updater('calendarSaida', 'calendario_disp_saida.php', {method: 'post', postBody: 'action=startCalendarSaida&month_s='+month_s+'&year_s='+year_s+'&id='+document.getElementById("quarto_tipo").value+''});
	}
	
	
