var lang="ru"; var prev_lang=""; var speed_intro=500; var sl_speed=500; var addr=""; var timer=new Array(); var acting=0; function cl(n) { timer[n]=setTimeout("close_m('"+n+"');",200); } function close_m(n,cb) { clearTimeout(timer[n]); if (!cb) { if (acting) { timer[n]=setTimeout('close_m('+n+')',sl_speed*2); return; } acting=1; $('#'+n).fadeOut(sl_speed, function () { acting=0; }); } //else $('#'+n).slideUp(1, cb()); } var elementHeight = new Array(); $(document).ready(function() { $(".intro_mm_links2 a").click(function() { if ($(this).hasClass("lang")) return false; elems=$(this).parent().find("li"); if (elems.length) return false; }); $(".intro_mm_links a").click(function() { if ($(this).hasClass("lang")) return false; elems=$(this).parent().find("li"); if (elems.length) return false; if (addr) return false; addr=$(this).attr('href'); $(".lang").fadeOut(speed_intro); $(".lang").animate({ opacity: 0 }, speed_intro, function() { if ($.browser.msie) this.style.removeAttribute('filter'); }); $("#cont_"+lang).animate({ opacity: 0 }, speed_intro, function() { if ($.browser.msie) this.style.removeAttribute('filter'); $("#imtro_mm_hold").html("
"); //alert(addr+"!"); window.location.href=addr; //addr=""; return false; }); return false; }); /* $(".alevel0").hover( function() { //if (acting) return; ul=$(this).parent().find("ul"); idd=ul.attr('id'); if (!elementHeight[idd]) { elementHeight[idd]=ul.height(); } //var elementHeight = ul.height(); ul.css('height', elementHeight[idd] + 'px'); acting=1; ul.fadeIn(sl_speed, function() { acting=0; if ($.browser.msie) this.style.removeAttribute('filter'); }); //clearTimeout(timer[idd]); }, function() { //if (acting) return; ul=$(this).parent().find("ul"); idd=ul.attr('id'); cl(idd); } ); $(".mainMenu_sub").mouseover( function() { //if (acting) return; clearTimeout(timer[$(this).attr('id')]); } ); $(".mainMenu_sub").mouseout( function () { //if (acting) return; cl($(this).attr('id')); } ); */ }); function set_lang1(v) { //alert("set lang1"); $(".lang").css('opacity', 0); $("#cont_sel").animate({ opacity: 0 }, speed_intro, function() { $("#cont_sel").css('display', 'none'); lang=v; //alert($("#cont_"+lang).html()); $("#cont_ru").css('opacity', 0); $("#cont_ua").css('opacity', 0); $("#cont_"+lang).css('display', 'block'); $(".lang").animate({ opacity: 1 }, speed_intro, function() { if ($.browser.msie) this.style.removeAttribute('filter'); }); $("#cont_"+lang).animate({ opacity: 1 }, speed_intro, function() { if ($.browser.msie) this.style.removeAttribute('filter'); }); }); } function set_lang2(v) { //alert("set lang2"); $(".lang").animate({ opacity: 0 }, speed_intro); $("#cont_"+lang).animate({ opacity: 0 }, speed_intro, function() { $("#cont_"+lang).css('display', 'none'); lang=v; $(".lang").animate({ opacity: 1 }, speed_intro); $("#cont_"+lang).css('display', 'block'); $("#cont_"+lang).animate({ opacity: 1 }, speed_intro, function() { if ($.browser.msie) this.style.removeAttribute('filter'); }); }); } // contacts $(document).ready(function () { $("a.highslide").click(function() { return hs.expand(this); }); if ($.validationEngine) { $(".valForm").validationEngine({ ajaxSubmit: true, ajaxSubmitFile: $(".valForm").attr('action') }); } }); // menu var timer=new Array(); function cl(n) { timer[n]=setTimeout("close_m('"+n+"');",200); } function close_m(n,cb) { //alert(n); clearTimeout(timer[n]); if (!cb) $('#'+n).hide(); else $('#'+n).slideUp(1, cb()); } $(document).ready(function() { $(".index_mm li:first-level a, .intro_mm_links li:first-level a").hover( function() { ul=$(this).parent().find("ul"); ul.slideDown(200); //var h = ul.height(); //ul.css('height', 0); //ul.animate({height: h}, {duration: 2000}); //ul.fadeIn(); idd=ul.attr('id'); clearTimeout(timer[idd]); }, function() { ul=$(this).parent().find("ul"); idd=ul.attr('id'); cl(idd); } ); $(".index_mm li:first-level a, .intro_mm_links li:first-level a").each(function () { $(this).click( function() { if ($(this).parent().find("ul").length) { return false; } } ); if ($(this).parent().find("ul").length) { $(this).attr('href', ''); $(this).css('cursor', 'default'); } }); $(".index_mm li ul, .intro_mm_links li ul").mouseover( function() { clearTimeout(timer[$(this).attr('id')]); } ); $(".index_mm li ul, .intro_mm_links li ul").mouseout( function () { cl($(this).attr('id')); } ); });