// Gestion de l'editeur WYSIWING //
function editeur(path, pathGeneral, formulaire, champs)
{
	
	//window.open(path+"commun/editeur/ed.php?ParentFormName="+formulaire+"&ParentTextareaName="+champs, "editeur", "width=720,height=450,resizable=yes");
	
	window.open(path+"commun/tinymce/editeur.php?ParentFormName="+formulaire+"&ParentTextareaName="+champs+"&chemin="+pathGeneral, "editeur", "width=720,height=450,resizable=yes");
	
}
// Fonction de verification d'email //
function is_email(email)
{		
   if(email!="")
   {	
	   var reg = /^[\w.-]+@[\w.-]+\.\w{1,4}$/
	   var reg2 = /[.@]{2,}/
	   return ((reg.exec(email)!=null) && (reg2.exec(email)==null))
	}else{return true;}		
}	
// Affichage d'une boite d'alerte proposant le choix oui/non avec un message en parametre
function confirmationAlert(url,msg) 
{res = confirm(msg);if(res) document.location.href = url;}   	
// Fonction générique d'ouverture de popup		
function openPopup(url,nom,largeur,hauteur,pStatus, pLocation, pMenu, pResizable, pToolbar, pScrollbar) 
{x = screen.width-largeur;if(x>0){x=x/2;}y = screen.height-hauteur;if(y>0){y=y/2;}
window.open(url,nom,"status="+pStatus+", location="+pLocation+", menubar="+pMenu+", resizable="+pResizable+", toolbar="+pToolbar+", scrollbars=="+pScrollbar+", width="+largeur+", Height="+hauteur+", left="+x+", top="+y);}   	
// Fonction générique d'ouverture de popup		
function openWin(url,nom,largeur,hauteur,pStatus, pLocation, pMenu, pResizable, pToolbar, pScrollbar) 
{x = screen.width-largeur;if(x>0){x=x/2;}y = screen.height-hauteur;if(y>0){y=y/2;}
window.open(url,nom,"status="+pStatus+", location="+pLocation+", menubar="+pMenu+", resizable="+pResizable+", toolbar="+pToolbar+", scrollbars=="+pScrollbar+", width="+largeur+", Height="+hauteur+", left="+x+", top="+y);}   	
// Fonction de mise en surbrillance d'une ligne ( ex : cas d'une liste )
function surbrillanceON(ligne, classe)
{ligne.className = classe;}  
// Fonction de désavtivation de la surbrillance d'une ligne ( ex : cas d'une liste ) 	
function surbrillanceOFF(ligne, classe)
{ligne.className = classe;}     
// Fonction de séléction en surbrillance d'une ligne ( ex : cas d'une liste ) 	
function surbrillanceSel(ligne, colorSel)   
{if(ligne.style.backgroundColor == colorSel){ligne.style.backgroundColor = '';}else{ligne.style.backgroundColor = colorSel;}}     	

function changeImage(nomFichier, elemImage)   		
{elemImage.src = nomFichier;}
   
