
	function submitBPAForm()
	{
		$('warningMessage').hide();
		$('warningMessage').update();

		var warningColor = '#FFFFB2';
		var form = $('bpaForm');
		$$('#bpaForm input[type=text]').each(function(e){
			e.style.backgroundColor = '#fff';
		});

		if(!form.home_address_street.present() && !form.work_address_street.present())
		{
			form.home_address_street.style.backgroundColor = warningColor;
			form.work_address_street.style.backgroundColor = warningColor;
			$('warningMessage').update('Sorry, but you need to fill at least one address information.');
			$('warningMessage').show();
			return false;
		}
		
		if(!form.home_phone_1.present() && !form.cell_phone_1.present() && !form.work_phone_1.present())
		{
			form.home_phone_1.style.backgroundColor = warningColor;
			form.cell_phone_1.style.backgroundColor = warningColor;
			form.work_phone_1.style.backgroundColor = warningColor;
			form.home_phone_2.style.backgroundColor = warningColor;
			form.cell_phone_2.style.backgroundColor = warningColor;
			form.work_phone_2.style.backgroundColor = warningColor;
			form.home_phone_3.style.backgroundColor = warningColor;
			form.cell_phone_3.style.backgroundColor = warningColor;
			form.work_phone_3.style.backgroundColor = warningColor;
			$('warningMessage').update('Sorry, but you need to fill at least one phone number.');
			$('warningMessage').show();
			return false;
		}
		
		if(!form.email_1.present() && !form.email_2.present())
		{
			form.email_1.style.backgroundColor = warningColor;
			form.email_2.style.backgroundColor = warningColor;
			$('warningMessage').update('Sorry, but you need to fill at least one email address.');
			$('warningMessage').show();
			return false;
		}
		
		if(form.email_1.present() && String($F(form.email_1)).search(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == -1)
		{
			form.email_1.style.backgroundColor = warningColor;
			$('warningMessage').update('Sorry, but your email 1 seems invalid. Please re-check it.');
			$('warningMessage').show();
			return false;
		}
		
		if(form.email_2.present() && String($F(form.email_2)).search(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/) == -1)
		{
			form.email_2.style.backgroundColor = warningColor;
			$('warningMessage').update('Sorry, but your email 2 seems invalid. Please re-check it.');
			$('warningMessage').show();
			return false;
		}
		
		if(!$F('agree'))
		{
			$('warningMessage').update('Sorry, but you need to agree to the terms displayed above.');
			$('warningMessage').show();
			return false;
		}
		
		
		form.submit();
	}
	
	
	function showSpecialtyOther(el)
	{
		$('specialtyOther').hide();
		$('specialtyOtherField').disable();

		if($F(el) == 'Other')
		{
			$('specialtyOther').show();
			$('specialtyOtherField').enable();
			$('specialtyOtherField').focus();
		}
	}

	function showHearOther(el)
	{
		$('specialtyHear').hide();
		$('specialtyHearField').disable();

		if($F(el) == 'Other')
		{
			$('specialtyHear').show();
			$('specialtyHearField').enable();
			$('specialtyHearField').focus();
		}
	}


