//Récupération de l'ID d'un objet
function getId(monObjet){
	return document.getElementById(monObjet);
}
//Récupère la taille de l'ecran
function getScreenWidth(){
	if (document.all){
		var larg = (document.documentElement.clientWidth);
	}else{
		var larg = (window.innerWidth);
	}	
	return larg;
}
function getScreenHeight(){
	if (document.all){
		var haut = (document.documentElement.clientHeight);
	}else{
		var haut = (window.innerHeight);
	}
	return haut;
}
function resizeObject(obj){
	if (navigator.userAgent.indexOf("MSIE 6") !=-1)
		var menuHeight = 160;
	else if(document.all)
		var menuHeight = 150;
	else
		var menuHeight = 150;
	if (getId('tdleft').offsetHeight > document.documentElement.clientHeight){
	 if(getId(obj).offsetHeight>trueHeight) trueHeight=getId(obj).offsetHeight;
		getId(obj).style.height = trueHeight + "px";
	}else{
		getId(obj).style.height = (getScreenHeight() - menuHeight) + "px";	
	}
	
}

//Renvoi une variable HTTPREQUEST
function varAjax(){
	if(window.XMLHttpRequest){ // Firefox 
		return new XMLHttpRequest(); 
	}else if(window.ActiveXObject){ // Internet Explorer 
		return new ActiveXObject("Microsoft.XMLHTTP"); 
	}else { // XMLHttpRequest non supporté par le navigateur 
		alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest..."); 
		return; 
	}
}


function positionObj(obj,l,h,event){
	//Taille ecran
	var eWidth = getScreenWidth();
	var eHeight = getScreenHeight();	
	//positionnement top et left de obj
	if(document.all){
		eTop = 150 + document.documentElement.scrollTop;
	}else{
		eTop = 150 + window.pageYOffset;	
	}
	getId(obj).style.top = eTop + "px";
	getId(obj).style.left = ((eWidth/2) - (l/2)) + "px";
}

function showFond(){
 	getId("fond").style.top = "0px";
	getId("fond").style.left = "0px";
	getId("fond").style.width =getScreenWidth()+"px";
	getId("fond").style.height =getScreenHeight()+"px";	
	getId("fond").style.display="block";
	getId("fond").style.visibility="visible";
}

function showImg(obj,l,graph,e){
	showFond();	
	positionObj(obj,l,800,e);
	getId('img_div').src = graph.src;
	getId(obj).style.visibility="visible";		
	getId(obj).style.display="block";
	//TEST SEB CEA IE6
	if((navigator.userAgent.indexOf("MSIE 7") == -1 && navigator.userAgent.indexOf("Mozilla") == -1) || navigator.userAgent.indexOf("MSIE 6") !=-1)
		fSwapSelect('hidden');
}

function hideImg(obj){
	getId(obj).style.display="";
 	getId(obj).style.visibility="hidden";		
 	getId("fond").style.display="none";
	getId("fond").style.visibility="hidden";
	//TEST SEB CEA IE6
	if((navigator.userAgent.indexOf("MSIE 7") == -1 && navigator.userAgent.indexOf("Mozilla") == -1) || navigator.userAgent.indexOf("MSIE 6") !=-1)
		fSwapSelect('visible');
}