
$(document).ready(function(){
	
	$('#cycleDestaque1').cycle({ 
		fx:     'fade',
		sync: false,
		speed:  700, 
		timeout: 9000,
		cleartypeNoBg : true,
		before: function(currSlideElement, nextSlideElement, options, forwardFlag) {
			$("div#fundo > div.features_home").remove();
			$(nextSlideElement).find("div.features_home").clone().prependTo("div#fundo").animate({"margin-left":"0"},1200, "easeOutExpo");
			$(".features_home .left a").click(function(){
				$('#cycleDestaque1').cycle($(this).attr("class"));
				return(false);
			});
		}
	});
	
	
	$("#dropBusca").toggle(
		function(){
			$(this).parents("#busca").stop().animate({ marginTop: "0px" },400 );
		},
		function(){
			$(this).parents("#busca").stop().animate({ marginTop: "-50px" },400 );
		}
	);
	

	
	$(function() {
		$("#menu_historia ul li a").css("background","#19518a");
		$("#menu_historia ul li a").mouseover(function () {
			$(this).stop().animate({
				 backgroundColor: "#0b2239"
			}, 200);
		});
		$("#menu_historia ul li a").mouseout(function () {
			$(this).stop().animate({
				 backgroundColor: "#19518a"
			}, 2000);
		});
	});


$("#Telefone, #Telefone_comercial, #Telefone2, #tx_telefone, #Celular, #Celular_conjuge").blur(function(){
    if($(this).val() == '' || $(this).val() == '(__) ____-____'){
        $(this).unmask('(99) 9999-9999');
        setTimeout(function(){$("#Telefone").val('Telefone');},10);
    }
});
$("#Telefone, #Telefone_comercial, #Telefone2, #tx_telefone, #Celular, #Celular_conjuge").focus(function(){
    this.value='';
    $(this).unbind('mask');
    $(this).unmask('(99) 9999-9999');
    $(this).mask('(99) 9999-9999');
});


$("#Cpf, #Cpf_conjuge").blur(function(){
    if($(this).val() == '' || $(this).val() == '___.___.___-__'){
        $(this).unmask('999.999.999-99')
        setTimeout(function(){$("#Cpf").val('Cpf');},10);
    }
});
$("#Cpf, #Cpf_conjuge").focus(function(){
    this.value='';
    $(this).unbind('mask');
    $(this).unmask('999.999.999-99');
    $(this).mask('999.999.999-99');
});

$("#Cep").blur(function(){
    if($(this).val() == '' || $(this).val() == '_____-___'){
        $("#Cep").unmask('99999-999')
        setTimeout(function(){$("#Cep").val('Cep');},10);
    }
});
$("#Cep").focus(function(){
    this.value='';
    $(this).unbind('mask');
    $(this).unmask('99999-999');
    $(this).mask('99999-999');
});

$("#Data_nascimento, #Data_nascimento_conjuge").blur(function(){
    if($(this).val() == '' || $(this).val() == '__/__/____'){
        $(this).unmask('99/99/9999')
        setTimeout(function(){$("#Data_nascimento").val('Data de nascimento');},10);
    }
});
$("#Data_nascimento, #Data_nascimento_conjuge").focus(function(){
    this.value='';
    $(this).unbind('mask');
    $(this).unmask('99/99/9999');
    $(this).mask('99/99/9999');
});

//Mascara Telefone
	//$("#Telefone2").mask("(99) 9999-9999");
	//$("#Telefone").mask("(99) 9999-9999");
	//$("#Celular").mask("(99) 9999-9999");	
	$("#Celular2").mask("(99) 9999-9999");	
	$("#Telefone_imobiliaria").mask("(99) 9999-9999");	
	//$("#Telefone_comercial").mask("(99) 9999-9999");
	$("#Telefone_comercial_conjuge").mask("(99) 9999-9999");
	$("#Telefone_banco").mask("(99) 9999-9999");	
	$("#Telefone_banco2").mask("(99) 9999-9999");	
	$("#Telefone_empresa_contato").mask("(99) 9999-9999");
	$("#Telefone_empresa_contato2").mask("(99) 9999-9999");
	$("#Telefone_residencial").mask("(99) 9999-9999");
	$("#Telefone_banco3").mask("(99) 9999-9999");
	$("#Telefone_empresa_contato3").mask("(99) 9999-9999");
	$("#Telefone_locador").mask("(99) 9999-9999");
	$("#Telefone_conjuge").mask("(99) 9999-9999");
	//$("#Celular_conjuge").mask("(99) 9999-9999");
	$("#Telefone_Residencial").mask("(99) 9999-9999");
	$("#Telefone_Comercial").mask("(99) 9999-9999");
	$("dd #telefone").mask("(99) 9999-9999");	
	$("#celular").mask("(99) 9999-9999");	
	$("#Fax").mask("(99) 9999-9999");	
	$("#Celular_locador").mask("(99) 9999-9999");
	//$("#tx_telefone").mask("(99) 9999-9999");
	
	//$("#Data_nascimento").mask("99/99/9999");
	//$("#Data_nascimento_conjuge").mask("99/99/9999");
	$("#Data_Nascimento").mask("99/99/9999");	
	
	//$("#Cpf").mask("999.999.999-99");
	//$("#Cpf_conjuge").mask("999.999.999-99");	
	
	//$("#Cep").mask("99999-999");
	$("#Cep_locador").mask("99999-999");
	$("#Cep_conjuge").mask("99999-999");
	
	$("#txtArea").maskDecimal();
	$("#txtAreaTot").maskDecimal();
	$("#Area_construida").maskDecimal();
	$("#Valor").maskMoney();
	$("#Valor_condominio").maskMoney();		

	
});







