var paramsFlash = {
   menu: "false",
   wmode: "transparent"
};
var searchText = "ïîèñê ïî ñàéòó";
var playerVersion = swfobject.getFlashPlayerVersion();
var version = playerVersion.major+"."+playerVersion.minor+"."+playerVersion.release;
var is_ie = (/msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent));
function GID(id) { return (is_ie) ? document.all[id] : document.getElementById(id); }

function fnCheckSearchForm(f) {
   if (!f.search.value.match(/^.+$/) || f.search.value == searchText) {
      alert("Óêàæèòå ïîèñêîâûé çàïðîñ!");
      f.search.focus();
      return false;
   }
   return true;
}

$(document).ready(function() {
   $(document).pngFix();
   checkFlash();
   $(".menuLeft").hover(
      function () {
         $(this).removeClass("menuLeft");
         $(this).addClass("menuLeftSel");
         $(this).children().removeClass("menuHref");
         $(this).children().addClass("menuHrefSel");
      },
      function () {
         $(this).removeClass("menuLeftSel");
         $(this).addClass("menuLeft");
         $(this).children().removeClass("menuHrefSel");
         $(this).children().addClass("menuHref");
      }
   );
   $(".submenuLeft").hover(
      function () {
         $(this).children().removeClass("submenuHref");
         $(this).children().addClass("submenuHrefSel");
      },
      function () {
         $(this).children().removeClass("submenuHrefSel");
         $(this).children().addClass("submenuHref");
      }
   );
   $(".subsubmenuLeft").hover(
      function () {
         $(this).children().removeClass("subsubmenuHref");
         $(this).children().addClass("subsubmenuHrefSel");
      },
      function () {
         $(this).children().removeClass("subsubmenuHrefSel");
         $(this).children().addClass("subsubmenuHref");
      }
   );
   $(".subsubsubmenuLeft").hover(
      function () {
         $(this).removeClass("subsubsubmenuLeft");
         $(this).addClass("subsubsubmenuLeftSel");
         $(this).children().removeClass("subsubsubmenuHref");
         $(this).children().addClass("subsubsubmenuHrefSel");
      },
      function () {
         $(this).removeClass("subsubsubmenuLeftSel");
         $(this).addClass("subsubsubmenuLeft");
         $(this).children().removeClass("subsubsubmenuHrefSel");
         $(this).children().addClass("subsubsubmenuHref");
      }
   );
});

function slideSubmenu(idM) {
   var isShow = ($("#submenu"+idM).css('display') == 'block' ? false : true);
   if (isShow) $("#submenu"+idM).css('display', 'block');
   else $("#submenu"+idM).css('display', 'none');
   return false;
}

function slideSubSubmenu(idM) {
   var isShow = ($("#subsubmenu"+idM).css('display') == 'block' ? false : true);
   if (isShow) $("#subsubmenu"+idM).css('display', 'block');
   else $("#subsubmenu"+idM).css('display', 'none');
   return false;
}

function slideSubSubSubmenu(idM) {
   var isShow = ($("#subsubsubmenu"+idM).css('display') == 'block' ? false : true);
   if (isShow) $("#subsubsubmenu"+idM).css('display', 'block');
   else $("#subsubsubmenu"+idM).css('display', 'none');
   return false;
}

function displayMenu(idM) {
   var brouser = $.browser;
   var offset = $("#img"+idM).offset();
   var left = offset['left']-($.browser.msie ? 2 : 0);
   var top = offset['top']+$("#img"+idM).height()-($.browser.msie ? 2 : 0);
   $("#topMenu"+idM).css({'left': left, 'top': top, 'display': 'block'});
}

function hideMenu(idM) {
   $("#topMenu"+idM).css('display', 'none');
}
