    <!--
    
 var attending; //graduation attendance flag
    
/*==================================================================================== */
/*  Function Name: leadingZero
       Parameters: 
          Returns: integer
          Purpose: This function adds a leading zero to numbers less than 10           
/*==================================================================================== */
function leadingZero(x){
    return (x>9)?x:'0'+x;
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: checkDeadline
       Parameters: 
          Returns: Boolean
          Purpose: This function checks to make sure todays date is less than the deadline
                   for the date for intent.
      Maintinance: Final dates for deadlines has yet to be determined by the registrars office. 
                   Function will need to be updated to reflect these changes.           
/*==================================================================================== */
function checkDeadline() 
{
    var currentTime = new Date();
    var month = leadingZero(currentTime.getMonth()); //zero index
    var year = currentTime.getFullYear();
    var day = leadingZero(currentTime.getDate()); //day of month    
    
    // yyyymmdd
    var today = year + "" + month + "" + day;
    var springDeadline = 20100124; //February 24th 2010 (month is zero indexed)  
        
    if (document.getElementById("rdoGradTerm1").checked == true && document.getElementById("drpGradYear").value == "2010")
	{
        if (today > springDeadline)
		{
	        document.getElementById("rdoGradTerm2").focus();
	        alert("Deadline for Spring 2010 has already past");
	        return false;
	    }
    }
    
    else{
        return true;
    }   
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: hideGownInfoFirst
	   Parameters: None
	      Returns: None
		  Purpose: This function hides the Gown Height and Size Codes when the page
		  		   loads.
/*==================================================================================== */
function hideGownInfoFirst()
{
	 document.getElementById("tblGownInfo").style.display = "none";
	 document.getElementById("rdoAttendingYes").checked=false
	 document.getElementById("rdoAttendingNo").checked=false
	 document.getElementById("drpHeight").selectedIndex = 0;
	 document.getElementById("drpSize").selectedIndex = 0;
	 document.getElementById("drpHeight").options[0].selected = true;
	 document.getElementById("drpSize").options[0].selected = true;

}

/*==================================================================================== */
/*  Function Name: checkForm
       Parameters: None
          Returns: None
          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 box,and put the 
                   focus on the violating textbox.                                     */
/*==================================================================================== */
function checkForm()
	{
	if(attendance_checker() == true)
		{	
		if(attending == "Yes")
			{	
			if (document.getElementById("drpHeight").value == "NA")
				{
				alert("Please select a Height Code.  If you do not wish to attend graduation, please indicate so by selecting 'No' next to 'Will you be attending graduation?'");
				document.getElementById("rdoAttendingNo").focus();
				return false;
				}
			else if (document.getElementById("drpSize").value == "NA")
				{
				alert("Please select a Size Code.  If you do not wish to attend graduation, please indicate so by selecting 'No' next to 'Will you be attending graduation?'");
				document.getElementById("rdoAttendingNo").focus();
				return false;
				}	
			}
	if (document.getElementById("txtStudentsE").value == "")
			{
			alert("Please enter a valid Student E-Number.");
			document.getElementById("txtStudentsE").focus();
			return false;
			}
		else if (document.getElementById("txtStudentLastName").value == "")
			{
			alert("Please enter a Last Name.");
			document.getElementById("txtStudentLastName").focus();
			return false;
			}
		else if (document.getElementById("txtStudentFirstName").value == "")
			{
			alert("Please enter a First Name.");
			document.getElementById("txtStudentFirstName").focus();
			return false;
			}	    
		else if (document.getElementById("txtStudentEmail").value == "")
			{
			alert("Please enter an E-mail address.");
			document.getElementById("txtStudentEmail").focus();
			return false;
			}
/*==================================================================================== */

		/* This section has been removed from the web form at the request of Denise Gilly, 
		/* the Assistant Registrar.
		/* //--Student Contact
	    else if (document.getElementById("txtStudentStreet").value == "")
	    	{
		    alert("Please enter an address or campus box");
			document.getElementById("txtStudentStreet").focus();
			return false;
		    }
		else if (document.getElementById("txtStudentZip").value == "")
			{
		    alert("Please enter a zip code");
			document.getElementById("txtStudentZip").focus();
			return false;
		    }
	    else if (document.getElementById("txtStudentCity").value == "")
	    	{
	        alert("Please enter a city");
			document.getElementById("txtStudentCity").focus();
			return false;
		    }
	    else if (document.getElementById("txtStudentPhone").value == "")
	    	{
		    alert("Please enter a phone number");
			document.getElementById("txtStudentPhone").focus();
			return false;
	    	}	
	       
/*==================================================================================== */

        //--Degree Information
    	else if (document.getElementById("txtDiplomaName").value == "")
			{
   		    alert("Please enter the name to be displayed on the diploma.");
			document.getElementById("txtDiplomaName").focus();
			return false;
		    }
    	else if (document.getElementById("drpMajor").value == "")
			{
    	    alert("Please select a major.");
			document.getElementById("drpMajor").focus();
			return false;
		    }   
		else if (checkDeadline() == false)
			{
		    return false;
		    }
		else
			{    
		    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;
}
/*==================================================================================== */

/*==================================================================================== */
/*  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: showGownInfo
       Parameters: 
          Returns: Boolean
          Purpose: This function reveals the Gown Information drop down menus.

/*==================================================================================== */
function showGownInfo()
{
	
    document.getElementById("tblGownInfo").style.display = "";
    attending=document.getElementById("rdoAttendingYes").value; 
	
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: hideGownInfo
       Parameters: 
          Returns: Boolean
          Purpose: This function hides the Gown Information drop down menus.
/*==================================================================================== */
function hideGownInfo()
{
    document.getElementById("tblGownInfo").style.display = "none";
	document.getElementById("drpHeight").selectedIndex = 0;
	document.getElementById("drpSize").selectedIndex = 0;
	document.getElementById("drpHeight").options[0].selected = true;
	document.getElementById("drpSize").options[0].selected = true;
	attending=document.getElementById("rdoAttendingNo").value;
}
/*==================================================================================== */

/*==================================================================================== */
/*	Function Name: attendance_checker
 * 	   Parameters:		
 * 	      Returns: Boolean
 * 	      Purpose: This function checks to make sure that the student has selected 
 *                 either rdoAttendingYes or rdoAttendingNo to confirm their attendance 
 *                 or absence from the graduation ceremony.
 */
/*==================================================================================== */
function attendance_checker()
	{
	var attending_choice = false;

	for (counter = 0; counter < document.getElementById("frmIntentToGrad").rdoAttending.length; counter++)
		{
		if (document.getElementById("frmIntentToGrad").rdoAttending[counter].checked)
			{
			attending_choice = true; 
			}
		}
	if  (!attending_choice)
		{
		alert("Please indicate whether or not you will be attending graduation.");
		document.getElementById("rdoAttendingNo").focus();
		return (false);
		}
		return (true);
	}
/*==================================================================================== */
/*  Function Name: printForm
       Parameters: None
          Returns: None
          Purpose: validates form data, calculates the total and prints the form
          
/*==================================================================================== */
function printForm(){
    if (checkForm() == true){
        window.print();
    }
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: submitForm
       Parameters: None
          Returns: None
          Purpose: calculates the total and submits the form
          
/*==================================================================================== */
function submitForm(){
    document.getElementById("frmIntentToGrad").submit();
}
/*==================================================================================== */

/*==================================================================================== */
/*  Function Name: submitForm
       Parameters: None
          Returns: None
          Purpose: validates form data, displays messagebox
          
/*==================================================================================== */
function nextForm(){
    if (checkForm() == true){
		alert("Please be advised that all major/minor sheets must be submitted to the Graduation office before the Intent to Graduate form will be processed. Contact your advisor to make the necessary arrangements. You will not be evaluated for graduation until all forms have been received. The deadline for receipt of these materials can be found on the registrars website.");
		submitForm();
    }
}
/*==================================================================================== */
    -->