	
	// OUVRIR UNE FENETRE POPUP
	function CC_Ouvrir_Fenetre_Popup (url, width, height) {
		var wf = "";	
		wf = wf + "width=" + width;
		wf = wf + ",height=" + height;
		wf = wf + ",resizable=yes";
		wf = wf + ",scrollbars=yes";
		wf = wf + ",menubar=no";
		wf = wf + ",toolbar=no";
		wf = wf + ",directories=no";
		wf = wf + ",location=no";
		wf = wf + ",status=no";		
		window.open(url,"_blank",wf);
	}

	// OUVRIR UNE FENETRE POPUP FIXE
	function CC_Ouvrir_Fenetre_Popup_Fixe (url, width, height) {
		var wf = "";	
		wf = wf + "width=" + width;
		wf = wf + ",height=" + height;
		wf = wf + ",resizable=no";
		wf = wf + ",scrollbars=no";
		wf = wf + ",menubar=no";
		wf = wf + ",toolbar=no";
		wf = wf + ",directories=no";
		wf = wf + ",location=no";
		wf = wf + ",status=no";		
		window.open(url,"_blank",wf);
	}

	// AFFICHER/MASQUER UN LAYER
	function CC_Afficher_Masquer_Layer (layer) {
		// Fonctionnement navigateur normal
		if (document.getElementById) {
			var style2 = document.getElementById(layer).style;
			style2.display = style2.display ? "" : "block";
			style2.visibility = style2.display ? "visible" : "hidden";

		// Fontionnement pour vielles versions de navigateur
		} else if (document.all) {
			var style2 = document.all[layer].style;
			style2.display = style2.display ? "" : "block";
			style2.visibility = style2.display ? "visible" : "hidden";

		// Fonctionnement pour Netscape
		} else if (document.layers)	{
			var style2 = document.layers[layer].style;
			style2.display = style2.display ? "" : "block";
			style2.visibility = style2.display ? "visible" : "hidden";
		}
	}

	// AFFICHER UN LAYER
	function CC_Afficher_Layer (layer) {
		// Fonctionnement navigateur normal
		if (document.getElementById) {
			var style2 = document.getElementById(layer).style;
			style2.display = "block";
			style2.visibility = "visible";

		// Fontionnement pour vielles versions de navigateur
		} else if (document.all) {
			var style2 = document.all[layer].style;
			style2.display = "block";
			style2.visibility = "visible";

		// Fonctionnement pour Netscape
		} else if (document.layers)	{
			var style2 = document.layers[layer].style;
			style2.display = "block";
			style2.visibility = "visible";
		}
	}

	// MASQUER UN LAYER
	function CC_Masquer_Layer (layer) {
		// Fonctionnement navigateur normal
		if (document.getElementById) {
			var style2 = document.getElementById(layer).style;
			style2.display = "";
			style2.visibility = "hidden";

		// Fontionnement pour vielles versions de navigateur
		} else if (document.all) {
			var style2 = document.all[layer].style;
			style2.display = "";
			style2.visibility = "hidden";

		// Fonctionnement pour Netscape
		} else if (document.layers)	{
			var style2 = document.layers[layer].style;
			style2.display = "";
			style2.visibility = "hidden";
		}
	}

	// CHANGER L'ADRESSE (URL) DE LA FENETRE
	function CC_Changer_URL_Fenetre (url) {
		window.location = url;
	}
	
	// METTRE EN SURBRILLANCE UNE LIGNE D'UN TABLEAU
	CC_BackColor = new Array();
	function CC_Modifier_TR_Table (theRow, thePointerColor, theNormalBgColor) {
    	var theCells = null;

		if (thePointerColor == '' || typeof(theRow.style) == 'undefined') {
        	return false;
    	}
    	
		if (typeof(document.getElementsByTagName) != 'undefined') {
        	theCells = theRow.getElementsByTagName('td');
    	} else if (typeof(theRow.cells) != 'undefined') {
        	theCells = theRow.cells;
    	} else {
        	return false;
    	}

    	var rowCellsCnt  = theCells.length;
    	var currentColor = new Array();
    	var newColor     = null;

    	for (var c = 0; c < rowCellsCnt; c++) {
	    	currentColor[c] = theCells[c].style.backgroundColor;
    		if (currentColor[c].toLowerCase() == thePointerColor.toLowerCase()) {
				newColor = CC_BackColor[c];
			} else {
				newColor = thePointerColor;
		    	CC_BackColor[c] = theCells[c].style.backgroundColor;
			}
			theCells[c].style.backgroundColor = newColor;
    	}
		
		return TRUE;
	}


   	var CC_Element_Editeur    	= null;
   	var CC_Editeur 				= new Array();

	// INSERTION D'UN TEXTE DANS UN TEXTAREA A LA POSITION DU CURSEUR
	function CC_Inserer_Balise (myField, balise, balisefermante) {

		if (balisefermante == true) {
			if (CC_Editeur[myField+'-'+balise] != 1) {
				CC_Inserer_Texte_Curseur (myField, '###'+balise+'###');
				CC_Editeur[myField+'-'+balise] = 1;
			} else {
				CC_Inserer_Texte_Curseur (myField, '###/'+balise+'###');
				CC_Editeur[myField+'-'+balise] = 0;
			}
		} else {
			CC_Inserer_Texte_Curseur (myField, '###'+balise+'###');
		}
	}

	// INSERTION D'UN TEXTE DANS UN TEXTAREA A LA POSITION DU CURSEUR
	function CC_Inserer_Texte_Curseur (myField, myValue) {

		// myField.value += myValue;
		// myField.focus();

		if (myValue == "######") myValue = "";

		el = myField;
		ins = myValue;

    	if (el.setSelectionRange){
        	el.value = el.value.substring(0,el.selectionStart) + ins + el.value.substring(el.selectionStart,el.selectionEnd) + el.value.substring(el.selectionEnd,el.value.length);
    	} else if (document.selection && document.selection.createRange) {
        	el.focus();
        	var range = document.selection.createRange();
        	range.text = ins + range.text;
    	} 
	}
