function emptyvalidation(entered, alertbox)
{
  with (entered)
  {
    if (value==null || value==""){
      if (alertbox!="") {
        alert(alertbox);
      } 
      return false;
    } else {
      return true;
    }
  }
}

function formvalidation(thisform)
{
    with (thisform)
    {
      for(i=0;i<thisform.length;i++){
        if (emptyvalidation(thisform.elements[i],"Niste izpolnili polja!")==false) {thisform.elements[i].focus(); return false;};
      }
    }
}
