function pobierzObiekt(){
	var req = createReq();
	if(req == null){
		alert("blad!");
		return;
	}
	var url = "./php/obiekt.php";
	req.open("GET", url, true);
	req.onreadystatechange = function(){
		if(isReady(req)){
			drukujObiekt(req.responseText);
		}
	}
	req.send(null);
}

function drukujObiekt(json){
	var jsonObj = JSON.parse(json);
	var body = document.getElementsByTagName("body")[0];
	var gul = document.createElement("ul");
	for(var dana in jsonObj){
		var wartosc = jsonObj[dana];
		var gli = document.createElement("li");
		
		if(isArray(wartosc)){
			gli.appendChild(document.createTextNode(dana+": "));
			var ul = document.createElement("ul");
			for(var i in wartosc){
				var li = document.createElement("li");
				li.appendChild(document.createTextNode(wartosc[i]));
				ul.appendChild(li);
			}
			gli.appendChild(ul);
		}else{
			gli.appendChild(document.createTextNode(dana+": "+wartosc));
		}
		gul.appendChild(gli);
	}
	body.appendChild(gul);
}

window.onload = pobierzObiekt;