function Versao_Impressao(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function SubmeteContato()
{
	var mesg = "Favor preencher: \n";
	var erro = 0;
	if( document.formContato.nome.value == '' )
	{
		erro = 1;
		mesg+= " - Seu Nome \n ";
	}
	if( document.formContato.email.value == '' )
	{
		erro = 1;
		mesg+= " - E-Mail \n ";
	}
	
	if( document.formContato.assunto.value == '' )
		{
			erro = 1;
			mesg+= " - Assunto \n ";
		}

	if( document.formContato.msg.value == '' )
		{
			erro = 1;
			mesg+= " - Mensagem \n ";
		}
	if( erro == 1)
		alert(mesg);
	else
		document.formContato.submit();
}
function logar(){

	var mesg = "Preencha: \n";
	var erro = 0;

	if( document.formlogin.nome.value == '' )
	{
		erro = 1;
		mesg+= " - Seu Login \n ";
	}
	if( document.formlogin.senha.value == '' )
	{
		erro = 1;
		mesg+= " - Sua Senha \n ";
	}

	if( erro == 1)
		alert(mesg);
	else
		document.formlogin.submit();
}
function recuperar_senha(){

	var mesg = "Preencha: \n";
	var erro = 0;

	if( document.formlogin.nome.value == '' )
	{
		erro = 1;
		mesg+= " - Seu Login \n ";
	}

	if( erro == 1)
		alert(mesg);
	else
		document.formlogin.submit();
}
function apagar_dado_tabela(id,campo){

	if(confirm("Você confirma a EXCLUSÃO deste registro?")){
		self.location.href='apagar_dado_tabela.php?id='+id+'&campo='+campo;
	}
}
function editar_dado_tabela(id,campo,linha){

	if(confirm("Você deseja EDITAR este registro?")){
		self.location.href='editar_dado_tabela.php?id='+id+'&campo='+campo+'&linha='+linha;
	}
}
function apagar_anuncio(id,idmodulo){

	if(confirm("Você confirma a EXCLUSÃO deste anúncio?")){
		self.location.href='xapagar_anuncio.php?idanuncio='+id+'&idmodulo='+idmodulo;
	}
}
function editar_anuncio(id,idmodulo){

	if(confirm("Você deseja EDITAR este anúncio?")){
		self.location.href='editar_anuncio_site.php?idanuncio='+id+'&idmodulo='+idmodulo;
	}
}
function submete_inserir_usuario(){

	var mesg = "Por favor verifique o(s) campo(s): \n";
	var erro = 0;
	if( document.inserir_usuario.nome_completo.value == '' )
	{
		erro = 1;
		mesg+= "  - Nome Completo \n ";
	}
	if( document.inserir_usuario.login.value == '' )
	{
		erro = 1;
		mesg+= " - Login \n ";
	}
	if( document.inserir_usuario.senha.value == '' )
	{
		erro = 1;
		mesg+= " - Senha \n ";
		
	}else{
		var tamanho = document.inserir_usuario.senha.value;
		if(tamanho.length<=7){
			erro = 1;
			mesg += " - Senha deve conter mínimo 8 caracteres\n ";		

		}
		if(document.inserir_usuario.senha.value!=document.inserir_usuario.resenha.value){
			erro = 1;
			mesg += " - Senha e Repetir Senha não estão iguais.\n ";
		}
	}
	
	if( document.inserir_usuario.email.value == '' )
		{
			erro = 1;
			mesg+= " - E-mail \n ";
		}

	if( erro == 1)
		alert(mesg);
	else
		document.inserir_usuario.submit();
}
function excluir_usuario_sistema(idCliente,idUsuario){

	if(confirm("Você deseja EXCLUIR este Usuário?")){
		self.location.href='xexcluir_usuario_sistema.php?idCliente='+idCliente+'&idUsuario='+idUsuario;
	}
}
function editar_usuario_sistema(idCliente,idUsuario){

	if(confirm("Você deseja EDITAR DADOS deste Usuário?")){
		self.location.href='editar_usuario_sistema.php?idCliente='+idCliente+'&idUsuario='+idUsuario;
	}
}
function submete_editar_usuario(){

	var mesg = "Por favor verifique o(s) campo(s): \n";
	var erro = 0;
	if( document.editar_usuario.nome_completo.value == '' )
	{
		erro = 1;
		mesg+= "  - Nome Completo \n ";
	}
	if( document.editar_usuario.login.value == '' )
	{
		erro = 1;
		mesg+= " - Login \n ";
	}
	if( document.editar_usuario.senha.value == '' )
	{
		erro = 1;
		mesg+= " - Senha \n ";
		
	}else{
		var tamanho = document.editar_usuario.senha.value;
		if(tamanho.length<=7){
			erro = 1;
			mesg += " - Senha deve conter mínimo 8 caracteres\n ";		

		}
		if(document.editar_usuario.senha.value!=document.editar_usuario.resenha.value){
			erro = 1;
			mesg += " - Senha e Repetir Senha não estão iguais.\n ";
		}
	}
	
	if( document.editar_usuario.email.value == '' )
		{
			erro = 1;
			mesg+= " - E-mail \n ";
		}

	if( erro == 1)
		alert(mesg);
	else
		document.editar_usuario.submit();
}