function checkForm(formulaire, obj) {
	if ( formulaire == 'fonction' ) {
		if ( obj.fon_nom.value=='' ) {
			alert('Veuillez saisir le nom de la fonction');
			obj.fon_nom.focus();
			obj.fon_nom.style.backgroundColor='#FF8080';
			return false;
		}
	}
	if ( formulaire == 'famille' ) {
		if ( obj.fam_nom.value=='' ) {
			alert('Veuillez saisir le nom de la famille');
			obj.fam_nom.focus();
			obj.fam_nom.style.backgroundColor='#FF8080';
			return false;
		}
		var fon_input = obj.getElementsByTagName('input');
		var iFonctionChecked = 0;
		for ( var i = 0 ; i < fon_input.length ; i++ ) {
			if ( typeof(fon_input[i].id) != 'undefined' && fon_input[i].id.indexOf('fon_') != '-1' && fon_input[i].checked ) {
				iFonctionChecked += 1;
			}
		}
		if ( iFonctionChecked == 0 ) {
			var message = 'Si vous n\'associez cette famille à aucune fonction, elle n\'apparaitra pas sur le site.'+
						'\nVous pourrez bien sûr l\'associer par la suite.'+
						'\nConfirmez vous l\'enregistrement ?';
			if ( confirm(message) ) {
				return true;
			}
			else {
				return false;
			}
		}
	}
	if ( formulaire == 'gamme' ) {
		if ( obj.gam_nom.value=='' ) {
			alert('Veuillez saisir le nom de la gamme');
			obj.gam_nom.focus();
			obj.gam_nom.style.backgroundColor='#FF8080';
			return false;
		}
	}
	if ( formulaire == 'prestation' ) {
		if ( obj.pr_nom.value=='' ) {
			alert('Veuillez saisir le nom de la prestation');
			obj.pr_nom.focus();
			obj.pr_nom.style.backgroundColor='#FF8080';
			return false;
		}
	}
	if ( formulaire == 'fg_photo' || formulaire == 'fp_photo' ) {
		if ( obj.fic_photo.value != '' ) {
			var arrExt = obj.fic_photo.value.split('.');
			var strExt = arrExt[arrExt.length - 1];
			if ( strExt.toLowerCase() != 'jpg' && strExt.toLowerCase() != 'jpeg' && strExt.toLowerCase() != 'gif' ) {
				alert('L\'illustration doit être au format jpg, jpeg ou gif');
				return false;
			}
		}
	}
	if ( formulaire == 'fg_bloc5' ) {
		if ( obj.fic_bloc5_photo.value != '' ) {
			var arrExt = obj.fic_bloc5_photo.value.split('.');
			var strExt = arrExt[arrExt.length - 1];
			if ( strExt.toLowerCase() != 'jpg' && strExt.toLowerCase() != 'jpeg' && strExt.toLowerCase() != 'gif' ) {
				alert('L\'illustration 1 doit être au format jpg, jpeg ou gif');
				return false;
			}
		}
	}
	if ( formulaire == 'fg_liens' || formulaire == 'fp_liens' ) {
		if ( obj.li_lib.value != '' ) {
			/*if ( !obj.li_fic_bloc[0].checked && !obj.li_fic_bloc[1].checked && !obj.li_fic_bloc[2].checked ) {
				alert('Veuillez choisir le bloc de destination du lien');
				return false;
			}*/
			if ( !obj.li_type[0].checked && !obj.li_type[1].checked && !obj.li_type[2].checked && !obj.li_type[3].checked ) {
				alert('Veuillez choisir le type du lien');
				return false;
			}
			if ( obj.li_type[0].checked && obj.li_url.value == '' ) {
				alert('Veuillez saisir l\'url du lien');
				return false;
			}
			if ( obj.li_type[1].checked && ( obj.li_url2.value == '' || obj.li_width.value == '' || obj.li_height.value == '' ) ) {
				alert('Veuillez saisir l\'url du lien, ainsi que la largeur et la hauteur de la fenêtre pop-up');
				return false;
			}
			if ( obj.li_type[2].checked && obj.li_file.value == '' && obj.get_id == '-1' ) {
				alert('Veuillez choisir le fichier lié au lien');
				return false;
			}
			if ( obj.li_type[3].checked ) {
				if ( typeof(obj.li_flash) != 'undefined' ) {
					if ( obj.li_flash.value == '' && obj.new_flash.value == '' ) {
						alert('Veuillez choisir l\'animation flash liée au lien ou intégrer une nouvelle animation');
						return false;
					}
				}
				else {
					if ( obj.new_flash.value == '' ) {
						alert('Veuillez intégrer une nouvelle animation');
						return false;
					}
				}
				if ( obj.new_flash.value != '' ) {
					var arrExt = obj.new_flash.value.split('.');
					var strExt = arrExt[arrExt.length - 1];
					if ( strExt.toLowerCase() != 'swf' ) {
						alert('La nouvelle animation doit être un fichier de type SWF');
						return false;
					}
				}
				if ( obj.new_flash.value != '' && ( obj.new_flash_width.value == '' || obj.new_flash_height.value == '' ) ) {
					alert('Veuillez saisir la largeur et la hauteur de la nouvelle animation');
					return false;
				}
				if ( obj.new_flash_width.value != '' && ( isNaN(obj.new_flash_width.value) || obj.new_flash_width.value.indexOf('.') != '-1' || obj.new_flash_width.value.indexOf(',') != '-1' ) ) {
					alert('La largeur de la nouvelle animation doit être un nombre entier');
				}
				if ( obj.new_flash_height.value != '' && ( isNaN(obj.new_flash_height.value) || obj.new_flash_height.value.indexOf('.') != '-1' || obj.new_flash_height.value.indexOf(',') != '-1' ) ) {
					alert('La hauteur de la nouvelle animation doit être un nombre entier');
				}
			}
		}
		else {
			alert('Veuillez saisir l\'intitulé du lien');
			return false;
		}
	}
	if ( formulaire == 'contributeur' ) {
		if ( obj.con_identifiant.value=='' ) {
			alert('Veuillez saisir l\'identifiant pour ce compte');
			obj.con_identifiant.focus();
			obj.gam_identifiant.style.backgroundColor='#FF8080';
			return false;
		}
		if ( obj.con_mot_de_passe.value=='' ) {
			alert('Veuillez saisir le mot de passe pour ce compte');
			obj.con_mot_de_passe.focus();
			obj.con_mot_de_passe.style.backgroundColor='#FF8080';
			return false;
		}
	}
	return true;
}

