/**
 * Biblioteca de la UCA
 * Funciones comunes
 */

/** Incluye el JavaScript de la UCA **/

document.write('<script LANGUAGE="JavaScript1.2" src="http://www.uca.es/js/uca.js"></' + 'script>');

// Funciones para DIANA

function barranav() {
codigobarranav =                 '<div class="PIEPAGINA"><hr style="margin:0; padding:0;"><map name="mapaind">'
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/default.asp"                  shape="poly"   coords="37, 8, 61, 20, 37, 34, 14, 20" alt="Página de entrada a la Biblioteca">';
codigobarranav = codigobarranav+ '  <area href="javascript:history.back()"                             shape="poly"   coords="60, 40, 62, 51, 51, 45"        alt="Página anterior">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/catalogo.asp"                 shape="circle" coords="86, 20, 16"                    alt="DIANA. Catálogo Automatizado">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/iris/bdatos.asp"              shape="rect"   coords="115, 8, 173, 35"               alt="Bases de Datos">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/ucadoc/revistas.asp"          shape="rect"   coords="174, 8, 231, 35"               alt="Revistas Electrónicas">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/scb/restric/petbib_fuser.asp" shape="rect"   coords="233, 8, 353, 35"               alt="Petición de Material Bibliográfico">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/scb/petdoc.htm"               shape="rect"   coords="354, 8, 456, 35"               alt="Préstamo Interbibliotecario">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/sbuca.asp"                    shape="rect"   coords="458, 8, 528, 35"               alt="Bibliotecas de la UCA">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/novedades.asp"                shape="rect"   coords="530, 8, 598, 35"               alt="Revistas Electrónicas">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/scb/faq.asp"                  shape="circle" coords="617, 20, 14"                   alt="Preguntas Frecuentes">';
codigobarranav = codigobarranav+ '  <area href="http://www.uca.es"                                     shape="rect"   coords="695, 8, 727, 35"               alt="Página de entrada a la UCA">';
codigobarranav = codigobarranav+ ' </map><img class="CEN" border="0" name="piepag" src="http://biblioteca.uca.es/images/barranav.gif" usemap="#mapaind" alt="" width="740" height="60"></div>';
document.write(codigobarranav);
}


function barranav2() {
codigobarranav =                 '<div class="CEN"><hr><map name="mapaind">'
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/default.asp"                  shape="poly"   coords="37, 8, 61, 20, 37, 34, 14, 20" alt="Página de entrada a la Biblioteca">';
codigobarranav = codigobarranav+ '  <area href="javascript:history.back()"                             shape="poly"   coords="60, 40, 62, 51, 51, 45"        alt="Página anterior">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/catalogo.asp"                 shape="circle" coords="86, 20, 16"                    alt="DIANA. Catálogo Automatizado">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/iris/bdatos.asp"              shape="rect"   coords="115, 8, 173, 35"               alt="Bases de Datos">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/ucadoc/revistas.asp"          shape="rect"   coords="174, 8, 231, 35"               alt="Revistas Electrónicas">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/scb/restric/petbib_fuser.asp" shape="rect"   coords="233, 8, 353, 35"               alt="Petición de Material Bibliográfico">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/scb/petdoc.htm"               shape="rect"   coords="354, 8, 456, 35"               alt="Préstamo Interbibliotecario">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/sbuca.asp"                    shape="rect"   coords="458, 8, 528, 35"               alt="Bibliotecas de la UCA">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/novedades.asp"                shape="rect"   coords="530, 8, 598, 35"               alt="Revistas Electrónicas">';
codigobarranav = codigobarranav+ '  <area href="http://biblioteca.uca.es/scb/faq.asp"                  shape="circle" coords="617, 20, 14"                   alt="Preguntas Frecuentes">';
codigobarranav = codigobarranav+ '  <area href="http://www.uca.es"                                     shape="rect"   coords="695, 8, 727, 35"               alt="Página de entrada a la UCA">';
codigobarranav = codigobarranav+ ' </map><img border="0" src="http://biblioteca.uca.es/images/barranav.gif" usemap="#mapaind" alt="" width="740" height="60"></div>';
document.write(codigobarranav);
}

