function formValidate( form) {
	var valid = true;
	
	$('.required', form).each( function() {
		$(this).removeClass( "invalid");
		$('label[for='+this.id+']').removeClass( "invalid");
		if (this.tagName == "SELECT" && this.value == 0) {
			$(this).addClass( "invalid");
			$('.errorMsg').css( 'display', 'block');
			valid = false;
		} else if (this.tagName == "INPUT" && this.type == "password" && false == /^.{5,}$/.test( this.value)) {
			$(this).addClass( "invalid");
			$('.errorMsg').css( 'display', 'block');
			valid = false;
		} else if (this.tagName == "INPUT" && this.type == "checkbox" && false == this.checked) {
			$('label[for='+this.id+']').addClass( "invalid");
			$('.errorMsg').css( 'display', 'block');
			valid = false;
		} else if ($(this).attr( "class").indexOf( "email") >= 0 && false == /^[A-Za-z0-9._%-]+@[A-Za-z0-9._%-]+\.[A-Za-z0-9._%-]{2,4}$/.test( this.value)) {
			$(this).addClass( "invalid");
			$('.errorMsg').css( 'display', 'block');
			valid = false;
		} else if (this.value == "") {
			$(this).addClass( "invalid");
			$('.errorMsg').css( 'display', 'block');
			valid = false;
		}
	});
	$(".date", form).each( function() {
		$(this).removeClass( "invalid");
		if (this.value != '' && false == /^\d{4}-\d{1,2}-\d{1,2}$/.test( this.value)) {
			$(this).addClass( "invalid");
			valid = false;
		}
	});
	return( valid);
}

