// Procedures globales du projet
function fc_infoaffiche()
{
	// Initialisation
	fc_info = fc_getel('info');
	fc_contenu = fc_getel('infoligne');
	
	// Entête
	fc_ob = fc_infohaut();
	
	// Titres et messages
	for (i=2; i<fc_infoaffiche.arguments.length; i += 2){
		fc_ob += fc_infotitre(fc_infoaffiche.arguments[i]);
		fc_ob += fc_infomess(fc_infoaffiche.arguments[i+1]);
	}
	
	// Bas de page
	fc_ob += fc_infobas();			
	
	// Premier affichage pour mesurer la hauteur du tableau
	fc_contenu.innerHTML = fc_ob;
	u = fc_infoaffiche.arguments[1];
	if(fc_infoaffiche.arguments[0] == 'g'){
		the_left = fc_getleft(u) - 400;
	}else{
		the_left = fc_getleft(u) + 20;
	}
	the_top = fc_gettop(u) //+ u.offsetHeight;
	fc_info.style.left = the_left + 'px';
	fc_info.style.top = the_top + 'px';
	//fc_info.scrollIntoView();
	fc_info.style.display = '';
	hauteur = fc_info.offsetHeight;
	
	// Déplacement de la hauteur du tableau
	the_top -= hauteur;
	fc_info.style.top = the_top + 'px';
	//fc_info.scrollIntoView();
	
	// Correction éventuelle de la hauteur
	if (the_top < document.body.scrollTop){
		fc_info.style.top = document.body.scrollTop;
		//fc_info.scrollIntoView();
	}
	
	//fc_info.style.display = '';
}


function fc_infobas()
{
	return '<tr><td colspan=3 class="fc_spacebas"></td></tr>'
	+ '</table>';
}

function fc_infohaut()
{
	return '<table cellpadding="3" cellspacing="1" class="fc_interne">'
	+ '<tr><td colspan=3 class="fc_spacehaut"></td></tr>';
}

function fc_infomasque()
{
	fc_ce = ds_getel('info');
	fc_ce.style.display = 'none';
}

function fc_infomess(t)
{
	return '<tr><td class="fc_space"> </td><td class="fc_mess">' + t + '</td><td class="fc_space"> </td></tr>';
}

function fc_infotitre(t)
{
	return '<tr><td colspan=3 class="fc_spacetitre"></td></tr>'
	+ '<tr><td colspan=3 class="fc_spacetitre"></td></tr>'
	+ '<tr>'
	+ '<td class="fc_space"> </td>'
	+ '<td class="fc_titre">' + t + '</td>'
	+ '<td class="fc_space"> </td>'
	+ '</tr>'
	+ '<tr><td colspan=3 class="fc_spacetitre"></td></tr>';
}

function info_init()
{
	ds_ce = ds_getel('info');
}

function fc_getel(id)
{
	return document.getElementById(id);
}

function fc_getleft(el)
{
	var tmp = el.offsetLeft;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetLeft;
		el = el.offsetParent;
		}
	return tmp;
}

function fc_gettop(el)
{
	var tmp = el.offsetTop;
	el = el.offsetParent
	while(el) {
		tmp += el.offsetTop;
		el = el.offsetParent;
		}
	return tmp;	
}


