PageSourceSearch

https://www.delphis.ru/files/js/js_304b1c08908dd79b59e32c469b7fef1f.js

js delphis.ru collected 2026-10-02 14:39:46 UTC 191,259 bytes, 3,390 lines download raw bytes

1// $Id: jquery.js,v 1.12.2.3 2008/06/25 09:38:39 goba Exp $ 
2
3/*
4 * jQuery 1.2.6 - New Wave Javascript
5 *
6 * Copyright (c) 2008 John Resig (jquery.com)
7 * Dual licensed under the MIT (MIT-LICENSE.txt)
8 * and GPL (GPL-LICENSE.txt) licenses.
9 *
10 * Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008)
11 * Rev: 5685
12 */
13eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(H(){J w=1b.4M,3m$=1b.$;J D=1b.4M=1b.$=H(a,b){I 2B D.17.5j(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,62=/^.[^:#\\[\\.]*$/,12;D.17=D.44={5j:H(d,b){d=d||S;G(d.16){7[0]=d;7.K=1;I 7}G(1j d=="23"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.61(c[3]);G(a){G(a.2v!=c[3])I D().2q(d);I D(a)}d=[]}}N I D(b).2q(d)}N G(D.1D(d))I D(S)[D.17.27?"27":"43"](d);I 7.6Y(D.2d(d))},5w:"1.2.6",8G:H(){I 7.K},K:0,3p:H(a){I a==12?D.2d(7):7[a]},2I:H(b){J a=D(b);a.5n=7;I a},6Y:H(a){7.K=0;2p.44.1p.1w(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5i:H(b){J a=-1;I D.2L(b&&b.5w?b[0]:b,7)},1K:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1K"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1n d)D.1K(b?7.V:7,c,D.1i(7,d[c],b,i,c))})},1g:H(b,a){G((b==\'2h\'||b==\'1Z\')&&3d(a)<0)a=12;I 7.1K(b,a,"2a")},1r:H(b){G(1j b!="49"&&b!=U)I 7.4E().3v((7[0]&&7[0].2z||S).5F(b));J a="";D.P(b||7,H(){D.P(7.3t,H(){G(7.16!=8)a+=7.16!=1?7.76:D.17.1r([7])})});I a},5z:H(b){G(7[0])D(b,7[0].2z).5y().39(7[0]).2l(H(){J a=7;1B(a.1x)a=a.1x;I a}).3v(7);I 7},8Y:H(a){I 7.P(H(){D(7).6Q().5z(a)})},8R:H(a){I 7.P(H(){D(7).5z(a)})},3v:H(){I 7.3W(19,M,Q,H(a){G(7.16==1)7.3U(a)})},6F:H(){I 7.3W(19,M,M,H(a){G(7.16==1)7.39(a,7.1x)})},6E:H(){I 7.3W(19,Q,Q,H(a){7.1d.39(a,7)})},5q:H(){I 7.3W(19,Q,M,H(a){7.1d.39(a,7.2H)})},3l:H(){I 7.5n||D([])},2q:H(b){J c=D.2l(7,H(a){I D.2q(b,a)});I 7.2I(/[^+>] [^+>]/.11(b)||b.1h("..")>-1?D.4r(c):c)},5y:H(e){J f=7.2l(H(){G(D.14.1f&&!D.4n(7)){J a=7.6o(M),5h=S.3h("1v");5h.3U(a);I D.4h([5h.4H])[0]}N I 7.6o(M)});J d=f.2q("*").5c().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2q("*").5c().P(H(i){G(7.16==3)I;J c=D.L(7,"3w");R(J a 1n c)R(J b 1n c[a])D.W.1e(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2I(D.1D(b)&&D.3C(7,H(a,i){I b.1k(a,i)})||D.3g(b,7))},4Y:H(b){G(b.1q==56)G(62.11(b))I 7.2I(D.3g(b,7,M));
13N b=D.3g(b,7);J a=b.K&&b[b.K-1]!==12&&!b.16;I 7.1E(H(){I a?D.2L(7,b)<0:7!=b})},1e:H(a){I 7.2I(D.4r(D.2R(7.3p(),1j a==\'23\'?D(a):D.2d(a))))},3F:H(a){I!!a&&D.3g(a,7).K>0},7T:H(a){I 7.3F("."+a)},6e:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2A")){J e=c.64,63=[],15=c.15,2V=c.O=="2A-2V";G(e<0)I U;R(J i=2V?e:0,2f=2V?e+1:15.K;i<2f;i++){J d=15[i];G(d.2W){b=D.14.1f&&!d.at.2x.an?d.1r:d.2x;G(2V)I b;63.1p(b)}}I 63}N I(7[0].2x||"").1o(/\\r/g,"")}I 12}G(b.1q==4L)b+=\'\';I 7.P(H(){G(7.16!=1)I;G(b.1q==2p&&/5O|5L/.11(7.O))7.4J=(D.2L(7.2x,b)>=0||D.2L(7.34,b)>=0);N G(D.Y(7,"2A")){J a=D.2d(b);D("9R",7).P(H(){7.2W=(D.2L(7.2x,a)>=0||D.2L(7.1r,a)>=0)});G(!a.K)7.64=-1}N 7.2x=b})},2K:H(a){I a==12?(7[0]?7[0].4H:U):7.4E().3v(a)},7b:H(a){I 7.5q(a).21()},79:H(i){I 7.3s(i,i+1)},3s:H(){I 7.2I(2p.44.3s.1w(7,19))},2l:H(b){I 7.2I(D.2l(7,H(a,i){I b.1k(a,i,a)}))},5c:H(){I 7.1e(7.5n)},L:H(d,b){J a=d.1R(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5C("9z"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1P("9u"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3W:H(g,f,h,d){J e=7.K>1,3x;I 7.P(H(){G(!3x){3x=D.4h(g,7.2z);G(h)3x.9o()}J b=7;G(f&&D.Y(7,"1T")&&D.Y(3x[0],"4F"))b=7.3H("22")[0]||7.3U(7.2z.3h("22"));J c=D([]);D.P(3x,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.1e(a);N{G(a.16==1)c=c.1e(D("1m",a).21());d.1k(b,a)}});c.P(6T)})}};D.17.5j.44=D.17;H 6T(i,a){G(a.4d)D.3Y({1a:a.4d,31:Q,1O:"1m"});N D.5u(a.1r||a.6O||a.4H||"");G(a.1d)a.1d.37(a)}H 1z(){I+2B 8J}D.1l=D.17.1l=H(){J b=19[0]||{},i=1,K=19.K,4x=Q,15;G(b.1q==8I){4x=b;b=19[1]||{};i=2}G(1j b!="49"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i<K;i++)G((15=19[i])!=U)R(J c 1n 15){J a=b[c],2w=15[c];G(b===2w)6M;G(4x&&2w&&1j 2w=="49"&&!2w.16)b[c]=D.1l(4x,a||(2w.K!=U?[]:{}),2w);N G(2w!==12)b[c]=2w}I b};J E="4M"+1z(),6K=0,5r={},6G=/z-?5i|8B-?8A|1y|6B|8v-?1Z/i,3P=S.3P||{};D.1l({8u:H(a){1b.$=3m$;G(a)1b.4M=w;I D},1D:H(a){I!!a&&1j a!="23"&&!a.Y&&a.1q!=2p&&/^[\\s[]?H/.11(a+"")},4n:H(a){I a.1C&&!a.1c||a.2j&&a.2z&&!a.2z.1c},5u:H(a){a=D.3k(a);G(a){J b=S.3H("6w")[0]||S.1C,1m=S.3h("1m");1m.O="1r/4t";G(D.14.1f)1m.1r=a;N 1m.3U(S.5F(a));b.39(1m,b.1x);b.37(1m)}},Y:H(b,a){I b.Y&&b.Y.2r()==a.2r()},1Y:{},L:H(c,d,b){c=c==1b?5r:c;J a=c[E];G(!a)a=c[E]=++6K;G(d&&!D.1Y[a])D.1Y[a]={};G(b!==12)D.1Y[a][d]=b;I d?D.1Y[a][d]:a},3b:H(c,b){c=c==1b?5r:c;J a=c[E];G(b){G(D.1Y[a]){2U D.1Y[a][b];b="";R(b 1n D.1Y[a])1X;G(!b)D.3b(c)}}N{1U{2U c[E]}1V(e){G(c.5l)c.5l(E)}2U D.1Y[a]}},P:H(d,a,c){J e,i=0,K=d.K;G(c){G(K==12){R(e 1n d)G(a.1w(d[e],c)===Q)1X}N R(;i<K;)G(a.1w(d[i++],c)===Q)1X}N{G(K==12){R(e 1n d)G(a.1k(d[e],e,d[e])===Q)1X}N R(J b=d[0];i<K&&a.1k(b,i,b)!==Q;b=d[++i]){}}I d},1i:H(b,a,c,i,d){G(D.1D(a))a=a.1k(b,i);I a&&a.1q==4L&&c=="2a"&&!6G.11(d)?a+"2X":a},1F:{1e:H(c,b){D.P((b||"").1R(/\\s+/),H(i,a){G(c.16==1&&!D.1F.3T(c.1F,a))c.1F+=(c.1F?" ":"")+a})},21:H(c,b){G(c.16==1)c.1F=b!=12?D.3C(c.1F.1R(/\\s+/),H(a){I!D.1F.3T(b,a)}).6s(" "):""},3T:H(b,a){I D.2L(a,(b.1F||b).6r().1R(/\\s+/))>-1}},6q:H(b,c,a){J e={};R(J d 1n c){e[d]=b.V[d];b.V[d]=c[d]}a.1k(b);R(J d 1n c)b.V[d]=e[d]},1g:H(d,e,c){G(e=="2h"||e=="1Z"){J b,3X={30:"5x",5g:"1G",18:"3I"},35=e=="2h"?["5e","6k"]:["5G","6i"];H 5b(){b=e=="2h"?d.8f:d.8c;J a=0,2C=0;D.P(35,H(){a+=3d(D.2a(d,"57"+7,M))||0;2C+=3d(D.2a(d,"2C"+7+"4b",M))||0});b-=29.83(a+2C)}G(D(d).3F(":4j"))5b();N D.6q(d,3X,5b);I 29.2f(0,b)}I D.2a(d,e,c)},2a:H(f,l,k){J e,V=f.V;H 3E(b){G(!D.14.2k)I Q;J a=3P.54(b,U);I!a||a.52("3E")==""}G(l=="1y"&&D.14.1f){e=D.1K(V,"1y");I e==""?"1":e}G(D.14.2G&&l=="18"){J d=V.50;V.50="0 7Y 7W";V.50=d}G(l.1I(/4i/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3P.54){G(l.1I(/4i/i))l="4i";l=l.1o(/([A-Z])/g,"-$1").3y();J c=3P.54(f,U);G(c&&!3E(f))e=c.52(l);N{J g=[],2E=[],a=f,i=0;R(;a&&3E(a);a=a.1d)2E.6h(a);R(;i<2E.K;i++)G(3E(2E[i])){g[i]=2E[i].V.18;2E[i].V.18="3I"}e=l=="18"&&g[2E.K-1]!=U?"2F":(c&&c.52(l))||"";R(i=0;i<g.K;i++)G(g[i]!=U)2E[i].V.18=g[i]}G(l=="1y"&&e=="")e="1"}N G(f.4g){J h=l.1o(/\\-(\\w)/g,H(a,b){I b.2r()});e=f.4g[l]||f.4g[h];G(!/^\\d+(2X)?$/i.11(e)&&/^\\d/.11(e)){J j=V.1A,66=f.65.1A;f.65.1A=f.4g.1A;V.1A=e||0;e=V.aM+"2X";V.1A=j;f.65.1A=66}}I e},4h:H(l,h){J k=[];h=h||S;G(1j h.3h==\'12\')h=h.2z||h[0]&&h[0].2z||S;D.P(l,H(i,d){G(!d)I;G(d.1q==4L)d+=\'\';G(1j d=="23"){d=d.1o(/(<(\\w+)[^>]*?)\\/>/g,H(b,a,c){I c.1I(/^(aK|4f|7E|aG|4T|7A|aB|3n|az|ay|av)$/i)?b:a+"></"+c+">"});J f=D.3k(d).3y(),1v=h.3h("1v");J e=!f.1h("<au")&&[1,"<2A 7w=\'7w\'>","</2A>"]||!f.1h("<ar")&&[1,"<7v>","</7v>"]||f.1I(/^<(aq|22|am|ak|ai)/)&&[1,"<1T>","</1T>"]||!f.1h("<4F")&&[2,"<1T><22>","</22></1T>"]||(!f.1h("<af")||!f.1h("<ad"))&&[3,"<1T><22><4F>","</4F></22></1T>"]||!f.1h("<7E")&&[2,"<1T><22></22><7q>","</7q></1T>"]||D.14.1f&&[1,"1v<1v>","</1v>"]||[0,"",""];1v.4H=e[1]+d+e[2];1B(e[0]--)1v=1v.5T;G(D.14.1f){J g=!f.1h("<1T")&&f.1h("<22")<0?1v.1x&&1v.1x.3t:e[1]=="<1T>"&&f.1h("<22")<0?1v.3t:[];R(J j=g.K-1;j>=0;
13--j)G(D.Y(g[j],"22")&&!g[j].3t.K)g[j].1d.37(g[j]);G(/^\\s/.11(d))1v.39(h.5F(d.1I(/^\\s*/)[0]),1v.1x)}d=D.2d(1v.3t)}G(d.K===0&&(!D.Y(d,"3V")&&!D.Y(d,"2A")))I;G(d[0]==12||D.Y(d,"3V")||d.15)k.1p(d);N k=D.2R(k,d)});I k},1K:H(d,f,c){G(!d||d.16==3||d.16==8)I 12;J e=!D.4n(d),40=c!==12,1f=D.14.1f;f=e&&D.3X[f]||f;G(d.2j){J g=/5Q|4d|V/.11(f);G(f=="2W"&&D.14.2k)d.1d.64;G(f 1n d&&e&&!g){G(40){G(f=="O"&&D.Y(d,"4T")&&d.1d)7p"O a3 a1\'t 9V 9U";d[f]=c}G(D.Y(d,"3V")&&d.7i(f))I d.7i(f).76;I d[f]}G(1f&&e&&f=="V")I D.1K(d.V,"9T",c);G(40)d.9Q(f,""+c);J h=1f&&e&&g?d.4G(f,2):d.4G(f);I h===U?12:h}G(1f&&f=="1y"){G(40){d.6B=1;d.1E=(d.1E||"").1o(/7f\\([^)]*\\)/,"")+(3r(c)+\'\'=="9L"?"":"7f(1y="+c*7a+")")}I d.1E&&d.1E.1h("1y=")>=0?(3d(d.1E.1I(/1y=([^)]*)/)[1])/7a)+\'\':""}f=f.1o(/-([a-z])/9H,H(a,b){I b.2r()});G(40)d[f]=c;I d[f]},3k:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2d:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1R||b.4I||b.1k)a[0]=b;N 1B(i)a[--i]=b[i]}I a},2L:H(b,a){R(J i=0,K=a.K;i<K;i++)G(a[i]===b)I i;I-1},2R:H(a,b){J i=0,T,2S=a.K;G(D.14.1f){1B(T=b[i++])G(T.16!=8)a[2S++]=T}N 1B(T=b[i++])a[2S++]=T;I a},4r:H(a){J c=[],2o={};1U{R(J i=0,K=a.K;i<K;i++){J b=D.L(a[i]);G(!2o[b]){2o[b]=M;c.1p(a[i])}}}1V(e){c=a}I c},3C:H(c,a,d){J b=[];R(J i=0,K=c.K;i<K;i++)G(!d!=!a(c[i],i))b.1p(c[i]);I b},2l:H(d,a){J c=[];R(J i=0,K=d.K;i<K;i++){J b=a(d[i],i);G(b!=U)c[c.K]=b}I c.7d.1w([],c)}});J v=9B.9A.3y();D.14={5B:(v.1I(/.+(?:9y|9x|9w|9v)[\\/: ]([\\d.]+)/)||[])[1],2k:/75/.11(v),2G:/2G/.11(v),1f:/1f/.11(v)&&!/2G/.11(v),42:/42/.11(v)&&!/(9s|75)/.11(v)};J y=D.14.1f?"7o":"72";D.1l({71:!D.14.1f||S.70=="6Z",3X:{"R":"9n","9k":"1F","4i":y,72:y,7o:y,9h:"9f",9e:"9d",9b:"99"}});D.P({6W:H(a){I a.1d},97:H(a){I D.4S(a,"1d")},95:H(a){I D.3a(a,2,"2H")},91:H(a){I D.3a(a,2,"4l")},8Z:H(a){I D.4S(a,"2H")},8X:H(a){I D.4S(a,"4l")},8W:H(a){I D.5v(a.1d.1x,a)},8V:H(a){I D.5v(a.1x)},6Q:H(a){I D.Y(a,"8U")?a.8T||a.8S.S:D.2d(a.3t)}},H(c,d){D.17[c]=H(b){J a=D.2l(7,d);G(b&&1j b=="23")a=D.3g(b,a);I 7.2I(D.4r(a))}});D.P({6P:"3v",8Q:"6F",39:"6E",8P:"5q",8O:"7b"},H(c,b){D.17[c]=H(){J a=19;I 7.P(H(){R(J i=0,K=a.K;i<K;i++)D(a[i])[b](7)})}});D.P({8N:H(a){D.1K(7,a,"");G(7.16==1)7.5l(a)},8M:H(a){D.1F.1e(7,a)},8L:H(a){D.1F.21(7,a)},8K:H(a){D.1F[D.1F.3T(7,a)?"21":"1e"](7,a)},21:H(a){G(!a||D.1E(a,[7]).r.K){D("*",7).1e(7).P(H(){D.W.21(7);D.3b(7)});G(7.1d)7.1d.37(7)}},4E:H(){D(">*",7).21();1B(7.1x)7.37(7.1x)}},H(a,b){D.17[a]=H(){I 7.P(b,19)}});D.P(["6N","4b"],H(i,c){J b=c.3y();D.17[b]=H(a){I 7[0]==1b?D.14.2G&&S.1c["5t"+c]||D.14.2k&&1b["5s"+c]||S.70=="6Z"&&S.1C["5t"+c]||S.1c["5t"+c]:7[0]==S?29.2f(29.2f(S.1c["4y"+c],S.1C["4y"+c]),29.2f(S.1c["2i"+c],S.1C["2i"+c])):a==12?(7.K?D.1g(7[0],b):U):7.1g(b,a.1q==56?a:a+"2X")}});H 25(a,b){I a[0]&&3r(D.2a(a[0],b,M),10)||0}J C=D.14.2k&&3r(D.14.5B)<8H?"(?:[\\\\w*3m-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3m-]|\\\\\\\\.)",6L=2B 4v("^>\\\\s*("+C+"+)"),6J=2B 4v("^("+C+"+)(#)("+C+"+)"),6I=2B 4v("^([#.]?)("+C+"*)");D.1l({6H:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4G("2v")==m[2]},":":{8D:H(a,i,m){I i<m[3]-0},8C:H(a,i,m){I i>m[3]-0},3a:H(a,i,m){I m[3]-0==i},79:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3S:H(a,i,m,r){I i==r.K-1},6D:H(a,i){I i%2==0},6C:H(a,i){I i%2},"3o-4u":H(a){I a.1d.3H("*")[0]==a},"3S-4u":H(a){I D.3a(a.1d.5T,1,"4l")==a},"8z-4u":H(a){I!D.3a(a.1d.5T,2,"4l")},6W:H(a){I a.1x},4E:H(a){I!a.1x},8y:H(a,i,m){I(a.6O||a.8x||D(a).1r()||"").1h(m[3])>=0},4j:H(a){I"1G"!=a.O&&D.1g(a,"18")!="2F"&&D.1g(a,"5g")!="1G"},1G:H(a){I"1G"==a.O||D.1g(a,"18")=="2F"||D.1g(a,"5g")=="1G"},8w:H(a){I!a.3R},3R:H(a){I a.3R},4J:H(a){I a.4J},2W:H(a){I a.2W||D.1K(a,"2W")},1r:H(a){I"1r"==a.O},5O:H(a){I"5O"==a.O},5L:H(a){I"5L"==a.O},5p:H(a){I"5p"==a.O},3Q:H(a){I"3Q"==a.O},5o:H(a){I"5o"==a.O},6A:H(a){I"6A"==a.O},6z:H(a){I"6z"==a.O},2s:H(a){I"2s"==a.O||D.Y(a,"2s")},4T:H(a){I/4T|2A|6y|2s/i.11(a.Y)},3T:H(a,i,m){I D.2q(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3C(D.3O,H(b){I a==b.T}).K}}},6x:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2B 4v("^([:.#]*)("+C+"+)")],3g:H(a,c,b){J d,1t=[];1B(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1t=b?c=f.r:D.2R(1t,f.r)}I 1t},2q:H(t,o){G(1j t!="23")I[t];G(o&&o.16!=1&&o.16!=9)I[];o=o||S;J d=[o],2o=[],3S,Y;
131B(t&&3S!=t){J r=[];3S=t;t=D.3k(t);J l=Q,3j=6L,m=3j.2D(t);G(m){Y=m[1].2r();R(J i=0;d[i];i++)R(J c=d[i].1x;c;c=c.2H)G(c.16==1&&(Y=="*"||c.Y.2r()==Y))r.1p(c);d=r;t=t.1o(3j,"");G(t.1h(" ")==0)6M;l=M}N{3j=/^([>+~])\\s*(\\w*)/i;G((m=3j.2D(t))!=U){r=[];J k={};Y=m[2].2r();m=m[1];R(J j=0,3i=d.K;j<3i;j++){J n=m=="~"||m=="+"?d[j].2H:d[j].1x;R(;n;n=n.2H)G(n.16==1){J g=D.L(n);G(m=="~"&&k[g])1X;G(!Y||n.Y.2r()==Y){G(m=="~")k[g]=M;r.1p(n)}G(m=="+")1X}}d=r;t=D.3k(t.1o(3j,""));l=M}}G(t&&!l){G(!t.1h(",")){G(o==d[0])d.4s();2o=D.2R(2o,d);r=d=[o];t=" "+t.6v(1,t.K)}N{J h=6J;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6I;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.61&&!D.4n(f)){J p=f.61(m[2]);G((D.14.1f||D.14.2G)&&p&&1j p.2v=="23"&&p.2v!=m[2])p=D(\'[@2v="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3y()=="49")a="3n";r=D.2R(r,d[i].3H(a))}G(m[1]==".")r=D.5m(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4G("2v")==m[2]){e=[r[i]];1X}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3k(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2o=D.2R(2o,d);I 2o},5m:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1F+" ").1h(m)>=0;G(!a&&b||a&&!b)c.1p(r[i])}I c},1E:H(t,r,h){J d;1B(t&&t!=d){d=t;J p=D.6x,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1X}}G(!m)1X;G(m[1]==":"&&m[2]=="4Y")r=62.11(m[3])?D.1E(m[3],r,M).r:D(r).4Y(m[3]);N G(m[1]==".")r=D.5m(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3i=r.K;i<3i;i++){J a=r[i],z=a[D.3X[m[2]]||m[2]];G(z==U||/5Q|4d|2W/.11(m[2]))z=D.1K(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1h(m[5])||O=="$="&&z.6v(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1h(m[5])>=0)^h)g.1p(a)}r=g}N G(m[1]==":"&&m[2]=="3a-4u"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6D"&&"2n"||m[3]=="6C"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3i=r.K;i<3i;i++){J j=r[i],1d=j.1d,2v=D.L(1d);G(!e[2v]){J c=1;R(J n=1d.1x;n;n=n.2H)G(n.16==1)n.4q=c++;e[2v]=M}J b=Q;G(3o==0){G(j.4q==d)b=M}N G((j.4q-d)%3o==0&&(j.4q-d)/3o>=0)b=M;G(b^h)g.1p(j)}r=g}N{J f=D.6H[m[1]];G(1j f=="49")f=f[m[2]];G(1j f=="23")f=6u("Q||H(a,i){I "+f+";}");r=D.3C(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4S:H(b,c){J a=[],1t=b[c];1B(1t&&1t!=S){G(1t.16==1)a.1p(1t);1t=1t[c]}I a},3a:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.16==1&&++d==e)1X;I a},5v:H(n,a){J r=[];R(;n;n=n.2H){G(n.16==1&&n!=a)r.1p(n)}I r}});D.W={1e:H(f,i,g,e){G(f.16==3||f.16==8)I;G(D.14.1f&&f.4I)f=1b;G(!g.24)g.24=7.24++;G(e!=12){J h=g;g=7.3M(h,H(){I h.1w(7,19)});g.L=e}J j=D.L(f,"3w")||D.L(f,"3w",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5k)I D.W.1H.1w(19.3L.T,19)});1H.T=f;D.P(i.1R(/\\s+/),H(c,b){J a=b.1R(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2t[b]||D.W.2t[b].4p.1k(f)===Q){G(f.3K)f.3K(b,1H,Q);N G(f.6t)f.6t("4o"+b,1H)}}d[g.24]=g;D.W.26[b]=M});f=U},24:1,26:{},21:H(e,h,f){G(e.16==3||e.16==8)I;J i=D.L(e,"3w"),1L,5i;G(i){G(h==12||(1j h=="23"&&h.8p(0)=="."))R(J g 1n i)7.21(e,g+(h||""));N{G(h.O){f=h.2y;h=h.O}D.P(h.1R(/\\s+/),H(b,a){J c=a.1R(".");a=c[0];G(i[a]){G(f)2U i[a][f.24];N R(f 1n i[a])G(!c[1]||i[a][f].O==c[1])2U i[a][f];R(1L 1n i[a])1X;G(!1L){G(!D.W.2t[a]||D.W.2t[a].4A.1k(e)===Q){G(e.6p)e.6p(a,D.L(e,"1H"),Q);N G(e.6n)e.6n("4o"+a,D.L(e,"1H"))}1L=U;2U i[a]}}})}R(1L 1n i)1X;G(!1L){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3w");D.3b(e,"1H")}}},1P:H(h,c,f,g,i){c=D.2d(c);G(h.1h("!")>=0){h=h.3s(0,-1);J a=M}G(!f){G(7.26[h])D("*").1e([1b,S]).1P(h,c)}N{G(f.16==3||f.16==8)I 12;J b,1L,17=D.1D(f[h]||U),W=!c[0]||!c[0].32;G(W){c.6h({O:h,2J:f,32:H(){},3J:H(){},4C:1z()});c[0][E]=M}c[0].O=h;G(a)c[0].6m=M;J d=D.L(f,"1H");G(d)b=d.1w(f,c);G((!17||(D.Y(f,\'a\')&&h=="4V"))&&f["4o"+h]&&f["4o"+h].1w(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1D(i)){1L=i.1w(f,b==U?c:c.7d(b));G(1L!==12)b=1L}G(17&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4V")){7.5k=M;1U{f[h]()}1V(e){}}7.5k=Q}I b},1H:H(b){J a,1L,38,5f,4m;b=19[0]=D.W.6l(b||1b.W);38=b.O.1R(".");b.O=38[0];38=38[1];5f=!38&&!b.6m;4m=(D.L(7,"3w")||{})[b.O];R(J j 1n 4m){J c=4m[j];G(5f||c.O==38){b.2y=c;b.L=c.L;1L=c.1w(7,19);G(a!==Q)a=1L;G(1L===Q){b.32();b.3J()}}}I a},6l:H(b){G(b[E]==M)I b;J d=b;b={8o:d};J c="8n 8m 8l 8k 2s 8j 47 5d 6j 5E 8i L 8h 8g 4K 2y 5a 59 8e 8b 58 6f 8a 88 4k 87 86 84 6d 2J 4C 6c O 82 81 35".1R(" ");R(J i=c.K;i;i--)b[c[i]]=d[c[i]];b[E]=M;b.32=H(){G(d.32)d.32();d.80=Q};
13b.3J=H(){G(d.3J)d.3J();d.7Z=M};b.4C=b.4C||1z();G(!b.2J)b.2J=b.6d||S;G(b.2J.16==3)b.2J=b.2J.1d;G(!b.4k&&b.4K)b.4k=b.4K==b.2J?b.6c:b.4K;G(b.58==U&&b.5d!=U){J a=S.1C,1c=S.1c;b.58=b.5d+(a&&a.2e||1c&&1c.2e||0)-(a.6b||0);b.6f=b.6j+(a&&a.2c||1c&&1c.2c||0)-(a.6a||0)}G(!b.35&&((b.47||b.47===0)?b.47:b.5a))b.35=b.47||b.5a;G(!b.59&&b.5E)b.59=b.5E;G(!b.35&&b.2s)b.35=(b.2s&1?1:(b.2s&2?3:(b.2s&4?2:0)));I b},3M:H(a,b){b.24=a.24=a.24||b.24||7.24++;I b},2t:{27:{4p:H(){55();I},4A:H(){I}},3D:{4p:H(){G(D.14.1f)I Q;D(7).2O("53",D.W.2t.3D.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("53",D.W.2t.3D.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3D";I D.W.1H.1w(7,19)}},3N:{4p:H(){G(D.14.1f)I Q;D(7).2O("51",D.W.2t.3N.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("51",D.W.2t.3N.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3N";I D.W.1H.1w(7,19)}}}};D.17.1l({2O:H(c,a,b){I c=="4X"?7.2V(c,a,b):7.P(H(){D.W.1e(7,c,b||a,b&&a)})},2V:H(d,b,c){J e=D.W.3M(c||b,H(a){D(7).4e(a,e);I(c||b).1w(7,19)});I 7.P(H(){D.W.1e(7,d,e,c&&b)})},4e:H(a,b){I 7.P(H(){D.W.21(7,a,b)})},1P:H(c,a,b){I 7.P(H(){D.W.1P(c,a,7,M,b)})},5C:H(c,a,b){I 7[0]&&D.W.1P(c,a,7[0],Q,b)},2m:H(b){J c=19,i=1;1B(i<c.K)D.W.3M(b,c[i++]);I 7.4V(D.W.3M(b,H(a){7.4Z=(7.4Z||0)%i;a.32();I c[7.4Z++].1w(7,19)||Q}))},7X:H(a,b){I 7.2O(\'3D\',a).2O(\'3N\',b)},27:H(a){55();G(D.2Q)a.1k(S,D);N D.3A.1p(H(){I a.1k(7,D)});I 7}});D.1l({2Q:Q,3A:[],27:H(){G(!D.2Q){D.2Q=M;G(D.3A){D.P(D.3A,H(){7.1k(S)});D.3A=U}D(S).5C("27")}}});J x=Q;H 55(){G(x)I;x=M;G(S.3K&&!D.14.2G)S.3K("69",D.27,Q);G(D.14.1f&&1b==1S)(H(){G(D.2Q)I;1U{S.1C.7V("1A")}1V(3e){3B(19.3L,0);I}D.27()})();G(D.14.2G)S.3K("69",H(){G(D.2Q)I;R(J i=0;i<S.4W.K;i++)G(S.4W[i].3R){3B(19.3L,0);I}D.27()},Q);G(D.14.2k){J a;(H(){G(D.2Q)I;G(S.3f!="68"&&S.3f!="1J"){3B(19.3L,0);I}G(a===12)a=D("V, 7A[7U=7S]").K;G(S.4W.K!=a){3B(19.3L,0);I}D.27()})()}D.W.1e(1b,"43",D.27)}D.P(("7R,7Q,43,85,4y,4X,4V,7P,"+"7O,7N,89,53,51,7M,2A,"+"5o,7L,7K,8d,3e").1R(","),H(i,b){D.17[b]=H(a){I a?7.2O(b,a):7.1P(b)}});J F=H(a,c){J b=a.4k;1B(b&&b!=c)1U{b=b.1d}1V(3e){b=c}I b==c};D(1b).2O("4X",H(){D("*").1e(S).4e()});D.17.1l({67:D.17.43,43:H(g,d,c){G(1j g!=\'23\')I 7.67(g);J e=g.1h(" ");G(e>=0){J i=g.3s(e,g.K);g=g.3s(0,e)}c=c||H(){};J f="2P";G(d)G(D.1D(d)){c=d;d=U}N{d=D.3n(d);f="6g"}J h=7;D.3Y({1a:g,O:f,1O:"2K",L:d,1J:H(a,b){G(b=="1W"||b=="7J")h.2K(i?D("<1v/>").3v(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2q(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3n(7.7I())},7I:H(){I 7.2l(H(){I D.Y(7,"3V")?D.2d(7.aH):7}).1E(H(){I 7.34&&!7.3R&&(7.4J||/2A|6y/i.11(7.Y)||/1r|1G|3Q/i.11(7.O))}).2l(H(i,c){J b=D(7).6e();I b==U?U:b.1q==2p?D.2l(b,H(a,i){I{34:c.34,2x:a}}):{34:c.34,2x:b}}).3p()}});D.P("7H,7G,7F,7D,7C,7B".1R(","),H(i,o){D.17[o]=H(f){I 7.2O(o,f)}});J B=1z();D.1l({3p:H(d,b,a,c){G(D.1D(b)){a=b;b=U}I D.3Y({O:"2P",1a:d,L:b,1W:a,1O:c})},aE:H(b,a){I D.3p(b,U,a,"1m")},aD:H(c,b,a){I D.3p(c,b,a,"3z")},aC:H(d,b,a,c){G(D.1D(b)){a=b;b={}}I D.3Y({O:"6g",1a:d,L:b,1W:a,1O:c})},aA:H(a){D.1l(D.60,a)},60:{1a:5Z.5Q,26:M,O:"2P",2T:0,7z:"4R/x-ax-3V-aw",7x:M,31:M,L:U,5Y:U,3Q:U,4Q:{2N:"4R/2N, 1r/2N",2K:"1r/2K",1m:"1r/4t, 4R/4t",3z:"4R/3z, 1r/4t",1r:"1r/as",4w:"*/*"}},4z:{},3Y:H(s){s=D.1l(M,s,D.1l(M,{},D.60,s));J g,2Z=/=\\?(&|$)/g,1u,L,O=s.O.2r();G(s.L&&s.7x&&1j s.L!="23")s.L=D.3n(s.L);G(s.1O=="4P"){G(O=="2P"){G(!s.1a.1I(2Z))s.1a+=(s.1a.1I(/\\?/)?"&":"?")+(s.4P||"7u")+"=?"}N G(!s.L||!s.L.1I(2Z))s.L=(s.L?s.L+"&":"")+(s.4P||"7u")+"=?";s.1O="3z"}G(s.1O=="3z"&&(s.L&&s.L.1I(2Z)||s.1a.1I(2Z))){g="4P"+B++;G(s.L)s.L=(s.L+"").1o(2Z,"="+g+"$1");s.1a=s.1a.1o(2Z,"="+g+"$1");s.1O="1m";1b[g]=H(a){L=a;1W();1J();1b[g]=12;1U{2U 1b[g]}1V(e){}G(i)i.37(h)}}G(s.1O=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2P"){J j=1z();J k=s.1a.1o(/(\\?|&)3m=.*?(&|$)/,"$ap="+j+"$2");s.1a=k+((k==s.1a)?(s.1a.1I(/\\?/)?"&":"?")+"3m="+j:"")}G(s.L&&O=="2P"){s.1a+=(s.1a.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.26&&!D.4O++)D.W.1P("7H");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1O=="1m"&&O=="2P"&&n.11(s.1a)&&n.2D(s.1a)[1]!=5Z.al){J i=S.3H("6w")[0];J h=S.3h("1m");h.4d=s.1a;G(s.7t)h.aj=s.7t;G(!g){J l=Q;h.ah=h.ag=H(){G(!l&&(!7.3f||7.3f=="68"||7.3f=="1J")){l=M;1W();1J();i.37(h)}}}i.3U(h);I 12}J m=Q;J c=1b.7s?2B 7s("ae.ac"):2B 7r();G(s.5Y)c.6R(O,s.1a,s.31,s.5Y,s.3Q);N c.6R(O,s.1a,s.31);1U{G(s.L)c.4B("ab-aa",s.7z);G(s.5S)c.4B("a9-5R-a8",D.4z[s.1a]||"a7, a6 a5 a4 5N:5N:5N a2");c.4B("X-9Z-9Y","7r");c.4B("9W",s.1O&&s.4Q[s.1O]?s.4Q[s.1O]+", */*":s.4Q.4w)}1V(e){}G(s.7m&&s.7m(c,s)===Q){s.26&&D.4O--;c.7l();I Q}G(s.26)D.W.1P("7B",[c,s]);J d=H(a){G(!m&&c&&(c.3f==4||a=="2T")){m=M;G(f){7k(f);f=U}1u=a=="2T"&&"2T"||!D.7j(c)&&"3e"||s.5S&&D.7h(c,s.1a)&&"7J"||"1W";G(1u=="1W"){1U{L=D.6X(c,s.1O,s.9S)}1V(e){1u="5J"}}G(1u=="1W"){J b;1U{b=c.5I("7g-5R")}1V(e){}G(s.5S&&b)D.4z[s.1a]=b;G(!g)1W()}N D.5H(s,c,1u);1J();G(s.31)c=U}};G(s.31){J f=4I(d,13);G(s.2T>0)3B(H(){G(c){c.7l();G(!m)d("2T")}},s.2T)}1U{c.9P(s.L)}1V(e){D.5H(s,c,U,e)}G(!s.31)d();H 1W(){G(s.1W)s.1W(L,1u);G(s.26)D.W.1P("7C",[c,s])}H 1J(){G(s.1J)s.1J(c,1u);G(s.26)D.W.1P("7F",[c,s]);G(s.26&&!--D.4O)D.W.1P("7G")}I c},5H:H(s,a,b,e){G(s.3e)s.3e(a,b,e);G(s.26)D.W.1P("7D",[a,s,e])},4O:0,7j:H(a){1U{I!a.1u&&5Z.9O=="5p:"||(a.1u>=7e&&a.1u<9N)||a.1u==7c||a.1u==9K||D.14.2k&&a.1u==12}1V(e){}I Q},7h:H(a,c){1U{J b=a.5I("7g-5R");I a.1u==7c||b==D.4z[c]||D.14.2k&&a.1u==12}1V(e){}I Q}
13,6X:H(a,c,b){J d=a.5I("9J-O"),2N=c=="2N"||!c&&d&&d.1h("2N")>=0,L=2N?a.9I:a.4U;G(2N&&L.1C.2j=="5J")7p"5J";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3z")L=6u("("+L+")");I L},3n:H(a){J s=[];G(a.1q==2p||a.5w)D.P(a,H(){s.1p(3u(7.34)+"="+3u(7.2x))});N R(J j 1n a)G(a[j]&&a[j].1q==2p)D.P(a[j],H(){s.1p(3u(j)+"="+3u(7))});N s.1p(3u(j)+"="+3u(D.1D(a[j])?a[j]():a[j]));I s.6s("&").1o(/%20/g,"+")}});D.17.1l({1N:H(c,b){I c?7.2g({1Z:"1N",2h:"1N",1y:"1N"},c,b):7.1E(":1G").P(H(){7.V.18=7.5D||"";G(D.1g(7,"18")=="2F"){J a=D("<"+7.2j+" />").6P("1c");7.V.18=a.1g("18");G(7.V.18=="2F")7.V.18="3I";a.21()}}).3l()},1M:H(b,a){I b?7.2g({1Z:"1M",2h:"1M",1y:"1M"},b,a):7.1E(":4j").P(H(){7.5D=7.5D||D.1g(7,"18");7.V.18="2F"}).3l()},78:D.17.2m,2m:H(a,b){I D.1D(a)&&D.1D(b)?7.78.1w(7,19):a?7.2g({1Z:"2m",2h:"2m",1y:"2m"},a,b):7.P(H(){D(7)[D(7).3F(":1G")?"1N":"1M"]()})},9G:H(b,a){I 7.2g({1Z:"1N"},b,a)},9F:H(b,a){I 7.2g({1Z:"1M"},b,a)},9E:H(b,a){I 7.2g({1Z:"2m"},b,a)},9D:H(b,a){I 7.2g({1y:"1N"},b,a)},9M:H(b,a){I 7.2g({1y:"1M"},b,a)},9C:H(c,a,b){I 7.2g({1y:a},c,b)},2g:H(k,j,i,g){J h=D.77(j,i,g);I 7[h.36===Q?"P":"36"](H(){G(7.16!=1)I Q;J f=D.1l({},h),p,1G=D(7).3F(":1G"),46=7;R(p 1n k){G(k[p]=="1M"&&1G||k[p]=="1N"&&!1G)I f.1J.1k(7);G(p=="1Z"||p=="2h"){f.18=D.1g(7,"18");f.33=7.V.33}}G(f.33!=U)7.V.33="1G";f.45=D.1l({},k);D.P(k,H(c,a){J e=2B D.28(46,f,c);G(/2m|1N|1M/.11(a))e[a=="2m"?1G?"1N":"1M":a](k);N{J b=a.6r().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1t(M)||0;G(b){J d=3d(b[2]),2M=b[3]||"2X";G(2M!="2X"){46.V[c]=(d||1)+2M;2b=((d||1)/e.1t(M))*2b;46.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3G(2b,d,2M)}N e.3G(2b,a,"")}});I M})},36:H(a,b){G(D.1D(a)||(a&&a.1q==2p)){b=a;a="28"}G(!a||(1j a=="23"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2p)A(7,a,b);N{A(7,a).1p(b);G(A(7,a).K==1)b.1k(7)}})},9X:H(b,c){J a=D.3O;G(b)7.36([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7n(i,1)}});G(!c)7.5A();I 7}});J A=H(b,c,a){G(b){c=c||"28";J q=D.L(b,c+"36");G(!q||a)q=D.L(b,c+"36",D.2d(a))}I q};D.17.5A=H(a){a=a||"28";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1k(7)})};D.1l({77:H(b,a,c){J d=b&&b.1q==a0?b:{1J:c||!c&&a||D.1D(b)&&b,2u:b,41:c&&a||a&&a.1q!=9t&&a};d.2u=(d.2u&&d.2u.1q==4L?d.2u:D.28.5K[d.2u])||D.28.5K.74;d.5M=d.1J;d.1J=H(){G(d.36!==Q)D(7).5A();G(D.1D(d.5M))d.5M.1k(7)};I d},41:{73:H(p,n,b,a){I b+a*p},5P:H(p,n,b,a){I((-29.9r(p*29.9q)/2)+0.5)*a+b}},3O:[],48:U,28:H(b,c,a){7.15=c;7.T=b;7.1i=a;G(!c.3Z)c.3Z={}}});D.28.44={4D:H(){G(7.15.2Y)7.15.2Y.1k(7.T,7.1z,7);(D.28.2Y[7.1i]||D.28.2Y.4w)(7);G(7.1i=="1Z"||7.1i=="2h")7.T.V.18="3I"},1t:H(a){G(7.T[7.1i]!=U&&7.T.V[7.1i]==U)I 7.T[7.1i];J r=3d(D.1g(7.T,7.1i,a));I r&&r>-9p?r:3d(D.2a(7.T,7.1i))||0},3G:H(c,b,d){7.5V=1z();7.2b=c;7.3l=b;7.2M=d||7.2M||"2X";7.1z=7.2b;7.2S=7.4N=0;7.4D();J e=7;H t(a){I e.2Y(a)}t.T=7.T;D.3O.1p(t);G(D.48==U){D.48=4I(H(){J a=D.3O;R(J i=0;i<a.K;i++)G(!a[i]())a.7n(i--,1);G(!a.K){7k(D.48);D.48=U}},13)}},1N:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1N=M;7.3G(0,7.1t());G(7.1i=="2h"||7.1i=="1Z")7.T.V[7.1i]="9m";D(7.T).1N()},1M:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1M=M;7.3G(7.1t(),0)},2Y:H(a){J t=1z();G(a||t>7.15.2u+7.5V){7.1z=7.3l;7.2S=7.4N=1;7.4D();7.15.45[7.1i]=M;J b=M;R(J i 1n 7.15.45)G(7.15.45[i]!==M)b=Q;G(b){G(7.15.18!=U){7.T.V.33=7.15.33;7.T.V.18=7.15.18;G(D.1g(7.T,"18")=="2F")7.T.V.18="3I"}G(7.15.1M)7.T.V.18="2F";G(7.15.1M||7.15.1N)R(J p 1n 7.15.45)D.1K(7.T.V,p,7.15.3Z[p])}G(b)7.15.1J.1k(7.T);I Q}N{J n=t-7.5V;7.4N=n/7.15.2u;7.2S=D.41[7.15.41||(D.41.5P?"5P":"73")](7.4N,n,0,1,7.15.2u);7.1z=7.2b+((7.3l-7.2b)*7.2S);7.4D()}I M}};D.1l(D.28,{5K:{9l:9j,9i:7e,74:9g},2Y:{2e:H(a){a.T.2e=a.1z},2c:H(a){a.T.2c=a.1z},1y:H(a){D.1K(a.T.V,"1y",a.1z)},4w:H(a){a.T.V[a.1i]=a.1z+a.2M}}});D.17.2i=H(){J b=0,1S=0,T=7[0],3q;G(T)ao(D.14){J d=T.1d,4a=T,1s=T.1s,1Q=T.2z,5U=2k&&3r(5B)<9c&&!/9a/i.11(v),1g=D.2a,3c=1g(T,"30")=="3c";G(T.7y){J c=T.7y();1e(c.1A+29.2f(1Q.1C.2e,1Q.1c.2e),c.1S+29.2f(1Q.1C.2c,1Q.1c.2c));1e(-1Q.1C.6b,-1Q.1C.6a)}N{1e(T.5X,T.5W);1B(1s){1e(1s.5X,1s.5W);G(42&&!/^t(98|d|h)$/i.11(1s.2j)||2k&&!5U)2C(1s);G(!3c&&1g(1s,"30")=="3c")3c=M;4a=/^1c$/i.11(1s.2j)?4a:1s;1s=1s.1s}1B(d&&d.2j&&!/^1c|2K$/i.11(d.2j)){G(!/^96|1T.*$/i.11(1g(d,"18")))1e(-d.2e,-d.2c);G(42&&1g(d,"33")!="4j")2C(d);d=d.1d}G((5U&&(3c||1g(4a,"30")=="5x"))||(42&&1g(4a,"30")!="5x"))1e(-1Q.1c.5X,-1Q.1c.5W);G(3c)1e(29.2f(1Q.1C.2e,1Q.1c.2e),29.2f(1Q.1C.2c,1Q.1c.2c))}3q={1S:1S,1A:b}}H 2C(a){1e(D.2a(a,"6V",M),D.2a(a,"6U",M))}H 1e(l,t){b+=3r(l,10)||0;1S+=3r(t,10)||0}I 3q};D.17.1l({30:H(){J a=0,1S=0,3q;G(7[0]){J b=7.1s(),2i=7.2i(),4c=/^1c|2K$/i.11(b[0].2j)?{1S:0,1A:0}:b.2i();2i.1S-=25(7,\'94\');2i.1A-=25(7,\'aF\');4c.1S+=25(b,\'6U\');4c.1A+=25(b,\'6V\');3q={1S:2i.1S-4c.1S,1A:2i.1A-4c.1A}}I 3q},1s:H(){J a=7[0].1s;1B(a&&(!/^1c|2K$/i.11(a.2j)&&D.1g(a,\'30\')==\'93\'))a=a.1s;I D(a)}});D.P([\'5e\',\'5G\'],H(i,b){J c=\'4y\'+b;D.17[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1b||7==S?1b.92(!i?a:D(1b).2e(),i?a:D(1b).2c()):7[c]=a}):7[0]==1b||7[0]==S?46[i?\'aI\':\'aJ\']||D.71&&S.1C[c]||S.1c[c]:7[0][c]}});D.P(["6N","4b"],H(i,b){J c=i?"5e":"5G",4f=i?"6k":"6i";D.17["5s"+b]=H(){I 7[b.3y()]()+25(7,"57"+c)+25(7,"57"+4f)};D.17["90"+b]=H(a){I 7["5s"+b]()+25(7,"2C"+c+"4b")+25(7,"2C"+4f+"4b")+(a?25(7,"6S"+c)+25(7,"6S"+4f):0)}})})();',62,669,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|options|nodeType|fn|display|arguments|url|window|body|parentNode|add|msie|css|indexOf|prop|typeof|call|extend|script|in|replace|push|constructor|text|offsetParent|cur|status|div|apply|firstChild|opacity|now|left|while|documentElement|isFunction|filter|className|hidden|handle|match|complete|attr|ret|hide|show|dataType|trigger|doc|split|top|table|try|catch|success|break|cache|height||remove|tbody|string|guid|num|global|ready|fx|Math|curCSS|start|scrollTop|makeArray|scrollLeft|max|animate|width|offset|tagName|safari|map|toggle||done|Array|find|toUpperCase|button|special|duration|id|copy|value|handler|ownerDocument|select|new|border|exec|stack|
13none|opera|nextSibling|pushStack|target|html|inArray|unit|xml|bind|GET|isReady|merge|pos|timeout|delete|one|selected|px|step|jsre|position|async|preventDefault|overflow|name|which|queue|removeChild|namespace|insertBefore|nth|removeData|fixed|parseFloat|error|readyState|multiFilter|createElement|rl|re|trim|end|_|param|first|get|results|parseInt|slice|childNodes|encodeURIComponent|append|events|elems|toLowerCase|json|readyList|setTimeout|grep|mouseenter|color|is|custom|getElementsByTagName|block|stopPropagation|addEventListener|callee|proxy|mouseleave|timers|defaultView|password|disabled|last|has|appendChild|form|domManip|props|ajax|orig|set|easing|mozilla|load|prototype|curAnim|self|charCode|timerId|object|offsetChild|Width|parentOffset|src|unbind|br|currentStyle|clean|float|visible|relatedTarget|previousSibling|handlers|isXMLDoc|on|setup|nodeIndex|unique|shift|javascript|child|RegExp|_default|deep|scroll|lastModified|teardown|setRequestHeader|timeStamp|update|empty|tr|getAttribute|innerHTML|setInterval|checked|fromElement|Number|jQuery|state|active|jsonp|accepts|application|dir|input|responseText|click|styleSheets|unload|not|lastToggle|outline|mouseout|getPropertyValue|mouseover|getComputedStyle|bindReady|String|padding|pageX|metaKey|keyCode|getWH|andSelf|clientX|Left|all|visibility|container|index|init|triggered|removeAttribute|classFilter|prevObject|submit|file|after|windowData|inner|client|globalEval|sibling|jquery|absolute|clone|wrapAll|dequeue|version|triggerHandler|oldblock|ctrlKey|createTextNode|Top|handleError|getResponseHeader|parsererror|speeds|checkbox|old|00|radio|swing|href|Modified|ifModified|lastChild|safari2|startTime|offsetTop|offsetLeft|username|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|_load|loaded|DOMContentLoaded|clientTop|clientLeft|toElement|srcElement|val|pageY|POST|unshift|Bottom|clientY|Right|fix|exclusive|detachEvent|cloneNode|removeEventListener|swap|toString|join|attachEvent|eval|substr|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|exclude|expr|quickClass|quickID|uuid|quickChild|continue|Height|textContent|appendTo|contents|open|margin|evalScript|borderTopWidth|borderLeftWidth|parent|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|linear|def|webkit|nodeValue|speed|_toggle|eq|100|replaceWith|304|concat|200|alpha|Last|httpNotModified|getAttributeNode|httpSuccess|clearInterval|abort|beforeSend|splice|styleFloat|throw|colgroup|XMLHttpRequest|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|getBoundingClientRect|contentType|link|ajaxSend|ajaxSuccess|ajaxError|col|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|keypress|keydown|change|mouseup|mousedown|dblclick|focus|blur|stylesheet|hasClass|rel|doScroll|black|hover|solid|cancelBubble|returnValue|wheelDelta|view|round|shiftKey|resize|screenY|screenX|relatedNode|mousemove|prevValue|originalTarget|offsetHeight|keyup|newValue|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|originalEvent|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|size|417|Boolean|Date|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|wrap|contentWindow|contentDocument|iframe|children|siblings|prevAll|wrapInner|nextAll|outer|prev|scrollTo|static|marginTop|next|inline|parents|able|cellSpacing|adobeair|cellspacing|522|maxLength|maxlength|readOnly|400|readonly|fast|600|class|slow|1px|htmlFor|reverse|10000|PI|cos|compatible|Function|setData|ie|ra|it|rv|getData|userAgent|navigator|fadeTo|fadeIn|slideToggle|slideUp|slideDown|ig|responseXML|content|1223|NaN|fadeOut|300|protocol|send|setAttribute|option|dataFilter|cssText|changed|be|Accept|stop|With|Requested|Object|can|GMT|property|1970|Jan|01|Thu|Since|If|Type|Content|XMLHTTP|th|Microsoft|td|onreadystatechange|onload|cap|charset|colg|host|tfoot|specified|with|1_|thead|leg|plain|attributes|opt|embed|urlencoded|www|area|hr|ajaxSetup|meta|post|getJSON|getScript|marginLeft|img|elements|pageYOffset|pageXOffset|abbr|seri
13alize|pixelLeft'.split('|'),0,{}));
14// $Id: drupal.js,v 1.41.2.4 2009/07/21 08:59:10 goba Exp $
15
16var Drupal = Drupal || { 'settings': {}, 'behaviors': {}, 'themes': {}, 'locale': {} };
17
18/**
19 * Set the variable that indicates if JavaScript behaviors should be applied
20 */
21Drupal.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;
22
23/**
24 * Attach all registered behaviors to a page element.
25 *
26 * Behaviors are event-triggered actions that attach to page elements, enhancing
27 * default non-Javascript UIs. Behaviors are registered in the Drupal.behaviors
28 * object as follows:
29 * @code
30 *    Drupal.behaviors.behaviorName = function () {
31 *      ...
32 *    };
33 * @endcode
34 *
35 * Drupal.attachBehaviors is added below to the jQuery ready event and so
36 * runs on initial page load. Developers implementing AHAH/AJAX in their
37 * solutions should also call this function after new page content has been
38 * loaded, feeding in an element to be processed, in order to attach all
39 * behaviors to the new content.
40 *
41 * Behaviors should use a class in the form behaviorName-processed to ensure
42 * the behavior is attached only once to a given element. (Doing so enables
43 * the reprocessing of given elements, which may be needed on occasion despite
44 * the ability to limit behavior attachment to a particular element.)
45 *
46 * @param context
47 *   An element to attach behaviors to. If none is given, the document element
48 *   is used.
49 */
50Drupal.attachBehaviors = function(context) {
51  context = context || document;
52  if (Drupal.jsEnabled) {
53    // Execute all of them.
54    jQuery.each(Drupal.behaviors, function() {
55      this(context);
56    });
57  }
58};
59
60/**
61 * Encode special characters in a plain-text string for display as HTML.
62 */
63Drupal.checkPlain = function(str) {
64  str = String(str);
65  var replace = { '&': '&amp;', '"': '&quot;', '<': '&lt;', '>': '&gt;' };
66  for (var character in replace) {
67    var regex = new RegExp(character, 'g');
68    str = str.replace(regex, replace[character]);
69  }
70  return str;
71};
72
73/**
74 * Translate strings to the page language or a given language.
75 *
76 * See the documentation of the server-side t() function for further details.
77 *
78 * @param str
79 *   A string containing the English string to translate.
80 * @param args
81 *   An object of replacements pairs to make after translation. Incidences
82 *   of any key in this array are replaced with the corresponding value.
83 *   Based on the first character of the key, the value is escaped and/or themed:
84 *    - !variable: inserted as is
85 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
86 *    - %variable: escape text and theme as a placeholder for user-submitted
87 *      content (checkPlain + Drupal.theme('placeholder'))
88 * @return
89 *   The translated string.
90 */
91Drupal.t = function(str, args) {
92  // Fetch the localized version of the string.
93  if (Drupal.locale.strings && Drupal.locale.strings[str]) {
94    str = Drupal.locale.strings[str];
95  }
96
97  if (args) {
98    // Transform arguments before inserting them
99    for (var key in args) {
100      switch (key.charAt(0)) {
101        // Escaped only
102        case '@':
103          args[key] = Drupal.checkPlain(args[key]);
104        break;
105        // Pass-through
106        case '!':
107          break;
108        // Escaped and placeholder
109        case '%':
110        default:
111          args[key] = Drupal.theme('placeholder', args[key]);
112          break;
113      }
114      str = str.replace(key, args[key]);
115    }
116  }
117  return str;
118};
119
120/**
121 * Format a string containing a count of items.
122 *
123 * This function ensures that the string is pluralized correctly. Since Drupal.t() is
124 * called by this function, make sure not to pass already-localized strings to it.
125 *
126 * See the documentation of the server-side format_plural() function for further details.
127 *
128 * @param count
129 *   The item count to display.
130 * @param singular
131 *   The string for the singular case. Please make sure it is clear this is
132 *   singular, to ease translation (e.g. use "1 new comment" instead of "1 new").
133 *   Do not use @count in the singular string.
134 * @param plural
135 *   The string for the plural case. Please make sure it is clear this is plural,
136 *   to ease translation. Use @count in place of the item count, as in "@count
137 *   new comments".
138 * @param args
139 *   An object of replacements pairs to make after translation. Incidences
140 *   of any key in this array are replaced with the corresponding value.
141 *   Based on the first character of the key, the value is escaped and/or themed:
142 *    - !variable: inserted as is
143 *    - @variable: escape plain text to HTML (Drupal.checkPlain)
144 *    - %variable: escape text and theme as a placeholder for user-submitted
145 *      content (checkPlain + Drupal.theme('placeholder'))
146 *   Note that you do not need to include @count in this array.
147 *   This replacement is done automatically for the plural case.
148 * @return
149 *   A translated string.
150 */
151Drupal.formatPlural = function(count, singular, plural, args) {
152  var args = args || {};
153  args['@count'] = count;
154  // Determine the index of the plural form.
155  var index = Drupal.locale.pluralFormula ? Drupal.locale.pluralFormula(args['@count']) : ((args['@count'] == 1) ? 0 : 1);
156
157  if (index == 0) {
158    return Drupal.t(singular, args);
159  }
160  else if (index == 1) {
161    return Drupal.t(plural, args);
162  }
163  else {
164    args['@count['+ index +']'] = args['@count'];
165    delete args['@count'];
166    return Drupal.t(plural.replace('@count', '@count['+ index +']'));
167  }
168};
169
170/**
171 * Generate the themed representation of a Drupal object.
172 *
173 * All requests for themed output must go through this function. It examines
174 * the request and routes it to the appropriate theme function. If the current
175 * theme does not provide an override function, the generic theme function is
176 * called.
177 *
178 * For example, to retrieve the HTML that is output by theme_placeholder(text),
179 * call Drupal.theme('placeholder', text).
180 *
181 * @param func
182 *   The name of the theme function to call.
183 * @param ...
184 *   Additional arguments to pass along to the theme function.
185 * @return
186 *   Any data the theme function returns. This could be a plain HTML string,
187 *   but also a complex object.
188 */
189Drupal.theme = function(func) {
190  for (var i = 1, args = []; i < arguments.length; i++) {
191    args.push(arguments[i]);
192  }
193
194  return (Drupal.theme[func] || Drupal.theme.prototype[func]).apply(this, args);
195};
196
197/**
198 * Parse a JSON response.
199 *
200 * The result is either the JSON object, or an object with 'status' 0 and 'data' an error message.
201 */
202Drupal.parseJson = function (data) {
203  if ((data.substring(0, 1) != '{') && (data.substring(0, 1) != '[')) {
204    return { status: 0, data: data.length ? data : Drupal.t('Unspecified error') };
205  }
206  return eval('(' + data + ');');
207};
208
209/**
210 * Freeze the current body height (as minimum height). Used to prevent
211 * unnecessary upwards scrolling when doing DOM manipulations.
212 */
213Drupal.freezeHeight = function () {
214  Drupal.unfreezeHeight();
215  var div = document.createElement('div');
216  $(div).css({
217    position: 'absolute',
218    top: '0px',
219    left: '0px',
220    width: '1px',
221    height: $('body').css('height')
222  }).attr('id', 'freeze-height');
223  $('body').append(div);
224};
225
226/**
227 * Unfreeze the body height
228 */
229Drupal.unfreezeHeight = function () {
230  $('#freeze-height').remove();
231};
232
233/**
234 * Wrapper around encodeURIComponent() which avoids Apache quirks (equivalent of
235 * drupal_urlencode() in PHP). This function should only be used on paths, not
236 * on query string arguments.
237 */
238Drupal.encodeURIComponent = function (item, uri) {
239  uri = uri || location.href;
240  item = encodeURIComponent(item).replace(/%2F/g, '/');
241  return (uri.indexOf('?q=') != -1) ? item : item.replace(/%26/g, '%2526').replace(/%23/g, '%2523').replace(/\/\//g, '/%252F');
242};
243
244/**
245 * Get the text selection in a textarea.
246 */
247Drupal.getSelection = function (element) {
248  if (typeof(element.selectionStart) != 'number' && document.selection) {
249    // The current selection
250    var range1 = document.selection.createRange();
251    var range2 = range1.duplicate();
252    // Select all text.
253    range2.moveToElementText(element);
254    // Now move 'dummy' end point to end point of original range.
255    range2.setEndPoint('EndToEnd', range1);
256    // Now we can calculate start and end points.
257    var start = range2.text.length - range1.text.length;
258    var end = start + range1.text.length;
259    return { 'start': start, 'end': end };
260  }
261  return { 'start': element.selectionStart, 'end': element.selectionEnd };
262};
263
264/**
265 * Build an error message from ahah response.
266 */
267Drupal.ahahError = function(xmlhttp, uri) {
268  if (xmlhttp.status == 200) {
269    if (jQuery.trim($(xmlhttp.responseText).text())) {
270      var message = Drupal.t("An error occurred. \n@uri\n@text", {'@uri': uri, '@text': xmlhttp.responseText });
271    }
272    else {
273      var message = Drupal.t("An error occurred. \n@uri\n(no information available).", {'@uri': uri, '@text': xmlhttp.responseText });
274    }
275  }
276  else {
277    var message = Drupal.t("An HTTP error @status occurred. \n@uri", {'@uri': uri, '@status': xmlhttp.status });
278  }
279  return message;
280}
281
282// Global Killswitch on the <html> element
283if (Drupal.jsEnabled) {
284  // Global Killswitch on the <html> element
285  $(document.documentElement).addClass('js');
286  // 'js enabled' cookie
287  document.cookie = 'has_js=1; path=/';
288  // Attach all behaviors.
289  $(document).ready(function() {
290    Drupal.attachBehaviors(this);
291  });
292}
293
294/**
295 * The default themes.
296 */
297Drupal.theme.prototype = {
298
299  /**
300   * Formats text for emphasized display in a placeholder inside a sentence.
301   *
302   * @param str
303   *   The text to format (plain-text).
304   * @return
305   *   The formatted text (html).
306   */
307  placeholder: function(str) {
308    return '<em>' + Drupal.checkPlain(str) + '</em>';
309  }
310};
311;
312Drupal.locale = { 'pluralFormula': function($n) { return Number((((($n%10)==1)&&(($n%100)!=11))?(0):((((($n%10)>=2)&&(($n%10)<=4))&&((($n%100)<10)||(($n%100)>=20)))?(1):2))); }, 'strings': { "Unspecified error": "Не специфичная ошибка", "Drag to re-order": "Переместите для изменения порядка", "Changes made in this table will not be saved until the form is submitted.": "Изменения, сделанные в списке не вступят в силу пока вы не сохраните их.", "None": "Нет", "Automatic alias": "Автоматические синонимы", "Anonymous": "Гость", "File browsing is disabled in directory %dir.": "Просмотр файлов запрещен для папки %dir.", "Upload": "Загрузить", "You can not perform this operation.": "Вы не можете выполнить эту операцию.", "Do you want to refresh the current directory?": "Вы хотите обновить текущую папку?", "Only files with the following extensions are allowed: %files-allowed.": "Прикреплять можно только файлы с расширениями: %files-allowed.", "Delete selected files?": "Удалить выбранные файлы?", "Please select a thumbnail.": "Пожалуйста выберите превью.", "Please specify dimensions within the allowed range that is from 1x1 to @dimensions.": "Пожалуйста укажите размер внутри разрешённого диапозона от 1x1 до @dimensions.", "unlimited": "нелимитировано", "Please select a file.": "Пожалуйста выберите файл.", "Log messages": "Сообщения в лог", "%filename is not an image.": "%filename не изображение.", "You must select at least %num files.": "Вы должны выбрать хотя бы %num файлов.", "You are not allowed to operate on more than %num files.": "Вам не разрешено управлять больше чем с %num файлами.", "Close"
312: "Закрыть", "Insert file": "Вставить файл", "The changes to these blocks will not be saved until the \x3cem\x3eSave blocks\x3c/em\x3e button is clicked.": "Изменения, сделанные в блоках не вступят в силу пока вы не нажмете кнопку \x3cem\x3eСохранить блоки\x3c/em\x3e.", "Select all rows in this table": "Отметить все колонки таблицы", "Deselect all rows in this table": "Снять отметку со всех колонок таблицы", "Published": "Опубликовано", "Not published": "Не опубликовано", "Promoted to front page": "Помещать на главную", "Continue": "Продолжить", "1 attachment": [ "@count файл", "@count файла" ], "Your server has been successfully tested to support this feature.": "Ваш сервер был успешно протестирован и может использовать эту функцию", "Your system configuration does not currently support this feature. The \x3ca href=\"http://drupal.org/node/15365\"\x3ehandbook page on Clean URLs\x3c/a\x3e has additional troubleshooting information.": "Конфигурация вашей системы на данный момент не поддерживает этой функции. Дополнительная информация доступна на \x3ca href=\"http://drupal.org/node/15365\"\x3eстраницы документации о Clean URLs\x3c/a\x3e.", "Testing clean URLs...": "Тестирование чистых URL-ов...", "Join summary": "Объединить анонс", "Split summary at cursor": "Отделить анонс от основного материала", "An HTTP error @status occurred. \n@uri": "Произошла HTTP ошибка @status. \r\n@uri", "An error occurred. \n@uri\n@text": "Возникла ошибка. \r\n@uri\r\n@text", "An error occurred. \n@uri\n(no information available).": "Возникла ошибка. \r\n@uri\r\n(нет доступной информации).", "Create thumbnails": "Создать превью", "Resize": "Изменить размеры", "or": "или", "You can visit the site without registering, use the following services:": "Вы можете зайти на сайт без регистрации, используя следующие сервисы:", "Facebook": "Facebook", "Twitter": "Twitter", "My world": "Мой мир", "VK": "ВКонтакте", "Enter by e-mail": "войти по e-mail", "Product has been added to your cart!": "Товар добавлен в корзину!", "In basket": "В корзине", "Discard": "Отменить", "New directory": "Новая папка", "Directory name may contain only alphanumeric characters, hyphen and underscore.": "Имя папки может содержать только буквы, цифры, дефисы и нижние подчеркивания.", "Directory %dir already exists.": "Папка %dir уже существует.", "You are not alllowed to create more than %num directories.": "Вам запрещено создавать папок больше %num.", "%dirname is not a valid directory name. It should contain only alphanumeric characters, hyphen and underscore.": "%dirname - это неверное имя для папки. Оно должно содержать только буквы, цифры, дефисы или нижние подчеркивания.", "Subdirectory %dir already exists.": "Подпапка %dir уже существует.", "Subdirectory %dir does not exist.": "Папка %dir не существует.", "Manage directories": "Управление папками", "Are you sure want to delete this subdirectory with all directories and files in it?": "Вы точно хотите удалить эту подпапку со всем содержимым?", "Item adding to cart": "Товар добавляется в корзину" } };;
313// $Id: dhtml_menu.js,v 1.18.2.10 2009/01/12 10:13:30 arancaytar Exp $
314
315/**
316 * @file dhtml_menu.js
317 * The Javascript code for DHTML Menu
318 */
319 
320Drupal.dhtmlMenu = {};
321
322/**
323 * Initialize the module's JS functions
324 */
325Drupal.behaviors.dhtmlMenu = function() {
326  // Do not run this function more than once.
327  if (Drupal.dhtmlMenu.init) {
328    return;
329  }
330  else {
331    Drupal.dhtmlMenu.init = true;
332  }
333
334  // Get the settings.
335  var effects = Drupal.settings.dhtmlMenu;
336
337  $('.collapsed').removeClass('expanded');
338
339  // Get cookie
340  if (!effects.siblings) {
341    var cookie = Drupal.dhtmlMenu.cookieGet();
342    for (var i in cookie) {
343      // If the cookie was not applied to the HTML code yet, do so now.
344      var li = $('#dhtml_menu-' + cookie[i]).parents('li:first');
345      if ($(li).hasClass('collapsed')) {
346        Drupal.dhtmlMenu.toggleMenu(li);
347      }
348    }
349  }
350
351  /* Add jQuery effects and listeners to all menu items.
352   * The ~ (sibling) selector is unidirectional and selects 
353   * only the latter element, so we must use siblings() to get 
354   * back to the link element.
355   */
356   $('ul.menu li.dhtml-menu:not(.leaf,.no-dhtml)').each(function() {
357    var li = this;
358    if (effects.clone) {
359      var ul = $(li).find('ul:first');
360      if (ul.length) {
361        $(li).find('a:first').clone().prependTo(ul).wrap('<li class="leaf fake-leaf"></li>');
362      }
363    }
364
365    if (effects.doubleclick) {
366      $(li).find('a:first').dblclick(function(e) {
367        window.location = this.href;
368      });
369    }
370
371    $(li).find('a:first').click(function(e) {
372      Drupal.dhtmlMenu.toggleMenu($(li));
373      return false;
374    });
375  });
376}
377
378/**
379 * Toggles the menu's state between open and closed.
380 *
381 * @param li
382 *   Object. The <li> element that will be expanded or collapsed.
383 */
384Drupal.dhtmlMenu.toggleMenu = function(li) {
385  var effects = Drupal.settings.dhtmlMenu;
386
387  // If the menu is expanded, collapse it.
388  if($(li).hasClass('expanded')) {
389    if (effects.slide) {
390      $(li).find('ul:first').animate({height: 'hide', opacity: 'hide'}, '1000');
391    }
392    else $(li).find('ul:first').css('display', 'none');
393
394    // If children are closed automatically, find and close them now.
395    if (effects.children) {
396      if (effects.slide) {
397        $(li).find('li.expanded').find('ul:first').animate({height: 'hide', opacity: 'hide'}, '1000');
398      }
399      else $(li).find('li.expanded').find('ul:first').css('display', 'none');
400
401      $(li).find('li.expanded').removeClass('expanded').addClass('collapsed')
402    }
403
404    $(li).removeClass('expanded').addClass('collapsed');
405  }
406
407  // Otherwise, expand it.
408  else {
409    if (effects.slide) {
410      $(li).find('ul:first').animate({height: 'show', opacity: 'show'}, '1000');
411    }
412    else $(li).find('ul:first').css('display', 'block');
413    $(li).removeClass('collapsed').addClass('expanded');
414
415    // If the siblings effect is on, close all sibling menus.
416    if (effects.siblings) {
417      var id = $(li).find('a:first').attr('id');
418
419      // Siblings are all open menus that are neither parents nor children of this menu.
420      $(li).find('li').addClass('own-children-temp');
421	  
422      // If the relativity option is on, select only the siblings that have the same parent
423      if (effects.relativity) {
424        var siblings = $(li).parent().find('li.expanded').not('.own-children-temp').not(':has(#' + id + ')');
425      }
426      // Otherwise, select all menus of the same level
427      else {
428        var siblings = $('ul.menu li.expanded').not('.own-children-temp').not(':has(#' + id + ')');
429      }
430
431      // If children should not get closed automatically...
432      if (!effects.children) {
433        // Remove items that are currently hidden from view (do not close these).
434        $('li.collapsed li.expanded').addClass('sibling-children-temp');
435        // Only close the top-most open sibling, not its children.
436        $(siblings).find('li.expanded').addClass('sibling-children-temp');
437        siblings = $(siblings).not('.sibling-children-temp');
438      }
439
440      $('.own-children-temp, .sibling-children-temp').removeClass('own-children-temp').removeClass('sibling-children-temp');
441
442      if (effects.slide) {
443        $(siblings).find('ul:first').animate({height: 'hide', opacity: 'hide'}, '1000');
444      }
445      else $(siblings).find('ul:first').css('display', 'none');
446
447      $(siblings).removeClass('expanded').addClass('collapsed');
448    }
449  }
450
451  // Save the current state of the menus in the cookie.
452  Drupal.dhtmlMenu.cookieSet();
453}
454
455/**
456 * Reads the dhtml_menu cookie.
457 */
458Drupal.dhtmlMenu.cookieGet = function() {
459  var c = /dhtml_menu=(.*?)(;|$)/.exec(document.cookie);
460  if (c) {
461    return c[1];
462  }
463  else return '';
464}
465
466/**
467 * Saves the dhtml_menu cooki.
468 */
469Drupal.dhtmlMenu.cookieSet = function() {
470  var expanded = new Array();
471  $('li.expanded').each(function() {
472    expanded.push($(this).find('a:first').attr('id').substr(5));
473  });
474  document.cookie = 'dhtml_menu=' + expanded.join(',') + ';path=/';
475}
476
477;
478Drupal.behaviors.id_fbconnect = function(context) {
479  if (Drupal.settings.id_fbconnect && typeof(FB) == 'undefined') {
480    window.fbAsyncInit = function() {
481      FB.init({
482        appId: Drupal.settings.id_fbconnect.app_id,
483        status: true,
484        cookie: true,
485        xfbml:  true,
486		/*---begin----*/
487		oauth : true
488		/*----end----*/
489      });
490    };
491    var e = document.createElement('script');
492    e.type = 'text/javascript';
493    e.src = document.location.protocol + '//connect.facebook.net/' + Drupal.settings.id_fbconnect.langcode + '/all.js';
494    e.async = true;
495    $("#fb-root").append(e);
496  }
497}
498
499
500function facebook_onlogin_ready() {
501	$("#id-fbconnect-autoconnect-form").submit();
502};
503/* $Id: lightbox.js,v 1.5.2.6.2.114 2009/01/05 14:21:52 snpower Exp $ */
504
505/**
506 * jQuery Lightbox
507 * @author
508 *   Stella Power, <http://drupal.org/user/66894>
509 *
510 * Based on Lightbox v2.03.3 by Lokesh Dhakar
511 * <http://www.huddletogether.com/projects/lightbox2/>
512 * Also partially based on the jQuery Lightbox by Warren Krewenki
513 *   <http://warren.mesozen.com>
514 *
515 * Permission has been granted to Mark Ashmead & other Drupal Lightbox2 module
516 * maintainers to distribute this file via Drupal.org
517 * Under GPL license.
518 *
519 * Slideshow, iframe and video functionality added by Stella Power.
520 */
521
522var Lightbox = {
523  overlayOpacity : 0.8, // Controls transparency of shadow overlay.
524  overlayColor : '000', // Controls colour of shadow overlay.
525  disableCloseClick : true,
526  // Controls the order of the lightbox resizing animation sequence.
527  resizeSequence: 0, // 0: simultaneous, 1: width then height, 2: height then width.
528  resizeSpeed: 'normal', // Controls the speed of the lightbox resizing animation.
529  fadeInSpeed: 'normal', // Controls the speed of the image appearance.
530  slideDownSpeed: 'slow', // Controls the speed of the image details appearance.
531  minWidth: 240,
532  borderSize : 10,
533  boxColor : 'fff',
534  fontColor : '000',
535  topPosition : '',
536  infoHeight: 20,
537  alternative_layout : false,
538  imageArray : [],
539  imageNum : null,
540  total : 0,
541  activeImage : null,
542  inprogress : false,
543  disableResize : false,
544  disableZoom : false,
545  isZoomedIn : false,
546  rtl : false,
547  loopItems : false,
548  keysClose : ['c', 'x', 27],
549  keysPrevious : ['p', 37],
550  keysNext : ['n', 39],
551  keysZoom : ['z'],
552  keysPlayPause : [32],
553
554  // Slideshow options.
555  slideInterval : 5000, // In milliseconds.
556  showPlayPause : true,
557  autoStart : true,
558  autoExit : true,
559  pauseOnNextClick : false, // True to pause the slideshow when the "Next" button is clicked.
560  pauseOnPrevClick : true, // True to pause the slideshow when the "Prev" button is clicked.
561  slideIdArray : [],
562  slideIdCount : 0,
563  isSlideshow : false,
564  isPaused : false,
565  loopSlides : false,
566
567  // Iframe options.
568  isLightframe : false,
569  iframe_width : 600,
570  iframe_height : 400,
571  iframe_border : 1,
572
573  // Video and modal options.
574  enableVideo : false,
575  flvPlayer : '/flvplayer.swf',
576  flvFlashvars : '',
577  isModal : false,
578  isVideo : false,
579  videoId : false,
580  modalWidth : 400,
581  modalHeight : 400,
582  modalHTML : null,
583
584
585  // initialize()
586  // Constructor runs on completion of the DOM loading.
587  // The function inserts html at the bottom of the page which is used
588  // to display the shadow overlay and the image container.
589  initialize: function() {
590
591    var s = Drupal.settings.lightbox2;
592    Lightbox.overlayOpacity = s.overlay_opacity;
593    Lightbox.overlayColor = s.overlay_color;
594    Lightbox.disableCloseClick = s.disable_close_click;
595    Lightbox.resizeSequence = s.resize_sequence;
596    Lightbox.resizeSpeed = s.resize_speed;
597    Lightbox.fadeInSpeed = s.fade_in_speed;
598    Lightbox.slideDownSpeed = s.slide_down_speed;
599    Lightbox.borderSize = s.border_size;
600    Lightbox.boxColor = s.box_color;
601    Lightbox.fontColor = s.font_color;
602    Lightbox.topPosition = s.top_position;
603    Lightbox.rtl = s.rtl;
604    Lightbox.loopItems = s.loop_items;
605    Lightbox.keysClose = s.keys_close.split(" ");
606    Lightbox.keysPrevious = s.keys_previous.split(" ");
607    Lightbox.keysNext = s.keys_next.split(" ");
608    Lightbox.keysZoom = s.keys_zoom.split(" ");
609    Lightbox.keysPlayPause = s.keys_play_pause.split(" ");
610    Lightbox.disableResize = s.disable_resize;
611    Lightbox.disableZoom = s.disable_zoom;
612    Lightbox.slideInterval = s.slideshow_interval;
613    Lightbox.showPlayPause = s.show_play_pause;
614    Lightbox.autoStart = s.slideshow_automatic_start;
615    Lightbox.autoExit = s.slideshow_automatic_exit;
616    Lightbox.pauseOnNextClick = s.pause_on_next_click;
617    Lightbox.pauseOnPrevClick = s.pause_on_previous_click;
618    Lightbox.loopSlides = s.loop_slides;
619    Lightbox.alternative_layout = s.use_alt_layout;
620    Lightbox.iframe_width = s.iframe_width;
621    Lightbox.iframe_height = s.iframe_height;
622    Lightbox.iframe_border = s.iframe_border;
623    Lightbox.enableVideo = s.enable_video;
624    if (s.enable_video) {
625      Lightbox.flvPlayer = s.flvPlayer;
626      Lightbox.flvFlashvars = s.flvFlashvars;
627    }
628
629    // Make the lightbox divs.
630    var output = '<div id="overlay" style="display: none;"></div>\
631      <div id="lightbox" style="display: none;">\
632        <div id="outerImageContainer"></div>\
633        <div id="imageDataContainer" class="clearfix">\
634          <div id="imageData"></div>\
635        </div>\
636      </div>';
637    var loading = '<div id="loading"><a href="#" id="loadingLink"></a></div>';
638    var modal = '<div id="modalContainer" style="display: none;"></div>';
639    var frame = '<div id="frameContainer" style="display: none;"></div>';
640    var imageContainer = '<div id="imageContainer" style="display: none;"></div>';
641    var details = '<div id="imageDetails"></div>';
642    var bottomNav = '<div id="bottomNav"></div>';
643    var image = '<img id="lightboxImage" />';
644    var hoverNav = '<div id="hoverNav"><a id="prevLink" href="#"></a><a id="nextLink" href="#"></a></div>';
645    var frameNav = '<div id="frameHoverNav"><a id="framePrevLink" href="#"></a><a id="frameNextLink" href="#"></a></div>';
646    var caption = '<span id="caption"></span>';
647    var numberDisplay = '<span id="numberDisplay"></span>';
648    var close = '<a id="bottomNavClose" href="#"></a>';
649    var zoom = '<a id="bottomNavZoom" href="#"></a>';
650    var zoomOut = '<a id="bottomNavZoomOut" href="#"></a>';
651    var pause = '<a id="lightshowPause" href="#" style="display: none;"></a>';
652    var play = '<a id="lightshowPlay" href="#" style="display: none;"></a>';
653
654    $("body").append(output);
655    $('#outerImageContainer').append(modal + frame + imageContainer + loading);
656    if (!s.use_alt_layout) {
657      $('#imageContainer').append(image + hoverNav);
658      $('#imageData').append(frameNav + details + bottomNav);
659      $('#imageDetails').append(caption + numberDisplay);
660      $('#bottomNav').append(close + zoom + zoomOut + pause + play);
661    }
662    else {
663      $('#outerImageContainer').append(bottomNav);
664      $('#imageContainer').append(image);
665      $('#bottomNav').append(close + zoom + zoomOut);
666      $('#imageData').append(hoverNav + details);
667      $('#imageDetails').append(caption + numberDisplay + pause + play);
668    }
669
670    // Setup onclick handlers.
671    if (Lightbox.disableCloseClick) {
672      $('#overlay').click(function() { Lightbox.end(); return false; } ).hide();
673    }
674    $('#loadingLink, #bottomNavClose').click(function() { Lightbox.end('forceClose'); return false; } );
675    $('#prevLink, #framePrevLink').click(function() { Lightbox.changeData(Lightbox.activeImage - 1); return false; } );
676    $('#nextLink, #frameNextLink').click(function() { Lightbox.changeData(Lightbox.activeImage + 1); return false; } );
677    $('#bottomNavZoom').click(function() { Lightbox.changeData(Lightbox.activeImage, true); return false; } );
678    $('#bottomNavZoomOut').click(function() { Lightbox.changeData(Lightbox.activeImage, false); return false; } );
679    $('#lightshowPause').click(function() { Lightbox.togglePlayPause("lightshowPause", "lightshowPlay"); return false; } );
680    $('#lightshowPlay').click(function() { Lightbox.togglePlayPause("lightshowPlay", "lightshowPause"); return false; } );
681
682    // Fix positioning.
683    $('#prevLink, #nextLink, #framePrevLink, #frameNextLink').css({ 'paddingTop': Lightbox.borderSize + 'px'});
684    $('#imageContainer, #frameContainer, #modalContainer').css({ 'padding': Lightbox.borderSize + 'px'});
685    $('#outerImageContainer, #imageDataContainer, #bottomNavClose').css({'backgroundColor': '#' + Lightbox.boxColor, 'color': '#'+Lightbox.fontColor});
686    if (Lightbox.alternative_layout) {
687      $('#bottomNavZoom, #bottomNavZoomOut').css({'bottom': Lightbox.borderSize + 'px', 'right': Lightbox.borderSize + 'px'});
688    }
689    else if (Lightbox.rtl == 1 && $.browser.msie) {
690      $('#bottomNavZoom, #bottomNavZoomOut').css({'left': '0px'});
691    }
692
693    // Force navigation links to always be displayed
694    if (s.force_show_nav) {
695      $('#prevLink, #nextLink').addClass("force_show_nav");
696    }
697
698  },
699
700  // initList()
701  // Loops through anchor tags looking for 'lightbox', 'lightshow' and
702  // 'lightframe', etc, references and applies onclick events to appropriate
703  // links. You can rerun after dynamically adding images w/ajax.
704  initList : function() {
705
706    // Attach lightbox to any links with rel 'lightbox', 'lightshow' or
707    // 'lightframe', etc.
708    $("a[@rel^='lightbox']:not(.lightbox-processed), area[@rel^='lightbox']:not(.lightbox-processed)").addClass('lightbox-processed').click(function(e) {
709      if (Lightbox.disableCloseClick) {
710        $('#lightbox').unbind('click');
711        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
712      }
713      Lightbox.start(this, false, false, false, false);
714      if (e.preventDefault) { e.preventDefault(); }
715      return false;
716    });
717    $("a[@rel^='lightshow']:not(.lightbox-processed), area[@rel^='lightshow']:not(.lightbox-processed)").addClass('lightbox-processed').click(function(e) {
718      if (Lightbox.disableCloseClick) {
719        $('#lightbox').unbind('click');
720        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
721      }
722      Lightbox.start(this, true, false, false, false);
723      if (e.preventDefault) { e.preventDefault(); }
724      return false;
725    });
726    $("a[@rel^='lightframe']:not(.lightbox-processed), area[@rel^='lightframe']:not(.lightbox-processed)").addClass('lightbox-processed').click(function(e) {
727      if (Lightbox.disableCloseClick) {
728        $('#lightbox').unbind('click');
729        $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
730      }
731      Lightbox.start(this, false, true, false, false);
732      if (e.preventDefault) { e.preventDefault(); }
733      return false;
734    });
735    if (Lightbox.enableVideo) {
736      $("a[@rel^='lightvideo']:not(.lightbox-processed), area[@rel^='lightvideo']:not(.lightbox-processed)").addClass('lightbox-processed').click(function(e) {
737        if (Lightbox.disableCloseClick) {
738          $('#lightbox').unbind('click');
739          $('#lightbox').click(function() { Lightbox.end('forceClose'); } );
740        }
741        Lightbox.start(this, false, false, true, false);
742        if (e.preventDefault) { e.preventDefault(); }
743        return false;
744      });
745    }
746    $("a[@rel^='lightmodal']:not(.lightbox-processed), area[@rel^='lightmodal']:not(.lightbox-processed)").addClass('lightbox-processed').click(function(e) {
747      $('#lightbox').unbind('click');
748      Lightbox.start(this, false, false, false, true);
749      if (e.preventDefault) { e.preventDefault(); }
750      return false;
751    });
752  },
753
754  // start()
755  // Display overlay and lightbox. If image is part of a set, add siblings to
756  // imageArray.
757  start: function(imageLink, slideshow, lightframe, lightvideo, lightmodal) {
758
759    Lightbox.isPaused = !Lightbox.autoStart;
760
761    // Replaces hideSelectBoxes() and hideFlash() calls in original lightbox2.
762    Lightbox.toggleSelectsFlash('hide');
763
764    // Stretch overlay to fill page and fade in.
765    var arrayPageSize = Lightbox.getPageSize();
766    $("#overlay").hide().css({
767      'width': '100%',
768      'zIndex': '10090',
769      'height': arrayPageSize[1] + 'px',
770      'backgroundColor' : '#' + Lightbox.overlayColor
771    });
772    // Detect OS X FF2 opacity + flash issue.
773    if (lightvideo && this.detectMacFF2()) {
774      $("#overlay").removeClass("overlay_default");
775      $("#overlay").addClass("overlay_macff2");
776      $("#overlay").css({'opacity' : null});
777    }
778    else {
779      $("#overlay").removeClass("overlay_macff2");
780      $("#overlay").addClass("overlay_default");
781      $("#overlay").css({'opacity' : Lightbox.overlayOpacity});
782    }
783    $("#overlay").fadeIn(Lightbox.fadeInSpeed);
784
785
786    Lightbox.isSlideshow = slideshow;
787    Lightbox.isLightframe = lightframe;
788    Lightbox.isVideo = lightvideo;
789    Lightbox.isModal = lightmodal;
790    Lightbox.imageArray = [];
791    Lightbox.imageNum = 0;
792
793    var anchors = $(imageLink.tagName);
794    var anchor = null;
795    var rel_parts = Lightbox.parseRel(imageLink);
796    var rel = rel_parts["rel"];
797    var rel_group = rel_parts["group"];
798    var title = (rel_parts["title"] ? rel_parts["title"] : imageLink.title);
799    var rel_style = null;
800    var i = 0;
801
802
803    // Set the title for image alternative text.
804    var alt = imageLink.title;
805    if (!alt) {
806      var img = $(imageLink).find("img");
807      if (img && $(img).attr("alt")) {
808        alt = $(img).attr("alt");
809      }
810      else {
811        alt = title;
812      }
813    }
814
815    if ($(imageLink).attr('id') == 'lightboxAutoModal') {
816      rel_style = rel_parts["style"];
817      Lightbox.imageArray.push(['#lightboxAutoModal > *', title, alt, rel_style, 1]);
818    }
819    else {
820      // Handle lightbox images with no grouping.
821      if ((rel == 'lightbox' || rel == 'lightshow') && !rel_group) {
822        Lightbox.imageArray.push([imageLink.href, title, alt]);
823      }
824
825      // Handle other items with no grouping.
826      else if (!rel_group) {
827        rel_style = rel_parts["style"];
828        Lightbox.imageArray.push([imageLink.href, title, alt, rel_style]);
829      }
830
831      // Handle grouped items.
832      else {
833
834        // Loop through anchors and add them to imageArray.
835        for (i = 0; i < anchors.length; i++) {
836          anchor = anchors[i];
837          if (anchor.href && $(anchor).attr('rel')) {
838            var rel_data = Lightbox.parseRel(anchor);
839            var anchor_title = (rel_data["title"] ? rel_data["title"] : anchor.title);
840            if (rel_data["rel"] == rel) {
841              if (rel_data["group"] == rel_group) {
842                if (Lightbox.isLightframe || Lightbox.isModal) {
843                  rel_style = rel_data["style"];
844                }
845                Lightbox.imageArray.push([anchor.href, anchor_title, alt, rel_style]);
846              }
847            }
848          }
849        }
850
851        // Remove duplicates.
852        for (i = 0; i < Lightbox.imageArray.length; i++) {
853          for (j = Lightbox.imageArray.length-1; j > i; j--) {
854            if (Lightbox.imageArray[i][0] == Lightbox.imageArray[j][0]) {
855              Lightbox.imageArray.splice(j,1);
856            }
857          }
858        }
859        while (Lightbox.imageArray[Lightbox.imageNum][0] != imageLink.href) {
860          Lightbox.imageNum++;
861        }
862      }
863    }
864
865    if (Lightbox.isSlideshow && Lightbox.showPlayPause && Lightbox.isPaused) {
866      $('#lightshowPlay').show();
867      $('#lightshowPause').hide();
868    }
869
870    // Calculate top and left offset for the lightbox.
871    var arrayPageScroll = Lightbox.getPageScroll();
872    var lightboxTop = arrayPageScroll[1] + (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1;
873    var lightboxLeft = arrayPageScroll[0];
874    $('#frameContainer, #modalContainer, #lightboxImage').hide();
875    $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide();
876    $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide();
877    $('#outerImageContainer').css({'width': '250px', 'height': '250px'});
878    $('#lightbox').css({
879      'zIndex': '10500',
880      'top': lightboxTop + 'px',
881      'left': lightboxLeft + 'px'
882    }).show();
883
884    Lightbox.total = Lightbox.imageArray.length;
885    Lightbox.changeData(Lightbox.imageNum);
886  },
887
888  // changeData()
889  // Hide most elements and preload image in preparation for resizing image
890  // container.
891  changeData: function(imageNum, zoomIn) {
892
893    if (Lightbox.inprogress === false) {
894      if (Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) {
895        if (imageNum >= Lightbox.total) imageNum = 0;
896        if (imageNum < 0) imageNum = Lightbox.total - 1;
897      }
898
899      if (Lightbox.isSlideshow) {
900        for (var i = 0; i < Lightbox.slideIdCount; i++) {
901          window.clearTimeout(Lightbox.slideIdArray[i]);
902        }
903      }
904      Lightbox.inprogress = true;
905      Lightbox.activeImage = imageNum;
906
907      if (Lightbox.disableResize && !Lightbox.isSlideshow) {
908        zoomIn = true;
909      }
910      Lightbox.isZoomedIn = zoomIn;
911
912
913      // Hide elements during transition.
914      $('#loading').css({'zIndex': '10500'}).show();
915      if (!Lightbox.alternative_layout) {
916        $('#imageContainer').hide();
917      }
918      $('#frameContainer, #modalContainer, #lightboxImage').hide();
919      $('#hoverNav, #prevLink, #nextLink, #frameHoverNav, #framePrevLink, #frameNextLink').hide();
920      $('#imageDataContainer, #numberDisplay, #bottomNavZoom, #bottomNavZoomOut').hide();
921
922      // Preload image content, but not iframe pages.
923      if (!Lightbox.isLightframe && !Lightbox.isVideo && !Lightbox.isModal) {
924        imgPreloader = new Image();
925        imgPreloader.onerror = function() { Lightbox.imgNodeLoadingError(this); };
926
927        imgPreloader.onload = function() {
928          var photo = document.getElementById('lightboxImage');
929          photo.src = Lightbox.imageArray[Lightbox.activeImage][0];
930          photo.alt = Lightbox.imageArray[Lightbox.activeImage][2];
931
932          var imageWidth = imgPreloader.width;
933          var imageHeight = imgPreloader.height;
934
935          // Resize code.
936          var arrayPageSize = Lightbox.getPageSize();
937          var targ = { w:arrayPageSize[2] - (Lightbox.borderSize * 2), h:arrayPageSize[3] - (Lightbox.borderSize * 6) - (Lightbox.infoHeight * 4) - (arrayPageSize[3] / 10) };
938          var orig = { w:imgPreloader.width, h:imgPreloader.height };
939
940          // Image is very large, so show a smaller version of the larger image
941          // with zoom button.
942          if (zoomIn !== true) {
943            var ratio = 1.0; // Shrink image with the same aspect.
944            $('#bottomNavZoomOut, #bottomNavZoom').hide();
945            if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
946              ratio = ((targ.w / orig.w) < (targ.h / orig.h)) ? targ.w / orig.w : targ.h / orig.h;
947              if (!Lightbox.disableZoom && !Lightbox.isSlideshow) {
948                $('#bottomNavZoom').css({'zIndex': '10500'}).show();
949              }
950            }
951
952            imageWidth  = Math.floor(orig.w * ratio);
953            imageHeight = Math.floor(orig.h * ratio);
954          }
955
956          else {
957            $('#bottomNavZoom').hide();
958            // Only display zoom out button if the image is zoomed in already.
959            if ((orig.w >= targ.w || orig.h >= targ.h) && orig.h && orig.w) {
960              // Only display zoom out button if not a slideshow and if the
961              // buttons aren't disabled.
962              if (!Lightbox.disableResize && Lightbox.isSlideshow === false && !Lightbox.disableZoom) {
963                $('#bottomNavZoomOut').css({'zIndex': '10500'}).show();
964              }
965            }
966          }
967
968          photo.style.width = (imageWidth) + 'px';
969          photo.style.height = (imageHeight) + 'px';
970          Lightbox.resizeContainer(imageWidth, imageHeight);
971
972          // Clear onLoad, IE behaves irratically with animated gifs otherwise.
973          imgPreloader.onload = function() {};
974        };
975
976        imgPreloader.src = Lightbox.imageArray[Lightbox.activeImage][0];
977        imgPreloader.alt = Lightbox.imageArray[Lightbox.activeImage][2];
978      }
979
980      // Set up frame size, etc.
981      else if (Lightbox.isLightframe) {
982        var src = Lightbox.imageArray[Lightbox.activeImage][0];
983        $('#frameContainer').html('<iframe id="lightboxFrame" style="display: none;" src="'+src+'"></iframe>');
984
985        // Enable swf support in Gecko browsers.
986        if ($.browser.mozilla && src.indexOf('.swf') != -1) {
987          setTimeout(function () {
988            document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0];
989          }, 1000);
990        }
991
992        if (!Lightbox.iframe_border) {
993          $('#lightboxFrame').css({'border': 'none'});
994          $('#lightboxFrame').attr('frameborder', '0');
995        }
996        var iframe = document.getElementById('lightboxFrame');
997        var iframeStyles = Lightbox.imageArray[Lightbox.activeImage][3];
998        iframe = Lightbox.setStyles(iframe, iframeStyles);
999        Lightbox.resizeContainer(parseInt(iframe.width, 10), parseInt(iframe.height, 10));
1000      }
1001      else if (Lightbox.isVideo || Lightbox.isModal) {
1002        var container = document.getElementById('modalContainer');
1003        var modalStyles = Lightbox.imageArray[Lightbox.activeImage][3];
1004        container = Lightbox.setStyles(container, modalStyles);
1005        if (Lightbox.isVideo) {
1006          Lightbox.modalHeight =  parseInt(container.height, 10);
1007          Lightbox.modalWidth =  parseInt(container.width, 10);
1008          Lightvideo.startVideo(Lightbox.imageArray[Lightbox.activeImage][0]);
1009        }
1010        Lightbox.resizeContainer(parseInt(container.width, 10), parseInt(container.height, 10));
1011      }
1012    }
1013  },
1014
1015  // imgNodeLoadingError()
1016  imgNodeLoadingError: function(image) {
1017    var s = Drupal.settings.lightbox2;
1018    var original_image = Lightbox.imageArray[Lightbox.activeImage][0];
1019    if (s.display_image_size !== "") {
1020      original_image = original_image.replace(new RegExp("."+s.display_image_size), "");
1021    }
1022    Lightbox.imageArray[Lightbox.activeImage][0] = original_image;
1023    image.onerror = function() { Lightbox.imgLoadingError(image); };
1024    image.src = original_image;
1025  },
1026
1027  // imgLoadingError()
1028  imgLoadingError: function(image) {
1029    var s = Drupal.settings.lightbox2;
1030    Lightbox.imageArray[Lightbox.activeImage][0] = s.default_image;
1031    image.src = s.default_image;
1032  },
1033
1034  // resizeContainer()
1035  resizeContainer: function(imgWidth, imgHeight) {
1036
1037    imgWidth = (imgWidth < Lightbox.minWidth ? Lightbox.minWidth : imgWidth);
1038
1039    this.widthCurrent = $('#outerImageContainer').width();
1040    this.heightCurrent = $('#outerImageContainer').height();
1041
1042    var widthNew = (imgWidth  + (Lightbox.borderSize * 2));
1043    var heightNew = (imgHeight  + (Lightbox.borderSize * 2));
1044
1045    // Scalars based on change from old to new.
1046    this.xScale = ( widthNew / this.widthCurrent) * 100;
1047    this.yScale = ( heightNew / this.heightCurrent) * 100;
1048
1049    // Calculate size difference between new and old image, and resize if
1050    // necessary.
1051    wDiff = this.widthCurrent - widthNew;
1052    hDiff = this.heightCurrent - heightNew;
1053
1054    $('#modalContainer').css({'width': imgWidth, 'height': imgHeight});
1055    // Detect animation sequence.
1056    if (Lightbox.resizeSequence) {
1057      var animate1 = {width: widthNew};
1058      var animate2 = {height: heightNew};
1059      if (Lightbox.resizeSequence == 2) {
1060        animate1 = {height: heightNew};
1061        animate2 = {width: widthNew};
1062      }
1063      $('#outerImageContainer').animate(animate1, Lightbox.resizeSpeed).animate(animate2, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); });
1064    }
1065    // Simultaneous.
1066    else {
1067      $('#outerImageContainer').animate({'width': widthNew, 'height': heightNew}, Lightbox.resizeSpeed, 'linear', function() { Lightbox.showData(); });
1068    }
1069
1070    // If new and old image are same size and no scaling transition is necessary
1071    // do a quick pause to prevent image flicker.
1072    if ((hDiff === 0) && (wDiff === 0)) {
1073      if ($.browser.msie) {
1074        Lightbox.pause(250);
1075      }
1076      else {
1077        Lightbox.pause(100);
1078      }
1079    }
1080
1081    var s = Drupal.settings.lightbox2;
1082    if (!s.use_alt_layout) {
1083      $('#prevLink, #nextLink').css({'height': imgHeight + 'px'});
1084    }
1085    $('#imageDataContainer').css({'width': widthNew + 'px'});
1086  },
1087
1088  // showData()
1089  // Display image and begin preloading neighbors.
1090  showData: function() {
1091    $('#loading').hide();
1092
1093    if (Lightbox.isLightframe || Lightbox.isVideo || Lightbox.isModal) {
1094      Lightbox.updateDetails();
1095      if (Lightbox.isLightframe) {
1096        $('#frameContainer').show();
1097        if ($.browser.safari) {
1098          $('#lightboxFrame').css({'zIndex': '10500'}).show();
1099        }
1100        else {
1101          $('#lightboxFrame').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed);
1102        }
1103      }
1104      else {
1105        if (Lightbox.isVideo) {
1106          $("#modalContainer").html(Lightbox.modalHTML);
1107          $("#modalContainer").click(function() { return false; } );
1108        }
1109        else {
1110          var src = unescape(Lightbox.imageArray[Lightbox.activeImage][0]);
1111          if (Lightbox.imageArray[Lightbox.activeImage][4]) {
1112            $(src).appendTo("#modalContainer");
1113          }
1114          else {
1115            $("#modalContainer").load(src);
1116          }
1117          $('#modalContainer').unbind('click');
1118        }
1119        $('#modalContainer').css({'zIndex': '10500'}).show();
1120      }
1121    }
1122
1123    // Handle display of image content.
1124    else {
1125      $('#imageContainer').show();
1126      if($.browser.safari) {
1127        $('#lightboxImage').css({'zIndex': '10500'}).show();
1128      }
1129      else {
1130        $('#lightboxImage').css({'zIndex': '10500'}).fadeIn(Lightbox.fadeInSpeed);
1131      }
1132      Lightbox.updateDetails();
1133      this.preloadNeighborImages();
1134    }
1135    Lightbox.inprogress = false;
1136
1137    // Slideshow specific stuff.
1138    if (Lightbox.isSlideshow) {
1139      if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) {
1140        if (Lightbox.autoExit) {
1141          Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.end('slideshow');}, Lightbox.slideInterval);
1142        }
1143      }
1144      else {
1145        if (!Lightbox.isPaused && Lightbox.total > 1) {
1146          Lightbox.slideIdArray[Lightbox.slideIdCount++] = setTimeout(function () {Lightbox.changeData(Lightbox.activeImage + 1);}, Lightbox.slideInterval);
1147        }
1148      }
1149      if (Lightbox.showPlayPause && Lightbox.total > 1 && !Lightbox.isPaused) {
1150        $('#lightshowPause').show();
1151        $('#lightshowPlay').hide();
1152      }
1153      else if (Lightbox.showPlayPause && Lightbox.total > 1) {
1154        $('#lightshowPause').hide();
1155        $('#lightshowPlay').show();
1156      }
1157    }
1158
1159    // Adjust the page overlay size.
1160    var arrayPageSize = Lightbox.getPageSize();
1161    var arrayPageScroll = Lightbox.getPageScroll();
1162    var pageHeight = arrayPageSize[1];
1163    if (Lightbox.isZoomedIn && arrayPageSize[1] > arrayPageSize[3]) {
1164      var lightboxTop = (Lightbox.topPosition == '' ? (arrayPageSize[3] / 10) : Lightbox.topPosition) * 1;
1165      pageHeight = pageHeight + arrayPageScroll[1] + lightboxTop;
1166    }
1167    $('#overlay').css({'height': pageHeight + 'px', 'width': arrayPageSize[0] + 'px'});
1168
1169    // Gecko browsers (e.g. Firefox, SeaMonkey, etc) don't handle pdfs as
1170    // expected.
1171    if ($.browser.mozilla) {
1172      if (Lightbox.imageArray[Lightbox.activeImage][0].indexOf(".pdf") != -1) {
1173        setTimeout(function () {
1174          document.getElementById("lightboxFrame").src = Lightbox.imageArray[Lightbox.activeImage][0];
1175        }, 1000);
1176      }
1177    }
1178  },
1179
1180  // updateDetails()
1181  // Display caption, image number, and bottom nav.
1182  updateDetails: function() {
1183
1184    $("#imageDataContainer").hide();
1185
1186    var caption = Lightbox.imageArray[Lightbox.activeImage][1];
1187    if (!caption) caption = '&nbsp;';
1188    $('#caption').html(caption).css({'zIndex': '10500'}).show();
1189
1190    // If image is part of set display 'Image x of x'.
1191    var s = Drupal.settings.lightbox2;
1192    var numberDisplay = null;
1193    if (Lightbox.total > 1) {
1194      var currentImage = Lightbox.activeImage + 1;
1195      if (!Lightbox.isLightframe && !Lightbox.isModal && !Lightbox.isVideo) {
1196        numberDisplay = s.image_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1197      }
1198      else if (Lightbox.isVideo) {
1199        numberDisplay = s.video_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1200      }
1201      else {
1202        numberDisplay = s.page_count.replace(/\!current/, currentImage).replace(/\!total/, Lightbox.total);
1203      }
1204      $('#numberDisplay').html(numberDisplay).css({'zIndex': '10500'}).show();
1205    }
1206
1207    $("#imageDataContainer").hide().slideDown(Lightbox.slideDownSpeed, function() {
1208      $("#bottomNav").show();
1209    });
1210    if (Lightbox.rtl == 1) {
1211      $("#bottomNav").css({'float': 'left'});
1212    }
1213    Lightbox.updateNav();
1214  },
1215
1216  // updateNav()
1217  // Display appropriate previous and next hover navigation.
1218  updateNav: function() {
1219
1220    $('#hoverNav').css({'zIndex': '10500'}).show();
1221    var prevLink = '#prevLink';
1222    var nextLink = '#nextLink';
1223
1224    // Slideshow is separated as we need to show play / pause button.
1225    if (Lightbox.isSlideshow) {
1226      if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage !== 0) {
1227        $(prevLink).css({'zIndex': '10500'}).show().click(function() {
1228          if (Lightbox.pauseOnPrevClick) {
1229            Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1230          }
1231          Lightbox.changeData(Lightbox.activeImage - 1); return false;
1232        });
1233      }
1234      else {
1235        $(prevLink).hide();
1236      }
1237
1238      // If not last image in set, display next image button.
1239      if ((Lightbox.total > 1 && Lightbox.loopSlides) || Lightbox.activeImage != (Lightbox.total - 1)) {
1240        $(nextLink).css({'zIndex': '10500'}).show().click(function() {
1241          if (Lightbox.pauseOnNextClick) {
1242            Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1243          }
1244          Lightbox.changeData(Lightbox.activeImage + 1); return false;
1245        });
1246      }
1247      // Safari browsers need to have hide() called again.
1248      else {
1249        $(nextLink).hide();
1250      }
1251    }
1252
1253    // All other types of content.
1254    else {
1255
1256      if ((Lightbox.isLightframe || Lightbox.isModal || Lightbox.isVideo) && !Lightbox.alternative_layout) {
1257        $('#frameHoverNav').css({'zIndex': '10500'}).show();
1258        $('#hoverNav').css({'zIndex': '10500'}).hide();
1259        prevLink = '#framePrevLink';
1260        nextLink = '#frameNextLink';
1261      }
1262
1263      // If not first image in set, display prev image button.
1264      if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage !== 0) {
1265        $(prevLink).css({'zIndex': '10500'}).show().click(function() {
1266          Lightbox.changeData(Lightbox.activeImage - 1); return false;
1267        });
1268      }
1269      // Safari browsers need to have hide() called again.
1270      else {
1271        $(prevLink).hide();
1272      }
1273
1274      // If not last image in set, display next image button.
1275      if ((Lightbox.total > 1 && Lightbox.loopItems) || Lightbox.activeImage != (Lightbox.total - 1)) {
1276        $(nextLink).css({'zIndex': '10500'}).show().click(function() {
1277          Lightbox.changeData(Lightbox.activeImage + 1); return false;
1278        });
1279      }
1280      // Safari browsers need to have hide() called again.
1281      else {
1282        $(nextLink).hide();
1283      }
1284    }
1285
1286    // Don't enable keyboard shortcuts so forms will work.
1287    if (!Lightbox.isModal) {
1288      this.enableKeyboardNav();
1289    }
1290  },
1291
1292
1293  // enableKeyboardNav()
1294  enableKeyboardNav: function() {
1295    $(document).bind("keydown", this.keyboardAction);
1296  },
1297
1298  // disableKeyboardNav()
1299  disableKeyboardNav: function() {
1300    $(document).unbind("keydown", this.keyboardAction);
1301  },
1302
1303  // keyboardAction()
1304  keyboardAction: function(e) {
1305    if (e === null) { // IE.
1306      keycode = event.keyCode;
1307      escapeKey = 27;
1308    }
1309    else { // Mozilla.
1310      keycode = e.keyCode;
1311      escapeKey = e.DOM_VK_ESCAPE;
1312    }
1313
1314    key = String.fromCharCode(keycode).toLowerCase();
1315
1316    // Close lightbox.
1317    if (Lightbox.checkKey(Lightbox.keysClose, key, keycode)) {
1318      Lightbox.end('forceClose');
1319    }
1320    // Display previous image (p, <-).
1321    else if (Lightbox.checkKey(Lightbox.keysPrevious, key, keycode)) {
1322      if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage !== 0) {
1323        Lightbox.changeData(Lightbox.activeImage - 1);
1324      }
1325
1326    }
1327    // Display next image (n, ->).
1328    else if (Lightbox.checkKey(Lightbox.keysNext, key, keycode)) {
1329      if ((Lightbox.total > 1 && ((Lightbox.isSlideshow && Lightbox.loopSlides) || (!Lightbox.isSlideshow && Lightbox.loopItems))) || Lightbox.activeImage != (Lightbox.total - 1)) {
1330        Lightbox.changeData(Lightbox.activeImage + 1);
1331      }
1332    }
1333    // Zoom in.
1334    else if (Lightbox.checkKey(Lightbox.keysZoom, key, keycode) && !Lightbox.disableResize && !Lightbox.disableZoom && !Lightbox.isSlideshow && !Lightbox.isLightframe) {
1335      if (Lightbox.isZoomedIn) {
1336        Lightbox.changeData(Lightbox.activeImage, false);
1337      }
1338      else if (!Lightbox.isZoomedIn) {
1339        Lightbox.changeData(Lightbox.activeImage, true);
1340      }
1341      return false;
1342    }
1343    // Toggle play / pause (space).
1344    else if (Lightbox.checkKey(Lightbox.keysPlayPause, key, keycode) && Lightbox.isSlideshow) {
1345
1346      if (Lightbox.isPaused) {
1347        Lightbox.togglePlayPause("lightshowPlay", "lightshowPause");
1348      }
1349      else {
1350        Lightbox.togglePlayPause("lightshowPause", "lightshowPlay");
1351      }
1352      return false;
1353    }
1354  },
1355
1356  preloadNeighborImages: function() {
1357
1358    if ((Lightbox.total - 1) > Lightbox.activeImage) {
1359      preloadNextImage = new Image();
1360      preloadNextImage.src = Lightbox.imageArray[Lightbox.activeImage + 1][0];
1361    }
1362    if (Lightbox.activeImage > 0) {
1363      preloadPrevImage = new Image();
1364      preloadPrevImage.src = Lightbox.imageArray[Lightbox.activeImage - 1][0];
1365    }
1366
1367  },
1368
1369  end: function(caller) {
1370    var closeClick = (caller == 'slideshow' ? false : true);
1371    if (Lightbox.isSlideshow && Lightbox.isPaused && !closeClick) {
1372      return;
1373    }
1374    // To prevent double clicks on navigation links.
1375    if (Lightbox.inprogress === true && caller != 'forceClose') {
1376      return;
1377    }
1378    Lightbox.disableKeyboardNav();
1379    $('#lightbox').hide();
1380    $("#overlay").fadeOut();
1381    Lightbox.isPaused = true;
1382    Lightbox.inprogress = false;
1383    // Replaces calls to showSelectBoxes() and showFlash() in original
1384    // lightbox2.
1385    Lightbox.toggleSelectsFlash('visible');
1386    if (Lightbox.isSlideshow) {
1387      for (var i = 0; i < Lightbox.slideIdCount; i++) {
1388        window.clearTimeout(Lightbox.slideIdArray[i]);
1389      }
1390      $('#lightshowPause, #lightshowPlay').hide();
1391    }
1392    else if (Lightbox.isLightframe) {
1393      $('#frameContainer').empty().hide();
1394    }
1395    else if (Lightbox.isVideo || Lightbox.isModal) {
1396      $('#modalContainer').hide().html("");
1397    }
1398  },
1399
1400
1401  // getPageScroll()
1402  // Returns array with x,y page scroll values.
1403  // Core code from - quirksmode.com.
1404  getPageScroll : function() {
1405
1406    var xScroll, yScroll;
1407
1408    if (self.pageYOffset) {
1409      yScroll = self.pageYOffset;
1410      xScroll = self.pageXOffset;
1411    }
1412    else if (document.documentElement && document.documentElement.scrollTop) {  // Explorer 6 Strict.
1413      yScroll = document.documentElement.scrollTop;
1414      xScroll = document.documentElement.scrollLeft;
1415    }
1416    else if (document.body) {// All other Explorers.
1417      yScroll = document.body.scrollTop;
1418      xScroll = document.body.scrollLeft;
1419    }
1420
1421    arrayPageScroll = [xScroll,yScroll];
1422    return arrayPageScroll;
1423  },
1424
1425  // getPageSize()
1426  // Returns array with page width, height and window width, height.
1427  // Core code from - quirksmode.com.
1428  // Edit for Firefox by pHaez.
1429  getPageSize : function() {
1430
1431    var xScroll, yScroll;
1432
1433    if (document.body.scrollHeight > document.body.offsetHeight) { // all but Explorer Mac
1434      xScroll = document.body.scrollWidth;
1435      yScroll = document.body.scrollHeight;
1436    }
1437    else if (window.innerHeight && window.scrollMaxY) {
1438      xScroll = window.innerWidth + window.scrollMaxX;
1439      yScroll = window.innerHeight + window.scrollMaxY;
1440    }
1441    // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari.
1442    else {
1443      xScroll = document.body.offsetWidth;
1444      yScroll = document.body.offsetHeight;
1445    }
1446
1447    var windowWidth, windowHeight;
1448
1449    if (self.innerHeight) { // All except Explorer.
1450      if (document.documentElement.clientWidth) {
1451        windowWidth = document.documentElement.clientWidth;
1452      }
1453      else {
1454        windowWidth = self.innerWidth;
1455      }
1456      windowHeight = self.innerHeight;
1457    }
1458    // Explorer 6 Strict Mode.
1459    else if (document.documentElement && document.documentElement.clientHeight) {
1460      windowWidth = document.documentElement.clientWidth;
1461      windowHeight = document.documentElement.clientHeight;
1462    }
1463    else if (document.body) { // Other Explorers.
1464      windowWidth = document.body.clientWidth;
1465      windowHeight = document.body.clientHeight;
1466    }
1467
1468
1469    // For small pages with total height less then height of the viewport.
1470    if (yScroll < windowHeight) {
1471      pageHeight = windowHeight;
1472    }
1473    else {
1474      pageHeight = yScroll;
1475    }
1476
1477
1478    // For small pages with total width less then width of the viewport.
1479    if (xScroll < windowWidth) {
1480      pageWidth = windowWidth;
1481    }
1482    else {
1483      pageWidth = xScroll;
1484    }
1485
1486    arrayPageSize = [pageWidth, pageHeight, windowWidth, windowHeight];
1487    return arrayPageSize;
1488  },
1489
1490
1491  // pause(numberMillis)
1492  pause : function(ms) {
1493    var date = new Date();
1494    var curDate = null;
1495    do { curDate = new Date(); }
1496    while (curDate - date < ms);
1497  },
1498
1499
1500  // toggleSelectsFlash()
1501  // Hide / unhide select lists and flash objects as they appear above the
1502  // lightbox in some browsers.
1503  toggleSelectsFlash: function (state) {
1504    if (state == 'visible') {
1505      $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").show();
1506    }
1507    else if (state == 'hide') {
1508      $("select:visible, embed:visible, object:visible").addClass("lightbox_hidden");
1509      $("select.lightbox_hidden, embed.lightbox_hidden, object.lightbox_hidden").hide();
1510    }
1511  },
1512
1513
1514  // parseRel()
1515  parseRel: function (link) {
1516    var parts = [];
1517    parts["rel"] = parts["title"] = parts["group"] = parts["style"] = null;
1518    if (!$(link).attr('rel')) return parts;
1519    parts["rel"] = $(link).attr('rel').match(/\w+/)[0];
1520
1521    if ($(link).attr('rel').match(/\[(.*)\]/)) {
1522      var info = $(link).attr('rel').match(/\[(.*?)\]/)[1].split('|');
1523      parts["group"] = info[0];
1524      parts["style"] = info[1];
1525    }
1526    if ($(link).attr('rel').match(/\[.*\]\[(.*)\]/)) {
1527      parts["title"] = $(link).attr('rel').match(/\[.*\]\[(.*)\]/)[1];
1528    }
1529    return parts;
1530  },
1531
1532  // setStyles()
1533  setStyles: function(item, styles) {
1534    item.width = Lightbox.iframe_width;
1535    item.height = Lightbox.iframe_height;
1536    item.scrolling = "auto";
1537
1538    if (!styles) return item;
1539    var stylesArray = styles.split(';');
1540    for (var i = 0; i< stylesArray.length; i++) {
1541      if (stylesArray[i].indexOf('width:') >= 0) {
1542        var w = stylesArray[i].replace('width:', '');
1543        item.width = jQuery.trim(w);
1544      }
1545      else if (stylesArray[i].indexOf('height:') >= 0) {
1546        var h = stylesArray[i].replace('height:', '');
1547        item.height = jQuery.trim(h);
1548      }
1549      else if (stylesArray[i].indexOf('scrolling:') >= 0) {
1550        var scrolling = stylesArray[i].replace('scrolling:', '');
1551        item.scrolling = jQuery.trim(scrolling);
1552      }
1553      else if (stylesArray[i].indexOf('overflow:') >= 0) {
1554        var overflow = stylesArray[i].replace('overflow:', '');
1555        item.overflow = jQuery.trim(overflow);
1556      }
1557    }
1558    return item;
1559  },
1560
1561
1562  // togglePlayPause()
1563  // Hide the pause / play button as appropriate.  If pausing the slideshow also
1564  // clear the timers, otherwise move onto the next image.
1565  togglePlayPause: function(hideId, showId) {
1566    if (Lightbox.isSlideshow && hideId == "lightshowPause") {
1567      for (var i = 0; i < Lightbox.slideIdCount; i++) {
1568        window.clearTimeout(Lightbox.slideIdArray[i]);
1569      }
1570    }
1571    $('#' + hideId).hide();
1572    $('#' + showId).show();
1573
1574    if (hideId == "lightshowPlay") {
1575      Lightbox.isPaused = false;
1576      if (!Lightbox.loopSlides && Lightbox.activeImage == (Lightbox.total - 1)) {
1577        Lightbox.end();
1578      }
1579      else if (Lightbox.total > 1) {
1580        Lightbox.changeData(Lightbox.activeImage + 1);
1581      }
1582    }
1583    else {
1584      Lightbox.isPaused = true;
1585    }
1586  },
1587
1588  triggerLightbox: function (rel_type, rel_group) {
1589    if (rel_type.length) {
1590      if (rel_group && rel_group.length) {
1591        $("a[@rel^='" + rel_type +"\[" + rel_group + "\]'], area[@rel^='" + rel_type +"\[" + rel_group + "\]']").eq(0).trigger("click");
1592      }
1593      else {
1594        $("a[@rel^='" + rel_type +"'], area[@rel^='" + rel_type +"']").eq(0).trigger("click");
1595      }
1596    }
1597  },
1598
1599  detectMacFF2: function() {
1600    var ua = navigator.userAgent.toLowerCase();
1601    if (/firefox[\/\s](\d+\.\d+)/.test(ua)) {
1602      var ffversion = new Number(RegExp.$1);
1603      if (ffversion < 3 && ua.indexOf('mac') != -1) {
1604        return true;
1605      }
1606    }
1607    return false;
1608  },
1609
1610  checkKey: function(keys, key, code) {
1611    return (jQuery.inArray(key, keys) != -1 || jQuery.inArray(String(code), keys) != -1);
1612  }
1613
1614
1615};
1616
1617// Initialize the lightbox.
1618Drupal.behaviors.initLightbox = function (context) {
1619  $('body:not(.lightbox-processed)', context).addClass('lightbox-processed').each(function() {
1620    Lightbox.initialize();
1621    $('#lightboxAutoModal').triggerHandler('click');
1622    return false; // Break the each loop.
1623  });
1624
1625  // Attach lightbox to any links with lightbox rels.
1626  Lightbox.initList();
1627};
1628
1629;
1630// $Id: mail_ru_auth.js,v 1.2 2010/11/27 15:36:36 seaji Exp $
1631
1632$(document).ready(function(){
1633  $('.js_warning').hide();
1634});;
1635// $Id: poormanscron.js,v 1.1.2.3 2010/01/17 00:27:52 davereid Exp $
1636(function ($) {
1637
1638/**
1639 * Checks to see if the cron should be automatically run.
1640 */
1641Drupal.behaviors.cronCheck = function(context) {
1642  if (Drupal.settings.cron.runNext || false) {
1643    $('body:not(.cron-check-processed)', context).addClass('cron-check-processed').each(function() {
1644      // Only execute the cron check if its the right time.
1645      if (Math.round(new Date().getTime() / 1000.0) >= Drupal.settings.cron.runNext) {
1646        $.get(Drupal.settings.cron.basePath + '/run-cron-check');
1647      }
1648    });
1649  }
1650};
1651
1652})(jQuery);
1653;
1654/*
1655 * jQuery Cycle Plugin (with Transition Definitions)
1656 * Examples and documentation at: http://jquery.malsup.com/cycle/
1657 * Copyright (c) 2007-2010 M. Alsup
1658 * Version: 2.88 (08-JUN-2010)
1659 * Dual licensed under the MIT and GPL licenses.
1660 * http://jquery.malsup.com/license.html
1661 * Requires: jQuery v1.2.6 or later
1662 */
1663(function($){var ver="2.88";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){if($.fn.cycle.debug){log(s);}}function log(){if(window.console&&window.console.log){window.console.log("[cycle] "+Array.prototype.join.call(arguments," "));}}$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isReady&&o.s){log("DOM not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; zero elements found by selector"+($.isReady?"":" (DOM not ready)"));return this;}return this.each(function(){var opts=handleArguments(this,options,arg2);if(opts===false){return;}opts.updateActivePagerLink=opts.updateActivePagerLink||$.fn.cycle.updateActivePagerLink;if(this.cycleTimeout){clearTimeout(this.cycleTimeout);}this.cycleTimeout=this.cyclePause=0;var $cont=$(this);var $slides=opts.slideExpr?$(opts.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){log("terminating; too few slides: "+els.length);return;}var opts2=buildOptions($cont,$slides,els,opts,o);if(opts2===false){return;}var startTime=opts2.continuous?10:getTimeout(els[opts2.currSlide],els[opts2.nextSlide],opts2,!opts2.rev);if(startTime){startTime+=(opts2.delay||0);if(startTime<10){startTime=10;}debug("first timeout: "+startTime);this.cycleTimeout=setTimeout(function(){go(els,opts2,0,(!opts2.rev&&!opts.backwards));},startTime);}});};function handleArguments(cont,options,arg2){if(cont.cycleStop==undefined){cont.cycleStop=0;}if(options===undefined||options===null){options={};}
1663if(options.constructor==String){switch(options){case"destroy":case"stop":var opts=$(cont).data("cycle.opts");if(!opts){return false;}cont.cycleStop++;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);}cont.cycleTimeout=0;$(cont).removeData("cycle.opts");if(options=="destroy"){destroy(opts);}return false;case"toggle":cont.cyclePause=(cont.cyclePause===1)?0:1;checkInstantResume(cont.cyclePause,arg2,cont);return false;case"pause":cont.cyclePause=1;return false;case"resume":cont.cyclePause=0;checkInstantResume(false,arg2,cont);return false;case"prev":case"next":var opts=$(cont).data("cycle.opts");if(!opts){log('options not found, "prev/next" ignored');return false;}$.fn.cycle[options](opts);return false;default:options={fx:options};}return options;}else{if(options.constructor==Number){var num=options;options=$(cont).data("cycle.opts");if(!options){log("options not found, can not advance slide");return false;}if(num<0||num>=options.elements.length){log("invalid slide index: "+num);return false;}options.nextSlide=num;if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}if(typeof arg2=="string"){options.oneTimeFx=arg2;}go(options.elements,options,1,num>=options.currSlide);return false;}}return options;function checkInstantResume(isPaused,arg2,cont){if(!isPaused&&arg2===true){var options=$(cont).data("cycle.opts");if(!options){log("options not found, can not resume");return false;}if(cont.cycleTimeout){clearTimeout(cont.cycleTimeout);cont.cycleTimeout=0;}go(options.elements,options,1,(!opts.rev&&!opts.backwards));}}}function removeFilter(el,opts){if(!$.support.opacity&&opts.cleartype&&el.style.filter){try{el.style.removeAttribute("filter");}catch(smother){}}}function destroy(opts){if(opts.next){$(opts.next).unbind(opts.prevNextEvent);}if(opts.prev){$(opts.prev).unbind(opts.prevNextEvent);}if(opts.pager||opts.pagerAnchorBuilder){$.each(opts.pagerAnchors||[],function(){this.unbind().remove();});}opts.pagerAnchors=null;if(opts.destroy){opts.destroy(opts);}}function buildOptions($cont,$slides,els,options,o){var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});if(opts.autostop){opts.countdown=opts.autostopCount||els.length;}var cont=$cont[0];$cont.data("cycle.opts",opts);opts.$cont=$cont;opts.stopCount=cont.cycleStop;opts.elements=els;opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});if(!$.support.opacity&&opts.cleartype){opts.after.push(function(){removeFilter(this,opts);});}if(opts.continuous){opts.after.push(function(){go(els,opts,0,(!opts.rev&&!opts.backwards));});}saveOriginalOpts(opts);if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($slides);}if($cont.css("position")=="static"){$cont.css("position","relative");}if(opts.width){$cont.width(opts.width);}if(opts.height&&opts.height!="auto"){$cont.height(opts.height);}if(opts.startingSlide){opts.startingSlide=parseInt(opts.startingSlide);}else{if(opts.backwards){opts.startingSlide=els.length-1;}}if(opts.random){opts.randomMap=[];for(var i=0;i<els.length;i++){opts.randomMap.push(i);}opts.randomMap.sort(function(a,b){return Math.random()-0.5;});opts.randomIndex=1;opts.startingSlide=opts.randomMap[1];}else{if(opts.startingSlide>=els.length){opts.startingSlide=0;}}opts.currSlide=opts.startingSlide||0;var first=opts.startingSlide;$slides.css({position:"absolute",top:0,left:0}).hide().each(function(i){var z;if(opts.backwards){z=first?i<=first?els.length+(i-first):first-i:els.length-i;}else{z=first?i>=first?els.length-(i-first):first-i:els.length-i;}$(this).css("z-index",z);});$(els[first]).css("opacity",1).show();removeFilter(els[first],opts);if(opts.fit&&opts.width){$slides.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}var reshape=opts.containerResize&&!$cont.innerHeight();if(reshape){var maxw=0,maxh=0;for(var j=0;j<els.length;j++){var $e=$(els[j]),e=$e[0],w=$e.outerWidth(),h=$e.outerHeight();if(!w){w=e.offsetWidth||e.width||$e.attr("width");}if(!h){h=e.offsetHeight||e.height||$e.attr("height");}maxw=w>maxw?w:maxw;maxh=h>maxh?h:maxh;}if(maxw>0&&maxh>0){$cont.css({width:maxw+"px",height:maxh+"px"});}}if(opts.pause){$cont.hover(function(){this.cyclePause++;},function(){this.cyclePause--;});}if(supportMultiTransitions(opts)===false){return false;}var requeue=false;options.requeueAttempts=options.requeueAttempts||0;$slides.each(function(){var $el=$(this);this.cycleH=(opts.fit&&opts.height)?opts.height:($el.height()||this.offsetHeight||this.height||$el.attr("height")||0);this.cycleW=(opts.fit&&opts.width)?opts.width:($el.width()||this.offsetWidth||this.width||$el.attr("width")||0);if($el.is("img")){var loadingIE=($.browser.msie&&this.cycleW==28&&this.cycleH==30&&!this.complete);var loadingFF=($.browser.mozilla&&this.cycleW==34&&this.cycleH==19&&!this.complete);var loadingOp=($.browser.opera&&((this.cycleW==42&&this.cycleH==19)||(this.cycleW==37&&this.cycleH==17))&&!this.complete);var loadingOther=(this.cycleH==0&&this.cycleW==0&&!this.complete);if(loadingIE||loadingFF||loadingOp||loadingOther){if(o.s&&opts.requeueOnImageNotLoaded&&++options.requeueAttempts<100){log(options.requeueAttempts," - img slide not loaded, requeuing slideshow: ",this.src,this.cycleW,this.cycleH);setTimeout(function(){$(o.s,o.c).cycle(options);},opts.requeueTimeout);requeue=true;return false;}else{log("could not determine size of image: "+this.src,this.cycleW,this.cycleH);}}}return true;});if(requeue){return false;}opts.cssBefore=opts.cssBefore||{};opts.animIn=opts.animIn||{};opts.animOut=opts.animOut||{};$slides.not(":eq("+first+")").css(opts.cssBefore);if(opts.cssFirst){$($slides[first]).css(opts.cssFirst);}if(opts.timeout){opts.timeout=parseInt(opts.timeout);if(opts.speed.constructor==String){opts.speed=$.fx.speeds[opts.speed]||parseInt(opts.speed);}if(!opts.sync){opts.speed=opts.speed/2;}var buffer=opts.fx=="shuffle"?500:250;
1663while((opts.timeout-opts.speed)<buffer){opts.timeout+=opts.speed;}}if(opts.easing){opts.easeIn=opts.easeOut=opts.easing;}if(!opts.speedIn){opts.speedIn=opts.speed;}if(!opts.speedOut){opts.speedOut=opts.speed;}opts.slideCount=els.length;opts.currSlide=opts.lastSlide=first;if(opts.random){if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.backwards){opts.nextSlide=opts.startingSlide==0?(els.length-1):opts.startingSlide-1;}else{opts.nextSlide=opts.startingSlide>=(els.length-1)?0:opts.startingSlide+1;}}if(!opts.multiFx){var init=$.fn.cycle.transitions[opts.fx];if($.isFunction(init)){init($cont,$slides,opts);}else{if(opts.fx!="custom"&&!opts.multiFx){log("unknown transition: "+opts.fx,"; slideshow terminating");return false;}}}var e0=$slides[first];if(opts.before.length){opts.before[0].apply(e0,[e0,e0,opts,true]);}if(opts.after.length>1){opts.after[1].apply(e0,[e0,e0,opts,true]);}if(opts.next){$(opts.next).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?-1:1);});}if(opts.prev){$(opts.prev).bind(opts.prevNextEvent,function(){return advance(opts,opts.rev?1:-1);});}if(opts.pager||opts.pagerAnchorBuilder){buildPager(els,opts);}exposeAddSlide(opts,els);return opts;}function saveOriginalOpts(opts){opts.original={before:[],after:[]};opts.original.cssBefore=$.extend({},opts.cssBefore);opts.original.cssAfter=$.extend({},opts.cssAfter);opts.original.animIn=$.extend({},opts.animIn);opts.original.animOut=$.extend({},opts.animOut);$.each(opts.before,function(){opts.original.before.push(this);});$.each(opts.after,function(){opts.original.after.push(this);});}function supportMultiTransitions(opts){var i,tx,txs=$.fn.cycle.transitions;if(opts.fx.indexOf(",")>0){opts.multiFx=true;opts.fxs=opts.fx.replace(/\s*/g,"").split(",");for(i=0;i<opts.fxs.length;i++){var fx=opts.fxs[i];tx=txs[fx];if(!tx||!txs.hasOwnProperty(fx)||!$.isFunction(tx)){log("discarding unknown transition: ",fx);opts.fxs.splice(i,1);i--;}}if(!opts.fxs.length){log("No valid transitions named; slideshow terminating.");return false;}}else{if(opts.fx=="all"){opts.multiFx=true;opts.fxs=[];for(p in txs){tx=txs[p];if(txs.hasOwnProperty(p)&&$.isFunction(tx)){opts.fxs.push(p);}}}}if(opts.multiFx&&opts.randomizeEffects){var r1=Math.floor(Math.random()*20)+30;for(i=0;i<r1;i++){var r2=Math.floor(Math.random()*opts.fxs.length);opts.fxs.push(opts.fxs.splice(r2,1)[0]);}debug("randomized fx sequence: ",opts.fxs);}return true;}function exposeAddSlide(opts,els){opts.addSlide=function(newSlide,prepend){var $s=$(newSlide),s=$s[0];if(!opts.autostopCount){opts.countdown++;}els[prepend?"unshift":"push"](s);if(opts.els){opts.els[prepend?"unshift":"push"](s);}opts.slideCount=els.length;$s.css("position","absolute");$s[prepend?"prependTo":"appendTo"](opts.$cont);if(prepend){opts.currSlide++;opts.nextSlide++;}if(!$.support.opacity&&opts.cleartype&&!opts.cleartypeNoBg){clearTypeFix($s);}if(opts.fit&&opts.width){$s.width(opts.width);}if(opts.fit&&opts.height&&opts.height!="auto"){$slides.height(opts.height);}s.cycleH=(opts.fit&&opts.height)?opts.height:$s.height();s.cycleW=(opts.fit&&opts.width)?opts.width:$s.width();$s.css(opts.cssBefore);if(opts.pager||opts.pagerAnchorBuilder){$.fn.cycle.createPagerAnchor(els.length-1,s,$(opts.pager),els,opts);}if($.isFunction(opts.onAddSlide)){opts.onAddSlide($s);}else{$s.hide();}};}$.fn.cycle.resetState=function(opts,fx){fx=fx||opts.fx;opts.before=[];opts.after=[];opts.cssBefore=$.extend({},opts.original.cssBefore);opts.cssAfter=$.extend({},opts.original.cssAfter);opts.animIn=$.extend({},opts.original.animIn);opts.animOut=$.extend({},opts.original.animOut);opts.fxFn=null;$.each(opts.original.before,function(){opts.before.push(this);});$.each(opts.original.after,function(){opts.after.push(this);});var init=$.fn.cycle.transitions[fx];if($.isFunction(init)){init(opts.$cont,$(opts.elements),opts);}};function go(els,opts,manual,fwd){if(manual&&opts.busy&&opts.manualTrump){debug("manualTrump in go(), stopping active transition");$(els).stop(true,true);opts.busy=false;}if(opts.busy){debug("transition active, ignoring new tx request");return;}var p=opts.$cont[0],curr=els[opts.currSlide],next=els[opts.nextSlide];if(p.cycleStop!=opts.stopCount||p.cycleTimeout===0&&!manual){return;}if(!manual&&!p.cyclePause&&!opts.bounce&&((opts.autostop&&(--opts.countdown<=0))||(opts.nowrap&&!opts.random&&opts.nextSlide<opts.currSlide))){if(opts.end){opts.end(opts);}return;}var changed=false;if((manual||!p.cyclePause)&&(opts.nextSlide!=opts.currSlide)){changed=true;var fx=opts.fx;curr.cycleH=curr.cycleH||$(curr).height();curr.cycleW=curr.cycleW||$(curr).width();next.cycleH=next.cycleH||$(next).height();next.cycleW=next.cycleW||$(next).width();if(opts.multiFx){if(opts.lastFx==undefined||++opts.lastFx>=opts.fxs.length){opts.lastFx=0;}fx=opts.fxs[opts.lastFx];opts.currFx=fx;}if(opts.oneTimeFx){fx=opts.oneTimeFx;opts.oneTimeFx=null;}$.fn.cycle.resetState(opts,fx);if(opts.before.length){$.each(opts.before,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});}var after=function(){$.each(opts.after,function(i,o){if(p.cycleStop!=opts.stopCount){return;}o.apply(next,[curr,next,opts,fwd]);});};debug("tx firing; currSlide: "+opts.currSlide+"; nextSlide: "+opts.nextSlide);opts.busy=1;if(opts.fxFn){opts.fxFn(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{if($.isFunction($.fn.cycle[opts.fx])){$.fn.cycle[opts.fx](curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}else{$.fn.cycle.custom(curr,next,opts,after,fwd,manual&&opts.fastOnEvent);}}}if(changed||opts.nextSlide==opts.currSlide){opts.lastSlide=opts.currSlide;if(opts.random){opts.currSlide=opts.nextSlide;if(++opts.randomIndex==els.length){opts.randomIndex=0;}opts.nextSlide=opts.randomMap[opts.randomIndex];if(opts.nextSlide==opts.currSlide){opts.nextSlide=(opts.currSlide==opts.slideCount-1)?0:opts.currSlide+1;}}else{if(opts.backwards){var roll=(opts.nextSlide-1)<0;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=1;opts.currSlide=0;}else{opts.nextSlide=roll?(els.length-1):opts.nextSlide-1;opts.currSlide=roll?0:opts.nextSlide+1;}}else{var roll=(opts.nextSlide+1)==els.length;if(roll&&opts.bounce){opts.backwards=!opts.backwards;opts.nextSlide=els.length-2;opts.currSlide=els.length-1;}else{opts.nextSlide=roll?0:opts.nextSlide+1;opts.currSlide=roll?els.length-1:opts.nextSlide-1;}}}}if(changed&&opts.pager){opts.updateActivePagerLink(opts.pager,opts.currSlide,opts.activePagerClass);}var ms=0;if(opts.timeout&&!opts.continuous){ms=getTimeout(els[opts.currSlide],els[opts.nextSlide],opts,fwd);}
1663else{if(opts.continuous&&p.cyclePause){ms=10;}}if(ms>0){p.cycleTimeout=setTimeout(function(){go(els,opts,0,(!opts.rev&&!opts.backwards));},ms);}}$.fn.cycle.updateActivePagerLink=function(pager,currSlide,clsName){$(pager).each(function(){$(this).children().removeClass(clsName).eq(currSlide).addClass(clsName);});};function getTimeout(curr,next,opts,fwd){if(opts.timeoutFn){var t=opts.timeoutFn.call(curr,curr,next,opts,fwd);while((t-opts.speed)<250){t+=opts.speed;}debug("calculated timeout: "+t+"; speed: "+opts.speed);if(t!==false){return t;}}return opts.timeout;}$.fn.cycle.next=function(opts){advance(opts,opts.rev?-1:1);};$.fn.cycle.prev=function(opts){advance(opts,opts.rev?1:-1);};function advance(opts,val){var els=opts.elements;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}if(opts.random&&val<0){opts.randomIndex--;if(--opts.randomIndex==-2){opts.randomIndex=els.length-2;}else{if(opts.randomIndex==-1){opts.randomIndex=els.length-1;}}opts.nextSlide=opts.randomMap[opts.randomIndex];}else{if(opts.random){opts.nextSlide=opts.randomMap[opts.randomIndex];}else{opts.nextSlide=opts.currSlide+val;if(opts.nextSlide<0){if(opts.nowrap){return false;}opts.nextSlide=els.length-1;}else{if(opts.nextSlide>=els.length){if(opts.nowrap){return false;}opts.nextSlide=0;}}}}var cb=opts.onPrevNextEvent||opts.prevNextClick;if($.isFunction(cb)){cb(val>0,opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,val>=0);return false;}function buildPager(els,opts){var $p=$(opts.pager);$.each(els,function(i,o){$.fn.cycle.createPagerAnchor(i,o,$p,els,opts);});opts.updateActivePagerLink(opts.pager,opts.startingSlide,opts.activePagerClass);}$.fn.cycle.createPagerAnchor=function(i,el,$p,els,opts){var a;if($.isFunction(opts.pagerAnchorBuilder)){a=opts.pagerAnchorBuilder(i,el);debug("pagerAnchorBuilder("+i+", el) returned: "+a);}else{a='<a href="#">'+(i+1)+"</a>";}if(!a){return;}var $a=$(a);if($a.parents("body").length===0){var arr=[];if($p.length>1){$p.each(function(){var $clone=$a.clone(true);$(this).append($clone);arr.push($clone[0]);});$a=$(arr);}else{$a.appendTo($p);}}opts.pagerAnchors=opts.pagerAnchors||[];opts.pagerAnchors.push($a);$a.bind(opts.pagerEvent,function(e){e.preventDefault();opts.nextSlide=i;var p=opts.$cont[0],timeout=p.cycleTimeout;if(timeout){clearTimeout(timeout);p.cycleTimeout=0;}var cb=opts.onPagerEvent||opts.pagerClick;if($.isFunction(cb)){cb(opts.nextSlide,els[opts.nextSlide]);}go(els,opts,1,opts.currSlide<i);});if(!/^click/.test(opts.pagerEvent)&&!opts.allowPagerClickBubble){$a.bind("click.cycle",function(){return false;});}if(opts.pauseOnPagerHover){$a.hover(function(){opts.$cont[0].cyclePause++;},function(){opts.$cont[0].cyclePause--;});}};$.fn.cycle.hopsFromLast=function(opts,fwd){var hops,l=opts.lastSlide,c=opts.currSlide;if(fwd){hops=c>l?c-l:opts.slideCount-l;}else{hops=c<l?l-c:l+opts.slideCount-c;}return hops;};function clearTypeFix($slides){debug("applying clearType background-color hack");function hex(s){s=parseInt(s).toString(16);return s.length<2?"0"+s:s;}function getBg(e){for(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){var v=$.css(e,"background-color");if(v.indexOf("rgb")>=0){var rgb=v.match(/\d+/g);return"#"+hex(rgb[0])+hex(rgb[1])+hex(rgb[2]);}if(v&&v!="transparent"){return v;}}return"#ffffff";}$slides.each(function(){$(this).css("background-color",getBg(this));});}$.fn.cycle.commonReset=function(curr,next,opts,w,h,rev){$(opts.elements).not(curr).hide();opts.cssBefore.opacity=1;opts.cssBefore.display="block";if(w!==false&&next.cycleW>0){opts.cssBefore.width=next.cycleW;}if(h!==false&&next.cycleH>0){opts.cssBefore.height=next.cycleH;}opts.cssAfter=opts.cssAfter||{};opts.cssAfter.display="none";$(curr).css("zIndex",opts.slideCount+(rev===true?1:0));$(next).css("zIndex",opts.slideCount+(rev===true?0:1));};$.fn.cycle.custom=function(curr,next,opts,cb,fwd,speedOverride){var $l=$(curr),$n=$(next);var speedIn=opts.speedIn,speedOut=opts.speedOut,easeIn=opts.easeIn,easeOut=opts.easeOut;$n.css(opts.cssBefore);if(speedOverride){if(typeof speedOverride=="number"){speedIn=speedOut=speedOverride;}else{speedIn=speedOut=1;}easeIn=easeOut=null;}var fn=function(){$n.animate(opts.animIn,speedIn,easeIn,cb);};$l.animate(opts.animOut,speedOut,easeOut,function(){if(opts.cssAfter){$l.css(opts.cssAfter);}if(!opts.sync){fn();}});if(opts.sync){fn();}};$.fn.cycle.transitions={fade:function($cont,$slides,opts){$slides.not(":eq("+opts.currSlide+")").css("opacity",0);opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.opacity=0;});opts.animIn={opacity:1};opts.animOut={opacity:0}
1663;opts.cssBefore={top:0,left:0};}};$.fn.cycle.ver=function(){return ver;};$.fn.cycle.defaults={fx:"fade",timeout:4000,timeoutFn:null,continuous:0,speed:1000,speedIn:null,speedOut:null,next:null,prev:null,onPrevNextEvent:null,prevNextEvent:"click.cycle",pager:null,onPagerEvent:null,pagerEvent:"click.cycle",allowPagerClickBubble:false,pagerAnchorBuilder:null,before:null,after:null,end:null,easing:null,easeIn:null,easeOut:null,shuffle:null,animIn:null,animOut:null,cssBefore:null,cssAfter:null,fxFn:null,height:"auto",startingSlide:0,sync:1,random:0,fit:0,containerResize:1,pause:0,pauseOnPagerHover:0,autostop:0,autostopCount:0,delay:0,slideExpr:null,cleartype:!$.support.opacity,cleartypeNoBg:false,nowrap:0,fastOnEvent:0,randomizeEffects:1,rev:0,manualTrump:true,requeueOnImageNotLoaded:true,requeueTimeout:250,activePagerClass:"activeSlide",updateActivePagerLink:null,backwards:false};})(jQuery);
1664/*
1665 * jQuery Cycle Plugin Transition Definitions
1666 * This script is a plugin for the jQuery Cycle Plugin
1667 * Examples and documentation at: http://malsup.com/jquery/cycle/
1668 * Copyright (c) 2007-2010 M. Alsup
1669 * Version:	 2.72
1670 * Dual licensed under the MIT and GPL licenses:
1671 * http://www.opensource.org/licenses/mit-license.php
1672 * http://www.gnu.org/licenses/gpl.html
1673 */
1674(function($){$.fn.cycle.transitions.none=function($cont,$slides,opts){opts.fxFn=function(curr,next,opts,after){$(next).show();$(curr).hide();after();};};$.fn.cycle.transitions.scrollUp=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssBefore={top:h,left:0};opts.cssFirst={top:0};opts.animIn={top:0};opts.animOut={top:-h};};$.fn.cycle.transitions.scrollDown=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var h=$cont.height();opts.cssFirst={top:0};opts.cssBefore={top:-h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.scrollLeft=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:0-w};};$.fn.cycle.transitions.scrollRight=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push($.fn.cycle.commonReset);var w=$cont.width();opts.cssFirst={left:0};opts.cssBefore={left:-w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.scrollHorz=function($cont,$slides,opts){$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.left=fwd?(next.cycleW-1):(1-next.cycleW);opts.animOut.left=fwd?-curr.cycleW:curr.cycleW;});opts.cssFirst={left:0};opts.cssBefore={top:0};opts.animIn={left:0};opts.animOut={top:0};};$.fn.cycle.transitions.scrollVert=function($cont,$slides,opts){$cont.css("overflow","hidden");opts.before.push(function(curr,next,opts,fwd){$.fn.cycle.commonReset(curr,next,opts);opts.cssBefore.top=fwd?(1-next.cycleH):(next.cycleH-1);opts.animOut.top=fwd?curr.cycleH:-curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0};opts.animIn={top:0};opts.animOut={left:0};};$.fn.cycle.transitions.slideX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;});opts.cssBefore={left:0,top:0,width:0};opts.animIn={width:"show"};opts.animOut={width:0};};$.fn.cycle.transitions.slideY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$(opts.elements).not(curr).hide();$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;});opts.cssBefore={left:0,top:0,height:0};opts.animIn={height:"show"};opts.animOut={height:0};};$.fn.cycle.transitions.shuffle=function($cont,$slides,opts){var i,w=$cont.css("overflow","visible").width();$slides.css({left:0,top:0});opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);});if(!opts.speedAdjusted){opts.speed=opts.speed/2;opts.speedAdjusted=true;}opts.random=0;opts.shuffle=opts.shuffle||{left:-w,top:15};opts.els=[];for(i=0;i<$slides.length;i++){opts.els.push($slides[i]);}for(i=0;i<opts.currSlide;i++){opts.els.push(opts.els.shift());}opts.fxFn=function(curr,next,opts,cb,fwd){var $el=fwd?$(curr):$(next);$(next).css(opts.cssBefore);var count=opts.slideCount;$el.animate(opts.shuffle,opts.speedIn,opts.easeIn,function(){var hops=$.fn.cycle.hopsFromLast(opts,fwd);for(var k=0;k<hops;k++){fwd?opts.els.push(opts.els.shift()):opts.els.unshift(opts.els.pop());}if(fwd){for(var i=0,len=opts.els.length;i<len;i++){$(opts.els[i]).css("z-index",len-i+count);}}else{var z=$(curr).css("z-index");$el.css("z-index",parseInt(z)+1+count);}$el.animate({left:0,top:0},opts.speedOut,opts.easeOut,function(){$(fwd?this:curr).hide();if(cb){cb();}});});};opts.cssBefore={display:"block",opacity:1,top:0,left:0};};$.fn.cycle.transitions.turnUp=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=next.cycleH;opts.animIn.height=next.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,height:0};opts.animIn={top:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnDown=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssFirst={top:0};opts.cssBefore={left:0,top:0,height:0};opts.animOut={height:0};};$.fn.cycle.transitions.turnLeft=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=next.cycleW;opts.animIn.width=next.cycleW;});opts.cssBefore={top:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.turnRight=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={top:0,left:0,width:0};opts.animIn={left:0};opts.animOut={width:0};};$.fn.cycle.transitions.zoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false,true);opts.cssBefore.top=next.cycleH/2;opts.cssBefore.left=next.cycleW/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};opts.animOut={width:0,height:0,top:curr.cycleH/2,left:curr.cycleW/2};});opts.cssFirst={top:0,left:0};opts.cssBefore={width:0,height:0};};$.fn.cycle.transitions.fadeZoom=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,false);opts.cssBefore.left=next.cycleW/2;opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,left:0,width:next.cycleW,height:next.cycleH};});opts.cssBefore={width:0,height:0};opts.animOut={opacity:0}
1674;};$.fn.cycle.transitions.blindX=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.width=next.cycleW;opts.animOut.left=curr.cycleW;});opts.cssBefore={left:w,top:0};opts.animIn={left:0};opts.animOut={left:w};};$.fn.cycle.transitions.blindY=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:0};opts.animIn={top:0};opts.animOut={top:h};};$.fn.cycle.transitions.blindZ=function($cont,$slides,opts){var h=$cont.css("overflow","hidden").height();var w=$cont.width();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);opts.animIn.height=next.cycleH;opts.animOut.top=curr.cycleH;});opts.cssBefore={top:h,left:w};opts.animIn={top:0,left:0};opts.animOut={top:h,left:w};};$.fn.cycle.transitions.growX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true);opts.cssBefore.left=this.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:0};});opts.cssBefore={width:0,top:0};};$.fn.cycle.transitions.growY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false);opts.cssBefore.top=this.cycleH/2;opts.animIn={top:0,height:this.cycleH};opts.animOut={top:0};});opts.cssBefore={height:0,left:0};};$.fn.cycle.transitions.curtainX=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,false,true,true);opts.cssBefore.left=next.cycleW/2;opts.animIn={left:0,width:this.cycleW};opts.animOut={left:curr.cycleW/2,width:0};});opts.cssBefore={top:0,width:0};};$.fn.cycle.transitions.curtainY=function($cont,$slides,opts){opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,false,true);opts.cssBefore.top=next.cycleH/2;opts.animIn={top:0,height:next.cycleH};opts.animOut={top:curr.cycleH/2,height:0};});opts.cssBefore={left:0,height:0};};$.fn.cycle.transitions.cover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts);if(d=="right"){opts.cssBefore.left=-w;}else{if(d=="up"){opts.cssBefore.top=h;}else{if(d=="down"){opts.cssBefore.top=-h;}else{opts.cssBefore.left=w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.uncover=function($cont,$slides,opts){var d=opts.direction||"left";var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(d=="right"){opts.animOut.left=w;}else{if(d=="up"){opts.animOut.top=-h;}else{if(d=="down"){opts.animOut.top=h;}else{opts.animOut.left=-w;}}}});opts.animIn={left:0,top:0};opts.animOut={opacity:1};opts.cssBefore={top:0,left:0};};$.fn.cycle.transitions.toss=function($cont,$slides,opts){var w=$cont.css("overflow","visible").width();var h=$cont.height();opts.before.push(function(curr,next,opts){$.fn.cycle.commonReset(curr,next,opts,true,true,true);if(!opts.animOut.left&&!opts.animOut.top){opts.animOut={left:w*2,top:-h/2,opacity:0};}else{opts.animOut.opacity=0;}});opts.cssBefore={left:0,top:0};opts.animIn={left:0};};$.fn.cycle.transitions.wipe=function($cont,$slides,opts){var w=$cont.css("overflow","hidden").width();var h=$cont.height();opts.cssBefore=opts.cssBefore||{};var clip;if(opts.clip){if(/l2r/.test(opts.clip)){clip="rect(0px 0px "+h+"px 0px)";}else{if(/r2l/.test(opts.clip)){clip="rect(0px "+w+"px "+h+"px "+w+"px)";}else{if(/t2b/.test(opts.clip)){clip="rect(0px "+w+"px 0px 0px)";}else{if(/b2t/.test(opts.clip)){clip="rect("+h+"px "+w+"px "+h+"px 0px)";}else{if(/zoom/.test(opts.clip)){var top=parseInt(h/2);var left=parseInt(w/2);clip="rect("+top+"px "+left+"px "+top+"px "+left+"px)";}}}}}}opts.cssBefore.clip=opts.cssBefore.clip||clip||"rect(0px 0px 0px 0px)";var d=opts.cssBefore.clip.match(/(\d+)/g);
1674var t=parseInt(d[0]),r=parseInt(d[1]),b=parseInt(d[2]),l=parseInt(d[3]);opts.before.push(function(curr,next,opts){if(curr==next){return;}var $curr=$(curr),$next=$(next);$.fn.cycle.commonReset(curr,next,opts,true,true,false);opts.cssAfter.display="block";var step=1,count=parseInt((opts.speedIn/13))-1;(function f(){var tt=t?t-parseInt(step*(t/count)):0;var ll=l?l-parseInt(step*(l/count)):0;var bb=b<h?b+parseInt(step*((h-b)/count||1)):h;var rr=r<w?r+parseInt(step*((w-r)/count||1)):w;$next.css({clip:"rect("+tt+"px "+rr+"px "+bb+"px "+ll+"px)"});(step++<=count)?setTimeout(f,13):$curr.css("display","none");})();});opts.cssBefore={display:"block",opacity:1,top:0,left:0};opts.animIn={left:0};opts.animOut={left:0};};})(jQuery);;
1675// $Id: views_slideshow.js,v 1.1.2.1.2.39 2010/07/01 03:29:08 redndahead Exp $
1676
1677/**
1678 *  @file
1679 *  A simple jQuery SingleFrame Div Slideshow Rotator.
1680 */
1681
1682/**
1683 * This will set our initial behavior, by starting up each individual slideshow.
1684 */
1685Drupal.behaviors.viewsSlideshowSingleFrame = function (context) {
1686  $('.views_slideshow_singleframe_main:not(.viewsSlideshowSingleFrame-processed)', context).addClass('viewsSlideshowSingleFrame-processed').each(function() {
1687    var fullId = '#' + $(this).attr('id');
1688    var settings = Drupal.settings.viewsSlideshowSingleFrame[fullId];
1689    settings.targetId = '#' + $(fullId + " :first").attr('id');
1690    settings.paused = false;
1691
1692    settings.opts = {
1693      speed:settings.speed,
1694      timeout:parseInt(settings.timeout),
1695      delay:parseInt(settings.delay),
1696      sync:settings.sync==1,
1697      random:settings.random==1,
1698      pause:false,
1699      allowPagerClickBubble:(settings.pager_hover==1 || settings.pager_click_to_page),
1700      prev:(settings.controls > 0)?'#views_slideshow_singleframe_prev_' + settings.vss_id:null,
1701      next:(settings.controls > 0)?'#views_slideshow_singleframe_next_' + settings.vss_id:null,
1702      pager:(settings.pager > 0)?'#views_slideshow_singleframe_pager_' + settings.vss_id:null,
1703      nowrap:parseInt(settings.nowrap),
1704      pagerAnchorBuilder: function(idx, slide) {
1705        var classes = 'pager-item pager-num-' + (idx+1);
1706        if (idx == 0) {
1707          classes += ' first';
1708        }
1709        if ($(slide).siblings().length == idx) {
1710          classes += ' last';
1711        }
1712
1713        if (idx % 2) {
1714          classes += ' odd';
1715        }
1716        else {
1717          classes += ' even';
1718        }
1719        
1720        var theme = 'viewsSlideshowPager' + settings.pager_type;
1721        return Drupal.theme.prototype[theme] ? Drupal.theme(theme, classes, idx, slide, settings) : '';
1722      },
1723      after:function(curr, next, opts) {
1724        // Used for Image Counter.
1725        if (settings.image_count) {
1726          $('#views_slideshow_singleframe_image_count_' + settings.vss_id + ' span.num').html(opts.currSlide + 1);
1727          $('#views_slideshow_singleframe_image_count_' + settings.vss_id + ' span.total').html(opts.slideCount);
1728        }
1729      },
1730      before:function(curr, next, opts) {
1731        // Remember last slide.
1732        if (settings.remember_slide) {
1733          createCookie(settings.vss_id, opts.currSlide + 1, settings.remember_slide_days);
1734        }
1735
1736        // Make variable height.
1737        if (settings.fixed_height == 0) {
1738          //get the height of the current slide
1739          var $ht = $(this).height();
1740          //set the container's height to that of the current slide
1741          $(this).parent().animate({height: $ht});
1742        }
1743      },
1744      cleartype:(settings.ie.cleartype == 'true')? true : false,
1745      cleartypeNoBg:(settings.ie.cleartypenobg == 'true')? true : false
1746    }
1747    
1748    // Set the starting slide if we are supposed to remember the slide
1749    if (settings.remember_slide) {
1750      var startSlide = readCookie(settings.vss_id);
1751      if (startSlide == null) {
1752        startSlide = 0;
1753      }
1754      settings.opts.startingSlide =  startSlide;
1755    }
1756
1757    if (settings.pager_hover == 1) {
1758      settings.opts.pagerEvent = 'mouseover';
1759      settings.opts.pauseOnPagerHover = true;
1760    }
1761
1762    if (settings.effect == 'none') {
1763      settings.opts.speed = 1;
1764    }
1765    else {
1766      settings.opts.fx = settings.effect;
1767    }
1768
1769    // Pause on hover.
1770    if (settings.pause == 1) {
1771      $('#views_slideshow_singleframe_teaser_section_' + settings.vss_id).hover(function() {
1772        $(settings.targetId).cycle('pause');
1773      }, function() {
1774        if (settings.paused == false) {
1775          $(settings.targetId).cycle('resume');
1776        }
1777      });
1778    }
1779
1780    // Pause on clicking of the slide.
1781    if (settings.pause_on_click == 1) {
1782      $('#views_slideshow_singleframe_teaser_section_' + settings.vss_id).click(function() { 
1783        viewsSlideshowSingleFramePause(settings);
1784      });
1785    }
1786
1787    // Add additional settings.
1788		if (settings.advanced != "\n") {
1789      var advanced = settings.advanced.split("\n");
1790      for (i=0; i<advanced.length; i++) {
1791        var prop = '';
1792        var value = '';
1793        var property = advanced[i].split(":");
1794        for (j=0; j<property.length; j++) {
1795          if (j == 0) {
1796            prop = property[j];
1797          }
1798          else if (j == 1) {
1799            value = property[j];
1800          }
1801          else {
1802            value += ":" + property[j];
1803          }
1804        }
1805
1806        // Need to evaluate so true, false and numerics aren't a string.
1807        if (value == 'true' || value == 'false' || IsNumeric(value)) {
1808          value = eval(value);
1809        }
1810        else {
1811          // Parse strings into functions.
1812          var func = value.match(/function\s*\((.*?)\)\s*\{(.*)\}/i);
1813          if (func) {
1814            value = new Function(func[1].match(/(\w+)/g), func[2]);
1815          }
1816        }
1817	
1818        // Call both functions if prop was set previously.
1819        if (typeof(value) == "function" && prop in settings.opts) {
1820          var callboth = function(before_func, new_func) {
1821            return function() {
1822              before_func.apply(null, arguments);
1823              new_func.apply(null, arguments);
1824            };
1825          };
1826          settings.opts[prop] = callboth(settings.opts[prop], value);
1827        }
1828        else {
1829          settings.opts[prop] = value;
1830        }
1831      }
1832    }
1833    
1834    $(settings.targetId).cycle(settings.opts);
1835
1836    // Start Paused
1837    if (settings.start_paused) {
1838      viewsSlideshowSingleFramePause(settings);
1839    }
1840    
1841    // Pause if hidden.
1842    if (settings.pause_when_hidden) {
1843      var checkPause = function(settings) {
1844        // If the slideshow is visible and it is paused then resume.
1845        // otherwise if the slideshow is not visible and it is not paused then
1846        // pause it.
1847        var visible = viewsSlideshowSingleFrameIsVisible(settings.targetId, settings.pause_when_hidden_type, settings.amount_allowed_visible);
1848        if (visible && settings.paused) {
1849          viewsSlideshowSingleFrameResume(settings);
1850        }
1851        else if (!visible && !settings.paused) {
1852          viewsSlideshowSingleFramePause(settings);
1853        }
1854      }
1855     
1856      // Check when scrolled.
1857      $(window).scroll(function() {
1858       checkPause(settings);
1859      });
1860      
1861      // Check when the window is resized.
1862      $(window).resize(function() {
1863        checkPause(settings);
1864      });
1865    }
1866
1867    // Show image count for people who have js enabled.
1868    $('#views_slideshow_singleframe_image_count_' + settings.vss_id).show();
1869
1870    if (settings.controls > 0) {
1871      // Show controls for people who have js enabled browsers.
1872      $('#views_slideshow_singleframe_controls_' + settings.vss_id).show();
1873      
1874      $('#views_slideshow_singleframe_playpause_' + settings.vss_id).click(function(e) {
1875      	if (settings.paused) {
1876      	  viewsSlideshowSingleFrameResume(settings);
1877      	}
1878      	else {
1879      	  viewsSlideshowSingleFramePause(settings);
1880      	}
1881        e.preventDefault();
1882      });
1883    }
1884  });
1885}
1886
1887// Pause the slideshow 
1888viewsSlideshowSingleFramePause = function (settings) {
1889  //make Resume translatable
1890  var resume = Drupal.t('Resume');
1891
1892  $(settings.targetId).cycle('pause');
1893  if (settings.controls > 0) {
1894    $('#views_slideshow_singleframe_playpause_' + settings.vss_id)
1895      .addClass('views_slideshow_singleframe_play')
1896      .addClass('views_slideshow_play')
1897      .removeClass('views_slideshow_singleframe_pause')
1898      .removeClass('views_slideshow_pause')
1899      .text(resume);
1900  }
1901  settings.paused = true;
1902}
1903
1904// Resume the slideshow
1905viewsSlideshowSingleFrameResume = function (settings) {
1906  $(settings.targetId).cycle('resume');
1907  if (settings.controls > 0) {
1908    $('#views_slideshow_singleframe_playpause_' + settings.vss_id)
1909      .addClass('views_slideshow_singleframe_pause')
1910      .addClass('views_slideshow_pause')
1911      .removeClass('views_slideshow_singleframe_play')
1912      .removeClass('views_slideshow_play')
1913      .text('Pause');
1914  }
1915  settings.paused = false;
1916}
1917
1918Drupal.theme.prototype.viewsSlideshowPagerThumbnails = function (classes, idx, slide, settings) {
1919  var href = '#';
1920  if (settings.pager_click_to_page) {
1921    href = $(slide).find('a').attr('href');
1922  }
1923  return '<div class="' + classes + '"><a href="' + href + '"><img src="' + $(slide).find('img').attr('src') + '" /></a></div>';
1924}
1925
1926Drupal.theme.prototype.viewsSlideshowPagerNumbered = function (classes, idx, slide, settings) {
1927  var href = '#';
1928  if (settings.pager_click_to_page) {
1929    href = $(slide).find('a').attr('href');
1930  }
1931  return '<div class="' + classes + '"><a href="' + href + '">' + (idx+1) + '</a></div>';
1932}
1933
1934// Verify that the value is a number.
1935function IsNumeric(sText) {
1936  var ValidChars = "0123456789";
1937  var IsNumber=true;
1938  var Char;
1939
1940  for (var i=0; i < sText.length && IsNumber == true; i++) { 
1941    Char = sText.charAt(i); 
1942    if (ValidChars.indexOf(Char) == -1) {
1943      IsNumber = false;
1944    }
1945  }
1946  return IsNumber;
1947}
1948
1949/**
1950 * Cookie Handling Functions
1951 */
1952function createCookie(name,value,days) {
1953  if (days) {
1954    var date = new Date();
1955    date.setTime(date.getTime()+(days*24*60*60*1000));
1956    var expires = "; expires="+date.toGMTString();
1957  }
1958  else {
1959    var expires = "";
1960  }
1961  document.cookie = name+"="+value+expires+"; path=/";
1962}
1963
1964function readCookie(name) {
1965  var nameEQ = name + "=";
1966  var ca = document.cookie.split(';');
1967  for(var i=0;i < ca.length;i++) {
1968    var c = ca[i];
1969    while (c.charAt(0)==' ') c = c.substring(1,c.length);
1970    if (c.indexOf(nameEQ) == 0) {
1971      return c.substring(nameEQ.length,c.length);
1972    }
1973  }
1974  return null;
1975}
1976
1977function eraseCookie(name) {
1978  createCookie(name,"",-1);
1979}
1980
1981/**
1982 * Checks to see if the slide is visible enough.
1983 * elem = element to check.
1984 * type = The way to calculate how much is visible.
1985 * amountVisible = amount that should be visible. Either in percent or px. If
1986 *                it's not defined then all of the slide must be visible.
1987 *
1988 * Returns true or false
1989 */
1990function viewsSlideshowSingleFrameIsVisible(elem, type, amountVisible) {
1991  // Get the top and bottom of the window;
1992  var docViewTop = $(window).scrollTop();
1993  var docViewBottom = docViewTop + $(window).height();
1994  var docViewLeft = $(window).scrollLeft();
1995  var docViewRight = docViewLeft + $(window).width();
1996
1997  // Get the top, bottom, and height of the slide;
1998  var elemTop = $(elem).offset().top;
1999  var elemHeight = $(elem).height();
2000  var elemBottom = elemTop + elemHeight;
2001  var elemLeft = $(elem).offset().left;
2002  var elemWidth = $(elem).width();
2003  var elemRight = elemLeft + elemWidth;
2004  var elemArea = elemHeight * elemWidth;
2005  
2006  // Calculate what's hiding in the slide.
2007  var missingLeft = 0;
2008  var missingRight = 0;
2009  var missingTop = 0;
2010  var missingBottom = 0;
2011  
2012  // Find out how much of the slide is missing from the left.
2013  if (elemLeft < docViewLeft) {
2014    missingLeft = docViewLeft - elemLeft;
2015  }
2016
2017  // Find out how much of the slide is missing from the right.
2018  if (elemRight > docViewRight) {
2019    missingRight = elemRight - docViewRight;
2020  }
2021  
2022  // Find out how much of the slide is missing from the top.
2023  if (elemTop < docViewTop) {
2024    missingTop = docViewTop - elemTop;
2025  }
2026
2027  // Find out how much of the slide is missing from the bottom.
2028  if (elemBottom > docViewBottom) {
2029    missingBottom = elemBottom - docViewBottom;
2030  }
2031  
2032  // If there is no amountVisible defined then check to see if the whole slide
2033  // is visible.
2034  if (type == 'full') {
2035    return ((elemBottom >= docViewTop) && (elemTop <= docViewBottom)
2036    && (elemBottom <= docViewBottom) &&  (elemTop >= docViewTop)
2037    && (elemLeft >= docViewLeft) && (elemRight <= docViewRight)
2038    && (elemLeft <= docViewRight) && (elemRight >= docViewLeft));
2039  }
2040  else if(type == 'vertical') {
2041    var verticalShowing = elemHeight - missingTop - missingBottom;
2042    
2043    // If user specified a percentage then find out if the current shown percent
2044    // is larger than the allowed percent.
2045    // Otherwise check to see if the amount of px shown is larger than the
2046    // allotted amount.
2047    if (amountVisible.indexOf('%')) {
2048      return (((verticalShowing/elemHeight)*100) >= parseInt(amountVisible));
2049    }
2050    else {
2051      return (verticalShowing >= parseInt(amountVisible));
2052    }
2053  }
2054  else if(type == 'horizontal') {
2055    var horizontalShowing = elemWidth - missingLeft - missingRight;
2056    
2057    // If user specified a percentage then find out if the current shown percent
2058    // is larger than the allowed percent.
2059    // Otherwise check to see if the amount of px shown is larger than the
2060    // allotted amount.
2061    if (amountVisible.indexOf('%')) {
2062      return (((horizontalShowing/elemWidth)*100) >= parseInt(amountVisible));
2063    }
2064    else {
2065      return (horizontalShowing >= parseInt(amountVisible));
2066    }
2067  }
2068  else if(type == 'area') {
2069    var areaShowing = (elemWidth - missingLeft - missingRight) * (elemHeight - missingTop - missingBottom);
2070    
2071    // If user specified a percentage then find out if the current shown percent
2072    // is larger than the allowed percent.
2073    // Otherwise check to see if the amount of px shown is larger than the
2074    // allotted amount.
2075    if (amountVisible.indexOf('%')) {
2076      return (((areaShowing/elemArea)*100) >= parseInt(amountVisible));
2077    }
2078    else {
2079      return (areaShowing >= parseInt(amountVisible));
2080    }
2081  }
2082}
2083
2084;
2085// $Id: openapi.js,v 1.14 2010/10/06 19:35:51 romka Exp $
2086var
2087  vk_members_data = {},
2088  lastCommentsResponse,
2089  lastCommentsPage = null,
2090  baseURL = window.location.protocol + '//' + window.location.hostname + '/';
2091
2092function array_unique(ar){
2093  if (ar.length && typeof ar !== 'string') {
2094    var sorter = {};
2095    var out = [];
2096    for (var i=0, j=ar.length; i<j; i++) {
2097      if(!sorter[ar[i]+typeof ar[i]]){
2098        out.push(ar[i]);
2099        sorter[ar[i]+typeof ar[i]]=true;
2100      }
2101    }
2102  }
2103  return out || ar;
2104}
2105
2106function doLogin() {
2107  VK.Auth.login(getInitData);
2108}
2109
2110function doUnite() {
2111  VK.Auth.login(uniteGetInitData);
2112}
2113
2114/*
2115function doLogout() {
2116  VK.Auth.logout(logoutOpenAPI);
2117}
2118*/
2119function loginOpenAPI() {
2120  getInitData();
2121}
2122
2123function logoutOpenAPI() {
2124  window.location = baseURL;
2125}
2126
2127function getInitData() {
2128  var code;
2129  code = 'return {';
2130  code += 'me: API.getProfiles({uids: API.getVariable({key: 1280})})[0]';
2131  /*
2132    ,sex,bdate,city,country,timezone,photo,photo_medium,photo_big,has_mobile,rate,contacts,education,home_phone,mobile_phone,university,university_name,faculty,faculty_name,graduation
2133  */
2134  code += '};';
2135  VK.Api.call('execute', {'code': code}, onGetInitData);
2136}
2137
2138function uniteGetInitData() {
2139  var code;
2140  code = 'return {';
2141  code += 'me: API.getProfiles({uids: API.getVariable({key: 1280})})[0]';
2142  /*
2143    ,sex,bdate,city,country,timezone,photo,photo_medium,photo_big,has_mobile,rate,contacts,education,home_phone,mobile_phone,university,university_name,faculty,faculty_name,graduation
2144  */
2145  code += '};';
2146  VK.Api.call('execute', {'code': code}, uniteOnGetInitData);
2147}
2148
2149
2150function onGetInitData(data) {
2151  var r, i, j, html;
2152  if (data.response) {
2153    r = data.response;
2154    /* Insert user info */
2155    if (r.me) {
2156      $.ajax({
2157        cache: false,
2158        data: {uid: r.me.uid, first_name: r.me.first_name, last_name: r.me.last_name, nickname: r.me.nickname},
2159        dataType: 'json',
2160        success: function(data) { succesLogin(data); },
2161        error: function(data) { succesLogin(data); },
2162        type: 'POST',
2163		    url: Drupal.settings.basePath + 'vk/login'
2164      });
2165    }    
2166  } else {
2167    window.location = baseURL + 'vk/login/error';
2168  }
2169}
2170
2171function uniteOnGetInitData(data) {
2172  var r, i, j, html;
2173  if (data.response) {
2174    r = data.response;
2175    /* Insert user info */
2176    if (r.me) {
2177      $.ajax({
2178        cache: false,
2179        data: {uid: r.me.uid, first_name: r.me.first_name, last_name: r.me.last_name, nickname: r.me.nickname},
2180        dataType: 'json',
2181        success: function(data) { succesLogin(data); },
2182        error: function(data) { errorLogin(data); },
2183        type: 'POST',
2184		    url: Drupal.settings.basePath + 'vk/succesfull-unite'
2185      });
2186    }    
2187  } else {
2188    window.location = baseURL + 'vk/error-unite';
2189  }
2190}
2191
2192function succesLogin(data) {
2193	if(data.error) {
2194		alert(data.message);
2195	}
2196  //console.log(data);
2197	/*----begin----*/
2198	//window.location = baseURL + 'checkout/personal';// + data.redirect_url;
2199	window.location = baseURL + 'user';// + data.redirect_url;
2200	/*----end----*/
2201}
2202
2203function errorLogin(data) {
2204	if(data.error) {
2205		alert(data.message);
2206	}
2207	//alert('Error connecting to server.');
2208	window.location = baseURL + 'checkout/personal';
2209}
2210
2211/*
2212function onGetStatus(data) {
2213  alert('try to set status');
2214  if (data.response) {
2215    r = data.response;
2216    alert(r.me.activity);
2217  }
2218}
2219*/;
2220
2221Drupal.behaviors.delphis_up_down_widget = function(context) {
2222  $(".up-down-widget .up-inactive").click(function(){
2223    if ($(this).hasClass('delphis-processed') == false) {
2224      $(this).removeClass("up-inactive").addClass("up-active").addClass("delphis-processed");
2225      var $count = $(this).parents(".comment-attr").find(".rating");
2226      var cur = $count.html();
2227      cur = parseInt(cur.substring(1, cur.length - 1));
2228      cur = cur + 1;
2229      $count.html('(' +  cur + ')');
2230    }
2231  });
2232  /*$(".up-down-node .up-inactive").click(function(){
2233    if ($(this).hasClass('delphis-processed-node') == false) {
2234      $(this).removeClass("up-inactive").addClass("up-active").addClass("delphis-processed-node");
2235      var $count = $(this).parents(".votes-attr").find(".rating-node");
2236      var cur = $count.html();
2237      cur = parseInt(cur.substring(1, cur.length - 1));
2238      cur = cur + 1;
2239      $count.html('(' +  cur + ')');
2240      //---- omniweb added --------
2241      var $countB = $(this).parents(".book-vote").find(".rating-node");
2242      var curB = $countB.html();
2243      curB = parseInt(curB.substring(1, curB.length - 1));
2244      curB = curB + 1;
2245      $countB.html('(' +  curB + ')');
2246      //--------------------------
2247    }
2248  });*/
2249      //---- omniweb added --------
2250  $(".votes-attr .up-down-node .up-inactive").click(function(){
2251    if ($(this).hasClass('delphis-processed-node') == false) {
2252      $(this).removeClass("up-inactive").addClass("up-active").addClass("delphis-processed-node");
2253	  $(this).title = 'Вы проголосовали';
2254      var $count = $(this).parents(".votes-attr").find(".rating-node");
2255      var cur = $count.html();
2256      cur = parseInt(cur.substring(1, cur.length - 1));
2257      cur = cur + 1;
2258      $count.html('(' +  cur + ')');
2259    }
2260  });
2261  $(".book-vote .up-down-node .up-inactive").click(function(){
2262    if ($(this).hasClass('delphis-processed-node') == false) {
2263      $(this).removeClass("up-inactive").addClass("up-active").addClass("delphis-processed-node");
2264	  $(this).title = 'Вы проголосовали';
2265      var $count = $(this).parents(".book-vote").find(".rating-node");
2266      var cur = $count.html();
2267      cur = parseInt(cur.substring(1, cur.length - 1));
2268      cur = cur + 1;
2269      $count.html('(' +  cur + ')');
2270    }
2271  });
2272      //--------------------------
2273}
2274
2275Drupal.behaviors.delphis_module = function(context) {
2276  $("#robokassa-redirect-form").submit();
2277  $("#mail-ru-auth-finalize-anon-form").submit();
2278
2279  var $form = $("#delphis-book-cart-catalog-sort-form");
2280  $form.find("input[type=submit]").hide();
2281  $form.find("select[name=custom_sort]").change(function() {
2282    $form.submit()
2283  });
2284  $form.find("select[name=catalog_term_sort]").change(function() {
2285    $form.submit();
2286  });
2287};
2288
2289
2290Drupal.behaviors.delphis_uc_cart = function(context) {
2291  var delphis_uc_cart_options = {
2292    success: delphis_uc_cart_options_success
2293  };
2294  /*---begin (539)---*/
2295  /*$("form[id^=uc-product-add-to-cart-form-]").submit(function() {
2296    //$(this).parent().animate({opacity: 0.3});
2297    $(this).ajaxSubmit(delphis_uc_cart_options);
2298    $(".block-basket-image a").removeClass('block-basket-link-empty');
2299    $(this).find("input[name=op]").val(Drupal.t("In basket"));
2300    var add = parseInt($(this).find("input[name=qty]").val());
2301    add = add > 1 ? add : 1;
2302    var cur = $(".block-basket-count").html();
2303    cur = parseInt(cur.substring(1, cur.length - 1));
2304    var tot = add + cur;
2305    $(".block-basket-count").html('(' +  tot + ')');
2306    return false;
2307  });*/
2308  $("form[id^=uc-product-add-to-cart-form-]").submit(function() {
2309	$("body").append('<div id="cart_add_popup_overlay">&nbsp;</div>');
2310	//$(this).find(".button-wrapper").append('<span class="add_prod_busy"></span>');
2311	$("body").append('<div class="cart_add_popup_info"></div>');
2312	$(".cart_add_popup_info").append('<span class="add_prod_busy">' + Drupal.t("Item adding to cart") + '...' + '</span>');
2313	$(this).ajaxSubmit(delphis_uc_cart_options);
2314    //$(this).find("input[name=op]").val(Drupal.t("Item added to cart") + '...');
2315    return false;
2316  });
2317  /*---end 539---*/
2318}
2319
2320function delphis_uc_cart_options_success(data, statusText, xhr, $form) {
2321  //alert(Drupal.t("Product has been added to your cart!"));
2322  //$form.parent().animate({opacity: 1});
2323  /*---begin (539)---*/
2324  $('.block-basket').load(Drupal.settings.basePath + 'ajax/cartkol');
2325  //$($form).find(".add_prod_busy").remove();
2326  $(".cart_add_popup_info").remove();
2327  //string below uses for jquery.form 2.49
2328  //$($form).find("input[name=op]").val(Drupal.t("In basket"));
2329  //string below uses for jquery.form 2.36
2330  $(xhr).find("input[name=op]").val(Drupal.t("In basket"));
2331  $("#cart_add_popup_overlay").remove();
2332  /*---end 539---*/
2333}
2334
2335$(document).ready(function() {
2336	/*---begin (477)---*/
2337  //var $div = $(".node-type-book #comments");
2338  var $div = $(".page-node #comments");
2339  /*---end---*/
2340  if ($div) {
2341    var $box = $div.find(".box");
2342    $box.hide();
2343	/*---begin (477)---*/
2344	//$("a.add-comments").click(function(){
2345    $(".logged-in a.add-comments").click(function(){
2346		arr = this.href.split('#');
2347		//arr = arr[0].split('/');
2348		$('#comment-form').attr('action', arr[0]);
2349	/*---end---*/
2350      delphis_comment_popup($div, $box);
2351      return false;
2352    });
2353	/*---begin (477)---*/
2354    $(".logged-in a.comment-reply-link").click(function(){
2355		arr = this.href.split('/');
2356		n = arr.length;
2357		par = arr[n-2]+'_'+arr[n-1];
2358		$('#comment-form').attr('action', Drupal.settings.basePath+'comm_save?ids='+par);
2359      delphis_comment_popup($div, $box);
2360      return false;
2361    });
2362	/*---end---*/
2363    if (typeof(Drupal.settings.delphis) != 'undefined') {
2364      if (typeof(Drupal.settings.delphis.comment_popup) != 'undefined') {
2365        delphis_comment_popup($div, $box);
2366      }
2367    }
2368  }
2369  /*---begin (477)---*/
2370  ac = getCookie('addcomm');
2371  if (ac == 2) {
2372	$(".logged-in a.add-comments").trigger('click');
2373	delCookie("addcomm");
2374	pth = location.href;
2375	pth = pth + '#cmnts';
2376	window.location.replace(pth);
2377  } else if (ac == 4) {
2378	rc = getCookie('replaycomm');
2379	$(".logged-in a#"+rc).trigger('click');
2380	delCookie("addcomm");
2381	delCookie("replaycomm");
2382	pth = location.href;
2383	pth = pth + '#cmnts';
2384	window.location.replace(pth);
2385  }
2386  /*---end---*/
2387});
2388
2389function delphis_comment_popup($div, $box) {
2390  var cancel = Drupal.t('Discard');
2391  $div.append('<div id="delphis_popup_overlay">&nbsp;</div>');
2392  $box.find("form div:first").append('<a class="close" href="#">
2392' + cancel + '</a>');
2393  $box.show();
2394
2395  $("#delphis_popup_overlay").click(function(){
2396    $box.hide();
2397    $("#delphis_popup_overlay").remove();
2398    $box.find("a.close").remove();
2399  });
2400
2401  $box.find("a.close").click(function(){
2402    $box.hide();
2403    $("#delphis_popup_overlay").remove();
2404    $box.find("a.close").remove();
2405    return false;
2406  });
2407};
2408// $Id: base.js,v 1.11.2.1 2010/03/10 20:08:58 merlinofchaos Exp $
2409/**
2410 * @file base.js
2411 *
2412 * Some basic behaviors and utility functions for Views.
2413 */
2414
2415Drupal.Views = {};
2416
2417/**
2418 * jQuery UI tabs, Views integration component
2419 */
2420Drupal.behaviors.viewsTabs = function (context) {
2421  $('#views-tabset:not(.views-processed)').addClass('views-processed').each(function() {
2422    new Drupal.Views.Tabs($(this), {selectedClass: 'active'});
2423  });
2424
2425  $('a.views-remove-link')
2426    .addClass('views-processed')
2427    .click(function() {
2428      var id = $(this).attr('id').replace('views-remove-link-', '');
2429      $('#views-row-' + id).hide();
2430      $('#views-removed-' + id).attr('checked', true);
2431      return false;
2432    });
2433}
2434
2435/**
2436 * For IE, attach some javascript so that our hovers do what they're supposed
2437 * to do.
2438 */
2439Drupal.behaviors.viewsHoverlinks = function() {
2440  if ($.browser.msie) {
2441    // If IE, attach a hover event so we can see our admin links.
2442    $("div.view:not(.views-hover-processed)").addClass('views-hover-processed').hover(
2443      function() {
2444        $('div.views-hide', this).addClass("views-hide-hover"); return true;
2445      },
2446      function(){
2447        $('div.views-hide', this).removeClass("views-hide-hover"); return true;
2448      }
2449    );
2450    $("div.views-admin-links:not(.views-hover-processed)")
2451      .addClass('views-hover-processed')
2452      .hover(
2453        function() {
2454          $(this).addClass("views-admin-links-hover"); return true;
2455        },
2456        function(){
2457          $(this).removeClass("views-admin-links-hover"); return true;
2458        }
2459      );
2460  }
2461}
2462
2463/**
2464 * Helper function to parse a querystring.
2465 */
2466Drupal.Views.parseQueryString = function (query) {
2467  var args = {};
2468  var pos = query.indexOf('?');
2469  if (pos != -1) {
2470    query = query.substring(pos + 1);
2471  }
2472  var pairs = query.split('&');
2473  /*---begin (539)---*/
2474  /*for(var i in pairs) {
2475    var pair = pairs[i].split('=');
2476    // Ignore the 'q' path argument, if present.
2477    if (pair[0] != 'q' && pair[1]) {
2478      args[pair[0]] = decodeURIComponent(pair[1].replace(/\+/g, ' '));
2479    }
2480  }*/
2481
2482  v = jQuery.browser.version.substr(0, 1);
2483  if (jQuery.browser.msie && v < 9) {
2484	  for(var i = 0; i < pairs.length; i++) {
2485		var pair = pairs[i].split('=');
2486		// Ignore the 'q' path argument, if present.
2487		if (pair[0] != 'q' && pair[1]) {
2488		  args[pair[0]] = decodeURIComponent(pair[1].replace(/\+/g, ' '));
2489		}
2490	  }
2491  } else {
2492	  for(var i in pairs) {
2493		var pair = pairs[i].split('=');
2494		// Ignore the 'q' path argument, if present.
2495		if (pair[0] != 'q' && pair[1]) {
2496		  args[pair[0]] = decodeURIComponent(pair[1].replace(/\+/g, ' '));
2497		}
2498	  }
2499  }
2500  /*---end 539---*/
2501  return args;
2502};
2503
2504/**
2505 * Helper function to return a view's arguments based on a path.
2506 */
2507Drupal.Views.parseViewArgs = function (href, viewPath) {
2508  var returnObj = {};
2509  var path = Drupal.Views.getPath(href);
2510  // Ensure we have a correct path.
2511  if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') {
2512    var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length));
2513    returnObj.view_args = args;
2514    returnObj.view_path = path;
2515  }
2516  return returnObj;
2517};
2518
2519/**
2520 * Strip off the protocol plus domain from an href.
2521 */
2522Drupal.Views.pathPortion = function (href) {
2523  // Remove e.g. http://example.com if present.
2524  var protocol = window.location.protocol;
2525  if (href.substring(0, protocol.length) == protocol) {
2526    // 2 is the length of the '//' that normally follows the protocol
2527    href = href.substring(href.indexOf('/', protocol.length + 2));
2528  }
2529  return href;
2530};
2531
2532/**
2533 * Return the Drupal path portion of an href.
2534 */
2535Drupal.Views.getPath = function (href) {
2536  href = Drupal.Views.pathPortion(href);
2537  href = href.substring(Drupal.settings.basePath.length, href.length);
2538  // 3 is the length of the '?q=' added to the url without clean urls.
2539  if (href.substring(0, 3) == '?q=') {
2540    href = href.substring(3, href.length);
2541  }
2542  var chars = ['#', '?', '&'];
2543  for (i in chars) {
2544    if (href.indexOf(chars[i]) > -1) {
2545      href = href.substr(0, href.indexOf(chars[i]));
2546    }
2547  }
2548  return href;
2549};
2550;
2551// $Id: ajax_view.js,v 1.19.2.5 2010/03/25 18:25:28 merlinofchaos Exp $
2552
2553/**
2554 * @file ajaxView.js
2555 *
2556 * Handles AJAX fetching of views, including filter submission and response.
2557 */
2558
2559Drupal.Views.Ajax = Drupal.Views.Ajax || {};
2560
2561/**
2562 * An ajax responder that accepts a packet of JSON data and acts appropriately.
2563 *
2564 * The following fields control behavior.
2565 * - 'display': Display the associated data in the view area.
2566 */
2567Drupal.Views.Ajax.ajaxViewResponse = function(target, response) {
2568
2569  if (response.debug) {
2570    alert(response.debug);
2571  }
2572
2573  var $view = $(target);
2574
2575  // Check the 'display' for data.
2576  if (response.status && response.display) {
2577    var $newView = $(response.display);
2578    $view.replaceWith($newView);
2579    $view = $newView;
2580    Drupal.attachBehaviors($view.parent());
2581  }
2582
2583  if (response.messages) {
2584    // Show any messages (but first remove old ones, if there are any).
2585    $view.find('.views-messages').remove().end().prepend(response.messages);
2586  }
2587};
2588
2589/**
2590 * Ajax behavior for views.
2591 */
2592Drupal.behaviors.ViewsAjaxView = function() {
2593  if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) {
2594    var ajax_path = Drupal.settings.views.ajax_path;
2595    // If there are multiple views this might've ended up showing up multiple times.
2596    if (ajax_path.constructor.toString().indexOf("Array") != -1) {
2597      ajax_path = ajax_path[0];
2598    }
2599    $.each(Drupal.settings.views.ajaxViews, function(i, settings) {
2600      var view = '.view-dom-id-' + settings.view_dom_id;
2601      if (!$(view).size()) {
2602        // Backward compatibility: if 'views-view.tpl.php' is old and doesn't
2603        // contain the 'view-dom-id-#' class, we fall back to the old way of
2604        // locating the view:
2605        view = '.view-id-' + settings.view_name + '.view-display-id-' + settings.view_display_id;
2606      }
2607
2608
2609      // Process exposed filter forms.
2610      $('form#views-exposed-form-' + settings.view_name.replace(/_/g, '-') + '-' + settings.view_display_id.replace(/_/g, '-'))
2611      .filter(':not(.views-processed)')
2612      .each(function () {
2613        // remove 'q' from the form; it's there for clean URLs
2614        // so that it submits to the right place with regular submit
2615        // but this method is submitting elsewhere.
2616        $('input[name=q]', this).remove();
2617        var form = this;
2618        // ajaxSubmit doesn't accept a data argument, so we have to
2619        // pass additional fields this way.
2620        $.each(settings, function(key, setting) {
2621          $(form).append('<input type="hidden" name="'+ key + '" value="'+ setting +'"/>');
2622        });
2623      })
2624      .addClass('views-processed')
2625      .submit(function () {
2626        $('input[type=submit], button', this).after('<span class="views-throbbing">&nbsp</span>');
2627        var object = this;
2628        $(this).ajaxSubmit({
2629          url: ajax_path,
2630          type: 'GET',
2631          success: function(response) {
2632            // Call all callbacks.
2633            if (response.__callbacks) {
2634              $.each(response.__callbacks, function(i, callback) {
2635                eval(callback)(view, response);
2636              });
2637              $('.views-throbbing', object).remove();
2638            }
2639          },
2640          error: function(xhr) { Drupal.Views.Ajax.handleErrors(xhr, ajax_path); $('.views-throbbing', object).remove(); },
2641          dataType: 'json'
2642        });
2643
2644        return false;
2645      });
2646
2647      $(view).filter(':not(.views-processed)')
2648        // Don't attach to nested views. Doing so would attach multiple behaviors
2649        // to a given element.
2650        .filter(function() {
2651          // If there is at least one parent with a view class, this view
2652          // is nested (e.g., an attachment). Bail.
2653          return !$(this).parents('.view').size();
2654        })
2655        .each(function() {
2656          // Set a reference that will work in subsequent calls.
2657          var target = this;
2658          $(this)
2659            .addClass('views-processed')
2660            // Process pager, tablesort, and attachment summary links.
2661            .find('ul.pager > li > a, th.views-field a, .attachment .views-summary a')
2662            .each(function () {
2663              var viewData = { 'js': 1 };
2664              // Construct an object using the settings defaults and then overriding
2665              // with data specific to the link.
2666              $.extend(
2667                viewData,
2668                Drupal.Views.parseQueryString($(this).attr('href')),
2669                // Extract argument data from the URL.
2670                Drupal.Views.parseViewArgs($(this).attr('href'), settings.view_base_path),
2671                // Settings must be used last to avoid sending url aliases to the server.
2672                settings
2673              );
2674              $(this).click(function () {
2675                $.extend(viewData, Drupal.Views.parseViewArgs($(this).attr('href'), settings.view_base_path));
2676                $(this).addClass('views-throbbing');
2677                $.ajax({
2678                  url: ajax_path,
2679                  type: 'GET',
2680                  data: viewData,
2681                  success: function(response) {
2682                    $(this).removeClass('views-throbbing');
2683                    // Scroll to the top of the view. This will allow users
2684                    // to browse newly loaded content after e.g. clicking a pager
2685                    // link.
2686                    var offset = $(target).offset();
2687                    // We can't guarantee that the scrollable object should be
2688                    // the body, as the view could be embedded in something
2689                    // more complex such as a modal popup. Recurse up the DOM
2690                    // and scroll the first element that has a non-zero top.
2691                    var scrollTarget = target;
2692                    while ($(scrollTarget).scrollTop() == 0 && $(scrollTarget).parent()) {
2693                      scrollTarget = $(scrollTarget).parent()
2694                    }
2695                    // Only scroll upward
2696                    if (offset.top - 10 < $(scrollTarget).scrollTop()) {
2697                      $(scrollTarget).animate({scrollTop: (offset.top - 10)}, 500);
2698                    }
2699                    // Call all callbacks.
2700                    if (response.__callbacks) {
2701                      $.each(response.__callbacks, function(i, callback) {
2702                        eval(callback)(target, response);
2703                      });
2704                    }
2705                  },
2706                  error: function(xhr) { $(this).removeClass('views-throbbing'); Drupal.Views.Ajax.handleErrors(xhr, ajax_path); },
2707                  dataType: 'json'
2708                });
2709
2710                return false;
2711              });
2712            }); // .each function () {
2713      }); // $view.filter().each
2714    }); // .each Drupal.settings.views.ajaxViews
2715  } // if
2716};
2717;
2718var BrowserDetect = {
2719	init: function () {
2720		this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
2721		this.version = this.searchVersion(navigator.userAgent)
2722			|| this.searchVersion(navigator.appVersion)
2723			|| "an unknown version";
2724		this.OS = this.searchString(this.dataOS) || "an unknown OS";
2725	},
2726	searchString: function (data) {
2727		for (var i=0;i<data.length;i++)	{
2728			var dataString = data[i].string;
2729			var dataProp = data[i].prop;
2730			this.versionSearchString = data[i].versionSearch || data[i].identity;
2731			if (dataString) {
2732				if (dataString.indexOf(data[i].subString) != -1)
2733					return data[i].identity;
2734			}
2735			else if (dataProp)
2736				return data[i].identity;
2737		}
2738	},
2739	searchVersion: function (dataString) {
2740		var index = dataString.indexOf(this.versionSearchString);
2741		if (index == -1) return;
2742		return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
2743	},
2744	dataBrowser: [
2745		{
2746			string: navigator.userAgent,
2747			subString: "Chrome",
2748			identity: "Chrome"
2749		},
2750		{ 	string: navigator.userAgent,
2751			subString: "OmniWeb",
2752			versionSearch: "OmniWeb/",
2753			identity: "OmniWeb"
2754		},
2755		{
2756			string: navigator.vendor,
2757			subString: "Apple",
2758			identity: "Safari",
2759			versionSearch: "Version"
2760		},
2761		{
2762			prop: window.opera,
2763			identity: "Opera"
2764		},
2765		{
2766			string: navigator.vendor,
2767			subString: "iCab",
2768			identity: "iCab"
2769		},
2770		{
2771			string: navigator.vendor,
2772			subString: "KDE",
2773			identity: "Konqueror"
2774		},
2775		{
2776			string: navigator.userAgent,
2777			subString: "Firefox",
2778			identity: "Firefox"
2779		},
2780		{
2781			string: navigator.vendor,
2782			subString: "Camino",
2783			identity: "Camino"
2784		},
2785		{		// for newer Netscapes (6+)
2786			string: navigator.userAgent,
2787			subString: "Netscape",
2788			identity: "Netscape"
2789		},
2790		{
2791			string: navigator.userAgent,
2792			subString: "MSIE",
2793			identity: "Explorer",
2794			versionSearch: "MSIE"
2795		},
2796		{
2797			string: navigator.userAgent,
2798			subString: "Gecko",
2799			identity: "Mozilla",
2800			versionSearch: "rv"
2801		},
2802		{ 		// for older Netscapes (4-)
2803			string: navigator.userAgent,
2804			subString: "Mozilla",
2805			identity: "Netscape",
2806			versionSearch: "Mozilla"
2807		}
2808	],
2809	dataOS : [
2810		{
2811			string: navigator.platform,
2812			subString: "Win",
2813			identity: "Windows"
2814		},
2815		{
2816			string: navigator.platform,
2817			subString: "Mac",
2818			identity: "Mac"
2819		},
2820		{
2821			   string: navigator.userAgent,
2822			   subString: "iPhone",
2823			   identity: "iPhone/iPod"
2824	    },
2825		{
2826			string: navigator.platform,
2827			subString: "Linux",
2828			identity: "Linux"
2829		}
2830	]
2831
2832};
2833BrowserDetect.init();
2834Drupal.behaviors.delphis = function (context) {
2835  $('body').addClass(BrowserDetect.browser);
2836  $('body').addClass(BrowserDetect.browser + '-' + BrowserDetect.version);
2837  $('body').addClass(BrowserDetect.browser + '-' + BrowserDetect.version + '-' + BrowserDetect.OS);
2838};
2839cssFix = function(){
2840var u = navigator.userAgent.toLowerCase(),
2841addClass = function(el, val){
2842	if(! el.className) {
2843		el.className = val;
2844	} else {
2845		var newCl = el.className;
2846		newCl+=(' '+val);
2847		el.className = newCl;
2848	}
2849},
2850is = function(t){return (u.indexOf(t)!=-1)};
2851addClass(document.getElementsByTagName('html')[0],[
2852(!(/opera|webtv/i.test(u))&&/msie (\d)/.test(u))?('ie ie'+RegExp.$1)
2853: is('firefox/2')?'gecko firefox2'
2854: is('firefox/3')?'gecko firefox3'
2855: is('gecko/')?'gecko'
2856: is('chrome/')?'chrome'
2857: is('opera/9')?'opera opera9':/opera (\d)/.test(u)?'opera opera'+RegExp.$1
2858: is('konqueror')?'konqueror'
2859: is('applewebkit/')?'webkit safari'
2860: is('mozilla/')?'gecko':'',
2861(is('x11')||is('linux'))?' linux'
2862: is('mac')?' mac'
2863: is('win')?' win':''
2864].join(' '));
2865}();
2866
2867var EventHelper = {
2868	'bind': function(obj, evt, fn) {
2869		if (obj.addEventListener)
2870			obj.addEventListener(evt, fn, false);
2871		else if (obj.attachEvent)
2872			obj.attachEvent('on' + evt, fn);
2873		else
2874			obj['on' + evt] = fn;
2875	}
2876};
2877
2878var userAgent = navigator.userAgent.toLowerCase();
2879var browser = {
2880	version: (userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/) || [])[1],
2881	safari: /webkit/.test(userAgent) && !/chrome/.test(userAgent),
2882	chrome: /chrome/.test(userAgent),
2883	opera: /opera/.test(userAgent),
2884	msie: /msie/.test(userAgent) && !/opera/.test(userAgent),
2885	mozilla: /mozilla/.test(userAgent) && !/(compatible|webkit)/.test(userAgent)
2886};
2887;
2888Drupal.behaviors.delphis = function(context) {
2889  $(".not-logged-in #site-menu li.last a").click(function() {
2890    $("body").append('<div id="delphis_popup_overlay">&nbsp;</div>');
2891	/*---begin (539)---*/
2892    /*$("body").append('<div id="delphis_popup"><span id="delphis_popup_close">X</span><div id="delphis_popup_in"></div></div>');*/
2893
2894	$(".user-login-form").show();
2895	var fa = $(".loginPopup #edit-orig-dest").val();
2896	$(".loginPopup #edit-fa").val(fa);
2897	chk = $(".loginPopup #edit-new-old-usrnew").attr('checked');
2898	if (chk) {
2899		document.getElementById('user-login-form').action = Drupal.settings.basePath + 'user/register?lfb=1';
2900	} else {
2901		document.getElementById('user-login-form').action = fa;
2902	}
2903	str = $('.loginPopup #uLogin-1').attr('x-ulogin-params');
2904	dest = fa;
2905	dest = dest.split('destination=');
2906	dest = 'destination%3D' + dest[1];
2907	str = str.split('destination%3D');
2908	str = str[0] + dest;
2909	$('.loginPopup #uLogin-1').attr('x-ulogin-params', str);
2910	//$('.loginPopup #uLogin-1').empty();
2911	str = $('.loginPopup #uLogin-1 iframe').attr('src');
2912	if (str.indexOf('destination%3Duser') != -1) {
2913		str = str.replace('destination%3Duser', dest);
2914		$('.loginPopup #uLogin-1 iframe').attr('src', str);
2915	}
2916	$(".loginPopup #edit-new-old-usrnew").click(function() {
2917		document.getElementById('user-login-form').action = Drupal.settings.basePath + 'user/register?lfb=1';
2918	});
2919	$(".loginPopup #edit-new-old-usrold").click(function() {
2920		document.getElementById('user-login-form').action = fa;
2921	});
2922	$('#edit-name').focus( function() {
2923		el = document.getElementById('edit-new-old-usrold');
2924		if (!el.checked) {
2925			el.checked = true;
2926		}
2927		$(el).trigger('click');
2928	});
2929	$('#edit-pass').focus(function() {
2930		el = document.getElementById('edit-new-old-usrold');
2931		if (!el.checked) {
2932			el.checked = true;
2933		}
2934		$(el).trigger('click');
2935	});
2936	/*---end 539---*/
2937    /*---begin---*/
2938	/*---begin (539)---*/
2939    /*$("#delphis_popup_in").html(
2940      '<span class="title">'+Drupal.t('You can visit the site without registering, use the following services:')+'</span><div class="links"><a class="fb link" href="/">'+Drupal.t('Facebook')+'</a><a class="tw link" href="/twitter/redirect">'+Drupal.t('Twitter')+'</a><a class="mw link mrc__connectButton" href="">'+Drupal.t('My world')+'</a><a class="vk link" onclick="doLogin();return false;" href="/">'+Drupal.t('VK')+'</a></div><span class="or">'+Drupal.t('or')+'</span><a class="enter" href="#">'+Drupal.t('Enter by e-mail')+'</a><a href="/user/register" class="registe">Зарегистрироваться</a>'
2941    );*/
2942	/*---end 539---*/
2943    /*if (navigator.userAgent.indexOf ("MSIE 8") != -1) {
2944    	fb_btn = '<div class="noFBLink"></div>';
2945    } else {
2946    	fb_btn = '<a class="fb link" href="/">'+Drupal.t('Facebook')+'</a>';
2947    }
2948    $("#delphis_popup_in").html(
2949      '<span class="title">'+Drupal.t('You can visit the site without registering, use the following services:')+'</span><div class="links">'+fb_btn+'<a class="tw link" href="/twitter/redirect">'+Drupal.t('Twitter')+'</a><a class="mw link mrc__connectButton" href="">'+Drupal.t('My world')+'</a><a class="vk link" onclick="doLogin();return false;" href="/">'+Drupal.t('VK')+'</a></div><span class="or">'+Drupal.t('or')+'</span><a class="enter" href="#">'+Drupal.t('Enter by e-mail')+'</a><a href="/user/register" class="registe">Зарегистрироваться</a>'
2950    );*/
2951    /*---end---*/
2952	/*---begin (539)---*/
2953    //mailru.connect.initButton();
2954	/*---end 539---*/
2955		$("a.mw").html(Drupal.t('My world'));
2956		$("a.fb").click(function() {
2957			/*----begin----*/
2958			FB.login(function(response) {
2959				//if (response.session) {
2960				if (response.authResponse) {
2961					//if (response.perms) {
2962					/*if (response.scope) {
2963						$("#id-fbconnect-autoconnect-form").submit();
2964					} else {
2965						// user is logged in, but did not grant any permissions
2966						alert('Perms denied');
2967					}*/
2968					$("#id-fbconnect-autoconnect-form").submit();
2969				} else {
2970					// user is not logged in
2971				}
2972			//}, {perms:'email,user_birthday'});
2973			}, {scope:'email,user_birthday'});
2974			/*----end----*/
2975      return false;
2976		});
2977    $("#delphis_popup_close").click(function() {
2978      $("#delphis_popup_overlay").remove();
2979      $("#delphis_popup").remove();
2980      $("#delphis_form_close").remove();
2981    });
2982    $("#delphis_popup .enter").click(function(){
2983      $(".user-login-form").show();
2984      $("#delphis_popup").remove();
2985      return false;
2986    });
2987    $("#delphis_popup_overlay").click(function(){
2988      $(this).remove();
2989      $("#delphis_popup").remove();
2990      $("#delphis_form_close").remove();
2991      $(".user-login-form").hide();
2992      $("#delphis_form_close").remove();
2993    });
2994    
2995    $(".user-login-form").prepend('<span id="delphis_form_close">X</span>');
2996    $("#delphis_form_close").click(function() {
2997      $("#delphis_popup_overlay").remove();
2998      $(".user-login-form").hide();
2999      $("#delphis_form_close").remove();
3000    });
3001    if ($("input#edit-question-yes").attr("checked")){
3002      $("#delphis-user-login-form .register-login-link").hide();
3003    }
3004    if ($("input#edit-question-no").attr("checked")){
3005      $("#delphis-user-login-form .button-wrapper").hide();
3006    }
3007    $("#delphis-user-login-form .form-radios input.form-radio").change(function(){
3008      if ($("input#edit-question-yes").attr("checked")){
3009        $("#delphis-user-login-form .register-login-link").hide();
3010        $("#delphis-user-login-form .button-wrapper").show();
3011      }
3012      else if ($("input#edit-question-no").attr("checked")){
3013        $("#delphis-user-login-form .button-wrapper").hide();
3014        $("#delphis-user-login-form .register-login-link").show();
3015      }
3016    });
3017    $("#delphis-user-login-form .cancel-login-link").click(function(){
3018      $(".user-login-form").hide();
3019      $("#delphis_form_close").remove();
3020      $("#delphis_popup_overlay").remove();
3021      return false
3022    });
3023    return false;
3024  });
3025
3026  /*---begin (539)---*/
3027  $(".not-logged-in #site-header a.private_office_link").click(function() {
3028    $("body").append('<div id="delphis_popup_overlay">&nbsp;</div>');
3029	$(".user-login-form").show();
3030	var fa = $(".loginPopup #edit-fa").val();
3031	if (fa.indexOf('&prfl=1') == -1) {
3032		fa = fa + '&prfl=1';
3033	}
3034	$(".loginPopup #edit-fa").val(fa);
3035	chk = $(".loginPopup #edit-new-old-usrnew").attr('checked');
3036	if (chk) {
3037		document.getElementById('user-login-form').action = Drupal.settings.basePath + 'user/register?lfb=1';
3038	} else {
3039		document.getElementById('user-login-form').action = fa;
3040	}
3041	str = $('.loginPopup #uLogin-1').attr('x-ulogin-params');
3042	dest = $('.loginPopup #uLogin-1').attr('x-ulogin-params');
3043	dest = dest.split('destination%3D');
3044	dest = 'destination%3D' + dest[1];
3045	str = str.replace(dest, 'destination%3Duser');
3046	$('.loginPopup #uLogin-1').attr('x-ulogin-params', str);
3047	//$('.loginPopup #uLogin-1').empty();
3048	str = $('.loginPopup #uLogin-1 iframe').attr('src');
3049	str = str.replace(dest, 'destination%3Duser');
3050	$('.loginPopup #uLogin-1 iframe').attr('src', str);
3051	$(".loginPopup #edit-new-old-usrnew").click(function() {
3052		document.getElementById('user-login-form').action = Drupal.settings.basePath + 'user/register?lfb=1';
3053	});
3054	$(".loginPopup #edit-new-old-usrold").click(function() {
3055		document.getElementById('user-login-form').action = fa;
3056	});
3057	$('#edit-name').focus( function() {
3058		el = document.getElementById('edit-new-old-usrold');
3059		if (!el.checked) {
3060			el.checked = true;
3061		}
3062		$(el).trigger('click');
3063	});
3064	$('#edit-pass').focus(function() {
3065		el = document.getElementById('edit-new-old-usrold');
3066		if (!el.checked) {
3067			el.checked = true;
3068		}
3069		$(el).trigger('click');
3070	});
3071    $("#delphis_popup_close").click(function() {
3072      $("#delphis_popup_overlay").remove();
3073      $("#delphis_popup").remove();
3074      $("#delphis_form_close").remove();
3075    });
3076    $("#delphis_popup .enter").click(function(){
3077      $(".user-login-form").show();
3078      $("#delphis_popup").remove();
3079      return false;
3080    });
3081    $("#delphis_popup_overlay").click(function(){
3082      $(this).remove();
3083      $("#delphis_popup").remove();
3084      $("#delphis_form_close").remove();
3085      $(".user-login-form").hide();
3086      $("#delphis_form_close").remove();
3087    });
3088
3089    $(".user-login-form").prepend('<span id="delphis_form_close">X</span>');
3090    $("#delphis_form_close").click(function() {
3091      $("#delphis_popup_overlay").remove();
3092      $(".user-login-form").hide();
3093      $("#delphis_form_close").remove();
3094    });
3095    $("#delphis-user-login-form .cancel-login-link").click(function(){
3096      $(".user-login-form").hide();
3097      $("#delphis_form_close").remove();
3098      $("#delphis_popup_overlay").remove();
3099      return false
3100    });
3101    return false;
3102  });
3103  /*---end 539---*/
3104	
3105	/*---begin (477)---*/
3106	$(".not-logged-in a.add-comments").click(function() {
3107		setCookie("addcomm", "1");
3108		$(".not-logged-in #site-menu li.last a").trigger('click');
3109		return false;
3110	});
3111	$(".not-logged-in a.comment-reply-link").click(function() {
3112		setCookie("addcomm", "3");
3113		setCookie("replaycomm", this.id);
3114		$(".not-logged-in #site-menu li.last a").trigger('click');
3115		return false;
3116	});
3117	/*---end---*/
3118  
3119  var fields = $("#edit-field-organization-name-0-value-wrapper, #edit-field-organization-address-0-value-wrapper, #edit-field-organization-bank-0-value-wrapper, #edit-field-organization-inn-0-value-wrapper, #edit-field-organization-kpp-0-value-wrapper, #edit-field-organization-r-ecount-0-value-wrapper, #edit-field-organization-k-ecount-0-value-wrapper, #edit-field-organization-bik-0-value-wrapper, #edit-field-organization-okpo-0-value-wrapper, #edit-field-organization-ogrn-0-value-wrapper");
3120  
3121  if ($("#user-register #edit-field-person-value-0-").attr('checked')){
3122    $(fields).hide();
3123  }
3124  
3125  $("#user-register .form-radios").change(function(){
3126    if ($(this).find("#edit-field-person-value-0-").attr('checked')){
3127      $(fields).slideUp('slow');
3128    }
3129    
3130    else {
3131      $(fields).slideDown('slow');
3132    }  
3133  });
3134  
3135  if ($(".page-checkout #edit-person-individual").attr('checked')) {
3136    $("#delphis-book-cart-checkout-personal .checkout-person-legal").hide();
3137  }
3138  
3139  $(".page-checkout .checkout-personal-info .form-radios").change(function(){
3140    if ($(this).find("#edit-person-individual").attr('checked')) {
3141      $("#delphis-book-cart-checkout-personal .checkout-person-legal").slideUp('slow');
3142    }
3143    else {
3144      $("#delphis-book-cart-checkout-personal .checkout-person-legal").slideDown('slow');
3145    }
3146  });
3147  
3148  $(".share .delphis-share-hidden").addClass("hide").hide();
3149  $(".share a.share-more-link").click(function(){
3150    if ($(this).parents().find(".delphis-share-hidden").hasClass("hide")) {
3151      $(".share .delphis-share-hidden").slideDown('slow').removeClass("hide").addClass("show");
3152    }
3153    else {
3154      $(".share .delphis-share-hidden").slideUp('slow').removeClass("show").addClass("hide");
3155    }
3156    return false;
3157  });
3158  
3159  if ($("#edit-delivery-address-old-wrapper input").attr('checked')) {
3160    $("#edit-delivery-new-address-wrapper").hide();
3161    $("#delphis-book-cart-checkout-delivery-address .delivery-full-address").hide();
3162  }
3163	
3164  $("#delphis-book-cart-checkout-delivery-address .form-radios").change(function(){
3165    if ($("#edit-delivery-address-old-wrapper input").attr('checked')) {
3166      $("#edit-delivery-new-address-wrapper").slideUp('slow');
3167      $("#delphis-book-cart-checkout-delivery-address .delivery-full-address").slideUp('slow');
3168    }
3169    else {
3170      $("#edit-delivery-new-address-wrapper").slideDown('slow');
3171      $("#delphis-book-cart-checkout-delivery-address .delivery-full-address").slideDown('slow');
3172    }
3173  });
3174  
3175  var $book_cart = $("#delphis-book-cart-checkout-delivery-method");
3176  $book_cart.find(".delivery-time").hide();  
3177  $book_cart.find(".form-checkboxes").hide();
3178  
3179  
3180  if ($book_cart.find("#edit-delivery-method-courier-moskow").attr('checked')) {
3181    $book_cart.find("#edit-delivery-method-courier-moskow-wrapper").addClass("checked").css({"height": "120px"});
3182    $book_cart.find(".delivery-time").show();
3183    $book_cart.find(".form-checkboxes").show();
3184  }
3185  else {
3186    $book_cart.find("#edit-delivery-method-courier-moskow-wrapper").removeClass("checked").css({"height": "22px"});
3187    $book_cart.find(".delivery-time").hide();
3188    $book_cart.find(".form-checkboxes").hide();
3189  }
3190  
3191  $book_cart.find(".form-radios").change(function(){
3192    if ($(this).find("#edit-delivery-method-courier-moskow").attr('checked')) {
3193      $book_cart.find("#edit-delivery-method-courier-moskow-wrapper").addClass("checked").animate({"height": "120px"}, "slow");
3194      $book_cart.find(".delivery-time").slideDown('slow');
3195      $book_cart.find(".form-checkboxes").slideDown('slow');
3196    }
3197    else {
3198      $book_cart.find("#edit-delivery-method-courier-moskow-wrapper").removeClass("checked").animate({"height": "22px"}, "slow");
3199      $book_cart.find(".delivery-time").slideUp('slow');
3200      $book_cart.find(".form-checkboxes").slideUp('slow');
3201    }
3202  });
3203}
3204
3205/*---begin (522)---*/
3206$(document).ready(function() {
3207	$('.block-basket').load(Drupal.settings.basePath + 'ajax/cartkol');
3208});
3209/*---end 522---*/
3210;
3211/*
3212 * jQuery Form Plugin
3213 * version: 2.36 (07-NOV-2009)
3214 * @requires jQuery v1.2.6 or later
3215 */
3216(function(b){b.fn.ajaxSubmit=function(s){if(!this.length){a("ajaxSubmit: skipping submit process - no element selected");return this}if(typeof s=="function"){s={success:s}}var e=b.trim(this.attr("action"));if(e){e=(e.match(/^([^#]+)/)||[])[1]}e=e||window.location.href||"";s=b.extend({url:e,type:this.attr("method")||"GET",iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},s||{});var u={};this.trigger("form-pre-serialize",[this,s,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(s.beforeSerialize&&s.beforeSerialize(this,s)===false){a("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var m=this.formToArray(s.semantic);if(s.data){s.extraData=s.data;for(var f in s.data){if(s.data[f] instanceof Array){for(var g in s.data[f]){m.push({name:f,value:s.data[f][g]})}}else{m.push({name:f,value:s.data[f]})}}}if(s.beforeSubmit&&s.beforeSubmit(m,this,s)===false){a("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[m,this,s,u]);if(u.veto){a("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}var d=b.param(m);if(s.type.toUpperCase()=="GET"){s.url+=(s.url.indexOf("?")>=0?"&":"?")+d;s.data=null}else{s.data=d}var t=this,l=[];if(s.resetForm){l.push(function(){t.resetForm()})}if(s.clearForm){l.push(function(){t.clearForm()})}if(!s.dataType&&s.target){var p=s.success||function(){};l.push(function(j){b(s.target).html(j).each(p,arguments)})}else{if(s.success){l.push(s.success)}}s.success=function(q,k){for(var n=0,j=l.length;n<j;n++){l[n].apply(s,[q,k,t])}};var c=b("input:file",this).fieldValue();var r=false;for(var i=0;i<c.length;i++){if(c[i]){r=true}}var h=false;
3216if((c.length&&s.iframe!==false)||s.iframe||r||h){if(s.closeKeepAlive){b.get(s.closeKeepAlive,o)}else{o()}}else{b.ajax(s)}this.trigger("form-submit-notify",[this,s]);return this;function o(){var w=t[0];if(b(":input[name=submit]",w).length){alert('Error: Form elements must not be named "submit".');return}var q=b.extend({},b.ajaxSettings,s);var G=b.extend(true,{},b.extend(true,{},b.ajaxSettings),q);var v="jqFormIO"+(new Date().getTime());var C=b('<iframe id="'+v+'" name="'+v+'" src="'+q.iframeSrc+'" />');var E=C[0];C.css({position:"absolute",top:"-1000px",left:"-1000px"});var F={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(){this.aborted=1;C.attr("src",q.iframeSrc)}};var D=q.global;if(D&&!b.active++){b.event.trigger("ajaxStart")}if(D){b.event.trigger("ajaxSend",[F,q])}if(G.beforeSend&&G.beforeSend(F,G)===false){G.global&&b.active--;return}if(F.aborted){return}var k=0;var z=0;var j=w.clk;if(j){var x=j.name;if(x&&!j.disabled){s.extraData=s.extraData||{};s.extraData[x]=j.value;if(j.type=="image"){s.extraData[name+".x"]=w.clk_x;s.extraData[name+".y"]=w.clk_y}}}setTimeout(function(){var J=t.attr("target"),H=t.attr("action");w.setAttribute("target",v);if(w.getAttribute("method")!="POST"){w.setAttribute("method","POST")}if(w.getAttribute("action")!=q.url){w.setAttribute("action",q.url)}if(!s.skipEncodingOverride){t.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"})}if(q.timeout){setTimeout(function(){z=true;A()},q.timeout)}var I=[];try{if(s.extraData){for(var K in s.extraData){I.push(b('<input type="hidden" name="'+K+'" value="'+s.extraData[K]+'" />').appendTo(w)[0])}}C.appendTo("body");E.attachEvent?E.attachEvent("onload",A):E.addEventListener("load",A,false);w.submit()}finally{w.setAttribute("action",H);J?w.setAttribute("target",J):t.removeAttr("target");b(I).remove()}},10);var y=50;function A(){if(k++){return}E.detachEvent?E.detachEvent("onload",A):E.removeEventListener("load",A,false);var H=true;try{if(z){throw"timeout"}var I,L;L=E.contentWindow?E.contentWindow.document:E.contentDocument?E.contentDocument:E.document;var M=q.dataType=="xml"||L.XMLDocument||b.isXMLDoc(L);a("isXml="+M);if(!M&&(L.body==null||L.body.innerHTML=="")){if(--y){k=0;setTimeout(A,100);return}a("Could not access iframe DOM after 50 tries.");return}F.responseText=L.body?L.body.innerHTML:null;F.responseXML=L.XMLDocument?L.XMLDocument:L;F.getResponseHeader=function(O){var N={"content-type":q.dataType};return N[O]};if(q.dataType=="json"||q.dataType=="script"){var n=L.getElementsByTagName("textarea")[0];if(n){F.responseText=n.value}else{var K=L.getElementsByTagName("pre")[0];if(K){F.responseText=K.innerHTML}}}else{if(q.dataType=="xml"&&!F.responseXML&&F.responseText!=null){F.responseXML=B(F.responseText)}}I=b.httpData(F,q.dataType)}catch(J){H=false;b.handleError(q,F,"error",J)}if(H){q.success(I,"success");if(D){b.event.trigger("ajaxSuccess",[F,q])}}if(D){b.event.trigger("ajaxComplete",[F,q])}if(D&&!--b.active){b.event.trigger("ajaxStop")}if(q.complete){q.complete(F,H?"success":"error")}setTimeout(function(){C.remove();F.responseXML=null},100)}function B(n,H){if(window.ActiveXObject){H=new ActiveXObject("Microsoft.XMLDOM");H.async="false";H.loadXML(n)}else{H=(new DOMParser()).parseFromString(n,"text/xml")}return(H&&H.documentElement&&H.documentElement.tagName!="parsererror")?H:null}}};b.fn.ajaxForm=function(c){return this.ajaxFormUnbind().bind("submit.form-plugin",function(){b(this).ajaxSubmit(c);return false}).bind("click.form-plugin",function(h){var g=h.target;var d=b(g);if(!(d.is(":submit,input:image"))){return}var f=this;f.clk=g;if(g.type=="image"){if(h.offsetX!=undefined){f.clk_x=h.offsetX;f.clk_y=h.offsetY}else{if(typeof b.fn.offset=="function"){var i=d.offset();f.clk_x=h.pageX-i.left;f.clk_y=h.pageY-i.top}else{f.clk_x=h.pageX-g.offsetLeft;f.clk_y=h.pageY-g.offsetTop}}}setTimeout(function(){f.clk=f.clk_x=f.clk_y=null},100)})};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(q){var p=[];if(this.length==0){return p}var d=this[0];var h=q?d.getElementsByTagName("*"):d.elements;if(!h){return p}for(var k=0,m=h.length;k<m;k++){var e=h[k];var f=e.name;if(!f){continue}if(q&&d.clk&&e.type=="image"){if(!e.disabled&&d.clk==e){p.push({name:f,value:b(e).val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}continue}var r=b.fieldValue(e,true);if(r&&r.constructor==Array){for(var g=0,c=r.length;g<c;g++){p.push({name:f,value:r[g]})}}else{if(r!==null&&typeof r!="undefined"){p.push({name:f,value:r})}}}if(!q&&d.clk){var l=b(d.clk),o=l[0],f=o.name;if(f&&!o.disabled&&o.type=="image"){p.push({name:f,value:l.val()});p.push({name:f+".x",value:d.clk_x},{name:f+".y",value:d.clk_y})}}return p};
3216b.fn.formSerialize=function(c){return b.param(this.formToArray(c))};b.fn.fieldSerialize=function(d){var c=[];this.each(function(){var h=this.name;if(!h){return}var f=b.fieldValue(this,d);if(f&&f.constructor==Array){for(var g=0,e=f.length;g<e;g++){c.push({name:h,value:f[g]})}}else{if(f!==null&&typeof f!="undefined"){c.push({name:this.name,value:f})}}});return b.param(c)};b.fn.fieldValue=function(h){for(var g=[],e=0,c=this.length;e<c;e++){var f=this[e];var d=b.fieldValue(f,h);if(d===null||typeof d=="undefined"||(d.constructor==Array&&!d.length)){continue}d.constructor==Array?b.merge(g,d):g.push(d)}return g};b.fieldValue=function(c,j){var e=c.name,p=c.type,q=c.tagName.toLowerCase();if(typeof j=="undefined"){j=true}if(j&&(!e||c.disabled||p=="reset"||p=="button"||(p=="checkbox"||p=="radio")&&!c.checked||(p=="submit"||p=="image")&&c.form&&c.form.clk!=c||q=="select"&&c.selectedIndex==-1)){return null}if(q=="select"){var k=c.selectedIndex;if(k<0){return null}var m=[],d=c.options;var g=(p=="select-one");var l=(g?k+1:d.length);for(var f=(g?k:0);f<l;f++){var h=d[f];if(h.selected){var o=h.value;if(!o){o=(h.attributes&&h.attributes.value&&!(h.attributes.value.specified))?h.text:h.value}if(g){return o}m.push(o)}}return m}return c.value};b.fn.clearForm=function(){return this.each(function(){b("input,select,textarea",this).clearFields()})};b.fn.clearFields=b.fn.clearInputs=function(){return this.each(function(){var d=this.type,c=this.tagName.toLowerCase();if(d=="text"||d=="password"||c=="textarea"){this.value=""}else{if(d=="checkbox"||d=="radio"){this.checked=false}else{if(c=="select"){this.selectedIndex=-1}}}})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};b.fn.enable=function(c){if(c==undefined){c=true}return this.each(function(){this.disabled=!c})};b.fn.selected=function(c){if(c==undefined){c=true}return this.each(function(){var d=this.type;if(d=="checkbox"||d=="radio"){this.checked=c}else{if(this.tagName.toLowerCase()=="option"){var e=b(this).parent("select");if(c&&e[0]&&e[0].type=="select-one"){e.find("option").selected(false)}this.selected=c}}})};function a(){if(b.fn.ajaxSubmit.debug&&window.console&&window.console.log){window.console.log("[jquery.form] "+Array.prototype.join.call(arguments,""))}}})(jQuery);
3217;
3218		// <![CDATA[
3219		var us_msg = {missing: "Не задано обязательное поле: \"%s\"", invalid: "Недопустимое значение поля: \"%s\"", email_or_phone: "Не задан ни email, ни телефон", no_list_ids: "Не выбрано ни одного списка рассылки"};
3220		function us_onLoadImpl() {
3221			us_autodetectCharset();
3222		}
3223		var us_onLoadOld = null;
3224		var us_onLoadCalled = false;
3225
3226		function us_onLoad() {
3227			us_onLoadImpl();
3228			us_onLoadCalled = true;
3229			if (us_onLoadOld) {
3230				us_onLoadOld();
3231			}
3232		}
3233
3234		us_onLoadOld = window.onload;
3235		window.onload = us_onLoad;
3236
3237		function us_autodetectCharset() {
3238			var d = document;
3239			var f = d.getElementById('us_form');
3240			var ee = f.getElementsByTagName('input');
3241			for (var i = 0;  i < ee.length;  i++) {
3242				var e = ee[i];
3243				if (e.getAttribute('name') == 'charset') {
3244					if (e.value == '') {
3245						// http://stackoverflow.com/questions/318831
3246						e.value = d.characterSet ? d.characterSet : d.charset;
3247					}
3248					return;
3249				}
3250			}
3251		}
3252
3253		function us_onSubmit() {
3254			if (!us_onLoadCalled) {
3255				alert('us_onLoad() has not been called')
3256				return false;
3257			}
3258
3259			function trim(s) {
3260				return s == null ? '' : s.replace(/^\s\s*/, '').replace(/\s\s*$/, '');
3261			}
3262
3263			var d = document;
3264			var f = d.getElementById('us_form');
3265			if (!f) {
3266				alert('Internal error: form not found.');
3267				return false;
3268			}
3269
3270			var ee, i, e, n, v, r, k, b1, b2;
3271			var hasEmail = false;
3272			var hasPhone = false;
3273
3274			ee = f.getElementsByTagName('input');
3275			for (i = 0;  i < ee.length;  i++) {
3276				e = ee[i];
3277				n = e.getAttribute('name');
3278				if (!n || e.getAttribute('type') != 'text') {
3279					continue;
3280				}
3281
3282				v = trim(e.value);
3283				if (v == '') {
3284					k = e.getAttribute('_required');
3285					if (k == '1') {
3286						alert(us_msg['missing'].replace('%s', e.getAttribute('_label')));
3287						e.focus();
3288						return false;
3289					}
3290					continue;
3291				}
3292
3293				if (n == 'email') {
3294					hasEmail = true;
3295				} else if (n == 'phone') {
3296					hasPhone = true;
3297				}
3298
3299				k = e.getAttribute('_validator');
3300				r = null;
3301				switch (k) {
3302					case null:
3303					case '':
3304						break;
3305					case 'email':
3306						// TODO Provide regexps from PHP code (add getEmailValidationRegexp_forJavascript() to functions.php).
3307						r = /^[a-zA-Z0-9_+=-]+[a-zA-Z0-9\._+=-]*@[a-zA-Z0-9][a-zA-Z0-9-]*(\.[a-zA-Z0-9]([a-zA-Z0-9-]+))*\.([a-zA-Z]{2,6})$/;
3308						break;
3309					case 'phone':
3310						r = /^[\d +()\-]{7,32}$/;
3311						break;
3312					case 'float':
3313						r = /^[+\-]?\d+(\.\d+)?$/;
3314						break;
3315					default:
3316						alert('Internal error: unknown validator "' + k + '"');
3317						e.focus();
3318						return false;
3319				}
3320				if (r && !r.test(v)) {
3321					alert(us_msg['invalid'].replace('%s', e.getAttribute('_label')));
3322					e.focus();
3323					return false;
3324				}
3325			}
3326
3327			if (!hasEmail && !hasPhone) {
3328				alert(us_msg['email_or_phone']);
3329				return false;
3330			}
3331
3332			ee = f.getElementsByTagName('input');
3333			b1 = false;
3334			b2 = false;
3335			for (i = 0;  i < ee.length;  i++) {
3336				e = ee[i];
3337				if (e.getAttribute('name') != 'list_ids[]') {
3338					continue;
3339				}
3340				b1 = true;
3341				if (e.checked) {
3342					b2 = true;
3343					break;
3344				}
3345			}
3346			if (b1 && !b2) {
3347				alert(us_msg['no_list_ids']);
3348				return false;
3349			}
3350
3351			return true;
3352		}
3353		// ]]>
3354;
3355/* Save Cookie */
3356function setCookie (name, value, expires, path, domain, secure) {
3357  document.cookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
3358}
3359
3360/* Get Cookie */
3361function getCookie(name) {
3362  var cookie = " " + document.cookie;
3363  var search = " " + name + "=";
3364  var setStr = null;
3365  var offset = 0;
3366  var end = 0;
3367
3368  if (cookie.length > 0) {
3369    offset = cookie.indexOf(search);
3370
3371    if (offset != -1) {
3372      offset += search.length;
3373      end = cookie.indexOf(";", offset)
3374
3375      if (end == -1) {
3376        end = cookie.length;
3377      }
3378
3379      setStr = unescape(cookie.substring(offset, end));
3380    }
3381}
3382  return(setStr);
3383}
3384
3385/* Delete Cookie */
3386function delCookie(name) {
3387  var cookie_date = new Date ( );  // Текущая дата и время
3388  cookie_date.setTime ( cookie_date.getTime() - 1 );
3389  document.cookie = name += "=; expires=" + cookie_date.toGMTString();
3390};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.