function stampapreventivo(){document.getElementById("btnstampa").style.display="none"}function sceglitipo(a){document.getElementById("tipoform").value=a}function cambiaOrdinamentoCategorie(){var d=document.getElementById(["_idcat"]).value;var e=document.getElementById(["_idaz"]).value;var c=document.getElementById(["ciclacambioord"]).value;var a="";for(var b=1;b<c;b++){if(a!=""){a=a+", "+document.getElementById(["txt_cambioord"+b]).value}else{a=document.getElementById(["txt_cambioord"+b]).value}}window.location.href="../controls/ordinamentoprodotti.asp?cmd=cambiaordcat&_idcat"+d+"&_idaz="+e+"&_conta="+c;return false}function cambiaOrdinamento(){var d=document.getElementById(["_idprod"]).value;var e=document.getElementById(["_idaz"]).value;var c=document.getElementById(["ciclacambioord"]).value;var a="";for(var b=1;b<c;b++){if(a!=""){a=a+", "+document.getElementById(["txt_cambioord"+b]).value}else{a=document.getElementById(["txt_cambioord"+b]).value}}window.location.href="../controls/ordinamentoprodotti.asp?cmd=cambiaord&_idprod"+d+"&_idaz="+e+"&_conta="+c;return false}function controllaOrdinamento(a){if(document.getElementById([a]).value==""){alert("Ordinamento obbligatorio");document.getElementById([a]).value=0;return false}if(isNaN(document.getElementById([a]).value)){alert("Attenzione, l'ordinamento deve essere numerico");document.getElementById([a]).value=0;return false}}function controlla_elemento(a){if(a==""){alert("I campi contrassegnati con l'asterisco sono obbligatori");return false}}function controlla_categoria(){nomeCampo1=document.getElementById(["nomelinea"]).value;ciclacategorie=document.getElementById(["ciclacategorie"]).value;var b=0;for(var a=1;a<ciclacategorie+1;a++){if(document.getElementById(["txt_nomecategoria"+a]).value!=""){b=b+1}}if(nomeCampo1==""||b==0){alert("I campi contrassegnati con l'asterisco sono obbligatori");return false}else{return false}}function controlla_prodotto(d,c,e){var a=0;for(var b=1;b<e+1;b++){if(document.getElementById(["txt_nomelinea"+b]).value!=""){a=a+1}}if(d==""||c==""||a==0){alert("I campi contrassegnati con l'asterisco sono obbligatori");return false}}function controlla_commento(a){if(a==""){alert("Il codice č obbligatorio");return false}}function controlla_messaggi(b,c,a){if(b==""||c==""||a==""){alert("I campi contrassegnati con l'asterisco sono obbligatori");return false}}function controllaMailing(b,c,a){if(b==""||c==""||a==""){alert("I campi contrassegnati dall'asterisco sono obbligatori");return false}if(a!=""){if(!(controllaMail(a))){return false}}}function rimuoviFile(a,c,b){document.getElementById(["txt_"+c+b]).value=a}function impostaValore(b,a){var c;c="txt_"+b;document.getElementById([c]).value=a}function impostaValore2(c,a){var b="txt_vis"+c;document.getElementById([b]).value=a}function impostaColore(b,a,c){var d;d="txt_"+b;if(c){document.getElementById([d]).value=a}else{document.getElementById([d]).value=""}}function impostaCategoria(b,a,d){var e;var c;e="txt_"+b;c="txt2_"+b;if(d){document.getElementById([e]).value=a;document.getElementById([c]).value="true"}else{document.getElementById([c]).value="";document.getElementById([c]).value="false"}}function impostaLinea(b,a,d){var e;var c;e="txt_"+b;c="txt2_"+b;if(d){document.getElementById([e]).value=a;document.getElementById([c]).value="true"}else{document.getElementById([c]).value="";document.getElementById([c]).value="false"}}function controllaMail(a){if(a.search(/^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$/)==-1){alert("Il campo email "+a+" non ha un formato valido")}else{return true}}function elimina(){if(!confirm("Procedere con l'eliminazione?")){return false}}function caricaModulo(){if(!confirm("Attenzione!\nCaricando un nuovo file verrā eliminato quello attuale.\nSi vuole procedere?")){return false}}function filtraElenco(c,f,e,d,b){var a=window.location.replace(c+"?_idfilter="+f+"&_idel="+e+"&_idaz="+d+"&_idlay="+b)}function lay_CSS(c,b,a){if(c==""||b==""||a==""){alert("I campi contrassegnati dall'asterisco sono obbligatori");return false}}function lay_Moduli(b,a){if(b==""||a==""){alert("I campi contrassegnati dall'asterisco sono obbligatori");return false}}function apriPostit(e,d,c,b){var a=window.open("../includes/div_popup.asp?_idel="+e+"&_idlay="+d+"&_idaz="+c+"&_idall="+b,"Descrizione","width:200 height:200");a.focus()}function setRedir(c){var b=c;var a=setTimeout('pageRedir("'+b+'")',4000)}function pageRedir(a){document.location.replace(a)}function gestione_inviomailing(b,a){if(b==""||a==""){alert("I campi contrassegnati dall'asterisco sono obbligatori");return false}}function popupDestinatari(){var a=window.open("rubrica.asp","_blank","width=575, height=400, resizable, status, scrollbars")}function inserisciMail(){opener.document.getElementById("Adestinatari").value=document.getElementById("eledestA").value;opener.document.getElementById("CCdestinatari").value=document.getElementById("eledestCC").value;opener.document.getElementById("BCCdestinatari").value=document.getElementById("eledestBCC").value;this.close();opener.document.getElementById("Adestinatari").focus()}function selezionaTutti(k,f){var g="";var a="";var d="";var e=f.name;var c=f.id;var h="";var j=f.checked;if(j){h=true}else{h=false}switch(e){case"A":for(var b=0;b<arrDestinatariA.length;b++){arrDestinatariA[b]=""}arrDestinatariA.sort();for(b=1;b<parseInt(k)+1;b++){arrDestinatariA.push(document.getElementById([e+"mail"+b]).value);document.getElementById([e+"mail"+b]).checked=h}for(var b=0;b<arrDestinatariA.length;b++){if(g==""){g=g+arrDestinatariA[b]}else{g=g+","+arrDestinatariA[b]}}if(j){document.getElementById(["eledest"+e]).value=g}else{document.getElementById(["eledest"+e]).value=""}break;case"CC":for(var b=0;b<arrDestinatariCC.length;b++){arrDestinatariCC[b]=""}arrDestinatariCC.sort();for(b=1;b<parseInt(k)+1;b++){arrDestinatariCC.push(document.getElementById([e+"mail"+b]).value);document.getElementById([e+"mail"+b]).checked=h}for(var b=0;b<arrDestinatariCC.length;b++){if(a==""){a=a+arrDestinatariCC[b]}else{a=a+","+arrDestinatariCC[b]}}if(j){document.getElementById(["eledest"+e]).value=a}else{document.getElementById(["eledest"+e]).value=""}break;case"BCC":for(var b=0;b<arrDestinatariBCC.length;b++){arrDestinatariBCC[b]=""}arrDestinatariBCC.sort();for(b=1;b<parseInt(k)+1;b++){arrDestinatariBCC.push(document.getElementById([e+"mail"+b]).value);document.getElementById([e+"mail"+b]).checked=h}for(var b=0;b<arrDestinatariBCC.length;b++){if(d==""){d=d+arrDestinatariBCC[b]}else{d=d+","+arrDestinatariBCC[b]}}if(j){document.getElementById(["eledest"+e]).value=d}else{document.getElementById(["eledest"+e]).value=""}break}}function aggiungiDestinatari(f){var g="";var a="";var d="";var e=f.name;var c=f.id;var h=f.value;var j=f.checked;document.getElementById(["tutti"+e]).checked=false;if(j){switch(e){case"A":arrDestinatariA.push(h);break;case"CC":arrDestinatariCC.push(h);break;case"BCC":arrDestinatariBCC.push(h);break}}else{switch(e){case"A":for(var b=0;b<arrDestinatariA.length;b++){if(arrDestinatariA[b]==h){arrDestinatariA[b]=""}}arrDestinatariA.sort();break;case"CC":for(var b=0;b<arrDestinatariCC.length;b++){if(arrDestinatariCC[b]==h){arrDestinatariCC[b]=""}}arrDestinatariCC.sort();break;case"BCC":for(var b=0;b<arrDestinatariBCC.length;b++){if(arrDestinatariBCC[b]==h){arrDestinatariBCC[b]=""}}arrDestinatariBCC.sort();break}}switch(e){case"A":for(var b=0;b<arrDestinatariA.length;b++){if(g==""){g=g+arrDestinatariA[b]}else{g=g+","+arrDestinatariA[b]}}document.getElementById(["eledest"+e]).value=g;break;case"CC":for(var b=0;b<arrDestinatariCC.length;b++){if(a==""){a=a+arrDestinatariCC[b]}else{a=a+","+arrDestinatariCC[b]}}document.getElementById(["eledest"+e]).value=a;break;case"BCC":for(var b=0;b<arrDestinatariBCC.length;b++){if(d==""){d=d+arrDestinatariBCC[b]}else{d=d+","+arrDestinatariBCC[b]}}document.getElementById(["eledest"+e]).value=d;break}}function iscrizione_utente(b,g,c,d,a,f,e){if(b==""||g==""||c==""||a==""||f==""||e==""){alert("I campi contrassegnati dall'asterisco sono obbligatori");return false}if(c!=""){if(!(controllaMail(c))){return false}}if(d!=""){if(isNaN(d)){alert("Attenzione, il cap deve essere numerico");return false}}if(e!=f){alert("Attenzione, le due password non coincidono");return false}}function controllaCliente(){var i=document.getElementById(["ragsoc"]).value;var e=document.getElementById(["piva"]).value;var c=document.getElementById(["cf"]).value;var j=document.getElementById(["telefono"]).value;var h=document.getElementById(["email"]).value;var a=document.getElementById(["indirizzo"]).value;var l=document.getElementById(["cap"]).value;var g=document.getElementById(["citta"]).value;var k=document.getElementById(["prov"]).value;var b=document.getElementById(["cap2"]).value;var f=document.getElementById(["txt_pagamento"]).value;var d;d=c;if(i==""||d==""||j==""||h==""||a==""||l==""||g==""||k==""||f!="true"){alert("I campi contrassegnati dall'asterisco sono obbligatori");return false}if(h!=""){if(!(controllaMail(h))){return false}}if(l!=""){if(isNaN(l)){alert("Attenzione, il cap deve essere numerico");return false}}if(b!=""){if(isNaN(b)){alert("Attenzione, il cap deve essere numerico");return false}}}function richiediCatalogo(){var g=document.getElementById(["ragsoc"]).value;var a=document.getElementById(["telefono"]).value;var c=document.getElementById(["email"]).value;var b=document.getElementById(["indirizzo"]).value;var f=document.getElementById(["cap"]).value;var e=document.getElementById(["citta"]).value;var d=document.getElementById(["prov"]).value;if(g==""||a==""||c==""||b==""||f==""||e==""||d==""){alert("I campi contrassegnati dall'asterisco sono obbligatori");return false}if(c!=""){if(!(controllaMail(c))){return false}}if(f!=""){if(isNaN(f)){alert("Attenzione, il cap deve essere numerico");return false}}document.getElementById(["frmrichiedi"]).submit()}function vediCatalogo(b,a){if(document.getElementById([b]).innerHTML=="Apri catalogo"){document.getElementById([b]).innerHTML="Chiudi catalogo";document.getElementById([a]).style.display=""}else{document.getElementById([b]).innerHTML="Apri catalogo";document.getElementById([a]).style.display="none"}};