function listPopup(target, istanza, nome_lista, id) { var ie = document.all ? true : false; var marginTop = (ie) ? document.documentElement.scrollTop : window.pageYOffset; var height = (ie) ? window.document.documentElement.scrollHeight : document.documentElement.scrollHeight; var box = document.createElement("div"); //box.id = "box_" + parseInt(Math.random() * 100); box.id = "box_geo"; box.style.position = "absolute"; box.style.top = "0px"; box.style.left = "0px"; box.style.width = "100%"; box.style.height = height + "px"; //box.style.backgroundColor = "white"; box.target = target; var wall = document.createElement("div"); wall.id = "wall_" + parseInt(Math.random() * 100); wall.style.position = "absolute"; wall.style.top = "0px"; wall.style.left = "0px"; wall.style.width = "100%"; wall.style.height = height + "px"; //wall.style.backgroundColor = "white"; var pop = document.createElement("div"); pop.id = "popup_" + parseInt(Math.random() * 100); pop.style.position = "absolute"; pop.style.top = parseInt(marginTop + 100) + "px"; pop.style.left = "40%"; pop.style.backgroundColor = "white"; pop.style.borderColor = "green"; pop.style.borderWidth = "1px"; pop.style.borderStyle = "solid"; pop.style.padding = "10px 10px 10px 10px"; var contentHTML = '
' + decodeURIComponent(nome_lista) + '
'; contentHTML += '
'; contentHTML += '
'; contentHTML += ''; contentHTML += 'Seleziona/Deseleziona tutto
'; contentHTML += '
'; contentHTML += ''; contentHTML += 'SALVA
'; contentHTML += '
'; contentHTML += ''; contentHTML += 'CHIUDI
'; pop.innerHTML = contentHTML; box.appendChild(wall); box.appendChild(pop); document.body.appendChild(box); eval(istanza + ".loadList(" + id + ");"); /* setOpacity(box.id, 50); setOpacity(wall.id, 70); setOpacity(pop.id, 100); */ } function selezionaTutto(id, sel) { var options = document.getElementById(id); for (var i = 0; i < options.length; i++) sel == true ? options[i].selected = true : options[i].selected = false; var idl = id.split("_"); var link = document.getElementById('sel_link_' + idl[idl.length - 1]); link.onclick = function() { selezionaTutto('email_nl_' + idl[idl.length - 1], !sel); } return sel; } function utf8_encode (argString) { // Encodes an ISO-8859-1 string to UTF-8 // // version: 1102.614 // discuss at: http://phpjs.org/functions/utf8_encode // + original by: Webtoolkit.info (http://www.webtoolkit.info/) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: sowberry // + tweaked by: Jack // + bugfixed by: Onno Marsman // + improved by: Yves Sucaet // + bugfixed by: Onno Marsman // + bugfixed by: Ulrich // * example 1: utf8_encode('Kevin van Zonneveld'); // * returns 1: 'Kevin van Zonneveld' var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n"); var utftext = "", start, end, stringl = 0; start = end = 0; stringl = string.length; for (var n = 0; n < stringl; n++) { var c1 = string.charCodeAt(n); var enc = null; if (c1 < 128) { end++; } else if (c1 > 127 && c1 < 2048) { enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128); } else { enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128); } if (enc !== null) { if (end > start) { utftext += string.slice(start, end); } utftext += enc; start = end = n + 1; } } if (end > start) { utftext += string.slice(start, stringl); } return utftext; } function serialize (mixed_value) { // Returns a string representation of variable (which can later be unserialized) // // version: 1102.614 // discuss at: http://phpjs.org/functions/serialize // + original by: Arpad Ray (mailto:arpad@php.net) // + improved by: Dino // + bugfixed by: Andrej Pavlovic // + bugfixed by: Garagoth // + input by: DtTvB (http://dt.in.th/2008-09-16.string-length-in-bytes.html) // + bugfixed by: Russell Walker (http://www.nbill.co.uk/) // + bugfixed by: Jamie Beck (http://www.terabit.ca/) // + input by: Martin (http://www.erlenwiese.de/) // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net/) // + improved by: Le Torbi (http://www.letorbi.de/) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net/) // + bugfixed by: Ben (http://benblume.co.uk/) // - depends on: utf8_encode // % note: We feel the main purpose of this function should be to ease the transport of data between php & js // % note: Aiming for PHP-compatibility, we have to translate objects to arrays // * example 1: serialize(['Kevin', 'van', 'Zonneveld']); // * returns 1: 'a:3:{i:0;s:5:"Kevin";i:1;s:3:"van";i:2;s:9:"Zonneveld";}' // * example 2: serialize({firstName: 'Kevin', midName: 'van', surName: 'Zonneveld'}); // * returns 2: 'a:3:{s:9:"firstName";s:5:"Kevin";s:7:"midName";s:3:"van";s:7:"surName";s:9:"Zonneveld";}' var _utf8Size = function (str) { var size = 0, i = 0, l = str.length, code = ''; for (i = 0; i < l; i++) { code = str.charCodeAt(i); if (code < 0x0080) { size += 1; } else if (code < 0x0800) { size += 2; } else { size += 3; } } return size; }; var _getType = function (inp) { var type = typeof inp, match; var key; if (type === 'object' && !inp) { return 'null'; } if (type === "object") { if (!inp.constructor) { return 'object'; } var cons = inp.constructor.toString(); match = cons.match(/(\w+)\(/); if (match) { cons = match[1].toLowerCase(); } var types = ["boolean", "number", "string", "array"]; for (key in types) { if (cons == types[key]) { type = types[key]; break; } } } return type; }; var type = _getType(mixed_value); var val, ktype = ''; switch (type) { case "function": val = ""; break; case "boolean": val = "b:" + (mixed_value ? "1" : "0"); break; case "number": val = (Math.round(mixed_value) == mixed_value ? "i" : "d") + ":" + mixed_value; break; case "string": val = "s:" + _utf8Size(mixed_value) + ":\"" + mixed_value + "\""; break; case "array": case "object": val = "a"; /* if (type == "object") { var objname = mixed_value.constructor.toString().match(/(\w+)\(\)/); if (objname == undefined) { return; } objname[1] = this.serialize(objname[1]); val = "O" + objname[1].substring(1, objname[1].length - 1); } */ var count = 0; var vals = ""; var okey; var key; for (key in mixed_value) { if (mixed_value.hasOwnProperty(key)) { ktype = _getType(mixed_value[key]); if (ktype === "function") { continue; } okey = (key.match(/^[0-9]+$/) ? parseInt(key, 10) : key); vals += this.serialize(okey) + this.serialize(mixed_value[key]); count++; } } val += ":" + count + ":{" + vals + "}"; break; case "undefined": // Fall-through default: // if the JS object has a property which contains a null value, the string cannot be unserialized by PHP val = "N"; break; } if (type !== "object" && type !== "array") { val += ";"; } return val; } function stringify(arr) { var str = new String(); for (var i = 0; i < arr.length; i++) str += arr[i] + ","; return str.substr(0, str.length - 1); } function deselectAll(id) { var sel = document.getElementById(id).options; for (var i = 0; i < sel.length; i++) sel[i].selected = false; return true; } function isJSON(str) { try { JSON.parse(str); } catch (e) { return false; } return true; } function inserito(id){ var target_div = document.getElementById(id); target_div.innerHTML = "

Inserimento effettuato

"; } function clear_div_content(id){ var target_div = document.getElementById(id); target_div.innerHTML = ''; } function seleziona_cat(idc_sel) { var links = document.getElementsByName('cat_links'); for (var i = 0; i < links.length; i++) if (links[i].id == idc_sel) links[i].className = 'selez'; else links[i].className = 'menu_sx_sotto'; } function hideItem(id) { document.getElementById(id).style.visibility = "hidden"; document.getElementById(id).style.display = "none"; } function showItem(id) { document.getElementById(id).style.visibility = ""; document.getElementById(id).style.display = ""; } function getVal(target_id) { return document.getElementById(target_id).value; } function setVal(target_id, val) { document.getElementById(target_id).value = val; } function getById(id) { return document.getElementById(id); } function enableButton(target) { document.getElementById(target).disabled = false; } function disableButton(target) { document.getElementById(target).disabled = true; } function precache(photoName) { var newphoto = new Image(); newphoto.src = photoName; return newphoto; } function loadingGIF(target) { var contentHTML = "
"; contentHTML += ""; contentHTML += "
"; contentHTML += "
"; target.innerHTML = contentHTML; } function setOpacity(div, alpha) { var myDiv = document.getElementById(div); myDiv.style.mozOpacity = alpha / 100; myDiv.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + alpha + ")"; myDiv.style.opacity = alpha / 100; } function popup(urlname) { var stile = "top=0,left=0,fullscreen=yes,status=no,menubar=no"; stile += ",toolbar=no,scrollbar=yes,resize=yes"; window.open(urlname, "", stile); } function isArray() { if (typeof arguments[0] == 'object') { var criterion = arguments[0].constructor.toString().match(/array/i); return (criterion != null); } return false; } function inArray(array, item) { if (isArray(array)) for (i = 0; i < array.length; i++) if (array[i] == item) return true; return false; } function decodeUrlVars(str) { var stringa = new String(str); var trimmed = str.replace(/^\s+|\s+$/g, '') ; var vars = stringa.split("&"); var result = new Array(); for (i = 0; i < vars.length; i++) { var tmp = new String(vars[i]); tmp = tmp.split("="); result[tmp[0]] = tmp[1]; } return result; } function removeById(id, target) { var elm = document.getElementById(id); document.body.removeChild(elm); try { document.getElementById(target).focus(); tinyMCE.get(target).focus(); } catch (e1) { try { tinyMCE.get(target).focus(); } catch (e2) {} } } function lightpopup(message, target) { var marginTop = (ie) ? document.documentElement.scrollTop : window.pageYOffset; var box = document.createElement("div"); box.id = "box_" + parseInt(Math.random() * 100); box.style.position = "absolute"; box.style.top = "0px"; box.style.left = "0px"; box.style.width = "100%"; box.style.height = "100%"; /*box.style.backgroundColor = 'black';*/ box.target = target; box.className = 'admin_preload_box'; var wall = document.createElement("div"); wall.id = "wall_" + parseInt(Math.random() * 100); /*wall.style.position = "absolute";*/ wall.style.top = "0px"; wall.style.left = "0px"; wall.style.width = "100%"; wall.style.height = document.body.clientHeight + "px"; /*wall.style.backgroundColor = "black";*/ var pop = document.createElement("div"); pop.id = "popup_" + parseInt(Math.random() * 100); pop.style.position = "absolute"; //pop.style.top = parseInt(marginTop + 10) + "px"; //pop.style.top = parseInt(marginTop + 100) + "px"; pop.style.top = "100px"; //pop.style.left = "50%"; pop.style.left = "40%"; pop.style.backgroundColor = "#FFF"; pop.style.borderColor = "#000"; pop.style.borderWidth = "2px"; pop.style.borderStyle = "solid"; pop.style.padding = "10px 10px 10px 10px"; var contentHTML = decodeURIComponent(message); contentHTML += '
'; contentHTML += ''; contentHTML += 'OK
'; pop.innerHTML = contentHTML; box.appendChild(wall); box.appendChild(pop); document.body.appendChild(box); setOpacity(wall.id, 70); setOpacity(pop.id, 80); } function billpopup(message, target) { var ie = (navigator.appName.indexOf("Internet Explorer") != -1) ? true : false; var marginTop = (ie) ? document.documentElement.scrollTop : window.pageYOffset; var box = document.createElement("div"); box.id = "box_" + parseInt(Math.random() * 100); /*box.style.position = "absolute";*/ box.style.top = "0px"; box.style.left = "0px"; box.style.width = "100%"; box.style.height = "100%"; //box.style.backgroundColor = ""; box.className = "admin_preload_box"; var wall = document.createElement("div"); wall.id = "wall_" + parseInt(Math.random() * 100); wall.style.position = "absolute"; /* wall.style.top = "0px"; wall.style.left = "0px"; */ wall.style.top = "0px"; wall.style.left = "0px"; wall.style.width = "100%"; wall.style.height = document.body.clientHeight + "px"; //wall.style.backgroundColor = "white"; wall.className = "admin_preload_wall"; var pop = document.createElement("div"); pop.id = "popup_" + parseInt(Math.random() * 100); pop.style.position = "absolute"; /* pop.style.top = parseInt(marginTop + 10) + "px"; pop.style.left = "10px"; */ pop.className = 'admin_preload_popup'; pop.style.top = "5%"; pop.style.left = "45%"; pop.style.backgroundColor = "#F0F0F0"; pop.style.borderWidth = "3px"; pop.style.borderStyle = "solid"; pop.style.borderColor = "black"; pop.style.padding = "5px"; var contentHTML = decodeURIComponent(message); contentHTML += '
'; contentHTML += ''; contentHTML += 'OK
'; pop.innerHTML = contentHTML; box.appendChild(wall); box.appendChild(pop); document.body.appendChild(box); setOpacity(wall.id, 70); setOpacity(pop.id, 80); } function loginPopup(target) { var ie = (navigator.appName.indexOf("Internet Explorer") != -1) ? true : false; var marginTop = (ie) ? document.documentElement.scrollTop : window.pageYOffset; var box = document.createElement("div"); box.id = "box_" + parseInt(Math.random() * 100); /*box.style.position = "absolute";*/ box.style.top = "0px"; box.style.left = "0px"; box.style.width = "100%"; box.style.height = "100%"; //box.style.backgroundColor = ""; box.className = "admin_preload_box"; var wall = document.createElement("div"); wall.id = "wall_" + parseInt(Math.random() * 100); wall.style.position = "absolute"; /* wall.style.top = "0px"; wall.style.left = "0px"; */ wall.style.top = "0px"; wall.style.left = "0px"; wall.style.width = "100%"; wall.style.height = document.body.clientHeight + "px"; //wall.style.backgroundColor = "white"; wall.className = "admin_preload_wall"; var pop = document.createElement("div"); pop.id = "popup_" + parseInt(Math.random() * 100); pop.style.position = "absolute"; /* pop.style.top = parseInt(marginTop + 10) + "px"; pop.style.left = "10px"; */ pop.className = 'admin_preload_popup'; pop.style.top = "25%"; pop.style.left = "40%"; pop.style.backgroundColor = "#30646E"; /*pop.style.borderColor = "#333"; pop.style.borderWidth = "3px"; pop.style.borderStyle = "solid";*/ pop.style.padding = "5px 0 0 0"; var contentHTML = '
'; contentHTML += '
'; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += '
Nome utente
Password
'; contentHTML += ''; contentHTML += '
'; contentHTML += '
'; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += ''; contentHTML += '
'; contentHTML += ''; contentHTML += '
'; contentHTML += '
'; pop.innerHTML = contentHTML; box.appendChild(wall); box.appendChild(pop); document.body.appendChild(box); setOpacity(wall.id, 70); setOpacity(pop.id, 100); } function check(id, pattern) { var check = new String(document.getElementById(id).value); if (!check.match(pattern)) { document.getElementById(id).style.borderColor = "#FF0000"; document.getElementById(id).focus(); return false; } else { document.getElementById(id).style.borderColor = "gray"; return true; } } var ie = 0; if (navigator.appName.indexOf("Internet Explorer") != -1) ie = 1; try { LLI.callBack("otherfunctions_lib"); } catch (e) {}