//<![CDATA[
//çà
function modifEtatCom(idCom)
{
	$.ajax({
		type: "POST",
		url: GEST_COM_AJAX,
		data: 'mod=upd_etat_com&idcom='+idCom+'&idetat='+$('#select_etat'+idCom).val(),
		success: function(data){
			if (data !=''){
			$('#etat'+idCom).empty();
			$('#etat'+idCom).append(data);
			}
		}
	});
}

function recapImpayees()
{
	var msg = '', csvList, $form = $("#impayees");
	var lstIdCom, aIdCom, i;
	csvList = '';
	lstIdCom = '';
	$form.find(":option-sel").each(function(){ csvList += this.id + ', ' }).end();
	aIdCom = csvList.split(',')
	// nettoyage des champs vides
	for (var i=0; i<aIdCom.length; i++) {
			if (aIdCom[i] != ' '){
				if (lstIdCom == ''){
					lstIdCom = aIdCom[i];
				}else{
					lstIdCom = lstIdCom+','+aIdCom[i];
				}
			}
		}
	if (lstIdCom !=''){
		GB_showCenter('GreyBox', URL_PROJET_JS+'module/GestCom/recap.asp?lst='+lstIdCom+'&mod=impayees', 400, 600);
	}else{
		alert('Sélectionnez au moins une commande.')
	}
}

function recapPreparer()
{
	var msg = '', csvList, $form = $("#preparer");
	var lstIdCom, aIdCom, i;
	csvList = '';
	lstIdCom = '';
	$form.find(":option-sel").each(function(){ csvList += this.id + ', ' }).end();
	aIdCom = csvList.split(',')
	// nettoyage des champs vides
	for (var i=0; i<aIdCom.length; i++) {
			if (aIdCom[i] != ' '){
				if (lstIdCom == ''){
					lstIdCom = aIdCom[i];
				}else{
					lstIdCom = lstIdCom+','+aIdCom[i];
				}
			}
		}		
	if (lstIdCom !=''){
		GB_showCenter('GreyBox', URL_PROJET_JS+'module/GestCom/recap.asp?lst='+lstIdCom+'&mod=preparer', 400, 600);
	}else{
		alert('Sélectionnez au moins une commande.')
	}
}

function recapCommande()
{
	var msg = '', csvList, $form = $("#preparer");
	var lstIdCom, aIdCom, i;
	csvList = '';
	lstIdCom = '';
	$form.find(":option-sel").each(function(){ csvList += this.id + ', ' }).end();
	aIdCom = csvList.split(',')
	// nettoyage des champs vides
	for (var i=0; i<aIdCom.length; i++) {
			if (aIdCom[i] != ' '){
				if (lstIdCom == ''){
					lstIdCom = aIdCom[i];
				}else{
					lstIdCom = lstIdCom+','+aIdCom[i];
				}
			}
		}		
	if (lstIdCom !=''){
		GB_showCenter('GreyBox', URL_PROJET_JS+'module/GestCom/recapCom.asp?lst='+lstIdCom+'&mod=preparer', 400, 600);
	}else{
		alert('Sélectionnez au moins une commande.')
	}
}

//]]>