var xmlhttp = false;
//Check if we are using IE.
try {
//If the Javascript version is greater than 5.
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
//If not, then use the older active x object.
try {
//If we are using Internet Explorer.
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
//Else we must be using a non-IE browser.
xmlhttp = false;
}
}
//If we are using a non-IE browser, create a javascript instance of the object.
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}

function wykonaj_zapytanie(serverPage, objID) {
var obj = document.getElementById(objID);
xmlhttp.open("GET", serverPage);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}

function wykonaj_zapytanie2(serverPage, objID) {
var obj = document.getElementById(objID);
xmlhttp.open("GET", serverPage);
xmlhttp.setRequestHeader( "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT" );
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}


function rolimpex_obiekt_prawa(obiekty_id, kategorie_id, parametry_id)
{
var strona='moduly/obiekty/ajax_prawa.php?obiekty_id='+obiekty_id+'&id='+kategorie_id+'&parametry_id='+parametry_id;
var warstwa_odpowiedzi='rp_prawa';
wykonaj_zapytanie2(strona, warstwa_odpowiedzi);

}


function rolimpex_obiekt(obiekty_id, kategorie_id)
{
var strona='moduly/obiekty/ajax_lewa.php?obiekty_id='+obiekty_id+'&id='+kategorie_id;
var warstwa_odpowiedzi='fotka_lewa';
wykonaj_zapytanie(strona, warstwa_odpowiedzi);
otwarty[obiekty_id]=1;
//alert(obiekty_id);
setTimeout('rolimpex_obiekt_prawa("'+obiekty_id+'", "'+kategorie_id+'", 24);',200);
}


