$(document).ready(function() {
    $('#lang-selection').hide();
    
    $('a#change-language').click(function() {
        $('#location-selection').hide();
        $('#radius-selection').hide();
        $('#lang-selection').slideToggle(400);
        return false;
    });
    
    $(document).click(function() {
        $('#lang-selection').slideUp('fast');
        //return false;
    });
    
    $('#radius-selection').hide();
    
    $('a#change-radius').click(function() {
        $('#lang-selection').hide();
        $('#location-selection').hide();
        $('#radius-selection').slideToggle(400);
        return false;
    });
    
    $(document).click(function() {
        $('#radius-selection').slideUp('fast');
        //return false;
    });
    
    $('#location-selection').hide();
    
    $(document).click(function() {
        $('#location-selection').slideUp('fast');
    });
    
    $('#location-selection').click(function(event){
        event.stopPropagation();
    });
    
    $('a#change-location').click(function() {
        $('#lang-selection').hide();
        $('#radius-selection').hide();
        $("#location-selection").css( { "position": "relative", "left": "0px", "top": "0px" } );
        $('#location-selection').slideToggle(400);
        
        $("#manualInput").focus();
        return false;
    });
    
    $('a#change-location-direction').click(function() {
        $('#lang-selection').slideUp('fast');
        $('#radius-selection').slideUp('fast');
        var pos = $("a#change-location-direction").offset(); 
        
        $("#location-selection").css( { "position": "absolute", "left": "260px", "top": (pos.top - 160) + "px" } );
        $('#location-selection').slideToggle(400);
        
        $("#manualInput").focus();
        return false;
    });
    
});

    function fbs_click() {u=location.href;t=document.title; window.open('http://www.facebook.com/sharer.php?u=' +encodeURIComponent(u)+'&t='+ encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436'); return false; } 
    function fbs_click2(u) {window.open('http://www.facebook.com/sharer.php?u=' +encodeURIComponent(u),'sharer','toolbar=0,status=0,width=626,height=436'); return false; }
