$(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();*/
		window.location=$(this).attr("clink");
	});

				

	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();
	});

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

/* dropdown 2 */

	$(".dropdownhmw img.flag").addClass("flagvisibility");
	$(".dropdownhmw dt a").click(function() {
		$(".dropdownhmw dd ul").toggle();
	});
	$(".dropdownhmw dd ul li a").click(function() {
		var text = $(this).html();
		window.location=$(this).attr("clink");
	});

				

	function getSelectedValue(id) {
		return $("#" + id).find("dt a span.value").html();
	}

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

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

});
