PageSourceSearch

https://velanet.it/js/velanet.js

js velanet.it collected 2026-09-27 02:27:09 UTC 13,308 bytes, 467 lines download raw bytes

1
2var RecaptchaOptions = {
3    theme : 'white',
4    lang : 'it'
5
6 };
7
8
9function menu_toggleInizio(elementID) {
10	aperto = elementID;
11	menu_toggle(elementID);
12}
13
14function menu_toggle(elementID){
15	if(elementID) {
16		for (var i = 1; i <= num_elementi_menu; i++) {
17		var tg = document.getElementById('submenu_'+i).style
18		tg.display = 'none'
19		}
20		var target1 = document.getElementById(elementID)
21		if (target1.style.display == 'none') {
22			target1.style.display = 'block'
23		} else {
24			target1.style.display = 'none'
25		}
26	}
27}
28
29function menu_restoreMenu(elementID) {
30	for (var i = 1; i <= num_elementi_menu; i++) {
31		var tg = document.getElementById('submenu_'+i).style
32		if(tg!=aperto) {
33			tg.display = 'none';
34		}
35	}
36	if(aperto==0) {
37		menu_toggle (elementID);
38	}
39	else  {
40		menu_toggle (aperto);
41	}
42}
43
44function menu_restore(elementID){
45	if(elementID!=aperto) {
46		if(ripristino!=0) {
47			window.clearTimeout(ripristino);
48		}
49		ripristino = window.setTimeout("menu_restoreMenu('"+elementID+"')",3000);
50	}
51}
52
53function menu_restoreEnter(elementID){
54	if(elementID!=aperto) {
55		if(ripristino!=0) {
56			window.clearTimeout(ripristino);
57		}
58		menu_restoreMenu (elementID)
59	}
60}
61
62function toggle1(elementID){
63	var attivo = elementID.substr(elementID.length-1, 1)
64//	alert(attivo)
65
66	for (var i = 1; i <= 4; i++) {
67		var tg = document.getElementById('contenuto'+i).style;
68		tg.display = 'none';
69
70		var NomeLabel = 'label'+i
71		document.getElementById(NomeLabel).src="imgs/base/label_"+i+"_off.gif";
72	}
73
74	var LabelDaCambiare = document.getElementById('label'+attivo)
75	LabelDaCambiare.src = "imgs/base/label_"+attivo+"_on.gif";
76
77var target1 = document.getElementById(elementID)
78if (target1.style.display == 'none') {
79	target1.style.display = 'block'
80	} else {
81	target1.style.display = 'none'
82	}
83}
84
85function apriPopUp(url,stampa,lar,alt,nome) {
86	if(stampa) {
87		larghPopUp = larghPopUpStampa;
88		altPopUp   = altPopUpBase;
89	}
90	else {
91		larghPopUp = larghPopUpBase;
92		altPopUp   = altPopUpBase;
93	}
94	if(alt) {
95		altPopUp = alt;
96	}
97	if(lar) {
98		larghPopUp = lar;
99	}
100        if(nome==undefined) {
101            nome = 'velanet_popup';
102        }
103	finestra= window.open(url,nome,'width='+larghPopUp+',height='+altPopUp+',status=yes,titlebar=no,menubar=yes,hotkeys=no,scrollbars=yes,resizable=yes');
104}
105
106function valida_invio_newsletter() {
107    if(!verificaEmail($('realname').value)) {
108        alert("Inserisci un indirizzo email valido");
109        return false;
110    }
111    else {
112        return true;
113    }
114}
115
116function verificaEmail(testo) {
117	var chiocciola="@";
118	var punto=".";
119	var lch=testo.indexOf(chiocciola);
120	var lstr=testo.length;
121	var lpunto=testo.indexOf(punto);
122	if (lch==-1){
123		return false;
124	}
125	if (lch<2 || lch==lstr){
126		return false;
127	}
128	if (lpunto <1  || lpunto==lstr){
129	    return false;
130	}
131	if (testo.indexOf(chiocciola,(lch+1))!=-1){
132	    return false;
133 	}
134	if (testo.substring(lch-1,lch)==punto || testo.substring(lch+1,lch+2)==punto){
135	    return false;
136 	}
137	if (testo.indexOf(punto,(lch+2))==-1){
138	    return false;
139	}
140	if (testo.indexOf(" ")!=-1){
141    	return false;
142	}
143	return true;
144}
145
146function controllaLuogo() {
147	errori = 0
148	messaggio = "";
149	if(document.getElementById("tipo") && document.getElementById("tipo").selectedIndex==0) {
150        errori +=1;
151        messaggio += "Non è stato indicato il tipo di luogo\n";
152	}
153	if(errori>0)
154		alert(messaggio);
155	else {
156        document.getElementById("velanet").style.cursor="wait";
157        mostraProgress();
158        document.getElementById("luogo").submit();
159    }
160}
161
162function segnalaPorto(campo) {
163	if(campo) {
164		agg='?campo='+campo;
165	}
166	else {
167		agg='';
168	}
169    apriPopUp('/lib/segnalaPorto.php'+agg,true);
170}
171
172function invioSegnalaPorto(campo) {
173	errori = 0
174	messaggio = "";
175	if(document.getElementById("porti_luoghi_1") && !verificaElemento('porti_','luoghi')) {
176		errori +=1;
177		messaggio += "Non è stato indicato il mare di appartenenza\n";
178	}
179	if(document.getElementById("nazione").value.length==0) {
180		errori +=1;
181		messaggio += "Non è stata inserita la nazione\n";
182	}
183	if(document.getElementById("regione").value.length==0) {
184		errori +=1;
185		messaggio += "Non è stata inserita la regione\n";
186	}
187	if(document.getElementById("porto").value.length==0) {
188		errori +=1;
189		messaggio += "Non è stata inserito il porto\n";
190	}
191	if(document.getElementById("campo").value.length>0) {
192            campo = document.getElementById("campo").value;
193        }
194        if(campo!=undefined) {
195		if(window.opener.document.getElementById(campo+"_luoghi_1").selectedIndex==0) {
196			window.opener.document.getElementById(campo+"_luoghi_1").selectedIndex = document.getElementById("porti_luoghi_1").selectedIndex;
197		}
198		window.opener.document.getElementById(campo+'_testo').value=document.getElementById("porto").value;
199		window.opener.document.getElementById(campo+'_label').innerHTML=document.getElementById("porto").value;
200	}
201	if(window.opener.document.getElementById('segnalazione')) {
202		window.opener.document.getElementById('segnalazione').value = 1;
203	}
204	if(errori>0)
205		alert(messaggio);
206	else {
207        mostraProgress();
208		document.getElementById("segnalaporto").submit();
209    }
210}
211
212//Uso standard : onkeypress="controllaMaxCaratteri(this,180);"
213function controllaMaxCaratteri(elemento,numax) {
214    stringa = elemento.value;
215    if (document.getElementById('caratteriusati')) {
216        document.getElementById('caratteriusati').innerHTML = stringa.length;
217    }
218    if(stringa.length>(numax-1)) {
219        errore="Il testo contenuto nel campo \'"+elemento.name+"\' e' troppo lungo.\nIl numero massimo di caratteri per il campo e' "+numax+"; hai inserito "+(stringa.length+2)+" caratteri";
220        alert(errore);
221        elemento.value = stringa.substr(0,numax-2);
222    }
223}
224
225function img(url) {
226	finestra= window.open('/lib/img.php?url='+url,'velanet_popup','width='+larghPopUpBase+',height='+altPopUpBase+',status=yes,titlebar=no,menubar=yes,hotkeys=no,scrollbars=yes,resizable=yes');
227}
228
229function dimRicerca() {
230	tab = document.getElementById('frame');
231	tab.height = window.innerHeight - 270;
232	tab.contentDocument.base.target="_top";
233	self.document.base.target="_top";
234}
235
236function apriTab(num,sub) {
237    totale = getElementsByTagAndClassName('div', 'contenutoTab').length;
238    if(totale>0) {
239        //log("totale "+totale)
240        if(!sub) {
241            sub = 1;
242        }
243        apriSubTab(num,sub);
244        addElementClass('tab'+num,'attivo');
245        showElement('area'+num);
246        mappaCentra();
247        for(k=1;k<=totale;k++) {
248            log('nascondi '+k+'-'+totale);
249            if(k!=num) {
250                if($('tab'+k)) {
251                    hideElement('area'+k);
252                    removeElementClass('tab'+k,'attivo');
253                }
254            }
255        }
256        ScrollTo('tab'+num);
257
258    }
259}
260function apriSubTab(genitore,elemento) {
261    log("sub area"+genitore);
262    totSub = 10;
263    a = getElementsByTagAndClassName('div', 'contenutoSubTab','area'+genitore).length;
264    log('nascondi '+genitore+'_'+elemento+'-'+totSub);
265    if(totSub>0 ) {
266        el = $('areaSub'+genitore+''+elemento);
267        /*log('areaSub'+genitore+''+elemento);
268        log(el);*/
269        while(!el) {
270            if(elemento>totSub) {
271                return;
272            }
273            elemento++;
274            el = $('areaSub'+genitore+''+elemento);
275            /*log('areaSub'+genitore+''+elemento);*/
276        }
277        /*log('apri ' +'areaSub'+genitore+''+elemento)*/
278        e = getElement('areaSub'+genitore+''+elemento);
279        if(e) {
280            showElement('areaSub'+genitore+''+elemento);
281            addElementClass('subTab'+genitore+''+elemento,'attivoSub');
282            for(s=1;s<=totSub;s++) {
283                if(s!=elemento) {
284                    hideElement('areaSub'+genitore+''+s);
285                    if($('subTab'+genitore+''+s) && hasElementClass('subTab'+genitore+''+s,'attivoSub')) {
286                        removeElementClass('subTab'+genitore+''+s,'attivoSub');
287                    }
288                }
289            }
290        }
291    }
292}
293
294function aggiornaOrigine() {
295    if(self.opener) {
296        self.opener.document.location.href =self.opener.document.location.href;
297    }
298}
299
300
301//
302//  Configurationl
303//
304if(Object.extend) {
305    LightboxOptions = Object.extend({
306        fileLoadingImage:        '/imgs/lightbox/loading.gif',
307        fileBottomNavCloseImage: '/imgs/chiudi.gif',
308
309        overlayOpacity: 0.8,   // controls transparency of shadow overlay
310
311        animate: true,         // toggles resizing animations
312        resizeSpeed: 7,        // controls the speed of the image resizing animations (1=slowest and 10=fastest)
313
314        borderSize: 10,         //if you adjust the padding in the CSS, you will need to update this variable
315
316        // When grouping images this is used to write: Image # of #.
317        // Change it for non-english localization
318        labelImage: "Immagine",
319        labelOf: "su"
320    }, window.LightboxOptions || {});
321}
322
323function ricercaLink(sezione) {
324    if(sezione=='it') {
325        $('categoria_www').selectedIndex = 0;
326    }
327    if(sezione=='www') {
328        $('categoria_it').selectedIndex = 0;
329    }
330    $('formlink').submit()
331}
332
333function aggiornaGenitore() {
334    self.opener.document.location.href = self.opener.document.location.href;
335}
336
337function mostraBlocchi(sel) {
338    //sel = $('ricerca').options[$('ricerca').selectedIndex].value;
339    $('selezionato').value = sel;
340    f = getElementsByTagAndClassName("*","blocco_velaitalia") ;
341    for(k=0;k<f.length;k++){
342        if(f[k].id=="ricerca_"+sel) {
343            showElement(f[k]);
344        }
345        else {
346            hideElement(f[k]);
347        }
348    }
349    f = getElementsByTagAndClassName("*","elemento_menu") ;
350    for(k=0;k<f.length;k++){
351        if(f[k].id==sel) {
352            setStyle(f[k],{"border-right":"none"})
353            addElementClass(f[k],"sfondo_"+sel);
354        }
355        else {
356            setStyle(f[k],{"border-right":"1px solid grey"})
357            removeElementClass(f[k],"sfondo_"+f[k].id);
358        }
359    }
360    showElement('bottone_cerca_velaitalia');
361}
362
363function rounded_velaitalia_1() {
364    Rounded('elemento_menu', 10, 10);//, 5, 0)
365}
366function nc_velaitalia_1() {
367    f = getElementsByTagAndClassName("*","elemento_menu") ;
368    s = "li#"+f[0].id;
369    for(k=1;k<f.length;k++) {
370        //log("li#"+f[k].id);
371        s +=",li#"+f[k].id;
372    }
373    Nifty(s,"left normal");
374    s = "div#generale";
375    for(k=0;k<f.length;k++) {
376        s +=",div#ricerca_"+f[k].id;
377    }
378    Nifty(s,"right big");
379}
380function cc_velaitalia_1() {
381    var settings = {
382       tl: { radius: 5 },
383       tr: { radius: 0 },
384       bl: { radius: 5 },
385       br: { radius: 0 },
386       antiAlias: true
387     }
388    f = getElementsByTagAndClassName("*","elemento_menu") ;
389    for(k=0;k<f.length;k++) {
390        curvyCorners(settings, $(f[k].id));
391    }
392}
393
394function cc_velaitalia_blocco(elem) {
395    var settings = {
396       tl: { radius: 0 },
397       tr: { radius: 5 },
398       bl: { radius: 0 },
399       br: { radius: 5 },
400       antiAlias: true
401     }
402    curvyCorners(settings, $(elem));
403}
404
405function ricercaMultipla() {
406    //sel = $('ricerca').options[$('ricerca').selectedIndex].value;
407    sel = $('selezionato').value;
408    f = getElementsByTagAndClassName("*","blocco_velaitalia") ;
409    if(sel=='operatori') {
410        $('ricerca_multipla').action="/link/index.php";
411    }
412    else if(sel=='noleggio') {
413        $('ricerca_multipla').action="/noleggio/ricerca.php/noleggio_1/aziende_1";
414    }
415    else if(sel=='imbarchi') {
416        $('ricerca_multipla').action="/crociere/index.php";
417    }
418    else if(sel=='corsi') {
419        $('ricerca_multipla').action="/corsi/index.php";
420    }
421    else if(sel=='usate') {
422        $('ricerca_multipla').action="/boatonsale/ricerca.php/usate_1/aziende_1";
423    }
424    else if(sel=='nuove') {
425        $('ricerca_multipla').action="/boatonsale/ricerca.php/nuove_1/aziende_1";
426    }
427    else if(sel=='prodotti') {
428        $('ricerca_multipla').action="/operatori/prodotti.php";
429    }
430    else {
431        alert("E' necessario selezionare un'area di ricerca")
432        return;
433    }
434
435    for(k=0;k<f.length;k++){
436        if(f[k].id!="ricerca_"+sel) {
437           removeElement(f[k]);
438        }
439    }
440    $('ricerca_multipla').submit();
441}
442
443
444function gt(url,lingua) {
445    base='http://translate.googleusercontent.com/translate_c?hl=en&sl=it&tl='+lingua+'&u=';
446    if(parent.frames[0]) {
447        fin=parent.frames[0];
448    }
449    else {
450        fin=window;
451    }
452    fin=window;
453    if(lingua=='it') {
454        top.location = url;
455    }
456    else {
457        top.location = base+url;
458    }
459}
460function mostraProgress() {
461	d = getViewportDimensions();
462    v = getViewportPosition();
463	e = {"w":getStyle($('progress'),'width').replace("px",""),"h":getStyle($('progress'),'height').replace("px","")};
464	setElementPosition('progress', {"x":(d.w-e.w)/2,"y":v.y+(d.h-e.h)/2});
465	showElement('progress');
466
467}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.