    $(document).ready(function(format){
        format("#cpf").mask("999.999.999-99")
        format("#data_nascimento").mask("99/99/9999")
        format("#fone_residencial").mask("(99) 9999-9999")	
        format("#fone_celular").mask("(99) 9999-9999")
        format("#cep").mask("99999-999")

		$('a[href*=#][class!=back]').click(function() {
			animationScrollTo(this.hash)
		})

		$('a.back').click(function(){ 
			$.scrollTo(0, 800, {queue:true}) 
			$(this).animate({"opacity": "0"}, "slow");
		});	

		$(window).scroll(function () {
		    //$('h3').removeClass('selected');
			var btnback = $('a.back')
			var btndisplay = btnback.css('display')
			var scrollTop = $(this).scrollTop()

			if(scrollTop > 200) {
				if(btndisplay=='none') btnback.show()
			} else {
				btnback.hide()
			}

		})

		if(location.hash!='') {
			animationScrollTo(location.hash)			
			$('a.back').show()
		}

    });

	function animationScrollTo(idToScroll)  {
		$('h3').removeClass('selected');	
		$.scrollTo(idToScroll, {duration:1000, 
				   				offset:{top:-10}, 
								onAfter:function(){
											$(idToScroll+' h3').addClass('selected')
											$('a.back').show().animate({opacity: "9"}, "slow")
										}
								})
	}
