//highslide
if(hs)	{
	hs.moveText='Przesuń';
	hs.closeText='Zamknij';
	hs.moveTitle='Kliknij i przytrzymaj aby przesunąć';
	hs.closeTitle='Kliknij aby zamknąć';
	hs.resizeTitle='Zmień rozmiar';
	loadingText='Czytam plik...';
	loadingTitle='Kliknij, aby przerwać';
}
eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([47-9yA-Z]|[12]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}(';(4(j){8 u="2.30";8 t=j.21.22&&/MSIE 6.0/.1t(navigator.userAgent);4 r(){7(23.24&&23.24.2p){23.24.2p("[D] "+Array.prototype.join.call(2q,""))}}j.G.D=4(l){8 s=2q[1];Q A.1r(4(){7(l===undefined||l===R){l={}}7(l.25==2r){switch(l){26"stop":7(A.U){1u(A.U)}A.U=0;j(A).1C("D.1K","");Q;26"27":A.1h=1;Q;26"2s":A.1h=0;7(s===28){l=j(A).1C("D.1K");7(!l){r("2t 1n 2u, 2v 1n 2s");Q}7(A.U){1u(A.U);A.U=0}q(l.1L,l,1,1)}Q;default:l={fx:l}}}S{7(l.25==Number){8 i=l;l=j(A).1C("D.1K");7(!l){r("2t 1n 2u, 2v 1n advance 2w");Q}7(i<0||i>=l.1L.N){r("invalid 2w 1D: "+i);Q}l.P=i;7(A.U){1u(A.U);A.U=0}q(l.1L,l,1,i>=l.1b);Q}}7(A.U){1u(A.U)}A.U=0;A.1h=0;8 b=j(A);8 g=l.29?j(l.29,A):b.children();8 k=g.get();7(k.N<2){r("terminating; too few slides: "+k.N);Q}8 a=j.extend({},j.G.D.2x,l||{},j.2y?b.2y():j.meta?b.1C():{});7(a.2a){a.2b=a.2c||k.N}b.1C("D.1K",a);a.1v=A;a.1L=k;a.J=a.J?[a.J]:[];a.1k=a.1k?[a.1k]:[];a.1k.1M(4(){a.2d=0});7(a.1w){a.1k.L(4(){q(k,a,0,!a.1x)})}7(t&&a.1N&&!a.2z){h(g)}8 o=A.className;a.F=V((o.1E(/w:(\\d+)/)||[])[1])||a.F;a.E=V((o.1E(/h:(\\d+)/)||[])[1])||a.E;a.1c=V((o.1E(/t:(\\d+)/)||[])[1])||a.1c;7(b.y("1O")=="static"){b.y("1O","relative")}7(a.F){b.F(a.F)}7(a.E&&a.E!="1P"){b.E(a.E)}7(a.19){a.19=V(a.19)}7(a.1l){a.1p=[];1F(8 n=0;n<k.N;n++){a.1p.L(n)}a.1p.sort(4(e,f){Q Math.1l()-0.5});a.11=0;a.19=a.1p[0]}S{7(a.19>=k.N){a.19=0}}8 m=a.19||0;g.y({1O:"2A",B:0,9:0}).W().1r(4(e){8 f=m?e>=m?k.N-(e-m):m-e:k.N-e;j(A).y("z-1D",f)});j(k[m]).y("1i",1).X();7(j.21.22){k[m].2B.2C("2e")}7(a.1m&&a.F){g.F(a.F)}7(a.1m&&a.E&&a.E!="1P"){g.E(a.E)}7(a.27){b.2D(4(){A.1h=1},4(){A.1h=0})}8 v=j.G.D.O[a.fx];7(j.2E(v)){v(b,g,a)}S{7(a.fx!="2f"){r("unknown transition: "+a.fx)}}g.1r(4(){8 e=j(A);A.12=(a.1m&&a.E)?a.E:e.E();A.14=(a.1m&&a.F)?a.F:e.F()});a.C=a.C||{};a.K=a.K||{};a.I=a.I||{};g.1n(":eq("+m+")").y(a.C);7(a.1g){j(g[m]).y(a.1g)}7(a.1c){a.1c=V(a.1c);7(a.1a.25==2r){a.1a=j.fx.speeds[a.1a]||V(a.1a)}7(!a.1Q){a.1a=a.1a/2}while((a.1c-a.1a)<250){a.1c+=a.1a}}7(a.2h){a.1R=a.1S=a.2h}7(!a.1y){a.1y=a.1a}7(!a.1G){a.1G=a.1a}a.2F=k.N;a.1b=m;7(a.1l){a.P=a.1b;7(++a.11==k.N){a.11=0}a.P=a.1p[a.11]}S{a.P=a.19>=(k.N-1)?0:a.19+1}8 p=g[m];7(a.J.N){a.J[0].1T(p,[p,p,a,28])}7(a.1k.N>1){a.1k[1].1T(p,[p,p,a,28])}7(a.1H&&!a.1I){a.1I=a.1H}7(a.1I){j(a.1I).2i("1H",4(){Q w(k,a,a.1x?-1:1)})}7(a.2j){j(a.2j).2i("1H",4(){Q w(k,a,a.1x?1:-1)})}7(a.1q){x(k,a)}a.addSlide=4(e,f){8 c=j(e),d=c[0];7(!a.2c){a.2b++}k[f?"1M":"L"](d);7(a.1d){a.1d[f?"1M":"L"](d)}a.2F=k.N;c.y("1O","2A");c[f?"prependTo":"2G"](b);7(f){a.1b++;a.P++}7(t&&a.1N&&!a.2z){h(c)}7(a.1m&&a.F){c.F(a.F)}7(a.1m&&a.E&&a.E!="1P"){g.E(a.E)}d.12=(a.1m&&a.E)?a.E:c.E();d.14=(a.1m&&a.F)?a.F:c.F();c.y(a.C);7(a.1q){j.G.D.2k(k.N-1,d,j(a.1q),k,a)}7(1U a.Y=="4"){a.Y(c)}};7(a.1c||a.1w){A.U=1V(4(){q(k,a,0,!a.1x)},a.1w?10:a.1c+(a.2H||0))}})};4 q(c,d,i,b){7(d.2d){Q}8 g=d.1v,k=c[d.1b],a=c[d.P];7(g.U===0&&!i){Q}7(!i&&!g.1h&&((d.2a&&(--d.2b<=0))||(d.1W&&!d.1l&&d.P<d.1b))){7(d.2l){d.2l(d)}Q}7(i||!g.1h){7(d.J.N){j.1r(d.J,4(e,f){f.1T(a,[k,a,d,b])})}8 o=4(){7(j.21.22&&d.1N){A.2B.2C("2e")}j.1r(d.1k,4(e,f){f.1T(a,[k,a,d,b])})};7(d.P!=d.1b){d.2d=1;7(d.1X){d.1X(k,a,d,o,b)}S{7(j.2E(j.G.D[d.fx])){j.G.D[d.fx](k,a,d,o)}S{j.G.D.2f(k,a,d,o,i&&d.2I)}}}7(d.1l){d.1b=d.P;7(++d.11==c.N){d.11=0}d.P=d.1p[d.11]}S{8 n=(d.P+1)==c.N;d.P=n?0:d.P+1;d.1b=n?c.N-1:d.P-1}7(d.1q){j.G.D.2m(d.1q,d.1b)}}7(d.1c&&!d.1w){g.U=1V(4(){q(c,d,0,!d.1x)},d.1c)}S{7(d.1w&&g.1h){g.U=1V(4(){q(c,d,0,!d.1x)},10)}}}j.G.D.2m=4(e,f){j(e).find("a").removeClass("2J").2e("a:eq("+f+")").addClass("2J")};4 w(e,f,c){8 d=f.1v,i=d.U;7(i){1u(i);d.U=0}7(f.1l&&c<0){f.11--;7(--f.11==-2){f.11=e.N-2}S{7(f.11==-1){f.11=e.N-1}}f.P=f.1p[f.11]}S{7(f.1l){7(++f.11==e.N){f.11=0}f.P=f.1p[f.11]}S{f.P=f.1b+c;7(f.P<0){7(f.1W){Q 1Y}f.P=e.N-1}S{7(f.P>=e.N){7(f.1W){Q 1Y}f.P=0}}}}7(f.1Z&&1U f.1Z=="4"){f.1Z(c>0,f.P,e[f.P])}q(e,f,1,c>=0);Q 1Y}4 x(c,d){8 i=j(d.1q);j.1r(c,4(e,f){j.G.D.2k(e,f,i,c,d)});j.G.D.2m(d.1q,d.19)}j.G.D.2k=4(c,d,i,b,g){8 k=(1U g.2n=="4")?j(g.2n(c,d)):j(\'<a href="#">\'+(c+1)+"</a>");7(k.parents("body").N==0){k.2G(i)}k.2i(g.2K,4(){g.P=c;8 e=g.1v,f=e.U;7(f){1u(f);e.U=0}7(1U g.2o=="4"){g.2o(g.P,b[g.P])}q(b,g,1,g.1b<c);Q 1Y});7(g.2L){k.2D(4(){g.1v.1h=1},4(){g.1v.1h=0})}};4 h(d){4 i(e){8 e=V(e).toString(16);Q e.N<2?"0"+e:e}4 b(e){1F(;e&&e.nodeName.toLowerCase()!="html";e=e.parentNode){8 f=j.y(e,"2M-2N");7(f.indexOf("rgb")>=0){8 c=f.1E(/\\d+/g);Q"#"+i(c[0])+i(c[1])+i(c[2])}7(f&&f!="transparent"){Q f}}Q"#ffffff"}d.1r(4(){j(A).y("2M-2N",b(A))})}j.G.D.2f=4(e,f,c,d,i){8 b=j(e),g=j(f);g.y(c.C);8 k=i?1:c.1y;8 a=i?1:c.1G;8 o=i?R:c.1R;8 n=i?R:c.1S;8 m=4(){g.20(c.K,k,o,d)};b.20(c.I,a,n,4(){7(c.M){b.y(c.M)}7(!c.1Q){m()}});7(c.1Q){m()}};j.G.D.O={2O:4(f,c,d){c.1n(":eq("+d.19+")").y("1i",0);d.J.L(4(){j(A).X()});d.K={1i:1};d.I={1i:0};d.C={1i:0};d.M={T:"Z"};d.Y=4(e){e.W()}}};j.G.D.ver=4(){Q u};j.G.D.2x={fx:"2O",1c:4000,1w:0,1a:1000,1y:R,1G:R,1I:R,2j:R,1Z:R,1q:R,2o:R,2K:"1H",2n:R,J:R,1k:R,2l:R,2h:R,1R:R,1S:R,1J:R,K:R,I:R,C:R,M:R,1X:R,E:"1P",19:0,1Q:1,1l:0,1m:0,27:0,2L:0,2a:0,2c:0,2H:0,29:R,1N:0,1W:0,2I:0}})(2P);(4(h){h.G.D.O.scrollUp=4(d,i,b){d.y("18","1e");b.J.L(4(e,f,c){h(A).X();c.C.B=f.1z;c.I.B=0-e.1z});b.1g={B:0};b.K={B:0};b.M={T:"Z"}};h.G.D.O.scrollDown=4(d,i,b){d.y("18","1e");b.J.L(4(e,f,c){h(A).X();c.C.B=0-f.1z;c.I.B=e.1z});b.1g={B:0};b.K={B:0};b.M={T:"Z"}};h.G.D.O.scrollLeft=4(d,i,b){d.y("18","1e");b.J.L(4(e,f,c){h(A).X();c.C.9=f.1A;c.I.9=0-e.1A});b.1g={9:0};b.K={9:0}};h.G.D.O.scrollRight=4(d,i,b){d.y("18","1e");b.J.L(4(e,f,c){h(A).X();c.C.9=0-f.1A;c.I.9=e.1A});b.1g={9:0};b.K={9:0}};h.G.D.O.scrollHorz=4(g,k,a){g.y("18","1e").F();a.J.L(4(e,f,c,d){h(A).X();8 i=e.1A,b=f.1A;c.C=d?{9:b}:{9:-b};c.K.9=0;c.I.9=d?-i:i;k.1n(e).y(c.C)});a.1g={9:0};a.M={T:"Z"}};h.G.D.O.scrollVert=4(g,k,a){g.y("18","1e");a.J.L(4(e,f,c,d){h(A).X();8 i=e.1z,b=f.1z;c.C=d?{B:-b}:{B:b};c.K.B=0;c.I.B=d?i:-i;k.1n(e).y(c.C)});a.1g={B:0};a.M={T:"Z"}};h.G.D.O.slideX=4(d,i,b){b.J.L(4(e,f,c){h(e).y("H",1)});b.Y=4(e){e.W()};b.C={H:2};b.K={F:"X"};b.I={F:"W"}};h.G.D.O.slideY=4(d,i,b){b.J.L(4(e,f,c){h(e).y("H",1)});b.Y=4(e){e.W()};b.C={H:2};b.K={E:"X"};b.I={E:"W"}};h.G.D.O.1J=4(o,n,m){8 v=o.y("18","2Q").F();n.y({9:0,B:0});m.J.L(4(){h(A).X()});m.1a=m.1a/2;m.1l=0;m.1J=m.1J||{9:-v,B:15};m.1d=[];1F(8 p=0;p<n.N;p++){m.1d.L(n[p])}1F(8 p=0;p<m.19;p++){m.1d.L(m.1d.2R())}m.1X=4(d,i,b,g,k){8 a=k?h(d):h(i);a.20(b.1J,b.1y,b.1R,4(){k?b.1d.L(b.1d.2R()):b.1d.1M(b.1d.pop());7(k){1F(8 e=0,f=b.1d.N;e<f;e++){h(b.1d[e]).y("z-1D",f-e)}}S{8 c=h(d).y("z-1D");a.y("z-1D",V(c)+1)}a.20({9:0,B:0},b.1G,b.1S,4(){h(k?A:d).W();7(g){g()}})})};m.Y=4(e){e.W()}};h.G.D.O.turnUp=4(d,i,b){b.J.L(4(e,f,c){h(A).X();c.C.B=f.12;c.K.E=f.12});b.Y=4(e){e.W()};b.1g={B:0};b.C={E:0};b.K={B:0};b.I={E:0};b.M={T:"Z"}};h.G.D.O.turnDown=4(d,i,b){b.J.L(4(e,f,c){h(A).X();c.K.E=f.12;c.I.B=e.12});b.Y=4(e){e.W()};b.1g={B:0};b.C={B:0,E:0};b.I={E:0};b.M={T:"Z"}};h.G.D.O.turnLeft=4(d,i,b){b.J.L(4(e,f,c){h(A).X();c.C.9=f.14;c.K.F=f.14});b.Y=4(e){e.W()};b.C={F:0};b.K={9:0};b.I={F:0};b.M={T:"Z"}};h.G.D.O.turnRight=4(d,i,b){b.J.L(4(e,f,c){h(A).X();c.K.F=f.14;c.I.9=e.14});b.Y=4(e){e.W()};b.C={9:0,F:0};b.K={9:0};b.I={F:0};b.M={T:"Z"}};h.G.D.O.2S=4(d,i,b){b.1g={B:0,9:0};b.M={T:"Z"};b.J.L(4(e,f,c){h(A).X();c.C={F:0,E:0,B:f.12/2,9:f.14/2};c.M={T:"Z"};c.K={B:0,9:0,F:f.14,E:f.12};c.I={F:0,E:0,B:e.12/2,9:e.14/2};h(e).y("H",2);h(f).y("H",1)});b.Y=4(e){e.W()}};h.G.D.O.fadeZoom=4(d,i,b){b.J.L(4(e,f,c){c.C={F:0,E:0,1i:1,9:f.14/2,B:f.12/2,H:1};c.K={B:0,9:0,F:f.14,E:f.12}});b.I={1i:0};b.M={H:0}};h.G.D.O.blindX=4(d,i,b){8 g=d.y("18","1e").F();i.X();b.J.L(4(e,f,c){h(e).y("H",1)});b.C={9:g,H:2};b.M={H:1};b.K={9:0};b.I={9:g}};h.G.D.O.blindY=4(d,i,b){8 g=d.y("18","1e").E();i.X();b.J.L(4(e,f,c){h(e).y("H",1)});b.C={B:g,H:2};b.M={H:1};b.K={B:0};b.I={B:g}};h.G.D.O.blindZ=4(d,i,b){8 g=d.y("18","1e").E();8 k=d.F();i.X();b.J.L(4(e,f,c){h(e).y("H",1)});b.C={B:g,9:k,H:2};b.M={H:1};b.K={B:0,9:0};b.I={B:g,9:k}};h.G.D.O.growX=4(d,i,b){b.J.L(4(e,f,c){c.C={9:A.14/2,F:0,H:2};c.K={9:0,F:A.14};c.I={9:0};h(e).y("H",1)});b.Y=4(e){e.W().y("H",1)}};h.G.D.O.growY=4(d,i,b){b.J.L(4(e,f,c){c.C={B:A.12/2,E:0,H:2};c.K={B:0,E:A.12};c.I={B:0};h(e).y("H",1)});b.Y=4(e){e.W().y("H",1)}};h.G.D.O.curtainX=4(d,i,b){b.J.L(4(e,f,c){c.C={9:f.14/2,F:0,H:1,T:"1B"};c.K={9:0,F:A.14};c.I={9:e.14/2,F:0};h(e).y("H",2)});b.Y=4(e){e.W()};b.M={H:1,T:"Z"}};h.G.D.O.curtainY=4(d,i,b){b.J.L(4(e,f,c){c.C={B:f.12/2,E:0,H:1,T:"1B"};c.K={B:0,E:A.12};c.I={B:e.12/2,E:0};h(e).y("H",2)});b.Y=4(e){e.W()};b.M={H:1,T:"Z"}};h.G.D.O.cover=4(d,i,b){8 g=b.2T||"9";8 k=d.y("18","1e").F();8 a=d.E();b.J.L(4(e,f,c){c.C=c.C||{};c.C.H=2;c.C.T="1B";7(g=="2U"){c.C.9=-k}S{7(g=="up"){c.C.B=a}S{7(g=="2W"){c.C.B=-a}S{c.C.9=k}}}h(e).y("H",1)});7(!b.K){b.K={9:0,B:0}}7(!b.I){b.I={9:0,B:0}}b.M=b.M||{};b.M.H=2;b.M.T="Z"};h.G.D.O.uncover=4(d,i,b){8 g=b.2T||"9";8 k=d.y("18","1e").F();8 a=d.E();b.J.L(4(e,f,c){c.C.T="1B";7(g=="2U"){c.I.9=k}S{7(g=="up"){c.I.B=-a}S{7(g=="2W"){c.I.B=a}S{c.I.9=-k}}}h(e).y("H",2);h(f).y("H",1)});b.Y=4(e){e.W()};7(!b.K){b.K={9:0,B:0}}b.C=b.C||{};b.C.B=0;b.C.9=0;b.M=b.M||{};b.M.H=1;b.M.T="Z"};h.G.D.O.toss=4(d,i,b){8 g=d.y("18","2Q").F();8 k=d.E();b.J.L(4(e,f,c){h(e).y("H",2);c.C.T="1B";7(!c.I.9&&!c.I.B){c.I={9:g*2,B:-k/2,1i:0}}S{c.I.1i=0}});b.Y=4(e){e.W()};b.C={9:0,B:0,H:1,1i:1};b.K={9:0};b.M={H:2,T:"Z"}};h.G.D.O.wipe=4(v,p,l){8 s=v.y("18","1e").F();8 j=v.E();l.C=l.C||{};8 u;7(l.1j){7(/l2r/.1t(l.1j)){u="1s(1f 1f "+j+"px 1f)"}S{7(/r2l/.1t(l.1j)){u="1s(1f "+s+"px "+j+"px "+s+"px)"}S{7(/t2b/.1t(l.1j)){u="1s(1f "+s+"px 1f 1f)"}S{7(/b2t/.1t(l.1j)){u="1s("+j+"px "+s+"px "+j+"px 1f)"}S{7(/2S/.1t(l.1j)){8 t=V(j/2);8 r=V(s/2);u="1s("+t+"px "+r+"px "+t+"px "+r+"px)"}}}}}}l.C.1j=l.C.1j||u||"1s(1f 1f 1f 1f)";8 q=l.C.1j.1E(/(\\d+)/g);8 t=V(q[0]),w=V(q[1]),x=V(q[2]),r=V(q[3]);l.J.L(4(i,b,g){7(i==b){Q}8 k=h(i).y("H",2);8 a=h(b).y({H:3,T:"1B"});8 o=1,n=V((g.1y/13))-1;4 m(){8 e=t?t-V(o*(t/n)):0;8 f=r?r-V(o*(r/n)):0;8 c=x<j?x+V(o*((j-x)/n||1)):j;8 d=w<s?w+V(o*((s-w)/n||1)):s;a.y({1j:"1s("+e+"px "+d+"px "+c+"px "+f+"px)"});(o++<=n)?1V(m,13):k.y("T","Z")}m()});l.M={};l.K={9:0};l.I={9:0}}})(2P);',[],183,'||||function|||if|var|left|||||||||||||||||||||||||css||this|top|cssBefore|cycle|height|width|fn|zIndex|animOut|before|animIn|push|cssAfter|length|transitions|nextSlide|return|null|else|display|cycleTimeout|parseInt|hide|show|onAddSlide|none||randomIndex|cycleH||cycleW||||overflow|startingSlide|speed|currSlide|timeout|els|hidden|0px|cssFirst|cyclePause|opacity|clip|after|random|fit|not||randomMap|pager|each|rect|test|clearTimeout|container|continuous|rev|speedIn|offsetHeight|offsetWidth|block|data|index|match|for|speedOut|click|next|shuffle|opts|elements|unshift|cleartype|position|auto|sync|easeIn|easeOut|apply|typeof|setTimeout|nowrap|fxFn|false|prevNextClick|animate|browser|msie|window|console|constructor|case|pause|true|slideExpr|autostop|countdown|autostopCount|busy|filter|custom||easing|bind|prev|createPagerAnchor|end|updateActivePagerLink|pagerAnchorBuilder|pagerClick|log|arguments|String|resume|options|found|can|slide|defaults|metadata|cleartypeNoBg|absolute|style|removeAttribute|hover|isFunction|slideCount|appendTo|delay|fastOnEvent|activeSlide|pagerEvent|pauseOnPagerHover|background|color|fade|jQuery|visible|shift|zoom|direction|right||down'.split('|'),0,{}))

