/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Définition & déclaration des variables
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
var droiteON	= "droite_2.gif";
var droiteOFF	= "droite_1.gif";
var centreON	= "centre_2.gif";
var centreOFF	= "centre_1.gif";
var gaucheON	= "gauche_2.gif";
var gaucheOFF	= "gauche_1.gif";
//var justeON		= "juste_2.gif";
//var justeOFF	= "juste_1.gif";
var boldON		= "bold_2.gif";
var boldOFF		= "bold_1.gif";
var italicON	= "italic_2.gif";
var italicOFF	= "italic_1.gif";
var underON		= "sousligne_2.gif";
var underOFF	= "sousligne_1.gif";

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Gère le clic sur une CheckBox	de type alignement
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		destobject : 
		nom : 
		off1 : 
		off2 : 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function ClicButton(destobject, nom, off1, off2)
{
	var src = document.images[nom].src;
	src = src.substring(src.lastIndexOf("/")+1);  
	hiddenObject = destobject;
	
	if (src == gaucheOFF)
	{
		document.images[nom].src='img/'+gaucheON;
		document.images[off1].src='img/'+centreOFF;
		document.images[off2].src='img/'+droiteOFF;
		//document.images[off3].src='img/'+justeOFF;
		hiddenObject.value = 'left';
	}
	
	if (src == droiteOFF)
	{
		document.images[nom].src='img/'+droiteON;
		document.images[off1].src='img/'+gaucheOFF;
		document.images[off2].src='img/'+centreOFF;
		//document.images[off3].src='img/'+justeOFF;
		hiddenObject.value = 'right';
	}
	
	if (src == centreOFF)
	{
		document.images[nom].src='img/'+centreON;
		document.images[off1].src='img/'+gaucheOFF;
		document.images[off2].src='img/'+droiteOFF;
		//document.images[off3].src='img/'+justeOFF;
		hiddenObject.value = 'center';
	}
	
	/*if (src==justeOFF)
	{
		document.images[nom].src='img/'+justeON;
		document.images[off1].src='img/'+gaucheOFF;
		document.images[off2].src='img/'+centreOFF;
		document.images[off3].src='img/'+droiteOFF;	
		document.all.PcjsDestObject.value = 'justify';
	}*/
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Gère le clic sur une CheckBox	de type BOLD
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		destobject : 
		nom1 :  
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function ClicBold(destobject, nom1) 
{
	var src = document.images[nom1].src;
	src = src.substring(src.lastIndexOf("/")+1);  
	PcjsDestObject = destobject;
	
	if (src == boldOFF)
	{
		document.images[nom1].src = 'img/'+boldON;
		PcjsDestObject.value = 'bold';
		//document.all.texte1.value='bold';
	}
	 if (src == boldON)
	 {
		document.images[nom1].src = 'img/'+boldOFF;
		PcjsDestObject.value = 'normal';
		//document.all.texte1.value='normal';
	}
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Gère le clic sur une CheckBox	de type ITALIC
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		destobject : 
		nom2 : 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function ClicItalic(destobject, nom2) 
{
	var src = document.images[nom2].src;
	src = src.substring(src.lastIndexOf("/")+1);  
	PcjsDestObject = destobject;
	
	if (src == italicOFF)
	{
		document.images[nom2].src = 'img/'+italicON;
		PcjsDestObject.value = 'italic';
	}
	
	if (src == italicON)
	{
		document.images[nom2].src = 'img/'+italicOFF;
		PcjsDestObject.value = 'normal';
	}
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Gère le clic sur une CheckBox	de type SOULIGNE
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		destobject : 
		nom3 : 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function ClicUnder(destobject, nom3) 
{
	var src = document.images[nom3].src;
	src = src.substring(src.lastIndexOf("/")+1);  
	PcjsDestObject = destobject;
	
	if (src == underOFF)
	{
		document.images[nom3].src = 'img/'+underON;
		PcjsDestObject.value = 'underline';
	}
	
	if (src == underON)
	{
		document.images[nom3].src = 'img/'+underOFF;
		PcjsDestObject.value = 'none';
	}
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Ouvre une popup
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		URL : chemin ver le fichier à ouvrir
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function showWindow(URL)
{ 
	var winName 	= "Couleurs";
	var tool 			= "toolbar=no," ;
	var stat 			= "status=no," ;
	var dir 			= "directories=no," ;
	var menu 			= "menubar=no," ;
	var scroll 		= "scrollbars=no," ;
	var loc 			= "location=no," ;
	var width 		= "width=360," ;
	var height 		= "height=380," ;
	var left			= "left=200," ;
	var top				= "top=100," ;
	var res 			= "resizable=no" ;
	var winProp ;

	winProp = tool + stat + dir + menu + scroll + loc + width + height + res ;	  
	EXT_Window = window.open(URL,winName,winProp);
	EXT_Window.focus();
}

/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Ouvre la popup d'impression
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		URL : chemin ver le fichier à ouvrir
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function showPrint(URL)
{ 
	var winName 	= "Couleurs";
	var tool 			= "toolbar=no," ;
	var stat 			= "status=no," ;
	var dir 			= "directories=no," ;
	var menu 			= "menubar=no," ;
	var scroll 		= "scrollbars=yes," ;
	var loc 			= "location=no," ;
	var width 		= "width=700," ;
	var height 		= "height=500," ;
	var left			= "left=200," ;
	var top				= "top=100," ;
	var res 			= "resizable=no" ;
	var winProp ;

	winProp = tool + stat + dir + menu + scroll + loc + width + height + res ;	  
	EXT_Window = window.open(URL,winName,winProp);
	EXT_Window.focus();
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Ouvre la popup de l'aide en ligne
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		URL : chemin ver le fichier à ouvrir
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function showHelp(URL)
{ 
	var winName 	= "Aide";
	var tool 			= "toolbar=no," ;
	var stat 			= "status=no," ;
	var dir 			= "directories=no," ;
	var menu 			= "menubar=no," ;
	var scroll 		= "scrollbars=no," ;
	var loc 			= "location=no," ;
	var width 		= "width=690," ;
	var height 		= "height=770," ;
	var left			= "left=0," ;
	var top				= "top=0," ;
	var res 			= "resizable=no" ;
	var winProp ;

	winProp = tool + stat + dir + menu + scroll + loc + width + height + res ;	  
	EXT_Window = window.open(URL,winName,winProp);
	EXT_Window.focus();
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Ouvre la popup de saisie d'un texte
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		page : chemin ver le fichier à ouvrir
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function FenEdition(page)
{
	var winName = "Saisie";
	var winProp = "toolbar=no,status=yes,directories=no,menubar=no,scrollbars=no,location=no,width=650,height=390,resizable=no" ;
		
	popup2 = window.open(page,winName,winProp);			
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Ouvre la popup d'édition d'un texte
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		page : chemin ver le fichier à ouvrir
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function FenEdition2(page)
{
	var winName = "Edition";
	var winProp = "toolbar=no,status=yes,directories=no,menubar=no,scrollbars=no,location=no,width=650,height=400,resizable=yes" ;
	
	popup2 = window.open(page,winName,winProp);
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Ouvre la popup de zoom sur une image
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		h : huteur de la popup
		w : largeur de la popup
		page : chemin ver le fichier à ouvrir
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function fenetreImg(w,h,page)
{
	var winName = "Images";
	var winProp = "toolbar=no,status=no,directories=no,menubar=no,scrollbars=no,location=no,width="+w+",height="+h+",resizable=no" ;
	popup2 = window.open(page,winName,winProp);			
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Ouvre la popup de prévisualisation de la disposition d'un article
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function Preview()
{
	id_une=document.form.id_une.value;
	var L=form.disposition.length;
	for (var i = 0 ; i< L ; i++)
	{ 
		if(form.disposition[i].checked)
		{ 
			dispo=form.disposition[i].value; break;
		} 
	}
	page="popupPreview.asp?id_une=" + id_une + "&dispo=" + dispo;
	var winName = "Preview";
	var winProp = "toolbar=no,status=no,directories=no,menubar=no,scrollbars=yes,location=no,width=720,height=800,resizable=yes" ;
	popup2=window.open(page,winName,winProp);			
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Ouvre la popup d'envoi d'un mail
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		h : huteur de la popup
		w : largeur de la popup
		page : chemin ver le fichier à ouvrir
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function fenetre(w,h,page)
{
	var winName = "Mail";
	var winProp = "toolbar=no,status=no,directories=no,menubar=no,scrollbars=no,location=no,width="+w+",height="+h+",resizable=no" ;
	popup2=window.open(page,winName,winProp);
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Fonction utiliser pour le passage d'information entre les popup 
		d'edition et les formulaire
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function AllerA()
{
	var L=form.disposition.length;			
	for (var i = 0 ; i< L ; i++)
	{
		if(form.disposition[i].checked)
		{ 
			Preview(); break;
		} 
	}
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Fonction utiliser pour coher toutes les case d'un formulaire
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function checkAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = true ;
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Fonction utiliser pour decoher toutes les case d'un formulaire
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function uncheckAll(field)
{
for (i = 0; i < field.length; i++)
	field[i].checked = false ;
}


/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 		Fonction de gestion de la progress bar du composant d'upload
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
		barref : 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
function ShowProgress(barref)
{
  strAppVersion = navigator.appVersion;
  if (document.all.FILE1.value != "") // || document.all.FILE2.value != "" || document.all.FILE3.value != "")
  {
    if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
    {
      winstyle = "dialogWidth=390px; dialogHeight:150px; center:yes";
      window.showModelessDialog(barref+'&b=IE',null,winstyle);
    }
    else
    {
      window.open(barref+'&b=NN','','width=600,height=300', true);
    }
  }
  return true;
}	
