function affichCacheZone(champ){
	if (document.getElementById(champ).style.display == 'none'){
		document.getElementById(champ).style.display = '';
	}else{
		document.getElementById(champ).style.display = 'none';
	}
}
	
function MM_openBrWindow(URL,Nom,Caract) {
	window.open(URL,Nom,Caract);
}

var idSpan = "";

function afficherSpan(e,titreNormalise){
	idSpan=titreNormalise;
	$(titreNormalise).style.display='inline';
	var posx=mousePositionX(e)+10;
	var posy=mousePositionY(e)+10;
	$(titreNormalise).style.top=posy+"px";
	tailleFenetre = screen.width;
	if(posx+400>tailleFenetre)
		$(titreNormalise).style.right=(tailleFenetre-posx)+"px";
	else
		$(titreNormalise).style.left=posx+"px";
		
}

function cacherSpan(titreNormalise){
	$(titreNormalise).style.display='none';
}

function completerSpan(xhr){
	if (xhr.status == 200){
        $(idSpan).innerHTML = xhr.responseText;
    }else{
        $(idSpan).innerHTML = xhr.status;
    }
}

function synthesePresentation(titreNormalise){
	new Ajax.Request(
		'synthesePresentation.php',
		{
			method: 'post',
			parameters: {titreNormalise: titreNormalise},
			onSuccess: completerSpan,
		}
	);
}

function mousePositionX(e){
	var posx = 0;
	if(!e) var e = window.event;
	if(e.pageX)
		posx=e.pageX;
	else if(e.clientX)
		posx = e.clientX;
	return posx;
}

function mousePositionY(e){
	var posy = 0;
	if(!e) var e = window.event;
	if(e.pageY)
		posy=e.pageY;
	else if(e.clientY)
		posy = e.clientY;
	return posy;
}
