

// JavaScript Document
<!-- Start of 1st menu -->
        $(document).ready(function() {
            $(".dropdown img.flag").addClass("flagvisibility");

            $(".dropdown dt a").click(function() {
                $(".dropdown dd ul").toggle();
            });
                        
            $(".dropdown dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown dt a span").html(text);
                $(".dropdown dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown"))
                    $(".dropdown dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown img.flag").toggleClass("flagvisibility");
            });
        });

<!-- end of 1st menu -->

<!-- Start of 2nd menu -->
        $(document).ready(function() {
            $(".dropdown1 img.flag").addClass("flagvisibility1");

            $(".dropdown1 dt a").click(function() {
                $(".dropdown1 dd ul").toggle();
            });
                        
            $(".dropdown1 dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown1 dt a span").html(text);
                $(".dropdown1 dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample1"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown1"))
                    $(".dropdown1 dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown1 img.flag").toggleClass("flagvisibility1");
            });
        });
<!-- end of 2nd menu -->

<!-- Start of 3rd menu -->
        $(document).ready(function() {
            $(".dropdown2 img.flag").addClass("flagvisibility2");

            $(".dropdown2 dt a").click(function() {
                $(".dropdown2 dd ul").toggle();
            });
                        
            $(".dropdown2 dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown2 dt a span").html(text);
                $(".dropdown2 dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample2"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown2"))
                    $(".dropdown2 dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown2 img.flag").toggleClass("flagvisibility2");
            });
        });
<!-- end of 3rd menu -->

<!-- Start of 4th menu -->
        $(document).ready(function() {
            $(".dropdown3 img.flag").addClass("flagvisibility3");

            $(".dropdown3 dt a").click(function() {
                $(".dropdown3 dd ul").toggle();
            });
                        
            $(".dropdown3 dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown3 dt a span").html(text);
                $(".dropdown3 dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample3"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown3"))
                    $(".dropdown3 dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown3 img.flag").toggleClass("flagvisibility3");
            });
        });
<!-- end of 4th menu -->


<!-- Start of 5th menu -->
        $(document).ready(function() {
            $(".dropdown4 img.flag").addClass("flagvisibility4");

            $(".dropdown4 dt a").click(function() {
                $(".dropdown4 dd ul").toggle();
            });
                        
            $(".dropdown4 dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown4 dt a span").html(text);
                $(".dropdown4 dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample4"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown4"))
                    $(".dropdown4 dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown4 img.flag").toggleClass("flagvisibility4");
            });
        });
<!-- end of 5th menu -->

<!-- Start of 6th menu -->
        $(document).ready(function() {
            $(".dropdown5 img.flag").addClass("flagvisibility5");

            $(".dropdown5 dt a").click(function() {
                $(".dropdown5 dd ul").toggle();
            });
                        
            $(".dropdown5 dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown5 dt a span").html(text);
                $(".dropdown5 dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample5"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown5"))
                    $(".dropdown5 dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown5 img.flag").toggleClass("flagvisibility5");
            });
        });
<!-- end of 6th menu -->


<!-- Start of 7th menu -->
        $(document).ready(function() {
            $(".dropdown6 img.flag").addClass("flagvisibility6");

            $(".dropdown6 dt a").click(function() {
                $(".dropdown6 dd ul").toggle();
            });
                        
            $(".dropdown6 dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown6 dt a span").html(text);
                $(".dropdown6 dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample6"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown6"))
                    $(".dropdown6 dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown6 img.flag").toggleClass("flagvisibility6");
            });
        });
<!-- end of 7th menu -->

<!-- Start of 8th menu -->
        $(document).ready(function() {
            $(".dropdown7 img.flag").addClass("flagvisibility7");

            $(".dropdown7 dt a").click(function() {
                $(".dropdown7 dd ul").toggle();
            });
                        
            $(".dropdown7 dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown7 dt a span").html(text);
                $(".dropdown7 dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample7"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown7"))
                    $(".dropdown7 dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown7 img.flag").toggleClass("flagvisibility7");
            });
        });
<!-- end of 8th menu -->

<!-- Start of 9th menu -->
        $(document).ready(function() {
            $(".dropdown8 img.flag").addClass("flagvisibility8");

            $(".dropdown8 dt a").click(function() {
                $(".dropdown8 dd ul").toggle();
            });
                        
            $(".dropdown8 dd ul li a").click(function() {
                var text = $(this).html();
                $(".dropdown8 dt a span").html(text);
                $(".dropdown8 dd ul").hide();
                $("#result").html("Selected value is: " + getSelectedValue("sample8"));
            });
                        
            function getSelectedValue(id) {
                return $("#" + id).find("dt a span.value").html();
            }

            $(document).bind('click', function(e) {
                var $clicked = $(e.target);
                if (! $clicked.parents().hasClass("dropdown8"))
                    $(".dropdown8 dd ul").hide();
            });


            $("#flagSwitcher").click(function() {
                $(".dropdown8 img.flag").toggleClass("flagvisibility8");
            });
        });
<!-- end of 9th menu -->