function cabecera_diana(titulo)
{
if (titulo==null) titulo='Diana';
document.write('<img border="0" src="http://biblioteca.uca.es/images/banner_bibli.jpg" style="position: absolute; z-index: 0">');
document.write('<table CLASS="CABIE" width="100%" border="0" cellspacing="0" cellpadding="0"><tr>');
document.write('<td width="100"  height="76" class="IZQ" valign="middle" nowrap><a href="http://www.uca.es"><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="100%" width="100%"></td>');
document.write('<td width="100%" height="76" class="IZQ" valign="middle" nowrap><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="100%" width="100%"></td>');
document.write('</tr><tr><td class="CEN" valign="middle" width="100%" nowrap>');
botones_cabecera_uca();
document.write('</td><td valign="middle" nowrap class="NOMBREPAG">&nbsp;'); 
document.write(titulo);
document.write('&nbsp;</td></tr>');
document.write('</table>');
return;
}


function pie_diana()
{
barranav();
}

function cabecera_metabuscador(titulo)
{
if (titulo==null) titulo='     ';
document.write('<img border="0" src="http://biblioteca.uca.es/images/banner_bibli.jpg" style="position: absolute; z-index: 0">');
document.write('<table CLASS="CABIE" width="100%" border="0" cellspacing="0" cellpadding="0"><tr>');
document.write('<td width="100"  height="76" class="IZQ" valign="middle" nowrap><a href="http://www.uca.es"><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="100%" width="100%"></td>');
document.write('<td width="100%" height="76" class="IZQ" valign="middle" nowrap><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="100%" width="100%"></td>');
document.write('</tr><tr><td class="CEN" valign="middle" width="100%" nowrap>');
botones_cabecera_uca();
document.write('</td><td valign="middle" nowrap class="NOMBREPAG">&nbsp;'); 
document.write(titulo);
document.write('&nbsp;</td></tr></table>');
document.write('<table border=0><tr><td>&nbsp;&nbsp;</td><td rowspan=3><img src="http://biblioteca.uca.es/images/logometafind.gif" border=0"></td></tr><tr>');
document.write('<td width="100%" class="CBDATOSC" valign="middle" style="background: #DEE7EF; color: black; font-size: 80%; text-align: center"><p class="TITULOC" style="color: #004080; font-family: Verdana, Arial, Syntax, sans-serif; font-size: 20px; font-weight: normal; text-align: center">Metabuscador</td>');
document.write('</tr><tr><td>&nbsp;&nbsp;</td></tr></table><br>');
return;
}


function GotoLabel(nombre,marcador)
{
CodigoHTML = "<A HREF='" + window.location.pathname + "#" + marcador + "'>" + nombre + "</A>";
document.write(CodigoHTML)
}











<!-- Start of StatCounter Code -->


var sc_project=1590960; 
var sc_invisible=1; 
var sc_partition=14; 
var sc_security="3252e784"; 

/** Incluye el JavaScript del StatCounter **/
document.write('<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></' + 'script>');
document.write('<noscript><a href="http://www.statcounter.com/" target="_blank"><img  src="http://c15.statcounter.com/counter.php?sc_project=1590960&amp;java=0&amp;security=3252e784&amp;invisible=1" alt="web stats script" border="0"></a></' + 'noscript>');


<!-- End of StatCounter Code -->


/** Variables Globales **/

nf		= Math.ceil(9*Math.random())
nffb	= Math.ceil(17*Math.random())
ie		= document.all?1:0
ns4 	= document.layers?1:0
nons4 	= document.layers?0:1
novale	= document.getElementById?0:1

function show_props(obj, objName) {
 for (var i in obj) {
  eval('document.write(objName + "." + i + " = " + obj[i] + "<br>")');
 }
 return ;
}

function textobarra(txt)
 { window.status = txt;
   setTimeout("borrabarra()",2000);
 }

function borrabarra()
 { window.status=""; }

function version() {
   naver = navigator.appVersion
	if (naver.indexOf("95") >= 0) { return "w95" }
     else { if (naver.indexOf("98") >= 0) { return "w95" }
       else { if (naver.indexOf("NT") >= 0) { return "wnt" }
         else { if (naver.indexOf("Win") >= 0) { return "w31" }
            else { return "nw" }
              }
            }
          }
}

