function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function details(id)
{
var mt = document.getElementById(id);
if(mt.style.display=='none') { mt.style.display='block';}
else{ mt.style.display='none';}
}
function details_on(id)
{
var mt = document.getElementById(id);
 mt.style.display='block';
}
function details_off(id)
{
var mt = document.getElementById(id);
 mt.style.display='none';
}
function case_rouge(ID)
{
document.getElementById(ID).style.backgroundColor='#F7AFB6';
}
function case_blanche(ID)
{
document.getElementById(ID).style.backgroundColor='#FFFFFF';
}
function case_grise(ID)
{
document.getElementById(ID).style.backgroundColor='#EDEDED';
}
function popupcentree(page,largeur,hauteur,options)
{
	var top= 40 ///(screen.height-hauteur)/2;
	var left=(screen.width-largeur)/2; 	
	window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options).focus();

}
function isEmpty(str) {
//re = /\s*;\s*/;
//str = str.split (re);
  if (str==null || str=="")
    return true;
  return false;
}

function valid_systeme(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Objet_francais_infolettre.value))
	{
		$msg+="-> L'objet de l'infolettre en français\n";
	}
	if(isEmpty(document.form1.Objet_anglais_infolettre.value))
	{
		$msg+="-> L'objet de l'infolettre en anglais\n";
	}
	if(isEmpty(document.form1.Courriel_officiel_infolettre.value))
	{
		$msg+="-> Courriel officiel de l'infolettre\n";
	}
	if(isEmpty(document.form1.Objet_francais_communique.value))
	{
		$msg+="-> L'objet du communiqué en français\n";
	}
	if(isEmpty(document.form1.Objet_anglais_communique.value))
	{
		$msg+="-> L'objet du communiqué en anglais\n";
	}
	if(isEmpty(document.form1.Courriel_officiel_communique.value))
	{
		$msg+="-> Courriel officiel du communiqué\n";
	}
    if(isEmpty(document.form1.Resultat_maximum.value))
	{
		$msg+="-> Nombre de r&eacute;sultats maximum par page\n";
	}
	
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	//document.form1.Submit.disabled='true';
	return true;
}
function valid_lien(){
	var $msg='';
	case_blanche('Titre_fr');
    case_blanche('Lien');
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Titre_fr.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Titre_fr');
	}
	if(document.form1.Lien.value=='http://')
	{
		$msg+="-> L'adresse URL\n";
		case_rouge('Lien');
	}
	if(isEmpty(document.form1.Lien.value))
	{
		$msg+="-> L'adresse URL\n";
		case_rouge('Lien');
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
function valid_partenaire(){
	var $msg='';
	case_blanche('Nom');
    case_blanche('Lien');
	case_blanche('Rubrique_id');
	case_blanche('Position_part');
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Nom.value))
	{
		$msg+="-> Le Nom\n";
		case_rouge('Nom');
	}
	//if(document.form1.Lien.value=='http://')
	//{
	//	$msg+="-> L'adresse URL\n";
	//	case_rouge('Lien');
	//}
	//if(isEmpty(document.form1.Lien.value))
	//{
	//	$msg+="-> L'adresse URL\n";
	//	case_rouge('Lien');
	//}
    if(document.form1.Rubrique_id.value=='---')
	{
		$msg+="-> Une catégorie\n";
		case_rouge('Rubrique_id');
	}
	if(isEmpty(document.form1.Position_part.value))
	{
		$msg+="-> La position\n";
		case_rouge('Position_part');
	}
	else if(isNaN(document.form1.Position_part.value)) // 2
	{
		$msg+="-> La position être un nombre\n";
		document.form1.Position_part.value='';
		case_rouge('Position_part');
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
function valid_catpartenaire(){
	var $msg='';
	case_blanche('Position');
	case_blanche('Categorie_fr');
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Categorie_fr.value))
	{
		$msg+="-> La dénomination de la catégorie\n";
		case_rouge('Categorie_fr');
	}
    if(isEmpty(document.form1.Position.value))
	{
		$msg+="-> La position\n";
		case_rouge('Position');
	}
	else if(isNaN(document.form1.Position.value)) // 2
	{
		$msg+="-> La position être un nombre\n";
		document.form1.Position.value='';
		case_rouge('Position');
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
//
function valid_bourse2(){
	var $msg='';
	case_blanche('Titre_fr');
	case_blanche('Texte_fr');
    case_blanche('Lien');
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Titre_fr.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Titre_fr');
	}
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> La description\n";
		case_rouge('Texte_fr');
	}
	if(document.form1.Lien.value=='http://')
	{
		$msg+="-> L'adresse URL\n";
		case_rouge('Lien');
	}
	if(isEmpty(document.form1.Lien.value))
	{
		$msg+="-> L'adresse URL\n";
		case_rouge('Lien');
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
////////
function valid_universite(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Nom_universite.value))
	{
		$msg+="-> La dénomination de l'université\n";
	}
	if(isEmpty(document.form1.Abre_universite.value))
	{
		$msg+="-> L'abréviation de l'université\n";
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}


