// showContext

function BasculDISTRI(){
	document.FORM1.CODE_PROFESSION_DISTRI.disabled=false;
	document.FORM1.CODE_PROFESSION_ET.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_GP.disabled=true;
	document.FORM1.CODE_PROFESSION_GP.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_INV.disabled=true;
	document.FORM1.CODE_PROFESSION_INV.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_MEO.disabled=true;
	document.FORM1.CODE_PROFESSION_MEO.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_PRES.disabled=true;	
	document.FORM1.CODE_PROFESSION_PRES.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_SYND.disabled=true;	
	document.FORM1.CODE_PROFESSION_SYND.options.selectedIndex=0;
}	
function BasculEDF(){
	document.FORM1.CODE_PROFESSION_DISTRI.disabled=true;
	document.FORM1.CODE_PROFESSION_DISTRI.options.selectedIndex=0;	
	document.FORM1.CODE_PROFESSION_ET.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_GP.disabled=true;
	document.FORM1.CODE_PROFESSION_GP.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_INV.disabled=true;
	document.FORM1.CODE_PROFESSION_INV.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_MEO.disabled=true;
	document.FORM1.CODE_PROFESSION_MEO.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_PRES.disabled=true;	
	document.FORM1.CODE_PROFESSION_PRES.options.selectedIndex=0;	
	document.FORM1.CODE_PROFESSION_SYND.disabled=true;	
	document.FORM1.CODE_PROFESSION_SYND.options.selectedIndex=0;
}	
function BasculET(){
	document.FORM1.CODE_PROFESSION_DISTRI.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.disabled=false;
	document.FORM1.CODE_PROFESSION_DISTRI.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_GP.disabled=true;
	document.FORM1.CODE_PROFESSION_GP.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_INV.disabled=true;
	document.FORM1.CODE_PROFESSION_INV.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_MEO.disabled=true;
	document.FORM1.CODE_PROFESSION_MEO.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_PRES.disabled=true;	
	document.FORM1.CODE_PROFESSION_PRES.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_SYND.disabled=true;	
	document.FORM1.CODE_PROFESSION_SYND.options.selectedIndex=0;	
}	
function BasculGP(){
	document.FORM1.CODE_PROFESSION_DISTRI.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_GP.disabled=false;
	document.FORM1.CODE_PROFESSION_DISTRI.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_INV.disabled=true;
	document.FORM1.CODE_PROFESSION_INV.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_MEO.disabled=true;
	document.FORM1.CODE_PROFESSION_MEO.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_PRES.disabled=true;	
	document.FORM1.CODE_PROFESSION_PRES.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_SYND.disabled=true;	
	document.FORM1.CODE_PROFESSION_SYND.options.selectedIndex=0;	
}	
function BasculINV(){
	document.FORM1.CODE_PROFESSION_DISTRI.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_GP.disabled=true;
	document.FORM1.CODE_PROFESSION_GP.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_INV.disabled=false;
	document.FORM1.CODE_PROFESSION_DISTRI.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_MEO.disabled=true;
	document.FORM1.CODE_PROFESSION_MEO.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_PRES.disabled=true;	
	document.FORM1.CODE_PROFESSION_PRES.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_SYND.disabled=true;	
	document.FORM1.CODE_PROFESSION_SYND.options.selectedIndex=0;	
}	
function BasculMEO(){
	document.FORM1.CODE_PROFESSION_DISTRI.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_GP.disabled=true;
	document.FORM1.CODE_PROFESSION_GP.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_INV.disabled=true;
	document.FORM1.CODE_PROFESSION_INV.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_MEO.disabled=false;
	document.FORM1.CODE_PROFESSION_DISTRI.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_PRES.disabled=true;	
	document.FORM1.CODE_PROFESSION_PRES.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_SYND.disabled=true;	
	document.FORM1.CODE_PROFESSION_SYND.options.selectedIndex=0;	
}	
function BasculPRES(){
	document.FORM1.CODE_PROFESSION_DISTRI.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_GP.disabled=true;
	document.FORM1.CODE_PROFESSION_GP.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_INV.disabled=true;
	document.FORM1.CODE_PROFESSION_INV.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_MEO.disabled=true;
	document.FORM1.CODE_PROFESSION_MEO.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_PRES.disabled=false;	
	document.FORM1.CODE_PROFESSION_DISTRI.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_SYND.disabled=true;	
	document.FORM1.CODE_PROFESSION_SYND.options.selectedIndex=0;	
}
function BasculSYND(){
	document.FORM1.CODE_PROFESSION_DISTRI.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.disabled=true;
	document.FORM1.CODE_PROFESSION_ET.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_GP.disabled=true;
	document.FORM1.CODE_PROFESSION_GP.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_INV.disabled=true;
	document.FORM1.CODE_PROFESSION_INV.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_MEO.disabled=true;
	document.FORM1.CODE_PROFESSION_MEO.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_PRES.disabled=true;	
	document.FORM1.CODE_PROFESSION_DISTRI.options.selectedIndex=0;
	document.FORM1.CODE_PROFESSION_SYND.disabled=false;	
	document.FORM1.CODE_PROFESSION_PRES.options.selectedIndex=0;	
}

