function GetDate(CtrlTxtDate, AutoRefreshParent)
{
	//testVSS
//	ChildWindow = window.open('../popup/Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlTxtDate + '&CtrlAge=' + CtrlTxtAge, "PopUpCalendar", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");
	ChildWindow = window.showModalDialog('../popup/Calendar.aspx?FormName=' + document.forms[0].name + '&CtrlName=' + CtrlTxtDate + '&AutoRefrechParent=' + AutoRefreshParent, window, 'dialogWidth:280px;dialogHeight:330px;')
}

function IsNumericPositif(sText){
	var ValidChars = "0123456789.";
	return TestIsNumeric(sText, ValidChars);
}
function IsNumeric(sText){
	var ValidChars = "0123456789.-";
	return TestIsNumeric(sText, ValidChars);
}
function TestIsNumeric(sText, ValidChars)
{
   
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
}

function Arrondir2Decimal(inDecimal)
{
	return Math.round(inDecimal*100)/100;
}

function CheckLength(TargetObject, MaxLength)
{
	LenString = TargetObject.value.length;
	if(LenString > MaxLength)
	{
		customAlert("MESSAGE_DEPASSEMENT_NOMBRE_CARACTERES_TEXTAREA");
		TargetObject.value = TargetObject.value.substring(0, MaxLength);
	}
}


function calculateEmail(inIdFirstName, inIdLastName, inIdEmail)
{
	if (!document.getElementById(inIdFirstName) || !document.getElementById(inIdLastName) || !document.getElementById(inIdEmail) ){
	
		return;
	}
	
	var firstName = document.getElementById(inIdFirstName).value;
	var lastName = document.getElementById(inIdLastName).value;
	var email = document.getElementById(inIdEmail).value;
	
	if(firstName.length > 1 && lastName.length > 1 && email == "")
	{
		document.getElementById(inIdEmail).value = deleteAccent(firstName) +"."+deleteAccent(lastName).toUpperCase() + "@AirLiquide.com";
	}
}

function deleteAccent(inString)
{
	inString= replaceAll(inString,' ','');
	inString=inString.replace(/[\xE7]/g,'c');
	inString=inString.replace(/[\xC7]/g,'C');
	inString=inString.replace(/[\xC0-\xC5]/g,'A');
	inString=inString.replace(/[\xE0-\xE4]/g,'a');
	inString=inString.replace(/[\xC8-\xCA]/g,'E');
	inString=inString.replace(/[\xE8-\xEB]/g,'e');
	inString=inString.replace(/[\xCC-\xCF]/g,'I');
	inString=inString.replace(/[\xEC-\xEF]/g,'i');
	inString=inString.replace(/[\xD2-\xD4]/g,'O');
	inString=inString.replace(/[\xF2-\xF4]/g,'o');
	inString=inString.replace(/[\xD9-\xDC]/g,'U');
	inString=inString.replace(/[\xF9-\xFB]/g,'u');	
	inString=inString.replace(/[\xF1]/g,'n');
	inString=inString.replace(/[\xD1]/g,'N');

	return inString;
}

// Remplace toutes les occurences d'une chaine 
function replaceAll(str, search, repl) { 
  while (str.indexOf(search) != -1) 
    str = str.replace(search, repl); 
  return str; 
}
 
function calculateLogin(inIdFirstName, inIdLastName, inIdLogin)
{
if (!document.getElementById(inIdFirstName) || !document.getElementById(inIdLastName) || !document.getElementById(inIdLogin) ){
	
		return;
	}
	
	var firstName = document.getElementById(inIdFirstName).value;
	var lastName = document.getElementById(inIdLastName).value;
	var login = document.getElementById(inIdLogin).value;
	
	if(firstName.length > 1 && lastName.length > 1 && login =="")
	{
		document.getElementById(inIdLogin).value = deleteAccent(firstLetterUpper(firstName)) +"."+deleteAccent(firstLetterUpper(lastName));
	}
}
function firstLetterUpper(inString){
	inString= replaceAll(inString,' ','.');
	inString = inString.replace(/^./, function(c) { return c.toUpperCase() } )
	return inString;
}

function changeCssRow(inIdDropDownList, inRow)
{
	var fieldValue = document.getElementById(inIdDropDownList).value;
	document.getElementById(inRow).className = fieldValue;
	
}

function isEmail(inChaine){
    var usr    = "([a-zA-Z0-9][a-zA-Z0-9_.-]*|\"([^\\\\\x80-\xff\015\012\"]|\\\\[^\x80-\xff])+\")";
    var domain = "([a-zA-Z0-9][a-zA-Z0-9._-]*\\.)*[a-zA-Z0-9][a-zA-Z0-9._-]*\\.[a-zA-Z]{2,5}";
    var regex  = usr + "\@" + domain + "$";
    var reg    = new RegExp(regex);

    return reg.test(inChaine);
}
function SendMail(inOrigineId, inDynamic){
    var email;
    if (inDynamic == "True")
        email = document.getElementById(inOrigineId).value
    else
        email = inOrigineId;
    if (isEmail(email))
        window.open('mailto:'+email, "PopUpMailTo", "width=270,height=300,top=200,left=200,toolbars=no,scrollbars=no,status=no,resizable=no");
    else
        customAlert("MESSAGE_EMAIL_MAL_FORMATE")
    
}

function GoToPageDetail(inUrl, inBoutonSaveId, inAvecConfirm){
    var outConfirm = false;
    if (inAvecConfirm.toUpperCase() == "true".toUpperCase() )
        outConfirm  = customConfirm("MESSAGE_ENREGISTREMENT_REDIRECTION_PAGE_DETAIL")
    if (outConfirm){
        document.getElementById("info_page").value = inUrl;
        __doPostBack(inBoutonSaveId, '');
    }
    else if (outConfirm == false){
        window.location = inUrl;
    }
    
}

function afficheLabelAlerteSiSessionEstCloturee(inDdl, inLabel){
    var ddlStatut = document.getElementById(inDdl);
    var lblAlerte = document.getElementById(inLabel);
    
    if (ddlStatut != null && lblAlerte != null)
    {
        if (ddlStatut.value.toUpperCase() == '8DD7F2BE-AF25-4658-934E-1B86DA764583'
        ||
        ddlStatut.value.toUpperCase() == '16E85A4A-7A9D-4E15-99EF-652D03AB0517'
        ){
            lblAlerte.style.visibility="visible";
        }
        else{
            lblAlerte.style.visibility="hidden";
        }
        
    }
}

function openExtractionOperationnelleSessionsInstanceWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionOperationnelleSessionsInstance.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionAnalytiqueAnalyseCandidatsCertifiesWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueAnalyseCandidatsCertifies.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionAnalytiqueCandidatsCertificationValideWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueCandidatsCertificationValide.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionAnalytiqueNombreDossiersCorrigesWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueNombreDossiersCorriges.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionAnalytiqueNouveauxCandidatsWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueNouveauxCandidats.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionOperationnelleSocietesWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionOperationnelleSocietes.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionOperationnelleCertifiesRelancerWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionOperationnelleCertifiesRelancer.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionOperationnellePlanningSessionWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionOperationnellePlanningSession.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openExtractionOperationnellePersonnelHabiliteWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionOperationnellePersonnelHabiliteInstance.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openUserInfoCompteWindow(paramGet, paramWindow)
{
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../PopUp/UserInfoCompte.aspx?'+paramGet, 'window', 'width=400,height=280,scrollbars=yes');
}

function openCandidatAlertWindow(paramGet, paramWindow)
{
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/CandidatAlert.aspx?'+paramGet, window, 'dialogWidth:300px;dialogHeight:280px;');
}

function openCandidatProcheAlertWindow(paramGet, paramWindow)
{
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/CandidatAlert.aspx?'+paramGet, window, 'dialogWidth:300px;dialogHeight:280px;');
}

function openPersonnelAlertWindow(paramGet, paramWindow)
{
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/PersonnelAlert.aspx?'+paramGet, window, 'dialogWidth:400px;dialogHeight:280px;');
}


function openResponsablesTechniquesWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/AjoutResponsableTechnique.aspx?'+paramGet, window, 'dialogWidth:700px;dialogHeight:500px;');
	
}


function openExportSessionCandidatExaminateurWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExportSessionCandidatExaminateur.aspx?'+paramGet, 'window', 'width=700,height=500');
	
}


function openExportMembrePersonnelHabiliteWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExportMembrePersonnelHabilite.aspx?'+paramGet, 'window', 'width=700,height=500');
	
}


function openExportResponsableTechniqueWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExportResponsableTechnique.aspx?'+paramGet, 'window', 'width=700,height=500');
	
}


function openExportExaminateurWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExportExaminateur.aspx?'+paramGet, 'window', 'width=700,height=500');
	
}


function openSessionExaminateurWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/AjoutExaminateurSession.aspx?'+paramGet, window, 'dialogWidth:700px;dialogHeight:500px;');	
}

function openDossierWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/AjoutDossierSession.aspx?'+paramGet, window, 'dialogWidth:800px;dialogHeight:500px;');	
}

function openRechercheSocieteWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/RechercheSociete.aspx?'+ paramGet, window, 'dialogWidth:700px;dialogHeight:700px;')
}
//EVOL mantis 111
function openRechercheSocietePersonnelWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/RechercheSocietePersonnel.aspx?'+ paramGet, window, 'dialogWidth:700px;dialogHeight:700px;')
}
//EVOL MANTIS 111
function openRechercheSocieteExtractionWindow(paramGet, paramWindow){
//paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/RechercheSocieteExtraction.aspx?'+ paramGet, window, 'dialogWidth:700px;dialogHeight:700px;')
}

function SaveOnRowClick(inBoutonSaveId, inObjetPostBack, inValeurPostBack)
{
    document.getElementById("info_page").value = "__doPostBack('"+inObjetPostBack+"', '"+inValeurPostBack+"')";
    var outWindow = customConfirm("MESSAGE_ENREGISTREMENT_REDIRECTION_PAGE_DETAIL");
    if (outWindow){
        __doPostBack(inBoutonSaveId, 'dtg');
    }
    else if (outWindow == false){
       __doPostBack(inObjetPostBack, inValeurPostBack);
    }
}

function copyFieldAdherent(){
	var rdbOui = 'SOC_Creer1_ccAdherentCofrend0';
	var rdbNon = 'SOC_Creer1_ccAdherentCofrend1';
	var txtAdherentInvisible = 'SOC_Creer1_txtAdherentInvisible';
	if (document.getElementById(rdbOui).checked){
		document.getElementById(txtAdherentInvisible).value = "oui";
	}
	else if (document.getElementById(rdbNon).checked){
		document.getElementById(txtAdherentInvisible).value = "non";
	}
}

function js_redirect(inUrl){
    window.location =  inUrl;
}

function setExamenPartiel(){
    var inPartielValueId = "DOS_Creer1_ccTypeExamen____1";
    var inCbxTroncCommunId = "DOS_Creer1_ccEpreuvesPasseesGeneral_localControl";
    var inCbxSpecifiqueId = "DOS_Creer1_ccEpreuvesPasseesSpecifique_localControl";
    var inCbxPratiqueId = "DOS_Creer1_ccEpreuvesPasseesPratique_localControl";
    var inLblGeneralId = "DOS_Creer1_lblGeneral";
    var inLblSpecifiqueId = "DOS_Creer1_lblSpecique";
    var inLblPratiqueId = "DOS_Creer1_lblPratique";
    if (document.getElementById(inPartielValueId)!=null)
    {
        var inTroncCommunInitialValue = document.getElementById(inCbxTroncCommunId).checked;
        var inSpecifiqueInitialValue = document.getElementById(inCbxSpecifiqueId).checked;
        var inPratiqueInitialValue = document.getElementById(inCbxPratiqueId).checked;
        
        
        if (!document.getElementById(inPartielValueId).checked){
            document.getElementById(inCbxTroncCommunId).checked = true;
            document.getElementById(inCbxSpecifiqueId).checked = true;
            document.getElementById(inCbxPratiqueId).checked = true;
            
            document.getElementById(inCbxTroncCommunId).disabled = true;
            document.getElementById(inCbxSpecifiqueId).disabled = true;
            document.getElementById(inCbxPratiqueId).disabled = true;
            document.getElementById(inLblGeneralId).disabled = true;
            document.getElementById(inLblSpecifiqueId).disabled = true;
            document.getElementById(inLblPratiqueId).disabled = true;
        }
        else{
            
            document.getElementById(inCbxTroncCommunId).checked = inTroncCommunInitialValue;
            document.getElementById(inCbxSpecifiqueId).checked = inSpecifiqueInitialValue;
            document.getElementById(inCbxPratiqueId).checked = inPratiqueInitialValue;
        
            document.getElementById(inCbxTroncCommunId).disabled = false;
            document.getElementById(inCbxSpecifiqueId).disabled = false;
            document.getElementById(inCbxPratiqueId).disabled = false;
            document.getElementById(inLblGeneralId).disabled = false;
            document.getElementById(inLblSpecifiqueId).disabled = false;
            document.getElementById(inLblPratiqueId).disabled = false;
        }
      }
}


