// JavaScript Document


// Write menus here
var menus = new Array (
                    "Customer Services|rightforyou/customerservice.html",
                    "Finance|rightforyou/finance.html",
                    "Sales|rightforyou/sales.html",
					"Actuaries|rightforyou/actuaries.html",
					"Underwriters|rightforyou/underwriters.html",
					"Internal Audit|rightforyou/audit.html",
					"Marketing|rightforyou/marketing.html",
					"IT|rightforyou/informationtechnology.html"
                    );

var items = new Array();


items[0]  = new Array (                    
                    "Birmingham AXA Insurance|rightforyou/BirminghamAXACareers.html",
                    "Bolton AXA Insurance|rightforyou/BoltonAXACareers.html",
                    "Bristol AXA Life|rightforyou/BristolAXACareers.html",
                    "Coventry AXA Life|rightforyou/CoventryAXACareers.html",
                    "Glasgow AXA Insurance|rightforyou/GlasgowAXACareers.html",
                    "Ipswich AXA Insurance|rightforyou/IpswichAXACareers.html",
                    "Morecambe AXA Insurance|rightforyou/MorcambeAXACareers.html",
                    "Tunbridge Wells AXA PPP|rightforyou/TunbridgeWellsAXACareers.html"
                    );
                    

items[1]  = new Array (
                    "none"
);


items[2]  = new Array (                    
                    "AXA Insurance|rightforyou/sales-axa-insurance.html",
                    "AXA PPP|rightforyou/sales-axa-ppp.html",
                    "AXA Life|rightforyou/sales-axa-life.html"
                    );
                    
items[3]  = new Array (                    
                    "AXA Life|rightforyou/actuaries-axa-life.html",
                    "AXA P&C|rightforyou/actuaries-axa-pandc.html",
                    "AXA Pensions|rightforyou/actuaries-axa-pensions.html",
                    "AXA PPP healthcare|rightforyou/actuaries-axa-healthcare.html"					
                    );

items[4]  = new Array (                    
                    "Underwriting Team <br />AXA Sun Life|rightforyou/underwritingteam.html",
                    "Large Case Underwriting <br />Team AXA Sun Life|rightforyou/largecase.html",
                    "Commercial Lines Underwriting Team|rightforyou/commerciallines.html",
                    "Personal Lines <br />Underwriting Team|rightforyou/personallines.html",
                    "Offer Development Teams|rightforyou/offerdevelopmentteam.html"
                    );

items[5]  = new Array (                    
                    "none"
                    );

items[6]  = new Array (                    
                    "AXA Life|rightforyou/marketing-axa-life.html",
                    "AXA PPP|rightforyou/marketing-axa-ppp.html"
                    );
items[7]  = new Array (                    
                    "none"
                    );


// Writes menu
function write_menu()
    {
		document.write('<img border="0" src="images/nav/lefthandside/Lefthandnav-blue-arewerightforyou.png" />')	
        document.write('<div id="accordion" class="menu_list">');
        document.write('<ul id="pmenu">');
        for(x=0; x<menus.length; x++)
            {
                // Spilts menus into array for menu name and url
                var menu_array  = menus[x].split("|");


					if (menu_array[0] != current_menu)
						{
							var menu  = '<li class="menu_head"><a href="'+menu_array[1]+'">'+menu_array[0]+'</a></li>';
						}
					else
						{
							var menu  = '<li class="menu_head"><a class="active" href="'+menu_array[1]+'">'+menu_array[0]+'</a></li>';
						}

					
                document.write(menu); 
				//alert(menu)
               //alert("The item is:" + items[x] + ":")
                // Checks if current menu has items then writes items
				//if((x !='1') && (x !='5') && (x !='6') && (x !='7'))  
				//{
                if(items[x] !='none')
                {
					

						if (menu_array[0] != current_menu)
						{
							var menu  = '<div class="menu_body">';
						}
						else
						{
							var menu  = '<div class="menu_body active">';
						}
				
						document.write(menu); 
                            // Writes Items
                            for(y=0; y<items[x].length; y++)
                                {
                                    // Splits current item into name and url
                                    var item_array   = items[x][y].split("|");
                                    
                                    document.write('<a href="'+item_array[1]+'">'+item_array[0]+'</a>');
                                }
					
					
                document.write('</div>');
				}
            } //loop
			
			document.write('<div id="bottom"></div>')
			
			
            document.write('</ul>');
        document.write('</div>');
    }
    
function stoperror()
    {
        return true;
    }
    
window.onerror=stoperror
