Cufon.replace("#header .logo",{fontFamily:'PlumbBlackSoftC'});$(document).ready(function(){$(".anons_block").hover(function(){$(".anons_block .preview_img").removeClass("over");$(".preview_img",this).addClass("over");$(".photo_block").removeClass("over");$(".photo_block.p"+$(this).attr("id")).addClass("over");});$(".bookmarks li").click(function(){$(".bookmarks li").removeClass("act");$(this).addClass("act");$(".bookmark_block").removeClass("act");$(".bookmark_block.m"+$(this).attr("id")).addClass("act");});$(".info .links ins").click(function(){$(".info .links ins").removeClass("act");$(this).addClass("act");});var more=false;$(".more").click(function(){$(this).toggleClass("act");if(!more){$(".pseudo",this).text("свернуть");more=true;}else{$(".pseudo",this).text("ещё");more=false;}$(".more_links").slideToggle(200);});$(".with_hover").hover(function(e){$(".alt_block",this).addClass("act").css({"left":(e.pageX-$(this).offset().left-Math.ceil($(".alt_block").width()/2))+"px","top":(e.pageY-$(this).offset().top-$(".alt_block").outerHeight(true)-13)+"px"});},function(){$(".alt_block",this).removeClass("act");});$(".with_hover").mousemove(function(e){var left_pos=e.pageX-$(this).offset().left-Math.ceil($(".alt_block").width()/2);var delta_height=$(".alt_block").outerHeight(true)+13;var top_pos=e.pageY-$(this).offset().top-delta_height;if(left_pos<=$(this).width()&&left_pos>0&&top_pos<=$(this).height()-$(".alt_block").outerHeight(true)&&top_pos>=-delta_height){$(".alt_block",this).css("left",left_pos+"px");$(".alt_block",this).css("top",top_pos+"px");}});if($("table").hasClass("colored")){$("table.colored tr").each(function(i){if(i==1){$("td",this).css("padding-top","14px");}if(i==$("table.colored tr").length-1){$("td",this).css("padding-bottom","20px");}if(i%2==0){$("td",this).addClass("colored_td");}});}$("#header .search .text").click(function(){if($(this).attr("value")!=""){$("#header .search .ic_close").fadeIn(200);}else{$("#header .search .ic_close").fadeOut(200);}});$("#header .search .text").keyup(function(){if($(this).attr("value")!=""){$("#header .search .ic_close").fadeIn(200);}else{$("#header .search .ic_close").fadeOut(200);}});$("#header .search .ic_close").click(function(){$("#header .search .text").attr("value","");$("#header .search .ic_close").fadeOut(200);});$("#bsm.bottom_sitemap .ic_sitemap_circle").click(function(){$(this).toggleClass("act");$("#bsm.bottom_sitemap .smap_block").slideToggle(300);});$("#bsm.bottom_sitemap .ic_close").click(function(){$("#bsm.bottom_sitemap .smap_block").slideToggle(300);});$(".all_site .pseudo").click(function(){$(this).parent().toggleClass("act");$(".top_sitemap.bottom_sitemap .smap_block").slideToggle(300);});$(".top_sitemap.bottom_sitemap .ic_close").click(function(){$(".top_sitemap.bottom_sitemap .smap_block").slideToggle(300);$(".all_site .pseudo").parent().toggleClass("act");});$(".area").hover(function(){$(".area_info").addClass("act");$("#cp1").addClass("act");},function(){$(".area_info").removeClass("act");$("#cp1").removeClass("act");});if($("html").hasClass("error404")){if($(window).height()<765){$(".error404 #wrapper").css("min-height","740px");$(".error404 #content").css({"top":"0","margin-top":"150px"});}$(window).resize(function(){if($(window).height()<765){$(".error404 #wrapper").css("min-height","740px");$(".error404 #content").css({"top":"0","margin-top":"150px"});}else{$(".error404 #wrapper").css("min-height","100%");$(".error404 #content").css({"top":"50%","margin-top":"-215px"});}});}var small_lenta=false,lenta=".photogallery .lenta ul",previews_num=Math.floor($(".photogallery").width()/$(lenta+" li").outerWidth(true));$(window).resize(function(){previews_num=Math.floor($(".photogallery").width()/$(lenta+" li").outerWidth(true));if($(lenta+" li").length<=previews_num){$(".photogallery .lenta_padds .nav_arrow.prev").addClass("invisible_button");$(".photogallery .lenta_padds .nav_arrow.next").addClass("invisible_button");small_lenta=true;}else{small_lenta=false;}});if($("div").hasClass("photogallery")){$(lenta).css("width",$(lenta+" li").outerWidth(true)*$(lenta+" li").length);if($(lenta+" li").length<=previews_num){$(".photogallery .lenta_padds .nav_arrow.prev").addClass("invisible_button");$(".photogallery .lenta_padds .nav_arrow.next").addClass("invisible_button");small_lenta=true;}}if(!small_lenta){$(".photogallery .lenta_padds .nav_arrow.prev").click(function(){move_lenta('prev');});$(".photogallery .lenta_padds .nav_arrow.next").click(function(){move_lenta('next');});}function move_lenta(direction){var lenta=$(".photogallery .lenta"),ul=$(".photogallery .lenta ul"),valid_delta=ul.width()-lenta.width(),step=200;if(direction=='prev'){$(".photogallery .lenta_padds .nav_arrow.next").removeClass("invisible_button")
var left_delta=ul.position().left+step;if(left_delta<0){ul.animate({"left":left_delta+"px"},400,'linear');}else{$(".photogallery .lenta_padds .nav_arrow.prev").addClass("invisible_button")
ul.animate({"left":"0px"},400,'linear');}}if(direction=='next'){$(".photogallery .lenta_padds .nav_arrow.prev").removeClass("invisible_button")
var left_delta=ul.position().left-step;if(-left_delta<valid_delta){ul.animate({"left":left_delta+"px"},400,'linear');}else{$(".photogallery .lenta_padds .nav_arrow.next").addClass("invisible_button")
ul.animate({"left":-valid_delta+"px"},400,'linear');}}}var curr_img=1;$(".photogallery .image_block .nav_arrow.prev").click(function(){curr_img=switch_img(curr_img-1);});$(".photogallery .image_block .nav_arrow.next").click(function(){curr_img=switch_img(curr_img+1);});$(".photogallery .pseudo_td div").click(function(){var left_pos=event.x-$(this).offset().left;if(left_pos<$(this).width()/2){curr_img=switch_img(curr_img-1);}else{curr_img=switch_img(curr_img+1);}});$(".photogallery .pseudo_td div").hover(function(){$(".photogallery .pseudo_td div").mousemove(function(e){$(".photogallery .image_block img").removeClass("default_cursor");var left_pos=e.pageX-$(this).offset().left;if(left_pos<$(this).width()/2){$(".photogallery .image_block .nav_arrow.prev").addClass("jq_hover");$(".photogallery .image_block .nav_arrow.next").removeClass("jq_hover");if(curr_img==1){$(".photogallery .image_block img").addClass("default_cursor");}}else{if(curr_img==$(".photogallery .pseudo_td div").length){$(".photogallery .image_block img").addClass("default_cursor");}$(".photogallery .image_block .nav_arrow.next").addClass("jq_hover");$(".photogallery .image_block .nav_arrow.prev").removeClass("jq_hover");}});},function(){$(".photogallery .image_block .nav_arrow").removeClass("jq_hover");});function switch_img(curr_img){$(".photogallery .pseudo_td div").removeClass("act");$(".photogallery .lenta ul li").removeClass("act");if($(".photogallery .image_block .nav_arrow").hasClass("invisible_button")){$(".photogallery .image_block .nav_arrow").removeClass("invisible_button");}if(curr_img<=1){$(".photogallery .image_block .nav_arrow.prev").addClass("invisible_button");}if(curr_img>=$(".photogallery .pseudo_td div").length){$(".photogallery .image_block .nav_arrow.next").addClass("invisible_button");}if(curr_img==0){curr_img=1;}if(curr_img>$(".photogallery .pseudo_td div").length){curr_img=$(".photogallery .pseudo_td div").length;}if($(".photogallery .lenta ul li.im"+curr_img).position().left-$(".photogallery .lenta ul li.im"+curr_img).width()<=-$(".photogallery .lenta ul").position().left&&!small_lenta){move_lenta('prev');}else
if($(".photogallery .lenta ul li.im"+curr_img).offset().left-$(".photogallery .lenta ul li.im"+curr_img).width()>=$(".photogallery .lenta").width()&&!small_lenta){move_lenta('next');}$(".photogallery .pseudo_td .im"+curr_img).addClass("act");$(".photogallery .lenta ul li.im"+curr_img).addClass("act");return curr_img;}$(".photogallery .lenta ul li").click(function(){var reg_expr=/[0-9]+/;curr_img=parseInt(reg_expr.exec($(this).attr("class")));switch_img(curr_img);});var scrollPane=$(".scroll-pane"),scrollContent=$(".scroll-content");scrollContent.css("width",174*$(".scroll-content-item").length);var scrollbar=$(".scroll-bar").slider({animate:true,slide:function(event,ui){if(scrollContent.width()>scrollPane.width()){scrollContent.stop().animate({"margin-left":Math.round(ui.value/100*(scrollPane.width()-scrollContent.width()))+"px"},300);}else{scrollContent.stop().animate({"margin-left":0},300);}}});var handleHelper=scrollbar.find(".ui-slider-handle").mousedown(function(){scrollbar.width(handleHelper.width());}).mouseup(function(){scrollbar.width("100%");}).append("<span class='ui-icon ui-icon-grip-dotted-vertical'></span>").wrap("<div class='ui-handle-helper-parent'></div>").parent();scrollPane.css("overflow","hidden");function sizeScrollbar(){var remainder=scrollContent.width()-scrollPane.width();var proportion=remainder/scrollContent.width();var handleSize=scrollPane.width()-(proportion*scrollPane.width());scrollbar.find(".ui-slider-handle").css({width:handleSize,"margin-left":-handleSize/2});handleHelper.width("").width(scrollbar.width()-handleSize);}function resetValue(){var remainder=scrollPane.width()-scrollContent.width();var leftVal=scrollContent.css("margin-left")==="auto"?0:parseInt(scrollContent.css("margin-left"));var percentage=Math.round(leftVal/remainder*100);scrollbar.slider("value",percentage);}function reflowContent(){var showing=scrollContent.width()+parseInt(scrollContent.css("margin-left"),10);var gap=scrollPane.width()-showing;if(gap>0){scrollContent.css("margin-left",parseInt(scrollContent.css("margin-left"),10)+gap);}}$(".colored2").each(function(i){if(i%2!=0){$(this).addClass("bezh_back");}});$(".sliding").click(function(){var this_id=$(this).attr('id');$(this).toggleClass("act");$(".block_"+this_id).slideToggle(250);});if($.cookie("mode")=='contrast'){$(".icon.ic_contrast ins").html('Обычная<br />версия');$('html').addClass("contrast");$(".studio-developer img").attr("src","/i/contrast/onetouch_logo_contrast.gif");}else{$(".icon.ic_contrast ins").html('Версия для<br />слабовидящих');$('html').removeClass("contrast");$(".studio-developer img").attr("src","/i/onetouch_logo.gif");}$(".icon.ic_contrast").click(function(){if($.cookie("mode")=='contrast'){$("ins",this).html('Версия для<br />слабовидящих');$('html').removeClass("contrast");$(".studio-developer img").attr("src","/i/onetouch_logo.gif");$.cookie("mode","standart_version",{path:'/',expires:30});}else{$("ins",this).html('Обычная<br />версия');$('html').addClass("contrast");$(".studio-developer img").attr("src","/i/contrast/onetouch_logo_contrast.gif");$.cookie("mode","contrast",{path:'/',expires:30});}});});