function setFormation(){
    
    var inAttestationFormationOuiId = "DOS_Creer1_ccAttestationFormation____0"; 
    var LblTempsFormationId = "DOS_Creer1_lblTempsFormation";
    var txtTempsFormationId = "DOS_Creer1_ccTempsFormation_localControl"; 
    var LblTempsFormationHeureId = "DOS_Creer1_lblTempsFormationHeure";
    var LblResponsableFormationId = "DOS_Creer1_lblResponsableFormation";
    var txtResponsableFormationId = "DOS_Creer1_ccResponsableFormation_localControl"; 
   
    if (!document.getElementById(inAttestationFormationOuiId).checked){
    
        document.getElementById(LblTempsFormationId).disabled = true;
        document.getElementById(txtTempsFormationId).disabled = true;
        document.getElementById(LblTempsFormationHeureId).disabled = true;
        document.getElementById(LblResponsableFormationId).disabled = true;
        document.getElementById(txtResponsableFormationId).disabled = true;
    }
    else
    {
        document.getElementById(LblTempsFormationId).disabled = false;
        document.getElementById(txtTempsFormationId).disabled = false;
        document.getElementById(LblTempsFormationHeureId).disabled = false;
        document.getElementById(LblResponsableFormationId).disabled = false;
        document.getElementById(txtResponsableFormationId).disabled = false;
    }
    
}



function setDateDosimetrie(){
    
    var inDosimetrieOuiId = "DOS_Creer1_ccDosimetreElevee____0"; 
    var inDosimetrieNonId = "DOS_Creer1_ccDosimetreElevee____1"; 
    
    var LblDateDosimetrieId = "DOS_Creer1_lblDateDosimetrie";
    var CalDateDosimetrieId = "DOS_Creer1_ccDateDosimetrie_localControl"; 
    var ImgDateDosimetrieId = "DOS_Creer1:ccDateDosimetrie_localControl_img";
    var HrefDosimetrie  = "javascript:GetDate('DOS_Creer1_ccDateDosimetrie_localControl', 'false')"; 
    
    if ( (!document.getElementById(inDosimetrieOuiId).checked) && (!document.getElementById(inDosimetrieNonId).checked) ){ 
    
        document.getElementById(LblDateDosimetrieId).disabled = true;
        document.getElementById(CalDateDosimetrieId).disabled = true;
        document.getElementById(ImgDateDosimetrieId).href = "javascript:void(0)";
    }
    else
    {
        document.getElementById(LblDateDosimetrieId).disabled = false;
        document.getElementById(CalDateDosimetrieId).disabled = false;
        document.getElementById(ImgDateDosimetrieId).href = HrefDosimetrie;
    }
}


function setDateCertificatMedical(){
    
    var inAcuiteVisuelleOuiId = "DOS_Creer1_ccAcuiteVisuelle____0"; 
    var LblDateCertificatMedicalId = "DOS_Creer1_lblDateCertificatMedical";
    var CalDateCertificatMedicalId = "DOS_Creer1_ccDateCertificatMedical_localControl"; 
    var ImgDateCertificatMedicalId = "DOS_Creer1:ccDateCertificatMedical_localControl_img";
    var HrefDateCertificatMedical  = "javascript:GetDate('DOS_Creer1_ccDateCertificatMedical_localControl', 'false')"; 
    
    if (!document.getElementById(inAcuiteVisuelleOuiId).checked){
    
        document.getElementById(LblDateCertificatMedicalId).disabled = true;
        document.getElementById(CalDateCertificatMedicalId).disabled = true;
        document.getElementById(ImgDateCertificatMedicalId).href = "javascript:void(0)";
    }
    else
    {
        document.getElementById(LblDateCertificatMedicalId).disabled = false;
        document.getElementById(CalDateCertificatMedicalId).disabled = false;
        document.getElementById(ImgDateCertificatMedicalId).href = HrefDateCertificatMedical;
    }
}

function setOptionCamari()
{
    var inCbxOptionCamariId = "CAN_Creer1_ccCamari_localControl";
    var inLblOptionCamariId = "CAN_Creer1_lblOptionCamari";
    var inDdlOptionCamariId = "CAN_Creer1_ccOptionCamari_localControl";
    
    if (!document.getElementById(inCbxOptionCamariId).checked)
    {
        document.getElementById(inLblOptionCamariId).disabled = true;
        document.getElementById(inDdlOptionCamariId).disabled = true;
    }
    else
    {
        document.getElementById(inLblOptionCamariId).disabled = false;
        document.getElementById(inDdlOptionCamariId).disabled = false;
    }
}

function setRaisonActivite()
{
    var inCalDateFinActiviteId = "CAN_Creer1_ccDateFinActivite_localControl";
    var inLblRaisonFinActiviteId = "CAN_Creer1_lblRaisonFinActivite";
    var inDdlRaisonFinActiviteId = "CAN_Creer1_ccRaisonFinActivite_localControl";
     
    if (document.getElementById(inCalDateFinActiviteId).value == "")
    {   
        document.getElementById(inLblRaisonFinActiviteId).disabled = true;
        document.getElementById(inDdlRaisonFinActiviteId).disabled = true;
    }
    else
    {
        document.getElementById(inLblRaisonFinActiviteId).disabled = false;
        document.getElementById(inDdlRaisonFinActiviteId).disabled = false;
    }
   
}

