var Timer;
		var obj_tmp;
		var couleur_tmp;
		var id_rubrique_active = "0";
		
		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;
		}
		
		function envoiArticle(id_article, page){
			if(page != ''){				
									window.location.href="http://www.datawords.co.uk/"+page;
							}else{
				window.location.href="http://www.datawords.co.uk/index.php?id="+id_article;
			}
		}
		
		function montreArticle(id_article, page){
			if(id_article == ''){
				Pagehome();
			}else{
				window.location.href="http://www.datawords.co.uk/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(http://www.datawords.co.uk/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;
				document.getElementById("divArticle_" + id_rubrique).style.top = GetAbsPos(obj,'Y') + 22;
				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(http://www.datawords.co.uk/images/" + couleur + "-on.gif) no-repeat";
			
			//obj.style.borderBottom = "solid 1px #990033";

			obj_tmp = obj;	
			couleur_tmp = couleur;
			
			if(Timer){
				window.clearTimeout(Timer);
			}
		}
		
		function afficheRubriqueUnique(id_lien, page){	
			if(page != ''){
									window.location.href = "http://www.datawords.co.uk/" + page;
							}else{		
				window.location.href = "http://www.datawords.co.uk/index.php?id=" + id_lien;		
			}		
		}
		
		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(http://www.datawords.co.uk/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 = "http://www.datawords.co.uk/index.php";
		}

		function preloadImages() {
			var d = document;
			if(d.images){
				if(!d.p){
					d.p = new Array();
				}
				var i, j = d.p.length;
				var a = preloadImages.arguments;
				for(i = 0; i<a.length; i++){
					if (a[i].indexOf("#")!=0){
						d.p[j] = new Image;
						d.p[j++].src = "http://www.datawords.co.uk/images/"+a[i];						
					}
				}
			}
		}