Ext.namespace('Cascade.panel.lager');
Cascade.panel.lager.auswahl_zubehoer_ptfe_setGuiValue = function(strId,message){
	Cascade.panel.lager.auswahl_zubehoer_ptfe.setBlockEvent(true);
	var _setExpandFieldSet = function(bExpand){
		var oNorthField = Ext.getCmp("LAGER_AUSWAHL_ZUBEHOER_PTFE_AzA_CHECK");
		var oEastField  = Ext.getCmp("LAGER_AUSWAHL_ZUBEHOER_PTFE_GmPTFE_CHECK");
		
		if(!bExpand){
			oNorthField.collapse();
			oEastField.expand();	
		}
		else if(bExpand){
			oNorthField.expand();
			oEastField.collapse();
		}
	}
	
	switch(strId){
		case "COMBOBOX":
		case "CHECKBOX":
		case "INITIAL" :
				if(message.store){
					var oDialogStores = Cascade.panel.lager.auswahl_zubehoer_ptfe.getStore();
					for(var i=0;i<message.store.length;i++){
						var aPart = message.store[i];
						switch(aPart[0]){
							case "TYP" :
									oDialogStores.storeAzA.loadData(aPart[1]);
								break;
							case "G" :
									oDialogStores.storeG.loadData(aPart[1]);
								break;
							case "A" :
									oDialogStores.storeA.loadData(aPart[1]);
								break;
							case "TaG" :
									oDialogStores.storeTaG.loadData(aPart[1]);
								break;			
						}
					}
				}
				
				if(message.value){
					for(var i=0;i<message.value.length;i++){
					 	var aPart = message.value[i];
					 	if(aPart[0]=="CHECKBOX")
					 		_setExpandFieldSet(aPart[1]);
					 	else
					 		Ext.getCmp("LAGER_AUSWAHL_ZUBEHOER_PTFE_"+aPart[0]).setValue(aPart[1]);
					}
				}
				
				if(message.image){
					var oImagePanel = Ext.getCmp("LAGER_AUSWAHL_ZUBEHOER_PTFE_PICTURE");
					
					var bEx = false;
					
					if(Ext.getCmp("LAGER_AUSWAHL_ZUBEHOER_PTFE_PICTURE_ADD")){
						bEx = true;	
					}
					
					var oImageForm = new Ext.Panel({
						layout	: 'form',
						border	: false,
						id		: 'LAGER_AUSWAHL_ZUBEHOER_PTFE_PICTURE_ADD',
						style	: 'margin-left: 5px;',
						html	: message.image
					});
					
					if(bEx){
						//oImagePanel.updateBox(oImageForm);
						oImagePanel.body.update(oImageForm);
					}
					else
						oImagePanel.add(oImageForm);
						
					oImagePanel.doLayout();
				}
			break;
		case "FIELDSET_CHECKBOX" :
				_setExpandFieldSet(message);
			break;
	} 	
	Cascade.panel.lager.auswahl_zubehoer_ptfe.setBlockEvent(false);
}