<!--


function Start() {
	ReLoadMiniChat(10000);
	ReLoadMiniMails(60000);
	ReLoadOneliner(60000);
}

function StartNolog() {
	ReLoadMiniChat(100000);
	ReLoadOneliner(600000);
}

function ReLoadMiniChat(interval) {
	window.setTimeout("ReLoadMiniChat("+interval+")",interval);
	sendData('', 'script_chat.php');
	getMyHTML('script_referrers.php','zone_referrers');
}

function ReLoadMiniMails(interval) {
	window.setTimeout("ReLoadMiniMails("+interval+")",interval);
	getMyHTML('script_mmails.php','zone_mmails');
}

function ReLoadOneliner(interval) {
	window.setTimeout("ReLoadOneliner("+interval+")",interval);
	getMyHTML('script_oneliner.php','zone_oneliner');
}

function TimeoutMiniChat(interval) {
	window.setTimeout("ReLoadMiniChat("+interval+")",interval);
}

function traduire(post_du_minichat,page)
{
       /*
      google.language.translate(post_du_minichat, "fr", "en", function(result) {
        if (!result.error) {
        	sendData(result.translation,page);
        }
      });
    */
      sendData(post_du_minichat,page);
}

	function sendData(data, page)
	{
	
		if(document.all)
		{
			//Internet Explorer
			var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
		}//fin if
		else
		{
		    //Mozilla
			var XhrObj = new XMLHttpRequest();
		}//fin else

		//définition de l'endroit d'affichage:
		var content = document.getElementById("minichat");
		
		XhrObj.open("POST", page);

		if(XhrObj.readyState == 1) 
		{  
		//document.getElementById("minichat_loading").innerHTML = "Loading Response..."; 
		afficher_masquer("minichat_loading");
		} 
		
		//Ok pour la page cible
		XhrObj.onreadystatechange = function()
		{
			if (XhrObj.readyState == 4 && XhrObj.status == 200)
				{
				content.innerHTML = XhrObj.responseText ;
				//document.getElementById("minichat_loading").innerHTML = "OK chargé"; 
				afficher_masquer("minichat_loading");
				}
		}

		XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		data=data.replace(/%/g,"%25");
		data=data.replace(/ /g,"%20");
		data=data.replace(/&/g,"%26");
		data=data.replace(/\+/g,"%2B");
		data=data.replace(/=/g,"%3D");
		data='msg='+data;
		XhrObj.send(data);
	}
	
	
 
function popupcentree(page,largeur,hauteur,options)
{
var top=(screen.height-hauteur)/2;
var left=(screen.width-largeur)/2;
window.open(page,"","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
}

function setCheckboxes(theForm, elementName, isChecked)
{
   var chkboxes = document.forms[theForm].elements[elementName];
   var count = chkboxes.length;

   if (count)
   {
      for (var i = 0; i < count; i++)
      {
         chkboxes[i].checked = isChecked;
          }
   }
   else
   {
          chkboxes.checked = isChecked;
   }
   return true;
} 

function getMyHTML(serverPage, objID) {

// Script pour les images des dossiers	
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@end @*/

if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
xmlhttp = new XMLHttpRequest();
}

var obj = document.getElementById(objID);
xmlhttp.open("POST", serverPage);
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
obj.innerHTML = xmlhttp.responseText;
}
}
xmlhttp.send(null);
}

function display(calque)
{
document.getElementById(calque).style.display=document.getElementById(calque).style.display=="none"?"block":"none";
}

function afficher_masquer(calque)
{
document.getElementById(calque).style.visibility=document.getElementById(calque).style.visibility=="visible"?"hidden":"visible";
}


//-->
