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}('(H(){J w=1b.4M,3m$=1b.$;J D=1b.4M=1b.$=H(a,b){I 2B D.17.5j(a,b)};J u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/,62=/^.[^:#\\[\\.]*$/,12;D.17=D.44={5j:H(d,b){d=d||S;G(d.16){7[0]=d;7.K=1;I 7}G(1j d=="23"){J c=u.2D(d);G(c&&(c[1]||!b)){G(c[1])d=D.4h([c[1]],b);N{J a=S.61(c[3]);G(a){G(a.2v!=c[3])I D().2q(d);I D(a)}d=[]}}N I D(b).2q(d)}N G(D.1D(d))I D(S)[D.17.27?"27":"43"](d);I 7.6Y(D.2d(d))},5w:"1.2.6",8G:H(){I 7.K},K:0,3p:H(a){I a==12?D.2d(7):7[a]},2I:H(b){J a=D(b);a.5n=7;I a},6Y:H(a){7.K=0;2p.44.1p.1w(7,a);I 7},P:H(a,b){I D.P(7,a,b)},5i:H(b){J a=-1;I D.2L(b&&b.5w?b[0]:b,7)},1K:H(c,a,b){J d=c;G(c.1q==56)G(a===12)I 7[0]&&D[b||"1K"](7[0],c);N{d={};d[c]=a}I 7.P(H(i){R(c 1n d)D.1K(b?7.V:7,c,D.1i(7,d[c],b,i,c))})},1g:H(b,a){G((b==\'2h\'||b==\'1Z\')&&3d(a)<0)a=12;I 7.1K(b,a,"2a")},1r:H(b){G(1j b!="49"&&b!=U)I 7.4E().3v((7[0]&&7[0].2z||S).5F(b));J a="";D.P(b||7,H(){D.P(7.3t,H(){G(7.16!=8)a+=7.16!=1?7.76:D.17.1r([7])})});I a},5z:H(b){G(7[0])D(b,7[0].2z).5y().39(7[0]).2l(H(){J a=7;1B(a.1x)a=a.1x;I a}).3v(7);I 7},8Y:H(a){I 7.P(H(){D(7).6Q().5z(a)})},8R:H(a){I 7.P(H(){D(7).5z(a)})},3v:H(){I 7.3W(19,M,Q,H(a){G(7.16==1)7.3U(a)})},6F:H(){I 7.3W(19,M,M,H(a){G(7.16==1)7.39(a,7.1x)})},6E:H(){I 7.3W(19,Q,Q,H(a){7.1d.39(a,7)})},5q:H(){I 7.3W(19,Q,M,H(a){7.1d.39(a,7.2H)})},3l:H(){I 7.5n||D([])},2q:H(b){J c=D.2l(7,H(a){I D.2q(b,a)});I 7.2I(/[^+>] [^+>]/.11(b)||b.1h("..")>-1?D.4r(c):c)},5y:H(e){J f=7.2l(H(){G(D.14.1f&&!D.4n(7)){J a=7.6o(M),5h=S.3h("1v");5h.3U(a);I D.4h([5h.4H])[0]}N I 7.6o(M)});J d=f.2q("*").5c().P(H(){G(7[E]!=12)7[E]=U});G(e===M)7.2q("*").5c().P(H(i){G(7.16==3)I;J c=D.L(7,"3w");R(J a 1n c)R(J b 1n c[a])D.W.1e(d[i],a,c[a][b],c[a][b].L)});I f},1E:H(b){I 7.2I(D.1D(b)&&D.3C(7,H(a,i){I b.1k(a,i)})||D.3g(b,7))},4Y:H(b){G(b.1q==56)G(62.11(b))I 7.2I(D.3g(b,7,M));N b=D.3g(b,7);J a=b.K&&b[b.K-1]!==12&&!b.16;I 7.1E(H(){I a?D.2L(7,b)<0:7!=b})},1e:H(a){I 7.2I(D.4r(D.2R(7.3p(),1j a==\'23\'?D(a):D.2d(a))))},3F:H(a){I!!a&&D.3g(a,7).K>0},7T:H(a){I 7.3F("."+a)},6e:H(b){G(b==12){G(7.K){J c=7[0];G(D.Y(c,"2A")){J e=c.64,63=[],15=c.15,2V=c.O=="2A-2V";G(e<0)I U;R(J i=2V?e:0,2f=2V?e+1:15.K;i<2f;i++){J d=15[i];G(d.2W){b=D.14.1f&&!d.at.2x.an?d.1r:d.2x;G(2V)I b;63.1p(b)}}I 63}N I(7[0].2x||"").1o(/\\r/g,"")}I 12}G(b.1q==4L)b+=\'\';I 7.P(H(){G(7.16!=1)I;G(b.1q==2p&&/5O|5L/.11(7.O))7.4J=(D.2L(7.2x,b)>=0||D.2L(7.34,b)>=0);N G(D.Y(7,"2A")){J a=D.2d(b);D("9R",7).P(H(){7.2W=(D.2L(7.2x,a)>=0||D.2L(7.1r,a)>=0)});G(!a.K)7.64=-1}N 7.2x=b})},2K:H(a){I a==12?(7[0]?7[0].4H:U):7.4E().3v(a)},7b:H(a){I 7.5q(a).21()},79:H(i){I 7.3s(i,i+1)},3s:H(){I 7.2I(2p.44.3s.1w(7,19))},2l:H(b){I 7.2I(D.2l(7,H(a,i){I b.1k(a,i,a)}))},5c:H(){I 7.1e(7.5n)},L:H(d,b){J a=d.1R(".");a[1]=a[1]?"."+a[1]:"";G(b===12){J c=7.5C("9z"+a[1]+"!",[a[0]]);G(c===12&&7.K)c=D.L(7[0],d);I c===12&&a[1]?7.L(a[0]):c}N I 7.1P("9u"+a[1]+"!",[a[0],b]).P(H(){D.L(7,d,b)})},3b:H(a){I 7.P(H(){D.3b(7,a)})},3W:H(g,f,h,d){J e=7.K>1,3x;I 7.P(H(){G(!3x){3x=D.4h(g,7.2z);G(h)3x.9o()}J b=7;G(f&&D.Y(7,"1T")&&D.Y(3x[0],"4F"))b=7.3H("22")[0]||7.3U(7.2z.3h("22"));J c=D([]);D.P(3x,H(){J a=e?D(7).5y(M)[0]:7;G(D.Y(a,"1m"))c=c.1e(a);N{G(a.16==1)c=c.1e(D("1m",a).21());d.1k(b,a)}});c.P(6T)})}};D.17.5j.44=D.17;H 6T(i,a){G(a.4d)D.3Y({1a:a.4d,31:Q,1O:"1m"});N D.5u(a.1r||a.6O||a.4H||"");G(a.1d)a.1d.37(a)}H 1z(){I+2B 8J}D.1l=D.17.1l=H(){J b=19[0]||{},i=1,K=19.K,4x=Q,15;G(b.1q==8I){4x=b;b=19[1]||{};i=2}G(1j b!="49"&&1j b!="H")b={};G(K==i){b=7;--i}R(;i<K;i++)G((15=19[i])!=U)R(J c 1n 15){J a=b[c],2w=15[c];G(b===2w)6M;G(4x&&2w&&1j 2w=="49"&&!2w.16)b[c]=D.1l(4x,a||(2w.K!=U?[]:{}),2w);N G(2w!==12)b[c]=2w}I b};J E="4M"+1z(),6K=0,5r={},6G=/z-?5i|8B-?8A|1y|6B|8v-?1Z/i,3P=S.3P||{};D.1l({8u:H(a){1b.$=3m$;G(a)1b.4M=w;I D},1D:H(a){I!!a&&1j a!="23"&&!a.Y&&a.1q!=2p&&/^[\\s[]?H/.11(a+"")},4n:H(a){I a.1C&&!a.1c||a.2j&&a.2z&&!a.2z.1c},5u:H(a){a=D.3k(a);G(a){J b=S.3H("6w")[0]||S.1C,1m=S.3h("1m");1m.O="1r/4t";G(D.14.1f)1m.1r=a;N 1m.3U(S.5F(a));b.39(1m,b.1x);b.37(1m)}},Y:H(b,a){I b.Y&&b.Y.2r()==a.2r()},1Y:{},L:H(c,d,b){c=c==1b?5r:c;J a=c[E];G(!a)a=c[E]=++6K;G(d&&!D.1Y[a])D.1Y[a]={};G(b!==12)D.1Y[a][d]=b;I d?D.1Y[a][d]:a},3b:H(c,b){c=c==1b?5r:c;J a=c[E];G(b){G(D.1Y[a]){2U D.1Y[a][b];b="";R(b 1n D.1Y[a])1X;G(!b)D.3b(c)}}N{1U{2U c[E]}1V(e){G(c.5l)c.5l(E)}2U D.1Y[a]}},P:H(d,a,c){J e,i=0,K=d.K;G(c){G(K==12){R(e 1n d)G(a.1w(d[e],c)===Q)1X}N R(;i<K;)G(a.1w(d[i++],c)===Q)1X}N{G(K==12){R(e 1n d)G(a.1k(d[e],e,d[e])===Q)1X}N R(J b=d[0];i<K&&a.1k(b,i,b)!==Q;b=d[++i]){}}I d},1i:H(b,a,c,i,d){G(D.1D(a))a=a.1k(b,i);I a&&a.1q==4L&&c=="2a"&&!6G.11(d)?a+"2X":a},1F:{1e:H(c,b){D.P((b||"").1R(/\\s+/),H(i,a){G(c.16==1&&!D.1F.3T(c.1F,a))c.1F+=(c.1F?" ":"")+a})},21:H(c,b){G(c.16==1)c.1F=b!=12?D.3C(c.1F.1R(/\\s+/),H(a){I!D.1F.3T(b,a)}).6s(" "):""},3T:H(b,a){I D.2L(a,(b.1F||b).6r().1R(/\\s+/))>-1}},6q:H(b,c,a){J e={};R(J d 1n c){e[d]=b.V[d];b.V[d]=c[d]}a.1k(b);R(J d 1n c)b.V[d]=e[d]},1g:H(d,e,c){G(e=="2h"||e=="1Z"){J b,3X={30:"5x",5g:"1G",18:"3I"},35=e=="2h"?["5e","6k"]:["5G","6i"];H 5b(){b=e=="2h"?d.8f:d.8c;J a=0,2C=0;D.P(35,H(){a+=3d(D.2a(d,"57"+7,M))||0;2C+=3d(D.2a(d,"2C"+7+"4b",M))||0});b-=29.83(a+2C)}G(D(d).3F(":4j"))5b();N D.6q(d,3X,5b);I 29.2f(0,b)}I D.2a(d,e,c)},2a:H(f,l,k){J e,V=f.V;H 3E(b){G(!D.14.2k)I Q;J a=3P.54(b,U);I!a||a.52("3E")==""}G(l=="1y"&&D.14.1f){e=D.1K(V,"1y");I e==""?"1":e}G(D.14.2G&&l=="18"){J d=V.50;V.50="0 7Y 7W";V.50=d}G(l.1I(/4i/i))l=y;G(!k&&V&&V[l])e=V[l];N G(3P.54){G(l.1I(/4i/i))l="4i";l=l.1o(/([A-Z])/g,"-$1").3y();J c=3P.54(f,U);G(c&&!3E(f))e=c.52(l);N{J g=[],2E=[],a=f,i=0;R(;a&&3E(a);a=a.1d)2E.6h(a);R(;i<2E.K;i++)G(3E(2E[i])){g[i]=2E[i].V.18;2E[i].V.18="3I"}e=l=="18"&&g[2E.K-1]!=U?"2F":(c&&c.52(l))||"";R(i=0;i<g.K;i++)G(g[i]!=U)2E[i].V.18=g[i]}G(l=="1y"&&e=="")e="1"}N G(f.4g){J h=l.1o(/\\-(\\w)/g,H(a,b){I b.2r()});e=f.4g[l]||f.4g[h];G(!/^\\d+(2X)?$/i.11(e)&&/^\\d/.11(e)){J j=V.1A,66=f.65.1A;f.65.1A=f.4g.1A;V.1A=e||0;e=V.aM+"2X";V.1A=j;f.65.1A=66}}I e},4h:H(l,h){J k=[];h=h||S;G(1j h.3h==\'12\')h=h.2z||h[0]&&h[0].2z||S;D.P(l,H(i,d){G(!d)I;G(d.1q==4L)d+=\'\';G(1j d=="23"){d=d.1o(/(<(\\w+)[^>]*?)\\/>/g,H(b,a,c){I c.1I(/^(aK|4f|7E|aG|4T|7A|aB|3n|az|ay|av)$/i)?b:a+"></"+c+">"});J f=D.3k(d).3y(),1v=h.3h("1v");J e=!f.1h("<au")&&[1,"<2A 7w=\'7w\'>","</2A>"]||!f.1h("<ar")&&[1,"<7v>","</7v>"]||f.1I(/^<(aq|22|am|ak|ai)/)&&[1,"<1T>","</1T>"]||!f.1h("<4F")&&[2,"<1T><22>","</22></1T>"]||(!f.1h("<af")||!f.1h("<ad"))&&[3,"<1T><22><4F>","</4F></22></1T>"]||!f.1h("<7E")&&[2,"<1T><22></22><7q>","</7q></1T>"]||D.14.1f&&[1,"1v<1v>","</1v>"]||[0,"",""];1v.4H=e[1]+d+e[2];1B(e[0]--)1v=1v.5T;G(D.14.1f){J g=!f.1h("<1T")&&f.1h("<22")<0?1v.1x&&1v.1x.3t:e[1]=="<1T>"&&f.1h("<22")<0?1v.3t:[];R(J j=g.K-1;j>=0;--j)G(D.Y(g[j],"22")&&!g[j].3t.K)g[j].1d.37(g[j]);G(/^\\s/.11(d))1v.39(h.5F(d.1I(/^\\s*/)[0]),1v.1x)}d=D.2d(1v.3t)}G(d.K===0&&(!D.Y(d,"3V")&&!D.Y(d,"2A")))I;G(d[0]==12||D.Y(d,"3V")||d.15)k.1p(d);N k=D.2R(k,d)});I k},1K:H(d,f,c){G(!d||d.16==3||d.16==8)I 12;J e=!D.4n(d),40=c!==12,1f=D.14.1f;f=e&&D.3X[f]||f;G(d.2j){J g=/5Q|4d|V/.11(f);G(f=="2W"&&D.14.2k)d.1d.64;G(f 1n d&&e&&!g){G(40){G(f=="O"&&D.Y(d,"4T")&&d.1d)7p"O a3 a1\'t 9V 9U";d[f]=c}G(D.Y(d,"3V")&&d.7i(f))I d.7i(f).76;I d[f]}G(1f&&e&&f=="V")I D.1K(d.V,"9T",c);G(40)d.9Q(f,""+c);J h=1f&&e&&g?d.4G(f,2):d.4G(f);I h===U?12:h}G(1f&&f=="1y"){G(40){d.6B=1;d.1E=(d.1E||"").1o(/7f\\([^)]*\\)/,"")+(3r(c)+\'\'=="9L"?"":"7f(1y="+c*7a+")")}I d.1E&&d.1E.1h("1y=")>=0?(3d(d.1E.1I(/1y=([^)]*)/)[1])/7a)+\'\':""}f=f.1o(/-([a-z])/9H,H(a,b){I b.2r()});G(40)d[f]=c;I d[f]},3k:H(a){I(a||"").1o(/^\\s+|\\s+$/g,"")},2d:H(b){J a=[];G(b!=U){J i=b.K;G(i==U||b.1R||b.4I||b.1k)a[0]=b;N 1B(i)a[--i]=b[i]}I a},2L:H(b,a){R(J i=0,K=a.K;i<K;i++)G(a[i]===b)I i;I-1},2R:H(a,b){J i=0,T,2S=a.K;G(D.14.1f){1B(T=b[i++])G(T.16!=8)a[2S++]=T}N 1B(T=b[i++])a[2S++]=T;I a},4r:H(a){J c=[],2o={};1U{R(J i=0,K=a.K;i<K;i++){J b=D.L(a[i]);G(!2o[b]){2o[b]=M;c.1p(a[i])}}}1V(e){c=a}I c},3C:H(c,a,d){J b=[];R(J i=0,K=c.K;i<K;i++)G(!d!=!a(c[i],i))b.1p(c[i]);I b},2l:H(d,a){J c=[];R(J i=0,K=d.K;i<K;i++){J b=a(d[i],i);G(b!=U)c[c.K]=b}I c.7d.1w([],c)}});J v=9B.9A.3y();D.14={5B:(v.1I(/.+(?:9y|9x|9w|9v)[\\/: ]([\\d.]+)/)||[])[1],2k:/75/.11(v),2G:/2G/.11(v),1f:/1f/.11(v)&&!/2G/.11(v),42:/42/.11(v)&&!/(9s|75)/.11(v)};J y=D.14.1f?"7o":"72";D.1l({71:!D.14.1f||S.70=="6Z",3X:{"R":"9n","9k":"1F","4i":y,72:y,7o:y,9h:"9f",9e:"9d",9b:"99"}});D.P({6W:H(a){I a.1d},97:H(a){I D.4S(a,"1d")},95:H(a){I D.3a(a,2,"2H")},91:H(a){I D.3a(a,2,"4l")},8Z:H(a){I D.4S(a,"2H")},8X:H(a){I D.4S(a,"4l")},8W:H(a){I D.5v(a.1d.1x,a)},8V:H(a){I D.5v(a.1x)},6Q:H(a){I D.Y(a,"8U")?a.8T||a.8S.S:D.2d(a.3t)}},H(c,d){D.17[c]=H(b){J a=D.2l(7,d);G(b&&1j b=="23")a=D.3g(b,a);I 7.2I(D.4r(a))}});D.P({6P:"3v",8Q:"6F",39:"6E",8P:"5q",8O:"7b"},H(c,b){D.17[c]=H(){J a=19;I 7.P(H(){R(J i=0,K=a.K;i<K;i++)D(a[i])[b](7)})}});D.P({8N:H(a){D.1K(7,a,"");G(7.16==1)7.5l(a)},8M:H(a){D.1F.1e(7,a)},8L:H(a){D.1F.21(7,a)},8K:H(a){D.1F[D.1F.3T(7,a)?"21":"1e"](7,a)},21:H(a){G(!a||D.1E(a,[7]).r.K){D("*",7).1e(7).P(H(){D.W.21(7);D.3b(7)});G(7.1d)7.1d.37(7)}},4E:H(){D(">*",7).21();1B(7.1x)7.37(7.1x)}},H(a,b){D.17[a]=H(){I 7.P(b,19)}});D.P(["6N","4b"],H(i,c){J b=c.3y();D.17[b]=H(a){I 7[0]==1b?D.14.2G&&S.1c["5t"+c]||D.14.2k&&1b["5s"+c]||S.70=="6Z"&&S.1C["5t"+c]||S.1c["5t"+c]:7[0]==S?29.2f(29.2f(S.1c["4y"+c],S.1C["4y"+c]),29.2f(S.1c["2i"+c],S.1C["2i"+c])):a==12?(7.K?D.1g(7[0],b):U):7.1g(b,a.1q==56?a:a+"2X")}});H 25(a,b){I a[0]&&3r(D.2a(a[0],b,M),10)||0}J C=D.14.2k&&3r(D.14.5B)<8H?"(?:[\\\\w*3m-]|\\\\\\\\.)":"(?:[\\\\w\\8F-\\8E*3m-]|\\\\\\\\.)",6L=2B 4v("^>\\\\s*("+C+"+)"),6J=2B 4v("^("+C+"+)(#)("+C+"+)"),6I=2B 4v("^([#.]?)("+C+"*)");D.1l({6H:{"":H(a,i,m){I m[2]=="*"||D.Y(a,m[2])},"#":H(a,i,m){I a.4G("2v")==m[2]},":":{8D:H(a,i,m){I i<m[3]-0},8C:H(a,i,m){I i>m[3]-0},3a:H(a,i,m){I m[3]-0==i},79:H(a,i,m){I m[3]-0==i},3o:H(a,i){I i==0},3S:H(a,i,m,r){I i==r.K-1},6D:H(a,i){I i%2==0},6C:H(a,i){I i%2},"3o-4u":H(a){I a.1d.3H("*")[0]==a},"3S-4u":H(a){I D.3a(a.1d.5T,1,"4l")==a},"8z-4u":H(a){I!D.3a(a.1d.5T,2,"4l")},6W:H(a){I a.1x},4E:H(a){I!a.1x},8y:H(a,i,m){I(a.6O||a.8x||D(a).1r()||"").1h(m[3])>=0},4j:H(a){I"1G"!=a.O&&D.1g(a,"18")!="2F"&&D.1g(a,"5g")!="1G"},1G:H(a){I"1G"==a.O||D.1g(a,"18")=="2F"||D.1g(a,"5g")=="1G"},8w:H(a){I!a.3R},3R:H(a){I a.3R},4J:H(a){I a.4J},2W:H(a){I a.2W||D.1K(a,"2W")},1r:H(a){I"1r"==a.O},5O:H(a){I"5O"==a.O},5L:H(a){I"5L"==a.O},5p:H(a){I"5p"==a.O},3Q:H(a){I"3Q"==a.O},5o:H(a){I"5o"==a.O},6A:H(a){I"6A"==a.O},6z:H(a){I"6z"==a.O},2s:H(a){I"2s"==a.O||D.Y(a,"2s")},4T:H(a){I/4T|2A|6y|2s/i.11(a.Y)},3T:H(a,i,m){I D.2q(m[3],a).K},8t:H(a){I/h\\d/i.11(a.Y)},8s:H(a){I D.3C(D.3O,H(b){I a==b.T}).K}}},6x:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,2B 4v("^([:.#]*)("+C+"+)")],3g:H(a,c,b){J d,1t=[];1B(a&&a!=d){d=a;J f=D.1E(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1t=b?c=f.r:D.2R(1t,f.r)}I 1t},2q:H(t,o){G(1j t!="23")I[t];G(o&&o.16!=1&&o.16!=9)I[];o=o||S;J d=[o],2o=[],3S,Y;1B(t&&3S!=t){J r=[];3S=t;t=D.3k(t);J l=Q,3j=6L,m=3j.2D(t);G(m){Y=m[1].2r();R(J i=0;d[i];i++)R(J c=d[i].1x;c;c=c.2H)G(c.16==1&&(Y=="*"||c.Y.2r()==Y))r.1p(c);d=r;t=t.1o(3j,"");G(t.1h(" ")==0)6M;l=M}N{3j=/^([>+~])\\s*(\\w*)/i;G((m=3j.2D(t))!=U){r=[];J k={};Y=m[2].2r();m=m[1];R(J j=0,3i=d.K;j<3i;j++){J n=m=="~"||m=="+"?d[j].2H:d[j].1x;R(;n;n=n.2H)G(n.16==1){J g=D.L(n);G(m=="~"&&k[g])1X;G(!Y||n.Y.2r()==Y){G(m=="~")k[g]=M;r.1p(n)}G(m=="+")1X}}d=r;t=D.3k(t.1o(3j,""));l=M}}G(t&&!l){G(!t.1h(",")){G(o==d[0])d.4s();2o=D.2R(2o,d);r=d=[o];t=" "+t.6v(1,t.K)}N{J h=6J;J m=h.2D(t);G(m){m=[0,m[2],m[3],m[1]]}N{h=6I;m=h.2D(t)}m[2]=m[2].1o(/\\\\/g,"");J f=d[d.K-1];G(m[1]=="#"&&f&&f.61&&!D.4n(f)){J p=f.61(m[2]);G((D.14.1f||D.14.2G)&&p&&1j p.2v=="23"&&p.2v!=m[2])p=D(\'[@2v="\'+m[2]+\'"]\',f)[0];d=r=p&&(!m[3]||D.Y(p,m[3]))?[p]:[]}N{R(J i=0;d[i];i++){J a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];G(a=="*"&&d[i].Y.3y()=="49")a="3n";r=D.2R(r,d[i].3H(a))}G(m[1]==".")r=D.5m(r,m[2]);G(m[1]=="#"){J e=[];R(J i=0;r[i];i++)G(r[i].4G("2v")==m[2]){e=[r[i]];1X}r=e}d=r}t=t.1o(h,"")}}G(t){J b=D.1E(t,r);d=r=b.r;t=D.3k(b.t)}}G(t)d=[];G(d&&o==d[0])d.4s();2o=D.2R(2o,d);I 2o},5m:H(r,m,a){m=" "+m+" ";J c=[];R(J i=0;r[i];i++){J b=(" "+r[i].1F+" ").1h(m)>=0;G(!a&&b||a&&!b)c.1p(r[i])}I c},1E:H(t,r,h){J d;1B(t&&t!=d){d=t;J p=D.6x,m;R(J i=0;p[i];i++){m=p[i].2D(t);G(m){t=t.8r(m[0].K);m[2]=m[2].1o(/\\\\/g,"");1X}}G(!m)1X;G(m[1]==":"&&m[2]=="4Y")r=62.11(m[3])?D.1E(m[3],r,M).r:D(r).4Y(m[3]);N G(m[1]==".")r=D.5m(r,m[2],h);N G(m[1]=="["){J g=[],O=m[3];R(J i=0,3i=r.K;i<3i;i++){J a=r[i],z=a[D.3X[m[2]]||m[2]];G(z==U||/5Q|4d|2W/.11(m[2]))z=D.1K(a,m[2])||\'\';G((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1h(m[5])||O=="$="&&z.6v(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1h(m[5])>=0)^h)g.1p(a)}r=g}N G(m[1]==":"&&m[2]=="3a-4u"){J e={},g=[],11=/(-?)(\\d*)n((?:\\+|-)?\\d*)/.2D(m[3]=="6D"&&"2n"||m[3]=="6C"&&"2n+1"||!/\\D/.11(m[3])&&"8q+"+m[3]||m[3]),3o=(11[1]+(11[2]||1))-0,d=11[3]-0;R(J i=0,3i=r.K;i<3i;i++){J j=r[i],1d=j.1d,2v=D.L(1d);G(!e[2v]){J c=1;R(J n=1d.1x;n;n=n.2H)G(n.16==1)n.4q=c++;e[2v]=M}J b=Q;G(3o==0){G(j.4q==d)b=M}N G((j.4q-d)%3o==0&&(j.4q-d)/3o>=0)b=M;G(b^h)g.1p(j)}r=g}N{J f=D.6H[m[1]];G(1j f=="49")f=f[m[2]];G(1j f=="23")f=6u("Q||H(a,i){I "+f+";}");r=D.3C(r,H(a,i){I f(a,i,m,r)},h)}}I{r:r,t:t}},4S:H(b,c){J a=[],1t=b[c];1B(1t&&1t!=S){G(1t.16==1)a.1p(1t);1t=1t[c]}I a},3a:H(a,e,c,b){e=e||1;J d=0;R(;a;a=a[c])G(a.16==1&&++d==e)1X;I a},5v:H(n,a){J r=[];R(;n;n=n.2H){G(n.16==1&&n!=a)r.1p(n)}I r}});D.W={1e:H(f,i,g,e){G(f.16==3||f.16==8)I;G(D.14.1f&&f.4I)f=1b;G(!g.24)g.24=7.24++;G(e!=12){J h=g;g=7.3M(h,H(){I h.1w(7,19)});g.L=e}J j=D.L(f,"3w")||D.L(f,"3w",{}),1H=D.L(f,"1H")||D.L(f,"1H",H(){G(1j D!="12"&&!D.W.5k)I D.W.1H.1w(19.3L.T,19)});1H.T=f;D.P(i.1R(/\\s+/),H(c,b){J a=b.1R(".");b=a[0];g.O=a[1];J d=j[b];G(!d){d=j[b]={};G(!D.W.2t[b]||D.W.2t[b].4p.1k(f)===Q){G(f.3K)f.3K(b,1H,Q);N G(f.6t)f.6t("4o"+b,1H)}}d[g.24]=g;D.W.26[b]=M});f=U},24:1,26:{},21:H(e,h,f){G(e.16==3||e.16==8)I;J i=D.L(e,"3w"),1L,5i;G(i){G(h==12||(1j h=="23"&&h.8p(0)=="."))R(J g 1n i)7.21(e,g+(h||""));N{G(h.O){f=h.2y;h=h.O}D.P(h.1R(/\\s+/),H(b,a){J c=a.1R(".");a=c[0];G(i[a]){G(f)2U i[a][f.24];N R(f 1n i[a])G(!c[1]||i[a][f].O==c[1])2U i[a][f];R(1L 1n i[a])1X;G(!1L){G(!D.W.2t[a]||D.W.2t[a].4A.1k(e)===Q){G(e.6p)e.6p(a,D.L(e,"1H"),Q);N G(e.6n)e.6n("4o"+a,D.L(e,"1H"))}1L=U;2U i[a]}}})}R(1L 1n i)1X;G(!1L){J d=D.L(e,"1H");G(d)d.T=U;D.3b(e,"3w");D.3b(e,"1H")}}},1P:H(h,c,f,g,i){c=D.2d(c);G(h.1h("!")>=0){h=h.3s(0,-1);J a=M}G(!f){G(7.26[h])D("*").1e([1b,S]).1P(h,c)}N{G(f.16==3||f.16==8)I 12;J b,1L,17=D.1D(f[h]||U),W=!c[0]||!c[0].32;G(W){c.6h({O:h,2J:f,32:H(){},3J:H(){},4C:1z()});c[0][E]=M}c[0].O=h;G(a)c[0].6m=M;J d=D.L(f,"1H");G(d)b=d.1w(f,c);G((!17||(D.Y(f,\'a\')&&h=="4V"))&&f["4o"+h]&&f["4o"+h].1w(f,c)===Q)b=Q;G(W)c.4s();G(i&&D.1D(i)){1L=i.1w(f,b==U?c:c.7d(b));G(1L!==12)b=1L}G(17&&g!==Q&&b!==Q&&!(D.Y(f,\'a\')&&h=="4V")){7.5k=M;1U{f[h]()}1V(e){}}7.5k=Q}I b},1H:H(b){J a,1L,38,5f,4m;b=19[0]=D.W.6l(b||1b.W);38=b.O.1R(".");b.O=38[0];38=38[1];5f=!38&&!b.6m;4m=(D.L(7,"3w")||{})[b.O];R(J j 1n 4m){J c=4m[j];G(5f||c.O==38){b.2y=c;b.L=c.L;1L=c.1w(7,19);G(a!==Q)a=1L;G(1L===Q){b.32();b.3J()}}}I a},6l:H(b){G(b[E]==M)I b;J d=b;b={8o:d};J c="8n 8m 8l 8k 2s 8j 47 5d 6j 5E 8i L 8h 8g 4K 2y 5a 59 8e 8b 58 6f 8a 88 4k 87 86 84 6d 2J 4C 6c O 82 81 35".1R(" ");R(J i=c.K;i;i--)b[c[i]]=d[c[i]];b[E]=M;b.32=H(){G(d.32)d.32();d.80=Q};b.3J=H(){G(d.3J)d.3J();d.7Z=M};b.4C=b.4C||1z();G(!b.2J)b.2J=b.6d||S;G(b.2J.16==3)b.2J=b.2J.1d;G(!b.4k&&b.4K)b.4k=b.4K==b.2J?b.6c:b.4K;G(b.58==U&&b.5d!=U){J a=S.1C,1c=S.1c;b.58=b.5d+(a&&a.2e||1c&&1c.2e||0)-(a.6b||0);b.6f=b.6j+(a&&a.2c||1c&&1c.2c||0)-(a.6a||0)}G(!b.35&&((b.47||b.47===0)?b.47:b.5a))b.35=b.47||b.5a;G(!b.59&&b.5E)b.59=b.5E;G(!b.35&&b.2s)b.35=(b.2s&1?1:(b.2s&2?3:(b.2s&4?2:0)));I b},3M:H(a,b){b.24=a.24=a.24||b.24||7.24++;I b},2t:{27:{4p:H(){55();I},4A:H(){I}},3D:{4p:H(){G(D.14.1f)I Q;D(7).2O("53",D.W.2t.3D.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("53",D.W.2t.3D.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3D";I D.W.1H.1w(7,19)}},3N:{4p:H(){G(D.14.1f)I Q;D(7).2O("51",D.W.2t.3N.2y);I M},4A:H(){G(D.14.1f)I Q;D(7).4e("51",D.W.2t.3N.2y);I M},2y:H(a){G(F(a,7))I M;a.O="3N";I D.W.1H.1w(7,19)}}}};D.17.1l({2O:H(c,a,b){I c=="4X"?7.2V(c,a,b):7.P(H(){D.W.1e(7,c,b||a,b&&a)})},2V:H(d,b,c){J e=D.W.3M(c||b,H(a){D(7).4e(a,e);I(c||b).1w(7,19)});I 7.P(H(){D.W.1e(7,d,e,c&&b)})},4e:H(a,b){I 7.P(H(){D.W.21(7,a,b)})},1P:H(c,a,b){I 7.P(H(){D.W.1P(c,a,7,M,b)})},5C:H(c,a,b){I 7[0]&&D.W.1P(c,a,7[0],Q,b)},2m:H(b){J c=19,i=1;1B(i<c.K)D.W.3M(b,c[i++]);I 7.4V(D.W.3M(b,H(a){7.4Z=(7.4Z||0)%i;a.32();I c[7.4Z++].1w(7,19)||Q}))},7X:H(a,b){I 7.2O(\'3D\',a).2O(\'3N\',b)},27:H(a){55();G(D.2Q)a.1k(S,D);N D.3A.1p(H(){I a.1k(7,D)});I 7}});D.1l({2Q:Q,3A:[],27:H(){G(!D.2Q){D.2Q=M;G(D.3A){D.P(D.3A,H(){7.1k(S)});D.3A=U}D(S).5C("27")}}});J x=Q;H 55(){G(x)I;x=M;G(S.3K&&!D.14.2G)S.3K("69",D.27,Q);G(D.14.1f&&1b==1S)(H(){G(D.2Q)I;1U{S.1C.7V("1A")}1V(3e){3B(19.3L,0);I}D.27()})();G(D.14.2G)S.3K("69",H(){G(D.2Q)I;R(J i=0;i<S.4W.K;i++)G(S.4W[i].3R){3B(19.3L,0);I}D.27()},Q);G(D.14.2k){J a;(H(){G(D.2Q)I;G(S.3f!="68"&&S.3f!="1J"){3B(19.3L,0);I}G(a===12)a=D("V, 7A[7U=7S]").K;G(S.4W.K!=a){3B(19.3L,0);I}D.27()})()}D.W.1e(1b,"43",D.27)}D.P(("7R,7Q,43,85,4y,4X,4V,7P,"+"7O,7N,89,53,51,7M,2A,"+"5o,7L,7K,8d,3e").1R(","),H(i,b){D.17[b]=H(a){I a?7.2O(b,a):7.1P(b)}});J F=H(a,c){J b=a.4k;1B(b&&b!=c)1U{b=b.1d}1V(3e){b=c}I b==c};D(1b).2O("4X",H(){D("*").1e(S).4e()});D.17.1l({67:D.17.43,43:H(g,d,c){G(1j g!=\'23\')I 7.67(g);J e=g.1h(" ");G(e>=0){J i=g.3s(e,g.K);g=g.3s(0,e)}c=c||H(){};J f="2P";G(d)G(D.1D(d)){c=d;d=U}N{d=D.3n(d);f="6g"}J h=7;D.3Y({1a:g,O:f,1O:"2K",L:d,1J:H(a,b){G(b=="1W"||b=="7J")h.2K(i?D("<1v/>").3v(a.4U.1o(/<1m(.|\\s)*?\\/1m>/g,"")).2q(i):a.4U);h.P(c,[a.4U,b,a])}});I 7},aL:H(){I D.3n(7.7I())},7I:H(){I 7.2l(H(){I D.Y(7,"3V")?D.2d(7.aH):7}).1E(H(){I 7.34&&!7.3R&&(7.4J||/2A|6y/i.11(7.Y)||/1r|1G|3Q/i.11(7.O))}).2l(H(i,c){J b=D(7).6e();I b==U?U:b.1q==2p?D.2l(b,H(a,i){I{34:c.34,2x:a}}):{34:c.34,2x:b}}).3p()}});D.P("7H,7G,7F,7D,7C,7B".1R(","),H(i,o){D.17[o]=H(f){I 7.2O(o,f)}});J B=1z();D.1l({3p:H(d,b,a,c){G(D.1D(b)){a=b;b=U}I D.3Y({O:"2P",1a:d,L:b,1W:a,1O:c})},aE:H(b,a){I D.3p(b,U,a,"1m")},aD:H(c,b,a){I D.3p(c,b,a,"3z")},aC:H(d,b,a,c){G(D.1D(b)){a=b;b={}}I D.3Y({O:"6g",1a:d,L:b,1W:a,1O:c})},aA:H(a){D.1l(D.60,a)},60:{1a:5Z.5Q,26:M,O:"2P",2T:0,7z:"4R/x-ax-3V-aw",7x:M,31:M,L:U,5Y:U,3Q:U,4Q:{2N:"4R/2N, 1r/2N",2K:"1r/2K",1m:"1r/4t, 4R/4t",3z:"4R/3z, 1r/4t",1r:"1r/as",4w:"*/*"}},4z:{},3Y:H(s){s=D.1l(M,s,D.1l(M,{},D.60,s));J g,2Z=/=\\?(&|$)/g,1u,L,O=s.O.2r();G(s.L&&s.7x&&1j s.L!="23")s.L=D.3n(s.L);G(s.1O=="4P"){G(O=="2P"){G(!s.1a.1I(2Z))s.1a+=(s.1a.1I(/\\?/)?"&":"?")+(s.4P||"7u")+"=?"}N G(!s.L||!s.L.1I(2Z))s.L=(s.L?s.L+"&":"")+(s.4P||"7u")+"=?";s.1O="3z"}G(s.1O=="3z"&&(s.L&&s.L.1I(2Z)||s.1a.1I(2Z))){g="4P"+B++;G(s.L)s.L=(s.L+"").1o(2Z,"="+g+"$1");s.1a=s.1a.1o(2Z,"="+g+"$1");s.1O="1m";1b[g]=H(a){L=a;1W();1J();1b[g]=12;1U{2U 1b[g]}1V(e){}G(i)i.37(h)}}G(s.1O=="1m"&&s.1Y==U)s.1Y=Q;G(s.1Y===Q&&O=="2P"){J j=1z();J k=s.1a.1o(/(\\?|&)3m=.*?(&|$)/,"$ap="+j+"$2");s.1a=k+((k==s.1a)?(s.1a.1I(/\\?/)?"&":"?")+"3m="+j:"")}G(s.L&&O=="2P"){s.1a+=(s.1a.1I(/\\?/)?"&":"?")+s.L;s.L=U}G(s.26&&!D.4O++)D.W.1P("7H");J n=/^(?:\\w+:)?\\/\\/([^\\/?#]+)/;G(s.1O=="1m"&&O=="2P"&&n.11(s.1a)&&n.2D(s.1a)[1]!=5Z.al){J i=S.3H("6w")[0];J h=S.3h("1m");h.4d=s.1a;G(s.7t)h.aj=s.7t;G(!g){J l=Q;h.ah=h.ag=H(){G(!l&&(!7.3f||7.3f=="68"||7.3f=="1J")){l=M;1W();1J();i.37(h)}}}i.3U(h);I 12}J m=Q;J c=1b.7s?2B 7s("ae.ac"):2B 7r();G(s.5Y)c.6R(O,s.1a,s.31,s.5Y,s.3Q);N c.6R(O,s.1a,s.31);1U{G(s.L)c.4B("ab-aa",s.7z);G(s.5S)c.4B("a9-5R-a8",D.4z[s.1a]||"a7, a6 a5 a4 5N:5N:5N a2");c.4B("X-9Z-9Y","7r");c.4B("9W",s.1O&&s.4Q[s.1O]?s.4Q[s.1O]+", */*":s.4Q.4w)}1V(e){}G(s.7m&&s.7m(c,s)===Q){s.26&&D.4O--;c.7l();I Q}G(s.26)D.W.1P("7B",[c,s]);J d=H(a){G(!m&&c&&(c.3f==4||a=="2T")){m=M;G(f){7k(f);f=U}1u=a=="2T"&&"2T"||!D.7j(c)&&"3e"||s.5S&&D.7h(c,s.1a)&&"7J"||"1W";G(1u=="1W"){1U{L=D.6X(c,s.1O,s.9S)}1V(e){1u="5J"}}G(1u=="1W"){J b;1U{b=c.5I("7g-5R")}1V(e){}G(s.5S&&b)D.4z[s.1a]=b;G(!g)1W()}N D.5H(s,c,1u);1J();G(s.31)c=U}};G(s.31){J f=4I(d,13);G(s.2T>0)3B(H(){G(c){c.7l();G(!m)d("2T")}},s.2T)}1U{c.9P(s.L)}1V(e){D.5H(s,c,U,e)}G(!s.31)d();H 1W(){G(s.1W)s.1W(L,1u);G(s.26)D.W.1P("7C",[c,s])}H 1J(){G(s.1J)s.1J(c,1u);G(s.26)D.W.1P("7F",[c,s]);G(s.26&&!--D.4O)D.W.1P("7G")}I c},5H:H(s,a,b,e){G(s.3e)s.3e(a,b,e);G(s.26)D.W.1P("7D",[a,s,e])},4O:0,7j:H(a){1U{I!a.1u&&5Z.9O=="5p:"||(a.1u>=7e&&a.1u<9N)||a.1u==7c||a.1u==9K||D.14.2k&&a.1u==12}1V(e){}I Q},7h:H(a,c){1U{J b=a.5I("7g-5R");I a.1u==7c||b==D.4z[c]||D.14.2k&&a.1u==12}1V(e){}I Q},6X:H(a,c,b){J d=a.5I("9J-O"),2N=c=="2N"||!c&&d&&d.1h("2N")>=0,L=2N?a.9I:a.4U;G(2N&&L.1C.2j=="5J")7p"5J";G(b)L=b(L,c);G(c=="1m")D.5u(L);G(c=="3z")L=6u("("+L+")");I L},3n:H(a){J s=[];G(a.1q==2p||a.5w)D.P(a,H(){s.1p(3u(7.34)+"="+3u(7.2x))});N R(J j 1n a)G(a[j]&&a[j].1q==2p)D.P(a[j],H(){s.1p(3u(j)+"="+3u(7))});N s.1p(3u(j)+"="+3u(D.1D(a[j])?a[j]():a[j]));I s.6s("&").1o(/%20/g,"+")}});D.17.1l({1N:H(c,b){I c?7.2g({1Z:"1N",2h:"1N",1y:"1N"},c,b):7.1E(":1G").P(H(){7.V.18=7.5D||"";G(D.1g(7,"18")=="2F"){J a=D("<"+7.2j+" />").6P("1c");7.V.18=a.1g("18");G(7.V.18=="2F")7.V.18="3I";a.21()}}).3l()},1M:H(b,a){I b?7.2g({1Z:"1M",2h:"1M",1y:"1M"},b,a):7.1E(":4j").P(H(){7.5D=7.5D||D.1g(7,"18");7.V.18="2F"}).3l()},78:D.17.2m,2m:H(a,b){I D.1D(a)&&D.1D(b)?7.78.1w(7,19):a?7.2g({1Z:"2m",2h:"2m",1y:"2m"},a,b):7.P(H(){D(7)[D(7).3F(":1G")?"1N":"1M"]()})},9G:H(b,a){I 7.2g({1Z:"1N"},b,a)},9F:H(b,a){I 7.2g({1Z:"1M"},b,a)},9E:H(b,a){I 7.2g({1Z:"2m"},b,a)},9D:H(b,a){I 7.2g({1y:"1N"},b,a)},9M:H(b,a){I 7.2g({1y:"1M"},b,a)},9C:H(c,a,b){I 7.2g({1y:a},c,b)},2g:H(k,j,i,g){J h=D.77(j,i,g);I 7[h.36===Q?"P":"36"](H(){G(7.16!=1)I Q;J f=D.1l({},h),p,1G=D(7).3F(":1G"),46=7;R(p 1n k){G(k[p]=="1M"&&1G||k[p]=="1N"&&!1G)I f.1J.1k(7);G(p=="1Z"||p=="2h"){f.18=D.1g(7,"18");f.33=7.V.33}}G(f.33!=U)7.V.33="1G";f.45=D.1l({},k);D.P(k,H(c,a){J e=2B D.28(46,f,c);G(/2m|1N|1M/.11(a))e[a=="2m"?1G?"1N":"1M":a](k);N{J b=a.6r().1I(/^([+-]=)?([\\d+-.]+)(.*)$/),2b=e.1t(M)||0;G(b){J d=3d(b[2]),2M=b[3]||"2X";G(2M!="2X"){46.V[c]=(d||1)+2M;2b=((d||1)/e.1t(M))*2b;46.V[c]=2b+2M}G(b[1])d=((b[1]=="-="?-1:1)*d)+2b;e.3G(2b,d,2M)}N e.3G(2b,a,"")}});I M})},36:H(a,b){G(D.1D(a)||(a&&a.1q==2p)){b=a;a="28"}G(!a||(1j a=="23"&&!b))I A(7[0],a);I 7.P(H(){G(b.1q==2p)A(7,a,b);N{A(7,a).1p(b);G(A(7,a).K==1)b.1k(7)}})},9X:H(b,c){J a=D.3O;G(b)7.36([]);7.P(H(){R(J i=a.K-1;i>=0;i--)G(a[i].T==7){G(c)a[i](M);a.7n(i,1)}});G(!c)7.5A();I 7}});J A=H(b,c,a){G(b){c=c||"28";J q=D.L(b,c+"36");G(!q||a)q=D.L(b,c+"36",D.2d(a))}I q};D.17.5A=H(a){a=a||"28";I 7.P(H(){J q=A(7,a);q.4s();G(q.K)q[0].1k(7)})};D.1l({77:H(b,a,c){J d=b&&b.1q==a0?b:{1J:c||!c&&a||D.1D(b)&&b,2u:b,41:c&&a||a&&a.1q!=9t&&a};d.2u=(d.2u&&d.2u.1q==4L?d.2u:D.28.5K[d.2u])||D.28.5K.74;d.5M=d.1J;d.1J=H(){G(d.36!==Q)D(7).5A();G(D.1D(d.5M))d.5M.1k(7)};I d},41:{73:H(p,n,b,a){I b+a*p},5P:H(p,n,b,a){I((-29.9r(p*29.9q)/2)+0.5)*a+b}},3O:[],48:U,28:H(b,c,a){7.15=c;7.T=b;7.1i=a;G(!c.3Z)c.3Z={}}});D.28.44={4D:H(){G(7.15.2Y)7.15.2Y.1k(7.T,7.1z,7);(D.28.2Y[7.1i]||D.28.2Y.4w)(7);G(7.1i=="1Z"||7.1i=="2h")7.T.V.18="3I"},1t:H(a){G(7.T[7.1i]!=U&&7.T.V[7.1i]==U)I 7.T[7.1i];J r=3d(D.1g(7.T,7.1i,a));I r&&r>-9p?r:3d(D.2a(7.T,7.1i))||0},3G:H(c,b,d){7.5V=1z();7.2b=c;7.3l=b;7.2M=d||7.2M||"2X";7.1z=7.2b;7.2S=7.4N=0;7.4D();J e=7;H t(a){I e.2Y(a)}t.T=7.T;D.3O.1p(t);G(D.48==U){D.48=4I(H(){J a=D.3O;R(J i=0;i<a.K;i++)G(!a[i]())a.7n(i--,1);G(!a.K){7k(D.48);D.48=U}},13)}},1N:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1N=M;7.3G(0,7.1t());G(7.1i=="2h"||7.1i=="1Z")7.T.V[7.1i]="9m";D(7.T).1N()},1M:H(){7.15.3Z[7.1i]=D.1K(7.T.V,7.1i);7.15.1M=M;7.3G(7.1t(),0)},2Y:H(a){J t=1z();G(a||t>7.15.2u+7.5V){7.1z=7.3l;7.2S=7.4N=1;7.4D();7.15.45[7.1i]=M;J b=M;R(J i 1n 7.15.45)G(7.15.45[i]!==M)b=Q;G(b){G(7.15.18!=U){7.T.V.33=7.15.33;7.T.V.18=7.15.18;G(D.1g(7.T,"18")=="2F")7.T.V.18="3I"}G(7.15.1M)7.T.V.18="2F";G(7.15.1M||7.15.1N)R(J p 1n 7.15.45)D.1K(7.T.V,p,7.15.3Z[p])}G(b)7.15.1J.1k(7.T);I Q}N{J n=t-7.5V;7.4N=n/7.15.2u;7.2S=D.41[7.15.41||(D.41.5P?"5P":"73")](7.4N,n,0,1,7.15.2u);7.1z=7.2b+((7.3l-7.2b)*7.2S);7.4D()}I M}};D.1l(D.28,{5K:{9l:9j,9i:7e,74:9g},2Y:{2e:H(a){a.T.2e=a.1z},2c:H(a){a.T.2c=a.1z},1y:H(a){D.1K(a.T.V,"1y",a.1z)},4w:H(a){a.T.V[a.1i]=a.1z+a.2M}}});D.17.2i=H(){J b=0,1S=0,T=7[0],3q;G(T)ao(D.14){J d=T.1d,4a=T,1s=T.1s,1Q=T.2z,5U=2k&&3r(5B)<9c&&!/9a/i.11(v),1g=D.2a,3c=1g(T,"30")=="3c";G(T.7y){J c=T.7y();1e(c.1A+29.2f(1Q.1C.2e,1Q.1c.2e),c.1S+29.2f(1Q.1C.2c,1Q.1c.2c));1e(-1Q.1C.6b,-1Q.1C.6a)}N{1e(T.5X,T.5W);1B(1s){1e(1s.5X,1s.5W);G(42&&!/^t(98|d|h)$/i.11(1s.2j)||2k&&!5U)2C(1s);G(!3c&&1g(1s,"30")=="3c")3c=M;4a=/^1c$/i.11(1s.2j)?4a:1s;1s=1s.1s}1B(d&&d.2j&&!/^1c|2K$/i.11(d.2j)){G(!/^96|1T.*$/i.11(1g(d,"18")))1e(-d.2e,-d.2c);G(42&&1g(d,"33")!="4j")2C(d);d=d.1d}G((5U&&(3c||1g(4a,"30")=="5x"))||(42&&1g(4a,"30")!="5x"))1e(-1Q.1c.5X,-1Q.1c.5W);G(3c)1e(29.2f(1Q.1C.2e,1Q.1c.2e),29.2f(1Q.1C.2c,1Q.1c.2c))}3q={1S:1S,1A:b}}H 2C(a){1e(D.2a(a,"6V",M),D.2a(a,"6U",M))}H 1e(l,t){b+=3r(l,10)||0;1S+=3r(t,10)||0}I 3q};D.17.1l({30:H(){J a=0,1S=0,3q;G(7[0]){J b=7.1s(),2i=7.2i(),4c=/^1c|2K$/i.11(b[0].2j)?{1S:0,1A:0}:b.2i();2i.1S-=25(7,\'94\');2i.1A-=25(7,\'aF\');4c.1S+=25(b,\'6U\');4c.1A+=25(b,\'6V\');3q={1S:2i.1S-4c.1S,1A:2i.1A-4c.1A}}I 3q},1s:H(){J a=7[0].1s;1B(a&&(!/^1c|2K$/i.11(a.2j)&&D.1g(a,\'30\')==\'93\'))a=a.1s;I D(a)}});D.P([\'5e\',\'5G\'],H(i,b){J c=\'4y\'+b;D.17[c]=H(a){G(!7[0])I;I a!=12?7.P(H(){7==1b||7==S?1b.92(!i?a:D(1b).2e(),i?a:D(1b).2c()):7[c]=a}):7[0]==1b||7[0]==S?46[i?\'aI\':\'aJ\']||D.71&&S.1C[c]||S.1c[c]:7[0][c]}});D.P(["6N","4b"],H(i,b){J c=i?"5e":"5G",4f=i?"6k":"6i";D.17["5s"+b]=H(){I 7[b.3y()]()+25(7,"57"+c)+25(7,"57"+4f)};D.17["90"+b]=H(a){I 7["5s"+b]()+25(7,"2C"+c+"4b")+25(7,"2C"+4f+"4b")+(a?25(7,"6S"+c)+25(7,"6S"+4f):0)}})})();',62,669,'|||||||this|||||||||||||||||||||||||||||||||||if|function|return|var|length|data|true|else|type|each|false|for|document|elem|null|style|event||nodeName|||test|undefined||browser|options|nodeType|fn|display|arguments|url|window|body|parentNode|add|msie|css|indexOf|prop|typeof|call|extend|script|in|replace|push|constructor|text|offsetParent|cur|status|div|apply|firstChild|opacity|now|left|while|documentElement|isFunction|filter|className|hidden|handle|match|complete|attr|ret|hide|show|dataType|trigger|doc|split|top|table|try|catch|success|break|cache|height||remove|tbody|string|guid|num|global|ready|fx|Math|curCSS|start|scrollTop|makeArray|scrollLeft|max|animate|width|offset|tagName|safari|map|toggle||done|Array|find|toUpperCase|button|special|duration|id|copy|value|handler|ownerDocument|select|new|border|exec|stack|none|opera|nextSibling|pushStack|target|html|inArray|unit|xml|bind|GET|isReady|merge|pos|timeout|delete|one|selected|px|step|jsre|position|async|preventDefault|overflow|name|which|queue|removeChild|namespace|insertBefore|nth|removeData|fixed|parseFloat|error|readyState|multiFilter|createElement|rl|re|trim|end|_|param|first|get|results|parseInt|slice|childNodes|encodeURIComponent|append|events|elems|toLowerCase|json|readyList|setTimeout|grep|mouseenter|color|is|custom|getElementsByTagName|block|stopPropagation|addEventListener|callee|proxy|mouseleave|timers|defaultView|password|disabled|last|has|appendChild|form|domManip|props|ajax|orig|set|easing|mozilla|load|prototype|curAnim|self|charCode|timerId|object|offsetChild|Width|parentOffset|src|unbind|br|currentStyle|clean|float|visible|relatedTarget|previousSibling|handlers|isXMLDoc|on|setup|nodeIndex|unique|shift|javascript|child|RegExp|_default|deep|scroll|lastModified|teardown|setRequestHeader|timeStamp|update|empty|tr|getAttribute|innerHTML|setInterval|checked|fromElement|Number|jQuery|state|active|jsonp|accepts|application|dir|input|responseText|click|styleSheets|unload|not|lastToggle|outline|mouseout|getPropertyValue|mouseover|getComputedStyle|bindReady|String|padding|pageX|metaKey|keyCode|getWH|andSelf|clientX|Left|all|visibility|container|index|init|triggered|removeAttribute|classFilter|prevObject|submit|file|after|windowData|inner|client|globalEval|sibling|jquery|absolute|clone|wrapAll|dequeue|version|triggerHandler|oldblock|ctrlKey|createTextNode|Top|handleError|getResponseHeader|parsererror|speeds|checkbox|old|00|radio|swing|href|Modified|ifModified|lastChild|safari2|startTime|offsetTop|offsetLeft|username|location|ajaxSettings|getElementById|isSimple|values|selectedIndex|runtimeStyle|rsLeft|_load|loaded|DOMContentLoaded|clientTop|clientLeft|toElement|srcElement|val|pageY|POST|unshift|Bottom|clientY|Right|fix|exclusive|detachEvent|cloneNode|removeEventListener|swap|toString|join|attachEvent|eval|substr|head|parse|textarea|reset|image|zoom|odd|even|before|prepend|exclude|expr|quickClass|quickID|uuid|quickChild|continue|Height|textContent|appendTo|contents|open|margin|evalScript|borderTopWidth|borderLeftWidth|parent|httpData|setArray|CSS1Compat|compatMode|boxModel|cssFloat|linear|def|webkit|nodeValue|speed|_toggle|eq|100|replaceWith|304|concat|200|alpha|Last|httpNotModified|getAttributeNode|httpSuccess|clearInterval|abort|beforeSend|splice|styleFloat|throw|colgroup|XMLHttpRequest|ActiveXObject|scriptCharset|callback|fieldset|multiple|processData|getBoundingClientRect|contentType|link|ajaxSend|ajaxSuccess|ajaxError|col|ajaxComplete|ajaxStop|ajaxStart|serializeArray|notmodified|keypress|keydown|change|mouseup|mousedown|dblclick|focus|blur|stylesheet|hasClass|rel|doScroll|black|hover|solid|cancelBubble|returnValue|wheelDelta|view|round|shiftKey|resize|screenY|screenX|relatedNode|mousemove|prevValue|originalTarget|offsetHeight|keyup|newValue|offsetWidth|eventPhase|detail|currentTarget|cancelable|bubbles|attrName|attrChange|altKey|originalEvent|charAt|0n|substring|animated|header|noConflict|line|enabled|innerText|contains|only|weight|font|gt|lt|uFFFF|u0128|size|417|Boolean|Date|toggleClass|removeClass|addClass|removeAttr|replaceAll|insertAfter|prependTo|wrap|contentWindow|contentDocument|iframe|children|siblings|prevAll|wrapInner|nextAll|outer|prev|scrollTo|static|marginTop|next|inline|parents|able|cellSpacing|adobeair|cellspacing|522|maxLength|maxlength|readOnly|400|readonly|fast|600|class|slow|1px|htmlFor|reverse|10000|PI|cos|compatible|Function|setData|ie|ra|it|rv|getData|userAgent|navigator|fadeTo|fadeIn|slideToggle|slideUp|slideDown|ig|responseXML|content|1223|NaN|fadeOut|300|protocol|send|setAttribute|option|dataFilter|cssText|changed|be|Accept|stop|With|Requested|Object|can|GMT|property|1970|Jan|01|Thu|Since|If|Type|Content|XMLHTTP|th|Microsoft|td|onreadystatechange|onload|cap|charset|colg|host|tfoot|specified|with|1_|thead|leg|plain|attributes|opt|embed|urlencoded|www|area|hr|ajaxSetup|meta|post|getJSON|getScript|marginLeft|img|elements|pageYOffset|pageXOffset|abbr|serialize|pixelLeft'.split('|'),0,{}))
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('6.16={3e:D(e){C x=0;C y=0;C 31=F;C 1j=e.18;k(6(e).H(\'1e\')==\'1k\'){3l=1j.2o;5e=1j.Q;1j.2o=\'3q\';1j.1e=\'3E\';1j.Q=\'2s\';31=12}C A=e;65(A){x+=A.56+(A.4c&&!6.2A.5Y?J(A.4c.6c)||0:0);y+=A.5i+(A.4c&&!6.2A.5Y?J(A.4c.6v)||0:0);A=A.7u}A=e;65(A&&A.4I&&A.4I.5l()!=\'1J\'){x-=A.4s||0;y-=A.3F||0;A=A.2S}k(31){1j.1e=\'1k\';1j.Q=5e;1j.2o=3l}E{x:x,y:y}},bl:D(A){C x=0,y=0;65(A){x+=A.56||0;y+=A.5i||0;A=A.7u}E{x:x,y:y}},2d:D(e){C w=6.H(e,\'Z\');C h=6.H(e,\'V\');C 1F=0;C 1y=0;C 1j=e.18;k(6(e).H(\'1e\')!=\'1k\'){1F=e.5A;1y=e.63}P{3l=1j.2o;5e=1j.Q;1j.2o=\'3q\';1j.1e=\'3E\';1j.Q=\'2s\';1F=e.5A;1y=e.63;1j.1e=\'1k\';1j.Q=5e;1j.2o=3l}E{w:w,h:h,1F:1F,1y:1y}},6O:D(A){E{1F:A.5A||0,1y:A.63||0}},8o:D(e){C h,w,3W;k(e){w=e.4E;h=e.4U}P{3W=17.2q;w=3t.6s||54.6s||(3W&&3W.4E)||17.1J.4E;h=3t.66||54.66||(3W&&3W.4U)||17.1J.4U}E{w:w,h:h}},7a:D(e){C t,l,w,h,4m,4q;k(e&&e.5J.5l()!=\'1J\'){t=e.3F;l=e.4s;w=e.68;h=e.6w;4m=0;4q=0}P{k(17.2q&&17.2q.3F){t=17.2q.3F;l=17.2q.4s;w=17.2q.68;h=17.2q.6w}P k(17.1J){t=17.1J.3F;l=17.1J.4s;w=17.1J.68;h=17.1J.6w}4m=54.6s||17.2q.4E||17.1J.4E||0;4q=54.66||17.2q.4U||17.1J.4U||0}E{t:t,l:l,w:w,h:h,4m:4m,4q:4q}},7W:D(e,4u){C A=6(e);C t=A.H(\'3D\')||\'\';C r=A.H(\'3G\')||\'\';C b=A.H(\'3H\')||\'\';C l=A.H(\'3I\')||\'\';k(4u)E{t:J(t)||0,r:J(r)||0,b:J(b)||0,l:J(l)};P E{t:t,r:r,b:b,l:l}},aY:D(e,4u){C A=6(e);C t=A.H(\'80\')||\'\';C r=A.H(\'81\')||\'\';C b=A.H(\'88\')||\'\';C l=A.H(\'87\')||\'\';k(4u)E{t:J(t)||0,r:J(r)||0,b:J(b)||0,l:J(l)};P E{t:t,r:r,b:b,l:l}},62:D(e,4u){C A=6(e);C t=A.H(\'6v\')||\'\';C r=A.H(\'86\')||\'\';C b=A.H(\'84\')||\'\';C l=A.H(\'6c\')||\'\';k(4u)E{t:J(t)||0,r:J(r)||0,b:J(b)||0,l:J(l)||0};P E{t:t,r:r,b:b,l:l}},30:D(3o){C x=3o.at||(3o.au+(17.2q.4s||17.1J.4s))||0;C y=3o.b4||(3o.bv+(17.2q.3F||17.1J.3F))||0;E{x:x,y:y}},6C:D(2u,6o){6o(2u);2u=2u.4M;65(2u){6.16.6C(2u,6o);2u=2u.bI}},bt:D(2u){6.16.6C(2u,D(A){1B(C 1N 1W A){k(25 A[1N]===\'D\'){A[1N]=Y}}})},9k:D(A,1u){C 2L=$.16.7a();C 6h=$.16.2d(A);k(!1u||1u==\'2e\')$(A).H({M:2L.t+((1t.2I(2L.h,2L.4q)-2L.t-6h.1y)/2)+\'14\'});k(!1u||1u==\'29\')$(A).H({L:2L.l+((1t.2I(2L.w,2L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\\%\\s*,\\s*([0-9]+(?:\\.[0-9]+)?)\\%\\s*\\)$/.5P(2v))E{r:2g(1K[1])*2.55,g:2g(1K[2])*2.55,b:2g(1K[3])*2.55};P k(1K=/^#([a-4l-4o-9])([a-4l-4o-9])([a-4l-4o-9])$/.5P(2v))E{r:J("4g"+1K[1]+1K[1]),g:J("4g"+1K[2]+1K[2]),b:J("4g"+1K[3]+1K[3])};P k(1K=/^#([a-4l-4o-9]{2})([a-4l-4o-9]{2})([a-4l-4o-9]{2})$/.5P(2v))E{r:J("4g"+1K[1]),g:J("4g"+1K[2]),b:J("4g"+1K[3])};P E 7T==12?F:{r:1m,g:1m,b:1m}};6.O.7k={84:1,6c:1,86:1,6v:1,3y:1,bO:1,V:1,L:1,bF:1,bE:1,3H:1,3I:1,3G:1,3D:1,4W:1,5q:1,4T:1,57:1,1H:1,bx:1,bw:1,88:1,87:1,81:1,80:1,43:1,by:1,M:1,Z:1,2r:1};6.O.7g={bz:1,bD:1,bC:1,bB:1,bA:1,2v:1,b3:1};6.O.4X=[\'ay\',\'aw\',\'av\',\'az\'];6.O.6t={\'6z\':[\'4H\',\'7b\'],\'5y\':[\'4H\',\'6l\'],\'5G\':[\'5G\',\'\'],\'5z\':[\'5z\',\'\']};6.3v.1Q({8x:D(3a,1i,19,1r){E u.2j(D(){C 5H=6.1i(1i,19,1r);C e=1I 6.7i(u,5H,3a)})},6y:D(1i,1r){E u.2j(D(){C 5H=6.1i(1i,1r);C e=1I 6.6y(u,5H)})},58:D(2x){E u.1L(D(){k(u.3d)6.6n(u,2x)})},aE:D(2x){E u.1L(D(){k(u.3d)6.6n(u,2x);k(u.2j&&u.2j[\'O\'])u.2j.O=[]})}});6.1Q({6y:D(1l,R){C z=u,1O;z.2x=D(){k(6.7q(R.3z))R.3z.1A(1l)};z.4z=7t(D(){z.2x()},R.2C);1l.3d=z},19:{7h:D(p,n,7y,7X,2C){E((-1t.aC(p*1t.aB)/2)+0.5)*7X+7y}},7i:D(1l,R,3a){C z=u,1O;C y=1l.18;C 7v=6.H(1l,"3m");C 45=6.H(1l,"1e");C 1n={};z.5V=(1I 7z()).7A();R.19=R.19&&6.19[R.19]?R.19:\'7h\';z.5F=D(1s,24){k(6.O.7k[1s]){k(24==\'2t\'||24==\'2k\'||24==\'7m\'){k(!1l.3K)1l.3K={};C r=2g(6.3C(1l,1s));1l.3K[1s]=r&&r>-78?r:(2g(6.H(1l,1s))||0);24=24==\'7m\'?(45==\'1k\'?\'2t\':\'2k\'):24;R[24]=12;1n[1s]=24==\'2t\'?[0,1l.3K[1s]]:[1l.3K[1s],0];k(1s!=\'1H\')y[1s]=1n[1s][0]+(1s!=\'2r\'&&1s!=\'6p\'?\'14\':\'\');P 6.1N(y,"1H",1n[1s][0])}P{1n[1s]=[2g(6.3C(1l,1s)),2g(24)||0]}}P k(6.O.7g[1s])1n[1s]=[6.O.3B(6.3C(1l,1s)),6.O.3B(24)];P k(/^5G$|5z$|4H$|5y$|6z$/i.4d(1s)){C m=24.3c(/\\s+/g,\' \').3c(/46\\s*\\(\\s*/g,\'46(\').3c(/\\s*,\\s*/g,\',\').3c(/\\s*\\)/g,\')\').8C(/([^\\s]+)/g);2Z(1s){1a\'5G\':1a\'5z\':1a\'6z\':1a\'5y\':m[3]=m[3]||m[1]||m[0];m[2]=m[2]||m[0];m[1]=m[1]||m[0];1B(C i=0;i<6.O.4X.1Y;i++){C 3b=6.O.6t[1s][0]+6.O.4X[i]+6.O.6t[1s][1];1n[3b]=1s==\'5y\'?[6.O.3B(6.3C(1l,3b)),6.O.3B(m[i])]:[2g(6.3C(1l,3b)),2g(m[i])]}1p;1a\'4H\':1B(C i=0;i<m.1Y;i++){C 6k=2g(m[i]);C 5v=!an(6k)?\'7b\':(!/as|1k|3q|ar|aq|ap|aF|aG|aW|aV|aU/i.4d(m[i])?\'6l\':F);k(5v){1B(C j=0;j<6.O.4X.1Y;j++){3b=\'4H\'+6.O.4X[j]+5v;1n[3b]=5v==\'6l\'?[6.O.3B(6.3C(1l,3b)),6.O.3B(m[i])]:[2g(6.3C(1l,3b)),6k]}}P{y[\'b1\']=m[i]}}1p}}P{y[1s]=24}E F};1B(p 1W 3a){k(p==\'18\'){C 2Q=6.6m(3a[p]);1B(4b 1W 2Q){u.5F(4b,2Q[4b])}}P k(p==\'2E\'){k(17.5B)1B(C i=0;i<17.5B.1Y;i++){C 4a=17.5B[i].4a||17.5B[i].aR||Y;k(4a){1B(C j=0;j<4a.1Y;j++){k(4a[j].aK==\'.\'+3a[p]){C 4n=1I aJ(\'\\.\'+3a[p]+\' {\');C 3g=4a[j].18.aH;C 2Q=6.6m(3g.3c(4n,\'\').3c(/}/g,\'\'));1B(4b 1W 2Q){u.5F(4b,2Q[4b])}}}}}}P{u.5F(p,3a[p])}}y.1e=45==\'1k\'?\'3E\':45;y.3m=\'3q\';z.2x=D(){C t=(1I 7z()).7A();k(t>R.2C+z.5V){8G(z.4z);z.4z=Y;1B(p 1W 1n){k(p=="1H")6.1N(y,"1H",1n[p][1]);P k(25 1n[p][1]==\'6r\')y[p]=\'46(\'+1n[p][1].r+\',\'+1n[p][1].g+\',\'+1n[p][1].b+\')\';P y[p]=1n[p][1]+(p!=\'2r\'&&p!=\'6p\'?\'14\':\'\')}k(R.2k||R.2t)1B(C p 1W 1l.3K)k(p=="1H")6.1N(y,p,1l.3K[p]);P y[p]="";y.1e=R.2k?\'1k\':(45!=\'1k\'?45:\'3E\');y.3m=7v;1l.3d=Y;k(6.7q(R.3z))R.3z.1A(1l)}P{C n=t-u.5V;C 4B=n/R.2C;1B(p 1W 1n){k(25 1n[p][1]==\'6r\'){y[p]=\'46(\'+J(6.19[R.19](4B,n,1n[p][0].r,(1n[p][1].r-1n[p][0].r),R.2C))+\',\'+J(6.19[R.19](4B,n,1n[p][0].g,(1n[p][1].g-1n[p][0].g),R.2C))+\',\'+J(6.19[R.19](4B,n,1n[p][0].b,(1n[p][1].b-1n[p][0].b),R.2C))+\')\'}P{C 6u=6.19[R.19](4B,n,1n[p][0],(1n[p][1]-1n[p][0]),R.2C);k(p=="1H")6.1N(y,"1H",6u);P y[p]=6u+(p!=\'2r\'&&p!=\'6p\'?\'14\':\'\')}}}};z.4z=7t(D(){z.2x()},13);1l.3d=z},6n:D(1l,2x){k(2x)1l.3d.5V-=bQ;P{3t.8G(1l.3d.4z);1l.3d=Y;6.6A(1l,"O")}}});6.6m=D(3g){C 2Q={};k(25 3g==\'5h\'){3g=3g.5l().8I(\';\');1B(C i=0;i<3g.1Y;i++){4n=3g[i].8I(\':\');k(4n.1Y==2){2Q[6.8K(4n[0].3c(/\\-(\\w)/g,D(m,c){E c.aN()}))]=6.8K(4n[1])}}}E 2Q};6.G={1b:Y,q:Y,4e:D(){E u.1L(D(){k(u.5f){u.7.2H.26(\'2J\',6.G.77);u.7=Y;u.5f=F;k(6.2A.4i){u.6x="aL"}P{u.18.aI=\'\';u.18.8E=\'\';u.18.8g=\'\'}}})},77:D(e){k(6.G.q!=Y){6.G.5n(e);E F}C 8=u.1X;6(17).1S(\'2l\',6.G.6q).1S(\'4p\',6.G.5n);8.7.1c=6.16.30(e);8.7.2b=8.7.1c;8.7.5r=F;8.7.aS=u!=u.1X;6.G.q=8;k(8.7.2V&&u!=u.1X){6B=6.16.3e(8.2S);6j=6.16.2d(8);6D={x:J(6.H(8,\'L\'))||0,y:J(6.H(8,\'M\'))||0};W=8.7.2b.x-6B.x-6j.1F/2-6D.x;X=8.7.2b.y-6B.y-6j.1y/2-6D.y;6.1M.2F(8,[W,X])}E 6.aX||F},8v:D(e){C 8=6.G.q;8.7.5r=12;C 5m=8.18;8.7.4k=6.H(8,\'1e\');8.7.3s=6.H(8,\'Q\');k(!8.7.8l)8.7.8l=8.7.3s;8.7.1h={x:J(6.H(8,\'L\'))||0,y:J(6.H(8,\'M\'))||0};8.7.5j=0;8.7.5b=0;k(6.2A.4i){C 6a=6.16.62(8,12);8.7.5j=6a.l||0;8.7.5b=6a.t||0}8.7.11=6.1Q(6.16.3e(8),6.16.2d(8));k(8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.G.6U}k(8.7.2r!=F){6.G.1b.H(\'2r\',8.7.2r)}k(8.7.1H){6.G.1b.H(\'1H\',8.7.1H);k(3t.5a){6.G.1b.H(\'69\',\'8A(1H=\'+8.7.1H*2W+\')\')}}k(8.7.3X){6.G.1b.5R(8.7.3X);6.G.1b.1g(0).4M.18.1e=\'1k\'}k(8.7.3i)8.7.3i.1A(8,[2T,8.7.1h.x,8.7.1h.y]);k(6.T&&6.T.4Y>0){6.T.8a(8)}k(8.7.4v==F){5m.1e=\'1k\'}E F},6J:D(8){k(8.7.1E.1D==73){k(8.7.1E==\'4R\'){8.7.1f=6.1Q({x:0,y:0},6.16.2d(8.2S));C 4Z=6.16.62(8.2S,12);8.7.1f.w=8.7.1f.1F-4Z.l-4Z.r;8.7.1f.h=8.7.1f.1y-4Z.t-4Z.b}P k(8.7.1E==\'17\'){C 6f=6.16.8o();8.7.1f={x:0,y:0,w:6f.w,h:6f.h}}}P k(8.7.1E.1D==4S){8.7.1f={x:J(8.7.1E[0])||0,y:J(8.7.1E[1])||0,w:J(8.7.1E[2])||0,h:J(8.7.1E[3])||0}}8.7.1f.W=8.7.1f.x-8.7.11.x;8.7.1f.X=8.7.1f.y-8.7.11.y},5o:D(q){k(q.7.4L||q.7.1E==\'4R\'){6(\'1J\',17).4A(6.G.1b.1g(0))}6.G.1b.8p().2k().H(\'1H\',1);k(3t.5a){6.G.1b.H(\'69\',\'8A(1H=2W)\')}},5n:D(e){6(17).26(\'2l\',6.G.6q).26(\'4p\',6.G.5n);k(6.G.q==Y){E}C q=6.G.q;6.G.q=Y;k(q.7.5r==F){E F}k(q.7.2y==12){6(q).H(\'Q\',q.7.3s)}C 5m=q.18;k(q.2V){6.G.1b.H(\'6Q\',\'4Q\')}k(q.7.3X){6.G.1b.5I(q.7.3X)}k(q.7.67==F){k(q.7.O>0){k(!q.7.1u||q.7.1u==\'29\'){C x=1I 6.O(q,{2C:q.7.O},\'L\');x.2w(q.7.1h.x,q.7.52)}k(!q.7.1u||q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,3u.Q)}}}2K.L=1o.L+\'14\';2K.M=1o.M+\'14\';2K.Z=U.Z+\'14\';2K.V=U.V+\'14\';E F},2B:D(R){k(!R||!R.22||R.22.1D!=5C){E}E u.1L(D(){C A=u;A.I=R;A.I.57=R.57||10;A.I.4T=R.4T||10;A.I.5q=R.5q||4y;A.I.4W=R.4W||4y;A.I.3S=R.3S||-8s;A.I.44=R.44||-8s;A.I.4C=R.4C||4y;A.I.4D=R.4D||4y;6M=6(A).H(\'Q\');k(!(6M==\'2i\'||6M==\'2s\')){A.18.Q=\'2i\'}8B=/n|5p|e|8w|s|5k|w|3U/g;1B(i 1W A.I.22){k(i.5l().8C(8B)!=Y){k(A.I.22[i].1D==73){2z=6(A.I.22[i]);k(2z.4V()>0){A.I.22[i]=2z.1g(0)}}k(A.I.22[i].4I){A.I.22[i].S=A;A.I.22[i].20=i;6(A.I.22[i]).1S(\'2J\',6.B.5O)}}}k(A.I.2n){k(25 A.I.2n===\'5h\'){5t=6(A.I.2n);k(5t.4V()>0){5t.1L(D(){u.53=A});5t.1S(\'2J\',6.B.4h)}}P k(A.I.2n.4I){A.I.2n.53=A;6(A.I.2n).1S(\'2J\',6.B.4h)}P k(A.I.2n==12){6(u).1S(\'2J\',6.B.4h)}}})},4e:D(){E u.1L(D(){C A=u;1B(i 1W A.I.22){A.I.22[i].S=Y;A.I.22[i].20=Y;6(A.I.22[i]).26(\'2J\',6.B.5O)}k(A.I.2n){k(25 A.I.2n===\'5h\'){2z=6(A.I.2n);k(2z.4V()>0){2z.26(\'2J\',6.B.4h)}}P k(A.I.2n==12){6(u).26(\'2J\',6.B.4h)}}A.I=Y})}};6.3v.1Q({bu:6.B.2B,aA:6.B.4e});6.1M={6W:1,7n:D(1O){C 1O=1O;E u.1L(D(){u.2c.3M.1L(D(5U){6.1M.2F(u,1O[5U])})})},1g:D(){C 1O=[];u.1L(D(6H){k(u.6X){1O[6H]=[];C 8=u;C 1v=6.16.2d(u);u.2c.3M.1L(D(5U){C x=u.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bH||F,64:o.64||o.bL||F,60:o.60||F,t:o.5u&&(o.5u==\'7f\'||o.5u==\'7d\')?o.5u:\'1c\',O:o.O?o.O:F,m:F,h:F};k(o.b0==12&&6.1C){27=6.1N(u,\'27\');6.1C.7C[27]=u.N.a;u.N.s=12;k(o.1T){u.N.1T=o.1T;u.N.7r=6.1C.8j(27).7s}}u.5d=12;u.74=J(1t.7o()*78);6.T.1Z[\'d\'+u.74]=6(u);6.T.4Y++})}};6.3v.1Q({9U:6.T.4e,bm:6.T.2B});6.bc=6.T.7G;6.1q={3J:Y,48:F,5D:Y,6L:D(e){6.1q.48=12;6.1q.2t(e,u,12)},6S:D(e){k(6.1q.3J!=u)E;6.1q.48=F;6.1q.2k(e,u)},2t:D(e,A,48){k(6.1q.3J!=Y)E;k(!A){A=u}6.1q.3J=A;2p=6.1Q(6.16.3e(A),6.16.2d(A));4K=6(A);3p=4K.1N(\'3p\');5Q=4K.1N(\'5Q\');k(3p){6.1q.5D=3p;4K.1N(\'3p\',\'\');6(\'#7p\').6F(3p);k(5Q)6(\'#6R\').6F(5Q.3c(\'bN://\',\'\'));P 6(\'#6R\').6F(\'\');1b=6(\'#4F\');k(A.2m.2E){1b.1g(0).2E=A.2m.2E}P{1b.1g(0).2E=\'\'}6E=6.16.2d(1b.1g(0));7U=48&&A.2m.Q==\'6G\'?\'3y\':A.2m.Q;2Z(7U){1a\'M\':1z=2p.y-6E.1y;1x=2p.x;1p;1a\'L\':1z=2p.y;1x=2p.x-6E.1F;1p;1a\'43\':1z=2p.y;1x=2p.x+2p.1F;1p;1a\'6G\':6(\'1J\').1S(\'2l\',6.1q.2l);1c=6.16.30(e);1z=1c.y+15;1x=1c.x+15;1p;7e:1z=2p.y+2p.1y;1x=2p.x;1p}1b.H({M:1z+\'14\',L:1x+\'14\'});k(A.2m.4P==F){1b.2t()}P{1b.aT(A.2m.4P)}k(A.2m.3Z)A.2m.3Z.1A(A);4K.1S(\'7B\',6.1q.2k).1S(\'7w\',6.1q.6S)}},2l:D(e){k(6.1q.3J==Y){6(\'1J\').26(\'2l\',6.1q.2l);E}1c=6.16.30(e);6(\'#4F\').H({M:1c.y+15+\'14\',L:1c.x+15+\'14\'})},2k:D(e,A){k(!A){A=u}k(6.1q.48!=12&&6.1q.3J==A){6.1q.3J=Y;6(\'#4F\').aQ(1);6(A).1N(\'3p\',6.1q.5D).26(\'7B\',6.1q.2k).26(\'7w\',6.1q.6S);k(A.2m.3Y)A.2m.3Y.1A(A);6.1q.5D=Y}},2B:D(R){k(!6.1q.1b){6(\'1J\').4A(\'<2Y 27="4F"><2Y 27="7p"></2Y><2Y 27="6R"></2Y></2Y>\');6(\'#4F\').H({Q:\'2s\',2r:4y,1e:\'1k\'});6.1q.1b=12}E u.1L(D(){k(6.1N(u,\'3p\')){u.2m={Q:/M|3y|L|43|6G/.4d(R.Q)?R.Q:\'3y\',2E:R.2E?R.2E:F,4P:R.4P?R.4P:F,3Z:R.3Z&&R.3Z.1D==2G?R.3Z:F,3Y:R.3Y&&R.3Y.1D==2G?R.3Y:F};C A=6(u);A.1S(\'bP\',6.1q.2t);A.1S(\'6L\',6.1q.6L)}})}};6.3v.9m=6.1q.2B;6.3v.1Q({ad:D(1i,1r,19){E u.2j(\'3r\',D(){1I 6.O.32(u,1i,1r,\'2e\',\'3L\',19)})},ag:D(1i,1r,19){E u.2j(\'3r\',D(){1I 6.O.32(u,1i,1r,\'29\',\'3L\',19)})},9F:D(1i,1r,19){E u.2j(\'3r\',D(){k(6.H(u,\'1e\')==\'1k\'){1I 6.O.32(u,1i,1r,\'29\',\'49\',19)}P{1I 6.O.32(u,1i,1r,\'29\',\'3L\',19)}})},9y:D(1i,1r,19){E u.2j(\'3r\',D(){k(6.H(u,\'1e\')==\'1k\'){1I 6.O.32(u,1i,1r,\'2e\',\'49\',19)}P{1I 6.O.32(u,1i,1r,\'2e\',\'3L\',19)}})},am:D(1i,1r,19){E u.2j(\'3r\',D(){1I 6.O.32(u,1i,1r,\'2e\',\'49\',19)})},b2:D(1i,1r,19){E u.2j(\'3r\',D(){1I 6.O.32(u,1i,1r,\'29\',\'49\',19)})}});6.O.32=D(e,1i,1r,5S,3f,19){k(!6.6g(e)){6.6A(e,\'3r\');E F}C z=u;C 31=F;z.A=6(e);z.19=25 1r==\'5h\'?1r:19||Y;z.1r=25 1r==\'D\'?1r:Y;z.3f=3f;z.1i=1i;z.1w=6.16.2d(e);z.1d={};z.1d.Q=z.A.H(\'Q\');z.1d.1e=z.A.H(\'1e\');k(z.1d.1e==\'1k\'){3l=z.A.H(\'2o\');z.A.2t();31=12}z.1d.M=z.A.H(\'M\');z.1d.L=z.A.H(\'L\');k(31){z.A.2k();z.A.H(\'2o\',3l)}z.1d.Z=z.1w.w+\'14\';z.1d.V=z.1w.h+\'14\';z.1d.3m=z.A.H(\'3m\');z.1w.M=J(z.1d.M)||0;z.1w.L=J(z.1d.L)||0;k(z.1d.Q!=\'2i\'&&z.1d.Q!=\'2s\'){z.A.H(\'Q\',\'2i\')}z.A.H(\'3m\',\'3q\').H(\'V\',3f==\'49\'&&5S==\'2e\'?1:z.1w.h+\'14\').H(\'Z\',3f==\'49\'&&5S==\'29\'?1:z.1w.w+\'14\');z.3z=D(){z.A.H(z.1d);k(z.3f==\'3L\')z.A.2k();P z.A.2t();6.6A(z.A.1g(0),\'3r\')};2Z(5S){1a\'2e\':z.3T=1I 6.O(z.A.1g(0),6.1i(1i-15,z.19,1r),\'V\');z.41=1I 6.O(z.A.1g(0),6.1i(z.1i,z.19,z.3z),\'M\');k(z.3f==\'3L\'){z.3T.2w(z.1w.h,0);z.41.2w(z.1w.M,z.1w.M+z.1w.h/2)}P{z.3T.2w(0,z.1w.h);z.41.2w(z.1w.M+z.1w.h/2,z.1w.M)}1p;1a\'29\':z.3T=1I 6.O(z.A.1g(0),6.1i(1i-15,z.19,1r),\'Z\');z.41=1I 6.O(z.A.1g(0),6.1i(z.1i,z.19,z.3z),\'L\');k(z.3f==\'3L\'){z.3T.2w(z.1w.w,0);z.41.2w(z.1w.L,z.1w.L+z.1w.w/2)}P{z.3T.2w(0,z.1w.w);z.41.2w(z.1w.L+z.1w.w/2,z.1w.L)}1p}};',62,735,'||||||jQuery|dragCfg|elm||||||||||||if||||||dragged||||this||||||el|iResize|var|function|return|false|iDrag|css|resizeOptions|parseInt|iEL|left|top|dropCfg|fx|else|position|options|resizeElement|iDrop|newSizes|height|dx|dy|null|width||oC|true||px||iUtil|document|style|easing|case|helper|pointer|oldStyle|display|cont|get|oR|speed|es|none|elem|255|props|newPosition|break|iTooltip|callback|tp|Math|axis|sizes|oldP|nx|hb|ny|apply|for|iSort|constructor|containment|wb|fractions|opacity|new|body|result|each|iSlider|attr|values|newCoords|extend|cursorAt|bind|onChange|wrs|onSlide|in|dragElem|length|zones|resizeDirection|dhs|handlers|highlighted|vp|typeof|unbind|id|nWidth|horizontally|ratio|currentPointer|slideCfg|getSize|vertically|0px|parseFloat|params|relative|queue|hide|mousemove|tooltipCFG|dragHandle|visibility|pos|documentElement|zIndex|absolute|show|nodeEl|color|custom|step|so|handle|browser|build|duration|nHeight|className|dragmoveBy|Function|dhe|max|mousedown|elS|clientScroll|margins|gx|zonex|toDrag|newStyles|zoney|parentNode|clonedEl|els|si|100|onDragModifier|div|switch|getPointer|restoreStyle|OpenClose|gy|old||||||prop|nmp|replace|animationHandler|getPosition|type|styles|onStop|onStart|onDrag|grid|oldVisibility|overflow|cs|event|title|hidden|interfaceFX|oP|window|newDimensions|fn|getHeight|getWidth|bottom|complete|min|parseColor|curCSS|marginTop|block|scrollTop|marginRight|marginBottom|marginLeft|current|orig|close|sliders|hc|128|wr|overzone|dh|minTop|eh|nw|user|de|frameClass|onHide|onShow||et||right|minLeft|oldDisplay|rgb||focused|open|cssRules|np|currentStyle|test|destroy|newLeft|0x|startDrag|msie|newTop|oD|fA|iw|rule|F0|mouseup|ih|139|scrollLeft|zonew|toInteger|ghosting|zoneh|xproc|3000|timer|append|pr|maxRight|maxBottom|clientWidth|tooltipHelper|parentBorders|border|tagName|yproc|jEl|insideParent|firstChild|namedColors|newPos|delay|move|parent|Array|minHeight|clientHeight|size|maxHeight|cssSides|count|contBorders||nRy|nRx|dragEl|self||offsetLeft|minWidth|stop|side|ActiveXObject|diffY|select|isDroppable|oldPosition|isDraggable|snapDistance|string|offsetTop|diffX|sw|toLowerCase|dEs|dragstop|hidehelper|ne|maxWidth|init|prot|handleEl|tolerance|sideEnd|onDrop|SliderContainer|borderColor|padding|offsetWidth|styleSheets|Object|oldTitle|Draggable|getValues|margin|opt|removeClass|nodeName|accept|png|211|192|start|exec|href|addClass|direction|onHover|key|startTime|src|next|opera|prev|onActivate|2000|getBorder|offsetHeight|onOut|while|innerHeight|revert|scrollWidth|filter|oldBorder|169|borderLeftWidth|oldFloat|hpc|clnt|fxCheckTag|windowSize|autoSize|sliderSize|floatVal|Color|parseStyle|stopAnim|func|fontWeight|dragmove|object|innerWidth|cssSidesEnd|pValue|borderTopWidth|scrollHeight|unselectable|pause|borderWidth|dequeue|parentPos|traverseDOM|sliderPos|helperSize|html|mouse|slider|prevLeft|getContainment|oneIsSortable|focus|elPosition|checkhover|getSizeLite|prevTop|cursor|tooltipURL|hidefocused|fitToContainer|snapToGrid|modifyContainer|tabindex|isSlider|sliderEl|SliderIteration|restricted|lastSi|applyOnHover|String|idsa||stopDrag|draginit|10000|moveDrag|getScroll|Width|nr|intersect|default|fit|colorCssProps|linear|fxe|shc|cssProps|onslide|toggle|set|random|tooltipTitle|isFunction|os|hash|setInterval|offsetParent|oldOverflow|blur|dragmoveByKey|firstNum|Date|getTime|mouseout|collected|emptyGIF|insertBefore|165|remeasure|hlt|measure|styleFloat|224|144|245|107|changed|240|230|140|is|notColor|filteredPosition|DraggableDestroy|getMargins|delta|checkdrop|indexOf|paddingTop|paddingRight|img|wid|borderBottomWidth||borderRightWidth|paddingLeft|paddingBottom|images|highlight|fracW|xfrac|maxy|maxx|listStyle|userSelect|fracH|yfrac|serialize|getHeightMinMax|initialPosition|containerMaxx|auto|getClient|empty|onResize|abs|1000|pow|distance|dragstart|se|animate|dragHelper|on|alpha|directions|match|containerMaxy|KhtmlUserSelect|onDragStop|clearInterval|onDragStart|split|pressedKey|trim|darkmagenta|183|189|darkolivegreen|tbody|moz|DXImageTransform|helperclass|brown|darkkhaki|td|darkgrey|darkcyan|darkgreen|tr|progid|darkorange|cyan|darkblue|153|indigo|130|green|215|gold|prototype|khaki|lightblue|activeclass|Microsoft|ondrop|fuchsia|148|darkred|204|centerEl|blue|ToolTip|darksalmon|darkviolet|122|150|233|darkorchid|black|textarea|iframe|hr|input|SwitchVertically|frameset|button|script|table|frame|form|SwitchHorizontally|createElement|optgroup|removeChild|meta|destroyWrapper|option|buildWrapper|w_|float|onselectstart|ondragstart|header|th|wrapper|DroppableDestroy|mozUserSelect|appendChild|tfoot|aqua|azure|caption|220|thead|beige|hoverclass|cssFloat|dl|col|colgroup|ul|ol|fixPNG||CloseVertically|173|fxWrapper|CloseHorizontally|find|lime|Slider|SliderSetValues|SliderGetValues|OpenVertically|isNaN|cloneNode|solid|dashed|dotted|transparent|pageX|clientX|Bottom|Right|216|Top|Left|ResizableDestroy|PI|cos|khtml|stopAll|double|groove|cssText|MozUserSelect|RegExp|selectorText|off|keydown|toUpperCase|keyCode|charCode|fadeOut|rules|fromHandler|fadeIn|outset|inset|ridge|selectKeyHelper|getPadding|array|sortable|borderStyle|OpenHorizontally|outlineColor|pageY|olive|navy|maroon|magenta|orange|pink|red|recallDroppables|purple|203|AlphaImageLoader|sqrt|lightgrey|238|lightgreen|lightcyan|getPositionLite|Droppable|lightyellow|193|182|lightpink||silver|purgeEvents|Resizable|clientY|outlineWidth|outlineOffset|textIndent|backgroundColor|borderTopColor|borderRightColor|borderLeftColor|borderBottomColor|lineHeight|letterSpacing|check|onhover|nextSibling|yellow|white|onout|number|http|fontSize|mouseover|100000000'.split('|'),0,{}))
 
 /*
 * jQuery form plugin
 * @requires jQuery v1.0.3
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 *
 * Revision: $Id$
 * Version: .97
 */

