/*
--------------------------------------------------------------------------- 
Default Javascript File
(c) 2006 Select Performers

Version:	1.00
Date:		06/01/2007
Author:		Ian Anderson Gray
Website:	http://selectperformers.com/
---------------------------------------------------------------------------
Notes:	
		
---------------------------------------------------------------------------
To Do

---------------------------------------------------------------------------
Change Log

---------------------------------------------------------------------------
*/

eval(function(p,a,c,k,e,d){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--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[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}('o 7F={7G:\'1.11\'};k $3p(R){h(R!=5e)};k $q(R){m(!$3p(R))h 1b;m(R.2A)h\'Y\';o q=36 R;m(q==\'2h\'&&R.7E){1L(R.49){14 1:h\'Y\';14 3:h(/\\S/).1Z(R.4Y)?\'7D\':\'7B\'}}m(q==\'2h\'||q==\'k\'){1L(R.5l){14 1s:h\'12\';14 4z:h\'7C\';14 1g:h\'4X\'}m(36 R.O==\'4x\'){m(R.1O)h\'7H\';m(R.5n)h\'M\'}}h q};k $2C(){o 2Z={};F(o i=0;i<M.O;i++){F(o t 18 M[i]){o 3l=M[i][t];o 3o=2Z[t];m(3o&&$q(3l)==\'2h\'&&$q(3o)==\'2h\')2Z[t]=$2C(3o,3l);V 2Z[t]=3l}}h 2Z};o $P=k(){o Q=M;m(!Q[1])Q=[c,Q[0]];F(o t 18 Q[1])Q[0][t]=Q[1][t];h Q[0]};o $2w=k(){F(o i=0,l=M.O;i<l;i++){M[i].P=k(1d){F(o 1i 18 1d){m(!c.1a[1i])c.1a[1i]=1d[1i];m(!c[1i])c[1i]=$2w.3g(1i)}}}};$2w.3g=k(1i){h k(K){h c.1a[1i].2v(K,1s.1a.56.1E(M,1))}};$2w(4P,1s,4o,57);k $35(R){h!!(R||R===0)};k $47(R,5h){h $3p(R)?R:5h};k $4L(2p,2g){h W.7N(W.4L()*(2g-2p+1)+2p)};k $1W(){h U 7O().7M()};k $4s(1w){7L(1w);7J(1w);h 1c};o 2s=k(R){R=R||{};R.P=$P;h R};o 7K=U 2s(E);o 7A=U 2s(L);L.5g=L.3K(\'5g\')[0];E.5d=!!(L.7p);m(E.7q)E.1A=E[E.7o?\'7n\':\'5k\']=1f;V m(L.54&&!L.7k&&!7l.7m)E.2m=E[E.5d?\'7s\':\'4W\']=1f;V m(L.7x!=1c)E.4l=1f;E.7y=E.2m;7w.P=$P;m(36 33==\'5e\'){o 33=k(){};m(E.2m)L.64("7t");33.1a=(E.2m)?E["[[7u.1a]]"]:{}}33.1a.2A=k(){};m(E.5k)4i{L.7P("7Q",1b,1f)}3W(e){};o 1g=k(1P){o 2T=k(){h(M[0]!==1c&&c.1G&&$q(c.1G)==\'k\')?c.1G.2v(c,M):c};$P(2T,c);2T.1a=1P;2T.5l=1g;h 2T};1g.22=k(){};1g.1a={P:k(1P){o 3x=U c(1c);F(o t 18 1P){o 5r=3x[t];3x[t]=1g.5p(5r,1P[t])}h U 1g(3x)},6r:k(){F(o i=0,l=M.O;i<l;i++)$P(c.1a,M[i])}};1g.5p=k(2b,2k){m(2b&&2b!=2k){o q=$q(2k);m(q!=$q(2b))h 2k;1L(q){14\'k\':o 4C=k(){c.21=M.5n.21;h 2k.2v(c,M)};4C.21=2b;h 4C;14\'2h\':h $2C(2b,2k)}}h 2k};o 68=U 1g({8c:k(B){c.2l=c.2l||[];c.2l.1l(B);h c},6i:k(){m(c.2l&&c.2l.O)c.2l.5E().1r(10,c)},8a:k(){c.2l=[]}});o 1R=U 1g({2o:k(q,B){m(B!=1g.22){c.$I=c.$I||{};c.$I[q]=c.$I[q]||[];c.$I[q].4H(B)}h c},1U:k(q,Q,1r){m(c.$I&&c.$I[q]){c.$I[q].1q(k(B){B.1H({\'K\':c,\'1r\':1r,\'M\':Q})()},c)}h c},4d:k(q,B){m(c.$I&&c.$I[q])c.$I[q].2H(B);h c}});o 67=U 1g({6a:k(){c.G=$2C.2v(1c,[c.G].P(M));m(c.2o){F(o 2W 18 c.G){m($q(c.G[2W]==\'k\')&&(/^3V[A-Z]/).1Z(2W))c.2o(2W,c.G[2W])}}h c}});1s.P({3c:k(B,K){F(o i=0,j=c.O;i<j;i++)B.1E(K,c[i],i,c)},5D:k(B,K){o 2y=[];F(o i=0,j=c.O;i<j;i++){m(B.1E(K,c[i],i,c))2y.1l(c[i])}h 2y},1N:k(B,K){o 2y=[];F(o i=0,j=c.O;i<j;i++)2y[i]=B.1E(K,c[i],i,c);h 2y},3a:k(B,K){F(o i=0,j=c.O;i<j;i++){m(!B.1E(K,c[i],i,c))h 1b}h 1f},89:k(B,K){F(o i=0,j=c.O;i<j;i++){m(B.1E(K,c[i],i,c))h 1f}h 1b},2K:k(1O,H){o 2L=c.O;F(o i=(H<0)?W.2g(0,2L+H):H||0;i<2L;i++){m(c[i]===1O)h i}h-1},53:k(1o,O){1o=1o||0;m(1o<0)1o=c.O+1o;O=O||(c.O-1o);o 4G=[];F(o i=0;i<O;i++)4G[i]=c[1o++];h 4G},2H:k(1O){o i=0;o 2L=c.O;5O(i<2L){m(c[i]===1O){c.3L(i,1);2L--}V{i++}}h c},15:k(1O,H){h c.2K(1O,H)!=-1},87:k(1j){o R={},O=W.2p(c.O,1j.O);F(o i=0;i<O;i++)R[1j[i]]=c[i];h R},P:k(12){F(o i=0,j=12.O;i<j;i++)c.1l(12[i]);h c},2C:k(12){F(o i=0,l=12.O;i<l;i++)c.4H(12[i]);h c},4H:k(1O){m(!c.15(1O))c.1l(1O);h c},8e:k(){h c[$4L(0,c.O-1)]||1c},5T:k(){h c[c.O-1]||1c}});1s.1a.1q=1s.1a.3c;1s.1q=1s.3c;k $A(12){h 1s.53(12)};k $1q(28,B,K){m(28&&36 28.O==\'4x\'&&$q(28)!=\'2h\'){1s.3c(28,B,K)}V{F(o 1x 18 28)B.1E(K||28,28[1x],1x)}};1s.1a.1Z=1s.1a.15;4o.P({1Z:k(3i,1D){h(($q(3i)==\'1S\')?U 4z(3i,1D):3i).1Z(c)},3M:k(){h 2N(c,10)},51:k(){h 2R(c)},4O:k(){h c.2a(/-\\D/g,k(1T){h 1T.4K(1).59()})},5V:k(){h c.2a(/\\w[A-Z]/g,k(1T){h(1T.4K(0)+\'-\'+1T.4K(1).30())})},5N:k(){h c.2a(/\\b[a-z]/g,k(1T){h 1T.59()})},55:k(){h c.2a(/^\\s+|\\s+$/g,\'\')},4y:k(){h c.2a(/\\s{2,}/g,\' \').55()},3k:k(12){o 1z=c.1T(/\\d{1,3}/g);h(1z)?1z.3k(12):1b},3I:k(12){o 2u=c.1T(/^#?(\\w{1,2})(\\w{1,2})(\\w{1,2})$/);h(2u)?2u.56(1).3I(12):1b},15:k(1S,s){h(s)?(s+c+s).2K(s+1S+s)>-1:c.2K(1S)>-1},7W:k(){h c.2a(/([.*+?^${}()|[\\]\\/\\\\])/g,\'\\\\$1\')}});1s.P({3k:k(12){m(c.O<3)h 1b;m(c.O==4&&c[3]==0&&!12)h\'7U\';o 2u=[];F(o i=0;i<3;i++){o 2B=(c[i]-0).7T(16);2u.1l((2B.O==1)?\'0\'+2B:2B)}h 12?2u:\'#\'+2u.1J(\'\')},3I:k(12){m(c.O!=3)h 1b;o 1z=[];F(o i=0;i<3;i++){1z.1l(2N((c[i].O==1)?c[i]+c[i]:c[i],16))}h 12?1z:\'1z(\'+1z.1J(\',\')+\')\'}});4P.P({1H:k(G){o B=c;G=$2C({\'K\':B,\'u\':1b,\'M\':1c,\'1r\':1b,\'2r\':1b,\'3e\':1b},G);m($35(G.M)&&$q(G.M)!=\'12\')G.M=[G.M];h k(u){o Q;m(G.u){u=u||E.u;Q=[(G.u===1f)?u:U G.u(u)];m(G.M)Q.P(G.M)}V Q=G.M||M;o 1X=k(){h B.2v($47(G.K,B),Q)};m(G.1r)h 7X(1X,G.1r);m(G.2r)h 7Y(1X,G.2r);m(G.3e)4i{h 1X()}3W(83){h 1b};h 1X()}},84:k(Q,K){h c.1H({\'M\':Q,\'K\':K})},3e:k(Q,K){h c.1H({\'M\':Q,\'K\':K,\'3e\':1f})()},K:k(K,Q){h c.1H({\'K\':K,\'M\':Q})},7j:k(K,Q){h c.1H({\'K\':K,\'u\':1f,\'M\':Q})},1r:k(1r,K,Q){h c.1H({\'1r\':1r,\'K\':K,\'M\':Q})()},2r:k(5b,K,Q){h c.1H({\'2r\':5b,\'K\':K,\'M\':Q})()}});57.P({3M:k(){h 2N(c)},51:k(){h 2R(c)},80:k(2p,2g){h W.2p(2g,W.2g(2p,c))},2E:k(2Y){2Y=W.2i(10,2Y||0);h W.2E(c*2Y)/2Y},6U:k(B){F(o i=0;i<c;i++)B(i)}});o C=U 1g({1G:k(r,1d){m($q(r)==\'1S\'){m(E.1A&&1d&&(1d.1x||1d.q)){o 1x=(1d.1x)?\' 1x="\'+1d.1x+\'"\':\'\';o q=(1d.q)?\' q="\'+1d.q+\'"\':\'\';4n 1d.1x;4n 1d.q;r=\'<\'+r+1x+q+\'>\'}r=L.64(r)}r=$(r);h(!1d||!r)?r:r.2t(1d)}});o 2q=U 1g({1G:k(X){h(X)?$P(X,c):c}});2q.P=k(1d){F(o 1i 18 1d){c.1a[1i]=1d[1i];c[1i]=$2w.3g(1i)}};k $(r){m(!r)h 1c;m(r.2A)h 1t.2x(r);m([E,L].15(r))h r;o q=$q(r);m(q==\'1S\'){r=L.6V(r);q=(r)?\'Y\':1b}m(q!=\'Y\')h 1c;m(r.2A)h 1t.2x(r);m([\'2h\',\'6R\'].15(r.5x.30()))h r;$P(r,C.1a);r.2A=k(){};h 1t.2x(r)};L.5u=L.3K;k $$(){o X=[];F(o i=0,j=M.O;i<j;i++){o 2G=M[i];1L($q(2G)){14\'Y\':X.1l(2G);14\'6Q\':1v;14 1b:1v;14\'1S\':2G=L.5u(2G,1f);4u:X.P(2G)}}h $$.4t(X)};$$.4t=k(12){o X=[];F(o i=0,l=12.O;i<l;i++){m(12[i].$3F)5f;o Y=$(12[i]);m(Y&&!Y.$3F){Y.$3F=1f;X.1l(Y)}}F(o n=0,d=X.O;n<d;n++)X[n].$3F=1c;h U 2q(X)};2q.3J=k(t){h k(){o Q=M;o 3Q=[];o X=1f;F(o i=0,j=c.O,1X;i<j;i++){1X=c[i][t].2v(c[i],Q);m($q(1X)!=\'Y\')X=1b;3Q.1l(1X)};h(X)?$$.4t(3Q):3Q}};C.P=k(1P){F(o t 18 1P){33.1a[t]=1P[t];C.1a[t]=1P[t];C[t]=$2w.3g(t);o 5P=(1s.1a[t])?t+\'2q\':t;2q.1a[5P]=2q.3J(t)}};C.P({2t:k(1d){F(o 1i 18 1d){o 2M=1d[1i];1L(1i){14\'7b\':c.5I(2M);1v;14\'I\':m(c.4c)c.4c(2M);1v;14\'1P\':c.4Z(2M);1v;4u:c.3q(1i,2M)}}h c},2D:k(r,60){r=$(r);1L(60){14\'5B\':r.25.4N(c,r);1v;14\'5C\':o 2P=r.5R();m(!2P)r.25.4v(c);V r.25.4N(c,2P);1v;14\'4j\':o 4q=r.4V;m(4q){r.4N(c,4q);1v}4u:r.4v(c)}h c},79:k(r){h c.2D(r,\'5B\')},7d:k(r){h c.2D(r,\'5C\')},7e:k(r){h c.2D(r,\'5A\')},7h:k(r){h c.2D(r,\'4j\')},7g:k(){o X=[];$1q(M,k(5v){X=X.7f(5v)});$$(X).2D(c);h c},2H:k(){h c.25.5q(c)},78:k(5w){o r=$(c.77(5w!==1b));m(!r.$I)h r;r.$I={};F(o q 18 c.$I)r.$I[q]={\'1j\':$A(c.$I[q].1j),\'2j\':$A(c.$I[q].2j)};h r.3H()},70:k(r){r=$(r);c.25.6Z(r,c);h r},5X:k(1V){c.4v(L.6X(1V));h c},4p:k(1k){h c.1k.15(1k,\' \')},5L:k(1k){m(!c.4p(1k))c.1k=(c.1k+\' \'+1k).4y();h c},5K:k(1k){c.1k=c.1k.2a(U 4z(\'(^|\\\\s)\'+1k+\'(?:\\\\s|$)\'),\'$1\').4y();h c},71:k(1k){h c.4p(1k)?c.5K(1k):c.5L(1k)},3O:k(t,N){1L(t){14\'1u\':h c.5G(2R(N));14\'76\':t=(E.1A)?\'8m\':\'74\'}t=t.4O();1L($q(N)){14\'4x\':m(![\'73\',\'5J\'].15(t))N+=\'2S\';1v;14\'12\':N=\'1z(\'+N.1J(\',\')+\')\'}c.17[t]=N;h c},5I:k(2d){1L($q(2d)){14\'2h\':C.3P(c,\'3O\',2d);1v;14\'1S\':c.17.41=2d}h c},5G:k(1u){m(1u==0){m(c.17.3t!="5H")c.17.3t="5H"}V{m(c.17.3t!="5U")c.17.3t="5U"}m(!c.3u||!c.3u.9x)c.17.5J=1;m(E.1A)c.17.5D=(1u==1)?\'\':"9u(1u="+1u*9v+")";c.17.1u=c.$2c.1u=1u;h c},23:k(t){t=t.4O();o 19=c.17[t];m(!$35(19)){m(t==\'1u\')h c.$2c.1u;19=[];F(o 17 18 C.26){m(t==17){C.26[17].1q(k(s){o 17=c.23(s);19.1l(2N(17)?17:\'5Y\')},c);m(t==\'24\'){o 3a=19.3a(k(2B){h(2B==19[0])});h(3a)?19[0]:1b}h 19.1J(\' \')}}m(t.15(\'24\')){m(C.26.24.15(t)){h[\'5Z\',\'4B\',\'4A\'].1N(k(p){h c.23(t+p)},c).1J(\' \')}V m(C.5a.15(t)){h[\'63\',\'62\',\'5W\',\'5Q\'].1N(k(p){h c.23(\'24\'+p+t.2a(\'24\',\'\'))},c).1J(\' \')}}m(L.5M)19=L.5M.9E(c,1c).9C(t.5V());V m(c.3u)19=c.3u[t]}m(E.1A)19=C.5z(t,19,c);m(19&&t.1Z(/3R/i)&&19.15(\'1z\')){h 19.6e(\'1z\').3L(1,4).1N(k(3R){h 3R.3k()}).1J(\' \')}h 19},9j:k(){h C.4e(c,\'23\',M)},2Q:k(3v,1o){3v+=\'9k\';o r=(1o)?c[1o]:c[3v];5O(r&&$q(r)!=\'Y\')r=r[3v];h $(r)},9f:k(){h c.2Q(\'2b\')},5R:k(){h c.2Q(\'2P\')},9l:k(){h c.2Q(\'2P\',\'4V\')},5T:k(){h c.2Q(\'2b\',\'9n\')},9o:k(){h $(c.25)},9I:k(){h $$(c.54)},4f:k(r){h!!$A(c.3K(\'*\')).15(r)},45:k(t){o 1Y=C.3b[t];m(1Y)h c[1Y];o 4Q=C.5m[t]||0;m(!E.1A||4Q)h c.9W(t,4Q);o 4R=c.a0[t];h(4R)?4R.4Y:1c},a2:k(t){o 1Y=C.3b[t];m(1Y)c[1Y]=\'\';V c.a1(t);h c},9T:k(){h C.4e(c,\'45\',M)},3q:k(t,N){o 1Y=C.3b[t];m(1Y)c[1Y]=N;V c.9L(t,N);h c},4Z:k(2d){h C.3P(c,\'3q\',2d)},5y:k(){c.5o=$A(M).1J(\'\');h c},9J:k(1V){o 2e=c.48();m([\'17\',\'2I\'].15(2e)){m(E.1A){m(2e==\'17\')c.5j.41=1V;V m(2e==\'2I\')c.3q(\'1V\',1V);h c}V{c.5q(c.4V);h c.5X(1V)}}c[$3p(c.4a)?\'4a\':\'5F\']=1V;h c},9d:k(){o 2e=c.48();m([\'17\',\'2I\'].15(2e)){m(E.1A){m(2e==\'17\')h c.5j.41;V m(2e==\'2I\')h c.45(\'1V\')}V{h c.5o}}h($47(c.4a,c.5F))},48:k(){h c.5x.30()},22:k(){1t.3m(c.3K(\'*\'));h c.5y(\'\')}});C.5z=k(t,19,Y){m($35(2N(19)))h 19;m([\'8H\',\'43\'].15(t)){o 2j=(t==\'43\')?[\'6d\',\'6J\']:[\'4j\',\'5A\'];o 3C=0;2j.1q(k(N){3C+=Y.23(\'24-\'+N+\'-43\').3M()+Y.23(\'3Y-\'+N).3M()});h Y[\'8A\'+t.5N()]-3C+\'2S\'}V m(t.1Z(/24(.+)5Z|61|3Y/)){h\'5Y\'}h 19};C.26={\'24\':[],\'3Y\':[],\'61\':[]};[\'63\',\'62\',\'5W\',\'5Q\'].1q(k(5S){F(o 17 18 C.26)C.26[17].1l(17+5S)});C.5a=[\'8M\',\'8N\',\'96\'];C.4e=k(r,3h,1j){o 19={};$1q(1j,k(1y){19[1y]=r[3h](1y)});h 19};C.3P=k(r,3h,4b){F(o 1y 18 4b)r[3h](1y,4b[1y]);h r};C.3b=U 2s({\'4X\':\'1k\',\'F\':\'98\',\'9a\':\'8S\',\'8R\':\'8O\',\'8T\':\'8V\',\'8W\':\'8X\',\'8Y\':\'8Z\',\'8U\':\'8P\',\'8Q\':\'90\',\'N\':\'N\',\'52\':\'52\',\'58\':\'58\',\'5t\':\'5t\',\'5c\':\'5c\'});C.5m={\'8u\':2,\'3z\':2};C.29={3r:{2n:k(q,B){m(c.4m)c.4m(q,B,1b);V c.8w(\'3V\'+q,B);h c},69:k(q,B){m(c.5s)c.5s(q,B,1b);V c.8y(\'3V\'+q,B);h c}}};E.P(C.29.3r);L.P(C.29.3r);C.P(C.29.3r);o 1t={X:[],2x:k(r){m(!r.$2c){1t.X.1l(r);r.$2c={\'1u\':1}}h r},3m:k(X){F(o i=0,j=X.O,r;i<j;i++){m(!(r=X[i])||!r.$2c)5f;m(r.$I)r.1U(\'3m\').3H();F(o p 18 r.$2c)r.$2c[p]=1c;F(o d 18 C.1a)r[d]=1c;1t.X[1t.X.2K(r)]=1c;r.2A=r.$2c=r=1c}1t.X.2H(1c)},22:k(){1t.2x(E);1t.2x(L);1t.3m(1t.X)}};E.2n(\'6f\',k(){E.2n(\'3X\',1t.22);m(E.1A)E.2n(\'3X\',9R)});o 1C=U 1g({1G:k(u){m(u&&u.$5i)h u;c.$5i=1f;u=u||E.u;c.u=u;c.q=u.q;c.2z=u.2z||u.9Y;m(c.2z.49==3)c.2z=c.2z.25;c.5E=u.9B;c.75=u.9H;c.9S=u.9P;c.8B=u.8K;m([\'44\',\'3n\'].15(c.q)){c.8I=(u.6z)?u.6z/8z:-(u.8r||0)/3}V m(c.q.15(\'1y\')){c.3y=u.6s||u.8o;F(o 1x 18 1C.1j){m(1C.1j[1x]==c.3y){c.1y=1x;1v}}m(c.q==\'6L\'){o 3s=c.3y-8s;m(3s>0&&3s<13)c.1y=\'f\'+3s}c.1y=c.1y||4o.8v(c.3y).30()}V m(c.q.1Z(/(6w|9c|9b)/)){c.99={\'x\':u.4k||u.65+L.1B.6E,\'y\':u.4g||u.6q+L.1B.6A};c.91={\'x\':u.4k?u.4k-E.6H:u.65,\'y\':u.4g?u.4g-E.6y:u.6q};c.97=(u.6s==3)||(u.93==2);1L(c.q){14\'3Z\':c.1m=u.1m||u.92;1v;14\'42\':c.1m=u.1m||u.94}c.6K()}h c},31:k(){h c.3j().3d()},3j:k(){m(c.u.3j)c.u.3j();V c.u.95=1f;h c},3d:k(){m(c.u.3d)c.u.3d();V c.u.8x=1b;h c}});1C.3B={1m:k(){m(c.1m&&c.1m.49==3)c.1m=c.1m.25},6j:k(){4i{1C.3B.1m.1E(c)}3W(e){c.1m=c.2z}}};1C.1a.6K=(E.4l)?1C.3B.6j:1C.3B.1m;1C.1j=U 2s({\'8t\':13,\'8n\':38,\'8q\':40,\'6d\':37,\'6J\':39,\'8J\':27,\'8L\':32,\'8G\':8,\'8C\':9,\'4n\':46});C.29.1R={2o:k(q,B){c.$I=c.$I||{};c.$I[q]=c.$I[q]||{\'1j\':[],\'2j\':[]};m(c.$I[q].1j.15(B))h c;c.$I[q].1j.1l(B);o 3G=q;o 1n=C.1R[q];m(1n){m(1n.4T)1n.4T.1E(c,B);m(1n.1N)B=1n.1N;m(1n.q)3G=1n.q}m(!c.4m)B=B.1H({\'K\':c,\'u\':1f});c.$I[q].2j.1l(B);h(C.4h.15(3G))?c.2n(3G,B):c},4d:k(q,B){m(!c.$I||!c.$I[q])h c;o 1F=c.$I[q].1j.2K(B);m(1F==-1)h c;o 1y=c.$I[q].1j.3L(1F,1)[0];o N=c.$I[q].2j.3L(1F,1)[0];o 1n=C.1R[q];m(1n){m(1n.2H)1n.2H.1E(c,B);m(1n.q)q=1n.q}h(C.4h.15(q))?c.69(q,N):c},4c:k(2d){h C.3P(c,\'2o\',2d)},3H:k(q){m(!c.$I)h c;m(!q){F(o 3A 18 c.$I)c.3H(3A);c.$I=1c}V m(c.$I[q]){c.$I[q].1j.1q(k(B){c.4d(q,B)},c);c.$I[q]=1c}h c},1U:k(q,Q,1r){m(c.$I&&c.$I[q]){c.$I[q].1j.1q(k(B){B.1H({\'K\':c,\'1r\':1r,\'M\':Q})()},c)}h c},6D:k(H,q){m(!H.$I)h c;m(!q){F(o 3A 18 H.$I)c.6D(H,3A)}V m(H.$I[q]){H.$I[q].1j.1q(k(B){c.2o(q,B)},c)}h c}};E.P(C.29.1R);L.P(C.29.1R);C.P(C.29.1R);C.1R=U 2s({\'6C\':{q:\'3Z\',1N:k(u){u=U 1C(u);m(u.1m!=c&&!c.4f(u.1m))c.1U(\'6C\',u)}},\'6B\':{q:\'42\',1N:k(u){u=U 1C(u);m(u.1m!=c&&!c.4f(u.1m))c.1U(\'6B\',u)}},\'3n\':{q:(E.4l)?\'44\':\'3n\'}});C.4h=[\'6w\',\'8D\',\'9e\',\'8E\',\'3n\',\'44\',\'3Z\',\'42\',\'8F\',\'6L\',\'9M\',\'9Q\',\'6P\',\'3X\',\'6f\',\'9O\',\'9N\',\'9K\',\'9U\',\'6p\',\'a3\',\'9Z\',\'2U\',\'9V\',\'9X\',\'9p\',\'6u\'];4P.P({9q:k(K,Q){h c.1H({\'K\':K,\'M\':Q,\'u\':1C})}});C.1R.4U={4T:k(B){m(E.3w){B.1E(c);h}o 2O=k(){m(E.3w)h;E.3w=1f;E.1w=$4s(E.1w);c.1U(\'4U\')}.K(c);m(L.3f&&E.2m){E.1w=k(){m([\'3w\',\'6O\'].15(L.3f))2O()}.2r(50)}V m(L.3f&&E.1A){m(!$(\'4S\')){o 3z=(E.9r.9m==\'9g:\')?\'://0\':\'9h:9i(0)\';L.9s(\'<2I 9t="4S" 9D 3z="\'+3z+\'"><\\/2I>\');$(\'4S\').9F=k(){m(c.3f==\'6O\')2O()}}}V{E.2n("6P",2O);L.2n("9G",2O)}}};E.9A=k(B){h c.2o(\'4U\',B)};E.P({6I:k(){m(c.4W)h c.9w;m(c.6G)h L.3U.6x;h L.1B.6x},6N:k(){m(c.4W)h c.9z;m(c.6G)h L.3U.6F;h L.1B.6F},6M:k(){m(c.1A)h W.2g(L.1B.9y,L.1B.4M);m(c.2m)h L.3U.4M;h L.1B.4M},6v:k(){m(c.1A)h W.2g(L.1B.8p,L.1B.4w);m(c.2m)h L.3U.4w;h L.1B.4w},6g:k(){h c.6H||L.1B.6E},6b:k(){h c.6y||L.1B.6A},72:k(){h{\'3C\':{\'x\':c.6I(),\'y\':c.6N()},\'6Y\':{\'x\':c.6M(),\'y\':c.6v()},\'6u\':{\'x\':c.6g(),\'y\':c.6b()}}},7a:k(){h{\'x\':0,\'y\':0}}});o T={};T.3D=U 1g({G:{6m:1g.22,6h:1g.22,6n:1g.22,1h:k(p){h-(W.66(W.4D*p)-1)/2},4r:6W,1Q:\'2S\',3S:1f,6l:50},1G:k(G){c.Y=c.Y||1c;c.6a(G);m(c.G.1G)c.G.1G.1E(c)},6o:k(){o 1W=$1W();m(1W<c.1W+c.G.4r){c.6t=c.G.1h((1W-c.1W)/c.G.4r);c.3E();c.3N()}V{c.31(1f);c.2t(c.J);c.1U(\'6h\',c.Y,10);c.6i()}},2t:k(J){c.1p=J;c.3N();h c},3E:k(){c.1p=c.2X(c.H,c.J)},2X:k(H,J){h(J-H)*c.6t+H},1o:k(H,J){m(!c.G.3S)c.31();V m(c.1w)h c;c.H=H;c.J=J;c.6p=c.J-c.H;c.1W=$1W();c.1w=c.6o.2r(W.2E(7c/c.G.6l),c);c.1U(\'6m\',c.Y);h c},31:k(3T){m(!c.1w)h c;c.1w=$4s(c.1w);m(!3T)c.1U(\'6n\',c.Y);h c},1n:k(H,J){h c.1o(H,J)},7i:k(3T){h c.31(3T)}});T.3D.6r(U 68,U 1R,U 67);T.2f={2U:k(t,J){m(t.1Z(/3R/i))h c.4A;o q=$q(J);m((q==\'12\')||(q==\'1S\'&&J.15(\' \')))h c.3J;h c.6c},1K:k(r,t,2J){m(!2J.1l)2J=[2J];o H=2J[0],J=2J[1];m(!$35(J)){J=H;H=r.23(t)}o 1e=c.2U(t,J);h{\'H\':1e.1K(H),\'J\':1e.1K(J),\'1e\':1e}}};T.2f.6c={1K:k(N){h 2R(N)},2V:k(H,J,2F){h 2F.2X(H,J)},34:k(N,1Q,t){m(1Q==\'2S\'&&t!=\'1u\')N=W.2E(N);h N+1Q}};T.2f.3J={1K:k(N){h N.1l?N:N.6e(\' \').1N(k(v){h 2R(v)})},2V:k(H,J,2F){o 1p=[];F(o i=0;i<H.O;i++)1p[i]=2F.2X(H[i],J[i]);h 1p},34:k(N,1Q,t){m(1Q==\'2S\'&&t!=\'1u\')N=N.1N(W.2E);h N.1J(1Q+\' \')+1Q}};T.2f.4A={1K:k(N){h N.1l?N:N.3I(1f)},2V:k(H,J,2F){o 1p=[];F(o i=0;i<H.O;i++)1p[i]=W.2E(2F.2X(H[i],J[i]));h 1p},34:k(N){h\'1z(\'+N.1J(\',\')+\')\'}};T.4B=T.3D.P({1G:k(r,t,G){c.Y=$(r);c.t=t;c.21(G)},6S:k(){h c.2t(0)},3E:k(){c.1p=c.1e.2V(c.H,c.J,c)},2t:k(J){c.1e=T.2f.2U(c.t,J);h c.21(c.1e.1K(J))},1o:k(H,J){m(c.1w&&c.G.3S)h c;o 1I=T.2f.1K(c.Y,c.t,[H,J]);c.1e=1I.1e;h c.21(1I.H,1I.J)},3N:k(){c.Y.3O(c.t,c.1e.34(c.1p,c.G.1Q,c.t))}});C.P({6T:k(t,G){h U T.4B(c,t,G)}});T.26=T.3D.P({1G:k(r,G){c.Y=$(r);c.21(G)},3E:k(){F(o p 18 c.H)c.1p[p]=c.1e[p].2V(c.H[p],c.J[p],c)},2t:k(J){o 1I={};c.1e={};F(o p 18 J){c.1e[p]=T.2f.2U(p,J[p]);1I[p]=c.1e[p].1K(J[p])}h c.21(1I)},1o:k(R){m(c.1w&&c.G.3S)h c;c.1p={};c.1e={};o H={},J={};F(o p 18 R){o 1I=T.2f.1K(c.Y,p,R[p]);H[p]=1I.H;J[p]=1I.J;c.1e[p]=1I.1e}h c.21(H,J)},3N:k(){F(o p 18 c.1p)c.Y.3O(p,c.1e[p].34(c.1p[p],c.G.1Q,p))}});C.P({8l:k(G){h U T.26(c,G)}});T.4E=k(1h,1D){1D=1D||[];m($q(1D)!=\'12\')1D=[1D];h $P(1h,{7Z:k(1F){h 1h(1F,1D)},81:k(1F){h 1-1h(1-1F,1D)},82:k(1F){h(1F<=0.5)?1h(2*1F,1D)/2:(2-1h(2*(1-1F),1D))/2}})};T.1M=U 2s({7S:k(p){h p}});T.1M.P=k(4I){F(o 1h 18 4I){T.1M[1h]=U T.4E(4I[1h]);T.1M.4F(1h)}};T.1M.4F=k(1h){[\'7R\',\'7V\',\'85\'].1q(k(4J){T.1M[1h.30()+4J]=T.1M[1h][\'86\'+4J]})};T.1M.P({8g:k(p,x){h W.2i(p,x[0]||6)},8f:k(p){h W.2i(2,8*(p-1))},8h:k(p){h 1-W.6k(W.8i(p))},8k:k(p){h 1-W.6k((1-p)*W.4D/2)},8j:k(p,x){x=x[0]||1.8d;h W.2i(p,2)*((x+1)*p-x)},88:k(p){o N;F(o a=0,b=1;1;a+=b,b/=2){m(p>=(7-4*a)/11){N=-W.2i((11-6*a-11*p)/4,2)+b*b;1v}}h N},8b:k(p,x){h W.2i(2,10*--p)*W.66(20*p*W.4D*(x[0]||1)/3)}});[\'7v\',\'7r\',\'7z\',\'7I\'].1q(k(1h,i){T.1M[1h]=U T.4E(k(p){h W.2i(p,[i+2])});T.1M.4F(1h)});',62,624,'||||||||||||this|||||return|||function||if||var||type|el||property|event|||||||fn|Element||window|for|options|from|events|to|bind|document|arguments|value|length|extend|args|obj||Fx|new|else|Math|elements|element||||array||case|contains||style|in|result|prototype|false|null|props|css|true|Class|transition|prop|keys|className|push|relatedTarget|custom|start|now|each|delay|Array|Garbage|opacity|break|timer|name|key|rgb|ie|documentElement|Event|params|call|pos|initialize|create|parsed|join|parse|switch|Transitions|map|item|properties|unit|Events|string|match|fireEvent|text|time|returns|index|test||parent|empty|getStyle|border|parentNode|Styles||iterable|Methods|replace|previous|tmp|source|tag|CSS|max|object|pow|values|current|chains|webkit|addListener|addEvent|min|Elements|periodical|Abstract|set|hex|apply|native|collect|results|target|htmlElement|bit|merge|inject|round|fx|selector|remove|script|fromTo|indexOf|len|val|parseInt|domReady|next|walk|parseFloat|px|klass|select|getNow|option|compute|precision|mix|toLowerCase|stop||HTMLElement|getValue|chk|typeof||||every|Properties|forEach|preventDefault|attempt|readyState|generic|method|regex|stopPropagation|rgbToHex|ap|trash|mousewheel|mp|defined|setProperty|Listeners|fKey|visibility|currentStyle|brother|loaded|proto|code|src|evType|fix|size|Base|setNow|included|realType|removeEvents|hexToRgb|Multi|getElementsByTagName|splice|toInt|increase|setStyle|setMany|items|color|wait|end|body|on|catch|unload|padding|mouseover||cssText|mouseout|width|DOMMouseScroll|getProperty||pick|getTag|nodeType|innerText|pairs|addEvents|removeEvent|getMany|hasChild|pageY|NativeEvents|try|top|pageX|gecko|addEventListener|delete|String|hasClass|first|duration|clear|unique|default|appendChild|scrollHeight|number|clean|RegExp|Color|Style|merged|PI|Transition|compat|newArray|include|transitions|easeType|charAt|random|scrollWidth|insertBefore|camelCase|Function|flag|node|ie_ready|add|domready|firstChild|webkit419|class|nodeValue|setProperties||toFloat|disabled|copy|childNodes|trim|slice|Number|checked|toUpperCase|borderShort|interval|selected|xpath|undefined|continue|head|picked|extended|styleSheet|ie6|constructor|PropertiesIFlag|callee|innerHTML|Merge|removeChild|pp|removeEventListener|multiple|getElementsBySelector|argument|contents|tagName|setHTML|fixStyle|bottom|before|after|filter|shift|textContent|setOpacity|hidden|setStyles|zoom|removeClass|addClass|defaultView|capitalize|while|elementsProperty|Left|getNext|direction|getLast|visible|hyphenate|Bottom|appendText|0px|Width|where|margin|Right|Top|createElement|clientX|cos|Options|Chain|removeListener|setOptions|getScrollTop|Single|left|split|beforeunload|getScrollLeft|onComplete|callChain|relatedTargetGecko|sin|fps|onStart|onCancel|step|change|clientY|implement|which|delta|scroll|getScrollHeight|click|clientWidth|pageYOffset|wheelDelta|scrollTop|mouseleave|mouseenter|cloneEvents|scrollLeft|clientHeight|opera|pageXOffset|getWidth|right|fixRelatedTarget|keydown|getScrollWidth|getHeight|complete|load|boolean|embed|hide|effect|times|getElementById|500|createTextNode|scrollSize|replaceChild|replaceWith|toggleClass|getSize|zIndex|cssFloat|control|float|cloneNode|clone|injectBefore|getPosition|styles|1000|injectAfter|injectInside|concat|adopt|injectTop|clearTimer|bindAsEventListener|all|navigator|taintEnabled|ie7|XMLHttpRequest|evaluate|ActiveXObject|Cubic|webkit420|iframe|DOMElement|Quad|Object|getBoxObjectFor|khtml|Quart|Document|whitespace|regexp|textnode|nodeName|MooTools|version|collection|Quint|clearInterval|Window|clearTimeout|getTime|floor|Date|execCommand|BackgroundImageCache|In|linear|toString|transparent|Out|escapeRegExp|setTimeout|setInterval|easeIn|limit|easeOut|easeInOut|err|pass|InOut|ease|associate|Bounce|some|clearChain|Elastic|chain|618|getRandom|Expo|Pow|Circ|acos|Back|Sine|effects|styleFloat|up|keyCode|offsetHeight|down|detail|111|enter|href|fromCharCode|attachEvent|returnValue|detachEvent|120|offset|meta|tab|dblclick|mousedown|mousemove|backspace|height|wheel|esc|metaKey|space|borderWidth|borderStyle|rowSpan|readOnly|frameborder|rowspan|colSpan|accesskey|readonly|accessKey|tabindex|tabIndex|maxlength|maxLength|frameBorder|client|fromElement|button|toElement|cancelBubble|borderColor|rightClick|htmlFor|page|colspan|menu|mouse|getText|mouseup|getPrevious|https|javascript|void|getStyles|Sibling|getFirst|protocol|lastChild|getParent|contextmenu|bindWithEvent|location|write|id|alpha|100|innerWidth|hasLayout|offsetWidth|innerHeight|onDomReady|shiftKey|getPropertyValue|defer|getComputedStyle|onreadystatechange|DOMContentLoaded|ctrlKey|getChildren|setText|focus|setAttribute|keypress|move|resize|altKey|keyup|CollectGarbage|alt|getProperties|blur|error|getAttribute|abort|srcElement|reset|attributes|removeAttribute|removeProperty|submit'.split('|'),0,{}))

/*
	Slimbox v1.41 - The ultimate lightweight Lightbox clone
	by Christophe Beyls (http://www.digitalia.be) - MIT-style license.
	Inspired by the original Lightbox v2 by Lokesh Dhakar.
*/

var Lightbox = {
	
	
	init: function(options){
		this.options = $extend({
			resizeDuration: 400,
			resizeTransition: false,	// default transition
			initialWidth: 250,
			initialHeight: 250,
			animateCaption: true,
			showCounter: true
		}, options || {});
		
		this.anchors = [];
		$each(document.links, function(el){
			if (el.rel && el.rel.test(/^lightbox/i)){
				el.onclick = this.click.pass(el, this);
				this.anchors.push(el);
			}
		}, this);
		this.eventKeyDown = this.keyboardListener.bindAsEventListener(this);
		this.eventPosition = this.position.bind(this);

		this.overlay = new Element('div', {'id': 'lbOverlay'}).injectInside(document.body);

		this.center = new Element('div', {'id': 'lbCenter', 'styles': {'width': this.options.initialWidth, 'height': this.options.initialHeight, 'marginLeft': -(this.options.initialWidth/2), 'display': 'none'}}).injectInside(document.body);
		this.image = new Element('div', {'id': 'lbImage'}).injectInside(this.center);
		new Element('a', {'id': 'lbCloseLink', 'href': '#', 'title': 'Close this image window'}).injectInside(this.image).onclick = this.overlay.onclick = this.close.bind(this);
		

		this.bottomContainer = new Element('div', {'id': 'lbBottomContainer', 'styles': {'display': 'none'}}).injectInside(document.body);
		this.bottom = new Element('div', {'id': 'lbBottom'}).injectInside(this.bottomContainer);
		
		this.prevLink = new Element('a', {'id': 'lbPrevLink', 'href': '#', 'title': 'Click to view PREVIOUS image', 'styles': {'display': 'none'}}).injectInside(this.bottom);
		this.nextLink = new Element('a', {'id': 'lbNextLink', 'href': '#', 'title': 'Click to view NEXT image', 'styles': {'display': 'none'}}).injectInside(this.bottom);
		this.caption = new Element('div', {'id': 'lbCaption'}).injectInside(this.bottom);
		this.number = new Element('div', {'id': 'lbNumber'}).injectInside(this.bottom);
		this.prevLink.onclick = this.previous.bind(this);
		this.nextLink.onclick = this.next.bind(this);
		new Element('div', {'styles': {'clear': 'both'}}).injectInside(this.bottom);

		var nextEffect = this.nextEffect.bind(this);
		this.fx = {
			overlay: this.overlay.effect('opacity', {duration: 500}).hide(),
			resize: this.center.effects($extend({duration: this.options.resizeDuration, onComplete: nextEffect}, this.options.resizeTransition ? {transition: this.options.resizeTransition} : {})),
			image: this.image.effect('opacity', {duration: 500, onComplete: nextEffect}),
			bottom: this.bottom.effect('margin-top', {duration: 400, onComplete: nextEffect})
		};

		this.preloadPrev = new Image();
		this.preloadNext = new Image();
	},

	click: function(link){
		if (link.rel.length == 8) return this.show(link.href, link.title);

		var j, imageNum, images = [];
		this.anchors.each(function(el){
			if (el.rel == link.rel){
				for (j = 0; j < images.length; j++) if(images[j][0] == el.href) break;
				if (j == images.length){
					images.push([el.href, el.title]);
					if (el.href == link.href) imageNum = j;
				}
			}
		}, this);
		return this.open(images, imageNum);
	},

	show: function(url, title){
		return this.open([[url, title]], 0);
	},

	open: function(images, imageNum){
		this.images = images;
		this.position();
		this.setup(true);
		this.top = window.getScrollTop() + (window.getHeight() / 15);
		this.center.setStyles({top: this.top, display: ''});
		this.fx.overlay.start(0.9);
		return this.changeImage(imageNum);
	},

	position: function(){
		this.overlay.setStyles({'top': window.getScrollTop(), 'height': window.getHeight()});
	},

	setup: function(open){
		var elements = $A(document.getElementsByTagName('object'));
		elements.extend(document.getElementsByTagName(window.ie ? 'select' : 'embed'));
		elements.each(function(el){
			if (open) el.lbBackupStyle = el.style.visibility;
			el.style.visibility = open ? 'hidden' : el.lbBackupStyle;
		});
		var fn = open ? 'addEvent' : 'removeEvent';
		window[fn]('scroll', this.eventPosition)[fn]('resize', this.eventPosition);
		document[fn]('keydown', this.eventKeyDown);
		this.step = 0;
	},

	keyboardListener: function(event){
		switch (event.keyCode){
			case 27: case 88: case 67: this.close(); break;
			case 37: case 80: this.previous(); break;	
			case 39: case 78: this.next();
		}
	},

	previous: function(){
		return this.changeImage(this.activeImage-1);
	},

	next: function(){
		return this.changeImage(this.activeImage+1);
	},

	changeImage: function(imageNum){
		if (this.step || (imageNum < 0) || (imageNum >= this.images.length)) return false;
		this.step = 1;
		this.activeImage = imageNum;

		this.bottomContainer.style.display = this.prevLink.style.display = this.nextLink.style.display = 'none';
		this.fx.image.hide();
		this.center.className = 'lbLoading';

		this.preload = new Image();
		this.preload.onload = this.nextEffect.bind(this);
		this.preload.src = this.images[imageNum][0];
		return false;
	},

	nextEffect: function(){
		switch (this.step++){
		case 1:
			this.center.className = '';
			this.image.style.backgroundImage = 'url('+this.images[this.activeImage][0]+')';
			this.image.style.width = this.bottom.style.width = this.preload.width+'px';
			this.image.style.height = this.prevLink.style.height = this.nextLink.style.height = this.preload.height+'px';

			
			var aI = this.activeImage;
			var al = document.getElementById("caption_"+(aI));
			if (al)
				{
					al = al.innerHTML;
				} 
			else
				{
					al = "";
				}
			
			
			this.number.setHTML((!this.options.showCounter || (this.images.length == 1)) ? '' : 'Image '+(this.activeImage+1)+' of '+this.images.length+'<br />'+(al));
			
			
			if (this.activeImage) this.preloadPrev.src = this.images[this.activeImage-1][0];
			if (this.activeImage != (this.images.length - 1)) this.preloadNext.src = this.images[this.activeImage+1][0];
			if (this.center.clientHeight != this.image.offsetHeight){
				this.fx.resize.start({height: this.image.offsetHeight});
				break;
			}
			this.step++;
		case 2:
			if (this.center.clientWidth != this.image.offsetWidth){
				this.fx.resize.start({width: this.image.offsetWidth, marginLeft: -this.image.offsetWidth/2});
				break;
			}
			this.step++;
		case 3:
			this.bottomContainer.setStyles({top: this.top + this.center.clientHeight, height: 0, marginLeft: this.center.style.marginLeft, display: ''});
			this.fx.image.start(1);
			break;
		case 4:
			if (this.options.animateCaption){
				this.fx.bottom.set(-this.bottom.offsetHeight);
				this.bottomContainer.style.height = '';
				this.fx.bottom.start(0);
				break;
			}
			this.bottomContainer.style.height = '';
		case 5:
			if (this.activeImage) this.prevLink.style.display = '';
			if (this.activeImage != (this.images.length - 1)) this.nextLink.style.display = '';
			this.step = 0;
		}
	},

	close: function(){
		if (this.step < 0) return;
		this.step = -1;
		if (this.preload){
			this.preload.onload = Class.empty;
			this.preload = null;
		}
		for (var f in this.fx) this.fx[f].stop();
		this.center.style.display = this.bottomContainer.style.display = 'none';
		this.fx.overlay.chain(this.setup.pass(false, this)).start(0);
		return false;
	}
};

window.addEvent('domready', Lightbox.init.bind(Lightbox));




/*-----------------------------------------------------------------------------*/
// Start of window.onload fix (by Dean Edwards/Matthias Miller/John Resig)
/*-----------------------------------------------------------------------------*/
	function init()
		{
   			// quit if this function has already been called
  	 		if (arguments.callee.done) return;

    		// flag this function so we don't do the same thing twice
    		arguments.callee.done = true;

    		// kill the timer
    		if (_timer) clearInterval(_timer);
			
			
			/*-----------------------------------------------------------------------------*/
			/*-----------------------------------------------------------------------------*/
    		// Start of Javascript to initialise when page loads...
					
			doExternalLink();
			Fat.fade_all();
			if(document.getElementById('printPage')) {document.getElementById('printPage').innerHTML = '<a href="javascript:window.print()" title="Print this Page" class="print">Print this Page</a>';}
			document.getElementById('favorites').innerHTML = "<a href=\"javascript:bookmarksite('"+document.title+"', '"+location.href+"')\" title=\"Add this page to your favourites\" class=\"favorites\">Add to Favourites</a>";
			geo();
			// End of Javascript to initialise when page loads
			/*-----------------------------------------------------------------------------*/
			/*-----------------------------------------------------------------------------*/
		};

	/* for Mozilla/Opera9 */
	if (document.addEventListener)
		{
   			document.addEventListener("DOMContentLoaded", init, false);
		}

	/* for Internet Explorer */
	/*@cc_on @*/
	/*@if (@_win32)
   	 	document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
   	 	var script = document.getElementById("__ie_onload");
    	script.onreadystatechange = function()
			{
        		if (this.readyState == "complete")
					{
            			init(); // call the onload handler
        			}
    		};
		/*@end @*/

	/* for Safari */
		if (/WebKit/i.test(navigator.userAgent))
			{ // sniff
    			var _timer = setInterval(function()
					{
        				if (/loaded|complete/.test(document.readyState))
							{
            					init(); // call the onload handler
        					}
    				}, 10);
			}

	/* for other browsers */
		window.onload = init;

/*-----------------------------------------------------------------------------*/
// End of window.onload fix
/*-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------*/
// Start of Bookmark Site function
/*-----------------------------------------------------------------------------*/
function bookmarksite(title,url)
	{
		if (window.sidebar) 
			{// firefox
				window.sidebar.addPanel(title, url, "");
			}
		else if(window.opera && window.print)
			{ // opera
				var elem = document.createElement('a');
				elem.setAttribute('href',url);
				elem.setAttribute('title',title);
				elem.setAttribute('rel','sidebar');
				elem.click();
			} 
		else if(document.all)
			{// ie
				window.external.AddFavorite(url, title);
			}
	}
/*-----------------------------------------------------------------------------*/
// End of Bookmark Site function
/*-----------------------------------------------------------------------------*/
 
/*-----------------------------------------------------------------------------*/
// Start of clearInputs Function
/*-----------------------------------------------------------------------------*/
/*		This function loops through all the text inputs on a page and stores their default values.
		When a text input is brought into focus, its current value is checked against its default value.
		If they are the same, the value is cleared.
		This allows you to add placeholder text to inputs (recommended for accessibility) but users don't have to manually delete the placeholder text.
		This function is triggered when the page loads. */

function clearInputs()
	{
		if (!document.getElementsByTagName)
			{
				return false;
			}
 		var all_inputs = document.getElementsByTagName('input');
 		for (var i=0;i<all_inputs.length;i++)
			{
  				var current_input = all_inputs[i];
  				if (current_input.getAttribute('type') == 'text' && current_input.getAttribute('value') != '')
					{
   						current_input.default_text = current_input.getAttribute('value');
   						current_input.onfocus = function()
							{
    							if (this.getAttribute('value') == this.default_text)
									{
     									this.setAttribute('value','');
									};
							}
					}
			}
	}
/*-----------------------------------------------------------------------------*/
// End of clearInputs Function
/*-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------*/
// Start of externalLink function
// Opens a link in a new window when class = externalLink
/*-----------------------------------------------------------------------------*/
function doExternalLink()
	{
		if (!document.getElementsByTagName)
			{
				return false;
			}
  		var links = document.getElementsByTagName("a");
  		for (var i=0; i < links.length; i++)
			{
    			if (links[i].className.match("externalLink"))
					{
						links[i].className = links[i].className + " newWinStyle";
							if (links[i].title == "")
								{
									links[i].title = "(opens in new window)";
								}
							else
								{
									links[i].title = links[i].title + " (opens in new window)";	
								}
	 						links[i].onclick = function(e)
								{
									if(!e)e=window.event;
									if(e.shiftKey || e.ctrlKey || e.altKey) return;
									window.open(this.href);
									return false;
								}
      				}
    		}
	}
/*-----------------------------------------------------------------------------*/
// End of externalLink Function
/*-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------*/
// Start of Array Shorthand
/*-----------------------------------------------------------------------------*/
// Shorthand for seeing if something is in an array

Array.prototype.inArray = function (value) {
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] === value) {
			return true;
		}
	}
	return false;
};
/*-----------------------------------------------------------------------------*/
// End of Array Shorthand
/*-----------------------------------------------------------------------------*/


