function doLoad(value) {
	var bik = document.getElementById('BIK'+value);
	try {
		var req = window.XMLHttpRequest? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
		req.open("GET",'/bik_check.asp?bik='+ bik.value+'&check=0', false);
		req.send(null);
		checkBIKScript(value);
		if (req.responseText !='1') {
			findBIK(value);
		}
	}
	catch(e) {
		checkBIKScript(value);
		var bik = document.getElementById('BIK'+value);
		var oWindow = win_open('/check_bik.asp?bik='+ bik.value,"checkBic",'740','580', null);
	}
}

function checkBIKScript(value) {
	var prevDiv = removeChild ("prev");
	var list1 = document.createElement("script");
	list1.id = "listener";
	var bik = document.getElementById('BIK'+value);
	list1.src = '/bik_check.asp?bik='+ bik.value+'&check=1&id='+value;
	prevDiv.appendChild(list1);
	checkField = document.getElementById ("checkBic");
}

function findBIK(value) {
	var oWindow = win_open("/find_bik.aspx?id="+value,"findBic",'740','580', null);

}

function win_open (file, name, win_width, win_height, string_param) {

	xx = (screen.width - win_width -10) / 2 ;
	yy = (screen.height - win_height - 32) / 2 ;
	
	w_name =  window.open (file, name, string_param + ',width=' + win_width + ',height=' + win_height + ',left=' + xx + ',top=' + yy) ;
	w_name.focus();
	return w_name ;

}