var all_menu = {
    ru: [
	{img: '1main', link: '/ru/'},
	{img: '2accounts', link: '/ru/howtohelp/money/'},
	{img: '3about', link: '/ru/aboutsite/'},
	{img: '4lesha', link: '/ru/aboutlesha/'},
	{img: '5disease', link: '/ru/disease/'},
	{img: '6history', link: '/his/index.html'},
	{img: '7video', link: 'http://community.livejournal.com/video_helping/'},
	{img: '8banners', link: '/ru/howtohelp/banners/'},
	{img: '9press', link: '/ru/howtohelp/press/'},
	{img: '10goods', link: '/ru/goods/'},
	{img: '11docs', link: '/a/docs/docs.htm'},
	{img: '12blog', link: 'http://community.livejournal.com/helping_hand_ru/'},
	{img: '13howto', link: '/ru/howtohelp/'}
    ],
    en: [
	{img: '1main', link: '/en/'},
	{img: '2accounts', link: '/en/howtohelp/money/'},
	{img: '3about', link: '/en/aboutsite/'},
	{img: '4disease', link: '/en/disease/'},
	{img: '5history', link: '/his/index.html'},
	{img: '6video', link: 'http://community.livejournal.com/video_helping/'},
	{img: '7banners', link: '/en/howtohelp/banners/'},
	{img: '8press', link: '/en/howtohelp/press/'},
	{img: '9goods', link: '/en/goods/'},
	{img: '10docs', link: '/a/docs/docs.htm'},
	{img: '11blog', link: 'http://community.livejournal.com/helping_hand_ru/'},
	{img: '12howto', link: '/en/howtohelp/'}
    ]
};

Function.prototype.bind = function(object) {
    var method = this
    return function() {
        return method.apply(object, arguments) 
    }
}

function show_menu(lang) {
    var menu = all_menu[lang];
    var bottom = document.getElementById('bottom');
    for (var i = 0; i < menu.length; i++) {
		var m = menu[i];
		var image = document.createElement('IMG');
		image.id = m['img'];

		image.alt = "";
		image.src = IMG_PREFIX + lang + '/' + image.id + '_h.png';
		image.onmouseover = function() {
			this.src = IMG_PREFIX + lang + '/' + this.id + '.png';
		}.bind(image);
		image.onmouseout = function(event) {
			this.src = IMG_PREFIX + lang + '/' + this.id + '_h.png';
		}.bind(image);
		m.elem = image;
		var a = document.createElement('a');
		a.href = m.link;
		a.appendChild(image);
		bottom.appendChild(a);
    }
}
