text: var PGObject_CloseButton=function(e){var a=document.createElement("div");$(a).hide();a.appendChild(document.createTextNode("\u0437\u0430\u043a\u0440\u044b\u0442\u044c"));$(a).click(e);var c=!1;this.setPosition=function(b,k){$(a).css({position:"fixed","z-index":"35",color:"#efefef","font-family":"Arial, Geneva, Helvetica, sans-serif","font-size":"18px","font-weight":"100",top:"20px",width:"100px","text-align":"right",display:"block"});$(a).css("cursor","pointer");var g=b+k-110;$(a).css("left",g+"px"); $(a).show();c||$("body").append(a);c=!0};this.hide=function(){$(a).hide()}},PGObject_InformText=function(){var e=document.createElement("div");$(e).hide();e.appendChild(document.createTextNode("\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430..."));e.title="\u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443";var a= !1;this.setPosition=function(c,b,k,g,n,s,t){var f=$(window).width();$(e).css({position:"fixed","z-index":"30",color:"#dddddd","font-family":"Arial, Geneva, Helvetica, sans-serif","font-size":"14px","font-weight":"100",left:f/2-50+"px",top:"26px",width:"400px","text-align":"left",display:"block"});c+=10;$(e).css("left",c+"px");480>b&&360<b?$(e).css("font-size","11px"):360>=b&&330<b?$(e).css("font-size","10px"):330>=b&&$(e).css("font-size","9px");0==s&&0==t?$(e).html(g+"&times;"+n+' <a href="'+k+'" target="_blank" style="color:#dddddd;" title="\u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435">\u043f\u043e\u043b\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440</a>'): $(e).html("\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 "+(s+1)+" \u0438\u0437 "+t+" &nbsp;\u2014&nbsp; "+g+"&times;"+n+' <a href="'+k+'" target="_blank" style="color:#dddddd;" title="\u043e\u0442\u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u043d\u043e\u0432\u043e\u043c \u043e\u043a\u043d\u0435">\u043f\u043e\u043b\u043d\u044b\u0439 \u0440\u0430\u0437\u043c\u0435\u0440</a>');$(e).show();a||$("body").append(e);a=!0};this.hide=function(){$(e).hide()};this.setInform=function(a){$(e).html(a)}}, PGObject_TitleText=function(){var e=document.createElement("div");$(e).hide();var a=!1;this.setPosition=function(c,b,k){$(e).css({position:"fixed","z-index":"30",color:"#dddddd","font-family":"Arial, Geneva, Helvetica, sans-serif","font-size":"16px","font-weight":"100",width:"400px","text-align":"left"});b+=60;c+=10;$(e).css("left",c+"px");$(e).css("top",b+"px");$(e).html(k);$(e).show();a||$("body").append(e);a=!0};this.hide=function(){$(e).hide()}},PGObject_Image=function(e){var a=document.createElement("div"); $(a).click(e);var c=document.createElement("div"),b=new Image,k,g,n,s,t,f,p=!1;this.resize=function(a,e,p,v){var r=$(window).width(),m=$(window).height(),l=Math.round(r/18);if(0==n&&0==s||f)if(0!=n||0!=s||f){var h=Math.round(l/4)+30;$(b).attr("title","\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443");$(b).css("cursor","pointer");canvas_w=r-2*l-2*h;canvas_h=m-110-50-h}else canvas_w=r-Math.round(l/4),canvas_h=m-50-30,$(b).attr("title",t),$(b).css("cursor","default"); else canvas_w=r-2*l,canvas_h=m-50-30,$(b).attr("title","\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443"),$(b).css("cursor","pointer");ratio_convas=canvas_w/canvas_h;k<canvas_w&&g<canvas_h?(m=k,l=g):(l=k/g,l<=ratio_convas?(m=canvas_h*l,l=canvas_h):(m=canvas_w,l=canvas_w/l));r=r/2-m/2;m=Math.round(m);l=Math.round(l);$(b).width(m);$(b).height(l);$(c).width(m);$(c).height(l);$(c).css("left",r);a.setPosition(r,m);e.setPosition(r,m,v,k,g,n,s);p.setPosition(r,l,t)}; this.setPosition=function(e,u,w,v,r,m,l,h){n=u;s=w;t=l;f=h;$(a).css({position:"fixed",top:"0px",left:"0px",margin:"0px",padding:"0px",width:"100%",height:"100%",background:"black",opacity:"0.5","z-index":"1"});$(a).show();$(c).css({position:"fixed",left:"0px",top:"50px",margom:"0px",padding:"0px","text-align":"center","z-index":"10",color:"white"});$(c).show();$(b).hide();b.src=e;$(b).load(function(){$(this).removeAttr("width").removeAttr("height").css({width:"",height:""});k=$(this).width();g=$(this).height(); var a=$(window).width(),d=$(window).height(),h=Math.round(a/18);if(0==n&&0==s||f)if(0!=n||0!=s||f){var z=Math.round(h/4)+30;$(b).attr("title","\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443");$(b).css("cursor","pointer");canvas_w=a-2*h-2*z;canvas_h=d-110-50-z}else canvas_w=a-Math.round(h/4),canvas_h=d-50-30,$(b).attr("title",l),$(b).css("cursor","default");else canvas_w=a-2*h,canvas_h=d-50-30,$(b).attr("title","\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443"), $(b).css("cursor","pointer");ratio_convas=canvas_w/canvas_h;k<canvas_w&&g<canvas_h?(d=k,h=g):(h=k/g,h<=ratio_convas?(d=canvas_h*h,h=canvas_h):(d=canvas_w,h=canvas_w/h));a=a/2-d/2;d=Math.round(d);h=Math.round(h);$(this).width(d);$(this).height(h);$(c).width(d);$(c).height(h);$(c).css("left",a);$(this).show();v.setPosition(a,d);r.setPosition(a,d,e,k,g,u,w);m.setPosition(a,h,l)});p||($(c).html(b),$("body").append(a),$("body").append(c));p=!0};this.hide=function(){$(a).hide();$(c).hide()};this.getImageLink= function(){return b};this.setOpacityBG=function(b){$(a).css("opacity",b)}},PGObject_Vectors=function(){var e=this,a,c=null,b=null,k=null,g=null,n=null,s=!1,t,f=!1,p=!0,x=document.createElement("div"),u=document.createElement("div"),w=document.createElement("div");$(w).hover(function(){$(u).css("opacity","0.2");$(this).css("opacity","0.8")},function(){$(u).css("opacity","0.1");$(this).css("opacity","1")});x.appendChild(u);w.appendChild(document.createTextNode("<"));x.appendChild(w);var v=document.createElement("div"), r=document.createElement("div"),m=document.createElement("div");$(m).hover(function(){$(r).css("opacity","0.2");$(this).css("opacity","0.8")},function(){$(r).css("opacity","0.1");$(this).css("opacity","1")});v.appendChild(r);m.appendChild(document.createTextNode(">"));v.appendChild(m);var l=function(d,a,h,e,A){var f=d.count,q=d.object;q.get_s();var m=q.getCurrentIm();0==d.count?f=d.allcount-1:f--;d.count=f;A.setPosition(d.arr[f].image,f,d.allcount,a,h,e,d.arr[f].title,d.infoType);c=d;b=a;k=h;g=e; n=A;s=!0;d.infoType&&(d=q.pres_arr[f].image,$("#"+m).css("border","0px solid black"),$(d).css("border","1px solid #eeeeee"),q.setCurrentIm("pgimage"+f),q.set_s(parseInt($(d).attr("thwh"))))},h=function(d,a,h,f,e){var m=d.count,q=d.object;q.get_s();var l=q.getCurrentIm();d.count==d.allcount-1?m=0:m++;d.count=m;e.setPosition(d.arr[m].image,m,d.allcount,a,h,f,d.arr[m].title,d.infoType);c=d;b=a;k=h;g=f;n=e;s=!0;d.infoType&&(d=q.pres_arr[m].image,$("#"+l).css("border","0px solid black"),$(d).css("border", "1px solid #eeeeee"),q.setCurrentIm("pgimage"+m),q.set_s(parseInt($(d).attr("thwh"))))};$(document).keypress(function(d){39!=d.keyCode&&13!=d.keyCode||!s?37==d.keyCode&&s&&l(c,b,k,g,n):h(c,b,k,g,n)});var y=!1;this.interval=5;this.setClickImage=function(d){p=d};this.resize=function(){var d=$(window).width(),a=$(window).height(),h=Math.round(d/18),a=a/2-50,d=d-h;$(x).css({width:h+"px"});$(w).css({"padding-top":a+"px"});$(v).css({left:d+"px",width:h+"px"});$(m).css({"padding-top":a+"px"})};this.setObject= function(a,h,f,e,m,l){c=a;b=h;k=f;g=e;n=m;s=l};this.setStatus=function(a,h,b,f,e,c){s=c};this.setCounter=function(a){c.count=a};this.setPosition=function(){var a=$(window).width(),h=$(window).height(),b=Math.round(a/18),h=h/2-50,a=a-b;$(x).css({position:"fixed",top:"0px",left:"0px",margin:"0px",padding:"0px",width:b+"px",height:"100%",display:"block","z-index":"10"});$(u).css({position:"absolute",width:"100%",height:"100%",background:"black",opacity:"0.1","z-index":"20"});$(w).css({position:"absolute", width:"100%",height:"100%","z-index":"30","text-align":"center",color:"#aaaaaa","font-family":"Arial, Geneva, Helvetica, sans-serif","font-size":"38px","font-weight":"100","padding-top":h+"px"});$(w).css("cursor","pointer");$(v).css({position:"fixed",top:"0px",left:a+"px",margin:"0px",padding:"0px",width:b+"px",height:"100%",display:"block","z-index":"10"});$(r).css({position:"absolute",width:"100%",height:"100%",background:"black",opacity:"0.1","z-index":"20"});$(m).css({position:"absolute",width:"100%", height:"100%","z-index":"30","text-align":"center",color:"#aaaaaa","font-family":"Arial, Geneva, Helvetica, sans-serif","font-size":"38px","font-weight":"100","padding-top":h+"px"});$(m).css("cursor","pointer");y||($("body").append(x),$("body").append(v));y=!0};this.left=function(a,h,b,f,c){w.onclick=function(e){l(a,h,b,f,c)}};this.right=function(d,b,c,k,g){m.onclick=function(a){h(d,b,c,k,g)};a=g.getImageLink();a.onclick=function(m){p&&(f?(clearInterval(t),$(a).attr("title","\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443"), f=!1,g.setOpacityBG("0.5")):($(a).attr("title","\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443"),c.setInform("\u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043e..."),g.setOpacityBG("0.8"),t=setInterval(function(){h(d,b,c,k,g);g.setOpacityBG("0.8")},1E3*e.interval),f=!0))}};this.hide=function(){$(x).hide();$(v).hide();clearInterval(t);$(a).attr("title","\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043b\u0430\u0439\u0434-\u0448\u043e\u0443"); f=!1}},PGObject_Filmstrip=function(e){var a=this,c="pgimage0",b=document.createElement("div"),k=document.createElement("div"),g=document.createElement("div"),n=document.createElement("table"),s=document.createElement("tbody"),t=document.createElement("tr");b.appendChild(k);b.appendChild(g);var f=document.createElement("div"),p=document.createElement("span");b.appendChild(f);p.appendChild(document.createTextNode("<"));$(p).hover(function(){$(f).css("opacity","0.1");$(this).css("opacity","0.8")},function(){$(f).css("opacity", "0");$(this).css("opacity","1")});p.onmousedown=function(h){l++;m=!0;a.pg_playLeftDF()};p.onmouseup=function(a){l=0;m=!1};p.onmouseout=function(a){l=0;m=!1};b.appendChild(p);var x=document.createElement("div"),u=document.createElement("span");b.appendChild(x);u.appendChild(document.createTextNode(">"));$(u).hover(function(){$(x).css("opacity","0.1");$(this).css("opacity","0.8")},function(){$(x).css("opacity","0");$(this).css("opacity","1")});u.onmousedown=function(h){r++;v=!0;a.pg_playRightDF()}; u.onmouseup=function(a){r=0;v=!1};u.onmouseout=function(a){r=0;v=!1};b.appendChild(u);var w=!1,v=!1,r=0,m=!1,l=0;this.pres_arr=[];this.resize=function(){var a=$(window).width(),c=$(window).height(),d=Math.round(a/10);fsW=a-2*d;$(b).css({width:fsW+"px",left:d+"px",top:c-110+"px"});c=Math.round(fsW/10);a=fsW-c;c=Math.round(c/2);$(k).css({width:a+"px","margin-left":c+"px"});$(g).css({width:fsW+"px"});$(f).css({width:c+"px",height:"110px"});$(p).css({width:c+"px",height:"110px"});$(p).css("cursor","pointer"); $(x).css({width:c+"px",height:"110px","margin-left":c+a+"px"});$(u).css({width:c+"px",height:"110px","margin-left":c+a+"px"});$(u).css("cursor","pointer")};this.pg_playRightDF=function(){var h=a.get_s();h<a.get_w()&&a.getStatusPlay("df_right","play")&&2>=a.getStatusPlay("df_right","play_counter")&&(a.set_s(h+15),setTimeout(a.pg_playRightDF,30))};this.pg_playLeftDF=function(){var h=a.get_s();10<h&&a.getStatusPlay("df_left","play")&&2>=a.getStatusPlay("df_left","play_counter")&&(a.set_s(h-15),setTimeout(a.pg_playLeftDF, 30))};this.get_s=function(){return $(k).scrollLeft()};this.set_s=function(a){$(k).scrollLeft(a)};this.get_w=function(){return $(n).outerWidth()-$(k).outerWidth()};this.getStatusPlay=function(a,b){switch(a){case "df_right":switch(b){case "play":return v;case "play_counter":return r}break;case "df_left":switch(b){case "play":return m;case "play_counter":return l}}};this.setStatusPlay=function(a,b,d){switch(a){case "df_right":switch(b){case "play":v=d;break;case "play_counter":r=d}break;case "df_left":switch(b){case "play":m= d;break;case "play_counter":l=d}}};this.setPosition=function(a,c,d,e,m){var l=$(window).width(),n=$(window).height(),s=Math.round(l/10);fsW=l-2*s;$(b).css({position:"fixed",width:fsW+"px",height:"110px","z-index":"50",left:s+"px",top:n-110+"px"});n=Math.round(fsW/10);l=fsW-n;n=Math.round(n/2);$(k).css({position:"absolute",width:l+"px",height:"110px","z-index":"53","margin-left":n+"px","text-align":"left",color:"#ffffff","font-family":"Arial, Geneva, Helvetica, sans-serif","font-weight":"100","border-left":"1px solid #757575", "border-right":"1px solid #757575",overflow:"hidden"});$(g).css({position:"absolute",width:fsW+"px",height:"110px",background:"black",opacity:"0.2","z-index":"51"});$(f).css({position:"absolute",width:n+"px",height:"110px",background:"black",opacity:"0","z-index":"60","margin-left":"0px"});$(p).css({position:"absolute",width:n+"px",height:"110px","z-index":"61","text-align":"center",color:"#aaaaaa","font-family":"Arial, Geneva, Helvetica, sans-serif","font-size":"38px","font-weight":"100","margin-left":"0px", "padding-top":"43px"});$(p).css("cursor","pointer");$(x).css({position:"absolute",width:n+"px",height:"110px",background:"black",opacity:"0","z-index":"60","margin-left":n+l+"px"});$(u).css({position:"absolute",width:n+"px",height:"110px","z-index":"61","text-align":"center",color:"#aaaaaa","font-family":"Arial, Geneva, Helvetica, sans-serif","font-size":"38px","font-weight":"100","margin-left":n+l+"px","padding-top":"43px"});$(u).css("cursor","pointer");this.setList(a,c,d,e,m);w||$("body").append(b); w=!0;$(b).show()};this.hide=function(){$(b).hide()};this.getInfo=function(b,c,d,f){var e=[],g=0,k=0;$("a[rel='"+c+"["+d+"]']").each(function(a,c){c.href==b&&(k=g);var d;$(this).find("img").each(function(a,b){d=b.src});e.push({image:c.href,thumb:d,title:this.title});g++});return{arr:e,count:k,allcount:g,object:a,infoType:f}};this.setList=function(b,f,d,g,m){var l=0,r=b.arr,p;for(p in r){var q={image:null,container:null};q.image=new Image;q.image.src=r[p].thumb;q.image.setAttribute("maximage",r[p].image); q.image.setAttribute("title",r[p].title);q.image.setAttribute("id","pgimage"+p);q.image.setAttribute("name","pgimage"+p);q.image.setAttribute("key",p);l+=5;q.image.setAttribute("thwh",l);l+=Math.round(100*(q.image.width/q.image.height));$(q.image).css({height:"100px",margin:"0px 5px 0px 0px",cursor:"pointer"});q.image.onclick=function(){var a=this.getAttribute("maximage"),k=this.getAttribute("title"),l=this.getAttribute("id");this.getAttribute("thwh");var n=this.getAttribute("key");$("#"+c).css("border", "0px solid black");$(this).css("border","1px solid #eeeeee");c=l;f.setPosition(a,b.count,b.allcount,d,g,m,k,!0);e.setCounter(n)};q.container=document.createElement("td");q.container.appendChild(q.image);t.appendChild(q.container);a.pres_arr.push(q)}s.appendChild(t);n.appendChild(s);$(k).append(n);element=$(a.pres_arr[b.count].image);element.stop(!1,!1);$(k).animate({scrollLeft:element.attr("thwh")},"slow");$("#"+c).css("border","0px solid black");element.css("border","1px solid #eeeeee");c="pgimage"+ b.count};this.getCurrentIm=function(){return c};this.setCurrentIm=function(a){c=a};this.clean=function(){for(var b in a.pres_arr)$(a.pres_arr[b].image).remove(),$(a.pres_arr[b].container).remove();a.pres_arr.length=0}},PulsarGallery=function(){var e=this;this.close=function(){a.hide();c.hide();b.hide();k.hide();g.hide();n.hide();g.setStatus(!1)};var a=new PGObject_CloseButton(this.close),c=new PGObject_InformText,b=new PGObject_TitleText,k=new PGObject_Image(this.close),g=new PGObject_Vectors,n=new PGObject_Filmstrip(g); this.alias="pulsargallery";this.aliaslite="pulsarlite";this.name="list1";this.action=!0;this.interval=5;this.resize=function(){this.action&&(g.resize(),k.resize(a,c,b,this.href),n.resize())};this.actionGal=function(e,t,f){g.setClickImage(!0);f=n.getInfo(t,this.alias,f,!0);n.clean();k.setPosition(t,f.count,f.allcount,a,c,b,e,!0);g.setPosition();g.setObject(f,a,c,b,k,!0);g.left(f,a,c,b,k);g.right(f,a,c,b,k);n.setPosition(f,k,a,c,b)};this.actionGalLite=function(e,t,f){g.setClickImage(!0);f=n.getInfo(t, this.aliaslite,f,!1);k.setPosition(t,f.count,f.allcount,a,c,b,e,!1);g.setPosition();g.left(f,a,c,b,k);g.right(f,a,c,b,k)};this.init=function(){if(this.action){g.interval=this.interval;var n=RegExp("^"+this.alias+"\\[([a-zA-Z0-9]+)\\]|"+this.name+"$"),t,f=RegExp("^"+this.aliaslite+"\\[([a-zA-Z0-9]+)\\]|"+this.name+"$"),p;$("a").each(function(){this.rel&&(t=this.rel.match(n))?($(this).attr("data-group",t[1]),this.onclick=function(a){a=$(this).attr("data-group");e.actionGal(this.title,this.href,a);return!1}): this.rel&&(p=this.rel.match(f))&&($(this).attr("data-group",p[1]),this.onclick=function(a){a=$(this).attr("data-group");e.actionGalLite(this.title,this.href,a);return!1})});$("a[rel='"+this.alias+"']").on("click",function(){var e=this.title,f=this.href;g.setClickImage(!1);k.setPosition(f,0,0,a,c,b,e);return!1});$(window).resize(function(){e.resize()})}}},pulsargallery=new PulsarGallery;