/*-----------------------------------------------------------------------------*/
// Start of IE Cache Fix
/*-----------------------------------------------------------------------------*/
// Solves an IE caching problem
var EventCache = function(){
	var listEvents = [];
	return {
		listEvents : listEvents,
		add : function(node, sEventName, fHandler){
			listEvents.push(arguments);
		},
		flush : function(){
			var i, item;
			for(i = listEvents.length - 1; i >= 0; i = i - 1){
				item = listEvents[i];
				if(item[0].removeEventListener){
					item[0].removeEventListener(item[1], item[2], item[3]);
				};
				if(item[1].substring(0, 2) != "on"){
					item[1] = "on" + item[1];
				};
				if(item[0].detachEvent){
					item[0].detachEvent(item[1], item[2]);
				};
				item[0][item[1]] = null;
			};
		}
	};
}();
addEventy(window,'unload',EventCache.flush);
/*-----------------------------------------------------------------------------*/
// End of IE Cache Fix
/*-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------*/
// Start of dropdown menu Function
/*-----------------------------------------------------------------------------*/
/*		This fixes the dropdown menu to work in IE */
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
/*-----------------------------------------------------------------------------*/
// End of dropdown menu fix
/*-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------*/
// Start of Easy Add Event
/*-----------------------------------------------------------------------------*/
// Easy way of adding an event
function addEventy( obj,type,fn ){
 if (obj.addEventListener){
 obj.addEventListener( type,fn,false );
 EventCache.add(obj,type,fn);
}
 else if (obj.attachEvent){
 obj["e"+type+fn] = fn;
 obj[type+fn] = function(){obj["e"+type+fn]( window.event );}
 obj.attachEvent( "on"+type,obj[type+fn] );
 EventCache.add(obj,type,fn);
}
 else{
 obj["on"+type] = obj["e"+type+fn];
}
}
/*-----------------------------------------------------------------------------*/
// End of Easy Add Event
/*-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------*/
//		Start of Unobtrusive Flash Objects (UFO) v3.21
/*-----------------------------------------------------------------------------*/
/*	Unobtrusive Flash Objects (UFO) v3.22 <http://www.bobbyvandersluis.com/ufo/>
	Copyright 2005-2007 Bobby van der Sluis
	This software is licensed under the CC-GNU LGPL <http://creativecommons.org/licenses/LGPL/2.1/>
			
	This function inserts the flash objects into the page if the visitor has flash enabled. */


