//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
//	1:	détection du navigateur~
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

var msie, ns4, ns6,iemac,ie4,ie5,ie55,ie6;

msie = false;
ns4 = false;
ns6 = false;
iemac = false;	        
ie4 = false;							 
ie5 = false;
ie55 = false;
ie6 = false;			     

var nVer = navigator.appVersion;
var nAgt = navigator.userAgent.toLowerCase();
var fullVersion = parseFloat(nVer);
var majorVersion = parseInt(nVer);

if ((verOffset = nAgt.indexOf("msie"))!=-1) // In Internet Explorer, the true version is after "MSIE"
{
	fullVersion = parseFloat(nAgt.substring(verOffset + 5,nAgt.length));
	majorVersion = parseInt('' + fullVersion);
}
else if ((verOffset = nAgt.indexOf("opera"))!=-1) // In Opera, the true version is after "Opera"
{
	fullVersion = parseFloat(nAgt.substring(verOffset+6,nAgt.length));
	majorVersion = parseInt('' + fullVersion);
}

if (navigator.appName == "Microsoft Internet Explorer"){
	msie = true;
	if (majorVersion >= 4)
	{
		if (nAgt.indexOf("msie 4.0")!=-1){ie4 = true;}
		if (nAgt.indexOf("msie 5.0")!=-1){ie5 = true;}
		if (nAgt.indexOf("msie 5.5")!=-1){ie55 = true;}
		if (nAgt.indexOf("msie 6.")!=-1){ie6 = true;}
	}
	
	if (navigator.appVersion.indexOf("Mac")!=-1){iemac = true;}
}
else if (navigator.appName == "Netscape")
{
	ns6 = parseInt(navigator.appVersion) >= 5;
	ns4 = parseInt(navigator.appVersion) < 5;
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//	2:	Boite de dialog modal pour ameliorer la fct confirm javascript						
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



//Boite de dialog modale, remplace le alert en javascript									
function AlertBox(message,Width,Height)
{
	return alert(message);

/*
	if (navigator.appName=="Microsoft Internet Explorer")
	{
		if (!(Height)) Height=160;
		if (!(Width)){
			Width=250;
			if (message.length>50)	
				Width+=message.length*3;
		}
		while ((valeur = window.showModalDialog('/commun/eplugs/AlertBox.asp?message=' + escape(message),'','dialogHeight:' + Height + 'px;dialogWidth:'+Width+'px;status:no;scroll:auto;help:no')) == null) {}
		return valeur;
	} else {
		return alert(message);
	}
	*/
}

//AlertMsg()																				
function AlertMsg(myTab,intIndex)
{
	var Chaine = myTab[intIdLangue][intIndex];
 	var ReplaceString;
	var SearchString;

 	if (AlertMsg.arguments.length > 2){
	
		 for(var CptArgs = 1; CptArgs <= AlertMsg.arguments.length -2; CptArgs++){		 
		 	SearchString = '%' + CptArgs.toString();		
		 	ReplaceString = AlertMsg.arguments[CptArgs+1];		
			Chaine = Replace(Chaine,SearchString,ReplaceString);		
		 }
	}
	alert(Chaine);
	return true;
}

// Boite de dialog modale, remplace le confirm en javascript								
function PrevenirBox(message,Width,Height){
	return ConfirmBox(message,Width,Height);
}


// Boite de dialog modale, remplace le confirm en javascript								
function ConfirmBox(message,Width,Height)
{
return confirm(message);
	/*if (navigator.appName=="Microsoft Internet Explorer")
	{
		var Width=250;
		if (message.length>50)
		{
			Width+=message.length*3;
		}
		while ((valeur = window.showModalDialog('/commun/eplugs/MessageBox.asp?message=' + escape(message),'','dialogHeight:160px;dialogWidth:'+Width+'px;status:no;scroll:auto;help:no')) == null) {}
		return valeur;
	}
	else return confirm(message);	*/
}



// Boite de dialog modale, remplace le prompt en javascript
function PromptBox(message)
{
	return prompt(message, "");
	/*if (navigator.appName=="Microsoft Internet Explorer") {
		var Width=250;
		if (message.length>50)
		{
			Width+=message.length*3;
		}
		return window.showModalDialog('/commun/eplugs/PromptBox.asp?message=' + escape(message),'','dialogHeight:160px;dialogWidth:'+Width+'px;status:no;scroll:auto;help:no');
	}
	else return prompt(message, "");*/
}

//Fonction d'appel de Visualisation de Cube OLAP											
function VisCub(NomSvr,NomBdd,NomCub,AdmCub)
{
	if (NomSvr==null || NomSvr=='') {NomSvr='localhost';}
	if (AdmCub==null || AdmCub=='') {AdmCub='False';}
	OpenW('/Eplug/Decision/OLAP/default.asp?NomSvr='+NomSvr +'&NomBdd='+NomBdd+'&NomCub='+NomCub+'&AdmCub='+AdmCub,'WinVisCub',0,0,'status=no,toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes');
}

//Fonction de visualisation des cubes OLAP par interface OWC
function VisuCubeOWC(idCube) 
{
	OpenW('/OPDOTNET/Eplug/Reporting/OLAP/visu/visuOWC.aspx?idCube='+idCube ,'visu',800,600,'status=no,toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes');
}

//Sélection d'un Document																	
function DocSel(IdAppliSource, FctDes, SelectMode,ListeApplisSel,ThemesSel,SelGroupe){

	var lstParametre = '/OpDotnet/commun/Login/aspxtoasp.aspx?IdApplication=118&TypeAcces=utilisateur&titreSel=Selection de Document&modeSel=user&IdGroupeSel=&fermetureSel=auto&idUser=';
	
	if (IdAppliSource){lstParametre += '&IdAppliSource=' + IdAppliSource}
	if (FctDes){lstParametre += '&SourceSel=window.opener.'+ FctDes}	
	if (SelectMode){lstParametre += '&SelectMode='+ SelectMode}		
	if (ListeApplisSel){lstParametre += '&ListeApplisSel='+ ListeApplisSel}		
	if (ThemesSel){lstParametre += '&ThemesSel='+ ThemesSel}		
	
	if (SelGroupe==null) {SelGroupe='0';}
	if (SelGroupe=='true') {
		SelGroupe='1';
	}else{
		SelGroupe='0';
	}
	if (SelGroupe){lstParametre += '&SelGroupe='+ SelGroupe}		
		
	
	lstParametre += '&url=/Eplug/infomediaire/site/Annexe/Selecteur/Selecteur.asp';
	
	var WinSelDoc=OpenW(lstParametre,'WinSelDoc',700,500,'');
}
//Visualisation d'un document																
function DocVis(NumDoc, NumApp,Origine){

	var lstParametre = '/OpDotnet/commun/Login/aspxtoasp.aspx?IdInfo='+NumDoc+'&IdApplication=118&TypeAcces=Utilisateur';
	
	lstParametre += (Origine)?'&Origine='+Origine:'&Origine=moteurvam'
	if (NumApp){lstParametre +='&IdAppliSource='+NumApp}
	
	lstParametre += '&url=/eplug/infomediaire/site/utilisateur/visualiser/visualiser.asp';
	
	var WinVisDoc=OpenW(lstParametre,'WinVisDoc',0,0,'');
}
//Sélection d'G3P																			
function SelObjet3P(ObjetDest,FonctionFin,AppliSrc,Multiple,Activites,Actions,LstCod,LstVal)
{
	var AppliDes='199';
	if (ObjetDest==null) { ObjetDest=''; }
	if (FonctionFin==null) { FonctionFin=''; }
	if (AppliSrc==null) { AppliSrc=''; AppliDes=''; }
	if (Activites==null) { Activites=''; }
	if (Actions==null) { Actions=''; }
	if (Multiple==null) { Multiple=''; }
	if (LstCod==null) { LstCod=''; }
	if (LstVal==null) { LstVal=''; }
	var WinG3p=OpenW('/OpDotNet/Eplug/Planification/Commun/Selection.aspx?ObjetDest='+ObjetDest+'&FonctionFin='+FonctionFin+'&Activites='+Activites+'&Multiple='+Multiple+'&Actions='+Actions+'&LstCod='+LstCod+'&LstVal='+LstVal+'&IdApplication='+AppliDes+'&IdAppliSource='+AppliSrc+'&TypeAcces=Utilisateur','WinG3p',640,0,'');
}
//Sélection d'un Projet																		
function SelProjet(ObjetDest,FonctionFin,AppliSrc,LstCod,LstVal)
{
	SelObjet3P(ObjetDest,FonctionFin,AppliSrc,'OUI',null,null,LstCod,LstVal);
}
//Sélection d'une Activité																	
function SelActivite(ObjetDest,FonctionFin,AppliSrc)
{
	SelObjet3P(ObjetDest,FonctionFin,AppliSrc,'NON','OUI');
}
//Sélection d'un Module FPC																	
//Sélection d'un Module FPC																	
function SelModuleFpc(TypRef,Insertion,AppliSrc,IdVue,IdElementCible)
{
	var AppliDes='141';
	if (TypRef==null) { TypRef='FPC'; }
//	TypRef +=',FPC';
//	IdElementCible=1357;
	if (Insertion==null) { Insertion='simple'; }
	if (IdVue==null) { IdVue=''; }
	if (IdElementCible==null) { IdElementCible=''; }
	if (AppliSrc==null) { AppliSrc=''; AppliDes=''; }
	var WinFpc=OpenW('/opdotnet/eplug/fpc/commun/Page/Liens/SelectLiens.aspx?IdApplication='+AppliDes+'&IdAppliSource='+AppliSrc+'&TypeAcces=Animateur&Insertion='+Insertion+'&TypeReferentielLien='+TypRef+'&IdVue='+IdVue+'&IdElementCible='+IdElementCible+'&CataloguesCreation=OFL','WinFpc',800,600,'');
}

// Sélection d'inscription RF					
// JSFctName : Fonction javascript de retour
// AppliSrc : Identifiant de l'application source
// TypeInfo : Type de l'information de l'inscription que l'on souhaite recevoir
// idProcess : identifiant du process											
function SelInscriptionRF(JSFctName,AppliSrc,TypeInfo,idProcess)
{
	var AppliDes = '199';
	if (JSFctName == null) { JSFctName = ''; }
	if (AppliSrc == null) { AppliSrc = ''; AppliDes = ''; }
	if (TypeInfo == null) { TypeInfo = ''; }
	if (idProcess == null) { idProcess = ''; }
	var WinInsRF = OpenW('/OpDotNet/Eplug/Planification/Commun/SelectionInscription.aspx?intIdProcess=' + idProcess + '&NameFct=' + JSFctName + '&strTypeInfo=' + TypeInfo + '&IdApplication=' + AppliDes + '&IdAppliSource=' + AppliSrc + '&TypeAcces=Utilisateur','WinSelInsRf',800,600,'');
}

//Création/Modification d'un Evénement																			
function ModEve(NumEve,NomCal,NumGrp,Inutile,NumApp,TypAcc,DatSrc)
{
	if (NumApp==null) {NumApp='';}
	if (NumEve==null) {NumEve='';}
	if (NomCal==null) {NomCal='';}
	if (NumGrp==null) {NumGrp='';}
	if (TypAcc==null) {TypAcc='';}
	if (DatSrc==null) {DatSrc='';}
	var WinModEve=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?IdApplication=190&IdApplisource='+NumApp+'&TypeAcces='+TypAcc+'&NumEve='+NumEve+'&NomCal='+NomCal+'&DatSrc='+DatSrc+'&url=/EPlug/Agenda/Eve-Mod.asp','WinModEve',800,0,'');
}

//Fonction de Sélection d'un Agenda															
function SelCal(NomDes,FctFin,NumApp,TypAcc,Multip)
{
	if (NomDes==null) {NomDes='';}
	if (FctFin==null) {FctFin='';}
	if (TypAcc==null || TypAcc=='') {TypAcc='Utilisateur';}
	if (NumApp==null || NumApp=='') {NumApp='';}
	if (Multip==null) {Multip='OUI';}
	var WinSelCal=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?NomDes='+NomDes+'&FctFin='+FctFin+'&Multip='+Multip+'&IdApplication=190&TypeAcces='+TypAcc+'&IdAppliSource='+NumApp+'&url=/EPlug/Agenda/Commun/SelCal.asp','WinSelCal',640,0,'');
}

//Fonction de Visualisation d'un Agenda														
function VisCal(NomCal)
{
	if (NomCal==null) {NomCal='';}
	var WinVisCal=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?NomCal='+NomCal+'&IdApplication=190&TypeAcces=Utilisateur&url=/EPlug/Agenda/Agenda.asp','WinVisCal',0,0,'');
}

//Recherche de Ressource																						
function RecRes(NumGrp,NomDes,FctFin,TypRes,DatDis,DebDis,FinDis,SetDat,NumApp,HorSem,TypAcc)
{
	if (NumApp==null) {NumApp='';}
	if (TypAcc==null) {TypAcc='';}
	if (HorSem==null) {HorSem='';}
	if (NumGrp==null) {NumGrp='';}
	if (NomDes==null) {NomDes='';}
	if (FctFin==null) {FctFin='';}
	if (TypRes==null) {TypRes='';}
	if (DatDis==null) {DatDis='';}
	if (DebDis==null) {DebDis='';}
	if (FinDis==null) {FinDis='';}
	if (SetDat==null) {SetDat='';}
	var WinRecRes=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?url=/Eplug/Agenda/Commun/RecRes.asp&IdApplication=190&IdApplisource='+NumApp+'&TypeAcces='+TypAcc+'&NomDes='+NomDes+'&FctFin='+FctFin+'&TypRes='+TypRes+'&DatDis='+DatDis+'&DebDis='+DebDis+'&FinDis='+FinDis+'&SetDat='+SetDat+'&HorSem='+HorSem,'WinRecRes',640,0,'');
	//var WinRecRes=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?IdApplication=190&IdAppliSource='+NumApp+'&TypeAcces='+TypAcc+'&NomDes='+NomDes+'&FctFin='+FctFin+'&TypRes='+TypRes+'&DatDis='+DatDis+'&DebDis='+DebDis+'&FinDis='+FinDis+'&SetDat='+SetDat+'&HorSem='+HorSem+'&url=/EPlug/Agenda/Commun/RecRes.asp','WinRecRes',640,0,'');
}

//Visualisation d'une Ressource																					
function VisRes(NumRes,NumApp,TypAcc)
{
	if (NumApp==null) {NumApp='';}
	if (TypAcc==null) {TypAcc='';}
	var WinVisRes=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?IdApplication=190&IdApplisource='+NumApp+'&TypeAcces='+TypAcc+'&NumRes='+NumRes+'&url=/Eplug/Agenda/Ressources/Vis-Res.asp','WinVisRes',640,0,'');
}
//Fonction de Sélection d'une Ressource														
function SelTypRes(NomDes,FctFin,Multip,NumApp)
{
	var AppDes='190';
	if (NomDes==null) {NomDes='';}
	if (FctFin==null) {FctFin='';}
	if (Multip==null) {Multip='';}
	if (NumApp==null) {NumApp='';AppDes='';}
	var WinSelRes=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?NomDes='+NomDes+'&FctFin='+FctFin+'&Multip='+Multip+'&IdAppliSource='+NumApp+'&IdApplication='+AppDes+'&TypeAcces=Utilisateur&url=/Eplug/Agenda/Commun/SelTypRes.asp','WinSelTypRes',640,0,'');
}
//Fonction de Sélection d'une Ressource														
function SelTypEve(NomDes,FctFin,Multip,NumApp)
{
	var AppDes='190';
	if (NomDes==null) {NomDes='';}
	if (FctFin==null) {FctFin='';}
	if (Multip==null) {Multip='';}
	if (NumApp==null) {NumApp='';AppDes='';}
	var WinSelRes=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?NomDes='+NomDes+'&FctFin='+FctFin+'&Multip='+Multip+'&IdAppliSource='+NumApp+'&IdApplication='+AppDes+'&TypeAcces=Utilisateur&url=/Eplug/Agenda/Commun/SelTypEve.asp','WinSelTypEve',640,0,'');
}
//Fonction de Sélection d'une Ressource														
function SelRes(NomDes,FctFin,Multip,NumApp,TypAcc,NumGrp)
{
	OldApp='190';
	if (NomDes==null) {NomDes='';}
	if (FctFin==null) {FctFin='';}
	if (Multip==null) {Multip='';}
	if (NumApp==null) {NumApp='';OldApp='';}
	if (TypAcc==null) {TypAcc='';}
	if (NumGrp==null) {NumGrp='';}
	var WinSelRes=OpenW('/OpDotnet/commun/Login/aspxtoasp.aspx?NomDes='+NomDes+'&FctFin='+FctFin+'&Multip='+Multip+'&IdAppliSource='+NumApp+'&TypeAcces='+TypAcc+'&IdApplication='+OldApp+'&NumGrp='+NumGrp+'&url=/Eplug/Agenda/Commun/SelRes.asp','WinSelRes',640,0,'');
}

//Lance la Fiche d'un Utilisateur de l'Annuaire 											
function showUsrFiche(NumUsr,IdAppliSource,TypeAcces,NumAnn,NumPro,AccesPerso)
{
	if (NumAnn==null){NumAnn='';}
	if (NumPro==null){NumPro='';}
	if (AccesPerso==null){AccesPerso=false;}
	var NumApp='';
	if (IdAppliSource==null || IdAppliSource=='0' || IdAppliSource=='142')
	{
		var WinUsr=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdObjet='+NumUsr+'&IdTypeObjet=25&IdAnn='+NumAnn+'&IdProfil='+NumPro+'&AccesPerso='+AccesPerso,'WinUsr',0,0,'');
	} else {
		var WinUsr=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdObjet='+NumUsr+'&IdTypeObjet=25&IdApplication=142&TypeAcces=Utilisateur&IdAnn='+NumAnn+'&IdProfil='+NumPro+'&IdAppliSource='+IdAppliSource+'&AccesPerso='+AccesPerso,'WinUsr',0,0,'');
	}
}

//Changement de la photo																		
function modPhoto(idUser)
{
		var WinModPhoto=OpenW('/OpDotNet/eplug/Annuaire/Admin/PhotoMod.aspx?intIdUtilisateur='+idUser,'WinModPhoto',640,480,'');
}

//Chargement de la Fiche d'un Utilisateur														
function VisUser(NumUsr,IdAppliSource,TypeAcces,NumAnn,NumPro,AccesPerso)
{
	showUsrDossier(NumUsr,IdAppliSource,TypeAcces,NumAnn,NumPro,AccesPerso);
} 

//Lance le Dossier d'un Utilisateur de l'Annuaire 												
function showUsrDossier(NumUsr,IdAppliSource,TypeAcces,NumAnn,NumPro,AccesPerso)
{
	if (NumAnn==null){NumAnn='';}
	if (NumPro==null){NumPro='';}
	if (AccesPerso==null){AccesPerso=false;}
	if (TypeAcces==null || TypeAcces==''){	
		if (IdAppliSource!=null && IdAppliSource == 'Portail'){TypeAcces='Portail';}
		else{TypeAcces='Utilisateur';}
	}	
	
	var NumApp='';
	if (IdAppliSource==null || IdAppliSource=='0' || IdAppliSource=='142'){
		//var WinUsr=OpenW('/OpDotNet/eplug/Annuaire/DossierPerso.aspx?intIdUtilisateur='+NumUsr+'&IdAnn='+NumAnn+'&IdProfil='+NumPro,'WinUsr',0,0,'');
		var WinUsr=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdObjet='+NumUsr+'&IdTypeObjet=25&IdAnn='+NumAnn+'&IdProfil='+NumPro+'&AccesPerso='+AccesPerso,'WinUsr'+NumUsr,0,0,'');
	} else {
		//alert(TypeAcces + '--' + IdAppliSource);
		//var WinUsr=OpenW('/OpDotNet/eplug/Annuaire/DossierPerso.aspx?intIdUtilisateur='+NumUsr+'&IdApplication=142&TypeAcces='+TypeAcces+'&IdAnn='+NumAnn+'&IdProfil='+NumPro+'&IdAppliSource='+IdAppliSource,'WinUsr',0,0,'');
		var WinUsr=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdObjet='+NumUsr+'&IdTypeObjet=25&IdApplication=142&TypeAcces='+TypeAcces+'&IdAnn='+NumAnn+'&IdProfil='+NumPro+'&IdAppliSource='+IdAppliSource+'&AccesPerso='+AccesPerso,'WinUsr'+NumUsr,0,0,'');
	}	
}

//Chargement de la Fiche d'un Organisme															
function showOrgFiche(NumOrg,mode,IdAppliSource,AccesPerso)
{
	if (mode==""){mode = "VIS"}
	if (AccesPerso==null) {AccesPerso=false;}
	if (IdAppliSource==null || IdAppliSource=='0' || IdAppliSource=='142')
	{
		var WinModOrg=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdObjet='+NumOrg+'&IdTypeObjet=28&mode='+mode+'&AccesPerso='+AccesPerso,'WinModOrg',0,0,'');
	} else {
		var WinModOrg=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdObjet='+NumOrg+'&IdTypeObjet=28&mode='+mode+'&IdApplication=142&TypeAcces=Utilisateur&IdAppliSource='+IdAppliSource+'&AccesPerso='+AccesPerso,'WinModOrg',0,0,'');
	}
}

//Chargement du Dossier de l'Organisme															
function showOrgDossier(NumOrg,mode,IdAppliSource,IdAnn,IdProfil,AccesPerso)
{
	if (NumOrg==-1){return false;}
	if (mode==""){mode = "VIS"}
	if (AccesPerso==null) {AccesPerso=false;}
	if (IdAppliSource==null || IdAppliSource=='0' || IdAppliSource=='142')
	{
		//var WinModOrgDossier=OpenW('/OpDotNet/eplug/Annuaire/DossierOrg.aspx?intIdOrganisme='+NumOrg+'&mode='+mode,'WinModOrgDossier',0,0,'');
		if (IdAnn=="" || IdAnn==null )
			var WinModOrgDossier=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdObjet='+NumOrg+'&IdTypeObjet=28&mode='+mode+'&AccesPerso='+AccesPerso,'WinModOrgDossier'+NumOrg,0,0,'');
		else if (IdProfil=="" || IdProfil==null)
			var WinModOrgDossier=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdAnn='+IdAnn+'&IdObjet='+NumOrg+'&IdTypeObjet=28&mode='+mode+'&AccesPerso='+AccesPerso,'WinModOrgDossier'+NumOrg,0,0,'');			
		else
			var WinModOrgDossier=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdProfil='+IdProfil+'&IdAnn='+IdAnn+'&IdObjet='+NumOrg+'&IdTypeObjet=ORG&mode='+mode+'&AccesPerso='+AccesPerso,'WinModOrgDossier'+NumOrg,0,0,'');						
		
	} else {
		//var WinModOrgDossier=OpenW('/OpDotNet/eplug/Annuaire/DossierOrg.aspx?intIdOrganisme='+NumOrg+'&mode='+mode+'&IdApplication=142&TypeAcces=Utilisateur&IdAppliSource='+IdAppliSource,'WinModOrgDossier',0,0,'');
		if (IdAnn=="" || IdAnn==null )
			var WinModOrgDossier=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdObjet='+NumOrg+'&IdTypeObjet=28&mode='+mode+'&IdApplication=142&TypeAcces=Utilisateur&IdAppliSource='+IdAppliSource+'&AccesPerso='+AccesPerso,'WinModOrgDossier'+NumOrg,0,0,'');
		else if (IdProfil=="" || IdProfil==null)
			var WinModOrgDossier=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdAnn='+IdAnn+'&IdObjet='+NumOrg+'&IdTypeObjet=28&mode='+mode+'&IdApplication=142&TypeAcces=Utilisateur&IdAppliSource='+IdAppliSource+'&AccesPerso='+AccesPerso,'WinModOrgDossier'+NumOrg,0,0,'');
		else
			var WinModOrgDossier=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Dossier/Dossier.aspx?IdProfil='+IdProfil+'&IdAnn='+IdAnn+'&IdObjet='+NumOrg+'&IdTypeObjet=28&mode='+mode+'&IdApplication=142&TypeAcces=Utilisateur&IdAppliSource='+IdAppliSource+'&AccesPerso='+AccesPerso,'WinModOrgDossier'+NumOrg,0,0,'');		
	}
}

//Chargement de la Fiche de la Fonction															
function showFctFiche(NumFct,mode)
{
	if (mode==""){mode = "VIS"}
	var WinModFct=OpenW('/OpDotNet/eplug/Annuaire/FicheRel.aspx?IdRelation='+NumFct+'&mode='+mode,'WinModFct',640,480,'');
}

//Chargement de la fiche de la Catégorie														
function showCatFiche(NumCat,mode,idTypeObjet)
{
	if (mode==""){mode = "VIS"}
	if (idTypeObjet==""||idTypeObjet==null){idTypeObjet="28"}
	var WinModCat=OpenW('/OpDotNet/eplug/Annuaire/FicheCat.aspx?IdCategorie='+NumCat+'&mode='+mode+'&idTypeObjet='+idTypeObjet,'WinModCat',640,480,'');
}

function selVues(FctDes, Multi, IdGroupe, IdAppliSource, TypeAcces,TypeVue) {
	// Fonction de lancement de l'assistant de sélection de vues.
	
	//?
	if (! Multi) Multi = 'true'; 
	if (! IdGroupe) IdGroupe = ''; 
	if (! TypeVue) TypeVue = ''; 
	var AppAcces;
	if (IdAppliSource) {
		if (! TypeAcces) { TypeAcces = 'Administrateur'; }
		AppAcces = '&IdApplication=101&IdAppliSource=' + IdAppliSource + '&TypeAcces=' + TypeAcces;
	} else {
		AppAcces = '';
	}
	OpenW("/opdotnet/Commun/UserControls/Noyau/Vues/pgChoixVues.aspx?FctDes=" + FctDes + '&Multi=' + Multi + '&TypeVue=' + TypeVue + "&IdGroupe=" + IdGroupe + AppAcces, 'SelVueAdmin', 600, 600, 'scrollbars=no');
}

/***************************************************											
	Ouverture des pages de selection de l'annuaire												
***************************************************/

//Choix d'une personne																			
// modes existant	: SELUSRORG ou vide															
//		JSFCTName	: nom de la fonction js à appeler en retour	
function SelUser(mode,JSFCTName,InpDes,SelDes,FctDes,FctFin,AffCon,Listes,NumApp,TypAcc,Multip,FctDesPlus,AccesPerso,IdAnn)
{	

	if (InpDes==null) {InpDes='';}
	if (SelDes==null) {SelDes='';}
	if (FctDes==null) {FctDes='';}
	if (FctDesPlus==null) {FctDesPlus='';}
	if (FctFin==null) {FctFin='';}
	if (AffCon==null || AffCon=='') {AffCon='OUI';}
	if (Listes==null || Listes=='') {Listes='OUI';}
	if (NumApp==null) {NumApp='';}
	if (TypAcc==null) {TypAcc='Utilisateur';}
	if (Multip==null) {Multip='OUI';}
	if (mode==null) {mode='';}
	if (IdAnn==null){
		IdAnn='';
	}
	else{
		IdAnn="&IdAnn=" + IdAnn;
	}	
	
	if (AccesPerso==null) {AccesPerso=false;}
	
	if (mode.toLowerCase().indexOf('selusrorgintra')>-1){
		
		var WinSelUser=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Navigation.aspx?IdTypeObjetNav=28&Wizard=cc2cab04-54c3-444c-9fa2-98419d773c6b&mode='+mode+'&JSFCTName='+JSFCTName+'&FctDes='+FctDes+'&FctDesPlus='+FctDesPlus+'&InpDes='+InpDes+'&SelDes='+SelDes+'&FctFin='+FctFin+'&Multip='+ Multip + '&IdApplication=142&TypeAcces=' + TypAcc + '&IdAppliSource=' + NumApp+'&AccesPerso='+AccesPerso+IdAnn,'WinSelUser',0,0,''); 
		
	}else if (NumApp != ''){
		var WinSelUser=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Navigation.aspx?IdTypeObjetNav=25&Wizard=cc2cab04-54c3-444c-9fa2-98419d773c6b&mode='+mode+'&JSFCTName='+JSFCTName+'&FctDes='+FctDes+'&FctDesPlus='+FctDesPlus+'&InpDes='+InpDes+'&SelDes='+SelDes+'&FctFin='+FctFin+'&Multip='+ Multip + '&IdApplication=142&TypeAcces=' + TypAcc + '&IdAppliSource=' + NumApp+'&AccesPerso='+AccesPerso+IdAnn,'WinSelUser',0,0,''); 
	}else{
		var WinSelUser=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Navigation.aspx?IdTypeObjetNav=25&Wizard=8415d519-41f8-409c-a82a-96bb5616468d&mode='+mode+'&JSFCTName='+JSFCTName+'&FctDes='+FctDes+'&FctDesPlus='+FctDesPlus+'&InpDes='+InpDes+'&SelDes='+SelDes+'&FctFin='+FctFin+'&Multip='+Multip+'&AccesPerso='+AccesPerso+IdAnn,'WinSelUser',0,0,'');
	}
	//var WinSelUser=OpenW('/OpDotNet/eplug/Annuaire/Admin/Ann3Frames.aspx?page=SelUser&mode='+mode+'&JSFCTName='+JSFCTName+'&FctDes='+FctDes+'InpDes='+InpDes+'&SelDes='+SelDes+'&FctFin='+FctFin+'&IdApplication=142&TypeAcces=Utilisateur','WinSelUser',0,0,'');
			
}

//Fonction de Sélection d'un Organisme															
function SelFctOrg(FctDes,DebOrg,FctAct,CatAct,Multip,NumApp,TypAcc,NumAnn,FctFin,Mode,IdNoeud,AccesPerso,IdAnn,InpDes,SelDes)
{
	//if (FctDes==null) {FctDes='AddFctOrg';}
	if (FctDes==null) {FctDes='';}
	if (DebOrg==null) {DebOrg='0';}
	if (FctAct==null) {FctAct='OUI';}
	if (CatAct==null) {CatAct='OUI';}
	if (Multip==null) {Multip='NON';}
	if (TypAcc==null) {TypAcc='Utilisateur';}
	if (NumApp==null) {NumApp='';TypAcc='';}
	if (NumAnn==null) {NumAnn='';}
	if (FctFin==null) {FctFin='';}
	if (Mode==null) {Mode='VIS';}
	if (AccesPerso==null) {AccesPerso=false;}
	
	if (IdAnn==null){
		IdAnn='';
	}
	else{
		IdAnn="&IdAnn=" + IdAnn;
	}	
	
	if (InpDes==null) {InpDes='';}
	if (SelDes==null) {SelDes='';}

	var paramNd = ''
	if (IdNoeud!=null&&IdNoeud!='') { paramNd='&IdNoeud=' + IdNoeud;}
	
	if (NumApp != ''){
		var WinSelFctOrg=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Navigation.aspx?IdTypeObjetNav=28&Wizard=dd78b732-433e-4ed8-9874-da2f26123fd9&FctDes='+FctDes+'&InpDes='+InpDes+'&SelDes='+SelDes+'&DebOrg='+DebOrg+'&FctAct='+FctAct+'&CatAct='+CatAct+'&Multip='+Multip+'&NumAnn='+NumAnn+'&IdAppliSource='+NumApp+'&TypeAcces='+TypAcc+'&IdApplication=142&FctFin='+FctFin+'&Mode='+Mode+paramNd+'&AccesPerso='+AccesPerso+IdAnn,'WinSelFctOrg',0,0,'');
	}else{
		var WinSelFctOrg=OpenW('/OpDotNet/eplug/Annuaire/Navigation/Navigation.aspx?IdTypeObjetNav=28&Wizard=dd78b732-433e-4ed8-9874-da2f26123fd9&FctDes='+FctDes+'&InpDes='+InpDes+'&SelDes='+SelDes+'&DebOrg='+DebOrg+'&FctAct='+FctAct+'&CatAct='+CatAct+'&Multip='+Multip+'&NumAnn='+NumAnn+'&FctFin='+FctFin+'&Mode='+Mode+paramNd+'&AccesPerso='+AccesPerso+IdAnn,'WinSelFctOrg',0,0,'');
	}
}

//Fonction de Sélection d'une Fonction															
function SelFct(FctDes,FctFin,NumApp,AccesPerso)
{
	//if (FctDes==null) {FctDes='AddFct';}
	if (FctDes==null) {FctDes='';}
	if (FctFin==null) {FctFin='';}
	if (NumApp==null) {NumApp='';}
	
	if (NumApp != ''){
		var WinAddFct=OpenW('/OpDotNet/eplug/Annuaire/Fonctions/Wizards/Selection/Selection.aspx?IdType=38&Wizard=dd78b732-433e-4ed8-9874-da2f26123fd9&FctDes='+FctDes+'&FctFin='+FctFin+'&IdAppliSource='+NumApp+'&TypeAcces=Utilisateur&IdApplication=142&AccesPerso='+AccesPerso,'WinAddFct',640,0,'');
	}else{
		var WinAddFct=OpenW('/OpDotNet/eplug/Annuaire/Fonctions/Wizards/Selection/Selection.aspx?IdType=38&Wizard=dd78b732-433e-4ed8-9874-da2f26123fd9&FctDes='+FctDes+'&FctFin='+FctFin+'&AccesPerso='+AccesPerso,'WinAddFct',640,0,'');
	}
}

//Sélection d'un profil																			
function SelProfil(Dest,NumApp)
{	
	if (Dest==null) {Dest='';}
	if (NumApp==null) {NumApp='';}
	
	if (NumApp != ''){
		var WinAddPro = OpenW('/OpDOtNet/eplug/Annuaire/Admin/AnnAddProfil.aspx?mode=Selprofil&Dest=' + Dest + '&IdApplication=142&TypeAcces=Utilisateur&IdAppliSource=' + NumApp,'WinAddPro',640,0,'');		
	}else{
		var WinAddPro = OpenW('/OpDOtNet/eplug/Annuaire/Admin/AnnAddProfil.aspx?mode=Selprofil&Dest=' + Dest,'WinAddPro',640,0,'');
	}
	//var WinSelUser=OpenW('/OpDotNet/eplug/Annuaire/Admin/Ann3Frames.aspx?page=SelUser&mode='+mode+'&JSFCTName='+JSFCTName+'&FctDes='+FctDes+'InpDes='+InpDes+'&SelDes='+SelDes+'&FctFin='+FctFin+'&IdApplication=142&TypeAcces=Utilisateur','WinSelUser',0,0,'');

}

//selection d'un profil (interface admin V3)
function selProfil(FctDes,NumApp,TypeAcces){
	
	if (NumApp==null) {NumApp='';}
	if (TypeAcces==null) {TypeAcces='';}
	
	if (NumApp != '' && TypeAcces!='' ){
		OpenW("/opdotnet/eplug/Administration/profils/selProfil.aspx?FctDes=" + FctDes + '&IdApplication=101&TypeAcces=' + TypeAcces + '&IdAppliSource=' + NumApp ,'SelPAdmin',600,600,'scrollbars=no');
	}else{
		OpenW("/opdotnet/eplug/Administration/profils/selProfil.aspx?FctDes=" + FctDes ,'SelPAdmin',600,600,'scrollbars=no');
	}
}

//Sélection d'un Groupe ou Profil																
function SelGrpPro(Dest,NumApp,FctFin)
{	
	if (Dest==null) {Dest='';}
	if (FctFin==null) {FctFin='';}	
	if (NumApp==null) {NumApp='';}
	
	if (NumApp != ''){
		var WinAddPro = OpenW('/OpDOtNet/eplug/Annuaire/Admin/AnnAddProfil.aspx?mode=SelGroupeProfil&Dest=' + Dest + '&FctFin='+ FctFin +'&IdApplication=142&TypeAcces=Utilisateur&IdAppliSource=' + NumApp,'WinAddPro',640,0,'');		
	}else{
		var WinAddPro = OpenW('/OpDOtNet/eplug/Annuaire/Admin/AnnAddProfil.aspx?mode=SelGroupeProfil&Dest=' + Dest + '&FctFin='+ FctFin ,'WinAddPro',640,0,'');
	}
	//var WinSelUser=OpenW('/OpDotNet/eplug/Annuaire/Admin/Ann3Frames.aspx?page=SelUser&mode='+mode+'&JSFCTName='+JSFCTName+'&FctDes='+FctDes+'InpDes='+InpDes+'&SelDes='+SelDes+'&FctFin='+FctFin+'&IdApplication=142&TypeAcces=Utilisateur','WinSelUser',0,0,'');
}

//Sélection d'un Groupe																			
function SelGrp(Dest,NumApp,FctFin)
{	
	if (Dest==null) {Dest='';}
	if (FctFin==null) {FctFin='';}	
	if (NumApp==null) {NumApp='';}
	
	if (NumApp != ''){
		var WinAddGrp = OpenW('/OpDOtNet/eplug/Annuaire/Admin/AnnAddProfil.aspx?mode=SelGrp&Dest=' + Dest + '&FctFin='+ FctFin +'&IdApplication=142&TypeAcces=Utilisateur&IdAppliSource=' + NumApp,'WinAddGrp',640,0,'');		
	}else{
		var WinAddGrp = OpenW('/OpDOtNet/eplug/Annuaire/Admin/AnnAddProfil.aspx?mode=SelGrp&Dest=' + Dest + '&FctFin='+ FctFin ,'WinAddPro',640,0,'');
	}
}				

//Fonction de Sélection dun theme de l'infomediaire	
//SelectedThemes : liste des thèmes deja sélectionnés (TODO)
//ListeThemes : Afficher seulement les thèmes parmi ceux-la
function SelTheme(FctDes,FctFin,NumApp,Multip,SelectedThemes,ListeThemes,IdGroupe,SelGroupe)
{
	//if (FctDes==null) {FctDes='AddFct';}
	if (FctDes==null) {FctDes='';}
	if (FctFin==null) {FctFin='';}
	if (NumApp==null) {NumApp='';}
	if (Multip==null) {Multip='false';}
	if (SelectedThemes==null) {SelectedThemes='';}
	if (ListeThemes==null) {ListeThemes='';}
	if (IdGroupe==null) {IdGroupe='';}
	if (SelGroupe==null) {SelGroupe='0';}
	if (SelGroupe=='true') {
		SelGroupe='1';
	}else{
		SelGroupe='0';
	}
	
	if (NumApp != ''){
		var WinSelTheme=OpenW('/OpDotNet/Commun/Assistant/Infomediaire/SelectTheme.aspx?FctDes='+FctDes+'&FctFin='+FctFin+'&Multip='+Multip+'&SelectedThemes='+SelectedThemes+'&ListeThemes='+ListeThemes+'&Groupe='+IdGroupe+'&SelGroupe='+SelGroupe+'&IdAppliSource='+NumApp+'&TypeAcces=Utilisateur&IdApplication=118','WinSelTheme',640,480,'status=no,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=yes');
	}else{
		var WinSelTheme=OpenW('/OpDotNet/Commun/Assistant/Infomediaire/SelectTheme.aspx?FctDes='+FctDes+'&FctFin='+FctFin+'&Multip='+Multip+'&SelectedThemes='+SelectedThemes+'&ListeThemes='+ListeThemes+'&Groupe='+IdGroupe+'&SelGroupe='+SelGroupe,'WinSelTheme',640,480,'status=no,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=yes');
	}
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Sélection d'une info dans le portail
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function selectPortailInfo(IdGroupe,FctDes){
	var WinSelInfo = OpenW('/opdotnet/eplug/portail/admin/commun/selectPAve.aspx?intIdGroupe=' + IdGroupe + '&profils=&Portail=&Mode=2&FctDes=' + FctDes,'WinSelInfo',800,600,'status=no,toolbar=no,scrollbars=yes,menubar=no,location=no,resizable=yes');
}

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		
//	Ouvre une fenêtre au milieu de l'écran														
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~		
function OpenW(Url,NomWin,Width,Height,Param,Top,Left)
{
	if (iemac == false && eval('window.'+ NomWin)!= null){eval('window.' + NomWin + '.close();');}
	if (Width == 0 || Width == null){Width = window.screen.availWidth-100;}
	if (Height == 0 || Height == null){Height = window.screen.availHeight-50;}
	if (Top == null && Top != 0){Top=(window.screen.availHeight/2)-(Height/2)-50;}
	if (Left == null && Left != 0){Left=(window.screen.availWidth/2)-(Width/2);}
	if (Param == '' || Param == null)
	{
		Param = 'scrollbars=1,resizable=yes';
	}
	if (Left <= 0){Left = 1}
	if (Top <= 0){Top = 1}
	eval(NomWin+'=window.open("'+Url+'","'+NomWin+'","top='+Top+',left='+Left+',width='+Width+',height='+Height+','+Param+'");');
}

function Cocher(Form,TypCoc,NomChk,NomImg,ValChk,DisabledChk)
//Coche/Décoche toutes les cases de NomForm - Typ => 1=Cocher, 0=Décocher
{
	//On regarde si une action a été spécifiée
	if (TypCoc==null)
	{
		TypCoc=2;
	} else {
		if (TypCoc!=0 && TypCoc!=1)
		{
			TypCoc=2;
		}
	}
	//On regarde si une chaine a été spécifiée
	if (NomChk==null)
	{
		NomChk='';
	}
	//On regarde si une valeur a été spécifiée
	if (ValChk==null)
	{
		ValChk='';
	}
	
	//On regarde si on doit controler tous les checkbox ou uniquement ceux non désactivés
	// si controle, DisabledChk = 1
	if (DisabledChk == null){
		DisabledChk='';
	}
	
	
	//On passe en revue tous les éléments
	for (var i=0;i<Form.elements.length;i++)
	{
		var Case=Form.elements[i];
		if (Case.type=='checkbox') {
		
			if ((NomChk=='' || Case.name.indexOf(NomChk)>=0) && (DisabledChk=='' || (DisabledChk =='1' && !Case.disabled) ))
			{
				var Valeur=Case.value;
				//Si on cherche un Checkbox qui commence par ou finit par				
				if (ValChk.indexOf('|')>=0)
				{
					Valeur='|'+Valeur+'|';
				}
				//Si on cherche les Checkbox qui ont une des valeurs de ValChk			
				if (ValChk.indexOf('#')>=0)
				{
					Valeur='#'+Valeur+'#';
				}
				if (ValChk=='' || ValChk==Valeur || (ValChk.indexOf('|')>=0 && Valeur.indexOf(ValChk)>=0) || (ValChk.indexOf('#')>=0 && ValChk.indexOf(Valeur)>=0))
				{
					if (TypCoc==0) {
						if (Case.checked==true)
						{
							Case.checked=false;
						}
					} else {
						if (TypCoc==1)
						{
							if (Case.checked==false)
							{
								Case.checked=true;
							}
						} else {
							if (Case.checked==true)
							{
								TypCoc=0;
								Case.checked=false;
							} else {
								TypCoc=1;
								Case.checked=true;
							}
						}
					}
				}
			}
		}
	}
	//On regarde si une image a été spécifiée
	if (NomImg!=null)
	{
		if (TypCoc==1)
		{
			eval("document."+NomImg+".src='/DataOp/Visuel/Icones/16x16/RienCocher.gif';");
		} else {
			eval("document."+NomImg+".src='/DataOp/Visuel/Icones/16x16/ToutCocher.gif';");
		}
	}
}

//Affiche/Cache le DIV NomDiv - Affichage est optionnel : 1=Affiche, 0=Cache				
function AffDiv(NomDiv,Affichage)
{
	var args = AffDiv.arguments;
	
	if (NomDiv == 'Patienter'){self.scroll(0,0);}
	
	var newXPos,newYPos,actionLayer,objDiv;

	if (document.getElementById || document.all)		//Si c'est un navigateur Mozilla ou ie5 et + || ie4
	{
		if (document.getElementById){objDiv = document.getElementById(NomDiv);}
		else{objDiv = document.all[NomDiv];}

		if (objDiv==null)
		{
			return;
		}
		if (Affichage != 0 && Affichage != 1){
			if (objDiv.style.visibility == 'visible'){actionLayer = 'hide';}else{actionLayer = 'show';}
		}else if (Affichage == 1){actionLayer = 'show';} else {actionLayer = 'hide';}

		if (actionLayer == 'show')
		{
			//on affiche d'abord l'élement avant de le bouger ou de calculer sa taille
			//sinon iemac rends une taille zéro et rends le replacement aléatoire
			objDiv.style.visibility = 'visible';
			objDiv.style.display = 'block';
	
			//positionnement par rapport au top et left demandés
			if (args.length == 5)
			{
				// positionnement / souris avec ou ss scrollbars
				if (args[4] == 'mouse' || args[4] == 'mouse|absolute') 
				{
					if (args[3] == 'gauche')
					{
						newXPos = window.event.clientX - objDiv.offsetWidth;
						newXPos = (newXPos<0)?0:newXPos;
						newYPos = window.event.clientY;
					}
					else
					{
						newXPos = window.event.clientX;
						newYPos  = window.event.clientY;
					}
				}
				else // positionnement / top et left
				{
					newXPos = args[3] //top
					newYPos = args[2] //left
				}					
				
				//repositionnement par rapport au scroll				
				if (args[4] != 'absolute' && args[4] != 'mouse|absolute')
				{
					newXPos = newXPos + document.body.scrollLeft;
					newXPos = newXPos.toString();// + 'px';

					newYPos = newYPos + document.body.scrollTop;
					newYPos = newYPos.toString();// + 'px';
				}
						
				objDiv.style.left = newXPos + 'px';
				objDiv.style.top = newYPos + 'px';	
			}
		}
		else
		{ 
				objDiv.style.visibility = 'hidden';
				objDiv.style.display = 'none';			
		}		

	}
	else if (document.layers) //Si c'est Netscape 4.x
	{
		objDiv = document.layers[NomDiv];
		
		if (objDiv==null)
		{
			return;
		}

		if (Affichage != 0 && Affichage != 1){
			if (objDiv.style.visibility == 'visible'){actionLayer = 'hide';}else{actionLayer = 'show';}
		}else if (Affichage == 1){actionLayer = 'show';} else {actionLayer = 'hide';}

		if (actionLayer == 'show')
		{
			objDiv.visibility = 'show';
			objDiv.display = 'block';

			//positionnement
			if (args.length == 5)
			{
				if (args[5] == 'mouse' || 'mouse|absolute') // positionnement / souris
				{
					if (args[4] == 'gauche')
					{
						newXPos = args[3].pageX - objDiv.clip.width;
						newXPos = (newXPos<0)?0:newXPos;
						newYPos = args[3].pageY;
					}
					else
					{
						newXPos = args[3].pageX;
						newYPos  = args[3].pageY;
					}					
				}
				else // positionnement / top et left
				{
					newXPos = args[3] //top
					newYPos = args[4] //left
				}
			
				//positionnement ss prise en compte des scrollbars
				//à corriger qd test avec scrollbars
				objDiv.left = newXPos;
				objDiv.top = newYPos;
			}	
		}
		else
		{
			objDiv.visibility = 'hidden';
			objDiv.display = 'none';			
		}
	}
	
	return actionLayer;
}

//Modification de la Transparence d'un Objet													
function SetTrs(NomObj,ValTrs)
{
	var ObjSty=ObjGet(NomObj); 
	if (ObjSty)
	{
		ObjSty.ValeurOpacite=ValTrs;
		ObjSty.style.opacity=(ValTrs/100);
		ObjSty.style.MozOpacity=(ValTrs/100);
		ObjSty.style.KhtmlOpacity=(ValTrs/100);
		ObjSty.style.filter="alpha(opacity="+ValTrs+")";
	}
}

//Initialisation des Coordonnées de la souris													
var XMouse = 0;
var YMouse = 0;
//Fonction de mise à jour de la position de la souris											
function SetMousePos(e)
{
	XMouse=0;
	YMouse=0;
	if((document.getElementById) && !(document.all))
	{
		XMouse=e.pageX;
		YMouse=e.pageY;
	} else {
		XMouse=event.clientX+document.body.scrollLeft;
		YMouse=event.clientY+document.body.scrollTop;
	}
	return true;
}



//	Replace(Chaine,Search,Replac)															
function Replace(Chaine,Search,Replac)
{
	if (Search==null || Search=='')
	{
		Search="\'|\"";
	}
	if (Replac==null)
	{
		Replac="\\\'";
	}
	var ExpReg=new RegExp(Search,"gi");
	return Chaine.replace(ExpReg,Replac);
}

//-----------------------------------------------------------------
//	getObj : Renvoie un objet à partir de son identifiant
//-----------------------------------------------------------------
function getObj(id, style)
{
	if (document.getElementById){ // Navigateur compatible DOM1 (Netscape 6, Explorer 5+)
		
		if (!style){return document.getElementById(id);}
		else if (document.getElementById(id) != null){
			this.obj = document.getElementById(id);
			this.style = document.getElementById(id).style;
		}
		else return null;
	}
	else if (document.all){ // DOM IE4

		if (!style){return document.all[id];}
		else if (document.all[id] != null){
			this.obj = document.all[id];
			this.style = document.all[id].style;
		}
		else return null;
	}
	else if (document.layers){ // DOM NS4 

		if (!style){return document.layers[id];}
		else if (document.layers[id] != null){
			this.obj = document.layers[id];
			this.style = document.layers[id];
		}
		else return null;		
	}
	return this;
}

//Fonction de récupération d'un Objet															
function ObjGet(NomObj)
{
	var ObjFin=null;
	if (document.getElementById)
	{
		ObjFin=document.getElementById([NomObj]);
		if (ObjFin!=null)
		{
			return ObjFin;
		}
	}
	if (document.all)
	{
		ObjFin=document.all[NomObj];
		if (ObjFin!=null)
		{
			return ObjFin;
		}
	}
	if (NomObj.indexOf('.')!=-1)
	{
		ObjFin=eval('document.'+NomObj);
		if (ObjFin!=null)
		{
			return ObjFin;
		}
	}
	var ObjFrm=eval('document.forms[0]');
	if (ObjFrm!=null)
	{
		ObjFin=eval('document.forms[0].'+NomObj);
		if (ObjFin!=null)
		{
			return ObjFin;
		} else {
			return null;
		}
	} else {
		return null;
	}
}

//Fonction de déplacement d'un Div																
function DivMov(NomDiv,XPos,YPos)
{
	var DivObj=ObjGet(NomDiv);
	if (DivObj)
	{
		if (XPos==null || XPos==-1)
		{
			XPos=XMouse+10;
			var DivWid=DivObj.offsetWidth;
			if ((XPos+DivWid)>document.body.clientWidth)
			{
				XPos-=(DivWid+20);
			}
			if (XPos<0)
			{
				XPos=0;
			}
		}
		if (YPos==null || YPos==-1)
		{
			YPos=YMouse+10;
			var DivHei=DivObj.offsetHeight;
			if ((YPos+DivHei)>document.body.clientHeight)
			{
				YPos-=(DivHei+10);
			}
			if (YPos<0)
			{
				YPos=0;
			}
		}
		DivObj.style.left=XPos;
		DivObj.style.top=YPos;
	}
}

//Fonction renvoyant la valeur des Cases à cocher sélectionnées									
function GetCheckboxVal(SelFor,SelChk)
{
	var TmpRep='';
	for (var IndInp=0;IndInp<SelFor.elements.length;IndInp++)
	{
		var Case=SelFor.elements[IndInp];
		if (Case.type=='checkbox')
		{
			if (Case.name==SelChk)
			{
				if (Case.checked==true)
				{
					if (TmpRep=='')
					{
						TmpRep=Case.value;
					} else {
						TmpRep+=','+Case.value;
					}
				}
			}
		}
	}
	return TmpRep;
}
//Fonction renvoyant la valeur du bouton radio sélectionné										
function GetRadioVal(SelFor,SelRad)
{
	for (var i=0; i<SelFor.length; i++)
	{
		if (SelRad[i].checked)
		{
			return SelRad[i].value;
		}
	}
	return null;
}

//Reecrit le contenu d un layer																
function DivWrite(NomDiv,TxtDiv)
{
	if (TxtDiv==null) {TxtDiv='';}
	//Si c'est Internet Explorer									
	if (document.all)
	{
		document.all[NomDiv].innerHTML=TxtDiv;
	}
	//Si c'est Netscape 4											
	if (document.layers)
	{
		document[NomDiv].document.open();
		document[NomDiv].document.write(TxtDiv);
		document[NomDiv].document.close();
	}
	//Si c'est Mozilla												
	if (document.getElementById && !document.all)
	{
		ObjDiv=document.getElementById([NomDiv]);
		ObjRan=document.createRange();
		ObjRan.setStartBefore(ObjDiv);
		ObjDom=ObjRan.createContextualFragment(TxtDiv);
		while (ObjDiv.hasChildNodes())
		{
			ObjDiv.removeChild(ObjDiv.lastChild);
		}
		ObjDiv.appendChild(ObjDom);
	}
}

//Lance l'assistant dates sur le même mois que Dat et renvoie vers Dest, et si précisée déclenche une fonction js				
//NB: IdLangue n'est plus nécessaire
function DoDate(Dat,Dest,IdLangue,fonctionjs)
{
	if (!fonctionjs) fonctionjs='';
	OpenW('/OPdotNet/commun/Assistant/AssistantDate.aspx?datecours='+ escape(Dat) +'&formdest=' + escape(Dest) +'&idlangue='+ IdLangue + '&fonctionjs=' + escape(fonctionjs),'DateWindow',205,185,'resizable=no');
}

//Lance l'assistant de choix de couleur et renvoie vers Dest									
function ModCol(NomDes)
{
	OpenW('/commun/eplugs/assistant/color/color.asp?dest='+escape(NomDes),'ColorWindow',260,300,'resizable=no');
}

//Fonction de déplacement d'une colonne d'un tableau de NumCol vers NumDes						
function TabColMov(NomTab,NumCol,NumDes)
{
	var ObjTab=ObjGet(NomTab);
	if (ObjTab)
	{
		for (var IndRow=0; IndRow<ObjTab.rows.length; IndRow++)
		{
			if (ObjTab.rows[IndRow].children[NumCol] && ObjTab.rows[IndRow].children[NumDes])
			{
				var TmpVal=ObjTab.rows[IndRow].children[NumCol].innerHTML;
				ObjTab.rows[IndRow].children[NumCol].innerHTML=ObjTab.rows[IndRow].children[NumDes].innerHTML;
				ObjTab.rows[IndRow].children[NumDes].innerHTML=TmpVal;
				if (IndRow==0)
				{
					var TmpLen=ObjTab.rows[IndRow].children[NumCol].size;
					ObjTab.rows[IndRow].children[NumCol].size=ObjTab.rows[IndRow].children[NumDes].size;
					ObjTab.rows[IndRow].children[NumCol].size=TmpLen;
				}
			}
		}
	}
}

//Supprime l'élément sélectionné de la liste de choix NomSel									
function SuppList(NomSel,Resize,Confirm,Exception)
{
	var NomSel = getObj(NomSel);
	if (NomSel)
	{
		//Si Resize est vide, on redimentionne pas												
		if (Resize==null)Resize=0;
		//Si confirm est vide, il faut confirmer												
		if (Confirm==null)	Confirm=1;
		//Si Exception est vide, il n'y a pas d'exception										
		if (Exception==null) Exception='';
		var CompteurSelectdElement = 0;
		//si un élement est choisi																
		for (var i = NomSel.options.length-1 ; i >= 0; i--)	{
			if (NomSel.options[i].selected)		{
				if (CompteurSelectdElement == 0)			{
					if (Confirm!=1 || ConfirmBox('Vous allez supprimer tous les éléments sélectionnés !'))				{
						if ((Exception == '') || (NomSel.options[i].text.indexOf(Exception) == -1)) {
							NomSel.options[i] = null;
							if (Resize!=0){
								if (NomSel.size>4)
									NomSel.size--;
								else 
									NomSel.size=2;
							}
						}
						CompteurSelectdElement++;
					} else {return};
				} else {
					if ((Exception == '') || (NomSel.options[i].text.indexOf(Exception) == -1)) {
						NomSel.options[i] = null;
						CompteurSelectdElement++;
						if (Resize!=0)	{
							if (NomSel.size>2)
								NomSel.size--;
							else 
								NomSel.size=2;
						}
					}
				}
			}
		}
		if (CompteurSelectdElement == 0)
			AlertBox("Vous devez choisir un élement à supprimer !");
	}		
}

//------------------------------------															
//	Ajout à un SELECT																			
//------------------------------------															
function AddList(NomSel,NumVal,NomVal,MajSiz,Unique)
{
	var AddSel=ObjGet(NomSel);
	if (AddSel==null)
	{
		if (NomSel.indexOf('document.')==-1)
		{
			NomSel='document.'+NomSel;
		}
		AddSel=eval(NomSel);
	}
	if (AddSel)
	{
		var NewVal=new Option(NomVal,NumVal);
		if (Unique!=null && Unique!=0)
		{
			for (var IndVal=0; IndVal<AddSel.options.length; IndVal++)
			{
				if (AddSel.options[IndVal].value==NumVal)
				{
					//AlertBox("Element deja selectionne !");
					return false;
				}
			}
		}
		AddSel.options[AddSel.options.length]=NewVal;
		if (MajSiz!=null && MajSiz!=0)
		{
			AddSel.size++;
		}
	}
}

//---------------------------------------------------------------------							
//	Sauve la liste des valeur de la liste de choix NomSel dans NomDest							
//---------------------------------------------------------------------							
function SaveList(NomSel)
{
	
	var StrListPageItems='';
	if (NomSel)
	{
		for (IndSel=0; IndSel<NomSel.length; IndSel++)
		{
			if (StrListPageItems!='')
			{
				StrListPageItems += ',';
			}
			StrListPageItems += NomSel.options[IndSel].value;
		} 
	}
	return StrListPageItems;
}

//---------------------------------------------------------------------							
//	Efface tout les éléments de la liste												
//---------------------------------------------------------------------							
function ClearList(strList){
	var oList = getObj(strList);
	if (oList){
		while(oList.length > 0){
			oList.options[0] = null;
		}
	}
}

//---------------------------------------------------------------------							
//	Ouvre la boite d'enregistrement d'un fichier												
//---------------------------------------------------------------------							
function downloadFile(path, filename, saveas, mappath)
{
	if (mappath==null||mappath=='')mappath=0;
	self.location = "/opdotnet/commun/assistant/downloadFile.aspx?strFilePath=" + path + "&strFileName=" + filename + "&saveAs=" + saveas + "&mapPath=" + mappath;
}

//--------------------------------------------------------------------		
//	__doPostBack : Surcharge de la fonction .NET qui gère le PostBack		
// ATTENTION : les hidden __EVENTTARGET, __EVENTARGUMENT doivent être		
// présentes																
//--------------------------------------------------------------------		
function __doPostBack(eventTarget, eventArgument, strFormName)
{
	var myForm = 'Form1';
	if (strFormName){myForm = strFormName}
	var theform;
	if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
		theform = document.forms[myForm];
	}
	else {
		theform = eval('document.' + myForm);
	}
	//if(theform.__EVENTTARGET){}
	theform.__EVENTTARGET.value = eventTarget.split("$").join(":");
	theform.__EVENTARGUMENT.value = eventArgument;
	theform.submit();
}
//Trim JavaScript															
function Trim(inputString)
{
   if (typeof inputString != "string") { return inputString; }
   var retValue = inputString;
   var ch = retValue.substring(0, 1);
   while (ch == " ") {
      retValue = retValue.substring(1, retValue.length);
      ch = retValue.substring(0, 1);
   }
   ch = retValue.substring(retValue.length-1, retValue.length);
   while (ch == " ") {
      retValue = retValue.substring(0, retValue.length-1);
      ch = retValue.substring(retValue.length-1, retValue.length);
   }
   while (retValue.indexOf("  ") != -1) {
      retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);
   }
   return retValue;
}
//Fonction hideOrNotMenu utilisé dans le composant MsdnMenu					
function hideOrNotMenu(Menu)
{

if (getObj(Menu+'_chevron').src.indexOf('Up')>=0){
	
	getObj(Menu+'_chevron').src='/dataop/outils/GERD/images/chevronDown.gif';

	
	for (var i=0;i<document.forms(0).elements.length;i++)
	{
	var Case=document.forms(0).elements[i];

	if ((Case.type=='hidden') && (Case.name.indexOf('collapse')>=0))
	{
		if (Case.name.indexOf(Menu)>=0)
		{
			Case.value='1';
		}
	}

	}
	
	
	for(i = 1; i <= 3; i++) {
		temp = eval("getObj(Menu+'_tdChevron"+i+"')");
		temp.className = 'Up';
	}
	getObj(Menu+'_grip').src ='/dataop/outils/GERD/images/gripGray.gif';
	temp = eval("getObj(Menu +'_trInfo')");
	temp.className="Disab";	

	temp = eval("getObj(Menu + '_topTable')");
	temp.className="clrTable";		

}else
{
	getObj(Menu+'_chevron').src='/dataop/outils/GERD/images/chevronUp.gif';
	for (var i=0;i<document.forms(0).elements.length;i++)
	{
	var Case=document.forms(0).elements[i];

	if ((Case.type=='hidden') && (Case.name.indexOf('collapse')>=0))
	{
		if (Case.name.indexOf(Menu)>=0)
		{
			Case.value='0';
		}
	}

	}

	for(i = 1; i <= 3; i++) {
		temp = eval("getObj(Menu+'_tdChevron"+i+"')");
		temp.className = 'Down';

	}
	getObj(Menu+'_grip').src ='/dataop/outils/GERD/images/gripblue.gif';
	temp = eval("getObj(Menu +'_trInfo')");
	temp.className="Enab";	
	temp = eval("getObj(Menu +'_topTable')");
	temp.className="setTable";	
}	

}
//Upload de Fichiers														
function uploadFile(repServeur,fctDest,mimeType,fileDestName)
{
	if (mimeType==null) {mimeType='';}
	if (fileDestName==null) {fileDestName='';}
	if (fctDest==null) {fctDest='';}
	if(repServeur!='' && repServeur!=null){
		OpenW('/opdotnet/Commun/Assistant/AssistantUpload.aspx?RepServeur='+repServeur+'&MimeType='+mimeType+'&FctDest='+fctDest+'&FileDestName='+fileDestName,'AssistantFichier',350,200,'scrollbars=0,resize=no');
	}
	else{
		AlertBox('Le repertoire de destination ne peut pas être vide !');			
	}
}

