function ResetForm(strFormID)
{
	document.getElementById(strFormID).reset();
}

function ValidateFields(strFormID, strAlertMessage)
{
	var frm = document.getElementById(strFormID);
	var strTextBoxID;
	var strLabelID;		
	var blnInvalid = false;
	var strLocation;
	var strEmailAddress;
		
	// loop through each element in the array
	for (ctr=0; ctr<document.getElementById(strFormID).length; ctr++)
	{
		if (document.getElementById(strFormID).elements[ctr].className == "RequiredField")
		{
			// save the id of the textbox to derive the id of the label
			strTextBoxID = document.getElementById(strFormID).elements[ctr].id;
			strLabelID = "lbl" + strTextBoxID
			
			if (document.getElementById(strFormID).elements[ctr].value == "")
			{												
				// change the label font color to red
				document.getElementById(strLabelID).style.color = "red";
					
				//set a flag indicating there are invalid entries
				blnInvalid = true;
			}
			else
			{	
				// change the label font color to the default... black
				document.getElementById(strLabelID).style.color = "blue";
			}
		}

		if (document.getElementById(strFormID).elements[ctr].className == "RequiredEmailField")
		{
			// save the id of the textbox to derive the id of the label
			strTextBoxID = document.getElementById(strFormID).elements[ctr].id;
			strLabelID = "lbl" + strTextBoxID

			if ((document.getElementById(strFormID).elements[ctr].value.indexOf("@") < 0) && (document.getElementById(strFormID).elements[ctr].value.indexOf(".") < 0))
			{
				// change the label font color to red
				document.getElementById(strLabelID).style.color = "red";
					
				//set a flag indicating there are invalid entries
				blnInvalid = true;				
			}
			else
			{	
				// change the label font color to the default... black
				document.getElementById(strLabelID).style.color = "blue";
			}
		}
	
	}

	// do not submit the form if there are any invalid entries
	if (blnInvalid == true)
	{
		alert("The identified fields contain missing or invalid information.");
	}
	else
	{
				
	  	if (strFormID == 'frmService') 
		{ 
			 

		}
	  	else if (strFormID == 'frmSignup') 
		{
		 	strAlertMessage = "Thank you for submitting your email address to be contacted on joining CECA.";
				
		}
		
		// Show an alert dialog box using appropriate message
		alert(strAlertMessage);

		// Submit the appropriate form
	   	document.getElementById(strFormID).submit();
	}					
}