function gainFocus(control)
{
	if (control.value == "Your email address")
	{
		control.value = "";
	}
	
	control.style.color = "black";
}

function loseFocus(control)
{
	if (control.value == "")
	{
		control.style.color = "#666666";
		control.value = "Your email address";
	}	
}

function verifyEmailInput(input)
{
	if (input == null || input.value == null || !isEmail(input.value)) 
	{
		alert("Please enter a valid email address.");
		
		if (input != null)
		{
			input.select();
		}

		return false;
	}
	else
	{
		return true;
	}	
}

function verifyEmail(val)
{
	if (val == null || !isEmail(val)) 
	{
		alert("Please enter a valid email address.");
		return false;
	}
	else
	{
		return true;
	}
}

function isEmail(who) {
	var email=/^\s*[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*@[A-Za-z0-9]+([_\.-][A-Za-z0-9]+)*\.([A-Za-z]){2,4}\s*$/i;
	return(email.test(who));
}

function checkBCForm() {
    var frm = document.bcform;
    var email = frm.email.value;

    return verifyEmail(email);
}