/**
 * ajaxSubmit() provides a mechanism for submitting an HTML form using AJAX.
 *
 * ajaxSubmit accepts a single argument which can be either a success callback function
 * or an options Object.  If a function is provided it will be invoked upon successful
 * completion of the submit and will be passed the response from the server.
 * If an options Object is provided, the following attributes are supported:
 *
 *  target:   Identifies the element(s) in the page to be updated with the server response.
 *            This value may be specified as a jQuery selection string, a jQuery object,
 *            or a DOM element.
 *            default value: null
 *
 *  url:      URL to which the form data will be submitted.
 *            default value: value of form's 'action' attribute
 *
 *  type:     The method in which the form data should be submitted, 'GET' or 'POST'.
 *            default value: value of form's 'method' attribute (or 'GET' if none found)
 *
 *  beforeSubmit:  Callback method to be invoked before the form is submitted.
 *            default value: null
 *
 *  success:  Callback method to be invoked after the form has been successfully submitted
 *            and the response has been returned from the server
 *            default value: null
 *
 *  dataType: Expected dataType of the response.  One of: null, 'xml', 'script', or 'json'
 *            default value: null
 *
 *  semantic: Boolean flag indicating whether data must be submitted in semantic order (slower).
 *            default value: false
 *
 *  resetForm: Boolean flag indicating whether the form should be reset if the submit is successful
 *
 *  clearForm: Boolean flag indicating whether the form should be cleared if the submit is successful
 *
 *
 * The 'beforeSubmit' callback can be provided as a hook for running pre-submit logic or for
 * validating the form data.  If the 'beforeSubmit' callback returns false then the form will
 * not be submitted. The 'beforeSubmit' callback is invoked with three arguments: the form data
 * in array format, the jQuery object, and the options object passed into ajaxSubmit.
 * The form data array takes the following form:
 *
 *     [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
 *
 * If a 'success' callback method is provided it is invoked after the response has been returned
 * from the server.  It is passed the responseText or responseXML value (depending on dataType).
 * See jQuery.ajax for further details.
 *
 *
 * The dataType option provides a means for specifying how the server response should be handled.
 * This maps directly to the jQuery.httpData method.  The following values are supported:
 *
 *      'xml':    if dataType == 'xml' the server response is treated as XML and the 'after'
 *                   callback method, if specified, will be passed the responseXML value
 *      'json':   if dataType == 'json' the server response will be evaluted and passed to
 *                   the 'after' callback, if specified
 *      'script': if dataType == 'script' the server response is evaluated in the global context
 *
 *
 * Note that it does not make sense to use both the 'target' and 'dataType' options.  If both
 * are provided the target will be ignored.
 *
 * The semantic argument can be used to force form serialization in semantic order.
 * This is normally true anyway, unless the form contains input elements of type='image'.
 * If your form must be submitted with name/value pairs in semantic order and your form
 * contains an input of type='image" then pass true for this arg, otherwise pass false
 * (or nothing) to avoid the overhead for this logic.
 *
 *
 * When used on its own, ajaxSubmit() is typically bound to a form's submit event like this:
 *
 * $("#form-id").submit(function() {
 *     $(this).ajaxSubmit(options);
 *     return false; // cancel conventional submit
 * });
 *
 * When using ajaxForm(), however, this is done for you.
 *
 * @example
 * $('#myForm').ajaxSubmit(function(data) {
 *     alert('Form submit succeeded! Server returned: ' + data);
 * });
 * @desc Submit form and alert server response
 *
 *
 * @example
 * var options = {
 *     target: '#myTargetDiv'
 * };
 * $('#myForm').ajaxSubmit(options);
 * @desc Submit form and update page element with server response
 *
 *
 * @example
 * var options = {
 *     success: function(responseText) {
 *         alert(responseText);
 *     }
 * };
 * $('#myForm').ajaxSubmit(options);
 * @desc Submit form and alert the server response
 *
 *
 * @example
 * var options = {
 *     beforeSubmit: function(formArray, jqForm) {
 *         if (formArray.length == 0) {
 *             alert('Please enter data.');
 *             return false;
 *         }
 *     }
 * };
 * $('#myForm').ajaxSubmit(options);
 * @desc Pre-submit validation which aborts the submit operation if form data is empty
 *
 *
 * @example
 * var options = {
 *     url: myJsonUrl.php,
 *     dataType: 'json',
 *     success: function(data) {
 *        // 'data' is an object representing the the evaluated json data
 *     }
 * };
 * $('#myForm').ajaxSubmit(options);
 * @desc json data returned and evaluated
 *
 *
 * @example
 * var options = {
 *     url: myXmlUrl.php,
 *     dataType: 'xml',
 *     success: function(responseXML) {
 *        // responseXML is XML document object
 *        var data = $('myElement', responseXML).text();
 *     }
 * };
 * $('#myForm').ajaxSubmit(options);
 * @desc XML data returned from server
 *
 *
 * @example
 * var options = {
 *     resetForm: true
 * };
 * $('#myForm').ajaxSubmit(options);
 * @desc submit form and reset it if successful
 *
 * @example
 * $('#myForm).submit(function() {
 *    $(this).ajaxSubmit();
 *    return false;
 * });
 * @desc Bind form's submit event to use ajaxSubmit
 *
 *
 * @name ajaxSubmit
 * @type jQuery
 * @param options  object literal containing options which control the form submission process
 * @cat Plugins/Form
 * @return jQuery
 * @see formToArray
 * @see ajaxForm
 * @see $.ajax
 * @author jQuery Community
 */