function onoffdisplay(formulaire, tabChamp)//Affchiage-Désaffichage du bloc de recherche
{   	   				   		
if(document.getElementById("blocRecherche").style.display=="none")
{document.getElementById("blocRecherche").style.display = "";}else{document.getElementById("blocRecherche").style.display = "none";   			   			
for (i=0; i<tabChamp.length; i++)    				
{document.getElementById(tabChamp[i]).value = '';}  
document.forms[formulaire].submit();}}				
//************************** AFFICHAGE BULlE D'AIDE **************************//
var IB=new Object;
var posX=0;posY=0;
var xOffset=00;yOffset=20;
function AffBulle(texte) {
  var isOP=(navigator.userAgent.indexOf('Opera') != -1)?true:false;		
  if(isOP)
  {contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=2 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;";}
  else{contenu="<TABLE border=0 cellspacing=0 cellpadding="+IB.NbPixel+"><TR bgcolor='"+IB.ColContour+"'><TD><TABLE border=0 cellpadding=8 cellspacing=0 bgcolor='"+IB.ColFond+"'><TR><TD nowrap><FONT size='-1' face='arial' color='"+IB.ColTexte+"'>"+texte+"</FONT></TD></TR></TABLE></TD></TR></TABLE>&nbsp;";}
  var finalPosX=posX-xOffset;
  if (finalPosX<0) finalPosX=0;
  if (document.layers) {document.layers["bulle"].document.write(contenu);document.layers["bulle"].document.close();document.layers["bulle"].top=posY+yOffset;document.layers["bulle"].left=finalPosX;document.layers["bulle"].visibility="show";}
  if (document.all) {bulle.innerHTML=contenu;document.all["bulle"].style.top=posY+yOffset;document.all["bulle"].style.left=finalPosX;document.all["bulle"].style.visibility="visible";}	  
 else if (document.getElementById) {document.getElementById("bulle").innerHTML=contenu;document.getElementById("bulle").style.top=posY+yOffset;document.getElementById("bulle").style.left=finalPosX;document.getElementById("bulle").style.visibility="visible";
 }}
function getMousePos(e) {
if (document.all) {
posX=event.x+document.body.scrollLeft;posY=event.y+document.body.scrollTop;
}else {posX=e.pageX;posY=e.pageY; }}
function HideBulle() {
if (document.layers) {document.layers["bulle"].visibility="hide";}
if (document.all) {document.all["bulle"].style.visibility="hidden";}
else if (document.getElementById){document.getElementById("bulle").style.visibility="hidden";}
}	
function InitBulle(ColTexte,ColFond,ColContour,NbPixel) {
IB.ColTexte=ColTexte;IB.ColFond=ColFond;IB.ColContour=ColContour;IB.NbPixel=NbPixel;
if (document.layers) {window.captureEvents(Event.MOUSEMOVE);window.onMouseMove=getMousePos;document.write("<LAYER name='bulle' top=0 left=0 visibility='hide' z-index=50></LAYER>");}
if (document.all) {document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden;z-index:50'></DIV>");document.onmousemove=getMousePos;}
else if (document.getElementById) {document.onmousemove=getMousePos;document.write("<DIV id='bulle' style='position:absolute;top:0;left:0;visibility:hidden;z-index:50'></DIV>");}}
//************************** FIN AFFICHAGE BULlE D'AIDE **************************//
//****************** FAUSSE POPUP ********************************************//	
function affPopup(hauteurOri, largeurOri, posXOri, posYOri, colorOmbre, titre, texteFenetre, couleurTexte, texteFondColor, tailleTexte, policeTexte, pathImage, classBordure, tailleBordure, hauteurTitre, nomImageBarre, nomChampAffPopup)
{
	//alert(Math.random());
if(hauteurOri==0){var hauteur = screen.height/3}else{var hauteur = hauteurOri};         	       
if(largeurOri==0){var largeur = screen.width/3}else{var largeur = largeurOri;}; 
if(posXOri==0){var posX = ((screen.width-largeur)/2) + 20}else{var posX = posXOri;};
if(posYOri==0){var posY = (screen.height-largeur)/2}else{var posY = posYOri;};	
createPopup(Math.random(), titre, largeur, hauteur, posX, posY, true,  '#FFFFFF' , texteFondColor , colorOmbre,  texteFenetre , couleurTexte  , tailleTexte , policeTexte, '#FFFFFF', pathImage, classBordure, tailleBordure, hauteurTitre, nomImageBarre, nomChampAffPopup);	
}
//****************** FIN FAUSSE POPUP ********************************************//			 

//****************** CACHER LES SELECT QD ON AFFICHE UN DIV **********************//
fSwapSelect = function(sId) 
{  	
 oObj = document.getElementById(sId); 
 Top_Element  = fDomOffset(oObj, 'offsetTop'); 
 Left_Element  = fDomOffset(oObj, 'offsetLeft'); 
 Largeur_Element  = oObj.offsetWidth; 
 Hauteur_Element  = oObj.offsetHeight; 
 oSelects = document.getElementsByTagName('SELECT'); 
 if (oSelects.length > 0) { 
  for (i = 0; i < oSelects.length; i++) { 
   oSlt = oSelects[i]; 
   Top_Select = fDomOffset(oSlt, 'offsetTop'); 
   Left_Select = fDomOffset(oSlt, 'offsetLeft'); 
   Largeur_Select = oSlt.offsetWidth; 
   Hauteur_Select = oSlt.offsetHeight; 
   isLeft = false; 
   if ((Left_Element > (Left_Select - Largeur_Element)) && (Left_Element < (Left_Select + Largeur_Select))) { 
    isLeft = true; 
   } 
   isTop = false; 
   if ((Top_Element > (Top_Select - Hauteur_Element)) && (Top_Element < (Top_Select + Hauteur_Select))) { 
    isTop = true; 
   } 
   if (isLeft && isTop) { 
    sVis = (oObj.style.visibility == 'hidden') ? 'visible' : 'hidden'; 
    if (oSlt.style.visibility != sVis) {oSlt.style.visibility = sVis;} 
   } else { 
    if (oSlt.style.visibility != 'visible') {oSlt.style.visibility = 'visible';} 
   } 
  } 
 } 
} 
//****************** FIN - CACHER LES SELECT QD ON AFFICHE UN DIV **********************//
//****************** ROLLOVER IMAGES ***************************************************//
function rolloverImage(nomImage, valeurImage)
{
	eval(nomImage + ".src='" + valeurImage + "'");	
}

