function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id+ "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=650,height=770,left = 412,top = 234');");
}
function getXMLHTTPRequest() {
try {
req = new XMLHttpRequest();
} catch(err1) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (err2) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (err3) {
req = false;
}
}
}
return req;
}
var http = getXMLHTTPRequest();

function getBranch() {
//var val=document.getElementById('country2').value;

//alert(val);
var url='component/com_checkout/';

var myurl = url+'bank.php';
myRand = parseInt(Math.random()*999999999999999);
var modurl = myurl+"?rand="+myRand;
//alert(modurl);
http.open("GET", modurl, true);
http.onreadystatechange = branchResponse;
http.send(null);
}

function branchResponse() {
if (http.readyState == 4) {
if(http.status == 200) {
var mytext = http.responseText;
//alert(mytext);
document.getElementById('branch').innerHTML = mytext;
}
} else {
document. getElementById('branch').innerHTML = "";
}
}

function getBankInfo() {

var browserName=navigator.appName;var flag=0;

//alert(browserName);
if (browserName=="Netscape")
{ 
	flag=1;
}

//var val1=document.getElementById('country2').value;
var val2=document.getElementById('bank').value;

//alert(val2);
//var val3=document.getElementById('account').value;
var url='component/com_checkout/';
var myurl = url+'bankinfo.php';
myRand = parseInt(Math.random()*999999999999999);

	var modurl = myurl+"?rand="+myRand+'&bank='+val2+'&flag='+flag+'&';
//alert(modurl);
http.open("GET", modurl, true);

http.onreadystatechange = bankResponse;

http.send(null);
}

function bankResponse() {
		if (http.readyState == 4) {
		if(http.status == 200) {
		var mytext = http.responseText;
		//alert(mytext);
		//alert(mytext);
		document.getElementById('branch_info').innerHTML = mytext;
		//document. getElementById('bank_ac_info').innerHTML = "";
		
		}
		} else {
				document. getElementById('branch_info').innerHTML = "";
				}
}


function getACInfo() {
var browserName=navigator.appName;var flag=0;

//alert(browserName);
if (browserName=="Netscape")
{ 
	flag=1;
}

//var val1=document.getElementById('country2').value;
var val2=document.getElementById('bank').value;
var val3=document.getElementById('account').value;

//alert('County '+val1+'Bank '+val2+'Account '+val3);
var url='component/com_checkout/';

var myurl =  url+'bank_acinfo.php';
myRand = parseInt(Math.random()*999999999999999);
var modurl = myurl+"?rand="+myRand+'&bank_id='+val3+'&bank='+val2+'&flag='+flag+'&';
http.open("GET", modurl, true);
http.onreadystatechange = acInfoResponse;
http.send(null);
}

function acInfoResponse() {

if (http.readyState == 4) {
if(http.status == 200) {
var mytext = http.responseText;
//alert(mytext);
document.getElementById('bank_ac_info').innerHTML = mytext;
}
} else {
document. getElementById('bank_ac_info').innerHTML = "";
}
}


