if (document.location.hash == '#useproxy' || document.location.search.match("useproxy=true")) {
usesessions = false;
pazpar2path = '/service-proxy/';
- showResponseType = 'xml';
+ showResponseType = 'json';
}
+if (this.JSON )
+ alert("Native JSON support");
+
my_paz = new pz2( { "onshow": my_onshow,
"showtime": 500, //each timer (show, stat, term, bytarget) can be specified this way
"pazpar2path": pazpar2path,
function logInOrOut() {
var loginElement = document.getElementById("login");
if (loginElement.innerHTML == 'Login')
- login();
+ login();
else
- logout();
+ logout();
}
function loggedIn() {
var login = document.getElementById("login");
login.innerHTML = 'Logout';
- // login.onclick = 'logout();';
- domReady();
}
function auth_check() {
auth.check(loggedIn, login, true);
+ domReady();
}
//
showhide();
}
-function serialize(array) {
- var t = typeof (obj);
- if (t != "object" || obj === null) {
- // simple data type
- return String(obj);
- } else {
- // recurse array or object
- var n, v, json = [], arr = (obj && obj.constructor == Array);
- for (n in obj) {
- v = obj[n];
- t = typeof (v);
- if (t == "string")
- v = '"' + v + '"';
- else if (t == "object" && v !== null)
- v = JSON.stringify(v);
- json.push((arr ? "" : '"' + n + '":') + String(v));
- }
- return (arr ? "" : "") + String(json) + (arr ? "]" : "}");
- }
-}
-
var termlist = {};
function my_onterm_iphone(data) {
my_onterm(data);