function confirmLink(theLink, theQuery)
{
// Confirmation is not required in the configuration file
	if (confirmMsg == '') {
		return true;
	}
	var is_confirmed = confirm(confirmMsg + ' ' + theQuery);
	if (is_confirmed) {
		theLink.href += '&is_js_confirmed=1';
	}
	return is_confirmed;
} // end of the 'confirmLink()' function
var confirmMsg  = 'Voulez-vous vraiment supprimer';

function confirmLinkForm(theLink, theQuery)
{
// Confirmation is not required in the configuration file
	if (confirmMsg == '') {
		return true;
	}
	var is_confirmed = confirm(confirmMsg + ' ' + theQuery);
	if (is_confirmed) {
		theLink.submit();
	}
	return is_confirmed;
} // end of the 'confirmLink()' function

function OuvrirFenetre(url,nom,details)
{ 
	window.open(url,nom,details)
}

<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function showbigImage(imagepath,largeur,hauteur) {
			var winProperties = "toolbar=no,location=no,directories=no,status=no,copyhistory=no,width="+largeur+",height="+hauteur+",resizable=yes";
			var url = "showpopupimage.html?imageurl=" + imagepath;
			window.open(url,'big',winProperties);
		}
		
function showDiv(id){
	if(document.getElementById(id).style.display == 'none'){
		document.getElementById(id).style.display='inline';
	}
	else{
		document.getElementById(id).style.display='none';
	}
}

function getData(url)
{
	http_request = false;

	if(window.XMLHttpRequest) // FIREFOX
		http_request = new XMLHttpRequest();
	else if(window.ActiveXObject) // IE
		http_request = new ActiveXObject("Microsoft.XMLHTTP");

    if (!http_request) {
        alert('Abandon :( Impossible de créer une instance XMLHTTP');
        return false;
    }

    http_request.onreadystatechange = function()
    {
		if(http_request.readyState == 4)
		{
			eval(http_request.responseText);
		}
    }

    http_request.open('POST', url, true);
    http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

    http_request.send(null);
}

function go(etat)
{
	getData("calculProgression.php?etat=0");
}

/* function getProgress(curPourc, idEnvoi, etat)
{
	if(etat == 0){
		document.getElementById('img_progress_envoi'+idEnvoi).src = "../images/barre_progression/progression_"+curPourc+".jpg";
		document.getElementById('img_progress_envoi'+idEnvoi).title = curPourc+"%";
		
		setTimeout('getData("calculProgression.php?etat=1")', 0);
	}
	else{
		document.location.href = "envois_visu.php";
	}
}*/

function getProgress(curPourc, idEnvoi, etat)
{
	if(etat == 0){
		document.getElementById('img_progress_envoi'+idEnvoi).value = curPourc+"%";
		
		setTimeout('getData("calculProgression.php?etat=1")', 0);
	}
	else{
		document.location.href = "envois_visu_en_cours.php";
	}
}

function chercherInscrit(url, chaine, page, nbEnregistrement){
	http_request = false;

	if(window.XMLHttpRequest) // FIREFOX
		http_request = new XMLHttpRequest();
	else if(window.ActiveXObject) // IE
		http_request = new ActiveXObject("Microsoft.XMLHTTP");

    if (!http_request) {
        alert('Abandon :( Impossible de créer une instance XMLHTTP');
        return false;
    }

    http_request.onreadystatechange = afficherInscritRecherche;

    http_request.open('POST', url, true);
    http_request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

    http_request.send("chaine="+chaine+"&page="+page+"&nbEnregistrement="+nbEnregistrement);
}

function afficherInscritRecherche() {
    if (http_request.readyState == 4) {
        if (http_request.status == 200) {
            blocInscrit = http_request.responseText;
            document.getElementById('affichage_inscrits').innerHTML = blocInscrit;
        } else {
            alert('Un problème est survenu avec la requête.');
        }
    }
}


