
//****************************
//** Funciones JS Generales **
//****************************

function limpiar_formulario(){
	document.forms[0].reset();
}

function enviar_noticia(_id){
	document.forms[0].Id.value = _id;
	document.forms[0].Operacion.value = "Ficha";
	document.forms[0].action = "noticias.php";
	document.forms[0].submit();
}

function siguiente(pagina,destino){
	document.forms[0].Pagina.value = pagina;
	document.forms[0].Operacion.value = "Buscar";
	document.forms[0].action = destino+".php";
	document.forms[0].submit();
}

function cargarPopup(_url,_ancho,_alto,_x,_y){
		ventana = window.open (_url,'ventana','menubar=no,location=no,resizable=no,scrollbars=yes,status=no,width='+_ancho+',height='+_alto + ',top='+_x+',left='+_y);
		ventana.focus();
}

function enviarMail(){
    if (texto_vacio("formulario","nombre","Nombre") == false) return;
    if (texto_vacio("formulario","email","Correo electrónico") == false) return;
    if (texto_vacio("formulario","asunto","Asunto") == false) return;
    if (texto_vacio("formulario","comentarios","Comentarios") == false) return;
	document.forms["formulario"].action="contacto.php";
	document.forms["formulario"].submit();
}

function enviarTrabaja(){
    if (texto_vacio("formulario","nombre","Nombre") == false) return;
    if (texto_vacio("formulario","apellidos","Apellidos") == false) return;
    if (texto_vacio("formulario","telefono","Teléfono") == false) return;
    if (texto_vacio("formulario","fnac","Fecha de Nacimiento") == false) return;
	document.forms["formulario"].action="trabaja.php";
	document.forms["formulario"].submit();
}

function enviarSugerencia(){
    if (texto_vacio("formulario","comentarios","Comentarios") == false) return;
	document.forms["formulario"].action="sugerencias.php";
	document.forms["formulario"].submit();
}

function calcHeight()
{
  //find the height of the internal page
  var the_height=
    document.getElementById('galeria').contentWindow.
      document.body.scrollHeight;

  //change the height of the iframe
  document.getElementById('galeria').height=
      the_height;
}

function WriteLayer(elid) {
	frames['galeria'].location.href="galeria.php?id="+elid;
}