//Sélection de Couleurs														
function SelectColor(oDest,selectedColor)
{
	if (selectedColor==null || selectedColor=='') { selectedColor='#ffffff';}
	var color = window.showModalDialog('/OpDotNet/Commun/Assistant/ColorPicker/ColorPicker.htm',selectedColor,'dialogHeight:455px;dialogWidth:370px;center:Yes;help:No;scroll:No;resizable:No;status:No;');
	eval('oDest.value=color;');
	eval('oDest.bgColor=color;');
	eval('oDest.borderColor=color;');
	eval('oDest.style.background=color;');
	eval('oDest.style.border=color;');
}
//Détection des Mouvements de la Souris
//Modif Thomas pas besoin partout									
//document.onmousemove=SetMousePos;



//Assistant ressource FPC
function SelRessourceFPC(FctFin) {
	if (FctFin==null) {FctFin='';}
	var WinUsr=OpenW('/OpDotNet/eplug/Fpc/Ressource/RessourceSelection.aspx?RetourJS='+FctFin,'WinResSel',0,0,'');
}




// Lance la page de paramétrage d'un SCO
function showParametrageSCO(IdSCO) {
	OpenW('/OpDotNet/ePlug/FPC/Commun/Page/SCOS/Parametrage.aspx?IdSCO=' + IdSCO,'SCOParam',700,650, 'status=no,toolbar=no,scrollbars=no,menubar=no,location=no,resizable=yes');
}


