/**
 * Correction or additive
 * 		Correction or additive collect input from user 
 *
 * @package 	forms
 * @author    	Sundar Murthi sundaramurthis@gmail.com
 * @date      	2008-07-25
 * @copyright 	TCM
 * 
 * @version 	1.0
 *
 * @Req ID  	2.2.4.16	(Correction or additive)
 *
 *•	2.2.3.3 Publication department
 *•	2.2.3.39 Correction or additive
 *
 * 
 */

function initAds14() {
	Elements.publication14 	= [ {
		xtype: 'combo',
		fieldLabel: 'Département de publication '+Elements.mandatory,
		hiddenName:'pubDep',
		store: new Ext.data.SimpleStore({
			url : Elements.comboSource,
			fields: Elements.comboFields,
			baseParams : {dbProperty : 'DEP_PUB'} 
		}),
		valueField:'id',
		displayField:'value',
		typeAhead: true,
		mode: 'local',
		editable: false,
		allowBlank: false, 
		triggerAction: 'all',
		emptyText:'Sélectionnez le département',
		selectOnFocus:true,
		width: 350,
	    hiddenId :'pubDep'
	} ];

	Elements.publication14[0].store.load({add : false});

	ads14 = new Ext.FormPanel({
	     labelWidth: 250,
	     frame:true,
	     title: 'Rectificatif ou additif',
	     bodyStyle:'padding:5px 5px 0',
	     defaultType: 'textfield',
	     itemCls: 'form-label-style',
	     items: Elements.clone(Elements.publication14)
	     				.concat(Elements.correctionAdditive)
	});
    
    //Eval 14
	ads14.items.items[4].on('blur',function(obj){
		if(obj.lastQuery != '') {
			document.getElementById('newspaper').value = obj.lastQuery;
		} else if(obj.lastSelectionText != 'null') {
			document.getElementById('newspaper').value = obj.lastSelectionText;
		}
	});
}

function getViewOnlyAds14(values){
	var viewObject 	= Elements.viewClone([ads14])[0];
	Elements.populateValues(values, viewObject);
	return viewObject;
}	