/*
* AdvancedAJAX 1.1.2
* (c) 2005-2006 Lukasz Lach
* mail: anakin@php5.pl
* www: http://advajax.anakin.us/
* http://anakin.us/
* http://creativecommons.org/licenses/LGPL/2.1/
*
*/
function advAJAX() {
var obj = new Object();
obj.url = window.location.href;
obj.method = "GET";
obj.parameters = new Object();
obj.jsonParameters = new Object();
obj.headers = new Object();
obj.async = true;
obj.mimeType = "text/xml";
obj.username = null;
obj.password = null;
obj.form = null;
obj.disableForm = true;
obj.unique = true;
obj.uniqueParameter = "_uniqid";
obj.requestDone = false;
obj.queryString = "";
obj.responseText = null;
obj.responseXML = null;
obj.status = null;
obj.statusText = null;
obj.aborted = false;
obj.timeout = 0;
obj.retryCount = 0;
obj.retryDelay = 1000;
obj.tag = null;
obj.group = null;
obj.progressTimerInterval = 50;
obj.xmlHttpRequest = null;
obj.onInitialization = null;
obj.onFinalization = null;
obj.onReadyStateChange = null;
obj.onLoading = null;
obj.onLoaded = null;
obj.onInteractive = null;
obj.onComplete = null;
obj.onProgress = null;
obj.onSuccess = null;
obj.onFatalError = null;
obj.onError = null;
obj.onTimeout = null;
obj.onRetryDelay = null;
obj.onRetry = null;
obj.onGroupEnter = null;
obj.onGroupLeave = null;
obj.createXmlHttpRequest = function() {
if (typeof XMLHttpRequest != "undefined")
return new XMLHttpRequest();
var xhrVersion = [ "MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
"MSXML2.XMLHttp","Microsoft.XMLHttp" ];
for (var i = 0; i < xhrVersion.length; i++) {
try {
var xhrObj = new ActiveXObject(xhrVersion[i]);
return xhrObj;
} catch (e) { }
}
obj.raiseEvent("FatalError");
return null;
};
obj._oldResponseLength = null;
obj._progressTimer = null;
obj._progressStarted = navigator.userAgent.indexOf('Opera') == -1;
obj._onProgress = function() {
if (typeof obj.onProgress == "function" &&
typeof obj.xmlHttpRequest.getResponseHeader == "function") {
var contentLength = obj.xmlHttpRequest.getResponseHeader("Content-length");
if (contentLength != null && contentLength != '') {
var responseLength = obj.xmlHttpRequest.responseText.length;
if (responseLength != obj._oldResponseLength) {
obj.raiseEvent("Progress", obj, responseLength, contentLength);
obj._oldResponseLength = obj.xmlHttpRequest.responseText.length;
}
}
}
if (obj._progressStarted) return;
obj._progressStarted = true;
var _obj = this;
this.__onProgress = function() {
obj._onProgress();
obj._progressTimer = window.setTimeout(_obj.__onProgress, obj.progressTimerInterval);
}
_obj.__onProgress();
}
obj._onInitializationHandled = false;
obj._initObject = function() {
if (obj.xmlHttpRequest != null) {
delete obj.xmlHttpRequest["onreadystatechange"];
obj.xmlHttpRequest = null;
}
if ((obj.xmlHttpRequest = obj.createXmlHttpRequest()) == null)
return null;
if (typeof obj.xmlHttpRequest.overrideMimeType != "undefined")
obj.xmlHttpRequest.overrideMimeType(obj.mimeType);
obj.xmlHttpRequest.onreadystatechange = function() {
if (obj == null || obj.xmlHttpRequest == null)
return;
obj.raiseEvent("ReadyStateChange", obj, obj.xmlHttpRequest.readyState);
obj._onProgress();
switch (obj.xmlHttpRequest.readyState) {
case 1: obj._onLoading(); break;
case 2: obj._onLoaded(); break;
case 3: obj._onInteractive(); break;
case 4: obj._onComplete(); break;
}
};
obj._onLoadingHandled =
obj._onLoadedHandled =
obj._onInteractiveHandled =
obj._onCompleteHandled = false;
};
obj._onLoading = function() {
if (obj._onLoadingHandled)
return;
if (!obj._retry && obj.group != null) {
if (typeof advAJAX._groupData[obj.group] == "undefined")
advAJAX._groupData[obj.group] = 0;
advAJAX._groupData[obj.group]++;
if (typeof obj.onGroupEnter == "function" && advAJAX._groupData[obj.group] == 1)
obj.onGroupEnter(obj);
}
obj.raiseEvent("Loading", obj);
obj._onLoadingHandled = true;
};
obj._onLoaded = function() {
if (obj._onLoadedHandled)
return;
obj.raiseEvent("Loaded", obj);
obj._onLoadedHandled = true;
};
obj._onInteractive = function() {
if (obj._onInteractiveHandled)
return;
obj.raiseEvent("Interactive", obj);
obj._onInteractiveHandled = true;
if (!obj._progressStarted)
obj._onProgress();
};
obj._onComplete = function() {
if (obj._onCompleteHandled || obj.aborted)
return;
if (obj._progressStarted) {
window.clearInterval(obj._progressTimer);
obj._progressStarted = false;
}
obj.requestDone = true;
with (obj.xmlHttpRequest) {
obj.responseText = responseText;
obj.responseXML = responseXML;
if (typeof status != "undefined")
obj.status = status;
if (typeof statusText != "undefined")
obj.statusText = statusText;
}
obj.raiseEvent("Complete", obj);
obj._onCompleteHandled = true;
if (obj.status == 200)
obj.raiseEvent("Success", obj); else
obj.raiseEvent("Error", obj);
delete obj.xmlHttpRequest['onreadystatechange'];
obj.xmlHttpRequest = null;
if (obj.disableForm)
obj.switchForm(true);
obj._groupLeave();
obj.raiseEvent("Finalization", obj);
};
obj._groupLeave = function() {
if (obj.group != null) {
advAJAX._groupData[obj.group]--;
if (advAJAX._groupData[obj.group] == 0)
obj.raiseEvent("GroupLeave", obj);
}
};
obj._retry = false;
obj._retryNo = 0;
obj._onTimeout = function() {
if (obj == null || obj.xmlHttpRequest == null || obj._onCompleteHandled)
return;
obj.aborted = true;
obj.xmlHttpRequest.abort();
obj.raiseEvent("Timeout", obj);
obj._retry = true;
if (obj._retryNo != obj.retryCount) {
obj._initObject();
if (obj.retryDelay > 0) {
obj.raiseEvent("RetryDelay", obj);
startTime = new Date().getTime();
while (new Date().getTime() - startTime < obj.retryDelay);
}
obj._retryNo++;
obj.raiseEvent("Retry", obj, obj._retryNo);
obj.run();
} else {
delete obj.xmlHttpRequest["onreadystatechange"];
obj.xmlHttpRequest = null;
if (obj.disableForm)
obj.switchForm(true);
obj._groupLeave();
obj.raiseEvent("Finalization", obj);
}
};
obj.run = function() {
obj._initObject();
if (obj.xmlHttpRequest == null)
return false;
obj.aborted = false;
if (!obj._onInitializationHandled) {
obj.raiseEvent("Initialization", obj);
obj._onInitializationHandled = true;
}
if (obj.method == "GET" && obj.unique)
obj.parameters[encodeURIComponent(obj.uniqueParameter)] =
new Date().getTime().toString().substr(5) + Math.floor(Math.random() * 100).toString();
if (!obj._retry) {
for (var a in obj.parameters) {
if (obj.queryString.length > 0)
obj.queryString += "&";
if (typeof obj.parameters[a] != "object")
obj.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(obj.parameters[a]); else {
for (var i = 0; i < obj.parameters[a].length; i++)
obj.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(obj.parameters[a][i]) + "&";
obj.queryString = obj.queryString.slice(0, -1);
}
}
for (var a in obj.jsonParameters) {
var useJson = typeof [].toJSONString == 'function';
if (obj.queryString.length > 0)
obj.queryString += "&";
obj.queryString += encodeURIComponent(a) + "=";
if (useJson)
obj.queryString += encodeURIComponent(obj.jsonParameters[a].toJSONString()); else
obj.queryString += encodeURIComponent(obj.jsonParameters[a]);
}
if (obj.method == "GET" && obj.queryString.length > 0)
obj.url += (obj.url.indexOf("?") != -1 ? "&" : "?") + obj.queryString;
}
if (obj.disableForm)
obj.switchForm(false);
try {
obj.xmlHttpRequest.open(obj.method, obj.url, obj.async, obj.username || '', obj.password || '');
} catch (e) {
obj.raiseEvent("FatalError", obj, e);
return;
}
if (obj.timeout > 0)
setTimeout(obj._onTimeout, obj.timeout);
if (typeof obj.xmlHttpRequest.setRequestHeader != "undefined")
for (var a in obj.headers)
obj.xmlHttpRequest.setRequestHeader(encodeURIComponent(a), encodeURIComponent(obj.headers[a]));
if (obj.method == "POST" && typeof obj.xmlHttpRequest.setRequestHeader != "undefined") {
obj.xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
obj.xmlHttpRequest.send(obj.queryString);
} else if (obj.method == "GET")
obj.xmlHttpRequest.send('');
};
obj.handleArguments = function(args) {
if (typeof args.form == "object" && args.form != null) {
obj.form = args.form;
obj.appendForm();
}
for (a in args) {
if (typeof obj[a] == "undefined")
obj.parameters[a] = args[a]; else {
if (a != "parameters" && a != "headers")
obj[a] = args[a]; else
for (b in args[a])
obj[a][b] = args[a][b];
}
}
obj.method = obj.method.toUpperCase();
};
obj.switchForm = function(enable) {
if (typeof obj.form != "object" || obj.form == null)
return;
with (obj.form)
for (var nr = 0; nr < elements.length; nr++)
if (!enable) {
if (elements[nr]["disabled"])
elements[nr]["_disabled"] = true; else
elements[nr]["disabled"] = "disabled";
} else
if (typeof elements[nr]["_disabled"] == "undefined")
elements[nr].removeAttribute("disabled");
};
obj.appendForm = function() {
with (obj.form) {
obj.method = getAttribute("method").toUpperCase();
obj.url = getAttribute("action");
for (var nr = 0; nr < elements.length; nr++) {
var e = elements[nr];
if (e.disabled)
continue;
switch (e.type) {
case "text":
case "password":
case "hidden":
case "textarea":
obj.addParameter(e.name, e.value);
break;
case "select-one":
if (e.selectedIndex >= 0)
obj.addParameter(e.name, e.options[e.selectedIndex].value);
break;
case "select-multiple":
for (var nr2 = 0; nr2 < e.options.length; nr2++)
if (e.options[nr2].selected)
obj.addParameter(e.name, e.options[nr2].value);
break;
case "checkbox":
case "radio":
if (e.checked)
obj.addParameter(e.name, e.value);
break;
}
}
}
};
obj.addParameter = function(name, value) {
if (typeof obj.parameters[name] == "undefined")
obj.parameters[name] = value; else
if (typeof obj.parameters[name] != "object")
obj.parameters[name] = [ obj.parameters[name], value ]; else
obj.parameters[name][obj.parameters[name].length] = value;
};
obj.delParameter = function(name) {
delete obj.parameters[name];
};
obj.raiseEvent = function(name) {
var args = [];
for (var i = 1; i < arguments.length; i++)
args.push(arguments[i]);
if (typeof obj["on" + name] == "function")
obj["on" + name].apply(null, args);
if (name == "FatalError")
obj.raiseEvent("Finalization", obj);
}
if (typeof advAJAX._defaultParameters != "undefined")
obj.handleArguments(advAJAX._defaultParameters);
return obj;
}
advAJAX.get = function(args) {
return advAJAX.handleRequest("GET", args);
};
advAJAX.post = function(args) {
return advAJAX.handleRequest("POST", args);
};
advAJAX.head = function(args) {
return advAJAX.handleRequest("HEAD", args);
};
advAJAX.submit = function(form, args) {
if (typeof args == "undefined" || args == null)
return -1;
if (typeof form != "object" || form == null)
return -2;
var request = new advAJAX();
args["form"] = form;
request.handleArguments(args);
return request.run();
};
advAJAX.assign = function(form, args) {
if (typeof args == "undefined" || args == null)
return -1;
if (typeof form != "object" || form == null)
return -2;
if (typeof form["onsubmit"] == "function")
form["_onsubmit"] = form["onsubmit"];
form["advajax_args"] = args;
form["onsubmit"] = function() {
if (typeof this["_onsubmit"] != "undefined" && this["_onsubmit"]() === false)
return false;
if (advAJAX.submit(this, this["advajax_args"]) == false)
return true;
return false;
}
return true;
};
advAJAX.download = function(targetObj, url) {
if (typeof targetObj == "string")
targetObj = document.getElementById(targetObj);
if (!targetObj)
return -1;
advAJAX.get({
url: url,
onSuccess : function(obj) {
targetObj.innerHTML = obj.responseText;
}
});
};
advAJAX.scan = function() {
var obj = document.getElementsByTagName("a");
for (var i = 0; i < obj.length;) {
if (obj[i].getAttribute("rel") == "advancedajax" && obj[i].getAttribute("href") !== null) {
var url = obj[i].getAttribute("href");
var div = document.createElement("div");
div.innerHTML = obj[i].innerHTML;
div.className = obj[i].className;
var parent = obj[i].parentNode;
parent.insertBefore(div, obj[i]);
parent.removeChild(obj[i]);
advAJAX.download(div, url);
} else i++;
}
};
advAJAX.handleRequest = function(requestType, args) {
if (typeof args == "undefined" || args == null)
return -1;
var request = new advAJAX();
window.advajax_obj = request;
request.method = requestType;
request.handleArguments(args);
return request.run();
};
advAJAX._defaultParameters = new Object();
advAJAX.setDefaultParameters = function(args) {
advAJAX._defaultParameters = new Object();
for (a in args)
advAJAX._defaultParameters[a] = args[a];
};
advAJAX._groupData = new Object();
function dvs(id) { if(document.getElementById(id)) document.getElementById(id).style.display='block'; }
function dvh(id) { if(document.getElementById(id)) document.getElementById(id).style.display='none'; }
function dget(id) { if(document.getElementById(id)) return document.getElementById(id); }
function dvl(id,l) { if(!dget(id)) return; dvs(dget(id)); dget(id).innerHTML = l; }
function getPageSize() {
var scrollX,scrollY,windowX,windowY,pageX,pageY;
if (window.innerHeight && window.scrollMaxY) {
scrollX = parent.document.body.scrollWidth;
scrollY = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
scrollX = parent.document.body.scrollWidth;
scrollY = parent.document.body.scrollHeight;
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
scrollX = parent.document.body.offsetWidth;
scrollY = parent.document.body.offsetHeight;
}
if (self.innerHeight) { // all except Explorer
windowX = self.innerWidth;
windowY = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
windowX = parent.document.documentElement.clientWidth;
windowY = parent.document.documentElement.clientHeight;
} else if (document.body) { // other Explorers
windowX = parent.document.body.clientWidth;
windowY = parent.document.body.clientHeight;
}
pageY = (scrollY < windowY) ? windowY : scrollY; // for small pages with total height less then height of the viewport
pageX = (scrollX < windowX) ? windowX : scrollX; // for small pages with total width less then width of the viewport
return {pageWidth:pageX,pageHeight:pageY,winWidth:windowX,winHeight:windowY};
}
function sbm(id) {
if(!dget(id)) return;
advAJAX.submit(dget(id), {
onSuccess : function(obj) { eval(obj.responseText); }
});
}
function sbmnoe(id,idv) {
if(!dget(id)) return;
advAJAX.submit(dget(id), {
onSuccess : function(obj) { document.getElementById(idv).innerHTML = obj.responseText; }
});
}
function assgn(id) {
if(!dget(id)) return;
advAJAX.assign(dget(id), {
onSuccess : function(obj) { document.getElementById('JSDIV').innerHTML = eval(obj.responseText); }
});
}
function assgn2(id,idv) {
if(!dget(id)) return;
advAJAX.assign(dget(id), {
onSuccess : function(obj) { document.getElementById(idv).innerHTML = obj.responseText; }
});
}
function form_rejestruj_success() {
document.location='rejestracjaKoniec.html';
/*dvs('rejestracja');
advAJAX.get({
url: "uzytkownik=/rejestruj/zakoncz",
onSuccess : function(obj) { document.getElementById('rejestracja').innerHTML = obj.responseText; }
}
);*/
}
function form_rejestruj() {
dvs('rejestracja');
advAJAX.get({
url: "uzytkownik=/rejestruj",
onSuccess : function(obj) { document.getElementById('rejestracja').innerHTML = obj.responseText; }
}
);
}
function form_rejestruj_anuluj () {
//dget('rejestracja').innerHTML = 'Trwa ładowanie...';
//dvh('rejestracja');
document.location='index.php';
}
function form_login(id) {
advAJAX.get({
url: "uzytkownik=/formularzLogowanie",
onSuccess : function(obj) { dget(id).innerHTML = obj.responseText; }
}
);
}
function zdjecie_dodaj(id) {
advAJAX.get({
url: "zdjecie=/dodaj",
onSuccess : function(obj) { dget(id).innerHTML = obj.responseText; }
}
);
}
function zdjecie_dodaj_reload() {
document.location='zdjecie=/dodaj';
}
function obiekt_dodajzdjecie(obiekt,id,pp) {
if(pp == undefined) pp = '';
advAJAX.get({
url: "obiekt=/zdjecie/dodaj=" + obiekt + pp,
onSuccess : function(obj) { dget(id).innerHTML = obj.responseText; }
}
);
}
var imgs = [];
var users = [];
var images_index = 0;
function moveNext() {
images_index++;
if(images_index >= imgs.length) images_index = 0;
document.getElementById('slideimage').src = imgs[images_index].src;
document.getElementById('images_capt').innerHTML = 'Zdjęcie ' + (images_index+1) + ' z ' + (imgs.length);
if(users[images_index][1] == 0) {
document.getElementById('dodane').innerHTML = '';
} else
document.getElementById('dodane').innerHTML = 'Dodane przez: ' + users[images_index][0] + '';
}
function movePrev() {
images_index--;
if(images_index < 0) images_index = imgs.length-1;
document.getElementById('slideimage').src = imgs[images_index].src;
document.getElementById('images_capt').innerHTML = 'Zdjęcie ' + (images_index+1) + ' z ' + (imgs.length);
if(users[images_index][1] == 0)
document.getElementById('dodane').innerHTML = '';
else
document.getElementById('dodane').innerHTML = 'Dodane przez: ' + users[images_index][0] + '';
}
function obiekt(id) {
images_index = 0;
if(document.getElementById('obiektWizytowka'))
d = document.getElementById('obiektWizytowka');
else d = parent.document.getElementById('obiektWizytowka');
advAJAX.get({url: "" + id, onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function obiekt_dodaj(pp) {
d = document.getElementById('obiektWizytowka');
if(pp == undefined) pp = '';
advAJAX.get({url: "obiekt=/nowy" + pp, onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function obiekt_dodaj_zakoncz() {
obiekt(0);
}
function obiekt_nowy_mapa() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_obiekt"));
map.setCenter(new GLatLng(52.536273956298828125, 19.00634765625),6);
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.addMapType(G_PHYSICAL_MAP);
var point = map.getCenter();
var marker_1 = new GMarker(point, {draggable: true});
marker_1.enableDragging();
map.addOverlay(marker_1);
GEvent.addListener(marker_1, "dragstart", function() {
});
GEvent.addListener(marker_1, "dragend", function() {
l = marker_1.getLatLng();
dget('geo_x').value = l.lat();
dget('geo_y').value = l.lng();
});
GEvent.addListener(map, "zoomend", function() {
dget('geo_z').value = map.getZoom();
});
GEvent.addListener(map, "moveend", function() {
marker_1.setPoint(map.getCenter());
l = marker_1.getLatLng();
dget('geo_x').value = l.lat();
dget('geo_y').value = l.lng();
});
}
}
function bladSubmit() {
sbmnoe('blad_frm','obiektWizytowka');
}
function zglosBlad(skad,id,iddiv) {
d = document.getElementById(iddiv);
if(!d) return;
advAJAX.get({url: "zglosblad,"+skad+","+id+".html", onSuccess : function(obj) { d.innerHTML = obj.responseText;
}});
}
function mobiSelect() {
d = document.getElementById('obiektWizytowka');
advAJAX.get({url: "mobileSelect.php", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function GPSD() {
d = document.getElementById('obiektWizytowka');
advAJAX.get({url: "GPSPobierz.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarz_nowy() {
if(document.getElementById('obiektWizytowka'))
d = document.getElementById('obiektWizytowka');
advAJAX.get({url: "0,komentarz,nowy.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarze(watek) {
if(document.getElementById('komentarzePrzewodnik'))
d = document.getElementById('komentarzePrzewodnik');
advAJAX.get({url: "" + parseInt(watek) + ",komentarze.html", onSuccess : function(obj) {
d.innerHTML = obj.responseText;
}});
}
function komentarz_czytaj(id,ukryj) {
if(document.getElementById('komentarz_tresc' + id))
d = document.getElementById('komentarz_tresc' + id);
d.innerHTML += '
';
u = '';
if(ukryj == true) u =',ukryj';
advAJAX.get({url: "komentarz" + parseInt(id) + u + ".html", onSuccess : function(obj) { d.innerHTML = obj.responseText;
//komentarz_drzewko(id);
}});
}
function komentarz_odpowiedz(id) {
if(document.getElementById('komentarz_odpowiedz' + id))
d = document.getElementById('komentarz_odpowiedz' + id);
d.innerHTML = '
';
d.style.display='block';
advAJAX.get({url: "komentarz" + parseInt(id) + ",odpowiedz.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarz_odpowiedz_anuluj(id) {
if(document.getElementById('komentarz_odpowiedz' + id))
d = document.getElementById('komentarz_odpowiedz' + id);
d.style.display='none';
d.style.innerHTML='';
}
function komentarz_drzewko(id) {
if(document.getElementById('komentarz_sub' + id))
d = document.getElementById('komentarz_sub' + id);
plusminus = dget('komentarz_plusminus');
if(!plusminus) return;
if(plusminus.src.indexOf('plus.gif') > 0)
{
if(plusminus) plusminus.src = 'images/minus.gif';
d.innerHTML = '
';
advAJAX.get({url: "" + parseInt(id) + ",komentarz.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
} else {
d.innerHTML = '';
if(plusminus) plusminus.src = 'images/plus.gif';
}
}
function komentarzobiekt_nowy() {
if(document.getElementById('obiektWizytowka'))
d = document.getElementById('obiektWizytowka');
advAJAX.get({url: "0,komentarzobiekt,nowy.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarzeobiekt(watek) {
if(document.getElementById('komentarzeobiekt'))
d = document.getElementById('komentarzeobiekt');
else d = parent.document.getElementById('komentarzeobiekt');
advAJAX.get({url: "" + parseInt(watek) + ",komentarzeobiekt.html", onSuccess : function(obj) {
d.innerHTML = obj.responseText;
}});
}
function komentarzobiekt_czytaj(id,ukryj) {
if(document.getElementById('komentarzobiekt_tresc' + id))
d = document.getElementById('komentarzobiekt_tresc' + id);
d.innerHTML += '
';
u = '';
if(ukryj == true) u =',ukryj';
advAJAX.get({url: "komentarzobiekt" + parseInt(id) + u + ".html", onSuccess : function(obj) { d.innerHTML = obj.responseText;
//komentarz_drzewko(id);
}});
}
function komentarzobiekt_odpowiedz(id) {
if(document.getElementById('komentarzobiekt_odpowiedz' + id))
d = document.getElementById('komentarzobiekt_odpowiedz' + id);
d.innerHTML = '
';
d.style.display='block';
advAJAX.get({url: "komentarzobiekt" + parseInt(id) + ",odpowiedz.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarzobiekt_odpowiedz_anuluj(id) {
if(document.getElementById('komentarzobiekt_odpowiedz' + id))
d = document.getElementById('komentarzobiekt_odpowiedz' + id);
d.style.display='none';
d.style.innerHTML='';
}
function komentarzobiekt_drzewko(id) {
if(document.getElementById('komentarzobiekt_sub' + id))
d = document.getElementById('komentarzobiekt_sub' + id);
plusminus = dget('komentarzobiekt_plusminus');
if(!plusminus) return;
if(plusminus.src.indexOf('plus.gif') > 0)
{
if(plusminus) plusminus.src = 'images/minus.gif';
d.innerHTML = '
';
advAJAX.get({url: "" + parseInt(id) + ",komentarzobiekt.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
} else {
d.innerHTML = '';
if(plusminus) plusminus.src = 'images/plus.gif';
}
}
function profil_edytuj() {
document.location='uzytkownik=/profil=/edytuj'
}
function profil_zdjecie() {
document.location='uzytkownik=/profil=/zdjecie'
}
function profil_edytuj_anuluj() {
document.location='uzytkownik=/profil'
}
function profil_zapisz() {
advAJAX.submit(document.getElementById("form_edit"), {
onSuccess : function(obj) { document.getElementById('JSDIV').innerHTML = eval(obj.responseText); }
});
}
function profil_zapisano() {
document.location='uzytkownik=/profil=/zapisano';
}
function setCookie(c_name,value,expiredays)
{
var exdate=new Date();
exdate.setDate(exdate.getDate()+expiredays);
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
function getCookie(c_name)
{
if (document.cookie.length>0)
{
c_start=document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return "";
}
var xMousePos = 0;
var yMousePos = 0;
var xMousePosMax = 0;
var yMousePosMax = 0;
var xBodyWidth = 0;
var yBodyHeight = 0;
function captureMousePosition(e) {
if (document.layers) {
xMousePos = e.pageX;
yMousePos = e.pageY;
xMousePosMax = window.innerWidth+window.pageXOffset;
yMousePosMax = window.innerHeight+window.pageYOffset;
xBodyWidth = window.innerWidth;
yBodyHeight = window.innerHeight;
} else if (document.all) {
xMousePos = window.event.x+document.body.scrollLeft;
yMousePos = window.event.y+document.body.scrollTop;
xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
yMousePosMax = document.body.clientHeight+document.body.scrollTop;
xBodyWidth = document.body.clientWidth;
yBodyWidth = document.body.clientHeight;
} else if (document.getElementById) {
xMousePos = e.pageX;
yMousePos = e.pageY;
xMousePosMax = window.innerWidth+window.pageXOffset;
yMousePosMax = window.innerHeight+window.pageYOffset;
xBodyWidth = window.innerWidth;
yBodyHeight = window.innerHeight;
}
}
document.onmousemove = captureMousePosition;
var images_rel_can_hide = false;
function imagesRel() {
b = '';
images = document.getElementsByTagName("img");
srcc = '';
for(i=0; i
';
d.style.visibility='visible';
d.style.left = xMousePos + 'px';
d.style.top = yMousePos + 'px';
if(!d) return;
d.innerHTML = '

Skarpa w Gnojnie - zobacz opis';
pano_obiekty[1] = '
Stadnina koni - zobacz opis';
pano_obiekty[0] = '
Cerkiew w. Demetriusza Mczennika - zobacz opis';
pano_obiekty[3] = '
Roskosz - pnoklasycystyczny paac - zobacz opis';
pano_obiekty[4] = '
Biaa Podlaska - rynek - zobacz opis';
pano_obiekty[5] = '
Biaa Podlaska - Wiea bramna - zobacz opis';
var objPanoramaWybierz, objPanorama;
function panorama_load(id,path) {
var so = new SWFObject('http://przewodnik.bialapodlaska.pl/panoramy/'+path + 'pw.swf', "panorama_flash", "500", "400", "9.0.28", "#ffffff");
so.addParam("quality", "high");
so.addParam("salign", "lt");
so.addParam("allowScriptAccess", "always");
so.addParam("allowFullScreen", "true");
so.write(id);
}
function panoramy() {
d_over = dget('layeroverpage');
sizes = getPageSize();
d_over.style.height=sizes.pageHeight + 'px';
d_over.style.width=sizes.pageWidth + 'px';
d_over.style.display='block';
dget('ladowanie_galerii').innerHTML = 'Trwa adowanie panoram...';
dget('ladowanie_galerii').style.top = '150px';
dget('ladowanie_galerii').style.left = (sizes.pageWidth/2-200) + 'px';
dget('ladowanie_galerii').style.display='block';
var objBody = (!document.body) ? document.getElementsByTagName('body').item(0):document.body;
objPanoramaWybierz = document.createElement('div');
objPanoramaWybierz.setAttribute('id','panoramaWybierz');
objPanoramaWybierz.className = 'panoramy_wybierz';
objBody.appendChild(objPanoramaWybierz);
objPanorama = document.createElement('div');
objPanorama.setAttribute('id','panorama');
objPanorama.className = 'panorama';
objBody.appendChild(objPanorama);
dget('panorama').style.top = '230px';
dget('panorama').style.left = (sizes.pageWidth/2-250)+'px';
dget('panorama').innerHTML = '| ' + pano_obiekty[0] + ' | ![]() |
| ' + pano_obiekty[nr] + ' | ![]() |