	//funzione richiamata da articolo.asp
	function Aggiungi() {
		var i
		var strLink
		strLink=""
		f=document.buy;
		for (i = 0; i < f.length; i++) {
			var e = f.elements[i];
			if (e.type == "select-one") {
				if (e.item(e.selectedIndex).value=="") {
					alert ("E' necessario selezionare tutte le caratteristiche !");
					e.focus();
					return;
				}
				strLink = strLink + e.item(e.selectedIndex).value
			}
		}

		if (strLink == "") {
			strLink=document.buy.IDArt.value
			}
		else {
			strLink=document.buy.IDArt.value+"."+strLink
		}
		
		s = document.location.href;
		ret = s.replace(/&/g, "|");
		window.location="carrello/AddCarrello.asp?ID=" + strLink + "&Source=" + ret
	}
	
	function AggiungiDaLista(articolo) {
		var i
		var strLink
		strLink=""
		f=document.buy;
		for (i = 0; i < f.length; i++) {
			var e = f.elements[i];
			if (e.type == "select-one") {
				if (e.item(e.selectedIndex).value=="") {
					alert ("E' necessario selezionare tutte le caratteristiche !");
					e.focus();
					return;
				}
				strLink = strLink + e.item(e.selectedIndex).value
			}
		}

		if (strLink == "") {
			strLink=document.getElementById(articolo).value
			}
		else {
			strLink=document.getElementById(articolo).value+"."+strLink
		}
		
		s = document.location.href;
		ret = s.replace(/&/g, "|");
		window.location="carrello/AddCarrello.asp?ID=" + strLink + "&Source=" + ret
	}


function ControllaEMail(Valore) {
	var r, re;
	var s = Valore;
	re = new RegExp(".+@{1}.+[\.]{1}.+","i");
	if (!(re.test(s))) {
		alert ("L'indirizzo e-mail inserito non è corretto !");
		return false;
	}
	return true;
}

