// JavaScript Document
function commutasezione(sz) {
  document.indice.sezione.value=sz;
  document.indice.submit();
}
function caricapagina(dove, sez, sbs) {
  document.indice.action=dove;
  document.indice.sezione.value=sez;
  document.indice.subsezione.value=sbs;
  document.indice.submit();
}
function caricapagina2(sez) {
  document.indice.sezione.value=sez;
  document.indice.submit();
}
function caricapaginacoordinate(dove, sez, sbs, lat, lon, lnt, ic, sole, tipo, quadro) {
  document.indice.action=dove;
  document.indice.sezione.value=sez;
  document.indice.subsezione.value=sbs;
  document.indice.lat.value=lat;
  document.indice.lon.value=lon;
  document.indice.lnt.value=lnt;
  document.indice.ic.value=ic;
  document.indice.sole.value=sole;
  document.indice.tipo.value=tipo;
  document.indice.quadro.value=quadro;
  document.indice.submit();
}
function startclock() {
  var now=new Date()
  var offset=now.getTimezoneOffset();
  var segno="+";
  var jd, jdA, jdB, secj, lms, ams, ecc, obl, yyy, edt;
  var hours=now.getUTCHours();
  var minutes=now.getUTCMinutes();
  var seconds=now.getUTCSeconds();
  var month=now.getUTCMonth()+1;
  var day=now.getUTCDate();
  var year=now.getUTCFullYear();
  jd=day+(hours+minutes/60+seconds/3600)/24;
  jdA=parseInt(year/100);
  jdB=2-jdA+parseInt(jdA/4);
  jd=parseInt(365.25*(year+4716))+parseInt(30.6001*(month+1))+jd+jdB-1524.5;
  secj=(jd-2415020)/36525;
  lms=279.69668+36000.76892*secj+Math.pow(0.0003025*secj,2);
  ams=358.47583+35999.04975*secj-0.00015*Math.pow(secj,2)-0.0000033*Math.pow(secj,3);
  ecc=0.01675104-0.0000418*secj-0.000000126*Math.pow(secj,2);
  obl=23.452294-0.0130125*secj-0.00000164*Math.pow(secj,2)+0.000000503*Math.pow(secj,3);
  yyy=Math.pow(Math.tan(obl/2*Math.PI/180),2);
  edt=yyy*Math.sin(2*lms*Math.PI/180)-2*ecc*Math.sin(ams*Math.PI/180)+4*ecc*yyy*Math.sin(ams*Math.PI/180)*Math.cos(2*lms*Math.PI/180)-.5*Math.pow(yyy,2)*Math.sin(4*lms*Math.PI/180)-(5/4)*Math.pow(ecc,2)*Math.sin(2*ams*Math.PI/180);
  edt=(edt*180/Math.PI)*4;
  if (edt<0) {segno="-"; edt=-edt;}
  var edtr=parseInt(edt)
  edt=parseInt((edt-edtr)*6000+.5)/100;
  edtr=segno+edtr+" m "+edt+" s";
  document.clockform.clockspot1.value=edtr;
  setTimeout('startclock()',10000);
}

