   /*
                 Initialize and render the Menu when its elements are ready 
                 to be scripted.
   */

            YAHOO.util.Event.onContentReady("productsandservices", function () {

                /*
                     Instantiate a Menu:  The first argument passed to the 
                     constructor is the id of the element in the page 
                     representing the Menu; the second is an object literal 
                     of configuration properties.
                */

                var oMenu = new YAHOO.widget.Menu(
                                    "productsandservices", 
                                    {
                                        position: "static", 
                                        hidedelay: 750, 
                                        lazyload: true, 
                                        effect: { 
                                            effect: YAHOO.widget.ContainerEffect.FADE,
                                            duration: 0.25
                                        } 
                                    }
                            );


                /*
                     Define an array of object literals, each containing 
                     the data necessary to create a submenu.
                */

                var aSubmenuData = [                
                    {
                        id: "AboutAVS", 
                        itemdata: [ 
                       		{
                                text: "What is AVS", url: "aboutavs.asp"                          
                            
                            }, 
                            {
                                text: "Achievement", url: "Achievement.asp",
                                submenu: { 
                                            id: "Achievement", 
                                            itemdata: [
                                                { text: "AVS1.0", url: "Achievement.asp#2.1" },
                                                { text: "AVS2.0", url: "Achievement.asp#2.2" },
                                            ] 
                                        }
                            
                            },
                            { text: "AVS Rules", url: "AVSRules.asp",
	                            submenu: { 
	                                            id: "AVSRules", 
	                                            itemdata: [
	                                                { text: "AVS Constitution", url: "http://www.avs.org.cn/english/Doc/AVS%20Constitution%20(Sep122004-Dual%20Languages).doc" },
	                                                { text: "Bylaws", url: "http://www.avs.org.cn/english/Doc/AVS%20Bylaws%20(Sep132004-Dual%20Languages).doc" },
	                                                { text: "Management Structure", url: "http://www.avs.org.cn/english/Doc/AVS%20Structure.doc" },
	                                                { text: "Default Licensing Form", url: "http://www.avs.org.cn/english/Doc/Default%20Licensing%20Form.doc" },
	                                                { text: "IPR Policy", url: "http://www.avs.org.cn/english/Doc/AVS%20IPR%20Policy%20(Mar29%202008-Dual%20Languages).doc" },
	                                                { text: "Advisory Guidelines for Patent... ", url: "http://www.avs.org.cn/english/Doc/Advisory%20Guidelines%20for%20Patent%20Pool%20License%20of%20AVS%20Standards.doc" },
	                                                { text: "AVS Patent Pool Administration... ", url: "http://www.avs.org.cn/english/Doc/AVS%20Patent%20Pool%20Administration%20Advisory%20Guidelines.doc" },
	                                                { text: "IPR Policy (Attachment)", url: "http://www.avs.org.cn/english/Doc/Legacy%20Member%20Amendment%20(Sep122004-Dual%20Languages).doc" },
	                                                { text: "Disclosure Form for Contribution", url: "http://www.avs.org.cn/english/Doc/Disclosure%20Form%20for%20Contribution.doc" },
													{ text: "Disclosure Form for Standard Draft", url: "http://www.avs.org.cn/english/Doc/Disclosure%20Form%20for%20Standard%20Draft.doc" },
													{ text: "Member agreement", url: "http://www.avs.org.cn/english/Doc/AVS%20MemberAgreement%20.doc" },
	                                            ] 
	                                        }

                             },
                            { text: "AVS Structure", url: "AVSStructure.asp" },
							{ text: "Technical Subgroups", url: "Subgroups.asp" },
 							{ text: "Industrial Prospects", url: "Prospects.asp" },
                        ]
                    },
                    {
                        id: "AVSMember",  url: "AVSMember.asp",
                        itemdata: [
                            { text: "List of Members", url: "avsmembership.asp" },                            
                            {
                                text: "How to join us", url: "AVSMember.asp" ,
                                submenu: { 
                                            id: "Howtojoinus", 
                                            itemdata: [
                                                { text: "Joining procedure", url: "AVSMember.asp#2.1" },
                                                { text: "Download application forms", url: "AVSMember.asp#2.2" },
                                                { text: "Fees and bank information",  url: "AVSMember.asp#2.3" },  
                                                { text: "Bank information",  url: "AVSMember.asp#2.4" },                                                
                                            ] 
                                        }
                            
                            },
 							{ text: "Membership class", url: "AVSMember.asp#2" } ,             
                        ]    
                    },
                    
                    {
                        id: "Event", 
                        itemdata: [
                            {
                                text: "Main great events", url: "Event.asp",
                                submenu: { 
                                            id: "Maingreatevents", 
                                            itemdata: [
                                                { text: "2009", url: "Event.asp" },
                                                { text: "2008",  url: "Event.asp#2008"},
                                                { text: "2007", url: "Event.asp#2007" },
                                                { text: "2006", url: "Event.asp#2006" },
                                                { text: "2005", url: "Event.asp#2005" },
                                                { text: "2004", url: "Event.asp#2004" },
                                                { text: "2003", url: "Event.asp#2003" },
                                                { text: "2002", url: "Event.asp#2002" },
                                                { text: "Before 2002", url: "Event.asp#Before " }
                                            ] 
                                        }
                            
                            },                            { text: "Meetings ", url: "../member.asp" }                        ] 
                    },
                    
                    {
                        id: "Document",
                        itemdata: [
                            { text: "Document Download", url: "Document.asp" },
                            {
                                text: "English Spec.", url: "EnglishSpec.asp"
                            
                            },
                        ]
                    }                    
                ];


                // Subscribe to the Menu instance's "beforeRender" event

                oMenu.subscribe("beforeRender", function () {

                    if (this.getRoot() == this) {
                        this.getItem(0).cfg.setProperty("submenu", aSubmenuData[0]);
                        this.getItem(1).cfg.setProperty("submenu", aSubmenuData[1]);
                        this.getItem(2).cfg.setProperty("submenu", aSubmenuData[2]);
                        this.getItem(3).cfg.setProperty("submenu", aSubmenuData[3]);

                    }

                });


                /*
                     Call the "render" method with no arguments since the 
                     markup for this Menu instance is already exists in the page.
                */

                oMenu.render();
            
            });
