$(function() {
    
    /*$('a#reservas').live('click', function(e) {
       e.preventDefault();
       $.get('http://www.cmnet.com.br/pwb3/?IDHotel=146369&IDIdioma=1&CSS=4', function(html) {
           $.facebox(html);
       });       
       return false;
    });*/
    
    $('a[rel=facebox]').facebox();
    
    $('a[rel=facebox_image]').live('click', function(e) {
       e.preventDefault();
       $.facebox({ image: $(this).attr('href') });
       return false;  
    });
    
	/* Mascaras formularios 
	if (typeof $.fn.mask != "undefined") {
		$(".telefone").mask("(99)9999-9999");
		$(".data").mask("99/99/9999");
		$(".cnpj").mask("99.999.999/9999-99");
	} */
});

$(document).ready(function(){
	
	$("#slider").easySlider1({
		auto: true,
		pause: 10000,
		continuous: true //colocar o slider para rodar e nunca para.
	});
	//Over e Out planos
	$(".planos-div").mouseover(function() {
	  $(this).removeClass('opacity-off').addClass('opacity-on');
	}).mouseout(function(){
	  $(this).removeClass('opacity-on').addClass('opacity-off');
	});

	// Links externos
	$("a[rel=external]").attr("target", "_blank");
	//$("a[rel=external nofollow]").attr("target", "_blank");

});

//valida formulario area assinante
function ValidaForm_AreaAssinante(form){
	var str_email = form.subscriberemail.value ;
    if (( str_email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1 ) || ( str_email == 'E-mail:' )){
    	alert("O campo 'E-mail' deve ser preenchido corretamente");
    	form.subscriberemail.focus();
    	return false;
	}
	if(form.subscriberpassword.value.length<=1){
		alert("O campo 'Passaword' deve estar preenchido corretamente.");
		form.subscriberpassword.focus();
		return false;
	}
}

//valida formulario Boletim Informativo
function ValidaForm_BoletimInformativo(form){
	if(form.newsnome.value.length<=1){
		alert("O campo 'Nome' deve estar preenchido corretamente.");
		form.newsnome.focus();
		return false;
	}
	var str_email = form.newsemail.value ;
    if (( str_email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1 ) || ( str_email == 'E-mail:' )){
    	alert("O campo 'E-mail' deve ser preenchido corretamente");
    	form.newsemail.focus();
    	return false;
	}
}

//valida formulario Contato
function ValidaForm_Contato(form){
	if(form.nome.value.length<=1){
		alert("O campo 'Nome' deve estar preenchido corretamente.");
		form.nome.focus();
		return false;
	}
	var str_email = form.email.value ;
    if (( str_email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1 ) || ( str_email == 'Email:' )){
    	alert("O campo 'E-mail' deve ser preenchido corretamente");
    	form.email.focus();
    	return false;
	}
	if(form.telefone.value.length<=1){
		alert("O campo 'Telefone' deve estar preenchido corretamente.");
		form.telefone.focus();
		return false;
	}
	if(form.mensagem.value.length<=1){
		alert("O campo 'Mensagem' deve estar preenchido corretamente.");
		form.mensagem.focus();
		return false;
	}
}

//valida formulario Email Adicional
function ValidaForm_EmailAdicional(form){
	if(form.nome.value.length<=1){
		alert("O campo 'Nome' deve estar preenchido corretamente.");
		form.nome.focus();
		return false;
	}
	var str_email = form.email.value ;
    if (( str_email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1 ) || ( str_email == 'Email:' )){
    	alert("O campo 'E-mail' deve ser preenchido corretamente");
    	form.email.focus();
    	return false;
	}
	if(form.telefone.value.length<=1){
		alert("O campo 'Telefone' deve estar preenchido corretamente.");
		form.telefone.focus();
		return false;
	}
}

function ValidaForm_ImpressaoBoleto(form){
	if(form.cpf.value.length<=1){
		alert("O 'CPF' deve estar preenchido corretamente.");
		form.cpf.focus();
		return false;
	}
}

//valida formulario Email Adicional
function ValidaForm_TrocaSenha(form){
	var str_email = form.email.value ;
    if (( str_email.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/) == -1 ) || ( str_email == 'Email:' )){
    	alert("O campo 'E-mail' deve ser preenchido corretamente");
    	form.email.focus();
    	return false;
	}
	if(form.senha.value.length<=1){
		alert("O campo 'Sua senha atual' deve estar preenchido corretamente.");
		form.senha.focus();
		return false;
	}
	if(form.senha1.value.length<=1){
		alert("O campo 'Sua nova senha' deve estar preenchido corretamente.");
		form.senha1.focus();
		return false;
	}
	if(form.senha2.value.length<=1){
		alert("O campo 'Confirme sua nova senha' deve estar preenchido corretamente.");
		form.senha2.focus();
		return false;
	}
}