/*
'********************************************************************
Private Function VerificaCF(CF As String) As Boolean
On Error GoTo Errore
Dim strTMP As String
Dim intI As Integer
Dim Somma As Integer
Dim ChrControllo As String
    VerificaCF = True
    For intI = 1 To 6
        strTMP = Mid(CF, intI, 1)
        If strTMP < "A" Or strTMP > "Z" Then
            VerificaCF = False
            Exit Function
        End If
    Next intI
    For intI = 7 To 8
        strTMP = Mid(CF, intI, 1)
        If strTMP < "0" Or strTMP > "9" Then
            VerificaCF = False
            Exit Function
        End If
    Next intI
    strTMP = Mid(CF, 9, 1)
    If strTMP < "A" Or strTMP > "Z" Then
        VerificaCF = False
        Exit Function
    End If
    For intI = 10 To 11
        strTMP = Mid(CF, intI, 1)
        If strTMP < "0" Or strTMP > "9" Then
            VerificaCF = False
            Exit Function
        End If
    Next intI
    strTMP = Mid(CF, 12, 1)
    If strTMP < "A" Or strTMP > "Z" Then
        VerificaCF = False
        Exit Function
    End If
    For intI = 13 To 15
        strTMP = Mid(CF, intI, 1)
        If strTMP < "0" Or strTMP > "9" Then
            VerificaCF = False
            Exit Function
        End If
    Next intI
    
    
    'Controllo Check ultimo valore CF
    Somma = 0
    For intI = 1 To 15
        strTMP = Mid(CF, intI, 1)
        If (intI Mod 2 <> 0) Then
            'Caratteri dispari
            Select Case strTMP
                Case "0", "A": Somma = Somma + 1
                Case "1", "B": Somma = Somma + 0
                Case "2", "C": Somma = Somma + 5
                Case "3", "D": Somma = Somma + 7
                Case "4", "E": Somma = Somma + 9
                Case "5", "F": Somma = Somma + 13
                Case "6", "G": Somma = Somma + 15
                Case "7", "H": Somma = Somma + 17
                Case "8", "I": Somma = Somma + 19
                Case "9", "J": Somma = Somma + 21
                Case "K": Somma = Somma + 2
                Case "L": Somma = Somma + 4
                Case "M": Somma = Somma + 18
                Case "N": Somma = Somma + 20
                Case "O": Somma = Somma + 11
                Case "P": Somma = Somma + 3
                Case "Q": Somma = Somma + 6
                Case "R": Somma = Somma + 8
                Case "S": Somma = Somma + 12
                Case "T": Somma = Somma + 14
                Case "U": Somma = Somma + 16
                Case "V": Somma = Somma + 10
                Case "W": Somma = Somma + 22
                Case "X": Somma = Somma + 25
                Case "Y": Somma = Somma + 24
                Case "Z": Somma = Somma + 23
            End Select
        Else
            'Caratteri pari
            Select Case strTMP
                Case "0", "A": Somma = Somma + 0
                Case "1", "B": Somma = Somma + 1
                Case "2", "C": Somma = Somma + 2
                Case "3", "D": Somma = Somma + 3
                Case "4", "E": Somma = Somma + 4
                Case "5", "F": Somma = Somma + 5
                Case "6", "G": Somma = Somma + 6
                Case "7", "H": Somma = Somma + 7
                Case "8", "I": Somma = Somma + 8
                Case "9", "J": Somma = Somma + 9
                Case "K": Somma = Somma + 10
                Case "L": Somma = Somma + 11
                Case "M": Somma = Somma + 12
                Case "N": Somma = Somma + 13
                Case "O": Somma = Somma + 14
                Case "P": Somma = Somma + 15
                Case "Q": Somma = Somma + 16
                Case "R": Somma = Somma + 17
                Case "S": Somma = Somma + 18
                Case "T": Somma = Somma + 19
                Case "U": Somma = Somma + 20
                Case "V": Somma = Somma + 21
                Case "W": Somma = Somma + 22
                Case "X": Somma = Somma + 23
                Case "Y": Somma = Somma + 24
                Case "Z": Somma = Somma + 25
            End Select
        End If
    Next intI
    Somma = Somma Mod 26
    Select Case Somma
        Case 0: ChrControllo = "A"
        Case 1: ChrControllo = "B"
        Case 2: ChrControllo = "C"
        Case 3: ChrControllo = "D"
        Case 4: ChrControllo = "E"
        Case 5: ChrControllo = "F"
        Case 6: ChrControllo = "G"
        Case 7: ChrControllo = "H"
        Case 8: ChrControllo = "I"
        Case 9: ChrControllo = "J"
        Case 10: ChrControllo = "K"
        Case 11: ChrControllo = "L"
        Case 12: ChrControllo = "M"
        Case 13: ChrControllo = "N"
        Case 14: ChrControllo = "O"
        Case 15: ChrControllo = "P"
        Case 16: ChrControllo = "Q"
        Case 17: ChrControllo = "R"
        Case 18: ChrControllo = "S"
        Case 19: ChrControllo = "T"
        Case 20: ChrControllo = "U"
        Case 21: ChrControllo = "V"
        Case 22: ChrControllo = "W"
        Case 23: ChrControllo = "X"
        Case 24: ChrControllo = "Y"
        Case 25: ChrControllo = "Z"
    End Select
    If ChrControllo <> Mid(CF, 16, 1) Then VerificaCF = False
    
    Exit Function
Errore:
    GestErr.ShowError Err, "VerificaCF", "FormWizaed"
End Function
'********************************************************************

'********************************************************************
Private Function VerificaPIva(PIva As String) As Boolean
On Error GoTo Errore
Dim intTMP As Integer
Dim intI As Integer
Dim Somma As Integer
Dim strTMP As String
    VerificaPIva = True
    For intI = 1 To 11
        strTMP = Mid(PIva, intI, 1)
        If strTMP < "0" Or strTMP > "9" Then
            VerificaPIva = False
            Exit Function
        End If
    Next intI
    
    Somma = 0
    For intI = 1 To 10 Step 2
        Somma = Somma + CInt(Mid(PIva, intI, 1))
    Next intI
    For intI = 2 To 10 Step 2
        intTMP = CInt(Mid(PIva, intI, 1)) * 2
        Somma = Somma + (intTMP \ 10) + (intTMP Mod 10)
    Next intI
    If (Somma Mod 10 = 0) And (CInt(Mid(PIva, 11, 1)) = 0) Then
        VerificaPIva = True
    ElseIf (10 - (Somma Mod 10)) = CInt(Mid(PIva, 11, 1)) Then
        VerificaPIva = True
    Else
        VerificaPIva = False
    End If
    
    Exit Function
Errore:
    GestErr.ShowError Err, "VerificaPIva", "FormWizaed"
End Function
'********************************************************************
*/