// (C)2008 Add Works

function devis_display() {
	// TYPE D'IMPRESSION
	var ar_x_ImpType          = new Array( 'numerique', 'offset' );
	var ar_x_ImpTypeNumerique = new Array( 'numerique'           );
	var ar_x_ImpTypeOffset    = new Array(              'offset' );

	// ORIGINAUX
	var ar_x_Originaux = new Array(
		'docpdf',
		'docword',
		'docxls',
		'docppt',
		'docpub',
		'docpshop',
		'docillus',
		'docindes',
		'docxps',
		'docautre');

	// FORMATS
	var ar_x_Format = new Array(
		'dlf','c5f','c4f',
		'dl','c5','c4');

	// MODES
	var ar_x_Mode   = new Array('recto');

	// IMPRESSION
	var ar_x_ImpStd = new Array('ic');
	var ar_x_ImpOff = new Array('oquadri');

	// PAPIER
	var ar_x_Papier = new Array('i90');
	var ar_x_PapierOff = new Array('op90','oo100');

	// EXEMPLAIRES
	var ar_x_NbExemplairesFixe = new Array('25','50','100','200','300','400');
	var ar_x_NbExemplairesFixeOff = new Array('500','1000','2000','3000','4000','5000','10000','20000');

	// Initialisation des variables
	var theForm = document.forms['fdevis_impadd'];
	var impType = theForm.elements['x_ImpType'].value;
	var nbExemplairesFixe = theForm.elements['x_NbExemplairesFixe'].value;

	// Initialistion des listes de choix
	my_updatecombo(theForm.elements['x_ImpType'], this.TabImpType, ar_x_ImpType);
	my_updatecombo(theForm.elements['x_Originaux'], this.TabOriginaux, ar_x_Originaux);
	my_updatecombo(theForm.elements['x_Format'], this.TabFormat, ar_x_Format);
	my_updatecombo(theForm.elements['x_Mode'], this.TabMode, ar_x_Mode);
	if (impType == "offset") {
		my_updatecombo(theForm.elements['x_Impression'], this.TabImpression, ar_x_ImpOff);
		my_updatecombo(theForm.elements['x_Papier'], this.TabPapier, ar_x_PapierOff);
		my_updatecombo(theForm.elements['x_NbExemplairesFixe'], this.TabNbExemplairesFixe, ar_x_NbExemplairesFixeOff);
	} else {
		my_updatecombo(theForm.elements['x_Impression'], this.TabImpression, ar_x_ImpStd);
		my_updatecombo(theForm.elements['x_Papier'], this.TabPapier, ar_x_Papier);
		my_updatecombo(theForm.elements['x_NbExemplairesFixe'], this.TabNbExemplairesFixe, ar_x_NbExemplairesFixe);
	}
	
	// Initialisations des champs
	theForm.elements['x_NbExemplaires'].value = nbExemplairesFixe;

	// Enchainement
	var displayNext = true;
	displayNext = devisStep('ImpType', displayNext);
	document.getElementById('ImpTypeAide').style.display = iif(displayNext, 'none', 'block');
	displayNext = devisStep('Originaux', displayNext);
	displayNext = devisStep('Format', displayNext);
	displayNext = devisStep('Mode', displayNext);
	displayNext = devisStep('Impression', displayNext);
	displayNext = devisStep('Papier', displayNext);
	displayNext = devisStep('NbExemplairesFixe', displayNext, '0');
	if (impType == "offset")
		fdevis_finalise(displayNext, 'J+3');
	else
		fdevis_finalise(displayNext);
}


