function first_open_menu(){
// heigt menu_block_content
if( menu_block_content_height_first_load == 1){
// calculate size crop block content height
menu_block_heading_height = menu_block_heading.getBoundingClientRect().height;
menu_block_content_height_first_load = 0;
// crop block content height
for(i=0; i < menu_block_content.length; i++){
menu_block_content_height[i] = menu_block_content[i].getBoundingClientRect().height;
menu_block_content[i].style.height = menu_block_heading_height + 'px';
}
}
}
// hover effects menu block
menu_block_1.addEventListener('mouseover', menu_block_1_mouseover);
menu_block_1.addEventListener('mouseout', menu_block_1_mouseout);
menu_block_2.addEventListener('mouseover', menu_block_2_mouseover);
menu_block_2.addEventListener('mouseout', menu_block_2_mouseout);
menu_block_3.addEventListener('mouseover', menu_block_3_mouseover);
menu_block_3.addEventListener('mouseout', menu_block_3_mouseout);
menu_block_4.addEventListener('mouseover', menu_block_4_mouseover);
menu_block_4.addEventListener('mouseout', menu_block_4_mouseout);
function menu_block_1_mouseover(event){ if(stop_function_desktop == 0) return; menu_block_content[0].style.height = menu_block_content_height[0] + 'px'; }
function menu_block_1_mouseout(event){ if(stop_function_desktop == 0) return; menu_block_content[0].style.height = menu_block_heading_height + 'px'; }
function menu_block_2_mouseover(event){ if(stop_function_desktop == 0) return; menu_block_content[1].style.height = menu_block_content_height[1] + 'px'; }
function menu_block_2_mouseout(event){ if(stop_function_desktop == 0) return; menu_block_content[1].style.height = menu_block_heading_height + 'px'; }
function menu_block_3_mouseover(event){ if(stop_function_desktop == 0) return; menu_block_content[2].style.height = menu_block_content_height[2] + 'px'; }
function menu_block_3_mouseout(event){ if(stop_function_desktop == 0) return; menu_block_content[2].style.height = menu_block_heading_height + 'px'; }
function menu_block_4_mouseover(event){ if(stop_function_desktop == 0) return; menu_block_content[3].style.height = menu_block_content_height[3] + 'px'; }
function menu_block_4_mouseout(event){ if(stop_function_desktop == 0) return; menu_block_content[3].style.height = menu_block_heading_height + 'px'; }