<!--

document.InputForm.action = "http://sdmines.sdsmt.edu/cgi-bin/global/send_message_2.cgi";

var enable = true;

	if (enable == true)
	{
//	Enable the input for JavaScript enabled browsers
	document.InputForm.Submit.disabled = false;
	document.InputForm.FirstName.disabled = false;
	document.InputForm.MiddleName.disabled = false;
	document.InputForm.LastName.disabled = false;
	document.InputForm.SID.disabled = false;
	document.InputForm.Street.disabled = false;
	document.InputForm.City.disabled = false;
	document.InputForm.State.disabled = false;
	document.InputForm.Zip.disabled = false;
	document.InputForm.Major1.disabled = false;
	document.InputForm.Major2.disabled = false;
	document.InputForm.Minor1.disabled = false;
	document.InputForm.Minor2.disabled = false;
	document.InputForm.Certificate1.disabled = false;
	document.InputForm.Certificate2.disabled = false;
	document.InputForm.Certificate3.disabled = false;
	document.InputForm.Hometown.disabled = false;
	document.InputForm.HomeState.disabled = false;
	document.InputForm.HighSchool.disabled = false;
	document.InputForm.HSCity.disabled = false;
	document.InputForm.HSState.disabled = false;
	document.InputForm.Newspaper.disabled = false;
	document.InputForm.HometownRelease[0].disabled = false;
	document.InputForm.HometownRelease[1].disabled = false;
	document.InputForm.HonorsRelease[0].disabled = false;
	document.InputForm.HonorsRelease[1].disabled = false;
	document.InputForm.NameRelease[0].disabled = false;
	document.InputForm.NameRelease[1].disabled = false;
	document.InputForm.Ceremony[0].disabled = false;
	document.InputForm.Ceremony[1].disabled = false;
	document.InputForm.Guests.disabled = false;
	document.InputForm.Name.disabled = false;
	}

