function checkRequiredFields(input, language)
{
	var Msg_Fr = "\nLes champs marqués d'un \"!\"sont requis pour compléter le formulaire.\nCes champs sont requis: \n   ";
	var Msg_En = "\nThe field marked with a \"!\" are required to complete the process.\nThis field must have a value to submit: \n   ";
	var NumCarte_Fr = "Vous devez inscrire le numéro de carte et la date d'expiration";
	var NumCarte_En = "You have to give the number and the expiratino date of the card";
	var CarteExp_Fr = "Vous devez inscrire la date d'expiration";
	var CarteExp_En = "You have to give the expiration date";
	
    var requiredFields = new Array("nom, prenom, coderegional, Numerotel");
    var fieldCheck   = true;
    
    if (language == "Fr")
    {
		var fieldNames = new Array("1988-01", "1988-02", "1988-03", "1988-04", "1989-01", "1989-02", "1989-03", "1989-04", "1990-01", "1990-02",	"1990-03", "1990-04", "1991-01", "1991-02", "1991-03", "1991-04", "1992-01", "1992-02", "1992-03", "1992-04", "1993-01", "1993-02", 
		"1993-03", "1993-04", "1994-01", "1994-02", "1994-03", "1994-04", "1995-01", "1995-02", "1995-03", "1995-04", "1996-01", "1996-02", 
		"1996-03", "1996-04", "1997-01", "1997-02", "1997-03", "1997-04", "1998-01", "1998-02", "1998-03", "1998-04", "1999-01", "1999-02", 
		"1999-03", "1999-04", "2000-01", "2000-02", "2000-03", "2000-04", "2001-01", "2001-02", "2001-03", "2001-04", "2002-01", "2002-02", 
		"2002-03", "2002-04", "2003-01", "2003-02", "2003-03", "2003-04", "2004-01", "2004-02", "2004-03", "2004-04", "2005-01", "2005-02", 
		"2005-03", "2005-4", "nom", "prenom", "coderegional", "Numerotel", "Rueappartement", "Ville", "ProvEtat", "Codepostal", "instructions");
		var fieldsNeeded = Msg_Fr;
		var NumCarte = NumCarte_Fr;
		var CarteExp = CarteExp_Fr;
	} 
	else
	{
		var fieldNames = new Array("1988-01", "1988-02", "1988-03", "1988-04", "1989-01", "1989-02", "1989-03", "1989-04", "1990-01", "1990-02",	"1990-03", "1990-04", "1991-01", "1991-02", "1991-03", "1991-04", "1992-01", "1992-02", "1992-03", "1992-04", "1993-01", "1993-02", 
		"1993-03", "1993-04", "1994-01", "1994-02", "1994-03", "1994-04", "1995-01", "1995-02", "1995-03", "1995-04", "1996-01", "1996-02", 
		"1996-03", "1996-04", "1997-01", "1997-02", "1997-03", "1997-04", "1998-01", "1998-02", "1998-03", "1998-04", "1999-01", "1999-02", 
		"1999-03", "1999-04", "2000-01", "2000-02", "2000-03", "2000-04", "2001-01", "2001-02", "2001-03", "2001-04", "2002-01", "2002-02", 
		"2002-03", "2002-04", "2003-01", "2003-02", "2003-03", "2003-04", "2004-01", "2004-02", "2004-03", "2004-04", "2005-01", "2005-02", 
		"2005-03", "2005-4", "name", "firstname", "areacode", "phonenumber", "st-app", "City", "Prov-State", "Postalcode", "instructions");
		var fieldsNeeded = Msg_En;
		var NumCarte = NumCarte_En;
		var CarteExp = CarteExp_En;
	}
   
    
    for(var fieldNum=0; fieldNum < requiredFields.length; fieldNum++) {
        if ((input.elements[requiredFields[fieldNum]].value == "") ||
            (input.elements[requiredFields[fieldNum]].value == " ")) {
            fieldsNeeded += fieldNames[fieldNum] + "\n   ";
            fieldCheck = false;
        }
    }

    // ALL REQUIRED FIELDS HAVE BEEN ENTERED
    if (fieldCheck == true)
    {
		if (input.typecarte.value != '-')
		{
			if (input.numcarte.value == '')
			{
				alert(NumCarte);
				return false;
			}
			else
			{
				if(input.expiration.value == '')
				{
					alert(CarteExp);
					return false;
				}
				else
				{
				 return true;	
				}
			}
		}
       return true;
    }
    // SOME REQUIRED FIELDS ARE MISSING VALUES
    else
    { 
        alert(fieldsNeeded);
        return false;
    }
}

