var inicio = 0;
var foro;
var idiomas = "esp|cat|eng"
idiomas = idiomas.split("|");

var ns;
if((!document.all)&&(!window.getComputedStyle)){ns = document.menuMarc.document.menuContent}

var nav_superior = ""

function preMove(i,tipo){
	if(inicio==1){
		moveIt(i,tipo)
	}
}


function getNavegacion(){

	if(idioma!=""){
		dirimg = "../images/" + idioma + "/";
		dirurl = "../" + idioma + "/";
		dirlang = "../"
		lang = idioma
	}
	else{
		dirforo = "../"
		lang = "esp"
		dirimg = "images/";
		dirurl = ""
		dirlang = ""
	}

	if(seccion){
		nav_superior += '<td><a href="default.asp" onmouseover="rollover(\'inicio\',\'on\')" onmouseout="rollover(\'inicio\',\'off\')"><img src="' +  dirimg + 'bt_inicio_off.gif" height="21" border="0" alt="" name="inicio"></a></td>'
					+ '<td><img src="' + dirimg + 'pix_trans.gif" border="0" alt="" width=1 height=1></td>'
	}else{
		nav_superior += '<td><img src="' + dirimg + 'pix_trans.gif" border="0" alt="" width=124 height=1></td>'
					+ '<td><img src="' + dirimg + 'pix_trans.gif" border="0" alt="" width=1 height=1></td>'
	
		/*cont = 0
		nav_superior += '<td bgcolor="#000000" align=right><img src="' + dirimg + 'pix_trans.gif" border="0" alt="" width=124 height=1><br><table border=0 cellpadding=0 cellspacing=0>'
		for(j=0;j<idiomas.length;j++){
			if(lang!=idiomas[j]){
				if(idiomas[j]=="esp"){
					urldefault = ".."
				}else{
					urldefault = dirlang + idiomas[j]
				}
				
				nav_superior += '<td bgcolor="#000000"><a href="' + urldefault + '/default.asp" onmouseover="rolloverNoLang(\''+idiomas[j]+'\',\'on\')" onmouseout="rolloverNoLang(\''+idiomas[j]+'\',\'off\')">'
				
				if(idioma==""){
					nav_superior += '<img src="images/bt_'+idiomas[j]+'_off.gif" height="21" border="0" alt="" name="'+idiomas[j]+'">'
				}else{
					nav_superior += '<img src="../images/bt_'+idiomas[j]+'_off.gif" height="21" border="0" alt="" name="'+idiomas[j]+'">'
				}
				nav_superior += '</a><br></td>'
				
				if(cont==0){
					if(idioma!=""){
						nav_superior += '<td bgcolor="#000000"><img src="../images/separator.gif" height="21" border="0" alt=""></a></td>'
					}else{
						nav_superior += '<td bgcolor="#000000"><img src="images/separator.gif" height="21" border="0" alt=""></a></td>'
					}
				}
				cont++
			}
		}
		nav_superior += '</table></td>'
		*/
	}
	
			nav_superior += '<td width=566><table border=0 cellpadding=0 cellspacing=0>'
	
			nav_superior += '<td><img width=1 height=21 src="' + dirimg + 'images/pix_trans.gif"></td>'
				+ '<td valign="top" width=100%>'
					+ '<a href="javascript:preMove(0,1)" onmouseover="rollover(\'actualidad\',\'on\',ns)" onmouseout="rollover(\'actualidad\',\'off\',ns)"><img src="' + dirimg + 'bt_actualidad_off.gif" height="21" border="0" alt="" name="actualidad"></a>'
					+ '<a href="' + dirurl + 'documentacion.asp" onmouseover="rollover(\'fons\',\'on\',ns)" onmouseout="rollover(\'fons\',\'off\',ns)"><img src="' + dirimg + 'bt_fons_off.gif" height="21" border="0" alt="" name="fons"></a>'
					+ '<a href="javascript:preMove(0,2)" onmouseover="rollover(\'europa\',\'on\',ns)" onmouseout="rollover(\'europa\',\'off\',ns)"><img src="' + dirimg + 'bt_europa_off.gif" height="21" border="0" alt="" name="europa"></a>'
					+ '<a href="' + dirurl + 'links.asp" onmouseover="rollover(\'links\',\'on\',ns)" onmouseout="rollover(\'links\',\'off\',ns)"><img src="' + dirimg + 'bt_links_off.gif" height="21" border="0" alt="" name="links"></a>'
					+ '<a href="mailto:ambextern@amb.es" onmouseover="rollover(\'contacte\',\'on\',ns)" onmouseout="rollover(\'contacte\',\'off\',ns)"><img src="' + dirimg + 'bt_contacte_off.gif" height="21" border="0" alt="" name="contacte"></a>'
				+ '</td>'
				+ '</table></td>'
				+ '<td bgcolor="#B2B2B2"><img src="images/pix_trans.gif" width="1" height="1" border="0" alt=""></td>'
				
	return nav_superior;
}

subseccion = ""

