
 function stringaVuota(s)
	{  
		for (var i = 0; i < s.length; i++) {
		var c = s.charAt(i);
		if ((c != '') && (c != '\n') && (c != '\t')) 
			return false;
		}
		return true;
	} 

	function validazione(form)
	{
	var msg;
	var campo_vuoto = "";
	
	for (var i = 0; i < form.length; i++){
		var e = form.elements[i];
		
	   if ((e.type == "text")  && !e.optional) {
	   		
		if  ((e.value == null) || (e.value == "") || stringaVuota(e.value)){
		
			campo_vuoto += "\n   " + e.name;
			continue;
			}
		}
	}
	if (!campo_vuoto)
		return true;
	
	msg = "---------------------------------------------------\n\n"
	msg += "       Il modulo  non e' stato inviato.\n\n";
	msg += "---------------------------------------------------\n\n"
	if (campo_vuoto)
	{
		msg += " I seguenti campi richiesti risultano vuoti: " + campo_vuoto + "\n";
	}
	alert(msg);
	return false;
	}	
	function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