var UFO = {
	req: ["movie", "width", "height", "majorversion", "build"],
	opt: ["play", "loop", "menu", "quality", "scale", "salign", "wmode", "bgcolor", "base", "flashvars", "devicefont", "allowscriptaccess", "seamlesstabbing", "allowfullscreen", "allownetworking"],
	optAtt: ["id", "name", "align"],
	optExc: ["swliveconnect"],
	ximovie: "ufo.swf",
	xiwidth: "215",
	xiheight: "138",
	ua: navigator.userAgent.toLowerCase(),
	pluginType: "",
	fv: [0,0],
	foList: [],
		
	create: function(FO, id) {
		if (!UFO.uaHas("w3cdom") || UFO.uaHas("ieMac")) return;
		UFO.getFlashVersion();
		UFO.foList[id] = UFO.updateFO(FO);
		UFO.createCSS("#" + id, "visibility:hidden;");
		UFO.domLoad(id);
	},

	updateFO: function(FO) {
		if (typeof FO.xi != "undefined" && FO.xi == "true") {
			if (typeof FO.ximovie == "undefined") FO.ximovie = UFO.ximovie;
			if (typeof FO.xiwidth == "undefined") FO.xiwidth = UFO.xiwidth;
			if (typeof FO.xiheight == "undefined") FO.xiheight = UFO.xiheight;
		}
		FO.mainCalled = false;
		return FO;
	},

	domLoad: function(id) {
		var _t = setInterval(function() {
			if ((document.getElementsByTagName("body")[0] != null || document.body != null) && document.getElementById(id) != null) {
				UFO.main(id);
				clearInterval(_t);
			}
		}, 250);
		if (typeof document.addEventListener != "undefined") {
			document.addEventListener("DOMContentLoaded", function() { UFO.main(id); clearInterval(_t); } , null); // Gecko, Opera 9+
		}
	},

	main: function(id) {
		var _fo = UFO.foList[id];
		if (_fo.mainCalled) return;
		UFO.foList[id].mainCalled = true;
		document.getElementById(id).style.visibility = "hidden";
		if (UFO.hasRequired(id)) {
			if (UFO.hasFlashVersion(parseInt(_fo.majorversion, 10), parseInt(_fo.build, 10))) {
				if (typeof _fo.setcontainercss != "undefined" && _fo.setcontainercss == "true") UFO.setContainerCSS(id);
				UFO.writeSWF(id);
			}
			else if (_fo.xi == "true" && UFO.hasFlashVersion(6, 65)) {
				UFO.createDialog(id);
			}
		}
		document.getElementById(id).style.visibility = "visible";
	},
	
	createCSS: function(selector, declaration) {
		var _h = document.getElementsByTagName("head")[0]; 
		var _s = UFO.createElement("style");
		if (!UFO.uaHas("ieWin")) _s.appendChild(document.createTextNode(selector + " {" + declaration + "}")); // bugs in IE/Win
		_s.setAttribute("type", "text/css");
		_s.setAttribute("media", "screen"); 
		_h.appendChild(_s);
		if (UFO.uaHas("ieWin") && document.styleSheets && document.styleSheets.length > 0) {
			var _ls = document.styleSheets[document.styleSheets.length - 1];
			if (typeof _ls.addRule == "object") _ls.addRule(selector, declaration);
		}
	},
	
	setContainerCSS: function(id) {
		var _fo = UFO.foList[id];
		var _w = /%/.test(_fo.width) ? "" : "px";
		var _h = /%/.test(_fo.height) ? "" : "px";
		UFO.createCSS("#" + id, "width:" + _fo.width + _w +"; height:" + _fo.height + _h +";");
		if (_fo.width == "100%") {
			UFO.createCSS("body", "margin-left:0; margin-right:0; padding-left:0; padding-right:0;");
		}
		if (_fo.height == "100%") {
			UFO.createCSS("html", "height:100%; overflow:hidden;");
			UFO.createCSS("body", "margin-top:0; margin-bottom:0; padding-top:0; padding-bottom:0; height:100%;");
		}
	},

	createElement: function(el) {
		return (UFO.uaHas("xml") && typeof document.createElementNS != "undefined") ?  document.createElementNS("http://www.w3.org/1999/xhtml", el) : document.createElement(el);
	},

	createObjParam: function(el, aName, aValue) {
		var _p = UFO.createElement("param");
		_p.setAttribute("name", aName);	
		_p.setAttribute("value", aValue);
		el.appendChild(_p);
	},

	uaHas: function(ft) {
		var _u = UFO.ua;
		switch(ft) {
			case "w3cdom":
				return (typeof document.getElementById != "undefined" && typeof document.getElementsByTagName != "undefined" && (typeof document.createElement != "undefined" || typeof document.createElementNS != "undefined"));
			case "xml":
				var _m = document.getElementsByTagName("meta");
				var _l = _m.length;
				for (var i = 0; i < _l; i++) {
					if (/content-type/i.test(_m[i].getAttribute("http-equiv")) && /xml/i.test(_m[i].getAttribute("content"))) return true;
				}
				return false;
			case "ieMac":
				return /msie/.test(_u) && !/opera/.test(_u) && /mac/.test(_u);
			case "ieWin":
				return /msie/.test(_u) && !/opera/.test(_u) && /win/.test(_u);
			case "gecko":
				return /gecko/.test(_u) && !/applewebkit/.test(_u);
			case "opera":
				return /opera/.test(_u);
			case "safari":
				return /applewebkit/.test(_u);
			default:
				return false;
		}
	},
	
	getFlashVersion: function() {
		if (UFO.fv[0] != 0) return;  
		if (navigator.plugins && typeof navigator.plugins["Shockwave Flash"] == "object") {
			UFO.pluginType = "npapi";
			var _d = navigator.plugins["Shockwave Flash"].description;
			if (typeof _d != "undefined") {
				_d = _d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
				var _m = parseInt(_d.replace(/^(.*)\..*$/, "$1"), 10);
				var _r = /r/.test(_d) ? parseInt(_d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
				UFO.fv = [_m, _r];
			}
		}
		else if (window.ActiveXObject) {
			UFO.pluginType = "ax";
			try { // avoid fp 6 crashes
				var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
			}
			catch(e) {
				try { 
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
					UFO.fv = [6, 0];
					_a.AllowScriptAccess = "always"; // throws if fp < 6.47 
				}
				catch(e) {
					if (UFO.fv[0] == 6) return;
				}
				try {
					var _a = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
				}
				catch(e) {}
			}
			if (typeof _a == "object") {
				var _d = _a.GetVariable("$version"); // bugs in fp 6.21/6.23
				if (typeof _d != "undefined") {
					_d = _d.replace(/^\S+\s+(.*)$/, "$1").split(",");
					UFO.fv = [parseInt(_d[0], 10), parseInt(_d[2], 10)];
				}
			}
		}
	},

	hasRequired: function(id) {
		var _l = UFO.req.length;
		for (var i = 0; i < _l; i++) {
			if (typeof UFO.foList[id][UFO.req[i]] == "undefined") return false;
		}
		return true;
	},
	
	hasFlashVersion: function(major, release) {
		return (UFO.fv[0] > major || (UFO.fv[0] == major && UFO.fv[1] >= release)) ? true : false;
	},

	writeSWF: function(id) {
		var _fo = UFO.foList[id];
		var _e = document.getElementById(id);
		if (UFO.pluginType == "npapi") {
			if (UFO.uaHas("gecko") || UFO.uaHas("xml")) {
				while(_e.hasChildNodes()) {
					_e.removeChild(_e.firstChild);
				}
				var _obj = UFO.createElement("object");
				_obj.setAttribute("type", "application/x-shockwave-flash");
				_obj.setAttribute("data", _fo.movie);
				_obj.setAttribute("width", _fo.width);
				_obj.setAttribute("height", _fo.height);
				var _l = UFO.optAtt.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[UFO.optAtt[i]] != "undefined") _obj.setAttribute(UFO.optAtt[i], _fo[UFO.optAtt[i]]);
				}
				var _o = UFO.opt.concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") UFO.createObjParam(_obj, _o[i], _fo[_o[i]]);
				}
				_e.appendChild(_obj);
			}
			else {
				var _emb = "";
				var _o = UFO.opt.concat(UFO.optAtt).concat(UFO.optExc);
				var _l = _o.length;
				for (var i = 0; i < _l; i++) {
					if (typeof _fo[_o[i]] != "undefined") _emb += ' ' + _o[i] + '="' + _fo[_o[i]] + '"';
				}
				_e.innerHTML = '<embed type="application/x-shockwave-flash" src="' + _fo.movie + '" width="' + _fo.width + '" height="' + _fo.height + '" pluginspage="http://www.macromedia.com/go/getflashplayer"' + _emb + '></embed>';
			}
		}
		else if (UFO.pluginType == "ax") {
			var _objAtt = "";
			var _l = UFO.optAtt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.optAtt[i]] != "undefined") _objAtt += ' ' + UFO.optAtt[i] + '="' + _fo[UFO.optAtt[i]] + '"';
			}
			var _objPar = "";
			var _l = UFO.opt.length;
			for (var i = 0; i < _l; i++) {
				if (typeof _fo[UFO.opt[i]] != "undefined") _objPar += '<param name="' + UFO.opt[i] + '" value="' + _fo[UFO.opt[i]] + '" />';
			}
			var _p = window.location.protocol == "https:" ? "https:" : "http:";
			_e.innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + _objAtt + ' width="' + _fo.width + '" height="' + _fo.height + '" codebase="' + _p + '//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=' + _fo.majorversion + ',0,' + _fo.build + ',0"><param name="movie" value="' + _fo.movie + '" />' + _objPar + '</object>';
		}
	},
		
	createDialog: function(id) {
		var _fo = UFO.foList[id];
		UFO.createCSS("html", "height:100%; overflow:hidden;");
		UFO.createCSS("body", "height:100%; overflow:hidden;");
		UFO.createCSS("#xi-con", "position:absolute; left:0; top:0; z-index:1000; width:100%; height:100%; background-color:#fff; filter:alpha(opacity:75); opacity:0.75;");
		UFO.createCSS("#xi-dia", "position:absolute; left:50%; top:50%; margin-left: -" + Math.round(parseInt(_fo.xiwidth, 10) / 2) + "px; margin-top: -" + Math.round(parseInt(_fo.xiheight, 10) / 2) + "px; width:" + _fo.xiwidth + "px; height:" + _fo.xiheight + "px;");
		var _b = document.getElementsByTagName("body")[0];
		var _c = UFO.createElement("div");
		_c.setAttribute("id", "xi-con");
		var _d = UFO.createElement("div");
		_d.setAttribute("id", "xi-dia");
		_c.appendChild(_d);
		_b.appendChild(_c);
		var _mmu = window.location;
		if (UFO.uaHas("xml") && UFO.uaHas("safari")) {
			var _mmd = document.getElementsByTagName("title")[0].firstChild.nodeValue = document.getElementsByTagName("title")[0].firstChild.nodeValue.slice(0, 47) + " - Flash Player Installation";
		}
		else {
			var _mmd = document.title = document.title.slice(0, 47) + " - Flash Player Installation";
		}
		var _mmp = UFO.pluginType == "ax" ? "ActiveX" : "PlugIn";
		var _uc = typeof _fo.xiurlcancel != "undefined" ? "&xiUrlCancel=" + _fo.xiurlcancel : "";
		var _uf = typeof _fo.xiurlfailed != "undefined" ? "&xiUrlFailed=" + _fo.xiurlfailed : "";
		UFO.foList["xi-dia"] = { movie:_fo.ximovie, width:_fo.xiwidth, height:_fo.xiheight, majorversion:"6", build:"65", flashvars:"MMredirectURL=" + _mmu + "&MMplayerType=" + _mmp + "&MMdoctitle=" + _mmd + _uc + _uf };
		UFO.writeSWF("xi-dia");
	},

	expressInstallCallback: function() {
		var _b = document.getElementsByTagName("body")[0];
		var _c = document.getElementById("xi-con");
		_b.removeChild(_c);
		UFO.createCSS("body", "height:auto; overflow:auto;");
		UFO.createCSS("html", "height:auto; overflow:auto;");
	},

	cleanupIELeaks: function() {
		var _o = document.getElementsByTagName("object");
		var _l = _o.length
		for (var i = 0; i < _l; i++) {
			_o[i].style.display = "none";
			for (var x in _o[i]) {
				if (typeof _o[i][x] == "function") {
					_o[i][x] = null;
				}
			}
		}
	}

};

