function loadXMLDoc(url,data,divToLoadInto){
// URL DOES NOT CONTAIN THE ROOT SITE, JUST THE LOCATION OF THE PAGE AKA. /folder1/blah/text.php
// data should be in the form of x=1&y=2&z=3

//Get Current url to prevent errors in cross domain security
var url_match = /https?:\/\/([-\w\.]+)+/;
var array_url=url_match.exec(window.location);
url=array_url[0]+url+"?"+data+"&tme="+new Date().getTime();

	if (window.XMLHttpRequest){xmlhttp=new XMLHttpRequest();}
	else{xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
	
	xmlhttp.onreadystatechange=function(){
		if(xmlhttp.readyState<4){
		//in case there is a small lag in loading
		document.getElementById(divToLoadInto).innerHTML="<div><img src='/images/loading.gif'></div>";
		}
			if (xmlhttp.readyState==4 && xmlhttp.status==200){
				document.getElementById(divToLoadInto).innerHTML=xmlhttp.responseText;
			}
	}
	xmlhttp.open("GET",url,true);
	xmlhttp.send();
}

//Nicolas S
