/*** BEGIN - conditions  ***/
function openWinCondition(value)
{
if (value==1) {
	Cond = window.open('conditions_en.asp','Cond','width=540,height=300,toolbar=no,scrollbars=yes,status=no');
} else {
	Cond = window.open('conditions_en.asp','Cond','width=540,height=300,toolbar=no,scrollbars=yes,status=no');
}
Cond.focus();
}
/*** END - conditions***/

function contains(onechar,lstring)
{
retval=false
for (var i=1;i<=lstring.length;i++)
        {
        if (lstring.substring(i,i+1)==onechar)
                {
                retval=true
                break
                }
        }
return retval
}


function myForm_Validator(theForm) {
theForm = document.myForm;


/*  conditions for RT */

if (theForm.uti_secteur1.checked == false && theForm.uti_secteur2.checked == false) {
alert("No \"EVENT\" selected. Please complete.");
theForm.uti_secteur1.focus();
return (false);
}

if (theForm.uti_secteur1.checked == true && theForm.uti_secteur2.checked == true) {
    alert("Only one option can be choosen. Please complete.");
	theForm.uti_secteur2.focus();
    return (false);
    }
	

/* china*/
/*
if (theForm.uti_secteur2.checked == true || theForm.uti_secteur3.checked == true) {
     alert("As a brazilian company, only one option can be choosen. Please complete.");
	theForm.uti_secteur2.focus();
    return (false);
    }
if (theForm.uti_secteur4.checked == true && theForm.uti_secteur5.checked == true) {
    alert("As a non-Brazilian company, only one option can be choosen. Please complete.");
	theForm.uti_secteur4.focus();
    return (false);
    }

if ((theForm.uti_secteur2.checked == true && theForm.uti_secteur4.checked == true) || (theForm.uti_secteur2.checked == true && theForm.uti_secteur5.checked == true) || (theForm.uti_secteur3.checked == true && theForm.uti_secteur4.checked == true) || (theForm.uti_secteur3.checked == true && theForm.uti_secteur5.checked == true)) {
    alert("Are a non-Brazilian and a brazilian company at the same time! only one option can be choosen. Please complete.");
	theForm.uti_secteur4.focus();
    return (false);
    }
*/
/*
if (theForm.uti_secteur3.checked == false && theForm.uti_secteur4.checked == false) {
     alert("At least one price must be selected! Please complete.");
	theForm.uti_secteur3.focus();
    return (false);
    }
*/	
/*  conditions for RT */

if (theForm.uti_prenom.value == "")
{
    alert("No \"First Name\" entered. Please complete.");
	// alert ("No event for the moment. Please come back later.");
    theForm.uti_prenom.focus();
    return (false);
}

if (theForm.uti_nom.value == "")
{
    alert("No \"Last Name\" entered. Please complete.");
    theForm.uti_nom.focus();
    return (false);
}
if (theForm.uti_email.value == "")
{
    alert("No \"Email\" entered. Please complete.");
    theForm.uti_email.focus();
    return (false);
}
if (contains("@",theForm.uti_email.value) && contains(".",theForm.uti_email.value))
  {
  //return (true)
  }
  else
  {
    alert("This email address is not valid. Please check.");
    theForm.uti_email.focus();
   return (false);
  }
if (theForm.uti_tel.value == "")
{
    alert("No \"Phone number\" entered. Please complete.");
    theForm.uti_tel.focus();
    return (false);
}
if (theForm.uti_nom_company.value == "")
{
    alert("No \"Name of the company\" entered. Please complete.");
    theForm.uti_nom_company.focus();
    return (false);
}

//uti_adresse_1, uti_adresse_2 (no check)

if (theForm.uti_adresse_1.value == "")
{
    alert("No \"Address\" entered. Please complete.");
    theForm.uti_adresse_1.focus();
    return (false);
}
//uti_adresse_cp (no check)
if (theForm.uti_adresse_cp.value == "")
{
    alert("No \"Zip code\" entered. Please complete.");
    theForm.uti_adresse_cp.focus();
    return (false);
}
if (theForm.uti_adresse_ville.value == "")
{
    alert("No \"City\" entered. Please complete.");
    theForm.uti_adresse_ville.focus();
    return (false);
}
//uti_etat (no check)
  if ((theForm.uti_pays_en.selectedIndex <= 0 ))//
  {
    alert("No \"Country\" entered. Please complete.");
    theForm.uti_pays_en.focus();
    return (false);
  }
/*
//purchase_order_number
  if ((theForm.uti_purchase_order_number.selectedIndex <= 0 ))//
  {
    alert("Please select Yes or No!");
    theForm.uti_purchase_order_number.focus();
    return (false);
  }
*/
/*
if (theForm.uti_name_accounts.value == "")
{
    alert("No \"Contact name in Accounts\" entered. Please complete.");
    theForm.uti_name_accounts.focus();
    return (false);
}
*/
// Condition acceptée -------------------
  if (theForm.uti_accept_terms.checked == false )
  {
    alert("You must accept our terms and conditions !\n");
    theForm.uti_accept_terms.focus();
    return (false);
  }
//end check
}