﻿function checkFormm(form){
fio = document.getElementById("name");
email = document.getElementById("email");
bot = document.getElementById("not_bot");
reg = /[a-z0-9-_.]+@[a-z0-9-_.]/i;
var prov = reg.test(email.value);
if(bot.checked !== true){
   $("#message .not_bot input").before("<strong>Поставьте галочку у поля<br /> 'Я не робот'</strong>");
   $("#message td strong").fadeTo("slow", 0.9);
	}
if(prov !== true){
   $("#message .email input").before("<strong>Заполните поле 'E-mail:'</strong>");
   $("#message td strong").fadeTo("slow", 0.9);
	}
if(fio.value == "Ф.И.О.:"){
   $("#message .name input").before("<strong>Заполните поле 'Ф.И.О.:'</strong>");
   $("#message td strong").fadeTo("slow", 0.9);
	}
if (bot.checked == true && prov == true && fio.value !== "Ф.И.О.:") {
return true;
}
else {return false;}
  	}

$(document).ready(function() {
$(".not_bot div").append('<input id="not_bot" class="not_bot" type="checkbox" value="checkbox" name="data[new][not_bot]">');
	$("#message .name input").mouseover(function()
  {  $("#message .name strong").remove(); }
);
	$("#message .email input").mouseover(function()
  {  $("#message .email strong").remove(); }
);
	$("#message .not_bot input").mouseover(function()
  {  $("#message .not_bot strong").remove(); }
);
 });
