		function OpenWindow(mypage,myname,w,h,scroll)
		{
			LeftPosition=(screen.width)?(screen.width-w)/2:100;
			TopPosition=(screen.height)?(screen.height-h)/2:100;
			settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
			window.open(mypage,myname,settings);
		}

		function checkNumber(widget,nomecampo, obblig, checkchars, maxlen) 
		{
			if (widget.value.length == 0 && obblig==true) 
			{
				alert('ATTENZIONE!\n\nIl campo '+nomecampo+' è obbligatorio !');
				return false;
			}
			if (widget.value.length > maxlen) 
			{
				alert('ATTENZIONE!\n\nSi possono inserire al massimo' + maxlen + 'caratteri nel campo '+nomecampo+'!');
				return false;
			}
			if (widget.value.length > 0 && checkchars==true) 
			{
				var re = new RegExp("[^0-9]"); //not in a-zA-Z0-9_
				if (widget.value.match(re) ) 
				{
					alert("ATTENZIONE!\n\nNel campo "+nomecampo+" sono ammessi solo numeri.");
					return false;
				}
			}
			return true;
		}		
	
	
		function checkString(widget,nomecampo,obblig, checkchars, maxlen) 
		{
			var validchars = unescape("%u0020%u00E0%u00E2%u00E4%u00E6%u00E7%u00E8%u00E9%u00EA%u00EB%u00EE%u00EF%u00F4%u00F6%u00FB%u00FC%u00F9%u0153");

			if (widget.value.length > 0) 
			{
				var re = new RegExp("[;]"); //not in a-zA-Z0-9_
				if (widget.value.match(re) ) 
				{
					alert("ATTENZIONE!\n\nNel campo "+nomecampo+" non è ammesso il carattere ;");
					return false;
				}
			}
			if (widget.value.length == 0 && obblig==true) 
			{
				alert('ATTENZIONE!\n\nIl campo '+nomecampo+' è obbligatorio !');
				return false;
			}
			if (widget.value.length > maxlen) 
			{

				alert('ATTENZIONE!\n\nSi possono inserire al massimo' + maxlen + 'caratteri nel campo '+nomecampo+'!');
				return false;
			}
			if (widget.value.length > 0 && checkchars==true) 
			{
				var re = new RegExp("[^a-zA-Z_0-9"+validchars+"]"); //not in a-zA-Z0-9_
				if (widget.value.match(re) ) 
				{
					alert("ATTENZIONE!\n\nNel campo "+nomecampo+" sono stati immessi dei caratteri non validi.");
					return false;
				}
			}
			return true;
		}