$(function () {
	$(".tips").tooltip({placement: 'auto left'});
	$(':checkbox').bootstrapSwitch();

	$("form").validate({
		rules: {
			username:{
				required: true
			},
			mail:{
				email: true,
				required: true
			},
			password_confirm: {
				equalTo: "#password_one"
			}
		},
		highlight: function (element) {
			$(element).closest('.form-group').removeClass('has-success').addClass('has-error');
		},
		unhighlight: function (element) {
			$(element).closest('.form-group').removeClass('has-error').addClass('has-success');
		}
	});

});