
function createXMLHttpRequest(){var xmlReq=false;if(window.XMLHttpRequest){try{xmlReq=new XMLHttpRequest();}catch(e){xmlReq=false;}}else if(window.ActiveXObject){try{xmlReq=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlReq=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){xmlReq=false;}}}
return xmlReq;}
var userAgent={};userAgent.isAJAX=(createXMLHttpRequest()?true:false);userAgent.isMozilla=(navigator.userAgent.match(/\bGecko\b/));userAgent.isOpera=(navigator.userAgent.match(/\bOpera\b/));userAgent.isInternetExplorer=(navigator.userAgent.match(/\bMSIE\b/)&&!userAgent.isOpera);function callServer(method,url,data,dataType,func,arg){if(!method)method='GET';var xmlReq=createXMLHttpRequest();if(xmlReq){xmlReq.onreadystatechange=function(){if(xmlReq.readyState==4){func(arg,xmlReq.responseText,xmlReq.responseXML,xmlReq.status,xmlReq.statusText);}};xmlReq.open(method,url,true);if(data){if(!dataType)dataType='application/xml';if(typeof(data)!="string"&&dataType.indexOf("charset=")<0&&userAgent.isMozilla)dataType=dataType+';charset=utf-8';xmlReq.setRequestHeader('Content-Type',dataType);}
xmlReq.send(data);return false;}
return true;}
function showHTML(element,responseText,responseXML,statusCode,statusText){if(typeof(element)=="string")element=document.getElementById(element);if(statusCode==200||statusCode==201){element.innerHTML=responseText;}
else{alert("Загрузить информацию не удалось:\n"+statusText);}}