var UFE_RE = /%u([0-9A-Za-z]{4})/g;
function unicodeFreeEscape(s) {
  return escape(s).replace(UFE_RE, "%ff");
}
function ajaxFunction(){		
	var username = unicodeFreeEscape(document.getElementById('user').value);
	var password = unicodeFreeEscape(document.getElementById('pwd').value);	
	
	var ajaxRequest;  // The variable that makes Ajax possible!	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){		
		if(ajaxRequest.responseText=="Invalid")
		{document.getElementById('mess').style.display="block";setTimeout('invalid()',2000);}
		//document.getElementById('newuser').innerHTML ="<span class='sinlink'>"+ ajaxRequest.responseText+"</span>";
		else
		document.getElementById('titled').innerHTML = ajaxRequest.responseText;
		}
	}
	var url = "http://www.manacine.com/login/login.php?user="+username+"&pwd="+password;	
	ajaxRequest.open("GET",url,true);
	ajaxRequest.send(null); 
}
function adf()
{
	var ajaxRequest;  // The variable that makes Ajax possible!	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){		
		document.getElementById('titled').innerHTML = ajaxRequest.responseText;
		}
	}
	var url = "http://www.manacine.com/login/log.php";	
	ajaxRequest.open("GET",url,true);
	ajaxRequest.send(null); 
}
function invalid()
{
	document.getElementById('mess').style.display="none";
}
function ajaxFunctionVer()
{	
	var username = document.getElementById('user').value;
	var ajaxRequest;  // The variable that makes Ajax possible!	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){		
		if(ajaxRequest.responseText=="Invalid")
		{document.getElementById('mess').style.display="block";setTimeout('invalid()',2000);}
		//document.getElementById('newuser').innerHTML ="<span class='sinlink'>"+ ajaxRequest.responseText+"</span>";
		else
		document.getElementById('titled').innerHTML = ajaxRequest.responseText;
		}
	}
	var url = "http://www.manacine.com/login/verify.php?user="+username;	
	ajaxRequest.open("GET",url,true);
	ajaxRequest.send(null); 
}