function valid_session_offert(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if(isEmpty(document.form1.An.value))
	{
		$msg+="-> Année\n";
	}
	else if(isNaN(document.form1.An.value)) // 2
	{
		$msg+="-> Année doit être un nombre\n";
		document.form1.An.value='';
		//case_rouge('Tcours');
	}
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

function valid_cours_offerts(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	case_blanche('Cours_id');
	case_grise('box_cours_id');
	case_grise('box_session_id');
	case_grise('box_universite_id');
	case_grise('box_responsable_id');
	case_grise('box_categorie_id');
	case_blanche('Date_asf');
	case_blanche('Date_asme');
	case_blanche('Date_dalc');
	case_blanche('Date_falc');
	case_blanche('Debut_message');
	case_blanche('Fin_message');
	case_blanche('Session_id');
	case_blanche('Categorie_id');
	case_blanche('Universite_id');
	case_blanche('Responsable');
	case_blanche('s1');case_blanche('s2');case_blanche('s3');case_blanche('s4');case_blanche('s5');case_blanche('s6');case_blanche('s7');
	case_blanche('s8');case_blanche('s9');case_blanche('s10');case_blanche('s11');case_blanche('s12');case_blanche('s13');case_blanche('s14');
	case_blanche('s15');case_blanche('s16');case_blanche('s17');case_blanche('s18');case_blanche('s19');case_blanche('s20');

	case_blanche('Titre1');case_blanche('Titre2');case_blanche('Titre3');case_blanche('Titre4');case_blanche('Titre5');case_blanche('Titre6');case_blanche('Titre7');
	case_blanche('Titre8');case_blanche('Titre9');case_blanche('Titre10');case_blanche('Titre11');case_blanche('Titre12');case_blanche('Titre13');case_blanche('Titre14');case_blanche('Titre15');
	case_blanche('Doc1');case_blanche('Doc2');case_blanche('Doc3');case_blanche('Doc4');case_blanche('Doc5');case_blanche('Doc6');case_blanche('Doc7');
	case_blanche('Doc8');case_blanche('Doc9');case_blanche('Doc10');case_blanche('Doc11');case_blanche('Doc12');case_blanche('Doc13');case_blanche('Doc14');case_blanche('Doc15');	

	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg",".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE"); 
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	
	if(document.form1.Cours_id.value=='---')
	{
		$msg+="-> Le choix d'un cours\n";
		case_rouge('Cours_id');
		case_rouge('box_cours_id');
	}
	if(document.form1.Session_id.value=='---')
	{
		$msg+="-> Le choix d'une session offerte\n";
		case_rouge('Session_id');
		case_rouge('box_session_id');
	}
	if(document.form1.Categorie_id.value=='---')
	{
		$msg+="-> Le choix d'une catégorie\n";
		case_rouge('Categorie_id');
		case_rouge('box_categorie_id');
	}
	if(document.form1.Universite_id.value=='---')
	{
		$msg+="-> Le choix d'une université\n";
		case_rouge('Universite_id');
		case_rouge('box_universite_id');
	}
	if(isEmpty(document.form1.Responsable.value))
	{
		$msg+="-> Le choix d'un responsable\n";
		case_rouge('Responsable');
		case_rouge('box_responsable_id');
	}
	if(isEmpty(document.form1.Date_asf.value))
	{
		$msg+="-> La date limite d'abandon sans facturation\n";
		case_rouge('Date_asf');
	}
	if(isEmpty(document.form1.Date_asme.value))
	{
		$msg+="-> La date limite d'abandon sans mention d'échec\n";
		case_rouge('Date_asme');
	}
	if(isEmpty(document.form1.Date_dalc.value))
	{
		$msg+="-> La date du début d'affichage dans la liste\n";
		case_rouge('Date_dalc');
	}
	if(isEmpty(document.form1.Date_falc.value))
	{
		$msg+="-> La date de fin d'affichage dans la liste\n";
		case_rouge('Date_falc');
	}
	if(isEmpty(document.form1.Texte_fr.value))
	{ }
	else {
		if(isEmpty(document.form1.Debut_message.value))
		{
			$msg+="-> La date du début d'affichage du message\n";
			case_rouge('Debut_message');
		}
		if(isEmpty(document.form1.Fin_message.value))
		{
			$msg+="-> La date de fin d'affichage du message\n";
			case_rouge('Fin_message');
		}
	}
	//valider les séances...
    if((document.form1.Jour_1.value!='Jour')||(document.form1.Heure_1.value!='---')||(document.form1.Local_1.value!='---')||(document.form1.Date_1.value!=''))
	{
		if((document.form1.Jour_1.value!='Jour')&&(document.form1.Heure_1.value!='---')&&(document.form1.Local_1.value!='---')&&(document.form1.Date_1.value!=''))
        { } else {
		$msg+="-> La séance de cours #01 correctement\n";
		case_rouge('s1');
		 if(document.form1.Date_1.value==''){
			  document.form1.Date_1.value='';
		 }
		}
	}
	
if((document.form1.Jour_2.value!='Jour')||(document.form1.Heure_2.value!='---')||(document.form1.Local_2.value!='---')||(document.form1.Date_2.value!=''))
{
if((document.form1.Jour_2.value!='Jour')&&(document.form1.Heure_2.value!='---')&&(document.form1.Local_2.value!='---')&&(document.form1.Date_2.value!=''))
{ } else {
$msg+="-> La séance de cours #02 correctement\n";
		case_rouge('s2');
		 if(document.form1.Date_2.value==''){
			  document.form1.Date_2.value='';
		 }
}
}
if((document.form1.Jour_3.value!='Jour')||(document.form1.Heure_3.value!='---')||(document.form1.Local_3.value!='---')||(document.form1.Date_3.value!=''))
{
if((document.form1.Jour_3.value!='Jour')&&(document.form1.Heure_3.value!='---')&&(document.form1.Local_3.value!='---')&&(document.form1.Date_3.value!=''))
{ } else {
$msg+="-> La séance de cours #03 correctement\n";
		case_rouge('s3');
		 if(document.form1.Date_3.value==''){
			  document.form1.Date_3.value='';
		 }
}
}
if((document.form1.Jour_4.value!='Jour')||(document.form1.Heure_4.value!='---')||(document.form1.Local_4.value!='---')||(document.form1.Date_4.value!=''))
{
if((document.form1.Jour_4.value!='Jour')&&(document.form1.Heure_4.value!='---')&&(document.form1.Local_4.value!='---')&&(document.form1.Date_4.value!=''))
{ } else {
$msg+="-> La séance de cours #04 correctement\n";
		case_rouge('s4');
		 if(document.form1.Date_4.value==''){
			  document.form1.Date_4.value='';
		 }
}
}
if((document.form1.Jour_5.value!='Jour')||(document.form1.Heure_5.value!='---')||(document.form1.Local_5.value!='---')||(document.form1.Date_5.value!=''))
{
if((document.form1.Jour_5.value!='Jour')&&(document.form1.Heure_5.value!='---')&&(document.form1.Local_5.value!='---')&&(document.form1.Date_5.value!=''))
{ } else {
$msg+="-> La séance de cours #05 correctement\n";
		case_rouge('s5');
		 if(document.form1.Date_5.value==''){
			  document.form1.Date_5.value='';
		 }
}
}
if((document.form1.Jour_6.value!='Jour')||(document.form1.Heure_6.value!='---')||(document.form1.Local_6.value!='---')||(document.form1.Date_6.value!=''))
{
if((document.form1.Jour_6.value!='Jour')&&(document.form1.Heure_6.value!='---')&&(document.form1.Local_6.value!='---')&&(document.form1.Date_6.value!=''))
{ } else {
$msg+="-> La séance de cours #06 correctement\n";
		case_rouge('s6');
		 if(document.form1.Date_6.value==''){
			  document.form1.Date_6.value='';
		 }
}
}
if((document.form1.Jour_7.value!='Jour')||(document.form1.Heure_7.value!='---')||(document.form1.Local_7.value!='---')||(document.form1.Date_7.value!=''))
{
if((document.form1.Jour_7.value!='Jour')&&(document.form1.Heure_7.value!='---')&&(document.form1.Local_7.value!='---')&&(document.form1.Date_7.value!=''))
{ } else {
$msg+="-> La séance de cours #07 correctement\n";
		case_rouge('s7');
		 if(document.form1.Date_7.value==''){
			  document.form1.Date_7.value='';
		 }
}
}
if((document.form1.Jour_8.value!='Jour')||(document.form1.Heure_8.value!='---')||(document.form1.Local_8.value!='---')||(document.form1.Date_8.value!=''))
{
if((document.form1.Jour_8.value!='Jour')&&(document.form1.Heure_8.value!='---')&&(document.form1.Local_8.value!='---')&&(document.form1.Date_8.value!=''))
{ } else {
$msg+="-> La séance de cours #08 correctement\n";
		case_rouge('s8');
		 if(document.form1.Date_8.value==''){
			  document.form1.Date_8.value='';
		 }
}
}
if((document.form1.Jour_9.value!='Jour')||(document.form1.Heure_9.value!='---')||(document.form1.Local_9.value!='---')||(document.form1.Date_9.value!=''))
{
if((document.form1.Jour_9.value!='Jour')&&(document.form1.Heure_9.value!='---')&&(document.form1.Local_9.value!='---')&&(document.form1.Date_9.value!=''))
{ } else {
$msg+="-> La séance de cours #09 correctement\n";
		case_rouge('s9');
		 if(document.form1.Date_9.value==''){
			  document.form1.Date_9.value='';
		 }
}
}
if((document.form1.Jour_10.value!='Jour')||(document.form1.Heure_10.value!='---')||(document.form1.Local_10.value!='---')||(document.form1.Date_10.value!=''))
{
if((document.form1.Jour_10.value!='Jour')&&(document.form1.Heure_10.value!='---')&&(document.form1.Local_10.value!='---')&&(document.form1.Date_10.value!=''))
{ } else {
$msg+="-> La séance de cours #10 correctement\n";
		case_rouge('s10');
		 if(document.form1.Date_10.value==''){
			  document.form1.Date_10.value='';
		 }
}
}
if((document.form1.Jour_11.value!='Jour')||(document.form1.Heure_11.value!='---')||(document.form1.Local_11.value!='---')||(document.form1.Date_11.value!=''))
{
if((document.form1.Jour_11.value!='Jour')&&(document.form1.Heure_11.value!='---')&&(document.form1.Local_11.value!='---')&&(document.form1.Date_11.value!=''))
{ } else {
$msg+="-> La séance de cours #11 correctement\n";
		case_rouge('s11');
		 if(document.form1.Date_11.value==''){
			  document.form1.Date_11.value='';
		 }
}
}
if((document.form1.Jour_12.value!='Jour')||(document.form1.Heure_12.value!='---')||(document.form1.Local_12.value!='---')||(document.form1.Date_12.value!=''))
{
if((document.form1.Jour_12.value!='Jour')&&(document.form1.Heure_12.value!='---')&&(document.form1.Local_12.value!='---')&&(document.form1.Date_12.value!=''))
{ } else {
$msg+="-> La séance de cours #12 correctement\n";
		case_rouge('s12');
		 if(document.form1.Date_12.value==''){
			  document.form1.Date_12.value='';
		 }
}
}
if((document.form1.Jour_13.value!='Jour')||(document.form1.Heure_13.value!='---')||(document.form1.Local_13.value!='---')||(document.form1.Date_13.value!=''))
{
if((document.form1.Jour_13.value!='Jour')&&(document.form1.Heure_13.value!='---')&&(document.form1.Local_13.value!='---')&&(document.form1.Date_13.value!=''))
{ } else {
$msg+="-> La séance de cours #13 correctement\n";
		case_rouge('s13');
		 if(document.form1.Date_13.value==''){
			  document.form1.Date_13.value='';
		 }
}
}
if((document.form1.Jour_14.value!='Jour')||(document.form1.Heure_14.value!='---')||(document.form1.Local_14.value!='---')||(document.form1.Date_14.value!=''))
{
if((document.form1.Jour_14.value!='Jour')&&(document.form1.Heure_14.value!='---')&&(document.form1.Local_14.value!='---')&&(document.form1.Date_14.value!=''))
{ } else {
$msg+="-> La séance de cours #14 correctement\n";
		case_rouge('s14');
		 if(document.form1.Date_14.value==''){
			  document.form1.Date_14.value='';
		 }
}
}
if((document.form1.Jour_15.value!='Jour')||(document.form1.Heure_15.value!='---')||(document.form1.Local_15.value!='---')||(document.form1.Date_15.value!=''))
{
if((document.form1.Jour_15.value!='Jour')&&(document.form1.Heure_15.value!='---')&&(document.form1.Local_15.value!='---')&&(document.form1.Date_15.value!=''))
{ } else {
$msg+="-> La séance de cours #15 correctement\n";
		case_rouge('s15');
		 if(document.form1.Date_15.value==''){
			  document.form1.Date_15.value='';
		 }
}
}
if((document.form1.Jour_16.value!='Jour')||(document.form1.Heure_16.value!='---')||(document.form1.Local_16.value!='---')||(document.form1.Date_16.value!=''))
{
if((document.form1.Jour_16.value!='Jour')&&(document.form1.Heure_16.value!='---')&&(document.form1.Local_16.value!='---')&&(document.form1.Date_16.value!=''))
{ } else {
$msg+="-> La séance de cours #16 correctement\n";
		case_rouge('s16');
		 if(document.form1.Date_16.value==''){
			  document.form1.Date_16.value='';
		 }
}
}
if((document.form1.Jour_17.value!='Jour')||(document.form1.Heure_17.value!='---')||(document.form1.Local_17.value!='---')||(document.form1.Date_17.value!=''))
{
if((document.form1.Jour_17.value!='Jour')&&(document.form1.Heure_17.value!='---')&&(document.form1.Local_17.value!='---')&&(document.form1.Date_17.value!=''))
{ } else {
$msg+="-> La séance de cours #17 correctement\n";
		case_rouge('s17');
		 if(document.form1.Date_17.value==''){
			  document.form1.Date_17.value='';
		 }
}
}
if((document.form1.Jour_18.value!='Jour')||(document.form1.Heure_18.value!='---')||(document.form1.Local_18.value!='---')||(document.form1.Date_18.value!=''))
{
if((document.form1.Jour_18.value!='Jour')&&(document.form1.Heure_18.value!='---')&&(document.form1.Local_18.value!='---')&&(document.form1.Date_18.value!=''))
{ } else {
$msg+="-> La séance de cours #18 correctement\n";
		case_rouge('s18');
		 if(document.form1.Date_18.value==''){
			  document.form1.Date_18.value='';
		 }
}
}
if((document.form1.Jour_19.value!='Jour')||(document.form1.Heure_19.value!='---')||(document.form1.Local_19.value!='---')||(document.form1.Date_19.value!=''))
{
if((document.form1.Jour_19.value!='Jour')&&(document.form1.Heure_19.value!='---')&&(document.form1.Local_19.value!='---')&&(document.form1.Date_19.value!=''))
{ } else {
$msg+="-> La séance de cours #19 correctement\n";
		case_rouge('s19');
		 if(document.form1.Date_19.value==''){
			  document.form1.Date_19.value='';
		 }
}
}
if((document.form1.Jour_20.value!='Jour')||(document.form1.Heure_20.value!='---')||(document.form1.Local_20.value!='---')||(document.form1.Date_20.value!=''))
{
	if((document.form1.Jour_20.value!='Jour')&&(document.form1.Heure_20.value!='---')&&(document.form1.Local_20.value!='---')&&(document.form1.Date_20.value!=''))
	{ } else {
	         $msg+="-> La séance de cours #20 correctement\n";
			case_rouge('s20');
			 if(document.form1.Date_20.value==''){
				  document.form1.Date_20.value='';
			 }
	}
}
//document 1...
	var extention1= document.form1.Doc1.value.slice(-4);

	if( (!isEmpty(document.form1.Doc1.value))||(!isEmpty(document.form1.Titre1.value)))
	{
		if(isEmpty(document.form1.Titre1.value))
		{
			$msg+="-> Le titre du document #1\n";
			case_rouge('Titre1');
		}
		if(!isValidExtention(extention1,validExtention1))
		{
			$msg+="-> Le document #1 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc1');
		}
	}
///fin document 1...	
//document 2...
	var extention2= document.form1.Doc2.value.slice(-4);

	if( (!isEmpty(document.form1.Doc2.value))||(!isEmpty(document.form1.Titre2.value)))
	{
		if(isEmpty(document.form1.Titre2.value))
		{
			$msg+="-> Le titre du document #2\n";
			case_rouge('Titre2');
		}
		if(!isValidExtention(extention2,validExtention1))
		{
			$msg+="-> Le document #2 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc2');
		}
	}
///fin document 2...	
//document 3...
	var extention3= document.form1.Doc3.value.slice(-4);

	if( (!isEmpty(document.form1.Doc3.value))||(!isEmpty(document.form1.Titre3.value)))
	{
		if(isEmpty(document.form1.Titre3.value))
		{
			$msg+="-> Le titre du document #3\n";
			case_rouge('Titre3');
		}
		if(!isValidExtention(extention3,validExtention1))
		{
			$msg+="-> Le document #3 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc3');
		}
	}
///fin document 3...
//document 4...
	var extention4= document.form1.Doc4.value.slice(-4);

	if( (!isEmpty(document.form1.Doc4.value))||(!isEmpty(document.form1.Titre4.value)))
	{
		if(isEmpty(document.form1.Titre4.value))
		{
			$msg+="-> Le titre du document #4\n";
			case_rouge('Titre4');
		}
		if(!isValidExtention(extention4,validExtention1))
		{
			$msg+="-> Le document #4 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc4');
		}
	}
///fin document 4...
//document 5...
	var extention5= document.form1.Doc5.value.slice(-4);

	if( (!isEmpty(document.form1.Doc5.value))||(!isEmpty(document.form1.Titre5.value)))
	{
		if(isEmpty(document.form1.Titre5.value))
		{
			$msg+="-> Le titre du document #5\n";
			case_rouge('Titre5');
		}
		if(!isValidExtention(extention5,validExtention1))
		{
			$msg+="-> Le document #5 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc5');
		}
	}
///fin document 5...
//document 6...
	var extention6= document.form1.Doc6.value.slice(-4);

	if( (!isEmpty(document.form1.Doc6.value))||(!isEmpty(document.form1.Titre6.value)))
	{
		if(isEmpty(document.form1.Titre6.value))
		{
			$msg+="-> Le titre du document #6\n";
			case_rouge('Titre6');
		}
		if(!isValidExtention(extention6,validExtention1))
		{
			$msg+="-> Le document #6 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc6');
		}
	}
///fin document 6...
//document 7..
	var extention7= document.form1.Doc7.value.slice(-4);

	if( (!isEmpty(document.form1.Doc7.value))||(!isEmpty(document.form1.Titre7.value)))
	{
		if(isEmpty(document.form1.Titre7.value))
		{
			$msg+="-> Le titre du document #7\n";
			case_rouge('Titre7');
		}
		if(!isValidExtention(extention7,validExtention1))
		{
			$msg+="-> Le document #7 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc7');
		}
	}
///fin document 7...
//document 8..
	var extention8= document.form1.Doc8.value.slice(-4);

	if( (!isEmpty(document.form1.Doc8.value))||(!isEmpty(document.form1.Titre8.value)))
	{
		if(isEmpty(document.form1.Titre8.value))
		{
			$msg+="-> Le titre du document #8\n";
			case_rouge('Titre8');
		}
		if(!isValidExtention(extention8,validExtention1))
		{
			$msg+="-> Le document #8 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc8');
		}
	}
///fin document 8...
//document 9..
	var extention9= document.form1.Doc9.value.slice(-4);

	if( (!isEmpty(document.form1.Doc9.value))||(!isEmpty(document.form1.Titre9.value)))
	{
		if(isEmpty(document.form1.Titre9.value))
		{
			$msg+="-> Le titre du document #9\n";
			case_rouge('Titre9');
		}
		if(!isValidExtention(extention9,validExtention1))
		{
			$msg+="-> Le document #9 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc9');
		}
	}
///fin document 9...
//document 10..
	var extention10= document.form1.Doc10.value.slice(-4);

	if( (!isEmpty(document.form1.Doc10.value))||(!isEmpty(document.form1.Titre10.value)))
	{
		if(isEmpty(document.form1.Titre10.value))
		{
			$msg+="-> Le titre du document #10\n";
			case_rouge('Titre10');
		}
		if(!isValidExtention(extention10,validExtention1))
		{
			$msg+="-> Le document #10 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc10');
		}
	}
///fin document 10...
//document 11..
	var extention11= document.form1.Doc11.value.slice(-4);

	if( (!isEmpty(document.form1.Doc11.value))||(!isEmpty(document.form1.Titre11.value)))
	{
		if(isEmpty(document.form1.Titre11.value))
		{
			$msg+="-> Le titre du document #11\n";
			case_rouge('Titre11');
		}
		if(!isValidExtention(extention11,validExtention1))
		{
			$msg+="-> Le document #11 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc11');
		}
	}
///fin document 11...
//document 12..
	var extention12= document.form1.Doc12.value.slice(-4);

	if( (!isEmpty(document.form1.Doc12.value))||(!isEmpty(document.form1.Titre12.value)))
	{
		if(isEmpty(document.form1.Titre12.value))
		{
			$msg+="-> Le titre du document #12\n";
			case_rouge('Titre12');
		}
		if(!isValidExtention(extention12,validExtention1))
		{
			$msg+="-> Le document #12 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc12');
		}
	}
///fin document 12...
//document 13..
	var extention13= document.form1.Doc13.value.slice(-4);

	if( (!isEmpty(document.form1.Doc13.value))||(!isEmpty(document.form1.Titre13.value)))
	{
		if(isEmpty(document.form1.Titre13.value))
		{
			$msg+="-> Le titre du document #13\n";
			case_rouge('Titre13');
		}
		if(!isValidExtention(extention13,validExtention1))
		{
			$msg+="-> Le document #13 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc13');
		}
	}
///fin document 13...
//document 14..
	var extention14= document.form1.Doc14.value.slice(-4);

	if( (!isEmpty(document.form1.Doc14.value))||(!isEmpty(document.form1.Titre14.value)))
	{
		if(isEmpty(document.form1.Titre14.value))
		{
			$msg+="-> Le titre du document #14\n";
			case_rouge('Titre14');
		}
		if(!isValidExtention(extention14,validExtention1))
		{
			$msg+="-> Le document #14 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc14');
		}
	}
///fin document 14...
//document 14..
	var extention15= document.form1.Doc15.value.slice(-4);

	if( (!isEmpty(document.form1.Doc15.value))||(!isEmpty(document.form1.Titre15.value)))
	{
		if(isEmpty(document.form1.Titre15.value))
		{
			$msg+="-> Le titre du document #15\n";
			case_rouge('Titre15');
		}
		if(!isValidExtention(extention15,validExtention1))
		{
			$msg+="-> Le document #15 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc15');
		}
	}
///fin document 15...


	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
/////////////////
function valid_cours_offerts2(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	case_blanche('Cours_id');
	case_grise('box_cours_id');
	case_grise('box_session_id');
	case_grise('box_universite_id');
	case_grise('box_responsable_id');
	case_grise('box_categorie_id');
	case_blanche('Date_asf');
	case_blanche('Date_asme');
	case_blanche('Date_dalc');
	case_blanche('Date_falc');
	case_blanche('Debut_message');
	case_blanche('Fin_message');
	case_blanche('Session_id');
	case_blanche('Categorie_id');
	case_blanche('Universite_id');
	case_blanche('Responsable');
	case_blanche('s1');case_blanche('s2');case_blanche('s3');case_blanche('s4');case_blanche('s5');case_blanche('s6');case_blanche('s7');
	case_blanche('s8');case_blanche('s9');case_blanche('s10');case_blanche('s11');case_blanche('s12');case_blanche('s13');case_blanche('s14');
	case_blanche('s15');case_blanche('s16');case_blanche('s17');case_blanche('s18');case_blanche('s19');case_blanche('s20');

	case_blanche('Titre1');case_blanche('Titre2');case_blanche('Titre3');case_blanche('Titre4');case_blanche('Titre5');case_blanche('Titre6');case_blanche('Titre7');
	case_blanche('Titre8');case_blanche('Titre9');case_blanche('Titre10');case_blanche('Titre11');case_blanche('Titre12');case_blanche('Titre13');case_blanche('Titre14');case_blanche('Titre15');
	case_blanche('Doc1');case_blanche('Doc2');case_blanche('Doc3');case_blanche('Doc4');case_blanche('Doc5');case_blanche('Doc6');case_blanche('Doc7');
	case_blanche('Doc8');case_blanche('Doc9');case_blanche('Doc10');case_blanche('Doc11');case_blanche('Doc12');case_blanche('Doc13');case_blanche('Doc14');case_blanche('Doc15');	

	var validExtention1 = new Array(".doc",".pdf",".txt",".zip",".ppt",".pps",".wmv",".xls",".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	
	if(document.form1.Cours_id.value=='---')
	{
		$msg+="-> Le choix d'un cours\n";
		case_rouge('Cours_id');
		case_rouge('box_cours_id');
	}
	if(document.form1.Session_id.value=='---')
	{
		$msg+="-> Le choix d'une session offerte\n";
		case_rouge('Session_id');
		case_rouge('box_session_id');
	}
	if(document.form1.Categorie_id.value=='---')
	{
		$msg+="-> Le choix d'une catégorie\n";
		case_rouge('Categorie_id');
		case_rouge('box_categorie_id');
	}
	if(document.form1.Universite_id.value=='---')
	{
		$msg+="-> Le choix d'une université\n";
		case_rouge('Universite_id');
		case_rouge('box_universite_id');
	}
	if(isEmpty(document.form1.Responsable.value))
	{
		$msg+="-> Le choix d'un responsable\n";
		case_rouge('Responsable');
		case_rouge('box_responsable_id');
	}
	if(isEmpty(document.form1.Date_asf.value))
	{
		$msg+="-> La date limite d'abandon sans facturation\n";
		case_rouge('Date_asf');
	}
	if(isEmpty(document.form1.Date_asme.value))
	{
		$msg+="-> La date limite d'abandon sans mention d'échec\n";
		case_rouge('Date_asme');
	}
	if(isEmpty(document.form1.Date_dalc.value))
	{
		$msg+="-> La date du début d'affichage dans la liste\n";
		case_rouge('Date_dalc');
	}
	if(isEmpty(document.form1.Date_falc.value))
	{
		$msg+="-> La date de fin d'affichage dans la liste\n";
		case_rouge('Date_falc');
	}
	if(isEmpty(document.form1.Texte_fr.value))
	{ }
	else {
		if(isEmpty(document.form1.Debut_message.value))
		{
			$msg+="-> La date du début d'affichage du message\n";
			case_rouge('Debut_message');
		}
		if(isEmpty(document.form1.Fin_message.value))
		{
			$msg+="-> La date de fin d'affichage du message\n";
			case_rouge('Fin_message');
		}
	}
	//valider les séances...
    if((document.form1.Jour_1.value!='Jour')||(document.form1.Heure_1.value!='---')||(document.form1.Local_1.value!='---')||(document.form1.Date_1.value!=''))
	{
		if((document.form1.Jour_1.value!='Jour')&&(document.form1.Heure_1.value!='---')&&(document.form1.Local_1.value!='---')&&(document.form1.Date_1.value!=''))
        { } else {
		$msg+="-> La séance de cours #01 correctement\n";
		case_rouge('s1');
		 if(document.form1.Date_1.value==''){
			  document.form1.Date_1.value='';
		 }
		}
	}
	
if((document.form1.Jour_2.value!='Jour')||(document.form1.Heure_2.value!='---')||(document.form1.Local_2.value!='---')||(document.form1.Date_2.value!=''))
{
if((document.form1.Jour_2.value!='Jour')&&(document.form1.Heure_2.value!='---')&&(document.form1.Local_2.value!='---')&&(document.form1.Date_2.value!=''))
{ } else {
$msg+="-> La séance de cours #02 correctement\n";
		case_rouge('s2');
		 if(document.form1.Date_2.value==''){
			  document.form1.Date_2.value='';
		 }
}
}
if((document.form1.Jour_3.value!='Jour')||(document.form1.Heure_3.value!='---')||(document.form1.Local_3.value!='---')||(document.form1.Date_3.value!=''))
{
if((document.form1.Jour_3.value!='Jour')&&(document.form1.Heure_3.value!='---')&&(document.form1.Local_3.value!='---')&&(document.form1.Date_3.value!=''))
{ } else {
$msg+="-> La séance de cours #03 correctement\n";
		case_rouge('s3');
		 if(document.form1.Date_3.value==''){
			  document.form1.Date_3.value='';
		 }
}
}
if((document.form1.Jour_4.value!='Jour')||(document.form1.Heure_4.value!='---')||(document.form1.Local_4.value!='---')||(document.form1.Date_4.value!=''))
{
if((document.form1.Jour_4.value!='Jour')&&(document.form1.Heure_4.value!='---')&&(document.form1.Local_4.value!='---')&&(document.form1.Date_4.value!=''))
{ } else {
$msg+="-> La séance de cours #04 correctement\n";
		case_rouge('s4');
		 if(document.form1.Date_4.value==''){
			  document.form1.Date_4.value='';
		 }
}
}
if((document.form1.Jour_5.value!='Jour')||(document.form1.Heure_5.value!='---')||(document.form1.Local_5.value!='---')||(document.form1.Date_5.value!=''))
{
if((document.form1.Jour_5.value!='Jour')&&(document.form1.Heure_5.value!='---')&&(document.form1.Local_5.value!='---')&&(document.form1.Date_5.value!=''))
{ } else {
$msg+="-> La séance de cours #05 correctement\n";
		case_rouge('s5');
		 if(document.form1.Date_5.value==''){
			  document.form1.Date_5.value='';
		 }
}
}
if((document.form1.Jour_6.value!='Jour')||(document.form1.Heure_6.value!='---')||(document.form1.Local_6.value!='---')||(document.form1.Date_6.value!=''))
{
if((document.form1.Jour_6.value!='Jour')&&(document.form1.Heure_6.value!='---')&&(document.form1.Local_6.value!='---')&&(document.form1.Date_6.value!=''))
{ } else {
$msg+="-> La séance de cours #06 correctement\n";
		case_rouge('s6');
		 if(document.form1.Date_6.value==''){
			  document.form1.Date_6.value='';
		 }
}
}
if((document.form1.Jour_7.value!='Jour')||(document.form1.Heure_7.value!='---')||(document.form1.Local_7.value!='---')||(document.form1.Date_7.value!=''))
{
if((document.form1.Jour_7.value!='Jour')&&(document.form1.Heure_7.value!='---')&&(document.form1.Local_7.value!='---')&&(document.form1.Date_7.value!=''))
{ } else {
$msg+="-> La séance de cours #07 correctement\n";
		case_rouge('s7');
		 if(document.form1.Date_7.value==''){
			  document.form1.Date_7.value='';
		 }
}
}
if((document.form1.Jour_8.value!='Jour')||(document.form1.Heure_8.value!='---')||(document.form1.Local_8.value!='---')||(document.form1.Date_8.value!=''))
{
if((document.form1.Jour_8.value!='Jour')&&(document.form1.Heure_8.value!='---')&&(document.form1.Local_8.value!='---')&&(document.form1.Date_8.value!=''))
{ } else {
$msg+="-> La séance de cours #08 correctement\n";
		case_rouge('s8');
		 if(document.form1.Date_8.value==''){
			  document.form1.Date_8.value='';
		 }
}
}
if((document.form1.Jour_9.value!='Jour')||(document.form1.Heure_9.value!='---')||(document.form1.Local_9.value!='---')||(document.form1.Date_9.value!=''))
{
if((document.form1.Jour_9.value!='Jour')&&(document.form1.Heure_9.value!='---')&&(document.form1.Local_9.value!='---')&&(document.form1.Date_9.value!=''))
{ } else {
$msg+="-> La séance de cours #09 correctement\n";
		case_rouge('s9');
		 if(document.form1.Date_9.value==''){
			  document.form1.Date_9.value='';
		 }
}
}
if((document.form1.Jour_10.value!='Jour')||(document.form1.Heure_10.value!='---')||(document.form1.Local_10.value!='---')||(document.form1.Date_10.value!=''))
{
if((document.form1.Jour_10.value!='Jour')&&(document.form1.Heure_10.value!='---')&&(document.form1.Local_10.value!='---')&&(document.form1.Date_10.value!=''))
{ } else {
$msg+="-> La séance de cours #10 correctement\n";
		case_rouge('s10');
		 if(document.form1.Date_10.value==''){
			  document.form1.Date_10.value='';
		 }
}
}
if((document.form1.Jour_11.value!='Jour')||(document.form1.Heure_11.value!='---')||(document.form1.Local_11.value!='---')||(document.form1.Date_11.value!=''))
{
if((document.form1.Jour_11.value!='Jour')&&(document.form1.Heure_11.value!='---')&&(document.form1.Local_11.value!='---')&&(document.form1.Date_11.value!=''))
{ } else {
$msg+="-> La séance de cours #11 correctement\n";
		case_rouge('s11');
		 if(document.form1.Date_11.value==''){
			  document.form1.Date_11.value='';
		 }
}
}
if((document.form1.Jour_12.value!='Jour')||(document.form1.Heure_12.value!='---')||(document.form1.Local_12.value!='---')||(document.form1.Date_12.value!=''))
{
if((document.form1.Jour_12.value!='Jour')&&(document.form1.Heure_12.value!='---')&&(document.form1.Local_12.value!='---')&&(document.form1.Date_12.value!=''))
{ } else {
$msg+="-> La séance de cours #12 correctement\n";
		case_rouge('s12');
		 if(document.form1.Date_12.value==''){
			  document.form1.Date_12.value='';
		 }
}
}
if((document.form1.Jour_13.value!='Jour')||(document.form1.Heure_13.value!='---')||(document.form1.Local_13.value!='---')||(document.form1.Date_13.value!=''))
{
if((document.form1.Jour_13.value!='Jour')&&(document.form1.Heure_13.value!='---')&&(document.form1.Local_13.value!='---')&&(document.form1.Date_13.value!=''))
{ } else {
$msg+="-> La séance de cours #13 correctement\n";
		case_rouge('s13');
		 if(document.form1.Date_13.value==''){
			  document.form1.Date_13.value='';
		 }
}
}
if((document.form1.Jour_14.value!='Jour')||(document.form1.Heure_14.value!='---')||(document.form1.Local_14.value!='---')||(document.form1.Date_14.value!=''))
{
if((document.form1.Jour_14.value!='Jour')&&(document.form1.Heure_14.value!='---')&&(document.form1.Local_14.value!='---')&&(document.form1.Date_14.value!=''))
{ } else {
$msg+="-> La séance de cours #14 correctement\n";
		case_rouge('s14');
		 if(document.form1.Date_14.value==''){
			  document.form1.Date_14.value='';
		 }
}
}
if((document.form1.Jour_15.value!='Jour')||(document.form1.Heure_15.value!='---')||(document.form1.Local_15.value!='---')||(document.form1.Date_15.value!=''))
{
if((document.form1.Jour_15.value!='Jour')&&(document.form1.Heure_15.value!='---')&&(document.form1.Local_15.value!='---')&&(document.form1.Date_15.value!=''))
{ } else {
$msg+="-> La séance de cours #15 correctement\n";
		case_rouge('s15');
		 if(document.form1.Date_15.value==''){
			  document.form1.Date_15.value='';
		 }
}
}
if((document.form1.Jour_16.value!='Jour')||(document.form1.Heure_16.value!='---')||(document.form1.Local_16.value!='---')||(document.form1.Date_16.value!=''))
{
if((document.form1.Jour_16.value!='Jour')&&(document.form1.Heure_16.value!='---')&&(document.form1.Local_16.value!='---')&&(document.form1.Date_16.value!=''))
{ } else {
$msg+="-> La séance de cours #16 correctement\n";
		case_rouge('s16');
		 if(document.form1.Date_16.value==''){
			  document.form1.Date_16.value='';
		 }
}
}
if((document.form1.Jour_17.value!='Jour')||(document.form1.Heure_17.value!='---')||(document.form1.Local_17.value!='---')||(document.form1.Date_17.value!=''))
{
if((document.form1.Jour_17.value!='Jour')&&(document.form1.Heure_17.value!='---')&&(document.form1.Local_17.value!='---')&&(document.form1.Date_17.value!=''))
{ } else {
$msg+="-> La séance de cours #17 correctement\n";
		case_rouge('s17');
		 if(document.form1.Date_17.value==''){
			  document.form1.Date_17.value='';
		 }
}
}
if((document.form1.Jour_18.value!='Jour')||(document.form1.Heure_18.value!='---')||(document.form1.Local_18.value!='---')||(document.form1.Date_18.value!=''))
{
if((document.form1.Jour_18.value!='Jour')&&(document.form1.Heure_18.value!='---')&&(document.form1.Local_18.value!='---')&&(document.form1.Date_18.value!=''))
{ } else {
$msg+="-> La séance de cours #18 correctement\n";
		case_rouge('s18');
		 if(document.form1.Date_18.value==''){
			  document.form1.Date_18.value='';
		 }
}
}
if((document.form1.Jour_19.value!='Jour')||(document.form1.Heure_19.value!='---')||(document.form1.Local_19.value!='---')||(document.form1.Date_19.value!=''))
{
if((document.form1.Jour_19.value!='Jour')&&(document.form1.Heure_19.value!='---')&&(document.form1.Local_19.value!='---')&&(document.form1.Date_19.value!=''))
{ } else {
$msg+="-> La séance de cours #19 correctement\n";
		case_rouge('s19');
		 if(document.form1.Date_19.value==''){
			  document.form1.Date_19.value='';
		 }
}
}
if((document.form1.Jour_20.value!='Jour')||(document.form1.Heure_20.value!='---')||(document.form1.Local_20.value!='---')||(document.form1.Date_20.value!=''))
{
	if((document.form1.Jour_20.value!='Jour')&&(document.form1.Heure_20.value!='---')&&(document.form1.Local_20.value!='---')&&(document.form1.Date_20.value!=''))
	{ } else {
	         $msg+="-> La séance de cours #20 correctement\n";
			case_rouge('s20');
			 if(document.form1.Date_20.value==''){
				  document.form1.Date_20.value='';
			 }
	}
}
//document 1...
	var extention1= document.form1.Doc1.value.slice(-4);
	if( (!isEmpty(document.form1.Doc1.value))||(!isEmpty(document.form1.Cachedoc1.value)))
	{
		if(isEmpty(document.form1.Titre1.value))
		{
			$msg+="-> Le titre du document #1\n";
			case_rouge('Titre1');
		}
		if(!isEmpty(document.form1.Doc1.value))
		{
		  if(!isValidExtention(extention1,validExtention1))
		  {
			$msg+="-> Le document #01 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc1');
		  }
	    }
	}
///fin document 1...	
//document 2...
	var extention2= document.form1.Doc2.value.slice(-4);
	if( (!isEmpty(document.form1.Doc2.value))||(!isEmpty(document.form1.Cachedoc2.value)))
	{
		if(isEmpty(document.form1.Titre2.value))
		{
			$msg+="-> Le titre du document #02\n";
			case_rouge('Titre2');
		}
		if(!isEmpty(document.form1.Doc2.value))
		{
		  if(!isValidExtention(extention2,validExtention1))
		  {
			$msg+="-> Le document #02 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc2');
		  }
	    }
	}
///fin document 2...	
//document 3...
	var extention3= document.form1.Doc3.value.slice(-4);
	if( (!isEmpty(document.form1.Doc3.value))||(!isEmpty(document.form1.Cachedoc3.value)))
	{
		if(isEmpty(document.form1.Titre3.value))
		{
			$msg+="-> Le titre du document #03\n";
			case_rouge('Titre3');
		}
		if(!isEmpty(document.form1.Doc3.value))
		{
		  if(!isValidExtention(extention3,validExtention1))
		  {
			$msg+="-> Le document #03 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc3');
		  }
	    }
	}
///fin document 3...
//document 4...
	var extention4= document.form1.Doc4.value.slice(-4);
	if( (!isEmpty(document.form1.Doc4.value))||(!isEmpty(document.form1.Cachedoc4.value)))
	{
		if(isEmpty(document.form1.Titre4.value))
		{
			$msg+="-> Le titre du document #04\n";
			case_rouge('Titre4');
		}
		if(!isEmpty(document.form1.Doc4.value))
		{
		  if(!isValidExtention(extention4,validExtention1))
		  {
			$msg+="-> Le document #04 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc4');
		  }
	    }
	}
///fin document 4...
//document 5...
	var extention5= document.form1.Doc5.value.slice(-4);
	if( (!isEmpty(document.form1.Doc5.value))||(!isEmpty(document.form1.Cachedoc5.value)))
	{
		if(isEmpty(document.form1.Titre5.value))
		{
			$msg+="-> Le titre du document #05\n";
			case_rouge('Titre5');
		}
		if(!isEmpty(document.form1.Doc5.value))
		{
		  if(!isValidExtention(extention5,validExtention1))
		  {
			$msg+="-> Le document #05 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc5');
		  }
	    }
	}
///fin document 5...
//document 6...
	var extention6= document.form1.Doc6.value.slice(-4);
	if( (!isEmpty(document.form1.Doc6.value))||(!isEmpty(document.form1.Cachedoc6.value)))
	{
		if(isEmpty(document.form1.Titre6.value))
		{
			$msg+="-> Le titre du document #06\n";
			case_rouge('Titre6');
		}
		if(!isEmpty(document.form1.Doc6.value))
		{
		  if(!isValidExtention(extention6,validExtention1))
		  {
			$msg+="-> Le document #06 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc6');
		  }
	    }
	}
///fin document 6...
//document 7..
	var extention7= document.form1.Doc7.value.slice(-4);
	if( (!isEmpty(document.form1.Doc7.value))||(!isEmpty(document.form1.Cachedoc7.value)))
	{
		if(isEmpty(document.form1.Titre7.value))
		{
			$msg+="-> Le titre du document #07\n";
			case_rouge('Titre7');
		}
		if(!isEmpty(document.form1.Doc7.value))
		{
		  if(!isValidExtention(extention7,validExtention1))
		  {
			$msg+="-> Le document #07 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc7');
		  }
	    }
	}
///fin document 7...
//document 8..
	var extention8= document.form1.Doc8.value.slice(-4);
	if( (!isEmpty(document.form1.Doc8.value))||(!isEmpty(document.form1.Cachedoc8.value)))
	{
		if(isEmpty(document.form1.Titre8.value))
		{
			$msg+="-> Le titre du document #08\n";
			case_rouge('Titre8');
		}
		if(!isEmpty(document.form1.Doc8.value))
		{
		  if(!isValidExtention(extention8,validExtention1))
		  {
			$msg+="-> Le document #08 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc8');
		  }
	    }
	}
///fin document 8...
//document 9..
	var extention9= document.form1.Doc9.value.slice(-4);
	if( (!isEmpty(document.form1.Doc9.value))||(!isEmpty(document.form1.Cachedoc9.value)))
	{
		if(isEmpty(document.form1.Titre9.value))
		{
			$msg+="-> Le titre du document #09\n";
			case_rouge('Titre9');
		}
		if(!isEmpty(document.form1.Doc9.value))
		{
		  if(!isValidExtention(extention9,validExtention1))
		  {
			$msg+="-> Le document #09 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc9');
		  }
	    }
	}
///fin document 9...
//document 10..
var extention10= document.form1.Doc10.value.slice(-4);
	if( (!isEmpty(document.form1.Doc10.value))||(!isEmpty(document.form1.Cachedoc10.value)))
	{
		if(isEmpty(document.form1.Titre10.value))
		{
			$msg+="-> Le titre du document #10\n";
			case_rouge('Titre10');
		}
		if(!isEmpty(document.form1.Doc10.value))
		{
		  if(!isValidExtention(extention10,validExtention1))
		  {
			$msg+="-> Le document #10 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc10');
		  }
	    }
	}
///fin document 10...
//document 11..
var extention11= document.form1.Doc11.value.slice(-4);
	if( (!isEmpty(document.form1.Doc11.value))||(!isEmpty(document.form1.Cachedoc11.value)))
	{
		if(isEmpty(document.form1.Titre11.value))
		{
			$msg+="-> Le titre du document #11\n";
			case_rouge('Titre11');
		}
		if(!isEmpty(document.form1.Doc11.value))
		{
		  if(!isValidExtention(extention11,validExtention1))
		  {
			$msg+="-> Le document #11 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc11');
		  }
	    }
	}
///fin document 11...
//document 12..
var extention12= document.form1.Doc12.value.slice(-4);
	if( (!isEmpty(document.form1.Doc12.value))||(!isEmpty(document.form1.Cachedoc12.value)))
	{
		if(isEmpty(document.form1.Titre12.value))
		{
			$msg+="-> Le titre du document #12\n";
			case_rouge('Titre12');
		}
		if(!isEmpty(document.form1.Doc12.value))
		{
		  if(!isValidExtention(extention12,validExtention1))
		  {
			$msg+="-> Le document #12 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc12');
		  }
	    }
	}
///fin document 12...
//document 13..
var extention13= document.form1.Doc13.value.slice(-4);
	if( (!isEmpty(document.form1.Doc13.value))||(!isEmpty(document.form1.Cachedoc13.value)))
	{
		if(isEmpty(document.form1.Titre13.value))
		{
			$msg+="-> Le titre du document #13\n";
			case_rouge('Titre13');
		}
		if(!isEmpty(document.form1.Doc13.value))
		{
		  if(!isValidExtention(extention13,validExtention1))
		  {
			$msg+="-> Le document #13 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc13');
		  }
	    }
	}
///fin document 13...
//document 14..
var extention14= document.form1.Doc14.value.slice(-4);
	if( (!isEmpty(document.form1.Doc14.value))||(!isEmpty(document.form1.Cachedoc14.value)))
	{
		if(isEmpty(document.form1.Titre14.value))
		{
			$msg+="-> Le titre du document #14\n";
			case_rouge('Titre14');
		}
		if(!isEmpty(document.form1.Doc14.value))
		{
		  if(!isValidExtention(extention14,validExtention1))
		  {
			$msg+="-> Le document #14 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc14');
		  }
	    }
	}
///fin document 14...
//document 14..
var extention15= document.form1.Doc15.value.slice(-4);
	if( (!isEmpty(document.form1.Doc15.value))||(!isEmpty(document.form1.Cachedoc15.value)))
	{
		if(isEmpty(document.form1.Titre15.value))
		{
			$msg+="-> Le titre du document #15\n";
			case_rouge('Titre15');
		}
		if(!isEmpty(document.form1.Doc15.value))
		{
		  if(!isValidExtention(extention15,validExtention1))
		  {
			$msg+="-> Le document #15 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc15');
		  }
	    }
	}
///fin document 15...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
/////////////////
function valid_formation_offerte(){

	var $msg='';
	case_blanche('Formation_id');
	case_grise('box_cours_id');
	case_blanche('Session_id');
	case_grise('box_session_id');
	case_grise('box_responsable_id');
	case_blanche('Responsable');
	case_blanche('Place');
	case_blanche('Date_dalc');
	case_blanche('Date_falc');
	case_blanche('Debut_message');
	case_blanche('Fin_message');
	case_blanche('s1');case_blanche('s2');case_blanche('s3');case_blanche('s4');case_blanche('s5');case_blanche('s6');case_blanche('s7');
	case_blanche('s8');case_blanche('s9');case_blanche('s10');case_blanche('s11');case_blanche('s12');case_blanche('s13');case_blanche('s14');
	case_blanche('s15');case_blanche('s16');case_blanche('s17');case_blanche('s18');case_blanche('s19');case_blanche('s20');
	
	case_blanche('Titre1');case_blanche('Titre2');case_blanche('Titre3');case_blanche('Titre4');case_blanche('Titre5');case_blanche('Titre6');case_blanche('Titre7');
	case_blanche('Titre8');case_blanche('Titre9');case_blanche('Titre10');case_blanche('Titre11');case_blanche('Titre12');case_blanche('Titre13');case_blanche('Titre14');case_blanche('Titre15');
	case_blanche('Doc1');case_blanche('Doc2');case_blanche('Doc3');case_blanche('Doc4');case_blanche('Doc5');case_blanche('Doc6');case_blanche('Doc7');
	case_blanche('Doc8');case_blanche('Doc9');case_blanche('Doc10');case_blanche('Doc11');case_blanche('Doc12');case_blanche('Doc13');case_blanche('Doc14');case_blanche('Doc15');	

	var validExtention1 = new Array(".doc",".pdf",".txt",".zip",".ppt",".pps",".wmv",".xls",".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	
	if(document.form1.Formation_id.value=='---')
	{
		$msg+="-> Le choix d'une formation\n";
		case_rouge('Formation_id');
		case_rouge('box_cours_id');
	}
	if(document.form1.Session_id.value=='---')
	{
		$msg+="-> Le choix d'une session offerte\n";
		case_rouge('Session_id');
		case_rouge('box_session_id');
	}
	if(isEmpty(document.form1.Responsable.value))
	{
		$msg+="-> Le choix d'un responsable\n";
		case_rouge('Responsable');
		case_rouge('box_responsable_id');
	}
	if(isEmpty(document.form1.Place.value))
	{
		$msg+="-> Le nombre de places disponibles\n";
		case_rouge('Place');
	}
	if(isEmpty(document.form1.Date_dalc.value))
	{
		$msg+="-> La date du début d'affichage dans la liste\n";
		case_rouge('Date_dalc');
	}
	if(isEmpty(document.form1.Date_falc.value))
	{
		$msg+="-> La date de fin d'affichage dans la liste\n";
		case_rouge('Date_falc');
	}
	if(isEmpty(document.form1.Texte_fr.value))
	{ }
	else {
		if(isEmpty(document.form1.Debut_message.value))
		{
			$msg+="-> La date du début d'affichage du message\n";
			case_rouge('Debut_message');
		}
		if(isEmpty(document.form1.Fin_message.value))
		{
			$msg+="-> La date de fin d'affichage du message\n";
			case_rouge('Fin_message');
		}
	}
	
	//valider les séances...
if((document.form1.Jour_1.value!='Jour')||(document.form1.Heure_1.value!='---')||(document.form1.Local_1.value!='---')||(document.form1.Date_1.value!=''))
{
if((document.form1.Jour_1.value!='Jour')&&(document.form1.Heure_1.value!='---')&&(document.form1.Local_1.value!='---')&&(document.form1.Date_1.value!=''))
{ } else {
		$msg+="-> La séance de formation #01 correctement\n";
		case_rouge('s1');
		 if(document.form1.Date_1.value==''){
			  document.form1.Date_1.value='';
		 }
}
}
	
if((document.form1.Jour_2.value!='Jour')||(document.form1.Heure_2.value!='---')||(document.form1.Local_2.value!='---')||(document.form1.Date_2.value!=''))
{
if((document.form1.Jour_2.value!='Jour')&&(document.form1.Heure_2.value!='---')&&(document.form1.Local_2.value!='---')&&(document.form1.Date_2.value!=''))
{ } else {
$msg+="-> La séance de formation #02 correctement\n";
		case_rouge('s2');
		 if(document.form1.Date_2.value==''){
			  document.form1.Date_2.value='';
		 }
}
}
if((document.form1.Jour_3.value!='Jour')||(document.form1.Heure_3.value!='---')||(document.form1.Local_3.value!='---')||(document.form1.Date_3.value!=''))
{
if((document.form1.Jour_3.value!='Jour')&&(document.form1.Heure_3.value!='---')&&(document.form1.Local_3.value!='---')&&(document.form1.Date_3.value!=''))
{ } else {
$msg+="-> La séance de formation #03 correctement\n";
		case_rouge('s3');
		 if(document.form1.Date_3.value==''){
			  document.form1.Date_3.value='';
		 }
}
}
if((document.form1.Jour_4.value!='Jour')||(document.form1.Heure_4.value!='---')||(document.form1.Local_4.value!='---')||(document.form1.Date_4.value!=''))
{
if((document.form1.Jour_4.value!='Jour')&&(document.form1.Heure_4.value!='---')&&(document.form1.Local_4.value!='---')&&(document.form1.Date_4.value!=''))
{ } else {
$msg+="-> La séance de formation #04 correctement\n";
		case_rouge('s4');
		 if(document.form1.Date_4.value==''){
			  document.form1.Date_4.value='';
		 }
}
}
if((document.form1.Jour_5.value!='Jour')||(document.form1.Heure_5.value!='---')||(document.form1.Local_5.value!='---')||(document.form1.Date_5.value!=''))
{
if((document.form1.Jour_5.value!='Jour')&&(document.form1.Heure_5.value!='---')&&(document.form1.Local_5.value!='---')&&(document.form1.Date_5.value!=''))
{ } else {
$msg+="-> La séance de formation #05 correctement\n";
		case_rouge('s5');
		 if(document.form1.Date_5.value==''){
			  document.form1.Date_5.value='';
		 }
}
}
if((document.form1.Jour_6.value!='Jour')||(document.form1.Heure_6.value!='---')||(document.form1.Local_6.value!='---')||(document.form1.Date_6.value!=''))
{
if((document.form1.Jour_6.value!='Jour')&&(document.form1.Heure_6.value!='---')&&(document.form1.Local_6.value!='---')&&(document.form1.Date_6.value!=''))
{ } else {
$msg+="-> La séance de formation #06 correctement\n";
		case_rouge('s6');
		 if(document.form1.Date_6.value==''){
			  document.form1.Date_6.value='';
		 }
}
}
if((document.form1.Jour_7.value!='Jour')||(document.form1.Heure_7.value!='---')||(document.form1.Local_7.value!='---')||(document.form1.Date_7.value!=''))
{
if((document.form1.Jour_7.value!='Jour')&&(document.form1.Heure_7.value!='---')&&(document.form1.Local_7.value!='---')&&(document.form1.Date_7.value!=''))
{ } else {
$msg+="-> La séance de formation #07 correctement\n";
		case_rouge('s7');
		 if(document.form1.Date_7.value==''){
			  document.form1.Date_7.value='';
		 }
}
}
if((document.form1.Jour_8.value!='Jour')||(document.form1.Heure_8.value!='---')||(document.form1.Local_8.value!='---')||(document.form1.Date_8.value!=''))
{
if((document.form1.Jour_8.value!='Jour')&&(document.form1.Heure_8.value!='---')&&(document.form1.Local_8.value!='---')&&(document.form1.Date_8.value!=''))
{ } else {
$msg+="-> La séance de formation #08 correctement\n";
		case_rouge('s8');
		 if(document.form1.Date_8.value==''){
			  document.form1.Date_8.value='';
		 }
}
}
if((document.form1.Jour_9.value!='Jour')||(document.form1.Heure_9.value!='---')||(document.form1.Local_9.value!='---')||(document.form1.Date_9.value!=''))
{
if((document.form1.Jour_9.value!='Jour')&&(document.form1.Heure_9.value!='---')&&(document.form1.Local_9.value!='---')&&(document.form1.Date_9.value!=''))
{ } else {
$msg+="-> La séance de formation #09 correctement\n";
		case_rouge('s9');
		 if(document.form1.Date_9.value==''){
			  document.form1.Date_9.value='';
		 }
}
}
if((document.form1.Jour_10.value!='Jour')||(document.form1.Heure_10.value!='---')||(document.form1.Local_10.value!='---')||(document.form1.Date_10.value!=''))
{
if((document.form1.Jour_10.value!='Jour')&&(document.form1.Heure_10.value!='---')&&(document.form1.Local_10.value!='---')&&(document.form1.Date_10.value!=''))
{ } else {
$msg+="-> La séance de formation #10 correctement\n";
		case_rouge('s10');
		 if(document.form1.Date_10.value==''){
			  document.form1.Date_10.value='';
		 }
}
}
if((document.form1.Jour_11.value!='Jour')||(document.form1.Heure_11.value!='---')||(document.form1.Local_11.value!='---')||(document.form1.Date_11.value!=''))
{
if((document.form1.Jour_11.value!='Jour')&&(document.form1.Heure_11.value!='---')&&(document.form1.Local_11.value!='---')&&(document.form1.Date_11.value!=''))
{ } else {
$msg+="-> La séance de formation #11 correctement\n";
		case_rouge('s11');
		 if(document.form1.Date_11.value==''){
			  document.form1.Date_11.value='';
		 }
}
}
if((document.form1.Jour_12.value!='Jour')||(document.form1.Heure_12.value!='---')||(document.form1.Local_12.value!='---')||(document.form1.Date_12.value!=''))
{
if((document.form1.Jour_12.value!='Jour')&&(document.form1.Heure_12.value!='---')&&(document.form1.Local_12.value!='---')&&(document.form1.Date_12.value!=''))
{ } else {
$msg+="-> La séance de formation #12 correctement\n";
		case_rouge('s12');
		 if(document.form1.Date_12.value==''){
			  document.form1.Date_12.value='';
		 }
}
}
if((document.form1.Jour_13.value!='Jour')||(document.form1.Heure_13.value!='---')||(document.form1.Local_13.value!='---')||(document.form1.Date_13.value!=''))
{
if((document.form1.Jour_13.value!='Jour')&&(document.form1.Heure_13.value!='---')&&(document.form1.Local_13.value!='---')&&(document.form1.Date_13.value!=''))
{ } else {
$msg+="-> La séance de formation #13 correctement\n";
		case_rouge('s13');
		 if(document.form1.Date_13.value==''){
			  document.form1.Date_13.value='';
		 }
}
}
if((document.form1.Jour_14.value!='Jour')||(document.form1.Heure_14.value!='---')||(document.form1.Local_14.value!='---')||(document.form1.Date_14.value!=''))
{
if((document.form1.Jour_14.value!='Jour')&&(document.form1.Heure_14.value!='---')&&(document.form1.Local_14.value!='---')&&(document.form1.Date_14.value!=''))
{ } else {
$msg+="-> La séance de formation #14 correctement\n";
		case_rouge('s14');
		 if(document.form1.Date_14.value==''){
			  document.form1.Date_14.value='';
		 }
}
}
if((document.form1.Jour_15.value!='Jour')||(document.form1.Heure_15.value!='---')||(document.form1.Local_15.value!='---')||(document.form1.Date_15.value!=''))
{
if((document.form1.Jour_15.value!='Jour')&&(document.form1.Heure_15.value!='---')&&(document.form1.Local_15.value!='---')&&(document.form1.Date_15.value!=''))
{ } else {
$msg+="-> La séance de formation #15 correctement\n";
		case_rouge('s15');
		 if(document.form1.Date_15.value==''){
			  document.form1.Date_15.value='';
		 }
}
}
if((document.form1.Jour_16.value!='Jour')||(document.form1.Heure_16.value!='---')||(document.form1.Local_16.value!='---')||(document.form1.Date_16.value!=''))
{
if((document.form1.Jour_16.value!='Jour')&&(document.form1.Heure_16.value!='---')&&(document.form1.Local_16.value!='---')&&(document.form1.Date_16.value!=''))
{ } else {
$msg+="-> La séance de formation #16 correctement\n";
		case_rouge('s16');
		 if(document.form1.Date_16.value==''){
			  document.form1.Date_16.value='';
		 }
}
}
if((document.form1.Jour_17.value!='Jour')||(document.form1.Heure_17.value!='---')||(document.form1.Local_17.value!='---')||(document.form1.Date_17.value!=''))
{
if((document.form1.Jour_17.value!='Jour')&&(document.form1.Heure_17.value!='---')&&(document.form1.Local_17.value!='---')&&(document.form1.Date_17.value!=''))
{ } else {
$msg+="-> La séance de formation #17 correctement\n";
		case_rouge('s17');
		 if(document.form1.Date_17.value==''){
			  document.form1.Date_17.value='';
		 }
}
}
if((document.form1.Jour_18.value!='Jour')||(document.form1.Heure_18.value!='---')||(document.form1.Local_18.value!='---')||(document.form1.Date_18.value!=''))
{
if((document.form1.Jour_18.value!='Jour')&&(document.form1.Heure_18.value!='---')&&(document.form1.Local_18.value!='---')&&(document.form1.Date_18.value!=''))
{ } else {
$msg+="-> La séance de formation #18 correctement\n";
		case_rouge('s18');
		 if(document.form1.Date_18.value==''){
			  document.form1.Date_18.value='';
		 }
}
}
if((document.form1.Jour_19.value!='Jour')||(document.form1.Heure_19.value!='---')||(document.form1.Local_19.value!='---')||(document.form1.Date_19.value!=''))
{
if((document.form1.Jour_19.value!='Jour')&&(document.form1.Heure_19.value!='---')&&(document.form1.Local_19.value!='---')&&(document.form1.Date_19.value!=''))
{ } else {
$msg+="-> La séance de formation #19 correctement\n";
		case_rouge('s19');
		 if(document.form1.Date_19.value==''){
			  document.form1.Date_19.value='';
		 }
}
}
if((document.form1.Jour_20.value!='Jour')||(document.form1.Heure_20.value!='---')||(document.form1.Local_20.value!='---')||(document.form1.Date_20.value!=''))
{
if((document.form1.Jour_20.value!='Jour')&&(document.form1.Heure_20.value!='---')&&(document.form1.Local_20.value!='---')&&(document.form1.Date_20.value!=''))
{ } else {
	         $msg+="-> La séance de formation #20 correctement\n";
			case_rouge('s20');
			 if(document.form1.Date_20.value==''){
				  document.form1.Date_20.value='';
			 }
}
}
//document 1...
	var extention1= document.form1.Doc1.value.slice(-4);

	if( (!isEmpty(document.form1.Doc1.value))||(!isEmpty(document.form1.Titre1.value)))
	{
		if(isEmpty(document.form1.Titre1.value))
		{
			$msg+="-> Le titre du document #1\n";
			case_rouge('Titre1');
		}
		if(!isValidExtention(extention1,validExtention1))
		{
			$msg+="-> Le document #1 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc1');
		}
	}
///fin document 1...	
//document 2...
	var extention2= document.form1.Doc2.value.slice(-4);

	if( (!isEmpty(document.form1.Doc2.value))||(!isEmpty(document.form1.Titre2.value)))
	{
		if(isEmpty(document.form1.Titre2.value))
		{
			$msg+="-> Le titre du document #2\n";
			case_rouge('Titre2');
		}
		if(!isValidExtention(extention2,validExtention1))
		{
			$msg+="-> Le document #2 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc2');
		}
	}
///fin document 2...	
//document 3...
	var extention3= document.form1.Doc3.value.slice(-4);

	if( (!isEmpty(document.form1.Doc3.value))||(!isEmpty(document.form1.Titre3.value)))
	{
		if(isEmpty(document.form1.Titre3.value))
		{
			$msg+="-> Le titre du document #3\n";
			case_rouge('Titre3');
		}
		if(!isValidExtention(extention3,validExtention1))
		{
			$msg+="-> Le document #3 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc3');
		}
	}
///fin document 3...
//document 4...
	var extention4= document.form1.Doc4.value.slice(-4);

	if( (!isEmpty(document.form1.Doc4.value))||(!isEmpty(document.form1.Titre4.value)))
	{
		if(isEmpty(document.form1.Titre4.value))
		{
			$msg+="-> Le titre du document #4\n";
			case_rouge('Titre4');
		}
		if(!isValidExtention(extention4,validExtention1))
		{
			$msg+="-> Le document #4 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc4');
		}
	}
///fin document 4...
//document 5...
	var extention5= document.form1.Doc5.value.slice(-4);

	if( (!isEmpty(document.form1.Doc5.value))||(!isEmpty(document.form1.Titre5.value)))
	{
		if(isEmpty(document.form1.Titre5.value))
		{
			$msg+="-> Le titre du document #5\n";
			case_rouge('Titre5');
		}
		if(!isValidExtention(extention5,validExtention1))
		{
			$msg+="-> Le document #5 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc5');
		}
	}
///fin document 5...
//document 6...
	var extention6= document.form1.Doc6.value.slice(-4);

	if( (!isEmpty(document.form1.Doc6.value))||(!isEmpty(document.form1.Titre6.value)))
	{
		if(isEmpty(document.form1.Titre6.value))
		{
			$msg+="-> Le titre du document #6\n";
			case_rouge('Titre6');
		}
		if(!isValidExtention(extention6,validExtention1))
		{
			$msg+="-> Le document #6 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc6');
		}
	}
///fin document 6...
//document 7..
	var extention7= document.form1.Doc7.value.slice(-4);

	if( (!isEmpty(document.form1.Doc7.value))||(!isEmpty(document.form1.Titre7.value)))
	{
		if(isEmpty(document.form1.Titre7.value))
		{
			$msg+="-> Le titre du document #7\n";
			case_rouge('Titre7');
		}
		if(!isValidExtention(extention7,validExtention1))
		{
			$msg+="-> Le document #7 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc7');
		}
	}
///fin document 7...
//document 8..
	var extention8= document.form1.Doc8.value.slice(-4);

	if( (!isEmpty(document.form1.Doc8.value))||(!isEmpty(document.form1.Titre8.value)))
	{
		if(isEmpty(document.form1.Titre8.value))
		{
			$msg+="-> Le titre du document #8\n";
			case_rouge('Titre8');
		}
		if(!isValidExtention(extention8,validExtention1))
		{
			$msg+="-> Le document #8 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc8');
		}
	}
///fin document 8...
//document 9..
	var extention9= document.form1.Doc9.value.slice(-4);

	if( (!isEmpty(document.form1.Doc9.value))||(!isEmpty(document.form1.Titre9.value)))
	{
		if(isEmpty(document.form1.Titre9.value))
		{
			$msg+="-> Le titre du document #9\n";
			case_rouge('Titre9');
		}
		if(!isValidExtention(extention9,validExtention1))
		{
			$msg+="-> Le document #9 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc9');
		}
	}
///fin document 9...
//document 10..
	var extention10= document.form1.Doc10.value.slice(-4);

	if( (!isEmpty(document.form1.Doc10.value))||(!isEmpty(document.form1.Titre10.value)))
	{
		if(isEmpty(document.form1.Titre10.value))
		{
			$msg+="-> Le titre du document #10\n";
			case_rouge('Titre10');
		}
		if(!isValidExtention(extention10,validExtention1))
		{
			$msg+="-> Le document #10 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc10');
		}
	}
///fin document 10...
//document 11..
	var extention11= document.form1.Doc11.value.slice(-4);

	if( (!isEmpty(document.form1.Doc11.value))||(!isEmpty(document.form1.Titre11.value)))
	{
		if(isEmpty(document.form1.Titre11.value))
		{
			$msg+="-> Le titre du document #11\n";
			case_rouge('Titre11');
		}
		if(!isValidExtention(extention11,validExtention1))
		{
			$msg+="-> Le document #11 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc11');
		}
	}
///fin document 11...
//document 12..
	var extention12= document.form1.Doc12.value.slice(-4);

	if( (!isEmpty(document.form1.Doc12.value))||(!isEmpty(document.form1.Titre12.value)))
	{
		if(isEmpty(document.form1.Titre12.value))
		{
			$msg+="-> Le titre du document #12\n";
			case_rouge('Titre12');
		}
		if(!isValidExtention(extention12,validExtention1))
		{
			$msg+="-> Le document #12 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc12');
		}
	}
///fin document 12...
//document 13..
	var extention13= document.form1.Doc13.value.slice(-4);

	if( (!isEmpty(document.form1.Doc13.value))||(!isEmpty(document.form1.Titre13.value)))
	{
		if(isEmpty(document.form1.Titre13.value))
		{
			$msg+="-> Le titre du document #13\n";
			case_rouge('Titre13');
		}
		if(!isValidExtention(extention13,validExtention1))
		{
			$msg+="-> Le document #13 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc13');
		}
	}
///fin document 13...
//document 14..
	var extention14= document.form1.Doc14.value.slice(-4);

	if( (!isEmpty(document.form1.Doc14.value))||(!isEmpty(document.form1.Titre14.value)))
	{
		if(isEmpty(document.form1.Titre14.value))
		{
			$msg+="-> Le titre du document #14\n";
			case_rouge('Titre14');
		}
		if(!isValidExtention(extention14,validExtention1))
		{
			$msg+="-> Le document #14 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc14');
		}
	}
///fin document 14...
//document 14..
	var extention15= document.form1.Doc15.value.slice(-4);

	if( (!isEmpty(document.form1.Doc15.value))||(!isEmpty(document.form1.Titre15.value)))
	{
		if(isEmpty(document.form1.Titre15.value))
		{
			$msg+="-> Le titre du document #15\n";
			case_rouge('Titre15');
		}
		if(!isValidExtention(extention15,validExtention1))
		{
			$msg+="-> Le document #15 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc15');
		}
	}
///fin document 15...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
////////////////2
function valid_formation_offerte2(){

	var $msg='';
	case_blanche('Formation_id');
	case_grise('box_cours_id');
	case_blanche('Session_id');
	case_grise('box_session_id');
	case_grise('box_responsable_id');
	case_blanche('Responsable');
	case_blanche('Place');
	case_blanche('Date_dalc');
	case_blanche('Date_falc');
	case_blanche('Debut_message');
	case_blanche('Fin_message');
	case_blanche('s1');case_blanche('s2');case_blanche('s3');case_blanche('s4');case_blanche('s5');case_blanche('s6');case_blanche('s7');
	case_blanche('s8');case_blanche('s9');case_blanche('s10');case_blanche('s11');case_blanche('s12');case_blanche('s13');case_blanche('s14');
	case_blanche('s15');case_blanche('s16');case_blanche('s17');case_blanche('s18');case_blanche('s19');case_blanche('s20');
	
	case_blanche('Titre1');case_blanche('Titre2');case_blanche('Titre3');case_blanche('Titre4');case_blanche('Titre5');case_blanche('Titre6');case_blanche('Titre7');
	case_blanche('Titre8');case_blanche('Titre9');case_blanche('Titre10');case_blanche('Titre11');case_blanche('Titre12');case_blanche('Titre13');case_blanche('Titre14');case_blanche('Titre15');
	case_blanche('Doc1');case_blanche('Doc2');case_blanche('Doc3');case_blanche('Doc4');case_blanche('Doc5');case_blanche('Doc6');case_blanche('Doc7');
	case_blanche('Doc8');case_blanche('Doc9');case_blanche('Doc10');case_blanche('Doc11');case_blanche('Doc12');case_blanche('Doc13');case_blanche('Doc14');case_blanche('Doc15');	

	var validExtention1 = new Array(".doc",".pdf",".txt",".zip",".ppt",".pps",".wmv",".xls",".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	
	if(document.form1.Formation_id.value=='---')
	{
		$msg+="-> Le choix d'une formation\n";
		case_rouge('Formation_id');
		case_rouge('box_cours_id');
	}
	if(document.form1.Session_id.value=='---')
	{
		$msg+="-> Le choix d'une session offerte\n";
		case_rouge('Session_id');
		case_rouge('box_session_id');
	}
	if(isEmpty(document.form1.Responsable.value))
	{
		$msg+="-> Le choix d'un responsable\n";
		case_rouge('Responsable');
		case_rouge('box_responsable_id');
	}
	if(isEmpty(document.form1.Place.value))
	{
		$msg+="-> Le nombre de places disponibles\n";
		case_rouge('Place');
	}
	if(isEmpty(document.form1.Date_dalc.value))
	{
		$msg+="-> La date du début d'affichage dans la liste\n";
		case_rouge('Date_dalc');
	}
	if(isEmpty(document.form1.Date_falc.value))
	{
		$msg+="-> La date de fin d'affichage dans la liste\n";
		case_rouge('Date_falc');
	}
	if(isEmpty(document.form1.Texte_fr.value))
	{ }
	else {
		if(isEmpty(document.form1.Debut_message.value))
		{
			$msg+="-> La date du début d'affichage du message\n";
			case_rouge('Debut_message');
		}
		if(isEmpty(document.form1.Fin_message.value))
		{
			$msg+="-> La date de fin d'affichage du message\n";
			case_rouge('Fin_message');
		}
	}
	
	//valider les séances...
if((document.form1.Jour_1.value!='Jour')||(document.form1.Heure_1.value!='---')||(document.form1.Local_1.value!='---')||(document.form1.Date_1.value!=''))
{
if((document.form1.Jour_1.value!='Jour')&&(document.form1.Heure_1.value!='---')&&(document.form1.Local_1.value!='---')&&(document.form1.Date_1.value!=''))
{ } else {
		$msg+="-> La séance de formation #01 correctement\n";
		case_rouge('s1');
		 if(document.form1.Date_1.value==''){
			  document.form1.Date_1.value='';
		 }
}
}
	
if((document.form1.Jour_2.value!='Jour')||(document.form1.Heure_2.value!='---')||(document.form1.Local_2.value!='---')||(document.form1.Date_2.value!=''))
{
if((document.form1.Jour_2.value!='Jour')&&(document.form1.Heure_2.value!='---')&&(document.form1.Local_2.value!='---')&&(document.form1.Date_2.value!=''))
{ } else {
$msg+="-> La séance de formation #02 correctement\n";
		case_rouge('s2');
		 if(document.form1.Date_2.value==''){
			  document.form1.Date_2.value='';
		 }
}
}
if((document.form1.Jour_3.value!='Jour')||(document.form1.Heure_3.value!='---')||(document.form1.Local_3.value!='---')||(document.form1.Date_3.value!=''))
{
if((document.form1.Jour_3.value!='Jour')&&(document.form1.Heure_3.value!='---')&&(document.form1.Local_3.value!='---')&&(document.form1.Date_3.value!=''))
{ } else {
$msg+="-> La séance de formation #03 correctement\n";
		case_rouge('s3');
		 if(document.form1.Date_3.value==''){
			  document.form1.Date_3.value='';
		 }
}
}
if((document.form1.Jour_4.value!='Jour')||(document.form1.Heure_4.value!='---')||(document.form1.Local_4.value!='---')||(document.form1.Date_4.value!=''))
{
if((document.form1.Jour_4.value!='Jour')&&(document.form1.Heure_4.value!='---')&&(document.form1.Local_4.value!='---')&&(document.form1.Date_4.value!=''))
{ } else {
$msg+="-> La séance de formation #04 correctement\n";
		case_rouge('s4');
		 if(document.form1.Date_4.value==''){
			  document.form1.Date_4.value='';
		 }
}
}
if((document.form1.Jour_5.value!='Jour')||(document.form1.Heure_5.value!='---')||(document.form1.Local_5.value!='---')||(document.form1.Date_5.value!=''))
{
if((document.form1.Jour_5.value!='Jour')&&(document.form1.Heure_5.value!='---')&&(document.form1.Local_5.value!='---')&&(document.form1.Date_5.value!=''))
{ } else {
$msg+="-> La séance de formation #05 correctement\n";
		case_rouge('s5');
		 if(document.form1.Date_5.value==''){
			  document.form1.Date_5.value='';
		 }
}
}
if((document.form1.Jour_6.value!='Jour')||(document.form1.Heure_6.value!='---')||(document.form1.Local_6.value!='---')||(document.form1.Date_6.value!=''))
{
if((document.form1.Jour_6.value!='Jour')&&(document.form1.Heure_6.value!='---')&&(document.form1.Local_6.value!='---')&&(document.form1.Date_6.value!=''))
{ } else {
$msg+="-> La séance de formation #06 correctement\n";
		case_rouge('s6');
		 if(document.form1.Date_6.value==''){
			  document.form1.Date_6.value='';
		 }
}
}
if((document.form1.Jour_7.value!='Jour')||(document.form1.Heure_7.value!='---')||(document.form1.Local_7.value!='---')||(document.form1.Date_7.value!=''))
{
if((document.form1.Jour_7.value!='Jour')&&(document.form1.Heure_7.value!='---')&&(document.form1.Local_7.value!='---')&&(document.form1.Date_7.value!=''))
{ } else {
$msg+="-> La séance de formation #07 correctement\n";
		case_rouge('s7');
		 if(document.form1.Date_7.value==''){
			  document.form1.Date_7.value='';
		 }
}
}
if((document.form1.Jour_8.value!='Jour')||(document.form1.Heure_8.value!='---')||(document.form1.Local_8.value!='---')||(document.form1.Date_8.value!=''))
{
if((document.form1.Jour_8.value!='Jour')&&(document.form1.Heure_8.value!='---')&&(document.form1.Local_8.value!='---')&&(document.form1.Date_8.value!=''))
{ } else {
$msg+="-> La séance de formation #08 correctement\n";
		case_rouge('s8');
		 if(document.form1.Date_8.value==''){
			  document.form1.Date_8.value='';
		 }
}
}
if((document.form1.Jour_9.value!='Jour')||(document.form1.Heure_9.value!='---')||(document.form1.Local_9.value!='---')||(document.form1.Date_9.value!=''))
{
if((document.form1.Jour_9.value!='Jour')&&(document.form1.Heure_9.value!='---')&&(document.form1.Local_9.value!='---')&&(document.form1.Date_9.value!=''))
{ } else {
$msg+="-> La séance de formation #09 correctement\n";
		case_rouge('s9');
		 if(document.form1.Date_9.value==''){
			  document.form1.Date_9.value='';
		 }
}
}
if((document.form1.Jour_10.value!='Jour')||(document.form1.Heure_10.value!='---')||(document.form1.Local_10.value!='---')||(document.form1.Date_10.value!=''))
{
if((document.form1.Jour_10.value!='Jour')&&(document.form1.Heure_10.value!='---')&&(document.form1.Local_10.value!='---')&&(document.form1.Date_10.value!=''))
{ } else {
$msg+="-> La séance de formation #10 correctement\n";
		case_rouge('s10');
		 if(document.form1.Date_10.value==''){
			  document.form1.Date_10.value='';
		 }
}
}
if((document.form1.Jour_11.value!='Jour')||(document.form1.Heure_11.value!='---')||(document.form1.Local_11.value!='---')||(document.form1.Date_11.value!=''))
{
if((document.form1.Jour_11.value!='Jour')&&(document.form1.Heure_11.value!='---')&&(document.form1.Local_11.value!='---')&&(document.form1.Date_11.value!=''))
{ } else {
$msg+="-> La séance de formation #11 correctement\n";
		case_rouge('s11');
		 if(document.form1.Date_11.value==''){
			  document.form1.Date_11.value='';
		 }
}
}
if((document.form1.Jour_12.value!='Jour')||(document.form1.Heure_12.value!='---')||(document.form1.Local_12.value!='---')||(document.form1.Date_12.value!=''))
{
if((document.form1.Jour_12.value!='Jour')&&(document.form1.Heure_12.value!='---')&&(document.form1.Local_12.value!='---')&&(document.form1.Date_12.value!=''))
{ } else {
$msg+="-> La séance de formation #12 correctement\n";
		case_rouge('s12');
		 if(document.form1.Date_12.value==''){
			  document.form1.Date_12.value='';
		 }
}
}
if((document.form1.Jour_13.value!='Jour')||(document.form1.Heure_13.value!='---')||(document.form1.Local_13.value!='---')||(document.form1.Date_13.value!=''))
{
if((document.form1.Jour_13.value!='Jour')&&(document.form1.Heure_13.value!='---')&&(document.form1.Local_13.value!='---')&&(document.form1.Date_13.value!=''))
{ } else {
$msg+="-> La séance de formation #13 correctement\n";
		case_rouge('s13');
		 if(document.form1.Date_13.value==''){
			  document.form1.Date_13.value='';
		 }
}
}
if((document.form1.Jour_14.value!='Jour')||(document.form1.Heure_14.value!='---')||(document.form1.Local_14.value!='---')||(document.form1.Date_14.value!=''))
{
if((document.form1.Jour_14.value!='Jour')&&(document.form1.Heure_14.value!='---')&&(document.form1.Local_14.value!='---')&&(document.form1.Date_14.value!=''))
{ } else {
$msg+="-> La séance de formation #14 correctement\n";
		case_rouge('s14');
		 if(document.form1.Date_14.value==''){
			  document.form1.Date_14.value='';
		 }
}
}
if((document.form1.Jour_15.value!='Jour')||(document.form1.Heure_15.value!='---')||(document.form1.Local_15.value!='---')||(document.form1.Date_15.value!=''))
{
if((document.form1.Jour_15.value!='Jour')&&(document.form1.Heure_15.value!='---')&&(document.form1.Local_15.value!='---')&&(document.form1.Date_15.value!=''))
{ } else {
$msg+="-> La séance de formation #15 correctement\n";
		case_rouge('s15');
		 if(document.form1.Date_15.value==''){
			  document.form1.Date_15.value='';
		 }
}
}
if((document.form1.Jour_16.value!='Jour')||(document.form1.Heure_16.value!='---')||(document.form1.Local_16.value!='---')||(document.form1.Date_16.value!=''))
{
if((document.form1.Jour_16.value!='Jour')&&(document.form1.Heure_16.value!='---')&&(document.form1.Local_16.value!='---')&&(document.form1.Date_16.value!=''))
{ } else {
$msg+="-> La séance de formation #16 correctement\n";
		case_rouge('s16');
		 if(document.form1.Date_16.value==''){
			  document.form1.Date_16.value='';
		 }
}
}
if((document.form1.Jour_17.value!='Jour')||(document.form1.Heure_17.value!='---')||(document.form1.Local_17.value!='---')||(document.form1.Date_17.value!=''))
{
if((document.form1.Jour_17.value!='Jour')&&(document.form1.Heure_17.value!='---')&&(document.form1.Local_17.value!='---')&&(document.form1.Date_17.value!=''))
{ } else {
$msg+="-> La séance de formation #17 correctement\n";
		case_rouge('s17');
		 if(document.form1.Date_17.value==''){
			  document.form1.Date_17.value='';
		 }
}
}
if((document.form1.Jour_18.value!='Jour')||(document.form1.Heure_18.value!='---')||(document.form1.Local_18.value!='---')||(document.form1.Date_18.value!=''))
{
if((document.form1.Jour_18.value!='Jour')&&(document.form1.Heure_18.value!='---')&&(document.form1.Local_18.value!='---')&&(document.form1.Date_18.value!=''))
{ } else {
$msg+="-> La séance de formation #18 correctement\n";
		case_rouge('s18');
		 if(document.form1.Date_18.value==''){
			  document.form1.Date_18.value='';
		 }
}
}
if((document.form1.Jour_19.value!='Jour')||(document.form1.Heure_19.value!='---')||(document.form1.Local_19.value!='---')||(document.form1.Date_19.value!=''))
{
if((document.form1.Jour_19.value!='Jour')&&(document.form1.Heure_19.value!='---')&&(document.form1.Local_19.value!='---')&&(document.form1.Date_19.value!=''))
{ } else {
$msg+="-> La séance de formation #19 correctement\n";
		case_rouge('s19');
		 if(document.form1.Date_19.value==''){
			  document.form1.Date_19.value='';
		 }
}
}
if((document.form1.Jour_20.value!='Jour')||(document.form1.Heure_20.value!='---')||(document.form1.Local_20.value!='---')||(document.form1.Date_20.value!=''))
{
if((document.form1.Jour_20.value!='Jour')&&(document.form1.Heure_20.value!='---')&&(document.form1.Local_20.value!='---')&&(document.form1.Date_20.value!=''))
{ } else {
	         $msg+="-> La séance de formation #20 correctement\n";
			case_rouge('s20');
			 if(document.form1.Date_20.value==''){
				  document.form1.Date_20.value='';
			 }
}
}
//document 1...
	var extention1= document.form1.Doc1.value.slice(-4);
	if( (!isEmpty(document.form1.Doc1.value))||(!isEmpty(document.form1.Cachedoc1.value)))
	{
		if(isEmpty(document.form1.Titre1.value))
		{
			$msg+="-> Le titre du document #1\n";
			case_rouge('Titre1');
		}
		if(!isEmpty(document.form1.Doc1.value))
		{
		  if(!isValidExtention(extention1,validExtention1))
		  {
			$msg+="-> Le document #01 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc1');
		  }
	    }
	}
///fin document 1...	
//document 2...
	var extention2= document.form1.Doc2.value.slice(-4);
	if( (!isEmpty(document.form1.Doc2.value))||(!isEmpty(document.form1.Cachedoc2.value)))
	{
		if(isEmpty(document.form1.Titre2.value))
		{
			$msg+="-> Le titre du document #02\n";
			case_rouge('Titre2');
		}
		if(!isEmpty(document.form1.Doc2.value))
		{
		  if(!isValidExtention(extention2,validExtention1))
		  {
			$msg+="-> Le document #02 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc2');
		  }
	    }
	}
///fin document 2...	
//document 3...
	var extention3= document.form1.Doc3.value.slice(-4);
	if( (!isEmpty(document.form1.Doc3.value))||(!isEmpty(document.form1.Cachedoc3.value)))
	{
		if(isEmpty(document.form1.Titre3.value))
		{
			$msg+="-> Le titre du document #03\n";
			case_rouge('Titre3');
		}
		if(!isEmpty(document.form1.Doc3.value))
		{
		  if(!isValidExtention(extention3,validExtention1))
		  {
			$msg+="-> Le document #03 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc3');
		  }
	    }
	}
///fin document 3...
//document 4...
	var extention4= document.form1.Doc4.value.slice(-4);
	if( (!isEmpty(document.form1.Doc4.value))||(!isEmpty(document.form1.Cachedoc4.value)))
	{
		if(isEmpty(document.form1.Titre4.value))
		{
			$msg+="-> Le titre du document #04\n";
			case_rouge('Titre4');
		}
		if(!isEmpty(document.form1.Doc4.value))
		{
		  if(!isValidExtention(extention4,validExtention1))
		  {
			$msg+="-> Le document #04 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc4');
		  }
	    }
	}
///fin document 4...
//document 5...
	var extention5= document.form1.Doc5.value.slice(-4);
	if( (!isEmpty(document.form1.Doc5.value))||(!isEmpty(document.form1.Cachedoc5.value)))
	{
		if(isEmpty(document.form1.Titre5.value))
		{
			$msg+="-> Le titre du document #05\n";
			case_rouge('Titre5');
		}
		if(!isEmpty(document.form1.Doc5.value))
		{
		  if(!isValidExtention(extention5,validExtention1))
		  {
			$msg+="-> Le document #05 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc5');
		  }
	    }
	}
///fin document 5...
//document 6...
	var extention6= document.form1.Doc6.value.slice(-4);
	if( (!isEmpty(document.form1.Doc6.value))||(!isEmpty(document.form1.Cachedoc6.value)))
	{
		if(isEmpty(document.form1.Titre6.value))
		{
			$msg+="-> Le titre du document #06\n";
			case_rouge('Titre6');
		}
		if(!isEmpty(document.form1.Doc6.value))
		{
		  if(!isValidExtention(extention6,validExtention1))
		  {
			$msg+="-> Le document #06 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc6');
		  }
	    }
	}
///fin document 6...
//document 7..
	var extention7= document.form1.Doc7.value.slice(-4);
	if( (!isEmpty(document.form1.Doc7.value))||(!isEmpty(document.form1.Cachedoc7.value)))
	{
		if(isEmpty(document.form1.Titre7.value))
		{
			$msg+="-> Le titre du document #07\n";
			case_rouge('Titre7');
		}
		if(!isEmpty(document.form1.Doc7.value))
		{
		  if(!isValidExtention(extention7,validExtention1))
		  {
			$msg+="-> Le document #07 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc7');
		  }
	    }
	}
///fin document 7...
//document 8..
	var extention8= document.form1.Doc8.value.slice(-4);
	if( (!isEmpty(document.form1.Doc8.value))||(!isEmpty(document.form1.Cachedoc8.value)))
	{
		if(isEmpty(document.form1.Titre8.value))
		{
			$msg+="-> Le titre du document #08\n";
			case_rouge('Titre8');
		}
		if(!isEmpty(document.form1.Doc8.value))
		{
		  if(!isValidExtention(extention8,validExtention1))
		  {
			$msg+="-> Le document #08 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc8');
		  }
	    }
	}
///fin document 8...
//document 9..
	var extention9= document.form1.Doc9.value.slice(-4);
	if( (!isEmpty(document.form1.Doc9.value))||(!isEmpty(document.form1.Cachedoc9.value)))
	{
		if(isEmpty(document.form1.Titre9.value))
		{
			$msg+="-> Le titre du document #09\n";
			case_rouge('Titre9');
		}
		if(!isEmpty(document.form1.Doc9.value))
		{
		  if(!isValidExtention(extention9,validExtention1))
		  {
			$msg+="-> Le document #09 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc9');
		  }
	    }
	}
///fin document 9...
//document 10..
var extention10= document.form1.Doc10.value.slice(-4);
	if( (!isEmpty(document.form1.Doc10.value))||(!isEmpty(document.form1.Cachedoc10.value)))
	{
		if(isEmpty(document.form1.Titre10.value))
		{
			$msg+="-> Le titre du document #10\n";
			case_rouge('Titre10');
		}
		if(!isEmpty(document.form1.Doc10.value))
		{
		  if(!isValidExtention(extention10,validExtention1))
		  {
			$msg+="-> Le document #10 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc10');
		  }
	    }
	}
///fin document 10...
//document 11..
var extention11= document.form1.Doc11.value.slice(-4);
	if( (!isEmpty(document.form1.Doc11.value))||(!isEmpty(document.form1.Cachedoc11.value)))
	{
		if(isEmpty(document.form1.Titre11.value))
		{
			$msg+="-> Le titre du document #11\n";
			case_rouge('Titre11');
		}
		if(!isEmpty(document.form1.Doc11.value))
		{
		  if(!isValidExtention(extention11,validExtention1))
		  {
			$msg+="-> Le document #11 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc11');
		  }
	    }
	}
///fin document 11...
//document 12..
var extention12= document.form1.Doc12.value.slice(-4);
	if( (!isEmpty(document.form1.Doc12.value))||(!isEmpty(document.form1.Cachedoc12.value)))
	{
		if(isEmpty(document.form1.Titre12.value))
		{
			$msg+="-> Le titre du document #12\n";
			case_rouge('Titre12');
		}
		if(!isEmpty(document.form1.Doc12.value))
		{
		  if(!isValidExtention(extention12,validExtention1))
		  {
			$msg+="-> Le document #12 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc12');
		  }
	    }
	}
///fin document 12...
//document 13..
var extention13= document.form1.Doc13.value.slice(-4);
	if( (!isEmpty(document.form1.Doc13.value))||(!isEmpty(document.form1.Cachedoc13.value)))
	{
		if(isEmpty(document.form1.Titre13.value))
		{
			$msg+="-> Le titre du document #13\n";
			case_rouge('Titre13');
		}
		if(!isEmpty(document.form1.Doc13.value))
		{
		  if(!isValidExtention(extention13,validExtention1))
		  {
			$msg+="-> Le document #13 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc13');
		  }
	    }
	}
///fin document 13...
//document 14..
var extention14= document.form1.Doc14.value.slice(-4);
	if( (!isEmpty(document.form1.Doc14.value))||(!isEmpty(document.form1.Cachedoc14.value)))
	{
		if(isEmpty(document.form1.Titre14.value))
		{
			$msg+="-> Le titre du document #14\n";
			case_rouge('Titre14');
		}
		if(!isEmpty(document.form1.Doc14.value))
		{
		  if(!isValidExtention(extention14,validExtention1))
		  {
			$msg+="-> Le document #14 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc14');
		  }
	    }
	}
///fin document 14...
//document 14..
var extention15= document.form1.Doc15.value.slice(-4);
	if( (!isEmpty(document.form1.Doc15.value))||(!isEmpty(document.form1.Cachedoc15.value)))
	{
		if(isEmpty(document.form1.Titre15.value))
		{
			$msg+="-> Le titre du document #15\n";
			case_rouge('Titre15');
		}
		if(!isEmpty(document.form1.Doc15.value))
		{
		  if(!isValidExtention(extention15,validExtention1))
		  {
			$msg+="-> Le document #15 doit être de format: ( pdf, zip, txt, doc, ppt, pps, wmv, mov, mpg, xls, jpg, jpeg, jpe, gif )\n";
			case_rouge('Doc15');
		  }
	    }
	}
///fin document 15...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
////////////////
//////////////////2 fin
function valid_session(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

	if(isEmpty(document.form1.An.value))
	{
		$msg+="-> Année\n";
	}
	else if(isNaN(document.form1.An.value)) // 2
	{
		$msg+="-> Année doit être un nombre\n";
		document.form1.An.value='';
		//case_rouge('Tcours');
	}
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

function valid_catcours(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Categorie_fr.value))
	{
		$msg+="-> La dénomination de la catégorie\n";
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
function valid_catformation(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Cat_formation.value))
	{
		$msg+="-> La dénomination de la catégorie\n";
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
function valid_catclientele(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Clientele_fr.value))
	{
		$msg+="-> La dénomination de la catégorie\n";
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
function valid_catbourse(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Titre_fr.value))
	{
		$msg+="-> La dénomination de la catégorie\n";
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

function valid_edifice(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Nom_edifice.value))
	{
		$msg+="-> La dénomination de l'édifice\n";
	}
	if(isEmpty(document.form1.Abre.value))
	{
		$msg+="-> L'abréviation de l'édifice\n";
	}
	if(isEmpty(document.form1.Adresse.value))
	{
		$msg+="-> L'adresse de l'édifice\n";
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
function valid_local(){
	var $msg='';
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	
	if(isEmpty(document.form1.Local.value))
	{
		$msg+="-> Le numéro du local\n";
	}
		if((document.form1.Edifice_id.value=='---'))
	{
		$msg+="-> Le choix d'un édifice\n";
	}
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}


function valid_APE(){
var $msg='';
	if((document.form1.Programme.value=='---'))
	{
		$msg+="-> Le choix du programme\n";
	}
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

function valid_heure(){
	var $msg='';
	if(isEmpty(document.form1.Heure.value))
	{
		$msg+="-> Le bloc horaire \n";
	}
	else if(!isEmpty(document.form1.Heure.value))
	{
		$codeoff=0;
		entry=document.form1.Heure.value;
		document.form1.Heure.value=entry.toLowerCase();
		strlen=entry.length; 
		if (strlen!=11) {$codeoff=1;}
		entry=entry.toLowerCase();    // in case of lowercase characters
	    // Check for legal characters in string - note index starts at zero
		if ('0123456789'.indexOf(entry.charAt(0))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(1))<0) {$codeoff=1}
		if ('h'.indexOf(entry.charAt(2))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(3))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(4))<0) {$codeoff=1}
		if ('-'.indexOf(entry.charAt(5))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(6))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(7))<0) {$codeoff=1}
		if ('h'.indexOf(entry.charAt(8))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(9))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(10))<0) {$codeoff=1}
		if($codeoff==1){$msg+="-> Le bloc horaire doit être au format (00h00-00h00)\n"; }
	} 
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg);
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
///fin bloc horaire


function valid_ville(){
	var $msg='';	
	if(isEmpty(document.form1.Nom_ville.value))
	{
		$msg+="-> La dénomination de la ville\n";
	}
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
function valid_catactivite(){
	var $msg='';	
	if(isEmpty(document.form1.Cat.value))
	{
		$msg+="-> La dénomination\n";
	}
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

function valid_administrateur(){
	var $msg='';
	case_blanche('Prenom');
	case_blanche('Nom');
	case_blanche('Courriel');
	case_blanche('Telephone');
	case_blanche('Login');
	case_blanche('Password');
	case_blanche('Photo1');
    var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	if(isEmpty(document.form1.Prenom.value))
	{
		$msg+="-> Le prénom\n";
		case_rouge('Prenom');
    }		
	if(isEmpty(document.form1.Nom.value))
	{
		$msg+="-> Le nom\n";
		case_rouge('Nom');
	}
	if(isEmpty(document.form1.Courriel.value))
	{
		$msg+="-> Le courriel\n";
		case_rouge('Courriel');
	}
	if(isEmpty(document.form1.Telephone.value))
	{
		$msg+="-> Le numéro de téléphone\n";
		case_rouge('Telephone');
	}
	if(isEmpty(document.form1.Login.value))
	{
		$msg+="-> Le code d'identification\n";
		case_rouge('Login');
	}
	if(isEmpty(document.form1.Password.value))
	{
		$msg+="-> Le mot de passe\n";
		case_rouge('Password');
	}
	//image signature...
	var extention2= document.form1.Photo1.value.slice(-4);
		if(!isEmpty(document.form1.Photo1.value))
		{
		  if(!isValidExtention(extention2,validExtention2))
		  {
			$msg+="-> La signature doit être de format: ( jpg, jpe, jpeg, gif )\n";
			case_rouge('Photo1');
		  }
	    }
///fin image...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

function valid_cours(){
	var $msg='';
	case_blanche('No_cours');
	case_blanche('Titre_cours_fr');
	case_blanche('Tcours');
	case_blanche('Tequipe');
	case_blanche('Tatelier');
	case_blanche('Tindividuel');
	case_blanche('Texte_fr');
	case_blanche('Texte_en');
	if(isEmpty(document.form1.No_cours.value))
	{
		$msg+="-> Le numéro du cours\n";
		case_rouge('No_cours');
    }
			
	if(isEmpty(document.form1.Titre_cours_fr.value))
	{
		$msg+="-> Le titre du cours\n";
		case_rouge('Titre_cours_fr');
	}
	
	if(isEmpty(document.form1.Tcours.value))
	{
		$msg+="-> Heure de cours par semaine\n";
		case_rouge('Tcours');
	}
	else if(isNaN(document.form1.Tcours.value)) // 2
	{
		$msg+="-> Heure de cours par semaine doit être un nombre\n";
		case_rouge('Tcours');
	}
	
	if(isEmpty(document.form1.Tequipe.value))
	{
		$msg+="-> Travail en équipe\n";
		case_rouge('Tequipe');
	}
	else if(isNaN(document.form1.Tequipe.value)) // 2
	{
		$msg+="-> Travail en équipe doit être un nombre\n";
		case_rouge('Tequipe');
	}
	
	if(isEmpty(document.form1.Tatelier.value))
	{
		$msg+="-> Atelier\n";
		case_rouge('Tatelier');
	}
	
	else if(isNaN(document.form1.Tatelier.value)) // 2
	{
		$msg+="-> Atelier doit être un nombre\n";
		case_rouge('Tatelier');
	}
	
	if(isEmpty(document.form1.Tindividuel.value))
	{
		$msg+="-> Travail individuel\n";
		case_rouge('Tindividuel');
	}
	else if(isNaN(document.form1.Tindividuel.value)) // 2
	{
		$msg+="-> Travail individuel doit être un nombre\n";
		case_rouge('Tindividuel');
	}
	
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> Le résumé\n";
		case_rouge('Texte_fr');
	}
	
	if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> La description\n";
		case_rouge('Texte_en');
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
	
}
/////////////
function valid_formation(){
	var $msg='';
	case_blanche('No_cours');
	case_blanche('Titre_cours_fr');
	case_blanche('Temps_c');
	case_grise('box_cat_id');
	case_blanche('Cat_id1');
	case_grise('box_clientele_id');
	case_blanche('Clientele_id1');
	case_blanche('Lecture');
	case_blanche('Texte_fr');
	case_blanche('Texte_en');
	if(isEmpty(document.form1.No_cours.value))
	{
		$msg+="-> Le numéro de la formation\n";
		case_rouge('No_cours');
    }
			
	if(isEmpty(document.form1.Titre_cours_fr.value))
	{
		$msg+="-> Le titre de la formation\n";
		case_rouge('Titre_cours_fr');
	}
	
	if(isEmpty(document.form1.Temps_c.value))
	{
		$msg+="-> Temps consacré total\n";
		case_rouge('Temps_c');
	}
	else if(isNaN(document.form1.Temps_c.value)) // 2
	{
		$msg+="-> Temps consacré total doit être un nombre\n";
		case_rouge('Temps_c');
	}
	
	if((document.form1.Clientele_id1.value=='---'))
	{
		$msg+="-> La clientèle visée #1 \n";
		case_rouge('box_clientele_id');
		case_rouge('Clientele_id1');
	}
	if((document.form1.Cat_id1.value=='---'))
	{
		$msg+="-> La catégorie #1 de la formation\n";
		case_rouge('box_cat_id');
		case_rouge('Cat_id1');
	}
	
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> Le résumé\n";
		case_rouge('Texte_fr');
	}
	
	if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> La description\n";
		case_rouge('Texte_en');
	}
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
	
}
/////////////
function textCounter(field, countfield, maxlimit) {
	if (field.value.length > maxlimit) {
		field.value = field.value.substring(0, maxlimit);
	} else {
		countfield.value = maxlimit - field.value.length;
	}
}
////////////////
function valid_document(){
var $msg='';
case_blanche('Titre_nouvelle');
case_blanche('Document1');
var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg",".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");

	if(isEmpty(document.form1.Titre_nouvelle.value))
	{
		$msg+="-> Le titre du document\n";
		case_rouge('Titre_nouvelle');
	}
	if(isEmpty(document.form1.Cat_id.value))
	{
		$msg+="-> La catégorie\n";
		case_rouge('Cat_id');
	}
	if(isEmpty(document.form1.Document1.value))
	{
	//	$msg+="-> Le document\n";
	//	case_rouge('Document1');
	}
	//document 1...
	var extention1= document.form1.Document1.value.slice(-4);
	if( (!isEmpty(document.form1.Document1.value)))
	{
		if(!isValidExtention(extention1,validExtention1))
		{
			$msg+="-> Le document doit être de format: ( pdf, zip, txt, doc, xls, ppt, pps, wmv, mov, mpg, jpg, gif, jpeg, jpe )\n";
			case_rouge('Document1');
		}
	}
///fin document 1...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

//////////////// fin document
function valid_outil(){
var $msg='';
case_blanche('Titre_nouvelle');
case_blanche('Document1');
case_blanche('Lien');
case_blanche('Cat_id');
var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");

	if(isEmpty(document.form1.Titre_nouvelle.value))
	{
		$msg+="-> Le titre du document\n";
		case_rouge('Titre_nouvelle');
	}
	if(isEmpty(document.form1.Cat_id.value))
	{
		$msg+="-> La catégorie\n";
		case_rouge('Cat_id');
	}
	if((isEmpty(document.form1.Lien.value)) && (isEmpty(document.form1.Document1.value)))
	{
		$msg+="-> Le document ou l'adresse URL\n";
		case_rouge('Lien');
		case_rouge('Document1');
	}
	//document 1...
	var extention1= document.form1.Document1.value.slice(-4);
	if( (!isEmpty(document.form1.Document1.value)))
	{
		if(!isValidExtention(extention1,validExtention1))
		{
			$msg+="-> Le document doit être de format: ( pdf, zip, txt, doc, xls, ppt, pps, wmv, mov, mpg )\n";
			case_rouge('Document1');
		}
	}
///fin document 1...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

//////////////// fin document
///////////////
function valid_mission(){
var $msg='';
case_blanche('Texte_en');
case_blanche('Document1');
	//case_blanche('Photo1');
	//case_blanche('Photo2');
	//case_blanche('Photo3');
	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
	//var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");

	if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> Le texte\n";
		case_rouge('Texte_en');
	}
		//photos 1 2 3...
//	var extention1 = document.form1.Photo1.value.slice(-4);
//	if(!isEmpty(document.form1.Photo1.value))
//	{
//		if(!isValidExtention(extention1,validExtention2))
	//	{
	//		$msg+="-> L'image # 1 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
	//		case_rouge('Photo1');
	//	}
//	}
//	var extention2 = document.form1.Photo2.value.slice(-4);
 ///   if(!isEmpty(document.form1.Photo2.value))
//	{
	//	if(!isValidExtention(extention2,validExtention2))
	//	{
	//		$msg+="-> L'image # 2 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
	//		case_rouge('Photo2');
	//	}
	//}
	//var extention3 = document.form1.Photo3.value.slice(-4);
   // if(!isEmpty(document.form1.Photo3.value))
	//{
	//	if(!isValidExtention(extention3,validExtention2))
	//	{
		//	$msg+="-> L'image # 3 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
		//	case_rouge('Photo3');
		//}
	//}
	//document 1...
	var extention1= document.form1.Document1.value.slice(-4);
	if( (!isEmpty(document.form1.Document1.value)))
	{
		if(!isValidExtention(extention1,validExtention1))
		{
			$msg+="-> Le document doit être de format: ( pdf, zip, txt, doc, xls, ppt, pps, wmv, mov, mpg )\n";
			case_rouge('Document1');
		}
	}
///fin document 1...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

//////////////// fin mission
//////////////////
function valid_capsule(){
var $msg='';
case_blanche('Date_eve');
case_blanche('Cat_id');
case_blanche('Texte_fr');
case_blanche('Texte_en');
case_blanche('Titre_nouvelle');
case_blanche('Document1');
	case_blanche('Photo1');
	case_blanche('Photo2');
	case_blanche('Photo3');
	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");

	if(isEmpty(document.form1.Titre_nouvelle.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Titre_nouvelle');
	}
    if(isEmpty(document.form1.Cat_id.value))
	{
		$msg+="-> La catégorie\n";
		case_rouge('Cat_id');
	}
	if(isEmpty(document.form1.Date_eve.value))
	{
		$msg+="-> La date\n";
		case_rouge('Date_eve');
	}
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> Le résumé\n";
		case_rouge('Texte_fr');
	}
	if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> Le texte\n";
		case_rouge('Texte_en');
	}
		//photos 1 2 3...
	var extention1 = document.form1.Photo1.value.slice(-4);
	if(!isEmpty(document.form1.Photo1.value))
	{
		if(!isValidExtention(extention1,validExtention2))
		{
			$msg+="-> L'image # 1 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo1');
		}
	}
	var extention2 = document.form1.Photo2.value.slice(-4);
    if(!isEmpty(document.form1.Photo2.value))
	{
		if(!isValidExtention(extention2,validExtention2))
		{
			$msg+="-> L'image # 2 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo2');
		}
	}
	var extention3 = document.form1.Photo3.value.slice(-4);
    if(!isEmpty(document.form1.Photo3.value))
	{
		if(!isValidExtention(extention3,validExtention2))
		{
			$msg+="-> L'image # 3 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo3');
		}
	}
	//document 1...
	var extention1= document.form1.Document1.value.slice(-4);
	if( (!isEmpty(document.form1.Document1.value)))
	{
		if(!isValidExtention(extention1,validExtention1))
		{
			$msg+="-> Le document doit être de format: ( pdf, zip, txt, doc, xls, ppt, pps, wmv, mov, mpg )\n";
			case_rouge('Document1');
		}
	}
///fin document 1...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}

////////////////
/////////////////////
function valid_nouvelle_ev(){
var $msg='';
case_blanche('Titre_nouvelle');
case_blanche('Lieu');
case_blanche('Adresse');
//case_blanche('Responsable_id');
case_blanche('Date_eve');
case_blanche('Heure');
case_blanche('Date_lim');

case_blanche('Texte_fr');
case_blanche('Texte_en');

case_blanche('Document1');
case_blanche('Photo1');
case_blanche('Photo2');
case_blanche('Photo3');
var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");

	if(isEmpty(document.form1.Titre_nouvelle.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Titre_nouvelle');
	}

			
	if(isEmpty(document.form1.Date_eve.value))
	{
		$msg+="-> La date\n";
		case_rouge('Date_eve');
	}

	if(document.form1.Accueil.value!='Non')
	{	
	  if(isEmpty(document.form1.Texte_fr.value))
	  {
		$msg+="-> Le résumé\n";
		case_rouge('Texte_fr');
	  }
	}
	if(document.form1.Accueil.value!='Oui')
	{
	  if(isEmpty(document.form1.Texte_en.value))
      {
		$msg+="-> Le texte\n";
		case_rouge('Texte_en');
	  }
	 } 
	  if(isEmpty(document.form1.Lieu.value))
	  {
		$msg+="-> Le lieu\n";
		case_rouge('Lieu');
	  }
	  if(isEmpty(document.form1.Adresse.value))
	  {
		$msg+="-> L'adresse\n";
		case_rouge('Adresse');
	  }
	  if(isEmpty(document.form1.Responsable_id.value))
	  {
		//$msg+="-> Le responsable\n";
	//	case_rouge('Responsable_id');
	  }
	  if(isEmpty(document.form1.Heure.value))
	  {
		$msg+="-> L'heure\n";
		case_rouge('Heure');
	  }
	//  if(isEmpty(document.form1.Date_lim.value))
	//  {
	//	$msg+="-> La date limite\n";
	//	case_rouge('Date_lim');
	//  }

		//photos 1 2 3...
	var extention1 = document.form1.Photo1.value.slice(-4);
	if(!isEmpty(document.form1.Photo1.value))
	{
		if(!isValidExtention(extention1,validExtention2))
		{
			$msg+="-> L'image # 1 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo1');
		}
	}
	var extention2 = document.form1.Photo2.value.slice(-4);
    if(!isEmpty(document.form1.Photo2.value))
	{
		if(!isValidExtention(extention2,validExtention2))
		{
			$msg+="-> L'image # 2 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo2');
		}
	}
	var extention3 = document.form1.Photo3.value.slice(-4);
    if(!isEmpty(document.form1.Photo3.value))
	{
		if(!isValidExtention(extention3,validExtention2))
		{
			$msg+="-> L'image # 3 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo3');
		}
	}
	//document 1...
	var extention1= document.form1.Document1.value.slice(-4);
	if( (!isEmpty(document.form1.Document1.value)))
	{
		if(!isValidExtention(extention1,validExtention1))
		{
			$msg+="-> Le document doit être de format: ( pdf, zip, txt, doc, xls, ppt, pps, wmv, mov, mpg )\n";
			case_rouge('Document1');
		}
	}
///fin document 1...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}


////////////////
//////////////////////
function valid_nouvelle(){
var $msg='';
case_blanche('Date_eve');
case_blanche('Texte_fr');
case_blanche('Texte_en');
case_blanche('Titre_nouvelle');
case_blanche('Document1');
	case_blanche('Photo1');
	case_blanche('Photo2');
	case_blanche('Photo3');
	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");

	if(isEmpty(document.form1.Titre_nouvelle.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Titre_nouvelle');
	}
	if(isEmpty(document.form1.Date_eve.value))
	{
		$msg+="-> La date\n";
		case_rouge('Date_eve');
	}
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> Le résumé\n";
		case_rouge('Texte_fr');
	}
	//if(isEmpty(document.form1.Texte_en.value))
	//{
	//	$msg+="-> La description complète\n";
	//	case_rouge('Texte_en');
	//}
		//photos 1 2 3...
	var extention1 = document.form1.Photo1.value.slice(-4);
	if(!isEmpty(document.form1.Photo1.value))
	{
		if(!isValidExtention(extention1,validExtention2))
		{
			$msg+="-> L'image # 1 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo1');
		}
	}
	var extention2 = document.form1.Photo2.value.slice(-4);
    if(!isEmpty(document.form1.Photo2.value))
	{
		if(!isValidExtention(extention2,validExtention2))
		{
			$msg+="-> L'image # 2 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo2');
		}
	}
	var extention3 = document.form1.Photo3.value.slice(-4);
    if(!isEmpty(document.form1.Photo3.value))
	{
		if(!isValidExtention(extention3,validExtention2))
		{
			$msg+="-> L'image # 3 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo3');
		}
	}
	//document 1...
	var extention1= document.form1.Document1.value.slice(-4);
	if( (!isEmpty(document.form1.Document1.value)))
	{
		if(!isValidExtention(extention1,validExtention1))
		{
			$msg+="-> Le document doit être de format: ( pdf, zip, txt, doc, xls, ppt, pps, wmv, mov, mpg )\n";
			case_rouge('Document1');
		}
	}
///fin document 1...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}


////////////////
///////////////////////valid_photo5
function valid_photo5(){
var $msg='';
	case_blanche('Photo1');
	case_blanche('Photo2');
	case_blanche('Photo3');
	case_blanche('Photo4');
	case_blanche('Photo5');
	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");

	//photos 1 2 3 4 5...
	var extention1 = document.form1.Photo1.value.slice(-4);
	if(!isEmpty(document.form1.Photo1.value))
	{
		if(!isValidExtention(extention1,validExtention2))
		{
			$msg+="-> L'image # 1 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo1');
		}
	}
	var extention2 = document.form1.Photo2.value.slice(-4);
    if(!isEmpty(document.form1.Photo2.value))
	{
		if(!isValidExtention(extention2,validExtention2))
		{
			$msg+="-> L'image # 2 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo2');
		}
	}
	var extention3 = document.form1.Photo3.value.slice(-4);
    if(!isEmpty(document.form1.Photo3.value))
	{
		if(!isValidExtention(extention3,validExtention2))
		{
			$msg+="-> L'image # 3 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo3');
		}
	}
	var extention4 = document.form1.Photo4.value.slice(-4);
    if(!isEmpty(document.form1.Photo4.value))
	{
		if(!isValidExtention(extention4,validExtention2))
		{
			$msg+="-> L'image # 4 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo4');
		}
	}
	var extention5 = document.form1.Photo5.value.slice(-4);
    if(!isEmpty(document.form1.Photo5.value))
	{
		if(!isValidExtention(extention5,validExtention2))
		{
			$msg+="-> L'image # 5 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo5');
		}
	}

// fin document ...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
/////////////////////// fin 5
function valid_vie(){
var $msg='';
case_blanche('Date_eve');
case_blanche('Texte_en');
case_blanche('Titre_nouvelle');
	case_blanche('Photo1');
	case_blanche('Photo2');
	case_blanche('Photo3');
	case_blanche('Document1');
	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	if(isEmpty(document.form1.Titre_nouvelle.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Titre_nouvelle');
	}
	if(isEmpty(document.form1.Date_eve.value))
	{
		$msg+="-> La date\n";
		case_rouge('Date_eve');
	}
	if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> La description complète\n";
		case_rouge('Texte_en');
	}
	//photos 1 2 3 ...
	var extention1 = document.form1.Photo1.value.slice(-4);
	if(!isEmpty(document.form1.Photo1.value))
	{
		if(!isValidExtention(extention1,validExtention2))
		{
			$msg+="-> L'image # 1 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo1');
		}
	}
	var extention2 = document.form1.Photo2.value.slice(-4);
    if(!isEmpty(document.form1.Photo2.value))
	{
		if(!isValidExtention(extention2,validExtention2))
		{
			$msg+="-> L'image # 2 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo2');
		}
	}
	var extention3 = document.form1.Photo3.value.slice(-4);
	if(!isEmpty(document.form1.Photo3.value))
	{
		if(!isValidExtention(extention3,validExtention2))
		{
			$msg+="-> L'image # 3 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo3');
		}
	}
	//fin photos 1 2 3 ...
	//document 1 ...
	var extention5= document.form1.Document1.value.slice(-4);
	if(!isEmpty(document.form1.Document1.value))
	{
		if(!isValidExtention(extention5,validExtention1))
		{
			$msg+="-> Le document doit être de format: .doc | .pdf  | .txt | .zip  | .ppt | .pps | .wmv | .xls\n";
			case_rouge('Document1');
		}
	}

// fin document ...
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
}
///////////////////////
function valid_evenement(){
	var $msg='';
	case_grise('box_ressource_id');
	case_blanche('Ressource_id');
	//case_grise('box_evenement_id');
	case_blanche('Texte2_en');
	case_blanche('Titre_evenement');
	case_blanche('Lieu');
	case_blanche('Date_eve');
	case_blanche('Heure');
	case_blanche('Duree');
	case_blanche('Date_d_affiche');
	case_blanche('Date_f_affiche');
	case_blanche('Texte_fr');
	case_blanche('Texte_en');
	case_blanche('Vignette1_fr');
	case_blanche('Date_d_message');			
	case_blanche('Date_f_message');
	case_blanche('Photo1');
	case_blanche('Photo2');
	case_blanche('Photo3');
	case_blanche('Document1');
	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
//document 1 ...
	var extention5= document.form1.Document1.value.slice(-4);
	if(!isEmpty(document.form1.Document1.value))
	{
		if(!isValidExtention(extention5,validExtention1))
		{
			$msg+="-> Le document doit être de format: .doc | .pdf  | .txt | .zip  | .ppt | .pps | .wmv | .xls\n";
			case_rouge('Document1');
		}
	}

// fin document ...
	if((document.form1.Ressource_id.value=='---'))
	{
		$msg+="-> Le choix d'une personne ressource\n";
		case_rouge('box_ressource_id');
		case_rouge('Ressource_id');
	}
	
	//photos 1 2 3 ...
	var extention1 = document.form1.Photo1.value.slice(-4);
	if(!isEmpty(document.form1.Photo1.value))
	{
		if(!isValidExtention(extention1,validExtention2))
		{
			$msg+="-> L'image # 1 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo1');
		}
	}
	var extention2 = document.form1.Photo2.value.slice(-4);
    if(!isEmpty(document.form1.Photo2.value))
	{
		if(!isValidExtention(extention2,validExtention2))
		{
			$msg+="-> L'image # 2 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo2');
		}
	}
	var extention3 = document.form1.Photo3.value.slice(-4);
	if(!isEmpty(document.form1.Photo3.value))
	{
		if(!isValidExtention(extention3,validExtention2))
		{
			$msg+="-> L'image # 3 doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo3');
		}
	}
	//fin photos 1 2 3 ...
	if(isEmpty(document.form1.Titre_evenement.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Titre_evenement');
    }
	if(isEmpty(document.form1.Lieu.value))
	{
		$msg+="-> Le lieu\n";
		case_rouge('Lieu');
    }
	if(isEmpty(document.form1.Date_eve.value))
	{
		$msg+="-> La date de l'évênement\n";
		case_rouge('Date_eve');
	}
	
	if(isEmpty(document.form1.Heure.value))
	{
		$msg+="-> L'heure\n";
		case_rouge('Heure');
	}
	else 
	{
		$codeoff=0;
		entry=document.form1.Heure.value;
		document.form1.Heure.value=entry.toLowerCase();
		strlen=entry.length; 
		if (strlen!=5) {$codeoff=1;}
		entry=entry.toLowerCase();    // in case of lowercase characters
	    // Check for legal characters in string - note index starts at zero
		if ('012'.indexOf(entry.charAt(0))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(1))<0) {$codeoff=1}
		if ('h'.indexOf(entry.charAt(2))<0) {$codeoff=1}
		if ('012345'.indexOf(entry.charAt(3))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(4))<0) {$codeoff=1}
		if($codeoff==1){$msg+="-> L'heure doit être au format (24h00)\n"; 
		case_rouge('Heure');
		}
	} 
	if(isEmpty(document.form1.Duree.value))
	{
		$msg+="-> La durée\n";
		case_rouge('Duree');
	}
	else
	{
		$codeoff=0;
		entry=document.form1.Duree.value;
		document.form1.Duree.value=entry.toLowerCase();
		strlen=entry.length; 
		if (strlen!=5) {$codeoff=1;}
		entry=entry.toLowerCase();    // in case of lowercase characters
	    // Check for legal characters in string - note index starts at zero
		if ('012'.indexOf(entry.charAt(0))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(1))<0) {$codeoff=1}
		if ('h'.indexOf(entry.charAt(2))<0) {$codeoff=1}
		if ('012345'.indexOf(entry.charAt(3))<0) {$codeoff=1}
		if ('0123456789'.indexOf(entry.charAt(4))<0) {$codeoff=1}
		if($codeoff==1){$msg+="-> La durée doit être au format (00h00)\n"; 
		case_rouge('Duree');
		}
	}
	if(isEmpty(document.form1.Date_d_affiche.value))
	{
		$msg+="-> La date de l'affichage\n";
		case_rouge('Date_d_affiche');
	}
	if(isEmpty(document.form1.Date_f_affiche.value))
	{
		$msg+="-> La date de fin de l'affichage\n";
		case_rouge('Date_f_affiche');
	}		
			
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> Le résumé\n";
		case_rouge('Texte_fr');
	}
	
	if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> La description complète\n";
		case_rouge('Texte_en');
	}
	
	if(isEmpty(document.form1.Vignette1_en.value))
	{ }
	else {
			if(isEmpty(document.form1.Date_d_message.value))
			{
				$msg+="-> La date du début d'affichage du message\n";
				case_rouge('Date_d_message');
			}
			if(isEmpty(document.form1.Date_f_message.value))
			{
				$msg+="-> La date de la fin d'affichage du message\n";
				case_rouge('Date_f_message');
			}
	}

	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
	
}
//////////////////////
function valid_recon(){
      var $msg='';
	  case_blanche('Cours');
	  case_blanche('Programme');
	  case_blanche('Texte_en');
	  case_blanche('Acquis');
	  //case_grise('Box_cours');
	  //case_grise('Box_programme');
	 // 
	  //
	if((document.getElementById("Choix1").checked==false) && (document.getElementById("Choix2").checked==false))
	{
	    $msg+="Veuillez choisir une option avant d\'enregistrer la reconnaissance, merci.\n";
		alert($msg)
		return false;
	}
	if((document.getElementById("Choix1").checked==true))
	{
		if((document.form1.Cours.value=='---'))
		{
			$msg+="-> Le choix d'un cours dans la liste\n";
			case_rouge('Cours');
			//case_rouge('Box_cours');
		}
		if(isEmpty(document.form1.Acquis.value))
		{
			$msg+="-> Acquis\n";
			case_rouge('Acquis');
		}
		else if(isNaN(document.form1.Acquis.value)) // 2
		{
			$msg+="-> Acquis doit être un nombre\n";
			document.form1.Acquis.value='';
			case_rouge('Acquis');
		}
		if((document.form1.Programme.value=='---'))
		{
			$msg+="-> Le choix d'un programme dans la liste\n";
			case_rouge('Programme');
			//case_rouge('Box_programme');
		}
		if(isEmpty(document.form1.Texte_en.value))
		{
			$msg+="-> La justification de la reconnaissance\n";
			case_rouge('Texte_en');
		}
	
	}
	if((document.getElementById("Choix2").checked==true))
	{
	
	
	}
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;

}
///////////////////////
//////////////////////
function valid_programme_formation(){
	var $msg='';
	case_blanche('No_programme');
	case_blanche('Titre_programme');
	case_blanche('Diplome');
	case_blanche('Responsable');
	case_blanche('Credits_ob');
	case_blanche('Credits_op');
	case_blanche('Credits_ch');
	case_blanche('Texte_fr');
	case_blanche('Texte_en');
	case_blanche('Texte2_en');
	case_blanche('Texte3_en');			
	if(isEmpty(document.form1.No_programme.value))
	{
		$msg+="-> Le numéro du programme\n";
		case_rouge('No_programme');
    }
			
	if(isEmpty(document.form1.Titre_programme.value))
	{
		$msg+="-> Le titre du programme\n";
		case_rouge('Titre_programme');
	}
	
	if(isEmpty(document.form1.Diplome.value))
	{
		$msg+="-> L'attestation\n";
		case_rouge('Diplome');
	}
	if((document.form1.Responsable.value=='---'))
	{
		$msg+="-> Le choix d'un responsable de programme\n";
		case_rouge('Responsable');
	}
	if(isEmpty(document.form1.Credits_ob.value))
	{
		$msg+="-> Unités pour les formations obligatoires\n";
		case_rouge('Credits_ob');
		document.form1.Credits_ob.value=0;
	}
	else if(isNaN(document.form1.Credits_ob.value)) // 2
	{
		$msg+="-> Unités obligatoires pour les formations doit être un nombre\n";
		case_rouge('Credits_ob');
		document.form1.Credits_ob.value=0;
	}
	
	if(isEmpty(document.form1.Credits_op.value))
	{
		$msg+="-> Unités pour les formations optionnels\n";
		case_rouge('Credits_op');
		document.form1.Credits_op.value=0;
	}
	else if(isNaN(document.form1.Credits_op.value)) // 2
	{
		$msg+="-> Unités pour les formations optionnels doit être un nombre\n";
		case_rouge('Credits_op');
		document.form1.Credits_op.value=0;
	}
	
	if(isEmpty(document.form1.Credits_ch.value))
	{
		$msg+="-> Unités pour les formations au choix\n";
		case_rouge('Credits_ch');
		document.form1.Credits_ch.value=0;
	}
	else if(isNaN(document.form1.Credits_ch.value)) // 2
	{
		$msg+="-> Unités pour les formations au choix doit être un nombre\n";
		case_rouge('Credits_ch');
		document.form1.Credits_ch.value=0;
	}
	
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> La description du programme de formation\n";
		case_rouge('Texte_fr');
	}
	
	/*if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> La description\n";
		case_rouge('Texte_en');
	}*/
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
	
}
///////////////////////fin programme formation
//////////////////////
function valid_programme(){
	var $msg='';
	case_blanche('No_programme');
	case_blanche('Titre_programme');
	case_blanche('Diplome');
	case_blanche('Responsable');
	case_blanche('Credits_ob');
	case_blanche('Credits_op');
	case_blanche('Credits_ch');
	case_blanche('Texte_fr');
	case_blanche('Texte_en');
	case_blanche('Texte2_en');
	case_blanche('Texte3_en');			
	if(isEmpty(document.form1.No_programme.value))
	{
		$msg+="-> Le numéro du programme\n";
		case_rouge('No_programme');
    }
			
	if(isEmpty(document.form1.Titre_programme.value))
	{
		$msg+="-> Le titre du programme\n";
		case_rouge('Titre_programme');
	}
	
	if(isEmpty(document.form1.Diplome.value))
	{
		$msg+="-> Le grade ou attestation\n";
		case_rouge('Diplome');
	}
	if((document.form1.Responsable.value=='---'))
	{
		$msg+="-> Le choix d'un responsable de programme\n";
		case_rouge('Responsable');
	}
	if(isEmpty(document.form1.Credits_ob.value))
	{
		$msg+="-> Crédits pour les cours obligatoires\n";
		case_rouge('Credits_ob');
		document.form1.Credits_ob.value=0;
	}
	else if(isNaN(document.form1.Credits_ob.value)) // 2
	{
		$msg+="-> Crédits pour les cours obligatoires doit être un nombre\n";
		case_rouge('Credits_ob');
		document.form1.Credits_ob.value=0;
	}
	
	if(isEmpty(document.form1.Credits_op.value))
	{
		$msg+="-> Crédits pour les cours optionnels\n";
		case_rouge('Credits_op');
		document.form1.Credits_op.value=0;
	}
	else if(isNaN(document.form1.Credits_op.value)) // 2
	{
		$msg+="-> Crédits pour les cours optionnels doit être un nombre\n";
		case_rouge('Credits_op');
		document.form1.Credits_op.value=0;
	}
	
	if(isEmpty(document.form1.Credits_ch.value))
	{
		$msg+="-> Crédits pour les cours au choix\n";
		case_rouge('Credits_ch');
		document.form1.Credits_ch.value=0;
	}
	else if(isNaN(document.form1.Credits_ch.value)) // 2
	{
		$msg+="-> Crédits pour les cours au choix doit être un nombre\n";
		case_rouge('Credits_ch');
		document.form1.Credits_ch.value=0;
	}
	
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> La description du programme\n";
		case_rouge('Texte_fr');
	}
	
	/*if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> La description\n";
		case_rouge('Texte_en');
	}*/
	
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
	
}
///////////////////////
function Comptetotal() 
{
    case_blanche('Credits_ob');
	case_blanche('Credits_op');
	case_blanche('Credits_ch');
	tota=0;num1=0;num2=0;num3=0;
	if(isNaN(document.form1.Credits_ob.value))
	{
		//$msg+="-> Atelier\n";
		case_rouge('Credits_ob');
		document.form1.Credits_ob.value=0;
	}
	else
	{ 
		 num1=parseFloat(document.getElementById('Credits_ob').value);  
	}
		if(isNaN(document.form1.Credits_op.value))
	{
		//$msg+="-> Atelier\n";
		case_rouge('Credits_op');
		document.form1.Credits_op.value=0;
	}
	else
	{ 
		 num2=parseFloat(document.getElementById('Credits_op').value);  
	}
	if(isNaN(document.form1.Credits_ch.value))
	{
		//$msg+="-> Atelier\n";
		case_rouge('Credits_ch');
		document.form1.Credits_ch.value=0;
	}
	else
	{ 
		 num3=parseFloat(document.getElementById('Credits_ch').value);  
	}
	tota = (num1 + num2 + num3);
	document.form1.Total1.value=tota;	
}

function isValidExtention(filename, validExtentions)
{
 var valid = false;
 for(i = 0;i < validExtentions.length;i++)
 {
 		if(filename == validExtentions[i])
			
			valid = true;
 }
	return valid;

}
///////valid_membership
function valid_membership(){
	var $msg='';
	case_blanche('Texte_fr');
    case_blanche('Texte_en');
	case_blanche('Autre_fr');

	//
	if(isEmpty(document.form1.Texte_fr.value))
	{
		$msg+="-> Le texte de l'avertissement #1\n";
		case_rouge('Texte_fr');
    }
	//	
	if(isEmpty(document.form1.Texte_en.value))
	{
		$msg+="-> Le texte de l'avertissement #2\n";
		case_rouge('Texte_en');
	}
	//
	if(isEmpty(document.form1.Autre_fr.value))
	{
		$msg+="-> Le texte de la facturation\n";
		case_rouge('Autre_fr');
	}
	//
		
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
	
}
///////
function valid_membre(){
	var $msg='';
	case_blanche('Prenom');
    case_blanche('Nom');
	case_blanche('Sontitre');
	case_blanche('Courriel1');
	case_blanche('Telbur');
	
	case_blanche('Adresse1');
	case_blanche('Adresse3');
	case_blanche('Ville1');
	
	case_blanche('Date_paie');
	//case_blanche('Date_insc');
	//case_blanche('Statut');
	
	case_blanche('Code');
	case_blanche('Passe');
	case_blanche('Photo1');
	
	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	//
	if(isEmpty(document.form1.Prenom.value))
	{
		$msg+="-> Le prénom\n";
		case_rouge('Prenom');
    }
	//	
	if(isEmpty(document.form1.Nom.value))
	{
		$msg+="-> Le nom\n";
		case_rouge('Nom');
	}
	//
	if(isEmpty(document.form1.Sontitre.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Sontitre');
	}
	//
	if(!isEmpty(document.form1.Courriel1.value))
	{
	var goodEmail = document.form1.Courriel1.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.biz)|(\.qc)|(\.ca)|(\.info)|(\..{2,2}))$)\b/gi);
	if (goodEmail){
	} else {
         $msg+="-> Le courriel correctement\n";
		 case_rouge('Courriel1');
	   }
	} else	{
		$msg+="-> Le courriel\n";
		case_rouge('Courriel1');
	}
	//
	if(isEmpty(document.form1.Telbur.value))
	{
		$msg+="-> Le téléphone\n";
		case_rouge('Telbur');
	}
	//
	if(isEmpty(document.form1.Adresse1.value))
	{
		$msg+="-> Le numéro de résidence\n";
		case_rouge('Adresse1');
	}
	else if(isNaN(document.form1.Adresse1.value)) // 2
	{
		$msg+="-> Le numéro de résidence doit être un nombre\n";
		case_rouge('Adresse1');
	}
	//
	if(isEmpty(document.form1.Adresse3.value))
	{
		$msg+="-> Le nom de la rue, boulevard ou avenue\n";
		case_rouge('Adresse3');
	}
	//
	if(isEmpty(document.form1.Ville1.value))
	{
		$msg+="-> La ville\n";
		case_rouge('Ville1');
	}
	//	
	if(isEmpty(document.form1.Date_paie.value))
	{
	//	$msg+="-> La date du dernier paiement reçu\n";
	//	case_rouge('Date_paie');
	}
	//	
	if(isEmpty(document.form1.Code.value))
	{
	//	$msg+="-> Le code utilisateur\n";
	//	case_rouge('Code');
	}
	//	
	if(isEmpty(document.form1.Passe.value))
	{
	//	$msg+="-> Le mot de passe\n";
	//	case_rouge('Passe');
	}	

	var extention1 = document.form1.Photo1.value.slice(-4);
	if(!isEmpty(document.form1.Photo1.value))
	{
		if(!isValidExtention(extention1,validExtention2))
		{
			$msg+="-> L'image doit être de format: .jpg | .jpe  | .jpeg | .gif \n";
			case_rouge('Photo1');
		}
	}
		
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.form1.Submit.disabled='true';
	return true;
	
}
/////////////////////////////////
function valid_insc(){
	var $msg='';
	case_blanche('Prenom');
    case_blanche('Nom');
	case_blanche('Sontitre');
	case_blanche('Courriel');
	case_blanche('Telbur');
	
	var validExtention1 = new Array(".pdf",".zip",".txt",".doc",".xls",".ppt",".pps",".wmv",".mov",".mpg");
	var validExtention2 = new Array(".jpg",".gif","jpeg",".jpe",".JPG",".GIF","JPEG",".JPE");
	//
	if(isEmpty(document.formL.Prenom.value))
	{
		$msg+="-> Le prénom\n";
		case_rouge('Prenom');
    }
	//	
	if(isEmpty(document.formL.Nom.value))
	{
		$msg+="-> Le nom\n";
		case_rouge('Nom');
	}
	//
	if(isEmpty(document.formL.Sontitre.value))
	{
		$msg+="-> Le titre\n";
		case_rouge('Sontitre');
	}
	//
	if(!isEmpty(document.formL.Courriel.value))
	{
	var goodEmail = document.formL.Courriel.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\.biz)|(\.qc)|(\.ca)|(\..{2,2}))$)\b/gi);
	if (goodEmail){
	} else {
         $msg+="-> Le courriel correctement\n";
		 case_rouge('Courriel');
	   }
	} else	{
		$msg+="-> Le courriel\n";
		case_rouge('Courriel');
	}
	//
	if(isEmpty(document.formL.Telbur.value))
	{
		$msg+="-> Le téléphone\n";
		case_rouge('Telbur');
	}
	//

		
	if (!isEmpty($msg)){
		alert('Les informations suivantes sont obligatoires: \n'+$msg)
		return false;
	}
	document.formL.Submit.disabled='true';
	return true;
	
}
//////////////////////////////////////
///BALISES HTML
function insertcode(type,var3,var1,var2) {
   with(document.form1)
   {
     if(var1 != null){
      if(var2 == null){ var2='  '; }

	switch(type) {
		case 'link':
			code = '<a class=Lire_plus href="' +var1+ '" target=_blank>' +var2+ '</a>';
			break;
		case 'linkM':
			code = '<a class=MT href="' +var1+ '" target=_blank>' +var2+ '</a>';
			break;
		case 'mailM':
			code = '<a class=MT href="' +var1+ '">' +var2+ '</a>';
			break;		
	   case 'mail':
			code = '<a class=MT href="' +var1+ '">' +var2+ '</a>';
			break;
	   case 'bold':
			code = '<b>' +var1+ '</b>';
			break;
		default:
	}
        	code = ' ' + code + ' ';

	switch(var3) {
		case 'Texte_fr':
			Texte_fr.value +=code;
			break;
		case 'Texte_en':
			Texte_en.value +=code;
			break;
		case 'Autre_fr':
			Autre_fr.value +=code;
			break;
		case 'Autre_en':
			Autre_en.value +=code;
			break;
	}
   }
            
      }
	}
