function onLoad() 
{
}

function onunLoad() 
{
	// se il nome della finestra e' call_reload allora e' stata aperta da un modulo che prevede il reload del chiamante
	// e la chiusura di questa
	if ( window.name == 'call_reload' )
	{
		window.opener.history.go(0);
		self.close();
	}
}

function ctr_mese() 
{

	if( window.document.frm_riel.frm_riel_mese.value < 13 ) 
    	{
			return true;
    	}
	else 
    	{
       	alert("mese non valido"); 
			window.document.frm_riel.frm_riel_mese.focus(); 
        	return false;
    	}

}



























//===============================================================================================================================

function lOkData(p_data)
/*
* verifica se la data passata e' valida
* la/e data/e devono essere nel formato gg/mm/aaaa
* restituisce VERO se il controllo da esito postivo FALSO altrimenti
*/
{

	if( p_data.substring(2,3) != "/" || p_data.substring(5,6) != "/" || isNaN(p_data.substring(0,2)) || isNaN(p_data.substring(3,5)) || isNaN(p_data.substring(6,10))) 
		{ 
			return false; 
		}
	else if( (p_data.substring(0,2) > 31) || (p_data.substring(3,5) > 12) ) 
		{
			return false; 
       }
	else
		{
			return true;
		}

	return true;
}

//-------------------------------------------------------------------------------------------------------------------------------

function lCompDate(p_dataF,p_dataI)
/*
* verifica se la data passata con p_dataF e' superiore o al massimo uguale alla data passata con p_dataI 
* la/e data/e devono essere nel formato gg/mm/aaaa
* restituisce VERO se il controllo da esito postivo FALSO altrimenti
*/
{

	// se l'anno della fine e' inferiore a quello dell'inizio
	if( p_dataF.substring(6,10) < p_dataI.substring(6,10) )
		{
			return false;
		}
	// se l'anno della fine e' = a quello dell'inizio
	if( p_dataF.substring(6,10) == p_dataI.substring(6,10) )
		{
			// se il mese della fine e' inferiore a quello dell'inizio
			if( p_dataF.substring(3,5) < p_dataI.substring(3,5) )
				{
					return false;
				}
			// se il mese della fine e' = a quello dell'inizio
			else if( p_dataF.substring(3,5) == p_dataI.substring(3,5) )
				{
					// se il giorno della fine e' = a quello dell'inizio
					if( p_dataF.substring(0,2) < p_dataI.substring(0,2) )
						{
							return false;
						}
				}

		}

	return true;
}

//-------------------------------------------------------------------------------------------------------------------------------

function numeralsOnly(evt) 
	{
		/**
		* Script  tratto dal libro "JavaScript and DHTML Cookbook" - Capitolo 8-11
		* Pubblicato da O Reilly & Associates
		* Copyright 2003 Danny Goodman
		* Riprodurre questa nota per qualunque riutilizzo del codice.
		*
		* 27/09/04 accetta anche il carattere "," per la separazione dei decimali e lo spazio (Vincenzo Criscione)
		*/
		evt = (evt) ? evt : event;
    	var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));
    	if (charCode == 44) 
    	{
       	return true;
    	}
    	if (charCode == 32) 
    	{
       	return true;
    	}
    	if (charCode > 31 && (charCode < 48 || charCode > 57)) 
    	{
       	alert("inserire solo numeri!"); 
        	return false;
    	}
    	return true;
	}

//-------------------------------------------------------------------------------------------------------------------------------

function onomastico(onomastico) 
{
  	prv = "onomastico.asp" + "?onomastico=" + onomastico ;
  	w=window.open(prv,"","width=480,height=600,menubar=no,scrollbars=yes,resizable=no");
  	//w=window.open(prv,"","");  
}

//-------------------------------------------------------------------------------------------------------------------------------


				function getInternetTime()
				{
					var mydate=new Date();
					var year=mydate.getYear();
					if (year < 1000) year += 1900;
					var day=mydate.getDay();
					var month=mydate.getMonth();
					var daym=mydate.getDate();
					var hours=mydate.getHours();
					var minutes=mydate.getMinutes();
					var seconds=mydate.getSeconds();
					var dayname=new Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat");
					
					if (daym<10) daym="0" + daym;
					if (month<10) month="0" + (month+1);
					d = new Date();
					Time24H = new Date();
					Time24H.setTime(d.getTime() + (d.getTimezoneOffset() * 60000) + 3600000);
					InternetTime = Math.round((Time24H.getHours() * 60 + Time24H.getMinutes() + Time24H.getSeconds() / 60 ) / 0.144) / 10;
					if (InternetTime < 10) 
						InternetTime = '00' + InternetTime;
					else if (InternetTime < 100) 
						InternetTime = '0' + InternetTime;
					if (hours==0) hours=12;
					if (minutes<=9) minutes="0" + minutes;
					if (seconds<=9)	seconds="0" + seconds;
					var cdate= dayname[day] + ", " + daym + "." + month + "." + year + "<br>" + hours + ":" + minutes + ":" + seconds + " " + " @" + InternetTime + ""
					if (document.all)
						document.all.internettime.innerHTML=cdate
					else if (document.getElementById)
						document.getElementById("internettime").innerHTML=cdate
					else
						document.write(cdate)
				}
				if (!document.all&&!document.getElementById) getInternetTime()
					
				function SetInternetTimer()
				{
					if (document.all||document.getElementById) setInterval("getInternetTime()",1000)
				}

//-------------------------------------------------------------------------------------------------------------------------------

