// Variables ============================================================================
// Set different variables to customize menu

var mouseover_menus = '#cccccc';
var mouseout_menus  = '#dddddd';

var mouseover_items = '#cccccc';
var mouseout_items  = '#f4f4f4';

// Write menus here
var menus = new Array (
	"Home|../gizeh/index.shtml",
	"About Shriners",
	"Articles|../articles/index.shtml",
	"Care Cruiser",
	"Contact Us|../gizeh/contact.shtml",
	"Dates to Remember|../gizeh/dates.shtml",
	"Donations|../gizeh/donate.shtml",
	/*
	"Spring Ceremonial",*/
	"Famous Shriners|../shriners/index.shtml",
	"Gizeh Shriners",
	"Golf Tournament|http://www.carecruisergolf.com",
	"Hall Rentals",
	"Hospitals",
	"Links|../gizeh/links.shtml",
	"Shriner Links",
	"Shriners Only",
	"Shrine of North America and Shriners Hospitals for Children|http://www.shrinershq.org \"target=\"_blank\""
);

var items = new Array();

// Write menu Items here respectively. If any menu item don't have sub items, then leave its respective array blank
items[0]  = new Array (" ");

items[1]  = new Array (
	"History of the Emblem|../about/emblem.shtml",
	"History of the Fez|../about/fez.shtml",
	"History of Shriners in BC|../about/history.shtml",
	"History of Freemasonry in BC|../about/freemasonry.shtml",
	"What is Freemasonry|../about/freemason2.shtml",
	"What is a Shriner|../about/shriner2.shtml",
	"Membership Requirements|../about/requirements.shtml",
	"Join the Shriners|../downloads/petition-for-initiation-04.pdf \"target=\"_blank\"",
	"Shriners Creed|../about/creed.shtml"
);

items[2]  = new Array (" ");

items[3]  = new Array ( 
	"Care Cruiser|../bus/index.shtml", 
	"Care Cruiser Photos|../bus/gallery.shtml",
	"Care Cruiser Video|../bus/video.shtml",
	"Schedule|../bus/schedule.shtml"
);

items[4]  = new Array (" ");

items[5]  = new Array (" ");

/* donations */
items[6]  = new Array (" ");

/*ceremonial
items[7]  = new Array (
	"Welcome Message|../spring_ceremonial_2008/index.shtml",
	"Registration Form|../spring_ceremonial_2008/registration.pdf",
	"Accommodations Rates|../spring_ceremonial_2008/accommodation_rates.shtml",
	"Nobles Program|../spring_ceremonial_2008/nobles_program.pdf",
	"Ladies Program|../spring_ceremonial_2008/ladies_program.pdf",
	"Chilliwack Info|http://www.chilliwack.com/main/page.cfm?id=5"
);*/

/* famous shriners */
items[7]  = new Array (" ");
/* old famous shriners
items[7]  = new Array (
	"Famous Shriners A - C|../shriners/index.shtml",
	"Famous Shriners D - K|../shriners/famous1.shtml",
	"Famous Shriners L - R|../shriners/famous2.shtml",
	"Famous Shriners S - Z|../shriners/famous3.shtml"
);
*/
items[8]  = new Array (
	"Divan|../gizeh/divan.shtml",
	"Gizeh Shrine Clubs|../gizeh/clubs.shtml",
	"Gizeh Units|../gizeh/units.shtml",
	"Graphics|../about/graphics.shtml"
);
/*	"Photo Gallery|../gizeh/gallery.shtml"*/
items[9] = new Array (" ");
/*
items[9]  = new Array (
	"Provincial Shrine Golf Classic|../golf_tournament_2008/provincial_shrine_golf_classic.shtml",
	"Vancouver Island Shrine Golf Classic|../golf_tournament_2008/vancouver_island_shrine_golf_classic.shtml"
);
*/
items[10]  = new Array (
	"Hall Rentals|../hall/index.shtml",
	"Hall Photos|../hall/gallery.shtml"
);

items[11]  = new Array (
	"BC Childrens Hospital|http://www.bcchildrens.ca/default.htm \"target=\"_blank\"",
	"Northern Health|http://www.northernhealth.ca/Your_Health/Programs/NH_Connections/default.asp \"target=\"_blank\"",
	"Shriners Hospitals for Children|http://www.shrinershq.org/Hospitals/_Hospitals_for_Children \"target=\"_blank\"",
	"St. Jude Childrens Hospital|http://www.stjude.org \"target=\"_blank\"",
	"Sunny Hill Health Centre|http://www.bcchildrens.ca/Services/SunnyHillHealthCtr/default.htm \"target=\"_blank\""
);

