var iframeid = "iframe";
var gocfg = [ 
{ name: "presentacion", tdid: "presentacion", off : "res/img/botpresentoff.gif", on: "res/img/botpresenton.gif", url: "presentacion.html", url_en: "presentacion_en.html" },
{ name: "estatutos", tdid: "estatutos", off : "res/img/botestatutoff.gif", on: "res/img/botestatuton.gif", url: "estatutos.pdf", url_en: "estatutos.pdf" },
{ name: "asociados", tdid: "asociados", off : "res/img/bigbotupoff.gif", on: "res/img/bigbotupon.gif", url: "asociados.php", url_en: "asociados.php" },
{ name: "pesca", tdid: "pesca", off : "res/img/bigbotcnoff.gif", on: "res/img/bigbotcnon.gif", url: "pesca.php", url_en: "pesca.php" },
{ name: "mercantes", tdid: "mercantes", off : "res/img/bigbotcnoff.gif", on: "res/img/bigbotcnon.gif", url: "mercantes.php", url_en: "mercantes.php" },
{ name: "astilleros", tdid: "astilleros", off : "res/img/bigbotcnoff.gif", on: "res/img/bigbotcnon.gif", url: "astilleros.php", url_en: "astilleros.php" },
{ name: "industria", tdid: "industria", off : "res/img/bigbotdwoff.gif", on: "res/img/bigbotdwon.gif", url: "industria.php", url_en: "industria.php" },
{ name: "buscar", tdid: "buscar", off : "res/img/botbuscaroff.gif", on: "res/img/botbuscaron.gif", url: "buscar.php", url_en: "buscar.php" },
{ name: "contacto", tdid: "contacto", off : "res/img/botcontactoff.gif", on: "res/img/botcontacton.gif", url: "contacto.php", url_en: "contacto.php" }
];
var selected = gocfg[ 0 ];

function clearSelected( )
{
	if ( selected != null )
	{
		document.getElementById( selected.tdid ).style.backgroundImage = "url(" + selected.off + ")";
		selected = null;
	}
}

function goUrl( url )
{
	clearSelected( );
	document.getElementById( iframeid ).src = url;
}

function go( page, language )
{
	clearSelected( );
	for ( var i in gocfg )
	{
		var el = gocfg[ i ];
		if ( el.name == page )
		{
			selected = el;
			var tdid = document.getElementById( selected.tdid ); 
			tdid.style.backgroundImage = "url(" + selected.on + ")";
			document.getElementById( iframeid ).src = language == "en" ? selected.url_en : selected.url;
		}
	}
}