
function createmessage() {
fn = document.volunteer.fname.value;
ln = document.volunteer.lname.value;
a = document.volunteer.saddress.value;
c = document.volunteer.city.value;
co = document.volunteer.county.value;
ce = document.volunteer.cell.value;
f = document.volunteer.fax.value;
z = document.volunteer.zip.value;
ph = document.volunteer.phone.value;
em = document.volunteer.GenMailFrom.value;
dob = document.volunteer.dob.value;
en = document.volunteer.ename.value;
jt = document.volunteer.jtitle.value;
ea = document.volunteer.esaddress.value;
ec = document.volunteer.ecity.value;
eco = document.volunteer.ecounty.value;
ece = document.volunteer.ecell.value;
ef = document.volunteer.efax.value;
ez = document.volunteer.ezip.value;
eph = document.volunteer.ephone.value;
otrain = document.volunteer.mtrain.value;
oaltemail=document.volunteer.altemail.value;
//loc = ""
skill=""
train=""
AddActive=""
//validating the form

if (dob.length < 1) {
alert("please enter your Date of Birth")
document.volunteer.dob.focus();
return false;
}

if (fn.length < 1) {
alert("please enter your first name")
document.volunteer.fname.focus();
return false;
}
if (ln.length < 1) {
alert("please enter your last name")
document.volunteer.lname.focus();
return false;
}
if (a.length < 1) {
alert("please enter your address")
document.volunteer.saddress.focus();
return false;
}
if (c.length < 1) {
alert("please enter your city")
document.volunteer.city.focus();
return false;
}
if (z.length == "") {
alert("please enter your Zip Code")
document.volunteer.zip.focus();
return false;
}
if ((z.length != 5) && (z.length != 10)){
alert("please enter valid zip code")
document.volunteer.zip.focus();
return false;
}
if (em.length < 1) {
alert("please enter your e-mail Address")
document.volunteer.GenMailFrom.focus();
return false;
} 
if (em.length < 1) {
alert("please enter your e-mail Address")
document.volunteer.GenMailFrom.focus();
return false;
} else if ((em.indexOf("@") == -1) || (em.indexOf(".") == -1)){
alert("please enter a valid Email Address")
document.volunteer.GenMailFrom.focus();
return false;
}
  if (ph.length != 12) {  
  	alert("please enter your phone number in this format 111-11-1111.")	 	  	
   document.volunteer.phone.focus();
  	 return false 
  	 }
  for (j=0; j<ph.length; j++) {
    if ((j == 3) || (j == 7)) {
      if (ph.charAt(j) != "-") {
      	alert("please enter your phone number in this format 111-11-1111.")	 	  	
   document.volunteer.phone.focus();
      	 return false 
      	 }
    } 
    else {
      if ((ph.charAt(j) < "0") || (ph.charAt(j) > "9")) { 
      	alert("please enter your phone number in this format 111-11-1111.")	 	  	
   document.volunteer.phone.focus();
      	return false 
      	}
    }
  }
  
if (ce.length != "") {
   if (ce.length != 12) {
   	alert("please enter your cell number in this format 111-11-1111.")	 	  	
   document.volunteer.cell.focus();
   	 return false
   	  }
  for (kk=0; kk<ce.length; kk++) {
    if ((kk == 3) || (kk == 7)) {
      if (ce.charAt(kk) != "-") { 
      	alert("please enter your cell number in this format 111-11-1111.")	 	  	
   document.volunteer.cell.focus();
      	return false 
      	}
    } else {
      if ((ce.charAt(kk) < "0") || (ce.charAt(kk) > "9")) {
      	alert("please enter your cell number in this format 111-11-1111.")	 	  	
   document.volunteer.cell.focus();
      	 return false
      	  }
    }
  }
}  

if (f.length != "") {
   if (f.length != 12) {
   	alert("please enter your fax number in this format 111-11-1111.")	 	  	
   document.volunteer.fax.focus();
   	 return false
   	  }
  for (kkk=0; kkk<f.length; kkk++) {
    if ((kkk == 3) || (kkk == 7)) {
      if (f.charAt(kkk) != "-") { 
      	alert("please enter your fax number in this format 111-11-1111.")	 	  	
   document.volunteer.fax.focus();
      	return false 
      	}
    } else {
      if ((f.charAt(kkk) < "0") || (f.charAt(kkk) > "9")) {
      	alert("please enter your work fax number in this format 111-11-1111.")	 	  	
   document.volunteer.fax.focus();
      	 return false
      	  }
    }
  }
}


 
if (eph.length != "") {
   if (eph.length != 12) {
   	alert("please enter your work phone number in this format 111-11-1111.")	 	  	
   document.volunteer.ephone.focus();
   	 return false
   	  }
  for (x=0; x<eph.length; x++) {
    if ((x == 3) || (x == 7)) {
      if (eph.charAt(x) != "-") { 
      	alert("please enter your work phone number in this format 111-11-1111.")	 	  	
   document.volunteer.ephone.focus();
      	return false 
      	}
    } else {
      if ((eph.charAt(x) < "0") || (eph.charAt(x) > "9")) {
      	alert("please enter your work phone number in this format 111-11-1111.")	 	  	
   document.volunteer.ephone.focus();
      	 return false
      	  }
    }
  }
}


if (ece.length != "") {
   if (ece.length != 12) {
   	alert("please enter your work cell number in this format 111-11-1111.")	 	  	
   document.volunteer.ecell.focus();
   	 return false
   	  }
  for (y=0; y<ece.length; y++) {
    if ((y == 3) || (y == 7)) {
      if (ece.charAt(y) != "-") { 
      	alert("please enter your work cell number in this format 111-11-1111.")	 	  	
   document.volunteer.ecell.focus();
      	return false 
      	}
    } else {
      if ((ece.charAt(y) < "0") || (ece.charAt(y) > "9")) {
      	alert("please enter your work cell number in this format 111-11-1111.")	 	  	
   document.volunteer.ecell.focus();
      	 return false
      	  }
    }
  }
}


if (ef.length != "") {
   if (ef.length != 12) {
   	alert("please enter your work fax number in this format 111-11-1111.")	 	  	
   document.volunteer.efax.focus();
   	 return false
   	  }
  for (zz=0; zz<ef.length; zz++) {
    if ((zz == 3) || (zz == 7)) {
      if (ef.charAt(zz) != "-") { 
      	alert("please enter your work fax number in this format 111-11-1111.")	 	  	
   document.volunteer.efax.focus();
      	return false 
      	}
    } else {
      if ((ef.charAt(zz) < "0") || (ef.charAt(zz) > "9")) {
      	alert("please enter your work fax number in this format 111-11-1111.")	 	  	
   document.volunteer.efax.focus();
      	 return false
      	  }
    }
  }
}

if (dob.length != "") { 
if (dob.length != 10) { 
   alert("please enter your date of birth in this format MM/DD/YYYY.")	 	  	
   document.volunteer.dob.focus();
return false 
}
  for (i=0; i<dob.length; i++) {
    if ((i == 2) || (i == 5)) {
      if (dob.charAt(i) != "/") { 
      	 alert("please enter your date of birth in this format MM/DD/YYYY.")	 	  	
    document.volunteer.dob.focus();
      	return false 
      	}
    } else {
      if ((dob.charAt(i) < "0") || (dob.charAt(i) > "9")) {
      		 alert("please enter your date of birth in this format MM/DD/YYYY.")	 	  	
    document.volunteer.dob.focus();
      	 return false
      	  }
    }
  }
}
//location fields removed 6.16.08 per F RATH
//for (xxx = 0; xxx < 3; xxx++){ 
//if (document.volunteer.location[xxx].checked){
//  loc = loc + document.volunteer.location[xxx].value +", ";
//}
//}
if (document.volunteer.sskill[0].checked){
  skill = skill + document.volunteer.sskill[0].value + "\n";
}
if (document.volunteer.sskill[1].checked){
  skill = skill + document.volunteer.sskill[1].value +": " 
}
skill = skill + document.volunteer.alan.value + "\n";

if (document.volunteer.sskill[2].checked){
  skill = skill + document.volunteer.sskill[2].value +": " 
}
skill = skill + document.volunteer.cskill.value + "\n";
if (document.volunteer.sskill[3].checked){
  skill = skill + document.volunteer.sskill[3].value +": " 
}
skill = skill + document.volunteer.oskill.value;

for (zzz = 0; zzz < 15; zzz++){ 
if (document.volunteer.mtraining[zzz].checked){
  train = train + document.volunteer.mtraining[zzz].value +", ";
}
}
if (document.volunteer.mtraining[15].checked){
  train = train + document.volunteer.mtraining[zzz].value +": ";
  train = train + document.volunteer.mtrain.value;
}

for (zzzz = 0; zzzz < 4; zzzz++){ 
if (document.volunteer.AddAct[zzzz].checked){
  AddActive = AddActive + document.volunteer.AddAct[zzzz].value +", ";
}
}
if (document.volunteer.AddAct[4].checked){
  AddActive = AddActive + document.volunteer.AddAct[zzzz].value +": ";
  AddActive = AddActive + document.volunteer.AddActCom.value;
}


if (document.volunteer.Citizenship[0].checked){
	citizen = "I am a U.S. Citizen";
}
if (document.volunteer.Citizenship[1].checked){
	citizen = "I am a NOT a U.S. Citizen";
}


document.volunteer.GenMailMess.value = "\n" + "First Name: " + fn + "  " + "Last Name: " + ln + "\n" + 
"Address: " + a + "\n" + "City: " + c + "  " + "County: " + co + "  " + "Zip: "  + z + "\n" + 
"Phone: " + ph + "  " + "Fax: " + f + "  " + "Cell: " + ce + "\n" + "Email Address: "  + em + "  " + 
"Date of Birth: " + dob + "\n" + "Employer's Name: " + en + "\n" + "Job Title: " + jt + "\n" + 
"Address: " + ea + "\n" + "City: " + ec + "  " + "County: " + eco + "  " + "Zip: "  + ez + "\n" + 
"Phone: " + eph + "  " + "Fax: " + ef + "  " + "Cell: " + ece + "\n" + "\n" +  
"Special Skills: " + skill + "\n" + "\n" + 
"Medical Training and Experience: "  + train + "\n " + "\n" +
"Additional MRC Activities: "  + AddActive + "\n " + citizen;
document.volunteer.GenMailFrom.value = em  
}                         