function get_flash(arquivo, largura, altura, bgcolor, id, qualidade, alinhamento,transparente) {
	var obj = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+largura+'" height="'+altura+'" id="'+id+'" align="'+alinhamento+'" style="z-index:2">';
	obj+= '<param name="allowScriptAccess" value="sameDomain" />';
	obj+= '<param name="movie" value="'+arquivo+'" />';
	obj+= '<param name="quality" value="'+qualidade+'" />';
	obj+= '<param name="wmode" value="transparent" />';
	obj+= '<param name="bgcolor" value="'+bgcolor+'" />';
	obj+= '<embed src="'+arquivo+'" wmode="transparent" menu="false" quality="'+qualidade+'" bgcolor="'+bgcolor+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	obj+= '</object>';
	document.write(obj);
}
/*
if(transparente == true) {
obj+= '<param name="wmode" value="transparent" />';
}


obj+= '<embed src="'+arquivo+'" '+((transparente==true)?'wmode="transparent"':'')+'" menu="false" quality="'+qualidade+'" bgcolor="'+bgcolor+'" width="'+largura+'" height="'+altura+'" name="'+id+'" align="'+alinhamento+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';

*/
function MM_openBrWindow(theURL,winName,features, myWidth, myHeight, isCenter) { //v3.0
	if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);
}

function mostra() {
	if(document.getElementById('indique-aberto')) {
		if(document.getElementById('indique-aberto').style.display == 'none') {
			document.getElementById('indique-aberto').style.display = 'block';
			document.getElementById('indique').style.display = 'none';
		} else {
			document.getElementById('indique-aberto').style.display = 'none';
			document.getElementById('indique').style.display = 'block';
		}
	}
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}
function exibe(id) {
	if(document.getElementById('dado'+id)) {
		if(document.getElementById('dado'+id).style.display == 'none') {
			document.getElementById('dado'+id).style.display = 'block';
		} else {
			document.getElementById('dado'+id).style.display = 'none';
		}
	}
}
function exibe2(id) {
	if(document.getElementById('dado'+id)) {
		document.getElementById('dado'+id).style.display = 'block';
	}
}
function oculta2(id) {
	if(document.getElementById('dado'+id)) {
		document.getElementById('dado'+id).style.display = 'none';
	}
}
function so_numero(field){
	field.value = field.value.replace(/[^0-9.]/g,'');
}

function Trim(v){
	// Passa o valor ou objeto recebido pela função para uma variável temporária,
	// pois se for objeto, a variável "v" só poderá ser alterada no final da função.
	var x = v
	// Cria uma varíavel temporária com o valor recebido convertido para string em minúsculas.
	// Essa variável será usada para testar se o valor recebido é uma string ou um objeto.
	var test = v.toString().toLowerCase()
	// Verifica se o valor recebido é um objeto
	if(test.indexOf("object") == 1){
		// Se v é um objeto, x recebe o valor do objeto v.
		x = v.value
	}
	// Enquanto o primeiro caractere de x (que tem índice 0) for espaço em branco,
	// x receberá um novo valor, que será o valor anterior sem o primeiro caractere.
	while(x.charAt(0) == " "){
		x = x.substr(1,x.length - 1)
	}
	// Enquanto o último caractere de x (onde o índice é definido pela quantidade de
	// carateres de x menos um) for espaço em branco, x receberá um novo valor, que
	// será o valor anterior sem o último caractere.
	while(x.charAt(x.length - 1) == " "){
		x = x.substr(0,x.length-1)
	}
	// Se o valor recebido é um objeto, o objeto recebe o valor de x, sem espaços
	// em branco à direita e à esquerda.
	if(test.indexOf("object") == 1){
		v.value = x
	} else {
		// Se não for objeto, a função retorna o valor de x sem espaços
		// em branco à direita e à esquerda.
		return x
	}
}