function WM_netscapeCssFix() {
  /*
    Source: Webmonkey Code Library
    (http://www.hotwired.com/webmonkey/javascript/code_library/)

    Author: Taylor
    Author Email: taylor@wired.com
    Author URL: http://www.taylor.org/
    */

  // This part was inspired by Matthew_Baird@wayfarer.com
  // It gets around another unfortunate bug whereby Netscape 
  // fires a resize event when the scrollbars pop up. This 
  // checks to make sure that the window's available size 
  // has actually changed.
  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
    document.location = document.location;
  }
}

function WM_netscapeCssFixCheckIn() {
  // This function checks to make sure the version of Netscape 
  // in use contains the bug; if so, it records the window's 
  // width and height and sets all resize events to be handled 
  // by the WM_netscapeCssFix() function.
  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {
    if (typeof document.WM == 'undefined'){
      document.WM = new Object;
    }
    if (typeof document.WM.WM_scaleFont == 'undefined') {
      document.WM.WM_netscapeCssFix = new Object;
      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
    }
    window.onresize = WM_netscapeCssFix;
  }
}


function cabeceraold(titulo)
{
document.write('<img border="0" src="http://biblioteca.uca.es/images/banner_bibli.jpg" class="CABECERAPAGINA">');
document.write('<table CLASS="CABIE" width="100%" border="0" cellspacing="0" cellpadding="0"><tr>');
document.write('<td width="100"  height="76" class="IZQ" valign="middle" nowrap><a href="http://www.uca.es"><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="100%" width="100%"></a></td>');
document.write('<td width="100%" height="76" class="IZQ" valign="middle" nowrap><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="100%" width="100%"></td>');
document.write('</tr><tr><td class="CEN" valign="middle" width="100%" nowrap>');
botones_cabecera_uca();
document.write('</td><td valign="middle" nowrap class="NOMBREPAG">&nbsp;');
document.write(document.title);
document.write('&nbsp;</td></tr></table>');
return;
}

function cabecera(titulo)
{
document.write('<img border="0" src="http://biblioteca.uca.es/images/banner_bibli.jpg" class="CABECERAPAGINA">');
document.write('<table CLASS="CABECERAPAGINA" width="100%" border="0" cellspacing="0" cellpadding="0"><tr>');
document.write('<td width="100"  height="76" class="IZQ" valign="middle" nowrap><a href="http://www.uca.es"><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="100%" width="100%"></a></td>');
document.write('<td width="100%" height="76" class="IZQ" valign="middle" nowrap><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="100%" width="100%"></td>');
document.write('</tr></table>');
document.write('<div height="76"><img border="0" src="http://biblioteca.uca.es/images/punto.gif" height="76" width="100%"></div><table><tr><td class="CEN" valign="middle" width="100%" nowrap>');
botones_cabecera_uca();
document.write('</td><td valign="middle" nowrap class="NOMBREPAG">&nbsp;');
document.write(document.title);
document.write('&nbsp;</td></tr></table>');
return;
}

function MCursor(e) {
  // set event properties to global vars 
  window.event.clientX = e.pageX;
  window.event.clientY = e.pageY;
  window.event.x = e.layerX;
  window.event.y = e.layerY;
  window.event.screenX = e.screenX;
  window.event.screenY = e.screenY;
  // route the event back to the intended function
  if ( routeEvent(e) == false ) {
    return false;
  } else {
    return true;
  }
}



/** Funciones para ventanas de mensajes */

var timerID = null;

function NavegadorNoCompatible(urlmensaje,urlretorno)
{
window.open(urlmensaje,"NavegadorNoCompatible","width=600,height=480,scrollbars=NO");
window.location=urlretorno;
return;
}

function iniciar()
{
if (novale) NavegadorNoCompatible("http://biblioteca.uca.es/comun/navegadornocompatible.asp","http://biblioteca.uca.es/catalogo.htm");

if (navigator.appName == "Netscape")
	{
	layerStyleRef="layer.";
	layerRef="document.layers";
	styleSwitch="";
	visibilidad="show";     
	}
	else
	{
	layerStyleRef="layer.style.";
	layerRef="document.all";
	styleSwitch=".style";
	visibilidad="visible";	
	}

/** Devuelve la Posicion Actual del Cursor. Para IE4 y NetScape4 */

if(!window.event && window.captureEvents) {
  // set up event capturing for mouse events (add or subtract as desired)
  window.captureEvents(Event.MOUSEOVER|Event.MOUSEOUT|Event.CLICK|Event.DBLCLICK);
  // set window event handlers (add or subtract as desired)
  window.onmouseover = MCursor;
  window.onmouseout = MCursor;
  window.onclick = MCursor;
  window.ondblclick = MCursor;
  // create an object to store the event properties 
  window.event = new Object;
}
	
}

