// JavaScript Document

function ajaxMemberLogin() {
//	emptyAbove();

	var ajaxML = ajaxObj;
	var frm = document.getElementById('memberLoginForm');
	
	var n = frm.ml_name.value; // name
	var p = frm.ml_pass.value; // password
	frm.ml_submit.disabled = true;
	
	var url = 'phpGets/memberLogin.php';
	ajaxML.method = 'POST';
	ajaxML.postData = 'name='+n+'&pass='+p;
	ajaxML.rhContentType = 'application/x-www-form-urlencoded';
	ajaxML.doGet(url,showMemberLoginStatus,'xml');
	
}

function showMemberLoginStatus(guts) {
	var ajaxAbove = document.getElementById('ajaxAbove');
	var ajaxBelow = document.getElementById('ajaxBelow');
	var frm = document.getElementById('memberLoginForm');

	emptyAbove();

	// show results
	var xml = guts.firstChild;
	frm.ml_submit.disabled = false;
	frm.ml_pass.value = '';

	// check for status id
	// record id and message
	var id = xml.childNodes[0].childNodes[0].nodeValue;
	var msg = xml.childNodes[1].childNodes[0].nodeValue;
	
	if(id == 1) {
		window.location = './?page_id=145';
	}else{
		ajaxAbove.innerHTML = '<div class="error">'+msg+'</div>';
	}
}


