	jQuery.validator.addMethod("cpf", function (value, element) {
	    value = jQuery.trim(value);
	 
	    value = value.replace('.', '');
	    value = value.replace('.', '');
	    cpf = value.replace('-', '');
	    while (cpf.length < 11) cpf = "0" + cpf;
	    var expReg = /^0+$|^1+$|^2+$|^3+$|^4+$|^5+$|^6+$|^7+$|^8+$|^9+$/;
	    var a = [];
	    var b = new Number;
	    var c = 11;
	    for (i = 0; i < 11; i++) {
	        a[i] = cpf.charAt(i);
	        if (i < 9) b += (a[i] * --c);
	    }
	    if ((x = b % 11) < 2) { a[9] = 0 } else { a[9] = 11 - x }
	    b = 0;
	    c = 11;
	    for (y = 0; y < 10; y++) b += (a[y] * c--);
	    if ((x = b % 11) < 2) { a[10] = 0; } else { a[10] = 11 - x; }
	    if ((cpf.charAt(9) != a[9]) || (cpf.charAt(10) != a[10]) || cpf.match(expReg)) return this.optional(element) || false;
	    return this.optional(element) || true;
	}, "Informe um CPF válido."); // Mensagem padrão 


	// this one requires the value to be the same as the first parameter
	$.validator.methods.equal = function(value, element, param) {
		return value == param;
	};

	$().ready(function() {
		var validator = $("#cadastro").bind("invalid-form.validate", function() {

		}).validate({
			debug: false,
			errorClass: 'form-required',
			errorPlacement: function(error, element) {
				error.insertBefore(element);
			},
			rules: {
				nome: {
					required:true,
				},
				cpf: {
					required:true,
					cpf: {cpf: true}
				},		
				tel: {
					required:true,
				},							
				senha: {
					required: true,
					minlength: 8
				},
				senha2: {
					minlength: 8,
					equalTo: "#senha"
				},
				email: {
					required: true,
					email: true
				}
			},
		    messages: {
		        required: "Por favor, preencha este campo.",
		        email: "Por favor, digite um e-mail v&aacute;lido.",
		        cpf: "Digite um cpf válido.",
		        maxlength: "Por favor, n&atilde;o insira mais que {0} caracteres.",
		        minlength: "Por favor, n&atilde;o insira menos que {0} caracteres.",
		        rangelength: "Por favor, insira um valor entre {0} e {1} caracteres."
		    }			
		});

	});
	
	
	$().ready(function() {
		var validator = $("#contato").bind("invalid-form.validate", function() {

		}).validate({
			debug: false,
			errorClass: 'form-required',
			errorPlacement: function(error, element) {
				error.insertBefore(element);
			},
			rules: {
				nome: {
					required:true,
				},
				email: {
					required: true,
					email: true
				},
				mensagem: {
					required: true,
				}				
			},
		    messages: {
		        required: "Por favor, preencha este campo."
		    }			
		});

	});	

	
	$().ready(function() {
		var validator = $("#entrada").bind("invalid-form.validate", function() {

		}).validate({
			debug: false,
			errorClass: 'form-required',
			errorPlacement: function(error, element) {
				error.insertBefore(element);
			},
			rules: {
				email: {
					required: true,
					email: true
				},
				senha: {
					required: true
				}				
			},
		    messages: {
		        required: "Por favor, preencha este campo."
		    }			
		});

	});	