function validateLog()
{
	with (document.frmlog)
	{
		var alertMsg = "Please check the following fields:\n";
		if (un.value == "") alertMsg += "\nUsername";
		if (pw.value == "") alertMsg += "\nPassword";
		if (alertMsg != "Please check the following fields:\n")
		{
			alert(alertMsg);
			return false;
		}
    	else
		{
			return true;
		}
	}
}
function validate_search() {
if (document.frmsearch.search.value == '') 
{ alert ('Please enter text to search');
document.frmsearch.search.focus ();
return false; }
document.frmsearch.submit ();
}
function validatecontact()
{
	with (document.Msg)
	{
		var alertMsg = "Please check the following fields:\n";
		if (name.value == "") alertMsg += "\nYour Name";
		if (email.value == "") alertMsg += "\nYour Email Address";
		if ((email.value.indexOf ('@',0) == -1 || email.value.indexOf ('.',0) == -1) && email.value != "") alertMsg += "\nYour Email Address is not valid"; 
		if (alertMsg != "Please check the following fields:\n")
		{
			alert(alertMsg);
			return false;
		}
    	else
		{
			return true;
		}
	}
}
function validate_pwform() {
if (document.pw.email.value == '') 
{ alert ('Please enter an email address');
document.pw.email.focus ();
return false; }
document.pw.submit ();
}
function validateForm()
{
	with (document.frmreg)
	{
		var alertMsg = "Please check the following fields:\n";
		if (fullname.value == "") alertMsg += "\nFull Name";
		if (address.value == "") alertMsg += "\nAddress";
		if (city.value == "") alertMsg += "\nCity / Town";
		if (postal_code.value == "") alertMsg += "\nPostal Code";
		if (email.value == "") alertMsg += "\nEmail";
		if ((email.value.indexOf ('@',0) == -1 || email.value.indexOf ('.',0) == -1) && email.value != "") alertMsg += "\nYour Email Address is not valid"; 
		if (phone.value == "") alertMsg += "\nTelephone";
		if (un.value == "") alertMsg += "\nUsername";
		if (pw.value == "") alertMsg += "\nPassword";
		if (alertMsg != "Please check the following fields:\n")
		{
			alert(alertMsg);
			return false;
		}
		else
		if (pw.value != pw2.value)
		{ 
		    alert("Passwords did not match. Please re-type your password");
		    pw2.focus();
		    pw2.select();
    		return false;
	    } 	
    	else
		{
			return true;
		}
	}
}