$(function () { $(".tips").tooltip({placement: 'auto left'}); });
$(':checkbox').bootstrapSwitch();
$('#notes').summernote({
	height: "200px",
	toolbar: [
		//['style', ['style']], // no style button
		['style', ['bold', 'italic', 'underline', 'clear']],
		['fontsize', ['fontsize']],
		['color', ['color']],
		['para', ['ul', 'ol', 'paragraph']],
		//['height', ['height']],
		['table', ['table']],
		['insert', ['link']],
		['fullscreen', ['fullscreen']]

		//['help', ['help']] //no help button
	]
});

/*----------- BEGIN chosen CODE -------------------------*/
$(".chzn-select").chosen();
$(".chzn-select-deselect").chosen({
	allow_single_deselect: true
});
/*----------- END chosen CODE -------------------------*/

$(function (){
	$("form").validate({
		rules: {
			username:{
				minlength: 1,
				maxlength: 256,
				required: true
			},
			mail: {
				email: 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');
		}
	});
});

$(function (){
	setTimeout(function(){
		$("input:text:visible:first").focus();
	}, 0);
});