// JavaScript Document

function WriteToFile() {
 try {
   var fso, s;
   var today = new Date().getDate();
   fso = new ActiveXObject("Scripting.FileSystemObject");
   s = fso.OpenTextFile("ietm_data.txt" , 8, 1, -2);
   s.writeline("date, selection");
   s.writeline(today + ", " +  document.ietmdata.questionnaire.value );
   s.Close();
 }
catch(err){
  var strErr = 'Error:';
  strErr += '\nNumber:' + err.number;
  strErr += '\nDescription:' + err.description;
  document.write(strErr);
 }
}

function SendToEmail() {
	var subject = "OGA Church Website Questionnaire";
	var date = = new Date().getDate();
	var selection = document.ietmdata.questionnaire.value;
	window.location.href = "mailto:sdavidson@jameswatt.ac.uk?subject=" + subject + "&body=date is " +date+" and selection was " + selection;
}

