var afficheDiv=0;
function displayDiv(div) {
	document.getElementById(div).style.display='block';
	afficheDiv++;
}
function hideDivDelay(div,delay) {
	setTimeout('hideDiv("'+div+'")',delay);
}
function hideDiv(div) {
	afficheDiv--;
	if (!afficheDiv>0) {
		afficheDiv=0;
		document.getElementById(div).style.display='none';
	} else {
//		window.alert("Fin Timeout "+afficheDiv);
	}
}

function updateBlog(url,div) {
// Activation du style du blog actif
		var blog=document.getElementById('col3d2m_').className;
		if (blog!='blog-') {document.getElementById(blog).className="float";}
		document.getElementById(div).className="float actif";
		document.getElementById("catlink").focus();
		document.getElementById("catlink").blur();
		document.getElementById('col3d2m_').className=div;
		var blog=document.getElementById('col3d2m_').className;
// Lancement de la requete Ajax
		var url2 = url.replace('categorie.php','contenu.php');
		updatePage('Chargement ...[{S}]Chargement ...');
		xmlHttpGet(url2,'updatePage(self.xmlHttpReq.responseText)');
		return false;
}
function updatePage(stri){
		arra=stri.split("[{S}]");
		document.getElementById("blog-detail").innerHTML = arra[0];
		document.getElementById("blog-rss"	 ).innerHTML = arra[1];
		if (arra.length>2) { document.getElementById("vote").innerHTML = arra[2]; displayDiv('preview');hideDivDelay('preview',1000);}
}
function compteKdo(kdo) {
		xmlHttpGet('/decompte.php?id='+kdo,'voidFunct');
}
function voidFunct(stri) {
}


function xmlHttpGet(strURL, strFunction) {
		var xmlHttpReq = false;
		var self = this;
		// Mozilla/Safari
		if (window.XMLHttpRequest) {
				self.xmlHttpReq = new XMLHttpRequest();
		}
		// IE
		else if (window.ActiveXObject) {
				self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
		}
		self.xmlHttpReq.open('GET', strURL, true);
		self.xmlHttpReq.onreadystatechange = function() {
				if (self.xmlHttpReq.readyState == 4) {
//							updatePage(self.xmlHttpReq.responseText);
							eval (strFunction);
				}
		}
		self.xmlHttpReq.send(null);
}
