function Validate(){
    var Mssge2 = 'One or more required fields must be filled in.';
    if(!document.getElementById("myForm"))
		return true;
    var thisForm = document.getElementById("myForm");
    var ElNum = thisForm.elements.length;
    for (var i=0;i<thisForm.elements.length;i++){ // for all of the elements on the form..
        if ((thisForm.elements[i].required_field)) { // if the element has the letters 'rqd' in it's name..
            if (thisForm.elements[i].type == 'select-one' || thisForm.elements[i].type == 'select-multiple') {
                // if it's a list element(for Nav)..
                if (!thisForm.elements[i].options[thisForm.elements[i].selectedIndex].value){
                    // and if the element is empty give a wrning
                    alert(Mssge2);
                    // return false to the form...
                    return false;
                }
            }
            else
                if (!thisForm.elements[i].value) {
                    alert(Mssge2);
                    return false;
                }
        } 
    } 
    
    if(document.getElementById("email") && document.getElementById("reemail"))
    {
		if(document.getElementById("email").value != document.getElementById("reemail").value)
		{
			alert("The email addresses do not match.");
			return false;
		}
		
		var email = document.getElementById("email").value;
		var iAt = email.indexOf("@");
		var iDot = email.indexOf(".");
		if(iAt < 1 || iDot < 1 || email.substring(0, iAt) < 1 || email.substring(iAt, email.length) < 1)
		{
		    alert("The email format is not correct.");
		    return false;
		}
		
		if(document.getElementById("dispemail") && document.getElementById("showemail"))
		{
			if(document.getElementById("dispemail").checked == true)
			    document.getElementById("showemail").value = "yes";
			else
			    document.getElementById("showemail").value = "no";
		}
	}
	
	if(document.getElementById("pwd") && document.getElementById("repwd"))
    {
		if(document.getElementById("pwd").value != document.getElementById("repwd").value)
		{
			alert("The passwords do not match.");
			return false;
		}
	}
	
	/*if(document.getElementById("bio") && document.getElementById("address"))
    {
		if(document.getElementById("bio").value.indexOf('"') > 0 || document.getElementById("address").value.indexOf('"') > 0)
		{
			alert("There cannot be quotes used in any of the fields");
			return false;
		}
	}*/
	
    return true;
} 