// --------------------------------
// FONCTIONS DE GESTION DES COOKIES
// --------------------------------

/*
   name - name of the cookie
   value - value of the cookie
   [expires] - expiration date of the cookie
     (defaults to end of current session)
   [path] - path for which the cookie is valid
     (defaults to path of calling document)
   [domain] - domain for which the cookie is valid
     (defaults to domain of calling document)
   [secure] - Boolean value indicating if the cookie transmission requires
     a secure transmission
   * an argument defaults when it is assigned null as a placeholder
   * a null placeholder is not required for trailing omitted arguments
*/

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

/*
  name - name of the desired cookie
  return string containing value of specified cookie or null
  if cookie does not exist
*/

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

/*
   name - name of the cookie
   [path] - path of the cookie (must be same as path used to create cookie)
   [domain] - domain of the cookie (must be same as domain used to
     create cookie)
   path and domain default if assigned null or omitted if no explicit
     argument proceeds
*/

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"

function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}

// --------------------------------


// --------------------------------
// Hashtable en javascript
// --------------------------------

/**
    Contructor(s):
     Hashtable()
              Creates a new, empty hashtable
    
    Method(s):
     void clear() 
              Clears this hashtable so that it contains no keys. 
     boolean containsKey(String key) 
              Tests if the specified object is a key in this hashtable. 
     boolean containsValue(Object value) 
              Returns true if this Hashtable maps one or more keys to this value. 
     Object get(String key) 
              Returns the value to which the specified key is mapped in this hashtable. 
     boolean isEmpty() 
              Tests if this hashtable maps no keys to values. 
     Array keys() 
              Returns an array of the keys in this hashtable. 
     void put(String key, Object value) 
              Maps the specified key to the specified value in this hashtable. A NullPointerException is thrown is the key or value is null.
     Object remove(String key) 
              Removes the key (and its corresponding value) from this hashtable. Returns the value of the key that was removed
     int size() 
              Returns the number of keys in this hashtable. 
     String toString() 
              Returns a string representation of this Hashtable object in the form of a set of entries, enclosed in braces and separated by the ASCII characters ", " (comma and space). 
     Array values() 
              Returns a array view of the values contained in this Hashtable. 
            
*/
function Hashtable(){
    this.clear = hashtable_clear;
    this.containsKey = hashtable_containsKey;
    this.containsValue = hashtable_containsValue;
    this.get = hashtable_get;
    this.isEmpty = hashtable_isEmpty;
    this.keys = hashtable_keys;
    this.put = hashtable_put;
    this.remove = hashtable_remove;
    this.size = hashtable_size;
    this.toString = hashtable_toString;
    this.values = hashtable_values;
    this.hashtable = new Array();
}

