/* *********************************************************************************
          LITERARIA
   ******************************************************************************* */ 

  SLDmode       = 'pause'

  SLDwidth      = 190;          // ancho del plugin
  SLDheight     = 200;          // alto del plugin

  SLDspeed      = 10 ;          // velocidad
  SLDDelay      = 10;         //retardo entre un desplazamiento y el siguiente (100 brusco, 1 suave)
  SLDbgcolor      = "#FFF9F1";      // color de fondo
  SLDstartDirection   = 'right'         //direccion en la que se mueve inicialmente el banner


  SLDpauseEvery   = 190 ;
  SLDpauseDelay   = 4000;

// ---------------------------------------------

lastvalue = "  correo electrónico";

function mailfocus(obj)
{
  lastvalue = obj.value;
  obj.value="";
}

function mailblur(obj)
{
  if (obj.value=="")
    obj.value=lastvalue;
}

function nwin(fc, params)
{
  if ( typeof win!='undefined' && win.location!=null)  win.close();
  win=window.open(fc,"",params);
}

function cambiar_anio_premio(popcion,pcoleccion,panio)
{
  document.forms.formulario.action="/html/puente.html?/cgi-bin/index.pl?opcion=" +  popcion + "&coleccion=" + pcoleccion + "&anio=" + panio;
  document.forms.formulario.submit(); 
}

function busqueda_rapida(popcion,ptit_aut)
{
  if (ptit_aut == "")
  {
    document.forms.frm_busqueda.action="/html/puente.html?/cgi-bin/index.pl?opcion=busqueda_avanzada";
    document.forms.frm_busqueda.submit();
  }
  else
  {
    document.forms.frm_busqueda.action="/html/puente.html?/cgi-bin/index.pl?opcion=" +  popcion + "&coleccion=&anio=&tit_aut=" + ptit_aut;
    document.forms.frm_busqueda.submit();
  }
}

function busqueda_avanzada(pform)
{
  paction  = "/html/puente.html?/cgi-bin/index.pl?";
  paction += "opcion=busca_avanzada";
  paction += "&id_sello_editorial_web=29";
  paction += "&id_funcion=44";
  paction += "&origen=b_avanzada";
  paction += "&id_coleccion="             + pform.id_coleccion.value;
  paction += "&titulo="                   + pform.titulo.value; 
  paction += "&codigo_comercial="         + pform.codigo_comercial.value;     
  paction += "&autor="                    + pform.autor.value;
  paction += "&isbn="                     + pform.isbn.value;
  pform.action=paction;
  pform.submit(); 
}

function premios_literarios()
{
  if (document.getElementById('ipremios_literarios').style.display == "none" )
  {
    document.getElementById('ipremios_literarios').style.display="block";
    document.getElementById('ipremios_poesia').style.display="none";
  }
  else
    { document.getElementById('ipremios_literarios').style.display="none"; }
  
}

function premios_poesia()
{
  if ( document.getElementById('ipremios_poesia').style.display == "none" )
  {
    document.getElementById('ipremios_poesia').style.display="block";
    document.getElementById('ipremios_literarios').style.display="none";
  }
  else
    { document.getElementById('ipremios_poesia').style.display="none"; }
}

function recibir_novedades(servidor,pcorreo)
{
  if (pcorreo != "")
    abre_ventana(servidor+'/algaida_literaria/cgi-bin/suscripciones/novedades.pl?e_mail='+pcorreo,'Suscripcion','toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=750,height=600,screenX=100,screenY=50');
}

function submitenterbuscar(myfield,e)
{
  var keycode;

  if (window.event) keycode = window.event.keyCode;
  else if (e) keycode = e.which;
  else return true;

  if (keycode == 13)
  {
    busqueda_rapida('busqueda_rapida', document.forms.frm_busqueda.tit_aut.value);      
    return false;
  }
  else
    return true;
}