// JavaScript Document

function modifImage(id, src)
{
	document.getElementById(id).src = nameServeur + src;	
}

function fileGET(fichier)
{
	return fileAjax(fichier,null,"GET",false);
}

function filePOST(fichier,info)
{
	return fileAjax(fichier,info,"POST",true);
}

function fileAjax(fichier,info,format,asyn)
{
	if(window.XMLHttpRequest) // FIREFOX
	  xhr_object = new XMLHttpRequest(); 
	else if(window.ActiveXObject) // IE
	  xhr_object = new ActiveXObject("Microsoft.XMLHTTP"); 
	else 
	  return(false); 
	  
	xhr_object.open(format, fichier, asyn); 
	if (format == "POST")
	{
		xhr_object.setRequestHeader("Content-type", "application/x-www-form-urlencoded");  
		xhr_object.onreadystatechange = function() {   
		   if(xhr_object.readyState == 4)  
		   {
//			   alert(xhr_object.responseText);
			  afficher(xhr_object.responseText);   
		   }

		}  

	}
	xhr_object.send(info); 
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}

function afficherElement(obj,etat)
{
	var el = document.getElementById(obj);
	if (!el) return;
	if(etat)
	{
		el.style.display = "block";
	}
	else
	{
		el.style.display = "none";
	}
}

function chgcolor(ligne,action)
{
	if (action == 'in')
		col1 = 'E2FFE1';
	else
	if (action == 'clic')
		col1 = 'FFCC99';
	else
		col1 = '';
		
	ligne.setAttribute('bgcolor', col1, 0);
}

function chgClassName(id, name)
{
	id.className  = name;
}

function allerAURL(url)
{
	this.document.location = url;
}

