function ChgSrc_2( obj )
			{
			var img = obj.children[0] ;
			img.src = img.src.replace( "_1", "_2" ) ;
			}

function ChgSrc_1( obj )
			{
			var img = obj.children[0] ;
			img.src = img.src.replace( "_2", "_1" ) ;
			}



	function ChkRep()
		{
		if( document.demande.ID.value == '' ) { alert( "Vous n'avez pas saisi votre identifiant ( LOGIN )." ) ; return ;}
		if( document.demande.NOM.value == "" ) { alert( "Saisie obligatoire du NOM" ) ; return ; }
		if( document.demande.PRE.value == "" ) { alert( "Saisie obligatoire du PRENOM" ) ; return ; }
		if( document.demande.CCAM.value == "" ) { alert( "Saisie obligatoire du CODE CCAM" ) ; return ; }
			if( document.demande.jou.value !=="" )
				{
				if( document.demande.moi.value =="" ) 		{ alert( "Date de naissance incorrecte." ); return ; }
				if( document.demande.ann.value =="" ) 		{ alert( "Date de naissance incorrecte." ); return ; }
				var datenais = document.demande.jou.value + "/" + document.demande.moi.value + "/" + document.demande.ann.value ;
				if( testTypeDate( datenais ) == false ) 	{ alert( "Date de naissance non valide" ) ; return ; }
				}
				else
				{
				alert( "Saisie obligatoire de la date de naissance" ) ; return ;
				}
		var reg = new RegExp( "[A-Z]{4}[0-9]{3}", "gi" ) ;
		if( reg.test( document.demande.CCAM.value ))
			{
			document.devis.CCA.value = document.demande.CCAM.value ;
			}
			else
			{
			alert( "Format de code CCAM 1 erroné..." ) ;
			return ;
			}
		document.devis.CCB.value = document.demande.CCAM2.value ;
		document.devis.DEP.value = document.demande.DP.value ;
		document.devis.DOC.value = document.demande.ID.value ;
		document.devis.ACT.value = document.demande.ACT.value ;
		document.devis.submit() ;
		return ;
		}
		
	function PadJou()
		{
		var jour = document.demande.jou.value.toString() ;
		jour = ( jour.length == 2 ? jour : "0"+jour )  ;
		document.demande.jou.value = ( jour == "0" ? "" : jour )  ;
		}
		
	function PadMoi()
		{
		var mois = document.demande.moi.value.toString() ;
		mois = ( mois.length == 2 ? mois : "0"+mois )  ;
		document.demande.moi.value = ( mois=="0" ? "" : mois ) ;
		}
		
	
	function testTypeDate(dateEntree)
		{
		tst=false;
		try
		{rc=dateEntree.split("/");nd=new Date(rc[2],(rc[1]-1),rc[0]);
		tst=(rc[2]>1800&&rc[2]<2200&&rc[2]==nd.getFullYear()&&rc[1]==(nd.getMonth()+1)&&rc[0]==nd.getDate());
		} catch(e) {}
		return tst;
		}
		
	function GetCCAM( na )
		{
		window.open( "../DOPA/ccam/Ccam_0.php?NUM="+na, "ccam", "menubar=no, statusbar=no, scrollbars=yes, width=1000, height=800" ) ;
		}
		
	function NewMem()
		{
		document.location.href = './newmemb.html' ;
		}
		
	function Profil( log )
		{
		var elem = document.getElementById('profil') ;
		elem.style.visibility = ( log == '' ? 'hidden' : 'visible' ) ;
		var next = document.demande.NOM.focus() ;
		}
		
	function ModProf()
		{
		alert( 'Modifie' ) ;
		var log = document.demande.ID.value ;
		window.open( "./modmemb.php?DOC="+log, "modi","menubar=no, statusbar=no, scrollbars=no, width=800, height=900" ) ; 
		}
		
	function ChkLen( val, ln, idx ) 
		{
		if( val.length == ln ) document.demande.elements[idx].focus() ;
		}
