		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) {	
	//showtimer();
	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;
	//hidetimer();
	}
		else setTimeout('handleServerResponse37()', 500);
	}
}














function shows(entry, ids, lan) {
	

	
	document.getElementById('bgfot').src='/im/big-'+entry;
    
    
	
	zapros="id="+ids+"&lan="+lan;
	
	if(xmlHttp) {	

	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/showimg.php", true);
		xmlHttp.onreadystatechange=handleServerResponse372;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('shows('+entry+','+ids+','+lan+')', 1000);
			}
}








function handleServerResponse372() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('namm').innerHTML=response;

	}
		else setTimeout('handleServerResponse372()', 500);
	}
}



