function file_old(fichier)
{
	var data=null;
	var xhr_object=null;
	if(window.XMLHttpRequest) xhr_object = new XMLHttpRequest();
	else if(window.ActiveXObject) xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
	else return(false);
	xhr_object.open("GET",fichier,false);
	xhr_object.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xhr_object.send(data);
	if(xhr_object.readyState == 4) return(xhr_object.responseText);
	else return(false);
}

function file(fichier,d)
{
	var data=null;
	var xhr_object=null;
	if(window.XMLHttpRequest) xhr_object=new XMLHttpRequest();
	else if(window.ActiveXObject) xhr_object=new ActiveXObject("Microsoft.XMLHTTP");
	else return(false);
	xhr_object.open("POST",fichier,true);
	xhr_object.onreadystatechange = function()
	{
		if(xhr_object.readyState==4)
		{
			if(xhr_object.status==200)
			{
				if(d!="") writediv(xhr_object.responseText,d);
			}

		}
		else
		{
			if(d=="droite") writediv('<div class="loading"><img src="images/loader.gif" alt="loading" /></div>','desc_action');
		}
	}
	xhr_object.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	xhr_object.send(data);
}


function writediv(texte,div)
{
    if(document.getElementById(div)) document.getElementById(div).innerHTML=texte;
}


function webcam()
{
	file('../ajax/js.php?method=webcam','webcam2');
}

