   	function validateCart()
   	{
   	    intTotal = document.getElementById('intTotal');
   	    
   	    if(intTotal.innerHTML == '0$') 
   	    {
   	        alert("Votre panier d'achat est vide. Ajouter un item pour passer à la caisse.");
   	        return false;
   	    }
   	    
   	    return true;
   	}
   	
   	function validateForm001()
   	{
   		strPrenom = document.getElementById('strPrenom');
   		strNom = document.getElementById('strNom');
   		strEmail = document.getElementById('strEmail');
   		strConfirmEmail = document.getElementById('strConfirmEmail');		
   		strTelephone1 = document.getElementById('strTelephone1');
   		strHearAbout = document.getElementById('strHearAbout');

   		   		
        document.getElementById('strPrenomError').style.display = 'none';
        document.getElementById('strNomError').style.display = 'none';   		
   		document.getElementById('strEmailError').style.display = 'none';
   		document.getElementById('strConfirmEmailError').style.display = 'none';		
   		document.getElementById('strTelephone1Error').style.display = 'none';
   		document.getElementById('strHearAboutError').style.display = 'none';

   		strPrenom.style.borderColor = '#777';
   		strNom.style.borderColor = '#777';
   		strEmail.style.borderColor = '#777';
   		strConfirmEmail.style.borderColor = '#777';		
   		strTelephone1.style.borderColor = '#777';   		
   		strHearAbout.style.borderColor = '#777';   		

		
		if(strPrenom.value == '') 
   		{ 
   		    strPrenom.style.borderColor = 'red';
   		    document.getElementById('strPrenomError').style.display = 'inline';
   		    document.getElementById('strPrenomError').innerHTML = '(requis)'; 
   		    return false;
   		}
   		   		
   		if(strNom.value == '') 
   		{ 
   		    strNom.style.borderColor = 'red';
   		    document.getElementById('strNomError').style.display = 'inline';
   		    document.getElementById('strNomError').innerHTML = '(requis)'; 
   		    return false;
   		}
   		
   		if(strEmail.value == '') 
   		{ 
   		    strEmail.style.borderColor = 'red';
   		    document.getElementById('strEmailError').style.display = 'inline';
   		    document.getElementById('strEmailError').innerHTML = '(requis)'; 
   		    return false;
   		}

   		if(!isValidEmail(strEmail.value)) 
   		{ 
   		    strEmail.style.borderColor = 'red';   		    
   		    document.getElementById('strEmailError').style.display = 'inline';
   		    document.getElementById('strEmailError').innerHTML = '(invalide)'; 
   		    return false;   		
   		}   		   		   		
   		if(strConfirmEmail.value == '') 
   		{ 
   		    strConfirmEmail.style.borderColor = 'red';
   		    document.getElementById('strConfirmEmailError').style.display = 'inline';
   		    document.getElementById('strConfirmEmailError').innerHTML = '(requis)'; 
   		    return false;
   		}
   		if(strEmail.value != strConfirmEmail.value) 
   		{ 
   		 strEmail.style.borderColor = 'red';
   		 strConfirmEmail.style.borderColor = 'red';
   		 document.getElementById('strConfirmEmailError').style.display = 'inline';
   		 document.getElementById('strConfirmEmailError').innerHTML = '(pas identique)'; 
   		 return false;   		
   		}    		
   		if(strTelephone1.value == '') 
   		{ 
   		    strTelephone1.style.borderColor = 'red';
   		    document.getElementById('strTelephone1Error').style.display = 'inline';
   		    document.getElementById('strTelephone1Error').innerHTML = '(requis)'; 
   		    return false;
   		}
   		if(checkInternationalPhone(strTelephone1.value)==false) 
   		{ 
   		    strTelephone1.style.borderColor = 'red';
   		    document.getElementById('strTelephone1Error').style.display = 'inline';
   		    document.getElementById('strTelephone1Error').innerHTML = '(invalide)'; 
   		    return false;
   		}
   		if(strHearAbout.value == '') 
   		{ 
   		    strHearAbout.style.borderColor = 'red';
   		    document.getElementById('strHearAboutError').style.display = 'inline';
   		    document.getElementById('strHearAboutError').innerHTML = '(requis)'; 
   		    return false;
   		}
		
   		   		   		   		   		   		   		
   		return true;
   	}

   	function validateForm008()
   	{
   		strNom = document.getElementById('strNom');
   		strPrenom = document.getElementById('strPrenom');   		
   		strOrganisateur = document.getElementById('strOrganisateur');
   		strEmail = document.getElementById('strEmail');
   		strConfirmEmail = document.getElementById('strConfirmEmail');
   		strEntreprise = document.getElementById('strEntreprise');
   		strTelephone1 = document.getElementById('strTelephone1');
   		strAdresse = document.getElementById('strAdresse');
   		strWantedDate = document.getElementById('strWantedDate');
   		strDuration = document.getElementById('strDuration');
   		strTime = document.getElementById('strTime');
   		strParticipation = document.getElementById('strParticipation');   		
		
		strSalle = document.getElementById("strSalle")
		strAutre = document.getElementById("strAutre")
   		
        document.getElementById('strNomError').style.display = 'none';   		
        document.getElementById('strPrenomError').style.display = 'none';        
        document.getElementById('strOrganisateurError').style.display = 'none';        
   		document.getElementById('strEmailError').style.display = 'none';
   		document.getElementById('strConfirmEmailError').style.display = 'none';
   		document.getElementById('strEntrepriseError').style.display = 'none';   		
   		document.getElementById('strTelephone1Error').style.display = 'none';
   		document.getElementById('strAdresseError').style.display = 'none';
   		document.getElementById('strWantedDateError').style.display = 'none';
   		document.getElementById('strDurationError').style.display = 'none';
   		document.getElementById('strTimeError').style.display = 'none';
   		document.getElementById('strParticipationError').style.display = 'none';
   		
		document.getElementById('strAutreError').style.display = 'none';
   		
   		strNom.style.borderColor = '#777';
   		strPrenom.style.borderColor = '#777';   		
    	strOrganisateur.style.borderColor = '#777';   		
  		strEntreprise.style.borderColor = '#777';
   		strAdresse.style.borderColor = '#777';   		
   		strTelephone1.style.borderColor = '#777';   		   		
   		strEmail.style.borderColor = '#777';
   		strConfirmEmail.style.borderColor = '#777';   		   		        
        strWantedDate.style.borderColor = '#777';   		
        strDuration.style.borderColor = '#777';   		
        strTime.style.borderColor = '#777';   		
   		strParticipation.style.borderColor = '#777';   		
   		
		strAutre.style.borderColor = '#777';   		
 
 
 Focus ="";


   		if(strPrenom.value == '') 
   		{ 
   		    strPrenom.style.borderColor = 'red';
   		    document.getElementById('strPrenomError').style.display = 'inline';
   		    document.getElementById('strPrenomError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strPrenom').focus();
			}

   		    return false;
   		}
   		if(strNom.value == '') 
   		{ 
   		    strNom.style.borderColor = 'red';
   		    document.getElementById('strNomError').style.display = 'inline';
   		    document.getElementById('strNomError').innerHTML = '(requis)'; 
 			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strNom').focus();
			}

  		    return false;
   		}
      	if(strOrganisateur.value == '') 
   		{ 
   		    strOrganisateur.style.borderColor = 'red';
   		    document.getElementById('strOrganisateurError').style.display = 'inline';
   		    document.getElementById('strOrganisateurError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strOrganisateur').focus();
			}

   		    return false;
   		}
		   		   		
   		if(strEntreprise.value == '') 
   		{ 
   		    strEntreprise.style.borderColor = 'red';
   		    document.getElementById('strEntrepriseError').style.display = 'inline';
   		    document.getElementById('strEntrepriseError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEntreprise').focus();
			}

   		    return false;
   		}

   		if(strAdresse.value == '') 
   		{ 
   		    strAdresse.style.borderColor = 'red';
   		    document.getElementById('strAdresseError').style.display = 'inline';
   		    document.getElementById('strAdresseError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strAdresse').focus();
			}

   		    return false;
   		}

   		if(strTelephone1.value == '') 
   		{ 
   		    strTelephone1.style.borderColor = 'red';
   		    document.getElementById('strTelephone1Error').style.display = 'inline';
   		    document.getElementById('strTelephone1Error').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strTelephone1').focus();
			}

   		    return false;
   		}
		
   		if(checkInternationalPhone(strTelephone1.value)==false) 
   		{ 
   		    strTelephone1.style.borderColor = 'red';
   		    document.getElementById('strTelephone1Error').style.display = 'inline';
   		    document.getElementById('strTelephone1Error').innerHTML = '(invalide)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strTelephone1').focus();
			}

   		    return false;
   		}
   		   		   		
   		if(strEmail.value == '') 
   		{ 
   		    strEmail.style.borderColor = 'red';
   		    document.getElementById('strEmailError').style.display = 'inline';
   		    document.getElementById('strEmailError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEmail').focus();
			}

   		    return false;
   		}

   		if(!isValidEmail(strEmail.value)) 
   		{ 
   		    strEmail.style.borderColor = 'red';   		    
   		    document.getElementById('strEmailError').style.display = 'inline';
   		    document.getElementById('strEmailError').innerHTML = '(invalide)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEmail').focus();
			}

   		    return false;   		
   		}   		   		   		
   		
   		if(strEmail.value != strConfirmEmail.value) 
   		{ 
   		    strConfirmEmail.style.borderColor = 'red';
   		    document.getElementById('strConfirmEmailError').style.display = 'inline';
   		    document.getElementById('strConfirmEmailError').innerHTML = '(pas identique)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strEmail').focus();
			}

   		    return false;
   		}
   		   		
   		if(strWantedDate.value == '') 
   		{ 
   		    strWantedDate.style.borderColor = 'red';
   		    document.getElementById('strWantedDateError').style.display = 'inline';
   		    document.getElementById('strWantedDateError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strWantedDate').focus();
			}

   		    return false;
   		}

   		if(strTime.selectedIndex == 0) 
   		{ 
   		    strTime.style.borderColor = 'red';
   		    document.getElementById('strTimeError').style.display = 'inline';
   		    document.getElementById('strTimeError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strTime').focus();
			}

   		    return false;
   		}   		

   		if(strDuration.selectedIndex == 0) 
   		{ 
   		    strDuration.style.borderColor = 'red';
   		    document.getElementById('strDurationError').style.display = 'inline';
   		    document.getElementById('strDurationError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strDuration').focus();
			}

   		    return false;
   		}   		
   		   		   		
   		if(strParticipation.selectedIndex == 0) 
   		{ 
   		    strParticipation.style.borderColor = 'red';
   		    document.getElementById('strParticipationError').style.display = 'inline';
   		    document.getElementById('strParticipationError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strParticipation').focus();
			}

   		    return false;
   		}
		
   		if(strSalle.value == 'Autre') 
   		{ 
		
			if(strAutre == '')
			{
				alert("bobautre")
					strAutre.style.borderColor = 'red';
					document.getElementById('strAutreError').style.display = 'inline';
					document.getElementById('strAutreError').innerHTML = '(requis)'; 
			
			if(Focus=="")
			{
				Focus = "true"
				document.getElementById('strAutre').focus();
			}

					return false;
			}
   		}


   		   		   		   		   		   		   		
   		return true;
   	}
   	
   	function validateForm002()
   	{
   		strEmail = document.getElementById('strEmail');
   		strConfirmEmail = document.getElementById('strConfirmEmail');
   		ChkTPR = document.getElementById('TPR');
		ChkYanWeb = document.getElementById('YanWeb');
		ChkListeChoix = document.getElementById('ListeChoix');
		
		
   		document.getElementById('strEmailError').style.display = 'none';
   		document.getElementById('strConfirmEmailError').style.display = 'none';
   		document.getElementById('ListeChoixError').style.display = 'none';
   		ChkListeChoix.style.borderColor = 'black';
   		strEmail.style.borderColor = 'black';
   		strConfirmEmail.style.borderColor = 'black';
   		
   		if(strEmail.value == '') 
   		{ 
   		    strEmail.style.borderColor = 'red';
   		    document.getElementById('strEmailError').style.display = 'inline';
   		    document.getElementById('strEmailError').innerHTML = '(requis)'; 
   		    return false;
   		}

   		if(!isValidEmail(strEmail.value)) 
   		{ 
   		    strEmail.style.borderColor = 'red';   		    
   		    document.getElementById('strEmailError').style.display = 'inline';
   		    document.getElementById('strEmailError').innerHTML = '(invalide)'; 
   		    return false;   		
   		}   		   		   		
   		
   		if(strConfirmEmail.value == '') 
   		{ 
   		    strConfirmEmail.style.borderColor = 'red';
   		    document.getElementById('strConfirmEmailError').style.display = 'inline';
   		    document.getElementById('strConfirmEmailError').innerHTML = '(requis)'; 
   		    return false;
   		}
   		   		
   		if(strEmail.value != strConfirmEmail.value) 
   		{ 
   		 strEmail.style.borderColor = 'red';
   		 strConfirmEmail.style.borderColor = 'red';
   		 document.getElementById('strConfirmEmailError').style.display = 'inline';
   		 document.getElementById('strConfirmEmailError').innerHTML = '(pas identique)'; 
   		 return false;   		
   		} 
		
		if(ChkTPR.checked || ChkYanWeb.checked )
		{
		}else{
			 ChkListeChoix.style.border = 'red 1px solid';
			 document.getElementById('ListeChoixError').style.display = 'inline';
			 document.getElementById('ListeChoixError').innerHTML = '(Veuillez choisir au moins une des listes)'; 

			return false;
		}

   		   		
   		return true;
   	}
   	
   	function isValidEmail(str) 
   	{
        return (str.lastIndexOf(".") > 2) && (str.indexOf("@") > 0) && (str.lastIndexOf(".") > (str.indexOf("@")+1)) && (str.indexOf("@") == str.lastIndexOf("@"));
    }
	