jQuery.fn.ajaxSubmit = function(options) {
    if (typeof options == 'function')
        options = { success: options };

    options = jQuery.extend({
        url:  this.attr('action') || window.location,
        type: this.attr('method') || 'GET'
    }, options || {});

    var a = this.formToArray(options.semantic);

    // give pre-submit callback an opportunity to abort the submit
    if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) return this;

    // fire vetoable 'validate' event
    var veto = {};
    jQuery.event.trigger('form.submit.validate', [a, this, options, veto]);
    if (veto.veto)
        return this;

    var q = jQuery.param(a);//.replace(/%20/g,'+');

    if (options.type.toUpperCase() == 'GET') {
        options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q;
        options.data = null;  // data is null for 'get'
    }
    else
        options.data = q; // data is the query string for 'post'

    var $form = this, callbacks = [];
    if (options.resetForm) callbacks.push(function() { $form.resetForm(); });
    if (options.clearForm) callbacks.push(function() { $form.clearForm(); });

    // perform a load on the target only if dataType is not provided
    if (!options.dataType && options.target) {
        var oldSuccess = options.success || function(){};
        callbacks.push(function(data, status) {
            //jQuery(options.target).attr("innerHTML", data).evalScripts().each(oldSuccess, [data, status]);
			jQuery(options.target).attr("innerHTML", data).each(oldSuccess, [data, status]);
        });
    }
    else if (options.success)
        callbacks.push(options.success);

    options.success = function(data, status) {
        for (var i=0, max=callbacks.length; i < max; i++)
            callbacks[i](data, status);
    };

    // are there files to upload?
    var files = jQuery('input:file', this).fieldValue();
    var found = false;
    for (var j=0; j < files.length; j++)
        if (files[j]) 
            found = true;

    if (options.iframe || found) // options.iframe allows user to force iframe mode
        fileUpload();
    else
        jQuery.ajax(options);

    // fire 'notify' event
    jQuery.event.trigger('form.submit.notify', [this, options]);
    return this;


    // private function for handling file uploads (hat tip to YAHOO!)
    function fileUpload() {
        var form = $form[0];
        var opts = jQuery.extend({}, jQuery.ajaxSettings, options);
        
        var id = 'jqFormIO' + jQuery.fn.ajaxSubmit.counter++;
        var $io = jQuery('<iframe id="' + id + '" name="' + id + '" />');
        var io = $io[0];
        var op8 = jQuery.browser.opera && window.opera.version() < 9;
        if (jQuery.browser.msie || op8) io.src = 'javascript:false;document.write("");';
        $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' });

        // make sure form attrs are set
        form.method = 'POST';
        form.encoding ? form.encoding = 'multipart/form-data' : form.enctype = 'multipart/form-data';

        var xhr = { // mock object
            responseText: null,
            responseXML: null,
            status: 0,
            statusText: 'n/a',
            getAllResponseHeaders: function() {},
            getResponseHeader: function() {},
            setRequestHeader: function() {}
        };
        
        var g = opts.global;
        // trigger ajax global events so that activity/block indicators work like normal
        if (g && ! jQuery.active++) jQuery.event.trigger("ajaxStart");
        if (g) jQuery.event.trigger("ajaxSend", [xhr, opts]);
        
        var cbInvoked = 0;
        var timedOut = 0;
        
        // take a breath so that pending repaints get some cpu time before the upload starts
        setTimeout(function() {
            $io.appendTo('body');
            // jQuery's event binding doesn't work for iframe events in IE
            io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);
            form.action = opts.url;
            var t = form.target;
            form.target = id;

            // support timout
            if (opts.timeout)
                setTimeout(function() { timedOut = true; cb(); }, opts.timeout);

            form.submit();
            form.target = t; // reset
        }, 10);
        
        function cb() {
            if (cbInvoked++) return;
            
            io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false);

            var ok = true;
            try {
                if (timedOut) throw 'timeout';
                // extract the server response from the iframe
                var data, doc;
                doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document;
                xhr.responseText = doc.body ? doc.body.innerHTML : null;
                xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
                
                if (opts.dataType == 'json' || opts.dataType == 'script') {
                    var ta = doc.getElementsByTagName('textarea')[0];
                    data = ta ? ta.value : xhr.responseText;
                    if (opts.dataType == 'json')
                        eval("data = " + data);
                    else
                        jQuery.globalEval(data);
                }
                else if (opts.dataType == 'xml') {
                    data = xhr.responseXML;
                    if (!data && xhr.responseText != null)
                        data = toXml(xhr.responseText);
                }
                else {
                    data = xhr.responseText;
                }
            }
            catch(e){
                ok = false;
                jQuery.handleError(opts, xhr, 'error', e);
            }

            // ordering of these callbacks/triggers is odd, but that's how $.ajax does it
            if (ok) {
                opts.success(data, 'success');
                if (g) jQuery.event.trigger("ajaxSuccess", [xhr, opts]);
            }
            if (g) jQuery.event.trigger("ajaxComplete", [xhr, opts]);
            if (g && ! --jQuery.active) jQuery.event.trigger("ajaxStop");
            if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error');

            // clean up
            setTimeout(function() { 
                $io.remove(); 
                xhr.responseXML = null;
            }, 100);
        };
        
        function toXml(s, doc) {
            if (window.ActiveXObject) {
                doc = new ActiveXObject('Microsoft.XMLDOM');
                doc.async = 'false';
                doc.loadXML(s);
            }
            else
                doc = (new DOMParser()).parseFromString(s, 'text/xml');
            return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null;
        }
    };
};
jQuery.fn.ajaxSubmit.counter = 0; // used to create unique iframe ids

