/*
* 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 _dvhs(id) { if(!document.getElementById(id)) return; if(document.getElementById(id).style.display=='block') document.getElementById(id).style.display='none'; else document.getElementById(id).style.display='block'; }
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 setHTML(id,html) {
if(!dget(id)) return; dget(id).innerHTML = html;
}
function updateHTML(id,html) {
if(!dget(id)) return; dget(id).innerHTML += html;
}
function sbm(id) {
if(!dget(id)) return false;
advAJAX.submit(dget(id), {
onSuccess : function(obj) { eval(obj.responseText); return false; }
});
return false;
}
function sbmnoe(id,idv) {
if(!dget(id)) return false;
advAJAX.submit(dget(id), {
onSuccess : function(obj) { document.getElementById(idv).innerHTML = obj.responseText; }
});
return false;
}
function assgn(id) {
if(!dget(id)) return;
advAJAX.assign(dget(id), {
onSuccess : function(obj) { 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 register_moderator() {
//dvs('loader');
//dvh('login');
dvh('p1');
dvh('p2');
dvh('imie');
dvh('nazwisko');
dvh('miejscowosc');
dvh('wojewodztwo');
advAJAX.submit(document.getElementById("form_register"), {
onSuccess : function(obj) { eval(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 zdep(przewodnik) {
advAJAX.get({
url: '/zdjecie=/dodaj,przewodnik=/' + parseInt(przewodnik),
onSuccess : function(obj) { dget('contentAdditional').innerHTML = obj.responseText; objShowDIV(); }
}
);
}
function zdjecie_dodaj_main() {
document.location='/zdjecie=/dodaj'
}
function zdjecie_dodaj_reload() {
document.location='/zdjecie=/dodaj';
}
function obiekt_dodajzdjecie(obiekt,id,pp, mode, przewodnik) {
if(pp == undefined) pp = '';
mm = '';
if(mode == 'popup') mm = '/popup';
if(przewodnik > 0) mm = '/przewodnik=' + parseInt(przewodnik);
advAJAX.get({
url: "/obiekt=/zdjecie/dodaj=" + obiekt + pp + mm ,
onSuccess : function(obj) { dget(id).innerHTML = obj.responseText; }
}
);
}
var imgs = [];
var users = [];
var license_info = [];
var images_index = 0;
function moveNext(panel) {
if(document.getElementById('slideimage'+images_index)) document.getElementById('slideimage'+images_index).style.display='none';
images_index++;
if(images_index >= imgs.length) images_index = 0;
if(document.getElementById('slideimage'+images_index)) document.getElementById('slideimage'+images_index).style.display='block';
document.getElementById('images_capt').innerHTML = 'Zdjęcie ' + (images_index+1) + ' z ' + (imgs.length);
if(users[images_index][1] == 0) {
document.getElementById('dodane').innerHTML = '';
} else
{
if(panel)
document.getElementById('dodane').innerHTML = '
';
else
document.getElementById('dodane').innerHTML = ' Dodane przez: ' + users[images_index][0] + '
';
}
if(license_info[images_index] != '') {
document.getElementById('dodane').innerHTML+= license_info[images_index];
}
}
function movePrev(panel) {
if(document.getElementById('slideimage'+images_index)) document.getElementById('slideimage'+images_index).style.display='none';
images_index--;
if(images_index < 0) images_index = imgs.length-1;
if(document.getElementById('slideimage'+images_index)) document.getElementById('slideimage'+images_index).style.display='block';
document.getElementById('images_capt').innerHTML = 'Zdjęcie ' + (images_index+1) + ' z ' + (imgs.length);
if(users[images_index][1] == 0)
document.getElementById('dodane').innerHTML = '';
else
{
if(panel)
document.getElementById('dodane').innerHTML = '';
else
document.getElementById('dodane').innerHTML = ' Dodane przez: ' + users[images_index][0] + '
';
}
if(license_info[images_index] != '') {
document.getElementById('dodane').innerHTML+= license_info[images_index];
}
}
var elements;
function votes_stars() {
elements = document.getElementsByTagName("img");
for(i=0; i
';
u = '';
if(ukryj == true) u =',ukryj';
advAJAX.get({url: "/komentarz" + parseInt(id) + ',' + parseInt(przewodnik) + u + ".html", onSuccess : function(obj) { d.innerHTML = obj.responseText;
//komentarz_drzewko(id);
}});
}
function komentarz_odpowiedz(id,przewodnik) {
if(document.getElementById('komentarz_odpowiedz' + id))
d = document.getElementById('komentarz_odpowiedz' + id);
d.innerHTML = '
';
d.style.display='block';
advAJAX.get({url: "/komentarz" + parseInt(id) + "," + parseInt(przewodnik) + ",odpowiedz.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarz_odpowiedz_anuluj(id,przewodnik) {
if(document.getElementById('komentarz_odpowiedz' + id))
d = document.getElementById('komentarz_odpowiedz' + id);
d.style.display='none';
d.style.innerHTML='';
}
function komentarz_drzewko(id,przewodnik) {
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) + "," + parseInt(przewodnik) + ",komentarz.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
} else {
d.innerHTML = '';
if(plusminus) plusminus.src = 'images/plus.gif';
}
}
function komentarzobiekt_nowy(w,obiekt) {
if(document.getElementById('obiektWizytowka'))
d = document.getElementById('obiektWizytowka');
advAJAX.get({url: "/0,"+parseInt(obiekt)+",komentarzobiekt,nowy.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarzeobiekt(obiekt,watek) {
if(document.getElementById('komentarzeobiekt'))
d = document.getElementById('komentarzeobiekt');
else d = parent.document.getElementById('komentarzeobiekt');
advAJAX.get({url: "/" + parseInt(obiekt) + ",0,komentarzeobiekt.html", onSuccess : function(obj) {
d.innerHTML = obj.responseText;
}});
}
function komentarzobiekt_czytaj(id,obiekt,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 + "," + parseInt(obiekt) + ".html", onSuccess : function(obj) { d.innerHTML = obj.responseText;
//komentarz_drzewko(id);
}});
}
function komentarzobiekt_odpowiedz(id,obiekt) {
if(document.getElementById('komentarzobiekt_odpowiedz' + id))
d = document.getElementById('komentarzobiekt_odpowiedz' + id);
d.innerHTML = '
';
d.style.display='block';
advAJAX.get({url: "/komentarzobiekt" + parseInt(id) + "," + parseInt(obiekt) + ",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,obiekt) {
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) + "," + parseInt(obiekt) + ",komentarzobiekt.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
} else {
d.innerHTML = '';
if(plusminus) plusminus.src = 'images/plus.gif';
}
}
function komentarztresc_nowy(w,tresc) {
if(document.getElementById('tresc_komentarze'))
d = document.getElementById('tresc_komentarze');
d.style.display='block';
advAJAX.get({url: "/" + w + "," + tresc + ",komentarztresc,nowy.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarzetresc(tresc,watek) {
if(document.getElementById('tresc_komentarze'))
d = document.getElementById('tresc_komentarze');
else d = parent.document.getElementById('tresc_komentarze');
d.style.display='block';
advAJAX.get({url: "/" + parseInt(tresc) + "," + parseInt(watek) + ",komentarzetresc.html", onSuccess : function(obj) {
d.innerHTML = obj.responseText;
}});
}
function komentarztresc_czytaj(id,tresc,ukryj) {
if(document.getElementById('komentarztresc_tresc' + id))
d = document.getElementById('komentarztresc_tresc' + id);
d.innerHTML += '
';
u = '';
if(ukryj == true) u =',ukryj';
advAJAX.get({url: "/komentarztresc" + parseInt(id) + u + "," + parseInt(tresc) + ".html", onSuccess : function(obj) { d.innerHTML = obj.responseText;
//komentarz_drzewko(id);
}});
}
function komentarztresc_czytaj1(id,tresc,ukryj) {
if(document.getElementById('komentarztresc_tresc' + id))
d = document.getElementById('komentarztresc_tresc' + id);
d.innerHTML += '
';
u = '';
if(ukryj == true) u =',ukryj';
advAJAX.get({url: "/komentarztresc" + parseInt(id) + u + "," + parseInt(tresc) + ".html", onSuccess : function(obj) { d.innerHTML = obj.responseText;
komentarztresc_drzewko(id,tresc);
}});
}
function komentarztresc_odpowiedz(id,tresc) {
if(document.getElementById('komentarztresc_odpowiedz' + id))
d = document.getElementById('komentarztresc_odpowiedz' + id);
d.innerHTML = '
';
d.style.display='block';
advAJAX.get({url: "/komentarztresc" + parseInt(id) + "," + parseInt(tresc) + ",odpowiedz.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; }});
}
function komentarztresc_odpowiedz_anuluj(id,tresc) {
if(document.getElementById('komentarztresc_odpowiedz' + id))
d = document.getElementById('komentarztresc_odpowiedz' + id);
if(id == 0) komentarzetresc(tresc,0);
else {
d.style.display='none';
d.style.innerHTML='';
}
}
function komentarztresc_drzewko(id,tresc) {
if(document.getElementById('komentarztresc_sub' + id))
d = document.getElementById('komentarztresc_sub' + id);
plusminus = dget('komentarztresc_plusminus' + id);
if(!plusminus) return;
if(plusminus.src.indexOf('plus.gif') > 0)
{
if(plusminus) plusminus.src = 'images/minus.gif';
d.innerHTML = '
';
advAJAX.get({url: "/" + parseInt(id) + "," + parseInt(tresc) + ",komentarztresc.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) { eval(obj.responseText); }
});
}
function profil_zapisz_lokalizacje() {
advAJAX.submit(document.getElementById("form_add_localization"), {
onSuccess : function(obj) { eval(obj.responseText); }
});
}
function profil_zapisano() {
document.location='/uzytkownik=/profil=/zapisano';
}
function kontakt_wyslij() {
advAJAX.submit(document.getElementById("form_kontakt"), {
onSuccess : function(obj) { eval(obj.responseText); }
});
}
function profil_subskybcja() {
advAJAX.submit(document.getElementById("form_subskrybcja"), {
onSuccess : function(obj) { eval(obj.responseText); }
});
}
function profil_subskybcja_usun() {
advAJAX.submit(document.getElementById("form_subskrybcja_usun"), {
onSuccess : function(obj) { eval(obj.responseText); }
});
}
function profil_subskybcja_usun_user(id) {
advAJAX.submit(document.getElementById("form_subskrybcja_usun"+id), {
onSuccess : function(obj) { eval(obj.responseText); }
});
}
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");
} catch (e) {
el = document.createElement("div");
el.setAttribute("id", "img_preview");
el.setAttribute("style", "width: 32px; height: 32px; background: white; position: absolute;visibiliy: hidden; border: 1px solid black; padding: 4px;");
}
}
document.body.appendChild(el);
d = dget('img_preview');
d.innerHTML = '
';
d.style.visibility='visible';
d.style.left = xMousePos + 'px';
d.style.top = yMousePos + 'px';
if(!d) return;
d.innerHTML = '
' + imm;
}
function resize_img_preview(w,h) {
d = dget('img_preview');
if(!d) return;
d.style.width = w + 'px';
d.style.height = (h+95) + 'px';
}
function hide_img_preview() {
d = dget('img_preview');
if(!d) return;
d.innerHTML = '';
d.style.visibility='hidden';
d.style.width = '32px';
d.style.height = '32px';
}
/*function slidestart(id,id2,id3) {
id3 = parseInt(id3);
id = parseInt(id);
d = dget('g');
if(id3 > 0)
advAJAX.get({url: "/slideshow,obiekt,"+id3+","+id2+".html", onSuccess : function(obj) { d.innerHTML = obj.responseText; slideshow_start(id,id2); }});
else
advAJAX.get({url: "/slideshow.html", onSuccess : function(obj) { d.innerHTML = obj.responseText; slideshow_start(id,id2); }});
}*/
function slidestart(przewodnik) {
d = dget('g');
/*advAJAX.get({url: "/slideshow,obiekt,"+id3+","+id2+".html", onSuccess : function(obj) { d.innerHTML = obj.responseText; slideshow_start(id,id2); }});
else*/
advAJAX.get({url: "/slideshow-"+parseInt(przewodnik) + ".html", onSuccess : function(obj) { d.innerHTML = obj.responseText;
$("div#przewodnik_galeria a").fancybox({'overlayShow' : true,'zoomSpeedIn' : 600,'zoomSpeedOut' : 500,'easingIn' : 'easeOutBack','easingOut' : 'easeInBack'});
}});
}
function slideshow_start(id,id2) {
id = parseInt(id);
id2 = parseInt(id2);
if(!dget('img' + id + '_' + id2)) return;
Lightbox.start(document.getElementById('img' + id + '_' + id2))
}
function obiekt_galeria() {
if(images_index < 0 || images_index > imgs.length-1) return;
slidestart(imgs[images_index].id,images_index,imgs[images_index].id)
}
var sTimer = null;
var sv = '';
function search(si,zdj) {
if(sTimer != null) clearTimeout(sTimer);
s = dget(si);
sv = s.value;
sf = document.getElementById('sef');
if(!sf) return;
dvh('sef');
sf.innerHTML = '';
sTimer = setTimeout("searching('" + si + "', " + zdj + ")", 700);
}
function searching(s,zdj) {
zdj = (zdj) ? 1:0;
s = dget(s);
var sef = dget('sef');
if(!sef || !s) return;
sef.innerHTML = 'Sprawdzam czy istniejÄ… podobne obiekty...';
dvs('sef');
advAJAX.get({url: "/sk.php?s=" + s.value + "&z=" + parseInt(zdj), onSuccess : function(obj) {
if(obj.responseText != '') {
sef.innerHTML = obj.responseText;
} else {
sef.innerHTML = '';
dvh('sef');
}
}});
}
function dvhs(id) {
setTimeout("dvh('" + id + "')", 100);
}
function self() {
document.location.reload();
}
var mailpanel_timer = null;
function mail_show() {
if(mailpanel_timer) clearTimeout(mailpanel_timer);
dvs('masginboxpanel');
}
function mail_hide() {
if(mailpanel_timer) clearTimeout(mailpanel_timer);
mailpanel_timer = setTimeout("dvh('masginboxpanel')", 200);
}
function input_digits(evt) {
var keyCode = evt.which ? evt.which : evt.keyCode;
return ('.'.keyCode == keyCode || (keyCode >= '0'.charCodeAt() && keyCode <= '9'.charCodeAt()) || keyCode == 39 || keyCode == 37 || keyCode == 9 || keyCode == 46) ||
keyCode == 8;
}
// getPageSize()
// Returns array with page width, height and window width, height
// Core code from - quirksmode.org
// Edit for Firefox by pHaez
// Script imported from lightbox
//
function getPageSize() {
var scrollX,scrollY,windowX,windowY,pageX,pageY;
if (window.innerHeight && window.scrollMaxY) {
scrollX = document.body.scrollWidth;
scrollY = window.innerHeight + window.scrollMaxY;
} else if (document.body.scrollHeight > document.body.offsetHeight){
scrollX = document.body.scrollWidth;
scrollY = document.body.scrollHeight;
} else {
scrollX = document.body.offsetWidth;
scrollY = document.body.offsetHeight;
}
if (self.innerHeight) {
windowX = self.innerWidth;
windowY = self.innerHeight;
} else if (document.documentElement && document.documentElement.clientHeight) {
windowX = document.documentElement.clientWidth;
windowY = document.documentElement.clientHeight;
} else if (document.body) {
windowX = document.body.clientWidth;
windowY = document.body.clientHeight;
}
pageY = (scrollY < windowY) ? windowY : scrollY;
pageX = (scrollX < windowX) ? windowX : scrollX;
return {pageWidth:pageX,pageHeight:pageY,winWidth:windowX,winHeight:windowY};
}
function getPageScroll() {
var x,y;
if (self.pageYOffset) {
x = self.pageXOffset;
y = self.pageYOffset;
} else if (document.documentElement && document.documentElement.scrollTop){ // Explorer 6 Strict
x = document.documentElement.scrollLeft;
y = document.documentElement.scrollTop;
} else if (document.body) {// all other Explorers
x = document.body.scrollLeft;
y = document.body.scrollTop;
}
return {x:x,y:y};
}
function divOverPage() {
var documentBody = document.getElementsByTagName('body').item(0);
if(!dget('div_over_page')) {
var divover = document.createElement('div');
divover.setAttribute('id','div_over_page');
documentBody.appendChild(divover);
}
if(!dget('div_over_page')) return;
var pageSize = getPageSize();
dget('div_over_page').style.display='block';
dget('div_over_page').style.height=pageSize.pageHeight + 'px';
dget('div_over_page').style.width=pageSize.pageWidth + 'px';
return true;
}
function sendLink(obiekt,tresc) {
if(!divOverPage()) return false;
over = dget('div_over_page');
if(!over) return;
if(!dget('div_send_link')) {
var documentBody = document.getElementsByTagName('body').item(0);
var divlink = document.createElement('div');
divlink.setAttribute('id','send_link_container');
documentBody.appendChild(divlink);
}
if(!dget('send_link_container')) return;
dget('send_link_container').innerHTML = 'Czekaj...';
var height = 300;
var pageSize= getPageSize();
dget('send_link_container').style.display='block';
dget('send_link_container').style.width='500px';
var pageScroll = getPageScroll();
dget('send_link_container').style.top= (pageScroll.y+10) + 'px';
dget('send_link_container').style.left= (pageSize.pageWidth/2-500/2) + 'px';
if(tresc)
advAJAX.get({url: "/sendlink_tresc.php?tr=" + obiekt, onSuccess : function(obj) { dget('send_link_container').innerHTML = obj.responseText; assgn('form_sendlink'); }});
else
advAJAX.get({url: "/sendlink.php?ob=" + obiekt, onSuccess : function(obj) { dget('send_link_container').innerHTML = obj.responseText; assgn('form_sendlink'); }});
}
function closesendLink() {
if(dget('div_over_page')) dget('div_over_page').style.display='none';
if(dget('send_link_container')) dget('send_link_container').style.display='none';
}
function showLink(obiekt) {
if(!divOverPage()) return false;
var pageScroll = getPageScroll();
var pageSize= getPageSize();
over = dget('div_over_page');
if(!over) return;
if(!dget('div_shoe_link')) {
var documentBody = document.getElementsByTagName('body').item(0);
var divlink = document.createElement('div');
divlink.setAttribute('id','show_link_container');
documentBody.appendChild(divlink);
}
if(!dget('show_link_container')) return;
dget('show_link_container').style.position = 'absolute';
dget('show_link_container').innerHTML = 'Wklej link do e-maila lub komunikatora:
';
var height = 80;
dget('show_link_container').style.display='block';
dget('show_link_container').style.width='500px';
dget('show_link_container').style.height='80px';
dget('show_link_container').style.top= (pageScroll.y+10) + 'px';
dget('show_link_container').style.left= (pageSize.pageWidth/2-500/2) + 'px';
dget('send_link_txt').focus();
dget('send_link_txt').select();
}
function closeshowLink() {
if(dget('div_over_page')) dget('div_over_page').style.display='none';
if(dget('show_link_container')) dget('show_link_container').style.display='none';
}
function form_disable(form) {
if(!form) return;
var elements = form.elements;
for(i=0;i bounds.getNorthEast().lng())) {
if((marker.getLatLng().lng() + degWidth > bounds.getNorthEast().lng()))
var pix = {x: pixPosition.x, y: (pixPosition.y + map.getSize().height/2 ) - height_}
else
var pix = {x: pixPosition_mapcenter.x, y: (pixPosition.y + map.getSize().height/2 ) - height_}
return map.fromDivPixelToLatLng(pix);
}
return map.getCenter();
}
function update_login_info() {
if(!dget('login_info')) return;
advAJAX.get({url: '/updatelogininfo', onSuccess : function(obj) { dget('login_info').innerHTML = obj.responseText; }});
}
function obiekt_sredniaocena(obiekt) {
advAJAX.get({url: 'updateobjectavg-'+obiekt, onSuccess : function(obj) { dget('obiekt_srednia_ocen').innerHTML = obj.responseText; }});
}
function obiekt_glosuj(str,vote) {
obiekt_sredniaocena(str);
update_login_info();
advAJAX.get({url: '/obiekt-glosuj-'+str+'.html&vote='+vote, onSuccess : function(obj) { dget('votes').innerHTML = obj.responseText; }});
}
function relacja_glosuj(str,vote) {
update_login_info();
advAJAX.get({url: '/relacja-'+str+'.html&vote='+vote, onSuccess : function(obj) { dget('votes').innerHTML = obj.responseText; }});
}
function twoje_relacje() {
document.location='twoje-relacje';
}
function relacja_edytor() {
document.location=parent.document.location;
}
function cudow() {
document.location=parent.document.location;
}
function cudow_prop(dane_id,prop) {
advAJAX.post({
url: '/form=/submit',
grupa : dane_id,
obiekt : prop,
vp : 'EB2E8F800DAAB9436C694099954C06F9',
fn : 'cudow',
onSuccess : function(obj) { eval(obj.responseText); }
});
}
var tLabel = '';
function historia_zmian(obiekt) {
tLabel = dget('obiekt_historia').innerHTML;
dget('obiekt_historia').innerHTML = ' Ładowanie...';
advAJAX.get({url: 'obiekt-historia-'+obiekt+'.html', onSuccess : function(obj) { dget('obiekt_historia').innerHTML = obj.responseText; }});
}
function historia_zmian_ukryj() {
dget('obiekt_historia').innerHTML = tLabel;
}
var map_uzupelnij,map_uzupelnij_set;
var ikonap;
var uzu_o_geo_x,uzu_o_geo_y,uzu_o_id;
function uzupelnij_map() {
if (GBrowserIsCompatible()) {
map_uzupelnij = new GMap2(document.getElementById("map_dodaj"));
map_uzupelnij.setCenter(new GLatLng(uzu_o_geo_x, uzu_o_geo_y),15);
map_uzupelnij.addControl(new GSmallMapControl());
map_uzupelnij.addControl(new GMapTypeControl());
var marker_1 = new GMarker(map_uzupelnij.getCenter());
map_uzupelnij.addOverlay(marker_1);
map_uzupelnij_set = new GMap2(document.getElementById("map_dodaj_set"));
map_uzupelnij_set.setCenter(new GLatLng(uzu_o_geo_x,uzu_o_geo_y),15);
map_uzupelnij_set.addControl(new GSmallMapControl());
map_uzupelnij_set.addControl(new GMapTypeControl());
var marker_2 = new GMarker(map_uzupelnij_set.getCenter(), {draggable: true, icon: ikonap});
map_uzupelnij_set.addOverlay(marker_2);
marker_2.enableDragging();
GEvent.addListener(marker_2, "dragend", function() {
l = marker_2.getLatLng();
dget('new_geo_x').value = l.lat();
dget('new_geo_y').value = l.lng();
dget('new_geo_z').value = map_uzupelnij_set.getZoom();
});
}
}
var trr = 10;
function uzupelnij() {
if(document.location.toString().indexOf('#')!=-1)
document.location=document.location.toString().substr(0,document.location.toString().indexOf('#'))+'#uzupelnijform';
else
document.location=document.location.toString() + '#uzupelnijform';
dget('uzu').innerHTML = '
';
advAJAX.get({
url: '/uzupelnij-'+uzu_o_id+'-'+trr,
onSuccess : function(obj) { dvs('uzu'); dget('uzu').innerHTML=obj.responseText; if(trr == 10) window.setTimeout("uzupelnij_map()",100); }
}
);
dvh('uzupelnij');
}
/*function $(id) {
return document.getElementById(id);
}*/
function load_search_map() {
if (GBrowserIsCompatible() && document.getElementById("map_search__query")) {
map = new GMap2(document.getElementById("map_search__query"));
map.setCenter(new GLatLng(50.03263821492264, 19.919800758361816),10);
map.addControl(new GSmallZoomControl());
GEvent.addListener(map, "moveend", function() {
var b = map.getBounds();
document.getElementById('bounds').value = b;
window.status = b;
});
var b = map.getBounds();
document.getElementById('bounds').value = b;
}
}
function przewodnik_strona(przewodnik) {
document.location=przewodnik;
}
if(typeof $ != 'function') {
function $(element) {
if(!document.getElementById(element)) return null;
return document.getElementById(element);
}
}