//----- VARIABLES
var regEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;



//----- DISABLE SUBMIT BUTTON IF JAVASCRIPT NOT DETECTED
function disableSubmit()
	{
		document.getElementById('btnSubmit').disabled = false;
	}
	
window.onload = disableSubmit;



//----- FORM VALIDATION
function validateEnewsletter()
{
	if(!document.frmLB.fldEmail.value.match(regEmail))
	{
		document.frmLB.fldEmail.value = "Please enter a valid email";
		document.frmLB.fldEmail.style.color = "red";
		document.frmLB.fldEmail.style.backgroundPosition = "bottom";
		return false;
	}
	return true;
}

function validateSendToAFriend()
{
	if(document.send_to_a_friend.your_name.value == "" || document.send_to_a_friend.your_name.value == "Please enter a name")
	{
		document.send_to_a_friend.your_name.value = "Please enter a name";
		document.send_to_a_friend.your_name.style.color = "red";
		document.send_to_a_friend.your_name.style.backgroundPosition = "bottom";
		return false;
	}
	else if(!document.send_to_a_friend.your_email.value.match(regEmail))
	{
		document.send_to_a_friend.your_email.value = "Please enter a valid email";
		document.send_to_a_friend.your_email.style.color = "red";
		document.send_to_a_friend.your_email.style.backgroundPosition = "bottom";
		return false;
	}
	else if(document.send_to_a_friend.friends_name.value == "" || document.send_to_a_friend.friends_name.value == "Please enter a name")
	{
		document.send_to_a_friend.friends_name.value = "Please enter a name";
		document.send_to_a_friend.friends_name.style.color = "red";
		document.send_to_a_friend.friends_name.style.backgroundPosition = "bottom";
		return false;
	}
	else if(!document.send_to_a_friend.friends_email.value.match(regEmail))
	{
		document.send_to_a_friend.friends_email.value = "Please enter a valid email";
		document.send_to_a_friend.friends_email.style.color = "red";
		document.send_to_a_friend.friends_email.style.backgroundPosition = "bottom";
		return false;
	}
	return true;
}


//----- Clear input box
function wipe(box)
	{
		box.value = "";
	}
	
	
	
//----- OnMouseOver input box
function touch(box)
	{
		box.style.color = "#333333";
	}
	
	
		
//----- Check plain text input box
function check(box)
	{
		if(box.value == "")
			{
				box.value = "Please enter a name";
				box.style.color = "red";
				box.style.backgroundPosition = "bottom";
			}
		if(box.value != ("" || "Please enter a name" || "Your name" || "Your friends name"))
			{
				box.style.color = "green";
				box.style.backgroundPosition = "top";
			}
	}
	
	
	
//----- Check email input box
function emailCheck(box)
	{
		if(!box.value.match(regEmail))
			{
				box.value = "Please enter a valid email";
				box.style.color = "red";
				box.style.backgroundPosition = "bottom";
			}
		else
			{
				box.style.color = "green";
				box.style.backgroundPosition = "top";
			}
	}