// JavaScript Document


	$(document).ready(function() {
		$(".dropdown1 img.flag").addClass("flagvisibility");

		$(".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("flagvisibility");
		});
	});











	$(document).ready(function() {
		$(".dropdown2 img.flag").addClass("flagvisibility");

		$(".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("flagvisibility");
		});
	});	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	$(document).ready(function() {
		$(".dropdown3 img.flag").addClass("flagvisibility");

		$(".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("flagvisibility");
		});
	});
	
	
	
	
	$(document).ready(function() {
		$(".dropdown4 img.flag").addClass("flagvisibility");

		$(".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("flagvisibility");
		});
	});
	
	$(document).ready(function() {
		$(".dropdown5 img.flag").addClass("flagvisibility");

		$(".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("flagvisibility");
		});
	});



	$(document).ready(function() {
		$(".dropdown6 img.flag").addClass("flagvisibility");

		$(".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("flagvisibility");
		});
	});




	$(document).ready(function() {
		$(".dropdown7 img.flag").addClass("flagvisibility");

		$(".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("flagvisibility");
		});
	});

	
	
	
