/*
 * Ext JS Library 2.2
 * Copyright(c) 2006-2008, Ext JS, LLC.
 * licensing@extjs.com
 * 
 * http://extjs.com/license
 */

Ext.onReady(function(){
    Ext.QuickTips.init();

    var industryMenu = new Ext.menu.Menu({
    	id: 'industry',
    	items: [
    	        {
    	        	text: 'General',
    	        	href: '/info/industrylinks#general'
    	        },
    	        {
    	        	text: 'Physician Background Searches',
    	        	href: '/info/industrylinks#physician'
    	        },
    	        {
    	        	text: 'Continuing Education',
    	        	href: '/info/industrylinks#continuing'
    	        },
    	        {
    	        	text: 'Board Certification',
    	        	href: '/info/industrylinks#board'
    	        },
    	        {
    	        	text: 'USMLE/SPEX Information',
    	        	href: '/info/industrylinks#usmle'
    	        },
    	        {
    	        	text: 'License Information',
    	        	href: '/info/industrylinks#license'
    	        },
    	        {
    	        	text: 'State Medical Boards',
    	        	href: '/info/industrylinks#boards'
    	        },
    	        {
    	        	text: 'Relocation',
    	        	href: '/info/industrylinks#relocation'
    	        },
    	        {
    	        	text: 'Practice Management',
    	        	href: '/info/industrylinks#practice'
    	        }
    	       ]
    })
    
    var references = new Ext.menu.Menu({
    	id: 'references',
    	items: [{
    				text: 'Jodi',
    				href: '/index/references'
    			},
    			{
    				text: 'Laura',
    				href: '/index/references#laura'
    			}
    	       ]
    })
    
    var aboutUs = new Ext.menu.Menu({
    	id: 'aboutUs',
    	items: [{
    	        	text: 'History',
    	        	href: '/index/history'
    	        },
    	        {
    	        	text: 'Meet Your Recruiters',
    	        	href: '/index/meetus'
    	        },
    	        {
    	        	text: "References",
    	        	href: '/index/references',
    	        	menu: references
    	        }
    	       ]
    })
    
    var homeMenu = new Ext.menu.Menu({
        id: 'home',
        items: [
                {
                	text: 'Home Page',
                	href: '/index'
                },
	            {
	                text: 'About Us',
	                href: '/index/history',
	                menu: aboutUs
	            }
	           ]
    });
    
   var clientsMenu = new Ext.menu.Menu({
    	id: 'clients',
    	items: [
    	        {
    	            text: 'Why Us',
    	            href: '/clients/whyus'
    	        },
    	        {
    	        	text: 'Industry Links',
    	        	menu: industryMenu,
    	        	href: '/info/industrylinks'
    	        },
    	        {
    	        	text: 'Contract Negotiation',
    	        	href: '/clients/contractnegotiation'
    	        },
    	        {
    	        	text: 'Phone Interview Tips',
    	        	href: '/clients/phone'
    	        },
    	        {
    	        	text: 'Site Visit Tips',
    	        	href: '/clients/sitevisit'
    	        }
    	       ]
    })
    
    var providersMenu = new Ext.menu.Menu({
    	id: 'providers',
    	items: [
    	        {
    	        	text: 'Why Us',
    	        	href: '/providers/whyus'
    	        },
    	        {
    	        	text: 'CV Resources',
    	        	href: '/providers/cvresources'
    	        },
    	        {
    	        	text: 'IndustryLinks',
    	        	menu: industryMenu,
    	        	href: '/info/industrylinks'
    	        },
    	        {
    	        	text: 'Contract Negotiation',
    	        	href: '/providers/contractnegotiation'
    	        },
    	        {
    	        	text: 'Phone Interview Tips',
    	        	href: '/providers/phone'
    	        },
    	        {
    	        	text: 'Site Visit Tips',
    	        	href: '/providers/sitevisit'
    	        },
    	        {
    	        	text: 'Choosing a Recruiter',
    	        	href: '/providers/recruiter'
    	        }
    	]
    })
    
	var referralMenu = new Ext.menu.Menu({
    	id: 'referrals',
    	items: [
    	        {
    	        	text: 'Jobs',
    	        	href: '/referral/job'
    	        },
    	        {
    	        	text: 'Providers',
    	        	href: '/referral/provider'
    	        }
    	]
    })
   
    var tb = new Ext.Toolbar({
    	renderTo: 'topMenu'
    });

    tb.add(
    	{
            text:'Home',
            menu: homeMenu  // assign menu by instance
        },
        '-',
        {
        	text: 'Clients',
        	iconCls: 'bmenu',
        	menu: clientsMenu
        },
        '-',
        {
        	text: 'Providers',
        	iconCls: 'bmenu',
        	menu: providersMenu
        },
        '-',
        {
        	text: 'Search Jobs',
        	iconCls: 'bmenu',
        	handler: function(){window.location='/search/searchjobs';}
        },
        '-',
        {
        	text: 'Referral Bonus',
        	iconCls: 'bmenu',
        	menu: referralMenu
        },
        '-',
        {
        	text: 'Careers',
        	iconCls: 'bmenu',
        	handler: function(){window.location='/careers';}
        },
        '-',
        {
        	text: 'Contact Us',
        	iconCls: 'bmenu',
        	handler: function(){window.location='/info/contactus';}
        }
    )
    
});