// JavaScript Document
			function Limpa(S)
			{
				var Digitos = "0123456789";
				var temp = "";
				var digito = "";
				for (var i=0; i<S.length; i++){
					digito = S.charAt(i);
					if (Digitos.indexOf(digito)>=0) {
						temp = temp + digito;
					}
				}
				return temp;
			}
			
			function Inverte(S)
			{
				var temp = "";
				for (var i=0; i<S.length; i++) {
					temp = S.charAt(i) + temp;
				}
				return temp;
			}

			function Resto(S)
			{
				var invertido = Inverte(Limpa(S));
				var soma = 0;
				for (var i=0; i<invertido.length; i++) {
					soma = soma + (i+2) * eval(invertido.charAt(i));
				}
				soma *= 10;
				return ((soma % 11) % 10);
			}
			
			function Validar_CPF(nr_cpf)
			{
				if ((nr_cpf == "000.000.000-00") || (nr_cpf == "111.111.111-11") || (nr_cpf == "222.222.222-22") || (nr_cpf == "444.444.444-44") || (nr_cpf == "555.555.555-55") || (nr_cpf == "666.666.666-66") || (nr_cpf == "777.777.777-77") || (nr_cpf == "888.888.888-88") || (nr_cpf == "999.999.999-99")) {
					return (false);
				}
				var result = "";
				var OK = false;
				var temp = Limpa(nr_cpf);
				if (temp.length>10) {
					var work = temp.substring(0,(temp.length)-2);
					var resto = Resto(work);
					OK = (resto == eval(temp.charAt((temp.length)-2)));
					if (OK){
						work = work + resto;
						resto = Resto(work);
						OK = (resto == eval(temp.charAt((temp.length)-1)));
					}
				}
				if (OK){
					return (true);
				}
				else 
				{
					return (false);
				}
			}


