//var baseurl="http://www.concepttestsite.co.uk/modelsources/"
var xmlhttp = new Array();
var i = 0;

function loadThis(url, destination, functocall) {
	
	/*var insertiddiv = document.getElementById('modelMessages');
	var newdiv[i] = document.createElement('div');
	newdiv[i].setAttribute('id','loadingDivImage');
	newdiv[i].innerHTML ='<img src="images/ajax-loader.gif">';

	insertiddiv.appendChild(newdiv[i]);*/
		
	xmlhttp[i]=null
	if (functocall=="undefined") functocall = "";
	if (window.XMLHttpRequest) {
		xmlhttp[i] = new XMLHttpRequest()
	} else if (window.ActiveXObject) {
		xmlhttp[i] = new ActiveXObject("Microsoft.XMLHTTP")
	}
    
	if (xmlhttp[i]!=null) {
		xmlhttp[i].onreadystatechange=new Function("loaded("+i+",'"+destination+"',"+functocall+")")
		//xmlhttp[i].open("GET",baseurl+url,true)
		xmlhttp[i].open("GET",url,true)
		xmlhttp[i].send(null)
	} else {
		alert("Your browser does not support AJAX")
	}
	i=i+1
}

function loaded(b,destination,functocall) {
	if (xmlhttp[b].readyState==4) {
		if (xmlhttp[b].status==200) {
			document.getElementById(destination).innerHTML = xmlhttp[b].responseText

			if (typeof(functocall)!="undefined") functocall();
		} else {
			alert("Problem retrieving data")
			alert(xmlhttp[b].status)
		}
	}
}