/** * Shows sub menu * * @param string menu Defines what to show */ original_focus_menu = false; function submenu(elm) { // finds what menu we are to show menu = $(elm).attr('href'); menu = menu.substr(1); // if we haven't cached the jquery object of the original focused menu yet we'll do that if(!original_focus_menu) { original_focus_menu = $("#mainmenu a.active"); } $("#mainmenu a").removeClass('active'); if($("#submenu_content").is(":visible") && $("#submenu").attr('menu') == menu) { $("#submenu_content").slideUp(); // Put focus on original focused menu again original_focus_menu.addClass('active'); return false; } else { // Put focus to this menu $(elm).addClass('active'); // if this menu is already loaded, we don't need to do more then show it if(menu == $("#submenu").attr('menu')) { $("#submenu_content").slideDown(); return false; } // if the existing menu is the search menu, we'll need to unbind the autofocus event if($("#submenu").attr('menu') == 'search') { $("#siteSearch").removeData("autocomplete").autocomplete("destroy"); } // else we'll loop through the possible cases callback = undefined; switch(menu) { case 'categories': html = '
'; // Span tags in menu will right align html += ''; html += 'New on TV'; html += 'TV archive'; html += ''; // Rest should just be printed left html += 'Film'; html += 'Entertainment'; html += 'TV series'; html += 'Sport'; html += 'Documentaries'; html += 'Science'; html += 'News'; html += 'Kids'; // closing links container html += '
'; break; case 'search': html = '| '; html += ' | '; html += '![]() | ';
html += 'Create search agent'; html += 'With a search agent, TimeFor.TV will automatically run the search for you each day, and send you a reminder when there is new search results. '; html += ''; html += ' | ';
html += '