function lanceTimer(){
	Timer = window.setTimeout('cache()',500);
}

function deleteTimer(){
	if(Timer){
		window.clearTimeout(Timer);
	}
}

function cache() {
	if(Timer){
		window.clearTimeout(Timer);
		if(id_rubrique_tmp != -1){
			document.getElementById("divArticle_" + id_rubrique_tmp).style.display = "none";					
		}	
		if(obj_tmp != null){
			/*obj_tmp.bgColor = couleur_tmp;
			obj_tmp.style.color = "#FFFFFF";
			obj_tmp.style.border = "";*/
			if(id_rubrique_active != id_rubrique_tmp){
				obj_tmp.style.background = "url(../images/" + couleur_tmp + "-off.gif)";
			}	
		}
	}
}

function changeClass(obj, id_article, couleur){
	obj.bgColor = "#EDEDED";
	//document.getElementById("lien_" + id_article).style.color = couleur;		
	document.getElementById("lien_" + id_article).style.color = "#37AFEA";
}

function retourClass(obj, id_article, couleur){
	obj.bgColor = "";
	document.getElementById("lien_" + id_article).style.color = couleur;	
}

function Pagehome(){
	window.location.href = "../index.php";
}

function preloadImages() {
	var d = document;
	if(d.images){
		if(!d.p){
			d.p = new Array();
		}
		var i, j = d.p.length;
		var aImg = preloadImages.arguments;
		for(i = 0; i<aImg.length; i++){
			if (aImg[i].indexOf("#")!=0){
				d.p[j] = new Image;
				d.p[j++].src = "images/"+aImg[i];						
			}
		}
	}
}

function montreArticle(id_article, page){
	if(id_article == ''){
		Pagehome();
	}else{
		window.location.href="../index.php?id="+id_article;
	}
}

function recupLangue(id_langue){
	document.frm.langue.value=id_langue;
	document.frm.submit();
}

var id_rubrique_tmp = "-1";
function showArticle(id_rubrique, couleur, obj){		
	if(id_rubrique_tmp != -1){
		document.getElementById("divArticle_" + id_rubrique_tmp).style.display = "none";	
		//obj_tmp.bgColor = couleur_tmp;
		//obj_tmp.style.color = "#FFFFFF";
		//obj_tmp.style.border = "";
		if(id_rubrique_active != id_rubrique_tmp){
			obj_tmp.style.background = "url(../images/" + couleur_tmp + "-off.gif) no-repeat";
		}				
	}
	if(document.getElementById("divArticle_" + id_rubrique) != null){
		document.getElementById("divArticle_" + id_rubrique).style.left = (GetAbsPos(obj,'X') + 1) + "px";
		document.getElementById("divArticle_" + id_rubrique).style.top = (GetAbsPos(obj,'Y') + 22) + "px";
		document.getElementById("divArticle_" + id_rubrique).style.display = "";
		id_rubrique_tmp = id_rubrique;
	}
	
	/*obj.bgColor = "#FFFFFF";
	obj.style.color = "#990033";
	obj.style.borderTop = "solid 1px #990033";*/
	
	obj.style.background = "url(../images/" + couleur + "-on.gif) no-repeat";
	
	//obj.style.borderBottom = "solid 1px #990033";

	obj_tmp = obj;	
	couleur_tmp = couleur;
	
	if(Timer){
		window.clearTimeout(Timer);
	}
}

function GetAbsPos(obj,XY){
	objBody=document.body;
	Position=0;
	while (obj != objBody){
		switch (XY){
		case 'X':
			Position+=obj.offsetLeft;
			break;
		case 'Y':
			Position+=obj.offsetTop;
			break;
		}
		obj=obj.offsetParent;
	}
	return Position;
}