function getHTTPObject() {
	var xmlhttp;
	/*@cc_on
	@if (@_jscript_version >= 5)
		try {
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				xmlhttp = false;
			}
		}
	@else
		xmlhttp = false;
	@end @*/
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		try {
			xmlhttp = new XMLHttpRequest();
		} catch (e) {
			xmlhttp = false;
		}
	}
	return xmlhttp;
}

var http = getHTTPObject();



function ajaxGET(url) {
	// Préparation d'une requête asynchrone de type GET
	http.open("GET", url,true);
	http.onreadystatechange = AjaxRetour;
	http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	http.send(null);
}


function AjaxRetour() {
	// 4 = tout est OK
	if (http.readyState == 4) {
		if(http.responseText!='' && http.responseText!=null) {
			eval(http.responseText);
		//	alert(http.responseText);
		}
	}
} 

function avertir() {
	alert('Le produit a été ajouté au bon de commande');
}

var qte;
function setQte(id, val) {
	qte = parseInt(Dom('qte'+id).value) + val;
	if(qte>=1) {
		Dom('qte'+id).value = qte;
		ajaxGET('bonCMDE_process.asp?idlg='+id+'&setQte='+qte);
	}
}

function supprLG(supprLG) {
	if(confirm('Voulez-vous supprimer cet article de votre bon de commande ?'))
		ajaxGET('bonCMDE_process.asp?supprLG='+supprLG);
}
