var aMese = new Array("gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre");
var aGiorno = new Array("domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato","domenica");

function ClockOn(){
	thistime= new Date();
	var hours=thistime.getHours();
	var minutes=thistime.getMinutes();
	var seconds=thistime.getSeconds();
	if (eval(hours) <10) hours="0"+hours;
	if (eval(minutes) < 10) minutes="0"+minutes;
	if (seconds < 10) seconds="0"+seconds;
	thistime = hours+":"+minutes+":"+seconds
	clock.innerHTML=thistime
	var timer=setTimeout("ClockOn()",200)
}

function DataEstesa(){
	oggi = new Date ();
	anno = oggi.getFullYear();
	data = oggi.getDate();
	return(aGiorno[oggi.getDay()]+" "+data+" "+aMese[oggi.getMonth()]+" "+anno);
}

function submitPg(pNome,pPagina,pIniziale,pRighe) {
  if (arguments.length==1) {
	  pPagina=document.form.pagina.value;
		pIniziale=document.form.iniziale.value;
	}
  document.form.name.value=pNome;
  if (pPagina) document.form.pagina.value=pPagina;
  switch (pIniziale) {
   case 'x': break;
   case '#': document.form.iniziale.value=""; break;
	 default: document.form.iniziale.value=pIniziale;
  }
  if (pRighe) document.form.righe.value=pRighe.value;
  document.form.submit();
}
function submitPg2(pNome) { // per azzerare il numero di pagina su apertura pagine con tabelle 
  document.form.paginaG.value=1;
  document.form.name.value=pNome;
  document.form.submit();
}
function submitPgG(pNome,pPagina,pRighe) {
  if (arguments.length==1) {
	  pPagina=document.form.paginaG.value;
	}
  document.form.name.value=pNome;
  if (pPagina) document.form.paginaG.value=pPagina;
  if (pRighe) document.form.righe.value=pRighe.value;
  document.form.submit();
}
function submitSch(nome,ids) {
  document.form.namecall.value=document.form.name.value;
  document.form.name.value=nome;
  document.form.scheda.value=ids;
	document.form.submit();
}

