var hMenu = -1;
var aPosX = new Array(0, 442, 442+76, 442+76+77);
var aMenus = new Array();
var bNotHome;
aMenus[0] = '&nbsp;';
function common_head(bHome, bSubdir) {
	bNotHome = bHome;
	if(!bHome) {
		document.write('<table width="775" border="0" cellspacing="0" cellpadding="0">');
		document.write('<tr>');
		document.write('<td background="gifs/barrasup.gif"><img src="gifs/trans.gif" width="775" height="57" usemap="#MapHome" border="0"></td>');
		document.write('</tr>');
		document.write('</table>');
		document.write('<map name="MapHome">');
		document.write('  <area shape="rect" coords="573,26,645,43" href="#" onclick="window.open(\'eme_sugerencias.asp\', \'biblio\', \'width=541,height=450,status,scrollbars\')">');
		document.write('  <area shape="rect" coords="493,26,568,43" href="javascript: f_castellano();">');
		document.write('  <area shape="rect" coords="650,7,780,48" href="http://www.bancaja.es" target="_new">');
		document.write('</map>');
	} else {
		aMenus[1] = '<img src="'+(bSubdir==1?'../':'')+'gifs/botidioma.gif" border="0" usemap="#MapMenu1">';
		aMenus[2] = '<img src="'+(bSubdir==1?'../':'')+'gifs/botinf.gif" border="0" usemap="#MapMenu2">';
		aMenus[3] = '<img src="'+(bSubdir==1?'../':'')+'gifs/botsalas.gif" border="0" usemap="#MapMenu3">';

		document.write('<table width="775" border="0" cellspacing="0" cellpadding="0">');
		document.write('<tr>');
		document.write('<td>');
		document.write('<img src="'+(bSubdir==1?'../':'')+'gifs/barrasup_ciberoteca.gif" width="439" height="57" usemap="#MapHome" border="0">');
		document.write('<a href="javascript: f_showMenu(1);"><img src="'+(bSubdir==1?'../':'')+'gifs/barrasup_idioma.gif" width="75" height="57" border="0"></a>');
		document.write('<a href="javascript: f_showMenu(2);"><img src="'+(bSubdir==1?'../':'')+'gifs/barrasup_info.gif" width="76" height="57" border="0"></a>');
		document.write('<a href="javascript: f_showMenu(3);"><img src="'+(bSubdir==1?'../':'')+'gifs/barrasup_salas.gif" width="77" height="57" border="0"></a>');
		document.write('</td><td width="119" background="'+(bSubdir==1?'../':'')+'gifs/barrasup_bancaja.gif">');
		document.write('<a href="http://www.bancaja.es" target="_new"><img src="'+(bSubdir==1?'../':'')+'gifs/trans.gif" width="112" height="57" border="0"></a>');
		document.write('</td>');
		document.write('</tr>');
		document.write('</table>');
		document.write('<map name="MapMenu1">');
		document.write('  <area shape="rect" coords="142,42,149,50" href="javascript: f_showMenu(0);">');
		document.write('  <area shape="rect" coords="0,0,139,28" href="javascript: f_castellano();">');
		document.write('</map>');
		document.write('<map name="MapMenu2">');
		document.write('  <area shape="rect" coords="142,70,149,78" href="javascript: f_showMenu(0);">');
		document.write('  <area shape="rect" coords="0,56,139,81" href="../informacion/acercade.htm">');
		document.write('  <area shape="rect" coords="0,28,149,53" href="#" onclick="window.open(\'../eme_sugerencias.asp\', \'biblio\', \'width=541,height=450,status,scrollbars\')">');
		document.write('  <area shape="rect" coords="0,0,149,25" href="../informacion/notalegal.htm">');
		document.write('</map>');
		document.write('<map name="MapMenu3">');
		document.write('  <area shape="rect" coords="142,153,149,161" href="javascript: f_showMenu(0);">');
		document.write('  <area shape="rect" coords="0,140,139,165" href="#" onclick="window.open(\'../bibliotecario/bibliotecariogenerico.htm\', \'biblio\', \'width=450,height=350,status\')">');
		document.write('  <area shape="rect" coords="0,112,139,137" href="../ediciones/home.asp">');
		document.write('  <area shape="rect" coords="0,84,149,109" href="../search/autor_mes.asp">');
		document.write('  <area shape="rect" coords="0,56,149,81" href="../reuniones/home.asp">');
		document.write('  <area shape="rect" coords="0,28,149,53" href="../consultas/consulta.asp">');
		document.write('  <area shape="rect" coords="0,0,149,25" href="../search/results.asp">');
		document.write('</map>');
		document.write('<map name="MapHome">');
		document.write('  <area shape="rect" coords="20,7,80,48" href="'+(bSubdir==1?'../':'')+'home.htm">');
		document.write('</map>');
	}
}

function f_showMenu(nMenu) {
	if(document.all) {
		oLayer = document.all['MenuFloat'];
		oLayer.innerHTML = aMenus[nMenu];
		oLayer = oLayer.style;
		oLayer.left = aPosX[nMenu];
	} else {
		oLayer = document.layers['MenuFloat'];
		oLayer.left = aPosX[nMenu];
		oLayer = oLayer.document;
		oLayer.open();
		oLayer.write(aMenus[nMenu]);
		oLayer.close();
	}
	oLayer.visibility = (nMenu!=0?"visible":"hidden");
	if(hMenu!=-1) { clearTimeout(hMenu); hMenu=-1; }
	if(nMenu!=0) hMenu=setTimeout("f_showMenu(0)", 5000);
}

function f_castellano() {
	sUrlOrig = location.href;
	sUrlDest = sUrlOrig.substr(0, sUrlOrig.lastIndexOf("/"));
	sUrlDest = sUrlDest.substr(0, sUrlDest.lastIndexOf("/"));
	if(bNotHome) sUrlDest = sUrlDest.substr(0, sUrlDest.lastIndexOf("/"));
	sUrlDest = sUrlDest + "/home.htm";
	// sUrlDest = sUrlDest.replace("valenciano/", "");
	location.href = sUrlDest;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
	window.open(theURL,winName,features);
}

function openAWindow( pageToLoad, winName, width, height, center, location, menubar, resizable, scrollbars, status, titlebar, toolbar, hotkeys) {
	xposition=0; yposition=0;
	if ((parseInt(navigator.appVersion) >= 4 ) && (center)) {
		xposition = (screen.width - width) / 2;
		yposition = ((screen.height - height) / 2)-15;
	}
	args = "width=" + width + ","
	+ "height=" + height + ","
	+ "location=" + location + ","
	+ "menubar=" + menubar + ","
	+ "resizable=" + resizable + ","
	+ "scrollbars=" + scrollbars + ","
	+ "status=" + status + ","
	+ "titlebar=" + titlebar + ","
	+ "toolbar=" + toolbar + ","
	+ "hotkeys=" + hotkeys + ","
	+ "screenx=" + xposition + "," //NN Only
	+ "screeny=" + yposition + "," //NN Only
	+ "left=" + xposition + "," //IE Only
	+ "top=" + yposition; //IE Only
	window.open( pageToLoad,winName,args );
}