function GetXmlHttpObject() {
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		// Internet Explorer
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	return xmlHttp;
}

function ImageProcess(sitemenu, page) {

	ProcessLink = '/rpc_image.php';
    var params = 'sitemenu=' + encodeURIComponent(sitemenu) + '&page=' + encodeURIComponent(page);
    imagexmlhttp=GetXmlHttpObject();
	imagexmlhttp.onreadystatechange=imageStateChanged;
	imagexmlhttp.open("POST", ProcessLink, true);
	imagexmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=windows-cp1251')
	imagexmlhttp.send(params);
}

function imageStateChanged() {
	if (imagexmlhttp.readyState==4) {
		document.getElementById("images").innerHTML='';
		document.getElementById("images").innerHTML=imagexmlhttp.responseText;
		$("a.images").fancybox({}); 
    }
}
