$(document).ready(function(){
	$('a[href^=#]').click(function(){
		return false;
	});

	$('a.imprimir').click(function(){
		window.print();
	});

	$('a.voltar').click(function(){
		history.go(-1);
	});

	$(".validacao").validate({
		errorElement: 'ul',
		errorClass: 'errors',
		errorPlacement: function(error, element) {
			error.appendTo( element.parent() );
		}
	});

	$('input.telefone').mask('(99) 9999-9999');
	$('input.nascimento').mask('99/99/9999');
	/*$('input#cep').mask('99999-999');
	$('input#cpf').mask('999.999.999-99');
	$('input#datanascimento').mask('99/99/9999');*/

	$("a[rel^='prettyPhoto']").prettyPhoto({
		theme:'light_rounded',
		gallery_markup: '<div class="pp_gallery"></div>'
	});

	swapValue = [];
	$("div>.input").each(function(i){
		swapValue[i] = $(this).val();
		$(this).focus(function(){
			if ($(this).val() == swapValue[i]) {
				$(this).val("");
			}
		}).blur(function(){
			if ($.trim($(this).val()) == "") {
				$(this).val(swapValue[i]);
			}
		});
	});
});