/**
 * ajaxForm() provides a mechanism for fully automating form submission.
 *
 * The advantages of using this method instead of ajaxSubmit() are:
 *
 * 1: This method will include coordinates for <input type="image" /> elements (if the element
 *    is used to submit the form).
 * 2. This method will include the submit element's name/value data (for the element that was
 *    used to submit the form).
 * 3. This method binds the submit() method to the form for you.
 *
 * Note that for accurate x/y coordinates of image submit elements in all browsers
 * you need to also use the "dimensions" plugin (this method will auto-detect its presence).
 *
 * The options argument for ajaxForm works exactly as it does for ajaxSubmit.  ajaxForm merely
 * passes the options argument along after properly binding events for submit elements and
 * the form itself.  See ajaxSubmit for a full description of the options argument.
 *
 *
 * @example
 * var options = {
 *     target: '#myTargetDiv'
 * };
 * $('#myForm').ajaxSForm(options);
 * @desc Bind form's submit event so that 'myTargetDiv' is updated with the server response
 *       when the form is submitted.
 *
 *
 * @example
 * var options = {
 *     success: function(responseText) {
 *         alert(responseText);
 *     }
 * };
 * $('#myForm').ajaxSubmit(options);
 * @desc Bind form's submit event so that server response is alerted after the form is submitted.
 *
 *
 * @example
 * var options = {
 *     beforeSubmit: function(formArray, jqForm) {
 *         if (formArray.length == 0) {
 *             alert('Please enter data.');
 *             return false;
 *         }
 *     }
 * };
 * $('#myForm').ajaxSubmit(options);
 * @desc Bind form's submit event so that pre-submit callback is invoked before the form
 *       is submitted.
 *
 *
 * @name   ajaxForm
 * @param  options  object literal containing options which control the form submission process
 * @return jQuery
 * @cat    Plugins/Form
 * @type   jQuery
 * @see    ajaxSubmit
 * @author jQuery Community
 */
