﻿// JavaScript Document
	var login_win=document.getElementById("login_window");
function showlogin(){
window.location='/logen.php';
	//login_win.style.left=parseFloat(document.body.scrollWidth)/2-225;
	//login_win.style.display="block";
	//document.getElementById("infbox").style.display="none";

}
function nonelogin(){
	login_win.style.display="none";
	checkthis();
}
function closethis(){
	document.getElementById("infbox").style.display="none";
}

var xmlHttp
function S_xmlhttprequest(){
	if(window.ActiveXObject){
		xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');	
	} else if(window.XMLHttpRequest){
		xmlHttp = new XMLHttpRequest();
	}
}
function login(){
	var uname=document.mylogin.username.value;
	var upass=document.mylogin.password.value;
	S_xmlhttprequest();
	xmlHttp.open("GET","/check.php?action=login&u="+uname+"&p="+upass+"",true);
	xmlHttp.onreadystatechange = logfanhui;
	xmlHttp.send(null);
}
function logfanhui(){
	if(xmlHttp.readyState==1){
	document.getElementById('infos').innerHTML = "&nbsp;<img src='/img/Load.gif'> <font color='green'>تەكشۈرۈۋاتىدۇ ....</font>";
	}
	if(xmlHttp.readyState==4){
	if(xmlHttp.status==200){
	var checkname =  xmlHttp.responseText;
	if(checkname=="نۇر تورىغا ئۇڭۇشلۇق كىردىڭىز تەبرىكلەيمىز<br><br><a href='/ucenter.php' style='color:red;'>ئەزالار مەركىزى</a>"){
		document.mylogin.innerHTML='<br><span id="infos">'+ checkname +'</span>';
	}else{document.getElementById('infos').innerHTML = checkname;}
	}
	}
}
function checkthis(){
	S_xmlhttprequest();
	xmlHttp.open("GET","/check.php?action=checkbody",true);
	xmlHttp.onreadystatechange = yesno;
	xmlHttp.send(null);
}
function yesno(){
	if(xmlHttp.readyState==4){
	if(xmlHttp.status==200){
	var check =  xmlHttp.responseText;
	document.getElementById("logining").innerHTML = check;
	}}
}
checkthis();
