if(!!ajax===false) var ajax=new Array();
var subsObj;

subscription=function() {
	subsObj=this;
	
	this.init=function() {
		this.block=document.getElementById('subscribe_block');
		this.f=document.getElementById('sForm');
	}
	this.submit=function() {
		if(this.f.email.value=='') {alert('Не заполнено поле "e-mail"');}
		else {
			this.f.submit.disabled=true;
			this.f.email.disabled=true;
			this.checkEmail(this.f.email.value);
		}
		return false;
	}
	this.checkEmail=function() {
		var index=ajax.length;
		ajax[index]=new sack();
		ajax[index].requestFile='/ajax.php?do=check_email&email='+this.f.email.value;
		ajax[index].onCompletion=function() {subsObj.getStatus(index);}
		ajax[index].runAJAX();
		return false;
	}
	this.getStatus=function(index) {
		this.status=parseInt(ajax[index].response);
		alert(messages[this.status]);
		this.f.submit.disabled=false;
		this.f.email.disabled=false;
	}
		
	this.remove=function(index) {
		if(!!document.getElementById('div_edu_'+index)) {
			this.formBox.removeChild(document.getElementById('div_edu_'+index));
		}
	}
}