var xmlHttp=null;

function GetXmlHttpObject() {
var xmlHttp;
try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); }
catch (e) {
	try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); }
	catch (E) { xmlHttp = false; } }
if(!xmlHttp && typeof XMLHttpRequest!='undefined') { xmlHttp = new XMLHttpRequest(); }
return xmlHttp; }

function AJAX(method, php, params, OnChange) {
xmlHttp = GetXmlHttpObject();
if(xmlHttp == null) { alert("Ваш браузер не поддерживает AJAX !"); return; }
if(OnChange!= null) xmlHttp.onreadystatechange = OnChange;
if(method == "GET") {
	url = php + "?ajax=&" + params;
	xmlHttp.open(method, url, true);
	xmlHttp.send(null); }
if(method == "POST") {
	params = "ajax=1&" + params;
	xmlHttp.open(method, php, true);
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlHttp.send(params); } }

function GetClientWidth() {
return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth; }

function GetClientHeight() {
return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight; }

function ShowMap(act,id) {
w = 640; h = 480;
url = "http://www.ks-bank.ru/ru/contacts/map.php?act="+act+"&id="+id;
ShowModal(url,w,h); }

function ShowModal(url,w,h) {
var l = (GetClientWidth() - w) / 2;
var t = (GetClientHeight() - h) / 2;
if(window.showModalDialog && (window.navigator.userAgent.indexOf("Opera")<0)) {
	return window.showModalDialog(url,"","dialogWidth:"+w+"px; dialogHeight:"+h+"px; dialogLeft:"+l+"px; dialogTop:"+t+"px"); }
window.open(url,"name","width="+w+", height="+h+", resizable=yes, toolbar=0, location=0, status=no, menubar=0, directories=0, scrollbars=no, left="+l+", top="+t+", modal=yes"); 
return; }

function EditParam(obj,id,param) {
return; }
