code: protected String getJavascriptBegin(String jsFormName, String methods) {
  		StringBuffer sb = new StringBuffer();
  		String name = jsFormName.replace('/', '_'); // remove any '/' characters
  
  		name = jsFormName.substring(0, 1).toUpperCase()
  				+ jsFormName.substring(1, jsFormName.length());
  
  		sb.append("\n    var bCancel = false; \n\n");
  		sb.append("    function validate" + name + "(form) { \n");
  		sb.append("        if (bCancel) { \n");
  		sb.append("            return true; \n");
  		sb.append("        } else { \n");
  
  		// Always return true if there aren't any Javascript validation methods
  		if ((methods == null) || (methods.length() == 0)) {
  			sb.append("            return true; \n");
  		} else {
  			sb.append("            var formValidationResult; \n");
  			sb.append("            formValidationResult = " + methods + "; \n");
  			if (methods.indexOf("&&") >= 0) {
  				sb.append("            return (formValidationResult); \n");
  			} else {
  				// Making Sure that Bitwise operator works:
  				sb.append("            return (formValidationResult == 1); \n");
  			}
  		}
  		sb.append("        } \n");
  		sb.append("    } \n\n");
  
  		return sb.toString();
  	}
docs: Returns the opening script element and some initial javascript.