function cMaiusculas(field){
	field.value = field.value.replace( "\\", "" );
	field.value = field.value.replace( "'", "" );
	field.value = field.value.replace( "#", "" );
	field.value = field.value.replace( "&", "" );
	field.value = field.value.replace( "`", "" );
	field.value = field.value.replace( "´", "" );
	field.value = field.value.replace( "(", "" );
	field.value = field.value.replace( ")", "" );
	field.value = field.value.replace( "%", "" );
	field.value = field.value.replace( "$", "" );
	field.value = field.value.replace( "*", "" );
	field.value = field.value.replace( "º", "" );
	field.value = field.value.replace( "ª", "" );
	field.value = field.value.replace( ">", "" );
	field.value = field.value.replace( "<", "" );
	field.value = field.value.replace( ";", "" );
	field.value = field.value.replace( "=", "" );
	field.value = field.value.replace( "+", "" );
	field.value = field.value.replace( "!", "" );
	field.value = field.value.replace( ".", "" );
	field.value = field.value.replace( "\"", "" );
	field.value = field.value.toUpperCase();
}

function cMinusculas(field){
	field.value = field.value.toLowerCase();
}

function cad_usuario(){
	if(document.getElementById('cad_cpf').value == '') {
		window.alert('O campo CPF é obrigatorio a!');
		document.getElementById('cad_cpf').focus();
		document.getElementById('cpf_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('nome').value == '') {
		window.alert('O campo NOME é obrigatorio!');
		document.getElementById('nome').focus();
		document.getElementById('nome_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('dt_nasc_dia').value == '') {
		window.alert('O campo DIA DE NASCIMENTO é obrigatorio!');
		document.getElementById('dt_nasc_dia').focus();
		document.getElementById('dt_nasc_dia_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('dt_nasc_mes').value == '') {
		window.alert('O campo MÊS DE NASCIMENTO é obrigatorio!');
		document.getElementById('dt_nasc_mes').focus();
		document.getElementById('dt_nasc_mes_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('dt_nasc_ano').value == '') {
		window.alert('O campo ANO DE NASCIMENTO é obrigatorio!');
		document.getElementById('dt_nasc_ano').focus();
		document.getElementById('dt_nasc_ano_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('email').value == '') {
		window.alert('O campo E-MAIL é obrigatorio!');
		document.getElementById('email').focus();
		document.getElementById('email_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('email2').value == '') {
		window.alert('O campo E-MAIL é obrigatorio!');
		document.getElementById('email2').focus();
		document.getElementById('email2_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('email').value != document.getElementById('email2').value) {
		window.alert('Digite o mesmo E-MAIL nos dois campos');
		document.getElementById('email2').value = "";
		document.getElementById('email2').focus();
		document.getElementById('email3_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('ddd1').value == '') {
		window.alert('O campo DDD DO TELEFONE 01 é obrigatorio!');
		document.getElementById('ddd1').focus();
		document.getElementById('ddd1_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('tel1').value == '') {
		window.alert('O campo TELEFONE 01 é obrigatorio!');
		document.getElementById('tel1').focus();
		document.getElementById('tel1_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('sexo').value == '') {
		window.alert('O campo SEXO é obrigatorio!');
		document.getElementById('sexo').focus();
		document.getElementById('sexo_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtCep').value == '') {
		window.alert('O campo CEP é obrigatorio!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtEndereco').value == '') {
		window.alert('O campo ENDEREÇO é obrigatorio, favor fazer a busca pelo CEP!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtBairro').value == '') {
		window.alert('O campo BAIRRO é obrigatorio, favor fazer a busca pelo CEP!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtCidade').value == '') {
		window.alert('O campo CIDADE é obrigatorio, favor fazer a busca pelo CEP!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtEstado').value == '') {
		window.alert('O campo ESTADO é obrigatorio, favor fazer a busca pelo CEP!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('end_num').value == '') {
		window.alert('O campo NÚMERO DO ENDEREÇO é obrigatorio!');
		document.getElementById('end_num').focus();
		document.getElementById('end_num_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('como_conheceu').value == '') {
		window.alert('O campo COMO CONHEÇEU O CAPIXABÃO é obrigatorio!');
		document.getElementById('como_conheceu').focus();
		document.getElementById('como_conheceu_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('senha1').value == '') {
		window.alert('O campo SENHA é obrigatorio!');
		document.getElementById('senha1').focus();
		document.getElementById('senha1_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('senha2').value == '') {
		window.alert('Favor re-digitar a senha!');
		document.getElementById('senha2').focus();
		document.getElementById('senha2_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('senha1').value != document.getElementById('senha2').value) {
		window.alert('Digite a mesma senha nos dois campos');
		document.getElementById('senha1').focus();
		document.getElementById('senha1').value = "";
		document.getElementById('senha2').value = "";
		document.getElementById('senha1_o').style.display = 'block';
		document.getElementById('senha2_o').style.display = 'block';
		return false;
	}
	else
	if(document.getElementById('email').value != '') {
		var invalid;
		invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
		// verifica se o email é válido
		if (invalid.test(document.getElementById('email').value) == false) {
			window.alert("Endereço de E-mail inválido!");
			document.getElementById('email').focus();
			return (false);
		}
	}
	if(document.getElementById('cad_cpf').value != '') {
		//valida_cpf(document.getElementById('cad_cpf').value);
		var i;
		//s = limpa_string(s);
		var c = document.getElementById('cad_cpf').value.substr(0,9);
		var dv = document.getElementById('cad_cpf').value.substr(9,2);
		var d1 = 0;
		for (i = 0; i < 9; i++)
		{
			d1 += c.charAt(i)*(10-i);
		}
		if (d1 == 0) {
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf').focus();
			document.getElementById('cpf2_o').style.display = 'block';
			return false;
		}
		d1 = 11 - (d1 % 11);
		if (d1 > 9) d1 = 0;
		if (dv.charAt(0) != d1)
		{
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf').focus();
			document.getElementById('cpf2_o').style.display = 'block';

			return false;
		}

		d1 *= 2;
		for (i = 0; i < 9; i++)
		{
			d1 += c.charAt(i)*(11-i);
		}
		d1 = 11 - (d1 % 11);
		if (d1 > 9) d1 = 0;
		if (dv.charAt(1) != d1)
		{
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf').focus();
			document.getElementById('cpf2_o').style.display = 'block';

			return false;
		}
	}
	document.FrmBuscaCep.submit();
}
function cad_faleconosco(){
	if(document.getElementById('nome').value == '') {
		window.alert('O campo NOME é obrigatorio!');
		document.getElementById('nome').focus();
		return false;
	} else
	if(document.getElementById('email2').value == '') {
		window.alert('O campo E-MAIL é obrigatorio!');
		document.getElementById('email2').focus();
		return false;
	} else
	if(document.getElementById('telefone').value == '') {
		window.alert('O campo TELEFONE é obrigatorio!');
		document.getElementById('telefone').focus();
		return false;
	} else
	if(document.getElementById('como_conheceu').value == '') {
		window.alert('O campo COMO CONHECEU O CAPIXABÃO é obrigatorio!');
		document.getElementById('como_conheceu').focus();
		return false;
	} else
	if(document.getElementById('assunto').value == '') {
		window.alert('O campo ASSUNTO é obrigatorio!');
		document.getElementById('assunto').focus();
		return false;
	} else
	if(document.getElementById('area').value == '') {
		window.alert('O campo ÁREA é obrigatorio!');
		document.getElementById('area').focus();
		return false;
	} else
	if(document.getElementById('msg').value == '') {
		window.alert('O campo MENSAGEM é obrigatorio!');
		document.getElementById('msg').focus();
		return false;
	} else
	if(document.getElementById('img_seguranca').value == '') {
		window.alert('O campo IMAGEM DE SEGURANÇA é obrigatorio!');
		document.getElementById('img_seguranca').focus();
		return false;
	} else
	if(document.getElementById('email2').value != '') {
		var invalid;
		invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
		// verifica se o email é válido
		if (invalid.test(document.getElementById('email2').value) == false) {
			window.alert("Endereço de E-mail inválido!");
			document.getElementById('email2').focus();
			return (false);
		}
	}
	document.frm_fale_conosco.submit();
}
function cad_receita(){
	if(document.getElementById('titulo').value == '') {
		window.alert('O campo TITULO é obrigatorio!');
		document.getElementById('titulo').focus();
		return false;
	} else
	if(document.getElementById('ingredientes').value == '') {
		window.alert('O campo INGREDIENTES é obrigatorio!');
		document.getElementById('ingredientes').focus();
		return false;
	} else
	if(document.getElementById('categoria').value == '') {
		window.alert('O campo CATEGORIA é obrigatorio!');
		document.getElementById('categoria').focus();
		return false;
	} else
	if(document.getElementById('preparo').value == '') {
		window.alert('O campo MODO DE PREPARO é obrigatorio!');
		document.getElementById('preparo').focus();
		return false;
	}
	document.frm_envia_receita.submit();
}
function cad_anuncio(){
	if(document.getElementById('nome').value == '') {
		window.alert('O campo NOME é obrigatorio!');
		document.getElementById('nome').focus();
		return false;
	} else
	if(document.getElementById('telefone').value == '') {
		window.alert('O campo TELEFONE é obrigatorio!');
		document.getElementById('telefone').focus();
		return false;
	} else
	if(document.getElementById('categoria').value == '') {
		window.alert('O campo CATEGORIA é obrigatorio!');
		document.getElementById('categoria').focus();
		return false;
	} else
	if(document.getElementById('descricao').value == '') {
		window.alert('O campo DESCRIÇÃO é obrigatorio!');
		document.getElementById('descricao').focus();
		return false;
	}
	document.getElementById('bt_interagir2').style.display = 'none';
	document.getElementById('carregandoo').style.display = 'block';
	document.frm_envia_anuncio.submit();
}

function cad_usuario_alterar(){
	if(document.getElementById('cad_cpf2').value == '') {
		window.alert('O campo CPF é obrigatorio b!');
		document.getElementById('cad_cpf2').focus();
		document.getElementById('cpf_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('nome').value == '') {
		window.alert('O campo NOME é obrigatorio!');
		document.getElementById('nome').focus();
		document.getElementById('nome_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('dt_nasc_dia').value == '') {
		window.alert('O campo DIA DE NASCIMENTO é obrigatorio!');
		document.getElementById('dt_nasc_dia').focus();
		document.getElementById('dt_nasc_dia_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('dt_nasc_mes').value == '') {
		window.alert('O campo MÊS DE NASCIMENTO é obrigatorio!');
		document.getElementById('dt_nasc_mes').focus();
		document.getElementById('dt_nasc_mes_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('dt_nasc_ano').value == '') {
		window.alert('O campo ANO DE NASCIMENTO é obrigatorio!');
		document.getElementById('dt_nasc_ano').focus();
		document.getElementById('dt_nasc_ano_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('email22').value == '') {
		window.alert('O campo E-MAIL é obrigatorio!');
		document.getElementById('email22').focus();
		document.getElementById('email_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('email23').value == '') {
		window.alert('O campo E-MAIL é obrigatorio!');
		document.getElementById('email23').focus();
		document.getElementById('email2_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('email22').value != document.getElementById('email23').value) {
		window.alert('Digite o mesmo E-MAIL nos dois campos');
		document.getElementById('email23').value = "";
		document.getElementById('email23').focus();
		document.getElementById('email3_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('ddd1').value == '') {
		window.alert('O campo DDD DO TELEFONE 01 é obrigatorio!');
		document.getElementById('ddd1').focus();
		document.getElementById('ddd1_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('tel1').value == '') {
		window.alert('O campo TELEFONE 01 é obrigatorio!');
		document.getElementById('tel1').focus();
		document.getElementById('tel1_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('sexo').value == '') {
		window.alert('O campo SEXO é obrigatorio!');
		document.getElementById('sexo').focus();
		document.getElementById('sexo_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtCep').value == '') {
		window.alert('O campo CEP é obrigatorio!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtEndereco').value == '') {
		window.alert('O campo ENDEREÇO é obrigatorio, favor fazer a busca pelo CEP!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtBairro').value == '') {
		window.alert('O campo BAIRRO é obrigatorio, favor fazer a busca pelo CEP!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtCidade').value == '') {
		window.alert('O campo CIDADE é obrigatorio, favor fazer a busca pelo CEP!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('TxtEstado').value == '') {
		window.alert('O campo ESTADO é obrigatorio, favor fazer a busca pelo CEP!');
		document.getElementById('TxtCep').focus();
		document.getElementById('TxtCep_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('end_num').value == '') {
		window.alert('O campo NÚMERO DO ENDEREÇO é obrigatorio!');
		document.getElementById('end_num').focus();
		document.getElementById('end_num_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('como_conheceu').value == '') {
		window.alert('O campo COMO CONHEÇEU O CAPIXABÃO é obrigatorio!');
		document.getElementById('como_conheceu').focus();
		document.getElementById('como_conheceu_o').style.display = 'block';
		return false;
	} /*else
	if(document.getElementById('senha1').value == '') {
	window.alert('O campo SENHA é obrigatorio!');
	document.getElementById('senha1').focus();
	document.getElementById('senha1_o').style.display = 'block';
	return false;
	} else
	if(document.getElementById('senha2').value == '') {
	window.alert('Favor re-digitar a senha!');
	document.getElementById('senha2').focus();
	document.getElementById('senha2_o').style.display = 'block';
	return false;
	} */else
	if(document.getElementById('senha1').value != '') {
		if(document.getElementById('senha1').value != document.getElementById('senha2').value) {
			window.alert('Digite a mesma senha nos dois campos');
			document.getElementById('senha1').focus();
			document.getElementById('senha1').value = "";
			document.getElementById('senha2').value = "";
			document.getElementById('senha1_o').style.display = 'block';
			document.getElementById('senha2_o').style.display = 'block';
			return false;
		}
	}
	else
	if(document.getElementById('email22').value != '') {
		var invalid;
		invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
		// verifica se o email é válido
		if (invalid.test(document.getElementById('email22').value) == false) {
			window.alert("Endereço de E-mail inválido!");
			document.getElementById('email22').focus();
			return (false);
		}
	}
	if(document.getElementById('cad_cpf2').value != '') {
		//valida_cpf(document.getElementById('cad_cpf').value);
		var i;
		//s = limpa_string(s);
		var c = document.getElementById('cad_cpf2').value.substr(0,9);
		var dv = document.getElementById('cad_cpf2').value.substr(9,2);
		var d1 = 0;
		for (i = 0; i < 9; i++)
		{
			d1 += c.charAt(i)*(10-i);
		}
		if (d1 == 0) {
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf2').focus();
			document.getElementById('cpf2_o').style.display = 'block';
			return false;
		}
		d1 = 11 - (d1 % 11);
		if (d1 > 9) d1 = 0;
		if (dv.charAt(0) != d1)
		{
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf2').focus();
			document.getElementById('cpf2_o').style.display = 'block';

			return false;
		}

		d1 *= 2;
		for (i = 0; i < 9; i++)
		{
			d1 += c.charAt(i)*(11-i);
		}
		d1 = 11 - (d1 % 11);
		if (d1 > 9) d1 = 0;
		if (dv.charAt(1) != d1)
		{
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf2').focus();
			document.getElementById('cpf2_o').style.display = 'block';

			return false;
		}
	}
	document.FrmBuscaCep.submit();
}

function cad_usuario_esqueci(){
	if(document.getElementById('cad_cpf3').value == '') {
		window.alert('O campo CPF é obrigatorio c!');
		document.getElementById('cad_cpf3').focus();
		document.getElementById('cpf_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('email3').value == '') {
		window.alert('O campo E-MAIL é obrigatorio!');
		document.getElementById('email3').focus();
		document.getElementById('email_o').style.display = 'block';
		return false;
	} else
	if(document.getElementById('email3').value != '') {
		var invalid;
		invalid = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/;
		// verifica se o email é válido
		if (invalid.test(document.getElementById('email3').value) == false) {
			window.alert("Endereço de E-mail inválido!");
			document.getElementById('email3').focus();
			return (false);
		}
	}
	if(document.getElementById('cad_cpf3').value != '') {
		//valida_cpf(document.getElementById('cad_cpf').value);
		var i;
		//s = limpa_string(s);
		var c = document.getElementById('cad_cpf3').value.substr(0,9);
		var dv = document.getElementById('cad_cpf3').value.substr(9,2);
		var d1 = 0;
		for (i = 0; i < 9; i++)
		{
			d1 += c.charAt(i)*(10-i);
		}
		if (d1 == 0) {
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf3').focus();
			document.getElementById('cpf2_o').style.display = 'block';
			return false;
		}
		d1 = 11 - (d1 % 11);
		if (d1 > 9) d1 = 0;
		if (dv.charAt(0) != d1)
		{
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf3').focus();
			document.getElementById('cpf2_o').style.display = 'block';

			return false;
		}

		d1 *= 2;
		for (i = 0; i < 9; i++)
		{
			d1 += c.charAt(i)*(11-i);
		}
		d1 = 11 - (d1 % 11);
		if (d1 > 9) d1 = 0;
		if (dv.charAt(1) != d1)
		{
			window.alert("CPF inválido!");
			document.getElementById('cad_cpf3').focus();
			document.getElementById('cpf2_o').style.display = 'block';

			return false;
		}
	}
	document.FrmEsqueci.submit();
}

function oculta_alert(campo_doido){
	document.getElementById(campo_doido).style.display = 'none';
	//document.getElementById('TxtCidade').disabled = true;
}

function valida_cpf(s)	{
	var i;
	//s = limpa_string(s);
	var c = s.substr(0,9);
	var dv = s.substr(9,2);
	var d1 = 0;
	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(10-i);
	}
	if (d1 == 0) return false;
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(0) != d1)
	{
		return false;
	}

	d1 *= 2;
	for (i = 0; i < 9; i++)
	{
		d1 += c.charAt(i)*(11-i);
	}
	d1 = 11 - (d1 % 11);
	if (d1 > 9) d1 = 0;
	if (dv.charAt(1) != d1)
	{
		return false;
	}
	return true;
}
function alterar_cep(id) {
	if(document.getElementById(id)) {
		if(document.getElementById(id).style.display == 'none') {
			document.getElementById(id).style.display = 'block';
		} else {
			document.getElementById(id).style.display = 'none';
		}
	}
}
function moeda(z){
	v = z.value;
	v=v.replace(/\D/g,"")  //permite digitar apenas números
	v=v.replace(/[0-9]{12}/,"inválido")   //limita pra máximo 999.999.999,99
	v=v.replace(/(\d{1})(\d{8})$/,"$1.$2")  //coloca ponto antes dos últimos 8 digitos
	v=v.replace(/(\d{1})(\d{5})$/,"$1.$2")  //coloca ponto antes dos últimos 5 digitos
	v=v.replace(/(\d{1})(\d{1,2})$/,"$1,$2")    //coloca virgula antes dos últimos 2 digitos
	z.value = v;
}

$(document).ready(function(){

	//Page Flip on hover

	$("#pageflip").hover(function() {
		$("#pageflip img , .msg_block").stop()
		.animate({
			width: '307px',
			height: '319px'
		}, 500);
	} , function() {
		$("#pageflip img").stop()
		.animate({
			width: '50px',
			height: '52px'
		}, 220);
		$(".msg_block").stop()
		.animate({
			width: '50px',
			height: '50px'
		}, 200);
	});


});