//onload
$(function() {
    //show topbar only on startpage
    if ($("#mainstart").length > 0) {
        //hide topbar after 5 seconds
        vmd.langcontainer.timer = setTimeout('vmd.langcontainer.hide();', 5000);
    } else {
        $("#langcontainer").css("top", -25);
        $("#langcontainer-closed").css("top", 0);
    }

    
    //topbar
    $("#langcontainer-closed-handler").removeAttr("href");
    $("#langcontainer-closed-handler").mouseover(vmd.langcontainer.show);
    $("#country-current").toggle(function() {
        $("#countries").show();
        clearTimeout(vmd.langcontainer.timer);
    }, function() {
        $("#countries").hide();
        vmd.langcontainer.timer = setTimeout('vmd.langcontainer.hide();', 5000);
    });
    $("#language-current span").toggle(function() {
        $("#languages").show();
        clearTimeout(vmd.langcontainer.timer);
    }, function() {
        $("#languages").hide();
        vmd.langcontainer.timer = setTimeout('vmd.langcontainer.hide();', 5000);
    });

});

var vmd = {
    langcontainer: {
        timer: false,
        
        show: function() {
            $("#langcontainer").animate({top: 0}, 400);
            $("#langcontainer-closed").animate({top: -25}, 300);
            vmd.langcontainer.timer = setTimeout('vmd.langcontainer.hide();', 10000);
        },
        
        hide: function() {
            $("#langcontainer").animate({top: -25}, 1000);
            $("#langcontainer-closed").animate({top: 0}, 1000);
        }
    }
}