function jsStringReplacejsCheckDate(strOriginal , strFind, strReplace)  {
  var intPos = 0;
  var intLen = strFind.length;
  intPos = strOriginal.indexOf(strFind);
  while (intPos != -1) {
    strOriginal = strOriginal.substring(0, intPos) + strReplace + strOriginal.substring(intPos+intLen, strOriginal.length);
    intPos = strOriginal.indexOf(strFind);
  };
  return strOriginal;
}
function jsTestCeiljsCheckDateFormat(Nbre)  {
 if (Nbre==Math.ceil(Nbre)) {
    return true; 
 } else { 
    return false;
 }
}
function jsStringReplacejsCheckDateFormat(strOriginal , strFind, strReplace)  {
  var intPos = 0;
  var intLen = strFind.length;
  intPos = strOriginal.indexOf(strFind);
  while (intPos != -1) {
    strOriginal = strOriginal.substring(0, intPos) + strReplace + strOriginal.substring(intPos+intLen, strOriginal.length);
    intPos = strOriginal.indexOf(strFind);
  };
  return strOriginal;
}
function jsCheckDateFormat(strDate, strFormat)  {
 var D;
 var M;
 var Y;
 var div4;
 var div100;
 var div400;
 var bTest = false;
  bTest = false;  if ((strFormat=='dd.mm.yyyy') || (strFormat=='dd.mm.yy') || (strFormat=='mm.dd.yyyy') || (strFormat=='mm.dd.yy') || (strFormat=='d.m.yyyy') || (strFormat=='d.m.yy') || (strFormat=='m.d.yyyy') || (strFormat=='m.d.yy'))
  {    bTest = true;    strDate = jsStringReplacejsCheckDateFormat(strDate, '.', '/');
    strFormat = jsStringReplacejsCheckDateFormat(strFormat, '.', '/');
  }  if (!bTest && ((strFormat=='dd-mm-yyyy') || (strFormat=='dd-mm-yy') || (strFormat=='mm-dd-yyyy') || (strFormat=='mm-dd-yy') || (strFormat=='d-m-yyyy') || (strFormat=='d-m-yy') || (strFormat=='m-d-yyyy') || (strFormat=='m-d-yy')))
  {    bTest = true;    strDate = jsStringReplacejsCheckDateFormat(strDate, '-', '/');
    strFormat = jsStringReplacejsCheckDateFormat(strFormat, '-', '/');
  }  if (!bTest && ((strFormat=='ddmmyyyy') || (strFormat=='mmddyyyy') || (strFormat=='ddmmyy') || (strFormat=='mmddyy')))
  {    strDate = strDate.substring(0, 2) + '/' + strDate.substring(2, 4) +  '/' + strDate.substring(4, strDate.length);
    strFormat = strFormat.substring(0, 2) + '/' + strFormat.substring(2, 4) +  '/' + strFormat.substring(4, strFormat.length);
  } p1 = strDate.indexOf('/');
 p2 = strDate.lastIndexOf('/');
 LenY = strDate.length - p2 - 1;
 bTest = false;  if ((strFormat=='dd/mm/yy') || (strFormat=='d/m/yy'))
  {    bTest = true;    D = parseFloat(strDate.substring(0,p1));
    M = parseFloat(strDate.substring(p1+1,p2));
    Y = parseFloat(strDate.substring(p2+1,strDate.length));
    if (LenY!=2) {Y=-1;} 
  }  if (!bTest && ((strFormat=='mm/dd/yy') || (strFormat=='m/d/yy')))
  {    bTest = true;    M = parseFloat(strDate.substring(0,p1));
    D = parseFloat(strDate.substring(p1+1,p2));
    Y = parseFloat(strDate.substring(p2+1,strDate.length));
    if (LenY!=2) {Y=-1;} 
  }  if (!bTest && ((strFormat=='mm/dd/yyyy') || (strFormat=='m/d/yyyy')))
  {    bTest = true;    M = parseFloat(strDate.substring(0,p1));
    D = parseFloat(strDate.substring(p1+1,p2));
    Y = parseFloat(strDate.substring(p2+1,strDate.length));
    if (LenY!=4) {Y=-1;} 
  }  if (!bTest && ((strFormat=='dd/mm/yyyy') || (strFormat=='d/m/yyyy')))
  {    bTest = true;    D = parseFloat(strDate.substring(0,p1));
    M = parseFloat(strDate.substring(p1+1,p2));
    Y = parseFloat(strDate.substring(p2+1,strDate.length));
    if (LenY!=4) {Y=-1;} 
  }  if (!bTest)
  {    D = parseFloat(strDate.substring(0,p1));
    M = parseFloat(strDate.substring(p1+1,p2));
    Y = parseFloat(strDate.substring(p2+1,strDate.length));
    if (LenY!=4) {Y=-1;} 
  }
 if ((D==0)||!jsTestCeiljsCheckDateFormat(D)) {D=-1;}
 if ((M==0)||!jsTestCeiljsCheckDateFormat(M)||(M>=13)) {M=-1;}
 if (!jsTestCeiljsCheckDateFormat(Y)) {Y=-1;}
 if (Y==0) {Y=2000;}
 div4=jsTestCeiljsCheckDateFormat(Y/4);
 div100=jsTestCeiljsCheckDateFormat(Y/100);
 div400=jsTestCeiljsCheckDateFormat(Y/400);
 if ((Y>=0) && (Y<=9999)) { 
   if ((M==1)||(M==3)||(M==5)||(M==7)||(M==8)||(M==10)||(M==12)) {
     if ((D>0)&&(D<=31)) { 
       return true;
     } else { return false; }
   }
   if ((M==4)||(M==6)||(M==9)||(M==11)) {
     if ((D>0)&&(D<=30)) { 
       return true; 
     } else { return false; }
   }
   if (M==02) {1
     if ((div4)&&!(div100)||(div400)) {
       if ((D>0)&&(D<=29)) {
         return true; 
       } else { return false; }
     } else {
       if ((D>0)&&(D<=28)) {
         return true; 
       }else { return false; }
     } 
   } else { return false; }
 } else { return false; }
 return true;
}
function jsCheckDate(strDate)  {
 strDate = jsStringReplacejsCheckDate(strDate, '.', '/');
 strDate = jsStringReplacejsCheckDate(strDate, '-', '/');
 if (strDate.indexOf('/')==-1)
   if (strDate.length == 6)
     strDate = strDate.substring(0, 2) + '/' + strDate.substring(2, 4) + '/' + strDate.substring(4, 6);
   else if (strDate.length==8)
     strDate = strDate.substring(0, 2) + '/' + strDate.substring(2, 4) + '/' + strDate.substring(4, 8);
 if ((jsCheckDateFormat(strDate, 'dd/mm/yy')) || (jsCheckDateFormat(strDate, 'dd/mm/yyyy')) || (jsCheckDateFormat(strDate, 'mm/dd/yy')) || (jsCheckDateFormat(strDate, 'mm/dd/yyyy')))
   return true;
 else {
   return false;
  };
}