items[12]  = new Array (" ");

items[13]  = new Array ( 
	"East West Shrine Game|http://www.shrinegame.com/ \"target=\"_blank\"",
	"Grand Lodge of BC and Yukon|http://freemasonry.bcy.ca \"target=\"_blank\"",
	"Shrine Fantasy Show|http://www.shrinefantasyshow.com \"target=\"_blank\"",
	"Our Telemarketer|http://www.xentel.com/index.htm \"target=\"_blank\""
);

items[14]  = new Array (                    
	"Shriners Only|../shrinersonly/index.shtml",
	"Fundraising|../shrinersonly/fundraising.shtml",
	"Gizeh Bylaws|../shrinersonly/bylaws.shtml",
	"Petition for Initiation|../downloads/petition-for-initiation-2010.pdf \"target=\"_blank\""
);
items[15]  = new Array (" ");


// Functions ============================================================================
// Don't Edit Below


// Menu Title Mouse Over-Mouse Out
function menu_over(x)
    {
        if(document.getElementById||(document.all && !(document.getElementById)))
            {
                x.style.backgroundColor=mouseover_menus;
            }
     }

function menu_out(x)
    {
        if(document.getElementById||(document.all && !(document.getElementById)))
            {
                x.style.backgroundColor=mouseout_menus;
            }
    }

// Item Mouse Over-Mouse Out
function item_over(x)
    {
        if(document.getElementById||(document.all && !(document.getElementById)))
            {
                x.style.backgroundColor=mouseover_items;
            }
    }

function item_out(x)
    {
        if(document.getElementById||(document.all && !(document.getElementById)))
            {
                x.style.backgroundColor=mouseout_items;
            }
    }
 
 
 
// Statement to collapse items;
function collapse(id)
    {
        if (document.getElementById(id).style.display=="")
            {
                document.getElementById(id).style.display = "none";
                return;
            }
        for (i=0; i<menus.length; i++)
            {
                var others = document.getElementById(i+1);
                others.style.display = "none";
            }
        document.getElementById(id).style.display = "";
    }
 
// Statement to open links
function go(url)
    {
        window.location=url;
    }
 
                     
                         
// Writes menu
function write_menu()
    {
        document.write('<div id="navigation_bar">');
        
        for(x=0; x<menus.length; x++)
            {
                document.write('<div>');
                
                // Spilts menus into array for menu name and url
                var menu_array  = menus[x].split("|");
                // If menus url is not available the just makes expand and collapse effect on menu
                if (!menu_array[1])
                    {
                        var menu  = '<div id="menu" onMouseOver=menu_over(this); onMouseOut=menu_out(this); onClick="collapse(\''+(x+1)+'\')">'+menus[x]+'</div>';
                    }
                else
                    {
                        var menu  = '<div id="menu" onMouseOver=menu_over(this); onMouseOut=menu_out(this); onClick="collapse(\''+(x+1)+'\'); go(\''+menu_array[1]+'\')"><a href="'+menu_array[1]+'">'+menu_array[0]+'</a></div>';
                    }
                document.write(menu); 
                    
                // Checks if current menu has items then writes items
                if(items[x] !='')
                    {
                        // If menu is not current then sets its display to none
                        if (menu_array[0] != current_menu)
                            {
                                document.write('<div style="display:none" id="'+(x+1)+'">');
                            }
                        else
                            {
                                document.write('<div style="display:" id="'+(x+1)+'">');
                            }
                                
                            // Writes Items
                            for(y=0; y<items[x].length; y++)
                                {
                                    // Splits current item into name and url
                                    var item_array   = items[x][y].split("|");
                                    
                                    // If item name is not current then acts with it as a ordinary item
                                    if (item_array[0] != current_item)
                                        {
                                            document.write('<div id="item" onMouseOver=item_over(this); onMouseOut=item_out(this); onClick="go(\''+item_array[1]+'\')"><a href="'+item_array[1]+'">'+item_array[0]+'</a></div>');
                                        }
                                    // Or if it current, then removes hyperlink and change it background color to current items background color
                                    else
                                        {
                                            document.write('<div id="current_item">'+item_array[0]+'</div>');
                                        }
        
                                }
                        }
                        
                    document.write('</div>');            
                document.write('</div>');
            }
            
        document.write('</div>');
    }
    
function stoperror()
    {
        return true
    }
    
window.onerror=stoperror
