/*Ext.onReady(function(){
	var store = new Ext.data.JsonStore({
	    url: '/content/Ajax/featured/',
	    root: 'f_ignitables',
	    fields: [
	        'title', 'string',
	        {name:'author', type: 'string'},
	        {name:'views', type:'number'},
	        {name:'rating', type:'number'}
	    ]
	});
	store.load();
	var store_r = new Ext.data.JsonStore({
	    url: '/content/Ajax/recent/',
	    root: 'r_ignitables',
	    fields: [
	        'title', 'string',
	        {name:'author', type: 'string'},
	        {name:'views', type:'number'},
	        {name:'date', type: 'date', dateFormat: 'n/j h:ia'}
	    ]
	});
	store_r.load();
	var store_p = new Ext.data.JsonStore({
	    url: '/content/Ajax/popular/',
	    root: 'p_ignitables',
	    fields: [
	        'title', 'string',
	        {name:'author', type: 'string'},
	        {name:'views', type:'number'},
	        {name:'rating', type:'number'}
	    ]
	});
	store_p.load();
	var store_h = new Ext.data.JsonStore({
	    url: '/content/Ajax/rated/',
	    root: 'h_ignitables',
	    fields: [
	        'title', 'string',
	        {name:'author', type: 'string'},
	        {name:'views', type:'number'},
	        {name:'rating', type:'number'}
	    ]
	});
	store_h.load();
	// second tabs built from JS
    var tabs2 = new Ext.TabPanel({
        renderTo: 'tabpanel',
        activeTab: 0,
        width:700,
        height:250,
        plain:true,
        defaults:{autoScroll: true},
        items:[{
                title: 'Featured',
                iconCls: 'icon-featured',
                contentEl: 'tab_featured'
            },{
                title: 'Recently Added',
                iconCls: 'icon-recent',
                contentEl: 'tab_recent'
                //autoLoad:'ajax1.htm'
            },{
                title: 'Most Popular',
                iconCls: 'icon-popular',
                //contentEl: 'tab_popular'
                autoLoad: '/content/Ajax/popular'
            },{
                title: 'Highest Rated',
                iconCls: 'icon-highestrated',
                contentEl: 'tab_highestrated'
                //listeners: {activate: handleActivate},
            }
        ]
    });

	var data = {
        title: 'Vinyasa MT 2.0',
        author: 'sizzler',
        image: 'tn_small.jpg',
        views: '439',
        link: '#',
        rating: '5'
    };
	var tpl = new Ext.Template(
        '<div style="float:left; width: 75px; height: 56px; padding: 5px;"><a href="{link}"><img src="/static/images/{image}"/></a></div>',
        '<p><a class="tablink" href="{link}">{title}</a></p>',
        '<p><b>By:</b> {author}</p>',
        '<p><b>Views:</b> {views}</p>',
        '<p><b>Rating:</b> {rating}</p>'
    );
    var tpl_r = new Ext.Template(
        '<div style="float:left; width: 75px; height: 56px; padding: 5px;"><a href="{link}"><img src="/static/images/{image}"/></a></div>',
        '<p><a class="tablink" href="{link}">{title}</a></p>',
        '<p><b>By:</b> {author}</p>',
        '<p><b>Views:</b> {views}</p>',
        '<p><b>Date Added:</b> {date}</p>'
    );
    var p_featured = new Ext.Panel({
        width: 680,
        html: ' ',
        renderTo: 'tab_featured',
        items: new Ext.DataView({
	        store: store,
	        tpl: tpl,
	        autoHeight:true,
	        multiSelect: true,
	        overClass:'x-view-over',
	        itemSelector:'div.thumb-wrap',
	        emptyText: 'No ignitables to display'
	    })
    });
    var p_recent = new Ext.Panel({
        width: 680,
        html: ' ',
        renderTo: 'tab_recent',
        items: new Ext.DataView({
	        store: store_r,
	        tpl: tpl_r,
	        autoHeight:true,
	        multiSelect: true,
	        overClass:'x-view-over',
	        itemSelector:'div.thumb-wrap',
	        emptyText: 'No ignitables to display'
	    })
    });
    var p_popular = new Ext.Panel({
        width: 680,
        html: ' ',
        renderTo: 'tab_popular',
        items: new Ext.DataView({
	        store: store,
	        tpl: tpl,
	        autoHeight:true,
	        multiSelect: true,
	        overClass:'x-view-over',
	        itemSelector:'div.thumb-wrap',
	        emptyText: 'No ignitables to display'
	    })
    });
    var p_rated = new Ext.Panel({
        width: 680,
        html: ' ',
        renderTo: 'tab_highestrated',
        items: new Ext.DataView({
	        store: store_h,
	        tpl: tpl,
	        autoHeight:true,
	        multiSelect: true,
	        overClass:'x-view-over',
	        itemSelector:'div.thumb-wrap',
	        emptyText: 'No ignitables to display'
	    })
    });
    //tpl.overwrite(p_featured.body, data);
    //p_featured.body.highlight('#c3daf9', {block:true});
});*/
