// JavaScript Document

var position_x = 0;
var position_y = 0;
var idOutilOuvert = 'tableEditeur';
var idImageOuvert = '';


function ouvrir_image(id,width,height)
{
	nyro = document.getElementById('nyroModalFull');
	img  = document.getElementById(id);

	width = nyro.style.right - nyro.style.left;
	alert(nyro.style.right);

	position_x = (nyro.availWidth-width)/2; //(largeur ecran - largeur image)/2
	position_y = (nyro.availHeight-height-10)/2; //(hauteur ecran - hauteur image)/2
	img.style.top = position_y;
	img.style.left = position_x;
	afficherElement(id,true);
	idImageOuvert = id;
}

function fermer_image(id)
{
	afficherElement(id,false);
	idImageOuvert = '';
}


function afficherOutils (id)
{
	afficherElement('tableTemoignage',false);
	if (id != idOutilOuvert)
	{
		afficherElement(idOutilOuvert, false);
		afficherElement(id, true);
		idOutilOuvert = id;
		
		if (idImageOuvert != '')
			fermer_image(idImageOuvert);
	}
}

function setOutilOuvertDefault(id)
{
	idOutilOuvert = id;
}

