function eFix(){
for (a in document.links) document.links[a].onfocus =
document.links[a].blur;}
if (document.all){document.onmousedown = eFix;} file:
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
		var basicstring='abcdefghijklmnopqrstuvwxyz -+';
		var emailstring='abcdefghijklmnopqrstuvwxyz_-.@1234567890';
		var aliasstring='abcdefghijklmnopqrstuvwxyz1234567890-+';
		var advstring='abcdefghijklmnopqrstuvwxyz -+/\'.,1234567890';
		var postcodestring='abcdefghijklmnopqrstuvwxyz 1234567890';
		var basicnumbers='1234567890';
		var phonenumbers='1234567890 -';

		function ValidateQuickLogin()
		{
			var f = document.forms["frmQuickLogin"];
			var a = "";
			
			var MemberID = f.elements["MemberID"].value;
			var Password = f.elements["Password"].value;
			
			if (ForceString(MemberID,basicnumbers) != MemberID) a += "- Invalid Member ID\n";
			if (ForceString(Password,basicnumbers) != Password) a += "- Invalid Passcode\n";

			if (a)
			{
				a = "Sorry, your login failed due to the following reasons:\n\n" + a + "\n\nPlease try again";
				alert(a);
				return (false);
			}
			return (true);
		}

		function ForceString(tstr, refstring)
		{
			var i = 0;
			var str2 = "";
			for (i = 0; i < tstr.length; i++)
				if (isAlphabeticChar(tstr.charAt(i), refstring)) {
					str2 += tstr.charAt(i);
				}
			return str2;
		}

		function isAlphabeticChar(InString, refstring)
		{
			if (InString.length!=1)
			{
				return false;
			}
			InString=InString.toLowerCase();
			if (refstring.indexOf (InString.toLowerCase(), 0)==-1)
			{
				return (false);
			}
			return (true);
		}

function validateFormOnSubmit(theForm) {
var reason = "";

  
  reason += validateEmpty(theForm.FirstName);
  reason += validateEmpty(theForm.LastName);
reason += validateimage(theForm.File1);
  reason += validateterms(theForm.terms);
      
  if (reason != "") {
    alert("Some fields need correction:\n" + reason);
    return false;
  }

  return true;
}
function validateEmpty(fld) {
    var error = "";
 
    if (fld.value.length == 0) {
        fld.style.background = 'Yellow'; 
        error = "The required field has not been filled in.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
}
function validateEmail(fld) {
    var error="";
    var tfld = trim(fld.value);                        // value of field with whitespace trimmed off
    var emailFilter = /^[^@]+@[^@.]+\.[^@]*\w\w$/ ;
    var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/ ;
   
    if (fld.value == "") {
        fld.style.background = 'Yellow';
        error = "You didn't enter an email address.\n";
    } else if (!emailFilter.test(tfld)) {              //test email for illegal characters
        fld.style.background = 'Yellow';
        error = "Please enter a valid email address.\n";
    } else if (fld.value.match(illegalChars)) {
        fld.style.background = 'Yellow';
        error = "The email address contains illegal characters.\n";
    } else {
        fld.style.background = 'White';
    }
    return error;
}
    function validateterms(fld) {
    var error = "";
 
    if (fld.checked == false) {
        fld.style.background = 'Yellow'; 
        error = "Please accept terms & Conditions.\n"
    } else {
        fld.style.background = 'White';
    }
    return error;  
} 
function validateimage(fld)
{

 var error = ""; 
 if (fld.value.length == 0) {
fld.style.background = 'White';   
}else if(!/(\.bmp|\.gif|\.jpg|\.jpeg)$/i.test(fld.value)) {

fld.style.background = 'Yellow'; 
error = "You must upload an image file with one of the following extensions: jpg,bmp,gif,jpeg.\n"
    }else {
	
fld.style.background = 'White';         
    
}
 
	
return error;
}
 