Ext.onReady(function() {
    //Ext.QuickTips.init();

    var store = new Ext.data.SimpleStore({
        fields: [
                { name: 'id' },
                { name: 'titulo' }
           ],
        proxy: new Ext.data.PagingMemoryProxy(Home.getDataSource())
    });

    var combo = new Ext.form.ComboBox({
        store: store,
        displayField: 'titulo',
        valueField: 'id',
        typeAhead: true,
        forceSelection: true,
        triggerAction: 'all',
        emptyText: 'SELECIONE UMA LOJA',
        selectOnFocus: true,
        editable: false,
        applyTo: 'cmbteste'
    });

    combo.on('select',
	  	function(e) {
	  	    window.location = "home.html?loja_id=" + e.value,
	  	    w3cookies.create('loja', e.value);
	  	},
		this, {
		    single: true,
		    delay: 100,
		    forumId: 4
		});

    var lojaId = document.location.search.substring(9);

    if (lojaId.indexOf('&') >= 0)
        lojaId = lojaId.substr(0, lojaId.indexOf('&'));

    if (null != lojaId && !isNaN(lojaId) && lojaId.trim() != "") {

        Home.getDestaque(lojaId);
        Home.getMenu(lojaId);
        Home.getFaixa(lojaId);
        

	    
    }
});