var $j = jQuery.noConflict();

$j(document).ready(
	function() {
		//alert(top.location.host);
		if(top.location.host!='www.dom.pl' && top != self)	{
			top.location=self.location
		}
		if(gtsp('banner'))	{
			//$j('#banner').hide();
			var banner_proj=readCookie('banner_proj');
			if(banner_proj)	{
				if(banner_proj<2)	{
					createCookie('banner_proj',parseInt(banner_proj)+1,30);
					$j('#banner').show();
				}
			}	else	{
				createCookie('banner_proj',1,30);
				$j('#banner').show();
			}
			
		}
		//$j.preloadCssImages();

	var zalogowany=readCookie('moj_logedin');
	
	if(zalogowany == 1)
	{
		if(gtsp('moj_out') && gtsp('kom1'))
		{
			document.getElementById('mojdompl').checked=true;
			//gtsp('moj_logedin').style.display="";
			gtsp('moj_out').style.display="none";
		}
/*
		if(gtsp('ulubione') && gtsp('ulubione_logged'))
		{
			gtsp('ulubione_logged').style.display="";
			gtsp('ulubione').style.display="none";
		}
*/	}
	
	if(location.hash && location.hash=='#error')
	{
		
		var error=decodeURIComponent(readCookie('error-wp'));
		if(error!='null' && error)
		{
			if(gtsp('error'))
			{
				gtsp('error').style.display="";
				error=error.replace(/\+/g,' ');
				gtsp('error').innerHTML=error;
			}
		}
	}

	if(location.hash && location.hash=='#thanx')	{
		if(gtsp('thanx') && gtsp('kom1'))	{
			gtsp('thanx').style.display='';
			gtsp('kom1').style.display="none";
		}
	}

	//Slider
		$j('div#slider').cycle({
				fx: 'scrollHorz',
				prev: 'a.slider-prev',
				next: 'a.slider-next',
				//pause: 1,
				timeout: 8000,
				delay: -8000,
				speed: 800
			});

	// Pause the slider
		$j('a.slider-pause').click(
			function() {
				$j('div#slider').cycle('pause');
				$j('a.slider-pause').addClass('paused');
			}
		);

	// Resume slider when previous is clicked, remove pause
		$j('a.slider-prev').click(
			function() {
				$j('div#slider').cycle('resume');
				$j('a.slider-pause').removeClass('paused');
			}
		);

	// Resume slider when next is clicked, remove pause
		$j('a.slider-next').click(
			function() {
				$j('div#slider').cycle('resume');
				$j('a.slider-pause').removeClass('paused');
			}
		);
	if(readCookie("moj_logedin") == 1)	{
		$j("#div_moj").load("/get_menu.php",{},function() {
			$j('#link_moj').attr('href','http://moj.dom.pl/' +  readCookie('moj_logedin_username') + '/');	
			TB_init();
		});
	}
	$j("#search_help_input").keyup(function()	{
		search_help_delay(this);
	});	
	parent.top.search_help_active=0;
	$j("#search_help_input").blur(function()	{
		var value = jQuery.trim(this.value);
		clearTimeout(parent.top.search_help_time);
		if(value.length)	{
			//alert(parent.top.search_help_active);	
			if(!parent.top.search_help_active)	{
				$j("#search_help_content").html("");
				$j("#search_help_content").hide();	
			}
		}	else	{
			this.value='Szukany tekst...';
		}
	});
	}
);
if(window.location.pathname!='/')	{
	$j(function() {                  
	  $j("img.thumbnail, a.thumb > img, #footer a >img, #widget-blocks div a > img").lazyload({
	     placeholder : "/images/ajax.gif",
	     effect      : "fadeIn"
	  });
	});
}


