//Written by Evan Callahan, NPower Seattle
	function validateform(theForm) {
try {
	//alert("function");
	  // add the name of each field you want to require
	  // for custom fields, use the Salesforce field ID
	  var required = ["email","first_name","last_name","company","title","country"];
	  var invalid = false;
	  for (var i in required) {
	//alert("required " + i + " " + required[i]);	
	    //var theField = theForm[required[i]];
	    var theField = document.getElementById(required[i]);
	    var theLabel = document.getElementById(required[i] + "label");
	    if ((theField != null) && (theField.value == "")) {
	    	if (theLabel != null){
		      theLabel.className = "invalid";
		}
	      if (!invalid){
	      	theField.focus();
	      }
	      invalid = true;
	    } else {
	    	if (theLabel != null){
		      theLabel.className = "";
		}
	    }
	  }
	  if (invalid) {
	     //alert("Please enter a value in the highlighted fields.");
	    try {
		    var registrationerrordiv = document.getElementById("registrationerrordiv");
		    if (registrationerrordiv != null){
	    		registrationerrordiv.className = 'inline';
	    	    }
	    } catch (exception){
	    }
	    return false;
	  } else {
	    return true;
	  }
	
} catch (exception){
	//alert("exception" + exception);
}
return true;
}