var last_id = "";
var det_id = "detail";
var pre_id = "preview";
var debugmode = false;
// GESTION DE CLICS, PREND L'IDENTIFIANT DE L'OEUVRE ET SA HAUTEUR
function clicGlo(id) {
	color_menu(id)
	aj_doshow(id,'glo_fiche.php','o')
}
function clicBio(id) {
	//color_menu(id)
	var str_titre = "";
	switch(id) {
		case 'bio1':
			str_titre = "D&eacute;marche artistique";
			break;
		case 'bio2':
			str_titre = "Parcours professionnel";
			break;
		case 'bio3':
			str_titre = "Expositions";
			break;
		case 'bio4':
			str_titre = "Publications";
			break;
		case 'bio5':
			str_titre = "Apparitions m&eacute;diatiques";
			break;
	}
	document.getElementById("bio_h2").innerHTML = str_titre;
	aj_doshowbio(id,'bio_fiche.php','o')
}
function clicDes(id) {
	color_menu(id)
	aj_doshow(id,'d_fiche.php','o')
}
function clicReg(id) {
	color_menu(id)
	aj_doshow(id,'t_fiche.php','o')
}
// GESTION DE L'AFFICHAGE, PREND L'IDENTIFIANT DE L'IMAGE
function show_image(nom) {
	show_effect('tableaux/'+nom+'.jpg');
}
function show_dessin(nom) {
	show_effect('dessins/'+nom+'.jpg');
}
function show_effect(fsrc) {
	myImage = new Image();
	myImage.src = fsrc;
	debug('show_effect : src = ' + myImage.src + ', y = ' + myImage.height + 'px');
	$('wait').hide();
	$('detail').show({ duration: 0.7, from: 0, to: 1 });
	$('peinture').appear({ duration: 1, from: 0, to: 1 });
	new Effect.Morph('peinture', { 
  			duration: 1,
  			style: 'height:' + myImage.height + 'px;'
			});
}
function show_bio(fsrc) {
	myImage = new Image();
	myImage.src = fsrc;
	debug('show_effect : src = ' + myImage.src + ', y = ' + myImage.height + 2 + 'px');
	$('wait').hide();
	$('detail').show({ duration: 0.7, from: 0, to: 1 });
	$('peinture').appear({ duration: 1, from: 0, to: 1 });
	new Effect.Morph('peinture', { 
  			duration: 1,
  			style: 'height:' + (myImage.height + 2) + 'px;'
			});
	bioloaded = true;
}
//COLORATION DU MENU, PREND L'IDENTIFIANT DE L'IMAGE DANS L'ITEM LISTE
function color_menu(id)
{
	if (id) {
		if (document.getElementById('th_'+last_id)) {
			document.getElementById('th_'+last_id).style.border = "2px solid #FFFFFF"
		}
		last_id = id;
		if (document.getElementById('th_'+id)) {
			document.getElementById('th_'+id).style.border = "2px solid #7dac3c"
		}
	}
}

/*function show_image(nom) {
	myImage = new Image();
	myImage.src = 'tableaux/'+nom+'.jpg';
	debug('show_image : ' + nom + ', src = ' + myImage.src + ', y = ' + myImage.height + 'px');
	$('wait').hide();
	$('detail').show({ duration: 0.7, from: 0, to: 1 });
	$('peinture').appear({ duration: 1, from: 0, to: 1 });
	new Effect.Morph('peinture', { 
  			duration: 1,
  			style: 'height:' + myImage.height + 'px;'
			});
	//window.clearTimeout()
}
function show_dessin(nom) {
	myImage = new Image();
	myImage.src = 'dessins/'+nom+'.jpg';
	debug('show_dessin : ' + nom + ', src = ' + myImage.src + ', y = ' + myImage.height + 'px');
	$('wait').hide();
	$('detail').show({ duration: 0.7, from: 0, to: 1 });
	$('peinture').appear({ duration: 1, from: 0, to: 1 });
	new Effect.Morph('peinture', { 
  			duration: 1,
  			style: 'height:' + myImage.height + 'px;'
			});
	//window.clearTimeout()
}*/
/*function open_image(_src) {
	myImage = new Image();
	myImage.src = _src;
	if (myImage.width > 50) {
		$('mask').appear({ duration: 0.7, from: 0, to: 0.5 });
		$('container').show();
		new Effect.Morph('holder', { 
  			duration: 0.7,
  			style: 'width:'+myImage.width+'px; height:'+(myImage.height + 35)+'px;'
			});
		//$('holder').morph('width:'+myImage.width+'px; height:'+(myImage.height + 35)+'px;');
		document.getElementById("holder").innerHTML = '';
		window.setTimeout('show_image(\''+_src+'\');', 700);
	}
}*/
function initdebug() {
	document.write("<div id='debug'><strong>Info D&eacute;bug</strong><br /></div>");
	}

function debug(msg) {
	if (debugmode) {
		document.getElementById('debug').innerHTML = document.getElementById('debug').innerHTML + msg + '<br />';
		}
	}
		
