function stampa()
{
	document.getElementById('head').style.display = "none"
	document.getElementById('tit').style.display = "none"
	document.getElementById('testa').style.display = "none"
	document.getElementById('barra').style.display = "none"
	document.getElementById('ombrabarra').style.display = "none"
	document.getElementById('colup').style.display = "none"
	document.getElementById('foot').style.display = "none"
	document.getElementById('stampa').style.display = "none"
	document.getElementById('nascondi').style.display = "none"
	document.getElementById('coldx').style.width = "100%"
	document.getElementById('coldx').style.border = "0"
	document.getElementById('wrap').style.border = "0"
	if (!window.print)
	{
		alert("Browser non supportato!")
		return
	}
	window.print()
	document.getElementById('head').style.display = ""
	document.getElementById('testa').style.display = ""
	document.getElementById('barra').style.display = ""
	document.getElementById('ombrabarra').style.display = ""
	document.getElementById('colup').style.display = ""
	document.getElementById('tit').style.display = ""
	document.getElementById('foot').style.display = ""
	document.getElementById('stampa').style.display = ""
	document.getElementById('nascondi').style.display = ""
	document.getElementById('coldx').style.width = "527px"
	document.getElementById('coldx').style.border = "0 0 0 1px solid #999999"
	document.getElementById('wrap').style.border = "1px solid #999999"
}

function nuovaFinestra(foto)
{
	parametri = '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('', '', parametri);
	finestra.location = url;

	return finestra;
}

function ridimensionaFinestra()
{
	var netscape = document.all;

	var larghezza;
	var altezza;

	larghezza = (!netscape) ? window.innerWidth : document.body.clientWidth;
	altezza = (!netscape) ? window.innerHeight : document.body.clientHeight;
	larghezza = (document.images[0].width - larghezza);
	altezza = (document.images[0].height - altezza);

	window.resizeBy(larghezza, altezza);
}

//
//  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;
  }
}