	function doEnterprise(actionType, id, usertype, area) {
		var title = '';
		var categoryDisabled = false;
		var userTypeDisabled = true;
		var url = 'enterprises_update.action';
		var gridReflesh = false;
		var idReadOnly = true;
		if(actionType == 'updateInfo'){
			categoryDisabled = true;
			title = '企业信息维护';
		}
		if(actionType == 'register'){
			url = 'enterprises_register.action';
			title = '用户注册';
			idReadOnly = false;
			userTypeDisabled = false;
		}
		if(actionType == 'Operator'){
			title = '申报用户查看与审查';
			gridReflesh = true;
			userTypeDisabled = true;
		}
		if(actionType == 'administrator'){
			title = '申报用户查看与审查';
			gridReflesh = true;
			userTypeDisabled = false;
		}
		
		function field(name, fieldLabel, inputType) {
			return { fieldLabel: fieldLabel, inputType: inputType, name: name };
		}
		
		function twoColumnedPanel(leftColumnItems, rightColumnItems) {
			return {
				baseCls: 'x-plain',
				defaults: {
					baseCls: 'x-plain',
					//columnWidth: 0.5,
					defaults: { anchor: '94%'},
					layout: 'form'
				},
				items: [
					{ defaultType: 'textfield',	items: leftColumnItems, columnWidth: 0.5 },
					{ defaultType: 'textfield', items: rightColumnItems, columnWidth: 0.5 }
				],
				layout: 'column'
			};
		}
		function certainLengthTextField(name, fieldLabel, anchors, maxLength, allowBlank, enabled) {
			return new Ext.form.TextField({maxLength: maxLength, allowBlank: false||allowBlank, anchor: anchors, name: name, fieldLabel: fieldLabel ,disabled:false||enabled });
		};
		var utypeCombo = new Ext.form.ComboBox({
			mode: 'local',
			hiddenName:'utype',
			allowBlank: false,
			disabled: userTypeDisabled,
			valueField:'value',
			store: new Ext.data.SimpleStore({
			data: [['个人','A'], ['企业','B']
			//,['政府机关','C'],['事业单位','D'],['组织','E']
			],
			fields: ['description','value' ]
			}),
			fieldLabel:'用户类型',
			displayField: 'description'
		});
		var roomCombo = new Ext.form.ComboBox({
			mode: 'local',
			anchor: '95%',
			allowBlank: false,
			listWidth: 350,
			displayField: 'description',
			disabled: userTypeDisabled,
			hiddenName: 'room',
			store: new Ext.data.SimpleStore({
				data: [
				//下拉框的第二个值必须和window-operator.js对应的处室的值的字母相对应
					['通信建设工程', 'C'],
					['通信建设企业资质申报','D'],
					['增值电信业务经营许可证审批','A1'], 
					['跨地区增值电信业务经营许可证备案','A2'], 
					//['互联网电子公告服务专项审批和备案','A3'], 
					['外商投资电信企业经营本行政区域内增值电信业务的初审','A4'],
					['电信网码号资源使用审批','B1'], 
					['短消息类服务接入代码（SP代码）申请','B2'],
					['部颁短消息类服务接入代码备案申请','B3']
					],
				fields: ['description','value' ]
			}),
			valueField: 'value',
			listeners: {
				select: function(combo, record, index){
					if(index == 0) {
//						alert(Ext.getCmp('communicationBuildField').hidden)
						Ext.getCmp('communicationBuildField').setVisible(true);
						bulidCombo.allowBlank = false;
					} else {
						bulidCombo.allowBlank = true;
						Ext.getCmp('communicationBuildField').setVisible(false);
					}
				}
			},
			fieldLabel: '申报类型'
		});
		
		var bulidCombo = new Ext.form.ComboBox({
			mode: 'local',
//			anchor: '97%',
			allowBlank: false,
//			listWidth: 150,
			displayField: 'description',
			disabled: userTypeDisabled,
			hiddenName: 'bulidType',
			store: new Ext.data.SimpleStore({
				data: [
					['建设单位', 'A'],
					['设计单位', 'B'], 
					['施工单位', 'C'], 
					['监理单位', 'D']
				],
				fields: ['description','value' ]
			}),
			valueField: 'value',
			fieldLabel: '通信企业类型'
		});
		
		
		var user_store = new Ext.data.Store({
			autoLoad: false,
			baseParams: { type: 'Enterprise' },
			reader: new Ext.data.JsonReader({ id: 'id', root: 'records' }, [ 'id', 'region' ]),
			url: 'users_list.action'
		});
		function setFieldDisabled(i){
			Ext.each(i, function(item, index) {
				if(Ext.getCmp(item)){
					Ext.getCmp(item).setDisabled(true);
				}
			});
		}
		function setFieldEnabled(i){
			Ext.each(i, function(item, index) {
				if(Ext.getCmp(item)){
					Ext.getCmp(item).setDisabled(false);
				} 
			});
		}
		
		function removeFields(i){
			Ext.each(i, function(item, index) {
				if(Ext.getCmp(item)){
					Ext.WindowMgr.getActive().items.get(0).form.remove(Ext.getCmp(item));
				} 
			});
		}
		
		function addFields(i){
			Ext.each(i, function(item, index) {
				if(Ext.getCmp(item)){
					Ext.WindowMgr.getActive().items.get(0).form.add(Ext.getCmp(item));
				} 
			});
		}
		function addFieldSet(name){
			if(Ext.getCmp(name)){
				Ext.WindowMgr.getActive().items.get(0).form.add(Ext.getCmp(name));
			} 
		}
		function removeFieldSet(name){ 
			if(Ext.getCmp(name)){
				Ext.WindowMgr.getActive().items.get(0).form.remove(Ext.getCmp(name));
			} 
		}
		function setFieldSetEnabled(name){
			if(Ext.getCmp(name)){
					Ext.getCmp(name).setDisabled(false);
			} 
		}
		function setFieldSetDisabled(name){
			if(Ext.getCmp(name)){
				Ext.getCmp(name).setDisabled(true);
			} 
		}
		var basicField = {
		    items: [
//		    	new Ext.form.TextField({allowBlank: false, regex:/^[A-Za-z0-9_\-\u4e00-\u9fa5]{2,20}$/,regexText:'用户名为2-20位的字母、中文、数字、中划线、下划线或其组合',
//						name: 'id', fieldLabel: '用户名', readOnly:idReadOnly, anchor:'47%'}),
				{
					baseCls: 'x-plain',
					defaults: {
						baseCls: 'x-plain',
						columnWidth: 0.5,
						defaults: { anchor: '94%'},
						layout: 'form'
					},
					items: [
						{ defaultType: 'textfield',	items: new Ext.form.TextField({allowBlank: false, regex:/^[A-Za-z0-9_\-\u4e00-\u9fa5]{2,20}$/,regexText:'用户名为2-20位的字母、中文、数字、中划线、下划线或其组合',
						name: 'id', fieldLabel: '用户名', readOnly:idReadOnly, anchor:'47%'}), columnWidth: 0.5 },
						{ defaultType: 'textfield', items: utypeCombo, columnWidth: 0.5, hidden : true},
						{ defaultType: 'textfield', items: roomCombo, columnWidth: 0.5 },
						{ defaultType: 'textfield', items: bulidCombo, columnWidth: 0.5, id:'communicationBuildField', hidden : true }
					],
					layout: 'column'
				},
				{
					baseCls: 'x-plain',
					defaults: {
						baseCls: 'x-plain',
						columnWidth: 0.33,
						layout: 'form'
					},
					items: [{ 
						items: [
							new Ext.form.ComboBox({
							autoLoad: false,
							displayField: 'cityName',
							id: 'province',
							disabled: userTypeDisabled,
							allowBlank: false,
							store: Ext.StoreMgr.add('store-province', new Ext.data.Store({
								reader: new Ext.data.JsonReader({ id: 'id', root: 'areas' }, [ 'id','areaId','cityName' ]),
								url: 'areas_list.action'
							})),
							valueField: 'id',
							anchor: '93%',
							fieldLabel: '省  市'
						})],
						labelWidth: 75,
						columnWidth: 0.4
					},{
						 items: [
						 	new Ext.form.ComboBox({
							autoLoad: false,
							allowBlank: false,
							//emptyText:'请先选择省市',
							disabled: userTypeDisabled,
							displayField: 'cityName',
							id: 'area',
							store: Ext.StoreMgr.add('store-area', new Ext.data.Store({
								reader: new Ext.data.JsonReader({ id: 'id', root: 'citys' }, [ 'id','areaId','cityName' ]),
								url: 'cities_list.action'
							})),
							valueField: 'id',
							anchor: '89%',
							fieldLabel: '地  市' 
						})],
						columnWidth: 0.3
					},{
						 items: [
						 	new Ext.form.ComboBox({
							autoLoad: false,
							allowBlank: false,
							//emptyText:'请先选择地市',
							disabled: userTypeDisabled,
							displayField: 'cityName',
							hiddenName: 'region',
							id: 'city',
							store: Ext.StoreMgr.add('store-city', new Ext.data.Store({
								reader: new Ext.data.JsonReader({ id: 'id', root: 'citys' }, [ 'id','areaId','cityName' ]),
								url: 'cities_list.action'
							})),
							valueField: 'id',
							anchor: '89%',
							fieldLabel: '县区市' 
						})],
						columnWidth: 0.3
					}
					],
					labelWidth: 40,
					layout: 'column'
				}
//				,
//				{
//					baseCls: 'x-plain',
//					defaults: {
//						baseCls: 'x-plain',
//						columnWidth: 0.3,
//						layout: 'form'
//					},
//					id: 'communicationBuildField',
//					visible: false,
//					items: [{items: [bulidCombo]}]
//				}
			],
			title: '帐户信息',
			id: 'basicField'
		};

		
		var enterpriseField = {
		    items: [
		    	new Ext.form.TextField({maxLength: 50, allowBlank: false,anchor:'97%', name: 'name',readOnly: userTypeDisabled, fieldLabel: '单位名称', id:'enterpriseName'}),
				new Ext.form.TextField({maxLength: 50, allowBlank: false,anchor:'97%', name: 'address', fieldLabel: '单位地址',id:'enterpriseAddress'}),
				twoColumnedPanel([
					new Ext.form.TextField({allowBlank: true, anchor: '90%', name: 'code',readOnly: userTypeDisabled, fieldLabel: '组织机构代码',id:'enterpriseCode',regex:/^[A-Za-z0-9]{8}-[A-Za-z0-9]{1}$/,regexText:'组织机构代码为8位数字（或字母）+中划线+1位数字（或字母），且必须为半角符'})
					
				],
				[new Ext.form.TextField({maxLength: 30, allowBlank: false, anchor: '90%', name: 'commercialId',readOnly: userTypeDisabled, fieldLabel: '工商注册号',
						 id: 'commercialId'})]
				),
				
				{	items: new Ext.form.TextField({
						maxLength: 150, anchor:'97%', name: 'codeReason', 
						fieldLabel: '无组织机构代码的原因',id:'enterpriseCodeReason', 
						allowBlank: false
					}),
					baseCls: 'x-plain',
					labelWidth: 124,
					layout: 'form'
				},
				twoColumnedPanel(
					[
						new Ext.form.TextField({maxLength: 16, allowBlank: false, name: 'representitive', fieldLabel: '法定代表人',id:'representitive'}),	
						new Ext.form.TextField({maxLength: 25, allowBlank: false, anchor: '90%', minLength:6, id: 'enterprisePhone',
							name: 'phone', fieldLabel: '电  话', regex:/^\d+-?\d+$/, regexText: '电话号码只能是纯数字或数字-数字'}),
						new Ext.form.TextField({regex: /^\d+$/,maxLength: 6,minLength: 6,maxLengthText: '邮政编码为6位数字',maxLengthText:'邮政编码为6位数字', allowBlank: false, anchor: '90%', name: 'zip', fieldLabel: '邮政编码',id:'enterpriseZip'}) ],
					[ 
						new Ext.form.TextField({maxLength: 16, allowBlank: false, name: 'contact', fieldLabel: '工作联系人',id:'enterpriseContact'}),
						new Ext.form.TextField({maxLength: 11, allowBlank: false, anchor: '90%', minLength:8, id: 'mobile',
							name: 'mobile', fieldLabel: '手机号码', regex: /^\d+$/,regexText: '手机号码必须为8-11位数字'}),
						new Ext.form.TextField({maxLength: 25, allowBlank: true, anchor: '90%', minLength:6, id: 'enterpriseFax',
							name: 'fax', fieldLabel: '传  真', regex:/^\d+-?\d+$/, regexText: '传真只能是纯数字或数字+中划线+数字'})
					]
				),
				twoColumnedPanel(
					new Ext.form.TextField({allowBlank: false, anchor: '90%',name: 'email',
						 vtype: 'email', fieldLabel: 'E-mail',maxLength: 40, id:'enterpriseEmail' }),
					new Ext.form.TextField({ name: 'url',   vtype: 'url'  , fieldLabel: '网  址',
						maxLength: 30, id:'enterpriseUrl' })
				),
				new Ext.form.TextArea({allowBlank: false, anchor: '97%', fieldLabel: '简介(请认真详细填写，否则会影响用户激活)', name:'remark',maxLength:500,  preventScrollbars :true, id: 'enterpriseRemark',height:50})
			], 
			title: '详细信息',
			id: 'enterpriseField'
		};
		var personField = {
		    items: [
		    	twoColumnedPanel(
		    		new Ext.form.TextField({maxLength: 30, anchor:'97%', name: 'name', fieldLabel: '姓名', id:'personName',allowBlank: false}),
		    		new Ext.form.TextField({maxLength: 30, anchor: '90%', name: 'code', fieldLabel: '证件号码',id:'personCode',allowBlank: false})
		    	),
				twoColumnedPanel(
					new Ext.form.TextField({maxLength: 25, allowBlank: false, anchor: '90%', minLength:6, id:'personPhone',
							name: 'phone', fieldLabel: '电  话', regex:/^\d+-?\d+$/, regexText: '电话号码只能是纯数字或数字+中划线+数字'}),
					new Ext.form.TextField({allowBlank: false, anchor: '90%',name: 'email',
						 vtype: 'email', fieldLabel: 'E-mail',maxLength: 40, id:'personEmail' })
					
				),
				new Ext.form.TextField({maxLength: 50, allowBlank: false,anchor:'97%', name: 'address', fieldLabel: '通信地址', id:'personAddress'}),
				twoColumnedPanel(
					new Ext.form.NumberField({maxLength: 6,minLength: 6,maxLengthText: '邮政编码为6位数字',id:'personZip',
							mixLengthText:'邮政编码为6位数字', allowBlank: false, anchor: '90%', name: 'zip', fieldLabel: '邮政编码'}),
					new Ext.form.TextField({ name: 'url',   vtype: 'url'  , fieldLabel: '网  址',
						maxLength: 30, id:'personUrl' })
				),	
				new Ext.form.TextArea({ anchor: '97%', fieldLabel: '备注', name:'remark',maxLength:500,  preventScrollbars :true, id:'personRemark',height:50})
			],
			title: '详细信息', 
			id: 'personField'
		};
		Ext.getCmp('province').on('select', function(combo, record) {
			Ext.getCmp('area').clearValue();
			Ext.getCmp('city').clearValue();
			
			Ext.StoreMgr.get('store-area').baseParams = { areaId: record.get('id') };
			Ext.StoreMgr.get('store-area').load();
		});
		Ext.getCmp('area').on('select', function(combo, record) {
			Ext.getCmp('city').clearValue();
			
			Ext.StoreMgr.get('store-city').baseParams = { areaId: record.get('id') };
			Ext.StoreMgr.get('store-city').load();
		});
		if(Ext.getCmp('enterpriseCode')){
			Ext.getCmp('enterpriseCode').on('blur', function(){
				if(Ext.getCmp('enterpriseCode').getValue() == '' || Ext.getCmp('enterpriseCode').getValue() == null){
					Ext.getCmp('enterpriseCodeReason').setDisabled(false);
					Ext.getCmp('enterpriseCodeReason').allowBlank = false;
				} else {
					Ext.getCmp('enterpriseCodeReason').allowBlank = true;
					Ext.getCmp('enterpriseCodeReason').setValue();
					Ext.getCmp('enterpriseCodeReason').setDisabled(true);
				}
			});
		}
		
		var items = [];
		
			
		if(actionType == 'updateInfo' || actionType == 'Operator' || actionType == 'administrator') {
			if(usertype == 'A'){
				items = [basicField, personField];  
				setFieldDisabled(['enterpriseName','enterpriseAddress','enterpriseCode','commercialId','representitive','enterprisePhone','enterpriseContact','enterpriseUrl','enterpriseRemark','enterpriseEmail','enterpriseFax','enterpriseZip','category', 'enterpriseCodeReason']);
				if(Ext.getCmp('enterpriseField')){
					Ext.getCmp('enterpriseField').setVisible(false);
				}
			} else {
				items = [basicField, enterpriseField]; 
				setFieldDisabled(['personName','personAddress','personCode','personPhone','personZip','personUrl','personRemark','personEmail']);
				if(Ext.getCmp('personField')){
					Ext.getCmp('personField').setVisible(false);
				} 
			}
			if (!userTypeDisabled&&area) {   
				//地级市管理员
				setFieldDisabled(['province','area']);
			} else if (!userTypeDisabled&&!area){  
				//admin1不做操作
			} else if (userTypeDisabled&&area){ 
				//地市审核员
				setFieldDisabled(['province','area','city']);
			}
		} else {
			items = [basicField, enterpriseField, personField]; 
		}	
			
		if(actionType == 'register'){
			items.push({
				title:'安全信息',
				items:twoColumnedPanel(
					[new Ext.form.TextField({maxLength: 16, allowBlank: false, anchor: '90%', minLength:6,
						name: 'password', fieldLabel: '密  码', inputType:'password'})], 
					[new Ext.form.TextField({maxLength: 16, allowBlank: false, anchor: '90%',minLength:6, 
						name: 'confirm', fieldLabel: '确认密码', inputType:'password'})]
				)
			});
		}
		function pushCombobox(comboboxDisabled){
			items.push({
				items: [
					new Ext.form.ComboBox({
						allowBlank: true,
						mode: 'local',
						hiddenName:'enabled',
						valueField:'value',
						disabled: comboboxDisabled,
						store: new Ext.data.SimpleStore({
							data: [['通过',true], ['不通过',false] ],
							fields: ['description','value' ]
						}),
						fieldLabel:'<span style="color:red">审核结果</span>',
						displayField: 'description'
					})
//					,
//					new Ext.form.ComboBox({
//						allowBlank: true,
//						mode: 'local',
//						hiddenName:'type',
//						valueField:'value',
//						id: 'typeComb',
//						disabled: comboboxDisabled,
//						store: new Ext.data.SimpleStore({
//							data: [['　','null'], ['经济强县企业','A'], ['非经济强县企业','B'], ['地级市企业','C'], ['省属企业','D'] ],
//							fields: ['description','value' ]
//						}),
//						fieldLabel:'<span style="color:red">企业类型</span>',
//						displayField: 'description'
//					}),
//					new Ext.form.ComboBox({
//						allowBlank: true,
//						mode: 'local',
//						hiddenName:'provinceDepartment',
//						valueField:'value',
//						id: 'provinceDepartmentComb',
//						disabled: comboboxDisabled,
//						store: new Ext.data.SimpleStore({
//							data: [['　','Z'],['科技厅','O'], ['教育厅','P'], ['信息产业厅','B'], ['广电厅','Q'], ['发改委','R'], ['其他主管部门','S'] ],
//							fields: ['description','value' ]
//						}),
//						fieldLabel:'<span style="color:red">主管部门</span>',
//						displayField: 'description'
//					})
				],
				title: '<span style="color:red">用户审核</span>'
			});
		};
		
		
		
		if(actionType == 'Operator' || actionType == 'administrator'){
				pushCombobox(false);
		}else if(actionType == 'updateInfo'){
				pushCombobox(true);
		}
		
		if(Ext.getCmp('typeComb')){
			Ext.getCmp('typeComb').on('select',function(combo, record){
//				if(record.get('value')!= 'D'){
//					Ext.getCmp('provinceDepartmentComb').clearValue();
//					Ext.getCmp('provinceDepartmentComb').setDisabled(true);
//				} else {
//					Ext.getCmp('provinceDepartmentComb').setDisabled(false);
//				}
			});
		}
		
		var entWindow = new Ext.Window({
			bbar: ['->', {
				handler:  function() {
							
						Ext.WindowMgr.getActive().items.first().getForm().submit({
							failure: function(form, action) {
//								if(action.failureType == 'client' || action.failureType == 'server'){
//									alert("输入项有误，请查看红色感叹号处！");
//								}
								//alert(action.failureType);
								alert("提交失败，请检查输入项格式是否正确!");
							},
							success: function() {
								Ext.Msg.show({
									buttons: Ext.MessageBox.OK,
									fn: function(){ 
										Ext.WindowMgr.getActive().close();
//										if(actionType == 'register') {
//											
//											window.open('/jihuo.html','', 'height=680,width=1000,left=0,top=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
//										}
									},
									icon: Ext.MessageBox.INFO,
									msg: '操作成功，请致电0571-87880010，由省通信管理局窗口办事人员激活您的用户名（只有激活后才能登录）！',
									title: '信息'
								});
								
								if(gridReflesh){ 
									Ext.StoreMgr.get('store-enterprise').load();
								}
							},
							url: url
						});
					},text: '提交'
				},'-', {
				 handler: function(){ 
					Ext.WindowMgr.getActive().close();
				 }, text: '取消' 
				 }
				 ],
			height:590, 
			//autoHeight: true,
			autoScroll: true,
			items: new Ext.form.FormPanel({
				id: 'form',
				defaults: { labelWidth: 75 },
				defaultType: 'fieldset',
				items: items,
				listeners: {
				add: function(container, component) {
					this.doLayout();
					this.doLayout();
					Ext.each(component.findBy(function(component) { return component.isXType('field'); }), function(item) { container.form.add(item); });
				},
				remove: function(container, component) {
					Ext.each(component.findBy(function(component) { return component.isXType('field'); }), function(item) { container.form.remove(item); });
				}
			}
				
			}),
			maximizable: false,
			id: 'window-enterprise',
			title: title,
			width: 680
		});
		var i = 0;
		utypeCombo.on('select',function(combo, record, index) {
			if(index == 0) {
				if(i != 0){
					addFields(['personName','personAddress','personCode','personPhone','personUrl','personRemark','personEmail','personZip']);
				}
				setFieldEnabled(['personName','personAddress','personCode','personPhone','personUrl','personRemark','personEmail','personZip']);
				setFieldDisabled(['enterpriseName','enterpriseAddress','enterpriseCode','commercialId','representitive','enterprisePhone','enterpriseContact','enterpriseUrl','enterpriseRemark','enterpriseEmail','enterpriseFax','enterpriseZip','category', 'enterpriseCodeReason']);
				removeFields(['enterpriseName','enterpriseAddress','enterpriseCode','commercialId','representitive','enterprisePhone','enterpriseContact','enterpriseUrl','enterpriseRemark','enterpriseEmail','enterpriseFax','enterpriseZip','category', 'enterpriseCodeReason']);
				if(Ext.getCmp('enterpriseField')){
					Ext.getCmp('enterpriseField').setVisible(false);
				}
				if(Ext.getCmp('personField')){
					Ext.getCmp('personField').setVisible(true);
				}
			}else {
				if( i != 0){
					addFields(['enterpriseName','enterpriseAddress','enterpriseCode','commercialId','representitive','enterprisePhone','enterpriseContact','enterpriseUrl','enterpriseRemark','enterpriseEmail','enterpriseFax','enterpriseZip','category', 'enterpriseCodeReason']);
				}
				setFieldEnabled(['enterpriseName','enterpriseAddress','enterpriseCode','commercialId','representitive','enterprisePhone','enterpriseContact','enterpriseUrl','enterpriseRemark','enterpriseEmail','enterpriseFax','enterpriseZip','category', 'enterpriseCodeReason']);
				setFieldDisabled(['personName','personAddress','personCode','personPhone','personUrl','personRemark','personEmail','personZip']);
				removeFields(['personName','personAddress','personCode','personPhone','personUrl','personRemark','personEmail','personZip']);
				if(index!= 1) {
					Ext.getCmp('commercialId').allowBlank = true;
					Ext.getCmp('representitive').allowBlank = true;
					Ext.getCmp('commercialId').setValue();
					Ext.getCmp('representitive').setValue();
					setFieldDisabled(['commercialId', 'representitive']);
					removeFields(['commercialId', 'representitive']);
				} else {
					Ext.getCmp('commercialId').allowBlank = false;
					Ext.getCmp('representitive').allowBlank = false;
				}
				if(Ext.getCmp('personField')){
					Ext.getCmp('personField').setVisible(false);
				}
				if(Ext.getCmp('enterpriseField')){
					Ext.getCmp('enterpriseField').setVisible(true);
				}
			}
			i++;
		});
		if(id){
			entWindow.show(null,function(){
				doAction('load', 'post','users_view.action',function(form, action){
					if(Ext.getCmp('enterpriseCode')){
						Ext.getCmp('enterpriseCode').fireEvent('blur', Ext.getCmp('enterpriseCode'));
					}
					var theUtype = action.result.data.utype;
					var indexParam = theUtype == 'A' ? 0 : (theUtype == 'B' ? 1 : 2);
					var roomType = action.result.data.room;
//					roomCombo.selectByValue(roomType, true);
					if ("C" == roomType) {
						roomCombo.fireEvent('select', utypeCombo, null, 1);
					} else {
						bulidCombo.allowBlank = true;
					}
					//alert(indexParam);
//					utypeCombo.fireEvent('select', utypeCombo, null, indexParam);
					utypeCombo.fireEvent('select', utypeCombo, null, 1);
					utypeCombo.setValue("B");
					Ext.StoreMgr.get('store-province').load({
						callback: function() {
							var id = action.result.data.region.areaId;
							var provinceId = '1111';
							Ext.Ajax.request({
								url: 'cities_view.action',
								params: {id: id},
								success: function(response, options){
									
									provinceId = Ext.decode(response.responseText).areaId;
									Ext.getCmp('province').setValue(provinceId);
									Ext.StoreMgr.get('store-area').baseParams = { areaId :provinceId };
									Ext.StoreMgr.get('store-area').load({
										callback: function() {
											Ext.getCmp('area').setValue(action.result.data.region.areaId);
											Ext.StoreMgr.get('store-city').baseParams = { areaId: action.result.data.region.areaId };
											Ext.StoreMgr.get('store-city').load({
												callback: function() {
													Ext.getCmp('city').setValue(action.result.data.region.id)
												}
											});
										}
									});
								}
							});
						}
					});
					
					
//					var dtype = action.result.data.type && action.result.data.type.name ;
//					Ext.WindowMgr.getActive().items.first().items.get(2).items.get(1).setValue(dtype);
					var provinceDepar = action.result.data.provinceDepartment ;
					if(provinceDepar == null || provinceDepar == 'undefined' || provinceDepar == 'null'){
//						Ext.WindowMgr.getActive().items.first().items.get(2).items.get(2).setValue();
					}
					var categoryType = action.result.data.category;
				}, {'id':id });
			});
		}else{
			
			entWindow.show();
			utypeCombo.fireEvent('select', utypeCombo, null, 1);
			utypeCombo.setValue("B");
			
			if(actionType == 'register'){	
			Ext.StoreMgr.get('store-province').load({
						callback: function() {
							Ext.getCmp('province').setValue('330000');
							Ext.StoreMgr.get('store-area').baseParams = { areaId: '330000' };
							Ext.StoreMgr.get('store-area').load();
						
							Ext.getCmp('area').on('select', function(combo, record) {
								Ext.getCmp('city').clearValue();
								
								Ext.StoreMgr.get('store-city').baseParams = { areaId: record.get('id') };
								Ext.StoreMgr.get('store-city').load();
							});
						}
					});
					Ext.getCmp('province').setValue('330000');
//					if(Ext.getCmp('personField')){
//						Ext.getCmp('personField').setVisible(false);
//					}
//					if(Ext.getCmp('enterpriseField')){
//						Ext.getCmp('enterpriseField').setVisible(false);
//					}
				}
		}
	} 

