<!--

//function isBlank(s) {
//  for (var i = 0; i < s.length ; i++ )  {
//    var c = s.charAt(i);
//	  if ((c != ' ') && (c != '\n') && (c != '\t')) {
//	  return false;
//	  }
//  }
//  return true;
//}

function isBlank(elm) {
  if (elm.value == "" || elm.value == null) 
    return true;
    else return false;
}

function isSelected(elm) {
    	if (elm.selectedIndex == 0)
    	return false;
    	else return true;
}

function isEmail(elm) {
    if (elm.value.indexOf("@") + "" != "-1" &&
        elm.value.indexOf(".") + "" != "-1" &&
        elm.value != "") 
    return true;
    else return false;
}


function verify(f) {

  f.Name.optional=false;
  f.Name.label="Name";
  
  f.Company_Name.optional=false;
  f.Company_Name.label="Company Name";

  f.Phone.optional=false;
  f.Phone.label="Phone";

  f.PHORM_FROM.optional=false;
  f.PHORM_FROM.label="Email";
  
  f.Subscription.optional=false;
  f.Subscription.label="Subscription";
 
  var msg;
  var empty_fields = "";
  var errors = "";

  if (isEmail(f.email) == false) {
  errors += "You have not given us a valid e-mail address. Please enter this information in the space provided. Thanks.";
  }
	
  for (var i = 0; i < f.length ; i++ )  {
    var e = f.elements[i];

    if ((e.optional==false) && ((e.type == "select-one") || (e.type == "select-multiple"))) {
      if (!isSelected(e)) {
	    empty_fields += " " + e.label + ",";
		continue;
	  }
    }

	  if ((e.optional==false) && ((e.type == "text") || (e.type == "textarea"))) {
	    if ((e.value == null) || (e.value == ""))	{
	    empty_fields += " " + e.label + ",";
      continue;
	    }
    }

	  if ((e.type == "text") || (e.type == "textarea")) {
  	  if (e.highlength != null) {
	    var str = e.value + "";
		    if (str.length > e.highlength) {
		    errors += "- The field " + e.label + " must be shorter than " + e.highlength + " characters. It is currently " + str.length + " characters long.\n";
		    }
	    continue;
      }
	  }
  }

  if ((!empty_fields) && (!errors)) {
    return true;
  }

  msg  = "Error: \n";

  if (empty_fields) {
    msg += "You seem to have left the following field(s) blank: " + empty_fields + ".\n";
  }
  if (errors) {
    msg += errors + "\n";
  }
  msg += "Just complete the required fields and re-submit.\n";
  msg += "\n\n";

  alert (msg);
  return false;
}

//-->
