// JavaScript Document
function fotos(URL) {
  var width = 680;
  var height = 490;
  var left = 0;
  var top = 0
  window.open(URL, 'Player', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}

function carregando(endereco){
var endereco;
document.getElementById(endereco).innerHTML = '<table width="250" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEDFB"><tr><td width="250" height="21" align="center" valign="middle"><img src="img/loading.gif" width="220" height="19"></td></tr><tr><td height="14" align="center" valign="middle" bgcolor="#66CCFF" class="fCarreg"><font face="Trebuchet MS, Georgia, Helvetica, sans-serif" size="2" color="#FFFFFF"><strong>Processando...</strong></font></td></tr></table>';
}
//////// ###############################################
function mostraSubPaginaPost(pagina, destino, itemPost){
var pagina;
var Destino = destino;
var xmlHttp;
var itemPost;
try{  // Firefox, Opera 8.0+, Safari  
xmlHttp=new XMLHttpRequest();  
}
		catch (e){  // Internet Explorer  
			try{    
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
			}
		    catch (e){   
			   try{      
			   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
			   }
				catch (e){      
				alert("Your browser does not support AJAX!");      
				return false;      
				}    
			}//catch (e){  
		} //catch (e){ // Internet Explorer 
xmlHttp.onreadystatechange=function(){					
	if(xmlHttp.readyState==4){
	if(xmlHttp.status == 200){
		resultado = xmlHttp.responseText;
		if(resultado == "OTg3OTg0OTg3NDk4Nzg5NzQ4OTRlODlmNHdlOThmNHc2ZWY0ZTZ3OGY0ZXc2OGY0ZXc2OGY0ZXc2OGY0ZXc2OGY0ZTY4ZjQ="){
		document.getElementById('respostaDiv').innerHTML = '';
		document.getElementById('campoBuscaAjax').value = '';
		alert("DESCULPE, MAS SUA BUSCA NÃO RETORNOU NENHUM RESULTADO");
		return false;
		}
		
		document.getElementById(Destino).innerHTML = resultado;
		//document.getElementById('respostaDiv').innerHTML = '';
		//mudaPosicao();
		}else{
			if(xmlHttp.status == 500){
			alert("DESCULPE, MAS O SERVIDOR NÃO RESPONDEU EM UM TEMPO HÁBIL. TENTE NOVAMENTE MAIS TARDE.");
			document.getElementById('respostaDiv').innerHTML = '';
				return false;
			}
			if(xmlHttp.status == 503){
			alert("DESCULPE, MAS O SERVIDOR NÃO ESTÁ DISPONÍVEL NESTE INSTANTE. TENTE NOVAMENTE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 409){
			alert('DESCULPE, MAS HOUVE UM CONFLITO GENERALIZADO NA COMUNICAÇÃO DO SEU NAVEGADOR COM O SERVIDOR.');
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 408){
			alert("O TEMPO LIMITE DO PEDIDO, FEITO DO SEU NAVEGADOR AO SERVIDOR, FOI ESGOTADO. TENTE NOVAMENTE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 404){
			alert("DESCULPE, MAS A PÁGINA SOLICITADA NÃO FOI ENCONTRADA. CERTAMENTE JÁ FOI DELETADA DO SITE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 403){
			alert("OS RECURSOS SOLICITADOS NÃO FORAM LIBERADOS PELO SERVIDOR POR SE TRATAR DE UM LOCAL RESTRITO.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}		
			
		}
		
	}else{
	/*	
			document.getElementById('respostaDiv').innerHTML = '<table width="250" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEDFB"><tr><td width="250" height="21" align="center" valign="middle"><img src="img/loading.gif" width="220" height="19"></td></tr><tr><td height="14" align="center" valign="middle" bgcolor="#66CCFF" class="fCarreg"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"><strong>Processando...</strong></font></td></tr></table>'; */
	}					   
}
    	
    	
url = "paginas.php";
url = url+pagina;
xmlHttp.open("POST", url, true);
xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlHttp.send(itemPost);
//xmlHttp.send("texto="+encodeURIComponent(itemPost)); 
}

//////// ###############################################
function mostraPagina(pagina){
var pagina;
var xmlHttp;
try{  // Firefox, Opera 8.0+, Safari  
xmlHttp=new XMLHttpRequest();  
}
		catch (e){  // Internet Explorer  
			try{    
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
			}
		    catch (e){   
			   try{      
			   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
			   }
				catch (e){      
				alert("Your browser does not support AJAX!");      
				return false;      
				}    
			}//catch (e){  
		} //catch (e){ // Internet Explorer 
xmlHttp.onreadystatechange=function(){					
	if(xmlHttp.readyState==4){
	if(xmlHttp.status == 200){
		resultado = xmlHttp.responseText;
		if(resultado == "OTg3OTg0OTg3NDk4Nzg5NzQ4OTRlODlmNHdlOThmNHc2ZWY0ZTZ3OGY0ZXc2OGY0ZXc2OGY0ZXc2OGY0ZXc2OGY0ZTY4ZjQ="){
		document.getElementById('respostaDiv').innerHTML = '';
		//document.getElementById('campoBuscaAjax').value = '';
		alert("DESCULPE, MAS SUA BUSCA NÃO RETORNOU NENHUM RESULTADO");
		return false;
		}
		
		document.getElementById('conteudo01').innerHTML = resultado;
		document.getElementById('respostaDiv').innerHTML = '';
		//mudaPosicao();
		}else{
			if(xmlHttp.status == 500){
			alert("DESCULPE, MAS O SERVIDOR NÃO RESPONDEU EM UM TEMPO HÁBIL. TENTE NOVAMENTE MAIS TARDE.");
			document.getElementById('respostaDiv').innerHTML = '';
				return false;
			}
			if(xmlHttp.status == 503){
			alert("DESCULPE, MAS O SERVIDOR NÃO ESTÁ DISPONÍVEL NESTE INSTANTE. TENTE NOVAMENTE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 409){
			alert('DESCULPE, MAS HOUVE UM CONFLITO GENERALIZADO NA COMUNICAÇÃO DO SEU NAVEGADOR COM O SERVIDOR.');
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 408){
			alert("O TEMPO LIMITE DO PEDIDO, FEITO DO SEU NAVEGADOR AO SERVIDOR, FOI ESGOTADO. TENTE NOVAMENTE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 404){
			alert("DESCULPE, MAS A PÁGINA SOLICITADA NÃO FOI ENCONTRADA. CERTAMENTE JÁ FOI DELETADA DO SITE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 403){
			alert("OS RECURSOS SOLICITADOS NÃO FORAM LIBERADOS PELO SERVIDOR POR SE TRATAR DE UM LOCAL RESTRITO.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}		
			
		}
		
	}else{
			document.getElementById('respostaDiv').innerHTML = '<table width="250" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEDFB"><tr><td width="250" height="21" align="center" valign="middle"><img src="img/loading.gif" width="220" height="19"></td></tr><tr><td height="14" align="center" valign="middle" bgcolor="#66CCFF" class="fCarreg"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"><strong>Processando...</strong></font></td></tr></table>';
	}					   
}
    	
    	
url = "paginas.php";
url = url+pagina;
xmlHttp.open("GET", url, true);
xmlHttp.send(null); 

}	
///////////////////////////////////
function mostraSubPagina(pagina, destino){
var pagina;
var Destino = destino;
var xmlHttp;
try{  // Firefox, Opera 8.0+, Safari  
xmlHttp=new XMLHttpRequest();  
}
		catch (e){  // Internet Explorer  
			try{    
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");    
			}
		    catch (e){   
			   try{      
			   xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");      
			   }
				catch (e){      
				alert("Your browser does not support AJAX!");      
				return false;      
				}    
			}//catch (e){  
		} //catch (e){ // Internet Explorer 
xmlHttp.onreadystatechange=function(){					
	if(xmlHttp.readyState==4){
	if(xmlHttp.status == 200){
		resultado = xmlHttp.responseText;
		if(resultado == "OTg3OTg0OTg3NDk4Nzg5NzQ4OTRlODlmNHdlOThmNHc2ZWY0ZTZ3OGY0ZXc2OGY0ZXc2OGY0ZXc2OGY0ZXc2OGY0ZTY4ZjQ="){
		document.getElementById('respostaDiv').innerHTML = '';
		document.getElementById('campoBuscaAjax').value = '';
		alert("DESCULPE, MAS SUA BUSCA NÃO RETORNOU NENHUM RESULTADO");
		return false;
		}
		
		document.getElementById(Destino).innerHTML = resultado;
		// document.getElementById('respostaDiv').innerHTML = '';
		//mudaPosicao();
		}else{
			if(xmlHttp.status == 500){
			alert("DESCULPE, MAS O SERVIDOR NÃO RESPONDEU EM UM TEMPO HÁBIL. TENTE NOVAMENTE MAIS TARDE.");
			document.getElementById('respostaDiv').innerHTML = '';
				return false;
			}
			if(xmlHttp.status == 503){
			alert("DESCULPE, MAS O SERVIDOR NÃO ESTÁ DISPONÍVEL NESTE INSTANTE. TENTE NOVAMENTE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 409){
			alert('DESCULPE, MAS HOUVE UM CONFLITO GENERALIZADO NA COMUNICAÇÃO DO SEU NAVEGADOR COM O SERVIDOR.');
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 408){
			alert("O TEMPO LIMITE DO PEDIDO, FEITO DO SEU NAVEGADOR AO SERVIDOR, FOI ESGOTADO. TENTE NOVAMENTE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 404){
			alert("DESCULPE, MAS A PÁGINA SOLICITADA NÃO FOI ENCONTRADA. CERTAMENTE JÁ FOI DELETADA DO SITE.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}
			if(xmlHttp.status == 403){
			alert("OS RECURSOS SOLICITADOS NÃO FORAM LIBERADOS PELO SERVIDOR POR SE TRATAR DE UM LOCAL RESTRITO.");
			document.getElementById('respostaDiv').innerHTML = '';
			return false;
			}		
			
		}
		
	}else{
	/*	
			document.getElementById('respostaDiv').innerHTML = '<table width="250" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEDFB"><tr><td width="250" height="21" align="center" valign="middle"><img src="img/loading.gif" width="220" height="19"></td></tr><tr><td height="14" align="center" valign="middle" bgcolor="#66CCFF" class="fCarreg"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#FFFFFF"><strong>Processando...</strong></font></td></tr></table>'; */
	}					   
}
    	
    	
url = "paginas.php";
url = url+pagina;
xmlHttp.open("GET", url, true);
xmlHttp.send(null); 
}


function logar(){
	lg = document.getElementById('tab_login_usuario').value;
	sh = document.getElementById('tab_senha_usuario').value;
	if(lg == ""){
		document.getElementById('respLogin').innerHTML = "&nbsp;<img src='img/action_delete.png' border='0' />&nbsp;<font face='verdana, arial' size='2' color='#FF0000'>Para logar, informe o login</font>";
		return false;
	}
	if(sh == ""){
		document.getElementById('respLogin').innerHTML = "&nbsp;<img src='img/action_delete.png' border='0' />&nbsp;<font face='verdana, arial' size='2' color='#FF0000'>Para logar, informe a senha</font>";
		return false;
	}
	mostraSubPaginaPost('?dp=bG9naW4uY29udHJvbGU=', 'respLogin2', 'tab_login_usuario='+encodeURIComponent(lg)+'&tab_senha_usuario='+encodeURIComponent(sh)+'');
}
function loginLmp(){
	document.getElementById('respLogin').innerHTML = "";
}

function calcular(a, b){ 
	var a; 
	var b;  
	var metros = document.getElementById('metros').value; 
	var centimetros = document.getElementById('centimetros').value; 
	var peso = document.getElementById('peso').value; 
	document.getElementById('dv').innerHTML = '<p>Calculando...</p>'; 
	mostraSubPagina('?dp='+a+'&peso='+peso+'&altura='+metros+'.'+centimetros+'', b);
}

function orcamento(){
	nome = document.getElementById('nomeu').value;
	email = document.getElementById('emailu').value;
	telefone = document.getElementById('fone').value;
	celular = document.getElementById('cel').value;
	dia_contato = document.getElementById('dia_c').value;
	hora_contato = document.getElementById('hora_c').value;
	estado = document.getElementById('id_estado').value;
	cidade = document.getElementById('id_cidades').value;
	texto = document.getElementById('txt').value;
	//news = document.getElementById('news').value;
	c = document.getElementById('news').checked;
	if(c == true){
		var news = "sim";
	}else{
		var news = "nao";
	}
	if(nome == ""){
		document.getElementById('nomeResp').innerHTML = '<font face="verdana,arial" size="2" color="#FF66FF"><strong>Por favor, informe seu nome</strong></font>';
		document.getElementById('nomeu').focus();
		return false;
	}
	if(email == ""){
		document.getElementById('emailResp').innerHTML = '<font face="verdana,arial" size="2" color="#FF66FF"><strong>Por favor, informe seu email</strong></font>';
		document.getElementById('emailu').focus();
		return false;
	}
		if(telefone == ""){
		document.getElementById('telefoneResp').innerHTML = '<font face="verdana,arial" size="2" color="#FF66FF"><strong>Por favor, informe seu telefone</strong></font>';
		document.getElementById('fone').focus();
		return false;
	}
	document.getElementById('ldng').innerHTML = '<table width="306" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td width="54" height="25" align="center" valign="middle"><img src="img/ld.gif" width="16" height="16"></td>    <td width="252" align="left" valign="middle"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#99CCFF"><strong>Registrando, aguarde...</strong></font></td></tr></table>';
	mostraSubPaginaPost('?dp=b3JjYW1lbnRvcw==', 'orcDiv', 'nm='+encodeURIComponent(nome)+'&em='+encodeURIComponent(email)+'&telefone='+encodeURIComponent(telefone)+'&tel='+encodeURIComponent(telefone)+'&cel='+encodeURIComponent(celular)+'&dia_c='+encodeURIComponent(dia_contato)+'&id_estado='+encodeURIComponent(estado)+'&id_cidade='+encodeURIComponent(cidade)+'&hora_c='+encodeURIComponent(hora_contato)+'&txt='+encodeURIComponent(texto)+'&news='+encodeURIComponent(news)+'');	
}

function orcamentoCategoria(vl){
var vl;
document.getElementById('lcOrcParc').innerHTML = '<table width="306" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td width="54" height="25" align="center" valign="middle"><img src="img/ld.gif" width="16" height="16"></td>    <td width="252" align="left" valign="middle"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#99CCFF"><strong>Registrando, aguarde...</strong></font></td></tr></table>';
mostraSubPagina('?dp=b3JjYW1lbnRvczI=&p='+vl+'', 'lcOrcParc');

}

function orcamentoRet(){
mostraSubPagina('?dp=b3JjYW1lbnRvcw==', 'orcDiv');

}
function orcamentoObs(ender, parceiro){
	var ender;
	var parceiro;
document.getElementById('bOrcEsc_'+ender).innerHTML = '<span class="t12">Tem alguma observação a fazer?</span><br /><textarea class="fForm" name="orcDescricao_'+parceiro+'" cols="40" rows="3" id="orcDescricao"></textarea>&nbsp;<br /><br /><div id="respC_t_'+parceiro+'">DDDD</div><a href="javascript:void(0);" onclick="javascript:orcamentoParcSalva('+parceiro+');" ><span><img src="img/cadastre.png" height="20" width="20" border="0" /></span><span class="t12">Salvar registro</span></a>&nbsp;&nbsp;<span><img src="img/action_delete.png" width="20" height="20" border="0" /></span><a href="javascript:void(0);" onclick="javascript:orcamentoObsRv('+ender+', '+parceiro+');"><span class="t12">Fechar</span></a>';	
}

function orcamentoObsRv(atual, total, parceiro){
	var atual;
	var total;
	var parceiro;
document.getElementById('bOrcEsc_'+atual).innerHTML = '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="149" height="20" align="left" valign="middle" class="frc"><input name="checkbox" type="checkbox"  value="'+atual+'" onclick="javascript:orcamentoObs(this.value, '+parceiro+'); javascript:orcamentoFch('+atual+', '+total+', '+parceiro+');"><span class="t12">Selecionar este<br></span></td><td width="211" align="left" valign="middle" class="frc"><span class="t12"><input type="checkbox" name="checkbox2" id="checkbox2">Conhecer antes</span></td></tr></table>';	
}

function orcamentoFch(atual, total, parceiro){
	var atual;
	var total;
	var parceiro;
//
	var tr = total;
	for(i=1; i<=tr; i++){
		if(i !== atual){
			prc = document.getElementById('idParc_'+i+'').innerHTML;
			orcamentoObsRv(i, total, prc);	
		}
	}
}

function orcamentoParcSalva(parc){
		var parc;
		document.getElementById('respC_t_'+parc+'').innerHTML = '<table width="306" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"><tr><td width="54" height="25" align="center" valign="middle"><img src="img/ld.gif" width="16" height="16"></td>    <td width="252" align="left" valign="middle"><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#99CCFF"><strong>Registrando, aguarde...</strong></font></td></tr></table>';
		txt = document.getElementById('orcDescricao_'+parc).value;
mostraSubPaginaPost('?dp=b3JjYW1lbnRvcw==', 'orcDiv', 'parc='+encodeURIComponent(parc)+'&txtParc='+encodeURIComponent(txt)+'');		
}
function orcParcDel(vv){
	var vv;
	if(confirm("Tem certeza de que deseja eliminar este registro do seu orçamento? Para excluir, clique em OK. Para manter este registro em sua lista, clique em cancelar")){
	mostraSubPaginaPost('?dp=b3JjYW1lbnRvcw==', 'orcDiv', 'rg='+encodeURIComponent(vv)+'&action='+encodeURIComponent('88T8E9FFF887R7TT7E88E8E7F7FE8E')+'');
	}
}

function pegaFoto(vl, gl){
	var vl;
	var gl;
	document.getElementById('galeriaBoxFoto').innerHTML = '<img style="margin-top: 200px; margin-left: 250px;" src="img/loadingb.gif" border="0">';
	mostraSubPagina('?dp=Zm90b19hamF4=&gal='+gl+'&p='+vl+'', 'galeriaCentro');
}
function paginarFotos(galeria, pagina){
	
	var galeria;
	var pagina;
	mostraSubPagina('?dp=Zm90b19hamF4=&pG=9956E55F44E&pag='+pagina+'&gal='+galeria+'', 'galeriaLateralEsquerda');

}
function pegaGalerUsuario(u){
	var u;
	document.getElementById('galeriaCentro').innerHTML = '<img src="img/loading.gif" border="0">';
	mostraSubPagina('?dp=Zm90b19hamF4Mg==&us='+u+'', 'galeriaCentro');
}
function pegaGalerUsuarioPG(u, p){
	var u;
	var p;
	document.getElementById('gFoto').innerHTML = '<img src="img/loading.gif" border="0">';
	mostraSubPagina('?dp=Zm90b19hamF4Mg==&us='+u+'&pag='+p+'', 'gFoto');
}
function editaFotoDesc(foto, local){
	var foto;
	var local;
	//
	mostraSubPagina('?dp=Zm90b19hamF4X2VkaXRhckRlc2NyaWNhbw==&pic='+foto+'&local='+local+'', 'gerDescFoto_'+local);
}
function editaFotoDescBD(foto, local){
	var foto;
	var local;
	texto = document.getElementById('campo_desc_foto').value;
	
	mostraSubPaginaPost('?dp=Zm90b19hamF4X2VkaXRhckRlc2NyaWNhbw==&pic='+foto+'&action=98E8F55G4_FA', 'gerDescFoto_'+local+'', 'texto='+encodeURIComponent(texto)+'&action='+encodeURIComponent('88T8E9FFF887R7TT7E88E8E7F7FE8E')+'');
	
}
function fotoDesc(foto, local){
	var foto;
	var local;
	mostraSubPagina('?dp=Zm90b19hamF4X2VkaXRhckRlc2NyaWNhbw==&pic='+foto+'&local='+local+'&descF=8F5A88D_F85E74IF', 'gerDescFoto_'+local);
	
}
function deletarFoto(foto, galeria){
	var foto;
	var galeria;
	if(confirm("VOCÊ CLICOU NO BOTÃO DELETAR FOTO. TEM CERTEZA DE QUE PRETENDE DELETAR? ESTA AÇÃO NÃO PODE SER DESFEITA")){
	mostraSubPagina('?dp=Zm90b19hamF4X2RlbGV0YUZvdG8=&pic='+foto+'&gal='+galeria+'&descF=9988f5e889F8EEE5F7E', 'listFotos');
	}
	
} 



/////////////////////////////////
function trocaLocalidade(){
document.getElementById('localContato').innerHTML = '';
pegaEstados();	
}
function rastrearLan(pc, sess){
	var pc;
	var sess;
	mostraSubPagina('?DP=bGFuLmNvbnRyb2xlQWNlc3Nvcw==&pc='+pc+'&sess='+sess, 'divLan');
}

function pegaEstados(){
	mostraSubPagina('?dp=aW5jLmNpZGFkZXMuZXN0YWRvcw==', 'localContato');
}
function pegaCidades(Estado){
	var Estado;
	IdEstado = document.getElementById('id_estado').value;
	mostraSubPagina('?dp=aW5jLmNpZGFkZXMuZXN0YWRvcw==&Estado='+Estado+'', 'localContato');
}
function contato(controle){
	var controle;
	mostraSubPagina('?dp=aW5jLmNvbnRhdG9z&controle='+controle+'', 'contatoBox');
}
function contatoBoxFechar(){
document.getElementById('contatoBox').innerHTML = '';
}
function blogContaTexto(){
var textoPostador = document.getElementById('blogComentariosTexto').value;
var maxTexto = 1000;
Contad = '<font face="Trebuchet MS, Georgia" size="2" color="#FF6600">Máximo de caracteres permitidos: <strong>'+maxTexto+'</strong></font>';
Contad += '<br /><font face="Trebuchet MS, Georgia" size="2" color="#FF6600">Caracteres digitados: <strong>'+textoPostador.length+'</strong></font>';
if(textoPostador.length > maxTexto){
Contad += '<br /><font face="Trebuchet MS, Georgia" size="2" color="#FF0000"><strong>Atenção! Você ultrapassou o limite de '+maxTexto+' caracteres!</strong>';
document.getElementById('blogComentariosTextoAlert2').innerHTML = '<br /><font face="Trebuchet MS, Georgia" size="2" color="#FF0000">Por gentileza, resuma seu texto retirando <strong>'+(textoPostador.length - maxTexto)+'</strong>'+(((textoPostador.length - maxTexto) > 1) ? " caracteres" : " caractere")+'</font><br />';
}else{
document.getElementById('blogComentariosTextoAlert2').innerHTML = '';
}
document.getElementById('blogComenariosResp').innerHTML = Contad;
}
function contatoModal(valor){
	var valor;
	
	if(valor == "galeria" || valor == ""){
		document.getElementById('descParc').innerHTML = '<font face="Trebuchet MS, Georgia" size="2" color="#996600">Utilize este espaço para enviar seu recado para a Galeria das Noivas. O seu contato será salvo na base de dados do sistema e em instantes você receberá contato.</font>';	
	}else{
	mostraSubPagina('?dp=aW5jLmNvbnRhdG9zLm1vZGFs&parc='+valor+'', 'descParc');	
	}
}
function contatoAnalisar(){
	Cnome = document.getElementById('contatoNome').value;
	Cemail = document.getElementById('emailContato').value;
	Cfone = document.getElementById('foneContato').value;
	Ctexto = document.getElementById('blogComentariosTexto').value;
	ChoraContato = "";
	Ccheck = document.getElementById('melhorHoraParaContato').checked;
	Ccheck2 = document.getElementById('melhorHoraParaContato2').checked;
	ChoraContato += ((Ccheck) ? ("MANHÃ") : "");
	ChoraContato += ((Ccheck2) ? (" TARDE ") : "");
var nomePostador = document.getElementById('contatoNome').value;
var textoPostador = document.getElementById('blogComentariosTexto').value;
var maxTexto = 1000;
if(Cnome == ""){
		var alertar = document.getElementById('contatosNomeAlert').innerHTML;
		if(alertar = "Por favor, preencha seu nome"){
		alert("Por favor, informe seu nome!");
		}
		document.getElementById('contatosNomeAlert').innerHTML = '<font face="Trebuchet MS, Georgia" size="2" color="#FF0000">Por favor, preencha seu nome</font>';
		return false;
	}
if(Cemail == ""){
alert("Por favor, informe email de contato");
document.getElementById('contatosEmalAlert').innerHTML = '<font face="Trebuchet MS, Georgia" size="2" color="#FF0000">Por favor, informe seu email</font>';
return false;
}
if ((Cemail.length != 0) && ((Cemail.indexOf("@") < 1) || (Cemail.indexOf('.') < 7))){
alert("Por favor, informe email válido!");
document.getElementById('contatosEmalAlert').innerHTML = '<font face="Trebuchet MS, Georgia" size="2" color="#FF0000">Por favor, informe email válido.</font>';
return false;
}
	if(Ctexto == ""){
		var alertar = document.getElementById('blogComentariosTextoAlert').innerHTML;
		if(alertar = "Por favor, escreva um texto"){
		alert("Por favor, digite um texto!");
		}
		document.getElementById('blogComentariosTextoAlert').innerHTML = '<font face="Trebuchet MS, Georgia" size="2" color="#FF0000">Por favor, escreva um texto</font>';
		return false;
	}
	if(Ctexto.length > maxTexto){
		document.getElementById('blogComentariosTextoAlert2').innerHTML = '<br /><font face="Trebuchet MS, Georgia" size="4" color="#FF0000"><u>Por gentileza, resuma seu texto retirando <strong>'+(textoPostador.length - maxTexto)+'</strong>'+(((textoPostador.length - maxTexto) > 1) ? " caracteres" : " caractere")+'</u></font>';
		return false;
		
	}
if(Cfone == ""){
	if(!confirm("Você não gostaria de deixar seu telefone para um contato telefônico?")){
	return false;
	}
}
	Cnome = document.getElementById('contatoNome').value;
	Cemail = document.getElementById('emailContato').value;
	Ctexto = document.getElementById('blogComentariosTexto').value;	
	IdCidades = document.getElementById('id_cidades').value;
	IdEstado = document.getElementById('id_estado').value;
	destinoC = document.getElementById('destinoCombo').value;
	alert(destinoC);	
	document.getElementById('blogComentariosTextoAlert2').innerHTML = '';
	document.getElementById('blogComentariosTextoAlert').innerHTML = '<table width="250" border="0" cellpadding="0" cellspacing="0" bgcolor="#DBEDFB"><tr><td width="250" height="21" align="center" valign="middle"><img src="img/loading.gif" width="220" height="19"></td></tr><tr><td height="14" align="center" valign="middle" bgcolor="#66CCFF" class="fCarreg"><font face="Trebuchet MS, Georgia, Helvetica, sans-serif" size="2" color="#FFFFFF"><strong>Processando...</strong></font></td></tr></table>';
	mostraSubPaginaPost('?dp=aW5jLmNvbnRhdG9zLnBvc3Rhcg==&nm='+Cnome+'&hContato='+ChoraContato+'&fone='+Cfone+'&email='+Cemail+'&id_cidades='+IdCidades+'&id_estado='+IdEstado+'&destino='+destinoC+'', 'contatoBox', 'txt='+encodeURIComponent(Ctexto));
}
function verParceiro(parce, local){
	var parce;
	var local;
	if(confirm("VOCÊ OPTOU POR CONHECER O PROFISSIONAL ANTES DE FAZER SUA OPÇÃO. O SISTEMA TE LEVARÁ PARA O PERFIL DO PROFISSIONAL ESCOLHIDO. QUANDO VOCÊ VOLTAR PARA ESTA PÁGINA DE ORÇAMENTO, AS SUAS OPÇÕES PERMANECERÃO SALVAS. PARA IR, CLIQUE EM OK")){
		location.href = parce;
	}else{
		document.getElementById('chCaixa_'+local).checked = false;	
	}
	
}

function buscarTag(){
	pegaCampo = document.getElementById('campoBuscaAjax');
	if(pegaCampo.value == ''){
		alert("PARA UMA BUSCA É NECESSÁRIO DIGITAR ALGO NA CAIXA DE BUSCA.");
		return false;
	}
	if(pegaCampo.value.length < 3){
		alert("PARA UMA BUSCA É NECESSÁRIO DIGITAR NO MÍNIMO 3 CARACTERES");
		return false;
	}
autoComplete('2');
}
function buscaFecha(){
	document.getElementById('campoBuscaAjax').value = "";	
	autoComplete('1');
}

//-->
    if (document.images)
    {
      preload_image = new Image(25,25); 
      preload_image.src="img/loading.gif"; 
    }
function enqueteAbrir(){
	mostraSubPagina('?dp=ZW5xdWV0ZS5mcmFtZTI=', 'enquete');
}
function autoComplete(x){
var x;
var Controle = 'campoPrincipal';
var tema = document.getElementById('campoBuscaAjax').value;
//document.getElementById('contatoBox').innerHTML = '';
if(tema == ""){
document.getElementById('campoBSC').innerHTML = '';
document.getElementById('campoPrincipal').innerHTML = '';
//mostraSubPagina('?dp=aW5jLmRlZmF1bHQucHJpbmNpcGFs', Controle);
}

var myString = tema;
var mySplitResult = myString.split(" ");
marChar = 20;
for(i=0; i<mySplitResult.length; i++){
	if(tema !== ""){
		if(mySplitResult[i].length > marChar){
			document.getElementById('campoBuscaAjax').value = '';
			document.getElementById('campoBSC').innerHTML = '';
			document.getElementById('campoPrincipal').innerHTML = '';
			//mostraSubPagina('?dp=aW5jLmRlZmF1bHQucHJpbmNpcGFs', Controle);
			alert("DESCULPE, MAS PALAVRAS ACIMA DE "+marChar+" CARACTERES NÃO SÃO PERMITIDAS");
			return false;
		}
		if(tema.length > 2){
			if(x == 1){
			document.getElementById('campoBSC').innerHTML = ' <div align="left" id="reF" style="  width:630px; background-color:#FFFFCC;  padding:5px;"><font face="Trebuchet MS, Georgia" size="3" color="#990000"><strong>  Resultados sugeridos para: </strong></font><font face="verdana, arial" size="2" color="#FF6600"><u><strong>'+tema+'</strong></u></font><br /><img src="img/action_delete.png" width="16" height="16"><a href="javascript:void(0);" onClick="javascript:buscaFecha();"><font face="Trebuchet MS, Georgia" size="2" color="#FF0000"><strong>FECHAR</strong></font></a></div> ';
			}else{
			document.getElementById('campoBSC').innerHTML = ' <div align="left" id="reF" style="  width:630px; background-color:#FFFFCC;  padding:5px;"><font face="Trebuchet MS, Georgia" size="3" color="#990000"><strong>  RESULTADOS RENCONTRADOS PARA: </strong></font><font face="verdana, arial" size="2" color="#FF6600"><u><strong>'+tema+'</strong></u></font><br /><img src="img/action_delete.png" width="16" height="16"><a href="javascript:void(0);" onClick="javascript:buscaFecha();"><font face="Trebuchet MS, Georgia" size="2" color="#FF0000"><strong>FECHAR</strong></font></a></div> ';	
			}
		}//if(tema.length > 2){
	}
}

if(document.getElementById('campoBuscaAjax').value.length >= 3){
mostraSubPagina('?dp=YnVzY2EuYWpheC5zdWdlc3RvZXM=&tag='+tema+'', Controle);	
}else{
//mostraSubPagina('?dp=aW5jLmRlZmF1bHQucHJpbmNpcGFs', Controle);
}
}

function mg(){
x = screen.width;

if(x <= 1024){
x = 3;
}else{
	x = (((screen.width - 985) / 2)-10);
}
/*
document.write('<style> body {');
	document.write('margin-left: '+x+'px;');
	document.write('margin-top: 0px;');
	document.write('margin-right: 0px;');
	document.write('margin-bottom: 0px; } </style>');
*/
}
mg();

function reld(){
	location.href='./';
}
function recarregar(){

t = setTimeout('reld();', 15000);
}
function destaque(local, idi){ 
	var local;
	var idi;
	mostraSubPagina('?dp='+local+'&p='+idi+'', 'blocoAconteudo');	

}
function mural(local){
	mostraSubPagina('?dp='+local+'', 'blocoCaCont');		
}

function muralAdd(pg, cm){
	var pg;
	var cm;
	
	nome = document.getElementById('muralNome').value;
	//email = document.getElementById('muralEmail').value;
	texto = document.getElementById('muralTexto').value;
	cod = document.getElementById('captcha').value;
	document.getElementById('muralResposta').innerHTML ='Processando...';
	if(cm == "a"){ com = ""; }else{ com = cm; }
	if(nome == ""){
		document.getElementById('muralResposta').innerHTML = 'Por favor informe seu nome';
		return false;
	}
	if(document.getElementById('muralEmail').value == ""){
		document.getElementById('muralResposta').innerHTML = 'Por favor informe seu email';
		return false;
	}

	mostraSubPaginaPost('?dp='+pg+'', 'blocoCaCont', 'nm='+encodeURIComponent(nome)+'&em='+encodeURIComponent(document.getElementById('muralEmail').value)+'&txt='+encodeURIComponent(texto)+'&cm='+com+'&code='+encodeURIComponent(cod)+'');	
}

function mural2(local){
	mostraSubPagina('?dp='+local+'', 'muralEsqBx');		
}
function monU(v){
	mostraSubPagina('?dp='+v+'', 'radioCont');
}
function fale_r(local){
	mostraSubPagina('?dp='+local+'', 'frmRadio');		
}
function fale_r2(local){
	mostraSubPagina('?dp='+local+'', 'frmRadio');		
}

function enqContr(local){
	ctcSt();
	mostraSubPagina('?dp='+local+'', 'cxMconteudo');		
}  

function enqOnlinePlayer(local){
	mostraSubPagina(local, 'frmRadio');		
}
function fale_rs(pg, local){
	var pg;
	var local;
	nome = document.getElementById('nm').value;
	email = document.getElementById('em').value;
	ass = document.getElementById('assun').value;
	texto = document.getElementById('txt').value;
	document.getElementById('clf_radio').innerHTML = "Registrando, aguarde...";
	mostraSubPaginaPost('?dp='+pg+'', local, 'nm='+encodeURIComponent(nome)+'&em='+encodeURIComponent(email)+'&assunto='+ass+'&txt='+encodeURIComponent(texto)+'');	
}
function muralAdd2(pg, cm){
	var pg;
	var cm;
	nome = document.getElementById('muralNome').value;
	//email = document.getElementById('muralEmail').value;
	texto = document.getElementById('muralTexto').value;
	cod = document.getElementById('captcha').value;
	document.getElementById('muralResposta').innerHTML ='Processando...';
	if(cm == "a"){ com = ""; }else{ com = cm; }
	if(nome == ""){
		document.getElementById('muralResposta').innerHTML = 'Por favor informe seu nome';
		return false;
	}
	mostraSubPaginaPost('?dp='+pg+'', 'muralEsqBx', 'nm='+encodeURIComponent(nome)+'&em='+encodeURIComponent(document.getElementById('muralEmail').value)+'&txt='+encodeURIComponent(texto)+'&cm='+com+'&code='+encodeURIComponent(cod)+'');	
}

function _nt_(vl){
	var vl;
	mostraSubPagina('?dp='+vl+'', 'scrollNoticia');	
}
function semFoto(){
	document.getElementById('xFo').innerHTML = '';
}
function player(local, caminho, controle, creditos){
	var local;
	var caminho;
	var controle;
	var creditos
	for(i=1; i<=10; i++){ 
		if(document.getElementById('controlePlayer_'+i+'').innerHTML == '46515584451254848'){ 
		var credI = document.getElementById('c_'+i).innerHTML;
		var PathI = document.getElementById('p_'+i).innerHTML;
		document.getElementById('cPlayer_'+i).innerHTML = '<a title="'+credI+'"  href="javascript:void(0);" onclick="javascript:player(\'cPlayer_'+i+'\', \''+PathI+'\', \''+i+'\', \''+credI+'\');"><img src="img/imPlayer.jpg" width="200" height="20" border="0" alt="'+credI+'" /></a><span style="visibility:hidden;" id="controlePlayer_'+i+'"></span>';	
		}
	}
	document.getElementById(local).innerHTML = '<iframe src="player_base.php?f='+caminho+'" width="200" height="20" frameborder="0" allowtransparency="yes" marginheight="0" marginwidth="0" scrolling="no"></iframe><span style="visibility:hidden;" id="controlePlayer_'+controle+'">46515584451254848</span>';
}
function ctcSt(){
	//clearTimeout(t);
}
function rOnline(URL) {
  var width = 710;
  var height = 342;
  var left = 0;
  var top = 0
  window.open(URL+'', 'Player', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no');
}
function rOnlineUs(url){
		mostraSubPagina('?dp='+url+'', 'iNr_');	
}
function enqOnline(URL) {
  var width = 170;
  var height = 580;
  var left = 0;
  var top = 0
  window.open(URL, 'Player', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=no, fullscreen=no', '_blank');
}

function _nt_Radio(local){
	mostraSubPagina('?dp='+local+'', 'boxRadioMur');	
}

function radioLog(local, base){
	ctcSt();
	if(document.getElementById('boxRadioMurb') == true){
	document.getElementById('boxRadioMurb').innerHTML = '<img src="img/ll.gif" width="43" height="11" style="margin-right: 5px; float:left;" /><font face="verdana" size="2" color="#C60">Carregando...</font>';
	}
	mostraSubPagina('?dp='+local+'&dia='+base+'', 'boxRadioMur');	
}
function alterClasse(v, classe){
	document.getElementById('boxRlista_'+v+'').className = classe;
}
function ban_n(arq, local){
mostraSubPagina('?dp='+arq+'', ''+local+'');
}
function ban_n2(arq, local){
mostraSubPagina('?dp='+arq+'', ''+local+'');
}
function muralUsRst(a){
	mostraSubPagina('?dp='+a+'&act=77Y88T77HH8Y77U8U8J996U8', 'cxMconteudo');
}
function colore(valor){
 	var valor;
 	document.getElementById('tabela'+valor).style.background = '#DBEDFB';
 }
 function descolore(valor){
 	document.getElementById('tabela'+valor).style.background = '';
}
function abreJanela(campo){
	window.open(campo, "_parent");
}
