function toggleLangue(noLangue) {
	var oTitre = document.forms[0]['titre_' + noLangue];
	var oTexte = document.forms[0]['texte_' + noLangue];

	if (oTitre.disabled) {
		oTitre.disabled = false;
		oTexte.disabled = false;
	} else {
		oTitre.disabled = true;
		oTexte.disabled = true;
	}

}

//###################################################################
//#    CUSTOMIZABLE JAVASCRIPT COLOR PICKER V 0.1
//#    AUTHOR: JUSTIN PALMER
//#    WEBSITE HTTP://WWW.ISOLATED-DESIGNS.NET/CORE
//#    DESCRIPTION:  A CUSTOM COLOR PICKER THAT WILL ALLOW YOU TO EASILY DEFINE UNLIMITED 
//#                  CUSTOM COLOR PALLETES.  SIMPLY ADD ANOTHER CASE TO THE SWITCH STATEMENT
//#                  AND FILL IN YOUR COLOR VALUES.  THEN ADD THE VALUE AND NAME TO THE SELECT MENU.
//#    COMPATIBLE BROWSERS:  TESTED ON MSIE 6, FIREFOX 0.9, OPERA 7...IF YOU USE A DIFFERENT BROWSER
//#    THATS NOT LISTED HERE AND WOULD LIKE TO LET ME KNOW IF IT WORKS OR DOESN'T, PLEASE DROP A COMMENT
//#####################################################################


//Initialize the Color Menu, Right now it defaults to common
	function initColorPicker()
	{
	colors = getColors('common');
	buildColorMenu(20,colors.length, colors, 'colorpicker');
	//alert(document.body.innerHTML);
	}
	
	//Swaps the pallte based on user selection
	function swapPallete(colors)
	{
		var root = document.getElementById('colorpicker');
		root.innerHTML = '';
		var colors = getColors(colors);
		buildColorMenu(20, colors.length, colors, 'colorpicker');
	}
	
	
//Generate An Array of Hex colors based on the pallete
function getColors(pallete)
{
	switch(pallete)
	{
		case 'grayscale' :
		    //GRAYSCALE COLORS CAN EASILY BE GENERATED CONSIDERING THERE RBG VALUES
			//ARE EQUAL.
			colors = generateGrayScale();
			break
		case 'common' :
			var colors = Array(
				'#006DA6',	'#053864',	'#50356C',	'#B05048',	'#C74122',
				'#778C32',	'#324E5E',	'#680000',	'#DA7F1E',	'#3D2408',
				'#0BB8CD',	'#B91B2D',	'#113D7F'
				);
				break
				
				//DEFINE YOUR CUSTOM PALLETES HERE
				//case 'mycustom' :
				// var colors = Array('#333333', '#FFFFFF');
				// return colors;
		default :
			//Nada
	}
	return colors;
}

	
	//The Work horse that does all the bulding
	function buildColorMenu(num_rows, total_cells, colors, rootID)
	{
		if(typeof colors != 'object'){ alert('Error: Colors Must Be An Array');}
		var root = document.getElementById(rootID);
		var table = document.createElement('table');
		table.id = 'swatch';
		table.cellpadding = 0;
		table.cellspacing = 1;
		root.appendChild(table);
		var tbody = document.createElement('tbody');
		var tr = document.createElement('tr');
		tbody.appendChild(tr);
		table.appendChild(tbody);
		var row = tr;
		for(var i = 0; i < total_cells; i++)
		{
			if( (i != 0) && ( i % num_rows ) == 0) {
				row = tbody.appendChild(document.createElement('tr'));
				} 
				td = document.createElement('td')
				td.id = colors[i];
				td.onclick = showColor;
				//td.onmouseover = showColor;
				td.style.background = colors[i];
				row.appendChild(td);
		}
		
		tfoot = document.createElement('tfoot');
		return table;
	}
	
	function generateGrayScale()
	{
		var colors = Array();
		for(var i = 0; i < 256; i++)
		{
			hex = decToHex(i);
			rgb = '#' + hex + hex + hex;
			colors.push(rgb);
		}
		return colors.reverse();
	}

	
	function showColor()
	{
	 var swatch = document.getElementById(this.id);
	 var input = document.getElementById('couleur');
	 input.value = swatch.id;
	 input.style.color = swatch.id;
	 input.style.backgroundColor = swatch.id;
	 }
	 
//Utility Scrtip to Convert decimal to hex value	 
function decToHex(dec)
{
  var hexStr = "0123456789ABCDEF";
  var low = dec % 16;
  var high = (dec - low)/16;
  hex = "" + hexStr.charAt(high) + hexStr.charAt(low);
  return hex;
}
