//################################################### REVISIONE 13/01/2020 function pop_video_mp4(url,larghezza_video_vw,rapporto_h_su_w,margine_superiore_vw) { /*---------- NOTE - ATTENZIONE:youtube e altri devono essere caricati via iframe. Per poterli vedere tramite questa funzione devono essere caricati in formato .mp4 In alternativa utilizzare la funzione pop_player - url = http//vattelapesca.it/pippo/pluto/film.mp4 - larghezza_video_vw = 40 essendo in vw larghezza massima = 100 ricorda di passare la variabile come numero intero - margine_superiore_vw = 10 ricorda di passare la variabile come numero intero Ricorda di passare la variabile rapporto_h_su_w come stringa in formato frazionario - rapporto_h_su_w = "9/16" - rapporto_h_su_w = "4/5" ------------*/ var altezza_video_vw = larghezza_video_vw * eval(rapporto_h_su_w) var html="" html = html + "" var parametri = "x=-1,w=" + larghezza_video_vw + ",y=" + margine_superiore_vw + ",h=-1,bordo=0.4,padding=1,bordo_colore=#AE2337,bordo_raggio=1,blocca_scroll=0,iframe=0,bottone_x=top.pop_chiude()" top.pop_inoltra_start() top.pop_apre(parametri) top.pop_obj.innerHTML = html top.pop_visibile() } //################################################### function pop_chiude_con_conferma(domanda) { var html = "" html = html + "
ATTENZIONE!
" html = html + "

" html = html + domanda + "
" top.pop_finestrella(html,"SI_NO", function(tipo,valore) { top.pop_chiude() if(valore=="SI"){top.pop_chiude()} },finestrella_personalizzata_50) } //################################################### function pop_bottoni(pagina,numero_pagine,iframe,locazione,filtri,parametri) { /*----------------------------- Gestisce tutto il controllo di sfoglio pagine web: tutti i parametri vengono forniti pagina = numero pagina attule numero_pagine = numero totale di pagine iframe = "IFRAME" esegue un ".src" altro esegue un "replace" locazione = locazione attuale senza alcun parametro dopo ? filtri = ..... parametri = "......" attenzione alle maiuscole viene lanciata: locazione?pagina da raggiungere........... -----------------------------*/ var s = "" s = s + "\r\npagina = " + pagina s = s + "\r\nnumero_pagine = " + numero_pagine s = s + "\r\niframe = " + iframe s = s + "\r\nlocazione = " + locazione s = s + "\r\nfiltri = " + filtri s = s + "\r\nparametri = " + parametri //alert(s) pagina = parseInt(pagina) numero_pagine = parseInt(numero_pagine) if (pagina == null || pagina == undefined || trim(pagina) == "" || isNaN(pagina)){pagina = 1} var dimensioni = top.pop_dimensioni() var dimensioni_quadro = pop_dimensioni() s = "" s = s + "\r\ndimensioni.y_occupa_px=" + dimensioni.y_occupa_px s = s + "\r\ndimensioni.y_scroll_px=" + dimensioni.y_scroll_px s = s + "\r\ndimensioni.y_alto_px=" + dimensioni.y_alto_px s = s + "\r\ndimensioni_quadro.y_occupa_px=" + dimensioni_quadro.y_occupa_px s = s + "\r\ndimensioni_quadro.y_scroll_px=" + dimensioni_quadro.y_scroll_px s = s + "\r\ndimensioni_quadro.y_alto_px=" + dimensioni_quadro.y_alto_px //alert(s) //########################################################################################## var oscuramento_alfa = 90 var colore = "black" var colore = "#3B5998" var colore = "#49A6D7" var colore = "#F4F1E9" var colore = "#FFFFFF" var colore = "#4D4D4D" top.document.body.appendChild(document.createElement("div")) top.document.body.lastChild.style.position = "fixed" top.document.body.lastChild.style.bottom = "0vh" top.document.body.lastChild.style.width = "100%" top.document.body.lastChild.style.display = "none" top.document.body.lastChild.style.backgroundColor = colore top.document.body.lastChild.style.paddingTop = "0.2em" top.document.body.lastChild.style.paddingBottom = "0.2em" top.document.body.lastChild.style.filter = "alpha(opacity=" + oscuramento_alfa + ")" top.document.body.lastChild.style.opacity = oscuramento_alfa/100 //-------------------------------------------------- var flag = false var sinistra = "" var destra = "" if (dimensioni.y_occupa_vh > 100) { flag = true var sinistra = "" var destra = "" } //-------------------------------------------------- var centro = "" if (numero_pagine > 1) { flag = true //---------- Gestione bottoni sfoglia pagine var stringa = pagina + "," + numero_pagine + ",'" + iframe + "','" + locazione + "','" + filtri + "','" + parametri + "'" centro = centro + "      " centro = centro + "       " centro = centro + "       " centro = centro + "       " centro = centro + " " } //-------------------------------------------------- var html = "" html = html + "" html = html + "" html = html + "" html = html + "" html = html + "
" + sinistra + "" + centro + "" + destra + "
" top.document.body.lastChild.innerHTML = html //alert(html) if (flag){top.document.body.lastChild.style.display = "block" } } //################################################### function pop_bottoni_lancio(tipo,pagina,numero_pagine,iframe,locazione,filtri,parametri) { var s = "" s = s + "\r\ntipo = " + tipo s = s + "\r\npagina = " + pagina s = s + "\r\nnumero_pagine = " + numero_pagine s = s + "\r\niframe = " + iframe s = s + "\r\nlocazione = " + locazione s = s + "\r\nfiltri = " + filtri s = s + "\r\nparametri = " + parametri //alert(s) var vai_a_pag = 0 if (tipo == "INPUT") { var html = "" html = html + "

