var menuTimeout;

$(document).ready(function ()
                  {
                    $(".main_menu").mouseenter(function() {
                        $(".sub_menu_down").stop(true, true).hide();
                        clearTimeout(menuTimeout);
                        $(this).parent().find("div").slideDown("slow");
                        menuTimeout = setTimeout("hideAllSubMenu()", 2000);       
                    });
                    
                    $(".sub_menu_down").mouseleave(function(){
                        $(this).hide();
                    }).mouseenter(function() {
                        clearTimeout(menuTimeout);
                    });
                  });

$(document).ready(function ()
                  {
                    $("#link_home").click(function ()
                                          {
                                            document.location = "http://" + location.hostname;
                                          });
                    
                    $("#newsOn").change(function ()
                                        {
                                          $(this).parent().submit();
                                        });
                    
                    $("#search_form_activator").click(function ()
                                                      {
                                                        $("#search_form").show();
                                                      });
                  });

function hideAllSubMenu()
{
    $(".sub_menu_down").hide();
}
