function o(id) { return document.getElementById(id) }

function validate(pole,wartosc)
{
	advAJAX.post({
    url: "validate.php",
	parameters : {
      "pole" : pole,
      "wartosc" : wartosc
    },
    onInitialization : function() {
		o(pole+"_input").setAttribute("readOnly","readOnly");
		o(pole+"_error").innerHTML = '<img src="Layout/ajax-loader.gif">';
    },
    onSuccess : function(obj) {
        o(pole+"_error").innerHTML = obj.responseText;
    },
    onError : function(obj) {
        alert("Error: " + obj.status);
    },
    onFinalization : function() {
		o(pole+"_input").removeAttribute("readOnly");
    }
});	
}
