	
		var xmlHttp;

	try {
		xmlHttp=new XMLHttpRequest();


	}
	catch(e) {
		var XmlHttpVersions=new Array('MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', 'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP');
		
		for(var i=0; i<XmlHttpVersions.length && !xmlHttp; i++) {
			try {
				xmlHttp = new ActiveXObject(XmlHttpVersions[i]);

			
			}
			catch(e) {}
		}
	}

	if(!xmlHttp) alert("Ошибка создания объекта XMLHttpRequest.");
	
	
	//Проверяем правильность введенного кода
function ochko() {
	
//	alert(entry.value);
	
	var gaga=document.getElementById('intext').value;
	
	zapros="fuck="+gaga;
	
	if(xmlHttp) {	

		if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/ok_code.php", true);
		xmlHttp.onreadystatechange=handleServerResponse37;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('ochko()', 1000);
			}
}
function handleServerResponse37() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('outcode').value=response;

	}
		else setTimeout('handleServerResponse37()', 500);
	}
}



function checkmail(value) {
reg = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;
if (!value.match(reg)) { 
document.getElementById('email').value=""; return false; }

else return true;
}