jQuery.fn.ajaxForm = function(options) {
    return this.each(function() {
        jQuery("input:submit,input:image,button:submit", this).click(function(ev) {
            var $form = this.form;
            $form.clk = this;
            if (this.type == 'image') {
                if (ev.offsetX != undefined) {
                    $form.clk_x = ev.offsetX;
                    $form.clk_y = ev.offsetY;
                } else if (typeof jQuery.fn.offset == 'function') { // try to use dimensions plugin
                    var offset = jQuery(this).offset();
                    $form.clk_x = ev.pageX - offset.left;
                    $form.clk_y = ev.pageY - offset.top;
                } else {
                    $form.clk_x = ev.pageX - this.offsetLeft;
                    $form.clk_y = ev.pageY - this.offsetTop;
                }
            }
            // clear form vars
            setTimeout(function() {
                $form.clk = $form.clk_x = $form.clk_y = null;
                }, 10);
        })
    }).submit(function(e) {
        jQuery(this).ajaxSubmit(options);
        return false;
    });
};


/**
 * formToArray() gathers form element data into an array of objects that can
 * be passed to any of the following ajax functions: $.get, $.post, or load.
 * Each object in the array has both a 'name' and 'value' property.  An example of
 * an array for a simple login form might be:
 *
 * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ]
 *
 * It is this array that is passed to pre-submit callback functions provided to the
 * ajaxSubmit() and ajaxForm() methods.
 *
 * The semantic argument can be used to force form serialization in semantic order.
 * This is normally true anyway, unless the form contains input elements of type='image'.
 * If your form must be submitted with name/value pairs in semantic order and your form
 * contains an input of type='image" then pass true for this arg, otherwise pass false
 * (or nothing) to avoid the overhead for this logic.
 *
 * @example var data = $("#myForm").formToArray();
 * $.post( "myscript.cgi", data );
 * @desc Collect all the data from a form and submit it to the server.
 *
 * @name formToArray
 * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
 * @type Array<Object>
 * @cat Plugins/Form
 * @see ajaxForm
 * @see ajaxSubmit
 * @author jQuery Community
 */
jQuery.fn.formToArray = function(semantic) {
    var a = [];
    if (this.length == 0) return a;

    var form = this[0];
    var els = semantic ? form.getElementsByTagName('*') : form.elements;
    if (!els) return a;
    for(var i=0, max=els.length; i < max; i++) {
        var el = els[i];
        var n = el.name;
        if (!n) continue;

        if (semantic && form.clk && el.type == "image") {
            // handle image inputs on the fly when semantic == true
            if(!el.disabled && form.clk == el)
                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
            continue;
        }
        var v = jQuery.fieldValue(el, true);
        if (v === null) continue;
        if (v.constructor == Array) {
            for(var j=0, jmax=v.length; j < jmax; j++)
                a.push({name: n, value: v[j]});
        }
        else
            a.push({name: n, value: v});
    }

    if (!semantic && form.clk) {
        // input type=='image' are not found in elements array! handle them here
        var inputs = form.getElementsByTagName("input");
        for(var i=0, max=inputs.length; i < max; i++) {
            var input = inputs[i];
            var n = input.name;
            if(n && !input.disabled && input.type == "image" && form.clk == input)
                a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y});
        }
    }
    return a;
};


/**
 * Serializes form data into a 'submittable' string. This method will return a string
 * in the format: name1=value1&amp;name2=value2
 *
 * The semantic argument can be used to force form serialization in semantic order.
 * If your form must be submitted with name/value pairs in semantic order then pass
 * true for this arg, otherwise pass false (or nothing) to avoid the overhead for
 * this logic (which can be significant for very large forms).
 *
 * @example var data = $("#myForm").formSerialize();
 * $.ajax('POST', "myscript.cgi", data);
 * @desc Collect all the data from a form into a single string
 *
 * @name formSerialize
 * @param semantic true if serialization must maintain strict semantic ordering of elements (slower)
 * @type String
 * @cat Plugins/Form
 * @see formToArray
 * @author jQuery Community
 */
jQuery.fn.formSerialize = function(semantic) {
    //hand off to jQuery.param for proper encoding
    return jQuery.param(this.formToArray(semantic));
};


/**
 * Serializes all field elements in the jQuery object into a query string.
 * This method will return a string in the format: name1=value1&amp;name2=value2
 *
 * The successful argument controls whether or not serialization is limited to
 * 'successful' controls (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
 * The default value of the successful argument is true.
 *
 * @example var data = $("input").formSerialize();
 * @desc Collect the data from all successful input elements into a query string
 *
 * @example var data = $(":radio").formSerialize();
 * @desc Collect the data from all successful radio input elements into a query string
 *
 * @example var data = $("#myForm :checkbox").formSerialize();
 * @desc Collect the data from all successful checkbox input elements in myForm into a query string
 *
 * @example var data = $("#myForm :checkbox").formSerialize(false);
 * @desc Collect the data from all checkbox elements in myForm (even the unchecked ones) into a query string
 *
 * @example var data = $(":input").formSerialize();
 * @desc Collect the data from all successful input, select, textarea and button elements into a query string
 *
 * @name fieldSerialize
 * @param successful true if only successful controls should be serialized (default is true)
 * @type String
 * @cat Plugins/Form
 */
jQuery.fn.fieldSerialize = function(successful) {
    var a = [];
    this.each(function() {
        var n = this.name;
        if (!n) return;
        var v = jQuery.fieldValue(this, successful);
        if (v && v.constructor == Array) {
            for (var i=0,max=v.length; i < max; i++)
                a.push({name: n, value: v[i]});
        }
        else if (v !== null && typeof v != 'undefined')
            a.push({name: this.name, value: v});
    });
    //hand off to jQuery.param for proper encoding
    return jQuery.param(a);
};


/**
 * Returns the value(s) of the element in the matched set.  For example, consider the following form:
 *
 *  <form><fieldset>
 *      <input name="A" type="text" />
 *      <input name="A" type="text" />
 *      <input name="B" type="checkbox" value="B1" />
 *      <input name="B" type="checkbox" value="B2"/>
 *      <input name="C" type="radio" value="C1" />
 *      <input name="C" type="radio" value="C2" />
 *  </fieldset></form>
 *
 *  var v = $(':text').fieldValue();
 *  // if no values are entered into the text inputs
 *  v == ['','']
 *  // if values entered into the text inputs are 'foo' and 'bar'
 *  v == ['foo','bar']
 *
 *  var v = $(':checkbox').fieldValue();
 *  // if neither checkbox is checked
 *  v === undefined
 *  // if both checkboxes are checked
 *  v == ['B1', 'B2']
 *
 *  var v = $(':radio').fieldValue();
 *  // if neither radio is checked
 *  v === undefined
 *  // if first radio is checked
 *  v == ['C1']
 *
 * The successful argument controls whether or not the field element must be 'successful'
 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
 * The default value of the successful argument is true.  If this value is false the value(s)
 * for each element is returned.
 *
 * Note: This method *always* returns an array.  If no valid value can be determined the
 *       array will be empty, otherwise it will contain one or more values.
 *
 * @example var data = $("#myPasswordElement").fieldValue();
 * alert(data[0]);
 * @desc Alerts the current value of the myPasswordElement element
 *
 * @example var data = $("#myForm :input").fieldValue();
 * @desc Get the value(s) of the form elements in myForm
 *
 * @example var data = $("#myForm :checkbox").fieldValue();
 * @desc Get the value(s) for the successful checkbox element(s) in the jQuery object.
 *
 * @example var data = $("#mySingleSelect").fieldValue();
 * @desc Get the value(s) of the select control
 *
 * @example var data = $(':text').fieldValue();
 * @desc Get the value(s) of the text input or textarea elements
 *
 * @example var data = $("#myMultiSelect").fieldValue();
 * @desc Get the values for the select-multiple control
 *
 * @name fieldValue
 * @param Boolean successful true if only the values for successful controls should be returned (default is true)
 * @type Array<String>
 * @cat Plugins/Form
 */
jQuery.fn.fieldValue = function(successful) {
    for (var val=[], i=0, max=this.length; i < max; i++) {
        var el = this[i];
        var v = jQuery.fieldValue(el, successful);
        if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length))
            continue;
        v.constructor == Array ? jQuery.merge(val, v) : val.push(v);
    }
    return val;
};

/**
 * Returns the value of the field element.
 *
 * The successful argument controls whether or not the field element must be 'successful'
 * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls).
 * The default value of the successful argument is true.  If the given element is not
 * successful and the successful arg is not false then the returned value will be null.
 *
 * Note: If the successful flag is true (default) but the element is not successful, the return will be null
 * Note: The value returned for a successful select-multiple element will always be an array.
 * Note: If the element has no value the return value will be undefined.
 *
 * @example var data = jQuery.fieldValue($("#myPasswordElement")[0]);
 * @desc Gets the current value of the myPasswordElement element
 *
 * @name fieldValue
 * @param Element el The DOM element for which the value will be returned
 * @param Boolean successful true if value returned must be for a successful controls (default is true)
 * @type String or Array<String> or null or undefined
 * @cat Plugins/Form
 */
jQuery.fieldValue = function(el, successful) {
    var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
    if (typeof successful == 'undefined') successful = true;

    if (successful && (!n || el.disabled || t == 'reset' || t == 'button' ||
        (t == 'checkbox' || t == 'radio') && !el.checked ||
        (t == 'submit' || t == 'image') && el.form && el.form.clk != el ||
        tag == 'select' && el.selectedIndex == -1))
            return null;

    if (tag == 'select') {
        var index = el.selectedIndex;
        if (index < 0) return null;
        var a = [], ops = el.options;
        var one = (t == 'select-one');
        var max = (one ? index+1 : ops.length);
        for(var i=(one ? index : 0); i < max; i++) {
            var op = ops[i];
            if (op.selected) {
                // extra pain for IE...
                var v = jQuery.browser.msie && !(op.attributes['value'].specified) ? op.text : op.value;
                if (one) return v;
                a.push(v);
            }
        }
        return a;
    }
    return el.value;
};


/**
 * Clears the form data.  Takes the following actions on the form's input fields:
 *  - input text fields will have their 'value' property set to the empty string
 *  - select elements will have their 'selectedIndex' property set to -1
 *  - checkbox and radio inputs will have their 'checked' property set to false
 *  - inputs of type submit, button, reset, and hidden will *not* be effected
 *  - button elements will *not* be effected
 *
 * @example $('form').clearForm();
 * @desc Clears all forms on the page.
 *
 * @name clearForm
 * @type jQuery
 * @cat Plugins/Form
 * @see resetForm
 */
jQuery.fn.clearForm = function() {
    return this.each(function() {
        jQuery('input,select,textarea', this).clearFields();
    });
};

/**
 * Clears the selected form elements.  Takes the following actions on the matched elements:
 *  - input text fields will have their 'value' property set to the empty string
 *  - select elements will have their 'selectedIndex' property set to -1
 *  - checkbox and radio inputs will have their 'checked' property set to false
 *  - inputs of type submit, button, reset, and hidden will *not* be effected
 *  - button elements will *not* be effected
 *
 * @example $('.myInputs').clearFields();
 * @desc Clears all inputs with class myInputs
 *
 * @name clearFields
 * @type jQuery
 * @cat Plugins/Form
 * @see clearForm
 */
jQuery.fn.clearFields = jQuery.fn.clearInputs = function() {
    return this.each(function() {
        var t = this.type, tag = this.tagName.toLowerCase();
        if (t == 'text' || t == 'password' || tag == 'textarea')
            this.value = '';
        else if (t == 'checkbox' || t == 'radio')
            this.checked = false;
        else if (tag == 'select')
            this.selectedIndex = -1;
    });
};


/**
 * Resets the form data.  Causes all form elements to be reset to their original value.
 *
 * @example $('form').resetForm();
 * @desc Resets all forms on the page.
 *
 * @name resetForm
 * @type jQuery
 * @cat Plugins/Form
 * @see clearForm
 */
jQuery.fn.resetForm = function() {
    return this.each(function() {
        // guard against an input with the name of 'reset'
        // note that IE reports the reset function as an 'object'
        if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
            this.reset();
    });
};


																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																														/*	SWFObject v2.0 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var Z="undefined",P="object",B="Shockwave Flash",h="ShockwaveFlash.ShockwaveFlash",W="application/x-shockwave-flash",K="SWFObjectExprInst",G=window,g=document,N=navigator,f=[],H=[],Q=null,L=null,T=null,S=false,C=false;var a=function(){var l=typeof g.getElementById!=Z&&typeof g.getElementsByTagName!=Z&&typeof g.createElement!=Z&&typeof g.appendChild!=Z&&typeof g.replaceChild!=Z&&typeof g.removeChild!=Z&&typeof g.cloneNode!=Z,t=[0,0,0],n=null;if(typeof N.plugins!=Z&&typeof N.plugins[B]==P){n=N.plugins[B].description;if(n){n=n.replace(/^.*\s+(\S+\s+\S+$)/,"$1");t[0]=parseInt(n.replace(/^(.*)\..*$/,"$1"),10);t[1]=parseInt(n.replace(/^.*\.(.*)\s.*$/,"$1"),10);t[2]=/r/.test(n)?parseInt(n.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof G.ActiveXObject!=Z){var o=null,s=false;try{o=new ActiveXObject(h+".7")}catch(k){try{o=new ActiveXObject(h+".6");t=[6,0,21];o.AllowScriptAccess="always"}catch(k){if(t[0]==6){s=true}}if(!s){try{o=new ActiveXObject(h)}catch(k){}}}if(!s&&o){try{n=o.GetVariable("$version");if(n){n=n.split(" ")[1].split(",");t=[parseInt(n[0],10),parseInt(n[1],10),parseInt(n[2],10)]}}catch(k){}}}}var v=N.userAgent.toLowerCase(),j=N.platform.toLowerCase(),r=/webkit/.test(v)?parseFloat(v.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,i=false,q=j?/win/.test(j):/win/.test(v),m=j?/mac/.test(j):/mac/.test(v);/*@cc_on i=true;@if(@_win32)q=true;@elif(@_mac)m=true;@end@*/return{w3cdom:l,pv:t,webkit:r,ie:i,win:q,mac:m}}();var e=function(){if(!a.w3cdom){return }J(I);if(a.ie&&a.win){try{g.write("<script id=__ie_ondomload defer=true src=//:><\/script>");var i=c("__ie_ondomload");if(i){i.onreadystatechange=function(){if(this.readyState=="complete"){this.parentNode.removeChild(this);V()}}}}catch(j){}}if(a.webkit&&typeof g.readyState!=Z){Q=setInterval(function(){if(/loaded|complete/.test(g.readyState)){V()}},10)}if(typeof g.addEventListener!=Z){g.addEventListener("DOMContentLoaded",V,null)}M(V)}();function V(){if(S){return }if(a.ie&&a.win){var m=Y("span");try{var l=g.getElementsByTagName("body")[0].appendChild(m);l.parentNode.removeChild(l)}catch(n){return }}S=true;if(Q){clearInterval(Q);Q=null}var j=f.length;for(var k=0;k<j;k++){f[k]()}}function J(i){if(S){i()}else{f[f.length]=i}}function M(j){if(typeof G.addEventListener!=Z){G.addEventListener("load",j,false)}else{if(typeof g.addEventListener!=Z){g.addEventListener("load",j,false)}else{if(typeof G.attachEvent!=Z){G.attachEvent("onload",j)}else{if(typeof G.onload=="function"){var i=G.onload;G.onload=function(){i();j()}}else{G.onload=j}}}}}function I(){var l=H.length;for(var j=0;j<l;j++){var m=H[j].id;if(a.pv[0]>0){var k=c(m);if(k){H[j].width=k.getAttribute("width")?k.getAttribute("width"):"0";H[j].height=k.getAttribute("height")?k.getAttribute("height"):"0";if(O(H[j].swfVersion)){if(a.webkit&&a.webkit<312){U(k)}X(m,true)}else{if(H[j].expressInstall&&!C&&O("6.0.65")&&(a.win||a.mac)){D(H[j])}else{d(k)}}}}else{X(m,true)}}}function U(m){var k=m.getElementsByTagName(P)[0];if(k){var p=Y("embed"),r=k.attributes;if(r){var o=r.length;for(var n=0;n<o;n++){if(r[n].nodeName.toLowerCase()=="data"){p.setAttribute("src",r[n].nodeValue)}else{p.setAttribute(r[n].nodeName,r[n].nodeValue)}}}var q=k.childNodes;if(q){var s=q.length;for(var l=0;l<s;l++){if(q[l].nodeType==1&&q[l].nodeName.toLowerCase()=="param"){p.setAttribute(q[l].getAttribute("name"),q[l].getAttribute("value"))}}}m.parentNode.replaceChild(p,m)}}function F(i){if(a.ie&&a.win&&O("8.0.0")){G.attachEvent("onunload",function(){var k=c(i);if(k){for(var j in k){if(typeof k[j]=="function"){k[j]=function(){}}}k.parentNode.removeChild(k)}})}}function D(j){C=true;var o=c(j.id);if(o){if(j.altContentId){var l=c(j.altContentId);if(l){L=l;T=j.altContentId}}else{L=b(o)}if(!(/%$/.test(j.width))&&parseInt(j.width,10)<310){j.width="310"}if(!(/%$/.test(j.height))&&parseInt(j.height,10)<137){j.height="137"}g.title=g.title.slice(0,47)+" - Flash Player Installation";var n=a.ie&&a.win?"ActiveX":"PlugIn",k=g.title,m="MMredirectURL="+G.location+"&MMplayerType="+n+"&MMdoctitle="+k,p=j.id;if(a.ie&&a.win&&o.readyState!=4){var i=Y("div");p+="SWFObjectNew";i.setAttribute("id",p);o.parentNode.insertBefore(i,o);o.style.display="none";G.attachEvent("onload",function(){o.parentNode.removeChild(o)})}R({data:j.expressInstall,id:K,width:j.width,height:j.height},{flashvars:m},p)}}function d(j){if(a.ie&&a.win&&j.readyState!=4){var i=Y("div");j.parentNode.insertBefore(i,j);i.parentNode.replaceChild(b(j),i);j.style.display="none";G.attachEvent("onload",function(){j.parentNode.removeChild(j)})}else{j.parentNode.replaceChild(b(j),j)}}function b(n){var m=Y("div");if(a.win&&a.ie){m.innerHTML=n.innerHTML}else{var k=n.getElementsByTagName(P)[0];if(k){var o=k.childNodes;if(o){var j=o.length;for(var l=0;l<j;l++){if(!(o[l].nodeType==1&&o[l].nodeName.toLowerCase()=="param")&&!(o[l].nodeType==8)){m.appendChild(o[l].cloneNode(true))}}}}}return m}function R(AE,AC,q){var p,t=c(q);if(typeof AE.id==Z){AE.id=q}if(a.ie&&a.win){var AD="";for(var z in AE){if(AE[z]!=Object.prototype[z]){if(z=="data"){AC.movie=AE[z]}else{if(z.toLowerCase()=="styleclass"){AD+=' class="'+AE[z]+'"'}else{if(z!="classid"){AD+=" "+z+'="'+AE[z]+'"'}}}}}var AB="";for(var y in AC){if(AC[y]!=Object.prototype[y]){AB+='<param name="'+y+'" value="'+AC[y]+'" />'}}t.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AD+">"+AB+"</object>";F(AE.id);p=c(AE.id)}else{if(a.webkit&&a.webkit<312){var AA=Y("embed");AA.setAttribute("type",W);for(var x in AE){if(AE[x]!=Object.prototype[x]){if(x=="data"){AA.setAttribute("src",AE[x])}else{if(x.toLowerCase()=="styleclass"){AA.setAttribute("class",AE[x])}else{if(x!="classid"){AA.setAttribute(x,AE[x])}}}}}for(var w in AC){if(AC[w]!=Object.prototype[w]){if(w!="movie"){AA.setAttribute(w,AC[w])}}}t.parentNode.replaceChild(AA,t);p=AA}else{var s=Y(P);s.setAttribute("type",W);for(var v in AE){if(AE[v]!=Object.prototype[v]){if(v.toLowerCase()=="styleclass"){s.setAttribute("class",AE[v])}else{if(v!="classid"){s.setAttribute(v,AE[v])}}}}for(var u in AC){if(AC[u]!=Object.prototype[u]&&u!="movie"){E(s,u,AC[u])}}t.parentNode.replaceChild(s,t);p=s}}return p}function E(k,i,j){var l=Y("param");l.setAttribute("name",i);l.setAttribute("value",j);k.appendChild(l)}function c(i){return g.getElementById(i)}function Y(i){return g.createElement(i)}function O(k){var j=a.pv,i=k.split(".");i[0]=parseInt(i[0],10);i[1]=parseInt(i[1],10);i[2]=parseInt(i[2],10);return(j[0]>i[0]||(j[0]==i[0]&&j[1]>i[1])||(j[0]==i[0]&&j[1]==i[1]&&j[2]>=i[2]))?true:false}function A(m,j){if(a.ie&&a.mac){return }var l=g.getElementsByTagName("head")[0],k=Y("style");k.setAttribute("type","text/css");k.setAttribute("media","screen");if(!(a.ie&&a.win)&&typeof g.createTextNode!=Z){k.appendChild(g.createTextNode(m+" {"+j+"}"))}l.appendChild(k);if(a.ie&&a.win&&typeof g.styleSheets!=Z&&g.styleSheets.length>0){var i=g.styleSheets[g.styleSheets.length-1];if(typeof i.addRule==P){i.addRule(m,j)}}}function X(k,i){var j=i?"visible":"hidden";if(S){c(k).style.visibility=j}else{A("#"+k,"visibility:"+j)}}return{registerObject:function(l,i,k){if(!a.w3cdom||!l||!i){return }var j={};j.id=l;j.swfVersion=i;j.expressInstall=k?k:false;H[H.length]=j;X(l,false)},getObjectById:function(l){var i=null;if(a.w3cdom&&S){var j=c(l);if(j){var k=j.getElementsByTagName(P)[0];if(!k||(k&&typeof j.SetVariable!=Z)){i=j}else{if(typeof k.SetVariable!=Z){i=k}}}}return i},embedSWF:function(n,u,r,t,j,m,k,p,s){if(!a.w3cdom||!n||!u||!r||!t||!j){return }r+="";t+="";if(O(j)){X(u,false);var q=(typeof s==P)?s:{};q.data=n;q.width=r;q.height=t;var o=(typeof p==P)?p:{};if(typeof k==P){for(var l in k){if(k[l]!=Object.prototype[l]){if(typeof o.flashvars!=Z){o.flashvars+="&"+l+"="+k[l]}else{o.flashvars=l+"="+k[l]}}}}J(function(){R(q,o,u);if(q.id==u){X(u,true)}})}else{if(m&&!C&&O("6.0.65")&&(a.win||a.mac)){X(u,false);J(function(){var i={};i.id=i.altContentId=u;i.width=r;i.height=t;i.expressInstall=m;D(i)})}}},getFlashPlayerVersion:function(){return{major:a.pv[0],minor:a.pv[1],release:a.pv[2]}},hasFlashPlayerVersion:O,createSWF:function(k,j,i){if(a.w3cdom&&S){return R(k,j,i)}else{return undefined}},createCSS:function(j,i){if(a.w3cdom){A(j,i)}},addDomLoadEvent:J,addLoadEvent:M,getQueryParamValue:function(m){var l=g.location.search||g.location.hash;if(m==null){return l}if(l){var k=l.substring(1).split("&");for(var j=0;j<k.length;j++){if(k[j].substring(0,k[j].indexOf("="))==m){return k[j].substring((k[j].indexOf("=")+1))}}}return""},expressInstallCallback:function(){if(C&&L){var i=c(K);if(i){i.parentNode.replaceChild(L,i);if(T){X(T,true);if(a.ie&&a.win){L.style.display="block"}}L=null;T=null;C=false}}}}}();

/* Javascript Document */
/**************** Enginer Sannhac *****************/
SNEnginer.prototype.sys_sOption;
SNEnginer.prototype.sys_sAct;
SNEnginer.prototype.sys_sTask;
SNEnginer.prototype.sys_sTab;

SNEnginer.prototype.m_sSection;
SNEnginer.prototype.m_sIncPath;
SNEnginer.prototype.m_sAbsPath;

//Khoanb 29.05.08
SNEnginer.prototype.m_sFilePathJs;
SNEnginer.prototype.m_sFilePathLayout;
SNEnginer.prototype.m_sFilePathLayoutImages;
SNEnginer.prototype.m_sFilePathLayoutCss;
SNEnginer.prototype.linkAjaxFile;
SNEnginer.prototype.sPathMedia;
SNEnginer.prototype.sLayoutPath;

function SNEnginer( ) {
	this.sys_sOption = arguments[0];
	this.sys_sAct = arguments[1];
	this.sys_sTask = arguments[2];	
	this.sys_sTab = arguments[3];	
	this.m_sSection = arguments[4];
	this.m_sIncPath = arguments[5];	
	this.sPathMedia = '';
};

SNEnginer.prototype.setAbsPath = function( ) {
	this.m_sAbsPath = arguments[0];
	this.m_sFilePathJs = arguments[1]+'js/';
	this.m_sFilePathLayout = arguments[1]+'layouts/';
	this.m_sFilePathLayoutImages = this.m_sFilePathLayout+'images/';
	this.m_sFilePathLayoutCss 	 = this.m_sFilePathLayout+'css/';
	this.sLayoutPath = arguments[0]+"layouts/default/";
	this.linkAjaxFile = arguments[0]+'ajax.php';
};

