function validation()
{	var errors ="";
	var theform = document.forms['registration'];

		if (theform.FIRST_NAME.value =="")
			{errors += " First Name \n";}
		if (theform.LAST_NAME.value=="")
			{errors += " Last Name \n";}
		if ((theform.GENDER[0].checked!= true)&&(theform.GENDER[1].checked!= true))
			{errors += " Gender \n";}
		if ((theform.DAY.value=="")||(theform.MONTH.value=="")||(theform.YEAR.value==""))
			{errors += " DOB \n";}

		if ((theform.HOME_PHONE.value=="")||(theform.WORK_PHONE.value=="")||(theform.CELL_PHONE.value==""))
			{errors += " Home Phone Number, Work Phone Number or Cell Phone Number \n";}
		if (theform.HOME_PHONE.value!="")
				{errors += " Home Phone Number \n";}
		if (theform.WORK_PHONE.value!="")
				{errors += " Work Phone Number \n";}
		if (theform.CELL_PHONE.value!="")
				{errors += " Cell Phone Number \n";}
		// End



	if (errors !="")
		{alert ("You have made the following errors: \n" + errors);
	return false;}
}

function disableButtons()
{
	var theform = document.forms['registration'];
	if ((own_lock == false)||(save_by_role_allowed == false))
	{
		theform.buttonClearAll.disabled = true;
		theform.buttonSave.disabled = true;
	}
}


    // Begin dynamic reset functions
function checkTextBox(formName,textBox,dropDown,val)
{
var theform = document.forms[formName] ;
if (theform.elements[textBox].value != "")	{	theform.elements[dropDown].value = val }
else if (theform.elements[textBox].value == "")	{	theform.elements[dropDown].value = "" }
}

function resetTextBox(formName,textBox,dropDown,val)
{
var theform = document.forms[formName];
if (theform.elements[dropDown].value != val)	{	theform.elements[textBox].value = "" }
}
