function makeRequest(url, container) {
        var http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari, ...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = function() { alertContents(http_request, container); };
        http_request.open('GET', url, true);
        http_request.send(null);

}

function alertContents(http_request, container) {
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                //alert(http_request.responseText);
                document.getElementById(container).innerHTML = http_request.responseText;
                //Special Condition for picture loading div
                if (container=="pic") {
                        document.getElementById(container).style.visibility="visible";
                }
            } else {
                alert('There was a problem with the request.');
            }
        }
}

function show_loading_bar(container) {
	pagebody = document.getElementById(container);
	
	_height = pagebody.offsetHeight;
	_width = pagebody.offsetWidth;

	//background-color:#F8FBFE;

	oDiv = "<div style='text-align:center;height:"+_height+"px;width:"+_width+"px;padding-top:"+(_height-50)/2+"px;'>";
	oDiv += "<span style='font-size:14pt;letter-spacing:5px;font-weight:bold;color:black;'>Loading...</span>";
	oDiv +="<br /><img src='images/ajax-loader.gif' /></div>";
	
	pagebody.innerHTML=oDiv;
}

function login() {
	u = document.getElementById("username");
	p = document.getElementById("password");
	if ( (u.value!="") && (p.value!="") ) {
		show_loading_bar('eaccountlogin');
		makeRequest("eaccount/login.php?u="+u.value+"&p="+p.value,"eaccountlogin");
	}
}

function showaccount(accountnumber) {
	show_loading_bar('accountsummary');
	makeRequest("eaccount/showaccount.php?acc="+accountnumber,"accountsummary");
}