
var winHeight = 0, winWidth = 0;
var tabs = null;

var iconOptions = {};
iconOptions.width = 32;
iconOptions.height = 32;
iconOptions.primaryColor = "#FF0000";
iconOptions.cornerColor = "#FFFFFF";
iconOptions.strokeColor = "#000000";
defaultIcon = MapIconMaker.createMarkerIcon(iconOptions);


function getBrowserWindowSize() {
    if( typeof( window.innerWidth ) == 'number' ) {
	//Non-IE
	winWidth = window.innerWidth;
	winHeight = window.innerHeight;
    } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	//IE 6+ in 'standards compliant mode'
	winWidth = document.documentElement.clientWidth;
	winHeight = document.documentElement.clientHeight;
    } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	//IE 4 compatible
	winWidth = document.body.clientWidth;
	winHeight = document.body.clientHeight;
    }
    if (tabs) {
	tabs.setWidth(winWidth);
	tabs.setHeight(winHeight);
    }
}

agencySelect = new Ext.form.ComboBox({
    store: AgencyStore,
    displayField:'name',
    typeAhead: true,
    triggerAction: 'all',
    emptyText:'Select An Agency...',
    selectOnFocus: true,
    forceSelection: true,
    autoCreate: true
})
agencySelect.on('select', function (box, record, index) {
        yai = record.data.yid
        agency = record;
        main.tabs.setActiveTab('routeViewer');
        RouteStore.reload({ params: { yai: yai } });
        });

    view = new Ext.Viewport({
        id: 'main',
        layout: 'fit',
        items:  [
            new Ext.TabPanel({
                id: 'tabs',
                items: [ { id: 'loadingTab', title: "Loading", html: 'Loading' } ],
                tbar: [agencySelect]
            })
        ]
    });
    var main = Ext.getCmp('main');
    main.tabs = Ext.getCmp('tabs');
    main.tabs.tabList = new Array();

// vim: et sts=4 cindent sw=4
