// Lokalni promenne
var blockHeight = 37;
var allBlockHeight = 3 * blockHeight;
var listHeight = 23;
var blockName = 'subMenuItem-';

/**
    Funkce pro nastaveni vychozi vysky vsech LI bloku
*/
function resetAllBlocks() {
	height = '' + blockHeight + 'px';
	for (var i=1;i<=3;i++) {
	    //getElementsByClass('li', (blockName + i))[0].style.height = height;
	    getElementsByClass('li', (blockName + i))[0].getElementsByTagName('ul')[0].style.display = 'none';
	}
}

/***/
function checkForSelectedBlock() {
    
}

/**
    Funkce pro samotne nastaveni vysky LI bloku
    @param id - id LI bloku, jehoz obrazek chceme zmenit
    @param newHeight - nova vyska LI bloku
*/
function setHeight(num, newHeight) {
    //getElementsByClass('li', (blockName + num))[0].style.height = newHeight + 'px';
    getElementsByClass('li', (blockName + num))[0].getElementsByTagName('ul')[0].style.display = 'block';
}

/**
    Funkce pro zmenu vysky LI bloku
    @param id - id LI bloku, jemuz chceme zmenit vysku
*/
function resizeBlock(id) {
	h = getElementsByClass('li', (blockName + id))[0].getElementsByTagName('li').length * listHeight;
	resetAllBlocks();
	
	switch (id) {
	    case 1: {
	        setHeight(1, h);
	    } break;
	    case 2: {
	        setHeight(2, h);
	    } break;
	    default: {
	        setHeight(3, h);
	    } break;
    }
}

/** Udalosti na onload */
//addEvent(window, 'onload', 'resetAllBlocks();');
