// +----------------------------------------------------------------------------+
// | <G a n e s h a> - Free Web Based Training System                           |
// +----------------------------------------------------------------------------+
// | <G a n e s h a> - Plate-forme de téléformation gratuite et en open source  |
// +----------------------------------------------------------------------------|
// | Copyright (C) 2000-2003  Anéma Formation  <http://www.anema.fr/>           |
// +----------------------------------------------------------------------------+
// |           Developer : Georges CALDEIRA <gcaldeira@anemalab.org>            |
// +----------------------------------------------------------------------------+
// |              Infos on project <http://anemalab.org/>                       |
// +----------------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify       |
// | it under the terms of the GNU General Public License as published by       |
// | the Free Software Foundation; either version 2 of the License, or          |
// | (at your option) any later version.                                        |
// |                                                                            |
// | This program is distributed in the hope that it will be useful,            |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of             |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              |
// | GNU General Public License for more details.                               |
// |                                                                            |
// | You should have received a copy of the GNU General Public License          |
// | along with this program; if not, write to the Free Software                |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   |
// +----------------------------------------------------------------------------+	

	/*********************************************************/  
	function DeleteItem(url)  {    
		ans = window.confirm(lang[41]);    
		if(ans)	{      
			window.location.href=url;    
		}  
	}

	/*********************************************************/
	function VerifAddGroupe(form) {	
		if ( form.text1.value=='' ) {		
			alert(lang[42]);		
			form.text1.focus();		
			return(false);
		}	
		if ( form.check1.checked ) {
			txt = lang[43];
		} else {
			txt = lang[44] ;
		}
		ans = window.confirm(txt);    
		if(ans)	{      
			form.submit();
		}  
	}
	
	/*********************************************************/
	function VerifGroupe(form,add) {	
		if ( form.text1.value=='' ) {		
			alert(lang[42]);		
			form.text1.focus();		
			return(false);
		}	
		form.submit();		
	}

	
	/*********************************************************/
	function VerifMembre(form) {	
		if ( form.text1.value=='' ) {		
			alert(lang[5]);		
			form.text1.focus();		
			return(false);
		}	
		if ( form.text2.value=='' ) {		
			alert(lang[4]);		
			form.text2.focus();		
			return(false);
		}	
		if ( form.text3.value=='' ) {		
			alert(lang[9]);		
			form.text3.focus();		
			return(false);
		}	
		if ( form.text4.value=='' ) {		
			alert(lang[10]);		
			form.text4.focus();		
			return(false);
		}	
		form.submit();
	}

	/*********************************************************/
	function VerifAdmin(form) {	
		if ( form.text1.value=='' ) {
			alert(lang[5]);
			form.text1.focus();
			return(false);
		}
		if ( form.text2.value=='' ) {		
			alert(lang[4]);
			form.text2.focus();
			return(false);
		}
		if ( form.text3.value=='' ) {		
			alert(lang[9]);
			form.text3.focus();	
			return(false);
		}
		if ( form.text4.value=='' ) {		
			alert(lang[10]);	
			form.text4.focus();	
			return(false);
		}
		form.submit();
	}
	
	
	/*********************************************************/
	function VerifModule(form) {	
		if ( form.text1.value=='' ) {
			alert(lang[15]);
			form.text1.focus();	
			return(false);
		}	
		lib1 = form.elements[6] ;
		if ( lib1.value=='' ) {	
			alert(lang[45]);
			lib1.focus();
			return(false);
		}	
		fic1 = form.elements[7] ;
		if ( fic1.value=='' ) {	
			alert(lang[46]);
			fic1.focus();
			return(false);
		}	
		form.submit();
	}

	/*********************************************************/
	function VerifAddModule(form) {	
		if ( form.text1.value=='' ) {
			alert(lang[15]);
			form.text1.focus();	
			return(false);
		}	
		form.submit();
	}

	/*********************************************************/
	function VerifChapitre	(form) {
		type = form.elements[3] ;
		if ( form.text1.value=='' ) {
			alert(lang[47]);
			form.text1.focus();	
			return(false);
		}	
		if ( type.value != 2 ) {
			if ( form.text2.value=='' ) {
				alert(lang[48]);
				form.text2.focus();	
				return(false);
			}
		} else {
			form.text2.value='' ;
		}
		
		form.submit();	
	}
	
	/*********************************************************/
	function VerifSociete(form) {	
		if ( form.text1.value=='' ) {
			alert(lang[4]);
			form.text1.focus();	
			return(false);
		}	
		form.submit();
	}

	/*********************************************************/
	function VerifSession(form) {	
		if ( form.text1.value=='' ) {
			alert(lang[15]);
			form.text1.focus();	
			return(false);
		}	
		if ( form.text2.value=='' ) {
			alert(lang[40]);
			form.text2.focus();	
			return(false);
		}	
		lib1 = form.elements[5] ;
		if ( lib1.value=='' ) {	
			alert(lang[45]);
			lib1.focus();
			return(false);
		}	
		fic1 = form.elements[6] ;
		if ( fic1.value=='' ) {	
			alert(lang[46]);
			fic1.focus();
			return(false);
		}	
		form.submit();
	}
	
	/*********************************************************/
	function VerifStagiaire(form) {	
		if ( form.text1.value=='' ) {		
			alert(lang[5]);		
			form.text1.focus();		
			return(false);
		}	
		if ( form.text2.value=='' ) {		
			alert(lang[4]);		
			form.text2.focus();		
			return(false);
		}	
		if ( form.text3.value=='' ) {		
			alert(lang[9]);		
			form.text3.focus();		
			return(false);
		}	
		if ( form.text4.value=='' ) {		
			alert(lang[10]);		
			form.text4.focus();		
			return(false);
		}	
		form.submit();
	}

	/*********************************************************/
	function CheckRadio(radio) {
		radio.checked = true ;
	}

	/*********************************************************/
	function VerifAddInscription(form) {	
		if ( form.text1.value=='' ) {		
			alert(lang[49]);		
			form.text1.focus();		
			return(false);
		}	
		form.submit();
	}	
	
	/*********************************************************/
	function VerifInscription(form) {	
		if ( form.text1.value=='' ) {		
			alert(lang[49]);		
			form.text1.focus();		
			return(false);
		}	
		form.submit();		
	}

	/*********************************************************/
	function VerifOpptions2(form) {	
		if ( form.text2.value=='' ) {		
			alert(lang[50]);		
			form.text2.focus();		
			return(false);
		}	
		if ( form.text3.value=='' ) {		
			alert(lang[51]);		
			form.text3.focus();		
			return(false);
		}	
		if ( form.text7.value=='' ) {		
			alert(lang[52]);		
			form.text7.focus();		
			return(false);
		}	
		if ( form.text8.value=='' ) {		
			alert(lang[53]);		
			form.text8.focus();		
			return(false);
		}	
		form.submit();		
	}