var CEMAIL_SERVER = "http://cemail.net.ru/check_mail.php";
function CemailGroup(input) {
    this.correct = null;
    this.input = input;
}

CemailGroup.prototype.add = function(m) {
    this.input = m;
}

CemailGroup.prototype.startCheck = function() {
    var oThis = this;
    if (this.input.value == "") {
	this.input.className = "blocked";
	this.correct = 0;
	return;
    }
    this.correct = 2; // checking..
    JsHttpRequest.query(
	CEMAIL_SERVER, {
    	    email: oThis.input.value
        },
        function(result, errors) {
    	    if (result==false) {
    		oThis.input.className = "blocked";
        	oThis.correct = 0;
    	    } else if (result==true) {
		 oThis.input.className = "";
        	 oThis.correct = 1;
    	    }
        },
        false
    );
}
