// JavaScript Document
function actu_mouse_over(obj, dir, actu_id) {
	obj.firstChild.firstChild.src='../' + dir + actu_id +'_date_over.gif';
	document.getElementById('actu_abstract_' + actu_id).style.display = '';
}

function actu_mouse_out(obj, dir, actu_id) {
	obj.firstChild.firstChild.src='../' + dir + actu_id +'_date.gif';
	document.getElementById('actu_abstract_' + actu_id).style.display = 'none;';
}

function map_mouse_over(dept) {
	document.getElementById('map_'+dept).style.display = '';
}

function map_mouse_out(dept) {
	document.getElementById('map_'+dept).style.display = 'none';
}

function re_essence_mouse_over(obj) {
		obj.parentNode.parentNode.style.backgroundColor = '#E5E5E5';
}

function re_essence_mouse_out(obj) {
	obj.parentNode.parentNode.style.backgroundColor = '';
}

function re_infos_mouse_over(obj) {
	if (obj.className != 'p_infos_re_select') {
		obj.style.backgroundColor = '#E5E5E5';//obj.className = 'p_infos_fp_select';
	}
}

function re_infos_mouse_out(obj) {
	obj.style.backgroundColor = '';//obj.className = 'p_infos_fp';
}

/**
* plus utilisé remplacé par un wz_tootltip
function doc_mouse_over(obj) {
	if (obj.className != 't_titre_doc_select') {
		obj.className = 't_titre_doc_hover';
	}
	return true;
}

function doc_mouse_out(obj) {
	if (obj.className != 't_titre_doc_select') {
		obj.className = 't_titre_doc';
	}
	return true; 
}

*/

function doc_mouse_click(obj, rub_id, doc_id) {
	var div = document.getElementById('doc_detail_' + doc_id);
	if (div) {
		if (div.style.display == '') {
			//on est déja sur ce document on le déselectionne pour revenir à la catégorie
			doc_hide_all(rub_id);
			document.getElementById('doc_detail_rub_'+rub_id).style.display = '';
			obj.className = 't_titre_doc';
			//on restore l'evt 
			obj.onmouseout = function(e) {
				if (obj.className != 't_titre_doc_select') {
					obj.className = 't_titre_doc';
				}
			}
		}
		else {
			doc_hide_all(rub_id);
			div.style.display = '';
			obj.className = 't_titre_doc_select';
			//on jarte l'évement mouseout
			obj.onmouseout = null;
		}
	}
}

function doc_hide_all(rub_id) {
	var eDiv = document.getElementById('e_doc_details_' + rub_id);
	var divs = eDiv.childNodes;
	var matched = '';
	for (i = 0; i < divs.length; i++) {
		if (divs[i] && divs[i].id) {
			if (divs[i].style.display == '' && divs[i].id.search(/doc_detail_rub/) == -1) {
				matched = divs[i].id.replace(/doc_detail_/, '');
			}
			divs[i].style.display = 'none';
		}
	}
	//si on a déja un doc sélectionné
	if (matched != '') {
		var obj = document.getElementById('pdf_num_'+matched)
		obj.className = 't_titre_doc';
		//on restore l'evt 
		obj.onmouseout = function(e) {
			if (obj.className != 't_titre_doc_select') {
				obj.className = 't_titre_doc';
			}
		}
	}
}

/*
* Revenir à l'affichage de la rubrique, description...
*/
function doc_show_rub(rub_id) {
	doc_hide_all(rub_id);
	document.getElementById('doc_detail_rub_'+rub_id).style.display = '';
}


/*
* Page fibra : Click sur un département : Récupérer les information de l'interpro
*/
function show_interpro_detail(part_id, dept) {
	//on sélectionne le département un seul à la fois
	wait_loading();
	var root = document.getElementById('e_fibra_region_map');
	var divs = root.getElementsByTagName('DIV');
	for (i = 0; i < divs.length; i++) {
			var div = divs[i];
			if (div && div.id && div.className == 'map_selects') {
				div.style.display = 'none';
			}
	}
	
	document.getElementById('map_sel_'+dept).style.display = '';
	
	var param = 'part_id='+part_id+'&dept='+dept;
	new net.ContentLoader('interpro.php', display_interpro_results, '', 'POST', param, '', 'test parmfontciotn');
	
}

function wait_loading() {
	document.getElementById('fibra_region_detail').style.display = 'none';
	document.getElementById('fibra_region_loading').style.display = '';
}

function display_interpro_results() {
	document.getElementById('fibra_region_detail').innerHTML = this.req.responseText;
	document.getElementById('fibra_region_loading').style.display = 'none';
	document.getElementById('fibra_region_detail').style.display = '';
}

function cndb_projet_show(ref) {
	window.location = 'fiche_reference.php?ref=' + ref
}

