var AppMouseOver  = {
    
    build: function(){
        this.countries = {
            'finland':{},
            'grape-arte':{},
            'czech-republic':{},
            'germany':{},
            'usa':{},
            'russia':{}
        };
        
        for (var index in this.countries)
        {
            this.buildCountry(index);
        }
    },
    
    buildCountry: function(index)
    {
        this.countries[index].item = document.getElementById(index);
        this.countries[index].languages = document.getElementById('languages-' + index);
        this.countries[index].languages.style.display = 'none';
        this.countries[index].link = document.getElementById(index + '-link');
        this.countries[index].link.onmouseover = function()
        {
            
            for (var i in AppMouseOver.countries)
            {
                AppMouseOver.countries[i].languages.style.display = 'none';
                AppMouseOver.countries[i].link.className = '';
            }
            AppMouseOver.countries[index].languages.style.display = 'block';
            AppMouseOver.countries[index].link.className = 'active';
        };

    },


    showCountry: function(country)
    {
        if (!AppMouseOver.countries[country])
            return;

        for (var i in AppMouseOver.countries)
        {
            AppMouseOver.countries[i].languages.style.display = 'none';
            AppMouseOver.countries[i].link.className = '';
        }
        AppMouseOver.countries[country].languages.style.display = 'block';
        AppMouseOver.countries[country].link.className = 'active';
    }
    
};
