function autoryzacja(){
document.forms['Login'].elements['login'].disabled=true;
var http = null;
    if(window.XMLHttpRequest)
	http = new XMLHttpRequest();
    else if (window.ActiveXObject)
    http = new ActiveXObject("Microsoft.XMLHTTP");
    http.onreadystatechange = function()
    {
        if(http.readyState == 4) 
	{ 
	    if( http.status == 200 ) { 
	    	
			var xmldoc = http.responseXML;
                        var xml_autoryzacja = xmldoc.getElementsByTagName('autoryzacja').item(0);
                        if(xml_autoryzacja.firstChild.data=='0'){
                        	
                        	var showalert = document.getElementById('error');
							while(showalert.lastChild){
   								showalert.removeChild(showalert.lastChild);
							}
								showalert.appendChild(document.createTextNode("Podane dane sa nieprawidlowe !!!"));
                        	document.forms['Login'].elements['login'].disabled=false;
                        	return false;
                        }
        }
		var form=document.getElementById('Login');
		form.submit();
    }
				}
	var shopname=document.forms['Login'].elements['shopname'].value;
	var username=document.forms['Login'].elements['username'].value;
	var password=document.forms['Login'].elements['password'].value;
    http.open("POST", "../Ajaxs/A_autoryzacja.php", true);
    http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    
    http.send("username="+username+"&shopname="+shopname+"&password="+password);   



}     
