function get(id) {
  return document.getElementById(id)
}


function getByName(name, parent) {
  if (!parent) {
    parent = document;
  }
  return parent.getElementsByName(name);
}


function getByTag(tag, parent) {
  if (!parent) {
    parent = document;
  }
  return parent.getElementsByTagName(tag);
}


//function checkForm(form, fields, placeToDispMsg) {
//  for (i in fields) {
//    //if (form.i)) {
//      if (form.{i}.value == '') {
//        dispMsg(fields[i], placeToDispMsg);
//        form.i.focus();
//        return false;
//      }
//    }
//    //else {
//    //  alert('System error : the field '+i+' is not defined');
//    //  return false;
//    //}
//  }
//  return true;
//}

function dispMsg(msg, id) {
  get(id).className = 'msg';
  get(id).style.display = 'block';
  get(id).innerHTML = msg;
}