function setRecertification(){

    var inCreditPointValueId = "DOS_Creer1_ccRecertification____0";
    var inExamenValueId = "DOS_Creer1_ccRecertification____1";
    var inDdlNiveauCertificationId = "DOS_Creer1_ccNiveauCertification_localControl";
    var inDdlTypeCertificationId= "DOS_Creer1_ccTypeCertification_localControl";
    var inNiveau3Id = "8d8c9013-5af2-4b39-9cf5-aae7f06f9bce";
    var inTypeRecertificationId = "48d0a523-7f26-45df-87be-927a0860683d";
    
    if(document.getElementById(inDdlNiveauCertificationId).value.toUpperCase() == inNiveau3Id.toUpperCase()
    && document.getElementById(inDdlTypeCertificationId).value.toUpperCase() == inTypeRecertificationId .toUpperCase()
    ) 
    {
        document.getElementById(inCreditPointValueId).disabled = false;
        document.getElementById(inExamenValueId).disabled = false; 
    }
    else
    {
        document.getElementById(inCreditPointValueId).disabled = true;
        document.getElementById(inExamenValueId).disabled = true; 
        
        document.getElementById(inCreditPointValueId).checked = false;
        document.getElementById(inExamenValueId).checked = false; 
    }
 }

function setExperience()
{
    var experienceAnneeId = "DOS_Creer1_ccExperienceIndustrielleAnnee_localControl";
    var experienceMoisId = "DOS_Creer1_ccExperienceIndustrielleMois_localControl";
    var experienceHeureId = "DOS_Creer1_ccExperienceIndustrielleHeure_localControl";   
    
    if(document.getElementById(experienceAnneeId).value != "" )
    {
        //document.getElementById(experienceMoisId).style.visibility="hidden";
        //document.getElementById(experienceHeureId).style.visibility="hidden";
        
        document.getElementById(experienceMoisId).disabled = true;
        document.getElementById(experienceHeureId).disabled = true;
        
        document.getElementById(experienceMoisId).value = "";
        document.getElementById(experienceHeureId).value = "";
    }
    else if( document.getElementById(experienceMoisId).value != "")
    {
        //document.getElementById(experienceAnneeId).style.visibility="hidden";
        //document.getElementById(experienceHeureId).style.visibility="hidden";
        
        document.getElementById(experienceAnneeId).disabled = true;
        document.getElementById(experienceHeureId).disabled = true;
        
        document.getElementById(experienceAnneeId).value = "";
        document.getElementById(experienceHeureId).value = "";
    }
    else if(document.getElementById(experienceHeureId).value != "")
    {
        //document.getElementById(experienceAnneeId).style.visibility="hidden";
        //document.getElementById(experienceMoisId).style.visibility="hidden";
        
        document.getElementById(experienceAnneeId).disabled = true;
        document.getElementById(experienceMoisId).disabled = true;
        
        document.getElementById(experienceAnneeId).value = "";
        document.getElementById(experienceMoisId).value = "";
    }
    else{
        document.getElementById(experienceAnneeId).style.visibility="";
        document.getElementById(experienceMoisId).style.visibility="";
        document.getElementById(experienceHeureId).style.visibility="";
        
        document.getElementById(experienceAnneeId).disabled = false;
        document.getElementById(experienceMoisId).disabled = false;
        document.getElementById(experienceHeureId).disabled = false;
        
        document.getElementById(experienceAnneeId).value = "";
        document.getElementById(experienceMoisId).value = "";
        document.getElementById(experienceHeureId).value = "";
    }
}

function setCertifieN2(){
    var inCbxCertifieN2OuiId = "DOS_Examen_Base1_ccCertifieN2____0";
    var inNotePratiqueN2Id = "DOS_Examen_Base1_ccNotePratiqueN2_localControl";
    var inDateNotrePratiqueN2Id = "DOS_Examen_Base1_ccDateNotePratiqueN2_localControl";
    var inDateNotrePratiqueN2ImageId = "DOS_Examen_Base1:ccDateNotePratiqueN2_localControl_img";
    
    var inLblNotePratiqueN2Id = "DOS_Examen_Base1_lblNotePratiqueN2";
    var inLblDateNotePratiqueN2Id = "DOS_Examen_Base1_lblDateNotePratiqueN2";
    //EVOL 80 : inversion
    if (document.getElementById(inCbxCertifieN2OuiId).checked)
    {
         document.getElementById(inNotePratiqueN2Id).disabled = true;
        
        document.getElementById(inNotePratiqueN2Id).style.visibility="hidden";
        document.getElementById(inDateNotrePratiqueN2Id).style.visibility="hidden";
        document.getElementById(inDateNotrePratiqueN2ImageId).style.visibility="hidden";
        
        document.getElementById(inNotePratiqueN2Id).value = "";
        document.getElementById(inDateNotrePratiqueN2Id).value = "";
        
        document.getElementById(inLblNotePratiqueN2Id).disabled = true;
        document.getElementById(inLblDateNotePratiqueN2Id).disabled = true;
    }
    else
    {
        document.getElementById(inNotePratiqueN2Id).disabled = false;
        
        document.getElementById(inNotePratiqueN2Id).style.visibility="visible";
        document.getElementById(inDateNotrePratiqueN2Id).style.visibility="visible";
        document.getElementById(inDateNotrePratiqueN2ImageId).style.visibility="visible";
        
        document.getElementById(inLblNotePratiqueN2Id).disabled = false;
        document.getElementById(inLblDateNotePratiqueN2Id).disabled = false;

        
    }
}

//////////////////////////////