/*=======Private methods for internal use only========*/

function hashtable_clear(){
    this.hashtable = new Array();
}

function hashtable_containsKey(key){
    var exists = false;
    for (var i in this.hashtable) {
        if (i == key && this.hashtable[i] != null) {
            exists = true;
            break;
        }
    }
    return exists;
}

function hashtable_containsValue(value){
    var contains = false;
    if (value != null) {
        for (var i in this.hashtable) {
            if (this.hashtable[i] == value) {
                contains = true;
                break;
            }
        }
    }
    return contains;
}

function hashtable_get(key){
    return this.hashtable[key];
}

function hashtable_isEmpty(){
    return (parseInt(this.size()) == 0) ? true : false;
}

function hashtable_keys(){
    var keys = new Array();
    for (var i in this.hashtable) {
        if (this.hashtable[i] != null) 
            keys.push(i);
    }
    return keys;
}

function hashtable_put(key, value){
    if (key == null || value == null) {
        throw "NullPointerException {" + key + "},{" + value + "}";
    }else{
        this.hashtable[key] = value;
    }
}

function hashtable_remove(key){
    var rtn = this.hashtable[key];
    this.hashtable[key] = null;
    return rtn;
}

function hashtable_size(){
    var size = 0;
    for (var i in this.hashtable) {
        if (this.hashtable[i] != null) 
            size ++;
    }
    return size;
}

