function constructform(form) {
  var _w = null;
  var prntstr, htmlstr;
  _w = window.open();
  _w.document.open();
  _w.moveTo(100,100);
  _w.focus();
  htmlstr = '<html><head><title>PC Questionnaire</title></head><body>';
  htmlstr += "<form>";
  htmlstr += "<h1>Presbyterian College Questionnaire</h1>";
  htmlstr += 'If the emailing to Trinity Presbytery fails to work, please <a href="javascript:window.print()"> PRINT </a> off a copy of these results <br> and mail or fax to:<br> Trinity Presbytery<br> 554 DeVega Dr <br> Lexington, SC 29073<br>FAX: 803-794-7830<hr>';

  prntstr = "%0D%0A%0D%0A.......PC Questionnaire.......%0D%0A";
  prntstr += "Question 1: ";
  htmlstr += "<br>Question 1: ";
  for(i=0; i<document.PCQues.Question1.length; i++) {
   if(document.PCQues.Question1[i].checked == true){
     prntstr += document.PCQues.Question1[i].value;
     htmlstr += document.PCQues.Question1[i].value;
   }
  }
  prntstr += "%0D%0AQuestion 2: ";
  htmlstr += "<br>Question 2: ";
  for(i=0; i<document.PCQues.Question2.length; i++) {
    if(document.PCQues.Question2[i].checked == true){
      prntstr += document.PCQues.Question2[i].value;
      htmlstr += document.PCQues.Question2[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 3: ";
  htmlstr += "<br>Question 3: ";
  for(i=0; i<document.PCQues.Question3.length; i++) {
    if(document.PCQues.Question3[i].checked == true){
      prntstr += document.PCQues.Question3[i].value;
      htmlstr += document.PCQues.Question3[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 4: ";
  htmlstr += "<br>Question 4: ";
  for(i=0; i<document.PCQues.Question4.length; i++) {
    if(document.PCQues.Question4[i].checked == true){
      prntstr += document.PCQues.Question4[i].value;
      htmlstr += document.PCQues.Question4[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 5: ";
  htmlstr += "<br>Question 5: ";
  for(i=0; i<document.PCQues.Question5.length; i++) {
    if(document.PCQues.Question5[i].checked == true){
      prntstr += document.PCQues.Question5[i].value;
      htmlstr += document.PCQues.Question5[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 6: ";
  htmlstr += "<br>Question 6: ";
  for(i=0; i<document.PCQues.Question6.length; i++) {
    if(document.PCQues.Question6[i].checked == true){
      prntstr += document.PCQues.Question6[i].value;
      htmlstr += document.PCQues.Question6[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 7: ";
  htmlstr += "<br>Question 7: ";
  for(i=0; i<document.PCQues.Question7.length; i++) {
    if(document.PCQues.Question7[i].checked == true){
      prntstr += document.PCQues.Question7[i].value;
      htmlstr += document.PCQues.Question7[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 8: ";
  htmlstr += "<br>Question 8: ";
  for(i=0; i<document.PCQues.Question8.length; i++) {
    if(document.PCQues.Question8[i].checked == true){
      prntstr += document.PCQues.Question8[i].value;
      htmlstr += document.PCQues.Question8[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 9: ";
  htmlstr += "<br>Question 9: ";
  for(i=0; i<document.PCQues.Question9.length; i++) {
    if(document.PCQues.Question9[i].checked == true){
      prntstr += document.PCQues.Question9[i].value;
      htmlstr += document.PCQues.Question9[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 10: ";
  htmlstr += "<br>Question 10: ";
  for(i=0; i<document.PCQues.Question10.length; i++) {
    if(document.PCQues.Question10[i].checked == true){
      prntstr += document.PCQues.Question10[i].value;
      htmlstr += document.PCQues.Question10[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 11: ";
  htmlstr += "<br>Question 11: ";
  for(i=0; i<document.PCQues.Question11.length; i++) {
    if(document.PCQues.Question11[i].checked == true){
      prntstr += document.PCQues.Question11[i].value;
      htmlstr += document.PCQues.Question11[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 12: ";
  htmlstr += "<br>Question 12: ";
  for(i=0; i<document.PCQues.Question12.length; i++) {
    if(document.PCQues.Question12[i].checked == true){
      prntstr += document.PCQues.Question12[i].value;
      htmlstr += document.PCQues.Question12[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 13: ";
  htmlstr += "<br>Question 13: ";
  for(i=0; i<document.PCQues.Question13.length; i++) {
    if(document.PCQues.Question13[i].checked == true){
      prntstr += document.PCQues.Question13[i].value;
      htmlstr += document.PCQues.Question13[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 14: ";
  htmlstr += "<br>Question 14: ";
  for(i=0; i<document.PCQues.Question14.length; i++) {
    if(document.PCQues.Question14[i].checked == true){
      prntstr += document.PCQues.Question14[i].value;
      htmlstr += document.PCQues.Question14[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 15: ";
  htmlstr += "<br>Question 15: ";
  for(i=0; i<document.PCQues.Question15.length; i++) {
    if(document.PCQues.Question15[i].checked == true){
      prntstr += document.PCQues.Question15[i].value;
      htmlstr += document.PCQues.Question15[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 16: ";
  htmlstr += "<br>Question 16: ";
  for(i=0; i<document.PCQues.Question16.length; i++) {
    if(document.PCQues.Question16[i].checked == true){
      prntstr += document.PCQues.Question16[i].value;
      htmlstr += document.PCQues.Question16[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 17: ";
  htmlstr += "<br>Question 17: ";
  for(i=0; i<document.PCQues.Question17.length; i++) {
    if(document.PCQues.Question17[i].checked == true){
      prntstr += document.PCQues.Question17[i].value;
      htmlstr += document.PCQues.Question17[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 18: ";
  htmlstr += "<br>Question 18: ";
  for(i=0; i<document.PCQues.Question18.length; i++) {
    if(document.PCQues.Question18[i].checked == true){
      prntstr += document.PCQues.Question18[i].value;
      htmlstr += document.PCQues.Question18[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 19: ";
  htmlstr += "<br>Question 19: ";
  for(i=0; i<document.PCQues.Question19.length; i++) {
    if(document.PCQues.Question19[i].checked == true){
      prntstr += document.PCQues.Question19[i].value;
      htmlstr += document.PCQues.Question19[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 20: ";
  htmlstr += "<br>Question 20: ";
  for(i=0; i<document.PCQues.Question20.length; i++) {
    if(document.PCQues.Question20[i].checked == true){
      prntstr += document.PCQues.Question20[i].value;
      htmlstr += document.PCQues.Question20[i].value;
    }
  }
  prntstr += "%0D%0AQuestion 21: ";
  htmlstr += "<br>Question 21: ";
  for(i=0; i<document.PCQues.Question21.length; i++) {
    if(document.PCQues.Question21[i].checked == true){
      prntstr += document.PCQues.Question21[i].value;
      htmlstr +=document.PCQues.Question21[i].value;
    }
  }
  htmlstr += "<br><br>Submitted by: ";
  htmlstr += document.PCQues.T1.value;
  htmlstr += " from " + document.PCQues.presbytery.value + " Presbytery<br>";
  htmlstr += " -------><b> Thank You!!</b><-------";
  _w.document.write(htmlstr);
  htmlstr += "</form><br></body></html>";
  _w.document.write('<hr><a href="javascript:self.close()"> CLOSE </a> this window.<br>');
  _w.document.write("</form><br></body></html>");
  _w.document.close();
  prntstr += "%0D%0A%0D%0ASubmitted by: ";
  prntstr +=document.PCQues.T1.value;
  prntstr += " from " + document.PCQues.presbytery.value + " Presbytery";
  prntstr += '%0D%0A<-------> Thank You <------->';
  if(bName()==1) 
    mailform(prntstr);
  else
    mailform(htmlstr);
}

function bName() {
  if(navigator.appName == "Microsoft Internet Explorer")
    return 1;
  if(navigator.appName == "Netscape")
    return 2;
  return 0;
}

function mailform(formstr) {
  var mailstr, headstr;
  mailstr = "mailto:trinity@trinity-presbytery.org?subject=PC Questionnaire results";
  headstr = "Click  'Send'  to transmit results---For a copy of these results, click on the second address line and fill in your email address";
  headstr += formstr;
  mailstr += "&body=" + headstr;
  location.href = mailstr;
}

function validate(form) {
  if(document.PCQues.T1.value.length<3) {
    window.alert('please enter name or email');
    return false;
  }
  constructform(form);
  return true;
}
