<!--
//Gets the browser specific XmlHttpRequest Object
function getXmlHttpRequestObject() {
	if (window.XMLHttpRequest) {
		return new XMLHttpRequest(); //Not IE
	} else if(window.ActiveXObject) {
		return new ActiveXObject("Microsoft.XMLHTTP"); //IE
	} else {
		//Display error message here and inform the user they should upgrade their browser.
		alert("Your browser doesn't support the XmlHttpRequest object.  Please upgrade to IE7 or Firefox.");
	}
}
//Get our browser specific XmlHttpRequest object.
var ajax = getXmlHttpRequestObject();
//Initiate the asyncronous request.

function processAjaxRequest(param, action, method, func, id){
//If our XmlHttpRequest object is not in the middle of a request, start the new asyncronous call.
	if (ajax.readyState == 4 || ajax.readyState == 0) {
		cust = new Object()
		cust.id = id

		var out = param;
		//Setup the connection as a GET call to SayHello.html.
		//True explicity sets the request to asyncronous (default).
		ajax.open(method, action, true);
		//Set the function that will be called when the XmlHttpRequest objects state changes.
		ajax.onreadystatechange = eval(func);
		//Send the proper header information along with the POST request
		ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajax.setRequestHeader("Content-length", out.length);
		ajax.setRequestHeader("Connection", "close");
		//Make the actual request.
		//ajax.cid = id;
		ajax.send(out);
	}
}

function listingsFilesCall(pid){
	//var newLimit = document.getElementById('mlimit_'+element+'').value;
	//if(newLimit.length != ""){
	//	if(curval != newLimit){


	var out = "lid="+pid;
	//		var functionOut = "";
	processAjaxRequest(out, 'getfiles.php', 'POST', 'listingsFilesOut', 'info');

	//	}
	//}
}

function listingsFilesOut(){
	if (ajax.readyState == 4) {
		//Set the contents of our span element to the result of the asyncronous call.
		var spanid = 'info';
		document.getElementById(spanid).innerHTML = ajax.responseText;
	}else{
		document.getElementById('info').innerHTML = '<div align="center" style="padding-top:30px"><img src="loading.gif" width="24" height="24"/></div>';
	}
}

function simpleLogin(rid, lid){
	var out = 'r=' + rid + '&l=' + lid;
	processAjaxRequest(out, 'login.simple.php', 'POST', 'simpleLoginOut', 'info');
}

function simpleLoginProcess(rid){
	var out = 'name='+document.getElementById('name').value+'&company='+document.getElementById('company').value+'&email='+document.getElementById('email').value+'&r=' + rid;
	processAjaxRequest(out, 'login.simple.php', 'POST', 'simpleLoginOut', 'info');
}

function noPrivNotice(rid, lid){
	var out = 'r=' + rid + '&l=' + lid + '&nopriv=1';
	processAjaxRequest(out, 'login.simple.php', 'POST', 'simpleLoginOut', 'info');
}

function simpleLoginOut(){
	if (ajax.readyState == 4) {
		//Set the contents of our span element to the result of the asyncronous call.
		var spanid = 'info';
		document.getElementById(spanid).innerHTML = ajax.responseText;
	}else{
		document.getElementById('info').innerHTML = '<div align="center" style="padding-top:30px"><img src="loading.gif" width="24" height="24"/></div>';
	}
}


//-->
