function validateContactForm(loForm) {

    var err = ''
    var focusSet = false;
    
    if(loForm.recipientname.value=="" || loForm.recipientdomain.value=="")
    {
        err+="\nPlease select the name above you wish to email";
    }
    
    if(loForm.contactname.value=="")
    {
        if(!focusSet){
		    loForm.contactname.focus();focusSet=true; 
	    }
        err+="\nPlease enter your 'name'";
    }
    
    if(!isEmail(loForm.contactemail.value))
    {
        if(!focusSet){
		    loForm.contactemail.focus();focusSet=true; 
	    }
        err+="\nPlease enter your 'email'";
    }
    
    if(loForm.contactmessage.value=="")
    {
        if(!focusSet){
		    loForm.contactmessage.focus();focusSet=true; 
	    }
        err+="\nPlease enter your 'message'";
    }
    
     if(err == '')
	    return true;
	    
    alert('Please answer the following question(s):\n' + err);
	return false;
}


function isEmail(sEmail)
{
var bEmail, sValidChar, sEmailPattern, oEmailRe, sError;
bEmail = false;
sError = "";
if (sEmail && sEmail.length > 0)
	{
	/*sValidChar = "[\\w\\-\\_\\.']+";
	sEmailPattern = "^\\s*" + sValidChar + 
		"@(" + sValidChar + "\\.)+" + sValidChar + "\\s*$"
	oEmailRe = new RegExp(sEmailPattern);
	*/
	// specify valid characters for email (letters, numbers, hyphen, underscore & apostrophe)
		sValidChar = "[\\w\\-\\_']+";
		// specify valid domain elements (same as above, but require 2 or more characters)
		sValidDomain = "[\\w\\-\\_']{2,}";

		// build a regular expression which asserts email string is valid chars combined with dots 
		// in the form 2chars@2chars.2chars
		sEmailPattern = "^\\s*\\.?(" + sValidChar + "\\.)*" + sValidChar + "\\.?" + 
			"@(" + sValidDomain + "\\.)+" + sValidDomain + "\\s*$"
		oEmailRe = new RegExp(sEmailPattern);
		if (sEmail.match(oEmailRe))
		{
			//check a whole bung of other stuff, the error strings contain the descriptions
			if (sEmail.match(/^www\./) && !confirm('Does your username really start with \'www.\'? (not likely)'))
			{
				sError = "Invalid email - should not start with www.\n";
			}
			else if (!sEmail.match(/^.{2,}@/) && !confirm('Is your username really 1 characher long?'))
			{
				sError = "Invalid email - username should be 2 or more charachters\n";
			}
			else if (sEmail.match(/(^\.|\.@)/) && !confirm('Does your username really start or end in a dot? (not likely)'))
			{
				sError = "Invalid email - username and domain should not start or end with dot\n";
			}
			else if (sEmail.match(/'/) && !confirm('Does your email address really contain an apostrophe?'))
			{
				sError = "Invalid email - should not contain an apostrophe\n";
			}
			else
			{
				bEmail = true;
			}
		}
		else
		{
			sError = "Invalid email format (should be username@domain.com)\n";
		}
	}
	//if (sError != '')
	//1alert(sError);
		return(bEmail);

/**********************************************		

	if (sEmail.match(oEmailRe))
		bEmail = true;
	}
return(bEmail);*/
}