function CheckSIRET(strSIRET){			
	var objStr;							
	var objNum;							
	var lngLongueur;					
	var intI;							
	var intChiffre;						
	var intDivision;					
	var intSomme;						
	var strTmp;							
	intSomme=0;							
	strSIRET=strSIRET+''				
	objStr=strSIRET;					
	lngLongueur=objStr.length;			
	if(objStr=='00000000000000')		
	{	return false;	};
	if(objStr=='12312312312312')		
	{	return false;	}; 			
	if (lngLongueur!=14)				
	{	return false;	};				
	for (intI=13;intI>=0; intI--)		
	{									
		strTmp=objStr.charAt(intI);		
		if (isNaN(parseInt(strTmp)))	
		{	return false; 
				};			
		objNum=parseInt(strTmp);	
		intDivision=intI%2;		
		if (intDivision==0)				
		{							
			if (2*objNum>=10)		
			{							
			strTmp=2*objNum+'';		
			intChiffre=parseInt(strTmp.charAt(0))+parseInt(strTmp.charAt(1));		
			}									
			else{	intChiffre=2*objNum;	};	
		}										
		else	{	intChiffre=objNum;	};		
		if (intI!=13) intSomme=intSomme+intChiffre;	
	};												
	intSomme=intSomme+parseInt(objStr.charAt(13));	
	if ((intSomme%10)==0)				
	{return true; }						
	else{return false; };				
} 