//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}
function gtsp(id){get=document.getElementById(id); return get}

function el(id,dis){

    if(gtsp(id)) gtsp(id).style.display=dis

}

function param(id) { return (gtsp(id).innerHTML.indexOf('<embed')!=-1 || gtsp(id).innerHTML.indexOf('<EMBED')!=-1 || gtsp(id).innerHTML.indexOf('<param')!=-1 || gtsp(id).innerHTML.indexOf('<PARAM')!=-1 || gtsp(id).innerHTML.indexOf('<a')!=-1 || gtsp(id).innerHTML.indexOf('<A')!=-1 || gtsp(id).innerHTML.indexOf('<iframe')!=-1 || gtsp(id).innerHTML.indexOf('<IFRAME')!=-1);}

function D22D(id){D2D('t'+id,'r'+id)}

function D2D(d1id,d2id){if(gtsp(d2id)){vtmp=gtsp(d1id).innerHTML;gtsp(d1id).innerHTML='';el(d2id,'none');gtsp(d2id).innerHTML=vtmp;ObjReplace(d2id);el(d2id,'');}}

function ObjReplace(id){var objs = document.getElementById(id).getElementsByTagName('object');

    for(i=0;i<objs.length;i++) objs[i].outerHTML=objs[i].outerHTML;

}