Sei a pagina " + pagina + " di " + numero_pagine + "; vai a pagina

" top.pop_finestrella(html,"INPUT",pop_bottoni_uscita,"x=-1,w=50,y=5,h=-1,bordo=0.5,padding=1,bordo_colore=#ff0000,bordo_raggio=1,blocca_scroll=1") } if (tipo == "<<"){vai_a_pag = 1;pop_bottoni_uscita(tipo,vai_a_pag)} if (tipo == "<"){vai_a_pag = pagina - 1;pop_bottoni_uscita(tipo,vai_a_pag)} if (tipo == ">>"){vai_a_pag = numero_pagine;pop_bottoni_uscita(tipo,vai_a_pag)} if (tipo == ">"){vai_a_pag = pagina + 1;pop_bottoni_uscita(tipo,vai_a_pag)} //----------------------------------------- function pop_bottoni_uscita(tipo,vai_a_pag) { var s = "" s = s + "\r\ntipo = " + tipo s = s + "\r\nvai_a_pag = " + vai_a_pag //alert(s) if(tipo == "INPUT"){top.pop_chiude()} vai_a_pag = parseInt(zero(vai_a_pag)) if (vai_a_pag > numero_pagine){vai_a_pag = numero_pagine} if (vai_a_pag < 1){vai_a_pag = 1} var xxx = "" xxx = xxx + "" + vai_a_pag + "" xxx = xxx + filtri xxx = xxx + parametri xxx = xxx + casuale() var loca = locazione + "?" + stringa_a_hex(xxx) s="" s = s + "\r\nlocazione=" + locazione s = s + "\r\nxxx=" + xxx s = s + "\r\nloca=" + loca //alert(s) top.document.body.removeChild(top.document.body.lastChild) top.pop_inoltra_start() if (iframe.toUpperCase() == "IFRAME") { top.iframe_obj.src=loca } else { top.rimpiazza(loca) } } } //################################################### ESECUZIONE COMANDI function pop_avvisi(elenco_c_idx) { //alert("pop_avvisi - elenco_c_idx=" + elenco_c_idx) var comandi = elenco_c_idx.split(sep_comandi) var i = 0 pop_avvisi_avviso(i,comandi) function pop_avvisi_avviso(i,comandi) { if(i FILTRARE LE INFORMAZIONI" html = html + "
● Attraverso i filtri e' possibile selezionare le informazioni di interesse escludendo le altre." html = html + "
● Indicare le parole da cercare nel sottostante campo di selezione separandole da una virgola; maiuscole o minuscole sono equivalenti." html = html + "
● Sono estratte le informazioni che contengono almeno una delle parole indicate." html = html + "
● Se non si indica alcuna parola verranno mostrate tutte le informazioni: per annullare i filtri lasciare in bianco il campo di selezione." html = html + "
● In alcuni casi i filtri non sono visibili tra le informazioni mostrate: essi sono pero' presenti nei link.