function setOptionInspection(){
    var inCbxCertifieN2OuiId = "DOS_Fiche_Resultat1_ccCertifieN2____0";
    var inNotePratiqueN2Id = "DOS_Fiche_Resultat1_ccInspectionNotePratiqueN2";
    var inDateNotrePratiqueN2Id = "DOS_Fiche_Resultat1_ccInspectionDate_localControl";
    var inDateNotrePratiqueN2ImageId = "DOS_Fiche_Resultat1:ccInspectionDate_localControl_img";
    
    var inLblNotePratiqueN2Id = "DOS_Fiche_Resultat1_lblInspectionNotePratiqueN2";
    var inLblDateNotePratiqueN2Id = "DOS_Fiche_Resultat1_lblDateInspection";
    var inLblNotePratiqueSurCentId = "DOS_Fiche_Resultat1_lblInspectionNotePratiqueN2SurCent";
    
    if (document.getElementById(inCbxCertifieN2OuiId).checked)
    {
        document.getElementById(inNotePratiqueN2Id).disabled = false;
        
        document.getElementById(inNotePratiqueN2Id).style.visibility="visible";
        document.getElementById(inDateNotrePratiqueN2Id).style.visibility="visible";
        document.getElementById(inDateNotrePratiqueN2ImageId).style.visibility="visible";
        
        document.getElementById(inLblNotePratiqueN2Id).disabled = false;
        document.getElementById(inLblDateNotePratiqueN2Id).disabled = false;
        document.getElementById(inLblNotePratiqueSurCentId).disabled = false;
    }
    else
    {
        document.getElementById(inNotePratiqueN2Id).disabled = true;
        
        document.getElementById(inNotePratiqueN2Id).style.visibility="hidden";
        document.getElementById(inDateNotrePratiqueN2Id).style.visibility="hidden";
        document.getElementById(inDateNotrePratiqueN2ImageId).style.visibility="hidden";
        
        document.getElementById(inNotePratiqueN2Id).value = "";
        document.getElementById(inDateNotrePratiqueN2Id).value = "";
        
        document.getElementById(inLblNotePratiqueN2Id).disabled = true;
        document.getElementById(inLblDateNotePratiqueN2Id).disabled = true;;
        document.getElementById(inLblNotePratiqueSurCentId).disabled = true;
        
    }
}


/////////////////////////////

function customConfirm(inTextePopUp)
{
    var outWindow = window.showModalDialog('../popup/confirm.aspx?texte='+inTextePopUp, escape(inTextePopUp), 'dialogWidth:280px;dialogHeight:120px;edge:sunken;unadorned:yes')
    return outWindow;
}

function ConfirmModal(inTextePopUp)
{
    var outWindow = window.showModalDialog('../popup/ConfirmModal.aspx?texte='+inTextePopUp, escape(inTextePopUp), 'dialogWidth:280px;dialogHeight:120px;edge:sunken;unadorned:yes')
    return outWindow;
}

function customAlert(inTextePopUp)
{
    window.showModalDialog('../popup/alert.aspx?texte='+inTextePopUp, escape(inTextePopUp), 'dialogWidth:280px;dialogHeight:150px;edge:sunken;unadorned:yes')
}


function openExtractionOperationnelleSessionCandidatWindow(paramGet, paramWindow)
{
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionOperationnelleCandidatSession.aspx?'+paramGet, 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionOperationnelleSyntheseSession(paramGet, paramWindow)
{
    //paramWindow not used but put in prototype in case the param may change
    ChildWindow = window.open('../Export/ExtractionOperationnelleSyntheseSession.aspx?'+paramGet,'window', 'width=700,height=500');
    InitializeTimer(ChildWindow);
}

function boutonConfirmSauvegarder(inBtnAction, inBtnSave)
{
    var outConfirm = false;
    outConfirm  = customConfirm("MESSAGE_ENREGISTREMENT_REDIRECTION_PAGE_DETAIL")
    
    if (outConfirm){
        document.getElementById("info_page").value = "__doPostBack('"+inBtnAction+"','')";
        __doPostBack(inBtnSave, '');
        return false;
    }
    else if (outConfirm == false){
        __doPostBack(inBtnAction, '');
        return true;
    }
    else{
        return false;
    }
}

function openModificationInstanceDossierWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
    ChildWindow = window.showModalDialog('../PopUp/ModificationInstanceDossier.aspx?'+paramGet, window, 'dialogWidth:700px;dialogHeight:500px;');
}


function openExtractionOperationnelleEtablissementCartesWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionOperationnelleEtablissementCartes.aspx?'+paramGet, 'window', 'width=700,height=500');
    InitializeTimer(ChildWindow);
}

//EVOL 110
function openExtractionOperationnelleDuplicataCarteWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionOperationnelleDuplicataCarte.aspx?'+paramGet, 'window', 'width=700,height=500');
    InitializeTimer(ChildWindow);
}

function openExtractionAnalytiqueNombreValidationWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueNombreValidationInstance.aspx?'+paramGet, 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openExtractionAnalytiqueAnalyseValidationWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueAnalyseValidationInstance.aspx?'+paramGet, 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}
function openExtractionAnalytiqueNombreCertificationWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionNombreCertificationInstance.aspx?'+paramGet, 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}
function openExtractionAnalytiqueAnalyseResultatExamenWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueAnalyseResultatExamen.aspx?'+paramGet, 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}
function openExtractionAnalytiqueAnalyseSanctionQuestionnaireExamenWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueAnalyseSanctionQuestionnaireExamen.aspx?'+paramGet, 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}
function openExtractionAnalytiqueAnalyseDureeProcessusCertificationWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExtractionAnalytiqueAnalyseDureeProcessusCertification.aspx?'+paramGet, 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

//Popups Courriers

function openCourrierEnvoiDossierWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiDossier.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openCourrierEnvoiDossierIncompletWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiDossierIncomplet.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openCourrierEnvoiRefusRenouvellementCertificationWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiRefusRenouvellementCertification.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openCourrierEnvoiSuccesRenouvellementCertificationWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiSuccesRenouvellementCertification.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openCourrierEnvoiCarteCertificationWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiCarteCertification.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openCourrierEnvoiEchecExamenBaseWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiEchecExamenBase.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openCourrierEnvoiSuccesExamenBaseWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiSuccesExamenBase.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openCourrierEnvoiRelanceDossiersWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiRelanceDossiers.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openCourrierEnvoiConvocationWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiConvocation.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openCourrierEnvoiAbsenceCandidatSessionWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiAbsenceCandidatSession.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openCourrierEnvoiAttestationPresenceSessionWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiAttestationPresenceSession.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}

function openCourrierEnvoiParticipationJurySessionWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiParticipationJurySession.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function openCourrierEnvoiResultatExamenWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/CourrierEnvoiResultatExamen.aspx', 'window', 'width=700,height=500');
	InitializeTimer(ChildWindow);
}


function DeleteDossier(inDossierId)
{
    var agree=ConfirmModal("DOSSIER_CONFIRMATION_SUPPRESSION");
    if (agree)
	    window.location = 'DOS_Creer.aspx?dossierId='+inDossierId+'&action=Delete';    
}

function DeleteCandidat(inCandidatId)
{
    var agree=ConfirmModal("CANDIDAT_CONFIRMATION_SUPPRESSION");
    if (agree)
	    window.location = 'CAN_Creer.aspx?candidatId='+inCandidatId+'&action=Delete';    
}


function DeleteSociete(inSocieteId)
{
    var agree=ConfirmModal("SOCIETE_CONFIRMATION_SUPPRESSION");
    if (agree)
	    window.location = 'SOC_Creer.aspx?societeId='+inSocieteId+'&action=Delete';    
}


function DeleteInstance(inInstanceId)
{
    var agree=ConfirmModal("INSTANCE_CONFIRMATION_SUPPRESSION");
    if (agree)
	    window.location = 'ORG_Instance_Creer.aspx?instanceId='+inInstanceId+'&action=Delete';    
}


function DeletePersonnel(inPersonnelId)
{
    var agree=ConfirmModal("PERSONNEL_CONFIRMATION_SUPPRESSION");
    if (agree)
	    window.location = 'ORG_Personnel_Creer.aspx?personnelId='+inPersonnelId+'&action=Delete';    
}

/* GERICCO V3 */

function openDocumentDetailWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may chang
	ChildWindow = window.showModalDialog('../PopUp/DOC_DetailDocument.aspx?'+paramGet, window, 'dialogWidth:790px;dialogHeight:350px;');
}

function DeleteDocument(inDocumentId)
{
    var agree=ConfirmModal("DOCUMENT_CONFIRMATION_SUPPRESSION");
    if (agree)
	    window.location = 'DOC_List.aspx?action=Delete&documentId='+inDocumentId;    
}


function setDetailVigilenceSociete(inDateRemarques, inDatePeremption){
    
    var inSurLaListeVigilenceOuiId = "SOC_Creer1_ccSurLalisteDeVigilence____0"; 
    var LblDateRemarquesId = "SOC_Creer1_lblDateRemarques";
    var CalDateRemarquesId = "SOC_Creer1_ccDateRemarques_localControl"; 
    var ImgDateRemarquesId = "SOC_Creer1:ccDateRemarques_localControl_img";
    var HrefDateRemarques  = "javascript:GetDate('SOC_Creer1_ccDateRemarques_localControl', 'false')"; 
    
    var LblDatePeremptionId = "SOC_Creer1_lblDatePeremption";
    var CalDatePeremptionId = "SOC_Creer1_ccDatePeremption_localControl"; 
    var ImgDatePeremptionId = "SOC_Creer1:ccDatePeremption_localControl_img";
    var HrefDatePeremption  = "javascript:GetDate('SOC_Creer1_ccDatePeremption_localControl', 'false')"; 
    
    var LblRaisonId = "SOC_Creer1_lblRaison";
    var TxtRaisonId = "SOC_Creer1_ccRaison_localControl";
    
    var ddlInstance = "SOC_Creer1_ucInstance_rptInstance__ctl$_ccInstance_localControl";
    var ddlInstanceId = "";
    var lblInstance = "SOC_Creer1_ucInstance_rptInstance__ctl$_lblInstance";
    var lblInstanceId = "";
    var imgRemove = "SOC_Creer1_ucInstance_rptInstance__ctl$_ccRemove_localControl";
    var imgRemoveId = "";
    var imgAdd = "SOC_Creer1_ucInstance_rptInstance__ctl$_ccAdd_localControl";
    var imgAddId = "";
    
  
    if (!document.getElementById(inSurLaListeVigilenceOuiId).checked){
    
        document.getElementById(LblDateRemarquesId).disabled = true;
        document.getElementById(CalDateRemarquesId).disabled = true;
        document.getElementById(ImgDateRemarquesId).href = "javascript:void(0)";
        document.getElementById(CalDateRemarquesId).value = "";
        
        document.getElementById(LblDatePeremptionId).disabled = true;
        document.getElementById(CalDatePeremptionId).disabled = true;
        document.getElementById(ImgDatePeremptionId).href = "javascript:void(0)";
        document.getElementById(CalDatePeremptionId).value = "";
        
        document.getElementById(LblRaisonId).disabled = true;
        document.getElementById(TxtRaisonId).disabled = true;
        document.getElementById(TxtRaisonId).value = "";
        
        for(i=1; i <= 20; i++)
        {
            ddlInstanceId = ddlInstance.replace('$',i);
            if (document.getElementById(ddlInstanceId) != null)
            {
                document.getElementById(ddlInstanceId).disabled = true;
                document.getElementById(ddlInstanceId).value = "";
            }
            
            lblInstanceId = lblInstance.replace('$',i);
            if(document.getElementById(lblInstanceId) != null)
                document.getElementById(lblInstanceId).disabled = true;
            
            imgAddId = imgAdd.replace('$',i);
            if (document.getElementById(imgAddId) != null)
                document.getElementById(imgAddId).disabled = true;
            
            imgRemoveId = imgRemove.replace('$',i);
            if (document.getElementById(imgRemoveId) != null)
              document.getElementById(imgRemoveId).disabled = true;
        }
    }
    else
    {
        document.getElementById(LblDateRemarquesId).disabled = false;
        document.getElementById(CalDateRemarquesId).disabled = false;
        document.getElementById(ImgDateRemarquesId).href = HrefDateRemarques;
        document.getElementById(CalDateRemarquesId).value = inDateRemarques;
        
        document.getElementById(LblDatePeremptionId).disabled = false;
        document.getElementById(CalDatePeremptionId).disabled = false;
        document.getElementById(ImgDatePeremptionId).href = HrefDatePeremption;
        document.getElementById(CalDatePeremptionId).value = inDatePeremption;
        
        document.getElementById(LblRaisonId).disabled = false;
        document.getElementById(TxtRaisonId).disabled = false;
        
        for(i=1; i <= 10; i++)
        {
            ddlInstanceId = ddlInstance.replace('$',i);
            if (document.getElementById(ddlInstanceId) != null)
                document.getElementById(ddlInstanceId).disabled = false;
           
            lblInstanceId = lblInstance.replace('$',i);
            if (document.getElementById(lblInstanceId))
               document.getElementById(lblInstanceId).disabled = false;
            
             imgAddId = imgAdd.replace('$',i);
            if (document.getElementById(imgAddId) != null)
                document.getElementById(imgAddId).disabled = false;
            
            imgRemoveId = imgRemove.replace('$',i);
            if (document.getElementById(imgRemoveId) != null)
              document.getElementById(imgRemoveId).disabled = false;
            
        }
    }
}


function openPopupDetailBLSocieteCandidatWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/DetailBLSocieteCandidat.aspx?'+paramGet, window, 'dialogWidth:790px;dialogHeight:350px;');
}


function openExportBLSocieteWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExportBLSociete.aspx?'+paramGet, 'window', 'width=800,height=350');
}


function openExportBLCandidatWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExportBLCandidat.aspx?'+paramGet, 'window', 'width=800,height=350');
}


function setDetailVigilenceCandidat(inDateRemarques, inDatePeremption){
    
    var inSurLaListeVigilenceOuiId = "CAN_Creer1_ccSurLalisteDeVigilence____0"; 
    var LblDateRemarquesId = "CAN_Creer1_lblDateRemarques";
    var CalDateRemarquesId = "CAN_Creer1_ccDateRemarques_localControl"; 
    var ImgDateRemarquesId = "CAN_Creer1:ccDateRemarques_localControl_img";
    var HrefDateRemarques  = "javascript:GetDate('CAN_Creer1_ccDateRemarques_localControl', 'false')"; 
    
    var LblDatePeremptionId = "CAN_Creer1_lblDatePeremption";
    var CalDatePeremptionId = "CAN_Creer1_ccDatePeremption_localControl"; 
    var ImgDatePeremptionId = "CAN_Creer1:ccDatePeremption_localControl_img";
    var HrefDatePeremption  = "javascript:GetDate('CAN_Creer1_ccDatePeremption_localControl', 'false')"; 
    
    var LblRaisonId = "CAN_Creer1_lblRaison";
    var TxtRaisonId = "CAN_Creer1_ccRaison_localControl";
    
    var ddlInstance = "CAN_Creer1_ucBLInstance_rptInstance__ctl$_ccInstance_localControl";
    var ddlInstanceId = "";
    var lblInstance = "CAN_Creer1_ucBLInstance_rptInstance__ctl$_lblInstance";
    var lblInstanceId = "";
    var imgRemove = "CAN_Creer1_ucBLInstance_rptInstance__ctl$_ccRemove_localControl";
    var imgRemoveId = "";
    var imgAdd = "CAN_Creer1_ucBLInstance_rptInstance__ctl$_ccAdd_localControl";
    var imgAddId = "";
    
    
    
    
    if (!document.getElementById(inSurLaListeVigilenceOuiId).checked){
    
        document.getElementById(LblDateRemarquesId).disabled = true;
        document.getElementById(CalDateRemarquesId).disabled = true;
        document.getElementById(ImgDateRemarquesId).href = "javascript:void(0)";
        document.getElementById(CalDateRemarquesId).value = "";
        
        document.getElementById(LblDatePeremptionId).disabled = true;
        document.getElementById(CalDatePeremptionId).disabled = true;
        document.getElementById(ImgDatePeremptionId).href = "javascript:void(0)";
        document.getElementById(CalDatePeremptionId).value = "";
        
        document.getElementById(LblRaisonId).disabled = true;
        document.getElementById(TxtRaisonId).disabled = true;
        document.getElementById(TxtRaisonId).value = "";
        
        for(i=1; i <= 10; i++)
        {
            ddlInstanceId = ddlInstance.replace('$',i);
            
            if (document.getElementById(ddlInstanceId) != null)
            {
                document.getElementById(ddlInstanceId).disabled = true;
                document.getElementById(ddlInstanceId).value = "";
            }
            
            lblInstanceId = lblInstance.replace('$',i);
            if (document.getElementById(lblInstanceId) != null)
                document.getElementById(lblInstanceId).disabled = true;
           
            imgAddId = imgAdd.replace('$',i);
            if (document.getElementById(imgAddId) != null)
                document.getElementById(imgAddId).disabled = true;
            
            imgRemoveId = imgRemove.replace('$',i);
            if (document.getElementById(imgRemoveId) != null)
                document.getElementById(imgRemoveId).disabled = true;
        }
    }
    else
    {
        document.getElementById(LblDateRemarquesId).disabled = false;
        document.getElementById(CalDateRemarquesId).disabled = false;
        document.getElementById(ImgDateRemarquesId).href = HrefDateRemarques;
        document.getElementById(CalDateRemarquesId).value = inDateRemarques;
        
        document.getElementById(LblDatePeremptionId).disabled = false;
        document.getElementById(CalDatePeremptionId).disabled = false;
        document.getElementById(ImgDatePeremptionId).href = HrefDatePeremption;
        document.getElementById(CalDatePeremptionId).value = inDatePeremption;
        
        document.getElementById(LblRaisonId).disabled = false;
        document.getElementById(TxtRaisonId).disabled = false;
        
        for(i=1; i <= 10; i++)
        {
            ddlInstanceId = ddlInstance.replace('$',i);
            if (document.getElementById(ddlInstanceId) != null)
                document.getElementById(ddlInstanceId).disabled = false;
           
            lblInstanceId = lblInstance.replace('$',i);
            if (document.getElementById(lblInstanceId) != null)
                document.getElementById(lblInstanceId).disabled = false;
            
            imgAddId = imgAdd.replace('$',i);
            if (document.getElementById(imgAddId) != null)
                document.getElementById(imgAddId).disabled = false;
            
            imgRemoveId = imgRemove.replace('$',i);
            if (document.getElementById(imgRemoveId) != null)
                document.getElementById(imgRemoveId).disabled = false;
        }
    }
}

