function DropDownMenu(entered) { // ********** DROP DOWN MENU (c) Henrik Petersen / NetKontoret - All rights reserved **************** // The script is explained along with other useful scripts at: http://www.echoecho.com/javascript.htm // You may freely use this script as long as you do not remove this line and the 2 lines above. with (entered) { ref=options[selectedIndex].value; splitcharacter=ref.lastIndexOf("$"); if (splitcharacter!=-1) {loc=ref.substring(0,splitcharacter); target=ref.substring(splitcharacter+1,1000).toLowerCase();} else {loc=ref; target="_self";}; lowloc=loc.toLowerCase(); if (lowloc=="false") {return;} if (target=="_self") {document.location=loc;} else {if (target=="_top") {top.location=loc;} else {if (target=="_blank") {window.open(loc);} else{if (target=="_parent") {parent.location=loc;} else {parent.frames[target].location=loc;}; } } } } } function eliminacarrello(id) { if(confirm("Attenzione. Il record verrà eliminato dal carrello della spesa definitivamente.")) { logout() parent.iframe.location.href = "update_carrello.asp?elimina=si&idcarrello="+id; } else { document.getElementById('C'+id).checked=false; } } function aggiornacarrello(quantita,id,vecchia) { if(confirm("Attenzione. Desideri modificare la quantità?")) { logout() parent.iframe.location.href = "update_carrello.asp?quantita="+quantita+"&idcarrello="+id; } else {document.getElementById('Q'+id).value=vecchia;} } function invialoc(variabile){ window.location=variabile } function slide(id){ $("#"+id).slideToggle("slow"); } function apriscelta(codice) { div="mask"+codice; $("#"+div).slideDown("slow"); Richiesta(codice,'/prep_carr.asp',div,''); } function prova(anchorname,variabile,pagina,dove) { var coordinates; if (this.type == "WINDOW") { coordinates = getAnchorWindowPosition(anchorname); } else { coordinates = getAnchorPosition(anchorname); } this.x = coordinates.x; this.y = coordinates.y; top_pos=this.y-156; left_pos=this.x-77; //alert (altezza); document.getElementById(dove).style.top = top_pos + "px"; document.getElementById(dove).style.left = left_pos + "px"; if (dove != "") { document.getElementById(dove).style.visibility = "visible"; document.getElementById(dove).style.display = "block"; Richiesta(variabile,pagina,dove,''); } } function caricafoto(tabella,valore,nomecampo,div) { document.form3.action='up_file.asp?valore='+valore+'&tabella='+tabella+'&nomecampo='+nomecampo+'&div='+div; document.form3.submit(); } function chiudi(dove) { $("#"+dove).slideUp("slow"); } function cambiacolore(id,colore) { //alert(id) document.getElementById(id).style.backgroundColor=colore; } /** * DHTML date validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/) */ // Declaring valid date character, minimum year and maximum year var dtCh= "/"; var minYear=1900; var maxYear=2100; function isInteger(s){ var i; for (i = 0; i < s.length; i++){ // Check that current character is number. var c = s.charAt(i); if (((c < "0") || (c > "9"))) return false; } // All characters are numbers. return true; } function stripCharsInBag(s, bag){ var i; var returnString = ""; // Search through string's characters one by one. // If character is not in bag, append to returnString. for (i = 0; i < s.length; i++){ var c = s.charAt(i); if (bag.indexOf(c) == -1) returnString += c; } return returnString; } function daysInFebruary (year){ // February has 29 days in any year evenly divisible by four, // EXCEPT for centurial years which are not also divisible by 400. return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 ); } function DaysArray(n) { for (var i = 1; i <= n; i++) { this[i] = 31 if (i==4 || i==6 || i==9 || i==11) {this[i] = 30} if (i==2) {this[i] = 29} } return this } function isDate(dtStr){ var daysInMonth = DaysArray(12) var pos1=dtStr.indexOf(dtCh) var pos2=dtStr.indexOf(dtCh,pos1+1) var strMonth=dtStr.substring(pos1+1,pos2) var strDay=dtStr.substring(0,pos1) var strYear=dtStr.substring(pos2+1) strYr=strYear if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1) if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1) for (var i = 1; i <= 3; i++) { if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1) } month=parseInt(strMonth) day=parseInt(strDay) year=parseInt(strYr) if (pos1==-1 || pos2==-1){ alert("The date format should be : mm/dd/yyyy") return false } if (strMonth.length<1 || month<1 || month>12){ alert("S'il vous plaît entrer un mois valable") return false } if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){ alert("S'il vous plaît entrer un jour en cours de validité") return false } if (strYear.length != 4 || year==0 || yearmaxYear){ alert("S'il vous plaît entrer un valide 4 chiffres entre "+minYear+" et "+maxYear) return false } if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){ alert("S'il vous plaît entrer une date valide") return false } return true } function Form55_Validator(theForm) { if ( theForm.ricerca.value == "" ) { alert("Il campo ricerca non può essere vuoto."); theForm.ricerca.focus(); return (false); } return (true); } function Form75_Validator(theForm) { if ( theForm.email.value == "" ) { alert("Il campo e-mail non può essere vuoto"); theForm.email.focus(); return (false); } return (true); } function Form10_Validator(theForm) { if ( theForm.email.value == "" ) { alert("Il campo e-mail non può essere vuoto"); theForm.email.focus(); return (false); } if ( theForm.password.value == "" ) { alert("Il campo password non può essere vuoto."); theForm.password.focus(); return (false); } //chiudi('boxlogin'); document.getElementById('backgroundPopup').style.display ="block"; document.getElementById('loader').style.display ="block"; return (true); } function isnum(obj) { if (isNaN(obj.value) || parseInt(obj.value)<0 || parseInt(obj.value) > 99999999999) { alert('Solo numeri sono accettati.'); obj.value=""; obj.focus(); } } function controllacarrello(theForm) { if (theForm.quantita.value==0) { alert("La quantità minima deve essere 1 prodotto") theForm.quantita.focus(); return (false); } somma=theForm.quantita.value if (isNaN(somma) || parseInt(somma)<0 || parseInt(somma) > 99999999999) { alert('Solo numeri sono accettati.'); return (false); } return (true); } function controllacarrellomultiplo(theForm) { somma=0; for (i=0; i 99999999999) { alert('Solo numeri sono accettati.'); return (false); } return (true) } function Form1_Validator(theForm) { if ( theForm.azienda.value != "" && theForm.piva.value == "") { alert("Il campo partita iva è obbligatorio"); theForm.piva.focus(); return (false); } if ( theForm.nome.value == "") { alert("Il campo Nome non può essere vuoto."); theForm.nome.focus(); return (false); } if ( theForm.cognome.value == "") { alert("Il campo Cognome non può essere vuoto."); theForm.cognome.focus(); return (false); } if ( theForm.indirizzo.value == "") { alert("Il campo Indirizzo deve essere inserito."); theForm.indirizzo.focus(); return (false); } if ( theForm.cap.value == "") { alert("Il campo Cap deve essere inserito."); theForm.cap.focus(); return (false); } if ( theForm.citta.value == "") { alert("Il campo Città non può essere vuoto"); theForm.citta.focus(); return (false); } if ( theForm.sigla_prov.value == "" ) { alert("Il campo provincia non può essere vuoto."); theForm.sigla_prov.focus(); return (false); } if ( theForm.sigla.value == "" ) { alert("Scegliere una nazione dall'elenco"); theForm.sigla.focus(); return (false); } if ( theForm.email.value == "") { alert("Il campo e-mail non può essere vuoto"); theForm.email.focus(); return (false); } if (theForm.email.value.indexOf("@") == -1) { alert("L'indirizzo email è errato."); theForm.email.value=""; theForm.email.focus(); return (false); } if (theForm.email.value.indexOf(".") == -1) { alert("L'indirizzo email è errato."); theForm.email.value=""; theForm.email.focus(); return (false); } if (theForm.email.value.length < 7) { alert("L'indirizzo email è errato."); theForm.email.value=""; theForm.email.focus(); return (false); } if ( theForm.password.value == "" ) { alert("Il campo password non può essere vuoto."); theForm.password.focus(); return (false); } if ( theForm.privacy.value == "0" ) { alert("E' necessario acconsentire alla privacy per poter effettuare l'invio"); theForm.privacy.focus(); return (false); } //chiudi('boxlogin'); document.getElementById('backgroundPopup').style.display ="block"; document.getElementById('loader').style.display ="block"; return (true); } function logout() { document.getElementById('backgroundPopup').style.display ="block"; document.getElementById('loader').style.display ="block"; } function aggiorna_pagamento(idcostopagamento) { //logout() window.location='spedizione.asp?idcosto_pagamento='+idcostopagamento } function Form19_Validator(theForm) { if ( theForm.nome.value == "") { alert("Il campo Nome non può essere vuoto."); theForm.nome.focus(); return (false); } if ( theForm.cognome.value == "") { alert("Il campo Cognome non può essere vuoto."); theForm.cognome.focus(); return (false); } if ( theForm.indirizzo.value == "") { alert("Il campo Indirizzo deve essere inserito."); theForm.indirizzo.focus(); return (false); } if ( theForm.cap.value == "") { alert("Il campo Cap deve essere inserito."); theForm.cap.focus(); return (false); } if ( theForm.citta.value == "") { alert("Il campo Città non può essere vuoto"); theForm.citta.focus(); return (false); } if ( theForm.idnazione.value == "") { alert("Scegliere una nazione dall'elenco"); theForm.idnazione.focus(); return (false); } return (true); }