
$(document).ready(function(){mainMenuInit();});var v_mm=new Object();v_mm.tier2={"speed":250,"wait":350};v_mm.tier2.active_item=0;function mainMenuInit(){$('ul#mm_tier1 > li.submenu_parent').each(function(index){index++;v_mm.tier2['timeout_'+index]=0;$(this).find('div.cover:first').width($(this).find('a:first').innerWidth(true));$(this).hover(function(){var t_which=$(this).attr('rel');if(t_which!=v_mm.tier2.active_item){mainMenuTier2Hide(v_mm.tier2.active_item,1);v_mm.tier2.active_item=t_which;}
clearTimeout(v_mm.tier2['timeout_'+t_which]);if($(this).hasClass('active'))return;$(this).addClass('active').find('div.cover:first').removeClass('hidden');$(this).find('div.mm_tier2:first').slideDown(v_mm.tier2.speed);},function(){var t_which=$(this).attr('rel');v_mm.tier2['timeout_'+t_which]=setTimeout(function(){mainMenuTier2Hide(t_which);},v_mm.tier2.wait);}).attr('rel',index).find('ul:first').each(function(){var t_children=$(this).find('li').size();var t_max_per_col=Math.ceil(t_children/2);var t_ul_index=0;var t_li_index=0;$(this).find('li').each(function(){if(!(t_li_index%t_max_per_col)){t_ul_index++;$(this).parents(':eq(1)').append($('<ul/>').attr('rel',t_ul_index));}
t_li_index++;var t_link=$(this).html();$(this).parents(':eq(1)').find('ul[rel="'+t_ul_index+'"]').append($('<li/>').html(t_link));});}).remove();});for(var i in mm_tier2_features){var t_html='<div class="feature"><a href="%URL%" title="%TITLE%"><img src="%IMG%" alt="%TITLE%" /></a><h4><a href="%URL%">%TITLE%</a></h4></div>';t_html=t_html.replace(/%URL%/g,mm_tier2_features[i].link);t_html=t_html.replace(/%TITLE%/g,mm_tier2_features[i].title);t_html=t_html.replace(/%IMG%/g,mm_tier2_features[i].image);$('ul#mm_tier1').find('div[rel="s_'+mm_tier2_features[i].section_id+'"]:first').append(t_html);}}
function mainMenuTier2Hide(which,t_speed){if(!t_speed)t_speed=v_mm.tier2.speed;$('ul#mm_tier1 > li.submenu_parent[rel='+which+'] > div.mm_tier2:first').slideUp(t_speed,function(){$(this).parent().removeClass('active').find('div.cover:first').addClass('hidden');if(v_mm.tier2.active_item==which)v_mm.tier2.active_item=0;});}
function createTier2Feature(which){}
