/*
 * jQuery 1.2 - New Wave Javascript
 *
 * Copyright (c) 2007 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * $Date: 2007-09-10 15:45:49 -0400 (Mon, 10 Sep 2007) $
 * $Rev: 3219 $
 */
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}('(G(){9(1n E!="11")H w=E;H E=17.16=G(a,c){9(17==6||!6.4K)I 1q E(a,c);I 6.4K(a,c)};9(1n $!="11")H D=$;17.$=E;H u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;E.1b=E.3x={4K:G(a,c){a=a||U;9(1n a=="1M"){H m=u.2L(a);9(m&&(m[1]||!c)){9(m[1])a=E.4I([m[1]],c);J{H b=U.42(m[3]);9(b)9(b.1T!=m[3])I E().1X(a);J{6[0]=b;6.L=1;I 6}J a=[]}}J I 1q E(c).1X(a)}J 9(E.1p(a))I 1q E(U)[E.1b.2d?"2d":"37"](a);I 6.6u(a.1d==1C&&a||(a.4d||a.L&&a!=17&&!a.1z&&a[0]!=11&&a[0].1z)&&E.2h(a)||[a])},4d:"1.2",82:G(){I 6.L},L:0,28:G(a){I a==11?E.2h(6):6[a]},2v:G(a){H b=E(a);b.4Y=6;I b},6u:G(a){6.L=0;1C.3x.1a.15(6,a);I 6},O:G(a,b){I E.O(6,a,b)},4J:G(a){H b=-1;6.O(G(i){9(6==a)b=i});I b},1y:G(f,d,e){H c=f;9(f.1d==3T)9(d==11)I 6.L&&E[e||"1y"](6[0],f)||11;J{c={};c[f]=d}I 6.O(G(a){M(H b 1j c)E.1y(e?6.R:6,b,E.1c(6,c[b],e,a,b))})},18:G(b,a){I 6.1y(b,a,"3O")},2t:G(e){9(1n e!="5w"&&e!=S)I 6.4o().3e(U.6F(e));H t="";E.O(e||6,G(){E.O(6.2X,G(){9(6.1z!=8)t+=6.1z!=1?6.6x:E.1b.2t([6])})});I t},5l:G(b){9(6[0])E(b,6[0].3N).6t().38(6[0]).1W(G(){H a=6;1Y(a.1t)a=a.1t;I a}).3e(6);I 6},8p:G(a){I 6.O(G(){E(6).6p().5l(a)})},8h:G(a){I 6.O(G(){E(6).5l(a)})},3e:G(){I 6.3s(1k,Q,1,G(a){6.57(a)})},6k:G(){I 6.3s(1k,Q,-1,G(a){6.38(a,6.1t)})},6g:G(){I 6.3s(1k,P,1,G(a){6.14.38(a,6)})},53:G(){I 6.3s(1k,P,-1,G(a){6.14.38(a,6.2i)})},1B:G(){I 6.4Y||E([])},1X:G(t){H b=E.1W(6,G(a){I E.1X(t,a)});I 6.2v(/[^+>] [^+>]/.12(t)||t.1e("..")>-1?E.4V(b):b)},6t:G(e){H f=6.1W(G(){I 6.66?E(6.66)[0]:6.4S(Q)});9(e===Q){H d=f.1X("*").4Q();6.1X("*").4Q().O(G(i){H c=E.K(6,"2A");M(H a 1j c)M(H b 1j c[a])E.1h.1f(d[i],a,c[a][b],c[a][b].K)})}I f},1A:G(t){I 6.2v(E.1p(t)&&E.2T(6,G(b,a){I t.15(b,[a])})||E.3G(t,6))},5T:G(t){I 6.2v(t.1d==3T&&E.3G(t,6,Q)||E.2T(6,G(a){I(t.1d==1C||t.4d)?E.2S(a,t)<0:a!=t}))},1f:G(t){I 6.2v(E.1S(6.28(),t.1d==3T?E(t).28():t.L!=11&&(!t.Y||t.Y=="7t")?t:[t]))},3j:G(a){I a?E.3G(a,6).L>0:P},7g:G(a){I 6.3j("."+a)},2V:G(b){9(b==11){9(6.L){H c=6[0];9(E.Y(c,"24")){H e=c.4z,a=[],W=c.W,2P=c.N=="24-2P";9(e<0)I S;M(H i=2P?e:0,2Y=2P?e+1:W.L;i<2Y;i++){H d=W[i];9(d.29){H b=E.V.1g&&!d.70["1N"].9U?d.2t:d.1N;9(2P)I b;a.1a(b)}}I a}J I 6[0].1N.1o(/\\r/g,"")}}J I 6.O(G(){9(b.1d==1C&&/4s|5u/.12(6.N))6.2K=(E.2S(6.1N,b)>=0||E.2S(6.2J,b)>=0);J 9(E.Y(6,"24")){H a=b.1d==1C?b:[b];E("9m",6).O(G(){6.29=(E.2S(6.1N,a)>=0||E.2S(6.2t,a)>=0)});9(!a.L)6.4z=-1}J 6.1N=b})},4n:G(a){I a==11?(6.L?6[0].3D:S):6.4o().3e(a)},6H:G(a){I 6.53(a).2e()},2s:G(){I 6.2v(1C.3x.2s.15(6,1k))},1W:G(b){I 6.2v(E.1W(6,G(a,i){I b.3c(a,i,a)}))},4Q:G(){I 6.1f(6.4Y)},3s:G(f,d,g,e){H c=6.L>1,a;I 6.O(G(){9(!a){a=E.4I(f,6.3N);9(g<0)a.91()}H b=6;9(d&&E.Y(6,"1F")&&E.Y(a[0],"4k"))b=6.4q("1J")[0]||6.57(U.5r("1J"));E.O(a,G(){9(E.Y(6,"1P")){9(6.3g)E.3w({1u:6.3g,3h:P,1Z:"1P"});J E.5h(6.2t||6.6s||6.3D||"")}J e.15(b,[c?6.4S(Q):6])})})}};E.1i=E.1b.1i=G(){H c=1k[0]||{},a=1,2g=1k.L,5e=P;9(c.1d==8v){5e=c;c=1k[1]||{}}9(2g==1){c=6;a=0}H b;M(;a<2g;a++)9((b=1k[a])!=S)M(H i 1j b){9(c==b[i])6r;9(5e&&1n b[i]==\'5w\'&&c[i])E.1i(c[i],b[i]);J 9(b[i]!=11)c[i]=b[i]}I c};H F="16"+(1q 3v()).3u(),6q=0,5d={};E.1i({8k:G(a){17.$=D;9(a)17.16=w;I E},1p:G(a){I!!a&&1n a!="1M"&&!a.Y&&a.1d!=1C&&/G/i.12(a+"")},4a:G(a){I a.35&&!a.1K||a.34&&a.3N&&!a.3N.1K},5h:G(a){a=E.33(a);9(a){9(17.6o)17.6o(a);J 9(E.V.1H)17.58(a,0);J 3p.3c(17,a)}},Y:G(b,a){I b.Y&&b.Y.26()==a.26()},1I:{},K:G(c,d,b){c=c==17?5d:c;H a=c[F];9(!a)a=c[F]=++6q;9(d&&!E.1I[a])E.1I[a]={};9(b!=11)E.1I[a][d]=b;I d?E.1I[a][d]:a},30:G(c,b){c=c==17?5d:c;H a=c[F];9(b){9(E.1I[a]){2G E.1I[a][b];b="";M(b 1j E.1I[a])22;9(!b)E.30(c)}}J{2c{2G c[F]}27(e){9(c.54)c.54(F)}2G E.1I[a]}},O:G(a,b,c){9(c){9(a.L==11)M(H i 1j a)b.15(a[i],c);J M(H i=0,45=a.L;i<45;i++)9(b.15(a[i],c)===P)22}J{9(a.L==11)M(H i 1j a)b.3c(a[i],i,a[i]);J M(H i=0,45=a.L,2V=a[0];i<45&&b.3c(2V,i,2V)!==P;2V=a[++i]){}}I a},1c:G(c,b,d,e,a){9(E.1p(b))b=b.3c(c,[e]);H f=/z-?4J|7T-?7S|1v|69|7Q-?1G/i;I b&&b.1d==4X&&d=="3O"&&!f.12(a)?b+"2I":b},1m:{1f:G(b,c){E.O((c||"").2p(/\\s+/),G(i,a){9(!E.1m.3t(b.1m,a))b.1m+=(b.1m?" ":"")+a})},2e:G(b,c){b.1m=c!=11?E.2T(b.1m.2p(/\\s+/),G(a){I!E.1m.3t(c,a)}).65(" "):""},3t:G(t,c){I E.2S(c,(t.1m||t).3z().2p(/\\s+/))>-1}},2q:G(e,o,f){M(H i 1j o){e.R["3C"+i]=e.R[i];e.R[i]=o[i]}f.15(e,[]);M(H i 1j o)e.R[i]=e.R["3C"+i]},18:G(e,p){9(p=="1G"||p=="2E"){H b={},3Z,3Y,d=["7L","7K","7J","7G"];E.O(d,G(){b["7F"+6]=0;b["7D"+6+"61"]=0});E.2q(e,b,G(){9(E(e).3j(\':3X\')){3Z=e.7A;3Y=e.7z}J{e=E(e.4S(Q)).1X(":4s").5X("2K").1B().18({4v:"1O",2W:"4D",19:"2U",7w:"0",1R:"0"}).5P(e.14)[0];H a=E.18(e.14,"2W")||"3V";9(a=="3V")e.14.R.2W="7k";3Z=e.7h;3Y=e.7f;9(a=="3V")e.14.R.2W="3V";e.14.3k(e)}});I p=="1G"?3Z:3Y}I E.3O(e,p)},3O:G(h,j,i){H g,2u=[],2q=[];G 3l(a){9(!E.V.1H)I P;H b=U.3M.3P(a,S);I!b||b.4y("3l")==""}9(j=="1v"&&E.V.1g){g=E.1y(h.R,"1v");I g==""?"1":g}9(j.1U(/4r/i))j=y;9(!i&&h.R[j])g=h.R[j];J 9(U.3M&&U.3M.3P){9(j.1U(/4r/i))j="4r";j=j.1o(/([A-Z])/g,"-$1").2F();H d=U.3M.3P(h,S);9(d&&!3l(h))g=d.4y(j);J{M(H a=h;a&&3l(a);a=a.14)2u.4Z(a);M(a=0;a<2u.L;a++)9(3l(2u[a])){2q[a]=2u[a].R.19;2u[a].R.19="2U"}g=j=="19"&&2q[2u.L-1]!=S?"2j":U.3M.3P(h,S).4y(j)||"";M(a=0;a<2q.L;a++)9(2q[a]!=S)2u[a].R.19=2q[a]}9(j=="1v"&&g=="")g="1"}J 9(h.43){H f=j.1o(/\\-(\\w)/g,G(m,c){I c.26()});g=h.43[j]||h.43[f];9(!/^\\d+(2I)?$/i.12(g)&&/^\\d/.12(g)){H k=h.R.1R;H e=h.4t.1R;h.4t.1R=h.43.1R;h.R.1R=g||0;g=h.R.74+"2I";h.R.1R=k;h.4t.1R=e}}I g},4I:G(a,e){H r=[];e=e||U;E.O(a,G(i,d){9(!d)I;9(d.1d==4X)d=d.3z();9(1n d=="1M"){d=d.1o(/(<(\\w+)[^>]*?)\\/>/g,G(m,a,b){I b.1U(/^(71|6Z|5D|6Y|49|9S|9P|3f|9K|9I)$/i)?m:a+"></"+b+">"});H s=E.33(d).2F(),1r=e.5r("1r"),2x=[];H c=!s.1e("<9D")&&[1,"<24>","</24>"]||!s.1e("<9A")&&[1,"<6S>","</6S>"]||s.1U(/^<(9x|1J|9u|9t|9s)/)&&[1,"<1F>","</1F>"]||!s.1e("<4k")&&[2,"<1F><1J>","</1J></1F>"]||(!s.1e("<9r")||!s.1e("<9q"))&&[3,"<1F><1J><4k>","</4k></1J></1F>"]||!s.1e("<5D")&&[2,"<1F><1J></1J><6L>","</6L></1F>"]||E.V.1g&&[1,"1r<1r>","</1r>"]||[0,"",""];1r.3D=c[1]+d+c[2];1Y(c[0]--)1r=1r.5k;9(E.V.1g){9(!s.1e("<1F")&&s.1e("<1J")<0)2x=1r.1t&&1r.1t.2X;J 9(c[1]=="<1F>"&&s.1e("<1J")<0)2x=1r.2X;M(H n=2x.L-1;n>=0;--n)9(E.Y(2x[n],"1J")&&!2x[n].2X.L)2x[n].14.3k(2x[n]);9(/^\\s/.12(d))1r.38(e.6F(d.1U(/^\\s*/)[0]),1r.1t)}d=E.2h(1r.2X)}9(0===d.L&&(!E.Y(d,"3B")&&!E.Y(d,"24")))I;9(d[0]==11||E.Y(d,"3B")||d.W)r.1a(d);J r=E.1S(r,d)});I r},1y:G(c,d,a){H e=E.4a(c)?{}:E.5o;9(d=="29"&&E.V.1H)c.14.4z;9(e[d]){9(a!=11)c[e[d]]=a;I c[e[d]]}J 9(E.V.1g&&d=="R")I E.1y(c.R,"9g",a);J 9(a==11&&E.V.1g&&E.Y(c,"3B")&&(d=="9e"||d=="9d"))I c.9b(d).6x;J 9(c.34){9(a!=11){9(d=="N"&&E.Y(c,"49")&&c.14)6E"N 96 94\'t 93 92";c.90(d,a)}9(E.V.1g&&/6B|3g/.12(d)&&!E.4a(c))I c.4l(d,2);I c.4l(d)}J{9(d=="1v"&&E.V.1g){9(a!=11){c.69=1;c.1A=(c.1A||"").1o(/6A\\([^)]*\\)/,"")+(3K(a).3z()=="8V"?"":"6A(1v="+a*6z+")")}I c.1A?(3K(c.1A.1U(/1v=([^)]*)/)[1])/6z).3z():""}d=d.1o(/-([a-z])/8T,G(z,b){I b.26()});9(a!=11)c[d]=a;I c[d]}},33:G(t){I(t||"").1o(/^\\s+|\\s+$/g,"")},2h:G(a){H r=[];9(1n a!="8Q")M(H i=0,2g=a.L;i<2g;i++)r.1a(a[i]);J r=a.2s(0);I r},2S:G(b,a){M(H i=0,2g=a.L;i<2g;i++)9(a[i]==b)I i;I-1},1S:G(a,b){9(E.V.1g){M(H i=0;b[i];i++)9(b[i].1z!=8)a.1a(b[i])}J M(H i=0;b[i];i++)a.1a(b[i]);I a},4V:G(b){H r=[],2f={};2c{M(H i=0,6P=b.L;i<6P;i++){H a=E.K(b[i]);9(!2f[a]){2f[a]=Q;r.1a(b[i])}}}27(e){r=b}I r},2T:G(b,a,c){9(1n a=="1M")a=3p("P||G(a,i){I "+a+"}");H d=[];M(H i=0,4m=b.L;i<4m;i++)9(!c&&a(b[i],i)||c&&!a(b[i],i))d.1a(b[i]);I d},1W:G(c,b){9(1n b=="1M")b=3p("P||G(a){I "+b+"}");H d=[];M(H i=0,4m=c.L;i<4m;i++){H a=b(c[i],i);9(a!==S&&a!=11){9(a.1d!=1C)a=[a];d=d.8O(a)}}I d}});H v=8M.8K.2F();E.V={4f:(v.1U(/.+(?:8I|8H|8F|8E)[\\/: ]([\\d.]+)/)||[])[1],1H:/6T/.12(v),3a:/3a/.12(v),1g:/1g/.12(v)&&!/3a/.12(v),39:/39/.12(v)&&!/(8B|6T)/.12(v)};H y=E.V.1g?"4h":"5g";E.1i({5f:!E.V.1g||U.8A=="8z",4h:E.V.1g?"4h":"5g",5o:{"M":"8y","8x":"1m","4r":y,5g:y,4h:y,3D:"3D",1m:"1m",1N:"1N",36:"36",2K:"2K",8w:"8u",29:"29",8t:"8s"}});E.O({1D:"a.14",8r:"16.4e(a,\'14\')",8q:"16.2R(a,2,\'2i\')",8o:"16.2R(a,2,\'4c\')",8n:"16.4e(a,\'2i\')",8m:"16.4e(a,\'4c\')",8l:"16.5c(a.14.1t,a)",8j:"16.5c(a.1t)",6p:"16.Y(a,\'8i\')?a.8f||a.8e.U:16.2h(a.2X)"},G(i,n){E.1b[i]=G(a){H b=E.1W(6,n);9(a&&1n a=="1M")b=E.3G(a,b);I 6.2v(E.4V(b))}});E.O({5P:"3e",8d:"6k",38:"6g",8c:"53",8b:"6H"},G(i,n){E.1b[i]=G(){H a=1k;I 6.O(G(){M(H j=0,2g=a.L;j<2g;j++)E(a[j])[n](6)})}});E.O({5X:G(a){E.1y(6,a,"");6.54(a)},8a:G(c){E.1m.1f(6,c)},89:G(c){E.1m.2e(6,c)},88:G(c){E.1m[E.1m.3t(6,c)?"2e":"1f"](6,c)},2e:G(a){9(!a||E.1A(a,[6]).r.L){E.30(6);6.14.3k(6)}},4o:G(){E("*",6).O(G(){E.30(6)});1Y(6.1t)6.3k(6.1t)}},G(i,n){E.1b[i]=G(){I 6.O(n,1k)}});E.O(["87","61"],G(i,a){H n=a.2F();E.1b[n]=G(h){I 6[0]==17?E.V.1H&&3r["86"+a]||E.5f&&32.2Y(U.35["59"+a],U.1K["59"+a])||U.1K["59"+a]:6[0]==U?32.2Y(U.1K["6n"+a],U.1K["6m"+a]):h==11?(6.L?E.18(6[0],n):S):6.18(n,h.1d==3T?h:h+"2I")}});H C=E.V.1H&&3q(E.V.4f)<85?"(?:[\\\\w*56-]|\\\\\\\\.)":"(?:[\\\\w\\84-\\83*56-]|\\\\\\\\.)",6j=1q 47("^>\\\\s*("+C+"+)"),6i=1q 47("^("+C+"+)(#)("+C+"+)"),6h=1q 47("^([#.]?)("+C+"*)");E.1i({55:{"":"m[2]==\'*\'||16.Y(a,m[2])","#":"a.4l(\'1T\')==m[2]",":":{81:"i<m[3]-0",7Z:"i>m[3]-0",2R:"m[3]-0==i",7Y:"m[3]-0==i",3o:"i==0",3n:"i==r.L-1",6f:"i%2==0",6d:"i%2","3o-46":"a.14.4q(\'*\')[0]==a","3n-46":"16.2R(a.14.5k,1,\'4c\')==a","7X-46":"!16.2R(a.14.5k,2,\'4c\')",1D:"a.1t",4o:"!a.1t",7W:"(a.6s||a.7V||\'\').1e(m[3])>=0",3X:\'"1O"!=a.N&&16.18(a,"19")!="2j"&&16.18(a,"4v")!="1O"\',1O:\'"1O"==a.N||16.18(a,"19")=="2j"||16.18(a,"4v")=="1O"\',7U:"!a.36",36:"a.36",2K:"a.2K",29:"a.29||16.1y(a,\'29\')",2t:"\'2t\'==a.N",4s:"\'4s\'==a.N",5u:"\'5u\'==a.N",52:"\'52\'==a.N",51:"\'51\'==a.N",50:"\'50\'==a.N",6c:"\'6c\'==a.N",6b:"\'6b\'==a.N",2y:\'"2y"==a.N||16.Y(a,"2y")\',49:"/49|24|6a|2y/i.12(a.Y)",3t:"16.1X(m[3],a).L",7R:"/h\\\\d/i.12(a.Y)",7P:"16.2T(16.2Z,G(1b){I a==1b.T;}).L"}},68:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1q 47("^([:.#]*)("+C+"+)")],3G:G(a,c,b){H d,2b=[];1Y(a&&a!=d){d=a;H f=E.1A(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");2b=b?c=f.r:E.1S(2b,f.r)}I 2b},1X:G(t,o){9(1n t!="1M")I[t];9(o&&!o.1z)o=S;o=o||U;H d=[o],2f=[],3n;1Y(t&&3n!=t){H r=[];3n=t;t=E.33(t);H l=P;H g=6j;H m=g.2L(t);9(m){H p=m[1].26();M(H i=0;d[i];i++)M(H c=d[i].1t;c;c=c.2i)9(c.1z==1&&(p=="*"||c.Y.26()==p.26()))r.1a(c);d=r;t=t.1o(g,"");9(t.1e(" ")==0)6r;l=Q}J{g=/^([>+~])\\s*(\\w*)/i;9((m=g.2L(t))!=S){r=[];H p=m[2],1S={};m=m[1];M(H j=0,31=d.L;j<31;j++){H n=m=="~"||m=="+"?d[j].2i:d[j].1t;M(;n;n=n.2i)9(n.1z==1){H h=E.K(n);9(m=="~"&&1S[h])22;9(!p||n.Y.26()==p.26()){9(m=="~")1S[h]=Q;r.1a(n)}9(m=="+")22}}d=r;t=E.33(t.1o(g,""));l=Q}}9(t&&!l){9(!t.1e(",")){9(o==d[0])d.44();2f=E.1S(2f,d);r=d=[o];t=" "+t.67(1,t.L)}J{H k=6i;H m=k.2L(t);9(m){m=[0,m[2],m[3],m[1]]}J{k=6h;m=k.2L(t)}m[2]=m[2].1o(/\\\\/g,"");H f=d[d.L-1];9(m[1]=="#"&&f&&f.42&&!E.4a(f)){H q=f.42(m[2]);9((E.V.1g||E.V.3a)&&q&&1n q.1T=="1M"&&q.1T!=m[2])q=E(\'[@1T="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.Y(q,m[3]))?[q]:[]}J{M(H i=0;d[i];i++){H a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];9(a=="*"&&d[i].Y.2F()=="5w")a="3f";r=E.1S(r,d[i].4q(a))}9(m[1]==".")r=E.4W(r,m[2]);9(m[1]=="#"){H e=[];M(H i=0;r[i];i++)9(r[i].4l("1T")==m[2]){e=[r[i]];22}r=e}d=r}t=t.1o(k,"")}}9(t){H b=E.1A(t,r);d=r=b.r;t=E.33(b.t)}}9(t)d=[];9(d&&o==d[0])d.44();2f=E.1S(2f,d);I 2f},4W:G(r,m,a){m=" "+m+" ";H c=[];M(H i=0;r[i];i++){H b=(" "+r[i].1m+" ").1e(m)>=0;9(!a&&b||a&&!b)c.1a(r[i])}I c},1A:G(t,r,h){H d;1Y(t&&t!=d){d=t;H p=E.68,m;M(H i=0;p[i];i++){m=p[i].2L(t);9(m){t=t.7O(m[0].L);m[2]=m[2].1o(/\\\\/g,"");22}}9(!m)22;9(m[1]==":"&&m[2]=="5T")r=E.1A(m[3],r,Q).r;J 9(m[1]==".")r=E.4W(r,m[2],h);J 9(m[1]=="["){H g=[],N=m[3];M(H i=0,31=r.L;i<31;i++){H a=r[i],z=a[E.5o[m[2]]||m[2]];9(z==S||/6B|3g|29/.12(m[2]))z=E.1y(a,m[2])||\'\';9((N==""&&!!z||N=="="&&z==m[5]||N=="!="&&z!=m[5]||N=="^="&&z&&!z.1e(m[5])||N=="$="&&z.67(z.L-m[5].L)==m[5]||(N=="*="||N=="~=")&&z.1e(m[5])>=0)^h)g.1a(a)}r=g}J 9(m[1]==":"&&m[2]=="2R-46"){H e={},g=[],12=/(\\d*)n\\+?(\\d*)/.2L(m[3]=="6f"&&"2n"||m[3]=="6d"&&"2n+1"||!/\\D/.12(m[3])&&"n+"+m[3]||m[3]),3o=(12[1]||1)-0,d=12[2]-0;M(H i=0,31=r.L;i<31;i++){H j=r[i],14=j.14,1T=E.K(14);9(!e[1T]){H c=1;M(H n=14.1t;n;n=n.2i)9(n.1z==1)n.4U=c++;e[1T]=Q}H b=P;9(3o==1){9(d==0||j.4U==d)b=Q}J 9((j.4U+d)%3o==0)b=Q;9(b^h)g.1a(j)}r=g}J{H f=E.55[m[1]];9(1n f!="1M")f=E.55[m[1]][m[2]];f=3p("P||G(a,i){I "+f+"}");r=E.2T(r,f,h)}}I{r:r,t:t}},4e:G(b,c){H d=[];H a=b[c];1Y(a&&a!=U){9(a.1z==1)d.1a(a);a=a[c]}I d},2R:G(a,e,c,b){e=e||1;H d=0;M(;a;a=a[c])9(a.1z==1&&++d==e)22;I a},5c:G(n,a){H r=[];M(;n;n=n.2i){9(n.1z==1&&(!a||n!=a))r.1a(n)}I r}});E.1h={1f:G(g,e,c,h){9(E.V.1g&&g.41!=11)g=17;9(!c.2r)c.2r=6.2r++;9(h!=11){H d=c;c=G(){I d.15(6,1k)};c.K=h;c.2r=d.2r}H i=e.2p(".");e=i[0];c.N=i[1];H b=E.K(g,"2A")||E.K(g,"2A",{});H f=E.K(g,"2m",G(){H a;9(1n E=="11"||E.1h.4T)I a;a=E.1h.2m.15(g,1k);I a});H j=b[e];9(!j){j=b[e]={};9(g.4R)g.4R(e,f,P);J g.7N("40"+e,f)}j[c.2r]=c;6.23[e]=Q},2r:1,23:{},2e:G(d,c,b){H e=E.K(d,"2A"),2O,4J;9(1n c=="1M"){H a=c.2p(".");c=a[0]}9(e){9(c&&c.N){b=c.4P;c=c.N}9(!c){M(c 1j e)6.2e(d,c)}J 9(e[c]){9(b)2G e[c][b.2r];J M(b 1j e[c])9(!a[1]||e[c][b].N==a[1])2G e[c][b];M(2O 1j e[c])22;9(!2O){9(d.4O)d.4O(c,E.K(d,"2m"),P);J d.7M("40"+c,E.K(d,"2m"));2O=S;2G e[c]}}M(2O 1j e)22;9(!2O){E.30(d,"2A");E.30(d,"2m")}}},1L:G(d,b,e,c,f){b=E.2h(b||[]);9(!e){9(6.23[d])E("*").1f([17,U]).1L(d,b)}J{H a,2O,1b=E.1p(e[d]||S),4N=!b[0]||!b[0].2B;9(4N)b.4Z(6.4M({N:d,2o:e}));9(E.1p(E.K(e,"2m")))a=E.K(e,"2m").15(e,b);9(!1b&&e["40"+d]&&e["40"+d].15(e,b)===P)a=P;9(4N)b.44();9(f&&f.15(e,b)===P)a=P;9(1b&&c!==P&&a!==P&&!(E.Y(e,\'a\')&&d=="4L")){6.4T=Q;e[d]()}6.4T=P}I a},2m:G(d){H a;d=E.1h.4M(d||17.1h||{});H b=d.N.2p(".");d.N=b[0];H c=E.K(6,"2A")&&E.K(6,"2A")[d.N],3m=1C.3x.2s.3c(1k,1);3m.4Z(d);M(H j 1j c){3m[0].4P=c[j];3m[0].K=c[j].K;9(!b[1]||c[j].N==b[1]){H e=c[j].15(6,3m);9(a!==P)a=e;9(e===P){d.2B();d.3L()}}}9(E.V.1g)d.2o=d.2B=d.3L=d.4P=d.K=S;I a},4M:G(c){H a=c;c=E.1i({},a);c.2B=G(){9(a.2B)a.2B();a.7I=P};c.3L=G(){9(a.3L)a.3L();a.7H=Q};9(!c.2o&&c.64)c.2o=c.64;9(E.V.1H&&c.2o.1z==3)c.2o=a.2o.14;9(!c.4H&&c.4G)c.4H=c.4G==c.2o?c.7E:c.4G;9(c.63==S&&c.62!=S){H e=U.35,b=U.1K;c.63=c.62+(e&&e.2D||b.2D||0);c.7C=c.7B+(e&&e.2z||b.2z||0)}9(!c.3R&&(c.60||c.5Z))c.3R=c.60||c.5Z;9(!c.5Y&&c.5W)c.5Y=c.5W;9(!c.3R&&c.2y)c.3R=(c.2y&1?1:(c.2y&2?3:(c.2y&4?2:0)));I c}};E.1b.1i({3Q:G(c,a,b){I c=="5V"?6.2P(c,a,b):6.O(G(){E.1h.1f(6,c,b||a,b&&a)})},2P:G(d,b,c){I 6.O(G(){E.1h.1f(6,d,G(a){E(6).5U(a);I(c||b).15(6,1k)},c&&b)})},5U:G(a,b){I 6.O(G(){E.1h.2e(6,a,b)})},1L:G(c,a,b){I 6.O(G(){E.1h.1L(c,a,6,Q,b)})},7y:G(c,a,b){9(6[0])I E.1h.1L(c,a,6[0],P,b)},25:G(){H a=1k;I 6.4L(G(e){6.4E=0==6.4E?1:0;e.2B();I a[6.4E].15(6,[e])||P})},7x:G(f,g){G 4x(e){H p=e.4H;1Y(p&&p!=6)2c{p=p.14}27(e){p=6};9(p==6)I P;I(e.N=="4w"?f:g).15(6,[e])}I 6.4w(4x).5S(4x)},2d:G(f){5R();9(E.3W)f.15(U,[E]);J E.3i.1a(G(){I f.15(6,[E])});I 6}});E.1i({3W:P,3i:[],2d:G(){9(!E.3W){E.3W=Q;9(E.3i){E.O(E.3i,G(){6.15(U)});E.3i=S}9(E.V.39||E.V.3a)U.4O("5Q",E.2d,P);9(!17.7v.L)E(17).37(G(){E("#4C").2e()})}}});E.O(("7u,7o,37,7n,6n,5V,4L,7m,"+"7l,7j,7i,4w,5S,7p,24,"+"50,7q,7r,7s,3U").2p(","),G(i,o){E.1b[o]=G(f){I f?6.3Q(o,f):6.1L(o)}});H x=P;G 5R(){9(x)I;x=Q;9(E.V.39||E.V.3a)U.4R("5Q",E.2d,P);J 9(E.V.1g){U.7e("<7d"+"7c 1T=4C 7b=Q "+"3g=//:><\\/1P>");H a=U.42("4C");9(a)a.5O=G(){9(6.2C!="1l")I;E.2d()};a=S}J 9(E.V.1H)E.4B=41(G(){9(U.2C=="5N"||U.2C=="1l"){4A(E.4B);E.4B=S;E.2d()}},10);E.1h.1f(17,"37",E.2d)}E.1b.1i({37:G(g,d,c){9(E.1p(g))I 6.3Q("37",g);H e=g.1e(" ");9(e>=0){H i=g.2s(e,g.L);g=g.2s(0,e)}c=c||G(){};H f="4F";9(d)9(E.1p(d)){c=d;d=S}J{d=E.3f(d);f="5M"}H h=6;E.3w({1u:g,N:f,K:d,1l:G(a,b){9(b=="1E"||b=="5L")h.4n(i?E("<1r/>").3e(a.4p.1o(/<1P(.|\\s)*?\\/1P>/g,"")).1X(i):a.4p);58(G(){h.O(c,[a.4p,b,a])},13)}});I 6},7a:G(){I E.3f(6.5K())},5K:G(){I 6.1W(G(){I E.Y(6,"3B")?E.2h(6.79):6}).1A(G(){I 6.2J&&!6.36&&(6.2K||/24|6a/i.12(6.Y)||/2t|1O|51/i.12(6.N))}).1W(G(i,c){H b=E(6).2V();I b==S?S:b.1d==1C?E.1W(b,G(i,a){I{2J:c.2J,1N:a}}):{2J:c.2J,1N:b}}).28()}});E.O("5J,5I,5H,6e,5G,5F".2p(","),G(i,o){E.1b[o]=G(f){I 6.3Q(o,f)}});H B=(1q 3v).3u();E.1i({28:G(d,b,a,c){9(E.1p(b)){a=b;b=S}I E.3w({N:"4F",1u:d,K:b,1E:a,1Z:c})},78:G(b,a){I E.28(b,S,a,"1P")},77:G(c,b,a){I E.28(c,b,a,"3S")},76:G(d,b,a,c){9(E.1p(b)){a=b;b={}}I E.3w({N:"5M",1u:d,K:b,1E:a,1Z:c})},80:G(a){E.1i(E.4u,a)},4u:{23:Q,N:"4F",2H:0,5E:"75/x-73-3B-72",6l:Q,3h:Q,K:S},4b:{},3w:G(s){H f,48=/=(\\?|%3F)/g,1s,K;s=E.1i(Q,s,E.1i(Q,{},E.4u,s));9(s.K&&s.6l&&1n s.K!="1M")s.K=E.3f(s.K);H q=s.1u.1e("?");9(q>-1){s.K=(s.K?s.K+"&":"")+s.1u.2s(q+1);s.1u=s.1u.2s(0,q)}9(s.1Z=="5b"){9(!s.K||!s.K.1U(48))s.K=(s.K?s.K+"&":"")+(s.5b||"6X")+"=?";s.1Z="3S"}9(s.1Z=="3S"&&s.K&&s.K.1U(48)){f="5b"+B++;s.K=s.K.1o(48,"="+f);s.1Z="1P";17[f]=G(a){K=a;1E();17[f]=11;2c{2G 17[f]}27(e){}}}9(s.1Z=="1P"&&s.1I==S)s.1I=P;9(s.1I===P&&s.N.2F()=="28")s.K=(s.K?s.K+"&":"")+"56="+(1q 3v()).3u();9(s.K&&s.N.2F()=="28"){s.1u+="?"+s.K;s.K=S}9(s.23&&!E.5a++)E.1h.1L("5J");9(!s.1u.1e("6W")&&s.1Z=="1P"){H h=U.4q("8g")[0];H g=U.5r("1P");g.3g=s.1u;9(!f&&(s.1E||s.1l)){H j=P;g.9Q=g.5O=G(){9(!j&&(!6.2C||6.2C=="5N"||6.2C=="1l")){j=Q;1E();1l();h.3k(g)}}}h.57(g);I}H k=P;H i=17.6V?1q 6V("9O.9N"):1q 6U();i.9M(s.N,s.1u,s.3h);9(s.K)i.5B("9J-9H",s.5E);9(s.5A)i.5B("9G-5z-9F",E.4b[s.1u]||"9E, 9C 9B 9z 5v:5v:5v 9y");i.5B("X-9w-9v","6U");9(s.6R)s.6R(i);9(s.23)E.1h.1L("5F",[i,s]);H c=G(a){9(!k&&i&&(i.2C==4||a=="2H")){k=Q;9(d){4A(d);d=S}1s=a=="2H"&&"2H"||!E.6Q(i)&&"3U"||s.5A&&E.6O(i,s.1u)&&"5L"||"1E";9(1s=="1E"){2c{K=E.6N(i,s.1Z)}27(e){1s="5t"}}9(1s=="1E"){H b;2c{b=i.5i("6M-5z")}27(e){}9(s.5A&&b)E.4b[s.1u]=b;9(!f)1E()}J E.5s(s,i,1s);1l();9(s.3h)i=S}};9(s.3h){H d=41(c,13);9(s.2H>0)58(G(){9(i){i.9p();9(!k)c("2H")}},s.2H)}2c{i.9n(s.K)}27(e){E.5s(s,i,S,e)}9(!s.3h)c();I i;G 1E(){9(s.1E)s.1E(K,1s);9(s.23)E.1h.1L("5G",[i,s])}G 1l(){9(s.1l)s.1l(i,1s);9(s.23)E.1h.1L("5H",[i,s]);9(s.23&&!--E.5a)E.1h.1L("5I")}},5s:G(s,a,b,e){9(s.3U)s.3U(a,b,e);9(s.23)E.1h.1L("6e",[a,s,e])},5a:0,6Q:G(r){2c{I!r.1s&&9l.9k=="52:"||(r.1s>=6K&&r.1s<9j)||r.1s==6J||E.V.1H&&r.1s==11}27(e){}I P},6O:G(a,c){2c{H b=a.5i("6M-5z");I a.1s==6J||b==E.4b[c]||E.V.1H&&a.1s==11}27(e){}I P},6N:G(r,b){H c=r.5i("9i-N");H d=b=="6y"||!b&&c&&c.1e("6y")>=0;H a=d?r.9h:r.4p;9(d&&a.35.34=="5t")6E"5t";9(b=="1P")E.5h(a);9(b=="3S")a=3p("("+a+")");I a},3f:G(a){H s=[];9(a.1d==1C||a.4d)E.O(a,G(){s.1a(3b(6.2J)+"="+3b(6.1N))});J M(H j 1j a)9(a[j]&&a[j].1d==1C)E.O(a[j],G(){s.1a(3b(j)+"="+3b(6))});J s.1a(3b(j)+"="+3b(a[j]));I s.65("&").1o(/%20/g,"+")}});E.1b.1i({1x:G(b,a){I b?6.1V({1G:"1x",2E:"1x",1v:"1x"},b,a):6.1A(":1O").O(G(){6.R.19=6.3d?6.3d:"";9(E.18(6,"19")=="2j")6.R.19="2U"}).1B()},1w:G(b,a){I b?6.1V({1G:"1w",2E:"1w",1v:"1w"},b,a):6.1A(":3X").O(G(){6.3d=6.3d||E.18(6,"19");9(6.3d=="2j")6.3d="2U";6.R.19="2j"}).1B()},6G:E.1b.25,25:G(a,b){I E.1p(a)&&E.1p(b)?6.6G(a,b):a?6.1V({1G:"25",2E:"25",1v:"25"},a,b):6.O(G(){E(6)[E(6).3j(":1O")?"1x":"1w"]()})},9c:G(b,a){I 6.1V({1G:"1x"},b,a)},9a:G(b,a){I 6.1V({1G:"1w"},b,a)},99:G(b,a){I 6.1V({1G:"25"},b,a)},98:G(b,a){I 6.1V({1v:"1x"},b,a)},97:G(b,a){I 6.1V({1v:"1w"},b,a)},95:G(c,a,b){I 6.1V({1v:a},c,b)},1V:G(j,h,g,f){H i=E.6C(h,g,f);I 6[i.3I===P?"O":"3I"](G(){i=E.1i({},i);H d=E(6).3j(":1O"),3r=6;M(H p 1j j){9(j[p]=="1w"&&d||j[p]=="1x"&&!d)I E.1p(i.1l)&&i.1l.15(6);9(p=="1G"||p=="2E"){i.19=E.18(6,"19");i.2N=6.R.2N}}9(i.2N!=S)6.R.2N="1O";i.3H=E.1i({},j);E.O(j,G(c,a){H e=1q E.2w(3r,i,c);9(/25|1x|1w/.12(a))e[a=="25"?d?"1x":"1w":a](j);J{H b=a.3z().1U(/^([+-]?)([\\d.]+)(.*)$/),1Q=e.2b(Q)||0;9(b){1B=3K(b[2]),2k=b[3]||"2I";9(2k!="2I"){3r.R[c]=1B+2k;1Q=(1B/e.2b(Q))*1Q;3r.R[c]=1Q+2k}9(b[1])1B=((b[1]=="-"?-1:1)*1B)+1Q;e.3J(1Q,1B,2k)}J e.3J(1Q,a,"")}});I Q})},3I:G(a,b){9(!b){b=a;a="2w"}9(!1k.L)I A(6[0],a);I 6.O(G(){9(b.1d==1C)A(6,a,b);J{A(6,a).1a(b);9(A(6,a).L==1)b.15(6)}})},9f:G(){H a=E.2Z;I 6.O(G(){M(H i=0;i<a.L;i++)9(a[i].T==6)a.6D(i--,1)}).5p()}});H A=G(b,c,a){9(!b)I;H q=E.K(b,c+"3I");9(!q||a)q=E.K(b,c+"3I",a?E.2h(a):[]);I q};E.1b.5p=G(a){a=a||"2w";I 6.O(G(){H q=A(6,a);q.44();9(q.L)q[0].15(6)})};E.1i({6C:G(b,a,c){H d=b&&b.1d==8Z?b:{1l:c||!c&&a||E.1p(b)&&b,2a:b,3E:c&&a||a&&a.1d!=8Y&&a};d.2a=(d.2a&&d.2a.1d==4X?d.2a:{8X:8W,8U:6K}[d.2a])||9o;d.3C=d.1l;d.1l=G(){E(6).5p();9(E.1p(d.3C))d.3C.15(6)};I d},3E:{6I:G(p,n,b,a){I b+a*p},5q:G(p,n,b,a){I((-32.8S(p*32.8R)/2)+0.5)*a+b}},2Z:[],2w:G(b,c,a){6.W=c;6.T=b;6.1c=a;9(!c.3A)c.3A={}}});E.2w.3x={4j:G(){9(6.W.2M)6.W.2M.15(6.T,[6.2l,6]);(E.2w.2M[6.1c]||E.2w.2M.6w)(6);9(6.1c=="1G"||6.1c=="2E")6.T.R.19="2U"},2b:G(a){9(6.T[6.1c]!=S&&6.T.R[6.1c]==S)I 6.T[6.1c];H r=3K(E.3O(6.T,6.1c,a));I r&&r>-8P?r:3K(E.18(6.T,6.1c))||0},3J:G(c,b,e){6.5n=(1q 3v()).3u();6.1Q=c;6.1B=b;6.2k=e||6.2k||"2I";6.2l=6.1Q;6.4g=6.4i=0;6.4j();H f=6;G t(){I f.2M()}t.T=6.T;E.2Z.1a(t);9(E.2Z.L==1){H d=41(G(){H a=E.2Z;M(H i=0;i<a.L;i++)9(!a[i]())a.6D(i--,1);9(!a.L)4A(d)},13)}},1x:G(){6.W.3A[6.1c]=E.1y(6.T.R,6.1c);6.W.1x=Q;6.3J(0,6.2b());9(6.1c=="2E"||6.1c=="1G")6.T.R[6.1c]="8N";E(6.T).1x()},1w:G(){6.W.3A[6.1c]=E.1y(6.T.R,6.1c);6.W.1w=Q;6.3J(6.2b(),0)},2M:G(){H t=(1q 3v()).3u();9(t>6.W.2a+6.5n){6.2l=6.1B;6.4g=6.4i=1;6.4j();6.W.3H[6.1c]=Q;H a=Q;M(H i 1j 6.W.3H)9(6.W.3H[i]!==Q)a=P;9(a){9(6.W.19!=S){6.T.R.2N=6.W.2N;6.T.R.19=6.W.19;9(E.18(6.T,"19")=="2j")6.T.R.19="2U"}9(6.W.1w)6.T.R.19="2j";9(6.W.1w||6.W.1x)M(H p 1j 6.W.3H)E.1y(6.T.R,p,6.W.3A[p])}9(a&&E.1p(6.W.1l))6.W.1l.15(6.T);I P}J{H n=t-6.5n;6.4i=n/6.W.2a;6.4g=E.3E[6.W.3E||(E.3E.5q?"5q":"6I")](6.4i,n,0,1,6.W.2a);6.2l=6.1Q+((6.1B-6.1Q)*6.4g);6.4j()}I Q}};E.2w.2M={2D:G(a){a.T.2D=a.2l},2z:G(a){a.T.2z=a.2l},1v:G(a){E.1y(a.T.R,"1v",a.2l)},6w:G(a){a.T.R[a.1c]=a.2l+a.2k}};E.1b.6m=G(){H c=0,3y=0,T=6[0],5m;9(T)8L(E.V){H b=E.18(T,"2W")=="4D",1D=T.14,21=T.21,2Q=T.3N,5y=1H&&!b&&3q(4f)<8J;9(T.6v){5x=T.6v();1f(5x.1R+32.2Y(2Q.35.2D,2Q.1K.2D),5x.3y+32.2Y(2Q.35.2z,2Q.1K.2z));9(1g){H d=E("4n").18("9L");d=(d=="8G"||E.5f&&3q(4f)>=7)&&2||d;1f(-d,-d)}}J{1f(T.5j,T.5C);1Y(21){1f(21.5j,21.5C);9(39&&/^t[d|h]$/i.12(1D.34)||!5y)d(21);9(5y&&!b&&E.18(21,"2W")=="4D")b=Q;21=21.21}1Y(1D.34&&/^1K|4n$/i.12(1D.34)){9(/^8D|1F-9R.*$/i.12(E.18(1D,"19")))1f(-1D.2D,-1D.2z);9(39&&E.18(1D,"2N")!="3X")d(1D);1D=1D.14}9(1H&&b)1f(-2Q.1K.5j,-2Q.1K.5C)}5m={3y:3y,1R:c}}I 5m;G d(a){1f(E.18(a,"8C"),E.18(a,"9T"))}G 1f(l,t){c+=3q(l)||0;3y+=3q(t)||0}}})();',62,615,'||||||this|||if|||||||||||||||||||||||||||||||||function|var|return|else|data|length|for|type|each|false|true|style|null|elem|document|browser|options||nodeName|||undefined|test||parentNode|apply|jQuery|window|css|display|push|fn|prop|constructor|indexOf|add|msie|event|extend|in|arguments|complete|className|typeof|replace|isFunction|new|div|status|firstChild|url|opacity|hide|show|attr|nodeType|filter|end|Array|parent|success|table|height|safari|cache|tbody|body|trigger|string|value|hidden|script|start|left|merge|id|match|animate|map|find|while|dataType||offsetParent|break|global|select|toggle|toUpperCase|catch|get|selected|duration|cur|try|ready|remove|done|al|makeArray|nextSibling|none|unit|now|handle||target|split|swap|guid|slice|text|stack|pushStack|fx|tb|button|scrollTop|events|preventDefault|readyState|scrollLeft|width|toLowerCase|delete|timeout|px|name|checked|exec|step|overflow|ret|one|doc|nth|inArray|grep|block|val|position|childNodes|max|timers|removeData|rl|Math|trim|tagName|documentElement|disabled|load|insertBefore|mozilla|opera|encodeURIComponent|call|oldblock|append|param|src|async|readyList|is|removeChild|color|args|last|first|eval|parseInt|self|domManip|has|getTime|Date|ajax|prototype|top|toString|orig|form|old|innerHTML|easing||multiFilter|curAnim|queue|custom|parseFloat|stopPropagation|defaultView|ownerDocument|curCSS|getComputedStyle|bind|which|json|String|error|static|isReady|visible|oWidth|oHeight|on|setInterval|getElementById|currentStyle|shift|ol|child|RegExp|jsre|input|isXMLDoc|lastModified|previousSibling|jquery|dir|version|pos|styleFloat|state|update|tr|getAttribute|el|html|empty|responseText|getElementsByTagName|float|radio|runtimeStyle|ajaxSettings|visibility|mouseover|handleHover|getPropertyValue|selectedIndex|clearInterval|safariTimer|__ie_init|absolute|lastToggle|GET|fromElement|relatedTarget|clean|index|init|click|fix|evt|removeEventListener|handler|andSelf|addEventListener|cloneNode|triggered|nodeIndex|unique|classFilter|Number|prevObject|unshift|submit|password|file|after|removeAttribute|expr|_|appendChild|setTimeout|client|active|jsonp|sibling|win|deep|boxModel|cssFloat|globalEval|getResponseHeader|offsetLeft|lastChild|wrapAll|results|startTime|props|dequeue|swing|createElement|handleError|parsererror|checkbox|00|object|box|safari2|Modified|ifModified|setRequestHeader|offsetTop|col|contentType|ajaxSend|ajaxSuccess|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|POST|loaded|onreadystatechange|appendTo|DOMContentLoaded|bindReady|mouseout|not|unbind|unload|ctrlKey|removeAttr|metaKey|keyCode|charCode|Width|clientX|pageX|srcElement|join|outerHTML|substr|parse|zoom|textarea|reset|image|odd|ajaxError|even|before|quickClass|quickID|quickChild|prepend|processData|offset|scroll|execScript|contents|uuid|continue|textContent|clone|setArray|getBoundingClientRect|_default|nodeValue|xml|100|alpha|href|speed|splice|throw|createTextNode|_toggle|replaceWith|linear|304|200|colgroup|Last|httpData|httpNotModified|fl|httpSuccess|beforeSend|fieldset|webkit|XMLHttpRequest|ActiveXObject|http|callback|img|br|attributes|abbr|urlencoded|www|pixelLeft|application|post|getJSON|getScript|elements|serialize|defer|ipt|scr|write|clientWidth|hasClass|clientHeight|mousemove|mouseup|relative|mousedown|dblclick|resize|focus|change|keydown|keypress|keyup|FORM|blur|frames|right|hover|triggerHandler|offsetWidth|offsetHeight|clientY|pageY|border|toElement|padding|Left|cancelBubble|returnValue|Right|Bottom|Top|detachEvent|attachEvent|substring|animated|line|header|weight|font|enabled|innerText|contains|only|eq|gt|ajaxSetup|lt|size|uFFFF|u0128|417|inner|Height|toggleClass|removeClass|addClass|replaceAll|insertAfter|prependTo|contentWindow|contentDocument|head|wrap|iframe|children|noConflict|siblings|prevAll|nextAll|prev|wrapInner|next|parents|maxLength|maxlength|readOnly|Boolean|readonly|class|htmlFor|CSS1Compat|compatMode|compatible|borderLeftWidth|inline|ie|ra|medium|it|rv|522|userAgent|with|navigator|1px|concat|10000|array|PI|cos|ig|fast|NaN|600|slow|Function|Object|setAttribute|reverse|changed|be|can|fadeTo|property|fadeOut|fadeIn|slideToggle|slideUp|getAttributeNode|slideDown|method|action|stop|cssText|responseXML|content|300|protocol|location|option|send|400|abort|th|td|cap|colg|tfoot|With|Requested|thead|GMT|1970|leg|Jan|01|opt|Thu|Since|If|Type|area|Content|hr|borderWidth|open|XMLHTTP|Microsoft|meta|onload|row|link|borderTopWidth|specified'.split('|'),0,{}))/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * $LastChangedDate: 2007-08-17 13:14:11 -0500 (Fri, 17 Aug 2007) $
 * $Rev: 2759 $
 *
 * Version: 1.1.2
 *
 * Requires: jQuery 1.1.3+
 */
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}('(9($){l e=$.1q.C,r=$.1q.r;$.1q.M({C:9(){3(!1[0])f();3(1[0]==p)3($.7.O||($.7.E&&U($.7.13)>11))6 n.19-(($(5).C()>n.19)?i():0);k 3($.7.E)6 n.19;k 6 $.I&&5.P.1E||5.o.1E;3(1[0]==5)6 1C.1y(($.I&&5.P.1w||5.o.1w),5.o.1u);6 e.1T(1,1P)},r:9(){3(!1[0])f();3(1[0]==p)3($.7.O||($.7.E&&U($.7.13)>11))6 n.1b-(($(5).r()>n.1b)?i():0);k 3($.7.E)6 n.1b;k 6 $.I&&5.P.1N||5.o.1N;3(1[0]==5)3($.7.1M){l a=n.1p;n.1a(27,n.1o);l b=n.1p;n.1a(a,n.1o);6 5.o.1c+b}k 6 1C.1y((($.I&&!$.7.E)&&5.P.1L||5.o.1L),5.o.1c);6 r.1T(1,1P)},19:9(){3(!1[0])f();6 1[0]==p||1[0]==5?1.C():1.14(\':N\')?1[0].1u-h(1,\'q\')-h(1,\'1I\'):1.C()+h(1,\'1h\')+h(1,\'1H\')},1b:9(){3(!1[0])f();6 1[0]==p||1[0]==5?1.r():1.14(\':N\')?1[0].1c-h(1,\'s\')-h(1,\'1F\'):1.r()+h(1,\'1v\')+h(1,\'1D\')},21:9(a){3(!1[0])f();a=$.M({A:w},a||{});6 1[0]==p||1[0]==5?1.C():1.14(\':N\')?1[0].1u+(a.A?(h(1,\'L\')+h(1,\'1x\')):0):1.C()+h(1,\'q\')+h(1,\'1I\')+h(1,\'1h\')+h(1,\'1H\')+(a.A?(h(1,\'L\')+h(1,\'1x\')):0)},1Y:9(a){3(!1[0])f();a=$.M({A:w},a||{});6 1[0]==p||1[0]==5?1.r():1.14(\':N\')?1[0].1c+(a.A?(h(1,\'K\')+h(1,\'1U\')):0):1.r()+h(1,\'s\')+h(1,\'1F\')+h(1,\'1v\')+h(1,\'1D\')+(a.A?(h(1,\'K\')+h(1,\'1U\')):0)},m:9(a){3(!1[0])f();3(a!=1S)6 1.1Q(9(){3(1==p||1==5)p.1a(a,$(p).u());k 1.m=a});3(1[0]==p||1[0]==5)6 n.1p||$.I&&5.P.m||5.o.m;6 1[0].m},u:9(a){3(!1[0])f();3(a!=1S)6 1.1Q(9(){3(1==p||1==5)p.1a($(p).m(),a);k 1.u=a});3(1[0]==p||1[0]==5)6 n.1o||$.I&&5.P.u||5.o.u;6 1[0].u},12:9(a){6 1.1O({A:w,J:w,v:1.z()},a)},1O:9(b,c){3(!1[0])f();l x=0,y=0,H=0,G=0,8=1[0],4=1[0],T,10,Z=$.D(8,\'12\'),F=$.7.1M,S=$.7.26,18=$.7.O,1n=$.7.E,R=$.7.E&&U($.7.13)>11,1m=w,1l=w,b=$.M({A:Q,15:w,1k:w,J:Q,1K:w,v:5.o},b||{});3(b.1K)6 1.1J(b,c);3(b.v.1j)b.v=b.v[0];3(8.B==\'Y\'){x=8.V;y=8.X;3(F){x+=h(8,\'K\')+(h(8,\'s\')*2);y+=h(8,\'L\')+(h(8,\'q\')*2)}k 3(18){x+=h(8,\'K\');y+=h(8,\'L\')}k 3((S&&1g.I)){x+=h(8,\'s\');y+=h(8,\'q\')}k 3(R){x+=h(8,\'K\')+h(8,\'s\');y+=h(8,\'L\')+h(8,\'q\')}}k{17{10=$.D(4,\'12\');x+=4.V;y+=4.X;3((F&&!4.B.1G(/^t[d|h]$/i))||S||R){x+=h(4,\'s\');y+=h(4,\'q\');3(F&&10==\'1i\')1m=Q;3(S&&10==\'25\')1l=Q}T=4.z||5.o;3(b.J||F){17{3(b.J){H+=4.m;G+=4.u}3(18&&($.D(4,\'24\')||\'\').1G(/23-22|20/)){H=H-((4.m==4.V)?4.m:0);G=G-((4.u==4.X)?4.u:0)}3(F&&4!=8&&$.D(4,\'1e\')!=\'N\'){x+=h(4,\'s\');y+=h(4,\'q\')}4=4.1B}W(4!=T)}4=T;3(4==b.v&&!(4.B==\'Y\'||4.B==\'1d\')){3(F&&4!=8&&$.D(4,\'1e\')!=\'N\'){x+=h(4,\'s\');y+=h(4,\'q\')}3(((1n&&!R)||18)&&10!=\'1r\'){x-=h(T,\'s\');y-=h(T,\'q\')}1A}3(4.B==\'Y\'||4.B==\'1d\'){3(((1n&&!R)||(S&&$.I))&&Z!=\'1i\'&&Z!=\'1z\'){x+=h(4,\'K\');y+=h(4,\'L\')}3(R||(F&&!1m&&Z!=\'1z\')||(S&&Z==\'1r\'&&!1l)){x+=h(4,\'s\');y+=h(4,\'q\')}1A}}W(4)}l a=j(8,b,x,y,H,G);3(c){$.M(c,a);6 1}k{6 a}},1J:9(b,c){3(!1[0])f();l x=0,y=0,H=0,G=0,4=1[0],z,b=$.M({A:Q,15:w,1k:w,J:Q,v:5.o},b||{});3(b.v.1j)b.v=b.v[0];17{x+=4.V;y+=4.X;z=4.z||5.o;3(b.J){17{H+=4.m;G+=4.u;4=4.1B}W(4!=z)}4=z}W(4&&4.B!=\'Y\'&&4.B!=\'1d\'&&4!=b.v);l a=j(1[0],b,x,y,H,G);3(c){$.M(c,a);6 1}k{6 a}},z:9(){3(!1[0])f();l a=1[0].z;W(a&&(a.B!=\'Y\'&&$.D(a,\'12\')==\'1r\'))a=a.z;6 $(a)}});l f=9(){1Z"1X: 1g 1W 14 1V";};l h=9(a,b){6 U($.D(a.1j?a[0]:a,b))||0};l j=9(a,b,x,y,d,c){3(!b.A){x-=h(a,\'K\');y-=h(a,\'L\')}3(b.15&&(($.7.E&&U($.7.13)<11)||$.7.O)){x+=h(a,\'s\');y+=h(a,\'q\')}k 3(!b.15&&!(($.7.E&&U($.7.13)<11)||$.7.O)){x-=h(a,\'s\');y-=h(a,\'q\')}3(b.1k){x+=h(a,\'1v\');y+=h(a,\'1h\')}3(b.J&&(!$.7.O||a.V!=a.m&&a.X!=a.m)){d-=a.m;c-=a.u}6 b.J?{1f:y-c,1t:x-d,u:c,m:d}:{1f:y,1t:x}};l g=0;l i=9(){3(!g){l a=$(\'<1s>\').D({r:16,C:16,1e:\'2d\',12:\'1i\',1f:-1R,1t:-1R}).2c(\'o\');g=16-a.2b(\'<1s>\').2a(\'1s\').D({r:\'16%\',C:29}).r();a.28()}6 g}})(1g);',62,138,'|this||if|parent|document|return|browser|elem|function|||||||||||else|var|scrollLeft|self|body|window|borderTopWidth|width|borderLeftWidth||scrollTop|relativeTo|false|||offsetParent|margin|tagName|height|css|safari|mo|st|sl|boxModel|scroll|marginLeft|marginTop|extend|visible|opera|documentElement|true|sf3|ie|op|parseInt|offsetLeft|while|offsetTop|BODY|elemPos|parPos|520|position|version|is|border|100|do|oa|innerHeight|scrollTo|innerWidth|offsetWidth|HTML|overflow|top|jQuery|paddingTop|absolute|jquery|padding|relparent|absparent|sf|pageYOffset|pageXOffset|fn|static|div|left|offsetHeight|paddingLeft|scrollHeight|marginBottom|max|fixed|break|parentNode|Math|paddingRight|clientHeight|borderRightWidth|match|paddingBottom|borderBottomWidth|offsetLite|lite|scrollWidth|mozilla|clientWidth|offset|arguments|each|1000|undefined|apply|marginRight|empty|collection|Dimensions|outerWidth|throw|inline|outerHeight|row|table|display|relative|msie|99999999|remove|200|find|append|appendTo|auto'.split('|'),0,{}))/*
 ### jQuery Multiple File Upload Plugin ###
 By Diego A., http://www.fyneworks.com, diego@fyneworks.com
 
 Website:
  http://www.fyneworks.com/jquery/multiple-file-upload/
 Project Page:
  http://jquery.com/plugins/project/MultiFile/
 Forums:
  http://www.nabble.com/jQuery-Multiple-File-Upload-f20931.html
 Blog:
	 http://fyneworks.blogspot.com/2007/04/jquery-multiple-file-upload-plugin-v11.html
  (old) http://fyneworks.blogspot.com/2007/04/multiple-file-upload-plugin-for-jquery.html
 
 12-April-2007: v1.1
                Added events and file extension validation
                See website for details.
 
 06-June-2007: v1.2
                Now works in Opera.
 
 12-June-2007: v1.21
                Preserves name of file input so all current server-side
																functions don't need to be changed on new installations.
 
 24-June-2007: v1.22
                Now works perfectly in Opera, thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com>
*/

