function AJAXReq(dest, completefunc){
<!-- // Required to be compliant with XHTML-->
	var xmlHttp=null; // Defines that xmlHttp is a new variable.
	var res;
		// Try to get the right object for different browser
	try {
		// Firefox, Opera 8.0+, Safari, IE7+
		xmlHttp = new XMLHttpRequest(); // xmlHttp is now a XMLHttpRequest.
	}
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4)
			try { 	// In some instances, status cannot be retrieved and will produce an error (e.g. Port is not responsive)
				if (xmlHttp.status == 200) {
					// Set the main HTML of the body to the info provided by the  Ajax Request
					res = xmlHttp.responseText;
					completefunc(res);
				}
			}
			catch (e) {
				res = -1;//"Error on Ajax return call : " + e.description;
				completefunc(res);
			}

	}
	
	xmlHttp.open("get",dest); // .open(RequestType, Source);
	xmlHttp.send(null); // Since there is no supplied form, null takes its place 
					 // as a new form.
	return res;
}

function RefreshPageLang(){
	document.location.href = document.location.href;
}

//Trigger AJAX refresh of the page
//Takes the pagenum of the requested page, and a pointer to the Lightbox object to allow for the 
//call to refreshImageList
function ChangeLang(e, relpath){
	e.returnValue = false;
	var langid = document.getElementById('lang_select_id').selectedIndex;
	var page = relpath+'/main/setlang.php?langid='+langid;
	AJAXReq(page, RefreshPageLang);
	return false;
}