  function id2object(id)
  {
    return document.getElementById(id);
  }

  function getInputLength(id)
  {
    return id2object(id).value.length;
  }

  function checkAndSubmit()
  {
    if(getInputLength('contact_nume')<6 || getInputLength('contact_email')<6 || getInputLength('contact_subject')<6 || getInputLength('contact_message')<6)
      alert('The values marked with * should be at least 6 character long.');
    else
      id2object('contact_form').submit();
  }

