﻿function doSendM() { 

var organization = $('#organization').val();
var txtcountry = $('#txtcountry').val();
var txtcity = $('#txtcity').val();
var txtaddress = $('#txtaddress').val();
var phone = $('#phone').val();
var txtfax = $('#txtfax').val();
var email = $('#email').val();
var siteurl = $('#siteurl').val();
var ceoname = $('#ceoname').val();
var contactname = $('#contactname').val();
var txtcomments = $('#txtcomments').val();

if (organization.length < 3) { alert("Пожалуйста укажите название организации"); $('#organization').focus(); return false; }
if (txtcountry.length < 3) { alert("Пожалуйста укажите страну"); $('#txtcountry').focus(); return false; }
if (txtcity.length < 3) { alert("Пожалуйста укажите город"); $('#txtcity').focus(); return false; }
if (txtaddress.length < 5) { alert("Пожалуйста укажите адрес"); $('#txtaddress').focus(); return false; }
if (phone.length < 5) { alert("Пожалуйста укажите телефон"); $('#phone').focus(); return false; }
if (email.length < 5) { alert("Пожалуйста укажите E-mail"); $('#email').focus(); return false; }
if (contactname.length < 3) { alert("Пожалуйста укажите контактное лицо"); $('#contactname').focus(); return false; }

var email = $('#email').val();
if (!isEmail(email)) {  alert("Пожалуйста укажите (верный) E-mail"); return false; $('#email').focus(); }

$.getIfModified("/ajaxserver/sendmembership.aspx", {
o:encodeURIComponent(organization), 
cn:encodeURIComponent(txtcountry),
cc:encodeURIComponent(txtcity),
a:encodeURIComponent(txtaddress),
p:encodeURIComponent(phone),
f:encodeURIComponent(txtfax),
e:encodeURIComponent(email),
u:encodeURIComponent(siteurl),
ceo:encodeURIComponent(ceoname),
cnp:encodeURIComponent(contactname),
cm:encodeURIComponent(txtcomments)
}, function(data) {

if (data == "ok") { 

$('#mform').BlindToggleVertically(450, function() { 
$('#thanks').BlindToggleVertically(450, function() {  }, 'bounceout');
 }, 'bounceout');
  }
});

}