if (typeof window.attachEvent != "undefined" && UFO.uaHas("ieWin")) {
	window.attachEvent("onunload", UFO.cleanupIELeaks);
}
// End of UFO Function
/*-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------*/
// Start of Sweet Titles
/*-----------------------------------------------------------------------------*/
/*
Sweet Titles (c) Creative Commons 2005
http://creativecommons.org/licenses/by-sa/2.5/
Author: Dustin Diaz | http://www.dustindiaz.com
*/
var sweetTitles = { 
	xCord : 0,								// @Number: x pixel value of current cursor position
	yCord : 0,								// @Number: y pixel value of current cursor position
	tipElements : ['a','abbr','acronym'],	// @Array: Allowable elements that can have the toolTip
	obj : Object,							// @Element: That of which you're hovering over
	tip : Object,							// @Element: The actual toolTip itself
	active : 0,								// @Number: 0: Not Active || 1: Active
	init : function() {
		if ( !document.getElementById ||
			!document.createElement ||
			!document.getElementsByTagName ) {
			return;
		}
		var i,j;
		this.tip = document.createElement('div');
		this.tip.id = 'toolTip';
		document.getElementsByTagName('body')[0].appendChild(this.tip);
		this.tip.style.top = '0';
		this.tip.style.visibility = 'hidden';
		var tipLen = this.tipElements.length;
		for ( i=0; i<tipLen; i++ ) {
			var current = document.getElementsByTagName(this.tipElements[i]);
			var curLen = current.length;
			 for ( j=0; j<curLen; j++ ) {
				// Quick check for Tags that don't have 'title'
				if (current[j].getAttribute('title') == null || current[j].getAttribute('title') == "") continue;

				addEventy(current[j],'mouseover',this.tipOver);
				addEventy(current[j],'mouseout',this.tipOut);
				current[j].setAttribute('tip',current[j].title);
				current[j].removeAttribute('title');
			}
		}
	},
	updateXY : function(e) {
		if ( document.captureEvents ) {
			sweetTitles.xCord = e.pageX;
			sweetTitles.yCord = e.pageY;
		} else if ( window.event.clientX ) {
			sweetTitles.xCord = window.event.clientX+document.documentElement.scrollLeft;
			sweetTitles.yCord = window.event.clientY+document.documentElement.scrollTop;
		}
	},
	tipOut: function() {
		if ( window.tID ) {
			clearTimeout(tID);
		}
		if ( window.opacityID ) {
			clearTimeout(opacityID);
		}
		sweetTitles.tip.style.visibility = 'hidden';
	},
	checkNode : function() {
		var trueObj = this.obj;
		if ( this.tipElements.inArray(trueObj.nodeName.toLowerCase()) ) {
			return trueObj;
		} else {
			return trueObj.parentNode;
		}
	},
	tipOver : function(e) {
		sweetTitles.obj = this;
		tID = window.setTimeout("sweetTitles.tipShow()",500);
		sweetTitles.updateXY(e);
	},
	tipShow : function() {		
		var scrX = Number(this.xCord);
		var scrY = Number(this.yCord);
		var tp = parseInt(scrY+15);
		var lt = parseInt(scrX+10);
		var anch = this.checkNode();
		var addy = '';
		var access = '';
		if ( anch.nodeName.toLowerCase() == 'a' ) {
			var addy = anch.href;
			if (addy.substr(0,27) == "http://vocalstudio.co.uk") { addy = addy.replace("http://vocalstudio.co.uk","");}
			if (addy == "/") { addy = "/home/";}
			addy = (addy.length > 45 ? addy.toString().substring(0,45)+"..." : addy);
			if (addy.substr(0,7) == "mailto:") { addy = '';}	
			if (addy.substr(0,7) == "/images") { addy = '';}
			var access = ( anch.accessKey ? ' <span>['+anch.accessKey+']</span> ' : '' );
		} else {
			addy = anch.firstChild.nodeValue;
		}
		this.tip.innerHTML = "<p>"+anch.getAttribute('tip')+"<em>"+access+addy+"</em></p>";
		if ( parseInt(document.documentElement.clientWidth+document.documentElement.scrollLeft) < parseInt(this.tip.offsetWidth+lt) ) {
			this.tip.style.left = parseInt(lt-(this.tip.offsetWidth+10))+'px';
		} else {
			this.tip.style.left = lt+'px';
		}
		if ( parseInt(document.documentElement.clientHeight+document.documentElement.scrollTop) < parseInt(this.tip.offsetHeight+tp) ) {
			this.tip.style.top = parseInt(tp-(this.tip.offsetHeight+10))+'px';
		} else {
			this.tip.style.top = tp+'px';
		}
		this.tip.style.visibility = 'visible';
		this.tip.style.opacity = '.1';
		this.tipFade(10);
	},
	tipFade: function(opac) {
		var passed = parseInt(opac);
		var newOpac = parseInt(passed+10);
		if ( newOpac < 80 ) {
			this.tip.style.opacity = '.'+newOpac;
			this.tip.style.filter = "alpha(opacity:"+newOpac+")";
			opacityID = window.setTimeout("sweetTitles.tipFade('"+newOpac+"')",20);
		}
		else { 
			this.tip.style.opacity = '.80';
			this.tip.style.filter = "alpha(opacity:80)";
		}
	}
};
function pageLoader() {
	sweetTitles.init();
}

