
function validateForm()
{
	var x_First_Name = document.theForm.x_First_Name.value;
	if ( x_First_Name == '' )
	{
		alert('-First Name is required-\n\n Please fill it out to continue.\n\n Thank you.');
		document.theForm.x_First_Name.focus();
		return false;
	}
	var x_Last_Name = document.theForm.x_Last_Name.value;
	if ( x_Last_Name == '' )
	{
		alert('-Last Name is required-\n\n Please fill it out to continue.\n\n Thank you.');
		document.theForm.x_Last_Name.focus();
		return false;
	}
	var x_Email = document.theForm.x_Email.value;
	if ( x_Email == '' )
	{
		alert('-Email is required-\n\n Please fill it out to continue.\n\n Thank you.');
		document.theForm.x_Email.focus();
		return false;
	}
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(x_Email))
	{
		alert('-Email must be in a proper format.-');
		document.theForm.x_Email.focus();
		return false;
	}
	return true;
}

function checkTotal(theRadio)
{
	var scholar = 0;
	var cost = 0;
	if (document.theForm.scholar.checked)
		scholar = 20;
	document.theForm.member8.value=scholar;
	if (theRadio.id=='scholar')
	{
		
		document.theForm.total.value=eval(document.theForm.member1.value)+eval(document.theForm.member2.value)+eval(document.theForm.member3.value)+eval(document.theForm.member4.value)+eval(document.theForm.member7.value)+eval(scholar);
	}
	else
	{
		document.theForm.member1.value=0;
		document.theForm.member2.value=0;
		document.theForm.member3.value=0;
		document.theForm.member4.value=0;
		//document.theForm.member5.value=0;
		//document.theForm.member6.value=0;
		document.theForm.member7.value=0;
		switch(theRadio.id)
		{
			case 'membershipType1':
				document.theForm.member1.value=210;
				cost=document.theForm.member1.value;
			break;
			case 'membershipType2':
				document.theForm.member2.value=210;
				cost=document.theForm.member2.value;
			break;
			case 'membershipType3':
				document.theForm.member3.value=130;
				cost=document.theForm.member3.value;
			break;
			case 'membershipType4':
				document.theForm.member4.value=105;
				cost=document.theForm.member4.value;
			break;
			case 'membershipType7':
				document.theForm.member7.value=50;
				cost=document.theForm.member7.value;
			break;
		}
		document.theForm.total.value=eval(cost)+eval(scholar);
	}
	return true;
}
