function checkEmail(str) 
{
var strFilter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
if (strFilter.test(str))
{ return true; }
else
{ return false; }
}

function validateEmails()
{

var email1 = document.forms["enquiry"].elements["email"].value;
var email2 = document.forms["enquiry"].elements["email2"].value;

if(checkEmail(email1))
{ 
if(!checkEmail(email2))
{ alert("Please input a valid email address for the confirmation email");
document.forms["enquiry"].elements["email2"].focus(); 
return false;
}
}
else
{ alert("Please input a valid email address"); 
document.forms["enquiry"].elements["email"].focus();
return false;
}

if (email1 == email2)
{ 
	return true; }
else
{ alert("Emails are not the same \nPlease Revise Your Input and Try again"); 
return false; }

} 

//-->

