// JavaScript Document - jquery Site da Hyperativa


$(document).ready(function(){
		var envio;	
		$('.btn-contato').click(function(){
				$('html, body').animate({scrollTop: $('.contato').offset().top}, 1500);
        });
		/*
		$('span.cases').click(function(){
				$('html, body').animate({scrollTop: $('#destaque').offset().top}, 500);
		});
		*/
		$('.btn-topo').click(function(){
				$('html, body').animate({scrollTop: $('.wr-page').offset().top}, 1500);
		});

		$('.txt-auto').focus(function () {
			var txt = $(this).attr('value');
			$(this).attr('value', '');
			$(this).blur(function () {
				var txt2 = $(this).attr('value');
				if (txt2 == '') {
					$(this).attr('value', txt);
				}
			});
		});
		


		
	
});

function validaEmail(campo){
	var res = true;
	if ( campo.length > 0 )
	{
	    var re = /^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z-._+&]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/;
		res = re.test(campo);
	}
    return res; 	
}
