 function req_check(g) {

    var missing = new Array();
    var anerr = new Array();
    var quala = 0;
    var errcnt = 0;
    var noemail = 0;
    var nocontact = 0;

    for(var i = 0; i < g.length; i++) {

      if (g.elements[i].name == "contact_name" && g.elements[i].value == "") {
        missing[quala] = "Name";
        quala = quala + 1;
      }
	  
	 	  
	  if (g.elements[i].name == "job_title" && g.elements[i].value == "") {
        missing[quala] = "Job Title";
        quala = quala + 1;
      }
	 	  
	  if (g.elements[i].name == "company_name" && g.elements[i].value == "") {
        missing[quala] = "Company";
        quala = quala + 1;
      } 
	  
	  if (g.elements[i].name == "current_solution" && g.elements[i].value == "") {
        missing[quala] = "Current Solution";
        quala = quala + 1;
      }
	 	  
	  if (g.elements[i].name == "industry" && g.elements[i].value == "") {
        missing[quala] = "Industry";
        quala = quala + 1;
      }	  
	  
	  if (g.elements[i].name == "number_employees" && g.elements[i].value == "") {
        missing[quala] = "Number of employees in organization";
        quala = quala + 1;
      }
	  
	  if (g.elements[i].name == "hiring_manage_system" && g.elements[i].value == "") {
        missing[quala] = "Are you considering a change in Hiring Management Systems";
        quala = quala + 1;
      }
	  
      if (g.elements[i].name == "email" && g.elements[i].value != "") {
        nocontact = nocontact + 1;
      }

     	 
    }

    if (nocontact == 0) {
      missing[quala] = "E-mail Address";
    }


    if (g.elements.email != "") {
      if (g.email.value.search(/@/) < 0 || g.email.value.search(/./) < 0) {
        if (g.email.value !== "") {
          anerr[errcnt] = "The email address entered is not valid.";
          errcnt = errcnt + 1;
        }
      }
    }

    if (missing.length > 0 || anerr.length > 0) {

      rerr = window.open("","lewin","width=300,height=485,left=150,screenX=150,top=50,screenY=50,location=no,menubar=no,scrollbars=yes,status=no,toolbar=no,resizable=yes","");
      rerr.document.writeln('<HTML>');
      rerr.document.writeln('<HEAD>');
      rerr.document.writeln('<TITLE>We need more infomation</TITLE>');
      rerr.document.writeln('<LINK REL=STYLESHEET TYPE="text/css" HREF="style/erc_style.css" TITLE="erc_style">');
      rerr.document.writeln('</HEAD>');
      rerr.document.writeln('<BODY alink="#02629C" link="#02629C" vlink="#02629C">');
      rerr.document.writeln('<TABLE border="0" cellpadding="3" cellspacing="0" class="text">');

      if (missing.length > 0) {

        rerr.document.writeln('<TR><TD class="text">We need to get more information in order to get in touch with you. Please complete the areas that are listed below.<br /><br /></TD></TR>');

        for(var gg = 0; gg < missing.length; gg++) {
          rerr.document.writeln('<TR>');
          rerr.document.writeln('  <TH>' + missing[gg] + '</TH>');
          rerr.document.writeln('</TR>');
        }

      }

      if (anerr.length > 0) {
        rerr.document.writeln('<TR><TD>The information you entered had the following errors. Please re-enter the data and submit the form again.<br /></TD></TR>');

        for(var gg = 0; gg < anerr.length; gg++) {
          rerr.document.writeln('<TR>');
          rerr.document.writeln('  <TH>' + anerr[gg] + '</TH>');
          rerr.document.writeln('</TR>');
        }
      }

      rerr.document.writeln('<br />');
      rerr.document.writeln('<TR><TD align="center"><a href="javascript:parent.close()"><b>Return to Registration Form</b></a><br /><br /></TD></TR>');
      rerr.document.writeln('</TABLE>');
      rerr.document.writeln('</BODY>');
      rerr.document.writeln('</HTML>');

      return false;
    }
  }

