

function initRequest(url, callFunc, header, uid) {
	xmlRequestObj = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")
	xmlRequestObj.onreadystatechange = proccessRequest;
	xmlRequestObj.open("POST", url, true);
	xmlRequestObj.setRequestHeader("uid", uid);
	xmlRequestObj.setRequestHeader("flash", header);
	xmlRequestObj.send(null);
}

function proccessRequest() {
	if (xmlRequestObj.readyState == 4 && xmlRequestObj.status == 200) {
		result = xmlRequestObj.responseText;
		var string = result;
		var newdiv = document.createElement("div");
		newdiv.innerHTML = string;
		var sidebar = document.getElementById("sidebarImgContainer");
		sidebar.appendChild(newdiv);
	}
}

function initSidebar(uid) {
agt=navigator.userAgent.toLowerCase();
sys=(navigator.platform)?navigator.platform.toLowerCase():agt;
agt_os=((sys.indexOf('mac')>=0)?"Macintosh":(sys.indexOf('unix')>=0 || sys.indexOf('linux')>=0 || sys.indexOf('x11')>=0 || sys.indexOf('x 11')>=0)?"Linux/Unix":(sys.indexOf('os/2')>=0)?"OS/2":(sys.indexOf('win')>=0)?"Windows":"");

if ((agt_os == "Macintosh" && agt.indexOf("firefox")!=-1) || (agt_os == "Windows" && agt.indexOf("firefox/2")!=-1)){
	path = "http://henleyglobal.com/fileadmin/flash/res/process_xml.php";
}
else if ((agt_os == "Macintosh" && (agt.indexOf("10_6")!=-1 || agt.indexOf("11_")!=-1 || agt.indexOf("12_")!=-1)))
{
	path = "http://henleyglobal.com/fileadmin/flash/res/process_xml.php";
}
else{
	path = "./fileadmin/flash/res/process_xml.php";
}

requiredMajorVersion = 8;
requiredMinorVersion = 0;
requiredRevision = 0;
hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
	if (hasReqestedVersion) {
		isFlash = true;
		//initialize the Ajax request
		initRequest(path, "proccessRequest", isFlash, uid);
	}
	else {
 		isFlash = false;
		//initialize the Ajax request
		initRequest(path, "proccessRequest", isFlash, uid);
	}
}