function mostrar(amostrar,aocultar)
{
	document.getElementById(amostrar).style.display='block';
	document.getElementById(aocultar).style.display='none';
}
function cargaPagina(pagina,capa)
{
	respuesta=document.getElementById(capa);
	envia(pagina);
}
function borrar_producto(producto)
{
	respuesta = document.getElementById('verProdu');
	envia('gestor/ajax/accionProductos.php','producto='+producto
		  +'&accion=Eliminar');
}
function edit_producto(producto)
{
	respuesta = document.getElementById('formIproducto');
	envia('gestor/formProdu.php','producto='+producto
		  +'&accion=Editar');
}
function paginador_pro(pagina,tipo)
{
	respuesta = document.getElementById('galeriaProductos');
	envia('productos/galeria.php','pagina='+pagina
		  +'&tipo='+tipo);
}
function buscar_tiendas()
{
	document.getElementById('resultado').style.display='block';
	respuesta = document.getElementById('resultado');
	envia('tiendas/ajax/listado_tiendas.php',
		'provincia='+document.mapa_tiendas.provincia.value+
		'&localidad='+document.mapa_tiendas.localidad.value);
}
function buscar_tiendas_p(provincia,localidad)
{
	//document.getElementById('resultado').style.display='block';
	respuesta = document.getElementById('resultado');
	envia('tiendas/ajax/listado_tiendas.php',
		'provincia='+provincia+
		'&localidad='+localidad);
}

function busca_localidades(provincia){
  respuesta = document.getElementById('localidades');
  envia('tiendas/ajax/localidades.php',
  'provincia='+provincia);
}
function abre_aviso()
{
	document.getElementById('todopopup2').style.display='block';
}
function confirmar_form_contacto()
{
	if(document.getElementById('aviso').checked==true)
	{
		if(megavalidacion('datosPerso'))
			datosPerso.submit();
	}
	else
	{
		alert('No has aceptado el aviso legal');
	}
}
function editar_legal(legal)
{
  respuesta = document.getElementById('formGestorLegales');
  envia('gestor/formLegales.php',
  'id='+legal);
}
function editar_legales()
{
  
  texto = document.eLegales.texto.value.replace(/[á]/gi,'amp;aacute;');
  texto = texto.replace(/[é]/gi,'amp;eacute;');
  texto = texto.replace(/[í]/gi,'amp;iacute;');
  texto = texto.replace(/[ó]/gi,'amp;oacute;');
  texto = texto.replace(/[ú]/gi,'amp;uacute;');
  texto = texto.replace(/[ñ]/gi,'amp;ntilde;');
  texto = texto.replace(/[€]/gi,'amp;euro;');
  
 // texto = document.eLegales.texto.value.replace(/[&]/gi,'amp;');

  respuesta = document.getElementById('divGestorLegales');
  envia('gestor/ajax/accionLegales.php',
  		'id='+document.eLegales.id.value+
		'&texto='+texto);
  
}