
function validateForm(Contact) {

var reason = "";

  reason += validateName(Contact.name);

  reason += validateEmail(Contact.email);

  reason += validateComment(Contact.comment);


  if (reason != "") {

    alert("Some fields need correction:\n" + reason);
    return false;

  }

  return true;

}

function validateName(fld) {

	var error="";

	if (fld.value == "") {

        fld.style.background = 'Red'; 

        error = "You didn't enter the Name.\n";

	} else {

	fld.style.background = 'White';

    }

    return error;

}

function validateEmail(fld) {

	var error="";

	if (fld.value == "") {

        fld.style.background = 'Red'; 

        error = "You didn't Select The Email Address.\n";

	} else {

	fld.style.background = 'White';

    }

    return error;

}

function validateComment(fld) {

	var error="";

	if (fld.value == "") {

        fld.style.background = 'Red'; 

        error = "You didn't enter the Comment.\n";

	} else {

	fld.style.background = 'White';

    }

    return error;

}
