<!--

//	Enable the input for JavaScript enabled browsers
	document.InputForm.Submit.disabled = false;
	document.InputForm.Title.disabled = false;
	document.InputForm.AllDay.disabled = false;
	document.InputForm.Startdate.disabled = false;
	document.InputForm.StartHH.disabled = false;
	document.InputForm.StartMM.disabled = false;
	document.InputForm.StartM.disabled = false;
	document.InputForm.Enddate.disabled = false;
	document.InputForm.EndHH.disabled = false;
	document.InputForm.EndMM.disabled = false;
	document.InputForm.EndM.disabled = false;
	document.InputForm.Importance.disabled = false;
	document.InputForm.Location.disabled = false;
	document.InputForm.Website.disabled = false;
	document.InputForm.Description.disabled = false;
	document.InputForm.Name.disabled = false;
	document.InputForm.Department.disabled = false;
	document.InputForm.Phone.disabled = false;
	document.InputForm.Email.disabled = false;
	

function validit()
{

// Set form name
	var form = document.InputForm;
	
// Required Information

	if (form.Title.value == "")
	{
		alert("Please enter the title of the event.")
		form.Title.focus();
		return false;
	}
	
	if (form.Name.value == "")
	{
		alert("Please enter your name.");
		form.Name.focus();
		return false;
	}

	if (form.Department.value == "")
	{
		alert("Please enter your Department/Organization.");
		form.Department.focus();
		return false;
	}

	if (form.Phone.value=="")
	{
		alert("Please enter your daytime phone number.");
		Phone.focus();
		return false;
	}

   if (form.Email.value == "")
   {
      alert("Please enter your email address.");
      form.Email.focus();
      return false;
   }

   if (form.Email.value != "")
   {
      if (form.Email.value.indexOf("@") == -1)
      {
         alert('Your email address is invalid it must contain @.');
         form.Email.focus();
         return false;
      }  
   }


// Email Body

	em = '<HTML><BODY>';
	em += '<div align="center">';
	em += '<table border="0" cellpadding="10" width="746" bgcolor="#FFFFFF" style="border: 1px solid #FFCC00">';
	em += '<tr>';
	em += '<td align="center"><strong>SDSM&amp;T Calendar Event</strong></td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td>';
	em += '<table style="width: 100%">';
	em += '<tr>';
	em += '<td><strong>Event Title</strong><br>';
	em += '</td>';
	em += '<td colspan="2">' + document.InputForm.Title.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td><strong>All Day Event</strong></td>';
	em += '<td colspan = "2">';
		if(document.InputForm.AllDay[0].checked)
			em += 'Yes';
		else
			em += 'No';
	em += '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td><strong>Starts On</strong></td>';
	em += '<td>Date: ' + document.InputForm.Startdate.value + '</td>';
	em += '<td style="width: 200px">Time: ';
	em += document.InputForm.StartHH.value + ':' + document.InputForm.StartMM.value + ' ' + document.InputForm.StartM.value;
	em += '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td><strong>Ends On</strong></td>';
	em += '<td>Date: ' + document.InputForm.Enddate.value + '</td>';
	em += '<td>Time: ';
	em += document.InputForm.EndHH.value + ':' + document.InputForm.EndMM.value + ' ' + document.InputForm.EndM.value;
	em += '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td><strong>Importance</strong></td>';
	em += '<td colspan="2">' + document.InputForm.Importance.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td><strong>Building/Location</strong></td>';
	em += '<td colspan="2">' + document.InputForm.Location.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td><strong>Website</strong></td>';
	em += '<td colspan="2">' + document.InputForm.Website.value + '</td>';
	em += '</tr>';
	em += '</table>';
	em += '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td>';
	em += 'Event Description:<br>';
	em += '<p>' + document.InputForm.Description.value + '</p></td>'
	em += '</tr>';
	em += '<tr>';
	em += '<td>';
	em += '<div align="left">';
	em += '<br>';
	em += '<strong>Submitted by...<br>';
	em += '</strong></div>';
	em += '<table border="0" style="width: 100%;" id="table2" class="style1">';
	em += '<tr>';
	em += '<td nowrap style="width: 50%"><b>Name: </b>' + document.InputForm.Name.value + '</td>';
	em += '<td nowrap><b>Phone: </b>' + document.InputForm.Phone.value + '</td>';
	em += '</tr>';
	em += '<tr>';
	em += '<td nowrap><b>Department/Organization: </b>' + document.InputForm.Department.value + '</td>';
	em += '<td nowrap><b>Email: </b>' + document.InputForm.Email.value + '</td>';
	em += '</tr>';
	em += '</table>';
	em += '</td>';
	em += '</tr>';
	em += '</table>';
	em += '</div>';
	em += '</body></html>';
	   
  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 Webmaster';
	
	// for reply to
	from = 'webmaster@sdsmt.edu';
	document.InputForm.email_from.value = from;
   
	cc = document.InputForm.Email.value;
	document.InputForm.email_cc.value = cc;

	subj = 'Calendar Event: ' + document.InputForm.Title.value;
	document.InputForm.email_subject.value = subj;

   return true;

}

//-->