function hashtable_toString(){
    var result = "";
    for (var i in this.hashtable)
    {      
        if (this.hashtable[i] != null) 
            result += "{" + i + "},{" + this.hashtable[i] + "}\n";   
    }
    return result;
}

function hashtable_values(){
    var values = new Array();
    for (var i in this.hashtable) {
        if (this.hashtable[i] != null) 
            values.push(this.hashtable[i]);
    }
    return values;
}

function GetFramePortail(){
	var win = window;
	if(win.top.opener){win = win.top.opener;}
	return win.top.content;
}

// --------------------------------


// --------------------------------
// objet ObjetGrid en Javascript
// --------------------------------

/**
    Methodes:
     int getCheckbox(idObjet) 
            renvoie l'identifiant de la checkbox correspond à l'objet d'identifiant idObjet
 	 void AddCheckbox(idChk, idObjet)
			ajoute une checkbox d'identifiant idChk pour l objet d'identifiant idObjet
     Array GetAllIdObjet()
			retourne la liste de tous les identifiants des objets
*/
function ObjetGrid(){
    this._checks = new Hashtable();
    this._checksEnabled = new Hashtable();
    this.GetCheckbox = ObjetGrid_GetCheckbox;
    this.AddCheckbox = ObjetGrid_AddCheckbox;
    //this.CheckboxEnabled = ObjetGrid_CheckboxEnabled;
    this.GetAllIdObjet = ObjetGrid_GetAllIdObjet;
}