function createCookie(name,value,days,domain) {
    if (days) {var date = new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires = "; expires="+date.toGMTString()} else var expires = "";
    if(domain) var dom = "; domain="+domain; else var dom="";
    document.cookie = name+"="+value+expires+"; path=/"+dom;
}

function moj_zapal(ob0,ob1,ob2,ob3,ob4) {
	if(ob0.checked==true){
		document.getElementById(ob1).style.visibility='hidden';
		document.getElementById(ob2).style.visibility='hidden';
		document.getElementById(ob3).style.display='';
		document.getElementById(ob4).style.display='none';
	}else{
		document.getElementById(ob1).style.visibility='';
		document.getElementById(ob2).style.visibility='';
		document.getElementById(ob3).style.display='none';
		document.getElementById(ob4).style.display='';
	}
}

function readCookie(name) {
    var nameEQ = name + "=";var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
        var c = ca[i];
	while (c.charAt(0)==' ') c = c.substring(1,c.length);
	    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
}

function eraseCookie(name,domain) {if (domain) createCookie(name,"",-1,domain); else createCookie(name,"",-1);}

/* moj.dom.pl - ulubione */
function moj_ulubione(ad_id) {
	var search_url=location.protocol+"//"+location.host+"/moj_ulubione.php";
	var user=readCookie('moj_logedin_id');
	var search_string="ad_id="+ad_id+"&user_id="+user;
	var akcja="do_moj_ulubione(wynik)";
	ajaxFunction(search_url,search_string,'get',akcja);
}

