
var theForm
function objForm(form) {
        this.isUserId=isUserId(form)
        this.isPassword=isPassword(form)
}
function checkLoginFields(form) {
  theForm = new objForm(form);
  if(theForm.isUserId && theForm.isPassword)
  {
    form.submit()
  }
  else
  {
    notify(form)
  }          
}
function notify(form) {
	var text = "ATTENZIONE: digitare"   
	if(theForm.isUserId == false) {
	        text += "\n\ - \'Nome\'"
	}
	if(theForm.isPassword == false) {
	        text += "\n\ - \'password\'"
	}
	        
	alert(text)
}
function isUserId(form) {
        if (form.userName.value == "") {
                return false
        }
        else {
                return true
        }
}
function isPassword(form) {
        if (form.password.value == "") {
                return false
        }
        else {
                return true
        }
}