// Checks for numbers greater than 0
function checkNumbers(e) {
ok = "1234567890";
for(i=0; i < e.length ;i++){
 if(ok.indexOf(e.charAt(i))<0){ 
  return (false); }} 
 if (document.images) {
  re = /^[1-9]+([0-9]+)?$/;
  if (e.match(re)) {
   return (-1); }
   }}

// Checks for valid US zip codes (zip or zip+4)
function checkZip(e) {
ok = "1234567890-";
for(i=0; i < e.length ;i++){
 if(ok.indexOf(e.charAt(i))<0){ 
  return (false); }} 
 if (document.images) {
  re = (/^\d{5}([\-]\d{4})?$/);
  if (e.match(re)) {
   return (-1); }
   }}

// Checks for valid us phone numbers
function checkPhone(e) {
ok = "1234567890-";
for(i=0; i < e.length ;i++){
 if(ok.indexOf(e.charAt(i))<0){ 
  return (false); }} 
 if (document.images) {
  re = (/^\d{3}\-\d{3}\-\d{4}$/);
  if (e.match(re)) {
   return (-1); }
   }}

// Checks for valid email accounts, structurally
function checkEmail(e) {
ok = "1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
 for(i=0; i < e.length ;i++){
  if(ok.indexOf(e.charAt(i))<0){ 
   return (false); }} 
  if (document.images) {
   re = (/(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)/);
   re_two = (/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/);
   if (!e.match(re) && e.match(re_two)) {
    return (-1); }
	}}


function checkData() {
with (window.document.sys) {

	// Validates if Other is checked, then the value is required.
	if (other.checked == true) {
	if (othervalue.value == "") {
      alert ("Other is selected, but not filled out.");
      othervalue.focus ();
      return false; }} 
	
	if (zip.value != "")  // Not required if blank
	if (!checkZip (zip.value)) {
	  alert ("Please provide your valid US zip code.");
	  zip.focus ();
	  return false; }
	  
	if (phone.value != "") // Not required if blank
	if (!checkPhone (phone.value)) {
      alert ("Please provide your valid phone number.");
      phone.focus ();
      return false; }

	if (email.value != "") // Not required if blank
	if (!checkEmail (email.value)) {
	  alert ("Please provide your valid e-mail address.");
	  email.focus ();
	  return false; }
	
	}}