window.onload=function(){
pageLoader();
}
/*-----------------------------------------------------------------------------*/
// End of Sweet Titles
/*-----------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------*/
// Start of F.A.T.
/*-----------------------------------------------------------------------------*/
// @name      The Fade Anything Technique
// @namespace http://www.axentric.com/aside/fat/
// @version   1.0-RC1
// @author    Adam Michela

var Fat = {
	make_hex : function (r,g,b) 
	{
		r = r.toString(16); if (r.length == 1) r = '0' + r;
		g = g.toString(16); if (g.length == 1) g = '0' + g;
		b = b.toString(16); if (b.length == 1) b = '0' + b;
		return "#" + r + g + b;
	},
	fade_all : function ()
	{
		var a = document.getElementsByTagName("*");
		for (var i = 0; i < a.length; i++) 
		{
			var o = a[i];
			var r = /fade-?(\w{3,6})?/.exec(o.className);
			if (r)
			{
				if (!r[1]) r[1] = "";
				if (o.id) Fat.fade_element(o.id,null,null,"#"+r[1]);
			}
		}
	},
	fade_element : function (id, fps, duration, from, to) 
	{
		if (!fps) fps = 30;
		if (!duration) duration = 3000;
		if (!from || from=="#") from = "#FFFF33";
		if (!to) to = this.get_bgcolor(id);
		
		var frames = Math.round(fps * (duration / 1000));
		var interval = duration / frames;
		var delay = interval;
		var frame = 0;
		
		if (from.length < 7) from += from.substr(1,3);
		if (to.length < 7) to += to.substr(1,3);
		
		var rf = parseInt(from.substr(1,2),16);
		var gf = parseInt(from.substr(3,2),16);
		var bf = parseInt(from.substr(5,2),16);
		var rt = parseInt(to.substr(1,2),16);
		var gt = parseInt(to.substr(3,2),16);
		var bt = parseInt(to.substr(5,2),16);
		
		var r,g,b,h;
		while (frame < frames)
		{
			r = Math.floor(rf * ((frames-frame)/frames) + rt * (frame/frames));
			g = Math.floor(gf * ((frames-frame)/frames) + gt * (frame/frames));
			b = Math.floor(bf * ((frames-frame)/frames) + bt * (frame/frames));
			h = this.make_hex(r,g,b);
		
			setTimeout("Fat.set_bgcolor('"+id+"','"+h+"')", delay);

			frame++;
			delay = interval * frame; 
		}
		setTimeout("Fat.set_bgcolor('"+id+"','"+to+"')", delay);
	},
	set_bgcolor : function (id, c)
	{
		var o = document.getElementById(id);
		o.style.backgroundColor = c;
	},
	get_bgcolor : function (id)
	{
		var o = document.getElementById(id);
		while(o)
		{
			var c;
			if (window.getComputedStyle) c = window.getComputedStyle(o,null).getPropertyValue("background-color");
			if (o.currentStyle) c = o.currentStyle.backgroundColor;
			if ((c != "" && c != "transparent") || o.tagName == "BODY") { break; }
			o = o.parentNode;
		}
		if (c == undefined || c == "" || c == "transparent") c = "#FFFFFF";
		var rgb = c.match(/rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/);
		if (rgb) c = this.make_hex(parseInt(rgb[1]),parseInt(rgb[2]),parseInt(rgb[3]));
		return c;
	}
}
/*-----------------------------------------------------------------------------*/
// End of F.A.T.
/*-----------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------
 *  Smooth Scroller Script, version 1.0.1
 *  (c) 2007 Dezinerfolio Inc. <midart@gmail.com>
 *
 *  For details, please check the website : http://dezinerfolio.com/
 *
/*--------------------------------------------------------------------------*/

