function importMandataire(id_mandataire)
{
		document.getElementById('div_import_'+id_mandataire).innerHTML = '<a href=\"javascript:importMandataire('+id_mandataire+');\"><img src="../img/indicator.gif" border=0></a>';
    var xmlhttp = getHTTPObject();
   	xmlhttp.open("GET", "../ajax/ajax_import_all_mandataire.php?trace=1&mandataire="+id_mandataire+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function copieFichierMandataire(id_mandataire)
{
		document.getElementById('div_copie_'+id_mandataire).innerHTML = '<a href=\"javascript:copieFichierMandataire('+id_mandataire+');\"><img src="../img/indicator.gif" border=0></a>';
    var xmlhttp = getHTTPObject();
   	xmlhttp.open("GET", "./liste_mandataire.php?id_mandataire="+id_mandataire+"&action=copie&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function activeMandataire(id_mandataire, actif)
{
		document.getElementById('td_active_'+id_mandataire).innerHTML = '<img src="../img/indicator.gif">';
    var xmlhttp = getHTTPObject();
   	xmlhttp.open("GET", "./liste_mandataire.php?id_mandataire="+id_mandataire+"&action=active&actif="+actif+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importMarqueAramis(id_marque)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_aramis.php?action=importMarqueAramis&marque="+escape(formatURL(id_marque))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importModeleAramis(modele, url_page)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_aramis.php?action=importModeleAramis&modele="+escape(formatURL(modele))+"&url="+escape(formatURL(url_page))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importModeleAramisSuivant(modele, url_page)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_aramis.php?action=importModeleAramisSuivant&modele="+escape(formatURL(modele))+"&url="+escape(formatURL(url_page))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function listeMarqueElite()
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_eliteauto.php?action=listeMarqueElite&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importMarqueElite(marque)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_eliteauto.php?action=importMarqueElite&marque="+escape(formatURL(marque))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importModeleElite(modele, url_page)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_eliteauto.php?action=importModeleElite&modele="+escape(formatURL(modele))+"&url="+escape(formatURL(url_page))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importMarqueAutoIES(marque, url_page)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_autoies.php?action=importMarqueAutoIES&marque="+escape(formatURL(marque))+"&lien_marque="+escape(formatURL(url_page))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importMarqueAutoPromo(id_marque)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_autopromo.php?action=importMarqueAutoPromo&marque="+escape(formatURL(id_marque))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importModeleAutoPromo(modele, url_page)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_autopromo.php?action=importModeleAutoPromo&modele="+escape(formatURL(modele))+"&url="+escape(formatURL(url_page))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importVehiculeAutoPromo(modele, url_page)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_autopromo.php?action=importVehiculeAutoPromo&modele="+escape(formatURL(modele))+"&url="+escape(formatURL(url_page))+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

function importMarqueModele()
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_noxauto.php?action=import&nocache="+Math.random(), true);
    xmlhttp.send(null);
}

	function formatURL(texte)
	{
		texte = texte.toString();
		texte = texte.replace(/\+/g,"[PLUS]");
		return texte;
	}

function maSelection(id_mandataire, ref_vehicule)
{
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "./ajax/ajax_selection.php?id_mandataire="+id_mandataire+"&ref_vehicule="+escape(ref_vehicule)+"&nocache="+Math.random(), true);
    xmlhttp.send(null);
	
}

function majSiteMapXML()
{
		document.getElementById('div_sitemap').innerHTML = '<a href=\"javascript:majSiteMapXML();\"><img src="../img/indicator.gif" border=0></a>';
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "../ajax/sitemap.php?nocache="+Math.random(), true);
    xmlhttp.send(null);
	
}

function bannirIpRobot(adresse_ip)
{
		//document.getElementById('div_sitemap').innerHTML = '<a href=\"javascript:majSiteMapXML();\"><img src="../img/indicator.gif" border=0></a>';
    var xmlhttp = getHTTPObject();
   	xmlhttp.open("GET", "../ajax/ajax_admin.php?adresse_ip="+adresse_ip+"&action=bannirIp&nocache="+Math.random(), true);
    xmlhttp.send(null);
	
}

function importAllMandataires()
{
		document.getElementById('div_import_all').innerHTML = '<a href=\"javascript:importAllMandataires();\"><img src="../img/indicator.gif" border=0></a>';
    var xmlhttp = getHTTPObject();
    xmlhttp.open("GET", "../ajax/ajax_import_all_mandataire.php?trace=1&nocache="+Math.random(), true);
    xmlhttp.send(null);
	
}
