var xmlHttp;

function GetXmlHttpObject()
{
var objXMLHttp=null

try {
objXMLHttp = new ActiveXObject("Msxml2.XMLHTTP"); //later IE
} catch (e) {
try {
objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP"); //earlier IE
} catch (e) {
objXMLHttp = null;
}
}

if (objXMLHttp==null)
{
objXMLHttp=new XMLHttpRequest() //IE7, Firefox, Safari
}
return objXMLHttp
}


function modif_produits(ss_type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_affiche_produit_modif.php";
url=url+"?q="+ss_type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_produit_modif;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_produit_modif() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("affiche_produit_modif").innerHTML=xmlHttp.responseText;
 } 
}



function affiche_modif_news(news)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="affiche_modif_news.php";
url=url+"?q="+news;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_modif_news;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_modif_news() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("affiche_news").innerHTML=xmlHttp.responseText;
 } 
}








function tps(tp)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_affiche_tp_modif.php";
url=url+"?q="+tp;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_tp_modif;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_tp_modif() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("tps").innerHTML=xmlHttp.responseText;
 } 
}



function tps2(tp)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_affiche_tele_modif.php";
url=url+"?q="+tp;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_tp_modif2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_tp_modif2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("tps").innerHTML=xmlHttp.responseText;
 } 
}








function affiche_modif_ref(ref)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_affiche_ref.php";
url=url+"?q="+ref;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_modif_ref;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function affiche_modif_ref_tp(ref)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_affiche_ref_tp.php";
url=url+"?q="+ref;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_modif_ref;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_modif_ref() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("modif_affiche_ref").innerHTML=xmlHttp.responseText;
 } 
}




function ss_type_tp(tp)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_type_tp.php";
url=url+"?q="+tp;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_type_tp;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_type_tp() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("affiche_modif").innerHTML=xmlHttp.responseText;
 } 
}










function ajout_affiche_produits(ss_type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_ajout_affiche_produits.php";
url=url+"?q="+ss_type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_ajout_affiche_produits;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_ajout_affiche_produits() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("ajout_affiche_produit").innerHTML=xmlHttp.responseText;
 } 
}








function majbdd(qte, element)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="majqte.php";
url=url+"?q="+qte;
url=url+"&element="+element;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function majbdd2(qte, element)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="majqte2.php";
url=url+"?q="+qte;
url=url+"&element="+element;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}





// admin types de produits
function affiche_sous_type(type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_ss_type2.php";
url=url+"?q="+type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_sous_type;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_sous_type() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("affiche_ss_type").innerHTML=xmlHttp.responseText;
 } 
}

function affiche_sous_type2(type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_ss_type3.php";
url=url+"?q="+type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_sous_type2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_sous_type2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("affiche_ss_type2").innerHTML=xmlHttp.responseText;
 } 
}


function affiche_sous_type3(type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_ss_type3.php";
url=url+"?q="+type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_sous_type3;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_sous_type2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("affiche_ss_type3").innerHTML=xmlHttp.responseText;
 } 
}


function affiche_sous_type5(type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_ss_type4.php";
url=url+"?q="+type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_affiche_sous_type5;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_affiche_sous_type5() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("affiche_ss_type4").innerHTML=xmlHttp.responseText;
 } 
}












// admin types de produits
function produits(produit)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_produit.php";
url=url+"?q="+produit;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_produit;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_produit() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("produit2").innerHTML=xmlHttp.responseText;
 } 
}
//




// admin types de produits
function type_produits(type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_type.php";
url=url+"?q="+type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_type;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_type() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("type_produit").innerHTML=xmlHttp.responseText;
 } 
}
//
// admin ss_types de produits
function ss_type_produits(ss_type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_ss_type.php";
url=url+"?q="+ss_type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_ss_type;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_ss_type() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("ss_type_produit").innerHTML=xmlHttp.responseText;
 } 
}
//


function ss_type_produits3(ss_type)
{
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="admin_modif_ss_type.php";
url=url+"?q="+ss_type;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_ss_type3;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged_ss_type3() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("ss_type_produit3").innerHTML=xmlHttp.responseText;
 } 
}
//






function showUser(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="getuser.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged2;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}

function soustype(str)
{ 
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request");
 return;
 }
var url="getsstypes.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=stateChanged_ss_type;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}


function stateChanged2() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText;
 } 
}


function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("prix").innerHTML=xmlHttp.responseText;
 } 
}





    function TestInt(id)
    {
    //recuperation de l'element
    var d=document.getElementById(id);
    //test de l'integrité de l'element
     if (d.value!="")
     {
     if (isNaN(d.value)==false)
     {
     d.value=parseInt(d.value);
     }
     else
     {
     d.value='';
     alert('VOUS DEVEZ SAISIR UN NOMBRE > 0');
	 d.focus();
     }
     }else{alert('VOUS DEVEZ SAISIR UN NOMBRE > 0');
	 d.focus();
	 }
     }
