
	function ajaxEvent(loUrl,loElement,llAppend,llQueued){ //defining function for this script
		if (!loElement) { //no callback specified.
			loElement=false;
		} else {
			(ClassFX.hasClass(loElement.parentNode,'folder'))?(ClassFX.addClass(loElement.parentNode,'loading')):(null);
		} 
		if (!llQueued) {llQueued=false;} //synchronous request.
		if (!llAppend) {llAppend=false;} //append into callback div.

		var loHTTP_Request = requestObject(); //should give this a prototype and keep it active for subsequent requests.
		if (!loHTTP_Request) {
			callbackEvents('unsupported XMLHTTP implementation',loElement,llAppend);
			return;
		}
		HTTPRequest(loHTTP_Request,loUrl,loElement,llAppend,llQueued); //request sent;
	}//

	function requestObject() {
		loHTTP_Request = false;
		if (window.XMLHttpRequest) { // moz...
			loHTTP_Request = new XMLHttpRequest();
			if (loHTTP_Request.overrideMimeType) {
				loHTTP_Request.overrideMimeType('text/xml'); //override to text/xml
			}
		} else if (window.ActiveXObject) { 
			try {
				loHTTP_Request = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try {
					loHTTP_Request = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e) {/*exception...*/}
			}
		}//
		if (!loHTTP_Request) { //can't create xmlhttp object
			return(false);
		}
		return(loHTTP_Request);
	}//

	function HTTPRequest(loHTTPXMLRequest,sUrl,loCallback,llAppend,llAsynch) {
		loHTTPXMLRequest.onreadystatechange = function() { hollaBack(loHTTPXMLRequest,loCallback,llAppend); }; //define callback function.
		loHTTPXMLRequest.open('GET', sUrl, llAsynch);//submit request. //asynchronous = true...
		loHTTPXMLRequest.send(null); //required to send - so send to null... ? loHTTPXMLRequest.status;
	}//

	function hollaBack(loActiveHTTP_Request,loCallback,llAppend) {
		if (loActiveHTTP_Request.readyState == 4) {
			if (loActiveHTTP_Request.status == 200) {
				callbackEvents(loActiveHTTP_Request.responseText,loCallback,llAppend);
			} else {
				callbackEvents('Unable to complete request. ' + loActiveHTTP_Request.status,loCallback,llAppend);
			}
		}
    }//

	function preCallBack(loElement,luValue) {
		//opportunity to override callback here.
		return(loElement);
	}//

	function callbackEvents(lsData,loElement,llAppend){ //specific task for call back
		loElement=preCallBack(loElement,lsData);
		loCollection=false;//integrate(loElement);
		if(loElement){
			if(loElement.tagName=='input'||loElement.tagName=='INPUT') {
				loElement.value = (llAppend)?(loElement.value + lsData):(lsData);
			} else {
				if(loCollection) { //see notes in developers blog about this. what developers blog you ask? the one that doesn't exist.
					loSwitchContainer=loElement.parentNode;
					loSwitch=loElement.cloneNode(true);
					loSwitchContainer.innerHTML='';
					loSwitchContainer.appendChild(loCollection);
					loSwitchContainer.appendChild(loSwitch);
					loElement=document.getElementById(loSwitch.id);
					loElement.innerHTML = (llAppend)?(loElement.innerHTML + lsData):(lsData);
				} else {
					loElement.innerHTML = (llAppend)?(loElement.innerHTML + lsData):(lsData);
				}
			}
			postCallBack(loElement,lsData);
		}
	}

	function postCallBack(loElement,luValue) {
		if (!loElement) {return;} //no callback specified 
		
		//cheating this in here for image background...sorry wasn't thinking about effects on the interface
		(ClassFX.hasClass(loElement.parentNode,'loading'))?(ClassFX.removeClass(loElement.parentNode,'loading')):(null);

		if(loElement.id=='contact-results') {
			messageSent();
		}
		if(loElement.id=='comment-results') {
			commentSent();
		}
	}//

	function integrate (loElement) { /*oh, shnap*/
		if(!loElement){return};
		if(ClassFX.hasClass(loElement.parentNode.childNodes[0],'protected')) { //FF text node returns false, IE returns true.
			return(loElement.parentNode.childNodes[0].cloneNode(true));
		} 
		if(ClassFX.hasClass(loElement.parentNode.childNodes[1],'protected')) { //FF 
			return(loElement.parentNode.childNodes[1].cloneNode(true));
		}
		return(false);
	}