function checkRaisonSociale(raisonSociale)
{   
	var intI;
	var strTmp;        
	var tabCaractere = ["Ë","Ê","É","È","Â","Ä","À","Ü","Û","Ù","Ö","Ô","Ï","Î"];
	
   	for (intI=0;intI<raisonSociale.length; intI++)		
	{  
		strTmp=raisonSociale.charAt(intI);
		for(i=0;i<tabCaractere.length;i++)
		{
		   if(strTmp == tabCaractere[i])
			{ 
		  		return false;
			} 
		}
	}    
	return true;
}

function checkNumTel(numTel)
{
	var i;
	var strTmp;        
	
   	for (i=0;i<numTel.length; i++)		
	{  
		if(numTel.charCodeAt(i) < 48 || numTel.charCodeAt(i) > 57)
		{
			return false;
		}
		
	}    
	return true;
}   	  
  
function BascDde()
{
if (document.FORM1.CODE_DEMANDE[0].checked)
	{	
	document.getElementById('NUMEDEDDE').style.display='none';
	document.getElementById('REFGAMOBJ').style.display='block';
	document.getElementById('CIVNOMPRE').style.display='block';
	document.getElementById('ADDREMAIL').style.display='block';
	document.getElementById('LEMESSAGE').style.display='block';
	document.getElementById('SOCISIRET').style.display='block';
	document.getElementById('COORDACTI').style.display='block';
	document.getElementById('PIECEJOIN').style.display='block';	
	document.FORM1.TYPE_DDE.value="NOUVELLE"
	}
if (document.FORM1.CODE_DEMANDE[1].checked)
	{
	document.getElementById('NUMEDEDDE').style.display='block';
	document.getElementById('REFGAMOBJ').style.display='none';
	document.getElementById('CIVNOMPRE').style.display='block';
	document.getElementById('ADDREMAIL').style.display='block';
	document.getElementById('LEMESSAGE').style.display='block';
	document.getElementById('SOCISIRET').style.display='none';
	document.getElementById('COORDACTI').style.display='none';
	document.getElementById('PIECEJOIN').style.display='block';	
	document.FORM1.TYPE_DDE.value="COMPLEMENT"
	}
}
function basculaff(Nom,Valeur){
	document.getElementById(Nom).style.display=Valeur;
}
function BascMotif()
{
	if($('#MOTIF').val()=='862'){
		//basculaff('projet','none');
		basculaff('gamme_produit','none');
	}
	else
	{
		basculaff('gamme_produit','inline');
	}
}


