function calcula(){
	var widthright = $("#resizer").width();
	wfoto = $("#fototopo").width();
	hfoto = parseFloat((266*wfoto)/1094);
	$('#fototopo').css("height", hfoto);
	
	if (widthright < 1094) {
		$('#resizer').css("width", "100%");
		
		$('#fototopo').css("width", "100%");
		wfoto = $("#fototopo").width();
		hfoto = parseFloat((266*wfoto)/1094);
		$('#fototopo').css("height", hfoto);
		
		$('#tamanho_rodape').css("width", "71%");
		
		$('#site').css("width", "94%");
		$('#site').css("margin", "20px 10px 0px 15px");
	}
	else{
		$('#resizer').css("width", "1094px");
		$('#fototopo').css("width", "1094px");
		hfoto = parseFloat((266*1094)/1094);
		$('#fototopo').css("height", hfoto);
		$('#tamanho_rodape').css("width", "1094px");
		
		$('#site').css("width", "1064px");
		$('#site').css("margin", "20px 10px 0px 15px");
	}
	
	var wdoc = $(document).width();
	//window.alert(wdoc);
	if(wdoc < 800){
		$('#menu-align').css("width", "100%");
	}
	else{
		$('#menu-align').css("width", "775px");
	}
	
	var wdados = $('#dados').width();
	var tudo = parseFloat(207 + wdados);
	var wrodape = $('#tamanho_rodape').width();
	if(tudo >= wrodape){
		$('#tamanho_rodape').css("width", "100%");
		$('#tamanho_rodape').css("margin-left", "0px");
	}
	//window.alert(wdados);
	
	
	var heighttotal = $(document).height(),
		topo = $("#header").height(),
		rodape = $("#footer").height(),
		
		toporodape = parseFloat(topo + rodape),
		heightrestante = parseFloat(heighttotal - toporodape),
		heightright = $("#resizer").height();

	if ( heightright < heightrestante ) {
		$('#resizer').css("height", heightrestante);
	}
}

   $(function(){
		// Datepicker
		$('#datepicker').datepicker({
			inline: false,
			minDate: 0
		});
		//hover states on the static widgets
		$('#dialog_link, ul#icons li').hover(
			function() { $(this).addClass('ui-state-hover'); }, 
			function() { $(this).removeClass('ui-state-hover'); }
		);
	});
	
	
	$(document).ready(function() {    
		$('#telefone').focus(function() {  
			$.mask.definitions['~']='[+-]';
			$('#telefone').mask('(99)9999-9999');  
		});
	});
	
	function check(id){document.getElementById(id).checked = true;}
	function checkEmail(valor){
		if(valor==''){return false;}
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(valor)){return true;}
		return false;
	}
	function valida_reserva(obj) {
		if((!obj.refeicao[0].checked)&&(!obj.refeicao[1].checked)){
			alert('Informe se você deseja jantar ou almoçar.');
			return false;
		}
		if ((obj.pessoas.value=='') || (obj.pessoas.value < 1)) {
			alert('Informe o número de pessoas.');
			obj.pessoas.focus();
			return false;
		}	
		if (obj.data.value=='Data') {
			alert('Informe a Data que você deseja reservar.');
			return false;
		}	
		if (obj.nome.value=='Nome') {
			alert('Informe o seu Nome.');
			obj.nome.focus();
			return false;
		}	
		if (checkEmail(obj.email.value)==false) {
			alert('E-mail inválido.');
			obj.email.focus();
			return false;
		}	
		if (obj.telefone.value=='Telefone') {
			alert('Informe o seu Telefone.');
			obj.telefone.focus();
			return false;
		}		
	}
	
	function valida_contato(obj) {
		if (obj.nome.value=='') {
			alert('Informe o seu Nome.');
			obj.nome.focus();
			return false;
		}	
		if (checkEmail(obj.email.value)==false) {
			alert('E-mail inválido.');
			obj.email.focus();
			return false;
		}	
		if (obj.fone.value=='') {
			alert('Informe o seu Telefone.');
			obj.fone.focus();
			return false;
		}
		if((!obj.assunto[0].checked)&&(!obj.assunto[1].checked)&&(!obj.assunto[2].checked)){
			alert('Selecione uma opção para o assunto.');
			return false;
		}
		if (obj.mensagem.value=='') {
			alert('Informe a sua Mensagem.');
			obj.mensagem.focus();
			return false;
		}			
	}
