var old_h = null;
var old_h_color = null;
var old_h_bgcolor = null;

	function openblock_inner(id, id_text_detail1, id_text_detail2, id_text_detail3) {
		if (old_h != null)
		{
			old_h.style.color = old_h_color;
			old_h.style.backgroundColor = old_h_bgcolor;
			old_h = null;
		}
		var h = document.getElementById('h'+id);
		if (h != null)
		{
			old_h = h;
			old_h_color = h.style.color;
			old_h_bgcolor = h.style.backgroundColor;
			h.style.color = "#C1EAFF";			 // Couleur du texte pour mettre en évidence celui sélectionné
			h.style.backgroundColor = "#1467B3"; // Couleur du fond pour mettre en évidence celui sélectionné
		}
		if (document.getElementById(id_text_detail1) != null)
			document.getElementById(id_text_detail1).innerHTML = document.getElementById(id).innerHTML;
		if (document.getElementById(id_text_detail2) != null)
			document.getElementById(id_text_detail2).innerHTML = "";
		if (document.getElementById(id_text_detail3) != null)
			document.getElementById(id_text_detail3).innerHTML = "";

	}
	function openblock(id) {
		openblock_inner(id, "texte_detail", "texte_detail2", "texte_detail3");
	}
	function openblock2(id) {
		openblock_inner(id, "texte_detail2", "texte_detail", "texte_detail3");
	}
	function openblock3(id) {
		openblock_inner(id, "texte_detail3", "texte_detail", "texte_detail2");
	}

	function closeblock(id) {
	}

	function closeblock2(id) {
	}
	
	function closeblock3(id) {
	}

	function calc_total_modulaire()
	{
		var total_modulaire=read_prix('prix_modulaire');
		if (document.getElementById('ccoll').checked)
			total_modulaire+=read_prix('vcoll');
		if (document.getElementById('cobj').checked)
			total_modulaire+=read_prix('vobj');
		if (document.getElementById('cproj').checked)
			total_modulaire+=read_prix('vproj');
		if (document.getElementById('cmark').checked)
			total_modulaire+=read_prix('vmark');
		if (document.getElementById('cdevis').checked)
			total_modulaire+=read_prix('vdevis');
		if (document.getElementById('cfact').checked)
			total_modulaire+=read_prix('vfact');
		if (document.getElementById('cndf').checked)
			total_modulaire+=read_prix('vndf');
		if (document.getElementById('cparc').checked)
			total_modulaire+=read_prix('vparc');
		if (document.getElementById('cser').checked)
			total_modulaire+=read_prix('vser');
		write_prix('total_modulaire',total_modulaire);
	}
	function read_prix(id)
	{
		var prix=document.getElementById(id).innerHTML.replace(",",".");
		return parseFloat(prix);
	}
	function write_prix(id,prix)
	{
		var prix=prix.toString().replace(".",",")+"0";
		document.getElementById(id).innerHTML = prix;
	}

	var div_ecran=null;
	function zoom_ecran_in(img_src)
	{
		if (div_ecran==null)
		{
			//document.write('<div style="position:absolute;display:none" id="zoom_ecran"></div>');
			div_ecran=document.getElementById('zoom_ecran');
		}
		div_ecran.style.left="400px";
        div_ecran.style.top="500px";
        div_ecran.style.width="640px";
        div_ecran.style.height="480px";
		div_ecran.style.display='block';
		div_ecran.innerHTML = '<img src="'+img_src+'" />';
	}
	function zoom_ecran_out()
	{
		if (div_ecran!=null)
			div_ecran.style.display='none';
	}
	
	function open_schema()
	{
			document.getElementById(id_text_detail1).innerHTML = document.getElementById(id).innerHTML;
	}
	
	function close_schema(id)
	{
			document.getElementById(id_text_detail1).innerHTML = document.getElementById(id).innerHTML;
	}