function ObjetGrid_GetCheckbox(idObjet){
    var chk;
      
    if (idObjet == null) {
        throw "NullPointerException {" + idObjet + "}";
    }else{
		if (this._checks.containsKey(idObjet)) {
			chk = this._checks.get(idObjet);
		}
    }
    return chk;
}
function ObjetGrid_AddCheckbox(chk, idObjet){
    if (chk == null || idObjet == null) {
        throw "NullPointerException {" + chk + "},{" + idObjet + "}";
    }else {
		this._checks.put(idObjet,chk);
    }
}

/*
function ObjetGrid_CheckboxEnabled(chk, enabled) {
	if (chk == null || enabled == null) {
        throw "NullPointerException {" + chk + "},{" + enabled + "}";
    }else {
		this._checksEnabled.put(chk.id, enabled);
	}
}
*/

function ObjetGrid_GetAllIdObjet(){
    var values = new Array();
    var vals=this._checks.keys();
    for (var i=0; i<this._checks.size(); i++) {
		if (! this._checks.get(vals[i]).disabled) {values.push(vals[i]);}
    }
    return values;
}

// --------------------------------

// --------------------------------
// objet de la médiation en Javascript
// --------------------------------

/**
	Propriétés :
	Identifiant : identifiant de l'objet.
	IdTypeObjet : identifiant du type de l'objet.
	Méthodes :
	GetControlChamp(idChp) : retourne le control associé à un champ.
	AddControlChamp(idChp,control) : associe un champ à un control.
*/
function ObjetMediation(identifiant,idTypeObjet){
	this._controls=new Hashtable();
	this.GetControlChamp=ObjetMediation_GetControlChamp;
	this.AddControlChamp=ObjetMediation_AddControlChamp;
	this.Identifiant=identifiant;
	this.IdTypeObjet=idTypeObjet;
}