function AddTextC(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Commentaire.createTextRange) 
      {
         var text;
         Commentaire.focus(Commentaire.caretPos);
         Commentaire.caretPos = document.selection.createRange().duplicate();
         if(Commentaire.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Commentaire.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Commentaire.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Commentaire.caretPos.text = startTag+defaultText+endTag;
      }
      else Commentaire.value += startTag+defaultText+endTag;
   }
}
function AddTextF(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Texte_fr.createTextRange) 
      {
         var text;
         Texte_fr.focus(Texte_fr.caretPos);
         Texte_fr.caretPos = document.selection.createRange().duplicate();
         if(Texte_fr.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Texte_fr.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Texte_fr.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Texte_fr.caretPos.text = startTag+defaultText+endTag;
      }
      else Texte_fr.value += startTag+defaultText+endTag;
   }
}
function AddTextF1(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Autre_fr.createTextRange) 
      {
         var text;
         Autre_fr.focus(Autre_fr.caretPos);
         Autre_fr.caretPos = document.selection.createRange().duplicate();
         if(Autre_fr.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Autre_fr.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Autre_fr.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Autre_fr.caretPos.text = startTag+defaultText+endTag;
      }
      else Autre_fr.value += startTag+defaultText+endTag;
   }
}
function AddTextE(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Texte_en.createTextRange) 
      {
         var text;
         Texte_en.focus(Texte_en.caretPos);
         Texte_en.caretPos = document.selection.createRange().duplicate();
         if(Texte_en.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Texte_en.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Texte_en.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Texte_en.caretPos.text = startTag+defaultText+endTag;
      }
      else Texte_en.value += startTag+defaultText+endTag;
   }
}
function AddTextE1(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Texte3_en.createTextRange) 
      {
         var text;
         Texte3_en.focus(Texte3_en.caretPos);
         Texte3_en.caretPos = document.selection.createRange().duplicate();
         if(Texte3_en.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Texte3_en.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Texte3_en.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Texte3_en.caretPos.text = startTag+defaultText+endTag;
      }
      else Texte3_en.value += startTag+defaultText+endTag;
   }
}
function AddTextPF(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Texte2_en.createTextRange) 
      {
         var text;
         Texte2_en.focus(Texte2_en.caretPos);
         Texte2_en.caretPos = document.selection.createRange().duplicate();
         if(Texte2_en.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Texte2_en.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Texte2_en.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Texte2_en.caretPos.text = startTag+defaultText+endTag;
      }
      else Texte2_en.value += startTag+defaultText+endTag;
   }
}
function AddTextPE(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Prod_en.createTextRange) 
      {
         var text;
         Prod_en.focus(Prod_en.caretPos);
         Prod_en.caretPos = document.selection.createRange().duplicate();
         if(Prod_en.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Prod_en.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Prod_en.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Prod_en.caretPos.text = startTag+defaultText+endTag;
      }
      else Prod_en.value += startTag+defaultText+endTag;
   }
}
function MM_popupMsg(msg) { //v1.0
  alert(msg);
}
//
function AddText_vi1f(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Vignette1_fr.createTextRange) 
      {
         var text;
         Vignette1_fr.focus(Vignette1_fr.caretPos);
         Vignette1_fr.caretPos = document.selection.createRange().duplicate();
         if(Vignette1_fr.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Vignette1_fr.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Vignette1_fr.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Vignette1_fr.caretPos.text = startTag+defaultText+endTag;
      }
      else Vignette1_fr.value += startTag+defaultText+endTag;
   }
}
function AddText_vi2f(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Vignette2_fr.createTextRange) 
      {
         var text;
         Vignette2_fr.focus(Vignette2_fr.caretPos);
         Vignette2_fr.caretPos = document.selection.createRange().duplicate();
         if(Vignette2_fr.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Vignette2_fr.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Vignette2_fr.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Vignette2_fr.caretPos.text = startTag+defaultText+endTag;
      }
      else Vignette2_fr.value += startTag+defaultText+endTag;
   }
}
function AddText_vi3f(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Vignette3_fr.createTextRange) 
      {
         var text;
         Vignette3_fr.focus(Vignette1_fr.caretPos);
         Vignette3_fr.caretPos = document.selection.createRange().duplicate();
         if(Vignette3_fr.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Vignette3_fr.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)

               fin += ' ';
            }
            Vignette3_fr.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Vignette3_fr.caretPos.text = startTag+defaultText+endTag;
      }
      else Vignette3_fr.value += startTag+defaultText+endTag;
   }
}
function AddText_vi1e(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Vignette1_en.createTextRange) 
      {
         var text;
         Vignette1_en.focus(Vignette1_en.caretPos);
         Vignette1_en.caretPos = document.selection.createRange().duplicate();
         if(Vignette1_en.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Vignette1_en.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Vignette1_en.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Vignette1_en.caretPos.text = startTag+defaultText+endTag;
      }
      else Vignette1_en.value += startTag+defaultText+endTag;
   }
}
function AddText_vi2e(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Vignette2_en.createTextRange) 
      {
         var text;
         Vignette2_en.focus(Vignette2_en.caretPos);
         Vignette2_en.caretPos = document.selection.createRange().duplicate();
         if(Vignette2_en.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Vignette2_en.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Vignette2_en.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Vignette2_en.caretPos.text = startTag+defaultText+endTag;
      }
      else Vignette2_en.value += startTag+defaultText+endTag;
   }
}
function AddText_vi3e(startTag,defaultText,endTag) 
{
   with(document.form1)
   {
      if (Vignette3_en.createTextRange) 
      {
         var text;
         Vignette3_en.focus(Vignette3_en.caretPos);
         Vignette3_en.caretPos = document.selection.createRange().duplicate();
         if(Vignette3_en.caretPos.text.length>0)
         {
            //gère les espace de fin de sélection. Un double-click sélectionne le mot
            //+ un espace qu'on ne souhaite pas forcément...
            var sel = Vignette3_en.caretPos.text;
            var fin = '';
            while(sel.substring(sel.length-1, sel.length)==' ')
            {
               sel = sel.substring(0, sel.length-1)
               fin += ' ';
            }
            Vignette3_en.caretPos.text = startTag + sel + endTag + fin;
         }
         else
            Vignette3_en.caretPos.text = startTag+defaultText+endTag;
      }
      else Vignette3_en.value += startTag+defaultText+endTag;
   }
}