function checkLearnedAbout()
{
    var eLearnedAbout = document.getElementById("strSalle");
    var eSpan = document.getElementById("SalleOther");
    var eLearnedAboutOther = document.getElementById("strAutre");
    if(eLearnedAbout.value == 'Autre')
    {
        eSpan.style.display = 'block';
    }else{
        eSpan.style.display = 'none';
        eLearnedAboutOther.value = '';
    }
}
/*  PHONE VALIDATION*/

var digits = "0123456789";
// non-digit characters which are allowed in phone numbers
var phoneNumberDelimiters = "()- ";
// characters which are allowed in international phone numbers
// (a leading + is OK)
var validWorldPhoneChars = phoneNumberDelimiters + "+";
// Minimum no of digits in an international phone no.
var minDigitsInIPhoneNumber = 10;

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;
    }
    return true;
}
function trim(s)
{   var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not a whitespace, append to returnString.
    for (i = 0; i < s.length; i++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (c != " ") returnString += c;
    }
    return returnString;
}
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++)
    {   
        // Check that current character isn't whitespace.
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function checkInternationalPhone(strPhone){
	var bracket=3
	strPhone=trim(strPhone)
	if(strPhone.indexOf("+")>1) return false
	if(strPhone.indexOf("-")!=-1)bracket=bracket+1
	if(strPhone.indexOf("(")!=-1 && strPhone.indexOf("(")>bracket)return false
	var brchr=strPhone.indexOf("(")
	if(strPhone.indexOf("(")!=-1 && strPhone.charAt(brchr+2)!=")")return false
	if(strPhone.indexOf("(")==-1 && strPhone.indexOf(")")!=-1)return false
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}