/*SNEnginer.prototype.doSyncTask = function( ) { 	
	alert(arguments.length)
	alert(arguments[1])
	switch( arguments.length ) {
		case 1:
			var p_sTask = arguments[0];
			var oForm = document.getElementById( 'mainForm' );
			oForm.sys_sOption.value = this.sys_sOption;
			oForm.sys_sAct.value = this.sys_sAct;
			oForm.sys_sTask.value = p_sTask;
			break;
		case 2:
			var p_sFormId = arguments[0];
			var p_sTask = arguments[1];
			var oForm = document.getElementById( p_sFormId );
			oForm.sys_sOption.value = this.sys_sOption;
			oForm.sys_sAct.value = this.sys_sAct;
			oForm.sys_sTask.value = p_sTask;
			break;
		case 3:
			var p_sFormId = arguments[0];
			var p_sOption = arguments[1];
			var p_sTask = arguments[2];
			var oForm = document.getElementById( p_sFormId );
			oForm.sys_sOption.value = p_sOption;
			oForm.sys_sAct.value = this.sys_sAct;
			oForm.sys_sTask.value = p_sTask;
			break;
		case 4:
			var p_sFormId = arguments[0];
			var p_sOption = arguments[1];
			var p_sAct = arguments[2];
			var p_sTask = arguments[3];
			var oForm = document.getElementById( p_sFormId );
			oForm.sys_sOption.value = p_sOption;
			oForm.sys_sAct.value = p_sAct;
			oForm.sys_sTask.value = p_sTask;
			break;
	}
	
	oForm.submit( );
};

function createHidden( ) {
	switch( arguments.length ) {
		case 2:
			var sName = arguments[0];
			var sValue = arguments[1];
			var oForm = document.getElementById( 'mainForm' );
			break;
		case 3:
			var sFormId = arguments[0];
			var sName = arguments[1];
			var sValue = arguments[2];
			var oForm = document.getElementById( sFormId );
			break;
	}
	
	var oHidden = document.createElement( 'input' );
	oHidden.type = "hidden";
	oHidden.name = sName;
	oHidden.value = sValue;
	
	oForm.appendChild( oHidden );
}*/
// Js Play Media file SN
function play(id, url){
	var divId 	= document.getElementById("span_"+id+"_"+url);
	divId.innerHTML = "<img src='"+oRootEngine.sLayoutPath+"/images/q_play.v1.png' width=16 height=16 alt='Nghe thử' title='Nghe thử' style='cursor: pointer;' align='bottom'>";
	if(isIE){
		var list = document.getElementsByTagName("span");
		for(var i = 0; i< list.length; i++){
			if(list[i].name == "q_player"){
				list[i].innerHTML = gettempplay( list[i].id);
			}
		}
	}else if(isFF){
		var list = document.getElementsByName("q_player");
		for(var i = 0; i< list.length; i++){
			list[i].innerHTML = gettempplay( list[i].id);
		}
	}	
	//request = 'cmd=qplay&c_id='+id+'&url='+url;
	$.get(oRootEngine.linkAjaxFile,{ cmd: "qplay", c_id: id, url: url }, function(data){
		var divId = document.getElementById("span_"+id+"_"+url);
		divId.innerHTML = data;
		//setAndExecute(divId);
	});		
};

function setAndExecute(divId) {
   var x = divId.getElementsByTagName("script"); 
   for( var i=0; i < x.length; i++) {
     	eval(x[i].text);
   }
};

function gettempplay(str){
	var sid = str.split("_");
	return "<img src='"+oRootEngine.m_sFilePathLayout+"/images/q_play.v1.png' width='16' height='16' alt='Nghe thử' title='Nghe thử' onclick=\"play("+sid[1]+", \'"+sid[2]+"\');\" style='cursor: pointer;' align='bottom'>";
};


/**************** End Enginer Sannhac *****************/

function img_resize(obj)
{
	//var pWidth = obj.parentNode.style.width;
	//pWidth = pWidth.replace("px","");
	var pHeight = obj.parentNode.style.height;
	pHeight = pHeight.replace("px","");
	
	var myWidth = obj.width;
	var myHeight = obj.height;
	
	if(myHeight > pHeight)
	{
		obj.height = pHeight;
		obj.width = (myWidth/myHeight) * pHeight;
	}
};

function img_resize2(obj)
{
	var pWidth = obj.parentNode.style.width;
	pWidth = pWidth.replace("px","");
	var pHeight = obj.parentNode.style.height;
	pHeight = pHeight.replace("px","");

	
	var myHeight 	= obj.height;
	var myWidth		= obj.width;
	
	var scale;
	if(pWidth/myWidth > pHeight/myHeight)
		scale	= pHeight/myHeight;
	else	scale	= pWidth/myWidth;
	
	//myWidth	  = (pWidth/pHeight) * myHeight;
	obj.width = scale*myWidth - 4;
	obj.height= scale*myHeight - 4 ;
};

function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
};

function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
};

function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
		if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
		for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
		if(!x && d.getElementById) x=d.getElementById(n); return x;
};

function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
};




/*********************************** common.js *****************************/

function pagging_ajax(totalPage, page, div, funcajax) 
{
	var uPaging = "<ul>\n";
	var class_active = "";
	var action = "";
	if((page-1)>0){
		uPaging += "<li class='previous'><a href='#' onclick=\""+funcajax+"('"+div+"', 1); return false;\">&nbsp;</a></li>\n";
	}
	var offset = page - 2;
	var limit = (page-2)+5;
	for(var i = offset; i < limit; i++){
		if(i <= totalPage && i>0){
			if(page == i) {
				class_active = "active";
				action = "";
			}else{	
				class_active = "";
				action = funcajax + "('"+div+"', "+i+"); return false;";
			}
			uPaging += "<li class='"+class_active+"'><a href='javascript: void(0);' onclick=\""+action+"\">"+i+"</a></li>\n";
		}
	}
	if((page+1)<=totalPage){
		uPaging += "<li class='next'><a href='#' onclick=\""+funcajax+"('"+div+"', "+totalPage+"); return false;\">&nbsp;</a></li>\n";
	}
	return uPaging+"</ul>";
};

function get_day(day, int)
 {
	var arrday = day.split("-");
	var date = new Date(arrday[0], parseInt(arrday[1])-1, arrday[2]);
	var day = parseInt(arrday[2]) + int;
	date.setDate(day);
	day = date.getDate();
	var month = date.getMonth()+1;
	if(isFF)
		var year = date.getYear() + 1900;
	else
		var year = date.getYear();
	if(month<10) month = "0"+month;
	if(day<10) day = "0"+day;
	return year+'-'+month+'-'+day;
};

function smiley(filename){
	return "<img src='"+sPathLayout+"images/emoticons/"+filename+".v1.gif' align='absmiddle'>";
}

function translate(str)
{
	str = replace_link(nl2br(str));
	if(str.length>0){
		var translate = new Array(';))',':((',':))','>:)','\:d/','\:D/',':)',':(',';)',':d',':D',';;)',':x',':X',':\">',':\"&gt;',':&quot;&gt;','>:p','>:P',':p',':P',':*',':o',':O','x(','X(',':>',':&gt;','b)','B)',':s',':S','&gt;:)',':|','=))','[-(','=p~','=P~',':-<',':-&lt;','[-x','[-X',':d/');
		var imgs = new Array("71","20","21","19","69","69","1","2","3","4","4","5","8","8","9","9","9","47","47","10","10","11","13","13","14","14","15","15","16","16","17","17","19","22","24","33","38","38","46","46","68","68","69");
		var total = translate.length;
		for(var i=0; i<total; i++){
			for(var j=0; j<=10; j++){
				str = str.replace(translate[i], smiley(imgs[i]));
			}
		}
	}
	return str;
};

function nl2br(str){
	var arr = str.split("\n");
	var total = arr.length;
	for(var i=0; i<total; i++){
		str = str.replace("\n"," <br> ");
	}
	return str;
};

function convertString2Unicode(s)
{
   var uniString = "", hexVal, uniChar;

   for(var i = 0; i < s.length; ++i)
   {
      //Convert char to hex
      hexVal = Number(s.charCodeAt(i)).toString(16);

      //Convert to unicode by making sure hex is 4 chars long, padding with 0's if less
      uniChar = "\\u" + ("000" + hexVal).match(/.{4}$/)[0];

      uniString += uniChar;
   }

   return uniString;
};

function escapeTxt(os){
	var ns='';
	var t;
	var chr='';
	var cc='';
	var tn='';
	for(i=0;i<256;i++){
	tn=i.toString(16);
	if(tn.length<2)tn="0"+tn;
		cc+=tn;
		chr+=unescape('%'+tn);
	}
	cc=cc.toUpperCase();
	os.replace(String.fromCharCode(13)+'',"%13");
	for(q=0;q<os.length;q++){
		t=os.substr(q,1);
		for(i=0;i<chr.length;i++){
			if(t==chr.substr(i,1)){
			t=t.replace(chr.substr(i,1),"%"+cc.substr(i*2,2));
			i=chr.length;
			}
		}
		ns+=t;
	}
	return ns;
};

function replace_link(str){
	var arr = str.split(" ");
	var total_word = arr.length;
	var return_str = "";
	for(var i=0; i<total_word; i++){
		var pre	=arr[i].substr(0,5);
		var str_length = arr[i].length;
		if(pre=="http:" ){
			if(str_length>=40){
				var str_start = arr[i].substr(0, 37);
				var url = "<a href='"+arr[i]+"' title='"+arr[i]+"' style='color:#29ADEB' >"+str_start+"...</a>";
			}else{
				var url = "<a href='"+arr[i]+"' title='"+arr[i]+"' style='color:#29ADEB' >"+arr[i]+"</a>";
			}
		}else{
			if(str_length>=40){
				var str_start = arr[i].substr(0, 37);
				var url = str_start+"...";
			}else{
				var url = arr[i];
			}
		}
		return_str+= url + " ";
	}
	return return_str;
};
/* End common.js */
// AVIM Start
/*
 *  AVIM JavaScript Vietnamese Input Method Source File dated 28-07-2008
 *
 *	Copyright (C) 2004-2008 Hieu Tran Dang <lt2hieu2004 (at) users (dot) sf (dot) net
 *	Website:	http://noname00.com/hieu
 *
 *	You are allowed to use this software in any way you want providing:
 *		1. You must retain this copyright notice at all time
 *		2. You must not claim that you or any other third party is the author
 *		   of this software in any way.
*/

var AVIMGlobalConfig = {
	method: -1, //Default input method: 0=AUTO, 1=TELEX, 2=VNI, 3=VIQR, 4=VIQR*
	onOff: 1, //Starting status: 0=Off, 1=On
	ckSpell: 0, //Spell Check: 0=Off, 1=On
	oldAccent: 1, //0: New way (oa`, oe`, uy`), 1: The good old day (o`a, o`e, u`y)
	useCookie: 1, //Cookies: 0=Off, 1=On
	exclude: ["email"], //IDs of the fields you DON'T want to let users type Vietnamese in
	showControl: 0, //Show control panel: 0=Off, 1=On. If you turn this off, you must write your own control panel.
	controlCSS: "avim.css" //Path to avim.css
};

//Set to true the methods which you want to be included in the AUTO method
var AVIMAutoConfig = {
	telex: true,
	vni: true,
	viqr: false,
	viqrStar: false
};

