var menu0 = new Array (
"estels.htm",   "Estrellas",
"galaxias.htm", "Galaxias",
"vialact.htm",  "La Vía Láctea",
"quapuls.htm",  "Cuásares y Púlsares",
"negres.htm",   "Agujeros Negros",
"material.htm", "Materiales",
"mesures.htm",  "Medidas",
"formov.htm",   "Fuerzas y Movimientos",
"origen.htm",   "Origen y Evolución",
"observ.htm",   "Observación",
"links.htm",    "El Universo en Internet" )

var menu = new Array (
"estrellas.htm", "Estrellas",
"galaxias.htm", "Galaxias",
"vialactea.htm", "La Vía Láctea",
"quasarpulsar.htm", "Cuásares y Púlsares",
"agujerosnegros.htm", "Agujeros Negros",
"materiales.htm", "Materiales",
"medidas.htm", "Medidas",
"fuerzasmov.htm", "Fuerzas y Movimientos",
"origen.htm", "Origen y Evolución",
"observacion.htm", "Observación",
"links.htm", "El Universo en Internet" )

var menu1 = new Array (
"estrellas.htm", "",
"galaxias.htm", "",
"vialactea.htm", "",
"quasares.htm",  "",
"agujerosnegros.htm", "",
"materiales.htm", "",
"medidas.htm", "",
"fuerzasmov.htm", "",
"origen.htm", "",
"observacion.htm", "",
"eluniverso.htm", "" )

var iAmpli=new Array()
var tm, typ, winfoto
var x = -1
var n = 0
var parar = 0
var ultim = menu.length-1
var npag = -1
var arxiu = location.href.toLowerCase()
arxiu = arxiu.slice( arxiu.lastIndexOf("/")+1 )
for (var i=0; i<menu.length; i+=2){
  if (menu[i] == arxiu || menu0[i] == arxiu){ npag = i/2; break }
}
document.writeln('<table width="760" border="0" cellpadding="0" cellspacing="0">')
document.writeln('<tr><td rowspan=2 width="168" class="nodisp"><a href="http://www.astromia.com/universo/index.htm" onClick="window.focus()"><img')
document.writeln('src="../images/logo02.gif" width="168" height="58" hspace="0"')
document.writeln('vspace="0" border="0" alt="Astronomía: el Universo"></a></td>')
document.writeln('<td width="592" height="24" valign=top NOWRAP class="nodisp">')
document.writeln('<table border="0" cellpadding="0" cellspacing="0"><tr>')
for (i=0; i<ultim-2; i+=2){
  boto( menu[i+1], (i==npag*2) ? "" : "http://www.astromia.com/universo/" + menu1[i] )
  if (i==8){
    bgraf(8,54,"info1","http://www.astromia.com/universo/" + menu1[ultim-1],menu[ultim])
    document.writeln('</tr></table></td></tr><tr><td width="592" valign=top NOWRAP class="nodisp">')
    document.writeln('<table border="0" cellpadding="0" cellspacing="0"><tr>')
    document.writeln('<td width=8 background="../images/fb00.gif" NOWRAP>&nbsp;</td>')
  }
}
bgraf(6,25,"prn1","javascript:imprimir()","Imprimir")
document.writeln('</tr></table></td></tr>')
document.writeln('<tr><td width="168" valign="bottom" background="../images/fb07.gif" class="nodisp"><img')
document.writeln('src="../images/pan01.gif" width="168" height="6"></td>')
document.writeln('<td width="592" align="center" valign="bottom" class="cap">'+document.title+'</td></tr></table>')

function boto( nom, url, tg ){
  var tx = '<b>&nbsp; '+nom+' &nbsp;</b>'
  document.writeln('<td height=23><img src="../images/fb01.gif" width="8" height="23"></td>')
  document.writeln('<td bgcolor="#665555" background="../images/fb'+((url=="")?'04':'02')+'.gif" class="panel" NOWRAP>')
  if (url==""){
    document.writeln('<font color="#CCDDEE">'+tx+'</font>')
  }else{
    document.writeln('<a href="'+url+'" onClick="window.focus()"')
    if (tg>"") document.write('target="_blank"')
    document.writeln('>'+tx+'</a>')
  }
  document.writeln('</td><td><img src="../images/fb03.gif" width="8" height="23"></td>')
}

function bgraf( spc, wdt, i1, url, txt, tg ){
  if (spc>0) document.writeln('<td width='+spc+' background="../images/fb00.gif" NOWRAP>&nbsp;</td>')
  document.writeln('<td height=23 bgcolor="#334455"><a href="'+url+'" onClick="window.focus()"')
  if (tg>"") document.write('target="_blank"')
  document.writeln('><img src="../images/'+i1+'.gif" border="0" width="'+wdt+'" height="23" alt="'+txt+'"></a></td>')
}

function imprimir(){window.print()}

function acabar(){
  var w = npag*2
  var ant = (npag > 0) ? (w-2) : (menu.length-2)
  var pos = (w >= menu.length-2) ? (0): (w+2)
  document.writeln('<table width="760" border="0" cellpadding="0" cellspacing="0" class="nodisp"><tr>')
  bgraf(0,168,"ssb2","http://www.astromia.com/solar/index.htm","El Sistema Solar","T")
  document.writeln('<td NOWRAP><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>')
  document.writeln('<td width="56" background="../images/fb00.gif" NOWRAP>&nbsp;</td>')
  boto("Fotos del Universo","http://www.astromia.com/fotouniverso/index.htm","T")
  document.writeln('<td width="18" background="../images/fb00.gif" NOWRAP>&nbsp;</td>')
  boto("Fotos del Sistema Solar","http://www.astromia.com/fotosolar/index.htm","T")
  document.writeln('<td width=16 background="../images/fb00.gif">&nbsp;</td>')
  bgraf(40,25,"ant1","http://www.astromia.com/universo/" + menu1[ant],menu[ant+1])
  bgraf(8,25,"home1","http://www.astromia.com/universo/index.htm","Astronomía: el Universo")
  bgraf(8,25,"up1","http://www.astromia.com/universo/" + menu1[w],"Este tema en astromia.com")
  bgraf(8,25,"pos1","http://www.astromia.com/universo/" + menu1[pos],menu[pos+1])
  bgraf(24,27,"bust1","mailto:inf"+"o@astrom"+"ia.com?Subject="+document.title,"Correo")
  document.writeln('</tr></table></td></tr></table>')
}

function cargaimg(){
  iAmpli[x]=new Image()
  iAmpli[x].src="../fotos/"+typ+x+'.jpg'
}

function tempsmort(){
  clearTimeout(tm)
  if(parar==1||x==n-1) return
  if(x>0){if(iAmpli[x-1].complete){x=x+1;cargaimg()}}
  else{x=x+1;cargaimg()}
  tm=setTimeout('tempsmort()',100)
}

function fet(tipus,y){
  clearTimeout(tm)
  var ok=1
  for(var i=0;i<document.images.lenght;i++){if(!document.images[i].complete){ok=0;break}}
  if(ok==1){ typ = tipus; n = y; tm=setTimeout('tempsmort()',100) }
  else tm=setTimeout('fet("'+typ+'","'+y+'")',100)
}
