function createRequestObject()
{
var xmlhttp;
xmlhttp = false;
// native XMLHttpRequest object like firefox and safari
if(window.XMLHttpRequest)
{
try
{
xmlhttp = new XMLHttpRequest();
}
catch(e)
{
xmlhttp = false;
}
// IE/Windows ActiveX version (why do people still use this browser?)
}
else if(window.ActiveXObject)
{
try
{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
try
{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e)
{
xmlhttp = false;
}
}
}
if(!xmlhttp)
alert("Error loading XMLHTTP object");
return xmlhttp;
}
function LoadHTML(url,div)
{
var dest;
var contentDiv;
var request;
request=createRequestObject();
dest=div;
if(!request) return false;
request.onreadystatechange=
function()
{
contentDiv = document.getElementById(dest);
//ТУТ ВСТАВИТЬ КАРТИНКУ ЛОАДЕРА!!!!!!!
//ТУТ ВСТАВИТЬ КАРТИНКУ ЛОАДЕРА!!!!!!!
contentDiv.innerHTML="<img src='1-1.gif'>";
if (request.readyState == 4){
contentDiv = document.getElementById(dest);
if (request.status == 200){
response = request.responseText;
contentDiv.innerHTML = response;
} else {
contentDiv.innerHTML = "Error: Status "+request.status;
}
}
};
request.open("POST", url, true);
request.send("");
}