function DateConviviale($QuelleDate)
  {
  $NomJour = date("D", strtotime($QuelleDate));
  $Jour = date("j", strtotime($QuelleDate));
  $NomMois = date("M", strtotime($QuelleDate));
  $Annee = date("Y", strtotime($QuelleDate));

  // Nom du jour en toutes lettres :
  switch ($NomJour)
    {
    case "Mon": $NomJour = "Lundi"; break;
    case "Tue": $NomJour = "Mardi"; break;
    case "Wed": $NomJour = "Mercredi"; break;
    case "Thu": $NomJour = "Jeudi"; break;
    case "Fri": $NomJour = "Vendredi"; break;
    case "Sat": $NomJour = "Samedi"; break;
    case "Sun": $NomJour = "Dimanche"; break;
    }

  // Nom du mois en toutes lettres :
  switch ($NomMois)
    {
    case "Jan": $NomMois = "Janvier"; break;
    case "Feb": $NomMois = "Février"; break;
    case "Mar": $NomMois = "Mars"; break;
    case "Apr": $NomMois = "Avril"; break;
    case "May": $NomMois = "Mai"; break;
    case "Jun": $NomMois = "Juin"; break;
    case "Jul": $NomMois = "Juillet"; break;
    case "Aug": $NomMois = "Août"; break;
    case "Sep": $NomMois = "Septembre"; break;
    case "Oct": $NomMois = "Octobre"; break;
    case "Nov": $NomMois = "Novembre"; break;
    case "Dec": $NomMois = "Décembre"; break;
    }
  return $NomJour;
  }

///FIN BALISES