if(typeof SearchForms == 'undefined'){
	var SearchForms={};
}
SearchForms[module_id]={module_id:module_id};
Ext.onReady(function(){
	var searchField=new Ext.form.TextField({
		emptyText:find_tt['empty_text'],
		flex:1,
		cls: 'find-module-field',
		height:34,
		width:225,
		enableKeyEvents: true,
		name:'query',
		listeners: {
		   	keydown: {
		    	fn: function(field,e) {
			    	 if (e.getKey() == Ext.EventObject.ENTER) {
			      		form.form.submit();
		    		}
		    	}
		   	}
  		}
	});
//	var submitBtn=new Ext.Button({
//		text:tt['search_value'],
//		handler:function(){
//			form.form.submit();
//		}
//	});
	var form=new Ext.form.FormPanel({
		layout:{
			type:'hbox',
			align:'middle'
		},
		height:38,
		width: 300,
		renderTo:'search-form-'+this.module_id,
		standardSubmit:true,
		url:'/search?moduleid='+this.module_id,
		border:false,
		cls:'mini_search_form',
		bodyStyle: 'background: none;',
		items:[
			searchField,{
				xtype: 'box',
				autoEl: {tag:'input', type:'button', cls: 'submit',value: find_tt['search_text'], onclick: 'SearchForms['+this.module_id+'].form.form.submit()'}
			}
		]
		
	});
	this.form=form;
},SearchForms[module_id]);