function do_moj_ulubione(kom)	{
	var zalogowany_moj=readCookie('moj_logedin');
	if(zalogowany_moj)	{
		if(kom==1)	{
			alert("Zapisano do ulubionych!");
		}	else	{
			alert("Błąd zapisu. Spróbuj jeszcze raz!");
		}
	}else{
		window.location="http://moj.dom.pl/user_home.php?"+kom;
	}
	
}

function ajaxFunction(url,params,met,akcja,ret){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
		if (ajaxRequest.overrideMimeType) { 
            ajaxRequest.overrideMimeType('text/xml; charset=iso-8859-2'); 
		} 
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Twoja przeglńÖdarka zawiodŇāa!");
				return false;
			}
		}
	}
	if(met=='post')	{
		ajaxRequest.open("POST", url, true);
	
		//Send the proper header information along with the request
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded;");
		ajaxRequest.setRequestHeader("Content-length", params.length);
		ajaxRequest.setRequestHeader("Connection", "close"); 
	
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			if(ret)	{
				wynik=ajaxRequest.responseXML;
				eval(akcja);	
			}	else	{
				wynik=ajaxRequest.responseText;
				setTimeout('eval("'+akcja+'")',800);
			}
		}
	}
	if(met=='get')	{
		ajaxRequest.open("GET", url+'?'+params, true);
		ajaxRequest.send(null);
	}
	if(met=='post')	{
		ajaxRequest.send(params); 
	}
}
/*dopisane z moj.dom.pl*/

