function ajaxSignon() {
	var content = convertFormDataToPostContent(window.document.signonform2);
	var URL = unescape(location.href);
	var SCRIPTEXE = 'fn_webcart_signon.php';
	if (URL == 'http://www.iowa80.com/') {
		SCRIPTEXE = 'DirectionsWEB/fn_webcart_signon.php';
	}
	doSignonPost(SCRIPTEXE, content, 'processSignon');
}

function processSignon(result) {
	if (result != '1') {
		document.getElementById('signonLink').style.display="none";
		document.getElementById('signonBox').style.display="none";
		document.getElementById('signoutLink').style.display="inline";
	}
	else {
		loadPanel_signon();
	}
}

function doSignonPost(url, content, callback_name) {

	var async_requestSignon = false;
	try {
		// Firefox, Opera 8.0+, Safari, IE7+
		async_requestSignon = new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			async_requestSignon = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			async_requestSignon = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}

	async_requestSignon.open('POST', url, true);
	async_requestSignon.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	async_requestSignon.onreadystatechange = function() {
		if (async_requestSignon.readyState == 4) { 
			if (async_requestSignon.status == 200) {
				response_content = async_requestSignon.responseText;
				eval(callback_name + '(response_content);');
			}
		}
	}
	async_requestSignon.send(content);
}
