function getXhr(){
var xhr = null; 
if(window.XMLHttpRequest) // Firefox et autres
xhr = new XMLHttpRequest(); 
else if(window.ActiveXObject){ // Internet Explorer 
try {
xhr = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
}
else { // XMLHttpRequest non support par le navigateur 
alert("Votre navigateur ne supporte pas le AJAX"); 
xhr = false; 
} 
return xhr
}



function click_op(objet,op){
        val = eval(document.caddie.elements[objet].value);
        nval = (parseInt(op)+val>=0)? parseInt(op)+val : 0;
		if (nval < 1){
			nval = 1;
			alert("1 produit minimum svp");
		}
        document.caddie.elements["n_qts"].value = nval;
		
        /*document.caddie.submit();*/
       }
		
		
function click_commande(objet,op) {
        val = eval(document.caddie.elements[objet].value);
        nval = (parseInt(op)+val>=0)? parseInt(op)+val : 0;
				if (nval < 1){
			nval = 1;
			alert("1 produit minimum svp");
		}
        document.caddie.elements[objet].value = nval;
        document.caddie.submit();
        }
		
		
function help(message,champ)
{
if(document.getElementById)
document.getElementById(champ).innerHTML = message;
} 

function replaceGui(chaine) {
chaine=chaine.replace(/["]/g,"'");
return chaine;
}

function ViewContent()
{
var Win = open("","","menubar=yes,scrollbars=yes");
  Win.moveTo(200,200);
  Win.document.write("<html><link href=\"styles.css\" rel=\"stylesheet\" type=\"text/css\"><body bgcolor=\"#000000\">");
  Win.document.write(document.getElementById("memoHtml1").innerHTML);
  Win.document.write("</body></html>");
  Win.document.close();
}

function PopupImage(img) { 
html = '<HTML><HEAD><TITLE>Image</TITLE><meta http-equiv="Pragma" content="no-cache"></HEAD><BODY leftmargin=0 marginwidth=0 topmargin=0 marginheigth=0 oncontextmenu="return false"  bgcolor="#000000"><CENTER>'+
'<a href="#" onClick="window.close()"><IMG SRC="'+img+'" BORDER=0 NAME=monImage alt="" border="0" onLoad="window.resizeTo(document.monImage.width+20,document.monImage.height+80); window.moveTo((screen.width-document.monImage.width)/2,5)"> </a></CENTER></BODY></HTML>';
ouvrirImage = window.open('','_blank','toolbar=0,location=0,menuBar=0,scrollbars=0,resizable=0');
ouvrirImage.document.write(html);
}