TB_WIDTH = 0;
TB_HEIGHT = 0;

var TB_doneOnce = 0;
var TB_ready = false;
var TB_useReady = true;


// add smoothbox to href elements that have a class of .smoothbox
function TB_init()
{
  TB_ready = true;
	$j("a.smoothbox").each(function(el){el.onclick=TB_bind});
}

//window.addEvent('domready', TB_init);
//window.addEvent('load', TB_init);



function TB_bind(event)
{
  if( TB_useReady && !TB_ready ) return;
  
	var event = new Event(event);
	// stop default behaviour
	event.preventDefault();
	// remove click border
	this.blur();
	// get caption: either title or name attribute
	var caption = this.title || this.name || "";
	// get rel attribute for image groups
	var group = this.rel || false;
	// display the box for the elements href
	TB_show(caption, this.href, group);
    this.onclick = TB_bind;
    return false;
}

// called when the user clicks on a smoothbox link
function TB_show(caption, url, rel, loading, disable_close)
{
  if( TB_useReady && !TB_ready ) return;
  
  // set default closing mechanism
  if(!disable_close) { disable_close = 0; }

  // create iframe, overlay and box if non-existent

  if (!$j("#TB_overlay").length)
  {
  	if($j('#smoothbox_container').length)
    	$j(document.createElement('div')).attr('id', 'TB_overlay').appendTo($j('#smoothbox_container'));
    else
    	$j(document.createElement('div')).attr('id', 'TB_overlay').appendTo(document.body);
    $j('#TB_overlay').css('opacity','0.6');
    TB_overlaySize();
  }

  if (!$j("#TB_window").length)
  {
  	if($j('#smoothbox_container').length)
    	$j(document.createElement('div')).attr('id', 'TB_window').appendTo($j('#smoothbox_container'));
    else
    	$j(document.createElement('div')).attr('id', 'TB_window').appendTo(document.body);
    $j('#TB_window').css('display','none');
  	
  }
  else 
  {
    $j('#TB_window').remove(); //$('TB_window').dispose();
   	if($j('#smoothbox_container').length)
    	$j(document.createElement('div')).attr('id', 'TB_window').appendTo($j('#smoothbox_container'));
    else
    	$j(document.createElement('div')).attr('id', 'TB_window').appendTo(document.body);
    //$('#TB_window').css('opacity','0');
  }
 
  if(disable_close == 0) { $j("#TB_overlay").click( function () { TB_remove()}); } else { $j("#TB_overlay").click(); }
  window.onscroll = TB_position;
 
  // check if a query string is involved
  var baseURL = url.match(/(.+)?/)[1] || url;
  
  // CODE TO SHOW IFRAME
  var queryString = url.match(/\?(.+)/)[1];
  var params = TB_parseQuery(queryString);

  TB_WIDTH = (params['width'] * 1) + 30;
  TB_HEIGHT = (params['height'] * 1) + 40;
  
  var ajaxContentW = TB_WIDTH - 30, ajaxContentH = TB_HEIGHT - 45;
  
  
  if (url.indexOf('TB_iframe') != -1)
  {
    urlNoQuery = url.split('TB_');
    $j("#TB_window").html($j("#TB_window").html() + "<div id='TB_title'><div id='TB_ajaxWindowTitle'>" + caption + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>X</a></div></div><iframe frameborder='0' hspace='0' src='" + urlNoQuery[0] + "&in_smoothbox=true' id='TB_iframeContent' name='TB_iframeContent' scrolling='auto' style='width:" + (ajaxContentW + 29) + "px;height:" + (ajaxContentH + 17) + "px;' onload='TB_showWindow()'> </iframe>");
  }
  else
  {
    $j("#TB_window").html($j("#TB_window").html() + "<div id='TB_title'><div id='TB_ajaxWindowTitle'>" + caption + "</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>X</a></div></div><div id='TB_ajaxContent' style='width:" + ajaxContentW + "px;height:" + ajaxContentH + "px;'></div>");
  }
  
  $j("#TB_closeWindowButton").click(function () {TB_remove()});

  if (url.indexOf('TB_inline') != -1)
  {
    $j("#TB_ajaxContent").html($j(params['inlineId']).html());
    TB_position();
    TB_showWindow();
  }
  else if (url.indexOf('TB_iframe') != -1)
  {
    //alert("UHOH1");
    TB_position();
    if (frames['TB_iframeContent'] == undefined) {//be nice to safari
      $j(document).keyup(function(e){
                    var key = e.keyCode;
                    if (key == 27) {
                        TB_remove()
                    }
      });
      TB_showWindow();
    }
  }
  else
  {
    //alert("UHOH2");
    var handlerFunc = function(){
          TB_position();
          TB_showWindow();
    };
    new Request.HTML({
      method: 'get',
      update: $j("#TB_ajaxContent"),
      onComplete: handlerFunc
    }).get(url);
  }

  window.onresize = function()
  {
    TB_position();
    TB_overlaySize();
  }

  document.onkeyup = function(event)
  {
    var event = new Event(event);
    if (event.code == 27) { // close
        TB_remove();
    }
  }

}

//helper functions below

function TB_showWindow()
{
  if( TB_useReady && !TB_ready ) return;
  
  if (TB_doneOnce == 0) {
     TB_doneOnce = 1;
      
      $j('#TB_window').fadeIn(1000);
  }
  else {
      $j('#TB_window').css('opacity', '1');
  }
}

function TB_remove()
{
  if( TB_useReady && !TB_ready ) return;
  
  //$("#TB_overlay").click();
  document.onkeyup = null;
  document.onkeydown = null;
  
//  if ($('#TB_closeWindowButton')) 
//     $("#TB_closeWindowButton").click();

  $j('#TB_window').fadeOut(250, function(){
  	$j('#TB_window').remove(); //$('TB_window').dispose();
  });
  
  $j('#TB_overlay').fadeOut(400, function(){
  	$j('#TB_overlay').remove(); //$('TB_overlay').dispose();
  });
  
  window.onscroll = null;
  window.onresize = null;
  TB_init();
  TB_doneOnce = 0;
  return false;
}

function TB_position()
{
  if( TB_useReady && !TB_ready ) return;
  
  $j('#TB_window').animate({
    width: TB_WIDTH + 'px',
    left: ($j(window).scrollLeft() + ($j(window).width() - TB_WIDTH) / 2) + 'px',
    top: ($j(window).scrollTop() + ($j(window).height() - TB_HEIGHT) / 2) + 'px'
	},150);	
}

function TB_overlaySize()
{
  if( TB_useReady && !TB_ready ) return;
  
  // we have to set this to 0px before so we can reduce the size / width of the overflow onresize 

  $j("#TB_overlay").css({
    "height": '0px',
    "width": '0px'
  });

  $j("#TB_overlay").css({
    "height": ($j(document).height() + 'px'),
    "width": ($j(document).width() + 'px')
  });

}


function TB_parseQuery(query)
{
  if( TB_useReady && !TB_ready ) return;
  
  // return empty object
  if (!query)  return {};
  var params = {};
  
  // parse query
  var pairs = query.split(/[;&]/);
  for (var i = 0; i < pairs.length; i++)
  {
    var pair = pairs[i].split('=');
    if (!pair || pair.length != 2) continue;
    // unescape both key and value, replace "+" with spaces in value
    params[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' ');
  }
  return params;
}


var open_menu;
var current_timeout = new Array();

function showMenu(id1, id2)
{
  if($j('#' + id1).length)
  {
    if($j('#' + id1).css('display')=='none')
    {
      //alert(open_menu);
      if($j('#' + open_menu).length) {hideMenu($j('#' + open_menu)); }
      $j('#' + id1).css('display','inline');
     //startMenuTimeout($j('#' + id1));

	$j('#' + id2).bind("mouseleave",function(e) {startMenuTimeout($j('#' + id1));});
	$j('#' + id1).bind("mouseover",function(e){killMenuTimeout($j('#' + id1)); });
	$j('#' + id1).bind("mouseout",function(e) {startMenuTimeout($j('#' + id1)); });
	  open_menu = id1;
    }
  }
}

function killMenuTimeout(divEl)
{
  clearTimeout(current_timeout[divEl.id]);
  current_timeout[divEl.id] = '';
}

function startMenuTimeout(divEl)
{
//	alert(divEl.id);
  if(current_timeout[divEl.id] == '') {
    current_timeout[divEl.id] = setTimeout(function() { hideMenu(divEl); }, 1000);
  }
}

function hideMenu(divEl)
{
  divEl.css('display','none');
  current_timeout[divEl.id] = '';
  divEl.unbind("mouseover");
  divEl.unbind("mouseout");
}

function SwapOut(id1) {
  $j('#' + id1).src = Rollarrow1.src;
  return true;
}

function SwapBack(id1) {
  $j('#' + id1).src = Rollarrow0.src;
  return true;
}
function urldecode( str ) {
    
    var hash_map = {}, ret = str.toString(), unicodeStr='', hexEscStr='';
    
    var replacer = function(search, replace, str) {
        var tmp_arr = [];
        tmp_arr = str.split(search);
        return tmp_arr.join(replace);
    };
    
    // The hash_map is identical to the one in urlencode.
    hash_map["'"]   = '%27';
    hash_map['(']   = '%28';
    hash_map[')']   = '%29';
    hash_map['*']   = '%2A';
    hash_map['~']   = '%7E';
    hash_map['!']   = '%21';
    hash_map['%20'] = '+';
    hash_map['\u00DC'] = '%DC';
    hash_map['\u00FC'] = '%FC';
    hash_map['\u00C4'] = '%D4';
    hash_map['\u00E4'] = '%E4';
    hash_map['\u00D6'] = '%D6';
    hash_map['\u00F6'] = '%F6';
    hash_map['\u00DF'] = '%DF';
    hash_map['\u20AC'] = '%80';
    hash_map['\u0081'] = '%81';
    hash_map['\u201A'] = '%82';
    hash_map['\u0192'] = '%83';
    hash_map['\u201E'] = '%84';
    hash_map['\u2026'] = '%85';
    hash_map['\u2020'] = '%86';
    hash_map['\u2021'] = '%87';
    hash_map['\u02C6'] = '%88';
    hash_map['\u2030'] = '%89';
    hash_map['\u0160'] = '%8A';
    hash_map['\u2039'] = '%8B';
    hash_map['\u0152'] = '%8C';
    hash_map['\u008D'] = '%8D';
    hash_map['\u017D'] = '%8E';
    hash_map['\u008F'] = '%8F';
    hash_map['\u0090'] = '%90';
    hash_map['\u2018'] = '%91';
    hash_map['\u2019'] = '%92';
    hash_map['\u201C'] = '%93';
    hash_map['\u201D'] = '%94';
    hash_map['\u2022'] = '%95';
    hash_map['\u2013'] = '%96';
    hash_map['\u2014'] = '%97';
    hash_map['\u02DC'] = '%98';
    hash_map['\u2122'] = '%99';
    hash_map['\u0161'] = '%9A';
    hash_map['\u203A'] = '%9B';
    hash_map['\u0153'] = '%9C';
    hash_map['\u009D'] = '%9D';
    hash_map['\u017E'] = '%9E';
    hash_map['\u0178'] = '%9F';
 
    for (unicodeStr in hash_map) {
        hexEscStr = hash_map[unicodeStr]; // Switch order when decoding
        ret = replacer(hexEscStr, unicodeStr, ret); // Custom replace. No regexing
    }
    
    // End with decodeURIComponent, which most resembles PHP's encoding functions
    ret = decodeURIComponent(ret);
 
    return ret;
}
function user_moj_log()	{
	if(readCookie('moj_logedin'))	{
		var username = readCookie('moj_logedin_username');
		var displayname = readCookie('moj_logedin_displayname');
		gtsp('user_moj_log_a').href='http://moj.dom.pl/' + username;
		if(displayname)	{
			gtsp('user_moj_log_a').innerHTML='Witaj, ' + urldecode(displayname) + '!';
		}	else	{
			gtsp('user_moj_log_a').innerHTML='Witaj, ' + urldecode(username) + '!';
		}
		el('user_moj_not_log','none');
		el('user_moj_log','');
	}
}

function user_moj_log2()	{
	if($j("#profil_link").length > 0) {
		$j("#profil_link img").load(function() {
			do_log2();
		});
	}
}
function do_log2() {
	if(readCookie('moj_logedin'))	{
		var username = readCookie('moj_logedin_username');
		var displayname = readCookie('moj_logedin_displayname');
		gtsp('profil_link').href='http://moj.dom.pl/' + username;
		gtsp('loged_profil').href='http://moj.dom.pl/' + username;
		username_short = username;
		if(username.length > 15)
			var username_short = username.substr(0,12)+'...';
		gtsp('loged_profil').innerHTML=username_short;
		gtsp('profil_tresc').innerHTML='...<a href="http://moj.dom.pl/zdjecia_z_budowy.html">zdjęcia z budowy</a><span class="moj_or">&nbsp;</span><br/>...<a href="http://moj.dom.pl/internetowy_dziennik_budowy.html">dziennik budowy</a><span class="moj_or">&nbsp;</span>';
		el('user_profil_not_log','none');
		el('user_profil_log','');
	}
}
function user_moj_log3()	{
	if($j("#profil_link").length > 0) {
		$j("#profil_link img").load(function() {
			do_log3();
		});
	}
}
function do_log3() {
	if(readCookie('moj_logedin'))	{
		$j('#div_moj').css('display','block');
	}
}
function search_help_delay(obj)	{
	var value = jQuery.trim(obj.value);
	clearTimeout(parent.top.search_help_time);
	if(value.length >2)	{
		parent.top.search_help_time = setTimeout("search_help('"+obj.value+"')",100);
	}	else	{
		$j("#search_help_content").html("");
		$j("#search_help_content").hide();
	}
}
var search_help_buffer = new Array();
function search_help(obj)	{
for(i=0;i<search_help_buffer.length;i++)	{
	if(search_help_buffer[i]==obj)	{
		if(search_help_buffer[i+1])	{
			$j("#search_help_content").html(search_help_buffer[i+1]);
			if($j("#r300x250").css("display") != "none")
				$j('#search_help_content').css("top", "315px");
			$j('#search_help_content').show();
		}	else	{
			$j("#search_help_content").html("");
			$j("#search_help_content").hide();
		}
		return false;
	}
}
$j.ajax({
  type: "GET",
  url: '/search_help.php',
  data: 'search=' + obj,
  dataType: "xml",
  success: function(xml){
          //alert(xml);
          //return;
          var toPrint = '';
		  var ct=0;
		  $j(xml).find('res').each(function(){
			if(!ct)	{
				$j('#search_help_content').html("");
				$j('<div class="item_search"></div>').html('<span>PODPOWIEDZI:</span>').appendTo('#search_help_content');
			}
			var ad_title = $j(this).find('res_title').text();
			var ad_link = $j(this).find('res_link').text();
			//alert(ad_title);
			$j('<div class="item_search"></div>').html('<a style="color:#03318B;" href="'+ad_link+'">'+ad_title+'</a>').appendTo('#search_help_content');
		  
		  	ct++;
		  });
		  var ct2=0;
		  $j(xml).find('res2').each(function(){
				if(!ct && !ct2)	{
					$j('#search_help_content').html("");
					$j('<div class="item_search"></div>').html('<span>PROJEKTY:</span>').appendTo('#search_help_content');
				}	else if(ct && !ct2)	{
					$j('<div class="item_search"></div>').html('<span>PROJEKTY:</span>').appendTo('#search_help_content');					
				}
				var ad_title = $j(this).find('res2_title').text();
				var ad_link = $j(this).find('res2_link').text();
				var ad_foto = $j(this).find('res2_foto').text();
				//alert(ad_title);
				$j('<div class="item_search" style="clear:both;"></div>').html('<a href="'+ad_link+'"><img style="float:left;margin:3px 3px 0 0;" src="'+ad_foto+'" alt="'+ad_title+'" width="50" height="33"/></a><a style="color:#03318B;" href="'+ad_link+'">'+ad_title+'</a>').appendTo('#search_help_content');
			  
			  	ct2++;
			  });		  
		  if(ct || ct2)	{
		  	search_help_buffer.push(obj);
		  	search_help_buffer.push($j('#search_help_content').html());
		  	$j('#search_help_content a').mouseover(function()	{
		  		parent.top.search_help_active=1;
		  	});
		  	$j('#search_help_content a').mouseout(function()	{
		  		parent.top.search_help_active=0;
		  	});
			if($j("#r300x250").css("display") != "none")
				$j('#search_help_content').css("top", "315px");
		  	$j('#search_help_content').show();
		  	
		  }	else	{
		  	search_help_buffer.push(obj);
		  	search_help_buffer.push("");
		  	$j('#search_help_content').hide();		  
		  }
  },
  error: function(){
	search_help_buffer.push(obj);
	search_help_buffer.push("");
  	$j('#search_help_content').html("");
  	$j('#search_help_content').hide();
  }
});

}

function wykop() {
	try {
    	var uri = document.location.href;
    	var title = document.getElementsByTagName('title')[0].innerHTML;
    	var md = document.getElementsByTagName('meta');
    	var desc = '';
    	for (var i = 0; i < md.length; i++) {
    		if (md[i].name && md[i].name.match(/description/i)) {
    			desc = md[i].getAttribute('content');
    			break;
    		}
    	}
    	document.location.href =
    	'http://www.wykop.pl/dodaj?url='+uri+'&title='+encodeURIComponent(title)+'&desc='+encodeURIComponent
    	(desc);
    } catch(e) {} 	
}
function facebook() {
	try {
    	var uri = document.location.href;
    	var title = document.getElementsByTagName('title')[0].innerHTML;
    	var md = document.getElementsByTagName('meta');
    	document.location.href =
    	'http://www.facebook.com/sharer.php?u='+uri+'&t='+encodeURIComponent(title);
    } catch(e) {} 	
}

function fokus() {
	$j('#search_help_input').val('');
	$j('#search_help_input').focus();
	$j('#search_help_input').css('color','black');
}

window.onload=fokus;