//'** - JS v.2.07.00 - **
function colg(modulo) {
	//modulo.style.cssText="background-color: #FFFFFF"
}

function colw(modulo) {	
	//modulo.style.cssText="background-color: #EDF4FD"
}

function VerificaData(adate) 
{
	test=VerificaLen(adate,10);
	if (test)
	{
		test = (adate.charAt(2)=="/");
	}
	if (test)
	{
		test = (adate.charAt(5)=="/");
	}
	if (test)
	{
		test = (adate.charAt(5)=="/");
	}
	if (test)
	{
		mese = adate.substring(3,5);
		test = ((mese>0) && (mese<13));
	}
	if (test)
	{
		giorno = adate.substring(0,2);
		if ( (mese==4) || (mese==6)|| (mese==9) || (mese==11))
		{
			test=((giorno>0) && (giorno<=30));
		}
		else if (mese==2)
			{
				test=((giorno>0) && (giorno<=29));
			}
			else 
			{
				test=((giorno>0) && (giorno<=31));
			}
	}
	if (test)
	{
		anno=adate.substring(6,10);
		test=((anno>1800) && (anno<3000));
	}
	return test;
}

function VerificaOrario(aora) 
{
	test=VerificaLen(aora,4 || aora,5);
	if (test)
	{
			var splitora = aora.split(".");
			for (icount in splitora) {}
			test=(icount==1)
	}
	if (test)
	{
		var ora = splitora[0];
		test = ((ora>0) && (ora<24)) || (ora=="0") || (ora=="00");
	}		
	if (test)
	{
		minuti = splitora[1];
		test = (minuti.length==2 && (minuti>0) && (minuti<60)) || (minuti=="00");
	}			
	
	return test;
}

function errore(aelem,aname,amsg)
{
	aelem.focus();

	window.alert(amsg+aname);
}

function VerificaLen(aelem,alen)
{
	mytest=(aelem.length >= alen);
	return mytest;
}

function VerificaEmail(email)
{
	var r = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	mytest=r.test( email );
	return mytest;
}

function VerificaNum(aelem,amin,amax)
{
	if (amin!=0 || amax!=0) {
	mytest=(aelem >= amin && aelem <= amax);
	} else {	
	mytest=(aelem > 0 || aelem < 0 || aelem == "0");
	}
	
	if (aelem.length < 1) {
	mytest=false;
	}

return mytest;
}

function VerificaRad(aelem,rad)
{
var x=0
for (i=0;i<rad;i++) {
	if (aelem[i].checked) {
		x++
	}
}
return (x > 0);
}

function VerificaList(alist,aValore)
{
	return alist > aValore;
}


function errSel(aelem,aname,amsg)
{
	aelem[0].focus();
	window.alert(amsg+aname);
}

function VerificaPerc(aelem)
{
	mytest=(aelem > 0 && aelem <= 100 || aelem == "-1" || aelem == "0");
	return mytest;
}

function EraseRad(aelem,rad)
{
for (i=0;i<rad;i++) {
	aelem[i].checked=false;
	}
}

function InsHelp(aelem,adescr)
{
	var appoggio=eval("document.AppForm.txt_"+aelem);
	if (appoggio.value==""){
		appoggio.value=adescr;
		appoggio.focus();
		appoggio.select();
	}
}

function DelHelp(aelem,adescr)
{
	var appoggio=eval("document.AppForm.txt_"+aelem);
	if (adescr=="hh.mm"){
		if(parseInt(appoggio.value)>=0 && appoggio.value.length<3){
			
			if(appoggio.value.length==1){appoggio.value="0"+appoggio.value}
			appoggio.value=appoggio.value+".00"}
	}
	if (appoggio.value==adescr){appoggio.value="";}	
}