" top.pop_finestrella(html,"INPUT", function(tipo,valore) { top.pop_chiude() filtri = "" + valore + "" //alert(x) top.pop_bottoni_lancio("<<",pagina,numero_pagine,iframe,locazione,filtri,parametri) },finestrella_personalizzata_90) } //---------------------------------------------------------------------------- function pop_finestrella(html,tipo,funzione_uscita,parametri) { var memo_obj = top.pop_obj var memo_container = top.pop_container var memo_oscurante = top.pop_oscurante /*--------------------------------------------- tipo = OK bottone OK tipo = SI_NO bottoni si/no tipo = INPUT campo di input e bottone OK parametri = "x=-1,w=100,y=0,h=-1,bordo=0.4,padding=1,bordo_colore=#ff0000,bordo_raggio=1,blocca_scroll=1" parametri = "x=-1,w=50,y=0,h=-1,bordo=0.2,padding=1,bordo_colore=#ff0000,bordo_raggio=1,blocca_scroll=1" parametri = "x=-1,w=50,y=20,h=-1,blocca_scroll=1" ----------------------------------------------*/ var standard = parametri ; if(trim(standard)==""){standard = "x=-1,w=50,y=10,h=-1,bordo=0.5,padding=1,bordo_colore=#ff0000,bordo_raggio=1,blocca_scroll=0"} var larghezza_bottoni = 5 var larghezza_finestra = top.pop_parametro_estrae_n("w=",standard) var larghezza_input = (larghezza_finestra - larghezza_bottoni)*0.5 var a = "" ; if (self!=top){a = "top.document.getElementById('"+ self.name + "').contentWindow."} var random = top.casuale() var id_a = "a_" + random var id_b = "b_" + random var s = "" s = s + "\r\nid_a = " + id_a s = s + "\r\nid_b = " + id_b s = s + "\r\nself = " + self s = s + "\r\ntop = " + top s = s + "\r\na = " + a //alert(s) var x= "" x = x + html //------------------------------------ tipo = OK if(tipo=="OK") { x = x + "