function rollover(imgName,st,lay)
{
	var a = imgName.split('_')
	if(a[1]!=null){
		img = a[0]
	}else{
		img = imgName
	}
	
	if(inicio==1){
		if(idioma!=""){dirimg = "../images/" + idioma + "/";}
		else{dirimg = "images/";}
		
		if((imgName != seccion)&&(imgName != subseccion)){
			if(ns && lay){
				lay.document.images[imgName].src = dirimg + "bt_" + img + "_" + st + ".gif"
			}else{
				document.images[imgName].src = dirimg + "bt_" + img + "_" + st + ".gif"
			}
		}
	}
}

function rolloverNoLang(imgName,st,lay)
{
	if(inicio==1){
		if(idioma!=""){dirimg = "../images/";}
		else{dirimg = "images/";}
		
		if(imgName != seccion){
			if(ns && lay){
				lay.document.images[imgName].src = dirimg + "bt_" + imgName + "_" + st + ".gif"
			}else{
				document.images[imgName].src = dirimg + "bt_" + imgName + "_" + st + ".gif"
			}
		}
	}
}

pie = ''

function getPie(){
	if(idioma!=""){dirimg = "../images/";}
	else{dirimg = "images/";}

	pie += '<img src="' + dirimg + 'pix_trans.gif" width=1 height=10><br>'
	+ '<table border=0 cellpadding=0 cellspacing=0>'
	+ '<td><img src="' + dirimg + 'pix_trans.gif" width=125 height=1></td>'
	+ '<td valign=top><a href="http://www.amb.es" target="_new"><img src="' + dirimg + 'logo_ambII.gif" width="59" height="30" border="0" alt="" VSPACE=10></a></td>'
	+ '</table><br>'
	
	return pie;
}

function getPieEuropaDirect(){
	if(idioma!=""){dirimg = "../images/";}
	else{dirimg = "images/";}

	pie += '<img src="' + dirimg + 'pix_trans.gif" width=1 height=10><br>'
	+ '<table border=0 cellpadding=0 cellspacing=0>'
	+ '<td><img src="' + dirimg + 'pix_trans.gif" width=125 height=1></td>'
	+ '<td valign=top><a href="http://www.amb.es" target="_new"><img src="' + dirimg + 'logo_ambII.gif" width="59" height="30" border="0" alt="" VSPACE=10></a></td>'
	+ '<td><img src="' + dirimg + 'pix_trans.gif" width=50 height=1></td>'
	+ '<td valign=top><img src="' + dirimg + 'cat/europedirect.gif" width="150" height="32" border="0" alt="" VSPACE=10></td>'
	// <a href="http://www.amb.es" target="_new"></a>
	+ '</table><br>'
	
	return pie;
}

function getBack(){
	if(idioma!=""){
		dir = "../../extern/" + idioma + "/default.asp"
		dirimg = "../images/"
	}else{
		dir = "../extern/default.asp"
		dirimg = "images/"
	}
	getback1 = '<Div id="ambextern"><a href="' + dir + '" onmouseover="rolloverNoLang(\'extern\',\'on\')" onmouseout="rolloverNoLang(\'extern\',\'off\')"><img src="' + dirimg + 'bt_extern_off.gif" alt="" width="135" height="22" border="0" name="extern"></a></div>'
	return getback1;
}

function openDetalles(idnovedad){
	window.open('descNovedad.asp?id='+idnovedad,'Novedad','width=476,height=450,scrollBars=1')
}

function openPublicacion(idnovedad){
	//+16 ScrollBars
	window.open('descPublicacion.asp?id='+idnovedad,'Novedad','width=476,height=450,scrollBars=1')
}

function getIdiomas(){
	getIdiomas1 = ""
/*
	var Idioma = new Array('esp','cat','eng');
	
	if(idioma!=""){	
		idi = idioma
	}else{
		idi = "esp";
	}
	getIdiomas1 = '<Div id="idiomas"><table border=0 cellpadding=0 cellspacing=0 width=690><td width=100%><img src="'+dirlang+'/images/pix_trans.gif" border=0 width=1 height=1></td>'
	for(i=0;i<Idioma.length;i++){
		if(idi != Idioma[i]){
			dirUrl = dirlang
			if(Idioma[i]!="esp"){
				dirUrl += Idioma[i]+"/"
			}
			dirUrl += "default.asp"
			
			getIdiomas1 += '<td><a href="' + dirUrl + '" onmouseover="rolloverNoLang(\''+Idioma[i]+'\',\'on\')" onmouseout="rolloverNoLang(\''+Idioma[i]+'\',\'off\')"><img src="' + dirlang + 'images/bt_'+Idioma[i]+'_off.gif" alt="" border="0" name="'+Idioma[i]+'"></a></td>'
				+ '<td bgcolor="black"><img src="'+dirlang+'images/pix_trans.gif" border=0 width=1 height=1></td>'
		}
	}
	getIdiomas1 += '</table></div>'
*/
	return getIdiomas1;
}