//
//  Sposta il focus sul campo specificato
//
	function setFocusField(name)
	{
	if (document.forms.length <= 0)
	return;
	
	for (i = 0; i < document.forms.length; i++)
	{
	for (j = 0; j < document.forms[i].elements.length; j++)
	{
	var field = document.forms[i].elements[j];
	
	if ((field.name == name) && (!field.disabled))
	{
	field.focus();
	if ((field.type == "text") || (field.type == "textarea") ||
	(field.type == "password"))
	field.select();
	break;
	}
	}
	}
	return;
	}

//
//  Se il campo specificato è stato compilato invia la form, altrimenti non
//  invia la form, mostra il messaggio di avvertimento indicato, e sposta il
//  focus sul campo
//
	function checkEmptyField(form, field, message)
	{
	if (field.value == "")
	{
	setFocusField(field.name)
	alert(message);
	return false;
	}
	else
	{
	form.submit();
	return true;
	}
	}
	
	function nuovaFinestra(url)
	{
	var finestra;
	var parametri;
	
	parametri = 'height=400,width=365,toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, screenX=0, screenY=0, left=0, top=0';
	
	finestra = window.open(url, '', parametri);
	
	return finestra;
	}
	
	function stampa()
	{
	if (!window.print)
	{
	alert("Browser non supportato!")
	return
	}
	window.print()
}