function AVIM()	{
	this.radioID = "avim_auto,avim_telex,avim_vni,avim_viqr,avim_viqr2,avim_off,avim_ckspell,avim_daucu".split(",");
	this.attached = [];
	this.changed = false;
	this.agt = navigator.userAgent.toLowerCase();
	this.alphabet = "QWERTYUIOPASDFGHJKLZXCVBNM\ ";
	this.support = true;
	this.ver = 0;
	this.specialChange = false;
	this.is_ie = ((this.agt.indexOf("msie") != -1) && (this.agt.indexOf("opera") == -1));
	this.is_opera = false;
	this.isKHTML = false;
	this.kl = 0;
	this.skey = [97,226,259,101,234,105,111,244,417,117,432,121,65,194,258,69,202,73,79,212,416,85,431,89];
	this.fID = document.getElementsByTagName("iframe");
	this.range = null;
	this.whit = false;
	this.db1 = [273,272];
	this.ds1 = ['d','D'];
	this.os1 = "o,O,ơ,Ơ,ó,Ó,ò,Ò,ọ,Ọ,ỏ,Ỏ,õ,Õ,ớ,Ớ,ờ,Ờ,ợ,Ợ,ở,Ở,ỡ,Ỡ".split(",");
	this.ob1 = "ô,Ô,ô,Ô,ố,Ố,ồ,Ồ,ộ,Ộ,ổ,Ổ,ỗ,Ỗ,ố,Ố,ồ,Ồ,ộ,Ộ,ổ,Ổ,ỗ,Ỗ".split(",");
	this.mocs1 = "o,O,ô,Ô,u,U,ó,Ó,ò,Ò,ọ,Ọ,ỏ,Ỏ,õ,Õ,ú,Ú,ù,Ù,ụ,Ụ,ủ,Ủ,ũ,Ũ,ố,Ố,ồ,Ồ,ộ,Ộ,ổ,Ổ,ỗ,Ỗ".split(",");
	this.mocb1 = "ơ,Ơ,ơ,Ơ,ư,Ư,ớ,Ớ,ờ,Ờ,ợ,Ợ,ở,Ở,ỡ,Ỡ,ứ,Ứ,ừ,Ừ,ự,Ự,ử,Ử,ữ,Ữ,ớ,Ớ,ờ,Ờ,ợ,Ợ,ở,Ở,ỡ,Ỡ".split(",");
	this.trangs1 = "a,A,â,Â,á,Á,à,À,ạ,Ạ,ả,Ả,ã,Ã,ấ,Ấ,ầ,Ầ,ậ,Ậ,ẩ,Ẩ,ẫ,Ẫ".split(",");
	this.trangb1 = "ă,Ă,ă,Ă,ắ,Ắ,ằ,Ằ,ặ,Ặ,ẳ,Ẳ,ẵ,Ẵ,ắ,Ắ,ằ,Ằ,ặ,Ặ,ẳ,Ẳ,ẵ,Ẵ".split(",");
	this.as1 = "a,A,ă,Ă,á,Á,à,À,ạ,Ạ,ả,Ả,ã,Ã,ắ,Ắ,ằ,Ằ,ặ,Ặ,ẳ,Ẳ,ẵ,Ẵ,ế,Ế,ề,Ề,ệ,Ệ,ể,Ể,ễ,Ễ".split(",");
	this.ab1 = "â,Â,â,Â,ấ,Ấ,ầ,Ầ,ậ,Ậ,ẩ,Ẩ,ẫ,Ẫ,ấ,Ấ,ầ,Ầ,ậ,Ậ,ẩ,Ẩ,ẫ,Ẫ,é,É,è,È,ẹ,Ẹ,ẻ,Ẻ,ẽ,Ẽ".split(",");
	this.es1 = "e,E,é,É,è,È,ẹ,Ẹ,ẻ,Ẻ,ẽ,Ẽ".split(",");
	this.eb1 = "ê,Ê,ế,Ế,ề,Ề,ệ,Ệ,ể,Ể,ễ,Ễ".split(",");
	this.english = "ĐÂĂƠƯÊÔ";
	this.lowen = "đâăơưêô";
	this.arA = "á,à,ả,ã,ạ,a,Á,À,Ả,Ã,Ạ,A".split(',');
	this.mocrA = "ó,ò,ỏ,õ,ọ,o,ú,ù,ủ,ũ,ụ,u,Ó,Ò,Ỏ,Õ,Ọ,O,Ú,Ù,Ủ,Ũ,Ụ,U".split(',');
	this.erA = "é,è,ẻ,ẽ,ẹ,e,É,È,Ẻ,Ẽ,Ẹ,E".split(',');
	this.orA = "ó,ò,ỏ,õ,ọ,o,Ó,Ò,Ỏ,Õ,Ọ,O".split(',');
	this.aA = "ấ,ầ,ẩ,ẫ,ậ,â,Ấ,Ầ,Ẩ,Ẫ,Ậ,Â".split(',');
	this.oA = "ố,ồ,ổ,ỗ,ộ,ô,Ố,Ồ,Ổ,Ỗ,Ộ,Ô".split(',');
	this.mocA = "ớ,ờ,ở,ỡ,ợ,ơ,ứ,ừ,ử,ữ,ự,ư,Ớ,Ờ,Ở,Ỡ,Ợ,Ơ,Ứ,Ừ,Ử,Ữ,Ự,Ư".split(',');
	this.trangA = "ắ,ằ,ẳ,ẵ,ặ,ă,Ắ,Ằ,Ẳ,Ẵ,Ặ,Ă".split(',');
	this.eA = "ế,ề,ể,ễ,ệ,ê,Ế,Ề,Ể,Ễ,Ệ,Ê".split(',');
	this.oA = "ố,ồ,ổ,ỗ,ộ,ô,Ố,Ồ,Ổ,Ỗ,Ộ,Ô".split(',');
	this.skey2 = "a,a,a,e,e,i,o,o,o,u,u,y,A,A,A,E,E,I,O,O,O,U,U,Y".split(',');
	
	this.fcc = function(x) {
		return String.fromCharCode(x);
	}
	
	this.getEL = function(id) {
		return document.getElementById(id);
	}
	
	this.getSF = function() {
		var sf = [], x;
		for(x = 0; x < this.skey.length; x++) {
			sf[sf.length] = this.fcc(this.skey[x]);
		}
		return sf;
	}
	
	if(AVIMGlobalConfig.showControl) {
		this.css = document.createElement('link');
		this.css.rel = 'stylesheet';
		this.css.type = 'text/css';
		this.css.href = AVIMGlobalConfig.controlCSS;
		document.getElementsByTagName('head')[0].appendChild(this.css);
		document.write('<span id="AVIMControl">');
		document.write('<p class="AVIMControl"><input id="avim_auto" type="radio" name="AVIMMethod" onclick="AVIMObj.setMethod(0);" />Tự động');
		document.write('<input id="avim_telex" type="radio" name="AVIMMethod" onclick="AVIMObj.setMethod(1);" />TELEX');
		document.write('<input id="avim_vni" type="radio" name="AVIMMethod" onclick="AVIMObj.setMethod(2);" />VNI');
		document.write('<input id="avim_viqr" type="radio" name="AVIMMethod" onclick="AVIMObj.setMethod(3);" />VIQR');
		document.write('<input id="avim_viqr2" type="radio" name="AVIMMethod" onclick="AVIMObj.setMethod(4);" />VIQR*');
		document.write('<input id="avim_off" type="radio" name="AVIMMethod" onclick="AVIMObj.setMethod(-1);" />Tắt<br />');
		document.write('<a class="AVIMControl" style="float: right; position: relative; top: 3px;" onclick="document.getElementById(' + "'AVIMControl').style.display='none';" + '">[Ẩn AVIM - F12]</a>');
		document.write('<input type="checkbox" id="avim_ckspell" onclick="AVIMObj.setSpell(this);" />Chính tả');
		document.write('<input type="checkbox" id="avim_daucu" onclick="AVIMObj.setDauCu(this);" />Kiểu cũ</p>');
		document.write('</span>');
	}

	if(!this.is_ie) {
		if(this.agt.indexOf("opera") >= 0) {
			this.operaV = this.agt.split(" ");
			this.operaVersion = parseInt(this.operaV[this.operaV.length - 1]);
			if(this.operaVersion >= 8) {
				this.is_opera = true;
			} else {
				this.operaV = this.operaV[0].split("/");
				this.operaVersion = parseInt(this.operaV[1]);
				if(this.operaVersion >= 8) this.is_opera = true;
			}
		} else if(this.agt.indexOf("khtml") >= 0) {
			this.isKHTML = true;
		} else {
			this.ver = this.agt.substr(this.agt.indexOf("rv:") + 3);
			this.ver = parseFloat(this.ver.substr(0, this.ver.indexOf(" ")));
			if(this.agt.indexOf("mozilla") < 0) this.ver = 0;
		}
	}
	
	this.nospell = function(w, k) {
		return false;
	}
	
	this.ckspell = function(w, k) {
		w = this.unV(w);
		var exc = "UOU,IEU".split(','), z, next = true, noE = "UU,UOU,UOI,IEU,AO,IA,AI,AY,AU,AO".split(','), noBE = "YEU";
		var check = true, noM = "UE,UYE,IU,EU,UY".split(','), noMT = "AY,AU".split(','), noT = "UA", t = -1, notV2 = "IAO";
		var uw = this.up(w), tw = uw, update = false, gi = "IO", noAOEW = "OE,OO,AO,EO,IA,AI".split(','), noAOE = "OA", test, a, b;
		var notViet = "AA,AE,EE,OU,YY,YI,IY,EY,EA,EI,II,IO,YO,YA,OOO".split(','), uk = this.up(k), twE, uw2 = this.unV2(uw);
		var vSConsonant = "B,C,D,G,H,K,L,M,N,P,Q,R,S,T,V,X".split(','), vDConsonant = "CH,GI,KH,NGH,GH,NG,NH,PH,QU,TH,TR".split(',');
		var vDConsonantE = "CH,NG,NH".split(','),sConsonant = "C,P,T,CH".split(','),vSConsonantE = "C,M,N,P,T".split(',');
		var noNHE = "O,U,IE,Ô,Ơ,Ư,IÊ,Ă,Â,UYE,UYÊ,UO,ƯƠ,ƯO,UƠ,UA,ƯA,OĂ,OE,OÊ".split(','),oMoc = "UU,UOU".split(',');
		if(this.FRX.indexOf(uk) >= 0) {
			for(a = 0; a < sConsonant.length; a++) {
				if(uw.substr(uw.length - sConsonant[a].length, sConsonant[a].length) == sConsonant[a]) {
					return true;
				}
			}
		}
		for(a = 0; a < uw.length; a++) {
			if("FJZW1234567890".indexOf(uw.substr(a, 1)) >= 0) {
				return true;
			}
			for(b = 0; b < notViet.length; b++) {
				if(uw2.substr(a, notViet[b].length) == notViet[b]) {
					for(z = 0; z < exc.length; z++) {
						if(uw2.indexOf(exc[z]) >= 0) {
							next=false;
						}
					}
					if(next && ((gi.indexOf(notViet[b]) < 0) || (a <= 0) || (uw2.substr(a - 1, 1) != 'G'))) {
						return true;
					}
				}
			}
		}
		for(b = 0; b < vDConsonant.length; b++) {
			if(tw.indexOf(vDConsonant[b]) == 0) {
				tw = tw.substr(vDConsonant[b].length);
				update = true;
				t = b;
				break;
			}
		}
		if(!update) {
			for(b = 0; b < vSConsonant.length; b++) {
				if(tw.indexOf(vSConsonant[b]) == 0) {
					tw=tw.substr(1);
					break;
				}
			}
		}
		update=false;
		twE=tw;
		for(b = 0; b < vDConsonantE.length; b++) {
			if(tw.substr(tw.length - vDConsonantE[b].length) == vDConsonantE[b]) {
				tw = tw.substr(0, tw.length - vDConsonantE[b].length);
				if(b == 2){
					for(z = 0; z < noNHE.length; z++) {
						if(tw == noNHE[z]) {
							return true;
						}
					}
					if((uk == this.trang) && ((tw == "OA") || (tw == "A"))) {
						return true;
					}
				}
				update = true;
				break;
			}
		}
		if(!update) {
			for(b = 0; b < vSConsonantE.length; b++) {
				if(tw.substr(tw.length - 1) == vSConsonantE[b]) {
					tw = tw.substr(0, tw.length - 1);
					break;
				}
			}
		}
		if(tw) {
			for(a = 0; a < vDConsonant.length; a++) {
				for(b = 0; b < tw.length; b++) {
					if(tw.substr(b, vDConsonant[a].length) == vDConsonant[a]) {
						return true;
					}
				}
			}
			for(a = 0; a < vSConsonant.length; a++) {
				if(tw.indexOf(vSConsonant[a]) >= 0) {
					return true;
				}
			}
		}
		test = tw.substr(0, 1);
		if((t == 3) && ((test == "A") || (test == "O") || (test == "U") || (test == "Y"))) {
			return true;
		}
		if((t == 5) && ((test == "E") || (test == "I") || (test == "Y"))) {
			return true;
		}
		uw2 = this.unV2(tw);
		if(uw2 == notV2) {
			return true;
		}
		if(tw != twE) {
			for(z = 0; z < noE.length; z++) {
				if(uw2 == noE[z]) {
					return true;
				}
			}
		}
		if((tw != uw) && (uw2 == noBE)) {
			return true;
		}
		if(uk != this.moc) {
			for(z = 0; z < oMoc.length; z++) {
				if(tw == oMoc[z]) return true;
			}
		}
		if((uw2.indexOf('UYE')>0) && (uk == 'E')) {
			check=false;
		}
		if((this.them.indexOf(uk) >= 0) && check) {
			for(a = 0; a < noAOEW.length; a++) {
				if(uw2.indexOf(noAOEW[a]) >= 0) {
					return true;
				}
			}
			if(uk != this.trang) {
				if(uw2 == noAOE) {
					return true;
				}
			}
			if((uk == this.trang) && (this.trang != 'W')) {
				if(uw2 == noT) {
					return true;
				}
			}
			if(uk == this.moc) {
				for(a = 0; a < noM.length; a++) {
					if(uw2 == noM[a]) {
						return true;
					}
				}
			}
			if((uk == this.moc) || (uk == this.trang)) {
				for(a = 0; a < noMT.length; a++) {
					if(uw2 == noMT[a]) {
						return true;
					}
				}
			}
		}
		this.tw5 = tw;
		if((uw2.charCodeAt(0) == 272) || (uw2.charCodeAt(0) == 273)) {
			if(uw2.length > 4) {
				return true;
			}
		} else if(uw2.length > 3) {
			return true;
		}
		return false;
	}
	
	this.noCookie = function() {}
	
	this.doSetCookie = function() {
		var exp = new Date(11245711156480).toGMTString();
		document.cookie = 'AVIM_on_off=' + AVIMGlobalConfig.onOff + ';expires=' + exp + ';path=/';
		document.cookie = 'AVIM_method=' + AVIMGlobalConfig.method + ';expires=' + exp + ';path=/';
		document.cookie = 'AVIM_ckspell=' + AVIMGlobalConfig.ckSpell + ';expires=' + exp + ';path=/';
		document.cookie = 'AVIM_daucu=' + AVIMGlobalConfig.oldAccent + ';expires=' + exp + ';path=/';
	}
	
	this.doGetCookie = function() {
		var ck = document.cookie, res = /AVIM_method/.test(ck), p, i, ckA = ck.split(';');
		if(!res || (ck.indexOf('AVIM_ckspell') < 0)) {
			this.setCookie();
			return;
		}
		for(i = 0; i < ckA.length; i++) {
			p = ckA[i].split('=');
			p[0] = p[0].replace(/^\s+/g, "");
			p[1] = parseInt(p[1]);
			if(p[0] == 'AVIM_on_off') {
				AVIMGlobalConfig.onOff = p[1];
			}
			else if(p[0] == 'AVIM_method') {
				AVIMGlobalConfig.method = p[1];
			}
			else if(p[0] == 'AVIM_ckspell') {
				if(p[1] == 0) {
					AVIMGlobalConfig.ckSpell=0;
					this.spellerr=this.nospell;
				} else {
					AVIMGlobalConfig.ckSpell=1;
					this.spellerr=this.ckspell;
				}
			} else if(p[0] == 'AVIM_daucu') {
				AVIMGlobalConfig.oldAccent = parseInt(p[1]);
			}
		}
	}
	
	if(AVIMGlobalConfig.useCookie == 1) {
		this.setCookie = this.doSetCookie;
		this.getCookie = this.doGetCookie;
	} else {
		this.setCookie = this.noCookie;
		this.getCookie = this.noCookie;
	}
	
	this.setMethod = function(m) {
		if(m == -1) {
			AVIMGlobalConfig.onOff = 0;
			if(this.getEL(this.radioID[5])) {
				this.getEL(this.radioID[5]).checked = true;
			}
		} else {
			AVIMGlobalConfig.onOff = 1;
			AVIMGlobalConfig.method = m;
			if(this.getEL(this.radioID[m])) {
				this.getEL(this.radioID[m]).checked = true;
			}
		}
		this.setSpell(AVIMGlobalConfig.ckSpell);
		this.setDauCu(AVIMGlobalConfig.oldAccent);
		this.setCookie();
	}
	
	this.setDauCu = function(box) {
		if(typeof(box) == "number") {
			AVIMGlobalConfig.oldAccent = box;
			if(this.getEL(this.radioID[7])) {
				this.getEL(this.radioID[7]).checked = box;
			}
		} else {
			AVIMGlobalConfig.oldAccent = (box.checked) ? 1 : 0;
		}
		this.setCookie();
	}
	
	this.setSpell = function(box) {
		if(typeof(box) == "number") {
			this.spellerr = (box == 1) ? this.ckspell : this.nospell;
			if(this.getEL(this.radioID[6])) {
				this.getEL(this.radioID[6]).checked = box;
			}
		} else {
			if(box.checked) {
				this.spellerr = this.ckspell;
				AVIMGlobalConfig.ckSpell = 1;
			} else {
				this.spellerr = this.nospell;
				AVIMGlobalConfig.ckSpell = 0;
			}
		}
		this.setCookie();
	}
	
	if(this.is_ie || (this.ver >= 1.3) || this.is_opera || this.isKHTML) {
		this.getCookie();
		if(AVIMGlobalConfig.onOff == 0) this.setMethod(-1);
		else this.setMethod(AVIMGlobalConfig.method);
		this.setSpell(AVIMGlobalConfig.ckSpell);
		this.setDauCu(AVIMGlobalConfig.oldAccent);
	} else {
		this.support = false;
	}
	
	this.mozGetText = function(obj) {
		var v, pos, w = "", g = 1;
		v = (obj.data) ? obj.data : obj.value;
		if(v.length <= 0) {
			return false;
		}
		if(!obj.data) {
			if(!obj.setSelectionRange) {
				return false;
			}
			pos = obj.selectionStart;
		} else {
			pos = obj.pos;
		}
		if(obj.selectionStart != obj.selectionEnd) {
			return ["", pos];
		}
		while(1) {
			if(pos - g < 0) {
				break;
			} else if(this.notWord(v.substr(pos - g, 1))) {
				if(v.substr(pos - g, 1) == "\\") {
					w = v.substr(pos - g, 1) + w;
				}
				break;
			} else {
				w = v.substr(pos - g, 1) + w;
			}
			g++;
		}
		return [w, pos];
	}
	
	this.ieGetText = function(obj) {
		var caret = obj.document.selection.createRange(), w="";
		if(caret.text) {
			caret.text = "";
		} else {
			while(1) {
				caret.moveStart("character", -1);
				if(w.length == caret.text.length) {
					break;
				}
				w = caret.text;
				if(this.notWord(w.charAt(0))) {
					if(w.charCodeAt(0) == 13) {
						w=w.substr(2);
					} else if(w.charAt(0) != "\\") {
						w=w.substr(1);
					}
					break;
				}
			}
		}
		if(w.length) {
			caret.collapse(false);
			caret.moveStart("character", -w.length);
			obj.cW = caret.duplicate();
			return obj;
		} else {
			return false;
		}
	}
	
	this.start = function(obj, key) {
		var w = "", method = AVIMGlobalConfig.method, dockspell = AVIMGlobalConfig.ckSpell, uni, uni2 = false, uni3 = false, uni4 = false;
		this.oc=obj;
		var telex = "D,A,E,O,W,W".split(','), vni = "9,6,6,6,7,8".split(','), viqr = "D,^,^,^,+,(".split(','), viqr2 = "D,^,^,^,*,(".split(','), a, noNormC;
		if(method == 0) {
			var arr = [], check = [AVIMAutoConfig.telex, AVIMAutoConfig.vni, AVIMAutoConfig.viqr, AVIMAutoConfig.viqrStar];
			var value1 = [telex, vni, viqr, viqr2], uniA = [uni, uni2, uni3, uni4], D2A = ["DAWEO", "6789", "D^+(", "D^*("];
			for(a = 0; a < check.length; a++) {
				if(check[a]) {
					arr[arr.length] = value1[a];
				} else {
					D2A[a] = "";
				}
			}
			for(a = 0; a < arr.length; a++) {
				uniA[a] = arr[a];
			}
			uni = uniA[0];
			uni2 = uniA[1];
			uni3 = uniA[2];
			uni4 = uniA[3];
			this.D2 = D2A.join();
			if(!uni) {
				return;
			}
		} else if(method == 1) {
			uni = telex;
			this.D2 = "DAWEO";
		}
		else if(method == 2) {
			uni = vni;
			this.D2 = "6789";
		}
		else if(method == 3) {
			uni = viqr;
			this.D2 = "D^+(";
		}
		else if(method == 4) {
			uni = viqr2;
			this.D2 = "D^*(";
		}
		if(!this.is_ie) {
			key = this.fcc(key.which);
			w = this.mozGetText(obj);
			if(!w || obj.sel) {
				return;
			}
			if(this.D2.indexOf(this.up(key)) >= 0) {
				noNormC = true;
			} else {
				noNormC = false;
			}
			this.main(w[0], key, w[1], uni, noNormC);
			if(!dockspell) {
				w = this.mozGetText(obj);
			}
			if(w && uni2 && !this.changed) {
				this.main(w[0], key, w[1], uni2, noNormC);
			}
			if(!dockspell) {
				w = this.mozGetText(obj);
			}
			if(w && uni3 && !this.changed) {
				this.main(w[0], key, w[1], uni3, noNormC);
			}
			if(!dockspell) {
				w = this.mozGetText(obj);
			}
			if(w && uni4 && !this.changed) {
				this.main(w[0], key, w[1], uni4, noNormC);
			}
		} else {
			obj = this.ieGetText(obj);
			if(obj) {
				var sT = obj.cW.text;
				w = this.main(sT, key, 0, uni, false);
				if(uni2 && ((w == sT) || (typeof(w) == 'undefined'))) {
					w = this.main(sT, key, 0, uni2, false);
				}
				if(uni3 && ((w == sT) || (typeof(w) == 'undefined'))) {
					w = this.main(sT, key, 0, uni3, false);
				}
				if(uni4 && ((w == sT) || (typeof(w) == 'undefined'))) {
					w = this.main(sT, key, 0, uni4, false);
				}
				if(w) {
					obj.cW.text = w;
				}
			}
		}
		if(this.D2.indexOf(this.up(key)) >= 0) {
			if(!this.is_ie) {
				w = this.mozGetText(obj);
				if(!w) {
					return;
				}
				this.normC(w[0], key, w[1]);
			} else if(typeof(obj) == "object") {
				obj = this.ieGetText(obj);
				if(obj) {
					w = obj.cW.text;
					if(!this.changed) {
						w += key;
						this.changed = true;
					}
					obj.cW.text = w;
					w = this.normC(w, key, 0);
					if(w) {
						obj = this.ieGetText(obj);
						obj.cW.text = w;
					}
				}
			}
		}
	}
	
	this.findC = function(w, k, sf) {
		var method = AVIMGlobalConfig.method;
		if(((method == 3) || (method == 4)) && (w.substr(w.length - 1, 1) == "\\")) {
			return [1, k.charCodeAt(0)];
		}
		var str = "", res, cc = "", pc = "", tE = "", vowA = [], s = "ÂĂÊÔƠƯêâăơôư", c = 0, dn = false, uw = this.up(w), tv, g;
		var DAWEOFA = this.up(this.aA.join() + this.eA.join() + this.mocA.join() + this.trangA.join() + this.oA.join() + this.english), h, uc;
		for(g = 0; g < sf.length; g++) {
			if(this.nan(sf[g])) {
				str += sf[g];
			} else {
				str += this.fcc(sf[g]);
			}
		}
		var uk = this.up(k), uni_array = this.repSign(k), w2 = this.up(this.unV2(this.unV(w))), dont = "ƯA,ƯU".split(',');
		if (this.DAWEO.indexOf(uk) >= 0) {
			if(uk == this.moc) {
				if((w2.indexOf("UU") >= 0) && (this.tw5 != dont[1])) {
					if(w2.indexOf("UU") == (w.length - 2)) {
						res=2;
					} else {
						return false;
					}
				} else if(w2.indexOf("UOU") >= 0) {
					if(w2.indexOf("UOU") == (w.length-3)) {
						res=2;
					} else {
						return false;
					}
				}
			}
			if(!res) {
				for(g = 1; g <= w.length; g++) {
					cc = w.substr(w.length - g, 1);
					pc = this.up(w.substr(w.length - g - 1, 1));
					uc = this.up(cc);
					for(h = 0; h < dont.length; h++) {
						if((this.tw5 == dont[h]) && (this.tw5 == this.unV(pc + uc))) {
							dn = true;
						}
					}
					if(dn) {
						dn = false;
						continue;
					}
					if(str.indexOf(uc) >= 0) {
						if(((uk == this.moc) && (this.unV(uc) == "U") && (this.up(this.unV(w.substr(w.length - g + 1, 1))) == "A")) || ((uk == this.trang) && (this.unV(uc) == 'A') && (this.unV(pc) == 'U'))) {
							if(this.unV(uc) == "U") {
								tv=1;
							} else {
								tv=2;
							}
							var ccc = this.up(w.substr(w.length - g - tv, 1));
							if(ccc != "Q") {
								res = g + tv - 1;
							} else if(uk == this.trang) {
								res = g;
							} else if(this.moc != this.trang) {
								return false;
							}
						} else {
							res = g;
						}
						if(!this.whit || (uw.indexOf("Ư") < 0) || (uw.indexOf("W") < 0)) {
							break;
						}
					} else if(DAWEOFA.indexOf(uc) >= 0) {
						if(uk == this.D) {
							if(cc == "đ") {
								res = [g, 'd'];
							} else if(cc == "Đ") {
								res = [g, 'D'];
							}
						} else {
							res = this.DAWEOF(cc, uk, g);
						}
						if(res) break;
					}
				}
			}
		}
		if((uk != this.Z) && (this.DAWEO.indexOf(uk) < 0)) {
			var tEC = this.retKC(uk);
			for(g = 0;g < tEC.length; g++) {
				tE += this.fcc(tEC[g]);
			}
		}
		for(g = 1; g <= w.length; g++) {
			if(this.DAWEO.indexOf(uk) < 0) {
				cc = this.up(w.substr(w.length - g, 1));
				pc = this.up(w.substr(w.length - g - 1, 1));
				if(str.indexOf(cc) >= 0) {
					if(cc == 'U') {
						if(pc != 'Q') {
							c++;
							vowA[vowA.length] = g;
						}
					} else if(cc == 'I') {
						if((pc != 'G') || (c <= 0)) {
							c++;
							vowA[vowA.length] = g;
						}
					} else {
						c++;
						vowA[vowA.length] = g;
					}
				} else if(uk != this.Z) {
					for(h = 0; h < uni_array.length; h++) if(uni_array[h] == w.charCodeAt(w.length - g)) {
						if(this.spellerr(w, k)) {
							return false;
						}
						return [g, tEC[h % 24]];
					}
					for(h = 0; h < tEC.length; h++) {
						if(tEC[h] == w.charCodeAt(w.length - g)) {
							return [g, this.fcc(this.skey[h])];
						}
					}
				}
			}
		}
		if((uk != this.Z) && (typeof(res) != 'object')) {
			if(this.spellerr(w, k)) {
				return false;
			}
		}
		if(this.DAWEO.indexOf(uk) < 0) {
			for(g = 1; g <= w.length; g++) {
				if((uk != this.Z) && (s.indexOf(w.substr(w.length - g, 1)) >= 0)) {
					return g;
				} else if(tE.indexOf(w.substr(w.length - g, 1)) >= 0) {
					for(h = 0; h < tEC.length; h++) {
						if(w.substr(w.length - g, 1).charCodeAt(0) == tEC[h]) {
							return [g, this.fcc(this.skey[h])];
						}
					}
				}
			}
		}
		if(res) {
			return res;
		}
		if((c == 1) || (uk == this.Z)) {
			return vowA[0];
		} else if(c == 2) {
			var v = 2;
			if(w.substr(w.length - 1) == " ") {
				v = 3;
			}
			var ttt = this.up(w.substr(w.length - v, 2));
			if((AVIMGlobalConfig.oldAccent == 0) && ((ttt == "UY") || (ttt == "OA") || (ttt == "OE"))) {
				return vowA[0];
			}
			var c2 = 0, fdconsonant, sc = "BCD" + this.fcc(272) + "GHKLMNPQRSTVX", dc = "CH,GI,KH,NGH,GH,NG,NH,PH,QU,TH,TR".split(',');
			for(h = 1; h <= w.length; h++) {
				fdconsonant=false;
				for(g = 0; g < dc.length; g++) {
					if(this.up(w.substr(w.length - h - dc[g].length + 1, dc[g].length)).indexOf(dc[g])>=0) {
						c2++;
						fdconsonant = true;
						if(dc[g] != 'NGH') {
							h++;
						} else {
							h+=2;
						}
					}
				}
				if(!fdconsonant) {
					if(sc.indexOf(this.up(w.substr(w.length - h, 1))) >= 0) {
						c2++;
					} else { 
						break;
					}
				}
			}
			if((c2 == 1) || (c2 == 2)) {
				return vowA[0];
			} else {
				return vowA[1];
			}
		} else if(c == 3) {
			return vowA[1];
		} else return false;
	}
	
	this.ie_replaceChar = function(w, pos, c) {
		var r = "", uc = 0;
		if(isNaN(c)) uc = this.up(c);
		if(this.whit && (this.up(w.substr(w.length - pos - 1, 1)) == 'U') && (pos != 1) && (this.up(w.substr(w.length - pos - 2, 1)) != 'Q')) {
			this.whit = false;
			if((this.up(this.unV(this.fcc(c))) == "Ơ") || (uc == "O")) {
				if(w.substr(w.length - pos - 1, 1) == 'u') r = this.fcc(432);
				else r = this.fcc(431);
			}
			if(uc == "O") {
				if(c == "o") {
					c = 417;
				} else {
					c = 416;
				}
			}
		}
		if(!isNaN(c)) {
			this.changed = true;
			r += this.fcc(c);
			return w.substr(0, w.length - pos - r.length + 1) + r + w.substr(w.length - pos + 1);
		} else {
			return w.substr(0, w.length - pos) + c + w.substr(w.length - pos + 1);
		}
	}
	
	this.replaceChar = function(o, pos, c) {
		var bb = false;
		if(!this.nan(c)) {
			var replaceBy = this.fcc(c), wfix = this.up(this.unV(this.fcc(c)));
			this.changed = true;
		} else {
			var replaceBy = c;
			if((this.up(c) == "O") && this.whit) {
				bb=true;
			}
		}
		if(!o.data) {
			var savePos = o.selectionStart, sst = o.scrollTop;
			if ((this.up(o.value.substr(pos - 1, 1)) == 'U') && (pos < savePos - 1) && (this.up(o.value.substr(pos - 2, 1)) != 'Q')) {
				if((wfix == "Ơ") || bb) {
					if (o.value.substr(pos-1,1) == 'u') {
						var r = this.fcc(432);
					} else {
						var r = this.fcc(431);
					}
				}
				if(bb) {
					this.changed = true;
					if(c == "o") {
						replaceBy = "ơ";
					} else {
						replaceBy = "Ơ";
					}
				}
			}
			o.value = o.value.substr(0, pos) + replaceBy + o.value.substr(pos + 1);
			if(r) o.value = o.value.substr(0, pos - 1) + r + o.value.substr(pos);
			o.setSelectionRange(savePos, savePos);
			o.scrollTop = sst;
		} else {
			if ((this.up(o.data.substr(pos - 1, 1)) == 'U') && (pos < o.pos - 1)) {
				if((wfix == "Ơ") || bb) {
					if (o.data.substr(pos - 1, 1) == 'u') {
						var r = this.fcc(432);
					} else {
						var r = this.fcc(431);
					}
				}
				if(bb) {
					this.changed = true;
					if(c == "o") {
						replaceBy = "ơ";
					} else {
						replaceBy = "Ơ";
					}
				}
			}
			o.deleteData(pos, 1);
			o.insertData(pos, replaceBy);
			if(r) {
				o.deleteData(pos - 1, 1);
				o.insertData(pos - 1, r);
			}
		}
		if(this.whit) {
			this.whit=false;
		}
	}
	
	this.tr = function(k, w, by, sf, i) {
		var r, pos = this.findC(w, k, sf), g;
		if(pos) {
			if(pos[1]) {
				if(this.is_ie) {
					return this.ie_replaceChar(w, pos[0], pos[1]);
				} else {
					return this.replaceChar(this.oc, i-pos[0], pos[1]);
				}
			} else {
				var c, pC = w.substr(w.length - pos, 1), cmp;
				r = sf;
				for(g = 0; g < r.length; g++) {
					if(this.nan(r[g]) || (r[g] == "e")) {
						cmp = pC;
					} else {
						cmp = pC.charCodeAt(0);
					}
					if(cmp == r[g]) {
						if(!this.nan(by[g])) {
							c = by[g];
						} else {
							c = by[g].charCodeAt(0);
						}
						if(this.is_ie) {
							return this.ie_replaceChar(w, pos, c);
						} else {
							return this.replaceChar(this.oc, i - pos, c);
						}
					}
				}
			}
		}
		return false;
	}
	
	this.main = function(w, k, i, a, noNormC) {
		var uk = this.up(k), bya = [this.db1, this.ab1, this.eb1, this.ob1, this.mocb1, this.trangb1], got = false, t = "d,D,a,A,a,A,o,O,u,U,e,E,o,O".split(",");
		var sfa = [this.ds1, this.as1, this.es1, this.os1, this.mocs1, this.trangs1], by = [], sf = [], method = AVIMGlobalConfig.method, h, g;
		if((method == 2) || ((method == 0) && (a[0] == "9"))) {
			this.DAWEO = "6789";
			this.SFJRX = "12534";
			this.S = "1";
			this.F = "2";
			this.J = "5";
			this.R = "3";
			this.X = "4";
			this.Z = "0";
			this.D = "9";
			this.FRX = "234";
			this.AEO = "6";
			this.moc = "7";
			this.trang = "8";
			this.them = "678";
			this.A = "^";
			this.E = "^";
			this.O = "^";
		} else if((method == 3) || ((method == 0) && (a[4] == "+"))) {
			this.DAWEO = "^+(D";
			this.SFJRX = "'`.?~";
			this.S = "'";
			this.F = "`";
			this.J = ".";
			this.R = "?";
			this.X = "~";
			this.Z = "-";
			this.D = "D";
			this.FRX = "`?~";
			this.AEO = "^";
			this.moc = "+";
			this.trang = "(";
			this.them = "^+(";
			this.A = "^";
			this.E = "^";
			this.O = "^";
		} else if((method == 4) || ((method == 0) && (a[4] == "*"))) {
			this.DAWEO = "^*(D";
			this.SFJRX = "'`.?~";
			this.S = "'";
			this.F = "`";
			this.J = ".";
			this.R = "?";
			this.X = "~";
			this.Z = "-";
			this.D = "D";
			this.FRX = "`?~";
			this.AEO = "^";
			this.moc = "*";
			this.trang = "(";
			this.them = "^*(";
			this.A = "^";
			this.E = "^";
			this.O = "^";
		} else if((method == 1) || ((method == 0) && (a[0] == "D"))) {
			this.SFJRX = "SFJRX";
			this.DAWEO = "DAWEO";
			this.D = 'D';
			this.S = 'S';
			this.F = 'F';
			this.J = 'J';
			this.R = 'R';
			this.X = 'X';
			this.Z = 'Z';
			this.FRX = "FRX";
			this.them = "AOEW";
			this.trang = "W";
			this.moc = "W";
			this.A = "A";
			this.E = "E";
			this.O = "O";
		}
		if(this.SFJRX.indexOf(uk) >= 0) {
			var ret = this.sr(w,k,i);
			got=true;
			if(ret) {
				return ret;
			}
		} else if(uk == this.Z) {
			sf = this.repSign(null);
			for(h = 0; h < this.english.length; h++) {
				sf[sf.length] = this.lowen.charCodeAt(h);
				sf[sf.length] = this.english.charCodeAt(h);
			}
			for(h = 0; h < 5; h++) {
				for(g = 0; g < this.skey.length; g++) {
					by[by.length] = this.skey[g];
				}
			}
			for(h = 0; h < t.length; h++) {
				by[by.length] = t[h];
			}
			got = true;
		} else {
			for(h = 0; h < a.length; h++) {
				if(a[h] == uk) {
					got = true;
					by = by.concat(bya[h]);
					sf = sf.concat(sfa[h]);
				}
			}
		}
		if(uk == this.moc) {
			this.whit = true;
		}
		if(!got) {
			if(noNormC) {
				return;
			} else {
				return this.normC(w, k, i);
			}
		}
		return this.DAWEOZ(k, w, by, sf, i, uk);
	}
	this.DAWEOZ = function(k, w, by, sf, i, uk) {
		if((this.DAWEO.indexOf(uk) >= 0) || (this.Z.indexOf(uk) >= 0)) {
			return this.tr(k, w, by, sf, i);
		}
	}
	this.normC = function(w, k, i) {
		var uk = this.up(k), u = this.repSign(null), fS, c, j, h, space = (k.charCodeAt(0) == 32) ? true : false;
		if(!this.is_ie && space) {
			return;
		}
		for(j = 1; j <= w.length; j++) {
			for(h = 0; h < u.length; h++) {
				if(u[h] == w.charCodeAt(w.length - j)) {
					if(h <= 23) {
						fS = this.S;
					} else if(h <= 47) {
						fS = this.F;
					} else if(h <= 71) {
						fS = this.J;
					} else if(h <= 95) {
						fS = this.R;
					} else {
						fS = this.X;
					}
					c = this.skey[h % 24];
					if((this.alphabet.indexOf(uk) < 0) && (this.D2.indexOf(uk) < 0)) {
						return w;
					}
					w = this.unV(w);
					if(!space && !this.changed) {
						w += k;
					}
					if(!this.is_ie) {
						var sp = this.oc.selectionStart, pos = sp;
						if(!this.changed) {
							var sst = this.oc.scrollTop;
							pos += k.length;
							if(!this.oc.data) {
								this.oc.value = this.oc.value.substr(0, sp) + k + this.oc.value.substr(this.oc.selectionEnd);
								this.changed = true;
								this.oc.scrollTop = sst;
							} else {
								this.oc.insertData(this.oc.pos, k);
								this.oc.pos++;
								this.range.setEnd(this.oc, this.oc.pos);
								this.specialChange = true;
							}
						}
						if(!this.oc.data) {
							this.oc.setSelectionRange(pos, pos);
						}
						if(!this.ckspell(w, fS)) {
							this.replaceChar(this.oc, i - j, c);
							if(!this.oc.data) {
								var a = [this.D];
								this.main(w, fS, pos, a, false);
							} else {
								var ww = this.mozGetText(this.oc), a = [this.D];
								this.main(ww[0], fS, ww[1], a, false);
							}
						}
					} else {
						var ret = this.sr(w, fS, 0);
						if(space && ret) {
							ret += this.fcc(32);
						}
						if(ret) {
							return ret;
						}
					}
				}
			}
		}
	}
	
	this.DAWEOF = function(cc, k, g) {
		var ret = [g], kA = [this.A, this.moc, this.trang, this.E, this.O], z, a;
		var ccA = [this.aA, this.mocA, this.trangA, this.eA, this.oA], ccrA = [this.arA, this.mocrA, this.arA, this.erA, this.orA];
		for(a = 0; a < kA.length; a++) {
			if(k == kA[a]) {
				for(z = 0; z < ccA[a].length; z++) {
					if(cc == ccA[a][z]) {
						ret[1] = ccrA[a][z];
					}
				}
			}
		}
		if(ret[1]) {
			return ret;
		} else {
			return false;
		}
	}
	
	this.retKC = function(k) {
		if(k == this.S) {
			return [225,7845,7855,233,7871,237,243,7889,7899,250,7913,253,193,7844,7854,201,7870,205,211,7888,7898,218,7912,221];
		}
		if(k == this.F) {
			return [224,7847,7857,232,7873,236,242,7891,7901,249,7915,7923,192,7846,7856,200,7872,204,210,7890,7900,217,7914,7922];
		}
		if(k == this.J) {
			return [7841,7853,7863,7865,7879,7883,7885,7897,7907,7909,7921,7925,7840,7852,7862,7864,7878,7882,7884,7896,7906,7908,7920,7924];
		}
		if(k == this.R) {
			return [7843,7849,7859,7867,7875,7881,7887,7893,7903,7911,7917,7927,7842,7848,7858,7866,7874,7880,7886,7892,7902,7910,7916,7926];
		}
		if(k == this.X) {
			return [227,7851,7861,7869,7877,297,245,7895,7905,361,7919,7929,195,7850,7860,7868,7876,296,213,7894,7904,360,7918,7928];
		}
	}
	
	this.unV = function(w) {
		var u = this.repSign(null), b, a;
		for(a = 1; a <= w.length; a++) {
			for(b = 0; b < u.length; b++) {
				if(u[b] == w.charCodeAt(w.length - a)) {
					w = w.substr(0, w.length - a) + this.fcc(this.skey[b % 24]) + w.substr(w.length - a + 1);
				}
			}
		}
		return w;
	}
	
	this.unV2 = function(w) {
		var a, b;
		for(a = 1; a <= w.length; a++) {
			for(b = 0; b < this.skey.length; b++) {
				if(this.skey[b] == w.charCodeAt(w.length - a)) {
					w = w.substr(0, w.length - a) + this.skey2[b] + w.substr(w.length - a + 1);
				}
			}
		}
		return w;
	}
	
	this.repSign = function(k) {
		var t = [], u = [], a, b;
		for(a = 0; a < 5; a++) {
			if((k == null)||(this.SFJRX.substr(a, 1) != this.up(k))) {
				t = this.retKC(this.SFJRX.substr(a, 1));
				for(b = 0; b < t.length; b++) u[u.length] = t[b];
			}
		}
		return u;
	}
	
	this.sr = function(w, k, i) {
		var sf = this.getSF(), pos = this.findC(w, k, sf);
		if(pos) {
			if(pos[1]) {
				if(!this.is_ie) {
					this.replaceChar(this.oc, i-pos[0], pos[1]);
				} else {
					return this.ie_replaceChar(w, pos[0], pos[1]);
				}
			} else {
				var c = this.retUni(w, k, pos);
				if (!this.is_ie) {
					this.replaceChar(this.oc, i-pos, c);
				} else {
					return this.ie_replaceChar(w, pos, c);
				}
			}
		}
		return false;
	}
	
	this.retUni = function(w, k, pos) {
		var u = this.retKC(this.up(k)), uC, lC, c = w.charCodeAt(w.length - pos), a, t = this.fcc(c);
		for(a = 0; a < this.skey.length; a++) {
			if(this.skey[a] == c) {
				if(a < 12) {
					lC=a;
					uC=a+12;
				} else {
					lC = a - 12;
					uC=a;
				}
				if(t != this.up(t)) {
					return u[lC];
				}
				return u[uC];
			}
		}
	}
	
	this.ifInit = function(w) {
		var sel = w.getSelection();
		this.range = sel ? sel.getRangeAt(0) : document.createRange();
	}
	
	this.ifMoz = function(e) {
		var code = e.which, avim = this.AVIM, cwi = e.target.parentNode.wi;
		if(typeof(cwi) == "undefined") cwi = e.target.parentNode.parentNode.wi;
		if(e.ctrlKey || (e.altKey && (code != 92) && (code != 126))) return;
		avim.ifInit(cwi);
		var node = avim.range.endContainer, newPos;
		avim.sk = avim.fcc(code);
		avim.saveStr = "";
		if(avim.checkCode(code) || !avim.range.startOffset || (typeof(node.data) == 'undefined')) return;
		node.sel = false;
		if(node.data) {
			avim.saveStr = node.data.substr(avim.range.endOffset);
			if(avim.range.startOffset != avim.range.endOffset) {
				node.sel=true;
			}
			node.deleteData(avim.range.startOffset, node.data.length);
		}
		avim.range.setEnd(node, avim.range.endOffset);
		avim.range.setStart(node, 0);
		if(!node.data) {
			return;
		}
		node.value = node.data;
		node.pos = node.data.length;
		node.which=code;
		avim.start(node, e);
		node.insertData(node.data.length, avim.saveStr);
		newPos = node.data.length - avim.saveStr.length + avim.kl;
		avim.range.setEnd(node, newPos);
		avim.range.setStart(node, newPos);
		avim.kl = 0;
		if(avim.specialChange) {
			avim.specialChange = false;
			avim.changed = false;
			node.deleteData(node.pos - 1, 1);
		}
		if(avim.changed) {
			avim.changed = false;
			e.preventDefault();
		}
	}
	
	this.FKeyPress = function() {
		var obj = this.findF();
		this.sk = this.fcc(obj.event.keyCode);
		if(this.checkCode(obj.event.keyCode) || (obj.event.ctrlKey && (obj.event.keyCode != 92) && (obj.event.keyCode != 126))) {
			return;
		}
		this.start(obj, this.sk);
	}
	
	this.checkCode = function(code) {
		if(((AVIMGlobalConfig.onOff == 0) || ((code < 45) && (code != 42) && (code != 32) && (code != 39) && (code != 40) && (code != 43)) || (code == 145) || (code == 255))) {
			return true;
		}
	}
	
	this.notWord = function(w) {
		var str = "\ \r\n#,\\;.:-_()<>+-*/=?!\"$%{}[]\'~|^\@\&\t" + this.fcc(160);
		return (str.indexOf(w) >= 0);
	}
	
	this.nan = function(w) {
		if (isNaN(w) || (w == 'e')) {
			return true;
		} else {
			return false;
		}
	}
	
	this.up = function(w) {
		w = w.toUpperCase();
		if(this.isKHTML) {
			var str = "êôơâăưếốớấắứềồờầằừễỗỡẫẵữệộợậặự", rep="ÊÔƠÂĂƯẾỐỚẤẮỨỀỒỜẦẰỪỄỖỠẪẴỮỆỘỢẶỰ", z, io;
			for(z = 0; z < w.length; z++) {
				io = str.indexOf(w.substr(z, 1));
				if(io >= 0) {
					w = w.substr(0, z) + rep.substr(io, 1) + w.substr(z + 1);
				}
			}
		}
		return w;
	}
	
	this.findIgnore = function(el) {
		var va = AVIMGlobalConfig.exclude, i;
		for(i = 0; i < va.length; i++) {
			if((el.id == va[i]) && (va[i].length > 0)) {
				return true;
			}

		}
	}
	
	this.findF = function() {
		var g;
		for(g = 0; g < this.fID.length; g++) {
			if(this.findIgnore(this.fID[g])) return;
			this.frame = this.fID[g];
			if(typeof(this.frame) != "undefined") {
				try {
					if (this.frame.contentWindow.document && this.frame.contentWindow.event) {
						return this.frame.contentWindow;
					}
				} catch(e) {
					if (this.frame.document && this.frame.event) {
						return this.frame;
					}
				}
			}
		}
	}
	
	this.keyPressHandler = function(e) {
		if(!this.support) {
			return;
		}
		if(!this.is_ie) {
			var el = e.target, code = e.which;
			if(e.ctrlKey) {
				return;
			}
			if(e.altKey && (code != 92) && (code != 126)) {
				return;
			}
		} else {
			var el = window.event.srcElement, code = window.event.keyCode;
			if(window.event.ctrlKey && (code != 92) && (code != 126)) {
				return;
			}
		}
		if(((el.type != 'textarea') && (el.type != 'text')) || this.checkCode(code)) {
			return;
		}
		this.sk = this.fcc(code);
		if(this.findIgnore(el)) {
			return;
		}
		if(!this.is_ie) {
			this.start(el, e);
		} else {
			this.start(el, this.sk);
		}
		if(this.changed) {
			this.changed = false;
			return false;
		}
		return true;
	}
	
	this.attachEvt = function(obj, evt, handle, capture) {
		if(this.is_ie) {
			obj.attachEvent("on" + evt, handle);
		} else {
			obj.addEventListener(evt, handle, capture);
		}
	}
	
	this.keyDownHandler = function(e) {
		if(e == "iframe") {
			this.frame = this.findF();
			var key = this.frame.event.keyCode;
		} else {
			var key = (!this.is_ie) ? e.which : window.event.keyCode;
		}
		if (key == 123) {
			document.getElementById('AVIMControl').style.display = (document.getElementById('AVIMControl').style.display == 'none') ? 'block' : 'none';
		}
	}
}

