// main login form validation
function validate_login1()
{
	if (document.pin.bcode.value=="Club Code" || document.pin.bcode.value=="")
	{
		alert("Please enter your Club Code!");
		document.pin.bcode.value="";
		document.pin.bcode.focus();
		return false;
	}
	return true;
} // validate_login1()

function validate_registration_business_1()
{
	if (document.register.bbcode.value=="Club Code" || document.register.bbcode.value=="")
	{
		alert("Please enter your Club Code!");
		document.register.bbcode.value="";
		document.register.bbcode.focus();
		return false;
	}
	return true;
} // validate_registration_business_1()

function validate_registration_business_2()
{
	if (document.register.eemail.value=="Email Address" || document.register.eemail.value=="")
	{
		alert("Please enter your email address!");
		document.register.eemail.value="";
		document.register.eemail.focus();
		return false;
	}
	if (document.register.company.value=="Club Name" || document.register.company.value=="")
	{
		alert("Please enter the club name!");
		document.register.company.value="";
		document.register.company.focus();
		return false;
	}
	return true;
} // validate_registration_business_2()

function validate_registration_business_3()
{
	if (document.profile.company.value=='' || document.profile.company.value=='Club Name')
	{
		alert('Please enter company name!');
		document.profile.company.value='';
		document.profile.company.focus();
		return false;
	}
	if (document.profile.admin_first_name.value=='' || document.profile.admin_first_name.value=='First Name')
	{
		alert("Please enter first name!");
		document.profile.admin_first_name.value='';
		document.profile.admin_first_name.focus();
		return false;
	}
	if (document.profile.admin_last_name.value=='' || document.profile.admin_last_name.value=='Last Name')
	{
		alert("Please enter last name!");
		document.profile.admin_last_name.value='';
		document.profile.admin_last_name.focus();
		return false;
	}
	if ((document.profile.address_1.value=='' || document.profile.address_1.value=='Address') && (document.profile.address_2.value=='' || document.profile.address_2.value=='Address'))
	{
		alert("Please enter club address!");
		document.profile.address_1.value='';
		document.profile.address_2.value='';
		document.profile.address_1.focus();
		return false;
	}
	if (document.profile.town.value=='' || document.profile.town.value=='Town or City')
	{
		alert("Please enter club town or city!");
		document.profile.town.value='';
		document.profile.town.focus();
		return false;
	}
	if (document.profile.postcode.value=='' || document.profile.postcode.value=='Postcode')
	{
		alert('Please enter postal code!');
		document.profile.postcode.value='';
		document.profile.postcode.focus();
		return false;
	}
	if (document.profile.phone_code.value=='' || document.profile.phone_code.value=='Area Code')
	{
		alert('Please enter phone area code!');
		document.profile.phone_code.value='';
		document.profile.phone_code.focus();
		return false;
	}
	if (document.profile.phone_number.value=='' || document.profile.phone_number.value=='Phone Number')
	{
		alert('Please enter club phone number!');
		document.profile.phone_number.value='';
		document.profile.phone_number.focus();
		return false;
	}
	if (document.profile.fax_number.value=='optional')
	{
		document.profile.fax_number.value='';
	}
	if (document.profile.mobile_phone.value=='optional')
	{
		document.profile.mobile_phone.value='';
	}
	if (document.profile.eemail.value=='' || document.profile.eemail.value=='Email')
	{
		alert("Please enter club email address!");
		document.profile.eemail.value='';
		document.profile.eemail.focus();
		return false;
	}
	else if ( (document.profile.eemail.value.indexOf("@")== -1) || (document.profile.eemail.value.indexOf(".")== -1) || (document.profile.eemail.value.indexOf(",")!= -1) || (document.profile.eemail.value.indexOf(":")!= -1) || (document.profile.eemail.value.indexOf(";")!= -1))
	{
		alert ("Please enter valid email address!")
		document.profile.eemail.focus();
		return false;
	}
	if (document.profile.website.value=='optional')
	{
		document.profile.website.value='';
	}
	return true;
} // validate_registration_business_3
		
function delete_business()
{
	if ( confirm("This will cancel your registration and delete all information stored!\nAre you sure?") )
	{
		document.profile.mode.value='delete';
		document.profile.submit();
	}
	else return false;
} // delete_business()

function validate_tell_a_friend()
{
	if (document.tell_a_friend.yname.value=="Your Name" || document.tell_a_friend.yname.value=="")
	{
		alert("Please enter your name!");
		document.tell_a_friend.yname.value="";
		document.tell_a_friend.yname.focus();
		return false;
	}
	if (document.tell_a_friend.yemail.value=="Your Email" || document.tell_a_friend.yemail.value=="")
	{
		alert("Please enter your email address!");
		document.tell_a_friend.yemail.value="";
		document.tell_a_friend.yemail.focus();
		return false;
	}
	if (document.tell_a_friend.fname.value=="Friends Name" || document.tell_a_friend.fname.value=="")
	{
		alert("Please enter friends name!");
		document.tell_a_friend.fname.value="";
		document.tell_a_friend.fname.focus();
		return false;
	}
	if (document.tell_a_friend.femail.value=="Friends Email" || document.tell_a_friend.femail.value=="")
	{
		alert("Please enter friends email address!");
		document.tell_a_friend.femail.value="";
		document.tell_a_friend.femail.focus();
		return false;
	}
//	document.tell_a_friend.action = "mailto:" + document.tell_a_friend.femail.value + "?subject=Great%20website&body=Hi%20" + document.tell_a_friend.fname.value + ",%0D%0AThere%20is%20a%20great%20site%20that%20helps%20us%20to%20help%20our%20Beat%20Bobby%20make%20where%20we%20live%20a%20safer%20place.%0D%0ATake%20a%20look%20at%20www.beatbobby.co.uk%0D%0ARegards%0D%0A" + document.tell_a_friend.yname.value + "";
//	alert(document.tell_a_friend.action);
//	document.tell_a_friend.target="_blank";
//	document.tell_a_friend.submit();
//	return false;
	return true;
} // validate_tell_a_friend()
