Ext.BLANK_IMAGE_URL = '../../../public/view/libs/extjs/resources/images/black/s.gif';

 function LoadSection (arg_0, arg_1, arg_2, arg_3, arg_4, arg_5){

	var store = new Ext.data.JsonStore({
		 url : 'http://www.cicana.com/public/controller.php?controller=gridMainPage&viewCategory='+arg_1+'&sortby=4&page=20',
		 root : 'rows',
		 autoExpandColumn: true, 
		 totalProperty : 'totalCount',	
		 fields :[
					{
						name : 'download'
					},
					{
						name : 'id'
					}, 
					{
						name : 'name'
					},
					{
						name : 'description'
					}, 
					  {
						name : 'yrank'
				   },
				   {
						name : 'mrank'
				   },
				     {
						name : 'wrank'
				   },
				     {
						name : 'rate'
				   },
				   {
						name : 'feedback'
				   },
					
					{
						name : 'size',
						type : 'float'
					}, 
					{
						name : 'creationdate'
				   }
				   ]
	});
	var pagingBar = new Ext.PagingToolbar({
				pageSize : 20,
				store : store,
				displayInfo : false,
				afterPageText :'',
				displayMsg : 'Displaying page {0} - {1}',
				emptyMsg : "No info to display"
			});
			
	var grid = new Ext.grid.GridPanel({
				width : 1320,
				region    : 'center',
				autoHeight: true, 
				title    : 'Lastest '+ arg_2 +' Files',
                renderTo :arg_0,
				store : store,
				trackMouseOver : false,
				stripeRows : true, 
				disableSelection : true,
				loadMask : true,
                cm : get_column_model(arg_4,arg_5)
                ,plugins:[new Ext.ux.grid.Search({
				iconCls:'icon-zoom'
				,disableIndexes: ['Download','Play','Size(Mo)','Release Date']
				,minChars:2
				,autoFocus:false
				}),
			new Ext.ux.IconMenu()]
			, tbar: [
		             	new Ext.Toolbar.TextItem
		             	(
		             		'<span class="rouge">&raquo; <a href="viewCategory.html?viewCategory='+arg_1+'&sortby=4">See All Files</a></span>'
		            	),
		            	'-',
		            	new Ext.Toolbar.TextItem
		            	(
		            		'  <strong><span class="rouge">Updated The 2009-01-19 07:48:06</span></strong>'
		            	)
		            	
           	   	 ]
			,bbar : pagingBar
			
			    ,commitChanges:function() {
				var records = this.store.getModifiedRecords();
				if(!records.length) {
						return;
				}
				var data = [];
				Ext.each(records, function(r, i) {
					data.push(r.data);
				}, this);
				var o = {
					 url:this.url
					,method:'post'
					,callback:this.requestCallback
					,scope:this
					,params:{
						 cmd:'saveData'
						,objName:this.objName
						,data:Ext.encode(data)
					}
				};
				Ext.Ajax.request(o);
			} });
			store.load({
				params : {
					start : 0,
					limit : 20
				}
			});
		  grid.on('render',function(){
            var secondTbar = new Ext.Toolbar({
                renderTo: this.tbar,
                items: [pagingBar]
            });    
       });
        
};


	