function DeleteAudit(inAuditId)
{
    var agree=ConfirmModal("DELETE_AUDIT_CONFIRMATION");
    if (agree)
	    window.location = 'ORG_Audit_Creer.aspx?auditId='+inAuditId+'&action=Delete';    
}

function openExportPersonnelAuditsWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExportPersonnelAudits.aspx?'+paramGet, 'window', 'width=800,height=350');
	
}

function openExportInstanceAuditsWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../Export/ExportInstanceAudits.aspx?'+paramGet, 'window', 'width=800,height=350');
	
}

function openAuditFncWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/AjoutAuditFnc.aspx?'+paramGet, window, 'dialogWidth:800px;dialogHeight:500px;');	
}

function DeleteFnc(inFncId)
{
    var agree=ConfirmModal("DELETE_FNC_CONFIRMATION");
    if (agree)
	    window.location = 'ORG_Fnc_Creer.aspx?fncId='+inFncId+'&action=Delete';    
}


function openFncToAuditWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.showModalDialog('../PopUp/AjoutFncToAudit.aspx?'+paramGet, window, 'dialogWidth:800px;dialogHeight:500px;');	
}


function openFncPrintWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	//ChildWindow = window.open('../PopUp/PrintFnc.aspx?'+paramGet, 'window', 'width=810,height=810');
	//alert("remarque : status=yes,toolbar=no,menubar=yes,location=no,scrollbars=auto,resizable=yes");
	ChildWindow = window.open("../PopUp/PrintFnc.aspx?"+paramGet,"FncPrint","height=820,width=810, top=0, left=200,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes,resizable=yes");
	ChildWindow.print();
}
//EVOL 592
function openFncMajeurePrintWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	//ChildWindow = window.open('../PopUp/PrintFnc.aspx?'+paramGet, 'window', 'width=810,height=810');
	//alert("majeur : status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes");
	ChildWindow = window.open("../PopUp/PrintFncMajeur.aspx?"+paramGet,"FncPrint","height=820,width=810, top=0, left=200,status=yes,toolbar=no,menubar=yes,location=no,scrollbars=yes,resizable=yes");
	ChildWindow.print();
}



/* GERICCO V4*/
function DeleteUser(inUserId)
{
    // retour mantis 518 var agree=confirm("Etes vous sure de vouloir supprimer?");
    var agree=ConfirmModal("USER_CONFIRMATION_SUPPRESSION");
    if (agree)
	    window.location = 'ADM_User_Creer.aspx?userId='+inUserId+'&action=Delete';    
}

function DeleteUserFO(inUserId)
{
    var agree=ConfirmModal("FO_CONFIRMATION_SUPPRESSION_UTILISATEUR");
    if (agree)
	    window.location = 'ADM_User_FO_Creer.aspx?userId='+inUserId+'&action=Delete';    
}

function openMTFO_DossierCandidatDetailWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../PopUp/MTFO_DossierCandidatDetail.aspx?mielId='+paramGet, 'window', 'width=600,height=700,scrollbars=yes,top=1,left=420');
	
}

function openMTFO_DossierCandidatsProchesListWindow(paramGet, paramWindow){
    //paramWindow not used but put in prototype in case the param may change
	ChildWindow = window.open('../PopUp/MTFO_DossierCandidatsProchesList.aspx?mielId='+paramGet, 'window', 'width=600,height=700,scrollbars=yes,top=1,left=420');
	
}

function MTFO_ConfirmRejet(paramGet, paramGetOpener)
{
    var agree=ConfirmModal("REJET_MTFO_CONFIRMATION");
	if (agree)
	{
	    window.location = '../PopUp/MTFO_DossierCandidatDetail.aspx?' + paramGet;
	    
	    if (paramGetOpener != '')
	        window.opener.location = '../Pages/DOS_Creer.aspx?' + paramGetOpener;
	}   
}

function MTFO_ConfirmValidationCandidat(paramGet, paramGetOpener)
{
    var agree=ConfirmModal("VALIDATION_CANDIDAT_MTFO_CONFIRMATION");
	if (agree)
	{
	    window.location = '../PopUp/MTFO_DossierCandidatDetail.aspx?' + paramGet;
	    
	    if (paramGetOpener != '')
	        window.opener.location = '../Pages/DOS_Creer.aspx?' + paramGetOpener;
	}   
}

function MTFO_ConfirmValidationSociete(paramGet, paramGetOpener)
{
    var agree=ConfirmModal("VALIDATION_SOCIETE_MTFO_CONFIRMATION");
	if (agree)
	{
	    window.location = '../PopUp/MTFO_DossierCandidatDetail.aspx?' + paramGet;
	    
	    if (paramGetOpener != '')
	        window.opener.location = '../Pages/DOS_Creer.aspx?' + paramGetOpener;
	}   
}

function MTFO_ConfirmGenererDossier(paramGet, paramGetOpener)
{
    var agree=ConfirmModal("GENERER_DOSSIER_MTFO_CONFIRMATION");
	if (agree)
	{
	    window.location = '../PopUp/MTFO_DossierCandidatDetail.aspx?' + paramGet;
	    
	    if (paramGetOpener != '')
	        window.opener.location = '../Pages/DOS_Creer.aspx?' + paramGetOpener;
	}   
}

function MTFO_ConfirmReactivationDossier(paramGet, paramGetOpener)
{
    var agree=ConfirmModal("REACTIVATION_DOSSIER_MTFO_CONFIRMATION");
	if (agree)
	{
	    window.location = '../PopUp/MTFO_DossierCandidatDetail.aspx?' + paramGet;
	    
	    if (paramGetOpener != '')
	        window.opener.location = '../Pages/DOS_Creer.aspx?' + paramGetOpener;
	}   
}

function DeleteMTFO(paramGet)
{
    var agree=ConfirmModal("DELETE_MTFO_CONFIRMATION");
    if (agree)
	    window.location = 'MTFO_DossierCandidatList.aspx?action=Delete&' + paramGet;    
}