function showHideLayerSwitch(capa)
{
if (eval(layerRef+'["'+capa+'"]'+styleSwitch+'.visibility == visibilidad'))
	{ esconderCapa(capa); }
	else
	{ verCapa(capa); }	
}

function sacacapa(capa)
{
/* ahora=new Date();
despues=new Date();
while ((despues - ahora < 400) ) {
      despues=new Date();
      } */
eval(layerRef+'["'+capa+'"]'+styleSwitch+'.visibility="visible"');
eval(layerRef+'["'+capa+'"]'+styleSwitch+'.display="block"');
// eval('document.getElementById(capa).visibility="visible"');
}

function esconderCapa(capa)
{
eval(layerRef+'["'+capa+'"]'+styleSwitch+'.visibility="hidden"');
eval(layerRef+'["'+capa+'"]'+styleSwitch+'.display="none"');
// eval('document.getElementById(capa).visibility="hidden"');
}

function verCapa(capa,ancho,xx,yy,tipo,alto)
{
/* this.capa=capa; this.ancho=ancho; this.xx=xx; this.yy=yy;


if (xx==null||yy==null) { xx=1; yy=10;}
if (ancho==null) { ancho="40%"; }

if (xx=='undefined'||xx==null) { xx=5; }
if (yy=='undefined'||yy==null) { yy=10; }
if (ancho=='undefined'||ancho==null) { ancho="auto"; }
if (alto=='undefined'||alto==null) { alto="auto"; }
*/
if (!xx) { xx=1; }
if (!yy) { yy=10; }
if (!ancho || ns4) { ancho="auto"; }

if (tipo!='abs') { xx=window.event.clientX+xx; yy=window.event.clientY+yy; }
if (alto=='undefined'||alto==null) { alto="auto"; }
if (navigator.appName != "Netscape")
{xx=xx+document.body.scrollLeft;
yy=yy+document.body.scrollTop;}

eval(layerRef+'["'+capa+'"]'+styleSwitch+'.width=("'+ancho+'")' );
eval(layerRef+'["'+capa+'"]'+styleSwitch+'.left=("'+xx+'")' );
eval(layerRef+'["'+capa+'"]'+styleSwitch+'.top=("'+yy+'")' );
eval(layerRef+'["'+capa+'"]'+styleSwitch+'.height=("'+alto+'")' );
sacacapa(capa);
/* alert (window.event.screenX+"-"+window.event.screenY+"-"+window.event.clientX+"-"+window.event.clientY  );
alert(xx+'-'+yy);
alert('-'+eval(layerRef+'["'+capa+'"]'+styleSwitch+'.width')+'-'+eval(layerRef+'["'+capa+'"]'+styleSwitch+'.left')+'-'+eval(layerRef+'["'+capa+'"]'+styleSwitch+'.top'));
*/

}

function llenaCapa(capa_a,capa_b)
{

document.getElementById(capa_a).innerHTML=document.getElementById(capa_b).innerHTML;

//if (ie) eval(layerRef + '["' + capa_a + '"].innerHTML = ' + layerRef + '["' + capa_b + '"].innerHTML');
//   else subecapa(capa_a,capa_b);
// pp=layerRef + '["' + capa_a + '"].innerHTML = ' + eval(layerRef + '["' + capa_b + '"].innerHTML');
// alert (pp);
// sacacapa(capa_a);

//  document.layer1.document.write("<HR><P>New content.</P><HR>");

//  document.layer1.document.close();


}

var z = 1
function subecapa(capa_a,capa_b) {
	if (ie) {
		document.all[capa_b].style.zIndex = z++;	
		document.all[capa_b].style.visibility = "visible";
	}
	else if (ns4) {
		document.layers[capa_a].layers[capa_b].zIndex = z++;
		document.layers[capa_a].layers[capa_b].visibility = "show";
	}		
}


