﻿/**
* @author      Michael J. I. Jackson <mjijackson@gmail.com>
* @copyright   2007 Michael J. I. Jackson
* @license     http://www.gnu.org/licenses/lgpl-3.0.txt GNU LGPL 3.0
* @version     SVN: $Id: shadowbox-jquery.js 75 2008-02-21 16:51:29Z mjijackson $
*/
eval(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 } ('a(k 3==\'12\'){10\'R n K g, 3 J E D.\';}4 g={};g.17={F:2(0,5){b 3(0).C(5)},I:2(0,5,B){a(k 5!=\'1a\'){4 l={};l[5]=B;5=l}3(0).C(5)},L:2(0){b(k 0==\'P\')?Q.S(0):0},A:2(0){3(0).A()},14:2(e){b e.19},i:2(e){e=e.1b||e;a(e.i){e.i()}1c{e.1d=1e}},1g:2(0,9,8){3(0).Z(9,8)},G:2(0,9,8){3(0).H(9,8)},m:2(0,f,c,z){c=M.N(c*O);4 o={};y(4 p q f){y(4 p q f){o[p]=T(f[p].n);a(p!=\'U\')o[p]+=\'V\'}}3(0).m(o,c,W,z)}};(2($){$.X.Y=2(x){b 6.11(2(){4 $6=$(6);4 7=$.13({},x||{},$.v?$6.v():$.15?$6.16():{});4 j=6.18||\'\';7.r=u((j.s(/w:(\\d+)/)||[])[1])||7.r;7.t=u((j.s(/h:(\\d+)/)||[])[1])||7.t;g.1f($6,7)})}})(3);', 62, 79, 'el||function|jQuery|var|style|this|opts|handler|name|if|return|duration|||obj|Shadowbox||preventDefault|cls|typeof|temp|animate|to|||in|width|match|height|parseInt|metadata||options|for|callback|remove|value|css|found|not|getStyle|removeEvent|unbind|setStyle|library|load|get|Math|round|1000|string|document|Unable|getElementById|String|opacity|px|null|fn|shadowbox|bind|throw|each|undefined|extend|getTarget|meta|data|lib|className|target|object|browserEvent|else|returnValue|false|setup|addEvent'.split('|'), 0, {}));
eval(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 } ('5(1d D==\'2u\'){3C\'ae 1B a2 D, a0 9p 9n 9m 4l.\';}(b(){4 4m=\'1.0\';4 9={3e:\'\',6U:\'../95/6N/91.6J\',15:M,6H:\'6G\',4I:\'/4O/8u.1P\',6p:\'#8r\',6i:0.35,6h:\'/6N/1q-85.6f\',6e:M,48:M,3m:M,3n:0.35,51:0.35,69:M,53:O,67:M,66:\'32\',3F:20,3G:\'1Y\',54:64,55:64,62:O,61:[27],5S:[\'n\',39],5Q:[\'p\',37],44:12,49:12,3k:12,3V:12,5P:\'F\',5O:O,1C:{5N:\'7y\',1K:\'1K\',1L:\'<23 2o="5a">C</23>7s\',1n:\'<23 2o="5a">N</23>2h\',1I:\'<23 2o="5a">P</23>7i\',1k:{5B:\'5l 5n 5t 42 <a 1j="{0}">{1}</a> 5o 5y 1B 5m 1p z.\',5A:\'5l 5n 5t 9h 42 <a 1j="{0}">{1}</a> 9d <a 1j="{2}">{3}</a> 5o 1c 1B 5m 1p z.\',5f:\'5l 5n 5t 5f 42 <a 1j="{0}">{1}</a> 8X 42 <a 1j="{2}">{3}</a> 5o 5y 1B 5m 1p z.\'}},1k:{2L:{S:\'5L\',V:\'2U://2S.8T.2T/8H/8F/\'},X:{S:\'3N\',V:\'2U://2S.5Z.2T/63/8C/\'},1e:{S:\'65 68 8q\',V:\'2U://2S.8p.2T/6b/8g/\'},1O:{S:\'6o\',V:\'2U://2S.88.2T/87.6r\'}},21:{6s:\'<B E="3p"></B>\'+\'<B E="3r">\'+\'<B E="1f">\'+\'<B 2o="80">\'+\'<B E="3u">\'+\'<B E="4N"></B>\'+\'</B>\'+\'<B E="4M">\'+\'<B E="3x"></B>\'+\'</B>\'+\'</B>\'+\'<B E="4L">\'+\'<B E="3z"></B>\'+\'<B E="4K"></B>\'+\'</B>\'+\'</B>\'+\'</B>\',1K:\'<1l 2D="{0}" 7K="{1}" />\'+\'<23><a 1j="3c:D.1L();">{2}</a></23>\',2a:\'<B E="7E">{0}</B>\',1L:\'<B E="7B">\'+\'<a 1j="3c:D.1L();" E="1L" 2d="7t">&7o;</a>\'+\'</B>\',1n:\'<B E="7n">\'+\'<a 1j="3c:D.1n();">{0}</a>\'+\'</B>\',1I:\'<B E="7m">\'+\'<a 1j="3c:D.4F();">{0}</a>\'+\'</B>\'},2h:{1l:[\'6f\',\'7j\',\'7h\',\'6J\',\'7g\'],X:[\'7f\',\'7e\',\'7d\',\'4C\',\'a7\'],1e:[\'9G\',\'9F\',\'4B\'],2t:[\'9s\',\'9l\',\'9k\'],29:[\'9j\',\'9b\',\'98\',\'96\',\'6r\',\'U\',\'92\',\'90\',\'8R\',\'8M\',\'8L\',\'8z\',\'8s\',\'8o\',\'8m\',\'8k\',\'8e\']}};4 2Y=12;4 8=D.8a;4 Z={1Y:/(1l|1P|1U)/,1q:/(1l|29|U|2n)/,1P:/\\.1P\\s*$/i,1U:/\\.1U\\s*$/i,4p:/:\\/\\/(.*?)[:\\/]/,2n:/#(.+)$/,1w:/^(6Q|6W)5v/i,1Q:/^(6Q|6W)5v\\[(.*?)\\]/i,1u:/^1u-(\\w+)/,1i:/\\s*([a-7M]*?)\\s*=\\s*(.+)\\s*/,71:/^(?:7x|7q|7l|1l|7k|F|9Q|3S|9f|8n|89|1i|7Q)$/i};4 1A=[];4 u;4 T;4 34=9.54;4 36=9.55;4 4f=0;4 4e=0;4 1R;4 5u=O;4 2y=O;4 17;4 47;4 2v;4 1H=3h.7C.76();4 2z=Q.4c==\'82\',7b=1H.1h("7P")>-1,1G=1H.1h(\'79\')>-1,78=1H.1h(\'79 7\')>-1,4i=1G&&!2z,30=(/81|73/).1x(1H),4k=30&&!!(Q.8f),2G=!30&&1H.1h(\'8A\')>-1,8B=(1H.1h(\'6b\')!=-1||1H.1h(\'94\')!=-1),3R=(1H.1h(\'9i\')!=-1||1H.1h(\'9q 9w x\')!=-1),a9=(1H.1h(\'7c\')!=-1);4 3P=1G&&!78;4 1c=12;5(3h.1c&&3h.1c.G){4 1S=b(3M){4 2I=O;1b(4 i=0,J=3h.1c.G;i<J;++i){5(3h.1c[i].S.1h(3M)>-1){2I=M;1m}}k 2I};4 1O=1S(\'6o\');4 1c={2L:1S(\'7Z 5L\'),X:1S(\'3N\'),1e:!1O&&1S(\'65 68\'),1O:1O}}q{4 1S=b(3M){4 2I=O;4q{4 6P=1V 8b(3M);5(6P){2I=M}}4s(e){}k 2I};4 1c={2L:1S(\'6O.6O\'),X:1S(\'3N.3N\'),1e:1S(\'8h.8j\'),1O:O}}4 1D=b(o,e){1b(4 p 6M e)o[p]=e[p];k o};4 3q=b(f){k 1d f.3o==\'6K\'&&(f.3o.4w()==\'A\'||f.3o.4w()==\'8E\')};8.2B=b(){4 l=28.8U;4 3l=Q.4c;5((3l||1G)&&!7b){l=2z?Q.2x.4x:Q.2w.4x}k l};8.3i=b(){4 j=28.9c;4 3l=Q.4c;5(3l||1G){j=2z?Q.2x.4y:Q.2w.4y}k j};8.6F=b(){4 2s=2z?Q.2x.2s:Q.2w.2s;5(30||4k){2s=Q.2w.2s}k 1E.2J(2s,8.2B())};8.6C=b(){4 40=2z?Q.2x.40:Q.2w.40;k 1E.2J(40,8.3i())};4 3Z=b(f){5(1G){5(1d f.1g.3X==\'6K\'&&(/6A/i).1x(f.1g.3X)){f.1g.3X=\'\'}}q{f.1g.1W=\'\';f.1g[\'-3W-1W\']=\'\';f.1g[\'-73-1W\']=\'\'}};4 6y=b(f,3j,3U,H){5(9.15){8.W(f,\'1W\',0);f.1g.1r=\'2j\';8.15(f,{1W:{1B:3j}},3U,b(){5(3j==1)3Z(f);5(1d H==\'b\')H()})}q{5(3j==1){3Z(f)}q{8.W(f,\'1W\',3j)}f.1g.1r=\'2j\';5(1d H==\'b\')H()}};4 4E=b(f,3U,H){4 2i=b(){f.1g.1r=\'3f\';3Z(f);5(1d H==\'b\')H()};5(9.15){8.15(f,{1W:{1B:0}},3U,2i)}q{2i()}};4 1X=b(f,U){f=8.v(f);5(f.6x){f.6x(\'7r\',U);k f.3d}5(f.3d){4 3S=f.7u.7v();3S.7w(f.3d);4 6w=3S.7z(U);f.7A(6w);k f.3d}q{f.22=U;k f.3d}};4 6u=b(f,U){f=8.v(f);f.22=U;k f.7D};4 3b=b(f){4 h=1E.2J(f.6t,f.4x);5(!h){h=K(8.1a(f,\'l\'),10)||0;5(!4i){h+=K(8.1a(f,\'3t-13\'),10)+K(8.1a(f,\'3t-4a\'),10)+K(8.1a(f,\'2b-13-j\'),10)+K(8.1a(f,\'2b-4a-j\'),10)}}k h};4 83=b(f){4 w=1E.2J(f.84,f.4y);5(!w){w=K(8.1a(f,\'j\'),10)||0;5(!4i){w+=K(8.1a(f,\'3t-38\'),10)+K(8.1a(f,\'3t-33\'),10)+K(8.1a(f,\'2b-38-j\'),10)+K(8.1a(f,\'2b-33-j\'),10)}}k w};4 6q=b(V){5(Z.1l.1x(V))k\'1l\';4 R=V.R(Z.4p);4 4S=R?Q.4p==R[1]:O;5(V.1h(\'#\')>-1&&4S)k\'2n\';4 4T=V.1h(\'?\');5(4T>-1)V=V.8d(0,4T);5(Z.1P.1x(V))k 1c.2L?\'1P\':\'1u-1P\';5(Z.1U.1x(V))k 1c.2L?\'1U\':\'1u-1U\';5(Z.X.1x(V))k 1c.X?\'X\':\'1u-X\';5(Z.1e.1x(V)){5(1c.1e){k\'1e\'}q 5(1c.1O){k\'X\'}q{k 3R?(1c.X?\'1u-1O\':\'1u-6l\'):\'1u-1e\'}}q 5(Z.2t.1x(V)){5(1c.X){k\'X\'}q 5(1c.1e){k\'1e\'}q{k 3R?\'1u-X\':\'1u-2t\'}}q 5(!4S||Z.29.1x(V)){k\'29\'}k\'1u\'};4 4V=b(1Z){4 F;5(3q(1p)){F=1p}q{F=8.6g(1Z);8i(!3q(F)&&F.6d){F=F.6d}}D.4Y(F);5(u.G)8.8l(1Z)};4 6c=b(c){4 52=1D({},c);5(!c.1Q){u=[52];T=0}q{u=[];4 31,26;1b(4 i=0,J=1A.G;i<J;++i){26=1A[i];5(26.1Q){5(26.z==c.z&&26.1Q==c.1Q&&26.2d==c.2d){31=u.G}5(26.1Q==c.1Q){u.6a(1D({},26))}}}5(31==12){u.8t(52);31=0}T=31}4 R,r;1b(4 i=0,J=u.G;i<J;++i){r=O;5(u[i].Y==\'1u\'){r=M}q 5(R=Z.1u.56(u[i].Y)){5(9.5P==\'F\'){u[i].Y=\'U\';4 m;2V(R[1]){18\'2t\':m=1s.1o(9.1C.1k.5f,9.1k.X.V,9.1k.X.S,9.1k.1e.V,9.1k.1e.S);1m;18\'6l\':m=1s.1o(9.1C.1k.5A,9.1k.X.V,9.1k.X.S,9.1k.1O.V,9.1k.1O.S);1m;32:5(R[1]==\'1P\'||R[1]==\'1U\')R[1]=\'2L\';m=1s.1o(9.1C.1k.5B,9.1k[R[1]].V,9.1k[R[1]].S)}u[i]=1D(u[i],{l:8I,j:8J,z:\'<B 2o="8K">\'+m+\'</B>\'})}q{r=M}}q 5(u[i].Y==\'2n\'){4 R=Z.2n.56(u[i].z);5(R){4 f;5(f=8.v(R[1])){u[i].z=f.22}q{3C\'5Y 5V 4l 8N E \'+R[1];}}q{3C\'5Y 5V E 4l 1b 2n z\';}}5(r){u.8O(i,1);5(i<T)--T;--i}}};4 5M=b(){4 F=u[T];5(!F)k;4 2M=8.v(\'3x\');2M.22=(F.2d)?F.2d:\'\';4 1F=8.v(\'4N\');1F.22=\'\';5(9.69){1F.22=1s.1o(9.21.1L,9.1C.1L);5(u.G>1){5(9.53){1X(1F,1s.1o(9.21.1n,9.1C.1n));1X(1F,1s.1o(9.21.1I,9.1C.1I))}q{5((u.G-1)>T){1X(1F,1s.1o(9.21.1n,9.1C.1n))}5(T>0){1X(1F,1s.1o(9.21.1I,9.1C.1I))}}}}5(u.G>1&&9.67){4 2a=\'\';5(9.66==\'8V\'){1b(4 i=0,J=u.G;i<J;++i){2a+=\'<a 1j="3c:D.3A(\'+i+\');"\';5(i==T){2a+=\' 2o="8Z"\'}2a+=\'>\'+(i+1)+\'</a>\'}}q{2a=(T+1)+\' 5K \'+u.G}1X(1F,1s.1o(9.21.2a,2a))}};4 5e=b(H){4 93=3b(8.v(\'4M\'));4 3w=0-3b(8.v(\'3u\'));4 2M=8.v(\'3x\');4 1F=8.v(\'4N\');5(9.15&&H){8.15(1F,{5J:{1B:0}},0.2,H)}q{8.W(1F,\'5J\',\'5I\')}};4 2O=b(H){4 2M=8.v(\'3x\');4 3w=8.v(\'3u\');5(9.15){5(2M.22!=\'\'){}8.15(3w,{33:{1B:-14},13:{1B:-14}},0.35,H)}q{5(2M.22!=\'\'){}8.W(3w,\'2P-13\',\'5I\');H()}};4 5F=b(){17={x:0,y:0,2Q:12,2R:12}};4 46=b(2K){5(2K){5F();4 5p=[\'5q:5r\',\'5s:\'+(2G?\'-3W-5x\':\'9L\')];5p.6a(1G?\'5w-6Z:#a8;3X:6A(1W=0)\':\'5w-6Z:4b\');1X(\'3z\',\'<B E="2r" 1g="\'+5p.2q(\';\')+\'"></B>\');8.24(8.v(\'2r\'),\'5z\',5k)}q{4 d=8.v(\'2r\');5(d){8.2N(d,\'5z\',5k);8.3K(d)}}};4 5k=b(1Z){17.2Q=1Z.5C;17.2R=1Z.5D;47=8.v(\'1J\');8.24(Q,\'5E\',5j);8.24(Q,\'5G\',5i);5(2G)8.W(8.v(\'2r\'),\'5s\',\'-3W-7p\')};4 5i=b(){8.2N(Q,\'5E\',5j);8.2N(Q,\'5G\',5i);5(2G)8.W(8.v(\'2r\'),\'5s\',\'-3W-5x\')};4 5j=b(1Z){4 5h=1Z.5D-17.2R;17.2R=17.2R+5h;17.y=1E.2J(1E.5H(0,17.y+5h),4f-34);8.W(47,\'13\',17.y+\'1M\');4 5g=1Z.5C-17.2Q;17.2Q=17.2Q+5g;17.x=1E.2J(1E.5H(0,17.x+5g),4e-36);8.W(47,\'38\',17.x+\'1M\')};4 5d=b(){4 c=u[T];5(!c)k;5M();2V(c.Y){18\'1l\':1R=1V 5c();1R.5b=b(){4 h=c.l?K(c.l,10):1R.l;4 w=c.j?K(c.j,10):1R.j;2H(h,w,b(I){2O(b(){2f({11:\'1l\',l:I.2l,j:I.2e,2D:c.z,1g:\'5q:5r\'});5(I.2W&&9.3G==\'17\'){46(M);8.W(8.v(\'2r\'),{l:I.2l+\'1M\',j:I.2e+\'1M\'})}2X()})});1R.5b=b(){}};1R.2D=c.z;1m;18\'1P\':18\'1U\':18\'X\':18\'1e\':4 L=D.5R(c);2H(L.l,L.j,b(){2O(b(){2f(L);2X()})});1m;18\'29\':4 h=c.l?K(c.l,10):8.2B();4 w=c.j?K(c.j,10):8.3i();4 z={11:\'29\',S:\'1J\',l:\'3T%\',j:\'3T%\',7F:\'0\',7G:\'0\',7H:\'0\',7I:\'7J\'};2H(h,w,b(I){2O(b(){2f(z);4 5T=(1G)?8.v(\'1J\').7L:28.5U[\'1J\'];5T.7N=c.z;2X()})});1m;18\'U\':18\'2n\':4 h=c.l?K(c.l,10):8.2B();4 w=c.j?K(c.j,10):8.3i();4 z={11:\'B\',59:\'U\',U:c.z};2H(h,w,b(){2O(b(){2f(z);2X()})});1m;32:3C\'D 7O 4Y z 5K Y \'+c.Y;}5(u.G>0){4 1n=u[T+1];5(!1n){1n=u[0]}5(1n.Y==\'1l\'){4 5W=1V 5c();5W.2D=1n.1j}4 1I=u[T-1];5(!1I){1I=u[u.G-1]}5(1I.Y==\'1l\'){4 5X=1V 5c();5X.2D=1I.1j}}};4 2f=b(c){4 E=\'1J\';4 z=8.v(E);5(z){2V(z.3o.4w()){18\'7R\':4 F=u[(c?T-1:T)];5(F.Y==\'1e\'&&1G){4q{1J.19.7S();1J.7T=\'7U-7V.4B\';28.1J=b(){}}4s(e){}}q 5(F.Y==\'X\'&&30){4q{Q.1J.7W()}4s(e){}z.22=\'\'}7X(b(){8.3K(z)},10);1m;18\'7Y\':8.3K(z);5(2G)58 28.5U[E];1m;32:8.3K(z)}}5(c){5(!c.E)c.E=E;k 1X(\'3z\',D.57(c))}k 12};4 2X=b(){4 c=u[T];5(!c)k;60(b(){3O(M);5(9.49&&1d 9.49==\'b\'){9.49(c)}})};4 2H=b(l,j,H){34=l;36=j;4 2p=Z.1Y.1x(u[T].Y);4 I=2Z(34,36,2p);5(H){4 2i=b(){H(I)};2V(9.6H){18\'86\':2F(I.l,I.13,M,b(){2E(I.j,M,2i)});1m;18\'6G\':2E(I.j,M,b(){2F(I.l,I.13,M,2i)});1m;32:2E(I.j,M);2F(I.l,I.13,M,2i)}}q{2E(I.j,O);2F(I.l,I.13,O);5(9.3G==\'1Y\'&&2p){4 z=8.v(\'1J\');5(z){z.l=I.2l;z.j=I.2e}}}};4 2Z=b(2c,25,2p){5(1d 2p==\'2u\')2p=O;4 l=2c=K(2c);4 j=25=K(25);4 1T=8.v(\'4L\');4 3s=8.2B();4 43=K(8.1a(1T,\'2b-13-j\'),10)+K(8.1a(1T,\'2b-4a-j\'),10)+K(8.1a(1T,\'2P-13\'),10)+K(8.1a(1T,\'2P-4a\'),10)+3b(8.v(\'4M\'))+3b(8.v(\'3u\'))+(2*9.3F);5((l+43)>=3s){l=3s-43}4 4Z=8.3i();4 4X=K(8.1a(1T,\'2b-38-j\'),10)+K(8.1a(1T,\'2b-33-j\'),10)+K(8.1a(1T,\'2P-38\'),10)+K(8.1a(1T,\'2P-33\'),10);4 4W=4X+(2*9.3F);5((j+4W)>=4Z){j=4Z-4W}4 2W=O;4 2l=2c;4 2e=25;4 41=9.3G;5(2p&&(41==\'1Y\'||41==\'17\')){4 3Y=(2c-l)/2c;4 3Q=(25-j)/25;5(41==\'1Y\'){5(3Y>3Q){j=1E.4U((25/2c)*l)}q 5(3Q>3Y){l=1E.4U((2c/25)*j)}2e=j;2l=l}q{4 F=u[T];5(F)2W=F.Y==\'1l\'&&(3Y>0||3Q>0)}}k{l:l,j:j+4X,2l:2l,2e:2e,13:((3s-(l+43))/2)+9.3F,2W:2W}};4 3J=b(){4 1f=8.v(\'1f\');4 3I=Q.2x.6j;4 6k=3I+1E.4U((8.2B()-(1f.6t||0))/2);8.W(1f,\'13\',6k+\'1M\')};4 2F=b(l,13,15,H){l=K(l);4f=l;4 4R=8.v(\'3z\');5(15&&9.15){8.15(4R,{l:{1B:l}},9.3n,H)}q{8.W(4R,\'l\',l+\'1M\');5(1d H==\'b\')H()}5(3P){3J();8.24(28,\'3I\',3J);13+=Q.2x.6j}4 1f=8.v(\'1f\');5(15&&9.15){8.15(1f,{13:{1B:13}},9.3n)}q{8.W(1f,\'13\',13+\'1M\')}};4 2E=b(j,15,H){j=K(j);4e=j;4 1f=8.v(\'1f\');5(15&&9.15){8.15(1f,{j:{1B:j}},9.3n,H)}q{8.W(1f,\'j\',j+\'1M\');5(1d H==\'b\')H()}};4 3O=b(2K){5(!9.62)k;5(2K){Q.6m=6n}q{Q.6m=\'\'}};4 3H=b(4Q,2C,2k){k(4Q.1h(2C)!=-1||4Q.1h(2k)!=-1)};4 6n=b(e){4 2k=e?e.8v:8w.8x;4 2C=1s.8y(2k).76();5(3H(9.61,2C,2k)){D.1L()}q 5(3H(9.5Q,2C,2k)){D.4F()}q 5(3H(9.5S,2C,2k)){D.1n()}};4 4P=b(2K){4 3B=(2K?\'2j\':\'3f\');4 4J=Q.3y(\'8D\');1b(i=0,J=4J.G;i<J;++i){4J[i].1g.1r=3B}4 4H=Q.3y(\'6v\');1b(i=0,J=4H.G;i<J;++i){4H[i].1g.1r=3B}4 4G=Q.3y(\'8G\');1b(i=0,J=4G.G;i<J;++i){4G[i].1g.1r=3B}};4 4D=b(){4 1K=8.v(\'4K\');6u(1K,1s.1o(9.21.1K,9.3e+9.6U,9.1C.1K,9.1C.5N));1K.1g.1r=\'2j\'};4 60=b(H){4 t=u[T].Y;4 6z=(t==\'1l\'||t==\'U\');4 1K=8.v(\'4K\');5(6z){4E(1K,0.35,H)}q{1K.1g.1r=\'3f\';H()}};4 4A=b(){4 1q=8.v(\'3p\');8.W(1q,{l:\'3T%\',j:\'3T%\'});8.W(1q,\'l\',8.6F()+\'1M\');5(!4k){8.W(1q,\'j\',8.6C()+\'1M\')}};4 6B=b(){5(!(2G&&3R))k O;1b(4 i=0,J=u.G;i<J;++i){5(!Z.1q.56(u[i].Y))k M}k O};4 4z=b(H){4 1q=8.v(\'3p\');5(2v==12){2v=6B()}5(H){4A();5(2v){8.W(1q,{1r:\'2j\',6D:\'4b\',6E:\'V(\'+9.3e+9.6h+\')\',8P:\'8Q\',1W:1});H()}q{8.W(1q,{1r:\'2j\',6D:9.6p,6E:\'4v\'});6y(1q,9.6i,9.51,H)}}q{5(2v){8.W(1q,\'1r\',\'3f\')}q{4E(1q,9.51)}2v=12}};D.8S=b(1v){5(5u)k;9=1D(9,1v||{});1X(Q.2w,9.21.6s);Z.1l=1V 3a(\'\\.(\'+9.2h.1l.2q(\'|\')+\')\\s*$\',\'i\');Z.X=1V 3a(\'\\.(\'+9.2h.X.2q(\'|\')+\')\\s*$\',\'i\');Z.1e=1V 3a(\'\\.(\'+9.2h.1e.2q(\'|\')+\')\\s*$\',\'i\');Z.2t=1V 3a(\'\\.(\'+9.2h.2t.2q(\'|\')+\')\\s*$\',\'i\');Z.29=1V 3a(\'\\.(\'+9.2h.29.2q(\'|\')+\')\\s*$\',\'i\');4 E=12;4 1Y=b(){6I(E);E=12;4A();2H(34,36)};8.24(28,\'1Y\',b(){5(2y){5(E){6I(E);E=12}5(!E)E=8W(1Y,50)}});5(9.6e){8.24(8.v(\'3p\'),\'3D\',D.1L)}5(3P){8.W(8.v(\'3r\'),\'5q\',\'5r\');8.W(\'4L\',\'8Y\',1);8.24(8.v(\'3r\'),\'3D\',b(e){4 4u=8.6g(e);5(4u.E&&4u.E==\'3r\')D.1L()})}5(!9.5O)D.6L();5u=M};D.6L=b(1N,1v){5(!1N){4 1N=[];4 a=Q.3y(\'a\'),1w;1b(4 i=0,J=a.G;i<J;++i){1w=a[i].4t(\'1w\');5(1w&&Z.1w.1x(1w))1N[1N.G]=a[i]}}q 5(!1N.G){1N=[1N]}4 F;1b(4 i=0,J=1N.G;i<J;++i){F=1N[i];5(1d F.2g==\'2u\'){F.2g=1A.G;8.24(F,\'3D\',4V)}1A[F.2g]=1p.4r(F,1v)}};D.4r=b(F,1v){4 1j=F.1j;4 o={f:F,2d:F.4t(\'2d\'),Y:6q(1j),9:1D({},1v||{}),z:1j};4 2A,4o=[\'2d\',\'Y\',\'l\',\'j\',\'1Q\'];1b(4 i=0,J=4o.G;i<J;++i){2A=4o[i];5(1d o.9[2A]!=\'2u\'){o[2A]=o.9[2A];58 o.9[2A]}}4 1w=F.4t(\'1w\');5(1w){4 R=1w.R(Z.1Q);5(R)o.1Q=97(R[2]);4 4n=1w.99(\';\');1b(4 i=0,J=4n.G;i<J;++i){R=4n[i].R(Z.1i);5(R){5(R[1]==\'9\'){9a(\'o.9 = 1D(o.9, \'+R[2]+\')\')}q{o[R[1]]=R[2]}}}}k o};D.6R=b(1v){5(1v){2Y=1D({},9);9=1D(9,1v)}};D.6S=b(){5(2Y){9=2Y;2Y=12}};D.4Y=b(c,1v){5(2y)k;2y=M;5(3q(c)){5(1d c.2g==\'2u\'||1d 1A[c.2g]==\'2u\'){c=1p.4r(c,1v)}q{c=1A[c.2g]}}1p.6S();5(c.9||1v){1p.6R(1D(1D({},c.9||{}),1v||{}))}6c(c);5(u.G){5(9.44&&1d 9.44==\'b\'){9.44(c)}8.W(8.v(\'1f\'),\'6T\',\'9e\');4P(O);4 I=2Z(9.54,9.55);2F(I.l,I.13);2E(I.j);5e(O);4z(b(){8.W(8.v(\'1f\'),\'1r\',\'2j\');4D();5d()})}};D.3A=b(3g){5(!u)k;5(!u[3g]){5(!9.53){k}q{3g=(3g<0)?(u.G-1):0}}T=3g;46(O);2f(12);3O(O);5(9.3k&&1d 9.3k==\'b\'){9.3k(u[T])}4D();5e(5d)};D.1n=b(){k 1p.3A(T+1)};D.4F=b(){k 1p.3A(T-1)};D.1L=b(){5(!2y)k;3O(O);8.W(8.v(\'1f\'),{6T:\'4v\',1r:\'3f\'});5(3P)8.2N(28,\'3I\',3J);46(O);2f(12);5(1R){1R.5b=b(){};1R=12}4z(O);4P(M);5(9.3V&&1d 9.3V==\'b\'){9.3V(u[T])}2y=O};D.9g=b(){1b(4 i=0,J=1A.G;i<J;++i){5(1A[i].f){8.2N(1A[i].f,\'3D\',4V);58 1A[i].2g}}1A=[]};D.5R=b(c){4 h=c.l?K(c.l,10):6V;4 w=c.j?K(c.j,10):6V;4 1z=9.48;4 19=9.3m;5(c.9){5(c.9.48!=12){1z=c.9.48}5(c.9.3m!=12){19=c.9.3m}}4 L={11:\'6v\',S:\'1J\'};2V(c.Y){18\'1P\':4 I=2Z(h,w,M);h=I.l;w=I.j;L.Y=\'6X/x-6Y-4O\';L.3v=c.z;L.1y=[{11:\'1i\',S:\'4C\',1t:c.z},{11:\'1i\',S:\'9o\',1t:\'4b\'}];1m;18\'1U\':1z=1z?\'M\':\'O\';4 3E=\'O\';4 a=h/w;5(19){3E=\'M\';h+=20}4 I=2Z(h,h/a,M);h=I.l;w=(h-(19?20:0))/a;4 4j=[\'9r=\'+c.z,\'l=\'+h,\'j=\'+w,\'72=\'+1z,\'9t=\'+(h-(19?20:0)),\'3E=\'+3E,\'9u=9v&4h;9x=9y&4h;9z=9A\'];L.Y=\'6X/x-6Y-4O\';L.3v=9.3e+9.4I;L.1y=[{11:\'1i\',S:\'4C\',1t:9.3e+9.4I},{11:\'1i\',S:\'4j\',1t:4j.2q(\'&4h;\')},{11:\'1i\',S:\'9B\',1t:\'M\'}];1m;18\'X\':1z=1z?\'M\':\'O\';5(19){19=\'M\';h+=16}q{19=\'O\'}L.1y=[{11:\'1i\',S:\'2D\',1t:c.z},{11:\'1i\',S:\'9C\',1t:\'9D\'},{11:\'1i\',S:\'9E\',1t:19},{11:\'1i\',S:\'1z\',1t:1z}];5(1G){L.74=\'75:9H-9I-9J-9K-8c\';L.9M=\'2U://2S.5Z.2T/9N/9O.9P#4m=6,0,2,0\'}q{L.Y=\'77/63\';L.3v=c.z}1m;18\'1e\':1z=1z?1:0;L.1y=[{11:\'1i\',S:\'72\',1t:1z}];5(1G){5(19){19=\'9R\';h+=70}q{19=\'4v\'}L.74=\'75:9S-9T-9U-9V-9W\';L.1y[L.1y.G]={11:\'1i\',S:\'V\',1t:c.z};L.1y[L.1y.G]={11:\'1i\',S:\'9X\',1t:19}}q{5(19){19=1;h+=45}q{19=0}L.Y=\'77/x-9Y-4B\';L.3v=c.z;L.1y[L.1y.G]={11:\'1i\',S:\'9Z\',1t:19}}1m}L.l=h;L.j=w;k L};D.57=b(c){4 U=\'<\'+c.11;1b(4 2m 6M c){5(2m==\'11\'||2m==\'U\'||2m==\'1y\')a1;5(2m==\'59\'){U+=\' 2o="\'+c[\'59\']+\'"\'}q{U+=\' \'+2m+\'="\'+c[2m]+\'"\'}}5(Z.71.1x(c.11)){U+=\'/>\\n\'}q{U+=\'>\\n\';4 3L=c.1y;5(3L){1b(4 i=0,J=3L.G;i<J;++i){U+=1p.57(3L[i])}}5(c.U)U+=c.U;U+=\'</\'+c.11+\'>\\n\'}k U};D.a3=b(){k 1c};D.a4=b(){k 9};D.a5=b(){k u[T]};D.a6=b(){k 4m}})();4g.4d.1h=4g.4d.1h||b(o){1b(4 i=0,J=1p.G;i<J;++i){5(1p[i]==o)k i}k-1};1s.1o=1s.1o||b(1o){4 7a=4g.4d.aa.ab(ac,1);k 1o.ad(/\\{(\\d+)\\}/g,b(m,i){k 7a[i]})};', 62, 635, '||||var|if|||SL|options||function|obj|||el||||width|return|height|||||else||||current_gallery|get||||content||div||Shadowbox|id|link|length|callback|dims|len|parseInt|markup|true||false||document|match|name|current|html|url|setStyle|qt|type|RE||tag|null|top||animate||drag|case|controls|getStyle|for|plugins|typeof|wmp|shadowbox|style|indexOf|param|href|errors|img|break|next|format|this|overlay|visibility|String|value|unsupported|opts|rel|test|children|autoplay|cache|to|text|apply|Math|tool_i|isIE|ua|prev|shadowbox_content|loading|close|px|links|f4m|swf|gallery|preloader|detectPlugin|shadowbox_b|flv|new|opacity|appendHTML|resize|ev||skin|innerHTML|span|addEvent|o_width|ci||window|iframe|counter|border|o_height|title|i_width|setContent|shadowboxCacheKey|ext|cb|visible|code|i_height|attr|inline|class|resizable|join|shadowbox_drag_layer|scrollHeight|qtwmp|undefined|overlay_img_needed|body|documentElement|activated|isStrict|opt|getViewportHeight|key|src|adjustWidth|adjustHeight|isGecko|resizeContent|detected|max|on|fla|title_i|removeEvent|showBars|margin|start_x|start_y|www|com|http|switch|enableDrag|finishContent|default_options|getDimensions|isSafari|index|default|right|optimal_height||optimal_width||left||RegExp|getComputedHeight|javascript|lastChild|assetURL|hidden|num|navigator|getViewportWidth|endingOpacity|onChange|mode|showMovieControls|resizeDuration|tagName|shadowbox_overlay|isLink|shadowbox_container|view_height|padding|shadowbox_toolbar|data|tool_m|shadowbox_title_inner|getElementsByTagName|shadowbox_body_inner|change|vis|throw|click|showicons|viewportPadding|handleLgImages|assertKey|scroll|centerVertically|remove|cn|plugin_name|QuickTime|listenKeyboard|absolute_pos|change_w|isMac|range|100|duration|onClose|moz|filter|change_h|clearOpacity|scrollWidth|handle|the|extra_height|onOpen||toggleDrag|draggable|autoplayMovies|onFinish|bottom|transparent|compatMode|prototype|current_width|current_height|Array|amp|isBorderBox|flashvars|isSafari3|found|version|params|l_opts|domain|try|buildCacheObj|catch|getAttribute|target|none|toUpperCase|clientHeight|clientWidth|toggleOverlay|resizeOverlay|wmv|movie|showLoading|fadeOut|previous|embeds|objects|flvPlayer|selects|shadowbox_loading|shadowbox_body|shadowbox_title|shadowbox_toolbar_inner|flash|toggleTroubleElements|valid|sbi|this_domain|q_index|round|handleClick|extra_width|extra_body_width|open|view_width||fadeDuration|copy|continuous|initialHeight|initialWidth|exec|createHTML|delete|cls|shortcut|onload|Image|loadContent|hideBars|either|move_x|move_y|unlistenDrag|positionDrag|listenDrag|You|view|must|browser|styles|position|absolute|cursor|install|initialized|box|background|grab|plugin|mousedown|shared|single|clientX|clientY|mousemove|resetDrag|mouseup|min|0px|marginLeft|of|Flash|buildBars|cancel|skipSetup|handleUnsupported|keysPrev|movieMarkup|keysNext|win|frames|element|preload_next|preload_prev|No|apple|hideLoading|keysClose|enableKeys|quicktime|200|Windows|counterType|displayCounter|Media|displayNav|push|windows|setupGallery|parentNode|listenOverlay|png|getTarget|overlayBgImage|overlayOpacity|scrollTop|s_top|qtf4m|onkeydown|handleKey|Flip4Mac|overlayColor|getPlayerType|htm|main|offsetHeight|overwriteHTML|object|frag|insertAdjacentHTML|fadeIn|anim|alpha|checkOverlayImgNeeded|getDocumentWidth|backgroundColor|backgroundImage|getDocumentHeight|wh|animSequence|clearInterval|gif|string|setup|in|images|ShockwaveFlash|axo|light|applyOptions|revertOptions|display|loadingImage|300|shadow|application|shockwave|color||empty|autostart|khtml|classid|clsid|toLowerCase|video|isIE7|msie|args|isOpera|linux|moov|mov|dv|bmp|jpeg|revious|jpg|input|hr|shadowbox_nav_previous|shadowbox_nav_next|nbsp|grabbing|frame|BeforeEnd|lose|Close|ownerDocument|createRange|setStartAfter|br|Cancel|createContextualFragment|appendChild|shadowbox_nav_close|userAgent|firstChild|shadowbox_counter|frameborder|marginwidth|marginheight|scrolling|auto|alt|contentWindow|z_|location|cannot|opera|col|OBJECT|stop|URL|non|existent|Stop|setTimeout|IFRAME|Shockwave|clearer|webkit|CSS1Compat|getComputedWidth|offsetWidth||hw|wmv_download|flip4mac|area|lib|ActiveXObject|D3488ABDDC6B|substring|vbs|evaluate|windowsmedia|wmplayer|while|ocx|txt|preventDefault|shtml|wbr|rhtml|microsoft|Player|000|rb|unshift|flvplayer|which|event|keyCode|fromCharCode|phtml|gecko|isWindows|download|select|AREA|flashplayer|embed|products|160|320|shadowbox_message|php5|php4|with|splice|backgroundRepeat|repeat|php3|init|adobe|innerHeight|skip|setInterval|or|zoom|shadowbox_counter_current|php|shadowboxLoading|pl|title_m|win32|WMC|cfm|escape|cgi|split|eval|aspx|innerWidth|and|block|spacer|clearCache|both|macintosh|asp|mpeg|mpg|adapter|library|wmode|base|mac|file|avi|displayheight|backcolor|0x000000|os|frontcolor|0xCCCCCC|lightcolor|0x557722|allowfullscreen|scale|aspect|controller|wm|asf|02BF25D5|8C17|4B23|BC80|move|codebase|qtactivex|qtplugin|cab|meta|full|6BF52A52|394A|11d3|B153|00C04F79FAA6|uimode|ms|showcontrols|no|continue|load|getPlugins|getOptions|getCurrent|getVersion|mp4|fff|isLinux|slice|call|arguments|replace|Unable'.split('|'), 0, {}));
; (function($) {
    // Globally keep track of all images by their unique hash.  Each item is an image data object.
    var allImages = {};
    var imageCounter = 0;

    // Galleriffic static class
    $.galleriffic = {
        version: '1.0.0.0',

        // Strips invalid characters and any leading # characters
        normalizeHash: function(hash) {
            return hash.replace(/^.*#/, '').replace(/\?.*$/, '');
        },

        getImage: function(hash) {
            if (!hash)
                return undefined;

            hash = $.galleriffic.normalizeHash(hash);
            return allImages[hash];
        },

        // Global function that looks up an image by its hash and displays the image.
        // Returns false when an image is not found for the specified hash.
        // @param {String} hash This is the unique hash value assigned to an image.
        gotoImage: function(hash) {
            var imageData = $.galleriffic.getImage(hash);
            if (!imageData)
                return false;

            var gallery = imageData.gallery;
            gallery.gotoImage(imageData);

            return true;
        },

        // Removes an image from its respective gallery by its hash.
        // Returns false when an image is not found for the specified hash or the
        // specified owner gallery does match the located images gallery.
        // @param {String} hash This is the unique hash value assigned to an image.
        // @param {Object} ownerGallery (Optional) When supplied, the located images
        // gallery is verified to be the same as the specified owning gallery before
        // performing the remove operation.
        removeImageByHash: function(hash, ownerGallery) {
            var imageData = $.galleriffic.getImage(hash);
            if (!imageData)
                return false;

            var gallery = imageData.gallery;
            if (ownerGallery && ownerGallery != gallery)
                return false;

            return gallery.removeImageByIndex(imageData.index);
        }
    };

    var defaults = {
        delay: 3000,
        numThumbs: 20,
        preloadAhead: 40, // Set to -1 to preload all images
        enableTopPager: false,
        enableBottomPager: true,
        maxPagesToShow: 7,
        imageContainerSel: '',
        captionContainerSel: '',
        controlsContainerSel: '',
        loadingContainerSel: '',
        renderSSControls: true,
        renderNavControls: true,
        playLinkText: 'Play',
        pauseLinkText: 'Pause',
        prevLinkText: 'Previous',
        nextLinkText: 'Next',
        nextPageLinkText: 'Next &rsaquo;',
        prevPageLinkText: '&lsaquo; Prev',
        enableHistory: false,
        enableKeyboardNavigation: true,
        autoStart: false,
        syncTransitions: false,
        defaultTransitionDuration: 1000,
        onSlideChange: undefined, // accepts a delegate like such: function(prevIndex, nextIndex) { ... }
        onTransitionOut: undefined, // accepts a delegate like such: function(slide, caption, isSync, callback) { ... }
        onTransitionIn: undefined, // accepts a delegate like such: function(slide, caption, isSync) { ... }
        onPageTransitionOut: undefined, // accepts a delegate like such: function(callback) { ... }
        onPageTransitionIn: undefined, // accepts a delegate like such: function() { ... }
        onImageAdded: undefined, // accepts a delegate like such: function(imageData, $li) { ... }
        onImageRemoved: undefined  // accepts a delegate like such: function(imageData, $li) { ... }
    };

    // Primary Galleriffic initialization function that should be called on the thumbnail container.
    $.fn.galleriffic = function(settings) {
        //  Extend Gallery Object
        $.extend(this, {
            // Returns the version of the script
            version: $.galleriffic.version,

            // Current state of the slideshow
            isSlideshowRunning: false,
            slideshowTimeout: undefined,

            // This function is attached to the click event of generated hyperlinks within the gallery
            clickHandler: function(e, link) {
                this.pause();

                if (!this.enableHistory) {
                    // The href attribute holds the unique hash for an image
                    var hash = $.galleriffic.normalizeHash($(link).attr('href'));
                    $.galleriffic.gotoImage(hash);
                    e.preventDefault();
                }
            },

            // Appends an image to the end of the set of images.  Argument listItem can be either a jQuery DOM element or arbitrary html.
            // @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
            appendImage: function(listItem) {
                this.addImage(listItem, false, false);
                return this;
            },

            // Inserts an image into the set of images.  Argument listItem can be either a jQuery DOM element or arbitrary html.
            // @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
            // @param {Integer} position The index within the gallery where the item shouold be added.
            insertImage: function(listItem, position) {
                this.addImage(listItem, false, true, position);
                return this;
            },

            // Adds an image to the gallery and optionally inserts/appends it to the DOM (thumbExists)
            // @param listItem Either a jQuery object or a string of html of the list item that is to be added to the gallery.
            // @param {Boolean} thumbExists Specifies whether the thumbnail already exists in the DOM or if it needs to be added.
            // @param {Boolean} insert Specifies whether the the image is appended to the end or inserted into the gallery.
            // @param {Integer} position The index within the gallery where the item shouold be added.
            addImage: function(listItem, thumbExists, insert, position) {
                var $li = (typeof listItem === "string") ? $(listItem) : listItem;
                var $aThumb = $li.find('a.thumb');
                var slideUrl = $aThumb.attr('href');
                var title = $aThumb.attr('title');
                var $caption = $li.find('.caption').remove();
                var hash = $aThumb.attr('name');

                // Increment the image counter
                imageCounter++;

                // Autogenerate a hash value if none is present or if it is a duplicate
                if (!hash || allImages['' + hash]) {
                    hash = imageCounter;
                }

                // Set position to end when not specified
                if (!insert)
                    position = this.data.length;

                var imageData = {
                    title: title,
                    slideUrl: slideUrl,
                    caption: $caption,
                    hash: hash,
                    gallery: this,
                    index: position
                };

                // Add the imageData to this gallery's array of images
                if (insert) {
                    this.data.splice(position, 0, imageData);

                    // Reset index value on all imageData objects
                    this.updateIndices(position);
                }
                else {
                    this.data.push(imageData);
                }

                var gallery = this;

                // Add the element to the DOM
                if (!thumbExists) {
                    // Update thumbs passing in addition post transition out handler
                    this.updateThumbs(function() {
                        var $thumbsUl = gallery.find('ul.thumbs');
                        if (insert)
                            $thumbsUl.children(':eq(' + position + ')').before($li);
                        else
                            $thumbsUl.append($li);

                        if (gallery.onImageAdded)
                            gallery.onImageAdded(imageData, $li);
                    });
                }

                // Register the image globally
                allImages['' + hash] = imageData;

                // Setup attributes and click handler
                $aThumb.attr('rel', 'history')
					.attr('href', '#' + hash)
					.removeAttr('name')
					.click(function(e) {
					    gallery.clickHandler(e, this);
					});

                return this;
            },

            // Removes an image from the gallery based on its index.
            // Returns false when the index is out of range.
            removeImageByIndex: function(index) {
                if (index < 0 || index >= this.data.length)
                    return false;

                var imageData = this.data[index];
                if (!imageData)
                    return false;

                this.removeImage(imageData);

                return true;
            },

            // Convenience method that simply calls the global removeImageByHash method.
            removeImageByHash: function(hash) {
                return $.galleriffic.removeImageByHash(hash, this);
            },

            // Removes an image from the gallery.
            removeImage: function(imageData) {
                var index = imageData.index;

                // Remove the image from the gallery data array
                this.data.splice(index, 1);

                // Remove the global registration
                delete allImages['' + imageData.hash];

                // Remove the image's list item from the DOM
                this.updateThumbs(function() {
                    var $li = gallery.find('ul.thumbs')
						.children(':eq(' + index + ')')
						.remove();

                    if (gallery.onImageRemoved)
                        gallery.onImageRemoved(imageData, $li);
                });

                // Update each image objects index value
                this.updateIndices(index);

                return this;
            },

            // Updates the index values of the each of the images in the gallery after the specified index
            updateIndices: function(startIndex) {
                for (i = startIndex; i < this.data.length; i++) {
                    this.data[i].index = i;
                }

                return this;
            },

            // Scraped the thumbnail container for thumbs and adds each to the gallery
            initializeThumbs: function() {
                this.data = [];
                var gallery = this;

                this.find('ul.thumbs > li').each(function(i) {
                    gallery.addImage($(this), true, false);
                });

                return this;
            },

            isPreloadComplete: false,

            // Initalizes the image preloader
            preloadInit: function() {
                if (this.preloadAhead == 0) return this;

                this.preloadStartIndex = this.currentImage.index;
                var nextIndex = this.getNextIndex(this.preloadStartIndex);
                return this.preloadRecursive(this.preloadStartIndex, nextIndex);
            },

            // Changes the location in the gallery the preloader should work
            // @param {Integer} index The index of the image where the preloader should restart at.
            preloadRelocate: function(index) {
                // By changing this startIndex, the current preload script will restart
                this.preloadStartIndex = index;
                return this;
            },

            // Recursive function that performs the image preloading
            // @param {Integer} startIndex The index of the first image the current preloader started on.
            // @param {Integer} currentIndex The index of the current image to preload.
            preloadRecursive: function(startIndex, currentIndex) {
                // Check if startIndex has been relocated
                if (startIndex != this.preloadStartIndex) {
                    var nextIndex = this.getNextIndex(this.preloadStartIndex);
                    return this.preloadRecursive(this.preloadStartIndex, nextIndex);
                }

                var gallery = this;

                // Now check for preloadAhead count
                var preloadCount = currentIndex - startIndex;
                if (preloadCount < 0)
                    preloadCount = this.data.length - 1 - startIndex + currentIndex;
                if (this.preloadAhead >= 0 && preloadCount > this.preloadAhead) {
                    // Do this in order to keep checking for relocated start index
                    setTimeout(function() { gallery.preloadRecursive(startIndex, currentIndex); }, 500);
                    return this;
                }

                var imageData = this.data[currentIndex];
                if (!imageData)
                    return this;

                // If already loaded, continue
                if (imageData.image)
                    return this.preloadNext(startIndex, currentIndex);

                // Preload the image
                var image = new Image();

                image.onload = function() {
                    imageData.image = this;
                    gallery.preloadNext(startIndex, currentIndex);
                };

                image.alt = imageData.title;
                image.src = imageData.slideUrl;

                return this;
            },

            // Called by preloadRecursive in order to preload the next image after the previous has loaded.
            // @param {Integer} startIndex The index of the first image the current preloader started on.
            // @param {Integer} currentIndex The index of the current image to preload.
            preloadNext: function(startIndex, currentIndex) {
                var nextIndex = this.getNextIndex(currentIndex);
                if (nextIndex == startIndex) {
                    this.isPreloadComplete = true;
                } else {
                    // Use setTimeout to free up thread
                    var gallery = this;
                    setTimeout(function() { gallery.preloadRecursive(startIndex, nextIndex); }, 100);
                }

                return this;
            },

            // Safe way to get the next image index relative to the current image.
            // If the current image is the last, returns 0
            getNextIndex: function(index) {
                var nextIndex = index + 1;
                if (nextIndex >= this.data.length)
                    nextIndex = 0;
                return nextIndex;
            },

            // Safe way to get the previous image index relative to the current image.
            // If the current image is the first, return the index of the last image in the gallery.
            getPrevIndex: function(index) {
                var prevIndex = index - 1;
                if (prevIndex < 0)
                    prevIndex = this.data.length - 1;
                return prevIndex;
            },

            // Pauses the slideshow
            pause: function() {
                this.isSlideshowRunning = false;
                if (this.slideshowTimeout) {
                    clearTimeout(this.slideshowTimeout);
                    this.slideshowTimeout = undefined;
                }

                if (this.$controlsContainer) {
                    this.$controlsContainer
						.find('div.ss-controls a').removeClass().addClass('play')
						.attr('title', this.playLinkText)
						.attr('href', '#play')
						.html(this.playLinkText);
                }

                return this;
            },

            // Plays the slideshow
            play: function() {
                this.isSlideshowRunning = true;

                if (this.$controlsContainer) {
                    this.$controlsContainer
						.find('div.ss-controls a').removeClass().addClass('pause')
						.attr('title', this.pauseLinkText)
						.attr('href', '#pause')
						.html(this.pauseLinkText);
                }

                if (!this.slideshowTimeout) {
                    var gallery = this;
                    this.slideshowTimeout = setTimeout(function() { gallery.ssAdvance(); }, this.delay);
                }

                return this;
            },

            // Toggles the state of the slideshow (playing/paused)
            toggleSlideshow: function() {
                if (this.isSlideshowRunning)
                    this.pause();
                else
                    this.play();

                return this;
            },

            // Advances the slideshow to the next image and delegates navigation to the
            // history plugin when history is enabled
            // enableHistory is true
            ssAdvance: function() {
                if (this.isSlideshowRunning)
                    this.next(true);

                return this;
            },

            // Advances the gallery to the next image.
            // @param {Boolean} dontPause Specifies whether to pause the slideshow.
            // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.  
            next: function(dontPause, bypassHistory) {
                this.gotoIndex(this.getNextIndex(this.currentImage.index), dontPause, bypassHistory);
                return this;
            },

            // Navigates to the previous image in the gallery.
            // @param {Boolean} dontPause Specifies whether to pause the slideshow.
            // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
            previous: function(dontPause, bypassHistory) {
                this.gotoIndex(this.getPrevIndex(this.currentImage.index), dontPause, bypassHistory);
                return this;
            },

            // Navigates to the next page in the gallery.
            // @param {Boolean} dontPause Specifies whether to pause the slideshow.
            // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
            nextPage: function(dontPause, bypassHistory) {
                var page = this.getCurrentPage();
                var lastPage = this.getNumPages() - 1;
                if (page < lastPage) {
                    var startIndex = page * this.numThumbs;
                    var nextPage = startIndex + this.numThumbs;
                    this.gotoIndex(nextPage, dontPause, bypassHistory);
                }

                return this;
            },

            // Navigates to the previous page in the gallery.
            // @param {Boolean} dontPause Specifies whether to pause the slideshow.
            // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
            previousPage: function(dontPause, bypassHistory) {
                var page = this.getCurrentPage();
                if (page > 0) {
                    var startIndex = page * this.numThumbs;
                    var prevPage = startIndex - this.numThumbs;
                    this.gotoIndex(prevPage, dontPause, bypassHistory);
                }

                return this;
            },

            // Navigates to the image at the specified index in the gallery
            // @param {Integer} index The index of the image in the gallery to display.
            // @param {Boolean} dontPause Specifies whether to pause the slideshow.
            // @param {Boolean} bypassHistory Specifies whether to delegate navigation to the history plugin when history is enabled.
            gotoIndex: function(index, dontPause, bypassHistory) {
                if (!dontPause)
                    this.pause();

                if (index < 0) index = 0;
                else if (index >= this.data.length) index = this.data.length - 1;

                var imageData = this.data[index];

                if (!bypassHistory && this.enableHistory)
                    $.historyLoad(String(imageData.hash));  // At the moment, historyLoad only accepts string arguments
                else
                    this.gotoImage(imageData);

                return this;
            },

            // This function is garaunteed to be called anytime a gallery slide changes.
            // @param {Object} imageData An object holding the image metadata of the image to navigate to.
            gotoImage: function(imageData) {
                var index = imageData.index;

                if (this.onSlideChange)
                    this.onSlideChange(this.currentImage.index, index);

                this.currentImage = imageData;
                this.preloadRelocate(index);

                this.refresh();

                return this;
            },

            // Returns the default transition duration value.  The value is halved when not
            // performing a synchronized transition.
            // @param {Boolean} isSync Specifies whether the transitions are synchronized.
            getDefaultTransitionDuration: function(isSync) {
                if (isSync)
                    return this.defaultTransitionDuration;
                return this.defaultTransitionDuration / 2;
            },

            // Rebuilds the slideshow image and controls and performs transitions
            refresh: function() {
                var imageData = this.currentImage;
                if (!imageData)
                    return this;

                var index = imageData.index;

                // Update Controls
                if (this.$controlsContainer) {
                    this.$controlsContainer
						.find('div.nav-controls a.prev').attr('href', '#' + this.data[this.getPrevIndex(index)].hash).end()
						.find('div.nav-controls a.next').attr('href', '#' + this.data[this.getNextIndex(index)].hash);
                }

                var previousSlide = this.$imageContainer.find('span.current').addClass('previous').removeClass('current');
                var previousCaption = 0;

                if (this.$captionContainer) {
                    previousCaption = this.$captionContainer.find('span.current').addClass('previous').removeClass('current');
                }

                // Perform transitions simultaneously if syncTransitions is true and the next image is already preloaded
                var isSync = this.syncTransitions && imageData.image;

                // Flag we are transitioning
                var isTransitioning = true;
                var gallery = this;

                var transitionOutCallback = function() {
                    // Flag that the transition has completed
                    isTransitioning = false;

                    // Remove the old slide
                    previousSlide.remove();

                    // Remove old caption
                    if (previousCaption)
                        previousCaption.remove();

                    if (!isSync) {
                        if (imageData.image && imageData.hash == gallery.data[gallery.currentImage.index].hash) {
                            gallery.buildImage(imageData, isSync);
                        } else {
                            // Show loading container
                            if (gallery.$loadingContainer) {
                                gallery.$loadingContainer.show();
                            }
                        }
                    }
                };

                if (previousSlide.length == 0) {
                    // For the first slide, the previous slide will be empty, so we will call the callback immediately
                    transitionOutCallback();
                } else {
                    if (this.onTransitionOut) {
                        this.onTransitionOut(previousSlide, previousCaption, isSync, transitionOutCallback);
                    } else {
                        previousSlide.fadeTo(this.getDefaultTransitionDuration(isSync), 0.0, transitionOutCallback);
                        if (previousCaption)
                            previousCaption.fadeTo(this.getDefaultTransitionDuration(isSync), 0.0);
                    }
                }

                // Go ahead and begin transitioning in of next image
                if (isSync)
                    this.buildImage(imageData, isSync);

                if (!imageData.image) {
                    var image = new Image();

                    // Wire up mainImage onload event
                    image.onload = function() {
                        imageData.image = this;

                        // Only build image if the out transition has completed and we are still on the same image hash
                        if (!isTransitioning && imageData.hash == gallery.data[gallery.currentImage.index].hash) {
                            gallery.buildImage(imageData, isSync);
                        }
                    };

                    // set alt and src
                    image.alt = imageData.title;
                    image.src = imageData.slideUrl;
                }

                // This causes the preloader (if still running) to relocate out from the currentIndex
                this.relocatePreload = true;

                return this.syncThumbs();
            },

            // Called by the refresh method after the previous image has been transitioned out or at the same time
            // as the out transition when performing a synchronous transition.
            // @param {Object} imageData An object holding the image metadata of the image to build.
            // @param {Boolean} isSync Specifies whether the transitions are synchronized.
            buildImage: function(imageData, isSync) {
                var gallery = this;
                var nextIndex = this.getNextIndex(imageData.index);

                // Construct new hidden span for the image
                var newSlide = this.$imageContainer
					.append('<span class="image-wrapper current"><a class="advance-link" rel="history" href="#' + this.data[nextIndex].hash + '" title="' + imageData.title + '">&nbsp;</a></span>')
					.find('span.current').css('opacity', '0');

                newSlide.find('a')
					.append(imageData.image)
					.click(function(e) {
					    gallery.clickHandler(e, this);
					});

                var newCaption = 0;
                if (this.$captionContainer) {
                    // Construct new hidden caption for the image
                    newCaption = this.$captionContainer
						.append('<span class="image-caption current"></span>')
						.find('span.current').css('opacity', '0')
						.append(imageData.caption);
                }

                // Hide the loading conatiner
                if (this.$loadingContainer) {
                    this.$loadingContainer.hide();
                }

                // Transition in the new image
                if (this.onTransitionIn) {
                    this.onTransitionIn(newSlide, newCaption, isSync);
                } else {
                    newSlide.fadeTo(this.getDefaultTransitionDuration(isSync), 1.0);
                    if (newCaption)
                        newCaption.fadeTo(this.getDefaultTransitionDuration(isSync), 1.0);
                }

                if (this.isSlideshowRunning) {
                    if (this.slideshowTimeout)
                        clearTimeout(this.slideshowTimeout);

                    this.slideshowTimeout = setTimeout(function() { gallery.ssAdvance(); }, this.delay);
                }

                return this;
            },

            // Returns the current page index that should be shown for the currentImage
            getCurrentPage: function() {
                return Math.floor(this.currentImage.index / this.numThumbs);
            },

            // Applies the selected class to the current image's corresponding thumbnail.
            // Also checks if the current page has changed and updates the displayed page of thumbnails if necessary.
            syncThumbs: function() {
                var page = this.getCurrentPage();
                if (page != this.displayedPage)
                    this.updateThumbs();

                // Remove existing selected class and add selected class to new thumb
                var $thumbs = this.find('ul.thumbs').children();
                $thumbs.filter('.selected').removeClass('selected');
                $thumbs.eq(this.currentImage.index).addClass('selected');

                return this;
            },

            // Performs transitions on the thumbnails container and updates the set of
            // thumbnails that are to be displayed and the navigation controls.
            // @param {Delegate} postTransitionOutHandler An optional delegate that is called after
            // the thumbnails container has transitioned out and before the thumbnails are rebuilt.
            updateThumbs: function(postTransitionOutHandler) {
                var gallery = this;
                var transitionOutCallback = function() {
                    // Call the Post-transition Out Handler
                    if (postTransitionOutHandler)
                        postTransitionOutHandler();

                    gallery.rebuildThumbs();

                    // Transition In the thumbsContainer
                    if (gallery.onPageTransitionIn)
                        gallery.onPageTransitionIn();
                    else
                        gallery.show();
                };

                // Transition Out the thumbsContainer
                if (this.onPageTransitionOut) {
                    this.onPageTransitionOut(transitionOutCallback);
                } else {
                    this.hide();
                    transitionOutCallback();
                }

                return this;
            },

            // Updates the set of thumbnails that are to be displayed and the navigation controls.
            rebuildThumbs: function() {
                //var needsPagination = this.data.length > this.numThumbs;
                var needsPagination = true;
                // Rebuild top pager
                if (this.enableTopPager) {
                    //var $topPager = this.find('div.top');
                    var $topPager = $('div.sliderImagesInner');
                    //                    if ($topPager.length == 0)
                    //                        //$topPager = this.prepend('<div class="top pagination"></div>').find('div.top');
                    //                    else
                    //                        $topPager.empty();
                    if ($topPager.length != 0)
                        $topPager.empty();
                    if (needsPagination)
                        this.buildPager($topPager, true);
                }

                // Rebuild bottom pager
                if (this.enableBottomPager) {
                    //                    var $bottomPager = this.find('div.bottom');
                    //                    if ($bottomPager.length == 0)
                    //                        $bottomPager = this.append('<div class="bottom pagination"></div>').find('div.bottom');
                    //                    else
                    //                        $bottomPager.empty();
                    var $bottomPager = $('div.sliderImagesInnerRight');
                    if ($bottomPager.length != 0)
                        $bottomPager.empty();

                    if (needsPagination)
                        this.buildPager($bottomPager, false);
                }

                var page = this.getCurrentPage();
                var startIndex = page * this.numThumbs;
                var stopIndex = startIndex + this.numThumbs - 1;
                if (stopIndex >= this.data.length)
                    stopIndex = this.data.length - 1;

                // Show/Hide thumbs
                var $thumbsUl = this.find('ul.thumbs');
                $thumbsUl.find('li').each(function(i) {
                    var $li = $(this);
                    if (i >= startIndex && i <= stopIndex) {
                        $li.show();
                    } else {
                        $li.hide();
                    }
                });

                this.displayedPage = page;

                // Remove the noscript class from the thumbs container ul
                $thumbsUl.removeClass('noscript');

                return this;
            },

            // Returns the total number of pages required to display all the thumbnails.
            getNumPages: function() {
                return Math.ceil(this.data.length / this.numThumbs);
            },

            // Rebuilds the pager control in the specified matched element.
            // @param {jQuery} pager A jQuery element set matching the particular pager to be rebuilt.
            buildPager: function(pager, isLeft) {
                var gallery = this;
                var numPages = this.getNumPages();
                var page = this.getCurrentPage();
                var startIndex = page * this.numThumbs;
                var pagesRemaining = this.maxPagesToShow - 1;

                var pageNum = page - Math.floor((this.maxPagesToShow - 1) / 2) + 1;
                if (pageNum > 0) {
                    var remainingPageCount = numPages - pageNum;
                    if (remainingPageCount < pagesRemaining) {
                        pageNum = pageNum - (pagesRemaining - remainingPageCount);
                    }
                }

                if (pageNum < 0) {
                    pageNum = 0;
                }

                // Prev Page Link
                if (page > 0 && isLeft) {
                    var prevPage = startIndex - this.numThumbs;
                    //pager.append('<a rel="history" href="#' + this.data[prevPage].hash + '" title="' + this.prevPageLinkText + '">' + this.prevPageLinkText + '</a>');
                    //<a href="#" class="rightHandler" style="z-index: 10;"><img src="/images/gallery/left_off.png" width="32" height="66" /></a>
                    pager.append('<a rel="history" class="rightHandler" style="z-index: 10;" href="#' + this.data[prevPage].hash + '" title="' + this.prevPageLinkText + '"><img src="/images/gallery/left_on.png" width="32" height="66" /></a>');
                }

                if (page == 0 && isLeft) {
                    pager.append('<a class="rightHandler" style="z-index: 10;"><img src="/images/gallery/left_off.png" width="32" height="66" /></a>');
                }

                // Create First Page link if needed
                if (pageNum > 0) {
                    //                    this.buildPageLink(pager, 0, numPages);
                    //                    if (pageNum > 1)
                    //                        pager.append('<span class="ellipsis">&hellip;</span>');

                    pagesRemaining--;
                }
                /// pager index section
                // Page Index Links
                //                while (pagesRemaining > 0) {
                //                    this.buildPageLink(pager, pageNum, numPages);
                //                    pagesRemaining--;
                //                    pageNum++;
                //                }

                // Create Last Page link if needed
                //                if (pageNum < numPages) {
                //                    var lastPageNum = numPages - 1;
                //                    if (pageNum < lastPageNum)
                //                        pager.append('<span class="ellipsis">&hellip;</span>');

                //                    this.buildPageLink(pager, lastPageNum, numPages);
                //                }
                /// end pager index section
                // Next Page Link
                var nextPage = startIndex + this.numThumbs;
                if (nextPage < this.data.length && !isLeft) {
                    //<a href="#" class="leftHandler" style="z-index: 10;"><img src="/images/gallery/right_on.png" width="32" height="66" /></a>
                    //pager.append('<a rel="history" href="#' + this.data[nextPage].hash + '" title="' + this.nextPageLinkText + '">' + this.nextPageLinkText + '</a>');
                    pager.append('<a rel="history" href="#' + this.data[nextPage].hash + '" class="leftHandler" style="z-index: 10;" title="' + this.nextPageLinkText + '"><img src="/images/gallery/right_on.png" width="32" height="66" /></a>');
                }

                if (nextPage >= this.data.length && !isLeft) {
                    pager.append('<a rel="history" href="#" class="leftHandler" style="z-index: 10;"><img src="/images/gallery/right_off.png" width="32" height="66" /></a>');
                }
                pager.find('a').click(function(e) {
                    gallery.clickHandler(e, this);
                });

                return this;
            },

            // Builds a single page link within a pager.  This function is called by buildPager
            // @param {jQuery} pager A jQuery element set matching the particular pager to be rebuilt.
            // @param {Integer} pageNum The page number of the page link to build.
            // @param {Integer} numPages The total number of pages required to display all thumbnails.
            buildPageLink: function(pager, pageNum, numPages) {
                var pageLabel = pageNum + 1;
                var currentPage = this.getCurrentPage();
                if (pageNum == currentPage)
                    pager.append('<span class="current">' + pageLabel + '</span>');
                else if (pageNum < numPages) {
                    var imageIndex = pageNum * this.numThumbs;
                    pager.append('<a rel="history" href="#' + this.data[imageIndex].hash + '" title="' + pageLabel + '">' + pageLabel + '</a>');
                }

                return this;
            }
        });

        // Now initialize the gallery
        $.extend(this, defaults, settings);

        // Verify the history plugin is available
        if (this.enableHistory && !$.historyInit)
            this.enableHistory = false;

        // Select containers
        if (this.imageContainerSel) this.$imageContainer = $(this.imageContainerSel);
        if (this.captionContainerSel) this.$captionContainer = $(this.captionContainerSel);
        if (this.loadingContainerSel) this.$loadingContainer = $(this.loadingContainerSel);

        // Initialize the thumbails
        this.initializeThumbs();

        if (this.maxPagesToShow < 3)
            this.maxPagesToShow = 3;

        this.displayedPage = -1;
        this.currentImage = this.data[0];
        var gallery = this;

        // Hide the loadingContainer
        if (this.$loadingContainer)
            this.$loadingContainer.hide();

        // Setup controls
        if (this.controlsContainerSel) {
            this.$controlsContainer = $(this.controlsContainerSel).empty();

            if (this.renderSSControls) {
                if (this.autoStart) {
                    this.$controlsContainer
						.append('<div class="ss-controls"><a href="#pause" class="pause" title="' + this.pauseLinkText + '">' + this.pauseLinkText + '</a></div>');
                } else {
                    this.$controlsContainer
						.append('<div class="ss-controls"><a href="#play" class="play" title="' + this.playLinkText + '">' + this.playLinkText + '</a></div>');
                }

                this.$controlsContainer.find('div.ss-controls a')
					.click(function(e) {
					    gallery.toggleSlideshow();
					    e.preventDefault();
					    return false;
					});
            }

            if (this.renderNavControls) {
                this.$controlsContainer
					.append('<div class="nav-controls"><a class="prev" rel="history" title="' + this.prevLinkText + '"><img src="/images/1.png" /></a><a class="next" rel="history" title="' + this.nextLinkText + '"><img src="/images/2.png" /></a></div>')
					.find('div.nav-controls a')
					.click(function(e) {
					    gallery.clickHandler(e, this);
					});
            }
        }

        var initFirstImage = !this.enableHistory || !location.hash;
        if (this.enableHistory && location.hash) {
            var hash = $.galleriffic.normalizeHash(location.hash);
            var imageData = allImages[hash];
            if (!imageData)
                initFirstImage = true;
        }

        // Setup gallery to show the first image
        if (initFirstImage)
            this.gotoIndex(0, false, true);

        // Setup Keyboard Navigation
        if (this.enableKeyboardNavigation) {
            $(document).keydown(function(e) {
                var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
                switch (key) {
                    case 32: // space
                        gallery.next();
                        e.preventDefault();
                        break;
                    case 33: // Page Up
                        gallery.previousPage();
                        e.preventDefault();
                        break;
                    case 34: // Page Down
                        gallery.nextPage();
                        e.preventDefault();
                        break;
                    case 35: // End
                        gallery.gotoIndex(gallery.data.length - 1);
                        e.preventDefault();
                        break;
                    case 36: // Home
                        gallery.gotoIndex(0);
                        e.preventDefault();
                        break;
                    case 37: // left arrow
                        gallery.previous();
                        e.preventDefault();
                        break;
                    case 39: // right arrow
                        gallery.next();
                        e.preventDefault();
                        break;
                }
            });
        }

        // Auto start the slideshow
        if (this.autoStart)
            this.play();

        // Kickoff Image Preloader after 1 second
        setTimeout(function() { gallery.preloadInit(); }, 1000);

        return this;
    };
})(jQuery);

/**
* jQuery Opacity Rollover plugin
*
* Copyright (c) 2009 Trent Foley (http://trentacular.com)
* Licensed under the MIT License:
*   http://www.opensource.org/licenses/mit-license.php
*/
; (function($) {
    var defaults = {
        mouseOutOpacity: 0.67,
        mouseOverOpacity: 1.0,
        fadeSpeed: 'fast',
        exemptionSelector: '.selected'
    };

    $.fn.opacityrollover = function(settings) {
        // Initialize the effect
        $.extend(this, defaults, settings);

        var config = this;

        function fadeTo(element, opacity) {
            var $target = $(element);

            if (config.exemptionSelector)
                $target = $target.not(config.exemptionSelector);

            $target.fadeTo(config.fadeSpeed, opacity);
        }

        this.css('opacity', this.mouseOutOpacity)
			.hover(
				function() {
				    fadeTo(this, config.mouseOverOpacity);
				},
				function() {
				    fadeTo(this, config.mouseOutOpacity);
				});

        return this;
    };
})(jQuery);


function getRandom(nums) {
    var ranNum = Math.round(Math.random() * nums);
    return ranNum;
}

$(document).ready(function() {
    //We will delete the "View photos" on the Local Phrases page
    if ($(".right:last h2").html() == 'Local Phrases')
        $(".right:last a:last").hide();

    if (document.location.href.indexOf('/specials.aspx') > -1)
        $('p.breadcrumbs').html('<strong><a title="Home" id="ctl00_ctl03_hlHome" href="/">Home</a></strong> » Specials');

    if (document.location.href.indexOf('/Terms-and-conditions.aspx') > -1)
        $('p.breadcrumbs').html('<strong><a title="Home" id="ctl00_ctl03_hlHome" href="/">Home</a></strong> » Terms and conditions');
        
    var numberOfImages = 3;
    var randomNumber = getRandom(numberOfImages);

    // Create an array to hold the names of all images.
    var image = new Array(numberOfImages);
    image[0] = "../images/random/1.jpg";
    image[1] = "../images/random/2.jpg";
    image[2] = "../images/random/3.jpg";
    image[3] = "../images/random/4.jpg";
    //image[4] = "../images/random/5.png";
    if (randomNumber > 3) { randomNumber = 3; }
    if (randomNumber < 0) { randomNumber = 0; }
    $(".tTwoColumns .accom_home").css("background-image", "url(" + image[randomNumber] + ")");
    //***********************************************//
    // COMMON STUFF
    //***********************************************//

    //initialise shadowbox
    Shadowbox.init();

    // default nav fixes
    $("ul.defaultNav li:last").addClass("last");

    $(".footerNav li[depth='0']").each(function() {
        if ($(this).next('li').attr('depth') == '1') {
            $(this).addClass('main');
        }

    });

    $(".componentHomeFlash h1 a").flash(
			{ width: 950, height: 329, autoplay: true, wmode: 'transparent' },
			{},
			function(htmlOptions) {
			    $this = $(this);
			    htmlOptions.src = $this.attr('href');
			    $this.before($.fn.flash.transform(htmlOptions));
			}
		);
    if ($(".componentSubNav div.middle h2").length == 0) {
        $(".componentSubNav div:first").removeClass('middle').addClass('middleNoBig');
    }
});


(function ($) {
  $.fn.fadeTransition = function(options) {
    var transitionObject,
        options = $.extend({pauseTime: 5000,
                            transitionTime: 2000,
                            ignore: null,
                            delayStart: 0,
                            pauseOnMouseOver: false,
                            manualNavigation: false,
                            createNavButtons: false}, options);
                            
    function fader(obj) {
      var timer = null,
          current = 0;
          els = (options.ignore)?$("> *:not(" + options.ignore + ")", obj):$("> *", obj);
      
      function setup() {
        $(obj).css("position", "relative");
        els.css("display", "none").css("left", "0").css("top", "0").css("position", "absolute");
        
        if (options.createNavButtons) {
          createNavButtons();
        }
      
        if (options.pauseOnMouseOver) {
          $(obj).mouseover(pause).mouseout(cue);
        }
      
        if (options.delayStart > 0) {
          setTimeout(showFirst, options.delayStart);
        }
        else {
          showFirst();
        }
      }
      
      setup();
      
      function createNavButtons() {
        var i, nav = $('<div class="fadenav"></div>');
        for (i=0; i<els.length; i++)
          $('<a href="#">&nbsp;</a>').click(manualNav).appendTo(nav);
          
        nav.appendTo(obj);
      }
      
      function manualNav(e) {
        var item;
        e = e || window.event;
        $(e.target).blur();
        item = $('.fadenav a', obj).index(e.target);
        if (timer) {
          clearTimeout(timer);
        }
        transition(item);
        return false;
      }
      
      function pause() {
        if (timer)
          clearTimeout(timer);
      }
      
      function highlightNav() {
        if (options.createNavButtons) {
          $('.fadenav a', obj).removeClass('current');
          $('.fadenav a:nth-child(' + (1 + current) + ')', obj).addClass('current');
        }
      }
      
      function showFirst() {
        if (options.ignore) {
          $(options.ignore, obj).fadeOut(options.transitionTime);
          $(els[current]).fadeIn(options.transitionTime, cue);
        }
        else {
          $(els[current]).css("display", "block");
        }
        
        highlightNav();
      }

      function transition(next) {
        $(els[current]).fadeOut(options.transitionTime);
        $(els[next]).fadeIn(options.transitionTime);
        current = next;
        highlightNav();
        cue();
      }

      function cue() {
        if ($("> *", obj).length < 2) {
          return false;
        }
        
        if (timer) {
          clearTimeout(timer);
        }
        
        if (!options.manualNavigation) {
          timer = setTimeout(function() { transition((current + 1) % els.length | 0)} , options.pauseTime);
        }
      }
    }

    return this.each(function() {
      new fader(this);
    });
  }
  
  $(document).ready(function () {
  $(".componentBlog .paging").css("left",$(".componentBlog .paging").parent().width()/2-$(".componentBlog .paging").width()/2);
	
  
  });

})(jQuery);


