<!--
var errWindow = 0;

function isFilled(fe)
{
  if (fe.value == "" || fe.value == null)
  {
    return false;
  }
  else
  {
    return true;
  }
}

function isValidCharacter(fe)
{
  if (fe.value.search(/'/i) >= 0)
  {
    return false;
  }
  else
  {
    return true;
  }
}


function showErrors(arErrMsg)
{
  if (errWindow != 0)
  {
    //  If window has already been opened once 
    errWindow.close();
  }

  errWindow = window.open("", "basic_err_wind", "toolbar=no,width=475,height=450,status=no,scrollbars=no,resizable=no, menubar=no");
  errWindow.document.write('<TITLE>Thew Arnott - Information Request</TITLE>');
  errWindow.document.write('<BODY bgcolor="#FFFFFF">');
  errWindow.document.write('<table border="0" cellspacing="0" cellpadding="10" width="117" bgcolor="#FFFFFF">');
  errWindow.document.write('<tr>');
  errWindow.document.write('<td><img src="images/logo_tree_sm.jpg" width="100" height="96"></td>');
  errWindow.document.write('<td><img src="images/logo_thewarnott_sm.gif" width="250" height="105"></td>');
  errWindow.document.write('</tr>');
  errWindow.document.write('</table>');
  errWindow.document.write('<BR>');
  errWindow.document.write('<h2 align="center">Data Entry Errors</h2>');
  errWindow.document.write('<H4 align="center"><I>The following data items have not been entered correctly. Please return to the data entry screen and correct them before submitting your request.</I></H4>');
  errWindow.document.write('<BR>');
  if (arErrMsg.length > 0)
  {
    errWindow.document.write('<DIV align=center>');
    for (i = 0; i < arErrMsg.length; i++)
    {
      errWindow.document.write(arErrMsg[i]);
      errWindow.document.write('<BR>');
    }
    errWindow.document.write('</DIV>');
  }
  errWindow.document.write('</BODY>');
}

function isFormOk(form)
{
  var err_msg = new Array();
  var arIndex = 0;
  var bReturn = true;
  var missing_field = 0;

  if (isFilled(form.firstname) == false)
  {
     err_msg[arIndex++] = "missing first name";
     bReturn = false;
  }
  if (isFilled(form.surname) == false)
  {
     err_msg[arIndex++] = "missing surname";
     bReturn = false;
  }

  if (isFilled(form.company) == false)
  {
     err_msg[arIndex++] = "missing company name";
     bReturn = false;
  }
  if (isFilled(form.email) == false)
  {
     err_msg[arIndex++] = "missing email address";
     bReturn = false;
  }

  if (bReturn == false)
  {
    showErrors(err_msg);
  }
  else
  {
    if (errWindow != 0)
    {
      //  If window has already been opened once 
      errWindow.close();
    }
  }

  return bReturn
}


//-->
