function delete_cliente(id,indice) {
	p = confirm("Você realmente deseja deletar?");
	if (p) {
		goto("delete_cliente.php?id="+id+"&indice="+indice);
	}
}



function delete_imagem_principal(id,indice) {
	p = confirm("Você realmente deseja deletar essa imagem?");
	if (p) {
		goto("delete_imagem_principal.php?id="+id+"&indice="+indice);
	}
}

function delete_fotos(id,id_foto,indice) {
	p = confirm("Você realmente deseja deletar essa foto?");
	if (p) {
		goto("delete_fotos.php?id="+id+"&id_foto="+id_foto+"&indice="+indice);
	}
}

function delete_destaque(id) {
	p = confirm("Você realmente deseja deletar esse destaque?");
	if (p) {
		goto("delete_destaque.php?id="+id);
	}
}

function goto(url_to) {
	window.location = url_to;
}

////////////////////////////////////////////////////////////////////////////////
// funcoes para deletar arquivos.
// parametro 'tabela' = é o id do cliente
// parametro 'id' = é o id do arquivo
////////////////////////////////////////////////////////////////////////////////
function delete_arquivos_cliente(tabela,id) {
	p = confirm("Você realmente deseja deletar esse arquivo?");
	if (p) {
		goto("deleta_arquivos.php?tabela="+tabela+"&id="+id);
	}
}

function delete_arquivos_contato(tabela,id) {
	p = confirm("Você realmente deseja deletar esse arquivo?");
	if (p) {
		goto("deleta_arquivos_contato.php?tabela="+tabela+"&id="+id);
	}
}

function delete_arquivos_camila_contato(tabela,id) {
	p = confirm("Você realmente deseja deletar esse arquivo?");
	if (p) {
		goto("deleta_camila_contato.php?tabela="+tabela+"&id="+id);
	}
}

function delete_arquivos_camila(tabela,id) {
	p = confirm("Você realmente deseja deletar esse arquivo?");
	if (p) {
		goto("deleta_camila.php?tabela="+tabela+"&id="+id);
	}
}

function delete_arquivos_cliente_visualiza(tabela,id) {
	p = confirm("Você realmente deseja deletar esse arquivo?");
	if (p) {
		goto("deleta_arquivos_visualiza.php?tabela="+tabela+"&id="+id);
	}
}

function delete_arquivos_camila_visualiza(tabela,id) {
	p = confirm("Você realmente deseja deletar esse arquivo?");
	if (p) {
		goto("deleta_camila_visualiza.php?tabela="+tabela+"&id="+id);
	}
}

function delete_cliente_contato(id_contato,id_cliente) {
	p = confirm("Você realmente deseja deletar esse contato?");
	if (p) {
		goto("delete_cliente_contato.php?id_contato="+id_contato+"&id_cliente="+id_cliente);
	}
}

function delete_arquivos(id,tipo) {
	p = confirm("Você realmente deseja deletar esse arquivo?");
	if (p) {
		goto("delete_arquivos.php?id="+id+"&tipo="+tipo);
	}
}

function mudar_tipo(parametro, tp_action, campo_type){
	span = document.getElementById("senha_span");
	campo = document.getElementById("senha_input");
	
	if(campo.value == "senha" && tp_action == "focus" && campo_type == "text"){
		
		span.innerHTML = "<input id='senha_input' name='senha' onfocus='mudar_tipo(this, \"focus\",\"password\");' onblur='mudar_tipo(this, \"blur\",\"password\");' type='password' value='' />";
		setTimeout("document.getElementById('senha_input').focus()",100);
	}
	
	if(campo.value == "" && tp_action == "blur" && campo_type == "password"){
		
		span.innerHTML = "<input id='senha_input' name='senha' onfocus='mudar_tipo(this, \"focus\",\"text\");' onblur='mudar_tipo(this, \"blur\",\"text\");' type='text' value='senha' />";
		 
	}
	
}


function busca_contato_voce(id_cliente,id_contato){
	
	window.location.href = "arquivos.php?id="+id_cliente+"&id_contato="+id_contato+"#voce_cliente";		
}

function busca_contato_cliente(id_cliente,id_contato){
	
	window.location.href = "arquivos.php?id="+id_cliente+"&id_contato="+id_contato;		
}

function hideShowLayer(hide_first, hide_second, show_first){
			
	
	document.getElementById(hide_first).style.display='none';	
	document.getElementById(hide_second).style.display='none';
	document.getElementById(show_first).style.display='block';
	
		
				
	}
	
	function showHideLayer(hide_first, show_first, show_second){
			
	document.getElementById(hide_first).style.display='none';
	document.getElementById(show_first).style.display='block';	
	document.getElementById(show_second).style.display='block';
	
	
		
				
	}