/*# AVOID COLLISIONS #*/
if(jQuery) (function($){
/*# AVOID COLLISIONS #*/

	// Fix for Opera: 6-June-2007
	// Stop confusion between null, 'null' and 'undefined'
	function IsNull(i){
		return (i==null || i=='null' || i=='' || i=='undefined');
	};
	
	// extend jQuery - $.MultiFile hook
	$.extend($, {
		MultiFile: function( o /* Object */ ){
			return $("INPUT[@type='file'].multi").MultiFile(o);
		}
	});
	
	// extend jQuery function library
	$.extend($.fn, {
			
			// MultiFile function
			MultiFile: function( o /* Object */ ){
				if(this._MultiFile){ return $(this); }
				this._MultiFile = true;
				
				// DEBUGGING: disable plugin
				//return false;
				
				// Bind to each element in current jQuery object
				return $(this).each(function(i){
							// Remember our ancestors...
							var d = this;
							var x = $(d);
       
       // Copy parent attributes - Thanks to Jonas Wagner
							// we will use this one to create new input elements
       var xclone = x.clone();
							
							//#########################################
							// Find basic configuration in class string
							// debug???
							d.debug = (d.className.indexOf('debug')>0);
							// limit number of files that can be selected?
							if(IsNull(d.max)){
								d.max = x.attr('maxlength');
								if(IsNull(d.max)){
									d.max = ((d.className.match(/\b((max|limit)\-[0-9]+)\b/gi) || [''])[0]);
									if(IsNull(d.max)){
										d.max = -1;
									}else{
										d.max = d.max.match(/[0-9]+/gi)[0];
									}
								}
							}
							d.max = new Number(d.max);
							// limit extensions?
							if(!d.accept){
								d.accept = (d.className.match(/\b(accept\-[\w\|]+)\b/gi)) || '';
								d.accept = new String(d.accept).replace(/^(accept|ext)\-/i,'');
							}
							//#########################################
							
							
							// Attach a bunch of events, jQuery style ;-)
							$.each("on,after".split(","), function(i,o){
								$.each("FileSelect,FileRemove,FileAppend".split(","), function(j,event){
									d[o+event] = function(e, v, m){ // default functions do absolutelly nothing...
										// if(d.debug) alert(''+o+event+'' +'\nElement:' +e.name+ '\nValue: ' +v+ '\nMaster: ' +m.name+ '');
									};
								});
							});
							// Setup a global event handler
							d.trigger = function(event, e){
									var f = d[event];
									if(f){
										var v = $(this).attr('value');
										var r = f(e, v, d);
										if(r!=null) return r;
									}
									return true;
							};
							
							
							// Initialize options
							if( typeof o == 'number' ){ o = {max:o}; };
							$.extend(d, d.data || {}, o);
							
							// Default properties - INTERNAL USE ONLY
							$.extend(d, {
								STRING: d.STRING || {}, // used to hold string constants
								n: 0, // How many elements are currently selected?
								k: 'multi', // Instance Key?
								f: function(z){ return d.k+'_'+String(i)+'_'+String(z); }
							});
							
							// Visible text strings...
							// $file = file name (with path), $ext = file extension
							d.STRING = $.extend({
								remove:'remove',
								denied:'You cannot select a $ext file.\nTry again...',
								selected:'File selected: $file'
							}, d.STRING);
							
							
							// Setup dynamic regular expression for extension validation
							// - thanks to John-Paul Bader: http://smyck.de/2006/08/11/javascript-dynamic-regular-expresions/
							if(String(d.accept).length>1){
								d.rxAccept = new RegExp('\\.('+(d.accept?d.accept:'')+')$','gi');
							};
							
							// Create wrapper to hold our file list
							d.w = d.k+'multi'+'_'+i; // Wrapper ID?
							x.wrap('<div id="'+d.w+'"></div>');
							
							// Bind a new element
							d.add = function( e, ii ){
								
								// Keep track of how many elements have been displayed
								d.n++;
								
								// Add reference to master element
								e.d = d;
								
								// Define element's ID and name (upload components need this!)
								e.i = ii;//d.I;
								e.id = d.f(e.i);
								e.name = (e.name || x.attr('name') || 'upload_file[]');//(e.i>0?e.i:''); // same name as master element
								
								// If we've reached maximum number, disable input e
								if( (d.max != -1) && ((d.n-1) > (d.max)) ){ // d.n Starts at 1, so subtract 1 to find true count
									e.disabled = true;
								};
								
								// Remember most recent e
								d.current = e;
								
								/// now let's use jQuery
								e = $(e);
								
								// Triggered when a file is selected
								e.change(function(){
										
										//# Trigger Event! onFileSelect
										if(!d.trigger('onFileSelect', this, d)) return false;
										//# End Event!
										
										// check extension
										if(d.accept){
											var v = String(e.attr('value'));
											if(!v.match(d.rxAccept)){
												// Clear element value
												e.val('').attr('value', '');
												e.get(0).value = '';
												
												// OPERA BUG FIX - 2007-06-24
												// Thanks to Adrian Wróbel <adrian [dot] wrobel [at] gmail.com>
 											// we add new input element and remove present one for browsers that can't clear value of input element
												//var f = $('<input name="'+(x.attr('name') || '')+'" type="file"/>');
												var f = xclone.clone();// Copy parent attributes - Thanks to Jonas Wagner
												
												d.n--;
												d.add(f.get(0), this.i);
												e.parent().prepend(f);
												e.remove();
												
												// Show error message
												// TO-DO: Some people have suggested alternative methods for displaying this message
												// such as inline HTML, lightbox, etc... maybe integrate with blockUI plugin?
												alert(d.STRING.denied.replace('$ext', String(v.match(/\.\w{1,4}$/gi))));
												
												return false;
											}
										};
										
										// Hide this element: display:none is evil!
										//this.style.display = 'block';
										this.style.position = 'absolute';
										this.style.left = '-1000px';
          
										// Create a new file input element
										//var f = $('<input name="'+(x.attr('name') || '')+'" type="file"/>');
          var f = xclone.clone();// Copy parent attributes - Thanks to Jonas Wagner
										
										// Add it to the form
										$(this).parent().prepend(f);
										
										// Update list
										d.list( this );
										
										// Bind functionality
										d.add( f.get(0), this.i+1 );
										
										//# Trigger Event! afterFileSelect
										if(!d.trigger('afterFileSelect', this, d)) return false;
										//# End Event!
										
								});
							
							};
							// Bind a new element
						
							// Add a new file to the list
							d.list = function( y ){
								
								//# Trigger Event! onFileAppend
								if(!d.trigger('onFileAppend', y, d)) return false;
								//# End Event!
								
								// Insert HTML
								var
									t = $('#'+d.w),
									r = $('<div></div>'),
									v = $(y).attr('value')+'',
									a = $('<span class="file" title="'+d.STRING.selected.replace('$file', v)+'">'+v.match(/[^\/\\]+$/gi)[0]+'</span>'),
									b = $('<a href="#'+d.w+'">'+d.STRING.remove+'</a>');
								t.append(r);
								r.append('[',b,']&nbsp;',a);//.prepend(y.i+': ');
								b.click(function(){
									
										//# Trigger Event! onFileRemove
										if(!d.trigger('onFileRemove', y, d)) return false;
										//# End Event!
										
										d.n--;
										d.current.disabled = false;
										$('#'+d.f(y.i)).remove();
										$(this).parent().remove();
										
										//# Trigger Event! afterFileRemove
										if(!d.trigger('afterFileRemove', y, d)) return false;
										//# End Event!
										
										return false;
								});
								
								//# Trigger Event! afterFileAppend
								if(!d.trigger('afterFileAppend', y, d)) return false;
								//# End Event!
								
							};
							
							// Bind first file element
							if(!d.ft){ d.add(d, 0); d.ft = true; }
							d.I++;
							d.n++;
							
				});
				// each element
			
			}
			// MultiFile function
	
	});
	// extend jQuery function library



/*
 ### Default implementation ###
 The plugin will attach itself to file inputs
 with the class 'multi' when the page loads
	
	Use the jQuery start plugin to 
*/
if($.start){ $.start($.MultiFile) }
else $(function(){ $.MultiFile() });



/*# AVOID COLLISIONS #*/
})(jQuery);
/*# AVOID COLLISIONS #*/

