// JavaScript Document

function TAFvalidateForm() {
	// Required Fields
	if (document.getElementById('name').value == "") {
		document.getElementById('name').focus();	
		alert('We need to tell your friend who this is from. \nPlease Enter Your Name.');
		return false;
	}
	if (document.getElementById('email').value == "") {
		document.getElementById('email').focus();	
		alert('In case your friend wants to reply to you. \nPlease Enter Your Email.');
		return false;
	}
	if (document.getElementById('femail1').value == "") {
		document.getElementById('femail1').focus();	
		alert('We need someone to send this to. \nPlease Enter A Friends Email.');
		return false;
	}

	//Well Formated
	if (document.getElementById('email').value != "") {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('email').value)){
			return true;
		}else{
			alert('You\'ve made a typo in your Email. \nPlease ReEnter Your Email');
			document.getElementById('email').focus();
			return false;
		}
	}
	if (document.getElementById('femail1').value != "") {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('femail1').value)){
			return true;
		}else{
			alert('You\'ve made a typo in this Emai.l \nPlease ReEnter Your Email');
			document.getElementById('femail1').focus();
			return false;
		}
	}
	if (document.getElementById('feail2').value != "") {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('femail2').value)){
			return true;	
		}else{
			alert('You\'ve made a typo in this Email. \nPlease ReEnter Your Email');
			document.getElementById('femail2').focus();
			return false;
		}
	}
	if (document.getElementById('femail3').value != "") {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('femail3').value)){
			return true;
		}else{
			alert('You\'ve made a typo in this Email. \nPlease ReEnter Your Email');
			document.getElementById('femail3').focus();
			return false;
		}
	}
	return true;
}


function ORDERSValidateForm() {
	
	// Required Fields
	if (document.getElementById('name').value == "") {
		document.getElementById('name').focus();	
		alert('We need to know who to contact. \nPlease Enter Your Name.');
		return false;
	}
	if (document.getElementById('address').value == "") {
		document.getElementById('address').focus();	
		alert('We need to know where to send your package. \nPlease Enter Your Address.');
		return false;
	}
	if (document.getElementById('product').value == "") {
		document.getElementById('product').focus();	
		alert('We need to know what to send you. \nPlease Enter Your Purchase.');
		return false;
	}
	if (document.getElementById('email').value == "") {
		document.getElementById('email').focus();	
		alert('We need this to conatact you. \nPlease Enter Your Email.');
		return false;
	}
	if (document.getElementById('phone').value == "") {
		document.getElementById('phone').focus();	
		alert('We need this to contact you. \n Please Enter Your Phone Number.');
		return false;
	}
	
	//Well Formated
	if (document.getElementById('email').value != "") {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('email').value)){
		}else{
			alert('You\'ve made a typo in your Email. \nPlease ReEnter Your Email');
			document.getElementById('email').focus();
			return false;
		}
	}
	return true;
}



function CONTACTValidateForm(){
	if (document.getElementById('name').value == "") {
		document.getElementById('name').focus();	
		alert('We\'er going to need to know how to address you. \nPlease Enter Your Name.');
		return false;
	}
	if (document.getElementById('email').value == "") {
		document.getElementById('email').focus();	
		alert('We need this to conatact you. \nPlease Enter Your Email.');
		return false;
	}
	if (document.getElementById('message').value == "") {
		document.getElementById('message').focus();	
		alert('No need to waste your time. \n Please Enter A Message.');
		return false;
	}
	
	//Well Formated
	if (document.getElementById('email').value != "") {
		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('email').value)){
		}else{
			alert('You\'ve made a typo in your Email. \nPlease ReEnter Your Email');
			document.getElementById('email').focus();
			return false;
		}
	}
	return true;
}

