
<!-- This must be added to the FORM header onSubmit="return validateForm(this)" -->

var expdate = new Date ();

<!-- Used to clear marked radio buttons -->
function resetForm() {
document.fback.ContactName.value=GetCookie('1bmrss$name')
document.fback.ContactEmail.value=GetCookie('1bmrss$email')
}

<!-- This validates the chosen configuration -->

function validateForm(f) {
 var output = '';

<!-- First do basic validation looking for no answers and bad email addresses -->

 if (eval("document.fback.ContactName.value") == '') {
  output += '  - Your Name\n';
  }
 if ((eval("document.fback.ContactEmail.value") == '') ||
  (document.fback.ContactEmail.value.indexOf(',') != -1) || 
  (document.fback.ContactEmail.value.indexOf(' ') != -1) || 
  (document.fback.ContactEmail.value.indexOf('@') == -1) || 
  (document.fback.ContactEmail.value.indexOf('.') == -1)) {
  output += '  - Your Valid Email Address\n';
  }
 if (eval("document.fback.requiredComment.value") == '') {
  output += '  - Your Comment\n';
  }
 if (output != '') {
   alert('Please enter the following information:    \n\r' + output);
   return false;
 } 


<!-- Save info in cookie -->

expdate.setTime (expdate.getTime() + (24 * 60 * 60 * 1000 * 31));
SetCookie ('1bmrss$name', document.fback.ContactName.value, expdate);
SetCookie ('1bmrss$email', document.fback.ContactEmail.value, expdate);
return true;
}
  

<!-- ================== COOKIE FUNCTIONS BELOW ================== -->

function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}

function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
  var j = i + alen;
  if (document.cookie.substring(i, j) == arg)
  return getCookieVal (j);
  i = document.cookie.indexOf(" ", i) + 1;
  if (i == 0) break; 
}
return '';
}  

function SetCookie (cname, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
expdate.setTime(expdate.getTime() +  (24 * 60 * 60 * 1000 * 31));
document.cookie = cname + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}