// JavaScript Document
				$().ready(function() {
					var validator = $("#texttests").bind("invalid-form.validate", function() {
					}).validate({
						debug: false,
						errorElement: "em",
						errorPlacement: function(error, element) {
							error.appendTo( element.parent("td").next("td") );
						},
						success: function(label) {
							label.text("ok!").addClass("success");
						},
						rules: {
							commentformname: {
								required:true,
								maxlength:15
							},
							commentformemail: {
								required:true,
								email:true	
							},
							commentformurl: {
								url:true	
							},
							commentformbody: {
								required:true,
								maxlength:100
							},
							commentformpass: {
								required:true,
								minlength:6
							}
						}

					});
					
					$('.submit').click(function(){
						if($("#texttests").valid()){
							$.ajax({
								url: 'save.php?act=note',
								type: 'post',
								dataType: 'json',
								data: {
									Key :'new',
									Name:$('#commentformname').val(),
									Mail:$('#commentformemail').val(),
									Url: $('#commentformurl').val(),
									Note:$('#commentformbody').val(),
									Code:$('#commentformpass').val(),
									Id  : $('#commentformid').val(),
									Ftb : $('#commentformftb').val()
									},
								success: function(data){
									if(data.msg == 'ok'){
										$('#Notelists').prepend(data.text);
										$('form')[0].reset();
										reproof();
										window.location = '#Note_'+data.aid;
									} else {
										alert(data.msg);
									}
								}
							});
						}
						return false;
					});
				});