Scroller = {
	// control the speed of the scroller.
	// dont change it here directly, please use Scroller.speed=50;
	speed:10,

	// returns the Y position of the div
	gy: function (d) {
		gy = d.offsetTop
		if (d.offsetParent) while (d = d.offsetParent) gy += d.offsetTop
		return gy
	},

	// returns the current scroll position
	scrollTop: function (){
		body=document.body
	    d=document.documentElement
	    if (body && body.scrollTop) return body.scrollTop
	    if (d && d.scrollTop) return d.scrollTop
	    if (window.pageYOffset) return window.pageYOffset
	    return 0
	},

	// attach an event for an element
	// (element, type, function)
	add: function(event, body, d) {
	    if (event.addEventListener) return event.addEventListener(body, d,false)
	    if (event.attachEvent) return event.attachEvent('on'+body, d)
	},

	// kill an event of an element
	end: function(e){
		if (window.event) {
			window.event.cancelBubble = true
			window.event.returnValue = false
      		return;
    	}
	    if (e.preventDefault && e.stopPropagation) {
	      e.preventDefault()
	      e.stopPropagation()
	    }
	},
	
	// move the scroll bar to the particular div.
	scroll: function(d){
		i = window.innerHeight || document.documentElement.clientHeight;
		h=document.body.scrollHeight;
		a = Scroller.scrollTop()
		if(d>a)
			if(h-d>i)
				a+=Math.ceil((d-a)/Scroller.speed)
			else
				a+=Math.ceil((d-a-(h-d))/Scroller.speed)
		else
			a = a+(d-a)/Scroller.speed;
		window.scrollTo(0,a)
	  	if(a==d || Scroller.offsetTop==a)clearInterval(Scroller.interval)
	  	Scroller.offsetTop=a
	},
	// initializer that adds the renderer to the onload function of the window
	init: function(){
		Scroller.add(window,'load', Scroller.render)
	},

	// this method extracts all the anchors and validates then as # and attaches the events.
	render: function(){
		a = document.getElementsByTagName('a');
		Scroller.end(this);
		window.onscroll
	    for (i=0;i<a.length;i++) {
	      l = a[i];
	      if(l.href && l.href.indexOf('#top') != -1 && ((l.pathname==location.pathname) || ('/'+l.pathname==location.pathname)) ){
	      	Scroller.add(l,'click',Scroller.end)
	      		l.onclick = function(){
	      			Scroller.end(this);
		        	l=this.hash.substr(1);
		        	 a = document.getElementsByTagName('a');
				     for (i=0;i<a.length;i++) {
				     	if(a[i].name == l){
				     		clearInterval(Scroller.interval);
				     		Scroller.interval=setInterval('Scroller.scroll('+Scroller.gy(a[i])+')',10);
						}
					}
				}
	      	}
		}
	}
}
// invoke the initializer of the scroller
Scroller.init();









