////////////////////////// Drop Down ////////////////////////// 
 
 $(document).ready(function() {
            $(".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();
            });
	        });
	
	
////////////////////////// All Sectors Drop Down //////////////////////////	
		
        $(document).ready(function() {
            $(".all_sectors_dropdown dt a").click(function() {
                $(".all_sectors_dropdown dd ul").toggle();
            });
                        
            $(".all_sectors_dropdown dd ul li a").click(function() {
                var text = $(this).html();
                $(".all_sectors_dropdown dt a span").html(text);
                $(".all_sectors_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("all_sectors_dropdown"))
                    $(".all_sectors_dropdown dd ul").hide();
            });
	        });
	
	
////////////////////////// All Project Types Drop Down //////////////////////////	
		
        $(document).ready(function() {
            $(".all_project_types_dropdown dt a").click(function() {
                $(".all_project_types_dropdown dd ul").toggle();
            });
                        
            $(".all_project_types_dropdown dd ul li a").click(function() {
                var text = $(this).html();
                $(".all_project_types_dropdown dt a span").html(text);
                $(".all_project_types_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("all_project_types_dropdown"))
                    $(".all_project_types_dropdown dd ul").hide();
            });
	        });
	
	
////////////////////////// All Locations Drop Down //////////////////////////	
		
        $(document).ready(function() {
            $(".all_locations_dropdown dt a").click(function() {
                $(".all_locations_dropdown dd ul").toggle();
            });
                        
            $(".all_locations_dropdown dd ul li a").click(function() {
                var text = $(this).html();
                $(".all_locations_dropdown dt a span").html(text);
                $(".all_locations_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("all_locations_dropdown"))
                    $(".all_locations_dropdown dd ul").hide();
            });
	        });
	
	
////////////////////////// Sort By Drop Down //////////////////////////	
		
        $(document).ready(function() {
            $(".sort_by_dropdown dt a").click(function() {
                $(".sort_by_dropdown dd ul").toggle();
            });
                        
            $(".sort_by_dropdown dd ul li a").click(function() {
                var text = $(this).html();
                $(".sort_by_dropdown dt a span").html(text);
                $(".sort_by_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("sort_by_dropdown"))
                    $(".sort_by_dropdown dd ul").hide();
            });
	        });

