/*
 * jsRequestLib - Javascript HTTP-Request-Library
 * 
 * obviously called ajax somewhere, buzzwords suck
 *
 * schandera II/MMVIII | schandera@sachenwerk.de | www.sachenwerk.de
 */


/* the obvious stuff, inspired from wikimedia's ajax.js (sajax)
 * generates the requester-object, tries the generic (gecko/ie7) then the proprietary
 * microsoft-rubbish */

/* DO NOT FORGET to declare the requester LOCALLY (with "var requester") in the function
 * using the requester for multiple requests!! */
function jsRequest_generateRequester() {
	var requester = false;
	try {
		requester = new XMLHttpRequest();
	} // end.try get requester for IE7,Gecko etc.
	catch (exception) {
		try {
			requester = new ActiveXObject("Msxml2.XMLHTTP");
		} // end.try get requester for IE
		catch(exception) {
			try {
				requester = new ActiveXObject("Microsoft.XMLHTTP");
			} // end.try get requester for IE
			catch(exception) {
				jsRequest_showError("Could not generate the requester with either XMLHttpRequest,Msxml2,Microsoft.XMLHTTP!\n\nException caught: \n"+exception);
				return(null);
			} // end.exception caught
		} // end.exception caught.could not object Msxml2
	} // end.exception caught
	return( requester );
} // end.generateRequester


function jsRequest_exception() {
	var message;
	var number;
} // end.exception

function jsRequest_showError(message) {
	alert("      === jsRequest - error ===      \n\n" + message );
} // end.showError