" x = x + "" x = x + "
" top.pop_apre(standard) //top.pop_container.className = "sfumato" top.pop_obj.innerHTML = x top.pop_visibile() top.document.getElementById(id_a).addEventListener("click", function(){a + funzione_uscita(tipo,"OK")}) } //------------------------------------ tipo = SI_NO if(tipo=="SI_NO") { x = x + "
" x = x + "" x = x + "      " x = x + "
" top.pop_apre(standard) //top.pop_container.className = "sfumato" top.pop_obj.innerHTML = x top.pop_visibile() top.document.getElementById(id_a).addEventListener("click", function(){a + funzione_uscita(tipo,"SI")}) top.document.getElementById(id_b).addEventListener("click", function(){a + funzione_uscita(tipo,"NO")}) } //------------------------------------ tipo = INPUT if(tipo=="INPUT") { x = x + "
" x = x +"" x = x + " " x = x + "
" top.pop_apre(standard) //top.pop_container.className = "sfumato" top.pop_obj.innerHTML = x top.pop_visibile() top.document.getElementById(id_a).tabIndex = 0 top.document.getElementById(id_a).focus() top.document.getElementById(id_b).addEventListener("click", function(){a + funzione_uscita(tipo,top.document.getElementById(id_a).value)}) top.document.getElementById(id_a).addEventListener('keypress', function(e){if (e.keyCode == 13){a + funzione_uscita(tipo,top.document.getElementById(id_a).value)}},false) } top.pop_obj = memo_obj top.pop_container = memo_container top.pop_oscurante = memo_oscurante } //##################################################################### function pop_tastiera(on_off) { document.onkeydown = function (e) { return on_off } document.onkeyup = function (e) { return on_off } } //##################################################################### function pop_apre(parametri) { /*============================================== parametri = "x=-1,y=-1,w=0.7,h=0.7,bordo=3,padding=0,bordo_colore=#cccccc,bordo_raggio=0,blocca_scroll=0,bottone_x=f1(),iframe=0" blocca_scroll = 0/1, 0=no 1=si 'x=-1,w=0.5,y=-1,h=0.5' Mezzo schermo centrato (taglia le ultime righe se sono troppe) 'x=-1,w=0.5,y=10,h=-1' Mezzo schermo in larghezza e centrato bloccato in alto a 10 vw. L'altezza č regolata automaticamente al contenuto senza perdita di righe 'x=0,y=0,w=0,h=0' Schermo intero ecc. Per regolare automaticamente l'altezza, in base al contenuto h deve essere negativo (idem per la larghezza con w) ATTENZIONE PARTICOLARITA': se h=-1 (l'altezza č floating dipenderā da quello che verrā caricato al momento non noto) y=-1 significherebbe voler centrare in altezza ma - dato che h č incognita - verrā messo ad y=0. In pratica se h=-1 (come spesso accade) convienne scegliere un valore fisso ed attendibile per y (ad es y=10). Analogo discorso vale per w ma certo meno frequente. ATTENZIONE! I parametri bordo e padding servono per crossbrowser e si riferiscono al CONTAINER Nell'Ordine sono accessibili gli oggetti: pop_oscurante: oscurante pop_container: contenitore pop_obj : elemento interno su cui lavorare pop_inoltra_obj : immagine di copertura attesa di caricamento '------------------------------------------------- Versione di novembre 2018 aggiunto il parametro "iframe" che se =1 in pop_obj va un iframe altrimenti html quindi: parametri = "x=-1,w=0.85,y=5,h=0.8,bordo=0.4,padding=1,bordo_colore=#AE2337,bordo_raggio=1,bottone_x=top.pop_chiude(),blocca_scroll=0,iframe=1 o niente o zero" top.pop_apre(parametri) se iframe top.pop_obj.src = url se div top.pop_obj.innerHTML = html ================================================*/ //------------------------------ parametri default (vw) /*--------------------------- var bordo_default = 0.4 var padding_default = 1 var bordo_colore_default = "#AE2337" var bordo_raggio_default = 1 var iframe_default = 0 ---------------------------*/ var bordo_default = 0.1 var padding_default = 0 var bordo_colore_default = "#AE2337" var bordo_raggio_default = 0 var iframe_default = 0 //------------------------------ Estrae parametri var x = pop_parametro_estrae_n("x=",parametri) var y = pop_parametro_estrae_n("y=",parametri) var w = pop_parametro_estrae_n("w=",parametri) var h = pop_parametro_estrae_n("h=",parametri) var iframe = pop_parametro_estrae_n("iframe=",parametri);if (iframe == 0){iframe = iframe_default} var bordo = pop_parametro_estrae_n("bordo=",parametri);if (bordo == 0){bordo = bordo_default} var padding = pop_parametro_estrae_n("padding=",parametri);if (padding == 0){padding = padding_default} var bordo_colore = pop_parametro_estrae_a("bordo_colore=",parametri);if (bordo_colore == ""){bordo_colore = bordo_colore_default} var bordo_raggio = pop_parametro_estrae_n("bordo_raggio=",parametri);if (bordo_raggio == 0){bordo_raggio = bordo_raggio_default} var blocca_scroll = pop_parametro_estrae_n("blocca_scroll=",parametri) var bottone_x = trim(pop_parametro_estrae_a("bottone_x=",parametri)) var m = 2 * ( bordo + padding) s = "----------------- ENTRATA" s = s + "\r\nx = " + x s = s + "\r\nw = " + w s = s + "\r\ny = " + y s = s + "\r\nh = " + h s = s + "\r\nm = " + m //################################################################ TOLTO IL 13/01/2020 DA PROBLEMI IN FIREFOX-TENERE SOTTO CONTROLLO //document.body.style.overflow = 'scroll' //################################################################ var dime = pop_dimensioni() //------------------------------ Sistemazione larghezza ed altezza var w_max = dime.x_occupa_vw if (0 < w && w <= 1){w = w * w_max} if (w == 0 || w_max <= w){w = w_max} if (w < 0 && x < 0){x = 0} var h_max = dime.y_occupa_vh if (0 < h && h <= 1){h = h * h_max} if (h == 0 || h >= h_max){h = h_max} if (h < 0 && y < 0){y = 0} s = s + "\r\n----------------- 1" s = s + "\r\nx = " + x s = s + "\r\nw = " + w s = s + "\r\nw_max = " + w_max s = s + "\r\ny = " + y s = s + "\r\nh = " + h s = s + "\r\nh_max = " + h_max s = s + "\r\nm = " + m //------------------------------ Sistemazioni posizioni e dimensioni finali if (x<0){x = (w_max-w-m)/2} if (y<0){y = (h_max-h-m)/2} if (w>=w_max){w = w-m ; x = 0} if (h>=h_max){h = h-m ; y = 0} if (w+x>w_max){w = w_max-x-m} if (h+y>h_max){h = h_max-y-m} //alert("blocca_scroll = " + blocca_scroll) s = s + "\r\n----------------- POSIZIONE SCROLLATA" var sx = dime.x_scroll_vw var sy = dime.y_scroll_vh s = s+ "\r\nsx = " + sx s = s+ "\r\nsy = " + sy if(blocca_scroll == 0){x = x + sx ; y = y + sy} s = s + "\r\n----------------- 2" s = s + "\r\nx = " + x s = s + "\r\nw = " + w s = s + "\r\ny = " + y s = s + "\r\nh = " + h s = s + "\r\nm = " + m //alert(s) //------------------------------ crea oscurante var oscuramento_background_color = "#000000" var oscuramento_alfa = 70 document.body.appendChild(document.createElement("div")) pop_oscurante = document.body.lastChild pop_oscurante.style.position = "absolute" pop_oscurante.style.visibility="hidden" pop_oscurante.style.top = "0vh" pop_oscurante.style.left = "0vw" pop_oscurante.style.margin = "0vw" pop_oscurante.style.padding = "0vw" pop_oscurante.style.width = "100vw" pop_oscurante.style.height = "100vh" pop_oscurante.style.position = "fixed" pop_oscurante.style.backgroundColor = oscuramento_background_color pop_oscurante.style.filter = "alpha(opacity=" + oscuramento_alfa + ")" pop_oscurante.style.opacity = oscuramento_alfa/100 //------------------------------ crea container document.body.appendChild(document.createElement("div")) pop_container = document.body.lastChild pop_container.style.visibility="hidden" pop_container.style.position="absolute" if(blocca_scroll != 0){pop_container.style.position="fixed"} pop_container.style.top = y + "vh" pop_container.style.left = x + "vw" pop_container.style.padding= padding + "vw" pop_container.style.border= bordo + "vw solid " + bordo_colore pop_container.style.webkitBorderRadius = bordo_raggio + "vw" pop_container.style.MozBorderRadius = bordo_raggio + "vw" pop_container.style.borderRadius = bordo_raggio + "vw" pop_container.style.backgroundColor = "#FFFFFF" //------------------------------ crea oggetto finale var random = pop_casuale() var bot = bottone_x var html = "
" if (iframe != 0) { var bot = "top.document.getElementById('"+ random + "').contentWindow." + bottone_x var html = "" } if (bottone_x != "") { var font_size_vw = dime.font_size_vw if(font_size_vw == 0){font_size_vw = 2} var diametro = 2 * font_size_vw var raggio = diametro/2 var sposta = -(bordo + diametro)/2 html = html + "" } pop_container.innerHTML = html pop_obj = document.getElementById(random) if (w > 0){pop_obj.style.width = w + "vw" ; pop_obj.style.overflowX = 'auto'} if (h > 0){pop_obj.style.height = h + "vh" ; pop_obj.style.overflowY = 'auto'} document.body.style.overflow = 'auto' } //##################################################################### function pop_player(url,w,h) { /*---------------------------- Fornire: url => YOUTUBE://codice filmato => http://vattelapesca.mp4 w => Larghezza in vw (0...100 es.: 32) h => Altezza in vw (0...100 es.: 18 per 16/9) attenzione per questioni di dimensini standard di video si parla di "vw" e non "vh" Rirorna: il filmato da inserire come html in una div o dove ti pare. ----------------------------*/ var s = "" //---------------------------- if (url.toUpperCase().indexOf("YOUTUBE://")>-1) { //-------------------- YOUTUBE s = s + "" //---------------------------- } else { if (!!document.createElement('video').canPlayType) { //---------------------- HTML5 s = s + "" //---------------------- } } return s } //##################################################################### function pop_stato_window(percentuale) { var stato = "location=0,toolbar=0,directories=0,menubar=0,status=0,scrollbars=1,resizable=1" if (percentuale > 0) { dime = top.pop_dimensioni() var w_max = dime.x_largo_px var h_max = dime.y_alto_px //var w_max = screen.availWidth //var h_max = screen.availHeight var w = percentuale * w_max / 100 var h = percentuale * h_max / 100 var x = (w_max-w)/2 var y = (h_max-h)/3 stato = stato + ",top=" + y + "px" stato = stato + ",left=" + x + "px" stato = stato + ",width=" + w + "px" stato = stato + ",height=" + h + "px" } return stato } //##################################################################### function pop_dimensiona_caratteri() { //-------------------------------- Inizio step 1 : Sistemazione altezza caratteri var top_dime = top.pop_dimensioni() var dime = pop_dimensioni() var size_iframe_vw = top_dime.font_size_vw * (top_dime.x_largo_px / dime.x_largo_px) document.body.style.fontSize = size_iframe_vw + "vw" document.getElementsByTagName("html")[0].style.fontSize = size_iframe_vw + "vw" //document.body.style.lineHeight = size_iframe_vw + "vw" //document.getElementsByTagName("html")[0].style.lineHeight = size_iframe_vw + "vw" } //##################################################################### function pop_dimensiona_iframe() { //-------------------------------- Inizio step 1 : Sistemazione altezza caratteri var top_dime = top.pop_dimensioni() var dime = pop_dimensioni() var size_iframe_vw = top_dime.font_size_vw * (top_dime.x_largo_px / dime.x_largo_px) document.body.style.fontSize = size_iframe_vw + "vw" document.getElementsByTagName("html")[0].style.fontSize = size_iframe_vw + "vw" //-------------------------------- Fine step 1 setTimeout(function() { //------------------------ Inizio step 2 : Sistemazione altezza iframe top_dime = top.pop_dimensioni() dime = pop_dimensioni() top.document.getElementById(self.name).style.height = 100 * dime.y_occupa_px/top_dime.y_alto_px + "vh" //top.document.getElementById(self.name).style.height = 100 + "vh" //------------------------- Fine step 2 setTimeout(function() { //----------------- Inizio step 3 : Visibile top.pop_visibile() top.scroll(top_dime.x_scroll_px,top_dime.y_scroll_px) //----------------- Fine step 3 },100) ; //-------- Ritardo tra step2 e step3 },100) ; //---------------- Ritardo tra step1 e step2 } //##################################################################### function pop_dimensioni() { var x_largo = Math.max(zero(document.documentElement.clientWidth),zero(window.innerWidth)) var x_occupa = Math.max(zero(document.body.scrollWidth),zero(document.documentElement.scrollWidth)) var x_scroll = Math.max(zero(document.documentElement.scrollLeft),zero(window.pageXOffset),zero(window.scrollX)) var y_alto = Math.max(zero(document.documentElement.clientHeight),zero(window.innerHeight)) var y_occupa = Math.max(zero(document.body.scrollHeight),zero(document.documentElement.scrollHeight)) var y_scroll = Math.max(zero(document.documentElement.scrollTop),zero(window.pageYOffset),zero(window.scrollY)) var size_px = pop_size() var size_vw = 100 * size_px/x_largo var x = { font_size_px:size_px, font_size_vw:size_vw, x_largo_px:x_largo, x_largo_vw:100, x_occupa_px:x_occupa, x_occupa_vw:100 * x_occupa/x_largo, x_scroll_px:x_scroll, x_scroll_vw:100 * x_scroll/x_largo, y_alto_px:y_alto, y_alto_vh:100, y_occupa_px:y_occupa, y_occupa_vh:100 * y_occupa/y_alto, y_scroll_px:y_scroll, y_scroll_vh:100 * y_scroll/y_alto, } return x } //##################################################################### function pop_size() { var size_px = 0 document.body.appendChild(document.createElement("div")) document.body.lastChild.style.display="none" var size = "" var el = document.body.lastChild var obj_explorer = el.currentStyle var obj_altri = getComputedStyle(el, null) var obj = obj_explorer || obj_altri size = obj.getPropertyValue('font-size') //alert(size) document.body.removeChild(document.body.lastChild) if(size.indexOf("px")>=0) { //----------------------- size č in px size_px = parseFloat(size) } else { if(size.indexOf("vw")>=0) { //--------------- size č in vw size_px = parseFloat(size) * Math.max(zero(document.documentElement.clientWidth),zero(window.innerWidth)) / 100 } else if(size.indexOf("pt")>=0) { //--------------- size č in pt size_px = parseFloat(size) * 4/3 } } return size_px } //##################################################################### function pop_parametro_estrae_n(nome,parametri) { var x = 0 try{x = parametri.split(nome)[1].split(",")[0]}catch(err){x = 0} if(isNaN(x) || x==null || x==undefined || x==""){x = 0} return eval(x) } //##################################################################### function pop_parametro_estrae_a(nome,parametri) { var x="" try{x = parametri.split(nome)[1].split(",")[0]}catch(err){x=""} if(x==null || x==undefined || x==""){x = ""} return x } //##################################################################### function pop_casuale() { var random = new Date() var random = pop_pulizia(Math.random() + "" + random.getTime() , "0123456789") return random } //##################################################################### function pop_pulizia(stringa,ammessi) { var s = stringa + "" var y = "" var a = "" for (var i = 0 ; i < s.length ; i++) { a = s.charAt(i) if (ammessi.indexOf(a)>=0){y += a} } return y } //##################################################################### function pop_chiude() { pop_inoltra_stop() //pop_fade(pop_container) try{pop_obj.firstChild.src = ""}catch(err){} try{document.body.removeChild(document.body.lastChild)}catch(err){} try{document.body.removeChild(document.body.lastChild)}catch(err){} } //##################################################################### function pop_barre_si() { document.body.style.overflowX = 'auto' document.body.style.overflowY = 'auto' } //##################################################################### function pop_barre_no() { document.body.style.overflowX = 'hidden' document.body.style.overflowY = 'hidden' } //##################################################################### function pop_visibile() { try { pop_inoltra_stop() pop_oscurante.style.visibility = "visible" //pop_fade(pop_container) pop_container.style.visibility = "visible" pop_container.tabIndex=-1 pop_container.focus() } catch(err){} } //##################################################################### function pop_inoltra_start() { pop_inoltra_stop() document.body.style.cursor="wait" document.body.appendChild(document.createElement("div")) pop_inoltra_obj = document.body.lastChild var w = 0 var flag = false pop_inoltra_ripeti(w,flag) function pop_inoltra_ripeti(w,flag) { var step = 0.4 var tempo = 15 var l_max = 25 var l_min = 1 var dime = pop_dimensioni() if(wl_max){w=l_max} r = w * 1.4142 /*----------------------------------------------------- var h = 0.5 var s = 0.5 var la= 0 var lb= 0.9 var l = la + ((l_max - w) * (lb - la))/(l_max - l_min) var colore = hslToRgb(l, s, h) ------------------------------------------------------*/ var colore = "#FF0000" //alert(colore) if(w>l_min) { pop_inoltra_obj.style.position = "fixed" pop_inoltra_obj.style.padding = 0 pop_inoltra_obj.style.backgroundColor = colore pop_inoltra_obj.style.width = w + "vw" pop_inoltra_obj.style.height = w + "vw" pop_inoltra_obj.style.top = (50 - w) + "vh" pop_inoltra_obj.style.left = ((100-w)/2) + "vw" pop_inoltra_obj.style.webkitBorderRadius = r + "vw" pop_inoltra_obj.style.MozBorderRadius = r + "vw" pop_inoltra_obj.style.borderRadius = r + "vw" } if(flag) { if(w<=l_min) { flag=false w=l_min } else { w=w-step } } else { if(w>=l_max) { flag=true w=l_max } else { w=w+step } } pop_visibile_timer = setTimeout(function(){pop_inoltra_ripeti(w,flag)}, tempo) } } //##################################################################### /** * Converts an HSL color value to RGB. Conversion formula * adapted from http://en.wikipedia.org/wiki/HSL_color_space. * Assumes h, s, and l are contained in the set [0, 1] and * returns r, g, and b in the set [0, 255]. * * @param {number} h The hue * @param {number} s The saturation * @param {number} l The lightness * @return {Array} The RGB representation */ function hslToRgb(h, s, l){ var r, g, b; if(s == 0){ r = g = b = l; // achromatic }else{ var hue2rgb = function hue2rgb(p, q, t){ if(t < 0) t += 1; if(t > 1) t -= 1; if(t < 1/6) return p + (q - p) * 6 * t; if(t < 1/2) return q; if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; return p; } var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; r = hue2rgb(p, q, h + 1/3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1/3); } return ("#" + Math.round(r * 255).toString(16) + Math.round(g * 255).toString(16) + Math.round(b * 255).toString(16)).toUpperCase() } //##################################################################### function pop_inoltra_stop() { try { clearTimeout(pop_visibile_timer) document.body.removeChild(pop_inoltra_obj) } catch(err){} document.body.style.cursor="default" } //##################################################################### function pop_fade(obj) { tempo=10 step = 3 if (obj.style.visibility == "hidden") { //----------------------- FADE IN var pop_alfa = 0 obj.style.opacity = 0 obj.style.visibility = "visible" var pop_fade_timer = setInterval(function() { if(pop_alfa>100) { obj.style.opacity = 1 clearInterval(pop_fade_timer) } else { pop_alfa = pop_alfa + step obj.style.opacity = pop_alfa/100 } },tempo) } else { //----------------------- FADE out var pop_alfa = 100 obj.style.opacity = pop_alfa/100 var pop_fade_timer = setInterval(function() { if(pop_alfa<0) { obj.style.opacity = 0 obj.style.visibility = "hidden" clearInterval(pop_fade_timer) } else { pop_alfa = pop_alfa - step obj.style.opacity = pop_alfa/100 } },tempo) } } //#####################################################################