/*!
 * Ext JS Library 3.3.1
 * Copyright(c) 2006-2010 Sencha Inc.
 * licensing@sencha.com
 * http://www.sencha.com/license
 */
Ext.onReady(function(){
    Ext.QuickTips.init();

    // Menus can be prebuilt and passed by reference
    var ourComp = new Ext.menu.Menu({
        id: 'ourCompMenu',
        width: 189,
        items: [
            {
                text: 'History',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/history.aspx" }
            },
            {
                text: 'Location',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/location.aspx" }
            }            
          ]
        });
        
        var ourCap = new Ext.menu.Menu({
        id: 'ourCapMenu',
        items: [
            {
                text: 'Assembly Performance Management',
                iconCls: 'p2',
                handler: function clicked() { window.location.href="http://www.perfectpart.com/" }
            },
            {
                text: 'AutoW8t',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/AutoW8t.aspx" }
            },
            {
                text: 'Custom Machines and Test Systems',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/customMachines.aspx" }
            },
            {
                text: 'Design and Build of PLC Based Control Systems',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/designBuild.aspx" }
            },
            {
                text: 'Dispense and Cut System',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/dispenseCut.aspx" }
            },
            {
                text: 'Engineering Services',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/engineering.aspx" }
            },
            {
                text: 'Integration and Custom Manufacturing',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/integration.aspx" }
            },
            {
                text: 'Machine Rework/ Retrofit / Upgrade / Relocate',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/machineRework.aspx" }
            },
            {
                text: 'Material Handling Solutions',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/materialHandling.aspx" }
            },
            {
                text: 'Paint and Dispense Applications',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/PaintDispense.aspx" }
            },
            {
                text: 'SCADA Systems',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/SCADA.aspx" }
            },
            {
                text: 'Tire and Wheel Assembly Solutions',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/tireWheel.aspx" }
            },
            {
                text: 'Tire Pressure Monitoring Systems (TPMS)',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/TPM.aspx" }
            }
          ]
        });
        
        var marketsServe = new Ext.menu.Menu({
        id: 'marketsServeMenu',
        items: [
            {
                text: 'Automotive',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/automotive.aspx" }
            },
            {
                text: 'Defense / Aerospace',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/defense.aspx" }
            },
            {
                text: 'General Industry',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/GeneralIndustry.aspx" }
            },
            {
                text: 'Government Agencies',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/government.aspx" }
            },
            {
                text: 'Logistics',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/logistics.aspx" }
            },
            {
                text: 'Low Volume Manufacturers',
                handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/lowVolMan.aspx" }
            }
          ]
        });
      
    var tb = new Ext.Toolbar();
    tb.render('toolbar');
    
    tb.add({
            text:'Our Company',
            width: 155,
            menu: ourComp         
        },
        {
            text: 'Our Capabilities',
            width: 155,
            menu: ourCap
        },
        {
            text: 'Markets We Serve',
            width: 155,
            menu: marketsServe
        },
        {
            text: 'News',
            width: 155,
            handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/news.aspx" }
        },
        {
            text: 'Contact Us',
            width: 155,
            handler: function clicked() { window.location.href="http://www.esyscorp.com/Content_Pages/contact.aspx" }
        },
        {
            
            iconCls: 'p2',
            width: 35,
            handler: function clicked() { window.location.href="http://www.perfectpart.com" }
        },
        {
            
            iconCls: 'fb',
            width: 35,
            handler: function clicked() { window.location.href="http://www.facebook.com/pages/Esys-Corp/188093903524" }
        },
        {
           
            iconCls: 'tw',
            width: 35,
            handler: function clicked() { window.location.href="http://twitter.com/esyscorp" }
        },
        {
           
            iconCls: 'yt',
            width: 35,
            handler: function clicked() { window.location.href="http://www.youtube.com/user/esyscorp#p/u" }
        }
                
        );

    
    tb.doLayout();

});
