GO.projects2.ToGroupDialog = Ext.extend(GO.Window,{
	
	initComponent : function(){

		Ext.apply(this, {
			title: GO.projects2.lang.groupSelection,
			layout:'fit',
			closable:true,
			closeAction:'hide',
			modal:false,
			height:140,
			width:350,
			items: [this.formPanel = new Ext.form.FormPanel({
				items: [
					this.groupNameField = new Ext.form.TextField({
						name : 'group_name',
						fieldLabel : GO.projects2.lang['groupName'],
						value: ''
					})
				],
				autoScroll:true,
				cls: 'go-form-panel'
			}) ],
			buttons: [{
				text: GO.lang['cmdOk'],
				handler: function(){
					this.fireEvent('group_name',this.groupNameField.getValue());
					this.hide();
				},
				scope: this
			},{
				text: GO.lang['cmdClose'],
				handler: function(){
					this.hide();
				},
				scope:this
			}]
		});

		GO.projects2.SelectTemplateWindow.superclass.initComponent.call(this);
		
		this.addEvents({
			'group_name' : true
		},this);
	},

	show : function(config){

		GO.projects2.ToGroupDialog.superclass.show.call(this,config);
		this.groupNameField.setValue('');

//		if(!this.rendered)
//			this.render(Ext.getBody());
//
//		this.showConfig = config || {};
		
	}
	
});