
function getLogin(username, password, email, method){
	
	var http=false; //Clear our fetching variable
	try {
			http = new ActiveXObject('Msxml2.XMLHTTP'); //Try the first kind of active x object?
	} catch (e) {
			try {
					http = new
					ActiveXObject('Microsoft.XMLHTTP'); //Try the second kind of active x object
		} catch (E) {
			http = false;
					}
	}
	if (!http && typeof XMLHttpRequest!='undefined') {
			http = new XMLHttpRequest(); //If we were able to get a working active x object, start an XMLHttpRequest
	}
	
	
	var url = '_includes/get_login.php';
	var params = 'username=' + username + "&password=" + password + "&email=" + email + "&method=" + method;
	http.open('POST', url, true);
	http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	http.setRequestHeader("Content-length", params.length);
	http.setRequestHeader("Connection", "close");
	http.send(params);
	http.onreadystatechange = function() {//Call a function when the state changes.
		if(http.readyState == 4 && http.status == 200) {
			document.getElementById('loginDiv').innerHTML=http.responseText;
		}
	}
}

function checkLogin(){

	var usernameLength = document.getElementById('loginUsername').value.length;
	var passwordLength = document.getElementById('loginPassword').value.length;
	
	if(usernameLength<1 || passwordLength<1){
		document.getElementById('loginSubmit').disabled = true;
	} else{
		document.getElementById('loginSubmit').disabled = false;
	}

}

function checkEmail(){

	var emailLength = document.getElementById('forgotEmail').value.length;
	
	if(emailLength<1){
		document.getElementById('forgotSubmit').disabled = true;
	} else{
		document.getElementById('forgotSubmit').disabled = false;
	}

}
