 	/**
	 * Permet d'envoyer des données en GET ou POST en utilisant les XmlHttpRequest
	 */
	function sendData(param, page)
	{
		if(document.all)
		{
			//Internet Explorer
			var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
		}//fin if
		else
		{
		    //Mozilla
			var XhrObj = new XMLHttpRequest();
		}//fin else

		//définition de l'endroit d'affichage:
		var content = document.getElementById("contenusousmenu");
		
		XhrObj.open("POST", page);

		//Ok pour la page cible
		XhrObj.onreadystatechange = function()
		{
			if (XhrObj.readyState == 4 && XhrObj.status == 200)
				content.innerHTML = XhrObj.responseText ;
		}

		XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		XhrObj.send(param);
	}//fin fonction SendData

/**
	 * Permet d'envoyer des données en GET ou POST en utilisant les XmlHttpRequest
	 */
	function sendData2(param, page)
	{
		if(document.all)
		{
			//Internet Explorer
			var XhrObj = new ActiveXObject("Microsoft.XMLHTTP") ;
		}//fin if
		else
		{
		    //Mozilla
			var XhrObj = new XMLHttpRequest();
		}//fin else

		//définition de l'endroit d'affichage:
		var content = document.getElementById("contenusousmenu2");
		
		XhrObj.open("POST", page);

		//Ok pour la page cible
		XhrObj.onreadystatechange = function()
		{
			if (XhrObj.readyState == 4 && XhrObj.status == 200)
				content.innerHTML = XhrObj.responseText ;
		}

		XhrObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
		XhrObj.send(param);
	}//fin fonction SendData   



function openregister()
{
jQuery(document).ready(function(){
tb_show("Nouveaux compte","register.php?width=700&amp;height=350","");
});
}
function openvendeur(idV)
{
this.idV = idV;
jQuery(document).ready(function(){
tb_show("Info Vendeur","info_vendeur.php?width=450&amp;height=150&id_vendeur="+idV+"","");
});
}
function opencondition()
{
jQuery(document).ready(function(){
tb_show("Condition","condition.php?width=700&amp;height=350","");
});
}


//___________________________
function delcata(did){

var dd=confirm("Voulez-vous supprimer se produits du catalogue? !!");
if (dd){
document.location.href="voir_article.php?delcata=" + did ;
}
}
//___________________________
function etatcata0(did){

var dd=confirm("Voulez-vous se produit inactif? !!");
if (dd){
document.location.href="voir_article.php?etatcata0=" + did ;
}
}
//___________________________
function etatcata1(did){

var dd=confirm("Voulez-vous se poduit actif? !!");
if (dd){
document.location.href="voir_article.php?etatcata1=" + did ;
}
}
//___________________________
function etatcatapart0(did){

var dd=confirm("Voulez-vous se produit inactif? !!");
if (dd){
document.location.href="voir_articlePart.php?etatcatapart0=" + did ;
}
}
//___________________________
function etatcatapart1(did){

var dd=confirm("Voulez-vous se poduit actif? !!");
if (dd){
document.location.href="voir_articlePart.php?etatcatapart1=" + did ;
}
}

/*
function redimImage(oImg,inMW,inMH){var type=oImg.src.substring(oImg.src.length-3,oImg.src.length);
if(type=="png"){oImg.className="png_hack";}else{var maxWidth=inMW;var maxHeight=inMH;var dW=0;var dH=0;var h=dH=oImg.height;var w=dW=oImg.width;if((h>=maxHeight)||(w>=maxWidth)){if((h>=maxHeight)&&(w>=maxWidth)){if(h>w){dH=maxHeight;
dW=parseInt((w*dH)/h,10);}else{dW=maxWidth;dH=parseInt((h*dW)/w,10);}}else{if((h>maxHeight)&&(w<maxWidth)){dH=maxHeight;dW=parseInt((w*dH)/h,10);}else{if((h<maxHeight)&&(w>maxWidth)){dW=maxWidth;dH=parseInt((h*dW)/w,10);}}}}if(oImg.width<dW||oImg.height<dH){oImg.attributes.removeNamedItem("width");oImg.attributes.removeNamedItem("height");
}else{oImg.width=dW;oImg.height=dH;}}}
function resizeImage(image,largeurMax,hauteurMax){var rapportLargeur=0;var rapportHauteur=0;if(document.getElementById(image)){image=document.getElementById(image);}rapportLargeur=image.width/largeurMax;rapportHauteur=image.height/hauteurMax;if(rapportLargeur>=rapportHauteur){image.style.width=largeurMax+"px";
}else{image.style.height=hauteurMax+"px";}}

*/
function redimImage(oImg,inMW,inMH){var type=oImg.src.substring(oImg.src.length-3,oImg.src.length);
var maxWidth=inMW;var maxHeight=inMH;var dW=0;var dH=0;var h=dH=oImg.height;var w=dW=oImg.width;if((h>=maxHeight)||(w>=maxWidth)){if((h>=maxHeight)&&(w>=maxWidth)){if(h>w){dH=maxHeight;
dW=parseInt((w*dH)/h,10);}else{dW=maxWidth;dH=parseInt((h*dW)/w,10);}}else{if((h>maxHeight)&&(w<maxWidth)){dH=maxHeight;dW=parseInt((w*dH)/h,10);}else{if((h<maxHeight)&&(w>maxWidth)){dW=maxWidth;dH=parseInt((h*dW)/w,10);}}}}if(oImg.width<dW||oImg.height<dH){oImg.attributes.removeNamedItem("width");oImg.attributes.removeNamedItem("height");
}else{oImg.width=dW;oImg.height=dH;}}
function resizeImage(image,largeurMax,hauteurMax){var rapportLargeur=0;var rapportHauteur=0;if(document.getElementById(image)){image=document.getElementById(image);}rapportLargeur=image.width/largeurMax;rapportHauteur=image.height/hauteurMax;if(rapportLargeur>=rapportHauteur){image.style.width=largeurMax+"px";
}else{image.style.height=hauteurMax+"px";}}
/**************************************************/
/* Fontion frais de port                          */
/**************************************************/

function writediv(texte)
{
document.getElementById('pseudobox').innerHTML = texte;
}

function verifPseudo(pseudo)
{
if(pseudo != '')
{
if(pseudo.length<1)
writediv('<b>'+pseudo+'</b>');
else if(pseudo.length>100)
writediv('<b>'+pseudo+'</b>');
else if(texte = file('testP2.php?pseudo='+escape(pseudo)))
{
if(texte == 1)
writediv('<div style="color:red;text-align:left;">Frais de port : '+texte+'&euro;</div>');
else if(texte == 2)
writediv('<div style="color:red;text-align:left;">Frais de port : '+texte+'&euro;</div>');
else
writediv('<div style="color:red;text-align:left;">Frais de port : '+texte+'&euro;</div>');
}
}

}

function file(fichier)
{
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("GET", fichier, false);
xhr_object.send(null);
if(xhr_object.readyState == 4) return(xhr_object.responseText);
else return(false);
}
  function addPlugin(src,img,t,m){window.sidebar.addSearchEngine(src,img,t,m);}


