	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 showvxod(lan) {
	
//	alert(entry.value);
	
var zapros="lan="+lan;
	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/vxod.php", true);
		xmlHttp.onreadystatechange=handleServerResponse371;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showvxod('+lan+')', 1000);
			}
}
function handleServerResponse371() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('okno').innerHTML=response;
        
        document.getElementById('okno').style.display='';
        
	//hidetimer();
	}
		else setTimeout('handleServerResponse371()', 500);
	}
}




//Открываем регистрацию
function showreg(entry, lan) {
	
//	alert(entry.value);
	
var zapros="userid="+entry+"&lan="+lan;


	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/registr.php", true);
		xmlHttp.onreadystatechange=handleServerResponse372;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showreg('+entry+','+lan+')', 1000);
			}
}
function handleServerResponse372() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('okno').innerHTML=response;
        
        document.getElementById('okno').style.display='';
        
	//hidetimer();
	}
		else setTimeout('handleServerResponse372()', 500);
	}
}




//Открываем регистрацию
function showpogr(lan) {
	

	
var zapros="lan="+lan;


	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/pogruzitsya.php", true);
		xmlHttp.onreadystatechange=handleServerResponse373;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showpogr('+lan+')', 1000);
			}
}
function handleServerResponse373() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('okno').innerHTML=response;
        
        document.getElementById('okno').style.display='';
        
	//hidetimer();
	}
		else setTimeout('handleServerResponse373()', 500);
	}
}




//Открываем регистрацию
function showvideo(entry, lan) {
	

	
var zapros="id="+entry+"&lan="+lan;


	if(xmlHttp) {	
	//showtimer();
	if(xmlHttp.readyState==4 || xmlHttp.readyState==0) {
		xmlHttp.open("POST", "/modules/video.php", true);
		xmlHttp.onreadystatechange=handleServerResponse375;
		xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		xmlHttp.send(zapros);	
	}
	else setTimeout('showvideo('+entry+', '+lan+')', 1000);
			}
}
function handleServerResponse375() {
if(xmlHttp.readyState==4) {
		if(xmlHttp.status==200) {
			response = xmlHttp.responseText;
		document.getElementById('okno').innerHTML=response;
        
        document.getElementById('okno').style.display='';
        
	//hidetimer();
	}
		else setTimeout('handleServerResponse375()', 500);
	}
}



function prova(form) {
	
	
	if(form.e_mail.value=='' || form.pass.value=='' || form.fio.value=='') {
		
		alert("Заполните обязательные поля"); return false;
	}

	else if(form.pass.value!=form.pass1.value) {alert("Пароли не совпадают"); return false;}
	else if(form.outcode.value=='error') {alert("Не верный проверочный код"); return false;}
	
	else return true;
	
}


function prover(form) {
	
	
	if(form.email.value=='' || form.phone.value=='' || form.fio.value=='' || form.note.value=='') {
		
		alert("Заполните обязательные поля"); return false;
	}
	
	else return true;
	
}

