function checkSchedule()	{
	if (document.formClassSchedule.checkClass.options[document.formClassSchedule.checkClass.selectedIndex].value == "0")
	{
		alert("Please select a Yoga Centre to check out our schedules.");
		return false;
	}
	else if (document.formClassSchedule.checkClass.options[document.formClassSchedule.checkClass.selectedIndex].value == "5")
	{
		MM_openBrWindow('class_schedules_ot.htm','popup','scrollbars=yes,width=760,height=420');
	}
	else if (document.formClassSchedule.checkClass.options[document.formClassSchedule.checkClass.selectedIndex].value == "2")
	{
		MM_openBrWindow('class_schedules_pp.htm','popup','scrollbars=yes,width=760,height=420');
	}
}


function checkSender()	{
	if (document.formRefer.sendername.value == "")
	{
		alert("Please enter your name.");
		document.formRefer.sendername.focus();
		return false;
	}
	else
	{
		if (document.formRefer.senderemail.value == "")
		{
			alert("Please enter your email address.");	
			document.formRefer.senderemail.focus();
			return false;
		}
		else
		{
			if ((document.formRefer.senderemail.value.indexOf("@",0) == 0) || (document.formRefer.senderemail.value.indexOf("@",0) == -1))
			{
				alert("Invalid email specified. Please specify the complete email address.");	
				document.formRefer.senderemail.focus();
				return false;
			}
			else		
				return true;
		}
	}
}

function checkFriend1()	{
	if (document.formRefer.friendname1.value == "")
	{
		alert("Please enter your first friend's name.");
		document.formRefer.friendname1.focus();
		return false;
	}
	else
	{
		if (document.formRefer.friendemail1.value == "")
		{
			alert("Please enter your first friend's email address.");	
			document.formRefer.friendemail1.focus();
			return false;
		}
		else
		{
			if ((document.formRefer.friendemail1.value.indexOf("@",0) == 0) || (document.formRefer.friendemail1.value.indexOf("@",0) == -1))
			{
				alert("Invalid email specified. Please specify the complete email address of your first friend.");	
				document.formRefer.friendemail1.focus();
				return false;
			}
			else		
				return true;
		}
	}
}

function checkFriend2()
{
	if (document.formRefer.friendname2.value != "")
	{
		if (document.formRefer.friendemail2.value == "")
		{
			alert("Please enter your second friend’s email address to correspond with the name provided.");
			document.formRefer.friendemail2.focus();
			return false;
		}	
		else 
		{
			if ((document.formRefer.friendemail2.value.indexOf("@",0) == 0) || (document.formRefer.friendemail2.value.indexOf("@",0) == -1))
			{
				alert("Invalid email specified. Please specify the complete email address of your second friend.");	
				document.formRefer.friendemail2.focus();
				return false;
			}
			else		
				return true;
		}
	}	
	else if (document.formRefer.friendemail2.value != "")
	{
		if ((document.formRefer.friendemail2.value.indexOf("@",0) == 0) || (document.formRefer.friendemail2.value.indexOf("@",0) == -1))
		{
			alert("Invalid email specified. Please specify the complete email address of your second friend.");	
			document.formRefer.friendemail2.focus();
			return false;
		}
		else
		{
			if (document.formRefer.friendname2.value == "")
			{
				alert("Please enter your second friend’s name to correspond with the email address provided.");
				document.formRefer.friendname2.focus();
				return false;
			}	
			else
				return true;
		}
	}	
	else
		return true;
}


function checkFriend3()
{
	if (document.formRefer.friendname3.value != "")
	{
		if (document.formRefer.friendemail3.value == "")
		{
			alert("Please enter your third friend’s email address to correspond with the name provided.");
			document.formRefer.friendemail3.focus();
			return false;
		}	
		else 
		{
			if ((document.formRefer.friendemail3.value.indexOf("@",0) == 0) || (document.formRefer.friendemail3.value.indexOf("@",0) == -1))
			{
				alert("Invalid email specified. Please specify the complete email address of your third friend.");	
				document.formRefer.friendemail3.focus();
				return false;
			}
			else		
				return true;
		}
	}	
	else if (document.formRefer.friendemail3.value != "")
	{
		if ((document.formRefer.friendemail3.value.indexOf("@",0) == 0) || (document.formRefer.friendemail3.value.indexOf("@",0) == -1))
		{
			alert("Invalid email specified. Please specify the complete email address of your third friend.");	
			document.formRefer.friendemail3.focus();
			return false;
		}
		else
		{
			if (document.formRefer.friendname3.value == "")
			{
				alert("Please enter your third friend’s name to correspond with the email address provided.");
				document.formRefer.friendname3.focus();
				return false;
			}	
			else
				return true;
		}
	}	
	else
		return true;
}


function checkFriend4()
{
	if (document.formRefer.friendname4.value != "")
	{
		if (document.formRefer.friendemail4.value == "")
		{
			alert("Please enter your fourth friend’s email address to correspond with the name provided.");
			document.formRefer.friendemail4.focus();
			return false;
		}	
		else 
		{
			if ((document.formRefer.friendemail4.value.indexOf("@",0) == 0) || (document.formRefer.friendemail4.value.indexOf("@",0) == -1))
			{
				alert("Invalid email specified. Please specify the complete email address of your fourth friend.");	
				document.formRefer.friendemail4.focus();
				return false;
			}
			else		
				return true;
		}
	}	
	else if (document.formRefer.friendemail4.value != "")
	{
		if ((document.formRefer.friendemail4.value.indexOf("@",0) == 0) || (document.formRefer.friendemail4.value.indexOf("@",0) == -1))
		{
			alert("Invalid email specified. Please specify the complete email address of your fourth friend.");	
			document.formRefer.friendemail4.focus();
			return false;
		}
		else
		{
			if (document.formRefer.friendname4.value == "")
			{
				alert("Please enter your fourth friend’s name to correspond with the email address provided.");
				document.formRefer.friendname4.focus();
				return false;
			}	
			else
				return true;
		}
	}	
	else
		return true;
}

function checkFriend5()
{
	if (document.formRefer.friendname5.value != "")
	{
		if (document.formRefer.friendemail5.value == "")
		{
			alert("Please enter your fifth friend’s email address to correspond with the name provided.");
			document.formRefer.friendemail5.focus();
			return false;
		}	
		else 
		{
			if ((document.formRefer.friendemail5.value.indexOf("@",0) == 0) || (document.formRefer.friendemail5.value.indexOf("@",0) == -1))
			{
				alert("Invalid email specified. Please specify the complete email address of your fifth friend.");	
				document.formRefer.friendemail5.focus();
				return false;
			}
			else		
				return true;
		}
	}	
	else if (document.formRefer.friendemail5.value != "")
	{
		if ((document.formRefer.friendemail5.value.indexOf("@",0) == 0) || (document.formRefer.friendemail5.value.indexOf("@",0) == -1))
		{
			alert("Invalid email specified. Please specify the complete email address of your fifth friend.");	
			document.formRefer.friendemail5.focus();
			return false;
		}
		else
		{
			if (document.formRefer.friendname5.value == "")
			{
				alert("Please enter your fifth friend’s name to correspond with the email address provided.");
				document.formRefer.friendname5.focus();
				return false;
			}	
			else
				return true;
		}
	}	
	else
		return true;
}



function checkRefer()	{
	if (
			checkSender()
			&& checkFriend1()
			&& checkFriend2()
			&& checkFriend3()
			&& checkFriend4()
			&& checkFriend5()
		)
		return true;
	else
		return false;
}


function ReferReset()
{
		document.formRefer.reset();
		return false;
}
