        jQuery(document).ready(function() {
        	jQuery(".dropdown img.flag").addClass("flagvisibility");

            jQuery(".dropdown dt a").click(function() {
                jQuery(".dropdown dd ul").toggle();
                return false;
            });
                        
            jQuery(".dropdown dd ul li a").click(function() {
                var text = jQuery(this).html();
                jQuery(".dropdown dt a span").html(text);
                jQuery(".dropdown dd ul").hide();
                //jQuery("#result").html("Selected value is: " + getSelectedValue("sample"));
            });
                        
            function getSelectedValue(id) {
                return jQuery("#" + id).find("dt a span.value").html();
            }

            jQuery(document).bind('click', function(e) {
                var jQueryclicked = jQuery(e.target);
                if (! jQueryclicked.parents().hasClass("dropdown"))
                    jQuery(".dropdown dd ul").hide();
            });


            jQuery("#flagSwitcher").click(function() {
                jQuery(".dropdown img.flag").toggleClass("flagvisibility");
            });
        });

