// JavaScript Document
function gid(id){return document.getElementById(id);}

function formSend()
{
	var send = true;
	send *= k = gid("nm").value.length;
	if (k)
	gid("nm_txt").style.color = "#000";
	else
	gid("nm_txt").style.color = "#FF0000";
	
	r = /^[a-z]+\.?[-_.a-z0-9]*@[a-z][-_.a-z0-9]+\.[a-z]{2,3}$/i;
	send *= k = gid("ml").value.search(r)+1;
	if (k)
	gid("ml_txt").style.color = "#000";
	else
	gid("ml_txt").style.color = "#FF0000";
	
	send *= k = gid("in").value.length;
	if (k)
	gid("in_txt").style.color = "#000";
	else
	gid("in_txt").style.color = "#FF0000";
			
	$.get("php/check_antibot.php?sec_code=" + $('#sec_code').val(), function(data){
        if ('f' == data){
            send = false;
            gid("captcha_txt").style.color = "#000";
        } else {
            gid("captcha_txt").style.color = "#FF0000";
        }
        if (send)
		return true;
	else
	{
		alert("Please fill in correctly required fields.");
		return false;
	}
        });
        return false;
}