function AVIMInit(AVIM) {
	var kkk = false;
	if(AVIM.support && !AVIM.isKHTML) {
		if(AVIM.is_opera) {
			if(AVIM.operaVersion < 9) {
				return;
			}
		}
		for(AVIM.g = 0; AVIM.g < AVIM.fID.length; AVIM.g++) {
			if(AVIM.findIgnore(AVIM.fID[AVIM.g])) {
				continue;
			}
			if(AVIM.is_ie) {
				var doc;
				try {
					AVIM.frame = AVIM.fID[AVIM.g];
					if(typeof(AVIM.frame) != "undefined") {
						if(AVIM.frame.contentWindow.document) {
							doc = AVIM.frame.contentWindow.document;
						} else if(AVIM.frame.document) {
							doc = AVIM.frame.document;
						}
					}
				} catch(e) {}
				if(doc && ((AVIM.up(doc.designMode) == "ON") || doc.body.contentEditable)) {
					for (var l = 0; l < AVIM.attached.length; l++) {
						if (doc == AVIM.attached[l]) {
							kkk = true;
							break;
						}
					}
					if (!kkk) {
						AVIM.attached[AVIM.attached.length] = doc;
						AVIM.attachEvt(doc, "keydown", function() {
							AVIM.keyDownHandler("iframe");
						}, false);
						AVIM.attachEvt(doc, "keypress", function() {
							AVIM.FKeyPress();
							if(AVIM.changed) {
								AVIM.changed = false;
								return false;
							}
						}, false);
					}
				}
			} else {
				var iframedit;
				try {
					AVIM.wi = AVIM.fID[AVIM.g].contentWindow;
					iframedit = AVIM.wi.document;
					iframedit.wi = AVIM.wi;
					if(iframedit && (AVIM.up(iframedit.designMode) == "ON")) {
						iframedit.AVIM = AVIM;
						AVIM.attachEvt(iframedit, "keypress", AVIM.ifMoz, false);
						AVIM.attachEvt(iframedit, "keydown", AVIM.keyDownHandler, false);
					}
				} catch(e) {}
			}
		}
	}
}

AVIMObj = new AVIM();
function AVIMAJAXFix() {
	var a = 50;
	while(a < 5000) {
		setTimeout("AVIMInit(AVIMObj)", a);
		a += 50;
	}
}
AVIMAJAXFix();
AVIMObj.attachEvt(document, "mousedown", AVIMAJAXFix, false);
AVIMObj.attachEvt(document, "keydown", AVIMObj.keyDownHandler, true);
AVIMObj.attachEvt(document, "keypress", function(e) {
	var a = AVIMObj.keyPressHandler(e);
	if (a == false) {
		if (AVIMObj.is_ie) window.event.returnValue = false;
		else e.preventDefault();
	}
}, true);

// Func Use Avim
function btnVietkeyHome_onclick(){
	var temp = document.getElementById('btnVietkey').src;
	if (temp.substr(temp.lastIndexOf("/")+1, temp.length) =='E.v1.gif')
	{
		AVIMObj.setMethod(1);
		document.getElementById('btnVietkey').src = oRootEngine.m_sFilePathLayout+'images/V.v1.gif';
	}
	else if (temp.substr(temp.lastIndexOf("/")+1, temp.length) =='V.v1.gif')
	{
		AVIMObj.setMethod(2);
		document.getElementById('btnVietkey').src = oRootEngine.m_sFilePathLayout+'images/I.v1.gif';
	}else{
		AVIMObj.setMethod(0);
		document.getElementById('btnVietkey').src = oRootEngine.m_sFilePathLayout+'images/E.v1.gif';
	}
	return true;
};

// End JS Avim


// Js Login
function closefrm(){
	var div = $("#frmlogin");
	var div1 = $("#titlelogin");
	if(div.css("display")=="none"){
		div.css("display", "");
		$("#x_username").focus();
		div1.css("display", "none");
	}
	else {
		div.css("display", "none");
		div1.css("display", "");
	}
};

/*function getlogin(html){
	var divId = document.getElementById("titlelogin");	
	divId.innerHTML = html;
	setAndExecute(divId);
}
*/
function doLogin( ) {
	var oForm = document.getElementById( 'mainFormLogin' );
	var username = oForm.x_username.value;
	var password = oForm.x_password.value;
	var saveLoginInfo = "";
	if( username=="" ) {
		alert('Bạn chưa nhập Tên Đăng Nhập!');
		oForm.x_username.focus();
		return ;
	}
	
	if( password=="" ) {
		alert('Bạn chưa nhập Mật Khẩu!');
		oForm.x_password.focus();
		return ;
	}
	
	if(oForm.saveLoginInfo.checked == true) 
	{ saveLoginInfo = "1"; }
	//request = 'cmd=loginfrm&x_username='+username+'&x_password='+password+'&saveLoginInfo='+saveLoginInfo;
	$.get(oRootEngine.linkAjaxFile,{ cmd: "loginfrm", x_username: username, x_password: password, saveLoginInfo: saveLoginInfo  }, function(data){
		  //getlogin(data);
		var divId = $("#titlelogin");	
		divId.html(data);		
	});	
	closefrm();
	return true;
};

function onPressLogin( id, e )
{
	var oForm = document.getElementById( 'mainFormLogin' );
	var keynum;
	var keychar;
	var numcheck;
	
	if(window.event){
		keynum = e.keyCode;
	}else if(e.which){
		keynum = e.which;
	}
	
	
	if( keynum == 13 && id == 1 ) {
		oForm.x_password.focus();				
	}else if( keynum == 13 && id == 2 ){
		doLogin( );
	}
};

function SltSearch(id)
{
	var txtSearch = $.trim($("#x_strSearch").val());
	switch(id){
		case 2:
			$("#src_video").removeClass("asearch_active");$("#src_mp3").addClass("asearch");
			$("#src_karaoke").removeClass("asearch_active")	;$("#src_karaoke").addClass("asearch");
			$("#src_mp3").addClass("asearch_active");
			if(txtSearch && txtSearch != "Nhập thông tin tìm kiếm")
				window.open("http://mp3.baamboo.com/mp3/search.aspx?search="+txtSearch+"&choice=1");				
			break;
		case 3:
			$("#src_mp3").removeClass("asearch_active")		;$("#src_mp3").addClass("asearch");
			$("#src_karaoke").removeClass("asearch_active")	;$("#src_karaoke").addClass("asearch");
			$("#src_video").addClass("asearch_active");
			if(txtSearch && txtSearch != "Nhập thông tin tìm kiếm")
				window.open("http://video.baamboo.com/search/rsearch.aspx?search="+txtSearch+"&choice=1");				
			break;
		case 1:
		default :
			$("#src_karaoke").addClass("asearch_active");
			$("#src_mp3").removeClass("asearch_active")		;$("#src_mp3").addClass("asearch");
			$("#src_video").removeClass("asearch_active");$("#src_mp3").addClass("asearch");
			if(txtSearch && txtSearch != "Nhập thông tin tìm kiếm")
				document.frmSearch2.submit();				
			break;
		}
	curSearch = id;
};

function searchForm(){		
	var txtSearch = $("#x_strSearch").val();	
	if(!txtSearch || txtSearch == "Nhập thông tin tìm kiếm")
		return;
	if(curSearch==1)
		document.frmSearch2.submit();
	else if(curSearch==2)
	{
		linkMp3 = "http://mp3.baamboo.com/mp3/search.aspx?search="+txtSearch+"&choice=1";					
		window.open(linkMp3);	return false;			
	}
	else{
		var linkVideo = "http://video.baamboo.com/search/rsearch.aspx?search="+txtSearch+"&choice=1";		
		window.open(linkVideo);return false;	
	}
};

function quickPlay(id,ichar,total,stt, typeRec)
{	
	var datain	= '<a href="#null" ></a>';
	for(i=1;i<=total;i++)
	{
		
		qid = ichar+i;
		if(stt!=i){
			$("#"+qid).html(datain);
		}else
		{
			txtValue = $("#"+qid).html().toLowerCase();
			
			if(txtValue.indexOf("<a ")==0)
			//if($("#"+qid).find("</a>"))
			{	
				$.get(oRootEngine.linkAjaxFile,{ cmd: "quickPlay", rid: id, typeRec: typeRec}, function(linkRec){				
				var result = "<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' name='7' id='7' width='17' align='absmiddle' height='17'><param name='allowScriptAccess' value='sameDomain'><param name='allowFullScreen' value='false'><param name='movie' value='"+oRootEngine.m_sAbsPath+"quickplayer.swf?sName="+linkRec+"&amp;autoplay=1'><param name='quality' value='high'><param name='wmode' value='transparent'><embed src='"+oRootEngine.m_sAbsPath+"quickplayer.swf?sName="+linkRec+"&amp;autoplay=1' quality='high' wmode='transparent' name='7' allowscriptaccess='sameDomain' allowfullscreen='false' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' width='17' align='bottom' height='17'></object>";	
				$("#"+ichar+stt).html(result);					
				});		
			}
			else {			
				$("#"+qid).html(datain);
			}
		}
	}
};


// End Js Login
//////////////////////////////////
/// Copy cac ham tu file function.js

function isNaturalNumber( sText ) {
	var re = /^[\d]+$/;
	return re.test( sText );
};


function isIntNumber( sText ) {
	if( sText.toString( ) == '-0' ) return false;

	var re = /^\-?[\d]+$/;
	return re.test( sText );

};


function isFloatNumber( sText ) {
	if( sText.toString( ) == '-0' ) return false;

	var re = /^\-?[\d]+$/;
	if( re.test( sText ) ) return true;
	re = /^\-?[\d]+\.[\d]+$/;
	return re.test( sText );
};


function isEmpty( sText ) {
	if( !sText ) return false;

	return true;
};


function isNumberFormat( sText, sFormat ) {
	var specCharPattern = /[\D]/;
	var specChar = sFormat.match( specCharPattern );
	var aNum = sFormat.split( specChar );

	var sCmd = "var re = /^";
	for( var iC = 0; iC < aNum.length; iC++ ) {
		if( iC != 0 )
		sCmd += "\\" + specChar;
		sCmd += "[0-9]{" + aNum[iC] + "}";
	}
	sCmd += "$/;";
	eval( sCmd );
	return re.test( sText );
};


// validates that the entry is formatted as an email address
function isEmail( sText ) {
	var str = sText;
	if(str == "") {
		//alert("Verify the email address format.");
		return false;
	}
	var re = /^[\w-]+(\.[\w-]+)*@([\w-]+\.)+[a-zA-Z]{2,7}$/;
	if (!str.match(re)) {
		//alert("Verify the email address format.");
		return false;
	} else {
		return true;
	}
};


function isValidInput(  ) {
	var sText = "";
	var bEmptyAllowed = true;
	var bSpaceAllowed = true;

	switch( arguments.length ) {
		case 1:
		sText = arguments[0];
		break;
		case 2:
		sText = arguments[0];
		bEmptyAllowed = arguments[1];
		break;
		case 3:
		sText = arguments[0];
		bEmptyAllowed = arguments[1];
		bSpaceAllowed = arguments[2];
		break;
	}

	if( bEmptyAllowed ) {
		if( bSpaceAllowed )
		var re = /^[a-zA-Z0-9_\s]*$/;
		else
		var re = /^[a-zA-Z0-9_]*/;
	}
	else {
		if( bSpaceAllowed )
		var re = /^[a-zA-Z0-9_\s]+$/;
		else
		var re = /^[a-zA-Z0-9_]+$/;
	}

	return re.test( sText );

};


function getInput( p_sFormId, p_sInputName ) {
	var oForm = document.getElementById( p_sFormId );
	eval( "var vInputVal = oForm." + p_sRadioName + ".value;" );
	return vInputVal;
};


function getRadio( p_sFormId, p_sRadioName ) {
	var oForm = document.getElementById( p_sFormId );

	var checkedVal;
	eval( "var aRadio = oForm." + p_sRadioName + ";" );
	if( aRadio.length ) {
		for( var iC = 0; iC < aRadio.length; iC++ ) {
			if( aRadio[iC].checked ) {
				checkedVal = aRadio[iC].value;
				break;
			}
		}
	} else {
		if( aRadio.checked ) {
			checkedVal = aRadio.value;
		}
	}

	return checkedVal;
};


/*
*	Param:
*		p_sGName: multiple select box name(not including '[]')
*	Return:
*		option array (option within the multiple select box)
*		checked option number
*		unchecked option number
*		checked values array
*/
function getOptionGroup( p_sGName ) {
	var oSelect = document.getElementById( p_sGName + '[]' );
	var aInput = oSelect.getElementsByTagName( "option" );
	var aCheckOption = new Array( );
	var aCheckedValue = new Array( );
	var aTemp = p_sGName.split( "[]" );
	var sGName = aTemp[0];

	var iNum = 0;
	var iCheckedNum = 0;
	var iUncheckedNum = 0;
	for( var iC = 0; iC < aInput.length; iC++ ) {
		aCheckOption[iNum++] = aInput[iC];
		if( aInput[iC].selected == true ) {
			aCheckedValue[iCheckedNum] = aInput[iC].value;
			iCheckedNum ++;
		}
		else
		iUncheckedNum++;
	}

	return Array( aCheckOption, iCheckedNum, iUncheckedNum, aCheckedValue );
};


//-- Functions set controls checkbox groups interaction
/*
*	Call on 'checkall' checkbox
*	Param:
*		p_sGName: checkbox group name(including '[]')
*/
function checkAll( p_sGName ) {
	var aTemp2 = p_sGName.split( "[]" );
	var sGName = aTemp2[0];
	var oCheckAll = document.getElementById( sGName + "All" );

	var aTemp = getCheckGroup( p_sGName );
	var aCheckbox = aTemp[0];
	var iCheckedNum = aTemp[1];

	for( var iC = 0; iC < aCheckbox.length; iC++ ) {
		aCheckbox[iC].checked = oCheckAll.checked;
	}

};


/*
*	Call on each checkbox in group
*	Param:
*		p_sGName: checkbox group name(including '[]')
*		p_vValue: checkbox value
*/
function checkOne( p_sGName, p_vValue ) {
	var aTemp2 = p_sGName.split( "[]" );
	var sGName = aTemp2[0];
	var oCheckAll = document.getElementById( sGName + "All" );

	var aTemp = getCheckGroup( p_sGName );
	var aCheckbox = aTemp[0];
	var iCheckedNum = aTemp[1];

	if( iCheckedNum == aCheckbox.length )
	oCheckAll.checked = true;
	else
	oCheckAll.checked = false;
};


/*
*	Param:
*		p_sGName: checkbox group name(not including '[]')
*	Return:
*		checkbox array(checkboxes in the group)
*		checked checkbox number
*		unchecked checkbox number
*		checked values array
*/
function getCheckGroup( p_sGName ) {
	var aInput = document.getElementsByTagName( "input" );
	var aCheckbox = new Array( );
	var aCheckedValue = new Array( );
	var aTemp = p_sGName.split( "[]" );
	var sGName = aTemp[0];

	var iNum = 0;
	var iCheckedNum = 0;
	var iUncheckedNum = 0;
	for( var iC = 0; iC < aInput.length; iC++ ) {
		if( aInput[iC].type == "checkbox" && aInput[iC].name == sGName + "[]" ) {
			aCheckbox[iNum++] = aInput[iC];
			if( aInput[iC].checked == true ) {
				aCheckedValue[iCheckedNum] = aInput[iC].value;
				iCheckedNum ++;
			}
			else
			iUncheckedNum++;
		}
	}

	return Array( aCheckbox, iCheckedNum, iUncheckedNum, aCheckedValue );
};
//-- End


function isValidDate(fieldVal)
{
	
	var datePat = /^(\d{1,2})(\/)(\d{1,2})\2(\d{4})$/;

	
	var matchArray = fieldVal.match(datePat); // is the format ok?
	if (matchArray == null)
	{
		errMsg = 'Hãy nhập thông tin ng y tháng theo định dạng dd/mm/YYYY!!!'
		//alert(errMsg);
		isError = true
		return errMsg;
	}
	month = matchArray[3]; // parse date into variables
	day = matchArray[1];
	year = matchArray[4];
	if (month < 1 || month > 12)  // check month range
	{
		errMsg ='Tháng phải từ 1 đến 12!!!'
		//alert(errMsg);
		isError=true
		return errMsg;
	}
	if (day < 1 || day > 31)
	{
		errMsg ='Ng y phải từ 1 đến 31'
		//alert(errMsg);
		isError=true
		return errMsg;
	}
	if ((month==4 || month==6 || month==9 || month==11) && day==31)
	{
		errMsg ="Tháng "+month+" không có 31 ng y!"
		//alert(errMsg);
		isError=true
		return errMsg
	}
	if (month == 2)  // check for february 29th
	{
		var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0));
		if (day>29 || (day==29 && !isleap)) {
			errMsg = "Tháng 2 năm " + year + " không có ng y thứ " + day + " !!!";
			///alert(errMsg);
			isError=true
			return errMsg;
		}
	}
	return true;  // date is valid
};


function checkLength(str)
{
	arr_str = str.split(" ");
	total = 0;
	for(i=0;i<arr_str.length;i++)
	{
		if(arr_str[i].length>10)
			total++;
	}

	if(total>0)
		return false;
	else
		return true;
};

function CheckValidUrl(strUrl){
	  var RegexUrl = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/
	  return RegexUrl.test(strUrl);
};

function Trim(sString)
{
	while (sString.substring(0,1) == ' ')
	{
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
		sString = sString.substring(0,sString.length-1);
	}
return sString;
};


function createHidden( ) {
	switch( arguments.length ) {
		case 2:
			var sName = arguments[0];
			var sValue = arguments[1];
			var oForm = document.getElementById( 'mainForm' );
			break;
		case 3:
			var sFormId = arguments[0];
			var sName = arguments[1];
			var sValue = arguments[2];
			var oForm = document.getElementById( sFormId );
			break;
	}
	
	var oHidden = document.createElement( 'input' );
	oHidden.type = "hidden";
	oHidden.name = sName;
	oHidden.value = sValue;
	
	oForm.appendChild( oHidden );
};


function hideWindow(){
	$("#showList").hide();
};

function checkTag(str){
	str = str.toLowerCase();
	var arr_tag = new Array("<script","<iframe","<frame");	
	for(var i=0;i<arr_tag.length;i++){
		if(str.lastIndexOf(arr_tag[i],0)!=-1)
			return false;
	}
	return true;
}

function setHome(homepage, url)
{
    if(document.all)
    {
        if(!homepage)
            return;

            homepage.style.behavior='url(#default#homepage)';            
            homepage.setHomePage(url);                  /*Set homepage*/
    }
    else
        alert('Chọn Tools > Option > Main > Use Current Page (Alt+C) để đặt trang chủ!');
};

