	var ligne_mem = null;

	var PREFIX_LIGNE_ID = "ligne_Q";
	var PREFIX_FLECHE_ID = "fleche_Q";


	function montreFleche(ligne,montre)
	{
		var index = extraitIndex(ligne.id);
	
		var elt = document.getElementById(PREFIX_FLECHE_ID + index);

		if (elt != null)
		{
			if (montre)
			{
				elt.src = './imagestyle/fleche_2.gif';
				
				//elt.style.visibility = "visible";
			}				
			else				
			{
				elt.src = './imagestyle/puce1.gif';
			
				//elt.style.visibility = "hidden";
			}				
		}
	
	}


	function changeCouleur(ligne)
	{
		var bChange = true;

		if (ligne_mem != null)
		{
			if (ligne_mem == ligne)
				bChange = false;
		}

		if (bChange)
		{
			ligne.style.backgroundColor = '#CCCCCC';
			
			montreFleche (ligne,true);
		}
	}

	function remetCouleur(ligne)
	{
		var bChange = true;

		if (ligne_mem != null)
		{
			if (ligne_mem == ligne)
				bChange = false;
		}

		if (bChange)
		{
			ligne.style.backgroundColor = '';
			montreFleche (ligne,false);
		}
	}


	function choixSel(ligne,page)
	{
		var sz = coderPageUrl(page) + '&sel=' + ligne.id;
		
		location.href = sz;

	}

	function lienReponse(ligne, coul)
	{

		if (ligne_mem != null)
		{
			ligne_mem.style.backgroundColor = '';
			montreFleche (ligne_mem,false);
		}			

		ligne_mem = ligne;

		ligne.style.backgroundColor = coul;;
		montreFleche (ligne,true);


		var elt = document.getElementById("div_Reponse");

		if (elt != null)
		{
			var index = extraitIndex(ligne.id);

			elt.innerHTML = getReponse(index);
		}

		//alert(ligne.id);
	}


	function extraitIndex(ligneId)
	{
		var index = 0;

		var tmp = ligneId.indexOf(PREFIX_LIGNE_ID);

		if (tmp != -1)
		{
			var sz = ligneId.substring(tmp+PREFIX_LIGNE_ID.length);

			//alert(sz);

			index = parseInt(sz);
		}

		return index;
	}



	function getReponse(index)
	{
		return aDatasQ[index][3];
	}


	function getTABLE_QR(index,page)
	{
		var sz = "";


		sz += '<table class="table_Q_R">';

		if (aDatasQ[index][0] != "")
		{
			if (index != 0)
			{
				sz += '<tr height="10px">';
				sz += '<td>' + '</td>';
				sz += '</tr>';
			}

			sz += '<tr>';
			sz += '<th>' + aDatasQ[index][0] + '</th>';
			sz += '</tr>';
		}

		var lienClick = "javascript:choixSel(this," + "\'" + page + "\'" + ")";
		
		sz += '<tr id="' + PREFIX_LIGNE_ID + index + '" style="cursor:pointer;" onmouseover="javascript:changeCouleur(this)" onmouseout="javascript:remetCouleur(this)" onclick="' + lienClick + '">';

		sz += '<td><img id="' + PREFIX_FLECHE_ID + index + '"' + ' src="./imagestyle/puce1.gif" style="visibility:visible;" align="absmiddle" border=0/>&nbsp;' + aDatasQ[index][1] + '</td>';
		sz += '</tr>';


		if (aDatasQ[index][2] != "")
		{
			sz += '<tr>';
			sz += '<td>' + '<span class="note_Q_R">' + aDatasQ[index][2] + '</span>' + '</td>';
			sz += '</tr>';
		}


		sz += '</table>';

		return sz;
	}



