// JavaScript Document
 
function fun_sintassi_domini(theForm)
{
	
	 if (theForm.dominio.value == "")
	  {
		alert("Inserire il nome del dominio che si vorrebbe registrare!");
		theForm.dominio.focus();
		return (false);
	  }
	
	if (theForm.dominio.value.length < 3)
	  {
		alert("Il nome dominio deve essere composto da almeno tre caratteri!");
		theForm.dominio.focus();
		return (false);
	  } 
	  
	var checkOK = "-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
	var checkStr = theForm.dominio.value;
	var allValid = true;
	var validGroups = true;
					
	for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
							
			for (j = 0;  j < checkOK.length;  j++)
				
				if (ch == checkOK.charAt(j))
					break;
					
					if (j == checkOK.length)
						{
							allValid = false;
							break;
						}
		}
				  
	
	if (checkStr.charAt(0)=="-")
		allValid = false;
		
		
	var app=checkStr.length;
	app = app-1;
	
	if (checkStr.charAt(app)=="-")
		allValid = false;
		
			
	if (!allValid) 
		{
			alert("La sintassi scelta per il propiro dominio non è registrabile!");
			theForm.dominio.focus();
			return (false);
		}   


}