function addLoadEvent(func){
 var oldonload=window.onload;
 if(typeof window.onload!='function'){
  window.onload=func;
 }else{
  window.onload=function(){
   oldonload();
   func();
  }
 }
}

$(function(){
 $('a').focus(function(){$(this)[0].blur();});
 
 if($('input:text','form:not(.comment):eq(0)').length)
  $('input:text','form:eq(0)')[0].focus();
 else if($('input:password','form:eq(0)').length)
  $('input:password','form:eq(0)')[0].focus();

 $('ul.f_list li:even').addClass('ra');
 $('ul.fl_list li:odd').filter('.fl_fldr').not('.fl_fldrp').addClass('fl_fldr_alt');
 $('ul.fl_list li:even').not('.fl_fldr').addClass('fl_file_alt');
 
 $('form.upload').animate({opacity:0.4},1500);
 $('form.upload').hover(function(){$(this).animate({opacity:1});},function(){$(this).animate({opacity:0.4});});
 
 $('ul.d_list ul').find('li:has(ul:hidden)').find('a.tgl:first').addClass('tgl-p');
 $('ul.d_list ul').find('li:has(ul:visible)').find('a.tgl:first').addClass('tgl-m');
 $('ul.d_list ul ul li .tgl').each(function(){
  var afol=unescape($(this).siblings('.nfo')[0].onclick.toString().match(/"(.*?)"/)[1].replace(/\+/g,' '));
	var re=new RegExp(afol.replace(/\//g,'#'),'i');
  if(!window.folder_show)
	 toggle_folder($(this)[0]);
  else if(!folder_show.match(re))
	 toggle_folder($(this)[0]);
 });

 $.MultiFile({afterFileSelect:function(){$('form.upload input.button').show();}});
 
 var ims=['jpg','jpeg','gif','bmp','png'];
 if(ims.length>0){
  $(document.body).append('<div id="im_hov"><img src="about:blank" alt="Loading..." /></div>');
 }
 for(m=0;m<ims.length;m++){
  $('li.fl_'+ims[m]+' > a').hover(
   function(){
    var offset={};
    $(this).offset({scroll:false},offset);
    $('#im_hov').show().css({top:offset.top+2,left:offset.left+$(this).width()+5}).find('img').attr('src','/aero/image?size=m400&file='+this.href.split('dir=')[1].replace(/aero/,'..').split('&file=').join('/'));
   },
   function(){
    $('#im_hov').hide().find('img').attr('src','about:blank');
   });
 }
 
 if(document.forms['mailpost'] && document.forms['mailpost'].req_username){
  typeahead.init(
   document.forms['mailpost'].req_username,
   username_list,
   'username',
   function(){
    return;
    if(typeahead.foundItemsIndex[typeahead.matchNumber])
     $('#useravatar').set('src',eval('typeahead.list['+typeahead.foundItemsIndex[typeahead.matchNumber]+'].avatar'));
    else
     $('#useravatar').set('src','');
   } 
  );
 }
 
 tb_init('a.thickbox, area.thickbox, input.thickbox');
 imgLoader=new Image();
 imgLoader.src=tb_pathToImage;
});

addLoadEvent(
 function(){
  typeahead.loaded();
 }
);

var format={
 ipath:'',
 toolbar_id:'',
 textarea_id:'',
 tools:[],
 start:'',
 middle:'',
 end:'',
 load:function(ipath,toolbar_id,textarea_id){
  if(format.tools.length<=0||ipath==''||toolbar_id==''||textarea_id=='') return false;
	else{
	 format.ipath=ipath;
	 format.toolbar_id=toolbar_id;
	 format.textarea_id=textarea_id;
	}
  $('#'+format.toolbar_id).html(format.toolbar());
 },
 toolbar:function(){
  var html='',i;
  for(i=0;i<format.tools.length;i++){
	 option=format.tools[i]['option']?format.tools[i]['option']:'';
	 html+='<a href="#" onclick="format.tool(\''+format.tools[i]['fn']+'\',\''+option+'\');return false;" '+
	       'title="'+format.tools[i]['text']+'"><img src="'+format.ipath+format.tools[i]['image']+'" style="margin:0;" /></a>';
	}
	return html+'&nbsp;';
 },
 tool:function(f,option){
  var text='',tag='',option=(option&&option!=''?'='+option:''),filler='';
  switch(f){
   case 'bold':tag='b';break;
	 case 'italic':tag='i';break;
	 case 'underline':tag='u';break;
	 case 'strike':tag='s';break;
	 case 'align':tag='align';break;
   case 'ol':tag='ol';option="]\n [*";filler=" \n";break;
	 case 'ul':tag='ul';option="]\n [*";filler=" \n";break;
   case 'url':tag='url';filler='text here';break;
   case 'color':tag='colour';break;
	 case 'bgcolor':tag='hilite';break;
   default:tag=f;break;
  }
  if(tag==''){
	 setTimeout('format.focus();',10);
	 return;
	}
	format.start=format.middle=format.end='';
	if(tag=='url' && !document.all && $('form','#uridiv').length){
   $('form','#uridiv')[0].reset();
	 if(($('#'+format.textarea_id)[0].selectionStart || $('#'+format.textarea_id)[0].selectionStart=='0')){
	  format.start_selection=$('#'+format.textarea_id)[0].selectionStart;
		format.end_selection=$('#'+format.textarea_id)[0].selectionEnd;
	  format.start=($('#'+format.textarea_id).val()).substring(0,format.start_selection);
	  format.middle=($('#'+format.textarea_id).val()).substring(format.start_selection,format.end_selection);
	  format.end=($('#'+format.textarea_id).val()).substring(format.end_selection,$('#'+format.textarea_id)[0].textLength);
	 }
	 if(format.middle!='')
	  $('#uri_text','#uridiv>form').attr('value',format.middle);
	 tb_show('','#TB_inline?height=240&width=500&inlineId=uridiv','');
	 $('form input','#TB_window')[0].focus();
	}else if(tag=='img' && $('form','#imgdiv').length){
   $('form','#imgdiv')[0].reset();
	 if(($('#'+format.textarea_id)[0].selectionStart || $('#'+format.textarea_id)[0].selectionStart=='0')){
	  format.start_selection=$('#'+format.textarea_id)[0].selectionStart;
		format.end_selection=$('#'+format.textarea_id)[0].selectionEnd;
	  format.start=($('#'+format.textarea_id).val()).substring(0,format.start_selection);
	  format.middle=($('#'+format.textarea_id).val()).substring(format.start_selection,format.end_selection);
	  format.end=($('#'+format.textarea_id).val()).substring(format.end_selection,$('#'+format.textarea_id)[0].textLength);
	 }
	 if(format.middle!='')
	  $('#img_alttext','#imgdiv>form').attr('value',format.middle);
	 tb_show('','#TB_inline?height=300&width=500&inlineId=imgdiv','');
	 $('form input','#TB_window')[0].focus();
	}else if(document.selection && document.selection.createRange){
	 str=document.selection.createRange().text;
	 format.focus();
	 sel=document.selection.createRange();
	 sel.text='['+tag+option+']'+str+filler+'[/'+tag+']';
	 format.focus();
  }else if(($('#'+format.textarea_id)[0].selectionStart || $('#'+format.textarea_id)[0].selectionStart=='0')){
	 var start_selection=$('#'+format.textarea_id)[0].selectionStart,end_selection=$('#'+format.textarea_id)[0].selectionEnd;
	 var start=($('#'+format.textarea_id).val()).substring(0,start_selection);
	 var middle=($('#'+format.textarea_id).val()).substring(start_selection,end_selection);
	 var end=($('#'+format.textarea_id).val()).substring(end_selection,$('#'+format.textarea_id)[0].textLength);
	 if(middle.length>0)
	  filler='';
	 if(middle.substring(0,tag.length+2)=='['+tag+']'&&middle.substring(middle.length-tag.length-3,middle.length)=='[/'+tag+']'){
	  middle=middle.substring(tag.length+2,middle.length-tag.length-3);
	 }else{
	  middle='['+tag+option+']'+middle+filler+'[/'+tag+']';
	 }
	 $('#'+format.textarea_id).val(start+middle+end);
	 setTimeout("format.focus();$('#"+format.textarea_id+"')[0].selectionStart="+(start_selection+tag.length+option.length+2)+";"+
	 "$('#"+format.textarea_id+"')[0].selectionEnd="+(start_selection+middle.length-tag.length-3-(filler.substring(filler.length-1,filler.length)=="\n"?1:0))+";",10);
  }else{
	 $('#'+format.textarea_id).val($('#'+format.textarea_id).val()+'['+tag+option+']'+filler+'[/'+tag+']');
	 setTimeout("format.focus();$('#"+format.textarea_id+"')[0].selectionStart="+($('#'+format.textarea_id).val().length-tag.length-3)+";$('#"+format.textarea_id+"')[0].selectionEnd="+($('#'+format.textarea_id).val().length-tag.length-3),10);
  }
 },
 focus:function(){
  $('#'+format.textarea_id)[0].focus();
 },
 url:function(form){
  var err='';
  if(form.uri_text.value=='')
	 err='You need to fill in the text field!';
	
	if(form.uri_uri.value=='' && form.uri_select[form.uri_select.selectedIndex].value=='/aero/---' && err=='')
	 err='You need to fill in or choose a link!';
	
	if(err!=''){
	 alert(err);
	 form.elements[0].focus();
	}else{
	 if(form.uri_uri.value!='')
	  link_uri=form.uri_uri.value;
	 else
	  link_uri=form.uri_select[form.uri_select.selectedIndex].value;
	
	 link_text=form.uri_text.value;
	 
	 if(format.start!='' || format.middle!='' || format.end!=''){
    if(format.middle.substring(0,5)=='[url]' && format.middle.substring(format.middle.length-6,format.middle.length)=='[/url]')
     format.middle=format.middle.substring(5,format.middle.length-6);
    else
     format.middle='[url='+link_uri+']'+link_text+'[/url]';
    $('#'+format.textarea_id).val(format.start+format.middle+format.end);
    setTimeout("format.focus();$('#"+format.textarea_id+"')[0].selectionStart="+(format.start_selection+link_uri.length+6)+";"+
    "$('#"+format.textarea_id+"')[0].selectionEnd="+(format.start_selection+format.middle.length-6)+";",10);
   }else{
    $('#'+format.textarea_id).val($('#'+format.textarea_id).val()+'[url='+link_uri+']'+link_text+'[/url]');
    setTimeout("format.focus();$('#"+format.textarea_id+"')[0].selectionStart="+($('#'+format.textarea_id).val().length-6)+";$('#"+format.textarea_id+"')[0].selectionEnd="+($('#'+format.textarea_id).val().length-6),10);
   }
	 tb_remove();
	}
 },
 img:function(form){
	if(form.img_text.value=='' && form.img_select[form.img_select.selectedIndex].value=='---' && form.img_file.value=='')
	 alert('You need to specify some form of picture!');
	else{
	 var is_img=new RegExp('^.+\.(jpe?g|gif|png)$','i');
	 if(form.img_text.value!='' || form.img_select[form.img_select.selectedIndex].value!='---'){
	  img_file=form.img_text.value!=''?form.img_text.value:form.img_select[form.img_select.selectedIndex].value;
	  if(!is_img.test(img_file)){
  	 alert('You need to specify a valid image!');
		 return false;
	  }
	 }else{
    $("#loading").ajaxStart(function(){$(this).show();}).ajaxComplete(function(){$(this).hide();});
    $.ajaxFileUpload({
     url:'/aero/a/ajaxupload.php', 
     secureuri:false,
     fileElementId:'img_file',
     dataType:'json',
     success:function(data,status){
      if(typeof(data.error)!='undefined'){
       if(data.error!='') alert(data.error);
       else{
			  form.img_text.value=data.msg;
				format.img(form);
			 }
      }
     },
     error:function(data,status,e){alert(e);}
    });
		return false;
   }  
	 var alt_text=form.img_alttext.value!=''?'='+form.img_alttext.value:'';
	 var align=form.img_float[form.img_float.selectedIndex].value;
	 alt_text+=(align!='---'?'|align='+align:'');
	 if(format.start!='' || format.middle!='' || format.end!=''){
    if(format.middle.substring(0,5)=='[img]' && format.middle.substring(format.middle.length-6,format.middle.length)=='[/img]')
     format.middle=format.middle.substring(5,format.middle.length-6);
    else
     format.middle='[img'+alt_text+']'+img_file+'[/img]';
    $('#'+format.textarea_id).val(format.start+format.middle+format.end);
    setTimeout("format.focus();$('#"+format.textarea_id+"')[0].selectionStart="+(format.start_selection+alt_text.length+5)+";"+
    "$('#"+format.textarea_id+"')[0].selectionEnd="+(format.start_selection+format.middle.length-6)+";",10);
   }else{
    $('#'+format.textarea_id).val($('#'+format.textarea_id).val()+'[img'+alt_text+']'+img_file+'[/img]');
    setTimeout("format.focus();$('#"+format.textarea_id+"')[0].selectionStart="+($('#'+format.textarea_id).val().length-img_file.length-6)+";$('#"+format.textarea_id+"')[0].selectionEnd="+($('#'+format.textarea_id).val().length-6),10);
   }
	 tb_remove();
	}
 }
}

Array.prototype.in_array=function(obj){
 var len=this.length;
 for(var x=0;x<=len;x++){
  if(this[x]==obj) return true;
 }
 return false;
}

function toggle_folder(obj,ov){
 if(adding && !ov && 0){
  alert('Sorry, you can\'t toggle folders while adding a new folder.');
  return false;
 }
 if($(obj).parent().children('ul').size()>0){
  $(obj).parent().children('ul').toggle();
	if($(obj).parent().is('.end-branch')||$(obj).parent().is('.end')){
   $(obj).parent().toggleClass('end-branch').toggleClass('end');
	}else{
   $(obj).parent().toggleClass('stub-branch');
   if(add_revert.length>0){$.each(add_revert,function(i,rv_obj){
    if(rv_obj[0][0]==$(obj).parent()[0]){
		 if(rv_obj[2]=='end') rv_obj[2]='end-branch';
		 else rv_obj[2]='end';
		}
   });}
	}
  $(obj).toggleClass('tgl-m').toggleClass('tgl-p');
 }
}

var siteRoot='/aero/';

var adding=false,add_revert=[];
function add_folder_l(obj,url,lst){
 if(adding){
  alert('Sorry, you can only add one folder at a time.');
  return false;
 }
 adding=true;
 $('#cmd').val('newfolder');
 $('#dir').val(url);
 $li=$(obj).parent();
 if($li.children('ul').css('display')=='none')
  toggle_folder($(obj).siblings('.tgl')[0],true);
 var li_html='<li'+($li.children().is('ul')?' id="add_folder"':'')+' class="end"><a href="#" onclick="alert(\'Type in a name for the folder!\');return false;" class="efo" title="Type a name for the folder">&nbsp;</a><input type="text" class="text" name="new_folder" value="" /> <input type="image" src="'+siteRoot+'images/add.png" style="width:16px;height:16px;vertical-align:middle;margin:-3px 0 0 0;" title="Add folder" /><img src="'+siteRoot+'images/delete.png" alt="Cancel" title="Cancel" onclick="add_folder_l_cancel();" style="width:16px;height:16px;vertical-align:middle;margin:-3px 0 0 0;" /></li>';
  
 if($li.children().is('ul')){
  if(lst && $li.children('ul').find('li.end-branch:first').is('li')){
	 $li.find('li.end-branch').each(function(){
	  if($li[0]==this.parentNode.parentNode){
     add_revert[add_revert.length]=[$(this),'stub-branch','end-branch'];
		 $(this).removeClass('end-branch').addClass('stub-branch');
		}
   });
  }else{
	 $li.find('li.end').each(function(){
	  if($li[0]==this.parentNode.parentNode){
     add_revert[add_revert.length]=[$(this),'','end'];
		 $(this).removeClass('end');
		}
	 });
	}
  $li.children('ul:first').append(li_html);
  $li.children('ul:first').find('.text')[0].focus();
 }else{
	if($li.is('.end')){
   $li.removeClass('end');
   add_revert[add_revert.length]=[$li,'','end'];
	}
	if($li.next().is('li')){
   $li.addClass('stub-branch');
	 add_revert[add_revert.length]=[$li,'stub-branch',''];
	}else{
	 $li.addClass('end-branch');
	 add_revert[add_revert.length]=[$li,'end-branch',''];
	}
  $li.append('<ul id="add_folder">'+li_html+'</ul>');
	$li.find('ul li .text')[0].focus();
 }
}
function add_folder_l_cancel(){
 if(adding){
  $('#add_folder').remove();
	for(var a=0;a<add_revert.length;a++){
	 if(add_revert[a][1]!='') $(add_revert[a][0]).removeClass(add_revert[a][1])
	 if(add_revert[a][2]!='') $(add_revert[a][0]).addClass(add_revert[a][2]);
	}
  adding=false;
	add_revert=[];
 }
}

var add_folder_flag=false;
function add_folder(a,dir){
 $('#cmd').val('newfolder');
 $li=$(a).parent().parent();
 if(add_folder_flag){
  $li.next().find('.text')[0].focus();
	return false;
 }
 add_folder_flag=true;
 $li.after('<li class="fl_fldr fl_fldre"><input type="hidden" name="dir" value="'+dir+'/" /><input type="text" class="text" name="new_folder" value="" style="margin-left:2px;" />'+
 '<input type="image" src="'+siteRoot+'images/accept.png" style="width:16px;height:16px;vertical-align:middle;margin:-3px 0 0 0;" title="Save" />'+
 '<img src="'+siteRoot+'images/delete.png" alt="Cancel" title="Cancel" onclick="add_folder_cancel(this);" style="width:16px;height:16px;vertical-align:middle;margin:-3px 0 0 0;cursor:pointer;" /></li>');
 $li.next().find('.text')[0].focus();
}
function add_folder_cancel(a){
 $(a).parent().remove();
 add_folder_flag=false;
}

function delete_file(a,dir,file){
 dir=unescape(dir).replace(/\+/g,' ');
 file=unescape(file).replace(/\+/g,' ');
 if(confirm('Are you sure you want to delete the file \''+dir+'/'+file+'\'?')){
  $('#cmd').val('delete');
	if($('form.folder').length){
   $('form.folder').prepend('<input type="hidden" name="dir" value="'+dir+'" /><input type="hidden" name="file" value="'+file+'" />');
   $('form.folder')[0].submit();
  }else{
   var re=new RegExp('&file='+file);
   $('form.post').attr('action',$('form.post').attr('action').replace(re,'')).prepend('<input type="hidden" name="dir" value="'+dir+'" /><input type="hidden" name="file" value="'+file+'" />');
   return true;
	}
 }
 return false;
}
function delete_folder(a,dir,folder){
 dir=unescape(dir).replace(/\+/g,' ');
 folder=unescape(folder).replace(/\+/g,' ');
 if(confirm('Are you sure you want to delete the folder \''+dir+'/'+folder+'\' and its contents?')){
  $('#cmd').val('delete');
	$('form.folder').prepend('<input type="hidden" name="dir" value="'+dir+'/'+folder+'" /><input type="hidden" name="all" />');
	$('form.folder')[0].submit();
 }
}

function rename_file(a,dir,file){
 dir=unescape(dir).replace(/\+/g,' ');
 file=unescape(file).replace(/\+/g,' ');
 $('#cmd').val('rename');
 $li=$(a).parent().parent();
 if($li.is('.fl_file_alt')) $li.css({'background-color':'#d9cfe5'});
 else $li.css({'background-color':'#ece7f2'});
 $li.prepend('<input type="hidden" name="fi_dir[]" value="'+dir+'" /><input type="hidden" name="fi_file_f[]" value="'+file+'" /><input type="text" class="text" name="fi_file_t[]" value="'+file+'" />'+
 '<input type="image" src="'+siteRoot+'images/accept.png" style="width:16px;height:16px;vertical-align:middle;margin:-3px 0 0 0;" title="Save" />'+
 '<img src="'+siteRoot+'images/delete.png" alt="Cancel" title="Cancel" onclick="rename_file_cancel(this,\''+file+'\');" style="width:16px;height:16px;vertical-align:middle;margin:-3px 0 0 0;cursor:pointer;" />');
 if($li.find('a:contains("'+file+'")').width()>200)
  $li.find('.text').width($li.find('a:contains("'+file+'")').width()+10);
 $li.find('a:contains("'+file+'")').html('&nbsp;');
 $li.find('.text')[0].focus();
}
function rename_file_cancel(a,file){
 $li.css({'background-color':''});
 $('#cmd').val('');
 $li=$(a).parent();
 $li.find('.text').siblings('input:image,img').remove().end().remove();
 $li.find('a:first').html(file);
}

function rename_folder(a,dir,folder){
 dir=unescape(dir).replace(/\+/g,' ');
 folder=unescape(folder).replace(/\+/g,' ');
 $('#cmd').val('rename');
 $li=$(a).parent().parent();
 if($li.is('.fl_fldr_alt')) $li.css({'background-color':'#d9cfe5'});
 else $li.css({'background-color':'#ece7f2'});
 $li.prepend('<input type="hidden" name="fo_dir[]" value="'+dir+'" /><input type="hidden" name="fo_folder_f[]" value="'+folder+'" /><input type="text" class="text" name="fo_folder_t[]" value="'+folder+'" style="margin-left:2px;" />'+
 '<input type="image" src="'+siteRoot+'images/accept.png" style="width:16px;height:16px;vertical-align:middle;margin:-3px 0 0 0;" title="Save" />'+
 '<img src="'+siteRoot+'images/delete.png" alt="Cancel" title="Cancel" onclick="rename_file_cancel(this,\''+folder+'\');" style="width:16px;height:16px;vertical-align:middle;margin:-3px 0 0 0;cursor:pointer;" />');
 if($li.find('a:contains("'+folder+'")').width()>200)
  $li.find('.text').width($li.find('a:contains("'+folder+'")').width()+10);
 $li.find('a:contains("'+folder+'")').html('&nbsp;');
 $li.find('.text')[0].focus();
}
function rename_folder_cancel(a,folder){
 $li.css({'background-color':''});
 $('#cmd').val('');
 $li=$(a).parent();
 $li.find('.text').siblings('input:image,img').remove().end().remove();
 $li.find('a:first').html(folder);
}

var typeahead={
 defaultText:'Start typing a username',
 noMatchesText:'No matches found',
 fillInput:false,
 limit:6,
 matchCase:false,
 // Do not modify below here -->
 filter:'',
 query:'',
 queryLength:0,
 lastKeyCode:0,
 matchNumber:0,
 hoverNumber:0,
 chosen:'',
 found:false,
 foundItems:new Array,
 foundItemsIndex:new Array,
 list:new Array,
 containerObj:new Object,
 formInput:new Object,
 defaultObj:new Object,
 func:new Function,
 defaultObjOn:false,
 listObj:new Object,
 listObjOn:false,
 noMatchesObj:new Object,
 noMatchesObjOn:false,
 
 init:function(formInput,list,filter,func){
  if(document.all || !formInput || !list){
	 return false;
	}
  this.formInput=formInput;
  this.list=list;
	this.filter=filter;
	if(typeof func=='function'){
	 this.func=func;
	}

	this.defaultObj=document.createElement('span');
	this.defaultObj.setAttribute('id','default-text');
	this.defaultObj.appendChild(document.createTextNode(typeahead.defaultText));

	this.containerObj=document.createElement('div');
	this.containerObj.setAttribute('id','ta-container');
	this.containerObj.style.display='none';
	this.containerObj.appendChild(this.defaultObj);
	this.defaultObjOn=true;
	if(document.all){
	 document.write(this.containerObj.outerHTML);
	 this.containerObj=document.getElementById('ta-container');
	}else{
	 document.body.appendChild(this.containerObj);
	}
	
	this.listObj=document.createElement('ul');
	this.listObj.setAttribute('id','ta-list');
	
	this.noMatchesObj=document.createElement('span');
	this.noMatchesObj.setAttribute('id','nomatches-text');
	this.noMatchesObj.appendChild(document.createTextNode(typeahead.noMatchesText));

	// Form input stuff
	formInput.onfocus=function(){
	 if(this.value==typeahead.defaultText){
	  this.value='';
	 }
	 this.select();
	 typeahead.containerObj.style.display='block';
	}
	formInput.onblur=function(){
	 if(this.value==''){
	  if(typeahead.fillInput){this.value=typeahead.defaultText;}
	 }
	 typeahead.containerObj.style.display='none';
	 typeahead.selectMatch();
	}
  formInput.onkeydown=function(event){
   if(!event && window.event){event=window.event;}
   if(event){this.lastKeyCode=event.keyCode;}
   switch(this.lastKeyCode){
    case 38: break;
    case 40: break;
    case 27: this.value=''; break;
    case 13: case 9: typeahead.selectMatch(); break;
    case 3: break;	
   }
   switch(this.lastKeyCode){
    case 38: typeahead.selectPrev(); break;
	  case 40: typeahead.selectNext(); break;
   }
   if(event && (this.lastKeyCode==13 || this.lastKeyCode==38 || this.lastKeyCode==40)){
    event.cancelBubble=true;
    event.returnValue=false;
	  return false;
   }
  }
  formInput.onkeypress=function(event){
   if(event && (this.lastKeyCode==13 || this.lastKeyCode==38 || this.lastKeyCode==40)){
    event.cancelBubble=true;
    event.returnValue=false;
	  return false;
   }
  }
	formInput.onkeyup=function(){
	 if(this.lastKeyCode==13 || this.lastKeyCode==38 || this.lastKeyCode==40){
	  return false;
	 }
	 if(this.value!=''){
	  typeahead.matchit(this.value);
	 }else{
	  typeahead.showDefault();
	 }
	}
	// Initialise input
	if(formInput.value!=''){
	 this.matchit(formInput.value);
	 if(this.chosen==formInput.value){this.hide();}
	}else if(this.fillInput){
	 formInput.value=this.defaultText;
	}
 },
 loaded:function(){
	$('#ta-container').css({'display':'block','left':(elementX(this.formInput))+'px','top':(elementY(this.formInput)+this.formInput.offsetHeight)+'px'});
 },
 matchit:function(query){
  if(!this.matchCase){
	 query=query.toLowerCase();
	}
  if(this.chosen!=query){
	 this.chosen='';
	 this.show();
	}else{
	 return false;
	}
  this.query=query;
	this.queryLength=query.length;
  this.found=false;
	this.foundItemsIndex=[];
  for(i=0;i<this.list.length;i++){
	 if( (!this.matchCase && eval('typeahead.list['+i+'].'+this.filter).substring(0,this.queryLength).toLowerCase()==query) ||
	     (this.matchCase && eval('typeahead.list['+i+'].'+this.filter).substring(0,this.queryLength)==query) 
	    ){
	  // Found something..
		this.found=true;
		this.foundItemsIndex[this.foundItemsIndex.length]=i;
		if( (!this.matchCase && eval('typeahead.list['+i+'].'+this.filter).toLowerCase()==query) ||
	      (this.matchCase && eval('typeahead.list['+i+'].'+this.filter)==query) 
	     ){
		 typeahead.matchNumber=this.foundItemsIndex.length-1;
     this.selectMatch();
		 //return false;
		}
	 }else{
	  // No match	
	 }
	}
	this.removeMatches();
	if(this.found){
	 this.showMatches();
	}else{
	 this.showNoMatches();
	}
 },
 showMatches:function(){
  this.matchNumber=0;
  for(m=0;m<this.foundItemsIndex.length && m<this.limit;m++){
	 this.foundItems[m]=document.createElement('LI');
	 this.foundItems[m].setAttribute('number',m);
	 this.foundItems[m].setAttribute('class',(!m?'selected':''));
	 // Grab the matched data
	 var data=eval('typeahead.list['+this.foundItemsIndex[m]+'].'+this.filter);
	 // Split out the matched bit
	 data_match=document.createElement('SPAN');
	 data_match.setAttribute('class','partial-match');
	 data_match.appendChild(document.createTextNode(data.substring(0,this.queryLength)));
	 this.foundItems[m].appendChild(data_match);
	 // ..and the not matched end bit
	 data_end=data.substring(this.queryLength,data.length);
	 this.foundItems[m].appendChild(document.createTextNode(data_end));
	 // add mouse functions
	 this.foundItems[m].onmouseover=function(){
    typeahead.foundItems[typeahead.matchNumber].className='';
		typeahead.matchNumber=this.getAttribute('number');
    this.className='selected';
	 }
	 this.foundItems[m].onmousedown=function(){
	  typeahead.matchNumber=this.getAttribute('number');
		typeahead.selectMatch();
	 }
	 // append to list
	 this.listObj.appendChild(this.foundItems[m]);
	}
  if(this.noMatchesObjOn){this.containerObj.removeChild(this.noMatchesObj);this.noMatchesObjOn=false;}
	if(this.defaultObjOn){this.containerObj.removeChild(this.defaultObj);this.defaultObjOn=false;}
  if(!this.listObjOn){this.containerObj.appendChild(this.listObj);}
	this.listObjOn=true;
	if(this.chosen!=this.query){this.formInput.className=this.formInput.className.replace(' chosen','');}
	this.func();
 },
 removeMatches:function(){
  for(r=0;r<this.foundItems.length;r++){
	 this.listObj.removeChild(this.foundItems[r]);
	}
	this.foundItems=[];
	this.matchNumber=-1;
 },
 showNoMatches:function(){
  if(this.listObjOn){this.containerObj.removeChild(this.listObj);this.listObjOn=false;}
	if(this.defaultObjOn){this.containerObj.removeChild(this.defaultObj);this.defaultObjOn=false;}
  if(!this.noMatchesObjOn){this.containerObj.appendChild(this.noMatchesObj);}
	this.noMatchesObjOn=true;
	this.formInput.className=this.formInput.className.replace(' chosen','');
	this.func();
 },
 showDefault:function(){
  if(this.listObjOn){this.containerObj.removeChild(this.listObj);this.listObjOn=false;}
  if(this.noMatchesObjOn){this.containerObj.removeChild(this.noMatchesObj);this.noMatchesObjOn=false;}
  if(!this.defaultObjOn){this.containerObj.appendChild(this.defaultObj);}
	this.defaultObjOn=true;
	this.formInput.className=this.formInput.className.replace(' chosen','');
 },
 selectMatch:function(){
  if(this.formInput.value=='' || this.matchNumber<0){return false;}
  this.formInput.value=eval('typeahead.list['+this.foundItemsIndex[this.matchNumber]+'].'+this.filter);
  this.formInput.className+=' chosen';
  this.chosen=this.formInput.value;
  this.hide();
  this.formInput.focus();
	this.func();
 },
 selectPrev:function(){
  if(typeahead.foundItems.length>0 && typeahead.matchNumber>0){
   typeahead.foundItems[typeahead.matchNumber--].className='';
   typeahead.foundItems[typeahead.matchNumber].className='selected';
	}
	this.func();
 },
 selectNext:function(){
  if(typeahead.foundItems.length>0 && typeahead.matchNumber<typeahead.foundItems.length-1){
   //alert(typeahead.foundItems[typeahead.matchNumber].className);
   typeahead.foundItems[typeahead.matchNumber++].setAttribute('class','');
   typeahead.foundItems[typeahead.matchNumber].setAttribute('class','selected');
	}
	this.func();
 },
 show:function(){this.containerObj.style.display='block';},
 hide:function(){this.containerObj.style.display='none';}
}
function elementX(obj){var curleft=0;if(obj.offsetParent){while(obj.offsetParent){curleft+=obj.offsetLeft;obj=obj.offsetParent;}}else if(obj.x){curleft+=obj.x;}return curleft;}
function elementY(obj){var curtop=0;if(obj.offsetParent){while(obj.offsetParent){curtop+=obj.offsetTop;obj=obj.offsetParent;}}else if(obj.y){curtop+=obj.y;}return curtop;}
jQuery.extend({

    createUploadIframe: function(id, uri)
	{
			//create frame
            var frameId = 'jUploadFrame' + id;
            
            if(window.ActiveXObject) {
                var io = document.createElement('<iframe id="' + frameId + '" name="' + frameId + '" />');
                if(typeof uri== 'boolean'){
                    io.src = 'javascript:false';
                }
                else if(typeof uri== 'string'){
                    io.src = uri;
                }
            }
            else {
                var io = document.createElement('iframe');
                io.id = frameId;
                io.name = frameId;
            }
            io.style.position = 'absolute';
            io.style.top = '-1000px';
            io.style.left = '-1000px';

            document.body.appendChild(io);

            return io			
    },
    createUploadForm: function(id, fileElementId)
	{
		//create form	
		var formId = 'jUploadForm' + id;
		var fileId = 'jUploadFile' + id;
		var form = $('<form  action="" method="POST" name="' + formId + '" id="' + formId + '" enctype="multipart/form-data"></form>');	
		var oldElement = $('#' + fileElementId);
		var newElement = $(oldElement).clone();
		$(oldElement).attr('id', fileId);
		$(oldElement).before(newElement);
		$(oldElement).appendTo(form);
		//set attributes
		$(form).css('position', 'absolute');
		$(form).css('top', '-1200px');
		$(form).css('left', '-1200px');
		$(form).appendTo('body');		
		return form;
    },

    ajaxFileUpload: function(s) {
        // TODO introduce global settings, allowing the client to modify them for all requests, not only timeout		
        s = jQuery.extend({}, jQuery.ajaxSettings, s);
        var id = new Date().getTime()        
		var form = jQuery.createUploadForm(id, s.fileElementId);
		var io = jQuery.createUploadIframe(id, s.secureuri);
		var frameId = 'jUploadFrame' + id;
		var formId = 'jUploadForm' + id;		
        // Watch for a new set of requests
        if ( s.global && ! jQuery.active++ )
		{
			jQuery.event.trigger( "ajaxStart" );
		}            
        var requestDone = false;
        // Create the request object
        var xml = {}   
        if ( s.global )
            jQuery.event.trigger("ajaxSend", [xml, s]);
        // Wait for a response to come back
        var uploadCallback = function(isTimeout)
		{			
			var io = document.getElementById(frameId);
            try 
			{				
				if(io.contentWindow)
				{
					 xml.responseText = io.contentWindow.document.body?io.contentWindow.document.body.innerHTML:null;
                	 xml.responseXML = io.contentWindow.document.XMLDocument?io.contentWindow.document.XMLDocument:io.contentWindow.document;
					 
				}else if(io.contentDocument)
				{
					 xml.responseText = io.contentDocument.document.body?io.contentDocument.document.body.innerHTML:null;
                	xml.responseXML = io.contentDocument.document.XMLDocument?io.contentDocument.document.XMLDocument:io.contentDocument.document;
				}						
            }catch(e)
			{
				jQuery.handleError(s, xml, null, e);
			}
            if ( xml || isTimeout == "timeout") 
			{				
                requestDone = true;
                var status;
                try {
                    status = isTimeout != "timeout" ? "success" : "error";
                    // Make sure that the request was successful or notmodified
                    if ( status != "error" )
					{
                        // process the data (runs the xml through httpData regardless of callback)
                        var data = jQuery.uploadHttpData( xml, s.dataType );    
                        // If a local callback was specified, fire it and pass it the data
                        if ( s.success )
                            s.success( data, status );
    
                        // Fire the global callback
                        if( s.global )
                            jQuery.event.trigger( "ajaxSuccess", [xml, s] );
                    } else
                        jQuery.handleError(s, xml, status);
                } catch(e) 
				{
                    status = "error";
                    jQuery.handleError(s, xml, status, e);
                }

                // The request was completed
                if( s.global )
                    jQuery.event.trigger( "ajaxComplete", [xml, s] );

                // Handle the global AJAX counter
                if ( s.global && ! --jQuery.active )
                    jQuery.event.trigger( "ajaxStop" );

                // Process result
                if ( s.complete )
                    s.complete(xml, status);

                jQuery(io).unbind()

                setTimeout(function()
									{	try 
										{
											$(io).remove();
											$(form).remove();	
											
										} catch(e) 
										{
											jQuery.handleError(s, xml, null, e);
										}									

									}, 100)

                xml = null

            }
        }
        // Timeout checker
        if ( s.timeout > 0 ) 
		{
            setTimeout(function(){
                // Check to see if the request is still happening
                if( !requestDone ) uploadCallback( "timeout" );
            }, s.timeout);
        }
        try 
		{
           // var io = $('#' + frameId);
			var form = $('#' + formId);
			$(form).attr('action', s.url);
			$(form).attr('method', 'POST');
			$(form).attr('target', frameId);
            if(form.encoding)
			{
                form.encoding = 'multipart/form-data';				
            }
            else
			{				
                form.enctype = 'multipart/form-data';
            }			
            $(form).submit();

        } catch(e) 
		{			
            jQuery.handleError(s, xml, null, e);
        }
        if(window.attachEvent){
            document.getElementById(frameId).attachEvent('onload', uploadCallback);
        }
        else{
            document.getElementById(frameId).addEventListener('load', uploadCallback, false);
        } 		
        return {abort: function () {}};	

    },

    uploadHttpData: function( r, type ) {
        var data = !type;
        data = type == "xml" || data ? r.responseXML : r.responseText;
        // If the type is "script", eval it in global context
        if ( type == "script" )
            jQuery.globalEval( data );
        // Get the JavaScript object, if JSON is used.
        if ( type == "json" )
            eval( "data = " + data );
        // evaluate scripts within html
        if ( type == "html" )
            jQuery("<div>").html(data).evalScripts();
			//alert($('param', data).each(function(){alert($(this).attr('value'));}));
        return data;
    }
})

/*=:project
    scalable Inman Flash Replacement (sIFR) version 3, revision 278

  =:file
    Copyright: 2006 Mark Wubben.
    Author: Mark Wubben, <http://novemberborn.net/>

  =:history
    * IFR: Shaun Inman
    * sIFR 1: Mike Davidson, Shaun Inman and Tomas Jogin
    * sIFR 2: Mike Davidson, Shaun Inman, Tomas Jogin and Mark Wubben

  =:license
    This software is licensed and provided under the CC-GNU LGPL.
    See <http://creativecommons.org/licenses/LGPL/2.1/>    
*/

var parseSelector=(function(){var _1=/\s*,\s*/;var _2=/\s*([\s>+~(),]|^|$)\s*/g;var _3=/([\s>+~,]|[^(]\+|^)([#.:@])/g;var _4=/^[^\s>+~]/;var _5=/[\s#.:>+~()@]|[^\s#.:>+~()@]+/g;function parseSelector(_6,_7){_7=_7||document.documentElement;var _8=_6.split(_1),_9=[];for(var i=0;i<_8.length;i++){var _b=[_7],_c=toStream(_8[i]);for(var j=0;j<_c.length;){var _e=_c[j++],_f=_c[j++],_10="";if(_c[j]=="("){while(_c[j++]!=")"&&j<_c.length){_10+=_c[j]}_10=_10.slice(0,-1)}_b=select(_b,_e,_f,_10)}_9=_9.concat(_b)}return _9}function toStream(_11){var _12=_11.replace(_2,"$1").replace(_3,"$1*$2");if(_4.test(_12)){_12=" "+_12}return _12.match(_5)||[]}function select(_13,_14,_15,_16){return (_17[_14])?_17[_14](_13,_15,_16):[]}var _18={toArray:function(_19){var a=[];for(var i=0;i<_19.length;i++){a.push(_19[i])}return a}};var dom={isTag:function(_1d,tag){return (tag=="*")||(tag.toLowerCase()==_1d.nodeName.toLowerCase())},previousSiblingElement:function(_1f){do{_1f=_1f.previousSibling}while(_1f&&_1f.nodeType!=1);return _1f},nextSiblingElement:function(_20){do{_20=_20.nextSibling}while(_20&&_20.nodeType!=1);return _20},hasClass:function(_21,_22){return (_22.className||"").match("(^|\\s)"+_21+"(\\s|$)")},getByTag:function(tag,_24){return _24.getElementsByTagName(tag)}};var _17={"#":function(_25,_26){for(var i=0;i<_25.length;i++){if(_25[i].getAttribute("id")==_26){return [_25[i]]}}return []}," ":function(_28,_29){var _2a=[];for(var i=0;i<_28.length;i++){_2a=_2a.concat(_18.toArray(dom.getByTag(_29,_28[i])))}return _2a},">":function(_2c,_2d){var _2e=[];for(var i=0,_30;i<_2c.length;i++){_30=_2c[i];for(var j=0,_32;j<_30.childNodes.length;j++){_32=_30.childNodes[j];if(_32.nodeType==1&&dom.isTag(_32,_2d)){_2e.push(_32)}}}return _2e},".":function(_33,_34){var _35=[];for(var i=0,_37;i<_33.length;i++){_37=_33[i];if(dom.hasClass([_34],_37)){_35.push(_37)}}return _35},":":function(_38,_39,_3a){return (pseudoClasses[_39])?pseudoClasses[_39](_38,_3a):[]}};parseSelector.selectors=_17;parseSelector.pseudoClasses={};parseSelector.util=_18;parseSelector.dom=dom;return parseSelector})();
var sIFR=new function(){var _3b=this;var _3c="sIFR-active";var _3d="sIFR-replaced";var _3e="sIFR-replacing";var _3f="sIFR-flash";var _40="sIFR-ignore";var _41="sIFR-alternate";var _42="sIFR-class";var _43="sIFR-layout";var _44=6;var _45=126;var _46=8;var _47="SIFR-PREFETCHED";var _48=[];var _49=5;this.isActive=false;this.isEnabled=true;this.hideElements=true;this.preserveSingleWhitespace=false;this.fixWrap=true;this.fixHover=true;this.registerEvents=true;this.setPrefetchCookie=true;this.cookiePath="/";this.domains=[];this.fromLocal=false;this.forceClear=false;this.forceWidth=false;this.fitExactly=false;this.forceTextTransform=true;this.useDomContentLoaded=true;this.hasFlashClassSet=false;this.delayCss=false;this.callbacks=[];var _4a=0;var _4b=false,_4c=false;var dom=new function(){var _4e="http://www.w3.org/1999/xhtml";this.getBody=function(){var _4f=document.getElementsByTagName("body");if(_4f.length==1){return _4f[0]}return null};this.addClass=function(_50,_51){if(_51){_51.className=((_51.className||"")==""?"":_51.className+" ")+_50}};this.removeClass=function(_52,_53){if(_53){_53.className=_53.className.replace(new RegExp("(^|\\s)"+_52+"(\\s|$)"),"").replace(/^\s+|(\s)\s+/g,"$1")}};this.hasClass=function(_54,_55){return new RegExp("(^|\\s)"+_54+"(\\s|$)").test(_55.className)};this.hasOneOfClassses=function(_56,_57){for(var i=0;i<_56.length;i++){if(this.hasClass(_56[i],_57)){return true}}return false};this.create=function(_59){if(document.createElementNS){return document.createElementNS(_4e,_59)}return document.createElement(_59)};this.setInnerHtml=function(_5a,_5b){if(ua.innerHtmlSupport){_5a.innerHTML=_5b}else{if(ua.xhtmlSupport){_5b=["<root xmlns=\"",_4e,"\">",_5b,"</root>"].join("");var xml=(new DOMParser()).parseFromString(_5b,"text/xml");xml=document.importNode(xml.documentElement,true);while(_5a.firstChild){_5a.removeChild(_5a.firstChild)}while(xml.firstChild){_5a.appendChild(xml.firstChild)}}}};this.nodeFromHtml=function(_5d){var _5e=this.create("div");_5e.innerHTML=_5d;return _5e.firstChild};this.getComputedStyle=function(_5f,_60){var _61;if(document.defaultView&&document.defaultView.getComputedStyle){_61=document.defaultView.getComputedStyle(_5f,null)[_60]}else{if(_5f.currentStyle){_61=_5f.currentStyle[_60]}}return _61||""};this.getStyleAsInt=function(_62,_63,_64){var _65=this.getComputedStyle(_62,_63);if(_64&&!/px$/.test(_65)){return 0}_65=parseInt(_65);return isNaN(_65)?0:_65};this.getZoom=function(){return _66.zoom.getLatest()}};this.dom=dom;var ua=new function(){var ua=navigator.userAgent.toLowerCase();var _69=(navigator.product||"").toLowerCase();this.macintosh=ua.indexOf("mac")>-1;this.windows=ua.indexOf("windows")>-1;this.quicktime=false;this.opera=ua.indexOf("opera")>-1;this.konqueror=_69.indexOf("konqueror")>-1;this.ie=false/*@cc_on || true @*/;this.ieSupported=this.ie&&!/ppc|smartphone|iemobile|msie\s5\.5/.test(ua)/*@cc_on && @_jscript_version >= 5.5 @*/;this.ieWin=this.ie&&this.windows/*@cc_on && @_jscript_version >= 5.1 @*/;this.windows=this.windows&&(!this.ie||this.ieWin);this.ieMac=this.ie&&this.macintosh/*@cc_on && @_jscript_version < 5.1 @*/;this.macintosh=this.macintosh&&(!this.ie||this.ieMac);this.safari=ua.indexOf("safari")>-1;this.webkit=ua.indexOf("applewebkit")>-1&&!this.konqueror;this.khtml=this.webkit||this.konqueror;this.gecko=!this.webkit&&_69=="gecko";this.operaVersion=this.opera&&/.*opera(\s|\/)(\d+\.\d+)/.exec(ua)?parseInt(RegExp.$2):0;this.webkitVersion=this.webkit&&/.*applewebkit\/(\d+).*/.exec(ua)?parseInt(RegExp.$1):0;this.geckoBuildDate=this.gecko&&/.*gecko\/(\d{8}).*/.exec(ua)?parseInt(RegExp.$1):0;this.konquerorVersion=this.konqueror&&/.*konqueror\/(\d\.\d).*/.exec(ua)?parseInt(RegExp.$1):0;this.flashVersion=0;if(this.ieWin){var axo;var _6b=false;try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(e){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");this.flashVersion=6;axo.AllowScriptAccess="always"}catch(e){_6b=this.flashVersion==6}if(!_6b){try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(e){}}}if(!_6b&&axo){this.flashVersion=parseFloat(/([\d,?]+)/.exec(axo.GetVariable("$version"))[1].replace(/,/g,"."))}}else{if(navigator.plugins&&navigator.plugins["Shockwave Flash"]){var _6c=navigator.plugins["Shockwave Flash"];this.flashVersion=parseFloat(/(\d+\.?\d*)/.exec(_6c.description)[1]);var i=0;while(this.flashVersion>=_46&&i<navigator.mimeTypes.length){var _6e=navigator.mimeTypes[i];if(_6e.type=="application/x-shockwave-flash"&&_6e.enabledPlugin.description.toLowerCase().indexOf("quicktime")>-1){this.flashVersion=0;this.quicktime=true}i++}}}this.flash=this.flashVersion>=_46;this.transparencySupport=this.macintosh||this.windows;this.computedStyleSupport=this.ie||document.defaultView&&document.defaultView.getComputedStyle&&(!this.gecko||this.geckoBuildDate>=20030624);this.css=true;if(this.computedStyleSupport){try{var _6f=document.getElementsByTagName("head")[0];_6f.style.backgroundColor="#FF0000";var _70=dom.getComputedStyle(_6f,"backgroundColor");this.css=!_70||/\#F{2}0{4}|rgb\(255,\s?0,\s?0\)/i.test(_70);_6f.style.backgroundColor="";_6f=null}catch(e){}}this.xhtmlSupport=!!window.DOMParser&&!!document.importNode;try{var n=dom.create("span");if(!this.ieMac){n.innerHTML="x"}this.innerHtmlSupport=n.innerHTML=="x"}catch(e){this.innerHtmlSupport=false}this.zoomSupport=!!(this.opera&&document.documentElement);this.geckoXml=this.gecko&&(document.contentType||"").indexOf("xml")>-1;this.requiresPrefetch=this.ieWin||this.khtml;this.verifiedKonqueror=false;this.supported=this.flash&&this.css&&(!this.ie||this.ieSupported)&&(!this.opera||this.operaVersion>=8)&&(!this.webkit||this.webkitVersion>=412)&&(!this.konqueror||this.konquerorVersion>3.5)&&this.computedStyleSupport&&(this.innerHtmlSupport||!this.khtml&&this.xhtmlSupport)&&(!this.gecko||this.geckoBuildDate>20040804)};this.ua=ua;var _72=new function(){var _73={leading:true,"margin-left":true,"margin-right":true,"text-indent":true};var _74=" ";function capitalize($){return $.toUpperCase()}this.normalize=function(str){if(_3b.preserveSingleWhitespace){return str.replace(/\s/g,_74)}return str.replace(/(\s)\s+/g,"$1").replace(/\xA0/,_74)};this.textTransform=function(_77,str){switch(_77){case "uppercase":str=str.toUpperCase();break;case "lowercase":str=str.toLowerCase();break;case "capitalize":var _79=str;str=str.replace(/^\w|\s\w/g,capitalize);if(str.indexOf("function capitalize")!=-1){var _7a=_79.replace(/(^|\s)(\w)/g,"$1$1$2$2").split(/^\w|\s\w/g);str="";for(var i=0;i<_7a.length;i++){str+=_7a[i].charAt(0).toUpperCase()+_7a[i].substring(1)}}break}return str};this.toHexString=function(str){if(typeof (str)!="string"||!str.charAt(0)=="#"||str.length!=4&&str.length!=7){return str}str=str.replace(/#/,"");if(str.length==3){str=str.replace(/(.)(.)(.)/,"$1$1$2$2$3$3")}return "0x"+str};this.toJson=function(obj){var _7e="";switch(typeof (obj)){case "string":_7e="\""+obj+"\"";break;case "number":case "boolean":_7e=obj.toString();break;case "object":_7e=[];for(var _7f in obj){if(obj[_7f]==Object.prototype[_7f]){continue}_7e.push("\""+_7f+"\":"+_72.toJson(obj[_7f]))}_7e="{"+_7e.join(",")+"}";break}return _7e};this.convertCssArg=function(arg){if(!arg){return {}}if(typeof (arg)=="object"){if(arg.constructor==Array){arg=arg.join("")}else{return arg}}var obj={};var _82=arg.split("}");for(var i=0;i<_82.length;i++){var $=_82[i].match(/([^\s{]+)\s*\{(.+)\s*;?\s*/);if(!$||$.length!=3){continue}if(!obj[$[1]]){obj[$[1]]={}}var _85=$[2].split(";");for(var j=0;j<_85.length;j++){var $2=_85[j].match(/\s*([^:\s]+)\s*\:\s*([^\s;]+)/);if(!$2||$2.length!=3){continue}obj[$[1]][$2[1]]=$2[2]}}return obj};this.extractFromCss=function(css,_89,_8a,_8b){var _8c=null;if(css&&css[_89]&&css[_89][_8a]){_8c=css[_89][_8a];if(_8b){delete css[_89][_8a]}}return _8c};this.cssToString=function(arg){var css=[];for(var _8f in arg){var _90=arg[_8f];if(_90==Object.prototype[_8f]){continue}css.push(_8f,"{");for(var _91 in _90){if(_90[_91]==Object.prototype[_91]){continue}var _92=_90[_91];if(_73[_91]){_92=parseInt(_92,10)}css.push(_91,":",_92,";")}css.push("}")}return css.join("")};this.bind=function(_93,_94){return function(){_93[_94].apply(_93,arguments)}};this.escape=function(str){return escape(str).replace(/\+/,"%2B")}};this.util=_72;var _66={};_66.fragmentIdentifier=new function(){this.fix=true;var _96;this.cache=function(){_96=document.title};function doFix(){document.title=_96}this.restore=function(){if(this.fix){setTimeout(doFix,0)}}};_66.synchronizer=new function(){this.isBlocked=false;this.block=function(){this.isBlocked=true};this.unblock=function(){this.isBlocked=false;_97.replaceAll()}};_66.zoom=new function(){var _98=100;this.getLatest=function(){return _98};if(ua.zoomSupport&&ua.opera){var _99=document.createElement("div");_99.style.position="fixed";_99.style.left="-65536px";_99.style.top="0";_99.style.height="100%";_99.style.width="1px";_99.style.zIndex="-32";document.documentElement.appendChild(_99);function updateZoom(){if(!_99){return}var _9a=window.innerHeight/_99.offsetHeight;var _9b=Math.round(_9a*100)%10;if(_9b>5){_9a=Math.round(_9a*100)+10-_9b}else{_9a=Math.round(_9a*100)-_9b}_98=isNaN(_9a)?100:_9a;_66.synchronizer.unblock();document.documentElement.removeChild(_99);_99=null}_66.synchronizer.block();setTimeout(updateZoom,54)}};this.hacks=_66;this.errors={};var _9c={kwargs:[],replaceAll:function(_9d){for(var i=0;i<this.kwargs.length;i++){_3b.replace(this.kwargs[i])}if(!_9d){this.kwargs=[]}}};var _97={kwargs:[],replaceAll:_9c.replaceAll};function isValidDomain(){if(_3b.domains.length==0){return true}var _9f="";try{_9f=document.domain}catch(e){}for(var i=0;i<_3b.domains.length;i++){var _a1=_3b.domains[i];if(_a1=="*"||_a1==_9f){return true}var _a2=_a1.lastIndexOf("*");if(_a2>-1){_a1=_a1.substr(_a2+1);var _a3=_9f.lastIndexOf(_a1);if(_a3>-1&&(_a3+_a1.length)==_9f.length){return true}}}return false}function isFile(){if(!_3b.fromLocal&&document.location.protocol=="file:"){if(_3b.debug){throw new Error(_3b.errors.isFile)}return true}return false}this.activate=function(){if(!ua.supported||!this.isEnabled||this.isActive||!isValidDomain()||isFile()){return}if(arguments.length>0){this.prefetch.apply(this,arguments)}this.isActive=true;if(this.hideElements){this.setFlashClass()}if(ua.ieWin&&_66.fragmentIdentifier.fix&&window.location.hash!=""){_66.fragmentIdentifier.cache()}else{_66.fragmentIdentifier.fix=false}if(!this.registerEvents){return}function handler(evt,_a5){_3b.initialize(_a5);if(evt&&evt.type=="load"){if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",handler,false)}if(window.removeEventListener){window.removeEventListener("load",handler,false)}}}if(window.addEventListener){if(_3b.useDomContentLoaded&&ua.gecko){document.addEventListener("DOMContentLoaded",handler,false)}window.addEventListener("load",handler,false)}else{if(ua.ieWin){if(_3b.useDomContentLoaded){document.write("<scr"+"ipt id=__sifr_ie_onload defer src=//:></script>");document.getElementById("__sifr_ie_onload").onreadystatechange=function(){if(this.readyState=="complete"){handler(null,true);this.removeNode()}}}window.attachEvent("onload",handler)}}};this.setFlashClass=function(){if(this.hasFlashClassSet){return}dom.addClass(_3c,dom.getBody()||document.documentElement);this.hasFlashClassSet=true};this.removeFlashClass=function(){if(!this.hasFlashClassSet){return}dom.removeClass(_3c,dom.getBody());dom.removeClass(_3c,document.documentElement);this.hasFlashClassSet=false};this.initialize=function(_a6){if(!this.isActive||!this.isEnabled){return}if(_4c){if(!_a6){_9c.replaceAll(false)}return}_4c=true;_9c.replaceAll(_a6);clearPrefetch()};function getSource(src){if(typeof (src)!="string"){if(src.src){src=src.src}if(typeof (src)!="string"){var _a8=[];for(var _a9 in src){if(src[_a9]!=Object.prototype[_a9]){_a8.push(_a9)}}_a8.sort().reverse();var _aa="";var i=-1;while(!_aa&&++i<_a8.length){if(parseFloat(_a8[i])<=ua.flashVersion){_aa=src[_a8[i]]}}src=_aa}}if(!src&&_3b.debug){throw new Error(_3b.errors.getSource)}if(ua.ie&&src.charAt(0)=="/"){src=window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/,"$1$2$3")+src}return src}this.prefetch=function(){if((!ua.requiresPrefetch&&!this.isActive)||!ua.supported||!this.isEnabled||!isValidDomain()){return}if(this.setPrefetchCookie&&new RegExp(";?"+_47+"=true;?").test(document.cookie)){return}try{_4b=true;if(ua.ieWin){prefetchIexplore(arguments)}else{prefetchLight(arguments)}if(this.setPrefetchCookie){document.cookie=_47+"=true;path="+this.cookiePath}}catch(e){if(_3b.debug){throw e}}};function prefetchIexplore(_ac){for(var i=0;i<_ac.length;i++){document.write("<script defer type=\"sifr/prefetch\" src=\""+getSource(_ac[i])+"\"></script>")}}function prefetchLight(_ae){for(var i=0;i<_ae.length;i++){new Image().src=getSource(_ae[i])}}function clearPrefetch(){if(!ua.ieWin||!_4b){return}try{var _b0=document.getElementsByTagName("script");for(var i=_b0.length-1;i>=0;i--){var _b2=_b0[i];if(_b2.type=="sifr/prefetch"){_b2.parentNode.removeChild(_b2)}}}catch(e){}}function getRatio(_b3,_b4){for(var i=0;i<_b4.length;i+=2){if(_b3<=_b4[i]){return _b4[i+1]}}return _b4[_b4.length-1]||1}function getFilters(obj){var _b7=[];for(var _b8 in obj){if(obj[_b8]==Object.prototype[_b8]){continue}var _b9=obj[_b8];_b8=[_b8.replace(/filter/i,"")+"Filter"];for(var _ba in _b9){if(_b9[_ba]==Object.prototype[_ba]){continue}_b8.push(_ba+":"+_72.escape(_72.toJson(_72.toHexString(_b9[_ba]))))}_b7.push(_b8.join(","))}return _72.escape(_b7.join(";"))}function calculate(_bb){var _bc,_bd;if(!ua.ie){_bc=dom.getStyleAsInt(_bb,"lineHeight");_bd=Math.floor(dom.getStyleAsInt(_bb,"height")/_bc)}else{if(ua.ie){var _be=_bb.innerHTML;_bb.style.visibility="visible";_bb.style.overflow="visible";_bb.style.position="static";_bb.style.zoom="normal";_bb.style.writingMode="lr-tb";_bb.style.width=_bb.style.height="auto";_bb.style.maxWidth=_bb.style.maxHeight=_bb.style.styleFloat="none";var _bf=_bb;var _c0=_bb.currentStyle.hasLayout;if(_c0){dom.setInnerHtml(_bb,"<div class=\""+_43+"\">X<br />X<br />X</div>");_bf=_bb.firstChild}else{dom.setInnerHtml(_bb,"X<br />X<br />X")}var _c1=_bf.getClientRects();_bc=_c1[1].bottom-_c1[1].top;_bc=Math.ceil(_bc*0.8);if(_c0){dom.setInnerHtml(_bb,"<div class=\""+_43+"\">"+_be+"</div>");_bf=_bb.firstChild}else{dom.setInnerHtml(_bb,_be)}_c1=_bf.getClientRects();_bd=_c1.length;if(_c0){dom.setInnerHtml(_bb,_be)}_bb.style.visibility=_bb.style.width=_bb.style.height=_bb.style.maxWidth=_bb.style.maxHeight=_bb.style.overflow=_bb.style.styleFloat=_bb.style.position=_bb.style.zoom=_bb.style.writingMode=""}}return {lineHeight:_bc,lines:_bd}}this.replace=function(_c2,_c3){if(!ua.supported){return}if(_c3){for(var _c4 in _c2){if(typeof (_c3[_c4])=="undefined"){_c3[_c4]=_c2[_c4]}}_c2=_c3}if(!_4c){return _9c.kwargs.push(_c2)}if(_66.synchronizer.isBlocked){return _97.kwargs.push(_c2)}var _c5=_c2.elements;if(!_c5&&parseSelector){_c5=parseSelector(_c2.selector)}if(_c5.length==0){return}this.setFlashClass();var src=getSource(_c2.src);var css=_72.convertCssArg(_c2.css);var _c8=getFilters(_c2.filters);var _c9=(_c2.forceClear==null)?_3b.forceClear:_c2.forceClear;var _ca=(_c2.fitExactly==null)?_3b.fitExactly:_c2.fitExactly;var _cb=_ca||(_c2.forceWidth==null?_3b.forceWidth:_c2.forceWidth);var _cc=parseInt(_72.extractFromCss(css,".sIFR-root","leading"))||0;var _cd=_72.extractFromCss(css,".sIFR-root","font-size",true)||0;var _ce=_72.extractFromCss(css,".sIFR-root","background-color",true)||"#FFFFFF";var _cf=_72.extractFromCss(css,".sIFR-root","kerning",true)||"";var _d0=_c2.gridFitType||_72.extractFromCss(css,".sIFR-root","text-align")=="right"?"subpixel":"pixel";var _d1=_3b.forceTextTransform?_72.extractFromCss(css,".sIFR-root","text-transform",true)||"none":"none";var _d2=_72.extractFromCss(css,".sIFR-root","opacity",true)||"100";var _d3=_c2.pixelFont||false;var _d4=_c2.ratios||_48;var _d5=parseInt(_c2.tuneHeight)||0;if(parseInt(_cd).toString()!=_cd&&_cd.indexOf("px")==-1){_cd=0}else{_cd=parseInt(_cd)}if(parseFloat(_d2)<1){_d2=100*parseFloat(_d2)}var _d6="";if(_ca){_72.extractFromCss(css,".sIFR-root","text-align",true)}if(!_c2.modifyCss){_d6=_72.cssToString(css)}var _d7=!ua.opera&&_3b.delayCss;var _d8=_c2.wmode||"";if(!_d8){if(_c2.transparent){_d8="transparent"}else{if(_c2.opaque){_d8="opaque"}}}if(_d8=="transparent"){if(!ua.transparencySupport){_d8="opaque"}else{_ce="transparent"}}for(var i=0;i<_c5.length;i++){var _da=_c5[i];if(!ua.verifiedKonqueror){if(dom.getComputedStyle(_da,"lineHeight").match(/e\+08px/)){ua.supported=_3b.isEnabled=false;this.removeFlashClass();return}ua.verifiedKonqueror=true}if(dom.hasOneOfClassses([_3d,_3e,_40,_41],_da)){continue}var _db=_da.offsetHeight;var _dc=_da.offsetWidth;var _dd=dom.getComputedStyle(_da,"display");if(!_db||!_dc||_dd==null||_dd=="none"){continue}if(_c9&&ua.gecko){_da.style.clear="both"}var _de=null;if(_3b.fixWrap&&ua.ie&&_dd=="block"){_de=_da.innerHTML;dom.setInnerHtml(_da,"X")}_dc=dom.getStyleAsInt(_da,"width",ua.ie);if(_dc==0){var _df=dom.getStyleAsInt(_da,"paddingRight",true);var _e0=dom.getStyleAsInt(_da,"paddingLeft",true);var _e1=dom.getStyleAsInt(_da,"borderRightWidth",true);var _e2=dom.getStyleAsInt(_da,"borderLeftWidth",true);_dc=_da.offsetWidth-_e0-_df-_e2-_e1}if(_de&&_3b.fixWrap&&ua.ie){dom.setInnerHtml(_da,_de)}var _e3,_e4;if(!_cd){var _e5=calculate(_da);_e3=Math.min(_45,Math.max(_44,_e5.lineHeight));if(_d3){_e3=Math.max(8,8*Math.round(_e3/8))}_e4=_e5.lines;if(isNaN(_e4)||!isFinite(_e4)||_e4==0){_e4=1}if(_e4>1&&_cc){_db+=Math.round((_e4-1)*_cc)}}else{_e3=_cd;_e4=1}_db=Math.round(_e4*_e3);if(_c9&&ua.gecko){_da.style.clear=""}var _e6=dom.create("span");_e6.className=_41;var _e7=_da.cloneNode(true);for(var j=0,l=_e7.childNodes.length;j<l;j++){_e6.appendChild(_e7.childNodes[j].cloneNode(true))}if(_c2.modifyContent){_c2.modifyContent(_e7,_c2.selector)}if(_c2.modifyCss){_d6=_c2.modifyCss(css,_e7,_c2.selector)}var _ea=handleContent(_e7,_d1);if(_c2.modifyContentString){_ea.text=_c2.modifyContentString(_ea.text,_c2.selector)}if(_ea==""){continue}var _eb=["content="+_72.escape(_ea.text),"width="+_dc,"height="+_db,"fitexactly="+(_ca?"true":""),"tunewidth="+(_c2.tuneWidth||""),"tuneheight="+_d5,"offsetleft="+(_c2.offsetLeft||""),"offsettop="+(_c2.offsetTop||""),"thickness="+(_c2.thickness||""),"sharpness="+(_c2.sharpness||""),"kerning="+_cf,"gridfittype="+_d0,"zoomsupport="+ua.zoomSupport,"flashfilters="+_c8,"opacity="+_d2,"blendmode="+(_c2.blendMode||""),"size="+_e3,"zoom="+dom.getZoom(),"css="+_72.escape(_d6),"selectable="+(_c2.selectable==null?"true":_c2.selectable),"lines="+_e4,"fixhover="+(_3b.fixHover?"true":""),"antialiastype="+(_c2.antiAliasType||""),"preventwrap="+(_c2.preventWrap?"true":"false"),"link="+_72.escape(_ea.primaryLink[0]||""),"target="+_72.escape(_ea.primaryLink[1]||"")];var _ec=encodeVars(_eb);var _ed="sIFR_callback_"+_4a++;var _ee=new CallbackInfo(_ed,_eb,_c2.onReplacement);window[_ed+"_DoFSCommand"]=(function(_ef){return function(_f0,arg){_ef.handle(_f0,arg)}})(_ee);_db=Math.round(_e4*getRatio(_e3,_d4)*_e3)+_49+_d5;var _f2=_cb?_dc:"100%";var _f3;if(ua.ie){_f3=["<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" id=\"",_ed,"\" sifr=\"true\" width=\"",_f2,"\" height=\"",_db,"\" class=\"",_3f,"\">","<param name=\"movie\" value=\"",src,"\"></param>","<param name=\"flashvars\" value=\"",_ec,"\"></param>","<param name=\"allowScriptAccess\" value=\"always\"></param>","<param name=\"quality\" value=\"best\"></param>","<param name=\"wmode\" value=\"",_d8,"\"></param>","<param name=\"bgcolor\" value=\"",_ce,"\"></param>","<param name=\"name\" value=\"",_ed,"\"></param>","</object>","<scr","ipt event=FSCommand(info,args) for=",_ed,">",_ed,"_DoFSCommand(info, args);","</","script>"].join("")}else{_f3=["<embed type=\"application/x-shockwave-flash\"",(_d7?" class=\""+_3f+"\"":"")," src=\"",src,"\" quality=\"best\" flashvars=\"",_ec,"\" width=\"",_f2,"\" height=\"",_db,"\" wmode=\"",_d8,"\" bgcolor=\"",_ce,"\" name=\"",_ed,"\" id=\"",_ed,"\" allowScriptAccess=\"always\" sifr=\"true\"></embed>"].join("")}dom.setInnerHtml(_da,_f3);_ee.flashNode=_da.firstChild;_ee.html=_f3;_3b.callbacks.push(_ee);if(_c2.selector){if(!_3b.callbacks[_c2.selector]){_3b.callbacks[_c2.selector]=[_ee]}else{_3b.callbacks[_c2.selector].push(_ee)}}_da.appendChild(_e6);dom.addClass(_d7?_3e:_3d,_da)}_66.fragmentIdentifier.restore()};this.getCallbackByFlashElement=function(_f4){for(var i=0;i<_3b.callbacks.length;i++){if(_3b.callbacks[i].id==_f4.getAttribute("id")){return _3b.callbacks[i]}}};this.redraw=function(){for(var i=0;i<_3b.callbacks.length;i++){_3b.callbacks[i].resetMovie()}};function encodeVars(_f7){return _f7.join("&amp;").replace(/%/g,"%25")}function handleContent(_f8,_f9){var _fa=[],_fb=[],_fc=[];var _fd=_f8.childNodes;var i=0;while(i<_fd.length){var _ff=_fd[i];if(_ff.nodeType==3){var text=_72.normalize(_ff.nodeValue);text=_72.textTransform(_f9,text);_fb.push(text)}if(_ff.nodeType==1){var _101=[];var _102=_ff.nodeName.toLowerCase();var _103=_ff.className||"";if(/\s+/.test(_103)){if(_103.indexOf(_42)>-1){_103=_103.match("(\\s|^)"+_42+"-([^\\s$]*)(\\s|$)")[2]}else{_103=_103.match(/^([^\s]+)/)[1]}}if(_103!=""){_101.push("class=\""+_103+"\"")}if(_102=="a"){var href=_ff.getAttribute("href")||"";var _105=_ff.getAttribute("target")||"";_101.push("href=\""+href+"\"","target=\""+_105+"\"");if(_fc.length==0){_fc=[href,_105]}}_fb.push("<"+_102+(_101.length>0?" ":"")+_101.join(" ")+">");if(_ff.hasChildNodes()){_fa.push(i);i=0;_fd=_ff.childNodes;continue}else{if(!/^(br|img)$/i.test(_ff.nodeName)){_fb.push("</",_ff.nodeName.toLowerCase(),">")}}}if(_fa.length>0&&!_ff.nextSibling){do{i=_fa.pop();_fd=_ff.parentNode.parentNode.childNodes;_ff=_fd[i];if(_ff){_fb.push("</",_ff.nodeName.toLowerCase(),">")}}while(i==_fd.length-1&&_fa.length>0)}i++}return {text:_fb.join("").replace(/\n|\r/g,""),primaryLink:_fc}}function CallbackInfo(id,vars,_108,_109){this.id=id;this.vars=vars;this._replacementHandler=_108;this._firedReplacementEvent=!(this._replacementHandler!=null);this._fixHover=_109;this._setClasses=!_3b.delayCss;this.html=""}CallbackInfo.prototype.getFlashElement=function(){return document.getElementById(this.id)};CallbackInfo.prototype.available=function(){var _10a=this.getFlashElement();return _10a&&_10a.parentNode};CallbackInfo.prototype.handle=function(info,arg){if(!this.available()){return}if(/(FSCommand\:)?resize/.test(info)){var _10d=this.getFlashElement();var $=arg.split(/\:|,/);_10d.setAttribute($[0],$[1]);if($.length>2){_10d.setAttribute($[2],$[3])}if(!this._setClasses){if(!ua.ie&&!ua.opera){dom.addClass(_3f,_10d)}dom.removeClass(_3e,_10d.parentNode);dom.addClass(_3d,_10d.parentNode);this._setClasses=true}if(ua.khtml){var _10f=_10d.offsetHeight}if(!this._firedReplacementEvent){this._replacementHandler(this);this._firedReplacementEvent=true}}else{if(/(FSCommand\:)?resetmovie/.test(info)){this.resetMovie()}else{if(this.debugHandler&&/(FSCommand\:)?debug/.test(info)){this.debugHandler(info,arg)}}}};CallbackInfo.prototype.call=function(type,_111){if(!this.available()){return false}var _112=this.getFlashElement();try{_112.SetVariable("callbackType",type);_112.SetVariable("callbackValue",_111);_112.SetVariable("callbackTrigger",true)}catch(e){return false}return true};CallbackInfo.prototype.replaceText=function(_113){_113=_72.escape(_113);this.vars[0]="content="+_113;this.html=this.html.replace(/(flashvars(=|\"\svalue=)\")[^\"]+/,"$1"+encodeVars(this.vars));return this.call("replacetext",_113)};CallbackInfo.prototype.resetMovie=function(){if(!this.available()){return}var _114=this.getFlashElement();var node=_114.parentNode;node.replaceChild(dom.nodeFromHtml(this.html),_114)}};/*=:project
    scalable Inman Flash Replacement (sIFR) version 3, revision 278

    Provides debug information about sIFR.

  =:file
    Copyright: 2006 Mark Wubben.
    Author: Mark Wubben, <http://novemberborn.net/>

  =:license
    * This software is licensed and provided under the CC-GNU LGPL
    * See <http://creativecommons.org/licenses/LGPL/2.1/>    
*/

sIFR.debug = new function() {
  // Initialize sIFR
  sIFR.debugMode = true;
  sIFR.errors = {
    isFile: 'sIFR: Did not activate because the page is being loaded from the filesystem.',
    getSource: 'sIFR: Could not determine appropriate source'
  }; // Added by the export script.
  
  function log(msg) {
    if(!sIFR.ua.safari && window.console && console.log) console.log(msg);
    else alert(msg);
  }
  
  function merge(kwargs, mergeKwargs) {
    if(mergeKwargs) {
      for(var property in kwargs) {
        if(typeof(mergeKwargs[property]) == 'undefined') mergeKwargs[property] = kwargs[property];
      }
      kwargs = mergeKwargs;
    }
    
    return kwargs;
  }
  
  this.ua = function() {
    var info = [];
    
    for(var prop in sIFR.ua) {
      if(sIFR.ua[prop] == Object.prototype[prop]) continue;
      
      info.push(prop, ': ', sIFR.ua[prop], '\n');
    }
    
    log(info.join(''));
  };
  
  this.domains = function() {
    var valid = sIFR.domains.length == 0;
    
    // The validation code is copied from the private sIFR code. Please keep 
    // up to date!
    
    var domain = '';
    try { // When trying to access document.domain on a Google-translated page with Firebug, I got an exception.
      domain = document.domain;
    } catch(e) {};

    for(var i = 0; i < sIFR.domains.length; i++) {
      if(sIFR.domains[i] == '*' || sIFR.domains[i] == domain) {
        valid = true;
        break;
      }
    }
    
    log(['The domain "', domain, '" is ', valid ? 'valid' : 'invalid', '.\nList of checked domains: ', sIFR.domains].join(''));
  };

  this.ratios = function(kwargs, mergeKwargs) {
    kwargs = merge(kwargs, mergeKwargs);
    
    var running = false;
    kwargs.onReplacement = function(cb) {
      if(running) return; // Prevent duplicate results
      running = true;
      cb.debugHandler = function(info, args) {
        if(/(FSCommand\:)?debug\:ratios/.test(info)) prompt('The ratios for ' + kwargs.selector + ' are:', args);
      }
      cb.call('ratios', '');
    };

    sIFR.replace(kwargs);
  };
  
  function verifyResource(uri, fail, ok) {
    if(sIFR.ua.ie && uri.charAt(0) == '/') {
      uri = window.location.toString().replace(/([^:]+)(:\/?\/?)([^\/]+).*/, '$1$2$3') + uri;
    }
    
    var xhr = new XMLHttpRequest();
    xhr.open('GET', uri, true);
    xhr.onreadystatechange = function() {
      if(xhr.readyState == 4) {
        if(xhr.status != 200) log(fail);
        else log(ok);
      }
    };
    xhr.send('');
  }

  this.test = function(kwargs, mergeKwargs) {
    kwargs = merge(kwargs, mergeKwargs);

    var src = kwargs.src;
    var checked = false;
    if(typeof(src) != 'string') {
      if(src.src) src = src.src;

      if(typeof(src) != 'string') {
        var versions = [];
        for(var version in src) if(src[version] != Object.prototype[version]) versions.push(version);
        versions.sort().reverse();

        var result = '';
        var i = -1;
        while(!result && ++i < versions.length) {
          if(parseFloat(versions[i]) <= ua.flashVersion) result = src[versions[i]];
          var msg = '<' + src[versions[i]] + '>, flash ' + parseFloat(versions[i]);
          verifyResource(src[versions[i]], 'FAILED: ' + msg, 'OK: ' + msg);
        }
        
        src = result;
        checked = true;
      }
    }
    
    if(!src) log('Could not determine appropriate source.');
    else if(!checked) verifyResource(src, 'FAILED: <' + src + '>', 'OK: <' + src + '>');
  };
  
  this.forceTest = function() {
    var replace = sIFR.replace;
    sIFR.replace = function(kwargs, mergeKwargs) {
      sIFR.debug.test(kwargs, mergeKwargs);
      replace.call(sIFR, kwargs, mergeKwargs);
    };
  }
};var font={src:'/aero/fonts/trebuchet.swf'};

sIFR.activate(font);

sIFR.replace(font,{
 selector:'h2',
 css:['.sIFR-root{background-color:#000000;color:#ff7611;font-size:18px;text-align:center;}'],
 wmode:'transparent',
 offsetTop:5,
 forceWidth:true
});
$(function(){$('h2').height(30);});

sIFR.replace(font,{
 selector:'h3',
 css:[
  '.sIFR-root{color:#e15a00;font-size:16px;}',
  'a{text-decoration:none;}',
  'a:link{color:#e15a00;}',
  'a:hover{color:#2593e7;}'
 ],
 wmode:'transparent'
});
$(function(){$('h3').height(26);});

sIFR.replace(font,{
 selector:'div.forumcat > h4',
 css:'.sIFR-root{color:#ffffff;font-size:12px;}',
 offsetTop:3,
 wmode:'transparent'
});

sIFR.replace(font,{
 selector:'#sidebar > h4',
 css:[
  '.sIFR-root{background-color:#333333;color:#ffffff;font-size:12px;}',
  'a{text-decoration:none;}',
  'a:link{color:#e15a00;}',
  'a:hover{color:#222222;}'
 ],
 wmode:'transparent'
});
//$(function(){$('#sidebar > h4').height(20);});

sIFR.replace(font,{
 selector:'#bottom h4',
 css:'.sIFR-root{color:#ffffff;font-size:15px;}',
 wmode:'transparent'
});


/*
 * Thickbox 3.1 - One Box To Rule Them All.
 * By Cody Lindley (http://www.codylindley.com)
 * Copyright (c) 2007 cody lindley
 * Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
*/
    
var tb_pathToImage="/aero/images/loadingAnimation.gif";

function tb_init(domChunk){
 $(domChunk).click(function(){
  var t=this.title || this.name || null;
  var a=this.href || this.alt;
  var g=this.rel || false;
  tb_show(t,a,g);
  this.blur();
  return false;
 });
}
function tb_show(caption,url,imageGroup){
 try{
  if(typeof document.body.style.maxHeight==="undefined"){
   $("body","html").css({height:"100%",width:"100%"});
   $("html").css("overflow","hidden");
   if(document.getElementById("TB_HideSelect")===null){
    $("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
    $("#TB_overlay").click(tb_remove);
   }
  }else{
   if(document.getElementById("TB_overlay")===null){
    $("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
    $("#TB_overlay").click(tb_remove);
   }
  }
  if(tb_detectMacXFF()){
   $("#TB_overlay").addClass("TB_overlayMacFFBGHack"); // use png overlay so hide flash
  }else{
   $("#TB_overlay").addClass("TB_overlayBG"); // use background and opacity
  }
  if(caption===null){caption="";}
  $("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
  $('#TB_load').show();
  
  var baseURL;
  if(url.indexOf("?")!==-1){ // ff there is a query string involved
   baseURL=url.substr(0,url.indexOf("?"));
  }else{ 
   baseURL=url;
  }
  var urlString=/\.jpg$|\.jpeg$|\.png$|\.gif$|\.bmp$/;
  var urlType=baseURL.toLowerCase().match(urlString);
  
  if(urlType=='.jpg' || urlType=='.jpeg' || urlType=='.png' || urlType=='.gif' || urlType=='.bmp' || baseURL.indexOf('/aero/image')>0){
   TB_PrevCaption="";
   TB_PrevURL="";
   TB_PrevHTML="";
   TB_NextCaption="";
   TB_NextURL="";
   TB_NextHTML="";
   TB_imageCount="";
   TB_FoundURL=false;
   if(imageGroup){
    TB_TempArray=$("a[@rel="+imageGroup+"]").get();
    for (TB_Counter=0; ((TB_Counter < TB_TempArray.length) && (TB_NextHTML === "")); TB_Counter++){
     var urlTypeTemp=TB_TempArray[TB_Counter].href.toLowerCase().match(urlString);
      if(!(TB_TempArray[TB_Counter].href==url)){      
       if(TB_FoundURL){
        TB_NextCaption=TB_TempArray[TB_Counter].title;
        TB_NextURL=TB_TempArray[TB_Counter].href;
        TB_NextHTML="<span id='TB_next'>&nbsp;&nbsp;<a href='#'>Next &gt;</a></span>";
       } else {
        TB_PrevCaption=TB_TempArray[TB_Counter].title;
        TB_PrevURL=TB_TempArray[TB_Counter].href;
        TB_PrevHTML="<span id='TB_prev'>&nbsp;&nbsp;<a href='#'>&lt; Prev</a></span>";
       }
      } else {
       TB_FoundURL=true;
       TB_imageCount="Image " + (TB_Counter + 1) +" of "+ (TB_TempArray.length);           
      }
    }
   }

   imgPreloader=new Image();
   imgPreloader.onload=function(){  
   imgPreloader.onload=null;
    
   // Resizing large images - orginal by Christian Montoya edited by me.
   var pagesize=tb_getPageSize();
   var x=pagesize[0] - 150;
   var y=pagesize[1] - 150;
   var imageWidth=imgPreloader.width;
   var imageHeight=imgPreloader.height;
   if(imageWidth > x){
    imageHeight=imageHeight * (x / imageWidth); 
    imageWidth=x; 
    if(imageHeight > y){ 
     imageWidth=imageWidth * (y / imageHeight); 
     imageHeight=y; 
    }
   } else if(imageHeight > y){ 
    imageWidth=imageWidth * (y / imageHeight); 
    imageHeight=y; 
    if(imageWidth > x){ 
     imageHeight=imageHeight * (x / imageWidth); 
     imageWidth=x;
    }
   }
   // End Resizing
   
   TB_WIDTH=imageWidth + 30;
   TB_HEIGHT=imageHeight + 60;
   $("#TB_window").append("<a href='' id='TB_ImageOff' title='Close'><img id='TB_Image' src='"+url+"' width='"+imageWidth+"' height='"+imageHeight+"' alt='"+caption+"'/></a>" + "<div id='TB_caption'>"+caption+"<div id='TB_secondLine'>" + TB_imageCount + TB_PrevHTML + TB_NextHTML + "</div></div><div id='TB_closeWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div>");   
   
   $("#TB_closeWindowButton").click(tb_remove);
   
   if(!(TB_PrevHTML === "")){
    function goPrev(){
     if($(document).unbind("click",goPrev)){$(document).unbind("click",goPrev);}
     $("#TB_window").remove();
     $("body").append("<div id='TB_window'></div>");
     tb_show(TB_PrevCaption, TB_PrevURL, imageGroup);
     return false; 
    }
    $("#TB_prev").click(goPrev);
   }
   
   if(!(TB_NextHTML === "")){  
    function goNext(){
     $("#TB_window").remove();
     $("body").append("<div id='TB_window'></div>");
     tb_show(TB_NextCaption, TB_NextURL, imageGroup);    
     return false; 
    }
    $("#TB_next").click(goNext);
    
   }

   document.onkeydown=function(e){  
    if(e==null){ // ie
     keycode=event.keyCode;
    } else { // mozilla
     keycode=e.which;
    }
    if(keycode==27){ // close
     tb_remove();
    } else if(keycode==190 || keycode==39){ // display previous image
     if(!(TB_NextHTML=="")){
      document.onkeydown="";
      goNext();
     }
    } else if(keycode==188 || keycode==37){ // display next image
     if(!(TB_PrevHTML=="")){
      document.onkeydown="";
      goPrev();
     }
    } 
   };
   
   tb_position();
   $("#TB_load").remove();
   $("#TB_ImageOff").click(tb_remove);
   $("#TB_window").css({display:"block"}); //for safari using css instead of show
   };
   
   imgPreloader.src=url;
  }else{//code to show html
   
   var queryString = url.replace(/^[^\?]+\??/,'');
   var params = tb_parseQuery( queryString );

   TB_WIDTH = (params['width']*1) + 30 || 630; //defaults to 630 if no paramaters were added to URL
   TB_HEIGHT = (params['height']*1) + 40 || 440; //defaults to 440 if no paramaters were added to URL
   ajaxContentW = TB_WIDTH - 30;
   ajaxContentH = TB_HEIGHT - 45;
   
   if(url.indexOf('TB_iframe') != -1){// either iframe or ajax window  
     urlNoQuery = url.split('TB_');
     $("#TB_iframeContent").remove();
     if(params['modal'] != "true"){//iframe no modal
      $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton' title='Close'>close</a> or Esc Key</div></div><iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;' > </iframe>");
     }else{//iframe modal
     $("#TB_overlay").unbind();
      $("#TB_window").append("<iframe frameborder='0' hspace='0' src='"+urlNoQuery[0]+"' id='TB_iframeContent' name='TB_iframeContent"+Math.round(Math.random()*1000)+"' onload='tb_showIframe()' style='width:"+(ajaxContentW + 29)+"px;height:"+(ajaxContentH + 17)+"px;'> </iframe>");
     }
   }else{// not an iframe, ajax
     if($("#TB_window").css("display") != "block"){
      if(params['modal'] != "true"){//ajax no modal
      $("#TB_window").append("<div id='TB_title'><div id='TB_ajaxWindowTitle'>"+caption+"</div><div id='TB_closeAjaxWindow'><a href='#' id='TB_closeWindowButton'>close</a> or Esc Key</div></div><div id='TB_ajaxContent' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px'></div>");
      }else{//ajax modal
      $("#TB_overlay").unbind();
      $("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:"+ajaxContentW+"px;height:"+ajaxContentH+"px;'></div>"); 
      }
     }else{//this means the window is already up, we are just loading new content via ajax
      $("#TB_ajaxContent")[0].style.width = ajaxContentW +"px";
      $("#TB_ajaxContent")[0].style.height = ajaxContentH +"px";
      $("#TB_ajaxContent")[0].scrollTop = 0;
      $("#TB_ajaxWindowTitle").html(caption);
     }
   }
     
   $("#TB_closeWindowButton").click(tb_remove);
   
    if(url.indexOf('TB_inline') != -1){ 
     $("#TB_ajaxContent").append($('#' + params['inlineId']).children());
     $("#TB_window").unload(function () {
      $('#' + params['inlineId']).append( $("#TB_ajaxContent").children() ); // move elements back when you're finished
     });
     tb_position();
     $("#TB_load").remove();
     $("#TB_window").css({display:"block"}); 
    }else if(url.indexOf('TB_iframe') != -1){
     tb_position();
     if($.browser.safari){//safari needs help because it will not fire iframe onload
      $("#TB_load").remove();
      $("#TB_window").css({display:"block"});
     }
    }else{
     $("#TB_ajaxContent").load(url += "&random=" + (new Date().getTime()),function(){//to do a post change this load method
      tb_position();
      $("#TB_load").remove();
      tb_init("#TB_ajaxContent a.thickbox");
      $("#TB_window").css({display:"block"});
     });
    }
   
  }

  if(!params['modal']){
   document.onkeyup=function(e){  
    if(e==null){ // ie
     keycode=event.keyCode;
    } else { // mozilla
     keycode=e.which;
    }
    if(keycode==27){ // close
     tb_remove();
    } 
   };
  }
  
 }catch(e){
  // nothing here
 }
}

function tb_showIframe(){
 $("#TB_load").remove();
 $("#TB_window").css({display:"block"});
}

function tb_remove(){
 $("#TB_imageOff").unbind("click");
 $("#TB_closeWindowButton").unbind("click");
 $("#TB_window").fadeOut("fast",function(){$('#TB_window,#TB_overlay,#TB_HideSelect').trigger("unload").unbind().remove();});
 $("#TB_load").remove();
 if(typeof document.body.style.maxHeight=="undefined"){//if IE 6
  $("body","html").css({height: "auto", width: "auto"});
  $("html").css("overflow","");
 }
 document.onkeydown="";
 document.onkeyup="";
 return false;
}

function tb_position(){
 $("#TB_window").css({marginLeft:'-'+parseInt((TB_WIDTH/2),10)+'px',width:TB_WIDTH+'px'});
 if(!(jQuery.browser.msie && jQuery.browser.version<7)){
  $("#TB_window").css({marginTop:'-'+parseInt((TB_HEIGHT/2),10)+'px'});
 }
}

function tb_parseQuery(query){
 var Params={};
 if(!query){return Params;}
 var Pairs=query.split(/[;&]/);
 for(var i=0;i<Pairs.length;i++){
  var KeyVal=Pairs[i].split('=');
  if(!KeyVal || KeyVal.length!=2){continue;}
  var key=unescape(KeyVal[0]);
  var val=unescape(KeyVal[1]);
  val=val.replace(/\+/g,' ');
  Params[key]=val;
 }
 return Params;
}

function tb_getPageSize(){
 var de=document.documentElement;
 var w=window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
 var h=window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
 arrayPageSize=[w,h];
 return arrayPageSize;
}

function tb_detectMacXFF(){
 var userAgent=navigator.userAgent.toLowerCase();
 if(userAgent.indexOf('mac')!=-1 && userAgent.indexOf('firefox')!=-1){
  return true;
 }
}


