function scrollHero(){var t=jQuery(window).scrollTop(),e=$("#bgheader").height(),o=$("#bgheader").height()/2,r=(Math.max(o-t,0)/o,Math.min(t,e)/e);heroBlackCoverScrollOpacity=r,heroContainerHover&&heroBlackCoverHoverOpacity>r&&(r=heroBlackCoverHoverOpacity),jQuery(".blackCover").first().css({opacity:r})}function attachClickArrow(){tmp.length>0&&$("#arrowBookmars").css("display","block"),$("#nextBookmark").on("click",function(t){t.preventDefault(),currentBookmarkIndex>=tmp.length-1&&(currentBookmarkIndex=-1),currentBookmarkIndex++;var e=tmp[currentBookmarkIndex];"undefined"!=typeof e&&e>0&&$("html,body").scrollTo(e-70,"slow")}),$("#prevBookmark").on("click",function(t){t.preventDefault(),0>=currentBookmarkIndex&&(currentBookmarkIndex=tmp.length),currentBookmarkIndex--;var e=tmp[currentBookmarkIndex];"undefined"!=typeof e&&e>0&&$("html,body").scrollTo(e-70,"slow")})}function supports_html5_storage(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}}function appendBookmark(t,e,o){if("undefined"!=typeof t&&"undefined"!=typeof o){var r="",a="bookmark"+parseInt(o);r="undefined"==typeof e||e===!1?$(''):$(''),$("body").append(r),r.on("click",function(e){e.preventDefault();var r="bookmark"+parseInt(o);null!==localStorage.getItem(r)&&$(this).animate({width:"0"},400,function(){$(this).remove(),localStorage.removeItem(r);var e=tmp.indexOf(parseInt(t));e>-1&&tmp.splice(e,1),tmp.sort(compareNumeric),$("#overlayBoxMain-inner-content").html("Закладка удалена"),$("#overlayBoxMain").fadeIn(400,function(){setTimeout(function(){$("#overlayBoxMain").fadeOut(400)},1e3)}),$(".bookmarks").length<=0&&$("#arrowBookmars").css("display","none")})}),"undefined"!=typeof e&&e===!0&&(tmp.push(parseInt(t)),tmp.sort(compareNumeric),r.animate({width:"50px"},700,function(){$("#overlayBoxMain-inner-content").html("Закладка добавлена"),$("#overlayBoxMain").fadeIn(400,function(){setTimeout(function(){$("#overlayBoxMain").fadeOut(400)},1e3)})}),$(".bookmarks").length>0&&$("#arrowBookmars").css("display","block"))}}function compareNumeric(t,e){return t>e?1:e>t?-1:void 0}var isMobile={Android:function(){return navigator.userAgent.match(/Android/i)},BlackBerry:function(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function(){return navigator.userAgent.match(/IEMobile/i)||navigator.userAgent.match(/WPDesktop/i)},any:function(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}},heroBlackCoverScrollOpacity=0,heroBlackCoverHoverOpacity=.9,heroContainerHover=!1;jQuery(window).scroll(scrollHero),$(document).ready(function(){var t=$("#headerTest").offset();$(window).scrollTop()>t.top&&$(window).width()>900&&$("#headerTest").stop().animate({top:$(window).scrollTop()-t.top+50+"px"}),$(window).scroll(function(){$(window).scrollTop()>t.top&&$(window).width()>900?$("#headerTest").stop().animate({top:$(window).scrollTop()-t.top+50+"px"}):$("#headerTest").stop().animate({top:0})}),$("#headerLnk").on("click",function(t){t.preventDefault();var e=$(".content:first").width()/1.8;$(window).width()<=650&&(e=$(window).width()-80),$(window).width()>900&&($("#headerSlider").css("margin-top",-($(this).width()+10)+"px"),$("#headerSlider").width(e).toggle(400)),$(window).width()<=900&&($("#headerSlider").width(e),$("#headerSlider").is(":hidden")?$("#headerSlider").slideDown("slow"):$("#headerSlider").slideUp("slow"))}),$(".h-list a, .h-list p, #downArrow a").on("click",function(t){if(t.preventDefault(),$(this).attr("data-scroll")&&$("#"+$(this).attr("data-scroll")).length>0){var e=$("#"+$(this).attr("data-scroll")).offset().top;$("html,body").scrollTo(e-70,"slow")}}),$(".quiestGen-lnk,.quiestGen-lnk2").on("click",function(t){t.preventDefault();var e=$(this).parents(".quiestGen");e.find(".quiestGen-answ").is(":visible")?e.find(".quiestGen-arrow img").attr("src","content/arrow.gif").css("width","1em"):e.find(".quiestGen-arrow img").attr("src","content/arrowB.gif").css("width","2em"),e.find(".quiestGen-answ").toggle(400)}),$(".catLnk a").on("click",function(t){t.preventDefault(),$(this).parent().prev(".cat").is(":visible")?$(this).text("читать далее"):$(this).text("свернуть"),$(this).parent().prev(".cat").toggle(400)})}),addrShow=function(){if($(this).find(".addrShow").length>0)return $(".addrShow").hide(0),!1;var t=$(this).offset().left,e=$(".box1160:first").width();$(".addrShow").remove(),$(this).prepend(' '+$(this).data("title").toString()+" ");var o=220;800>=e&&(o=e/2.5,$(".addrShow").width(o)),e/2>=t?$(".addrShow").css("left","0"):$(".addrShow").css({left:"auto",right:"0"})},addrShowHover=function(){var t=$(this).offset().left,e=$(".box1160:first").width();$(".addrShow").remove(),$(this).prepend(' '+$(this).data("title").toString()+" ");var o=220;800>=e&&(o=e/2.5,$(".addrShow").width(o)),e/2>=t?$(".addrShow").css({left:"0","text-align":"left"}):$(".addrShow").css({left:"auto",right:"0","text-align":"right"})},isMobile.any()?$(".addr").on("click",addrShow):$(".addr").hover(addrShowHover,function(){$(".addrShow").hide(0)}),$(window).resize(function(){var t=$(".content:first").width()/1.8;$(window).width()<=650&&(t=$(window).width()-80),$("#headerSlider").width(t),$(window).width()<=900?$("#headerSlider").css("margin-top","-7px"):$("#headerSlider").css("margin-top",-($("#headerLnk").width()+10)+"px")});var bookmarkOffsetsArray=new Array,currentBookmarkIndex=-1,countBookmars=0,tmp=new Array;if(supports_html5_storage()){for(i=0;i