function formValidate()
{
	$("#reg_one").validate(
		{
			rules:
			{
				username:{required: true, displayname: true, minlength: 4},
				password: {required: true,minlength: 6, maxlength: 24},
		        cpassword: {required: true,minlength: 6,maxlength: 24, equalTo:":input[name='password']"},
		        pha: {
		            required: true,
		            minlength:6,
		            maxlength: 24
		        }
			},
			errorPlacement:function(error,element)
			{
				error.appendTo(element.parents('td').children(".error_placement"));
			},
			success: function(label)
			{
				//set &nbsp; as text for IE
				label.html("&nbsp;").addClass("checked");
				
			}	
		}
	);
	
	$("#profile_form").validate(
		{
			rules:
			{
				email:{required:true, maxlength:128, email:true},
				first_name:{required: true, maxlength: 32},
				last_name:{required: true, maxlength: 32},
				city:{maxlength:32},
				state:{maxlength:32}
			},
			errorPlacement:function(error,element)
			{
				error.appendTo(element.parents('td').children(".error_placement"));
			},
			success: function(label)
			{
				label.html("&nbsp;").addClass("checked");
			}
		}
	
	);
	
	$('#profile_form').submit(function()
		{

			if($("#cAccept").attr("checked")==false){alert('Please check the box to accept our User Agreement and Privacy Policy.');return false;}
		}		
	);
	
	$("#reset_password_form").validate(
		{
			rules:
			{
				username:
				{
					required: true,
		            displayname: true,
		            minlength: 4
				},
				email: {
		            required: true,
		            email: true,
		            maxlength: 128
		        }
			},
			errorPlacement:function(error,element)
			{
				error.appendTo(element.parents('td').children(".error_placement"));
			},
			success: function(label)
			{
				label.html("&nbsp;").addClass("checked");
			}
		}
	);
	
	$("#kid_form").validate(
		{
			rules:
			{
				pemail: {
		            required: true,
		            email: true,
		            maxlength: 128
		        }
			},
			errorPlacement:function(error,element)
			{
				error.appendTo(element.parents('td').children(".error_placement"));
			},
			success: function(label)
			{
				label.html("&nbsp;").addClass("checked");
			}
		}
	);
	$("#change_pwd_form").validate(
		{
			rules:
			{
				password: {required: true, minlength: 6,maxlength: 24},
				cpassword: {required: true,minlength: 6,maxlength: 24,equalTo:":input[name='password']"}
			},
			errorPlacement:function(error,element)
			{
				error.appendTo(element.parents('td').children(".error_placement"));
			},
			success: function(label)
			{
				label.html("&nbsp;").addClass("checked");
			}
		}
	);
	
	$("#reg_audit_form").validate(
		{
			rules:
			{
				pFirstName: {required: true, maxlength:32},
				pLastName: {required: true, maxlength:32},
				pContactNo: {maxlength:32},
				pEmail: {
		            required: true,
		            email: true,
		            maxlength: 128
		        },
				pStreetAddress: {maxlength:128},
				pCity: {maxlength:32},
				pState: {maxlength:32},
				cFirstName: {required: true, maxlength:32},
				cLastName: {required: true, maxlength:32},
				cEmail: {required: true, email: true, maxlength: 128}
			},
			errorPlacement:function(error,element)
			{
				error.appendTo(element.parents('td').children(".error_placement"));
			},
			success: function(label)
			{
				label.html("&nbsp;").addClass("checked");
			}
		}
	);
	$('#reg_audit_form').submit(function()
		{
			if($("#cAccept").attr("checked")==false){alert('Please check the box to accept our User Agreement and Privacy Policy.');return false;}
		}		
	);
	
	$(":input[name='password']").pstrength({minChar: 6, minCharText: ''});
	$(":input[name='password']").pstrength.addRule('twelvechar', function (word, score) {
		return word.length >= 12 && score;
	}, 3, true);
	
	jQuery.validator.addMethod("displayname", validateName, "Allow english charactors,chinese charctors, and \" ' \", \"-\", \"_\", \".\", \"@\",space key ");
}

validateName = function(value) {
	return /^(([a-zA-Z]|\d|['\.\-_\@]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[\x20])+)$/.test(value);
};
