	<!--
/*==================================================================================== */
/*  Function Name: checkForm
       Parameters: None
          Returns: Boolean
          Purpose: This function checks for any blanks that are in the text boxes. 
                   It is done in sequential order. The first instance of a blank text 
                   box will throw an error, display an error message below the textbox 
                   in violation, and put the focus on the violating textbox.           */
/*==================================================================================== */
function checkForm() 
{
	//--Variables
	txtContactName = document.getElementById("txtContactName").value;
	txtContactEmail = document.getElementById("txtContactEmail").value;
	txtContactNumber = document.getElementById("txtContactNumber").value;
	txtGroupDept = document.getElementById("txtGroupDept").value;
	txtEventTitle = document.getElementById("txtEventTitle").value;
	txtEventDescription = document.getElementById("txtEventDescription").value;
	txtExpected = document.getElementById("txtExpected").value;
	txtRoomNum = document.getElementById("txtRoomNum").value;

	//--Check For Blanks In Text Boxes
	if (txtContactName == "") {
	hideAllErrors();
	document.getElementById("errContactName").style.display = "inline";
	document.getElementById("txtContactName").select();
	document.getElementById("txtContactName").focus();
	return false;}		
		
		else if (txtContactEmail == "") {
		hideAllErrors();
		document.getElementById("errContactEmail").style.display = "inline";
		document.getElementById("txtContactEmail").select();
		document.getElementById("txtContactEmail").focus();
		return false;}
					
			else if (eMailcheck(txtContactEmail)==false){
			hideAllErrors();
			document.getElementById("errContactEmail").style.display = "inline";
			document.getElementById("txtContactEmail").select();
			document.getElementById("txtContactEmail").focus();
			return false;}
			
				else if (txtContactNumber == "") {
				hideAllErrors();
				document.getElementById("errContactNumber").style.display = "inline";
				document.getElementById("txtContactNumber").select();
				document.getElementById("txtContactNumber").focus();
				return false;}
				
					else if (txtGroupDept == "") {
					hideAllErrors();
					document.getElementById("errGroupDept").style.display = "inline";
					document.getElementById("txtGroupDept").select();
					document.getElementById("txtGroupDept").focus();
					return false;}
					
						else if (txtEventTitle == "") {
						hideAllErrors();
						document.getElementById("errEventTitle").style.display = "inline";
						document.getElementById("txtEventTitle").select();
						document.getElementById("txtEventTitle").focus();
						return false;} 
						
							else if (txtEventDescription == "") {
							hideAllErrors();
							document.getElementById("errEventDescription").style.display = "inline";
							document.getElementById("txtEventDescription").select();
							document.getElementById("txtEventDescription").focus();
							return false;} 
							
								else if (txtExpected == "") {
								hideAllErrors();
								document.getElementById("errExpected").style.display = "inline";
								document.getElementById("txtExpected").select();
								document.getElementById("txtExpected").focus();
								return false;} 
								
									else if (txtRoomNum == "") {
									hideAllErrors();
									document.getElementById("errRoomNum").style.display = "inline";
									document.getElementById("txtRoomNum").select();
									document.getElementById("txtRoomNum").focus();
									return false;} 
									
	else 
	// This means that all text boxes have something entered into them.
	return true;
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: hideAllErrors
       Parameters: None
          Returns: Boolean
          Purpose: This function simply clears any errors that are present on the form.
                   This check runs every time you attempt to submit the current form.
/*==================================================================================== */
function hideAllErrors() 
{
	//-- Clear Any Error Display Messages
	document.getElementById("errContactName").style.display = "none";
	document.getElementById("errContactEmail").style.display = "none";
	document.getElementById("errContactNumber").style.display = "none";
	document.getElementById("errGroupDept").style.display = "none";
	document.getElementById("errEventTitle").style.display = "none";
	document.getElementById("errEventDescription").style.display = "none";
	document.getElementById("errExpected").style.display = "none";
	document.getElementById("errRoomNum").style.display = "none";
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: eMailcheck
       Parameters: textbox.value
          Returns: Boolean
          Purpose: This function will first check to make sure there is text entered 
		           before the @ symbol. If text has been entered prior, it then checks 
				   that you enter the @ symbol directly after the first text. Once that 
				   is done, it looks for text directly after the @ symbol. If text has 
				   been entered after the @ symbol, it will then check for a dot after 
				   that text. Once it finds the dot, it then checks for text after the 
				   dot. If all this passes the function returns true.                  */
/*==================================================================================== */
function eMailcheck(str) 
{
		// Variables
		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)

		// Begin Validation
		if (str.indexOf(at)==-1){
		   return false;}
		
			if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
				return false;}
		
				if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    		return false;}
		
					if (str.indexOf(at,(lat+1))!=-1){
		   				return false;}
		
						if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    				return false;}
		
							if (str.indexOf(dot,(lat+2))==-1){
		   						return false;}
		
								if (str.indexOf(" ")!=-1){
		    						return false;}
 								
								// If the code makes it to here than validation has passed
								return true;					
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: checkNoEnter
       Parameters: textbox event
          Returns: Boolean
          Purpose: This function receives the event from the keyPress on the current
		  	       textbox. This will ensure that only numbers are input into the text
				   box. If it is not a number, then it will not be allowed to show up
				   on the form.
/*==================================================================================== */
function checkNoEnter(evt) 
{
	// Variables
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode

    if (charCode == 13)
	{
        return false;
    }
    	return true;
}
/*==================================================================================== */
	
/*==================================================================================== */
/*  Function Name: checkForNums
       Parameters: textbox event
          Returns: Boolean
          Purpose: This function receives the event from the keyPress on the current
		  	       textbox. This will ensure that only numbers are input into the text
				   box. If it is not a number, then it will not be allowed to show up
				   on the form.
/*==================================================================================== */
function checkForNums(evt) 
{
	// Variables
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode

    if (( charCode >= 48 && charCode <= 57) || 
		( charCode == 32 || charCode == 8 || charCode == 9 )||
		(charCode == 46 || charCode == 35 || charCode == 36 ))
	{
        return true;
    }
    	return false;
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: checkForLetters
       Parameters: textbox event
          Returns: Boolean
          Purpose: This function receives the event from the keyPress on the current
		  	       textbox. This will ensure that only letters are input into the text
				   box. If it is not a letter, then it will not be allowed to show up
				   on the form.
/*==================================================================================== */
function checkForLetters(evt) 
{
	// Variables
    evt = (evt) ? evt : window.event
    var charCode = (evt.which) ? evt.which : evt.keyCode
		
    if (( charCode >= 65 && charCode <= 92 ) || 
		( charCode >= 97 && charCode <= 122 ) || 
		( charCode == 32 || charCode == 8 || charCode == 9 )||
		(charCode == 46 || charCode == 35 || charCode == 36 ))
	{
		return true;
    }
    	return false;
}
/*==================================================================================== */
	-->