function geo()
	{
		if (!document.getElementsByTagName) // Check for browser support
			{
				return false;
			}
		var map = rot13init(); 
		var tooltip_js_on = '';
		var tooltip_js_off = '';
		var links = document.getElementsByTagName('a'); // Get all anchors
		
		function geo_decode(anchor)
			{ // function to recompose the orginal address
				var href = anchor.getAttribute('href');
				var address = href.replace(/.*mail\/([a-z0-9._%-]+)\+([a-z0-9._%-]+)\+([a-z.]+)/i, '$1' + '@' + '$2' + '.' + '$3');
				var linktext = anchor.innerHTML; // IE Fix
				if (href != address)
					{
						var rot13 = 1;
						anchor.setAttribute('href','mailto:' + (rot13 ? str_rot13(address,map) : address)+"?subject=From the Ian Anderson Gray Vocal Tuition Web Site"); // Add mailto link	
						anchor.innerHTML = linktext; // IE Fix
					}
			}
	
		for (var l = 0 ; l < links.length ; l++)
			{ // Loop through the anchors
				
				if (links[l].href.search("/mail/") !== -1) {
					
				links[l].onclick = function()
					{ // Encode links when clicked
						geo_decode(this);
					}
				links[l].onmouseover = function()
					{ // Display tooltip when links are hovered
						geo_decode(this); // Encode links when hovered (so that the address appears correctly in the browser's status bar)
							
					}
				}
			}
	}


function rot13init() {
	var map = new Array();
	var s = "abcdefghijklmnopqrstuvwxyz";
	for (var i = 0 ; i < s.length ; i++)
		map[s.charAt(i)] = s.charAt((i+13)%26);
	for (var i = 0 ; i < s.length ; i++)
		map[s.charAt(i).toUpperCase()] = s.charAt((i+13)%26).toUpperCase();
	return map;
}

function str_rot13(a,map) {
	var s = "";
	for (var i = 0 ; i < a.length ; i++) {
		var b = a.charAt(i);
		s += (b>='A' && b<='Z' || b>='a' && b<='z' ? map[b] : b);
	}
	return s;
}

/*------------------------------------------------------------
 *						END OF CODE
/*-----------------------------------------------------------*/
document.write("<style>#nav li ul { filter:alpha(opacity=95);-moz-opacity:.95;opacity:.95;} body div#toolTip { -moz-border-radius:5px; } html {overflow-y: scroll;}</style>");