function hideShow(id) { for (var i = 1; i <= 7; i++) { if (!document.getElementById('hs_' + i)) continue; var el = document.getElementById('hs_' + i); if (i == id) el.style.display = ''; else el.style.display = 'none'; } } 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 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.backgroundImage = "url(/immagini/bg_black.png)"; 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 = document.body.clientHeight + "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 + 150) + "px"; pop.style.left = "50%"; pop.style.backgroundColor = "white"; pop.style.borderColor = "green"; pop.style.borderWidth = "2px"; pop.style.borderStyle = "solid"; pop.style.padding = "10px 10px 10px 10px"; var contentHTML = 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 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 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) {}