function validate_email(field,alerttxt)
{
	with (field)
	{
		apos=value.indexOf("@");
		dotpos=value.lastIndexOf(".");
		if (apos<1||dotpos-apos<2) {
			alert(alerttxt);
			field.style.background = 'lightyellow';
			return false;
		}
		else {
			return true;
		}
	}
}

function validate_form(thisform)
{
	with (thisform)
	{
		Name.style.background = 'white';
		Email.style.background = 'white';
		Message.style.background = 'white';

		if ( document.contactme.Name.value == "" ) {
			alert("Please enter your name");
			Name.focus();
			Name.style.background = 'lightyellow';
			return false;
		}

		if (validate_email(Email,"Please enter a valid e-mail address")==false) {
			Email.focus();
			return false;
		}

		if ( document.contactme.Message.value == "" || document.contactme.Message.value == "Please enter your message here") {
			alert("Please enter your message");
			Message.focus();
			Message.style.background = 'lightyellow';
			return false;
		}
		
	}
}

function StatusMsg(text) 
{
    status = text;
    return true;
}