function ObjetMediation_GetControlChamp(idChp)
{
	return this._controls.get(idChp);
}

function ObjetMediation_AddControlChamp(idChp,control)
{
	if(idChp!=null&&control!=null){this._controls.put(idChp,control);}
}


/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FPC : Début
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

function FPC_ouvrirEltFiche(CatalogueId, ElementId, AffMode) {
	// Fonction d'ouverture de la fiche d'un élément.
	
	if ((AffMode == null) || (AffMode != 'Portail' && AffMode != 'Utilisateur')) { AffMode = 'Normal'; }
	OpenW('/OPDotNet/ePlug/FPC/Offre/Utilisateur/pEltAiguillage.aspx?intIdCatalogue=' + CatalogueId + '&intIdElement=' + ElementId + '&ModeAff=' + AffMode, 'FPCEltFiche', 850, 700, '');
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FPC : Fin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

function controlerFormatNombre(Nombre, NbChiffresEnt, NbChiffresDec, ValMin, ValMax, Sep) {
	/* Fonction controlant le format d'un nombre entier ou décimal en gérant la saisie d'un point à la place du séparateur de décimal usuel.
		Rq : Pour déterminer le séparateur de décimal usuel en vb.net : System.Globalization.NumberFormatInfo.CurrentInfo.CurrencyDecimalSeparator
		Paramètre Nombre : Zone de saisie du nombre.
		Paramètre NbChiffresEnt (>= 0) : Nombre de chiffres maximum pour la partie entière du nombre.
		Paramètre NbChiffresDec (>= 0) : Nombre de chiffres maximum pour la partie décimale du nombre.
		Paramètre ValMin : Valeur minimale du nombre.
		Paramètre ValMax : Valeur minimale du nombre.
		Paramètre Sep (obligatoire) : Séparateur de décimal usuel (exemple : ',').
	*/
	//alert('controlerFormatNombre() : Début : Nombre.value = ' + Nombre.value + ' ; NbChiffresEnt = ' + NbChiffresEnt + ' ; NbChiffresDec = ' + NbChiffresDec + ' ; ValMin = ' + ValMin + ' ; ValMax = ' + ValMax + ' ; Sep = ' + Sep);
	
	var NbValide = false;
	Nombre.value = Nombre.value.replace(/ /gi, ''); // Suppression de tous les espaces
	
	// Expression régulière pour la partie entière et, si nécessaire, pour la partie décimale
	var Format = "^-?([0-9]{0," + NbChiffresEnt + "}";
	if (NbChiffresDec > 0) {
		Format += "([\.\\" + Sep + "][0-9]{1," + NbChiffresDec + "})?";
	}
	Format += ")?$";
	
	// Tests et utilisation de séparateur
	if (Nombre.value.search(Format) != -1) {
		Nombre.value = Nombre.value.replace(Sep, '.'); // Forcage du point comme séparateur pour utilisation js
		var Nb = parseFloat(Nombre.value);
		if (Nb >= ValMin && Nb <= ValMax) {
			NbValide = true;
		}
		Nombre.value = Nombre.value.replace(/\./, Sep); // Affichage du nombre avec le séparateur usuel
	}
	
	return NbValide;
}

/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notification : Début
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */



/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Notification : Fin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */