
	function isNonEmpty(obj)

{

    retval = false;
	obj=document.getElementById(obj)
    for (var i = 0; i < obj.value.length; i++) {

        if (obj.value.substring(i, i + 1) != " ") {

            retval = true;

            break;

        }

    }

    return retval;

}


function check(form)
{

    if(!isNonEmpty('Name_of_Firm')) {

		alert("You forgot to fill <Name of Firm> field.");

		return false;

    }
    if(!isNonEmpty('Name')) {

		alert("You forgot to fill <Contact Person> field.");

		return false;

    }


  if(!isNonEmpty('Telephone_Number')) {

		alert("You forgot to fill <Telephone Number> field.");

		return false;

    }

    
    
  if(!isNonEmpty('Fax_Number')) {

		alert("You forgot to fill <Fax Number> field.");

		return false;

    }
  if(!isNonEmpty('Street_Address')) {

		alert("You forgot to fill <Street Address> field.");

		return false;

    }
  if(!isNonEmpty('City_State_Zip')) {

		alert("You forgot to fill <City/State/Zip> field.");

		return false;

    }
  if(!isNonEmpty('e_mail')) {

		alert("You forgot to fill <E-mail Address> field.");

		return false;

    }
  if(!isNonEmpty('Specific_Comments')) {

		alert("You forgot to fill <Specific Comments> field.");

		return false;

    }
    
    
    
    
    regexp = /^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@(((\[)?(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))(\])?))|((([a-zA-Z0-9\-])+\.)+([a-zA-Z\-])+))$/gi;

    if(isNonEmpty('e_mail') && (document.getElementById('e_mail').value.search(regexp)==-1)) {

		alert("Incorrect <E-Mail>.");

		return false;

    }

	form.submit();
    return false;

}




