$(document).ready(function() {

    $(".dropdown dt a").click(function() {
        $(".dropdown dd ul").toggle();
//        $("#ru").css({ "color": "red", "font-weight": "bold" });
    });
                
    $(".dropdown dd ul li a").click(function() {
        var text = $(this).html();
        $(".dropdown dt a span").html(text);
        $(".dropdown dd ul").hide();        
        
//        $("#ru").html(getSelectedValue("dropdown_value"));
        if (getSelectedValue("dropdown_value") == 'hotel'){
        	self.location.href = 'http://www.hotel-laval.de';
        }
        if (getSelectedValue("dropdown_value") == 'group'){
        	self.location.href = 'http://www.laval-group.com';
        }
    });

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

});