function CheckForm()
{
	//alert("check form");
if (document.FORM1.CODE_DEMANDE[0].checked)
 {
    	//alert("nouvelle demande");
    if (document.FORM1.NUM_REF.value != '') {
        if (isNaN(document.FORM1.NUM_REF.value)) {
            alert('La référence produit ne doit comporter que des chiffres !n(Sans espace, ni autre caratère)');
            document.FORM1.NUM_REF.focus();
            return false;
        }
        else
        {
            if (document.FORM1.NUM_REF.value.length > 6) {
                alert("La référence ne peut comporter que 6 chiffres");
                document.FORM1.NUM_REF.focus();
                return false;
            }
            else
            {
                taille = document.FORM1.NUM_REF.value.length
                for (i = 0; i < (6 - taille); i++) {
                    document.FORM1.NUM_REF.value = "0" + document.FORM1.NUM_REF.value;
                }
            }
        }
    }
if (document.FORM1.MOTIF.value=='') {alert('Vous n\'avez pas indiqué l\'objet de votre message !'); return false;}
if (document.FORM1.F_15.value=='') {alert('Vous n\'avez pas écrit votre message !'); document.FORM1.F_15.focus(); return false;}
{ var founded=false;for (i=0;i<document.FORM1.F_1.length;i++){
	if (document.FORM1.F_1[i].checked) founded=true;
	}
	if (!founded) {alert('Vous n\'avez pas indiqué votre civilité !'); return false;}
}
if (document.FORM1.F_2.value=='') {alert('Vous n\'avez pas indiqué votre prénom !'); document.FORM1.F_2.focus(); return false;}
//else {document.FORM1.F_2.value=document.FORM1.F_2.value.toUpperCase();}
if (document.FORM1.F_2.value !='') { if (document.FORM1.F_2.value.length > 50) {alert('Vous n\'avez pas indiqué votre prénom !'); return false;} }
if (document.FORM1.F_3.value=='') {alert('Vous n\'avez pas indiqué votre nom !'); document.FORM1.F_3.focus(); return false;}
else {document.FORM1.F_3.value=document.FORM1.F_3.value.toUpperCase();}
if (document.FORM1.F_3.value !='') { if (document.FORM1.F_3.value.length < 1) {alert('Vous n\'avez pas indiqué votre nom !'); return false;} }
if (document.FORM1.F_3.value !='') { if (document.FORM1.F_3.value.length > 50) {alert('Vous n\'avez pas indiqué votre nom !'); return false;} }
if (document.FORM1.F_4.value=='') {alert('Vous n\'avez pas indiqué votre société !'); document.FORM1.F_4.focus(); return false;}
else {
	checkRaisonSociale(document.FORM1.F_4.value);
	document.FORM1.F_4.value=document.FORM1.F_4.value.toUpperCase();}
if (document.FORM1.F_5.value=='') {alert('Vous n\'avez pas indiqué votre N° SIRET !'); document.FORM1.F_5.focus(); return false;}
if (!CheckSIRET(document.FORM1.F_5.value)) {
	alert('Le N° SIRET est incorrect !');
	document.FORM1.F_5.focus();
	return false;
}
if (document.FORM1.F_7.value=='') {alert('Vous n\'avez pas indiqué votre e-mail !'); document.FORM1.F_7.focus(); return false;}
if( ! document.FORM1.F_7.value.match(/^[-_A-Za-z0-9]+(\.[-_A-Za-z0-9]+)*@[-A-Za-z0-9]+(\.[-A-Za-z0-9]+)+$/)) {
	alert("L'adresse e-mail saisie n'est pas valide");
	document.FORM1.F_7.focus();
	return false;
}
if (document.FORM1.F_8.value=='') {alert('Vous n\'avez pas indiqué votre numero de téléphone !'); document.FORM1.F_8.focus(); return false;}
if (document.FORM1.F_8.value !='') { if (document.FORM1.F_8.value.length < 10) {alert('Merci de saisir votre numero de téléphone\n sous la forme : 0566778899'); return false;} }
if (document.FORM1.F_8.value !='') { if (document.FORM1.F_8.value.length > 10) {alert('Merci de saisir votre numero de téléphone\n sous la forme : 0566778899'); return false;} }
if (document.FORM1.F_8.value !='') { if (isNaN(document.FORM1.F_8.value)) {alert('Merci de saisir votre numero de téléphone\n sous la forme : 0566778899'); return false;} }  
if (document.FORM1.F_8.value !='') { if(!checkNumTel(document.FORM1.F_8.value)){alert('Merci de saisir votre numero de téléphone\n sous la forme : 0566778899'); return false;} }
if (document.FORM1.F_9.value=='') {alert('Vous n\'avez pas indiqué votre adresse !'); document.FORM1.F_9.focus(); return false;}
else {document.FORM1.F_9.value=document.FORM1.F_9.value.toUpperCase();
	document.FORM1.F_91.value=document.FORM1.F_91.value.toUpperCase();}
if (document.FORM1.F_10.value=='') {alert('Vous n\'avez pas écrit votre code postal !'); document.FORM1.F_10.focus(); return false;}
if (document.FORM1.F_10.value !='') { if (document.FORM1.F_10.value.length < 5) {alert('Vous n\'avez pas écrit votre code postal !'); return false;} }
if (document.FORM1.F_10.value !='') { if (document.FORM1.F_10.value.length > 5) {alert('Vous n\'avez pas écrit votre code postal !'); return false;} }
if (isNaN(document.FORM1.F_10.value)) {alert('Vous n\'avez pas écrit votre code postal !'); return false;}
if (document.FORM1.F_11.value=='') {alert('Vous n\'avez pas écrit votre ville !'); document.FORM1.F_11.focus(); return false;}
else {document.FORM1.F_11.value=document.FORM1.F_11.value.toUpperCase();}
var f=document.FORM1;
if (!checkRadio(document.FORM1.CODE_PROF)) {
		alert('Vous n\'avez pas coché votre type d\'entreprise !');
		return false;
	}	
	var cpt=0
	while(!document.FORM1.CODE_PROF[cpt].checked) {
		cpt++;
	}
	var profession=document.FORM1.CODE_PROF[cpt].value;
	/*
	switch(profession) {
		case "93":
			if (f.CODE_PROFESSION_DISTRI.options.selectedIndex==0) {
				alert('Précisez votre type d\'entreprise');
				return false;
			}
			else{
				f.CODE_PROFESS.value=f.CODE_PROFESSION_DISTRI.value;
			}
			break;
		case "94":
			f.CODE_PROFESS.value="94";
			break;
		case "95":
			if (f.CODE_PROFESSION_ET.options.selectedIndex==0) {
				alert('Précisez votre type d\'établissement');
				/*return false;
			}
			else{
				f.CODE_PROFESS.value=f.CODE_PROFESSION_ET.value;
			}
			break;
		case "96":
			if (f.CODE_PROFESSION_GP.options.selectedIndex==0) {
				alert('Précisez votre type d\'entreprise');
				/*return false;
			}
			else{
				f.CODE_PROFESS.value=f.CODE_PROFESSION_GP.value;
			}
			break;
		case "97":
			if (f.CODE_PROFESSION_INV.options.selectedIndex==0) {
				alert('Précisez votre type d\'entreprise');
				/*return false;
			}
			else{
				f.CODE_PROFESS.value=f.CODE_PROFESSION_INV.value;
			}
			break;
		case "100":
			if (f.CODE_PROFESSION_MEO.options.selectedIndex==0) {
				alert('Précisez votre type d\'entreprise');
				/*return false;
			}
			else{
				f.CODE_PROFESS.value=f.CODE_PROFESSION_MEO.value;
			}
			break;
		case "101":
			if (f.CODE_PROFESSION_PRES.options.selectedIndex==0) {
				alert('Précisez votre type d\'entreprise');
				/*return false;
			}
			else{
				f.CODE_PROFESS.value=f.CODE_PROFESSION_PRES.value;
			}
			break;
		case "107":
			if (f.CODE_PROFESSION_SYND.options.selectedIndex==0) {
				alert('Précisez votre type de syndicat');
				/*return false;
			}
			else{
				f.CODE_PROFESS.value=f.CODE_PROFESSION_SYND.value;
			}
			break;	
	}*/
	document.FORM1.CODE_PROFESS.value = profession;
//alert("prof :"+document.FORM1.CODE_PROFESS.value);
	
	//alert("motif ="+document.FORM1.MOTIF.value)
	if(document.FORM1.MOTIF.value=='862'){
		// rien
	}else{
		//alert("motif != 862"+document.FORM1.MOTIF.value+" gamme :"+document.FORM1.GAMME.value);
		if(document.FORM1.GAMME.value != ""){
		//	alert("on va passer");
			document.FORM1.F_15.value = document.FORM1.F_15.value + "\nGamme sélectionnée par le client : "+document.FORM1.elements['GAMME'].options[document.FORM1.elements['GAMME'].selectedIndex].text;
			// alert("on passe "+ document.FORM1.F_15.value)
		}


	}
	
		//alert("retour par 0");
return true;
//return false;
}

if (document.FORM1.CODE_DEMANDE[1].checked)
	{
	//	alert("on passe dans num demande");
	if (document.FORM1.NUM_DEMANDE.value=='') {alert('Vous n\'avez pas indiqué le numéro de votre demande !'); document.FORM1.NUM_DEMANDE.focus(); return false;}	
	if (document.FORM1.NUM_DEMANDE.value=='1') {alert('Si vous formulez une nouvelle demande vous devez sélectionner l\'option \"Vous souhaitez formuler une nouvelle demande au Service Relations Pro. - Si vous avez oublié le numéro d\'enregistrement de votre demande, contactez votre Service Relations Pro au 810 48 48 48'); document.FORM1.NUM_DEMANDE.focus(); return false;}
	if (document.FORM1.NUM_DEMANDE.value=='2') {alert('Si vous formulez une nouvelle demande vous devez sélectionner l\'option \"Vous souhaitez formuler une nouvelle demande au Service Relations Pro. - Si vous avez oublié le numéro d\'enregistrement de votre demande, contactez votre Service Relations Pro au 810 48 48 48'); document.FORM1.NUM_DEMANDE.focus(); return false;}
	if (isNaN(document.FORM1.NUM_DEMANDE.value)) {alert('Le numéro de votre demande est incorrect'); document.FORM1.NUM_DEMANDE.focus(); return false;}
	else {
		var obj0 = document.FORM1.NUM_DEMANDE
		var contenu0 = obj0.value
		var longueur0 = obj0.value.length;
			//alert("ajout zero "+longueur);
		if(longueur0 < 8)
		{
			nb0 = 8-longueur0;
			//alert('ajout 0'+nb0);			
			for(var i=0;i<nb0;i++)
			{
				contenu0 = "0"+contenu0;
			}
		obj0.value= contenu0
		}
	}
	if (document.FORM1.F_15.value=='') {alert('Vous n\'avez pas écrit votre message !'); document.FORM1.F_15.focus(); return false;}
	{ var founded=false;
		for (i=0;i<document.FORM1.F_1.length;i++){
			if (document.FORM1.F_1[i].checked) founded=true;
		}
		if (!founded) {alert('Vous n\'avez pas indiqué votre civilité !'); return false;}
	}
if (document.FORM1.F_2.value=='') {alert('Vous n\'avez pas indiqué votre prénom !');  document.FORM1.F_2.focus(); return false;}
else {document.FORM1.F_2.value=document.FORM1.F_2.value.toUpperCase();}
if (document.FORM1.F_2.value !='') { if (document.FORM1.F_2.value.length > 50) {alert('Vous n\'avez pas indiqué votre prénom !'); document.FORM1.F_2.focus(); return false;} }
if (document.FORM1.F_3.value=='') {alert('Vous n\'avez pas indiqué votre nom !'); document.FORM1.F_3.focus(); return false;}
if (document.FORM1.F_3.value !='') { if (document.FORM1.F_3.value.length < 1) {alert('Vous n\'avez pas indiqué votre nom !'); return false;} }
else {document.FORM1.F_3.value=document.FORM1.F_3.value.toUpperCase();}
if (document.FORM1.F_3.value !='') { if (document.FORM1.F_3.value.length > 50) {alert('Vous n\'avez pas indiqué votre nom !'); return false;} }
if (document.FORM1.F_7.value=='') {alert('Vous n\'avez pas indiqué votre e-mail !'); document.FORM1.F_7.focus(); return false;}
if( ! document.FORM1.F_7.value.match(/^[-_A-Za-z0-9]+(\.[-_A-Za-z0-9]+)*@[-A-Za-z0-9]+(\.[-A-Za-z0-9]+)+$/)) {
	alert("L\'adresse e-mail saisie n'est pas valide");
	document.FORM1.F_7.focus();
	return false;
}
if (document.FORM1.F_8.value=='') {alert('Vous n\'avez pas indiqué votre numero de téléphone !'); document.FORM1.F_8.focus(); return false;}
if (document.FORM1.F_8.value !='') { if (document.FORM1.F_8.value.length < 10) {alert('Merci de saisir votre numero de téléphone\n sous la forme : 0566778899'); return false;} }
if (document.FORM1.F_8.value !='') { if (document.FORM1.F_8.value.length > 10) {alert('Merci de saisir votre numero de téléphone\n sous la forme : 0566778899'); return false;} }
if (document.FORM1.F_8.value !='') { if (isNaN(document.FORM1.F_8.value)) {alert('Merci de saisir votre numero de téléphone\n sous la forme : 0566778899'); return false;} }


return true;
//return false;
//alert("sortie par 1");
}
//alert("sortir par rien")
}

function checkRadio(radio) {
for (i=0;i<radio.length;i++) {
	if (radio[i].checked) return true;
}
return false;
}