function validit()
{
//Timestamp
		stamp = new Date();
		document.InputForm.Stamp.value = stamp;

// Used for not authorized.
	if (document.InputForm.miners.value != '')
		document.InputForm.action = "http://interact.sdsmt.edu/not-authorized.asp";

// Required Information

   if (document.InputForm.FirstName.value == "")
   {
      alert("Please enter your first name.");
      document.InputForm.FirstName.focus();
      return false;
   }
   
   if (document.InputForm.LastName.value == "")
   {
      alert("Please enter your last name.");
      document.InputForm.LastName.focus();
      return false;
   }
   
   if (document.InputForm.SID.value == "")
   {
      alert("Please enter your student ID.");
      document.InputForm.SID.focus();
      return false;
   }

   if (vGradDate == null)
   {
      alert("Please tell us your anticipated graduation date.");
      document.InputForm.GradDate[1].focus();
      return false;
   }
	
   if (document.InputForm.Street.value == "")
   {
      alert("Please enter your street address.");
      document.InputForm.Street.focus();
      return false;
   }

   if (document.InputForm.City.value == "")
   {
      alert("Please enter the city.");
      document.InputForm.City.focus();
      return false;
   }

   if (document.InputForm.State.selectedIndex == 0)
   {
      alert("Please select the state.");
      document.InputForm.State.focus();
      return (false);
   }

   if (document.InputForm.Zip.value == "")
   {
      alert("Please enter the zip code.");
      document.InputForm.Zip.focus();
      return false;
   }

   if (document.InputForm.Major1.selectedIndex == 0)
   {
      alert("Please select your major.");
      document.InputForm.Major1.focus();
      return (false);
   }

   if (document.InputForm.Hometown.value == "")
   {
      alert("Please enter your hometown.");
      document.InputForm.Hometown.focus();
      return false;
   }

   if (document.InputForm.HighSchool.value == "")
   {
      alert("Please enter your high school.");
      document.InputForm.HighSchool.focus();
      return false;
   }

   if (document.InputForm.HSCity.value == "")
   {
      alert("Please enter the ciry of your high school.");
      document.InputForm.HSCity.focus();
      return false;
   }

   var radioSelected = false;
   for (i = 0;  i < document.InputForm.HometownRelease.length;  i++)
   {
      if (document.InputForm.HometownRelease[i].checked)
        radioSelected = true;
   }
   if (!radioSelected)
   {
      alert("Please tell us if you give your permission to release your hometown information.");
      document.InputForm.HometownRelease[0].focus();
      return false;
   }

	 if (document.InputForm.HometownRelease[0].checked == true)
	 {	
	   if (document.InputForm.Newspaper.value == "")
	   {
	      alert("Please enter your local newspaper.");
	      document.InputForm.Newspaper.focus();
	      return false;
	   }
	 }

   var radioSelected = false;
   for (i = 0;  i < document.InputForm.HonorsRelease.length;  i++)
   {
      if (document.InputForm.HonorsRelease[i].checked)
        radioSelected = true;
   }
   if (!radioSelected)
   {
      alert("Please tell us if you give your permission to release your honors information.");
      document.InputForm.HonorsRelease[0].focus();
      return false;
   }

   var radioSelected = false;
   for (i = 0;  i < document.InputForm.NameRelease.length;  i++)
   {
      if (document.InputForm.NameRelease[i].checked)
        radioSelected = true;
   }
   if (!radioSelected)
   {
      alert("Please tell us if you give your permission to print your name on the commencement program.");
      document.InputForm.NameRelease[0].focus();
      return false;
   }

   var radioSelected = false;
   for (i = 0;  i < document.InputForm.Ceremony.length;  i++)
   {
      if (document.InputForm.Ceremony[i].checked)
        radioSelected = true;
   }
   if (!radioSelected)
   {
      alert("Please tell if you plan to attend the ceremony.");
      document.InputForm.Ceremony[0].focus();
      return false;
   }

   if (document.InputForm.Guests.value == "")
   {
      alert("Please tell us approximately how many guests will be attending.");
      document.InputForm.Guests.focus();
      return false;
   }

// Email Body

	em = '<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt">';
	em += '<p><b>Application for Graduation and Commencement</b></p>';
	em += '<p>NAME:&nbsp;&nbsp;&nbsp;&nbsp; ' + document.InputForm.FirstName.value + ' ' + document.InputForm.MiddleName.value + ' ' + document.InputForm.LastName.value + '</p>';
	em += '<p>ID #:&nbsp;&nbsp;&nbsp;&nbsp; ' + document.InputForm.SID.value + '</p>';
	em += '<p>ANTICIPATED GRADUATION DATE:&nbsp;&nbsp;&nbsp;&nbsp; ';
	em += vGradDate + '</p>';
	em += '<p>Mail diploma to: </p>';
	em += '<blockquote>' + document.InputForm.Street.value + '<br />';
	em += document.InputForm.City.value + ', ' + document.InputForm.State.value + '&nbsp; ' + document.InputForm.Zip.value + '</blockquote>';
	em += '<table border="0" cellpadding="3" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt">';
	em += '<tr>';
	em += '<td>';
	em += '<p>MAJOR(S):</p>';
	em += '</td>';
	em += '<td>' + document.InputForm.Major1.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td>&nbsp;</td>';
	em += '<td>' + document.InputForm.Major2.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td>MINOR(S):</td>';
	em += '<td>' + document.InputForm.Minor1.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td>&nbsp;</td>';
	em += '<td>' + document.InputForm.Minor2.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td>CERTIFICATE(S):</td>';
	em += '<td>' + document.InputForm.Certificate1.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td>&nbsp;</td>';
	em += '<td>' + document.InputForm.Certificate2.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td>&nbsp;</td>';
	em += '<td>' + document.InputForm.Certificate3.value + '</td>';
	em += '</tr>';
	em += '</table>';
	em += '<p>HOMETOWN:&nbsp;&nbsp;&nbsp;&nbsp; ';
	em += document.InputForm.Hometown.value + ', ' + document.InputForm.HomeState.value + '</p>';
	em += '<p>HIGH SCHOOL:&nbsp;&nbsp;&nbsp;&nbsp; ';
	em += document.InputForm.HighSchool.value + ', ' + document.InputForm.HSCity.value + ', ' + document.InputForm.HSState.value + '</p>';
	em += '<p>HOMETOWN NEWSPAPER(S):&nbsp;&nbsp;&nbsp;&nbsp; ' + document.InputForm.Newspaper.value + '<br /></p>';
	em += '<p>Permission to release hometown:&nbsp;&nbsp;&nbsp;&nbsp; ';
	em += vHometown + '</p>';
	em += '<p>Permission to release honors:&nbsp;&nbsp;&nbsp;&nbsp; ';
	em += vHonors + '</p>';
	em += '<p>Permission to print name:&nbsp;&nbsp;&nbsp;&nbsp; ';
	em += vName + '</p>';
	em += '<hr style="color: #000080" />';
	em += '<p>Attending commencement ceremony:&nbsp;&nbsp;&nbsp;&nbsp; ';
	em += vCeremony + '</p>';
	em += '<p>GUESTS:&nbsp;&nbsp;&nbsp;&nbsp; ';
	em += document.InputForm.Guests.value + '</p>';
	em += '<p>Pronunciation:&nbsp; ' + document.InputForm.Name.value + '</p>';
	em += '</div>';

  document.InputForm.email_body.value = em;



// Email header information

	// replaces HPCNet User as label for http@barney.hpcnet.org.
	document.InputForm.email_from_name.value = 'SDSM&T Registrar and Enrollment Services';
	
	// for reply to
   from = 'Kathryn.Crawford@sdsmt.edu';
   document.InputForm.email_from.value = from;

//   to = 'Vickie.Bender@sdsmt.edu';   
 	 to = 'Kathryn.Crawford@sdsmt.edu';
   document.InputForm.email_to.value = to;
   
   subj = document.InputForm.FirstName.value + ' ' + document.InputForm.LastName.value + ' - AA/BS Graduation Application';
   document.InputForm.email_subject.value = subj;

// CSV File

   if (document.InputForm.GradDate[0].checked == true)
	   csvurl = '/upload/results/aes/grad-may-august.csv';
   if (document.InputForm.GradDate[1].checked == true)
	   csvurl = '/upload/results/aes/grad-may-august.csv';
   if (document.InputForm.GradDate[2].checked == true)
	   csvurl = '/upload/results/aes/grad-december.csv';
	   
	 document.InputForm.csv_file.value = csvurl;

// Confirmation page 

   confurl = 'http://interact.sdsmt.edu/aes/graduation_confirm.asp' ;
   document.InputForm.confirm.value = confurl;

   return true;

}

//-->
