function get_reference(id_article,id_cible){
$('#'+id_cible).load("spip.php?page=archive",{'id_article':id_article},function(){document.getElementById(id_cible).style.display="block";centrerAffichage(id_cible);});
}

function get_image(id_doc,id_cible){
$('#'+id_cible).load("spip.php?page=image",{'id_document':id_doc},function(){document.getElementById(id_cible).style.display="block";centrerAffichage(id_cible);});
}

function clear_reference(id_cible){
document.getElementById(id_cible).innerHTML="";
document.getElementById(id_cible).style.display="none";
window.onscroll = function(){};
}

function init_reference(){

}

function get_photo(id_article,id_cible){
$('#'+id_cible).load("spip.php?page=photo",{'id_article':id_article},function(){document.getElementById(id_cible).style.display="block";centrerAffichage(id_cible);});
}


/////////////////////////////////////////////////////////////////////////////////////////


// controle le chargement de l'image 
function centrerAffichage(id){

gdim=document.getElementById(id);

//taille de la page en Y
	if (document.documentElement.clientHeight){
		yScroll = document.documentElement.clientHeight;
		}
		else
		{
    yScroll = document.body.clientHeight;
    }

//Distance de Scrolling en Y
var yScrolltop;
	if (self.pageYOffset) {
		yScrolltop = self.pageYOffset;
	} else if (document.documentElement && document.documentElement.scrollTop ){	 // Explorer 6 Strict
		yScrolltop = document.documentElement.scrollTop;
	} else if (document.body) {// all other Explorers
		yScrolltop = document.body.scrollTop;
	}  	

//la taille de la fenetre ajax en y n'est pas prise en compte, on force la valeur a 500.
//gdim.offsetHeight
dist_top=(yScrolltop + ((yScroll/*-gdim.offsetHeight*/-500)/2));
gdim.style.top=dist_top+"px";
/*alert ("test en cours: "+dist_top+"px"+" id"+id);*/
gdim.onclick = function() {clear_reference(id);}
window.onscroll = function(){centrerAffichage(id)};
} 

//////////////////////////////////////////////////////////////////////////////////



function position(id_cible){
return true;
}
