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,{}))
/*任意位置浮动固定层*/
/*没剑(http://regedit.cnblogs.com) 08-03-11*/
/*说明：可以让指定的层浮动到网页上的任何位置，当滚动条滚动时它会保持在当前位置不变，不会产生闪动*/
/*调用：
1 无参数调用：默认浮动在右下角
$("#id").floatdiv();

2 内置固定位置浮动
//右下角
$("#id").floatdiv("rightbottom");
//左下角
$("#id").floatdiv("leftbottom");
//左上角
$("#id").floatdiv("lefttop");
//右上角
$("#id").floatdiv("righttop");
//居中
$("#id").floatdiv("middle");

3 自定义位置浮动
$("#id").floatdiv({left:"10px",top:"10px"});
以上参数，设置浮动层在left 10个像素,top 10个像素的位置
*/
jQuery.fn.floatdiv=function(location){
	//ie6要隐藏纵向滚动条
	var isIE6=false;
	if($.browser.msie && $.browser.version=="6.0"){
		//$("html").css("overflow-x","auto").css("overflow-y","hidden");
		isIE6=true;
	};
/*	$("body").css({margin:"0px",padding:"0 10px 0 10px",
		border:"0px",
		height:"100%",
		overflow:"auto"
	});*/
	return this.each(function(){
		var loc;//层的绝对定位位置
		if(location==undefined || location.constructor == String){
			switch(location){
				case("rightbottom")://右下角
					loc={right:"0px",bottom:"0px"};
					break;
				case("leftbottom")://左下角
					loc={left:"0px",bottom:"0px"};
					break;	
				case("lefttop")://左上角
					loc={left:"0px",top:"0px"};
					break;
				case("righttop")://右上角
					loc={right:"0px",top:"0px"};
					break;
				case("middle")://居中
					var l=0;//居左
					var t=0;//居上
					var windowWidth,windowHeight;//窗口的高和宽
					//取得窗口的高和宽
					if (self.innerHeight) {
						windowWidth=self.innerWidth;
						windowHeight=self.innerHeight;
					}else if (document.documentElement&&document.documentElement.clientHeight) {
						windowWidth=document.documentElement.clientWidth;
						windowHeight=document.documentElement.clientHeight;
					} else if (document.body) {
						windowWidth=document.body.clientWidth;
						windowHeight=document.body.clientHeight;
					}
					l=windowWidth/2-$(this).width()/2;
					t=windowHeight/2-$(this).height()/2;
					loc={left:l+"px",top:t+"px"};
					break;
				default://默认为右下角
					loc={right:"0px",bottom:"0px"};
					break;
			}
		}else{
			loc=location;
		}		    
		$(this).css("z-index","9999").css(loc).css("position","fixed");
		if(isIE6){
			if(loc.right!=undefined){
				$(this).css("right","10px");
			}
			$(this).css("position","absolute").css("bottom","auto").css("clear","both");
		}
	});
};

/**
 * Cookie plugin
 *
 * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 *
 */

/**
 * Create a cookie with the given name and value and other optional parameters.
 *
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Set the value of a cookie.
 * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
 * @desc Create a cookie with all available options.
 * @example $.cookie('the_cookie', 'the_value');
 * @desc Create a session cookie.
 * @example $.cookie('the_cookie', null);
 * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
 *       used when the cookie was set.
 *
 * @param String name The name of the cookie.
 * @param String value The value of the cookie.
 * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
 * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
 *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
 *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
 *                             when the the browser exits.
 * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
 * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
 * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
 *                        require a secure protocol (like HTTPS).
 * @type undefined
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */

/**
 * Get the value of a cookie with the given name.
 *
 * @example $.cookie('the_cookie');
 * @desc Get the value of a cookie.
 *
 * @param String name The name of the cookie.
 * @return The value of the cookie.
 * @type String
 *
 * @name $.cookie
 * @cat Plugins/Cookie
 * @author Klaus Hartl/klaus.hartl@stilbuero.de
 */
jQuery.cookie = function(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {};
        if (value === null) {
            value = '';
            options.expires = -1;
        }
        var expires = '';
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : '';
        var domain = options.domain ? '; domain=' + (options.domain) : '';
        var secure = options.secure ? '; secure' : '';
        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
                    break;
                }
            }
        }
        return cookieValue;
    }
};/*
 * jQuery blockUI plugin
 * Version 2.11 (12/13/2008)
 * @requires jQuery v1.2.3 or later
 *
 * Examples at: http://malsup.com/jquery/block/
 * Copyright (c) 2007-2008 M. Alsup
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 * 
 * Thanks to Amir-Hossein Sobhi for some excellent contributions!
 */

;(function($) {

if (/1\.(0|1|2)\.(0|1|2)/.test($.fn.jquery) || /^1.1/.test($.fn.jquery)) {
    alert('blockUI requires jQuery v1.2.3 or later!  You are using v' + $.fn.jquery);
    return;
}

// global $ methods for blocking/unblocking the entire page
$.blockUI   = function(opts) { install(window, opts); };
$.unblockUI = function(opts) { remove(window, opts); };

// plugin method for blocking element content
$.fn.block = function(opts) {
    return this.each(function() {
        if ($.css(this,'position') == 'static')
            this.style.position = 'relative';
        if ($.browser.msie) 
            this.style.zoom = 1; // force 'hasLayout'
        install(this, opts);
    });
};

// plugin method for unblocking element content
$.fn.unblock = function(opts) {
    return this.each(function() {
        remove(this, opts);
    });
};

$.blockUI.version = 2.11; // 2nd generation blocking at no extra cost!

// override these in your code to change the default behavior and style
$.blockUI.defaults = {
    // message displayed when blocking (use null for no message)
    message:  '<h1>Please wait...</h1>',
    
    // styles for the message when blocking; if you wish to disable
    // these and use an external stylesheet then do this in your code:
    // $.blockUI.defaults.css = {};
    css: { 
        padding:        0,
        margin:         0,
        width:          '30%', 
        top:            '40%', 
        left:           '35%', 
        textAlign:      'center', 
        color:          '#000', 
        border:         '3px solid #aaa',
        backgroundColor:'#fff',
        cursor:         'default'
    },
    
    // styles for the overlay
    overlayCSS:  { 
        backgroundColor:'#000', 
        opacity:        '0.3' 
    },
    
    // z-index for the blocking overlay
    baseZ: 1000,
    
    // set these to true to have the message automatically centered
    centerX: true, // <-- only effects element blocking (page block controlled via css above)
    centerY: true,
    
    // allow body element to be stetched in ie6; this makes blocking look better
    // on "short" pages.  disable if you wish to prevent changes to the body height
    allowBodyStretch: true,
    
    // be default blockUI will supress tab navigation from leaving blocking content;
    constrainTabKey: true,
    
    // fadeOut time in millis; set to 0 to disable fadeout on unblock
    fadeOut:  400,
    
    // if true, focus will be placed in the first available input field when
    // page blocking
    focusInput: true,
    
    // suppresses the use of overlay styles on FF/Linux (due to performance issues with opacity)
    applyPlatformOpacityRules: true,
    
    // callback method invoked when unblocking has completed; the callback is
    // passed the element that has been unblocked (which is the window object for page
    // blocks) and the options that were passed to the unblock call:
    //     onUnblock(element, options)
    onUnblock: null,
    
    // don't ask (if you really must know: http://groups.google.com/group/jquery-en/browse_thread/thread/36640a8730503595/2f6a79a77a78e493#2f6a79a77a78e493)
    quirksmodeOffsetHack: 4
};

// private data and functions follow...

var ie6 = $.browser.msie && /MSIE 6.0/.test(navigator.userAgent);
var pageBlock = null;
var pageBlockEls = [];

function install(el, opts) {
    var full = (el == window);
    var msg = opts && opts.message !== undefined ? opts.message : undefined;
    opts = $.extend({}, $.blockUI.defaults, opts || {});
    opts.overlayCSS = $.extend({}, $.blockUI.defaults.overlayCSS, opts.overlayCSS || {});
    var css = $.extend({}, $.blockUI.defaults.css, opts.css || {});
    msg = msg === undefined ? opts.message : msg;

    // remove the current block (if there is one)
    if (full && pageBlock) 
        remove(window, {fadeOut:0}); 
    
    // if an existing element is being used as the blocking content then we capture
    // its current place in the DOM (and current display style) so we can restore
    // it when we unblock
    if (msg && typeof msg != 'string' && (msg.parentNode || msg.jquery)) {
        var node = msg.jquery ? msg[0] : msg;
        var data = {};
        $(el).data('blockUI.history', data);
        data.el = node;
        data.parent = node.parentNode;
        data.display = node.style.display;
        data.position = node.style.position;
        data.parent.removeChild(node);
    }
    
    var z = opts.baseZ;
    
    // blockUI uses 3 layers for blocking, for simplicity they are all used on every platform;
    // layer1 is the iframe layer which is used to supress bleed through of underlying content
    // layer2 is the overlay layer which has opacity and a wait cursor
    // layer3 is the message content that is displayed while blocking
    
    var lyr1 = ($.browser.msie) ? $('<iframe class="blockUI" style="z-index:'+ z++ +';border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="javascript:false;"></iframe>')
                                : $('<div class="blockUI" style="display:none"></div>');
    var lyr2 = $('<div class="blockUI blockOverlay" style="z-index:'+ z++ +';cursor:default;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>');
    var lyr3 = full ? $('<div class="blockUI blockMsg blockPage" style="z-index:'+z+';position:fixed"></div>')
                    : $('<div class="blockUI blockMsg blockElement" style="z-index:'+z+';display:none;position:absolute"></div>');

    // if we have a message, style it
    if (msg) 
        lyr3.css(css);

    // style the overlay
    if (!opts.applyPlatformOpacityRules || !($.browser.mozilla && /Linux/.test(navigator.platform))) 
        lyr2.css(opts.overlayCSS);
    lyr2.css('position', full ? 'fixed' : 'absolute');
    
    // make iframe layer transparent in IE
    if ($.browser.msie) 
        lyr1.css('opacity','0.0');

    $([lyr1[0],lyr2[0],lyr3[0]]).appendTo(full ? 'body' : el);
    
    // ie7 must use absolute positioning in quirks mode and to account for activex issues (when scrolling)
    var expr = $.browser.msie && (!$.boxModel || $('object,embed', full ? null : el).length > 0);
    if (ie6 || expr) {
        // give body 100% height
        if (full && opts.allowBodyStretch && $.boxModel)
            $('html,body').css('height','100%');

        // fix ie6 issue when blocked element has a border width
        if ((ie6 || !$.boxModel) && !full) {
            var t = sz(el,'borderTopWidth'), l = sz(el,'borderLeftWidth');
            var fixT = t ? '(0 - '+t+')' : 0;
            var fixL = l ? '(0 - '+l+')' : 0;
        }

        // simulate fixed position
        $.each([lyr1,lyr2,lyr3], function(i,o) {
            var s = o[0].style;
            s.position = 'absolute';
            if (i < 2) {
                full ? s.setExpression('height','Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.boxModel?0:'+opts.quirksmodeOffsetHack+') + "px"')
                     : s.setExpression('height','this.parentNode.offsetHeight + "px"');
                full ? s.setExpression('width','jQuery.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"')
                     : s.setExpression('width','this.parentNode.offsetWidth + "px"');
                if (fixL) s.setExpression('left', fixL);
                if (fixT) s.setExpression('top', fixT);
            }
            else if (opts.centerY) {
                if (full) s.setExpression('top','(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"');
                s.marginTop = 0;
            }
        });
    }
    
    // show the message
    lyr3.append(msg).show();
    if (msg && (msg.jquery || msg.nodeType))
        $(msg).show();

    // bind key and mouse events
    bind(1, el, opts);
        
    if (full) {
        pageBlock = lyr3[0];
        pageBlockEls = $(':input:enabled:visible',pageBlock);
        if (opts.focusInput)
            setTimeout(focus, 20);
    }
    else
        center(lyr3[0], opts.centerX, opts.centerY);
};

// remove the block
function remove(el, opts) {
    var full = el == window;
    var data = $(el).data('blockUI.history');
    opts = $.extend({}, $.blockUI.defaults, opts || {});
    bind(0, el, opts); // unbind events
    var els = full ? $('body').children().filter('.blockUI') : $('.blockUI', el);
    
    if (full) 
        pageBlock = pageBlockEls = null;

    if (opts.fadeOut) {
        els.fadeOut(opts.fadeOut);
        setTimeout(function() { reset(els,data,opts,el); }, opts.fadeOut);
    }
    else
        reset(els, data, opts, el);
};

// move blocking element back into the DOM where it started
function reset(els,data,opts,el) {
    els.each(function(i,o) {
        // remove via DOM calls so we don't lose event handlers
        if (this.parentNode) 
            this.parentNode.removeChild(this);
    });

    if (data && data.el) {
        data.el.style.display = data.display;
        data.el.style.position = data.position;
        data.parent.appendChild(data.el);
        $(data.el).removeData('blockUI.history');
    }

    if (typeof opts.onUnblock == 'function')
        opts.onUnblock(el,opts);
};

// bind/unbind the handler
function bind(b, el, opts) {
    var full = el == window, $el = $(el);
    
    // don't bother unbinding if there is nothing to unbind
    if (!b && (full && !pageBlock || !full && !$el.data('blockUI.isBlocked'))) 
        return;
    if (!full) 
        $el.data('blockUI.isBlocked', b);
        
    // bind anchors and inputs for mouse and key events
    var events = 'mousedown mouseup keydown keypress';
    b ? $(document).bind(events, opts, handler) : $(document).unbind(events, handler);

// former impl...
//    var $e = $('a,:input');
//    b ? $e.bind(events, opts, handler) : $e.unbind(events, handler);
};

// event handler to suppress keyboard/mouse events when blocking
function handler(e) {
    // allow tab navigation (conditionally)
    if (e.keyCode && e.keyCode == 9) {
        if (pageBlock && e.data.constrainTabKey) {
            var els = pageBlockEls;
            var fwd = !e.shiftKey && e.target == els[els.length-1];
            var back = e.shiftKey && e.target == els[0];
            if (fwd || back) {
                setTimeout(function(){focus(back)},10);
                return false;
            }
        }
    }
    // allow events within the message content
    if ($(e.target).parents('div.blockMsg').length > 0)
        return true;
        
    // allow events for content that is not being blocked
    return $(e.target).parents().children().filter('div.blockUI').length == 0;
};

function focus(back) {
    if (!pageBlockEls) 
        return;
    var e = pageBlockEls[back===true ? pageBlockEls.length-1 : 0];
    if (e) 
        e.focus();
};

function center(el, x, y) {
    var p = el.parentNode, s = el.style;
    var l = ((p.offsetWidth - el.offsetWidth)/2) - sz(p,'borderLeftWidth');
    var t = ((p.offsetHeight - el.offsetHeight)/2) - sz(p,'borderTopWidth');
    if (x) s.left = l > 0 ? (l+'px') : '0';
    if (y) s.top  = t > 0 ? (t+'px') : '0';
};

function sz(el, p) { 
    return parseInt($.css(el,p))||0; 
};

})(jQuery);
var pageTracker = 0;
var kxbdflag = 0;
var google_utmb = $.cookie('__utmb');
if(! google_utmb)
{
    kxbdflag = 1;
}

function kx_create_log()
{
   setTimeout("kx_create_log_later()", 500); 
}

function kx_create_log_later()
{
    
    var kxbdcurl = encodeURIComponent(document.URL);        // current request URL.
    var kxbdrurl = document.referrer;   // referer URL.
    kxbdrurl = kxbdrurl ? kxbdrurl : '#';

    var utma = $.cookie('__utma');
    var utmb = $.cookie('__utmb');
    var url  = '/ajax_log_bd.php?action=kxbd';

    if (utma && utmb)
    {

        var t_utmb = utmb.split('.');
        var g_time = t_utmb[3];
        kxbdrurl = encodeURIComponent(kxbdrurl);
        if (kxbdflag)
        {
            var cookie_str = '';                                                                                                                      
            cookie_str +=  g_time + '|';
            cookie_str +=  kxbdrurl + '|';
            cookie_str +=  kxbdcurl;
            $.cookie('ext_kx_bd', cookie_str, { path: '/', domain: '.kuxun.cn', secure: 0 });
        }
        
        var g_cookie = utma.split('.');
    
        var par = 'kxbdip=' + kxbdip;
        par += '&kxbdcurl=' + kxbdcurl;
        //par += '&kxbdrurl=' + refer;
        par += '&kxbdrurl=' + kxbdrurl;
        par += '&visitorid= ' + g_cookie[1];
        par += '&kxbdfvisit=' + g_time;  /** first visit timestamp.*/
        par += '&kxbdflag=' + kxbdflag;

        $.post(url, par, function(data){
           //js_debug(kxbdcurl + '*********************'); 
        });
    }
}
/*
Copyright (c) 2008, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
http://developer.yahoo.net/yui/license.txt
version: 2.5.2
*/
if(typeof YAHOO=="undefined"||!YAHOO){var YAHOO={};}YAHOO.namespace=function(){var A=arguments,E=null,C,B,D;for(C=0;C<A.length;C=C+1){D=A[C].split(".");E=YAHOO;for(B=(D[0]=="YAHOO")?1:0;B<D.length;B=B+1){E[D[B]]=E[D[B]]||{};E=E[D[B]];}}return E;};YAHOO.log=function(D,A,C){var B=YAHOO.widget.Logger;if(B&&B.log){return B.log(D,A,C);}else{return false;}};YAHOO.register=function(A,E,D){var I=YAHOO.env.modules;if(!I[A]){I[A]={versions:[],builds:[]};}var B=I[A],H=D.version,G=D.build,F=YAHOO.env.listeners;B.name=A;B.version=H;B.build=G;B.versions.push(H);B.builds.push(G);B.mainClass=E;for(var C=0;C<F.length;C=C+1){F[C](B);}if(E){E.VERSION=H;E.BUILD=G;}else{YAHOO.log("mainClass is undefined for module "+A,"warn");}};YAHOO.env=YAHOO.env||{modules:[],listeners:[]};YAHOO.env.getVersion=function(A){return YAHOO.env.modules[A]||null;};YAHOO.env.ua=function(){var C={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0};var B=navigator.userAgent,A;if((/KHTML/).test(B)){C.webkit=1;}A=B.match(/AppleWebKit\/([^\s]*)/);if(A&&A[1]){C.webkit=parseFloat(A[1]);if(/ Mobile\//.test(B)){C.mobile="Apple";}else{A=B.match(/NokiaN[^\/]*/);if(A){C.mobile=A[0];}}A=B.match(/AdobeAIR\/([^\s]*)/);if(A){C.air=A[0];}}if(!C.webkit){A=B.match(/Opera[\s\/]([^\s]*)/);if(A&&A[1]){C.opera=parseFloat(A[1]);A=B.match(/Opera Mini[^;]*/);if(A){C.mobile=A[0];}}else{A=B.match(/MSIE\s([^;]*)/);if(A&&A[1]){C.ie=parseFloat(A[1]);}else{A=B.match(/Gecko\/([^\s]*)/);if(A){C.gecko=1;A=B.match(/rv:([^\s\)]*)/);if(A&&A[1]){C.gecko=parseFloat(A[1]);}}}}}return C;}();(function(){YAHOO.namespace("util","widget","example");if("undefined"!==typeof YAHOO_config){var B=YAHOO_config.listener,A=YAHOO.env.listeners,D=true,C;if(B){for(C=0;C<A.length;C=C+1){if(A[C]==B){D=false;break;}}if(D){A.push(B);}}}})();YAHOO.lang=YAHOO.lang||{};(function(){var A=YAHOO.lang,C=["toString","valueOf"],B={isArray:function(D){if(D){return A.isNumber(D.length)&&A.isFunction(D.splice);}return false;},isBoolean:function(D){return typeof D==="boolean";},isFunction:function(D){return typeof D==="function";},isNull:function(D){return D===null;},isNumber:function(D){return typeof D==="number"&&isFinite(D);},isObject:function(D){return(D&&(typeof D==="object"||A.isFunction(D)))||false;},isString:function(D){return typeof D==="string";},isUndefined:function(D){return typeof D==="undefined";},_IEEnumFix:(YAHOO.env.ua.ie)?function(F,E){for(var D=0;D<C.length;D=D+1){var H=C[D],G=E[H];if(A.isFunction(G)&&G!=Object.prototype[H]){F[H]=G;}}}:function(){},extend:function(H,I,G){if(!I||!H){throw new Error("extend failed, please check that "+"all dependencies are included.");}var E=function(){};E.prototype=I.prototype;H.prototype=new E();H.prototype.constructor=H;H.superclass=I.prototype;if(I.prototype.constructor==Object.prototype.constructor){I.prototype.constructor=I;}if(G){for(var D in G){if(A.hasOwnProperty(G,D)){H.prototype[D]=G[D];}}A._IEEnumFix(H.prototype,G);}},augmentObject:function(H,G){if(!G||!H){throw new Error("Absorb failed, verify dependencies.");}var D=arguments,F,I,E=D[2];if(E&&E!==true){for(F=2;F<D.length;F=F+1){H[D[F]]=G[D[F]];}}else{for(I in G){if(E||!(I in H)){H[I]=G[I];}}A._IEEnumFix(H,G);}},augmentProto:function(G,F){if(!F||!G){throw new Error("Augment failed, verify dependencies.");}var D=[G.prototype,F.prototype];for(var E=2;E<arguments.length;E=E+1){D.push(arguments[E]);}A.augmentObject.apply(this,D);},dump:function(D,I){var F,H,K=[],L="{...}",E="f(){...}",J=", ",G=" => ";if(!A.isObject(D)){return D+"";}else{if(D instanceof Date||("nodeType" in D&&"tagName" in D)){return D;}else{if(A.isFunction(D)){return E;}}}I=(A.isNumber(I))?I:3;if(A.isArray(D)){K.push("[");for(F=0,H=D.length;F<H;F=F+1){if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F<D;F=F+1){A.augmentObject(G,E[F],true);}return G;},later:function(K,E,L,G,H){K=K||0;E=E||{};var F=L,J=G,I,D;if(A.isString(L)){F=E[L];}if(!F){throw new TypeError("method undefined");}if(!A.isArray(J)){J=[G];}I=function(){F.apply(E,J);};D=(H)?setInterval(I,K):setTimeout(I,K);return{interval:H,cancel:function(){if(this.interval){clearInterval(D);}else{clearTimeout(D);}}};},isValue:function(D){return(A.isObject(D)||A.isString(D)||A.isNumber(D)||A.isBoolean(D));}};A.hasOwnProperty=(Object.prototype.hasOwnProperty)?function(D,E){return D&&D.hasOwnProperty(E);}:function(D,E){return !A.isUndefined(D[E])&&D.constructor.prototype[E]!==D[E];};B.augmentObject(A,B,true);YAHOO.util.Lang=A;A.augment=A.augmentProto;YAHOO.augment=A.augmentProto;YAHOO.extend=A.extend;})();YAHOO.register("yahoo",YAHOO,{version:"2.5.2",build:"1076"});YAHOO.util.Get=function(){var M={},L=0,Q=0,E=false,N=YAHOO.env.ua,R=YAHOO.lang;var J=function(V,S,W){var T=W||window,X=T.document,Y=X.createElement(V);for(var U in S){if(S[U]&&YAHOO.lang.hasOwnProperty(S,U)){Y.setAttribute(U,S[U]);}}return Y;};var H=function(S,T,V){var U=V||"utf-8";return J("link",{"id":"yui__dyn_"+(Q++),"type":"text/css","charset":U,"rel":"stylesheet","href":S},T);
};var O=function(S,T,V){var U=V||"utf-8";return J("script",{"id":"yui__dyn_"+(Q++),"type":"text/javascript","charset":U,"src":S},T);};var A=function(S,T){return{tId:S.tId,win:S.win,data:S.data,nodes:S.nodes,msg:T,purge:function(){D(this.tId);}};};var B=function(S,V){var T=M[V],U=(R.isString(S))?T.win.document.getElementById(S):S;if(!U){P(V,"target node not found: "+S);}return U;};var P=function(V,U){var S=M[V];if(S.onFailure){var T=S.scope||S.win;S.onFailure.call(T,A(S,U));}};var C=function(V){var S=M[V];S.finished=true;if(S.aborted){var U="transaction "+V+" was aborted";P(V,U);return ;}if(S.onSuccess){var T=S.scope||S.win;S.onSuccess.call(T,A(S));}};var G=function(U,Y){var T=M[U];if(T.aborted){var W="transaction "+U+" was aborted";P(U,W);return ;}if(Y){T.url.shift();if(T.varName){T.varName.shift();}}else{T.url=(R.isString(T.url))?[T.url]:T.url;if(T.varName){T.varName=(R.isString(T.varName))?[T.varName]:T.varName;}}var b=T.win,a=b.document,Z=a.getElementsByTagName("head")[0],V;if(T.url.length===0){if(T.type==="script"&&N.webkit&&N.webkit<420&&!T.finalpass&&!T.varName){var X=O(null,T.win,T.charset);X.innerHTML='YAHOO.util.Get._finalize("'+U+'");';T.nodes.push(X);Z.appendChild(X);}else{C(U);}return ;}var S=T.url[0];if(T.type==="script"){V=O(S,b,T.charset);}else{V=H(S,b,T.charset);}F(T.type,V,U,S,b,T.url.length);T.nodes.push(V);if(T.insertBefore){var c=B(T.insertBefore,U);if(c){c.parentNode.insertBefore(V,c);}}else{Z.appendChild(V);}if((N.webkit||N.gecko)&&T.type==="css"){G(U,S);}};var K=function(){if(E){return ;}E=true;for(var S in M){var T=M[S];if(T.autopurge&&T.finished){D(T.tId);delete M[S];}}E=false;};var D=function(Z){var W=M[Z];if(W){var Y=W.nodes,S=Y.length,X=W.win.document,V=X.getElementsByTagName("head")[0];if(W.insertBefore){var U=B(W.insertBefore,Z);if(U){V=U.parentNode;}}for(var T=0;T<S;T=T+1){V.removeChild(Y[T]);}}W.nodes=[];};var I=function(T,S,U){var W="q"+(L++);U=U||{};if(L%YAHOO.util.Get.PURGE_THRESH===0){K();}M[W]=R.merge(U,{tId:W,type:T,url:S,finished:false,nodes:[]});var V=M[W];V.win=V.win||window;V.scope=V.scope||V.win;V.autopurge=("autopurge" in V)?V.autopurge:(T==="script")?true:false;R.later(0,V,G,W);return{tId:W};};var F=function(b,W,V,T,X,Y,a){var Z=a||G;if(N.ie){W.onreadystatechange=function(){var c=this.readyState;if("loaded"===c||"complete"===c){Z(V,T);}};}else{if(N.webkit){if(b==="script"){if(N.webkit>=420){W.addEventListener("load",function(){Z(V,T);});}else{var S=M[V];if(S.varName){var U=YAHOO.util.Get.POLL_FREQ;S.maxattempts=YAHOO.util.Get.TIMEOUT/U;S.attempts=0;S._cache=S.varName[0].split(".");S.timer=R.later(U,S,function(h){var e=this._cache,d=e.length,c=this.win,f;for(f=0;f<d;f=f+1){c=c[e[f]];if(!c){this.attempts++;if(this.attempts++>this.maxattempts){var g="Over retry limit, giving up";S.timer.cancel();P(V,g);}else{}return ;}}S.timer.cancel();Z(V,T);},null,true);}else{R.later(YAHOO.util.Get.POLL_FREQ,null,Z,[V,T]);}}}}else{W.onload=function(){Z(V,T);};}}};return{POLL_FREQ:10,PURGE_THRESH:20,TIMEOUT:2000,_finalize:function(S){R.later(0,null,C,S);},abort:function(T){var U=(R.isString(T))?T:T.tId;var S=M[U];if(S){S.aborted=true;}},script:function(S,T){return I("script",S,T);},css:function(S,T){return I("css",S,T);}};}();YAHOO.register("get",YAHOO.util.Get,{version:"2.5.2",build:"1076"});(function(){var Y=YAHOO,util=Y.util,lang=Y.lang,env=Y.env,PROV="_provides",SUPER="_supersedes",REQ="expanded",AFTER="_after";var YUI={dupsAllowed:{"yahoo":true,"get":true},info:{"base":"http://yui.yahooapis.com/2.5.2/build/","skin":{"defaultSkin":"sam","base":"assets/skins/","path":"skin.css","after":["reset","fonts","grids","base"],"rollup":3},dupsAllowed:["yahoo","get"],"moduleInfo":{"animation":{"type":"js","path":"animation/animation-min.js","requires":["dom","event"]},"autocomplete":{"type":"js","path":"autocomplete/autocomplete-min.js","requires":["dom","event"],"optional":["connection","animation"],"skinnable":true},"base":{"type":"css","path":"base/base-min.css","after":["reset","fonts","grids"]},"button":{"type":"js","path":"button/button-min.js","requires":["element"],"optional":["menu"],"skinnable":true},"calendar":{"type":"js","path":"calendar/calendar-min.js","requires":["event","dom"],"skinnable":true},"charts":{"type":"js","path":"charts/charts-experimental-min.js","requires":["element","json","datasource"]},"colorpicker":{"type":"js","path":"colorpicker/colorpicker-min.js","requires":["slider","element"],"optional":["animation"],"skinnable":true},"connection":{"type":"js","path":"connection/connection-min.js","requires":["event"]},"container":{"type":"js","path":"container/container-min.js","requires":["dom","event"],"optional":["dragdrop","animation","connection"],"supersedes":["containercore"],"skinnable":true},"containercore":{"type":"js","path":"container/container_core-min.js","requires":["dom","event"],"pkg":"container"},"cookie":{"type":"js","path":"cookie/cookie-beta-min.js","requires":["yahoo"]},"datasource":{"type":"js","path":"datasource/datasource-beta-min.js","requires":["event"],"optional":["connection"]},"datatable":{"type":"js","path":"datatable/datatable-beta-min.js","requires":["element","datasource"],"optional":["calendar","dragdrop"],"skinnable":true},"dom":{"type":"js","path":"dom/dom-min.js","requires":["yahoo"]},"dragdrop":{"type":"js","path":"dragdrop/dragdrop-min.js","requires":["dom","event"]},"editor":{"type":"js","path":"editor/editor-beta-min.js","requires":["menu","element","button"],"optional":["animation","dragdrop"],"supersedes":["simpleeditor"],"skinnable":true},"element":{"type":"js","path":"element/element-beta-min.js","requires":["dom","event"]},"event":{"type":"js","path":"event/event-min.js","requires":["yahoo"]},"fonts":{"type":"css","path":"fonts/fonts-min.css"},"get":{"type":"js","path":"get/get-min.js","requires":["yahoo"]},"grids":{"type":"css","path":"grids/grids-min.css","requires":["fonts"],"optional":["reset"]},"history":{"type":"js","path":"history/history-min.js","requires":["event"]},"imagecropper":{"type":"js","path":"imagecropper/imagecropper-beta-min.js","requires":["dom","event","dragdrop","element","resize"],"skinnable":true},"imageloader":{"type":"js","path":"imageloader/imageloader-min.js","requires":["event","dom"]},"json":{"type":"js","path":"json/json-min.js","requires":["yahoo"]},"layout":{"type":"js","path":"layout/layout-beta-min.js","requires":["dom","event","element"],"optional":["animation","dragdrop","resize","selector"],"skinnable":true},"logger":{"type":"js","path":"logger/logger-min.js","requires":["event","dom"],"optional":["dragdrop"],"skinnable":true},"menu":{"type":"js","path":"menu/menu-min.js","requires":["containercore"],"skinnable":true},"profiler":{"type":"js","path":"profiler/profiler-beta-min.js","requires":["yahoo"]},"profilerviewer":{"type":"js","path":"profilerviewer/profilerviewer-beta-min.js","requires":["profiler","yuiloader","element"],"skinnable":true},"reset":{"type":"css","path":"reset/reset-min.css"},"reset-fonts-grids":{"type":"css","path":"reset-fonts-grids/reset-fonts-grids.css","supersedes":["reset","fonts","grids","reset-fonts"],"rollup":4},"reset-fonts":{"type":"css","path":"reset-fonts/reset-fonts.css","supersedes":["reset","fonts"],"rollup":2},"resize":{"type":"js","path":"resize/resize-beta-min.js","requires":["dom","event","dragdrop","element"],"optional":["animation"],"skinnable":true},"selector":{"type":"js","path":"selector/selector-beta-min.js","requires":["yahoo","dom"]},"simpleeditor":{"type":"js","path":"editor/simpleeditor-beta-min.js","requires":["element"],"optional":["containercore","menu","button","animation","dragdrop"],"skinnable":true,"pkg":"editor"},"slider":{"type":"js","path":"slider/slider-min.js","requires":["dragdrop"],"optional":["animation"]},"tabview":{"type":"js","path":"tabview/tabview-min.js","requires":["element"],"optional":["connection"],"skinnable":true},"treeview":{"type":"js","path":"treeview/treeview-min.js","requires":["event"],"skinnable":true},"uploader":{"type":"js","path":"uploader/uploader-experimental.js","requires":["element"]},"utilities":{"type":"js","path":"utilities/utilities.js","supersedes":["yahoo","event","dragdrop","animation","dom","connection","element","yahoo-dom-event","get","yuiloader","yuiloader-dom-event"],"rollup":8},"yahoo":{"type":"js","path":"yahoo/yahoo-min.js"},"yahoo-dom-event":{"type":"js","path":"yahoo-dom-event/yahoo-dom-event.js","supersedes":["yahoo","event","dom"],"rollup":3},"yuiloader":{"type":"js","path":"yuiloader/yuiloader-beta-min.js","supersedes":["yahoo","get"]},"yuiloader-dom-event":{"type":"js","path":"yuiloader-dom-event/yuiloader-dom-event.js","supersedes":["yahoo","dom","event","get","yuiloader","yahoo-dom-event"],"rollup":5},"yuitest":{"type":"js","path":"yuitest/yuitest-min.js","requires":["logger"],"skinnable":true}}},ObjectUtil:{appendArray:function(o,a){if(a){for(var i=0;
i<a.length;i=i+1){o[a[i]]=true;}}},keys:function(o,ordered){var a=[],i;for(i in o){if(lang.hasOwnProperty(o,i)){a.push(i);}}return a;}},ArrayUtil:{appendArray:function(a1,a2){Array.prototype.push.apply(a1,a2);},indexOf:function(a,val){for(var i=0;i<a.length;i=i+1){if(a[i]===val){return i;}}return -1;},toObject:function(a){var o={};for(var i=0;i<a.length;i=i+1){o[a[i]]=true;}return o;},uniq:function(a){return YUI.ObjectUtil.keys(YUI.ArrayUtil.toObject(a));}}};YAHOO.util.YUILoader=function(o){this._internalCallback=null;this._useYahooListener=false;this.onSuccess=null;this.onFailure=Y.log;this.onProgress=null;this.scope=this;this.data=null;this.insertBefore=null;this.charset=null;this.varName=null;this.base=YUI.info.base;this.ignore=null;this.force=null;this.allowRollup=true;this.filter=null;this.required={};this.moduleInfo=lang.merge(YUI.info.moduleInfo);this.rollups=null;this.loadOptional=false;this.sorted=[];this.loaded={};this.dirty=true;this.inserted={};var self=this;env.listeners.push(function(m){if(self._useYahooListener){self.loadNext(m.name);}});this.skin=lang.merge(YUI.info.skin);this._config(o);};Y.util.YUILoader.prototype={FILTERS:{RAW:{"searchExp":"-min\\.js","replaceStr":".js"},DEBUG:{"searchExp":"-min\\.js","replaceStr":"-debug.js"}},SKIN_PREFIX:"skin-",_config:function(o){if(o){for(var i in o){if(lang.hasOwnProperty(o,i)){if(i=="require"){this.require(o[i]);}else{this[i]=o[i];}}}}var f=this.filter;if(lang.isString(f)){f=f.toUpperCase();if(f==="DEBUG"){this.require("logger");}if(!Y.widget.LogWriter){Y.widget.LogWriter=function(){return Y;};}this.filter=this.FILTERS[f];}},addModule:function(o){if(!o||!o.name||!o.type||(!o.path&&!o.fullpath)){return false;}o.ext=("ext" in o)?o.ext:true;o.requires=o.requires||[];this.moduleInfo[o.name]=o;this.dirty=true;return true;},require:function(what){var a=(typeof what==="string")?arguments:what;this.dirty=true;YUI.ObjectUtil.appendArray(this.required,a);},_addSkin:function(skin,mod){var name=this.formatSkin(skin),info=this.moduleInfo,sinf=this.skin,ext=info[mod]&&info[mod].ext;if(!info[name]){this.addModule({"name":name,"type":"css","path":sinf.base+skin+"/"+sinf.path,"after":sinf.after,"rollup":sinf.rollup,"ext":ext});}if(mod){name=this.formatSkin(skin,mod);if(!info[name]){var mdef=info[mod],pkg=mdef.pkg||mod;this.addModule({"name":name,"type":"css","after":sinf.after,"path":pkg+"/"+sinf.base+skin+"/"+mod+".css","ext":ext});}}return name;},getRequires:function(mod){if(!mod){return[];}if(!this.dirty&&mod.expanded){return mod.expanded;}mod.requires=mod.requires||[];var i,d=[],r=mod.requires,o=mod.optional,info=this.moduleInfo,m;for(i=0;i<r.length;i=i+1){d.push(r[i]);m=info[r[i]];YUI.ArrayUtil.appendArray(d,this.getRequires(m));}if(o&&this.loadOptional){for(i=0;i<o.length;i=i+1){d.push(o[i]);YUI.ArrayUtil.appendArray(d,this.getRequires(info[o[i]]));}}mod.expanded=YUI.ArrayUtil.uniq(d);return mod.expanded;},getProvides:function(name,notMe){var addMe=!(notMe),ckey=(addMe)?PROV:SUPER,m=this.moduleInfo[name],o={};if(!m){return o;}if(m[ckey]){return m[ckey];}var s=m.supersedes,done={},me=this;var add=function(mm){if(!done[mm]){done[mm]=true;lang.augmentObject(o,me.getProvides(mm));}};if(s){for(var i=0;i<s.length;i=i+1){add(s[i]);}}m[SUPER]=o;m[PROV]=lang.merge(o);m[PROV][name]=true;return m[ckey];},calculate:function(o){if(this.dirty){this._config(o);this._setup();this._explode();if(this.allowRollup){this._rollup();}this._reduce();this._sort();this.dirty=false;}},_setup:function(){var info=this.moduleInfo,name,i,j;for(name in info){var m=info[name];if(m&&m.skinnable){var o=this.skin.overrides,smod;if(o&&o[name]){for(i=0;i<o[name].length;i=i+1){smod=this._addSkin(o[name][i],name);}}else{smod=this._addSkin(this.skin.defaultSkin,name);}m.requires.push(smod);}}var l=lang.merge(this.inserted);if(!this._sandbox){l=lang.merge(l,env.modules);}if(this.ignore){YUI.ObjectUtil.appendArray(l,this.ignore);}if(this.force){for(i=0;i<this.force.length;i=i+1){if(this.force[i] in l){delete l[this.force[i]];}}}for(j in l){if(lang.hasOwnProperty(l,j)){lang.augmentObject(l,this.getProvides(j));}}this.loaded=l;},_explode:function(){var r=this.required,i,mod;for(i in r){mod=this.moduleInfo[i];if(mod){var req=this.getRequires(mod);if(req){YUI.ObjectUtil.appendArray(r,req);}}}},_skin:function(){},formatSkin:function(skin,mod){var s=this.SKIN_PREFIX+skin;if(mod){s=s+"-"+mod;}return s;},parseSkin:function(mod){if(mod.indexOf(this.SKIN_PREFIX)===0){var a=mod.split("-");return{skin:a[1],module:a[2]};}return null;},_rollup:function(){var i,j,m,s,rollups={},r=this.required,roll;if(this.dirty||!this.rollups){for(i in this.moduleInfo){m=this.moduleInfo[i];if(m&&m.rollup){rollups[i]=m;}}this.rollups=rollups;}for(;;){var rolled=false;for(i in rollups){if(!r[i]&&!this.loaded[i]){m=this.moduleInfo[i];s=m.supersedes;roll=false;if(!m.rollup){continue;}var skin=(m.ext)?false:this.parseSkin(i),c=0;if(skin){for(j in r){if(i!==j&&this.parseSkin(j)){c++;roll=(c>=m.rollup);if(roll){break;}}}}else{for(j=0;j<s.length;j=j+1){if(this.loaded[s[j]]&&(!YUI.dupsAllowed[s[j]])){roll=false;break;}else{if(r[s[j]]){c++;roll=(c>=m.rollup);if(roll){break;}}}}}if(roll){r[i]=true;rolled=true;this.getRequires(m);}}}if(!rolled){break;}}},_reduce:function(){var i,j,s,m,r=this.required;for(i in r){if(i in this.loaded){delete r[i];}else{var skinDef=this.parseSkin(i);if(skinDef){if(!skinDef.module){var skin_pre=this.SKIN_PREFIX+skinDef.skin;for(j in r){m=this.moduleInfo[j];var ext=m&&m.ext;if(!ext&&j!==i&&j.indexOf(skin_pre)>-1){delete r[j];}}}}else{m=this.moduleInfo[i];s=m&&m.supersedes;if(s){for(j=0;j<s.length;j=j+1){if(s[j] in r){delete r[s[j]];}}}}}}},_sort:function(){var s=[],info=this.moduleInfo,loaded=this.loaded,checkOptional=!this.loadOptional,me=this;var requires=function(aa,bb){if(loaded[bb]){return false;}var ii,mm=info[aa],rr=mm&&mm.expanded,after=mm&&mm.after,other=info[bb],optional=mm&&mm.optional;if(rr&&YUI.ArrayUtil.indexOf(rr,bb)>-1){return true;}if(after&&YUI.ArrayUtil.indexOf(after,bb)>-1){return true;
}if(checkOptional&&optional&&YUI.ArrayUtil.indexOf(optional,bb)>-1){return true;}var ss=info[bb]&&info[bb].supersedes;if(ss){for(ii=0;ii<ss.length;ii=ii+1){if(requires(aa,ss[ii])){return true;}}}if(mm.ext&&mm.type=="css"&&(!other.ext)){return true;}return false;};for(var i in this.required){s.push(i);}var p=0;for(;;){var l=s.length,a,b,j,k,moved=false;for(j=p;j<l;j=j+1){a=s[j];for(k=j+1;k<l;k=k+1){if(requires(a,s[k])){b=s.splice(k,1);s.splice(j,0,b[0]);moved=true;break;}}if(moved){break;}else{p=p+1;}}if(!moved){break;}}this.sorted=s;},toString:function(){var o={type:"YUILoader",base:this.base,filter:this.filter,required:this.required,loaded:this.loaded,inserted:this.inserted};lang.dump(o,1);},insert:function(o,type){this.calculate(o);if(!type){var self=this;this._internalCallback=function(){self._internalCallback=null;self.insert(null,"js");};this.insert(null,"css");return ;}this._loading=true;this.loadType=type;this.loadNext();},sandbox:function(o,type){if(o){}else{}this._config(o);if(!this.onSuccess){throw new Error("You must supply an onSuccess handler for your sandbox");}this._sandbox=true;var self=this;if(!type||type!=="js"){this._internalCallback=function(){self._internalCallback=null;self.sandbox(null,"js");};this.insert(null,"css");return ;}if(!util.Connect){var ld=new YAHOO.util.YUILoader();ld.insert({base:this.base,filter:this.filter,require:"connection",insertBefore:this.insertBefore,charset:this.charset,onSuccess:function(){this.sandbox(null,"js");},scope:this},"js");return ;}this._scriptText=[];this._loadCount=0;this._stopCount=this.sorted.length;this._xhr=[];this.calculate();var s=this.sorted,l=s.length,i,m,url;for(i=0;i<l;i=i+1){m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});for(var j=0;j<this._xhr.length;j=j+1){this._xhr[j].abort();}return ;}if(m.type!=="js"){this._loadCount++;continue;}url=m.fullpath||this._url(m.path);var xhrData={success:function(o){var idx=o.argument[0],name=o.argument[2];this._scriptText[idx]=o.responseText;if(this.onProgress){this.onProgress.call(this.scope,{name:name,scriptText:o.responseText,xhrResponse:o,data:this.data});}this._loadCount++;if(this._loadCount>=this._stopCount){var v=this.varName||"YAHOO";var t="(function() {\n";var b="\nreturn "+v+";\n})();";var ref=eval(t+this._scriptText.join("\n")+b);this._pushEvents(ref);if(ref){this.onSuccess.call(this.scope,{reference:ref,data:this.data});}else{this.onFailure.call(this.scope,{msg:this.varName+" reference failure",data:this.data});}}},failure:function(o){this.onFailure.call(this.scope,{msg:"XHR failure",xhrResponse:o,data:this.data});},scope:this,argument:[i,url,s[i]]};this._xhr.push(util.Connect.asyncRequest("GET",url,xhrData));}},loadNext:function(mname){if(!this._loading){return ;}if(mname){if(mname!==this._loading){return ;}this.inserted[mname]=true;if(this.onProgress){this.onProgress.call(this.scope,{name:mname,data:this.data});}}var s=this.sorted,len=s.length,i,m;for(i=0;i<len;i=i+1){if(s[i] in this.inserted){continue;}if(s[i]===this._loading){return ;}m=this.moduleInfo[s[i]];if(!m){this.onFailure.call(this.scope,{msg:"undefined module "+m,data:this.data});return ;}if(!this.loadType||this.loadType===m.type){this._loading=s[i];var fn=(m.type==="css")?util.Get.css:util.Get.script,url=m.fullpath||this._url(m.path),self=this,c=function(o){self.loadNext(o.data);};if(env.ua.webkit&&env.ua.webkit<420&&m.type==="js"&&!m.varName){c=null;this._useYahooListener=true;}fn(url,{data:s[i],onSuccess:c,insertBefore:this.insertBefore,charset:this.charset,varName:m.varName,scope:self});return ;}}this._loading=null;if(this._internalCallback){var f=this._internalCallback;this._internalCallback=null;f.call(this);}else{if(this.onSuccess){this._pushEvents();this.onSuccess.call(this.scope,{data:this.data});}}},_pushEvents:function(ref){var r=ref||YAHOO;if(r.util&&r.util.Event){r.util.Event._load();}},_url:function(path){var u=this.base||"",f=this.filter;u=u+path;if(f){u=u.replace(new RegExp(f.searchExp),f.replaceStr);}return u;}};})();(function(){var B=YAHOO.util,K,I,J={},F={},M=window.document;YAHOO.env._id_counter=YAHOO.env._id_counter||0;var C=YAHOO.env.ua.opera,L=YAHOO.env.ua.webkit,A=YAHOO.env.ua.gecko,G=YAHOO.env.ua.ie;var E={HYPHEN:/(-[a-z])/i,ROOT_TAG:/^body|html$/i,OP_SCROLL:/^(?:inline|table-row)$/i};var N=function(P){if(!E.HYPHEN.test(P)){return P;}if(J[P]){return J[P];}var Q=P;while(E.HYPHEN.exec(Q)){Q=Q.replace(RegExp.$1,RegExp.$1.substr(1).toUpperCase());}J[P]=Q;return Q;};var O=function(Q){var P=F[Q];if(!P){P=new RegExp("(?:^|\\s+)"+Q+"(?:\\s+|$)");F[Q]=P;}return P;};if(M.defaultView&&M.defaultView.getComputedStyle){K=function(P,S){var R=null;if(S=="float"){S="cssFloat";}var Q=P.ownerDocument.defaultView.getComputedStyle(P,"");if(Q){R=Q[N(S)];}return P.style[S]||R;};}else{if(M.documentElement.currentStyle&&G){K=function(P,R){switch(N(R)){case"opacity":var T=100;try{T=P.filters["DXImageTransform.Microsoft.Alpha"].opacity;}catch(S){try{T=P.filters("alpha").opacity;}catch(S){}}return T/100;case"float":R="styleFloat";default:var Q=P.currentStyle?P.currentStyle[R]:null;return(P.style[R]||Q);}};}else{K=function(P,Q){return P.style[Q];};}}if(G){I=function(P,Q,R){switch(Q){case"opacity":if(YAHOO.lang.isString(P.style.filter)){P.style.filter="alpha(opacity="+R*100+")";if(!P.currentStyle||!P.currentStyle.hasLayout){P.style.zoom=1;}}break;case"float":Q="styleFloat";default:P.style[Q]=R;}};}else{I=function(P,Q,R){if(Q=="float"){Q="cssFloat";}P.style[Q]=R;};}var D=function(P,Q){return P&&P.nodeType==1&&(!Q||Q(P));};YAHOO.util.Dom={get:function(R){if(R&&(R.nodeType||R.item)){return R;}if(YAHOO.lang.isString(R)||!R){return M.getElementById(R);}if(R.length!==undefined){var S=[];for(var Q=0,P=R.length;Q<P;++Q){S[S.length]=B.Dom.get(R[Q]);}return S;}return R;},getStyle:function(P,R){R=N(R);var Q=function(S){return K(S,R);};return B.Dom.batch(P,Q,B.Dom,true);},setStyle:function(P,R,S){R=N(R);var Q=function(T){I(T,R,S);};B.Dom.batch(P,Q,B.Dom,true);},getXY:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}return H(R);};return B.Dom.batch(P,Q,B.Dom,true);},getX:function(P){var Q=function(R){return B.Dom.getXY(R)[0];};return B.Dom.batch(P,Q,B.Dom,true);},getY:function(P){var Q=function(R){return B.Dom.getXY(R)[1];};return B.Dom.batch(P,Q,B.Dom,true);},setXY:function(P,S,R){var Q=function(V){var U=this.getStyle(V,"position");if(U=="static"){this.setStyle(V,"position","relative");U="relative";}var X=this.getXY(V);if(X===false){return false;}var W=[parseInt(this.getStyle(V,"left"),10),parseInt(this.getStyle(V,"top"),10)];if(isNaN(W[0])){W[0]=(U=="relative")?0:V.offsetLeft;}if(isNaN(W[1])){W[1]=(U=="relative")?0:V.offsetTop;}if(S[0]!==null){V.style.left=S[0]-X[0]+W[0]+"px";}if(S[1]!==null){V.style.top=S[1]-X[1]+W[1]+"px";}if(!R){var T=this.getXY(V);if((S[0]!==null&&T[0]!=S[0])||(S[1]!==null&&T[1]!=S[1])){this.setXY(V,S,true);}}};B.Dom.batch(P,Q,B.Dom,true);},setX:function(Q,P){B.Dom.setXY(Q,[P,null]);},setY:function(P,Q){B.Dom.setXY(P,[null,Q]);},getRegion:function(P){var Q=function(R){if((R.parentNode===null||R.offsetParent===null||this.getStyle(R,"display")=="none")&&R!=R.ownerDocument.body){return false;}var S=B.Region.getRegion(R);return S;};return B.Dom.batch(P,Q,B.Dom,true);},getClientWidth:function(){return B.Dom.getViewportWidth();},getClientHeight:function(){return B.Dom.getViewportHeight();},getElementsByClassName:function(T,X,U,V){X=X||"*";U=(U)?B.Dom.get(U):null||M;if(!U){return[];}var Q=[],P=U.getElementsByTagName(X),W=O(T);for(var R=0,S=P.length;R<S;++R){if(W.test(P[R].className)){Q[Q.length]=P[R];if(V){V.call(P[R],P[R]);}}}return Q;},hasClass:function(R,Q){var P=O(Q);var S=function(T){return P.test(T.className);};return B.Dom.batch(R,S,B.Dom,true);},addClass:function(Q,P){var R=function(S){if(this.hasClass(S,P)){return false;}S.className=YAHOO.lang.trim([S.className,P].join(" "));return true;};return B.Dom.batch(Q,R,B.Dom,true);},removeClass:function(R,Q){var P=O(Q);var S=function(T){if(!Q||!this.hasClass(T,Q)){return false;}var U=T.className;T.className=U.replace(P," ");if(this.hasClass(T,Q)){this.removeClass(T,Q);}T.className=YAHOO.lang.trim(T.className);return true;};return B.Dom.batch(R,S,B.Dom,true);},replaceClass:function(S,Q,P){if(!P||Q===P){return false;}var R=O(Q);var T=function(U){if(!this.hasClass(U,Q)){this.addClass(U,P);return true;}U.className=U.className.replace(R," "+P+" ");if(this.hasClass(U,Q)){this.replaceClass(U,Q,P);}U.className=YAHOO.lang.trim(U.className);return true;};return B.Dom.batch(S,T,B.Dom,true);},generateId:function(P,R){R=R||"yui-gen";var Q=function(S){if(S&&S.id){return S.id;}var T=R+YAHOO.env._id_counter++;if(S){S.id=T;}return T;};return B.Dom.batch(P,Q,B.Dom,true)||Q.apply(B.Dom,arguments);},isAncestor:function(P,Q){P=B.Dom.get(P);Q=B.Dom.get(Q);if(!P||!Q){return false;}if(P.contains&&Q.nodeType&&!L){return P.contains(Q);}else{if(P.compareDocumentPosition&&Q.nodeType){return !!(P.compareDocumentPosition(Q)&16);}else{if(Q.nodeType){return !!this.getAncestorBy(Q,function(R){return R==P;});}}}return false;},inDocument:function(P){return this.isAncestor(M.documentElement,P);},getElementsBy:function(W,Q,R,T){Q=Q||"*";R=(R)?B.Dom.get(R):null||M;if(!R){return[];}var S=[],V=R.getElementsByTagName(Q);for(var U=0,P=V.length;U<P;++U){if(W(V[U])){S[S.length]=V[U];if(T){T(V[U]);}}}return S;},batch:function(T,W,V,R){T=(T&&(T.tagName||T.item))?T:B.Dom.get(T);if(!T||!W){return false;}var S=(R)?V:window;if(T.tagName||T.length===undefined){return W.call(S,T,V);}var U=[];for(var Q=0,P=T.length;Q<P;++Q){U[U.length]=W.call(S,T[Q],V);}return U;},getDocumentHeight:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollHeight:M.documentElement.scrollHeight;var P=Math.max(Q,B.Dom.getViewportHeight());return P;},getDocumentWidth:function(){var Q=(M.compatMode!="CSS1Compat")?M.body.scrollWidth:M.documentElement.scrollWidth;var P=Math.max(Q,B.Dom.getViewportWidth());return P;},getViewportHeight:function(){var P=self.innerHeight;
var Q=M.compatMode;if((Q||G)&&!C){P=(Q=="CSS1Compat")?M.documentElement.clientHeight:M.body.clientHeight;}return P;},getViewportWidth:function(){var P=self.innerWidth;var Q=M.compatMode;if(Q||G){P=(Q=="CSS1Compat")?M.documentElement.clientWidth:M.body.clientWidth;}return P;},getAncestorBy:function(P,Q){while(P=P.parentNode){if(D(P,Q)){return P;}}return null;},getAncestorByClassName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return B.Dom.hasClass(S,P);};return B.Dom.getAncestorBy(Q,R);},getAncestorByTagName:function(Q,P){Q=B.Dom.get(Q);if(!Q){return null;}var R=function(S){return S.tagName&&S.tagName.toUpperCase()==P.toUpperCase();};return B.Dom.getAncestorBy(Q,R);},getPreviousSiblingBy:function(P,Q){while(P){P=P.previousSibling;if(D(P,Q)){return P;}}return null;},getPreviousSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getPreviousSiblingBy(P);},getNextSiblingBy:function(P,Q){while(P){P=P.nextSibling;if(D(P,Q)){return P;}}return null;},getNextSibling:function(P){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getNextSiblingBy(P);},getFirstChildBy:function(P,R){var Q=(D(P.firstChild,R))?P.firstChild:null;return Q||B.Dom.getNextSiblingBy(P.firstChild,R);},getFirstChild:function(P,Q){P=B.Dom.get(P);if(!P){return null;}return B.Dom.getFirstChildBy(P);},getLastChildBy:function(P,R){if(!P){return null;}var Q=(D(P.lastChild,R))?P.lastChild:null;return Q||B.Dom.getPreviousSiblingBy(P.lastChild,R);},getLastChild:function(P){P=B.Dom.get(P);return B.Dom.getLastChildBy(P);},getChildrenBy:function(Q,S){var R=B.Dom.getFirstChildBy(Q,S);var P=R?[R]:[];B.Dom.getNextSiblingBy(R,function(T){if(!S||S(T)){P[P.length]=T;}return false;});return P;},getChildren:function(P){P=B.Dom.get(P);if(!P){}return B.Dom.getChildrenBy(P);},getDocumentScrollLeft:function(P){P=P||M;return Math.max(P.documentElement.scrollLeft,P.body.scrollLeft);},getDocumentScrollTop:function(P){P=P||M;return Math.max(P.documentElement.scrollTop,P.body.scrollTop);},insertBefore:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}return P.parentNode.insertBefore(Q,P);},insertAfter:function(Q,P){Q=B.Dom.get(Q);P=B.Dom.get(P);if(!Q||!P||!P.parentNode){return null;}if(P.nextSibling){return P.parentNode.insertBefore(Q,P.nextSibling);}else{return P.parentNode.appendChild(Q);}},getClientRegion:function(){var R=B.Dom.getDocumentScrollTop(),Q=B.Dom.getDocumentScrollLeft(),S=B.Dom.getViewportWidth()+Q,P=B.Dom.getViewportHeight()+R;return new B.Region(R,S,P,Q);}};var H=function(){if(M.documentElement.getBoundingClientRect){return function(Q){var R=Q.getBoundingClientRect();var P=Q.ownerDocument;return[R.left+B.Dom.getDocumentScrollLeft(P),R.top+B.Dom.getDocumentScrollTop(P)];};}else{return function(R){var S=[R.offsetLeft,R.offsetTop];var Q=R.offsetParent;var P=(L&&B.Dom.getStyle(R,"position")=="absolute"&&R.offsetParent==R.ownerDocument.body);if(Q!=R){while(Q){S[0]+=Q.offsetLeft;S[1]+=Q.offsetTop;if(!P&&L&&B.Dom.getStyle(Q,"position")=="absolute"){P=true;}Q=Q.offsetParent;}}if(P){S[0]-=R.ownerDocument.body.offsetLeft;S[1]-=R.ownerDocument.body.offsetTop;}Q=R.parentNode;while(Q.tagName&&!E.ROOT_TAG.test(Q.tagName)){if(Q.scrollTop||Q.scrollLeft){if(!E.OP_SCROLL.test(B.Dom.getStyle(Q,"display"))){if(!C||B.Dom.getStyle(Q,"overflow")!=="visible"){S[0]-=Q.scrollLeft;S[1]-=Q.scrollTop;}}}Q=Q.parentNode;}return S;};}}();})();YAHOO.util.Region=function(C,D,A,B){this.top=C;this[1]=C;this.right=D;this.bottom=A;this.left=B;this[0]=B;};YAHOO.util.Region.prototype.contains=function(A){return(A.left>=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.5.2",build:"1076"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B<A;++B){var C=this.subscribers[B];if(C&&C.contains(D,F)){this._delete(B);E=true;}}return E;},fire:function(){this.lastError=null;var K=[],E=this.subscribers.length;if(!E&&this.silent){return true;}var I=[].slice.call(arguments,0),G=true,D,J=false;if(!this.silent){}var C=this.subscribers.slice(),A=YAHOO.util.Event.throwErrors;for(D=0;D<E;++D){var M=C[D];if(!M){J=true;}else{if(!this.silent){}var L=M.getScope(this.scope);if(this.signature==YAHOO.util.CustomEvent.FLAT){var B=null;if(I.length>0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var K=this;var L=function(){K._tryPreloadAttach();};this._interval=setInterval(L,this.POLL_INTERVAL);}},onAvailable:function(P,M,Q,O,N){var K=(YAHOO.lang.isString(P))?[P]:P;for(var L=0;L<K.length;L=L+1){F.push({id:K[L],fn:M,obj:Q,override:O,checkReady:N});}C=this.POLL_RETRYS;this.startInterval();},onContentReady:function(M,K,N,L){this.onAvailable(M,K,N,L,true);},onDOMReady:function(K,M,L){if(this.DOMReady){setTimeout(function(){var N=window;if(L){if(L===true){N=M;}else{N=L;}}K.call(N,"DOMReady",[],M);},0);}else{this.DOMReadyEvent.subscribe(K,M,L);}},addListener:function(M,K,V,Q,L){if(!V||!V.call){return false;}if(this._isValidCollection(M)){var W=true;for(var R=0,T=M.length;R<T;++R){W=this.on(M[R],K,V,Q,L)&&W;}return W;}else{if(YAHOO.lang.isString(M)){var P=this.getEl(M);if(P){M=P;}else{this.onAvailable(M,function(){YAHOO.util.Event.on(M,K,V,Q,L);});return true;}}}if(!M){return false;}if("unload"==K&&Q!==this){J[J.length]=[M,K,V,Q,L];return true;}var Y=M;if(L){if(L===true){Y=Q;}else{Y=L;}}var N=function(Z){return V.call(Y,YAHOO.util.Event.getEvent(Z,M),Q);};var X=[M,K,V,N,Y,Q,L];var S=I.length;I[S]=X;if(this.useLegacyEvent(M,K)){var O=this.getLegacyIndex(M,K);if(O==-1||M!=G[O][0]){O=G.length;B[M.id+K]=O;G[O]=[M,K,M["on"+K]];E[O]=[];M["on"+K]=function(Z){YAHOO.util.Event.fireLegacyEvent(YAHOO.util.Event.getEvent(Z),O);};}E[O].push(X);}else{try{this._simpleAdd(M,K,N,false);}catch(U){this.lastError=U;this.removeListener(M,K,V);return false;}}return true;},fireLegacyEvent:function(O,M){var Q=true,K,S,R,T,P;S=E[M].slice();for(var L=0,N=S.length;L<N;++L){R=S[L];if(R&&R[this.WFN]){T=R[this.ADJ_SCOPE];P=R[this.WFN].call(T,O);Q=(Q&&P);}}K=G[M];if(K&&K[2]){K[2](O);}return Q;},getLegacyIndex:function(L,M){var K=this.generateId(L)+M;if(typeof B[K]=="undefined"){return -1;}else{return B[K];}},useLegacyEvent:function(L,M){if(this.webkit&&("click"==M||"dblclick"==M)){var K=parseInt(this.webkit,10);if(!isNaN(K)&&K<418){return true;}}return false;},removeListener:function(L,K,T){var O,R,V;if(typeof L=="string"){L=this.getEl(L);}else{if(this._isValidCollection(L)){var U=true;for(O=L.length-1;O>-1;O--){U=(this.removeListener(L[O],K,T)&&U);}return U;}}if(!T||!T.call){return this.purgeElement(L,false,K);}if("unload"==K){for(O=J.length-1;O>-1;O--){V=J[O];if(V&&V[0]==L&&V[1]==K&&V[2]==T){J.splice(O,1);return true;}}return false;}var P=null;var Q=arguments[3];if("undefined"===typeof Q){Q=this._getCacheIndex(L,K,T);}if(Q>=0){P=I[Q];}if(!L||!P){return false;}if(this.useLegacyEvent(L,K)){var N=this.getLegacyIndex(L,K);var M=E[N];if(M){for(O=0,R=M.length;O<R;++O){V=M[O];if(V&&V[this.EL]==L&&V[this.TYPE]==K&&V[this.FN]==T){M.splice(O,1);break;}}}}else{try{this._simpleRemove(L,K,P[this.WFN],false);}catch(S){this.lastError=S;return false;}}delete I[Q][this.WFN];delete I[Q][this.FN];I.splice(Q,1);return true;},getTarget:function(M,L){var K=M.target||M.srcElement;return this.resolveTextNode(K);},resolveTextNode:function(L){try{if(L&&3==L.nodeType){return L.parentNode;}}catch(K){}return L;},getPageX:function(L){var K=L.pageX;if(!K&&0!==K){K=L.clientX||0;if(this.isIE){K+=this._getScrollLeft();}}return K;},getPageY:function(K){var L=K.pageY;if(!L&&0!==L){L=K.clientY||0;if(this.isIE){L+=this._getScrollTop();}}return L;
},getXY:function(K){return[this.getPageX(K),this.getPageY(K)];},getRelatedTarget:function(L){var K=L.relatedTarget;if(!K){if(L.type=="mouseout"){K=L.toElement;}else{if(L.type=="mouseover"){K=L.fromElement;}}}return this.resolveTextNode(K);},getTime:function(M){if(!M.time){var L=new Date().getTime();try{M.time=L;}catch(K){this.lastError=K;return L;}}return M.time;},stopEvent:function(K){this.stopPropagation(K);this.preventDefault(K);},stopPropagation:function(K){if(K.stopPropagation){K.stopPropagation();}else{K.cancelBubble=true;}},preventDefault:function(K){if(K.preventDefault){K.preventDefault();}else{K.returnValue=false;}},getEvent:function(M,K){var L=M||window.event;if(!L){var N=this.getEvent.caller;while(N){L=N.arguments[0];if(L&&Event==L.constructor){break;}N=N.caller;}}return L;},getCharCode:function(L){var K=L.keyCode||L.charCode||0;if(YAHOO.env.ua.webkit&&(K in D)){K=D[K];}return K;},_getCacheIndex:function(O,P,N){for(var M=0,L=I.length;M<L;M=M+1){var K=I[M];if(K&&K[this.FN]==N&&K[this.EL]==O&&K[this.TYPE]==P){return M;}}return -1;},generateId:function(K){var L=K.id;if(!L){L="yuievtautoid-"+A;++A;K.id=L;}return L;},_isValidCollection:function(L){try{return(L&&typeof L!=="string"&&L.length&&!L.tagName&&!L.alert&&typeof L[0]!=="undefined");}catch(K){return false;}},elCache:{},getEl:function(K){return(typeof K==="string")?document.getElementById(K):K;},clearCache:function(){},DOMReadyEvent:new YAHOO.util.CustomEvent("DOMReady",this),_load:function(L){if(!H){H=true;var K=YAHOO.util.Event;K._ready();K._tryPreloadAttach();}},_ready:function(L){var K=YAHOO.util.Event;if(!K.DOMReady){K.DOMReady=true;K.DOMReadyEvent.fire();K._simpleRemove(document,"DOMContentLoaded",K._ready);}},_tryPreloadAttach:function(){if(F.length===0){C=0;clearInterval(this._interval);this._interval=null;return ;}if(this.locked){return ;}if(this.isIE){if(!this.DOMReady){this.startInterval();return ;}}this.locked=true;var Q=!H;if(!Q){Q=(C>0&&F.length>0);}var P=[];var R=function(T,U){var S=T;if(U.override){if(U.override===true){S=U.obj;}else{S=U.override;}}U.fn.call(S,U.obj);};var L,K,O,N,M=[];for(L=0,K=F.length;L<K;L=L+1){O=F[L];if(O){N=this.getEl(O.id);if(N){if(O.checkReady){if(H||N.nextSibling||!Q){M.push(O);F[L]=null;}}else{R(N,O);F[L]=null;}}else{P.push(O);}}}for(L=0,K=M.length;L<K;L=L+1){O=M[L];R(this.getEl(O.id),O);}C--;if(Q){for(L=F.length-1;L>-1;L--){O=F[L];if(!O||!O.id){F.splice(L,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(O,P,R){var M=(YAHOO.lang.isString(O))?this.getEl(O):O;var Q=this.getListeners(M,R),N,K;if(Q){for(N=Q.length-1;N>-1;N--){var L=Q[N];this.removeListener(M,L.type,L.fn);}}if(P&&M&&M.childNodes){for(N=0,K=M.childNodes.length;N<K;++N){this.purgeElement(M.childNodes[N],P,R);}}},getListeners:function(M,K){var P=[],L;if(!K){L=[I,J];}else{if(K==="unload"){L=[J];}else{L=[I];}}var R=(YAHOO.lang.isString(M))?this.getEl(M):M;for(var O=0;O<L.length;O=O+1){var T=L[O];if(T){for(var Q=0,S=T.length;Q<S;++Q){var N=T[Q];if(N&&N[this.EL]===R&&(!K||K===N[this.TYPE])){P.push({type:N[this.TYPE],fn:N[this.FN],obj:N[this.OBJ],adjust:N[this.OVERRIDE],scope:N[this.ADJ_SCOPE],index:Q});}}}}return(P.length)?P:null;},_unload:function(Q){var K=YAHOO.util.Event,N,M,L,P,O,R=J.slice();for(N=0,P=J.length;N<P;++N){L=R[N];if(L){var S=window;if(L[K.ADJ_SCOPE]){if(L[K.ADJ_SCOPE]===true){S=L[K.UNLOAD_OBJ];}else{S=L[K.ADJ_SCOPE];}}L[K.FN].call(S,K.getEvent(Q,L[K.EL]),L[K.UNLOAD_OBJ]);R[N]=null;L=null;S=null;}}J=null;if(I){for(M=I.length-1;M>-1;M--){L=I[M];if(L){K.removeListener(L[K.EL],L[K.TYPE],L[K.FN],M);}}L=null;}G=null;K._simpleRemove(window,"unload",K._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var K=document.documentElement,L=document.body;if(K&&(K.scrollTop||K.scrollLeft)){return[K.scrollTop,K.scrollLeft];}else{if(L){return[L.scrollTop,L.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(M,N,L,K){M.addEventListener(N,L,(K));};}else{if(window.attachEvent){return function(M,N,L,K){M.attachEvent("on"+N,L);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(M,N,L,K){M.removeEventListener(N,L,(K));};}else{if(window.detachEvent){return function(L,M,K){L.detachEvent("on"+M,K);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;
/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */
if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{};var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;
if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C<F.length;++C){B.subscribe(F[C].fn,F[C].obj,F[C].override);}}}return I[G];},fireEvent:function(E,D,A,C){this.__yui_events=this.__yui_events||{};var G=this.__yui_events[E];if(!G){return null;}var B=[];for(var F=1;F<arguments.length;++F){B.push(arguments[F]);}return G.fire.apply(G,B);},hasEvent:function(A){if(this.__yui_events){if(this.__yui_events[A]){return true;}}return false;}};YAHOO.util.KeyListener=function(A,F,B,C){if(!A){}else{if(!F){}else{if(!B){}}}if(!C){C=YAHOO.util.KeyListener.KEYDOWN;}var D=new YAHOO.util.CustomEvent("keyPressed");this.enabledEvent=new YAHOO.util.CustomEvent("enabled");this.disabledEvent=new YAHOO.util.CustomEvent("disabled");if(typeof A=="string"){A=document.getElementById(A);}if(typeof B=="function"){D.subscribe(B);}else{D.subscribe(B.fn,B.scope,B.correctScope);}function E(J,I){if(!F.shift){F.shift=false;}if(!F.alt){F.alt=false;}if(!F.ctrl){F.ctrl=false;}if(J.shiftKey==F.shift&&J.altKey==F.alt&&J.ctrlKey==F.ctrl){var G;if(F.keys instanceof Array){for(var H=0;H<F.keys.length;H++){G=F.keys[H];if(G==J.charCode){D.fire(J.charCode,J);break;}else{if(G==J.keyCode){D.fire(J.keyCode,J);break;}}}}else{G=F.keys;if(G==J.charCode){D.fire(J.charCode,J);}else{if(G==J.keyCode){D.fire(J.keyCode,J);}}}}}this.enable=function(){if(!this.enabled){YAHOO.util.Event.addListener(A,C,E);this.enabledEvent.fire(F);}this.enabled=true;};this.disable=function(){if(this.enabled){YAHOO.util.Event.removeListener(A,C,E);this.disabledEvent.fire(F);}this.enabled=false;};this.toString=function(){return"KeyListener ["+F.keys+"] "+A.tagName+(A.id?"["+A.id+"]":"");};};YAHOO.util.KeyListener.KEYDOWN="keydown";YAHOO.util.KeyListener.KEYUP="keyup";YAHOO.util.KeyListener.KEY={ALT:18,BACK_SPACE:8,CAPS_LOCK:20,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,META:224,NUM_LOCK:144,PAGE_DOWN:34,PAGE_UP:33,PAUSE:19,PRINTSCREEN:44,RIGHT:39,SCROLL_LOCK:145,SHIFT:16,SPACE:32,TAB:9,UP:38};YAHOO.register("event",YAHOO.util.Event,{version:"2.5.2",build:"1076"});YAHOO.util.Connect={_msxml_progid:["Microsoft.XMLHTTP","MSXML2.XMLHTTP.3.0","MSXML2.XMLHTTP"],_http_headers:{},_has_http_headers:false,_use_default_post_header:true,_default_post_header:"application/x-www-form-urlencoded; charset=UTF-8",_default_form_header:"application/x-www-form-urlencoded",_use_default_xhr_header:true,_default_xhr_header:"XMLHttpRequest",_has_default_headers:true,_default_headers:{},_isFormSubmit:false,_isFileUpload:false,_formNode:null,_sFormData:null,_poll:{},_timeOut:{},_polling_interval:50,_transaction_id:0,_submitElementValue:null,_hasSubmitListener:(function(){if(YAHOO.util.Event){YAHOO.util.Event.addListener(document,"click",function(B){var A=YAHOO.util.Event.getTarget(B);if(A.nodeName.toLowerCase()=="input"&&(A.type&&A.type.toLowerCase()=="submit")){YAHOO.util.Connect._submitElementValue=encodeURIComponent(A.name)+"="+encodeURIComponent(A.value);}});return true;}return false;})(),startEvent:new YAHOO.util.CustomEvent("start"),completeEvent:new YAHOO.util.CustomEvent("complete"),successEvent:new YAHOO.util.CustomEvent("success"),failureEvent:new YAHOO.util.CustomEvent("failure"),uploadEvent:new YAHOO.util.CustomEvent("upload"),abortEvent:new YAHOO.util.CustomEvent("abort"),_customEvents:{onStart:["startEvent","start"],onComplete:["completeEvent","complete"],onSuccess:["successEvent","success"],onFailure:["failureEvent","failure"],onUpload:["uploadEvent","upload"],onAbort:["abortEvent","abort"]},setProgId:function(A){this._msxml_progid.unshift(A);YAHOO.log("ActiveX Program Id  "+A+" added to _msxml_progid.","info","Connection");},setDefaultPostHeader:function(A){if(typeof A=="string"){this._default_post_header=A;YAHOO.log("Default POST header set to  "+A,"info","Connection");}else{if(typeof A=="boolean"){this._use_default_post_header=A;}}},setDefaultXhrHeader:function(A){if(typeof A=="string"){this._default_xhr_header=A;YAHOO.log("Default XHR header set to  "+A,"info","Connection");}else{this._use_default_xhr_header=A;}},setPollingInterval:function(A){if(typeof A=="number"&&isFinite(A)){this._polling_interval=A;YAHOO.log("Default polling interval set to "+A+"ms","info","Connection");}},createXhrObject:function(E){var D,A;try{A=new XMLHttpRequest();D={conn:A,tId:E};YAHOO.log("XHR object created for transaction "+E,"info","Connection");}catch(C){for(var B=0;B<this._msxml_progid.length;++B){try{A=new ActiveXObject(this._msxml_progid[B]);D={conn:A,tId:E};YAHOO.log("ActiveX XHR object created for transaction "+E,"info","Connection");break;}catch(C){}}}finally{return D;}},getConnectionObject:function(A){var C;var D=this._transaction_id;try{if(!A){C=this.createXhrObject(D);}else{C={};C.tId=D;C.isUpload=true;}if(C){this._transaction_id++;}}catch(B){}finally{return C;}},asyncRequest:function(F,C,E,A){var D=(this._isFileUpload)?this.getConnectionObject(true):this.getConnectionObject();var B=(E&&E.argument)?E.argument:null;if(!D){YAHOO.log("Unable to create connection object.","error","Connection");return null;}else{if(E&&E.customevents){this.initCustomEvents(D,E);}if(this._isFormSubmit){if(this._isFileUpload){this.uploadFile(D,E,C,A);return D;}if(F.toUpperCase()=="GET"){if(this._sFormData.length!==0){C+=((C.indexOf("?")==-1)?"?":"&")+this._sFormData;}}else{if(F.toUpperCase()=="POST"){A=A?this._sFormData+"&"+A:this._sFormData;}}}if(F.toUpperCase()=="GET"&&(E&&E.cache===false)){C+=((C.indexOf("?")==-1)?"?":"&")+"rnd="+new Date().valueOf().toString();}D.conn.open(F,C,true);if(this._use_default_xhr_header){if(!this._default_headers["X-Requested-With"]){this.initHeader("X-Requested-With",this._default_xhr_header,true);YAHOO.log("Initialize transaction header X-Request-Header to XMLHttpRequest.","info","Connection");}}if((F.toUpperCase()=="POST"&&this._use_default_post_header)&&this._isFormSubmit===false){this.initHeader("Content-Type",this._default_post_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded; UTF-8 for POST transaction.","info","Connection");}if(this._has_default_headers||this._has_http_headers){this.setHeader(D);}this.handleReadyState(D,E);D.conn.send(A||"");YAHOO.log("Transaction "+D.tId+" sent.","info","Connection");if(this._isFormSubmit===true){this.resetFormState();}this.startEvent.fire(D,B);if(D.startEvent){D.startEvent.fire(D,B);}return D;}},initCustomEvents:function(A,C){for(var B in C.customevents){if(this._customEvents[B][0]){A[this._customEvents[B][0]]=new YAHOO.util.CustomEvent(this._customEvents[B][1],(C.scope)?C.scope:null);YAHOO.log("Transaction-specific Custom Event "+A[this._customEvents[B][1]]+" created.","info","Connection");A[this._customEvents[B][0]].subscribe(C.customevents[B]);YAHOO.log("Transaction-specific Custom Event "+A[this._customEvents[B][1]]+" subscribed.","info","Connection");}}},handleReadyState:function(C,D){var B=this;var A=(D&&D.argument)?D.argument:null;if(D&&D.timeout){this._timeOut[C.tId]=window.setTimeout(function(){B.abort(C,D,true);},D.timeout);}this._poll[C.tId]=window.setInterval(function(){if(C.conn&&C.conn.readyState===4){window.clearInterval(B._poll[C.tId]);delete B._poll[C.tId];if(D&&D.timeout){window.clearTimeout(B._timeOut[C.tId]);delete B._timeOut[C.tId];}B.completeEvent.fire(C,A);if(C.completeEvent){C.completeEvent.fire(C,A);}B.handleTransactionResponse(C,D);}},this._polling_interval);},handleTransactionResponse:function(F,G,A){var D,C;var B=(G&&G.argument)?G.argument:null;try{if(F.conn.status!==undefined&&F.conn.status!==0){D=F.conn.status;}else{D=13030;}}catch(E){D=13030;}if(D>=200&&D<300||D===1223){C=this.createResponseObject(F,B);if(G&&G.success){if(!G.scope){G.success(C);YAHOO.log("Success callback. HTTP code is "+D,"info","Connection");}else{G.success.apply(G.scope,[C]);YAHOO.log("Success callback with scope. HTTP code is "+D,"info","Connection");}}this.successEvent.fire(C);if(F.successEvent){F.successEvent.fire(C);}}else{switch(D){case 12002:case 12029:case 12030:case 12031:case 12152:case 13030:C=this.createExceptionObject(F.tId,B,(A?A:false));if(G&&G.failure){if(!G.scope){G.failure(C);
YAHOO.log("Failure callback. Exception detected. Status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. Exception detected. Status code is "+D,"warn","Connection");}}break;default:C=this.createResponseObject(F,B);if(G&&G.failure){if(!G.scope){G.failure(C);YAHOO.log("Failure callback. HTTP status code is "+D,"warn","Connection");}else{G.failure.apply(G.scope,[C]);YAHOO.log("Failure callback with scope. HTTP status code is "+D,"warn","Connection");}}}this.failureEvent.fire(C);if(F.failureEvent){F.failureEvent.fire(C);}}this.releaseObject(F);C=null;},createResponseObject:function(A,G){var D={};var I={};try{var C=A.conn.getAllResponseHeaders();var F=C.split("\n");for(var E=0;E<F.length;E++){var B=F[E].indexOf(":");if(B!=-1){I[F[E].substring(0,B)]=F[E].substring(B+2);}}}catch(H){}D.tId=A.tId;D.status=(A.conn.status==1223)?204:A.conn.status;D.statusText=(A.conn.status==1223)?"No Content":A.conn.statusText;D.getResponseHeader=I;D.getAllResponseHeaders=C;D.responseText=A.conn.responseText;D.responseXML=A.conn.responseXML;if(G){D.argument=G;}return D;},createExceptionObject:function(H,D,A){var F=0;var G="communication failure";var C=-1;var B="transaction aborted";var E={};E.tId=H;if(A){E.status=C;E.statusText=B;}else{E.status=F;E.statusText=G;}if(D){E.argument=D;}return E;},initHeader:function(A,D,C){var B=(C)?this._default_headers:this._http_headers;B[A]=D;if(C){this._has_default_headers=true;}else{this._has_http_headers=true;}},setHeader:function(A){if(this._has_default_headers){for(var B in this._default_headers){if(YAHOO.lang.hasOwnProperty(this._default_headers,B)){A.conn.setRequestHeader(B,this._default_headers[B]);YAHOO.log("Default HTTP header "+B+" set with value of "+this._default_headers[B],"info","Connection");}}}if(this._has_http_headers){for(var B in this._http_headers){if(YAHOO.lang.hasOwnProperty(this._http_headers,B)){A.conn.setRequestHeader(B,this._http_headers[B]);YAHOO.log("HTTP header "+B+" set with value of "+this._http_headers[B],"info","Connection");}}delete this._http_headers;this._http_headers={};this._has_http_headers=false;}},resetDefaultHeaders:function(){delete this._default_headers;this._default_headers={};this._has_default_headers=false;},setForm:function(K,E,B){this.resetFormState();var J;if(typeof K=="string"){J=(document.getElementById(K)||document.forms[K]);}else{if(typeof K=="object"){J=K;}else{YAHOO.log("Unable to create form object "+K,"warn","Connection");return ;}}if(E){var F=this.createFrame((window.location.href.toLowerCase().indexOf("https")===0||B)?true:false);this._isFormSubmit=true;this._isFileUpload=true;this._formNode=J;return ;}var A,I,G,L;var H=false;for(var D=0;D<J.elements.length;D++){A=J.elements[D];L=A.disabled;I=A.name;G=A.value;if(!L&&I){switch(A.type){case"select-one":case"select-multiple":for(var C=0;C<A.options.length;C++){if(A.options[C].selected){if(window.ActiveXObject){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].attributes["value"].specified?A.options[C].value:A.options[C].text)+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(A.options[C].hasAttribute("value")?A.options[C].value:A.options[C].text)+"&";}}}break;case"radio":case"checkbox":if(A.checked){this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}break;case"file":case undefined:case"reset":case"button":break;case"submit":if(H===false){if(this._hasSubmitListener&&this._submitElementValue){this._sFormData+=this._submitElementValue+"&";}else{this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}H=true;}break;default:this._sFormData+=encodeURIComponent(I)+"="+encodeURIComponent(G)+"&";}}}this._isFormSubmit=true;this._sFormData=this._sFormData.substr(0,this._sFormData.length-1);YAHOO.log("Form initialized for transaction. HTML form POST message is: "+this._sFormData,"info","Connection");this.initHeader("Content-Type",this._default_form_header);YAHOO.log("Initialize header Content-Type to application/x-www-form-urlencoded for setForm() transaction.","info","Connection");return this._sFormData;},resetFormState:function(){this._isFormSubmit=false;this._isFileUpload=false;this._formNode=null;this._sFormData="";},createFrame:function(A){var B="yuiIO"+this._transaction_id;var C;if(window.ActiveXObject){C=document.createElement('<iframe id="'+B+'" name="'+B+'" />');if(typeof A=="boolean"){C.src="javascript:false";}}else{C=document.createElement("iframe");C.id=B;C.name=B;}C.style.position="absolute";C.style.top="-1000px";C.style.left="-1000px";document.body.appendChild(C);YAHOO.log("File upload iframe created. Id is:"+B,"info","Connection");},appendPostData:function(A){var D=[];var B=A.split("&");for(var C=0;C<B.length;C++){var E=B[C].indexOf("=");if(E!=-1){D[C]=document.createElement("input");D[C].type="hidden";D[C].name=B[C].substring(0,E);D[C].value=B[C].substring(E+1);this._formNode.appendChild(D[C]);}}return D;},uploadFile:function(D,M,E,C){var N=this;var H="yuiIO"+D.tId;var I="multipart/form-data";var K=document.getElementById(H);var J=(M&&M.argument)?M.argument:null;var B={action:this._formNode.getAttribute("action"),method:this._formNode.getAttribute("method"),target:this._formNode.getAttribute("target")};this._formNode.setAttribute("action",E);this._formNode.setAttribute("method","POST");this._formNode.setAttribute("target",H);if(YAHOO.env.ua.ie){this._formNode.setAttribute("encoding",I);}else{this._formNode.setAttribute("enctype",I);}if(C){var L=this.appendPostData(C);}this._formNode.submit();this.startEvent.fire(D,J);if(D.startEvent){D.startEvent.fire(D,J);}if(M&&M.timeout){this._timeOut[D.tId]=window.setTimeout(function(){N.abort(D,M,true);},M.timeout);}if(L&&L.length>0){for(var G=0;G<L.length;G++){this._formNode.removeChild(L[G]);}}for(var A in B){if(YAHOO.lang.hasOwnProperty(B,A)){if(B[A]){this._formNode.setAttribute(A,B[A]);}else{this._formNode.removeAttribute(A);}}}this.resetFormState();var F=function(){if(M&&M.timeout){window.clearTimeout(N._timeOut[D.tId]);
delete N._timeOut[D.tId];}N.completeEvent.fire(D,J);if(D.completeEvent){D.completeEvent.fire(D,J);}var P={};P.tId=D.tId;P.argument=M.argument;try{P.responseText=K.contentWindow.document.body?K.contentWindow.document.body.innerHTML:K.contentWindow.document.documentElement.textContent;P.responseXML=K.contentWindow.document.XMLDocument?K.contentWindow.document.XMLDocument:K.contentWindow.document;}catch(O){}if(M&&M.upload){if(!M.scope){M.upload(P);YAHOO.log("Upload callback.","info","Connection");}else{M.upload.apply(M.scope,[P]);YAHOO.log("Upload callback with scope.","info","Connection");}}N.uploadEvent.fire(P);if(D.uploadEvent){D.uploadEvent.fire(P);}YAHOO.util.Event.removeListener(K,"load",F);setTimeout(function(){document.body.removeChild(K);N.releaseObject(D);YAHOO.log("File upload iframe destroyed. Id is:"+H,"info","Connection");},100);};YAHOO.util.Event.addListener(K,"load",F);},abort:function(E,G,A){var D;var B=(G&&G.argument)?G.argument:null;if(E&&E.conn){if(this.isCallInProgress(E)){E.conn.abort();window.clearInterval(this._poll[E.tId]);delete this._poll[E.tId];if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{if(E&&E.isUpload===true){var C="yuiIO"+E.tId;var F=document.getElementById(C);if(F){YAHOO.util.Event.removeListener(F,"load");document.body.removeChild(F);YAHOO.log("File upload iframe destroyed. Id is:"+C,"info","Connection");if(A){window.clearTimeout(this._timeOut[E.tId]);delete this._timeOut[E.tId];}D=true;}}else{D=false;}}if(D===true){this.abortEvent.fire(E,B);if(E.abortEvent){E.abortEvent.fire(E,B);}this.handleTransactionResponse(E,G,true);YAHOO.log("Transaction "+E.tId+" aborted.","info","Connection");}return D;},isCallInProgress:function(B){if(B&&B.conn){return B.conn.readyState!==4&&B.conn.readyState!==0;}else{if(B&&B.isUpload===true){var A="yuiIO"+B.tId;return document.getElementById(A)?true:false;}else{return false;}}},releaseObject:function(A){if(A&&A.conn){A.conn=null;YAHOO.log("Connection object for transaction "+A.tId+" destroyed.","info","Connection");A=null;}}};YAHOO.register("connection",YAHOO.util.Connect,{version:"2.5.2",build:"1076"});(function(){var B=YAHOO.util;var A=function(D,C,E,F){if(!D){}this.init(D,C,E,F);};A.NAME="Anim";A.prototype={toString:function(){var C=this.getEl()||{};var D=C.id||C.tagName;return(this.constructor.NAME+": "+D);},patterns:{noNegatives:/width|height|opacity|padding/i,offsetAttribute:/^((width|height)|(top|left))$/,defaultUnit:/width|height|top$|bottom$|left$|right$/i,offsetUnit:/\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i},doMethod:function(C,E,D){return this.method(this.currentFrame,E,D-E,this.totalFrames);},setAttribute:function(C,E,D){if(this.patterns.noNegatives.test(C)){E=(E>0)?E:0;}B.Dom.setStyle(this.getEl(),C,E+D);},getAttribute:function(C){var E=this.getEl();var G=B.Dom.getStyle(E,C);if(G!=="auto"&&!this.patterns.offsetUnit.test(G)){return parseFloat(G);}var D=this.patterns.offsetAttribute.exec(C)||[];var H=!!(D[3]);var F=!!(D[2]);if(F||(B.Dom.getStyle(E,"position")=="absolute"&&H)){G=E["offset"+D[0].charAt(0).toUpperCase()+D[0].substr(1)];}else{G=0;}return G;},getDefaultUnit:function(C){if(this.patterns.defaultUnit.test(C)){return"px";}return"";},setRuntimeAttribute:function(D){var I;var E;var F=this.attributes;this.runtimeAttributes[D]={};var H=function(J){return(typeof J!=="undefined");};if(!H(F[D]["to"])&&!H(F[D]["by"])){return false;}I=(H(F[D]["from"]))?F[D]["from"]:this.getAttribute(D);if(H(F[D]["to"])){E=F[D]["to"];}else{if(H(F[D]["by"])){if(I.constructor==Array){E=[];for(var G=0,C=I.length;G<C;++G){E[G]=I[G]+F[D]["by"][G]*1;}}else{E=I+F[D]["by"]*1;}}}this.runtimeAttributes[D].start=I;this.runtimeAttributes[D].end=E;this.runtimeAttributes[D].unit=(H(F[D].unit))?F[D]["unit"]:this.getDefaultUnit(D);return true;},init:function(E,J,I,C){var D=false;var F=null;var H=0;E=B.Dom.get(E);this.attributes=J||{};this.duration=!YAHOO.lang.isUndefined(I)?I:1;this.method=C||B.Easing.easeNone;this.useSeconds=true;this.currentFrame=0;this.totalFrames=B.AnimMgr.fps;this.setEl=function(M){E=B.Dom.get(M);};this.getEl=function(){return E;};this.isAnimated=function(){return D;};this.getStartTime=function(){return F;};this.runtimeAttributes={};this.animate=function(){if(this.isAnimated()){return false;}this.currentFrame=0;this.totalFrames=(this.useSeconds)?Math.ceil(B.AnimMgr.fps*this.duration):this.duration;if(this.duration===0&&this.useSeconds){this.totalFrames=1;}B.AnimMgr.registerElement(this);return true;};this.stop=function(M){if(!this.isAnimated()){return false;}if(M){this.currentFrame=this.totalFrames;this._onTween.fire();}B.AnimMgr.stop(this);};var L=function(){this.onStart.fire();this.runtimeAttributes={};for(var M in this.attributes){this.setRuntimeAttribute(M);}D=true;H=0;F=new Date();};var K=function(){var O={duration:new Date()-this.getStartTime(),currentFrame:this.currentFrame};O.toString=function(){return("duration: "+O.duration+", currentFrame: "+O.currentFrame);};this.onTween.fire(O);var N=this.runtimeAttributes;for(var M in N){this.setAttribute(M,this.doMethod(M,N[M].start,N[M].end),N[M].unit);}H+=1;};var G=function(){var M=(new Date()-F)/1000;var N={duration:M,frames:H,fps:H/M};N.toString=function(){return("duration: "+N.duration+", frames: "+N.frames+", fps: "+N.fps);};D=false;H=0;this.onComplete.fire(N);};this._onStart=new B.CustomEvent("_start",this,true);this.onStart=new B.CustomEvent("start",this);this.onTween=new B.CustomEvent("tween",this);this._onTween=new B.CustomEvent("_tween",this,true);this.onComplete=new B.CustomEvent("complete",this);this._onComplete=new B.CustomEvent("_complete",this,true);this._onStart.subscribe(L);this._onTween.subscribe(K);this._onComplete.subscribe(G);}};B.Anim=A;})();YAHOO.util.AnimMgr=new function(){var C=null;var B=[];var A=0;this.fps=1000;this.delay=1;this.registerElement=function(F){B[B.length]=F;A+=1;F._onStart.fire();this.start();};this.unRegister=function(G,F){F=F||E(G);if(!G.isAnimated()||F==-1){return false;}G._onComplete.fire();B.splice(F,1);A-=1;if(A<=0){this.stop();}return true;};this.start=function(){if(C===null){C=setInterval(this.run,this.delay);}};this.stop=function(H){if(!H){clearInterval(C);for(var G=0,F=B.length;G<F;++G){this.unRegister(B[0],0);}B=[];C=null;A=0;}else{this.unRegister(H);}};this.run=function(){for(var H=0,F=B.length;H<F;++H){var G=B[H];if(!G||!G.isAnimated()){continue;}if(G.currentFrame<G.totalFrames||G.totalFrames===null){G.currentFrame+=1;if(G.useSeconds){D(G);}G._onTween.fire();}else{YAHOO.util.AnimMgr.stop(G,H);}}};var E=function(H){for(var G=0,F=B.length;G<F;++G){if(B[G]==H){return G;}}return -1;};var D=function(G){var J=G.totalFrames;var I=G.currentFrame;var H=(G.currentFrame*G.duration*1000/G.totalFrames);var F=(new Date()-G.getStartTime());var K=0;if(F<G.duration*1000){K=Math.round((F/H-1)*G.currentFrame);}else{K=J-(I+1);}if(K>0&&isFinite(K)){if(G.currentFrame+K>=J){K=J-(I+1);}G.currentFrame+=K;}};};YAHOO.util.Bezier=new function(){this.getPosition=function(E,D){var F=E.length;var C=[];for(var B=0;B<F;++B){C[B]=[E[B][0],E[B][1]];}for(var A=1;A<F;++A){for(B=0;B<F-A;++B){C[B][0]=(1-D)*C[B][0]+D*C[parseInt(B+1,10)][0];C[B][1]=(1-D)*C[B][1]+D*C[parseInt(B+1,10)][1];}}return[C[0][0],C[0][1]];};};(function(){var A=function(F,E,G,H){A.superclass.constructor.call(this,F,E,G,H);};A.NAME="ColorAnim";var C=YAHOO.util;YAHOO.extend(A,C.Anim);var D=A.superclass;var B=A.prototype;B.patterns.color=/color$/i;B.patterns.rgb=/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;B.patterns.hex=/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;B.patterns.hex3=/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;B.patterns.transparent=/^transparent|rgba\(0, 0, 0, 0\)$/;B.parseColor=function(E){if(E.length==3){return E;}var F=this.patterns.hex.exec(E);if(F&&F.length==4){return[parseInt(F[1],16),parseInt(F[2],16),parseInt(F[3],16)];}F=this.patterns.rgb.exec(E);if(F&&F.length==4){return[parseInt(F[1],10),parseInt(F[2],10),parseInt(F[3],10)];}F=this.patterns.hex3.exec(E);if(F&&F.length==4){return[parseInt(F[1]+F[1],16),parseInt(F[2]+F[2],16),parseInt(F[3]+F[3],16)];}return null;};B.getAttribute=function(E){var G=this.getEl();if(this.patterns.color.test(E)){var H=YAHOO.util.Dom.getStyle(G,E);
if(this.patterns.transparent.test(H)){var F=G.parentNode;H=C.Dom.getStyle(F,E);while(F&&this.patterns.transparent.test(H)){F=F.parentNode;H=C.Dom.getStyle(F,E);if(F.tagName.toUpperCase()=="HTML"){H="#fff";}}}}else{H=D.getAttribute.call(this,E);}return H;};B.doMethod=function(F,J,G){var I;if(this.patterns.color.test(F)){I=[];for(var H=0,E=J.length;H<E;++H){I[H]=D.doMethod.call(this,F,J[H],G[H]);}I="rgb("+Math.floor(I[0])+","+Math.floor(I[1])+","+Math.floor(I[2])+")";}else{I=D.doMethod.call(this,F,J,G);}return I;};B.setRuntimeAttribute=function(F){D.setRuntimeAttribute.call(this,F);if(this.patterns.color.test(F)){var H=this.attributes;var J=this.parseColor(this.runtimeAttributes[F].start);var G=this.parseColor(this.runtimeAttributes[F].end);if(typeof H[F]["to"]==="undefined"&&typeof H[F]["by"]!=="undefined"){G=this.parseColor(H[F].by);for(var I=0,E=J.length;I<E;++I){G[I]=J[I]+G[I];}}this.runtimeAttributes[F].start=J;this.runtimeAttributes[F].end=G;}};C.ColorAnim=A;})();
/*
TERMS OF USE - EASING EQUATIONS
Open source under the BSD License.
Copyright 2001 Robert Penner All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
YAHOO.util.Easing={easeNone:function(B,A,D,C){return D*B/C+A;},easeIn:function(B,A,D,C){return D*(B/=C)*B+A;},easeOut:function(B,A,D,C){return -D*(B/=C)*(B-2)+A;},easeBoth:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B+A;}return -D/2*((--B)*(B-2)-1)+A;},easeInStrong:function(B,A,D,C){return D*(B/=C)*B*B*B+A;},easeOutStrong:function(B,A,D,C){return -D*((B=B/C-1)*B*B*B-1)+A;},easeBothStrong:function(B,A,D,C){if((B/=C/2)<1){return D/2*B*B*B*B+A;}return -D/2*((B-=2)*B*B*B-2)+A;},elasticIn:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return -(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;},elasticOut:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F)==1){return A+G;}if(!E){E=F*0.3;}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}return B*Math.pow(2,-10*C)*Math.sin((C*F-D)*(2*Math.PI)/E)+G+A;},elasticBoth:function(C,A,G,F,B,E){if(C==0){return A;}if((C/=F/2)==2){return A+G;}if(!E){E=F*(0.3*1.5);}if(!B||B<Math.abs(G)){B=G;var D=E/4;}else{var D=E/(2*Math.PI)*Math.asin(G/B);}if(C<1){return -0.5*(B*Math.pow(2,10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E))+A;}return B*Math.pow(2,-10*(C-=1))*Math.sin((C*F-D)*(2*Math.PI)/E)*0.5+G+A;},backIn:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*(B/=D)*B*((C+1)*B-C)+A;},backOut:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}return E*((B=B/D-1)*B*((C+1)*B+C)+1)+A;},backBoth:function(B,A,E,D,C){if(typeof C=="undefined"){C=1.70158;}if((B/=D/2)<1){return E/2*(B*B*(((C*=(1.525))+1)*B-C))+A;}return E/2*((B-=2)*B*(((C*=(1.525))+1)*B+C)+2)+A;},bounceIn:function(B,A,D,C){return D-YAHOO.util.Easing.bounceOut(C-B,0,D,C)+A;},bounceOut:function(B,A,D,C){if((B/=C)<(1/2.75)){return D*(7.5625*B*B)+A;}else{if(B<(2/2.75)){return D*(7.5625*(B-=(1.5/2.75))*B+0.75)+A;}else{if(B<(2.5/2.75)){return D*(7.5625*(B-=(2.25/2.75))*B+0.9375)+A;}}}return D*(7.5625*(B-=(2.625/2.75))*B+0.984375)+A;},bounceBoth:function(B,A,D,C){if(B<C/2){return YAHOO.util.Easing.bounceIn(B*2,0,D,C)*0.5+A;}return YAHOO.util.Easing.bounceOut(B*2-C,0,D,C)*0.5+D*0.5+A;}};(function(){var A=function(H,G,I,J){if(H){A.superclass.constructor.call(this,H,G,I,J);}};A.NAME="Motion";var E=YAHOO.util;YAHOO.extend(A,E.ColorAnim);var F=A.superclass;var C=A.prototype;C.patterns.points=/^points$/i;C.setAttribute=function(G,I,H){if(this.patterns.points.test(G)){H=H||"px";F.setAttribute.call(this,"left",I[0],H);F.setAttribute.call(this,"top",I[1],H);}else{F.setAttribute.call(this,G,I,H);}};C.getAttribute=function(G){if(this.patterns.points.test(G)){var H=[F.getAttribute.call(this,"left"),F.getAttribute.call(this,"top")];}else{H=F.getAttribute.call(this,G);}return H;};C.doMethod=function(G,K,H){var J=null;if(this.patterns.points.test(G)){var I=this.method(this.currentFrame,0,100,this.totalFrames)/100;J=E.Bezier.getPosition(this.runtimeAttributes[G],I);}else{J=F.doMethod.call(this,G,K,H);}return J;};C.setRuntimeAttribute=function(P){if(this.patterns.points.test(P)){var H=this.getEl();var J=this.attributes;var G;var L=J["points"]["control"]||[];var I;var M,O;if(L.length>0&&!(L[0] instanceof Array)){L=[L];}else{var K=[];for(M=0,O=L.length;M<O;++M){K[M]=L[M];}L=K;}if(E.Dom.getStyle(H,"position")=="static"){E.Dom.setStyle(H,"position","relative");}if(D(J["points"]["from"])){E.Dom.setXY(H,J["points"]["from"]);}else{E.Dom.setXY(H,E.Dom.getXY(H));}G=this.getAttribute("points");if(D(J["points"]["to"])){I=B.call(this,J["points"]["to"],G);
var N=E.Dom.getXY(this.getEl());for(M=0,O=L.length;M<O;++M){L[M]=B.call(this,L[M],G);}}else{if(D(J["points"]["by"])){I=[G[0]+J["points"]["by"][0],G[1]+J["points"]["by"][1]];for(M=0,O=L.length;M<O;++M){L[M]=[G[0]+L[M][0],G[1]+L[M][1]];}}}this.runtimeAttributes[P]=[G];if(L.length>0){this.runtimeAttributes[P]=this.runtimeAttributes[P].concat(L);}this.runtimeAttributes[P][this.runtimeAttributes[P].length]=I;}else{F.setRuntimeAttribute.call(this,P);}};var B=function(G,I){var H=E.Dom.getXY(this.getEl());G=[G[0]-H[0]+I[0],G[1]-H[1]+I[1]];return G;};var D=function(G){return(typeof G!=="undefined");};E.Motion=A;})();(function(){var D=function(F,E,G,H){if(F){D.superclass.constructor.call(this,F,E,G,H);}};D.NAME="Scroll";var B=YAHOO.util;YAHOO.extend(D,B.ColorAnim);var C=D.superclass;var A=D.prototype;A.doMethod=function(E,H,F){var G=null;if(E=="scroll"){G=[this.method(this.currentFrame,H[0],F[0]-H[0],this.totalFrames),this.method(this.currentFrame,H[1],F[1]-H[1],this.totalFrames)];}else{G=C.doMethod.call(this,E,H,F);}return G;};A.getAttribute=function(E){var G=null;var F=this.getEl();if(E=="scroll"){G=[F.scrollLeft,F.scrollTop];}else{G=C.getAttribute.call(this,E);}return G;};A.setAttribute=function(E,H,G){var F=this.getEl();if(E=="scroll"){F.scrollLeft=H[0];F.scrollTop=H[1];}else{C.setAttribute.call(this,E,H,G);}};B.Scroll=D;})();YAHOO.register("animation",YAHOO.util.Anim,{version:"2.5.2",build:"1076"});if(!YAHOO.util.DragDropMgr){YAHOO.util.DragDropMgr=function(){var A=YAHOO.util.Event;return{ids:{},handleIds:{},dragCurrent:null,dragOvers:{},deltaX:0,deltaY:0,preventDefault:true,stopPropagation:true,initialized:false,locked:false,interactionInfo:null,init:function(){this.initialized=true;},POINT:0,INTERSECT:1,STRICT_INTERSECT:2,mode:0,_execOnAll:function(D,C){for(var E in this.ids){for(var B in this.ids[E]){var F=this.ids[E][B];if(!this.isTypeOfDD(F)){continue;}F[D].apply(F,C);}}},_onLoad:function(){this.init();A.on(document,"mouseup",this.handleMouseUp,this,true);A.on(document,"mousemove",this.handleMouseMove,this,true);A.on(window,"unload",this._onUnload,this,true);A.on(window,"resize",this._onResize,this,true);},_onResize:function(B){this._execOnAll("resetConstraints",[]);},lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isLocked:function(){return this.locked;},locationCache:{},useCache:true,clickPixelThresh:3,clickTimeThresh:1000,dragThreshMet:false,clickTimeout:null,startX:0,startY:0,fromTimeout:false,regDragDrop:function(C,B){if(!this.initialized){this.init();}if(!this.ids[B]){this.ids[B]={};}this.ids[B][C.id]=C;},removeDDFromGroup:function(D,B){if(!this.ids[B]){this.ids[B]={};}var C=this.ids[B];if(C&&C[D.id]){delete C[D.id];}},_remove:function(C){for(var B in C.groups){if(B&&this.ids[B][C.id]){delete this.ids[B][C.id];}}delete this.handleIds[C.id];},regHandle:function(C,B){if(!this.handleIds[C]){this.handleIds[C]={};}this.handleIds[C][B]=B;},isDragDrop:function(B){return(this.getDDById(B))?true:false;},getRelated:function(G,C){var F=[];for(var E in G.groups){for(var D in this.ids[E]){var B=this.ids[E][D];if(!this.isTypeOfDD(B)){continue;}if(!C||B.isTarget){F[F.length]=B;}}}return F;},isLegalTarget:function(F,E){var C=this.getRelated(F,true);for(var D=0,B=C.length;D<B;++D){if(C[D].id==E.id){return true;}}return false;},isTypeOfDD:function(B){return(B&&B.__ygDragDrop);},isHandle:function(C,B){return(this.handleIds[C]&&this.handleIds[C][B]);},getDDById:function(C){for(var B in this.ids){if(this.ids[B][C]){return this.ids[B][C];}}return null;},handleMouseDown:function(D,C){this.currentTarget=YAHOO.util.Event.getTarget(D);this.dragCurrent=C;var B=C.getEl();this.startX=YAHOO.util.Event.getPageX(D);this.startY=YAHOO.util.Event.getPageY(D);this.deltaX=this.startX-B.offsetLeft;this.deltaY=this.startY-B.offsetTop;this.dragThreshMet=false;this.clickTimeout=setTimeout(function(){var E=YAHOO.util.DDM;E.startDrag(E.startX,E.startY);E.fromTimeout=true;},this.clickTimeThresh);},startDrag:function(B,D){clearTimeout(this.clickTimeout);var C=this.dragCurrent;if(C&&C.events.b4StartDrag){C.b4StartDrag(B,D);C.fireEvent("b4StartDragEvent",{x:B,y:D});}if(C&&C.events.startDrag){C.startDrag(B,D);C.fireEvent("startDragEvent",{x:B,y:D});}this.dragThreshMet=true;},handleMouseUp:function(B){if(this.dragCurrent){clearTimeout(this.clickTimeout);if(this.dragThreshMet){if(this.fromTimeout){this.fromTimeout=false;this.handleMouseMove(B);}this.fromTimeout=false;this.fireEvents(B,true);}else{}this.stopDrag(B);this.stopEvent(B);}},stopEvent:function(B){if(this.stopPropagation){YAHOO.util.Event.stopPropagation(B);}if(this.preventDefault){YAHOO.util.Event.preventDefault(B);}},stopDrag:function(D,C){var B=this.dragCurrent;if(B&&!C){if(this.dragThreshMet){if(B.events.b4EndDrag){B.b4EndDrag(D);B.fireEvent("b4EndDragEvent",{e:D});}if(B.events.endDrag){B.endDrag(D);B.fireEvent("endDragEvent",{e:D});}}if(B.events.mouseUp){B.onMouseUp(D);B.fireEvent("mouseUpEvent",{e:D});}}this.dragCurrent=null;this.dragOvers={};},handleMouseMove:function(E){var B=this.dragCurrent;if(B){if(YAHOO.util.Event.isIE&&!E.button){this.stopEvent(E);return this.handleMouseUp(E);}else{if(E.clientX<0||E.clientY<0){}}if(!this.dragThreshMet){var D=Math.abs(this.startX-YAHOO.util.Event.getPageX(E));var C=Math.abs(this.startY-YAHOO.util.Event.getPageY(E));if(D>this.clickPixelThresh||C>this.clickPixelThresh){this.startDrag(this.startX,this.startY);}}if(this.dragThreshMet){if(B&&B.events.b4Drag){B.b4Drag(E);B.fireEvent("b4DragEvent",{e:E});}if(B&&B.events.drag){B.onDrag(E);B.fireEvent("dragEvent",{e:E});}if(B){this.fireEvents(E,false);}}this.stopEvent(E);}},fireEvents:function(U,K){var Z=this.dragCurrent;if(!Z||Z.isLocked()||Z.dragOnly){return ;}var M=YAHOO.util.Event.getPageX(U),L=YAHOO.util.Event.getPageY(U),O=new YAHOO.util.Point(M,L),J=Z.getTargetCoord(O.x,O.y),E=Z.getDragEl(),D=["out","over","drop","enter"],T=new YAHOO.util.Region(J.y,J.x+E.offsetWidth,J.y+E.offsetHeight,J.x),H=[],C={},P=[],a={outEvts:[],overEvts:[],dropEvts:[],enterEvts:[]};for(var R in this.dragOvers){var c=this.dragOvers[R];if(!this.isTypeOfDD(c)){continue;}if(!this.isOverTarget(O,c,this.mode,T)){a.outEvts.push(c);}H[R]=true;delete this.dragOvers[R];}for(var Q in Z.groups){if("string"!=typeof Q){continue;}for(R in this.ids[Q]){var F=this.ids[Q][R];if(!this.isTypeOfDD(F)){continue;}if(F.isTarget&&!F.isLocked()&&F!=Z){if(this.isOverTarget(O,F,this.mode,T)){C[Q]=true;if(K){a.dropEvts.push(F);}else{if(!H[F.id]){a.enterEvts.push(F);}else{a.overEvts.push(F);}this.dragOvers[F.id]=F;}}}}}this.interactionInfo={out:a.outEvts,enter:a.enterEvts,over:a.overEvts,drop:a.dropEvts,point:O,draggedRegion:T,sourceRegion:this.locationCache[Z.id],validDrop:K};for(var B in C){P.push(B);}if(K&&!a.dropEvts.length){this.interactionInfo.validDrop=false;if(Z.events.invalidDrop){Z.onInvalidDrop(U);Z.fireEvent("invalidDropEvent",{e:U});}}for(R=0;R<D.length;R++){var X=null;if(a[D[R]+"Evts"]){X=a[D[R]+"Evts"];}if(X&&X.length){var G=D[R].charAt(0).toUpperCase()+D[R].substr(1),W="onDrag"+G,I="b4Drag"+G,N="drag"+G+"Event",V="drag"+G;if(this.mode){if(Z.events[I]){Z[I](U,X,P);Z.fireEvent(I+"Event",{event:U,info:X,group:P});}if(Z.events[V]){Z[W](U,X,P);Z.fireEvent(N,{event:U,info:X,group:P});}}else{for(var Y=0,S=X.length;Y<S;++Y){if(Z.events[I]){Z[I](U,X[Y].id,P[0]);Z.fireEvent(I+"Event",{event:U,info:X[Y].id,group:P[0]});}if(Z.events[V]){Z[W](U,X[Y].id,P[0]);Z.fireEvent(N,{event:U,info:X[Y].id,group:P[0]});
}}}}}},getBestMatch:function(D){var F=null;var C=D.length;if(C==1){F=D[0];}else{for(var E=0;E<C;++E){var B=D[E];if(this.mode==this.INTERSECT&&B.cursorIsOver){F=B;break;}else{if(!F||!F.overlap||(B.overlap&&F.overlap.getArea()<B.overlap.getArea())){F=B;}}}}return F;},refreshCache:function(C){var E=C||this.ids;for(var B in E){if("string"!=typeof B){continue;}for(var D in this.ids[B]){var F=this.ids[B][D];if(this.isTypeOfDD(F)){var G=this.getLocation(F);if(G){this.locationCache[F.id]=G;}else{delete this.locationCache[F.id];}}}}},verifyEl:function(C){try{if(C){var B=C.offsetParent;if(B){return true;}}}catch(D){}return false;},getLocation:function(G){if(!this.isTypeOfDD(G)){return null;}var E=G.getEl(),J,D,C,L,K,M,B,I,F;try{J=YAHOO.util.Dom.getXY(E);}catch(H){}if(!J){return null;}D=J[0];C=D+E.offsetWidth;L=J[1];K=L+E.offsetHeight;M=L-G.padding[0];B=C+G.padding[1];I=K+G.padding[2];F=D-G.padding[3];return new YAHOO.util.Region(M,B,I,F);},isOverTarget:function(J,B,D,E){var F=this.locationCache[B.id];if(!F||!this.useCache){F=this.getLocation(B);this.locationCache[B.id]=F;}if(!F){return false;}B.cursorIsOver=F.contains(J);var I=this.dragCurrent;if(!I||(!D&&!I.constrainX&&!I.constrainY)){return B.cursorIsOver;}B.overlap=null;if(!E){var G=I.getTargetCoord(J.x,J.y);var C=I.getDragEl();E=new YAHOO.util.Region(G.y,G.x+C.offsetWidth,G.y+C.offsetHeight,G.x);}var H=E.intersect(F);if(H){B.overlap=H;return(D)?true:B.cursorIsOver;}else{return false;}},_onUnload:function(C,B){this.unregAll();},unregAll:function(){if(this.dragCurrent){this.stopDrag();this.dragCurrent=null;}this._execOnAll("unreg",[]);this.ids={};},elementCache:{},getElWrapper:function(C){var B=this.elementCache[C];if(!B||!B.el){B=this.elementCache[C]=new this.ElementWrapper(YAHOO.util.Dom.get(C));}return B;},getElement:function(B){return YAHOO.util.Dom.get(B);},getCss:function(C){var B=YAHOO.util.Dom.get(C);return(B)?B.style:null;},ElementWrapper:function(B){this.el=B||null;this.id=this.el&&B.id;this.css=this.el&&B.style;},getPosX:function(B){return YAHOO.util.Dom.getX(B);},getPosY:function(B){return YAHOO.util.Dom.getY(B);},swapNode:function(D,B){if(D.swapNode){D.swapNode(B);}else{var E=B.parentNode;var C=B.nextSibling;if(C==D){E.insertBefore(D,B);}else{if(B==D.nextSibling){E.insertBefore(B,D);}else{D.parentNode.replaceChild(B,D);E.insertBefore(D,C);}}}},getScroll:function(){var D,B,E=document.documentElement,C=document.body;if(E&&(E.scrollTop||E.scrollLeft)){D=E.scrollTop;B=E.scrollLeft;}else{if(C){D=C.scrollTop;B=C.scrollLeft;}else{}}return{top:D,left:B};},getStyle:function(C,B){return YAHOO.util.Dom.getStyle(C,B);},getScrollTop:function(){return this.getScroll().top;},getScrollLeft:function(){return this.getScroll().left;},moveToEl:function(B,D){var C=YAHOO.util.Dom.getXY(D);YAHOO.util.Dom.setXY(B,C);},getClientHeight:function(){return YAHOO.util.Dom.getViewportHeight();},getClientWidth:function(){return YAHOO.util.Dom.getViewportWidth();},numericSort:function(C,B){return(C-B);},_timeoutCount:0,_addListeners:function(){var B=YAHOO.util.DDM;if(YAHOO.util.Event&&document){B._onLoad();}else{if(B._timeoutCount>2000){}else{setTimeout(B._addListeners,10);if(document&&document.body){B._timeoutCount+=1;}}}},handleWasClicked:function(B,D){if(this.isHandle(D,B.id)){return true;}else{var C=B.parentNode;while(C){if(this.isHandle(D,C.id)){return true;}else{C=C.parentNode;}}}return false;}};}();YAHOO.util.DDM=YAHOO.util.DragDropMgr;YAHOO.util.DDM._addListeners();}(function(){var A=YAHOO.util.Event;var B=YAHOO.util.Dom;YAHOO.util.DragDrop=function(E,C,D){if(E){this.init(E,C,D);}};YAHOO.util.DragDrop.prototype={events:null,on:function(){this.subscribe.apply(this,arguments);},id:null,config:null,dragElId:null,handleElId:null,invalidHandleTypes:null,invalidHandleIds:null,invalidHandleClasses:null,startPageX:0,startPageY:0,groups:null,locked:false,lock:function(){this.locked=true;},unlock:function(){this.locked=false;},isTarget:true,padding:null,dragOnly:false,_domRef:null,__ygDragDrop:true,constrainX:false,constrainY:false,minX:0,maxX:0,minY:0,maxY:0,deltaX:0,deltaY:0,maintainOffset:false,xTicks:null,yTicks:null,primaryButtonOnly:true,available:false,hasOuterHandles:false,cursorIsOver:false,overlap:null,b4StartDrag:function(C,D){},startDrag:function(C,D){},b4Drag:function(C){},onDrag:function(C){},onDragEnter:function(C,D){},b4DragOver:function(C){},onDragOver:function(C,D){},b4DragOut:function(C){},onDragOut:function(C,D){},b4DragDrop:function(C){},onDragDrop:function(C,D){},onInvalidDrop:function(C){},b4EndDrag:function(C){},endDrag:function(C){},b4MouseDown:function(C){},onMouseDown:function(C){},onMouseUp:function(C){},onAvailable:function(){},getEl:function(){if(!this._domRef){this._domRef=B.get(this.id);}return this._domRef;},getDragEl:function(){return B.get(this.dragElId);},init:function(F,C,D){this.initTarget(F,C,D);A.on(this._domRef||this.id,"mousedown",this.handleMouseDown,this,true);for(var E in this.events){this.createEvent(E+"Event");}},initTarget:function(E,C,D){this.config=D||{};this.events={};this.DDM=YAHOO.util.DDM;this.groups={};if(typeof E!=="string"){this._domRef=E;E=B.generateId(E);}this.id=E;this.addToGroup((C)?C:"default");this.handleElId=E;A.onAvailable(E,this.handleOnAvailable,this,true);this.setDragElId(E);this.invalidHandleTypes={A:"A"};this.invalidHandleIds={};this.invalidHandleClasses=[];this.applyConfig();},applyConfig:function(){this.events={mouseDown:true,b4MouseDown:true,mouseUp:true,b4StartDrag:true,startDrag:true,b4EndDrag:true,endDrag:true,drag:true,b4Drag:true,invalidDrop:true,b4DragOut:true,dragOut:true,dragEnter:true,b4DragOver:true,dragOver:true,b4DragDrop:true,dragDrop:true};if(this.config.events){for(var C in this.config.events){if(this.config.events[C]===false){this.events[C]=false;}}}this.padding=this.config.padding||[0,0,0,0];this.isTarget=(this.config.isTarget!==false);this.maintainOffset=(this.config.maintainOffset);this.primaryButtonOnly=(this.config.primaryButtonOnly!==false);this.dragOnly=((this.config.dragOnly===true)?true:false);
},handleOnAvailable:function(){this.available=true;this.resetConstraints();this.onAvailable();},setPadding:function(E,C,F,D){if(!C&&0!==C){this.padding=[E,E,E,E];}else{if(!F&&0!==F){this.padding=[E,C,E,C];}else{this.padding=[E,C,F,D];}}},setInitPosition:function(F,E){var G=this.getEl();if(!this.DDM.verifyEl(G)){if(G&&G.style&&(G.style.display=="none")){}else{}return ;}var D=F||0;var C=E||0;var H=B.getXY(G);this.initPageX=H[0]-D;this.initPageY=H[1]-C;this.lastPageX=H[0];this.lastPageY=H[1];this.setStartPosition(H);},setStartPosition:function(D){var C=D||B.getXY(this.getEl());this.deltaSetXY=null;this.startPageX=C[0];this.startPageY=C[1];},addToGroup:function(C){this.groups[C]=true;this.DDM.regDragDrop(this,C);},removeFromGroup:function(C){if(this.groups[C]){delete this.groups[C];}this.DDM.removeDDFromGroup(this,C);},setDragElId:function(C){this.dragElId=C;},setHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.handleElId=C;this.DDM.regHandle(this.id,C);},setOuterHandleElId:function(C){if(typeof C!=="string"){C=B.generateId(C);}A.on(C,"mousedown",this.handleMouseDown,this,true);this.setHandleElId(C);this.hasOuterHandles=true;},unreg:function(){A.removeListener(this.id,"mousedown",this.handleMouseDown);this._domRef=null;this.DDM._remove(this);},isLocked:function(){return(this.DDM.isLocked()||this.locked);},handleMouseDown:function(H,G){var D=H.which||H.button;if(this.primaryButtonOnly&&D>1){return ;}if(this.isLocked()){return ;}var C=this.b4MouseDown(H);if(this.events.b4MouseDown){C=this.fireEvent("b4MouseDownEvent",H);}var E=this.onMouseDown(H);if(this.events.mouseDown){E=this.fireEvent("mouseDownEvent",H);}if((C===false)||(E===false)){return ;}this.DDM.refreshCache(this.groups);var F=new YAHOO.util.Point(A.getPageX(H),A.getPageY(H));if(!this.hasOuterHandles&&!this.DDM.isOverTarget(F,this)){}else{if(this.clickValidator(H)){this.setStartPosition();this.DDM.handleMouseDown(H,this);this.DDM.stopEvent(H);}else{}}},clickValidator:function(D){var C=YAHOO.util.Event.getTarget(D);return(this.isValidHandleChild(C)&&(this.id==this.handleElId||this.DDM.handleWasClicked(C,this.id)));},getTargetCoord:function(E,D){var C=E-this.deltaX;var F=D-this.deltaY;if(this.constrainX){if(C<this.minX){C=this.minX;}if(C>this.maxX){C=this.maxX;}}if(this.constrainY){if(F<this.minY){F=this.minY;}if(F>this.maxY){F=this.maxY;}}C=this.getTick(C,this.xTicks);F=this.getTick(F,this.yTicks);return{x:C,y:F};},addInvalidHandleType:function(C){var D=C.toUpperCase();this.invalidHandleTypes[D]=D;},addInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}this.invalidHandleIds[C]=C;},addInvalidHandleClass:function(C){this.invalidHandleClasses.push(C);},removeInvalidHandleType:function(C){var D=C.toUpperCase();delete this.invalidHandleTypes[D];},removeInvalidHandleId:function(C){if(typeof C!=="string"){C=B.generateId(C);}delete this.invalidHandleIds[C];},removeInvalidHandleClass:function(D){for(var E=0,C=this.invalidHandleClasses.length;E<C;++E){if(this.invalidHandleClasses[E]==D){delete this.invalidHandleClasses[E];}}},isValidHandleChild:function(F){var E=true;var H;try{H=F.nodeName.toUpperCase();}catch(G){H=F.nodeName;}E=E&&!this.invalidHandleTypes[H];E=E&&!this.invalidHandleIds[F.id];for(var D=0,C=this.invalidHandleClasses.length;E&&D<C;++D){E=!B.hasClass(F,this.invalidHandleClasses[D]);}return E;},setXTicks:function(F,C){this.xTicks=[];this.xTickSize=C;var E={};for(var D=this.initPageX;D>=this.minX;D=D-C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}for(D=this.initPageX;D<=this.maxX;D=D+C){if(!E[D]){this.xTicks[this.xTicks.length]=D;E[D]=true;}}this.xTicks.sort(this.DDM.numericSort);},setYTicks:function(F,C){this.yTicks=[];this.yTickSize=C;var E={};for(var D=this.initPageY;D>=this.minY;D=D-C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}for(D=this.initPageY;D<=this.maxY;D=D+C){if(!E[D]){this.yTicks[this.yTicks.length]=D;E[D]=true;}}this.yTicks.sort(this.DDM.numericSort);},setXConstraint:function(E,D,C){this.leftConstraint=parseInt(E,10);this.rightConstraint=parseInt(D,10);this.minX=this.initPageX-this.leftConstraint;this.maxX=this.initPageX+this.rightConstraint;if(C){this.setXTicks(this.initPageX,C);}this.constrainX=true;},clearConstraints:function(){this.constrainX=false;this.constrainY=false;this.clearTicks();},clearTicks:function(){this.xTicks=null;this.yTicks=null;this.xTickSize=0;this.yTickSize=0;},setYConstraint:function(C,E,D){this.topConstraint=parseInt(C,10);this.bottomConstraint=parseInt(E,10);this.minY=this.initPageY-this.topConstraint;this.maxY=this.initPageY+this.bottomConstraint;if(D){this.setYTicks(this.initPageY,D);}this.constrainY=true;},resetConstraints:function(){if(this.initPageX||this.initPageX===0){var D=(this.maintainOffset)?this.lastPageX-this.initPageX:0;var C=(this.maintainOffset)?this.lastPageY-this.initPageY:0;this.setInitPosition(D,C);}else{this.setInitPosition();}if(this.constrainX){this.setXConstraint(this.leftConstraint,this.rightConstraint,this.xTickSize);}if(this.constrainY){this.setYConstraint(this.topConstraint,this.bottomConstraint,this.yTickSize);}},getTick:function(I,F){if(!F){return I;}else{if(F[0]>=I){return F[0];}else{for(var D=0,C=F.length;D<C;++D){var E=D+1;if(F[E]&&F[E]>=I){var H=I-F[D];var G=F[E]-I;return(G>H)?F[D]:F[E];}}return F[F.length-1];}}},toString:function(){return("DragDrop "+this.id);}};YAHOO.augment(YAHOO.util.DragDrop,YAHOO.util.EventProvider);})();YAHOO.util.DD=function(C,A,B){if(C){this.init(C,A,B);}};YAHOO.extend(YAHOO.util.DD,YAHOO.util.DragDrop,{scroll:true,autoOffset:function(C,B){var A=C-this.startPageX;var D=B-this.startPageY;this.setDelta(A,D);},setDelta:function(B,A){this.deltaX=B;this.deltaY=A;},setDragElPos:function(C,B){var A=this.getDragEl();this.alignElWithMouse(A,C,B);},alignElWithMouse:function(C,G,F){var E=this.getTargetCoord(G,F);if(!this.deltaSetXY){var H=[E.x,E.y];YAHOO.util.Dom.setXY(C,H);var D=parseInt(YAHOO.util.Dom.getStyle(C,"left"),10);var B=parseInt(YAHOO.util.Dom.getStyle(C,"top"),10);this.deltaSetXY=[D-E.x,B-E.y];
}else{YAHOO.util.Dom.setStyle(C,"left",(E.x+this.deltaSetXY[0])+"px");YAHOO.util.Dom.setStyle(C,"top",(E.y+this.deltaSetXY[1])+"px");}this.cachePosition(E.x,E.y);var A=this;setTimeout(function(){A.autoScroll.call(A,E.x,E.y,C.offsetHeight,C.offsetWidth);},0);},cachePosition:function(B,A){if(B){this.lastPageX=B;this.lastPageY=A;}else{var C=YAHOO.util.Dom.getXY(this.getEl());this.lastPageX=C[0];this.lastPageY=C[1];}},autoScroll:function(J,I,E,K){if(this.scroll){var L=this.DDM.getClientHeight();var B=this.DDM.getClientWidth();var N=this.DDM.getScrollTop();var D=this.DDM.getScrollLeft();var H=E+I;var M=K+J;var G=(L+N-I-this.deltaY);var F=(B+D-J-this.deltaX);var C=40;var A=(document.all)?80:30;if(H>L&&G<C){window.scrollTo(D,N+A);}if(I<N&&N>0&&I-N<C){window.scrollTo(D,N-A);}if(M>B&&F<C){window.scrollTo(D+A,N);}if(J<D&&D>0&&J-D<C){window.scrollTo(D-A,N);}}},applyConfig:function(){YAHOO.util.DD.superclass.applyConfig.call(this);this.scroll=(this.config.scroll!==false);},b4MouseDown:function(A){this.setStartPosition();this.autoOffset(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},b4Drag:function(A){this.setDragElPos(YAHOO.util.Event.getPageX(A),YAHOO.util.Event.getPageY(A));},toString:function(){return("DD "+this.id);}});YAHOO.util.DDProxy=function(C,A,B){if(C){this.init(C,A,B);this.initFrame();}};YAHOO.util.DDProxy.dragElId="ygddfdiv";YAHOO.extend(YAHOO.util.DDProxy,YAHOO.util.DD,{resizeFrame:true,centerFrame:false,createFrame:function(){var B=this,A=document.body;if(!A||!A.firstChild){setTimeout(function(){B.createFrame();},50);return ;}var G=this.getDragEl(),E=YAHOO.util.Dom;if(!G){G=document.createElement("div");G.id=this.dragElId;var D=G.style;D.position="absolute";D.visibility="hidden";D.cursor="move";D.border="2px solid #aaa";D.zIndex=999;D.height="25px";D.width="25px";var C=document.createElement("div");E.setStyle(C,"height","100%");E.setStyle(C,"width","100%");E.setStyle(C,"background-color","#ccc");E.setStyle(C,"opacity","0");G.appendChild(C);if(YAHOO.env.ua.ie){var F=document.createElement("iframe");F.setAttribute("src","javascript:");F.setAttribute("scrolling","no");F.setAttribute("frameborder","0");G.insertBefore(F,G.firstChild);E.setStyle(F,"height","100%");E.setStyle(F,"width","100%");E.setStyle(F,"position","absolute");E.setStyle(F,"top","0");E.setStyle(F,"left","0");E.setStyle(F,"opacity","0");E.setStyle(F,"zIndex","-1");E.setStyle(F.nextSibling,"zIndex","2");}A.insertBefore(G,A.firstChild);}},initFrame:function(){this.createFrame();},applyConfig:function(){YAHOO.util.DDProxy.superclass.applyConfig.call(this);this.resizeFrame=(this.config.resizeFrame!==false);this.centerFrame=(this.config.centerFrame);this.setDragElId(this.config.dragElId||YAHOO.util.DDProxy.dragElId);},showFrame:function(E,D){var C=this.getEl();var A=this.getDragEl();var B=A.style;this._resizeProxy();if(this.centerFrame){this.setDelta(Math.round(parseInt(B.width,10)/2),Math.round(parseInt(B.height,10)/2));}this.setDragElPos(E,D);YAHOO.util.Dom.setStyle(A,"visibility","visible");},_resizeProxy:function(){if(this.resizeFrame){var H=YAHOO.util.Dom;var B=this.getEl();var C=this.getDragEl();var G=parseInt(H.getStyle(C,"borderTopWidth"),10);var I=parseInt(H.getStyle(C,"borderRightWidth"),10);var F=parseInt(H.getStyle(C,"borderBottomWidth"),10);var D=parseInt(H.getStyle(C,"borderLeftWidth"),10);if(isNaN(G)){G=0;}if(isNaN(I)){I=0;}if(isNaN(F)){F=0;}if(isNaN(D)){D=0;}var E=Math.max(0,B.offsetWidth-I-D);var A=Math.max(0,B.offsetHeight-G-F);H.setStyle(C,"width",E+"px");H.setStyle(C,"height",A+"px");}},b4MouseDown:function(B){this.setStartPosition();var A=YAHOO.util.Event.getPageX(B);var C=YAHOO.util.Event.getPageY(B);this.autoOffset(A,C);},b4StartDrag:function(A,B){this.showFrame(A,B);},b4EndDrag:function(A){YAHOO.util.Dom.setStyle(this.getDragEl(),"visibility","hidden");},endDrag:function(D){var C=YAHOO.util.Dom;var B=this.getEl();var A=this.getDragEl();C.setStyle(A,"visibility","");C.setStyle(B,"visibility","hidden");YAHOO.util.DDM.moveToEl(B,A);C.setStyle(A,"visibility","hidden");C.setStyle(B,"visibility","");},toString:function(){return("DDProxy "+this.id);}});YAHOO.util.DDTarget=function(C,A,B){if(C){this.initTarget(C,A,B);}};YAHOO.extend(YAHOO.util.DDTarget,YAHOO.util.DragDrop,{toString:function(){return("DDTarget "+this.id);}});YAHOO.register("dragdrop",YAHOO.util.DragDropMgr,{version:"2.5.2",build:"1076"});YAHOO.util.Attribute=function(B,A){if(A){this.owner=A;this.configure(B,true);}};YAHOO.util.Attribute.prototype={name:undefined,value:null,owner:null,readOnly:false,writeOnce:false,_initialConfig:null,_written:false,method:null,validator:null,getValue:function(){return this.value;},setValue:function(F,B){var E;var A=this.owner;var C=this.name;var D={type:C,prevValue:this.getValue(),newValue:F};if(this.readOnly||(this.writeOnce&&this._written)){return false;}if(this.validator&&!this.validator.call(A,F)){return false;}if(!B){E=A.fireBeforeChangeEvent(D);if(E===false){return false;}}if(this.method){this.method.call(A,F);}this.value=F;this._written=true;D.type=C;if(!B){this.owner.fireChangeEvent(D);}return true;},configure:function(B,C){B=B||{};this._written=false;this._initialConfig=this._initialConfig||{};for(var A in B){if(A&&YAHOO.lang.hasOwnProperty(B,A)){this[A]=B[A];if(C){this._initialConfig[A]=B[A];}}}},resetValue:function(){return this.setValue(this._initialConfig.value);},resetConfig:function(){this.configure(this._initialConfig);},refresh:function(A){this.setValue(this.value,A);}};(function(){var A=YAHOO.util.Lang;YAHOO.util.AttributeProvider=function(){};YAHOO.util.AttributeProvider.prototype={_configs:null,get:function(C){this._configs=this._configs||{};var B=this._configs[C];if(!B){return undefined;}return B.value;},set:function(D,E,B){this._configs=this._configs||{};var C=this._configs[D];if(!C){return false;}return C.setValue(E,B);},getAttributeKeys:function(){this._configs=this._configs;var D=[];var B;for(var C in this._configs){B=this._configs[C];if(A.hasOwnProperty(this._configs,C)&&!A.isUndefined(B)){D[D.length]=C;}}return D;},setAttributes:function(D,B){for(var C in D){if(A.hasOwnProperty(D,C)){this.set(C,D[C],B);}}},resetValue:function(C,B){this._configs=this._configs||{};if(this._configs[C]){this.set(C,this._configs[C]._initialConfig.value,B);return true;}return false;},refresh:function(E,C){this._configs=this._configs;E=((A.isString(E))?[E]:E)||this.getAttributeKeys();for(var D=0,B=E.length;D<B;++D){if(this._configs[E[D]]&&!A.isUndefined(this._configs[E[D]].value)&&!A.isNull(this._configs[E[D]].value)){this._configs[E[D]].refresh(C);}}},register:function(B,C){this.setAttributeConfig(B,C);},getAttributeConfig:function(C){this._configs=this._configs||{};var B=this._configs[C]||{};var D={};for(C in B){if(A.hasOwnProperty(B,C)){D[C]=B[C];}}return D;},setAttributeConfig:function(B,C,D){this._configs=this._configs||{};C=C||{};if(!this._configs[B]){C.name=B;this._configs[B]=this.createAttribute(C);}else{this._configs[B].configure(C,D);}},configureAttribute:function(B,C,D){this.setAttributeConfig(B,C,D);},resetAttributeConfig:function(B){this._configs=this._configs||{};this._configs[B].resetConfig();},subscribe:function(B,C){this._events=this._events||{};if(!(B in this._events)){this._events[B]=this.createEvent(B);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.subscribe.apply(this,arguments);},addListener:function(){this.subscribe.apply(this,arguments);},fireBeforeChangeEvent:function(C){var B="before";B+=C.type.charAt(0).toUpperCase()+C.type.substr(1)+"Change";C.type=B;return this.fireEvent(C.type,C);},fireChangeEvent:function(B){B.type+="Change";return this.fireEvent(B.type,B);},createAttribute:function(B){return new YAHOO.util.Attribute(B,this);}};YAHOO.augment(YAHOO.util.AttributeProvider,YAHOO.util.EventProvider);})();(function(){var D=YAHOO.util.Dom,F=YAHOO.util.AttributeProvider;YAHOO.util.Element=function(G,H){if(arguments.length){this.init(G,H);}};YAHOO.util.Element.prototype={DOM_EVENTS:null,appendChild:function(G){G=G.get?G.get("element"):G;this.get("element").appendChild(G);},getElementsByTagName:function(G){return this.get("element").getElementsByTagName(G);},hasChildNodes:function(){return this.get("element").hasChildNodes();},insertBefore:function(G,H){G=G.get?G.get("element"):G;H=(H&&H.get)?H.get("element"):H;this.get("element").insertBefore(G,H);},removeChild:function(G){G=G.get?G.get("element"):G;this.get("element").removeChild(G);return true;},replaceChild:function(G,H){G=G.get?G.get("element"):G;H=H.get?H.get("element"):H;return this.get("element").replaceChild(G,H);},initAttributes:function(G){},addListener:function(K,J,L,I){var H=this.get("element");I=I||this;H=this.get("id")||H;var G=this;if(!this._events[K]){if(this.DOM_EVENTS[K]){YAHOO.util.Event.addListener(H,K,function(M){if(M.srcElement&&!M.target){M.target=M.srcElement;}G.fireEvent(K,M);},L,I);}this.createEvent(K,this);}YAHOO.util.EventProvider.prototype.subscribe.apply(this,arguments);},on:function(){this.addListener.apply(this,arguments);},subscribe:function(){this.addListener.apply(this,arguments);},removeListener:function(H,G){this.unsubscribe.apply(this,arguments);},addClass:function(G){D.addClass(this.get("element"),G);},getElementsByClassName:function(H,G){return D.getElementsByClassName(H,G,this.get("element"));},hasClass:function(G){return D.hasClass(this.get("element"),G);},removeClass:function(G){return D.removeClass(this.get("element"),G);},replaceClass:function(H,G){return D.replaceClass(this.get("element"),H,G);},setStyle:function(I,H){var G=this.get("element");if(!G){return this._queue[this._queue.length]=["setStyle",arguments];}return D.setStyle(G,I,H);},getStyle:function(G){return D.getStyle(this.get("element"),G);},fireQueue:function(){var H=this._queue;for(var I=0,G=H.length;I<G;++I){this[H[I][0]].apply(this,H[I][1]);}},appendTo:function(H,I){H=(H.get)?H.get("element"):D.get(H);this.fireEvent("beforeAppendTo",{type:"beforeAppendTo",target:H});I=(I&&I.get)?I.get("element"):D.get(I);var G=this.get("element");if(!G){return false;}if(!H){return false;}if(G.parent!=H){if(I){H.insertBefore(G,I);}else{H.appendChild(G);}}this.fireEvent("appendTo",{type:"appendTo",target:H});},get:function(G){var I=this._configs||{};var H=I.element;if(H&&!I[G]&&!YAHOO.lang.isUndefined(H.value[G])){return H.value[G];}return F.prototype.get.call(this,G);},setAttributes:function(L,H){var K=this.get("element");
for(var J in L){if(!this._configs[J]&&!YAHOO.lang.isUndefined(K[J])){this.setAttributeConfig(J);}}for(var I=0,G=this._configOrder.length;I<G;++I){if(L[this._configOrder[I]]!==undefined){this.set(this._configOrder[I],L[this._configOrder[I]],H);}}},set:function(H,J,G){var I=this.get("element");if(!I){this._queue[this._queue.length]=["set",arguments];if(this._configs[H]){this._configs[H].value=J;}return ;}if(!this._configs[H]&&!YAHOO.lang.isUndefined(I[H])){C.call(this,H);}return F.prototype.set.apply(this,arguments);},setAttributeConfig:function(G,I,J){var H=this.get("element");if(H&&!this._configs[G]&&!YAHOO.lang.isUndefined(H[G])){C.call(this,G,I);}else{F.prototype.setAttributeConfig.apply(this,arguments);}this._configOrder.push(G);},getAttributeKeys:function(){var H=this.get("element");var I=F.prototype.getAttributeKeys.call(this);for(var G in H){if(!this._configs[G]){I[G]=I[G]||H[G];}}return I;},createEvent:function(H,G){this._events[H]=true;F.prototype.createEvent.apply(this,arguments);},init:function(H,G){A.apply(this,arguments);}};var A=function(H,G){this._queue=this._queue||[];this._events=this._events||{};this._configs=this._configs||{};this._configOrder=[];G=G||{};G.element=G.element||H||null;this.DOM_EVENTS={"click":true,"dblclick":true,"keydown":true,"keypress":true,"keyup":true,"mousedown":true,"mousemove":true,"mouseout":true,"mouseover":true,"mouseup":true,"focus":true,"blur":true,"submit":true};var I=false;if(YAHOO.lang.isString(H)){C.call(this,"id",{value:G.element});}if(D.get(H)){I=true;E.call(this,G);B.call(this,G);}YAHOO.util.Event.onAvailable(G.element,function(){if(!I){E.call(this,G);}this.fireEvent("available",{type:"available",target:G.element});},this,true);YAHOO.util.Event.onContentReady(G.element,function(){if(!I){B.call(this,G);}this.fireEvent("contentReady",{type:"contentReady",target:G.element});},this,true);};var E=function(G){this.setAttributeConfig("element",{value:D.get(G.element),readOnly:true});};var B=function(G){this.initAttributes(G);this.setAttributes(G,true);this.fireQueue();};var C=function(G,I){var H=this.get("element");I=I||{};I.name=G;I.method=I.method||function(J){H[G]=J;};I.value=I.value||H[G];this._configs[G]=new YAHOO.util.Attribute(I,this);};YAHOO.augment(YAHOO.util.Element,F);})();YAHOO.register("element",YAHOO.util.Element,{version:"2.5.2",build:"1076"});YAHOO.register("utilities", YAHOO, {version: "2.5.2", build: "1076"});
YAHOO.widget.AutoComplete=function(G,B,J,C){if(G&&B&&J){if(J instanceof YAHOO.widget.DataSource){this.dataSource=J}else{return }if(YAHOO.util.Dom.inDocument(G)){if(YAHOO.lang.isString(G)){this._sName="instance"+YAHOO.widget.AutoComplete._nIndex+" "+G;this._elTextbox=document.getElementById(G)}else{this._sName=(G.id)?"instance"+YAHOO.widget.AutoComplete._nIndex+" "+G.id:"instance"+YAHOO.widget.AutoComplete._nIndex;this._elTextbox=G}YAHOO.util.Dom.addClass(this._elTextbox,"yui-ac-input")}else{return }if(YAHOO.util.Dom.inDocument(B)){if(YAHOO.lang.isString(B)){this._elContainer=document.getElementById(B)}else{this._elContainer=B}if(this._elContainer.style.display=="none"){}var D=this._elContainer.parentNode;var A=D.tagName.toLowerCase();if(A=="div"){YAHOO.util.Dom.addClass(D,"yui-ac")}else{}}else{return }if(C&&(C.constructor==Object)){for(var I in C){if(I){this[I]=C[I]}}}this._initContainer();this._initProps();this._initList();this._initContainerHelpers();var H=this;var F=this._elTextbox;var E=this._elContent;YAHOO.util.Event.addListener(F,"keyup",H._onTextboxKeyUp,H);YAHOO.util.Event.addListener(F,"keydown",H._onTextboxKeyDown,H);YAHOO.util.Event.addListener(F,"focus",H._onTextboxFocus,H);YAHOO.util.Event.addListener(F,"blur",H._onTextboxBlur,H);YAHOO.util.Event.addListener(E,"mouseover",H._onContainerMouseover,H);YAHOO.util.Event.addListener(E,"mouseout",H._onContainerMouseout,H);YAHOO.util.Event.addListener(E,"scroll",H._onContainerScroll,H);YAHOO.util.Event.addListener(E,"resize",H._onContainerResize,H);YAHOO.util.Event.addListener(F,"keypress",H._onTextboxKeyPress,H);YAHOO.util.Event.addListener(window,"unload",H._onWindowUnload,H);this.textboxFocusEvent=new YAHOO.util.CustomEvent("textboxFocus",this);this.textboxKeyEvent=new YAHOO.util.CustomEvent("textboxKey",this);this.dataRequestEvent=new YAHOO.util.CustomEvent("dataRequest",this);this.dataReturnEvent=new YAHOO.util.CustomEvent("dataReturn",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.containerExpandEvent=new YAHOO.util.CustomEvent("containerExpand",this);this.typeAheadEvent=new YAHOO.util.CustomEvent("typeAhead",this);this.itemMouseOverEvent=new YAHOO.util.CustomEvent("itemMouseOver",this);this.itemMouseOutEvent=new YAHOO.util.CustomEvent("itemMouseOut",this);this.itemArrowToEvent=new YAHOO.util.CustomEvent("itemArrowTo",this);this.itemArrowFromEvent=new YAHOO.util.CustomEvent("itemArrowFrom",this);this.itemSelectEvent=new YAHOO.util.CustomEvent("itemSelect",this);this.unmatchedItemSelectEvent=new YAHOO.util.CustomEvent("unmatchedItemSelect",this);this.selectionEnforceEvent=new YAHOO.util.CustomEvent("selectionEnforce",this);this.containerCollapseEvent=new YAHOO.util.CustomEvent("containerCollapse",this);this.textboxBlurEvent=new YAHOO.util.CustomEvent("textboxBlur",this);F.setAttribute("autocomplete","off");YAHOO.widget.AutoComplete._nIndex++}else{}};YAHOO.widget.AutoComplete.prototype.dataSource=null;YAHOO.widget.AutoComplete.prototype.minQueryLength=1;YAHOO.widget.AutoComplete.prototype.maxResultsDisplayed=10;YAHOO.widget.AutoComplete.prototype.queryDelay=0.2;YAHOO.widget.AutoComplete.prototype.highlightClassName="yui-ac-highlight";YAHOO.widget.AutoComplete.prototype.prehighlightClassName=null;YAHOO.widget.AutoComplete.prototype.delimChar=null;YAHOO.widget.AutoComplete.prototype.autoHighlight=true;YAHOO.widget.AutoComplete.prototype.typeAhead=false;YAHOO.widget.AutoComplete.prototype.animHoriz=false;YAHOO.widget.AutoComplete.prototype.animVert=true;YAHOO.widget.AutoComplete.prototype.animSpeed=0.3;YAHOO.widget.AutoComplete.prototype.forceSelection=false;YAHOO.widget.AutoComplete.prototype.allowBrowserAutocomplete=true;YAHOO.widget.AutoComplete.prototype.alwaysShowContainer=false;YAHOO.widget.AutoComplete.prototype.useIFrame=false;YAHOO.widget.AutoComplete.prototype.useShadow=false;YAHOO.widget.AutoComplete.prototype.containerWidth=false;YAHOO.widget.AutoComplete.prototype.toString=function(){return"AutoComplete "+this._sName};YAHOO.widget.AutoComplete.prototype.isContainerOpen=function(){return this._bContainerOpen};YAHOO.widget.AutoComplete.prototype.getListItems=function(){return this._aListItems};YAHOO.widget.AutoComplete.prototype.getListItemData=function(A){if(A._oResultData){return A._oResultData}else{return false}};YAHOO.widget.AutoComplete.prototype.setHeader=function(B){if(this._elHeader){var A=this._elHeader;if(B){A.innerHTML=B;A.style.display="block"}else{A.innerHTML="";A.style.display="none"}}};YAHOO.widget.AutoComplete.prototype.setFooter=function(B){if(this._elFooter){var A=this._elFooter;if(B){A.innerHTML=B;A.style.display="block"}else{A.innerHTML="";A.style.display="none"}}};YAHOO.widget.AutoComplete.prototype.setBody=function(A){if(this._elBody){var B=this._elBody;if(A){B.innerHTML=A;B.style.display="block";B.style.display="block"}else{B.innerHTML="";B.style.display="none"}this._maxResultsDisplayed=0}};YAHOO.widget.AutoComplete.prototype.formatResult=function(B,C){var A=B[0];if(A){return A}else{return""}};YAHOO.widget.AutoComplete.prototype.doBeforeExpandContainer=function(D,A,C,B){return true};YAHOO.widget.AutoComplete.prototype.sendQuery=function(A){this._sendQuery(A)};YAHOO.widget.AutoComplete.prototype.doBeforeSendQuery=function(A){return A};YAHOO.widget.AutoComplete.prototype.destroy=function(){var B=this.toString();var A=this._elTextbox;var D=this._elContainer;this.textboxFocusEvent.unsubscribeAll();this.textboxKeyEvent.unsubscribeAll();this.dataRequestEvent.unsubscribeAll();this.dataReturnEvent.unsubscribeAll();this.dataErrorEvent.unsubscribeAll();this.containerExpandEvent.unsubscribeAll();this.typeAheadEvent.unsubscribeAll();this.itemMouseOverEvent.unsubscribeAll();this.itemMouseOutEvent.unsubscribeAll();this.itemArrowToEvent.unsubscribeAll();this.itemArrowFromEvent.unsubscribeAll();this.itemSelectEvent.unsubscribeAll();this.unmatchedItemSelectEvent.unsubscribeAll();this.selectionEnforceEvent.unsubscribeAll();this.containerCollapseEvent.unsubscribeAll();this.textboxBlurEvent.unsubscribeAll();YAHOO.util.Event.purgeElement(A,true);YAHOO.util.Event.purgeElement(D,true);D.innerHTML="";for(var C in this){if(YAHOO.lang.hasOwnProperty(this,C)){this[C]=null}}};YAHOO.widget.AutoComplete.prototype.textboxFocusEvent=null;YAHOO.widget.AutoComplete.prototype.textboxKeyEvent=null;YAHOO.widget.AutoComplete.prototype.dataRequestEvent=null;YAHOO.widget.AutoComplete.prototype.dataReturnEvent=null;YAHOO.widget.AutoComplete.prototype.dataErrorEvent=null;YAHOO.widget.AutoComplete.prototype.containerExpandEvent=null;YAHOO.widget.AutoComplete.prototype.typeAheadEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOverEvent=null;YAHOO.widget.AutoComplete.prototype.itemMouseOutEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowToEvent=null;YAHOO.widget.AutoComplete.prototype.itemArrowFromEvent=null;YAHOO.widget.AutoComplete.prototype.itemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.unmatchedItemSelectEvent=null;YAHOO.widget.AutoComplete.prototype.selectionEnforceEvent=null;YAHOO.widget.AutoComplete.prototype.containerCollapseEvent=null;YAHOO.widget.AutoComplete.prototype.textboxBlurEvent=null;YAHOO.widget.AutoComplete._nIndex=0;YAHOO.widget.AutoComplete.prototype._sName=null;YAHOO.widget.AutoComplete.prototype._elTextbox=null;YAHOO.widget.AutoComplete.prototype._elContainer=null;YAHOO.widget.AutoComplete.prototype._elContent=null;YAHOO.widget.AutoComplete.prototype._elHeader=null;YAHOO.widget.AutoComplete.prototype._elBody=null;YAHOO.widget.AutoComplete.prototype._elFooter=null;YAHOO.widget.AutoComplete.prototype._elShadow=null;YAHOO.widget.AutoComplete.prototype._elIFrame=null;YAHOO.widget.AutoComplete.prototype._bFocused=true;YAHOO.widget.AutoComplete.prototype._oAnim=null;YAHOO.widget.AutoComplete.prototype._bContainerOpen=false;YAHOO.widget.AutoComplete.prototype._bOverContainer=false;YAHOO.widget.AutoComplete.prototype._aListItems=null;YAHOO.widget.AutoComplete.prototype._nDisplayedItems=0;YAHOO.widget.AutoComplete.prototype._maxResultsDisplayed=0;YAHOO.widget.AutoComplete.prototype._sCurQuery=null;YAHOO.widget.AutoComplete.prototype._sSavedQuery=null;YAHOO.widget.AutoComplete.prototype._oCurItem=null;YAHOO.widget.AutoComplete.prototype._bItemSelected=false;YAHOO.widget.AutoComplete.prototype._nKeyCode=null;YAHOO.widget.AutoComplete.prototype._nDelayID=-1;YAHOO.widget.AutoComplete.prototype._iFrameSrc="javascript:false;";YAHOO.widget.AutoComplete.prototype._queryInterval=null;YAHOO.widget.AutoComplete.prototype._sLastTextboxValue=null;YAHOO.widget.AutoComplete.prototype._initProps=function(){var B=this.minQueryLength;if(!YAHOO.lang.isNumber(B)){this.minQueryLength=1}var D=this.maxResultsDisplayed;if(!YAHOO.lang.isNumber(D)||(D<1)){this.maxResultsDisplayed=10}var E=this.queryDelay;if(!YAHOO.lang.isNumber(E)||(E<0)){this.queryDelay=0.2}var A=this.delimChar;if(YAHOO.lang.isString(A)&&(A.length>0)){this.delimChar=[A]}else{if(!YAHOO.lang.isArray(A)){this.delimChar=null}}var C=this.animSpeed;if((this.animHoriz||this.animVert)&&YAHOO.util.Anim){if(!YAHOO.lang.isNumber(C)||(C<0)){this.animSpeed=0.3}if(!this._oAnim){this._oAnim=new YAHOO.util.Anim(this._elContent,{},this.animSpeed)}else{this._oAnim.duration=this.animSpeed}}if(this.forceSelection&&A){}};YAHOO.widget.AutoComplete.prototype._initContainerHelpers=function(){if(this.useShadow&&!this._elShadow){var A=document.createElement("div");A.className="yui-ac-shadow";this._elShadow=this._elContainer.appendChild(A)}if(this.useIFrame&&!this._elIFrame){var B=document.createElement("iframe");B.src=this._iFrameSrc;B.frameBorder=0;B.scrolling="no";B.style.position="absolute";B.style.width="100%";B.style.height="100%";B.tabIndex=-1;this._elIFrame=this._elContainer.appendChild(B)}};YAHOO.widget.AutoComplete.prototype._initContainer=function(){YAHOO.util.Dom.addClass(this._elContainer,"yui-ac-container");if(!this._elContent){var C=document.createElement("div");C.className="yui-ac-content";C.style.display="none";this._elContent=this._elContainer.appendChild(C);var B=document.createElement("div");B.className="yui-ac-hd";B.style.display="none";this._elHeader=this._elContent.appendChild(B);var D=document.createElement("div");D.className="yui-ac-bd";this._elBody=this._elContent.appendChild(D);var A=document.createElement("div");A.className="yui-ac-ft";A.style.display="none";this._elFooter=this._elContent.appendChild(A)}else{}};YAHOO.widget.AutoComplete.prototype._initList=function(){this._aListItems=[];while(this._elBody.hasChildNodes()){var B=this.getListItems();if(B){for(var A=B.length-1;A>=0;A--){B[A]=null}}this._elBody.innerHTML=""}var E=document.createElement("ul");E=this._elBody.appendChild(E);for(var C=0;C<this.maxResultsDisplayed;C++){var D=document.createElement("li");D=E.appendChild(D);this._aListItems[C]=D;this._initListItem(D,C)}this._maxResultsDisplayed=this.maxResultsDisplayed};YAHOO.widget.AutoComplete.prototype._initListItem=function(C,B){var A=this;C.style.display="none";C._nItemIndex=B;C.mouseover=C.mouseout=C.onclick=null;YAHOO.util.Event.addListener(C,"mouseover",A._onItemMouseover,A);YAHOO.util.Event.addListener(C,"mouseout",A._onItemMouseout,A);YAHOO.util.Event.addListener(C,"click",A._onItemMouseclick,A)};YAHOO.widget.AutoComplete.prototype._onIMEDetected=function(A){A._enableIntervalDetection()};YAHOO.widget.AutoComplete.prototype._enableIntervalDetection=function(){var A=this._elTextbox.value;var B=this._sLastTextboxValue;if(A!=B){this._sLastTextboxValue=A;this._sendQuery(A)}};YAHOO.widget.AutoComplete.prototype._cancelIntervalDetection=function(A){if(A._queryInterval){clearInterval(A._queryInterval)}};YAHOO.widget.AutoComplete.prototype._isIgnoreKey=function(A){if((A==9)||(A==13)||(A==16)||(A==17)||(A>=18&&A<=20)||(A==27)||(A>=33&&A<=35)||(A>=36&&A<=40)||(A>=44&&A<=45)){return true}return false};YAHOO.widget.AutoComplete.prototype._sendQuery=function(G){if(this.minQueryLength==-1){this._toggleContainer(false);return }var C=(this.delimChar)?this.delimChar:null;if(C){var E=-1;for(var B=C.length-1;B>=0;B--){var F=G.lastIndexOf(C[B]);if(F>E){E=F}}if(C[B]==" "){for(var A=C.length-1;A>=0;A--){if(G[E-1]==C[A]){E--;break}}}if(E>-1){var D=E+1;while(G.charAt(D)==" "){D+=1}this._sSavedQuery=G.substring(0,D);G=G.substr(D)}else{if(G.indexOf(this._sSavedQuery)<0){this._sSavedQuery=null}}}if((G&&(G.length<this.minQueryLength))||(!G&&this.minQueryLength>0)){if(this._nDelayID!=-1){clearTimeout(this._nDelayID)}this._toggleContainer(false);return }G=encodeURIComponent(G);this._nDelayID=-1;G=this.doBeforeSendQuery(G);this.dataRequestEvent.fire(this,G);this.dataSource.getResults(this._populateList,G,this)};YAHOO.widget.AutoComplete.prototype._populateList=function(K,L,I){if(L===null){I.dataErrorEvent.fire(I,K)}if(!I._bFocused||!L){return }var A=(navigator.userAgent.toLowerCase().indexOf("opera")!=-1);var O=I._elContent.style;O.width=(!A)?null:"";O.height=(!A)?null:"";var H=decodeURIComponent(K);I._sCurQuery=H;I._bItemSelected=false;if(I._maxResultsDisplayed!=I.maxResultsDisplayed){I._initList()}var C=Math.min(L.length,I.maxResultsDisplayed);I._nDisplayedItems=C;if(C>0){I._initContainerHelpers();var D=I._aListItems;for(var G=C-1;G>=0;G--){var N=D[G];var B=L[G];N.innerHTML=I.formatResult(B,H);N.style.display="list-item";N._sResultKey=B[0];N._oResultData=B}for(var F=D.length-1;F>=C;F--){var M=D[F];M.innerHTML=null;M.style.display="none";M._sResultKey=null;M._oResultData=null}var J=I.doBeforeExpandContainer(I._elTextbox,I._elContainer,K,L);I._toggleContainer(J);if(I.autoHighlight){var E=D[0];I._toggleHighlight(E,"to");I.itemArrowToEvent.fire(I,E);I._typeAhead(E,K)}else{I._oCurItem=null}}else{I._toggleContainer(false)}I.dataReturnEvent.fire(I,K,L)};YAHOO.widget.AutoComplete.prototype._clearSelection=function(){var C=this._elTextbox.value;var B=(this.delimChar)?this.delimChar[0]:null;var A=(B)?C.lastIndexOf(B,C.length-2):-1;if(A>-1){this._elTextbox.value=C.substring(0,A)}else{this._elTextbox.value=""}this._sSavedQuery=this._elTextbox.value;this.selectionEnforceEvent.fire(this)};YAHOO.widget.AutoComplete.prototype._textMatchesOption=function(){var D=null;for(var A=this._nDisplayedItems-1;A>=0;A--){var C=this._aListItems[A];var B=C._sResultKey.toLowerCase();if(B==this._sCurQuery.toLowerCase()){D=C;break}}return(D)};YAHOO.widget.AutoComplete.prototype._typeAhead=function(D,G){if(!this.typeAhead||(this._nKeyCode==8)){return }var F=this._elTextbox;var E=this._elTextbox.value;if(!F.setSelectionRange&&!F.createTextRange){return }var B=E.length;this._updateValue(D);var C=F.value.length;this._selectText(F,B,C);var A=F.value.substr(B,C);this.typeAheadEvent.fire(this,G,A)};YAHOO.widget.AutoComplete.prototype._selectText=function(D,A,B){if(D.setSelectionRange){D.setSelectionRange(A,B)}else{if(D.createTextRange){var C=D.createTextRange();C.moveStart("character",A);C.moveEnd("character",B-D.value.length);C.select()}else{D.select()}}};YAHOO.widget.AutoComplete.prototype._toggleContainerHelpers=function(B){var D=false;var C=this._elContent.offsetWidth+"px";var A=this._elContent.offsetHeight+"px";if(this.useIFrame&&this._elIFrame){D=true;if(B){this._elIFrame.style.width=C;this._elIFrame.style.height=A}else{this._elIFrame.style.width=0;this._elIFrame.style.height=0}}if(this.useShadow&&this._elShadow){D=true;if(B){this._elShadow.style.width=C;this._elShadow.style.height=A}else{this._elShadow.style.width=0;this._elShadow.style.height=0}}};YAHOO.widget.AutoComplete.prototype._toggleContainer=function(K){var E=this._elContainer;if(this.alwaysShowContainer&&this._bContainerOpen){return }if(!K){this._elContent.scrollTop=0;var C=this._aListItems;if(C&&(C.length>0)){for(var H=C.length-1;H>=0;H--){C[H].style.display="none"}}if(this._oCurItem){this._toggleHighlight(this._oCurItem,"from")}this._oCurItem=null;this._nDisplayedItems=0;this._sCurQuery=null}if(!K&&!this._bContainerOpen){this._elContent.style.display="none";return }if(this.containerWidth){this._elContainer.style.width=this.containerWidth+"px"}else{this._elContainer.style.width=this._elTextbox.offsetWidth-4+"px"}this._elContainer.style.top="22px";var B=this._oAnim;if(B&&B.getEl()&&(this.animHoriz||this.animVert)){if(!K){this._toggleContainerHelpers(K)}if(B.isAnimated()){B.stop()}var I=this._elContent.cloneNode(true);E.appendChild(I);I.style.top="-9000px";I.style.display="block";var G=I.offsetWidth;var D=I.offsetHeight;var A=(this.animHoriz)?0:G;var F=(this.animVert)?0:D;B.attributes=(K)?{width:{to:G},height:{to:D}}:{width:{to:A},height:{to:F}};if(K&&!this._bContainerOpen){this._elContent.style.width=A+"px";this._elContent.style.height=F+"px"}else{this._elContent.style.width=G+"px";this._elContent.style.height=D+"px"}E.removeChild(I);I=null;var J=this;var L=function(){B.onComplete.unsubscribeAll();if(K){J.containerExpandEvent.fire(J)}else{J._elContent.style.display="none";J.containerCollapseEvent.fire(J)}J._toggleContainerHelpers(K)};this._elContent.style.display="block";B.onComplete.subscribe(L);B.animate();this._bContainerOpen=K}else{if(K){this._elContent.style.display="block";this.containerExpandEvent.fire(this)}else{this._elContent.style.display="none";this.containerCollapseEvent.fire(this)}this._toggleContainerHelpers(K);this._bContainerOpen=K}};YAHOO.widget.AutoComplete.prototype._toggleHighlight=function(A,C){var B=this.highlightClassName;if(this._oCurItem){YAHOO.util.Dom.removeClass(this._oCurItem,B)}if((C=="to")&&B){YAHOO.util.Dom.addClass(A,B);this._oCurItem=A}};YAHOO.widget.AutoComplete.prototype._togglePrehighlight=function(A,C){if(A==this._oCurItem){return }var B=this.prehighlightClassName;if((C=="mouseover")&&B){YAHOO.util.Dom.addClass(A,B)}else{YAHOO.util.Dom.removeClass(A,B)}};YAHOO.widget.AutoComplete.prototype._updateValue=function(E){var F=this._elTextbox;var D=(this.delimChar)?(this.delimChar[0]||this.delimChar):null;var B=this._sSavedQuery;var C=E._sResultKey;F.focus();F.value="";if(D){if(B){F.value=B}F.value+=C+D;if(D!=" "){F.value+=" "}}else{F.value=C}if(F.type=="textarea"){F.scrollTop=F.scrollHeight}var A=F.value.length;this._selectText(F,A,A);this._oCurItem=E};YAHOO.widget.AutoComplete.prototype._selectItem=function(A){this._bItemSelected=true;this._updateValue(A);this._cancelIntervalDetection(this);this.itemSelectEvent.fire(this,A,A._oResultData);this._toggleContainer(false)};YAHOO.widget.AutoComplete.prototype._jumpSelection=function(){if(this._oCurItem){this._selectItem(this._oCurItem)}else{this._toggleContainer(false)}};YAHOO.widget.AutoComplete.prototype._moveSelection=function(G){if(this._bContainerOpen){var E=this._oCurItem;var F=-1;if(E){F=E._nItemIndex}var D=(G==40)?(F+1):(F-1);if(D<-2||D>=this._nDisplayedItems){return }if(E){this._toggleHighlight(E,"from");this.itemArrowFromEvent.fire(this,E)}if(D==-1){if(this.delimChar&&this._sSavedQuery){if(!this._textMatchesOption()){this._elTextbox.value=this._sSavedQuery}else{this._elTextbox.value=this._sSavedQuery+this._sCurQuery}}else{this._elTextbox.value=this._sCurQuery}this._oCurItem=null;return }if(D==-2){this._toggleContainer(false);return }var C=this._aListItems[D];var A=this._elContent;var B=((YAHOO.util.Dom.getStyle(A,"overflow")=="auto")||(YAHOO.util.Dom.getStyle(A,"overflowY")=="auto"));if(B&&(D>-1)&&(D<this._nDisplayedItems)){if(G==40){if((C.offsetTop+C.offsetHeight)>(A.scrollTop+A.offsetHeight)){A.scrollTop=(C.offsetTop+C.offsetHeight)-A.offsetHeight}else{if((C.offsetTop+C.offsetHeight)<A.scrollTop){A.scrollTop=C.offsetTop}}}else{if(C.offsetTop<A.scrollTop){this._elContent.scrollTop=C.offsetTop}else{if(C.offsetTop>(A.scrollTop+A.offsetHeight)){this._elContent.scrollTop=(C.offsetTop+C.offsetHeight)-A.offsetHeight}}}}this._toggleHighlight(C,"to");this.itemArrowToEvent.fire(this,C);if(this.typeAhead){this._updateValue(C)}}};YAHOO.widget.AutoComplete.prototype._onItemMouseover=function(A,B){if(B.prehighlightClassName){B._togglePrehighlight(this,"mouseover")}else{B._toggleHighlight(this,"to")}B.itemMouseOverEvent.fire(B,this)};YAHOO.widget.AutoComplete.prototype._onItemMouseout=function(A,B){if(B.prehighlightClassName){B._togglePrehighlight(this,"mouseout")}else{B._toggleHighlight(this,"from")}B.itemMouseOutEvent.fire(B,this)};YAHOO.widget.AutoComplete.prototype._onItemMouseclick=function(A,B){B._toggleHighlight(this,"to");B._selectItem(this)};YAHOO.widget.AutoComplete.prototype._onContainerMouseover=function(A,B){B._bOverContainer=true};YAHOO.widget.AutoComplete.prototype._onContainerMouseout=function(A,B){B._bOverContainer=false;if(B._oCurItem){B._toggleHighlight(B._oCurItem,"to")}};YAHOO.widget.AutoComplete.prototype._onContainerScroll=function(A,B){B._elTextbox.focus()};YAHOO.widget.AutoComplete.prototype._onContainerResize=function(A,B){B._toggleContainerHelpers(B._bContainerOpen)};YAHOO.widget.AutoComplete.prototype._onTextboxKeyDown=function(A,B){var C=A.keyCode;switch(C){case 9:if((navigator.userAgent.toLowerCase().indexOf("mac")==-1)){if(B._oCurItem){if(B.delimChar&&(B._nKeyCode!=C)){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A)}}B._selectItem(B._oCurItem)}else{B._toggleContainer(false)}}break;case 13:if((navigator.userAgent.toLowerCase().indexOf("mac")==-1)){if(B._oCurItem){if(B._nKeyCode!=C){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A)}}B._selectItem(B._oCurItem)}else{B._toggleContainer(false)}}break;case 27:B._toggleContainer(false);return ;case 39:B._jumpSelection();break;case 38:YAHOO.util.Event.stopEvent(A);B._moveSelection(C);break;case 40:YAHOO.util.Event.stopEvent(A);B._moveSelection(C);break;default:break}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyPress=function(A,B){var C=A.keyCode;if((navigator.userAgent.toLowerCase().indexOf("mac")!=-1)){switch(C){case 9:if(B._oCurItem){if(B.delimChar&&(B._nKeyCode!=C)){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A)}}B._selectItem(B._oCurItem)}else{B._toggleContainer(false)}break;case 13:if(B._oCurItem){if(B._nKeyCode!=C){if(B._bContainerOpen){YAHOO.util.Event.stopEvent(A)}}B._selectItem(B._oCurItem)}else{B._toggleContainer(false)}break;default:break}}else{if(C==229){B._queryInterval=setInterval(function(){B._onIMEDetected(B)},500)}}};YAHOO.widget.AutoComplete.prototype._onTextboxKeyUp=function(B,D){D._initProps();var E=B.keyCode;D._nKeyCode=E;var C=this.value;if(D._isIgnoreKey(E)||(C.toLowerCase()==D._sCurQuery)){return }else{D._bItemSelected=false;YAHOO.util.Dom.removeClass(D._oCurItem,D.highlightClassName);D._oCurItem=null;D.textboxKeyEvent.fire(D,E)}if(D.queryDelay>0){var A=setTimeout(function(){D._sendQuery(C)},(D.queryDelay*1000));if(D._nDelayID!=-1){clearTimeout(D._nDelayID)}D._nDelayID=A}else{D._sendQuery(C)}};YAHOO.widget.AutoComplete.prototype._onTextboxFocus=function(A,B){B._elTextbox.setAttribute("autocomplete","off");B._bFocused=true;if(!B._bItemSelected){B.textboxFocusEvent.fire(B)}};YAHOO.widget.AutoComplete.prototype._onTextboxBlur=function(A,B){if(!B._bOverContainer||(B._nKeyCode==9)){if(!B._bItemSelected){var C=B._textMatchesOption();if(!B._bContainerOpen||(B._bContainerOpen&&(C===null))){if(B.forceSelection){B._clearSelection()}else{B.unmatchedItemSelectEvent.fire(B)}}else{if(B.forceSelection){B._selectItem(C)}}}if(B._bContainerOpen){B._toggleContainer(false)}B._cancelIntervalDetection(B);B._bFocused=false;B.textboxBlurEvent.fire(B)}};YAHOO.widget.AutoComplete.prototype._onWindowUnload=function(A,B){if(B&&B._elTextbox&&B.allowBrowserAutocomplete){B._elTextbox.setAttribute("autocomplete","on")}};YAHOO.widget.DataSource=function(){};YAHOO.widget.DataSource.ERROR_DATANULL="Response data was null";YAHOO.widget.DataSource.ERROR_DATAPARSE="Response data could not be parsed";YAHOO.widget.DataSource.prototype.maxCacheEntries=15;YAHOO.widget.DataSource.prototype.queryMatchContains=false;YAHOO.widget.DataSource.prototype.queryMatchSubset=false;YAHOO.widget.DataSource.prototype.queryMatchCase=false;YAHOO.widget.DataSource.prototype.toString=function(){return"DataSource "+this._sName};YAHOO.widget.DataSource.prototype.getResults=function(A,D,B){var C=this._doQueryCache(A,D,B);if(C.length===0){this.queryEvent.fire(this,B,D);this.doQuery(A,D,B)}};YAHOO.widget.DataSource.prototype.doQuery=function(A,C,B){};YAHOO.widget.DataSource.prototype.flushCache=function(){if(this._aCache){this._aCache=[]}if(this._aCacheHelper){this._aCacheHelper=[]}this.cacheFlushEvent.fire(this)};YAHOO.widget.DataSource.prototype.queryEvent=null;YAHOO.widget.DataSource.prototype.cacheQueryEvent=null;YAHOO.widget.DataSource.prototype.getResultsEvent=null;YAHOO.widget.DataSource.prototype.getCachedResultsEvent=null;YAHOO.widget.DataSource.prototype.dataErrorEvent=null;YAHOO.widget.DataSource.prototype.cacheFlushEvent=null;YAHOO.widget.DataSource._nIndex=0;YAHOO.widget.DataSource.prototype._sName=null;YAHOO.widget.DataSource.prototype._aCache=null;YAHOO.widget.DataSource.prototype._init=function(){var A=this.maxCacheEntries;if(!YAHOO.lang.isNumber(A)||(A<0)){A=0}if(A>0&&!this._aCache){this._aCache=[]}this._sName="instance"+YAHOO.widget.DataSource._nIndex;YAHOO.widget.DataSource._nIndex++;this.queryEvent=new YAHOO.util.CustomEvent("query",this);this.cacheQueryEvent=new YAHOO.util.CustomEvent("cacheQuery",this);this.getResultsEvent=new YAHOO.util.CustomEvent("getResults",this);this.getCachedResultsEvent=new YAHOO.util.CustomEvent("getCachedResults",this);this.dataErrorEvent=new YAHOO.util.CustomEvent("dataError",this);this.cacheFlushEvent=new YAHOO.util.CustomEvent("cacheFlush",this)};YAHOO.widget.DataSource.prototype._addCacheElem=function(B){var A=this._aCache;if(!A||!B||!B.query||!B.results){return }if(A.length>=this.maxCacheEntries){A.shift()}A.push(B)};YAHOO.widget.DataSource.prototype._doQueryCache=function(A,I,N){var H=[];var G=false;var J=this._aCache;var F=(J)?J.length:0;var K=this.queryMatchContains;var D;if((this.maxCacheEntries>0)&&J&&(F>0)){this.cacheQueryEvent.fire(this,N,I);if(!this.queryMatchCase){D=I;I=I.toLowerCase()}for(var P=F-1;P>=0;P--){var E=J[P];var B=E.results;var C=(!this.queryMatchCase)?encodeURIComponent(E.query).toLowerCase():encodeURIComponent(E.query);if(C==I){G=true;H=B;if(P!=F-1){J.splice(P,1);this._addCacheElem(E)}break}else{if(this.queryMatchSubset){for(var O=I.length-1;O>=0;O--){var R=I.substr(0,O);if(C==R){G=true;for(var M=B.length-1;M>=0;M--){var Q=B[M];var L=(this.queryMatchCase)?encodeURIComponent(Q[0]).indexOf(I):encodeURIComponent(Q[0]).toLowerCase().indexOf(I);if((!K&&(L===0))||(K&&(L>-1))){H.unshift(Q)}}E={};E.query=I;E.results=H;this._addCacheElem(E);break}}if(G){break}}}}if(G){this.getCachedResultsEvent.fire(this,N,D,H);A(D,H,N)}}return H};YAHOO.widget.DS_XHR=function(C,A,D){if(D&&(D.constructor==Object)){for(var B in D){this[B]=D[B]}}if(!YAHOO.lang.isArray(A)||!YAHOO.lang.isString(C)){return }this.schema=A;this.scriptURI=C;this._init()};YAHOO.widget.DS_XHR.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_XHR.TYPE_JSON=0;YAHOO.widget.DS_XHR.TYPE_XML=1;YAHOO.widget.DS_XHR.TYPE_FLAT=2;YAHOO.widget.DS_XHR.ERROR_DATAXHR="XHR response failed";YAHOO.widget.DS_XHR.prototype.connMgr=YAHOO.util.Connect;YAHOO.widget.DS_XHR.prototype.connTimeout=0;YAHOO.widget.DS_XHR.prototype.scriptURI=null;YAHOO.widget.DS_XHR.prototype.scriptQueryParam="query";YAHOO.widget.DS_XHR.prototype.scriptQueryAppend="";YAHOO.widget.DS_XHR.prototype.responseType=YAHOO.widget.DS_XHR.TYPE_JSON;YAHOO.widget.DS_XHR.prototype.responseStripAfter="\n<!-";YAHOO.widget.DS_XHR.prototype.doQuery=function(E,G,B){var J=(this.responseType==YAHOO.widget.DS_XHR.TYPE_XML);var D=this.scriptURI+"?"+this.scriptQueryParam+"="+G;if(this.scriptQueryAppend.length>0){D+="&"+this.scriptQueryAppend}var C=null;var F=this;var I=function(K){if(!F._oConn||(K.tId!=F._oConn.tId)){F.dataErrorEvent.fire(F,B,G,YAHOO.widget.DataSource.ERROR_DATANULL);return }for(var N in K){}if(!J){K=K.responseText}else{K=K.responseXML}if(K===null){F.dataErrorEvent.fire(F,B,G,YAHOO.widget.DataSource.ERROR_DATANULL);return }var M=F.parseResponse(G,K,B);var L={};L.query=decodeURIComponent(G);L.results=M;if(M===null){F.dataErrorEvent.fire(F,B,G,YAHOO.widget.DataSource.ERROR_DATAPARSE);M=[]}else{F.getResultsEvent.fire(F,B,G,M);F._addCacheElem(L)}E(G,M,B)};var A=function(K){F.dataErrorEvent.fire(F,B,G,YAHOO.widget.DS_XHR.ERROR_DATAXHR);return };var H={success:I,failure:A};if(YAHOO.lang.isNumber(this.connTimeout)&&(this.connTimeout>0)){H.timeout=this.connTimeout}if(this._oConn){this.connMgr.abort(this._oConn)}F._oConn=this.connMgr.asyncRequest("GET",D,H,null)};YAHOO.widget.DS_XHR.prototype.parseResponse=function(sQuery,oResponse,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var nEnd=((this.responseStripAfter!=="")&&(oResponse.indexOf))?oResponse.indexOf(this.responseStripAfter):-1;if(nEnd!=-1){oResponse=oResponse.substring(0,nEnd)}switch(this.responseType){case YAHOO.widget.DS_XHR.TYPE_JSON:var jsonList,jsonObjParsed;if(YAHOO.lang.JSON){jsonObjParsed=YAHOO.lang.JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break}else{try{jsonList=eval("jsonObjParsed."+aSchema[0])}catch(e){bError=true;break}}}else{if(oResponse.parseJSON){jsonObjParsed=oResponse.parseJSON();if(!jsonObjParsed){bError=true}else{try{jsonList=eval("jsonObjParsed."+aSchema[0])}catch(e){bError=true;break}}}else{if(window.JSON){jsonObjParsed=JSON.parse(oResponse);if(!jsonObjParsed){bError=true;break}else{try{jsonList=eval("jsonObjParsed."+aSchema[0])}catch(e){bError=true;break}}}else{try{while(oResponse.substring(0,1)==" "){oResponse=oResponse.substring(1,oResponse.length)}if(oResponse.indexOf("{")<0){bError=true;break}if(oResponse.indexOf("{}")===0){break}var jsonObjRaw=eval("("+oResponse+")");if(!jsonObjRaw){bError=true;break}jsonList=eval("(jsonObjRaw."+aSchema[0]+")")}catch(e){bError=true;break}}}}if(!jsonList){bError=true;break}if(!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList]}for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue=""}aResultItem.unshift(dataFieldValue)}if(aResultItem.length==1){aResultItem.push(jsonResult)}aResults.unshift(aResultItem)}break;case YAHOO.widget.DS_XHR.TYPE_XML:var xmlList=oResponse.getElementsByTagName(aSchema[0]);if(!xmlList){bError=true;break}for(var k=xmlList.length-1;k>=0;k--){var result=xmlList.item(k);var aFieldSet=[];for(var m=aSchema.length-1;m>=1;m--){var sValue=null;var xmlAttr=result.attributes.getNamedItem(aSchema[m]);if(xmlAttr){sValue=xmlAttr.value}else{var xmlNode=result.getElementsByTagName(aSchema[m]);if(xmlNode&&xmlNode.item(0)&&xmlNode.item(0).firstChild){sValue=xmlNode.item(0).firstChild.nodeValue}else{sValue=""}}aFieldSet.unshift(sValue)}aResults.unshift(aFieldSet)}break;case YAHOO.widget.DS_XHR.TYPE_FLAT:if(oResponse.length>0){var newLength=oResponse.length-aSchema[0].length;if(oResponse.substr(newLength)==aSchema[0]){oResponse=oResponse.substr(0,newLength)}if(oResponse.length>0){var aRecords=oResponse.split(aSchema[0]);for(var n=aRecords.length-1;n>=0;n--){if(aRecords[n].length>0){aResults[n]=aRecords[n].split(aSchema[1])}}}}break;default:break}sQuery=null;oResponse=null;oParent=null;if(bError){return null}else{return aResults}};YAHOO.widget.DS_XHR.prototype._oConn=null;YAHOO.widget.DS_ScriptNode=function(D,A,C){if(C&&(C.constructor==Object)){for(var B in C){this[B]=C[B]}}if(!YAHOO.lang.isArray(A)||!YAHOO.lang.isString(D)){return }this.schema=A;this.scriptURI=D;this._init()};YAHOO.widget.DS_ScriptNode.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_ScriptNode.prototype.getUtility=YAHOO.util.Get;YAHOO.widget.DS_ScriptNode.prototype.scriptURI=null;YAHOO.widget.DS_ScriptNode.prototype.scriptQueryParam="query";YAHOO.widget.DS_ScriptNode.prototype.scriptQueryAppendByOtherInput={"param":"","id":""};YAHOO.widget.DS_ScriptNode.prototype.asyncMode="allowAll";YAHOO.widget.DS_ScriptNode.prototype.scriptCallbackParam="callback";YAHOO.widget.DS_ScriptNode.callbacks=[];YAHOO.widget.DS_ScriptNode._nId=0;YAHOO.widget.DS_ScriptNode._nPending=0;YAHOO.widget.DS_ScriptNode.prototype.doQuery=function(A,F,C){var B=this;if(YAHOO.widget.DS_ScriptNode._nPending===0){YAHOO.widget.DS_ScriptNode.callbacks=[];YAHOO.widget.DS_ScriptNode._nId=0}var E=YAHOO.widget.DS_ScriptNode._nId;YAHOO.widget.DS_ScriptNode._nId++;YAHOO.widget.DS_ScriptNode.callbacks[E]=function(G){if((B.asyncMode!=="ignoreStaleResponses")||(E===YAHOO.widget.DS_ScriptNode.callbacks.length-1)){B.handleResponse(G,A,F,C)}else{}delete YAHOO.widget.DS_ScriptNode.callbacks[E]};YAHOO.widget.DS_ScriptNode._nPending++;var D=this.scriptURI+"&"+this.scriptQueryParam+"="+F+"&"+this.scriptCallbackParam+"=YAHOO.widget.DS_ScriptNode.callbacks["+E+"]";if(this.scriptQueryAppendByOtherInput.param.length>0){D+="&"+this.scriptQueryAppendByOtherInput.param+"="+encodeURIComponent(document.getElementById(this.scriptQueryAppendByOtherInput.id).value)}this.getUtility.script(D,{autopurge:true,onsuccess:YAHOO.widget.DS_ScriptNode._bumpPendingDown,onfail:YAHOO.widget.DS_ScriptNode._bumpPendingDown})};YAHOO.widget.DS_ScriptNode.prototype.handleResponse=function(oResponse,oCallbackFn,sQuery,oParent){var aSchema=this.schema;var aResults=[];var bError=false;var jsonList,jsonObjParsed;try{jsonList=eval("(oResponse."+aSchema[0]+")")}catch(e){bError=true}if(!jsonList){bError=true;jsonList=[]}else{if(!YAHOO.lang.isArray(jsonList)){jsonList=[jsonList]}}for(var i=jsonList.length-1;i>=0;i--){var aResultItem=[];var jsonResult=jsonList[i];for(var j=aSchema.length-1;j>=1;j--){var dataFieldValue=jsonResult[aSchema[j]];if(!dataFieldValue){dataFieldValue=""}aResultItem.unshift(dataFieldValue)}if(aResultItem.length==1){aResultItem.push(jsonResult)}aResults.unshift(aResultItem)}if(bError){aResults=null}if(aResults===null){this.dataErrorEvent.fire(this,oParent,sQuery,YAHOO.widget.DataSource.ERROR_DATAPARSE);aResults=[]}else{var resultObj={};resultObj.query=decodeURIComponent(sQuery);resultObj.results=aResults;this._addCacheElem(resultObj);this.getResultsEvent.fire(this,oParent,sQuery,aResults)}oCallbackFn(sQuery,aResults,oParent)};YAHOO.widget.DS_ScriptNode._bumpPendingDown=function(){YAHOO.widget.DS_ScriptNode._nPending--};YAHOO.widget.DS_JSFunction=function(A,C){if(C&&(C.constructor==Object)){for(var B in C){this[B]=C[B]}}if(!YAHOO.lang.isFunction(A)){return }else{this.dataFunction=A;this._init()}};YAHOO.widget.DS_JSFunction.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSFunction.prototype.dataFunction=null;YAHOO.widget.DS_JSFunction.prototype.doQuery=function(C,F,D){var B=this.dataFunction;var E=[];E=B(F);if(E===null){this.dataErrorEvent.fire(this,D,F,YAHOO.widget.DataSource.ERROR_DATANULL);return }var A={};A.query=decodeURIComponent(F);A.results=E;this._addCacheElem(A);this.getResultsEvent.fire(this,D,F,E);C(F,E,D);return };YAHOO.widget.DS_JSArray=function(A,C){if(C&&(C.constructor==Object)){for(var B in C){this[B]=C[B]}}if(!YAHOO.lang.isArray(A)){return }else{this.data=A;this._init()}};YAHOO.widget.DS_JSArray.prototype=new YAHOO.widget.DataSource();YAHOO.widget.DS_JSArray.prototype.data=null;YAHOO.widget.DS_JSArray.prototype.doQuery=function(E,I,A){var F;var C=this.data;var J=[];var D=false;var B=this.queryMatchContains;if(I){if(!this.queryMatchCase){I=I.toLowerCase()}for(F=C.length-1;F>=0;F--){var H=[];if(YAHOO.lang.isString(C[F])){H[0]=C[F]}else{if(YAHOO.lang.isArray(C[F])){H=C[F]}}if(YAHOO.lang.isString(H[0])){var G=(this.queryMatchCase)?encodeURIComponent(H[0]).indexOf(I):encodeURIComponent(H[0]).toLowerCase().indexOf(I);if((!B&&(G===0))||(B&&(G>-1))){J.unshift(H)}}}}else{for(F=C.length-1;F>=0;F--){if(YAHOO.lang.isString(C[F])){J.unshift([C[F]])}else{if(YAHOO.lang.isArray(C[F])){J.unshift(C[F])}}}}this.getResultsEvent.fire(this,A,I,J);E(I,J,A)};YAHOO.register("autocomplete",YAHOO.widget.AutoComplete,{version:"2.5.2",build:"1076"})
var KX = window.KX || {};
KX.AC = KX.AC || {};
KX.AC.JipiaoGNPrePopulateListData = [
    ["北京","bj","pek",""], 
    ["上海", "sh", "sha", ""],
    ["广州", "gz", "can", ""],
    ["深圳", "sz", "szx", ""],
    ["成都", "cd", "ctu", ""],
    ["重庆", "cq", "ckg", ""],
    ["西安", "xa", "xiy", ""],
    ["杭州", "hz", "hgh", ""],
    ["武汉", "wh", "wuh", ""],
    ["昆明", "km", "kmg", ""]
];
KX.AC.JipiaoGJPrePopulateListData = [
    ["香港" , "xg", "gjhkg", ""],
    ["东京", "dj", "gjtyo", ""],
    ["首尔", "se", "gjicn", ""],
    ["新加坡", "xjp", "gjsin", ""],
    ["大阪", "dz", "gjosa", ""],
    ["曼谷", "mg", "gjbkk", ""],
    ["台北", "tb", "gjtpe", ""],
    ["悉尼", "xn", "gjsyd", ""],
    ["巴黎", "bl", "gjcdg", ""],
    ["纽约", "ny", "gjnyc", ""]
];
KX.AC.mychannels = [
{
    "name":"JipiaoStart", 
        "channel":"JipiaoGN",
        "input":"frmcity",
        "container":"container1",
		"containerWidth":200,
        "resultCount":10,
        "resultsJsonTag":["sKey", "sJianpin", "sAbbr"]
},
{
    "name":"JipiaoEnd", 
    "channel":"JipiaoGN",
    "input":"tocity",
    "container":"container2",
	"containerWidth":200,
    "resultCount":10,
    "resultsJsonTag":["sKey", "sJianpin", "sAbbr"]
},
{
    "name":"HqJipiaoStart", 
        "channel":"JipiaoGN",
        "input":"hqfrmcity",
        "container":"container3",
		"containerWidth":140,
        "resultCount":10,
        "resultsJsonTag":["sKey", "sJianpin", "sAbbr"]
},
{
    "name":"HqJipiaoEnd", 
    "channel":"JipiaoGN",
    "input":"hqtocity",
    "container":"container4",
	"containerWidth":140,
    "resultCount":10,
    "resultsJsonTag":["sKey", "sJianpin", "sAbbr"]
}
];
KX.AC.init = function(configs) {
    var nChannels = configs.length;
    for(var i=0; i<nChannels; i++){
        var item = configs[i];
        if(!item.name || !item.channel || !item.input ||!item.container||!item.resultsJsonTag){
            continue;
        }
        if(!item.count){
            item.count = 10;
        }
        KX.AC[item["name"]] = new function(item){
            this.oACDS = new YAHOO.widget.DS_ScriptNode("http://www.kuxun.cn/complete/search.fcgi?count="+item.count+"&ch="+item.channel, ["ResultSet.Result"].concat(item.resultsJsonTag));
            this.oACDS.scriptQueryParam = "q";
            if(item['channel'] == "Hotel"){
                this.oACDS.scriptQueryAppendByOtherInput = {'param':"city", 'id':'city'};
            }
            this.oACDS.maxCacheEntries = 0;

            // Instantiate AutoComplete
            this.oAutoComp = new YAHOO.widget.AutoComplete(item.input, item.container, this.oACDS);
            this.oAutoComp.queryDelay = 0;
            this.oAutoComp.animVert = false;
            this.oAutoComp.useShadow = true;
            this.oAutoComp.useIFrame = true;
            if(item.containerWidth){
                this.oAutoComp.containerWidth = item.containerWidth;
            }
//            this.oAutoComp.forceSelection = true;
            this.oAutoComp.prehighlightClassName = "yui-ac-prehighlight";
            this.oAutoComp.setHeader("输入中文/拼音或↑↓选择.")
            this.oAutoComp.formatResult = function(oResultItem, sQuery) {
                var nResultLen = oResultItem.length;
                var oResultItemObject = {};
                for(var i=0; i<nResultLen; i++){
                    oResultItemObject[item.resultsJsonTag[i]] = oResultItem[i];
                }
                var sKey = oResultItemObject["sKey"].slice(0,12);
                if(sKey.indexOf(sQuery) == 0){
                    var sKeyQuery = sKey.substr(0, sQuery.length);
                    var sKeyRemainder = sKey.substr(sQuery.length);
                    var aMarkup = [];
                    aMarkup.push("<div class='sample-result'><div class='sample-quantity'>");
                    if(oResultItemObject.nQuantity){
                        aMarkup.push("约"+oResultItemObject.nQuantity+"查询");
                    }
                    aMarkup = aMarkup.concat(["</div><span class='sample-query'>",
                        sKeyQuery,
                        "</span>",
                        sKeyRemainder]);
                    if(oResultItemObject.sJianpin){
                        aMarkup = aMarkup.concat(["(",
                            oResultItemObject.sJianpin.toUpperCase(),
                            ")"]);
                    }
                    aMarkup.push("</div>");
                }else{
                    var aMarkup = [];
                    aMarkup.push("<div class='sample-result'><div class='sample-quantity'>");
                    if(oResultItemObject.nQuantity){
                        aMarkup.push("约"+oResultItemObject.nQuantity+"查询");
                    }
                    aMarkup = aMarkup.concat(["</div>",
                        sKey]);
                    if(oResultItemObject.sJianpin){
                        aMarkup = aMarkup.concat(["(",
                            oResultItemObject.sJianpin.toUpperCase(),
                            ")"]);
                    }
                    aMarkup.push("</div>");
                }
                return (aMarkup.join(""));
            };
            if(item["channel"] == "JipiaoGN" || item["channel"] == "JipiaoGJ"){
                /*
                this.oAutoComp.textboxFocusEvent.subscribe(function(){
                    var inString ='汉字、拼音或首字母';
                    if(this._elTextbox.value == inString){
                        this._elTextbox.value = "";
                    }
                    this._populateList('', KX.AC[item.channel+"PrePopulateListData"], this);
					if($("#frmcity")){
						$("#frmcity").css("color","#333");
					}
					if($("#tocity")){
						$("#tocity").css("color","#333");
					}
                });
                this.oAutoComp.itemSelectEvent.subscribe(function(type, args){
                    var result = args[2];
					if($("#searchhotel")){
						if(item["channel"] == "JipiaoGJ" && item['name'] == "JipiaoEnd"){
							to_code = result[2].toUpperCase();
							if(HRS[to_code]){
								$("#searchhotel").attr("checked","cheched");
							}
							else{
								$("#searchhotel").removeAttr("checked");
							}
						}
					}
					if(item['name'] == "JipiaoStart"){
                        document.sjipiao.From.value = result[2].toUpperCase();
                    }
                    if(item['name'] == "JipiaoEnd"){
                        document.sjipiao.to.value = result[2].toUpperCase();
                    }

                });
                */
                this.oAutoComp.itemSelectEvent.subscribe(function(){
                        //changeAirType(getRadioValue('type'));
                        changeAirType($('#internal_search_type').val() || 1);
                }); 

            }
        }(item);
    }
}
/**
  add performacne test.                                                                                                                             
 */
var perf_start = +(new Date());
var perf_show_flight_flag  = 0;

function gE(x){return document.getElementById(x);}
function gETop(x){var t=0;while(x){t+=x.offsetTop;x=x.offsetParent;}return t;}
function gEBottom(x){return (x.offsetHeight+gETop(x));}
function gELeft(x){var l=0;while(x){l+=x.offsetLeft;x=x.offsetParent;}return l;}
function gERight(x){return (x.offsetWidth+gELeft(x));}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if(endstr == -1) {
		endstr = document.cookie.length;
	}
	return document.cookie.substring(offset, endstr);
}
function getCookie(name) {
	var arg = name + "=";
	var alen = arg.length;
	var clen = document.cookie.length;
	var i = 0;
	var j = 0;
	while(i < clen) {
		j = i + alen;
		if(document.cookie.substring(i, j) == arg)
			return getCookieVal(j);
		i = document.cookie.indexOf(" ", i) + 1;
		if(i == 0)
			break;
	}
	return null;
}
function deleteCookie(name) {
	var exp = new Date();
	var cval = getCookie(name);
	exp.setTime(exp.getTime() - 1);
	document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
function setCookie(name, value) {
	var argv = setCookie.arguments;
	var argc = setCookie.arguments.length;
	var exp = (argc > 2) ? argv[2] : 90;
	var path = (argc > 3) ? argv[3] : null;
	var domain = (argc > 4) ? argv[4] : null;
	var secure = (argc > 5) ? argv[5] : false;
	var expires = new Date();
	deleteCookie(name);
	expires.setTime(expires.getTime() + (exp*24*60*60*1000));
	document.cookie = name + "=" + value +
		"; expires=" + expires.toGMTString() +
		((domain == null) ? "" : ("; domain=" + domain)) +
		((path == null) ? "" : ("; path=" + path)) +
		((secure == true) ? "; secure" : "");
}
var gAjaxObj=null;
var gAjaxFiles=new Array();
var gAjaxInUse=false;
gAjaxFiles.length=0;

function ajaxGetObj(){
	var obj=null;
	if(window.XMLHttpRequest){
		obj=new XMLHttpRequest();
	}else{
		obj=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return (obj);
}
function ajaxOnGetFile() {
	if(typeof(gAjaxObj) == "undefined" || gAjaxObj == null) {
		return false;
	}
	if(gAjaxObj.readyState != 4) {
		return false;
	}
	if(gAjaxFiles.length > 0) {
		gAjaxFiles[0][1](gAjaxObj.responseText);
		gAjaxFiles.shift();
	}
	gAjaxInUse = false;
	if(gAjaxFiles.length > 0) {
		ajaxGetNextFile();
	}
}
function ajaxGetNextFile() {
	if(typeof(gAjaxObj) == "undefined" || gAjaxObj == null) {
		gAjaxObj=ajaxGetObj();
	}
	if(!gAjaxInUse) {
		gAjaxObj.open("GET", gAjaxFiles[0][0], true);
		gAjaxObj.onreadystatechange=ajaxOnGetFile;
		gAjaxObj.send(null);
		gAjaxInUse = true;
	}
}
function ajaxGetFile(fpath, func) {
	var ddddd = new Date();
	var sssss = ddddd.getTime()+Math.floor(Math.random()*100000);
	if(fpath.indexOf("?")>0){
		fpath += '&randno='+ sssss
	}else{
		fpath += '?randno='+ sssss;
	}

	gAjaxFiles[gAjaxFiles.length] = new Array(fpath, func);
	ajaxGetNextFile();
}

function showHeadUrl(){
	var url=window.location.href;
	if(url.indexOf("fast_air_search_wrap")!=-1) {
	var m='<a href="/?kxlog=tgright_toindex" target="_blank">机票首页</a><span style="color:#1438ce"> | </span><a href="http://fang.kuxun.cn" target="_blank">住房</a><span style="color:#1438ce"> | </span><a href="http://offer.kuxun.cn" target="_blank">工作</a><span style="color:#1438ce"> | </span><a href="http://bbs.kuxun.cn" target=_blank>社区</a>';
	} 
	else
	{
	var m='<a href="http://fang.kuxun.cn" target="_blank">住房</a><span style="color:#1438ce"> | </span><a href="http://offer.kuxun.cn" target="_blank">工作</a><span style="color:#1438ce"> | </span><a href="http://bbs.kuxun.cn" target=_blank>社区</a>';
	}
	var user=getCookie('kxuser');
	var userid=getCookie('kxuserid');
	if(user!=""&&userid!=""&&user&&userid){
	 var userd=decodeURIComponent(user);
	  m+=' | <a href="http://bbs.kuxun.cn/space.php?action=viewpro&uid='+userid+'" target="_blank"><strong>'+userd+'</strong></a>';
      m+=' | <a href="http://bbs.kuxun.cn/logging.php?action=logout">退出</a>';
	}
	else{
	  m+=' | <a href="http://bbs.kuxun.cn/logging.php?action=login">登录</a>';
	}
	var d=gE('user-login');
	if(d){d.innerHTML=m;}
}

function showUserPanel(){
	var user=getCookie('kxuser');
	var userid=getCookie('kxuserid');
	var m;
	if(user!=""&&userid!=""&&user&&userid){
	 var userd=decodeURIComponent(decodeURIComponent(user));
	  m =' <a href="http://bbs.kuxun.cn/space.php?action=viewpro&uid='+userid+'" onclick="logback(\'topright_viweuser\')" target="_blank" style="margin-right:4px;"><strong>'+userd+'</strong></a>';
      m +='<a href="http://bbs.kuxun.cn/logging.php?action=logout" onclick="logback(\'topright_logout\')">退出</a>';
	}
	else{
	  m = '<a href="http://bbs.kuxun.cn/logging.php?action=login" onclick="logback(\'topright_login\')">登录</a>';
	}
	m +=' <var>&nbsp;|&nbsp;</var><a href="http://home.kuxun.cn/help" target="_blank">帮助</a>';

	var d=gE('user-login');
	if(d){d.innerHTML=m;}
}

function cf(flashsrc,flashwidth,flashheight,flashlink,br)
{
	 document.write("<table width="+flashwidth+" height="+flashheight+" border=0 cellpadding=0 cellspacing=0><tr><td>");
	 document.write("<div style=\"position:relative\">");
	 document.write("<embed style=\"position:absolute;top:0;left:0;z-index:0\" src="+flashsrc+" quality=\"high\" width="+flashwidth+" height="+flashheight+" TYPE=\"application/x-shockwave-flash\" PLUGINSPAGE=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" wmode=\"opaque\"></embed>");
	 document.write("<div style=\"position:relative;filter:alpha(opacity=0);-moz-opacity:0;z-index:10;left:0;top:0;background:transparent !important;background:#cdeaf6;width:"+flashwidth+";height:"+flashheight+"px;\">");
	 document.write("<a href="+flashlink+" target=\"_blank\" style=\"cursor:pointer;display:block;width:"+flashwidth+";height:"+flashheight+"px;\">");
	 document.write("<img src=\"img/touming.gif\" width=\"100%\" height=\"100%\"/></a>");
	 document.write("</div>");
	 document.write("</div>");
	 document.write("</td></tr></table>");
	 if (br=="1") 
	 {
		 document.write("<br>");
	 }
}

function cf1(flashsrc,flashwidth,flashheight,br)
{
	 document.write("<embed src=\""+flashsrc+"\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width="+flashwidth+" height="+flashheight+" align=center></embed>");
	 if (br=="1") 
	 {
		 document.write("<br><br>");
	 }
}

function addParam2(key, value)
{
	if(!key || "" == key || !value || "" == value)
	{
		return;
	}
	var ahrefs = document.getElementsByTagName('A');
	var reppre = "&" + key;
	var repall = reppre + "=" + value;
	for(var i = 0; i < ahrefs.length; i++)
	{
		if(ahrefs[i].name != "img"){
		if(typeof(ahrefs[i].href) != "string" )
			continue;
		if(ahrefs[i].href.lastIndexOf("javascript")!=-1)
			continue;
		if(-1 != ahrefs[i].href.indexOf('?'))
		{
			if(-1 == ahrefs[i].href.indexOf(reppre))
				ahrefs[i].href+=(repall);
		}
		else
		{
			ahrefs[i].href+=("?" + key + "=" + value);
		}
		}
	}
}

function GetValueFromUrl(key)
{
	if(!key || key == "")
	{
		return "";
	}
	var myhref = window.location.href;
	var pos = myhref.indexOf(key + "=");
	if(-1 == pos)
	{
		return "";
	}
	
	var ch = myhref.charAt(pos-1);
	if(ch == '&' || ch == '?')
	{
		var pos2 = myhref.indexOf("&", pos);
		var value = "";
		var len = key.length + 1;
		if(-1 != pos2)
		{
			if(pos2 - pos > len)
			{
				value = myhref.substring(pos + len, pos2);
			}
		}
		else
		{
			if(pos + len < myhref.length && myhref.charAt(pos + len) != ' ')
			{
				value = myhref.substring(pos + len);
			}
		}

		return value;
	}
}
function creatElement(key,value){
	var   oInput   =   document.createElement("INPUT");
	oInput.setAttribute("type","hidden"); 
	oInput.setAttribute("name",key);
	oInput.setAttribute("id",key);
	oInput.setAttribute("value",value);
	var oForm = document.s;
	oForm.appendChild(oInput); 
}
function addParam(key)
{
	if(!key || key == "")
	{
		return;
	}
	var myhref = window.location.href;
	var pos = myhref.indexOf(key + "=");
	if(-1 == pos)
		return;
	var ch = myhref.charAt(pos-1);
	if(ch == '&' || ch == '?')
	{
		var pos2 = myhref.indexOf("&", pos);
		var value = "";
		var len = key.length + 1;
		if(-1 != pos2)
		{
			if(pos2 - pos > len)
			{
				value = myhref.substring(pos + len, pos2);
				addParam2(key, value)

			}
		}
		else
		{
			if(pos + len < myhref.length && myhref.charAt(pos + len) != ' ')
			{
				value = myhref.substring(pos + len);
				addParam2(key, value);
			}
		}
		//alert(document.getElementsByName(key).length);
		if((document.getElementsByName(key).length==0) && value!=""){
				
				creatElement(key,value);
		}

	}
}

function GetParam(key)
{
	if(!key || key == "")
	{
		return;
	}
	var myhref = window.location.href;
	var pos = myhref.indexOf(key + "=");
	if(-1 == pos)
		return;
	var ch = myhref.charAt(pos-1);
	if(ch == '&' || ch == '?')
	{
		var pos2 = myhref.indexOf("&", pos);
		var value = "";
		var len = key.length + 1;
		if(-1 != pos2)
		{
			if(pos2 - pos > len)
			{
				value = myhref.substring(pos + len, pos2);

			}
		}
		else
		{
			if(pos + len < myhref.length && myhref.charAt(pos + len) != ' ')
			{
				value = myhref.substring(pos + len);
			}
		}

	}
	return value;
}
function getRevisedCityCode(code_)
{
	if(code_ == "NAY")
	{
		return "PEK";
	}
	else if(code_ == "PVG")
	{
		return "SHA";
	}

	return code_;
}

function copyToClipBoard(){
	var clipBoardContent=''; 
	clipBoardContent+="推荐一个机票搜索网站给你--酷讯网,通过搜索比较多家机票网站的报价,总是能找到最便宜的机票,我用过了,觉得非常不错,值得推荐,酷讯网址";
	clipBoardContent+=" http://jipiao.kuxun.cn";
    window.clipboardData.setData("Text",clipBoardContent);
	alert("酷讯机票标题和地址已经复制，您可以粘贴到QQ、MSN里发送给好友了。");
}

//for ajax functions
function defaultcallback(str){}
function logback(id, suffix)
{
	var u= '/null.htm?kxlog='+id;
	if(typeof(suffix) != "undefined" && "" != suffix)
	{
		u += "&" + suffix;
	}
	ajaxGetFile(u, defaultcallback);
}
 function getDateDiff(date1,date2){
   
   var   re   =   /^(\d{4})\S(\d{1,2})\S(\d{1,2})$/;  
   var   dt1,dt2;  
   if   (re.test(date1))  
   {  
    dt1   =   new   Date(RegExp.$1,RegExp.$2   -   1,RegExp.$3);  
   }
   
   if   (re.test(date2))  
   {  
    dt2   =   new   Date(RegExp.$1,RegExp.$2   -   1,RegExp.$3);  
   } 
   
   return Math.floor((dt2-dt1)/(1000 * 60 * 60 * 24))
 }

function getjxforshort(str){
  if(str.length>10)
  {
  	 newstr=""
	  for(i=str.length-1;i>=0;i--)
	  {
	  	ch=str.charAt(i);
	  	newstr=ch+newstr;
	    if((ch.charCodeAt(0)>=65)&&(ch.charCodeAt(0)<=90))
			break;
		}
  
  }
  else
  	newstr=str;
  if(newstr.indexOf('-')!=-1)
  {
	 newstrarr=newstr.split('-');
	 newstr=newstrarr[0];
}
  return newstr;
}

function addParaWithValue(url,value){
	if(value=="" || !value)
		return url;
	else{
		if(typeof(url) != "string")
		return url;
		else{
			if((url.indexOf('?'))< 0){
				newurl = url+"?"+value; 
			}
			else{
				newurl =url +"&"+value; 
			}
		return newurl;
		}
	}

}
function IsNumeric(port)  
{  
  var   pattern=/^\d+$/;  
  if(!pattern.test(port))  
  return   false;  
  return   true;  
}
function getAirPort(plain,city){
	var pattern = /^[A-Z]{3}$/;
	if(!pattern.test(plain)){
		airport = GetAirPortCode(plain,city);
	}
	else{
		airport = plain;
	}
	return airport;
}
function loadScript(url, callback)
{
    var el = document.createElement("script");
    el.src = url;
    el.type = "text/javascript";
    el.language = "javascript";
    document.getElementsByTagName("head")[0].appendChild(el);
    el.onreadystatechange = function () {
        if (el.readyState == 'complete' || el.readyState == 'loaded' || el.readyState == 'interactive') {
            callback();
        }
    }
    el.onload = function () {
        callback();
    }
}
function showLoginHtml(){
				  login_user = getCookie("uchome_username");
				  login_email = getCookie("uchome_email");
				  login_uid = getCookie("uchome_uid");
                  var head_img_HTML = '<img onerror="this.src=\'http://passport.kuxun.cn/template/image/noavatar_big.gif\'" src="http://passport.kuxun.cn/template/image/noavatar_big.gif">';

                  if(login_user=="" || login_user==null){
					  if(login_email =="" || login_email==null)
					  {   
						 // login_HTML = '<a href="http://yiqiwan.kuxun.cn/global_login/user_login.php">登录</a><var>&nbsp;|&nbsp;</var><a href="http://yiqiwan.kuxun.cn/global_login/user_reg.php" target="_blank">注册</a><var>&nbsp;|&nbsp;</var><a href="http://home.kuxun.cn/help/" target="_blank">帮助***</a>'
                         login_HTML = '<a href="#" onmouseover="this.href=\'http://passport.kuxun.cn/login\'">登录</a><span class="jiange">|</span><a href="#" onmouseover="this.href=\'http://passport.kuxun.cn/register\'">注册</a><span class="jiange">|</span><a href="#" onmouseover="this.href=\'http://home.kuxun.cn/helpcenter/\'" target="_blank">帮助</a>';
					  }   
					  else{
						  login_HTML = '<a href="#" onmouseover="this.href=\'http://passport.kuxun.cn/\'" target="_blank">'+unescape(login_email)+'</a><span class="jiange">|</span><a href="javascript:logout();">退出</a><span class="jiange">|</span><a href="#" onmouseover="this.href=\'http://home.kuxun.cn/helpcenter/\'" target="_blank">帮助</a>';

					  }   
				  }   
				  else{
					  var userhtml = decodeURIComponent(decodeURIComponent(login_user));
					  login_HTML = '<span class="huanying"><a href="#" onmouseover="this.href=\'http://passport.kuxun.cn/\'" target="_blank">你好 '+userhtml+'</a></span><span class="jiange">|</span><a href="javascript:logout();">退出</a><span class="jiange">|</span><a href="#" onmouseover="this.href=\'http://home.kuxun.cn/helpcenter/\'" target="_blank">帮助</a>';
                        head_img_HTML = '<img onerror="this.src=\'/template/image/avatar.gif\'" src="http://yiqiwan.kuxun.cn/api/ps_avatar.php?uid='+login_uid+'">';
                  }
                  //login_HTML += '<span class="jiange">|</span><a href="#" id="favorite">收藏本站</a>';
				  $("#login_span_v3").html(login_HTML);
				  if($("#user_name"))
                    $("#user_name").html(userhtml);
				  
                  if($('#img_div')){
                    $("#img_div").html(head_img_HTML);
                  }
		 }
function logout(){
		$.getScript("http://passport.kuxun.cn/admin?act=logout&randID="+Math.random(),function(data){
			logout_HTML = '<a href="#" onmouseover="this.href=\'http://passport.kuxun.cn/login\'">登录</a><span class="jiange">|</span><a href="#" onmouseover="this.href=\'http://passport.kuxun.cn/register\'">注册</a><span class="jiange">|</span><a href="#" onmouseover="this.href=\'http://home.kuxun.cn/helpcenter/\'" target="_blank">帮助</a>';
            //login_HTML += '<span class="jiange">|</span><a href="#" id="favorite">收藏本站</a>'; 
	 		$("#login_span_v3").html(logout_HTML);	
		});
}
//
function log_google_tracker(category, action, optional_label, optional_value)
{
    if (pageTracker)
    {
        pageTracker._trackEvent(category, action, optional_label, optional_value);
    }
}
$(document).ready(function(){
    //add click favourite
    $('.favourite').click(function(){
        try
        {
            if(document.all) 
            {
                window.external.addFavorite('http://www.kuxun.cn/','酷讯旅游搜索引擎 www.kuxun.cn');
            } 
            else
            {
                window.sidebar.addPanel('酷讯旅游搜索引擎 www.kuxun.cn','http://www.kuxun.cn/','');
            }
        }
        catch(e)
        {};
        return false;
    });
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
	loadScript(gaJsHost+"google-analytics.com/ga.js", function(){
        if ('function' == typeof(_kx_log))
        {
            //_kx_log(3);
            var page_type = 'undefined' == typeof(__page_type) ? 0 : __page_type;
            _kx_log(page_type);
        }
        else
        {
            pageTracker = _gat._getTracker("UA-5254304-1");
            pageTracker._setDomainName(".kuxun.cn");
            pageTracker._trackPageview();
        }
        /*
        var current_url = document.URL;
        //js_debug('current_url = ' + current_url);
        var reg = /tg=fcg/i;
        if (current_url.match(reg))
        {
            pageTracker = _gat._getTracker("UA-5254304-8");
            //js_debug('google new ID: UA-5254304-8');
		}else
        {
            pageTracker = _gat._getTracker("UA-5254304-1"); 
            //js_debug('google ID: UA-5254304-1');
        }
        tracker = pageTracker;
        pageTracker._setDomainName(".kuxun.cn");
        pageTracker._trackPageview();
        */
		isLoadDone = true;
        //bd_count
        if ('function' == typeof(kx_create_log))
        {
            kx_create_log();
        }
        var login_user = getCookie("uchome_username");
	    var	login_email = getCookie("uchome_email");
        if(login_user && login_email)
        {
            log_google_tracker('Global','Auth','IsLogin',1);           
        }
    });
});
function log_clickstat_tracker(p) {
    var clickstat_url = 'http://stat.jipiao.kuxun.cn/null.html';
    clickstat_sender_iframe = $('#clickstat_sender_iframe');
    if (clickstat_sender_iframe.length == 0) {
        $(document.body).append('<iframe src="" id="clickstat_sender_iframe" style="display:none"></iframe>');
        clickstat_sender_iframe = $('#clickstat_sender_iframe');
    }
    var __utmkx = _kx_cookie('__utmkx') || '';
    var c = __utmkx.split('|>');
    var vid = _kx_cookie('__utmguid');
    if (null == vid) {
        vid = '0';
    }
    var __utmkxversion = _kx_cookie('__utmkxversion');
    if (null == __utmkxversion) {
        __utmkxversion = '';
    }
    p[p.length] = ['et', c[0]];
    p[p.length] = ['st', c[1]];
    p[p.length] = ['s', c[5]];
    p[p.length] = ['pt', c[8]];
    p[p.length] = ['vid', vid];
    p[p.length] = ['ver', __utmkxversion];
    p[p.length] = ['rand', Math.floor(Math.random()*100000)];
    var t = [];
    for (i = 0; i < p.length; i ++) {
        t[t.length] = p[i][0] + '=' + encodeURIComponent(p[i][1]);
    };
    clickstat_sender_iframe.attr('src', clickstat_url + '?' + t.join('&'));
}
function _kx_cookie(name, value, options) {
    if (typeof value != 'undefined') { // name and value given, set cookie
        options = options || {}; 
        if (value === null) {
            value = ''; 
            options.expires = -1; 
        }   
        var expires = ''; 
        if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
            var date;
            if (typeof options.expires == 'number') {
                date = new Date();
                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
            } else {
                date = options.expires;
            }   
            expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
        }   
        // CAUTION: Needed to parenthesize options.path and options.domain
        // in the following expressions, otherwise they evaluate to undefined
        // in the packed version for some reason...
        var path = options.path ? '; path=' + (options.path) : ''; 
        var domain = options.domain ? '; domain=' + (options.domain) : ''; 
        var secure = options.secure ? '; secure' : ''; 
        document.cookie = [name, '=', value, expires, path, domain, secure].join('');
    } else { // only name given, get cookie
        var cookieValue = null;
        if (document.cookie && document.cookie != '') {
            var cookies = document.cookie.split(';');
            for (var i = 0; i < cookies.length; i++) {
                var cookie = jQuery.trim(cookies[i]);
                // Does this cookie string begin with the name we want?
                if (cookie.substring(0, name.length + 1) == (name + '=')) {
                    cookieValue = cookie.substring(name.length + 1);
                    break;
                }   
            }   
        }   
        return cookieValue;
    }   
};

$(document).ready(function(){
    $('[_logname|=""]').each(function(){
        $(this).bind('mousedown', function(){
            var _logname = $(this).attr('_logname');
            if (null == _logname) return;
            var _logvalue = $(this).attr('_logvalue');
            if ('undefined' == typeof(_logvalue)) _logvalue = '';
            log_clickstat_tracker([['n', _logname], ['v', _logvalue]]);
        });
    });
});
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept == "undefined") var deconcept = new Object();
if(typeof deconcept.util == "undefined") deconcept.util = new Object();
if(typeof deconcept.SWFObjectUtil == "undefined") deconcept.SWFObjectUtil = new Object();
deconcept.SWFObject = function(swf, id, w, h, ver, c, quality, xiRedirectUrl, redirectUrl, detectKey) {
	if (!document.getElementById) { return; }
	this.DETECT_KEY = detectKey ? detectKey : 'detectflash';
	this.skipDetect = deconcept.util.getRequestParameter(this.DETECT_KEY);
	this.params = new Object();
	this.variables = new Object();
	this.attributes = new Array();
	if(swf) { this.setAttribute('swf', swf); }
	if(id) { this.setAttribute('id', id); }
	if(w) { this.setAttribute('width', w); }
	if(h) { this.setAttribute('height', h); }
	if(ver) { this.setAttribute('version', new deconcept.PlayerVersion(ver.toString().split("."))); }
	this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion();
	if (!window.opera && document.all && this.installedVer.major > 7) {
		// only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE
		deconcept.SWFObject.doPrepUnload = true;
	}
	if(c) { this.addParam('bgcolor', c); }
	var q = quality ? quality : 'high';
	this.addParam('quality', q);
	this.setAttribute('useExpressInstall', false);
	this.setAttribute('doExpressInstall', false);
	var xir = (xiRedirectUrl) ? xiRedirectUrl : window.location;
	this.setAttribute('xiRedirectUrl', xir);
	this.setAttribute('redirectUrl', '');
	if(redirectUrl) { this.setAttribute('redirectUrl', redirectUrl); }
}
deconcept.SWFObject.prototype = {
	useExpressInstall: function(path) {
		this.xiSWFPath = !path ? "expressinstall.swf" : path;
		this.setAttribute('useExpressInstall', true);
	},
	setAttribute: function(name, value){
		this.attributes[name] = value;
	},
	getAttribute: function(name){
		return this.attributes[name];
	},
	addParam: function(name, value){
		this.params[name] = value;
	},
	getParams: function(){
		return this.params;
	},
	addVariable: function(name, value){
		this.variables[name] = value;
	},
	getVariable: function(name){
		return this.variables[name];
	},
	getVariables: function(){
		return this.variables;
	},
	getVariablePairs: function(){
		var variablePairs = new Array();
		var key;
		var variables = this.getVariables();
		for(key in variables){
			variablePairs[variablePairs.length] = key +"="+ variables[key];
		}
		return variablePairs;
	},
	getSWFHTML: function() {
		var swfNode = "";
		if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { // netscape plugin architecture
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "PlugIn");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'"';
			swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';
			swfNode += ' allowScriptAccess="always" ';
			var params = this.getParams();
			 for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }
			var pairs = this.getVariablePairs().join("&");
			 if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }
			swfNode += '/>';
		} else { // PC IE
			if (this.getAttribute("doExpressInstall")) {
				this.addVariable("MMplayerType", "ActiveX");
				this.setAttribute('swf', this.xiSWFPath);
			}
			swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'" style="'+ this.getAttribute('style') +'">';
			swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';
			var params = this.getParams();
			for(var key in params) {
			 swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';
			}
			var pairs = this.getVariablePairs().join("&");
			if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}
			swfNode += '<param name="allowScriptAccess" value="always" />';
			swfNode += "</object>";
		}
		return swfNode;
	},
	write: function(elementId){
		if(this.getAttribute('useExpressInstall')) {
			// check to see if we need to do an express install
			var expressInstallReqVer = new deconcept.PlayerVersion([6,0,65]);
			if (this.installedVer.versionIsValid(expressInstallReqVer) && !this.installedVer.versionIsValid(this.getAttribute('version'))) {
				this.setAttribute('doExpressInstall', true);
				this.addVariable("MMredirectURL", escape(this.getAttribute('xiRedirectUrl')));
				document.title = document.title.slice(0, 47) + " - Flash Player Installation";
				this.addVariable("MMdoctitle", document.title);
			}
		}
		if(this.skipDetect || this.getAttribute('doExpressInstall') || this.installedVer.versionIsValid(this.getAttribute('version'))){
			var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;
			n.innerHTML = this.getSWFHTML();
			return true;
		}else{
			if(this.getAttribute('redirectUrl') != "") {
				document.location.replace(this.getAttribute('redirectUrl'));
			}
		}
		return false;
	}
}

/* ---- detection functions ---- */
deconcept.SWFObjectUtil.getPlayerVersion = function(){
	var PlayerVersion = new deconcept.PlayerVersion(0,0,0);
    if(navigator.plugins && navigator.mimeTypes.length){
        var x = navigator.plugins["Shockwave Flash"];
        if(x && x.description) {
            PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
        }
    }else if (window.ActiveXObject){
       try {
          var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
		//alert(axo.GetVariable("$version"));
           PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
       } catch (e) {}
    }
    return PlayerVersion;	
/*


	var PlayerVersion = new deconcept.PlayerVersion([0,0,0]);
	if(navigator.plugins && navigator.mimeTypes.length){
		var x = navigator.plugins["Shockwave Flash"];
		if(x && x.description) {
			PlayerVersion = new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));
		}
	}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
		var axo = 1;
		var counter = 3;
		while(axo) {
			try {
				counter++;
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
//				document.write("player v: "+ counter);
				PlayerVersion = new deconcept.PlayerVersion([counter,0,0]);
			} catch (e) {
				axo = null;
			}
		}
	} else { // Win IE (non mobile)
		// do minor version lookup in IE, but avoid fp6 crashing issues
		// see http://blog.deconcept.com/2006/01/11/getvariable-setvariable-crash-internet-explorer-flash-6/
		try{
			var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		}catch(e){
			try {
				var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
				PlayerVersion = new deconcept.PlayerVersion([6,0,21]);
				axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)
			} catch(e) {
				if (PlayerVersion.major == 6) {
					return PlayerVersion;
				}
			}
			try {
				axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			} catch(e) {}
		}
		if (axo != null) {
			PlayerVersion = new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));
		}
	}
	return PlayerVersion;*/
}
deconcept.PlayerVersion = function(arrVersion){
	this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;
	this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;
	this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;
}
deconcept.PlayerVersion.prototype.versionIsValid = function(fv){
	if(this.major < fv.major) return false;
	if(this.major > fv.major) return true;
	if(this.minor < fv.minor) return false;
	if(this.minor > fv.minor) return true;
	if(this.rev < fv.rev) return false;
	return true;
}
/* ---- get value of query string param ---- */
deconcept.util = {
	getRequestParameter: function(param) {
		var q = document.location.search || document.location.hash;
		if (param == null) { return q; }
		if(q) {
			var pairs = q.substring(1).split("&");
			for (var i=0; i < pairs.length; i++) {
				if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
					return pairs[i].substring((pairs[i].indexOf("=")+1));
				}
			}
		}
		return "";
	}
}
/* fix for video streaming bug */
deconcept.SWFObjectUtil.cleanupSWFs = function() {
	var objects = document.getElementsByTagName("OBJECT");
	for (var i = objects.length - 1; i >= 0; i--) {
		objects[i].style.display = 'none';
		for (var x in objects[i]) {
			if (typeof objects[i][x] == 'function') {
				objects[i][x] = function(){};
			}
		}
	}
}
// fixes bug in some fp9 versions see http://blog.deconcept.com/2006/07/28/swfobject-143-released/
if (deconcept.SWFObject.doPrepUnload) {
	if (!deconcept.unloadSet) {
		deconcept.SWFObjectUtil.prepUnload = function() {
			__flash_unloadHandler = function(){};
			__flash_savedUnloadHandler = function(){};
			window.attachEvent("onunload", deconcept.SWFObjectUtil.cleanupSWFs);
		}
		window.attachEvent("onbeforeunload", deconcept.SWFObjectUtil.prepUnload);
		deconcept.unloadSet = true;
	}
}
/* add document.getElementById if needed (mobile IE < 5) */
if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}

/* add some aliases for ease of use/backwards compatibility */
var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for legacy support
var SWFObject = deconcept.SWFObject;
function changeVersion(page, task, ver)
{
    window.location = "/split_test.php?action=changeversion&page="+page+"&task="+task+"&ver="+ver+"&url="+encodeURIComponent(window.location);
}
/** @file index_v2/jipiao_index.js */
/**
fix bug, make one patch.
*/
//var tab_flag ='from';
var __page_type = 3;    /** for new analytics system #2010.07*/

var arrived = 0;
var tracker
var isLoadDone = false;
function StringBuffer() {
    this.data = new Array();
}
StringBuffer.prototype.append = function(str) {
    this.data.push(str);
    return this;
}
StringBuffer.prototype.toString = function() {
    return this.data.join("");
}
function addDocClickEvent(func) {
    var oldfunc = window.document.onclick;
    if (typeof window.document.onclick != 'function') {
        window.document.onclick = func;
    } else {
        window.document.onclick = function() {
            oldfunc();
            func();
        }
    }
}
function addWindowResetEvent(func) {
    var oldfunc = window.onresize;
    if (typeof window.onresize != 'function') {
        window.onresize = func;
    } else {
        window.onresize = function() {
            oldfunc();
            func();
        }
    }
}
var hqfrmcity;
var hqtocity;
var fesfrmcity;
var festocity;
/*
function showChgCity() {
var gcs   = document.getElementById('gcs');
var label = document.getElementById("gcity");
gcs.style.top  = gEBottom(label) + "px";
gcs.style.left = (gELeft(label) - 10) + "px";
gcs.style.display = "block";
}
function resizeChgCity() {
var gcs   = document.getElementById('gcs');
var label = document.getElementById("gcity");
gcs.style.top  = gEBottom(label) + "px";
gcs.style.left = (gELeft(label) - 10) + "px";
}
function chgCity(cityname) {
var citycode = getCityCode(cityname);
document.getElementById("gcity").innerHTML = cityname;
document.getElementById("hqfrmcity").innerHTML = cityname;
sousuohq();
chg6Corps(citycode);
hideChgCity();
}
function hideChgCity() {
document.getElementById('gcs').style.display = "none";
}
*/
var arrcorps = new Array(
"www.airchina.com.cn 国航",
"www.ce-air.com 东航",
"www.csair.com 南航",
"www.hnair.com 海航",
"www.shenzhenair.com 深航",
"www.shanghai-air.com 上航",
"www.scal.com.cn 川航",
"ho.travelsky.com 吉祥航空",
"www.china-sss.com 春秋航空",
"www.eaststar-air.com 东星",
"www.luckyair.net 祥鹏航空",
"www.ueair.com 鹰联航空",
"www.cu-air.com 联合航空",
"www.ctrip.com 携程网",
"www.yoee.com 游易网",
"www.mangocity.com 芒果网",
"www.16885.com 均瑶旅行网",
"www.9588.com 9588网");
var randcount = 0;
function randomcorp() {
    if(randcount == arrcorps.length) {
        randcount = 0;
    }
    document.getElementById("corprandom").innerHTML = arrcorps[randcount];
    setTimeout(randomcorp, 2000);
    randcount++;
}
function citypickerhandler(cityname, citycode) {
    sousuohq();
}
function showRadioByType(){
    if(type == 2) {
        document.getElementById("redate").style.display = "block";
        document.getElementById("return").checked = true;
    } else {
        document.getElementById("redate").style.display = "none";
        document.getElementById("single").checked = true;
    }
}
//隐藏悬浮提示窗口
$(function(){
    $("img[id=toclose]").click(function(){
        $("div[id=newnotice]").hide();
    });
});
//增加到收藏夹
function addJipiaoBookmark(){
    title="超低价1折机票―酷讯机票搜索";;
    url="http://jipiao.kuxun.cn";
    if(window.sidebar&&window.sidebar.addPanel)
    window.sidebar.addPanel(title,url,"");
    else if(document.all)
    window.external.addFavorite(url,title);else if(window.opera&&window.print)
    return true;
}
var pageTracker = 0;
function indexInit() {
    indexhq();
    /*
    var today = new Date();
    today = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 1);
    var tomorrow = new Date(today.getFullYear(), today.getMonth(), today.getDate() + 3);
    document.getElementById("i-date").value  = today.getFullYear() + "-" + addPrefixZero(today.getMonth() + 1) + "-" + addPrefixZero(today.getDate());
    document.getElementById("i-date2").value = tomorrow.getFullYear() + "-" + addPrefixZero(tomorrow.getMonth() + 1) + "-" + addPrefixZero(tomorrow.getDate());
    */

    //    KX.AC.init(KX.AC.mychannels);
    //    addDocClickEvent(hideCalendar);
    
    /*new suggestion calendar begin*/
    KX.sugg_init_jipiao_fr(10,"highlightg","highlighth","lh","frmcity","container1");
    KX.sugg_init_jipiao_to(10,"highlightg","highlighth","lh","tocity","container2");
    KX.sugg_init_jipiao_fr_hq(10,"highlightg","highlighth","lh","hqfrmcity","container3");
    KX.sugg_init_jipiao_to_hq(10,"highlightg","highlighth","lh","hqtocity","container4");
    KX.sugg_init_jipiao_fr_ext(10,"highlightg","highlighth","lh","ext_frmcity","ext_container1");
    KX.sugg_init_jipiao_to_ext(10,"highlightg","highlighth","lh","ext_tocity","ext_container2");

    setTimeout(function(){
        for(var i=0;i<type_zu;i++){
            next_month_t=nextmonth(today.getFullYear(),today.getMonth(),i);
            month_arr[i]=create_month(next_month_t.getFullYear(),next_month_t.getMonth(),next_month_t.getDate());
        }
    },0);
    ini_cal();
    if(!$.browser.msie){
        $("#calendar").css({"top":"208px"});
    }
    else if($.browser.version=="6.0"){
        $("#calendar").css({"top":"210px"});
    }
    else if($.browser.version=="7.0"){
        $("#calendar").css({"top":"210px"});
    }
    else if($.browser.version=="8.0"){
        $("#calendar").css({"top":"208px"});
    }

    $("#i-date").bind("click",{fr_input_id:"i-date",fr_div_class:"i-date",div_class:"date",to_input_id:"i-date2"},cshow1);
    $("#i-date").next(".plain_button_date").bind("click",{fr_input_id:"i-date",fr_div_class:"i-date",div_class:"date",to_input_id:"i-date2"},cshow1);
    $("#i-date").next(".plain_button_date").next(".spe_day").bind("click",{fr_input_id:"i-date",fr_div_class:"i-date",div_class:"date",to_input_id:"i-date2"},cshow1);
    $("#i-date2").bind("click",{to_input_id:"i-date2",to_div_class:"i-date2",div_class:"date",fr_input_id:"i-date"},cshow2);
    $("#i-date2").next(".plain_button_date").bind("click",{to_input_id:"i-date2",to_div_class:"i-date2",div_class:"date",fr_input_id:"i-date"},cshow2);
    $("#i-date2").next(".plain_button_date").next(".spe_day").bind("click",{to_input_id:"i-date2",to_div_class:"i-date2",div_class:"date",fr_input_id:"i-date"},cshow2);
    $("#int_switcher").bind("click",{to_input_id:"i-date2",to_div_class:"i-date2",div_class:"date",fr_input_id:"i-date"},cshow3);

    $("#ext_i-date").bind("click",{fr_input_id:"ext_i-date",fr_div_class:"ext_i-date",div_class:"date",to_input_id:"ext_i-date2"},cshow1);
    $("#ext_i-date").next(".plain_button_date").bind("click",{fr_input_id:"ext_i-date",fr_div_class:"ext_i-date",div_class:"date",to_input_id:"ext_i-date2"},cshow1);
    $("#ext_i-date").next(".plain_button_date").next(".spe_day").bind("click",{fr_input_id:"ext_i-date",fr_div_class:"ext_i-date",div_class:"date",to_input_id:"ext_i-date2"},cshow1);
    $("#ext_i-date2").bind("click",{to_input_id:"ext_i-date2",to_div_class:"ext_i-date2",div_class:"date",fr_input_id:"ext_i-date"},cshow2);
    $("#ext_i-date2").next(".plain_button_date").bind("click",{to_input_id:"ext_i-date2",to_div_class:"ext_i-date2",div_class:"date",fr_input_id:"ext_i-date"},cshow2);
    $("#ext_i-date2").next(".plain_button_date").next(".spe_day").bind("click",{to_input_id:"ext_i-date2",to_div_class:"ext_i-date2",div_class:"date",fr_input_id:"ext_i-date"},cshow2);
    $("#ext_switcher").bind("click",{to_input_id:"ext_i-date2",to_div_class:"ext_i-date2",div_class:"date",fr_input_id:"ext_i-date"},cshow3);
    showLoginHtml();

    $(".next").click(function(){
        empty_cal();
        month_num++;
        var search_value=$("input[name='inter_exter']:checked").val();
        if(search_value=="internal"){
            fill_cal(month_num,"i-date","i-date2");
        }
        else if(search_value=="external"){
            fill_cal(month_num,"ext_i-date","ext_i-date2");
        }
    });

    $(".before").click(function(){
        empty_cal();
        month_num--;
        var search_value=$("input[name='inter_exter']:checked").val();
        if(search_value=="internal"){
            fill_cal(month_num,"i-date","i-date2");
        }
        else if(search_value=="external"){
            fill_cal(month_num,"ext_i-date","ext_i-date2");
        }
    });
    if(!$.browser.msie){
        $("#i-date").bind("input",{obj:selectDate_chufa}, check_riqi);
        $("#i-date2").bind("input",{obj:selectDate_daoda}, check_riqi);
        $("#ext_i-date").bind("input",{obj:selectDate_chufa}, check_riqi);
        $("#ext_i-date2").bind("input",{obj:selectDate_daoda}, check_riqi);
    }
    else{
        $("#i-date").bind("propertychange",{obj:selectDate_chufa}, check_riqi);
        $("#i-date2").bind("propertychange",{obj:selectDate_daoda}, check_riqi);
        $("#ext_i-date").bind("propertychange",{obj:selectDate_chufa}, check_riqi);
        $("#ext_i-date2").bind("propertychange",{obj:selectDate_daoda}, check_riqi);
    }
    $(document).click(function(){
        $("#calendar").removeClass("chufa");
        $("#calendar").hide();
        $(".date").removeClass("highlight");
    });
    /*new suggestion calendar end*/
    
    addDocClickEvent(hide_city);
    $("#hq_button").click(function(){
        hq_from_name = $("#hqfrmcity").val();
        hq_from = getCityCode(hq_from_name);
        hq_to_name = $("#hqtocity").val();
        hq_to = getCityCode(hq_to_name);
        if (! hq_from_name || ! hq_to_name)
        {
            alert('请输入城市名');
            return false;
        }
        else if (hq_from_name == hq_to_name)
        {
            alert('出发城市和到达城市不能相同');
            return false;
        }
        else if (! hq_from || ! hq_to)
        {
            alert('您输入的城市名不在查询范围内');
            return false;
        }

        indexhq();
        $("#hq_title_from").html(hq_from_name);
        $("#hq_title_to").html(hq_to_name);
        //append_ga('HomePage','Click','HQ-SearchButton',1);
    });

    showLoginHtml();
    //add_a_click("tj_content","TejiaLink");
    //add_a_click("carriorlink","CarriorLink");
    //add_a_click("citylink","CityLink");
    $("#hangqing").click(function(){
        //append_ga('HomePage','Click','HQ-Graph',1);
    });
    //google ad
    //jipiao_home_right_word
    setTimeout(function(){
        $('#jipiao_home_right_word').attr('src', 'jipiao_home_right_word.html');
        $('#jipiao_index_banner_pic').attr('src', 'jipiao_index_banner_pic.html');
        $('#jipiao_home_mid_rightword').attr('src', 'jipiao_home_mid_rightword.html');
        $('#ifr_gga_rt').attr('src', '/js/index_v2/google_ads.html');
        $('#jipiao_right_pic').attr('src', 'jipiao_home_right_pic.html');
        $('#external_home_right_word').attr('src', 'jipiao_home_right_word.html');
    }, 100);
    /*
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    loadScript(gaJsHost+"google-analytics.com/ga.js", function(){
    var current_url = document.URL;
    //js_debug('current_url = ' + current_url);
    var reg = /tg=fcg/i;
    if (current_url.match(reg))
    {
    pageTracker = _gat._getTracker("UA-5254304-8");
    //js_debug('google new ID: UA-5254304-8');
    }else
    {
    pageTracker = _gat._getTracker("UA-5254304-1");
    //js_debug('google ID: UA-5254304-1');
    }
    tracker = pageTracker;
    pageTracker._setDomainName(".kuxun.cn");
    pageTracker._trackPageview();
    isLoadDone = true;
    //bd_count
    kx_create_log();
    });
    */
}
$(document).ready(function(){
    InitCityNav(0);
    indexInit();
    initDateHref();
    seoPlugin();
});
function initDateHref()
{
    $('._date').each(function(){
        var href = $(this).attr('href');
        var _date = $(this).attr('date');
        var price = $(this).attr('price');
        var a_price = price.split('元');
        $(this).attr('href',href + '?' + _date + '&referprice=1_' + a_price[0]);
    });
}
function add_a_click(id,name)
{
    setTimeout(function(){
        $("#"+id).find('a').each(function(i)
        {
            $(this).click(function(){
                append_ga('HomePage','Click',name,1);
            });
        });
    }, 500);
}
function append_ga(ga_v1,ga_v2,ga_v3,ga_v4)
{
    //暂时不执行

    if (pageTracker)
    {
        pageTracker._trackEvent(ga_v1, ga_v2, ga_v3, ga_v4);
        //$('#debug').show().append('### first_data_return');
    }
}
/********************** define festival begin ************************/
//var chinacal = new Array("元旦","初七","腊八","初九","小寒","十一","十二","十三","十四","十五","十六","十七","十八","十九","二十","廿一","廿二","小年","廿四","大寒","廿六","廿七","廿八","廿九","除夕","春节","初二","初三","初四","初五","初六","初七","初八","立春","初十","十一","十二","十三","十四","元宵","十六","十七","十八","十九","情人");
/**
National Day.
*/
var chinacal = new Array(
'廿三', '廿四', '廿五', '廿六', '廿七',
'廿八', '廿九', '三十', '初一', '初二',
'初三', '初四', '秋分', '初六', '初七',
'初八', '初九', '初十', '十一', '十二',
'国庆', '十四', '中秋', '十六', '十七',
'十八', '十九', '寒露', '廿一', '廿二',
'廿二', '廿四', '廿五', '廿六', '廿七',
'廿八', '廿九', '初一', '初二', '初三',
'初四'
);
//var abcal = new Array("01-01","01-02","01-03","01-04","01-05","01-06","01-07","01-08","01-09","01-10","01-11","01-12","01-13","01-14","01-15","01-16","01-17","01-18","01-19","01-20","01-21","01-22","01-23","01-24","01-25","01-26","01-27","01-28","01-29","01-30","01-31","02-01","02-02","02-03","02-04","02-05","02-06","02-07","02-08","02-09","02-10","02-11","02-12","02-13","02-14");
var abcal = new Array(
'09-11', '09-12', '09-13', '09-14', '09-15',
'09-16', '09-17', '09-18', '09-19', '09-20',
'09-21', '09-22', '09-23', '09-24', '09-25',
'09-26', '09-27', '09-28', '09-29', '09-30',
'10-01', '10-02', '10-03', '10-04', '10-05',
'10-06', '10-07', '10-08', '10-09', '10-10',
'10-11', '10-12', '10-13', '10-14', '10-15',
'10-16', '10-17', '10-18', '10-19', '10-20',
'10-21'
);

var fescityname;
var fesfrmcity;
var fesdate;
var festocitycode;
var fesfromcitycode;
var trpiaoArr;
var isshowreture = false;
function festivalInit() {
    fescityname = from_name;
    fesfromcitycode = getFesCityCode(fescityname);
    festocitycode   = "ALL";
    //document.getElementById("fesfrmcity").innerHTML = fescityname;
    //document.getElementById("festocity").innerHTML  = '全国';
    var firsttime = getdate(2009, 09, 11).getTime();
    var thetime   = getdate(2009, 10, 21).getTime();
    var todaytime = (new Date()).getTime();

    var fix_time = todaytime + 8 * 86400000;  // 8 days
    if (fix_time < thetime)
    {
        thetime = fix_time;
    }

    var tmptime   = thetime;
    if(todaytime > firsttime) {
        if(parseInt((thetime-todaytime)/86400000,10) < 7)
        thetime = todaytime + 7*86400000;
    }
    var strHtml = new StringBuffer();
    var fristindex = parseInt((thetime - firsttime) / 86400000, 10);

    //alert('fristindex' + fristindex);

    fesdate = "2009-" + abcal[fristindex];
    endindex = fristindex + 3
    if(endindex>=abcal.length){
        endindex = abcal.length-1;
    }

    //alert('endindex' + endindex);return;

    findex = endindex-6;
    fesurl = "/yuandan/getfestival_v2.php?citycode=" + fesfromcitycode + "&date="+fesdate ;

    //alert(fesurl);

    ajaxGetFile(fesurl, showfespiao);
    strHtml.append('<span onclick="leftonestep(this)" style="border-left:0px;">&lt;&lt;</span>');
    for(var j = findex; j <= endindex; j++) {
        //alert('findex =' + findex + 'endindex = ' + endindex);return;
        if(j == fristindex - 1) {
            strHtml.append('<span urlcitycode="' + fesfromcitycode + '" urlshowdate="2009-' + abcal[j] + '" onclick="changetocity(this)">' + abcal[j] + '(' + chinacal[j] + ')</span>');
        } else if(j == fristindex) {
            strHtml.append('<span class="checked" urlcitycode="' + fesfromcitycode + '" urlshowdate="2009-' + abcal[j] + '" onclick="changetocity(this)">' + abcal[j] + '(' + chinacal[j] + ')</span>');
        } else {
            strHtml.append('<span urlcitycode="' + fesfromcitycode + '" urlshowdate="2009-' + abcal[j] + '" onclick="changetocity(this)">' + abcal[j] + '(' + chinacal[j] + ')</span>');
        }
    }
    if(j < abcal.length)
    strHtml.append('<span onclick="rightonestep(this)">&gt;&gt;</span>');
    else
    strHtml.append('<span><|</span>');
    var fesdiv = document.getElementById("fesnav");
    fesdiv.innerHTML = strHtml.toString();
}
function getdate(yy, mm, dd) {
    var thisdate = new Date(parseInt(yy, 10), (parseInt(mm, 10) - 1), parseInt(dd, 10));
    return thisdate;
}
function getFesCnName(citycode) {
    var cnname = '';
    for(i = 0; i < fesapdata.length; i++) {
        if(fesapdata[i][0] == citycode) {
            cnname = fesapdata[i][1];
            break;
        }
    }
    return cnname;
}
function getFesCityCode(cityname) {
    var citycode;
    for(i = 0; i < fesapdata.length; i++) {
        if(fesapdata[i][1] == cityname) {
            citycode = fesapdata[i][0];
            break;
        }
    }
    return citycode;
}
function changetocity(obj) {
    var urlcitycode = obj.getAttribute("urlcitycode");
    var urlshowdate = obj.getAttribute("urlshowdate");
    fesdate = urlshowdate;
    if(arrived == 0)
    fesurl = "/yuandan/getfestival_v2.php?citycode=" + urlcitycode + "&date=" + urlshowdate;
    else
    fesurl = "/yuandan/getfestival_v2.php?citycode=" + urlcitycode + "&date=" + urlshowdate+"&type=arrived";
    ajaxGetFile(fesurl, showfespiao);
    var fesnavdiv = document.getElementById("fesnav");
    var spanarr = fesnavdiv.getElementsByTagName("span");
    for(i = 0; i < spanarr.length; i++) {
        spanarr[i].className = "";
    }
    obj.className = "checked";
    if(obj.previousSibling) {
        obj.previousSibling.className = "";
    }
}
function showfespiao(str) {
    var strHtml = new StringBuffer();
    var totallen;
    var tmptocity;
    strHtml.append('<div class="clear"></div>');
    var fesyeardiv = document.getElementById("newyear");
    if(str == "nocjpiao") {
        //var cnfesfromcity = document.getElementById("fesfrmcity").innerHTML;
        //var cnfestocity   = document.getElementById("festocity").innerHTML;
        //var showmsg = " 春节期间(01.18-02.14)暂无数据";
        var showmsg = " 十一黄金周期间(09.11-10.21)暂无数据";
        strHtml.append('<table cellspacing="0" cellpadding="0" border="0" align="center" width="99%" class="zhekou_table">');
        strHtml.append('<tr><td class="zhekou_td" style="text-align:center; height:134px; font-size:14px;" colspan="23">' + showmsg + '</td></tr>');
        strHtml.append('<tr><td colspan="12" class="td1" id="turnpage" >&nbsp;&nbsp;&nbsp;&nbsp;</td><tr>');
        strHtml.append('</table>');
        fesyeardiv.innerHTML = strHtml;
    } else {
        trpiaoArr = new Array();
        var piaoarr = str.split('\n');
        document.getElementById("fesnav").style.display = "";
        /*if(((festocitycode == "ALL") && (piaoarr.length > 15))) {
        document.getElementById("fesnav").style.display = "";
        } else {
        document.getElementById("fesnav").style.display = "none";
        }*/
        var tmplen = (piaoarr.length - 1) % 3;
        for(var i = 0; i < Math.floor((piaoarr.length - 1) / 3); i++) {
            var k = 3 * i;
            strHtml = new StringBuffer();
            strHtml.append('<tr>');
            for(var m = 0; m < 3; m++) {
                onepiao = piaoarr[k + m].split('\t');
                resultdate = onepiao[5];
                tmpurl = onepiao[7];
                strHtml.append('<td class="zhekou_td" height="20" width="6%"><span class="festival_date">' + onepiao[5] + '</span>');
                strHtml.append('(' + onepiao[6] + ')');
                totallen = parseInt(onepiao[8].length, 10) + parseInt(onepiao[9].length, 10) + parseInt(onepiao[4].length, 10);
                if(totallen > 10) {
                    tmptocity = onepiao[9].substr(0, parseInt(onepiao[9].length, 10) - (totallen - 10));
                } else {
                    tmptocity = onepiao[9];
                }
                strHtml.append('<a target="_blank" href="' + tmpurl + '"><span title="' + onepiao[8] + '-' + onepiao[9] + '">' + onepiao[8] + '-' + tmptocity + '</span>');
                strHtml.append('<font color="#FF6600"><b>');
                if(onepiao[3] >= 100) {
                    strHtml.append(onepiao[4] + '</b></font></a>');
                } else {
                    strHtml.append(onepiao[4] + '</b></font>(' + (onepiao[3] / 10) + '折)</a>');
                }
                strHtml.append('</td>');
            }
            strHtml.append('</tr>');
            trpiaoArr[trpiaoArr.length] = strHtml.toString();
        }
        if(tmplen == 1) {
            strHtml = new StringBuffer();
            strHtml.append('<tr>');
            onepiao = piaoarr[piaoarr.length - 2].split('\t');
            resultdate = onepiao[5];
            tmpurl = onepiao[7];
            strHtml.append('<td class="zhekou_td" height="20" width="6%"><span class="festival_date">' + onepiao[5] + '</span>');
            strHtml.append('(' + onepiao[6] + ')');
            totallen = parseInt(onepiao[8].length, 10) + parseInt(onepiao[9].length, 10) + parseInt(onepiao[4].length, 10);
            if(totallen > 10) {
                tmptocity = onepiao[9].substr(0, parseInt(onepiao[9].length, 10) - (totallen - 10));
            } else {
                tmptocity = onepiao[9];
            }
            strHtml.append('<a target="_blank" href="' + tmpurl + '"><span title="' + onepiao[8] + '-' + onepiao[9] + '">' + onepiao[8] + '-' + tmptocity + '</span>');
            strHtml.append('<font color="#FF6600"><b>');
            if(onepiao[3]>= 100) {
                strHtml.append(onepiao[4] + '</b></font></a>');
            } else {
                strHtml.append(onepiao[4] + '</b></font>(' + (onepiao[3] / 10) + '折)</a>');
            }
            strHtml.append('</td>');
            strHtml.append('<td width="6%" height="20" class="zhekou_td">&nbsp;</td>');
            strHtml.append('<td width="6%" height="20" class="zhekou_td">&nbsp;</td>');
            strHtml.append('</tr>');
            trpiaoArr[trpiaoArr.length] = strHtml.toString();
        }
        if(tmplen == 2) {
            strHtml = new StringBuffer();
            strHtml.append('<tr>');
            onepiao = piaoarr[piaoarr.length-3].split('\t');
            resultdate = onepiao[5];
            tmpurl = onepiao[7];
            strHtml.append('<td class="zhekou_td" height="20" width="6%"><span class="festival_date">' + onepiao[5] + '</span>');
            strHtml.append('(' + onepiao[6] + ')');
            totallen = parseInt(onepiao[8].length, 10) + parseInt(onepiao[9].length, 10) + parseInt(onepiao[4].length, 10);
            if(totallen > 10) {
                tmptocity = onepiao[9].substr(0, parseInt(onepiao[9].length, 10) - (totallen - 10));
            } else {
                tmptocity = onepiao[9];
            }
            strHtml.append('<a target="_blank" href="' + tmpurl + '"><span title="' + onepiao[8] + '-' + onepiao[9] + '">' + onepiao[8] + '-' + tmptocity + '</span>');
            strHtml.append('<font color="#FF6600"><b>');
            if(onepiao[3] >= 100) {
                strHtml.append(onepiao[4] + '</b></font></a>');
            } else {
                strHtml.append(onepiao[4] + '</b></font>(' + (onepiao[3] / 10) + '折)</a>');
            }
            strHtml.append('</td>');
            onepiao = piaoarr[piaoarr.length - 2].split('\t');
            resultdate = onepiao[5];
            tmpurl = onepiao[7];
            strHtml.append('<td class="zhekou_td" height="20" width="6%"><span class="festival_date">' + onepiao[5] + '</span>');
            strHtml.append('(' + onepiao[6] + ')');
            totallen = parseInt(onepiao[8].length, 10) + parseInt(onepiao[9].length, 10) + parseInt(onepiao[4].length, 10);
            if(totallen > 10) {
                tmptocity = onepiao[9].substr(0, parseInt(onepiao[9].length, 10) - parseInt(totallen - 10));
            } else {
                tmptocity = onepiao[9];
            }
            strHtml.append('<a target="_blank" href="' + tmpurl + '"><span title="' + onepiao[8] + '-' + onepiao[9] + '">' + onepiao[8] + '-' + tmptocity + '</span>');
            strHtml.append('<font color="#FF6600"><b>');
            if(onepiao[3] >= 100) {
                strHtml.append(onepiao[4] + '</b></font></a>');
            } else {
                strHtml.append(onepiao[4] + '</b></font>(' + (onepiao[3] / 10) + '折)</a>');
            }
            strHtml.append('</td>');
            strHtml.append('<td width="6%" height="20" class="zhekou_td">&nbsp;</td>');
            strHtml.append('</tr>');
            trpiaoArr[trpiaoArr.length] = strHtml.toString();
        }
        if((trpiaoArr.length) % 5 != 0) {
            var thenulltr = 5 - (trpiaoArr.length % 5);
            for(i = 0; i < thenulltr; i++) {
                var ss = '';
                ss += '<tr>';
                ss += '<td width="4%" height="20" class="zhekou_td">&nbsp;</td>';
                ss += '<td width="4%" height="20" class="zhekou_td">&nbsp;</td>';
                ss += '<td width="4%" height="20" class="zhekou_td">&nbsp;</td>';
                ss += '</tr>';
                trpiaoArr[trpiaoArr.length] = ss;
            }
        }
        strHtml = new StringBuffer();
        strHtml.append('<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="zhekou_table">');
        pagenum = 1;
        var forcount = 0;
        if(trpiaoArr.length < (pagenum * 5)) {
            forcount = trpiaoArr.length;
        } else {
            forcount = pagenum * 5;
        }
        for(i = (pagenum - 1) * 5; i < forcount; i++) {
            strHtml.append(trpiaoArr[i]);
        }
        href = '';
        if(trpiaoArr.length > 5) {
            href += '<strong>1&nbsp;&nbsp;</strong>';
            for(k = 2; k <= Math.ceil(trpiaoArr.length / 5); k++) {
                href += '<a href="#" onclick="changePage(' + k + ');return false;">[' + k +']</a>&nbsp;&nbsp;';
            }
            strHtml.append('<tr><td colspan="3" class="td1" id="turnpage" align="center">' + href);
            if(isshowreture) {
                strHtml.append('&nbsp;&nbsp;<a href="#" onclick="searchreturn();return false;">返&nbsp;&nbsp;程</a></td><tr>');
            } else {
                strHtml.append('&nbsp;&nbsp;</td><tr>');
            }
        } else {
            if(isshowreture) {
                strHtml.append('<tr><td colspan="3" class="td1" id="turnpage" align="center"><a href="#" onclick="searchreturn();return false;">返&nbsp;&nbsp;程</a></td><tr>');
            } else {
                strHtml.append('<tr><td colspan="3" class="td1" id="turnpage" align="center">&nbsp;&nbsp;&nbsp;&nbsp;</td><tr>');
            }
        }
        strHtml.append('</table>');
        fesyeardiv.innerHTML = strHtml.toString();
    }
}
function changePage(pagenum) {
    var strHtml = new StringBuffer();
    strHtml.append('<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0" class="zhekou_table">');
    var forcount = 0;
    if(trpiaoArr.length < pagenum * 5) {
        forcount = trpiaoArr.length;
    } else {
        forcount = pagenum * 5;
    }
    for(var i = (pagenum - 1) * 5; i < forcount; i++) {
        strHtml.append(trpiaoArr[i]);
    }
    var href = '';
    if(trpiaoArr.length > 5) {
        for(var k = 1; k <= Math.ceil(trpiaoArr.length / 5); k++) {
            if(k == pagenum) {
                href += '<strong>' + k + '</strong>&nbsp;&nbsp;';
            } else {
                href += '<a href="#" onclick="changePage(' + k + ');return false;">[' + k + ']</a>&nbsp;&nbsp;';
            }
        }
        strHtml.append('<tr><td colspan="3" class="td1" id="turnpage" align="center">' + href);
        if(isshowreture) {
            strHtml.append('&nbsp;&nbsp;<a href="#" onclick="searchreturn();return false;">返&nbsp;&nbsp;程</a></td><tr>');
        } else {
            strHtml.append('&nbsp;&nbsp;&nbsp;&nbsp;</td><tr>');
        }
    } else {
        strHtml.append('<tr><td colspan="3" class="td1" id="turnpage" align="center">');
        if(isshowreture) {
            strHtml.append('&nbsp;&nbsp;<a href="#" onclick="searchreturn();return false;">返&nbsp;&nbsp;程</a></td><tr>');
        } else {
            strHtml.append('&nbsp;&nbsp;&nbsp;&nbsp;</td><tr>');
        }
    }
    strHtml.append('</table>');
    var newyeardiv = document.getElementById("newyear");
    newyeardiv.innerHTML = strHtml.toString();
}
function leftonestep(obj) {
    var fesnavdiv = document.getElementById("fesnav");
    var spanarr = fesnavdiv.getElementsByTagName("span");
    var spanfirst = spanarr[1];
    var spanlast = spanarr[7];
    var spanfirstdate = spanfirst.getAttribute("urlshowdate");
    fesfromcitycode = spanfirst.getAttribute("urlcitycode");
    var halfdate = spanfirstdate.substring(5, 10);
    var firsttime = getdate(2009, 09, 11).getTime();
    var theday = new Date();
    var yy = theday.getFullYear();
    var mm = theday.getMonth();
    var dd = theday.getDate();
    var todaytime = (new Date(yy, mm, dd)).getTime();
    var firstindex = 1;
    if(todaytime > firsttime) {
        firstindex = firstindex + (todaytime - firsttime) / 86400000;
    }
    for(var i = 0; i < abcal.length; i++) {
        if(abcal[i] == halfdate) {
            var theindex = i;
            break;
        }
    }
    var insertspan = document.createElement("SPAN");
    insertspan.setAttribute("urlcitycode", fesfromcitycode);
    insertspan.setAttribute("urlshowdate", ("2009-" + abcal[theindex - 1]));
    insertspan.onclick = function() {
        changetocity(this);
    };
    var inserttxtnode = document.createTextNode(abcal[theindex - 1] + '(' + chinacal[theindex - 1] + ')');
    insertspan.appendChild(inserttxtnode);
    if(spanlast.className == "checked") {
        changetocity(spanlast.previousSibling);
    }
    fesnavdiv.removeChild(spanlast);
    fesnavdiv.insertBefore(insertspan,spanfirst);
    var laststrong = fesnavdiv.lastChild;
    laststrong.onclick = function() {
        rightonestep(this);
    };
    lasttxtnode = document.createTextNode(">>");
    laststrong.appendChild(lasttxtnode);
    laststrong.removeChild(laststrong.firstChild);
    if(theindex == firstindex) {
        var firststrong = fesnavdiv.firstChild;
        firststrong.onclick = function(){;};
        var nulltxtnode = document.createTextNode('|<');
        firststrong.appendChild(nulltxtnode);
        firststrong.removeChild(firststrong.firstChild);
    }
}
function rightonestep(obj) {
    var fesnavdiv = document.getElementById("fesnav");
    var spanarr = fesnavdiv.getElementsByTagName("span");
    var spanfirst = spanarr[1];
    var spanlast = spanarr[7];
    var spanfirstdate = spanlast.getAttribute("urlshowdate");
    fesfromcitycode = spanfirst.getAttribute("urlcitycode");
    var halfdate = spanfirstdate.substring(5,10);
    //var firsttime = getdate(2009, 01, 01).getTime();
    var firsttime = getdate(2009, 09, 11).getTime();
    var theday = new Date();


    var fix_time = theday.getTime() + 15 * 86400000;
    var t_day = new Date(fix_time);
    var g_month = t_day.getMonth() + 1;
    var t_month = g_month >= 10 ? g_month : '0' + g_month;
    var t_date  =  t_day.getDate() >= 10 ?  t_day.getDate() : '0' +  t_day.getDate();
    var tmp_halfdate = t_month + '-' + t_date;
    //alert('tmp_halfdate = ' + tmp_halfdate);


    var yy = theday.getFullYear();
    var mm = theday.getMonth();
    var dd = theday.getDate();
    var todaytime = (new Date(yy, mm, dd)).getTime();
    var lastindex = 13+18;
    //var lastindex = 15;
    //alert('halfdate' + halfdate);
    if(todaytime > firsttime) {
        lastindex = lastindex + (todaytime - firsttime) / 86400000;
        //alert('lastindex =' + lastindex);
        if(lastindex >=abcal.length-1)
        lastindex = abcal.length-1;
    }
    //alert('lastindex = ' + lastindex);
    for(var i = 0; i < abcal.length; i++) {
        if(abcal[i] == tmp_halfdate)
        {
            lastindex = i;
            //alert('lastindex = ' + lastindex);
        }
        if(abcal[i] == halfdate) {
            var theindex = i;
            //break;
        }
    }

    //lastindex = theindex;

    var insertspan = document.createElement("SPAN");
    insertspan.setAttribute("urlcitycode", fesfromcitycode);
    insertspan.setAttribute("urlshowdate", ("2009-" + abcal[theindex + 1]));
    insertspan.onclick = function() {
        changetocity(this);
    };
    inserttxtnode = document.createTextNode(abcal[theindex + 1] + '(' + chinacal[theindex + 1] + ')');
    insertspan.appendChild(inserttxtnode);
    if(spanfirst.className == "checked") {
        changetocity(spanfirst.nextSibling);
    }
    fesnavdiv.removeChild(spanfirst);
    fesnavdiv.insertBefore(insertspan, fesnavdiv.lastChild);
    var firststrong = fesnavdiv.firstChild;
    firststrong.onclick = function() {
        leftonestep(this);
    };
    firsttxtnode = document.createTextNode("<<");
    firststrong.appendChild(firsttxtnode);
    firststrong.removeChild(firststrong.firstChild);
    if(lastindex == theindex + 1) {
        var laststrong = fesnavdiv.lastChild;
        laststrong.onclick = function(){;};
        var nulltxtnode = document.createTextNode('<|');
        laststrong.appendChild(nulltxtnode);
        laststrong.removeChild(laststrong.firstChild);
    }
}
function sousuofestival(str) {
    isshowreture = false;
    var cnfesfromcity = document.getElementById("fesfrmcity").innerHTML.split("/")[0];
    document.getElementById("fesfrmcity").innerHTML = cnfesfromcity;
    if(fesIsEmpty(cnfesfromcity)) {
        alert("出发地不能为空");
        return false;
    } else {
        if(!fesIsValidCity(cnfesfromcity, 1)) {
            alert("出发地城市不正确");
            return false;
        }
    }
    var cnfestocity = document.getElementById("festocity").innerHTML.split("/")[0];
    document.getElementById("festocity").innerHTML = cnfestocity;
    if(fesIsEmpty(cnfestocity)) {
        alert("目的地不能为空");
        return false;
    } else {
        if(!fesIsValidCity(cnfestocity, 0)) {
            alert("目的地城市不正确");
            return false;
        }
    }
    if(str == "fromairindex") {
        if(fesfromcitycode == festocitycode) {
            alert("出发地和目的地不能相同");
            return false;
        }
    }
    if(!fesdate) {
        fesdate="2009-01-25";
    }
    if(fesfromcitycode != festocitycode) {
        var fesnavdiv = document.getElementById("fesnav");
        var spanarr = fesnavdiv.getElementsByTagName("span");
        for(var i = 0; i < spanarr.length; i++) {
            spanarr[i].setAttribute("urlcitycode", fesfromcitycode);
        }
        var fesurl;
        if(festocitycode != "ALL" && fesfromcitycode != "ALL") {
            isshowreture = true;
            fesurl = "../yuandan/getfestival_v2.php?citycode=" + fesfromcitycode + "&tocity=" + festocitycode + "&chunjiedate=" + fesdate;
        } else {
            fesurl = "../yuandan/getfestival_v2.php?citycode=" + fesfromcitycode + "&tocity=" + festocitycode + "&date=" + fesdate;
        }
        ajaxGetFile(fesurl, showfespiao);
    }
}
function festivalhandler(cityname, citycode) {
    sousuofestival("fromairindex");
}
function fesIsEmpty(v) {
    return ((v == null) || (v.length == 0) || /^\s+$/.test(v));
}
function fesIsValidCity(sCtiy, fromorto) {
    var flag = false;
    for(var i = 0; i < fesapdata.length; i++) {
        if(fesapdata[i][1] == sCtiy) {
            flag = true;
            if(fromorto == 1) {
                fesfromcitycode = fesapdata[i][0];
            } else {
                festocitycode = fesapdata[i][0];
            }
            break;
        }
    }
    return flag;
}
function searchreturn() {
    var citytemp = document.getElementById("fesfrmcity").innerHTML;
    document.getElementById("fesfrmcity").innerHTML = document.getElementById("festocity").innerHTML;
    document.getElementById("festocity").innerHTML = citytemp;
    sousuofestival("fromairindex");
}

var apdata = [
['AOG','鞍山','anshan','AS'],
['AQG','安庆','anqing','AQ'],
['AYN','安阳','anyang','AY'],
['AKA','安康','ankang','AK'],
['AKU','阿克苏','akesu','AKS'],
['AAT','阿勒泰','aletai','ALT'],
['AVA','安顺','anshun','AS'],
['PEK','北京','beijing','BJ'],
['BFU','蚌埠','bengbu','BB'],
['BHY','北海','beihai','BH'],
['BSD','保山','baoshan','BS'],
['BAV','包头','baotou','BT'],
['AEB','百色','baise','BS'],
['CTU','成都','chengdu','CD'],
['CKG','重庆','chongqing','CQ'],
['CSX','长沙','changsha','CS'],
['CGQ','长春','changchun','CC'],
['CZX','常州','changzhou','CZ'],
['CGD','常德','changde','CD'],
['CEH','承德','chengde','CD'],
['CHG','朝阳','chaoyang','CY'],
['CIH','长治','changzhi','CZ'],
['NBS','长白山','长白山','CBS'],
['CIF','赤峰','chifeng','CF'],
['BPX','昌都','changdu','CD'],
['CNI','长海','changhai','CH'],
['DLC','大连','dalian','DL'],
['DLU','大理','dali','DL'],
['DOY','东营','dongying','DY'],
['DNH','敦煌','dunhuang','DH'],
['DDG','丹东','dandong','DD'],
['DAT','大同','datong','DT'],
['DAX','达县','daxian','DX'],
['DIG','迪庆','diqing','DQ'],
['LUM','德宏','dehong','DH'],
['ENH','恩施','enshi','ES'],
['DSN','鄂尔多斯','eerduosi','EEDS'],
['FOC','福州','fuzhou','FZ'],
['FUO','佛山','foshan','FS'],
['FUG','阜阳','fuyang','FY'],
['FYN','富蕴','fuyun','FY'],
['CAN','广州','guangzhou','GZ'],
['KWL','桂林','guilin','GL'],
['KWE','贵阳','guiyang','GY'],
['KOW','赣州','ganzhou','GZ'],
['GOQ','格尔木','geermu','GEM'],
['GYS','广元','guangyuan','GY'],
['GHN','广汉','guanghan','GH'],
['LHK','光化','guanghua','GH'],
['HGH','杭州','hangzhou','HZ'],
['HRB','哈尔滨','haerbin','HEB'],
['HFE','合肥','hefei','HF'],
['HAK','海口','haikou','HK'],
['HET','呼和浩特','huhehaote','HHHT'],
['TXN','黄山','huangshan','HS'],
['HJJ','怀化','huaihua','HH'],
['HNY','衡阳','hengyang','HY'],
['HDG','邯郸','handan','HD'],
['HEK','黑河','heihe','HH'],
['HLD','海拉尔','hailaer','HLE'],
['HMI','哈密','hami','HM'],
['HYN','黄岩','huangyan','HY'],
['HZG','汉中','hanzhong','HZ'],
['HUZ','徽州','huizhou','HZ'],
['HTN','和田','hetian','HT'],
['TNA','济南','jinan','JN'],
['JIL','吉林','jilin','JL'],
['JZH','九寨沟','jiuzhaigou','JZG'],
['JDZ','景德镇','jingdezhen','JDZ'],
['JGS','井冈山','jinggangshan','JGS'],
['JNZ','锦州','jinzhou','JZ'],
['JJN','晋江','jinjiang','JJ'],
['JIU','九江','jiujiang','JJ'],
['JNG','济宁','jining','JN'],
['SHS','荆州','jingzhou','JZ'],
['KNC','吉安','jian','JA'],
['JGN','嘉峪关','jiayuguan','JYG'],
['JMU','佳木斯','jiamusi','JMS'],
['CHW','酒泉','jiuquan','JQ'],
['KMG','昆明','kunming','KM'],
['KUS','昆山','kunshan','KS'],
['JKI','喀纳斯','kanasi','KNS'],
['KHG','喀什','kashi','KS'],
['KGT','康定','kangding','KD'],
['KCA','库车','kuche','KC'],
['KRL','库尔勒','kuerle','KEL'],
['KRY','克拉玛依','kelamayi','KLMY'],
['LHW','兰州','lanzhou','LZ'],
['LXA','拉萨','lasa','LS'],
['LJG','丽江','lijiang','LJ'],
['LLB','荔波','libo','LB'],
['LUZ','庐山','lushan','LS'],
['LZO','泸州','luzhou','LZ'],
['LZH','柳州','liuzhou','LZ'],
['LYG','连云港','lianyungang','LYG'],
['LYA','洛阳','luoyang','LY'],
['HZH','黎平','liping','LP'],
['LCX','龙岩','longyan','LY'],
['LCX','连城','liancheng','LC'],
['LYI','临沂','linyi','LY'],
['LNJ','临沧','lincang','LC'],
['LZY','林芝','linzhi','LZ'],
['LDG','罗定','luoding','LD'],
['LXI','林西','linxi','LX'],
['MDG','牡丹江','mudanjiang','MDJ'],
['OHE','漠河','mohe','MH'],
['MIG','绵阳','mianyang','MY'],
['MXZ','梅县','meixian','MX'],
['NZH','满洲里','manzhouli','MZL'],
['LUM','芒市','mangshi','MS'],
['NKG','南京','nanjing','NJ'],
['KHN','南昌','nanchang','NC'],
['NGB','宁波','ningbo','NB'],
['NNG','南宁','nanning','NN'],
['NTG','南通','nantong','NT'],
['NNY','南阳','nanyang','NY'],
['WUS','南平','nanping','NP'],
['NAO','南充','nanchong','NC'],
['NLT','那拉提','nalati','NLT'],
['PZI','攀枝花','panzhihua','PZH'],
['TAO','青岛','qingdao','QD'],
['SHP','秦皇岛','qinhuangdao','QHD'],
['JJN','泉州','quanzhou','QZ'],
['NDG','齐齐哈尔','qiqihaer','QQHE'],
['JUZ','衢州','quzhou','QZ'],
['IQM','且末','qiemo','QM'],
['IQN','庆阳','qingyang','QY'],
['SHA','上海','shanghai','SH'],
['SZX','深圳','shenzhen','SZ'],
['SHE','沈阳','shenyang','SY'],
['SYX','三亚','sanya','SY'],
['SJW','石家庄','shijiazhuang','SJZ'],
['SZV','苏州','suzhou','SZ'],
['SWA','汕头','shantou','ST'],
['SHS','沙市','shashi','SS'],
['SYM','思茅','simao','SM'],
['SYM','普洱','puer','PE'],
['SSA','鄯善','shanshan','SS'],
['TSN','天津','tianjin','TJ'],
['TYN','太原','taiyuan','TY'],
['HYN','台州','taizhou','TZ'],
['TCZ','腾冲','tengchong','TC'],
['TNH','通化','tonghua','TH'],
['TGO','通辽','tongliao','TL'],
['TEN','铜仁','tongren','TR'],
['TCG','塔城','tacheng','TC'],
['THQ','天水','tianshui','TS'],
['WUH','武汉','wuhan','WH'],
['URC','乌鲁木齐','wulumuqi','WLMQ'],
['WNZ','温州','wenzhou','WZ'],
['WUX','无锡','wuxi','WX'],
['WEF','潍坊','weifang','WF'],
['WEH','威海','weihai','WH'],
['WUS','武夷山','wuyishan','WYS'],
['ZSWU','芜湖','wuhu','WH'],
['HLH','乌兰浩特','wulanhaote','WLHT'],
['WXN','万州','wanzhou','WZ'],
['WXN','梁平','Liangping','LP'],
['WUZ','梧州','wuzhou','WZ'],
['WNH','文山','wenshan','WS'],
['WUA','乌海','wuhai','WH'],
['XIY','西安','xian','XA'],
['XMN','厦门','xiamen','XM'],
['XUZ','徐州','xuzhou','XZ'],
['XNN','西宁','xining','XN'],
['DIG','香格里拉','xianggelila','XGLL'],
['JHG','西双版纳','xishuangbanna','XSBN'],
['JHG','景洪','jinghong','JH'],
['XFN','襄樊','xiangfan','XF'],
['XNT','邢台','xingtai','XT'],
['XIC','西昌','xichang','XC'],
['XEN','兴城','xingcheng','XC'],
['XIN','兴宁','xingning','XN'],
['XIL','锡林浩特','xilinhaote','XLHT'],
['YNT','烟台','yantai','YT'],
['YNZ','盐城','yancheng','YC'],
['INC','银川','yinchuan','YC'],
['ENY','延安','yanan','YA'],
['YBP','宜宾','yibin','YB'],
['YIH','宜昌','yichang','YC'],
['YIW','义乌','yiwu','YW'],
['YNJ','延吉','yanji','YJ'],
['YCU','运城','yuncheng','YC'],
['LLF','永州','yongzhou','YZ'],
['UYN','榆林','yulin','YL'],
['ZYYL','依兰','yilan','YL'],
['YUA','元谋','yuanmou','YM'],
['YIN','伊宁','yining','YN'],
['CGO','郑州','zhengzhou','ZZ'],
['ZUH','珠海','zhuhai','ZH'],
['DYG','张家界','zhangjiajie','ZJJ'],
['HSN','舟山','zhoushan','ZS'],
['ZYI','遵义','zunyi','ZY'],
['ZHA','湛江','zhanjiang','ZJ'],
['ZAT','昭通','zhaotong','ZT'],
['ZHY','中卫','zhongwei','ZW'],
/** and new flight line.*/
['DQA', '大庆', 'daqing', 'DQ'],
['LDS', '伊春', 'yichun', 'YC'],
['YUS', '玉树', 'yushu', 'YS'],
['JXA', '鸡西', 'jixi', 'JX'],
['ACX', '兴义', 'xingyi', 'XY']
];

var fesapdata = [['ALL','全国','all','AC']];
fesapdata = fesapdata.concat(apdata);
/********************** define festival end ************************/
/**
homepage hq swf
*/
function indexhq() {
    setHqVar('home_hq', hq_from, hq_to, 610, 240, 680, 300);
    createHQswf('PriceTrend');
}

function changeAirType(type) {
    var from = document.getElementById('frmcity').value;
    var to = document.getElementById('tocity').value;
    if(type == 2) {
        //document.getElementById("redate").style.display = "block";
        var url = "http://jipiao.kuxun.cn/ajaxgetReusultInfo.php?funcname=hq_homepage&type=returnsingle&from=" + encodeURIComponent(from) + "&to=" + encodeURIComponent(to);
        document.getElementById('jipiao_img').src = url;
        document.getElementById('fromto').innerHTML = from+"-"+to;
        document.getElementById('hangqing').href = 'http://jipiao.kuxun.cn/hqdir/'+getCityCode(from)+'_'+getCityCode(to)+'.html';

    } else {
        //document.getElementById("redate").style.display = "none";
        var url = "http://jipiao.kuxun.cn/ajaxgetReusultInfo.php?funcname=hq_homepage&type=single&from=" + encodeURIComponent(from) + "&to=" + encodeURIComponent(to);
        document.getElementById('jipiao_img').src = url;
        document.getElementById('fromto').innerHTML = from+"-"+to;
        document.getElementById('hangqing').href = 'http://jipiao.kuxun.cn/hqdir/'+getCityCode(from)+'_'+getCityCode(to)+'.html';

    }
    fix_special_price_url(from);
}
function getCnName(citycode) {
    var cnname = '';
    for(i = 0; i < apdata.length; i++) {
        if(apdata[i][0] == citycode) {
            cnname = apdata[i][1];
            break;
        }
    }
    return cnname;
}
function getCityCode(cityname) {
    var citycode;
    for(i = 0; i < apdata.length; i++) {
        if(apdata[i][1] == cityname) {
            citycode = apdata[i][0];
            break;
        }
    }
    return citycode;
}
/* Calendar begin */
function showCalendar(sImg, bOpenBound, sFld1, sFld2, sCallback, d1) {
    hide_city();
    var fld1, fld2, cf, wcf;
    cf = document.getElementById("CalFrame");
    wcf = window.frames.CalFrame;
    if(d1 != null) {
        wcf.date1 = document.getElementById(d1).value;
    } else {
        wcf.date1 = null;
    }
    var oImg = document.getElementById(sImg);
    fld1 = document.getElementById(sFld1);
    fld2 = document.getElementById(sFld2);
    if(!wcf.bCalLoaded) {
        alert("日历未成功装载！请刷新页面！");
        return;
    }
    if(cf.style.display == "block") {
        cf.style.display = "none";
        return;
    }
    var sT = document.body.scrollTop;
    var sL = document.body.scrollLeft;
    var eH = oImg.clientHeight;
    var eW = oImg.clientWidth;
    var eT = 0;
    var eL = 0;
    var p  = oImg;
    var q= p;
    var qT = 0;
    var qL = 0;
    while(p && p.tagName != "BODY") {
        eT += p.offsetTop;
        eL += p.offsetLeft;
        p = p.offsetParent;
    }
    if(sCallback != null) {
        var ie = document.all;
        if(!ie) {
            cf.style.top  = ((document.body.clientHeight - eT - eH >= cf.height) ? eT + eH : eT + 24) + 3 +"px";
            cf.style.left = ((document.body.clientWidth - eL >= cf.width) ? eL : eL + eW - cf.width) - 6 +"px";
        } else {
            var browser = navigator.appName;
            var b_version = navigator.appVersion;
            var version = b_version.split(";");
            var trim_Version = version[1].replace(/[ ]/g, "");
            if(browser == "Microsoft Internet Explorer" && trim_Version == "MSIE7.0") {
                cf.style.top = ((document.body.clientHeight - (eT - sT) - eH >= cf.height) ? eT + eH : eT - cf.height)  +4+ "px";
                cf.style.left = ((document.body.clientWidth - (eL - sL) >= cf.width) ? eL : eL + eW - cf.width) - 5 + "px";
            } else if(browser == "Microsoft Internet Explorer" && trim_Version == "MSIE6.0") {
                cf.style.top = ((document.body.clientHeight - (eT - sT) - eH >= cf.height) ? eT + eH : eT - cf.height) + 4 + "px";
                cf.style.left = ((document.body.clientWidth - (eL - sL) >= cf.width) ? eL : eL + eW - cf.width) -10+ "px";
            }
            else
            {
                cf.style.top  = ((document.body.clientHeight - eT - eH >= cf.height) ? eT + eH : eT + 24) + 3 +"px";
                cf.style.left = ((document.body.clientWidth - eL >= cf.width) ? eL : eL + eW - cf.width) - 6 +"px";
            }
        }
    }
    cf.style.display = "block";
    wcf.openbound = bOpenBound;
    wcf.fld1 = fld1;
    wcf.fld2 = fld2;
    wcf.callback = sCallback;
    wcf.initCalendar();
}
//function hideCalendar() {
//	var cf = document.getElementById("CalFrame");
//	cf.style.display = "none";
//}
function calcallback(str, target) {
    target.value = str;
    if(target.getAttribute("id") == "i-date") {
        var dateArr = str.split('-');
        var date1 = new Date(parseInt(dateArr[0], 10), parseInt(dateArr[1], 10) - 1, parseInt(dateArr[2], 10));
        dateArr = document.getElementById("i-date2").value.split('-');
        var date2 = new Date(parseInt(dateArr[0], 10), parseInt(dateArr[1], 10) - 1, parseInt(dateArr[2], 10));
        if(date1.getTime() > date2.getTime()) {
            date1 = new Date(date1.getFullYear(), date1.getMonth(), date1.getDate() + 3);
            document.getElementById("i-date2").value = addPrefixZero(date1.getFullYear()) + "-" + addPrefixZero(date1.getMonth() + 1) + "-" + addPrefixZero(date1.getDate());
        }
    }
}
/* Calendar end */
function addPrefixZero(num) {
    if(parseInt(num, 10) < 10) {
        return "0" + num.toString();
    } else {
        return num.toString();
    }
}
function Submit_(obj)
{
    if(!onUrl(document.s.t.value, document.s.q.value)) {
        return false;
    }
    var city1 = document.getElementById("frmcity").value;
    var citycode1 = document.getElementById("From").value;
    var city2 = document.getElementById("tocity").value;
    var citycode2 = document.getElementById("to").value;
    var date_str1 = document.getElementById("i-date").value;
    var date_str2;
    var dateArr = date_str1.split('-');
    var date1 = new Date(parseInt(dateArr[0], 10), parseInt(dateArr[1], 10) - 1, parseInt(dateArr[2], 10));
    var date2;
    /** fix bug for ticket type, internal or external*/
    var airtype = $('#return').val();
    var text;
    var url;
    if(!date_str1) {
        alert("出发日期不能为空");
        return false;
    }
    if(city1 == city2) {
        alert("出发城市和到达城市不能相同");
        return false;
    }
    if(airtype) {
        date_str2 = document.getElementById("i-date2").value;
        if(!date_str2) {
            alert("返程日期不能为空");
            return false;
        } else {
            dateArr = date_str2.split('-');
            date2 = new Date(parseInt(dateArr[0], 10), parseInt(dateArr[1], 10) - 1, parseInt(dateArr[2], 10));
            if(date1.getTime() > date2.getTime()) {
                alert("出发日期不能晚于返程日期");
                return false;
            }
        }
    }
    //append_ga('HomePage','Click','SearchButton',1);
    //设置cookie
    $.cookie('city_jipiao_from', decodeURIComponent(city1), { expires: 30, path: '/', domain: '.kuxun.cn', secure: 0 });
    $.cookie('city_jipiao_to', decodeURIComponent(city2), { expires: 30, path: '/', domain: '.kuxun.cn', secure: 0 });

    /** add code for SEO.*/
    var submit_form = $('#search_form');
    var search_type = $('#internal_search_type').attr('value') || 1;
    var from_city = $('#frmcity').val() || '';
    var to_city   = $('#tocity').val() || '';
    var go_date   = $('#i-date').val() || '';
    var submit_url = city_pinyin_map[from_city] ? city_pinyin_map[from_city] : '';
    submit_url += '-' + (city_pinyin_map[to_city] ? city_pinyin_map[to_city] : '');
    submit_url += '.html?' + go_date;

    if (2 == search_type)
    {
        var back_date = $('#i-date2').val() || '';
        submit_url = '/round-' + submit_url +'_' + back_date;
    }
    else
    {
        submit_url = '/' + submit_url;
    }

    submit_form.attr('action', submit_url)
    .submit();
    //js_debug(submit_form.attr('action'));

    //$("form")[0].submit();
    /*if(document.getElementById("searchhotel").checked) {
    var win = window.open("http://hotel.kuxun.cn/search.php?city=" + city2 +"&ifid=jipiao",'hotel_page',"height=600, width=800 ,resizable=yes,location=yes,scrollbars=yes,menubar=yes");
    win.blur();
    }*/
}
/************************ aircorps begin **************************/
var cur_table_num = 5;
function actj_shiftcity(obj) {
    var citycode = obj.getAttribute("urlkey");
    actj_shiftcity2(obj);
}
function actj_shiftcity2(obj) {
    var citycode = obj.getAttribute("urlkey");
    var corpnum = obj.getAttribute("urlcorp");
    var piaourl = "/aircorps_new/aircorps_shiftcity.php?sitenum=" + corpnum + "&citycode=" + citycode;
    cur_table_num = corpnum;
    ajaxGetFile(piaourl, actj_showCityPiao);
    var tmpobj = obj.parentNode;
    var arrdiv = tmpobj.childNodes;
    tabdivobj = tmpobj.nextSibling.nextSibling;
    for(i = 0; i < arrdiv.length; i++) {
        if(arrdiv[i].className == "checked") {
            arrdiv[i].className="";
            break;
        }
    }
    obj.className = "checked";
}
function actj_showCityPiao(r) {
    document.getElementById("table_" + cur_table_num).innerHTML = r;
}
/************************ aircorps end **************************/
function sugInit() {
    on_load_url_index();
    // for citypicker
    if(!document.getElementById("citypicker_cityname").value) {
        document.getElementById("citypicker_cityname").value = '汉字、拼音或首字母';
        document.getElementById("citypicker_cityname").style.color = "#CCC";
    } else {
        document.getElementById("citypicker_cityname").style.color = "";
    }
    textInit();
    // for citypicker
    gsug.setInputObj(document.getElementById("citypicker_cityname"));
}
function getElementByName(obj,name,tij)
{
    var plist = obj.getElementsByTagName(tij);
    for(i=0;i<plist.length;i++)
    {
        if(plist[i].getAttribute("name") == name)
        {
            return plist[i];
        }
    }
    return null;
}
function inarray(inputcode,codearr)
{
    var inflag=false;
    for(l=0;l<codearr.length;l++)
    {
        if(codearr[l]==inputcode){inflag=true;break;}
    }
    return inflag;
}
function hidemorecitydiv()
{
    document.getElementById("morecitydiv").style.display   =   "none";
}

var citycodelistmore=new Array("PEK","SHA","CAN","SZX","CTU","XIY","HGH","HRB","WUH","CSX","TSN","SHE","CGQ","DLC","TAO","TNA","CGO","TYN","SJW","NKG","NGB","FOC","XMN","ZUH","HAK","KHN","HFE","NNG","KMG","KWE","LHW","INC","HET","URC");
var citynamelistmore=new Array("北京","上海","广州","深圳","成都","重庆","西安","杭州","武汉","南京","沈阳","天津","武汉","大连","青岛","长沙","昆明","长春","郑州","海口","合肥","济南","福州","哈尔滨","乌鲁木齐");
var tmpcityarr = new Array();
function InitCityNav(flag)
{
    if(!citylist)
    {
        return;
    }
    var navdiv = getElementByName(gE("ct_content"), "citylist", "ul");
    if(!navdiv)
    {
        return;
    }
    var citycodelist=new Array();
    var strNavHtml = "";
    var arrCities = citylist.split("\t\t");
    if(flag != 0)
    {
        arrCities.pop();
        arrCities.push(hotcityarr[flag]+"_"+flag);
    }
    var start  = 0;
    var id_s = 0;
    tmpcityarr = [];
    for(i = start; i < arrCities.length; ++ i)
    {
        id_s += 1;
        var arrStr = arrCities[i].split("_");
        if(arrStr.length != 2)
        {
            continue;
        }
        citycodelist[citycodelist.length]=arrStr[0];
        if(arrStr[0] != view_from)
        {
            strNavHtml += "<li class=\"\" onclick='$(\"#id_"+id_s+"\").click()'>";
        }
        else
        {
            strNavHtml += "<li class=\"active\" onclick='$(\"#id_"+id_s+"\").click()'>";
            findflag = 1;
        }
        strNavHtml += "<span><a id='id_"+id_s+"' onFocus=\"this.blur()\" href=\"#nogo\" onclick=\"shiftcity(this)\"  urlname=\""+arrStr[1]+"\""+"urlkey=\"" + arrStr[0] + "\"";
        strNavHtml += " name=\"city\" ";
        strNavHtml += " >" + arrStr[1] + "</a></span></li>";
        //生成临时城市数组
        if(arrStr[0] != "other")
        {
            tmpcityarr.push(arrStr[1]);
        }
    }
    //strNavHtml +="<li><span><a href=\"#nogo\" id='tejia_from' onclick='javascript:event.cancelBubble=true;tanchu(\"tejia_from\",\"frmcity\");append_ga(\"HomePage\",\"Click\",\"MoreCity\",1);'>更多>></a></span></li>";
    strNavHtml +="<li><span><a href=\"#nogo\" id='tejia_from' onclick='javascript:event.cancelBubble=true;tanchu(\"tejia_from\",\"frmcity\");'>更多>></a></span></li>";

    /*
    var processnum=citycodelistmore.length;
    for(i=0;i<processnum;i++)
    {
    if(inarray(citycodelistmore[i],citycodelist))
    {
    for(j=i;j<processnum;j++)
    {
    citycodelistmore[j]=citycodelistmore[j+1];
    citynamelistmore[j]=citynamelistmore[j+1];
    }
    processnum--;
    i--;
    }
    }
    citycodelistmore.length=processnum;
    citynamelistmore.length=processnum;
    */
    navdiv.innerHTML = strNavHtml;

}
function getNames(obj,name,tij)
{
    var plist = obj.getElementsByTagName(tij);
    var rlist = new Array();
    for(i=0;i<plist.length;i++)
    {
        if(plist[i].getAttribute("name") == name)
        {
            rlist[rlist.length] = plist[i];
        }
    }
    return rlist;
}
function shiftcity(obj)
{
    if(!obj)
    {
        return;
    }
    var citylist = getNames(gE("ct_content"), "city", "a");
    strUrlKey = obj.getAttribute("urlkey");
    strUrlName = obj.getAttribute("urlname");
    $(obj).parent().parent().addClass("active");
    for(i = 0; i < citylist.length; ++ i)
    {
        if(citylist[i].getAttribute("urlkey") != strUrlKey)
        {
            $(citylist[i]).parent().parent().removeClass();
        }
    }
    strUrl = "/ajax_index_tejia_v3.php?cate="+ strUrlKey;
    ajaxGetFile(strUrl, showAL4Comm);
    //append_ga('HomePage','Click','CityTab',1);
    //add_a_click("tj_content","TejiaLink");
}
function viewCityTejia(strUrlKey){
    strUrl = "/ajax_index_tejia_v3.php?cate="+ strUrlKey;
    ajaxGetFile(strUrl, showAL4Comm);
}
function showAL4Comm(str)
{
    if(str != "")
    {
        showAL(str, "main_left", "hot_tejia", "div");
    }
    else
    {
        strUrl = "/ajax_index_tejia_v3.php?cate=other";
        ajaxGetFile(strUrl, showAL(str, "main_left", "hot_tejia", "div"));
    }
}
function showAL(str, parentname, selfname, tagname)
{
    var d = getElementByName(gE(parentname), selfname, tagname);
    if(d)
    {
        if(str != "")
        {
            d.innerHTML = str;
            d.style.display = "";
        }
        else
        {
            d.style.display = "none";
        }
    }
}
function changecity(obj,flag)
{
    if(flag!=1)
    thelastspan=document.getElementById("spanmorebtn").previousSibling;
    else
    thelastspan=document.getElementById("fesmore").previousSibling;
    var tolistcode=thelastspan.getAttribute("urlkey");
    var tolistname=thelastspan.getAttribute("urlname");
    var fromcode=obj.getAttribute("urlkey");
    var fromname=obj.getAttribute("urlname");
    obj.innerHTML=tolistname;
    obj.setAttribute("urlkey",tolistcode);
    obj.setAttribute("urlname",tolistname);

    thelastspan.setAttribute("urlkey",fromcode);
    thelastspan.setAttribute("urlname",fromname);
    thelastspan.innerHTML=fromname;
    hidemorecitydiv();
    if(flag == 1)
    pickercity(thelastspan);
    else
    shiftcity(thelastspan);
}

function initmorecitydiv(flag)
{
    var ss = "";
    ss += '<td>';
    //ss += '<img class="sanj" src="/img/index_v2/point1.gif" />';
    ss += '<img class="sanj" src="/image/result_v3/img11.gif" />';
    ss += '</td>';
    ss +='<div class="yy">';
    ss +='<div class="xzcs">';
    ss +='<div class="biaoti">';
    ss +='<img style="cursor:pointer" class="left" src="/img/index_v2/close.gif" onclick="hidemorecitydiv();" />';
    ss +='<div class="clear"></div>';
    ss +='</div>';

    ss +='<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">';
    var tmpcount=citycodelistmore.length%5;
    /*
    for(i=0;i<Math.floor(citycodelistmore.length/5);i++)
    {
    for(j=0;j<5;j++)
    {
    ss+='<span onclick="changecity(this);event.cancelBubble=true;"  urlkey="'+citycodelistmore[5*i+j]+'"  urlname="'+citynamelistmore[5*i+j]+'"   style="cursor:pointer;background:none">'+citynamelistmore[5*i+j]+'</span>';
    }
    }*/
    for(i=0;i<Math.floor(citycodelistmore.length);i++)
    {
        if(i%5 == 0)
        {
            ss +='<tr>';
        }
        ss += '<td><span onclick="changecity(this,'+flag+');event.cancelBubble=true;"  urlkey="'+citycodelistmore[i]+'"  urlname="'+citynamelistmore[i]+'">'+citynamelistmore[i]+'</span></td>';
        if(i%5 == 4)
        {
            ss +='</tr>';
        }
    }
    ss +='</table>';
    ss +='<div>';
    if(flag == 0)
    ss +='<label><a href="http://jipiao.kuxun.cn/morecities.html" style="float:right;padding-bottom:3px;padding-right:7px;">所有城市>></a><label>';
    if(flag == 1)
    ss +='<label><a href="http://jipiao.kuxun.cn/festival/" style="float:right;padding-bottom:3px;padding-right:7px;">所有城市>></a><label>';
    ss +='<div class="clear"></div>';
    ss +='</div>';
    ss += '</div>'
    ss +='</div>';
    ss +='</div>';
    ss +='</div>';

    document.getElementById("morecitydiv").innerHTML=ss;
}

function getspanLeft(x){var l=0;while(x){l+=x.offsetLeft;x=x.offsetParent;}return l;}
function showmorectiy(obj,flag)
{
    initmorecitydiv(flag)
    var divleft=getspanLeft(document.getElementById("content"));
    var spanleft=getspanLeft(obj);

    if (document.getElementById("morecitydiv").style.display   ==   ""){document.getElementById("morecitydiv").style.display   =   "none";}
    else{document.getElementById("morecitydiv").style.display   =   "";
    document.getElementById("morecitydiv").style.left   =   spanleft-25+"px";
    document.getElementById("morecitydiv").style.top   =gETop(obj)+ 25+"px";
    }
}
//点击节日专区的citytab
function pickercity(obj)
{
    if(!obj)
    {
        return;
    }
    var citylist = getNames(gE("fes"), "city", "span");
    strUrlKey = obj.getAttribute("urlkey");
    strUrlName = obj.getAttribute("urlname");
    obj.className = "checked";
    for(i = 0; i < citylist.length; ++ i)
    {
        if(citylist[i].getAttribute("urlkey") != strUrlKey)
        {
            citylist[i].className = "";
        }
    }
    setCityCodeOffesNav(strUrlKey);
    $("#from_cityname").attr("codename",strUrlKey);
    $("#from_cityname").attr("class","checked");
    $("#to_cityname").removeClass();
    $("#to_cityname").attr("codename",strUrlKey);
    $("#from_cityname").html(strUrlName+"出发");
    $("#to_cityname").html("到达"+strUrlName);
    //alert(tab_flag);
    /*
    if ('from' == tab_flag)
    {
    $("#from_cityname").attr("codename",strUrlKey);
    $("#from_cityname").attr("class","checked");
    $("#from_cityname").html(strUrlName+"出发");
    }
    if ('to' == tab_flag)
    {
    $("#to_cityname").attr("codename",strUrlKey);
    $("#to_cityname").attr("class","checked");
    $("#to_cityname").html("到达"+strUrlName);
    }
    */
    arrived = 0;
    pickfesdate = getFesDate();
    strUrl = "/yuandan/getfestival_v2.php?citycode="+strUrlKey+"&date="+pickfesdate;
    if(arrived == 1)
    strUrl+="&type=arrived";
    ajaxGetFile(strUrl, showfespiao);
}
function getFesDate(){
    curdate = "";
    $("#fesnav span").each(function(){
        curclass = $(this).attr("class");
        if(curclass=="checked"){
            curdate = $(this).attr("urlshowdate");
            return curdate;
        }
    });
    return curdate;
}
function getFesCity(){
    curcity = "";
    $("#fes span").each(function(){
        curclass = $(this).attr("class");
        if(curclass=="checked"){
            curdate = $(this).attr("urlname");
            return curcity;
        }
    });
    return curcity;
}
function setCityCodeOffesNav(citycode){
    $("#fesnav span").each(function(){
        if($(this).attr("urlcitycode"))
        $(this).attr("urlcitycode",citycode);
    });
}
function jipiao_up(val, target)
{
    var target_val = document.getElementById(target).value;
    if(target_val.length >1)
    {
        var from = document.getElementById('frmcity').value;
        var to = document.getElementById('tocity').value;
        if(val == 1)
        {
            var url = "http://jipiao.kuxun.cn/ajaxgetReusultInfo.php?funcname=hq_homepage&type=single&from=" + encodeURIComponent(from) + "&to=" + encodeURIComponent(to);
            document.getElementById('jipiao_img').src = url;
            document.getElementById('fromto').innerHTML = from+"-"+to;
            document.getElementById('hangqing').href = 'http://jipiao.kuxun.cn/hqdir/'+getCityCode(from)+'_'+getCityCode(to)+'.html';
        }
        else if(val == 2)
        {
            var url = "http://jipiao.kuxun.cn/ajaxgetReusultInfo.php?funcname=hq_homepage&type=returnsingle&from=" + encodeURIComponent(from) + "&to=" + encodeURIComponent(to);
            document.getElementById('jipiao_img').src = url;
            document.getElementById('fromto').innerHTML = from+"-"+to;
            document.getElementById('hangqing').href = 'http://jipiao.kuxun.cn/hqdir/'+getCityCode(from)+'_'+getCityCode(to)+'.html';
        }

        fix_special_price_url(from);
    }
}
function getRadioValue($)
{
    var obj=document.getElementsByName($);
    if(obj!=null)
    {
        var i;
        for(i=0;i<obj.length;i++)
        {
            if(obj[i].checked)
            {
                return obj[i].value;
            }
        }
    }
    return null;
}
function getposition(obj)
{
    var r = new Array();
    r['x'] = obj.offsetLeft;
    r['y'] = obj.offsetTop;
    while(obj = obj.offsetParent)
    {
        r['x'] += obj.offsetLeft;
        r['y'] += obj.offsetTop;
    }
    return r;
}
var hotcityarr={"北京":"PEK","上海":"SHA","广州":"CAN","深圳":"SZX","成都":"CTU","重庆":"CKG","西安":"XIY","杭州":"HGH","武汉":"WUH","南京":"NKG","沈阳":"SHE","天津":"TSN","大连":"DLC","青岛":"TAO","长沙":"CSX","昆明":"KMG","长春":"CGQ","郑州":"CGO","海口":"HAK","合肥":"HFE","济南":"TNA","福州":"FOC","哈尔滨":"HRB","乌鲁木齐":"URC"};
function inithotcity(anchor)
{
    var morecitystr = '<div class="tc_content">';
    morecitystr += '<h6 class="h6"><span class="close" onclick="hide_city();"></span>';
    if(anchor != "tejia_from")
    {
        morecitystr += 'Top&nbsp;24';
    }
    morecitystr += '热门城市</h6>';
    morecitystr += '<ul class="tc_ul">';
    for(hotcity in hotcityarr)
    {
        if(anchor == "tejia_from")
        {
            if(tmpcityarr.join('').indexOf(hotcity) == -1)
            {
                morecitystr += '<li><a  urlkey="'+hotcityarr[hotcity]+'">'+hotcity+'</a></li>';
            }
        }
        else
        {
            morecitystr += '<li><a>'+hotcity+'</a></li>';
        }
    }
    morecitystr += '</ul>';
    morecitystr += '</div>';
    document.getElementById('tanchu').innerHTML = morecitystr;
}

function tanchu(anchor,id)
{
    inithotcity(anchor);
    var position = getposition(document.getElementById(anchor));
    var tc = document.getElementById('tanchu');
    var as = tc.getElementsByTagName("a");
    for(var i=0; i<as.length; i++)
    {
        as[i].onclick = function()
        {
            var a = i;
            return function()
            {
                if(anchor == "tejia_from")
                {
                    view_from = hotcityarr[as[a].innerHTML];
                    InitCityNav(as[a].innerHTML);
                    viewCityTejia(hotcityarr[as[a].innerHTML]);
                }
                else
                {
                    document.getElementById(id).value = as[a].innerHTML;
                }
                if(anchor == 'search_from' || anchor == 'search_to')
                {
                    //changeAirType(getRadioValue('type'));
                    changeAirType($('#internal_search_type').val() || 1);
                }
                if(anchor == 'hq_from' || anchor == 'hq_to')
                {
                    hq_from_name = $("#hqfrmcity").val();
                    hq_from = getCityCode(hq_from_name);
                    hq_to_name = $("#hqtocity").val();
                    hq_to = getCityCode(hq_to_name);
                    indexhq();
                    $("#hq_title_from").html(hq_from_name);
                    $("#hq_title_to").html(hq_to_name);
                    indexhq();
                }

                hide_city();
            }
        }(i);
    }
    if(anchor == "tejia_from")
    {
        tc.style.left = parseInt(position['x'] - 7) + 'px';
        tc.style.top = parseInt(position['y'] + 35) + 'px';
    }
    else if(anchor == "hq_from" || anchor == "hq_to")
    {
        tc.style.left = parseInt(position['x'] - 105) + 'px';
        tc.style.top = parseInt(position['y'] + 25) + 'px';
    }
    else
    {
        tc.style.left = parseInt(position['x'] - 138) + 'px';
        tc.style.top = parseInt(position['y'] + 25) + 'px';
    }
    tc.style.display = '';
}
function hide_city()
{
    document.getElementById('tanchu').style.display = 'none';
    //document.getElementById("price").style.display = '';
}

function fix_special_price_url(from_city)
{
    if (from_city)
    {
        var obj = $('#special_price_url');
        var pinyin = city_pinyin_map[from_city] || from_city;
        var href = obj.attr('href', '/tejia-' + pinyin + '.html');
    }
}

$(document).ready(function(){
    $("#jipiao_search").click(function(){
        var flag = check_search_ext_int();
        if (1 == flag)
        {
            /** fix home page code lost bug.*/
            var from_city = $('#frmcity').attr('value');
            var to_city   = $('#tocity').attr('value');
            $('#From').attr('value', int_city_code_map[from_city] ? int_city_code_map[from_city] : '');
            $('#to').attr('value', int_city_code_map[to_city] ? int_city_code_map[to_city] : '');
            Submit_($(this));
        } else if (2 == flag)
        {
            goto_elong();
            return false;
        } else if (-1 == flag)
        {
            error_msg('城市有误,请重新选择.');
            return false;
        }

        return false;
    })
    .bind('mouseenter', function(){
        $(this).attr('class', 'search_kxsubmit_here');
    })
    .bind('mouseleave', function(){
        $(this).attr('class', 'search_kxsubmit');
    });

    preloadResultImages();
    /*
    questionnaire();
    bind_questionnaire();
    */
});

function preloadResultImages() {
    var image_files = ["/img/resultloading.gif", "/image/result_v3/kooxoo_top_yy.gif", "/image/result_v3/kooxoo_top.gif", "http://jp1.kximg.cn/image/result/fix/tab_div_bg.gif", "http://jp1.kximg.cn/image/result/result_v3/bg7.gif", "http://jp1.kximg.cn/image/result/fix/ad_banner.gif", "http://jp1.kximg.cn/image/search/search_btn.gif", "http://jp1.kximg.cn/image/airline/HU.gif", "http://jp1.kximg.cn/image/airline/KN.gif", "http://jp1.kximg.cn/image/airline/MU.gif", "http://jp1.kximg.cn/image/airline/CZ.gif", "http://jp1.kximg.cn/image/airline/FM.gif", "http://jp1.kximg.cn/image/airline/CA.gif", "http://jp1.kximg.cn/image/airline/00.gif"];
    var img = [];
    for (i = 0; i < image_files.length; i++) {
        img[i] = new Image();
        img[i].src = image_files[i];
    }
}

function questionnaire()
{
    if (1 == $.cookie('__utmkxcq'))
    {
        return false;
    }
    var html = [];
    html.push('<div id="hcp_jp">');
    html.push('<div class="hcp_jp_title"><a id="patch_hotel_close" href="#" class="guanbi"></a></div>');
    html.push('<div id="recommend_hotel_content" class="hcp_content">');
    html.push('<div id="patch_hotel_info">');
    html.push('<a target="_blank" href="/questionnaire/searchtaste.php" onclick="append_ga(\'HomePage\',\'Click\',\'questionnaire\',1);">');
    html.push('<img src="/images/fix/question-ads.gif" />');
    html.push('</a>');
    html.push('</div>');
    html.push('</div>');
    html.push('</div>');

    $('#questionnaire').show().html(html.join('')).floatdiv('rightbottom');
}

function bind_questionnaire()
{
    $('#patch_hotel_close').click(function(){
        if ($.browser.msie && $.browser.version < 7)
        {
            $('#questionnaire').hide();
        }
        else
        {
            $('#questionnaire').slideUp('slow');
        }
        $.cookie('__utmkxcq', 1, { expires: 0, path: '/', secure: 0 });

        return false;
    });
}

function onUrl(From,to){
    From = From.replace(/\s+/g,"");
    to = to.replace(/\s+/g,"");

    if ('' == From)
    {
        alert('出发城市不能为空');
        return false;
    } else if ('' == to)
    {
        alert('到达城市不能为空');
        return false;
    }

    From = int_city_code_map[From] ? int_city_code_map[From] : '';
    to   = int_city_code_map[to] ? int_city_code_map[to] : '';
    if (! From || ! to)
    {
        alert('你输入的城市名不在查询范围内');
        return false;
    }

    if (From == to)
    {
        alert('出发城市和到达城市不能相同');
        return false;
    }

    // int_city_code_map

    return true;
}

function seoPlugin(){
//    $(".jp_tj_ul li a").each(function(){
//        $(this).attr("href",add_tongji($(this).attr("href")));
//    });
}

function add_tongji(href){
    var tongji='http://tongji.kuxun.cn/commerce.php?url=';
    var new_href=tongji + href;
    return new_href;
}
var jsReady = false;
var swfReady = false;
var hqwidth;
var hqheight;
var hqtype;
function isReady() {
    return jsReady;
}
function setSWFIsReady() {
    swfReady = true;
    updateStatus();
}
function newMessage(value) {}
function statusChange() {
    updateStatus();
}
function pageInit() {
    jsReady = true;
}
function updateStatus() {
	if (swfReady) {
        var currentStatus = getSWF("hqfo").getStatus();
    }
}
function getSWF(movieName) {
	if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
    } else {
        return document[movieName];
    }
}
function initnewhq(name,src, width, height, type,from,id){
    hqwidth = width;
    hqheight = height;
    if(type != null) {
        hqtype = type;
    } else {
        hqtype = "";
    }
	hqtype = "";
	if((typeof(fromid) == "string") && (fromid != "")) {
	   hqdata= encodeURIComponent ("http://jipiao.kuxun.cn/fcgi-bin/hqquery_serv/?hqfrom=" + from + "&hqto=" + to + "&fromid=" + fromid + "&type=" + hqtype + "&randno=" + Math.random());
	} else {
	    hqdata = encodeURIComponent ("http://jipiao.kuxun.cn/fcgi-bin/hqquery_serv/?hqfrom=" + from + "&hqto=" + to + "&type=" + hqtype + "&randno=" + Math.random());
	}
	flashvars = "hasTitle=1&data="+hqdata;
	str = CreateFlash(name,src,hqwidth,hqheight,flashvars);
	gE('PriceTrend').innerHTML = str;	
}
function inithq(from, to, width, height, type) {
    alert('**************');
    hqwidth = width;
    hqheight = height;
    if(type != null) {
        hqtype = type;
    } else {
        hqtype = "";
    }
	/*
    var so = new SWFObject("/hq.swf", "hqfo", hqwidth, hqheight, 8, "#FFFFFF");
    var from_name = getCnName(from); 
    var to_name   = getCnName(to);
	so.addParam("wmode", "transparent");
	so.addVariable("hasTitle", "1");
	if((typeof(fromid) == "string") && (fromid != "")) {
	    so.addVariable("data", encodeURIComponent ("http://jipiao.kuxun.cn/fcgi-bin/hqquery_serv/?hqfrom=" + from + "&hqto=" + to + "&fromid=" + fromid + "&type=" + hqtype + "&randno=" + Math.random()));
	} else {
	    so.addVariable("data", encodeURIComponent ("http://jipiao.kuxun.cn/fcgi-bin/hqquery_serv/?hqfrom=" + from + "&hqto=" + to + "&type=" + hqtype + "&randno=" + Math.random()));
	}
	so.addVariable("mess", from_name + "-" + to_name);
	so.addVariable("errorProcessFunc", "flashError");
	var pricediv = document.getElementById('PriceTrend');
	var explaindiv = document.getElementById('explaindiv');
    pricediv.style.display = "";
    explaindiv.style.display = "";
	var errordiv = document.getElementById('leerror');
	errordiv.innerHTML = "";
	errordiv.style.display = "none";
	so.write("PriceTrend");
    */
}
function hqisValidCity(sCtiy, fromorto) {
    flag = false;
    for(i = 0; i < apdata.length; i++) {
        if(apdata[i][1] == sCtiy) {
            flag = true;
            if(fromorto == 1) {
                from = apdata[i][0];
            } else {
                to = apdata[i][0];
            }
            break;
        }
    }
    return flag;
}
function hqIsEmpty(v) {
     return ((v == null) || (v.length == 0) || /^\s+$/.test(v));
}
function sousuohq() {
    var hqfrmcity = document.getElementById("hqfrmcity");
    var from_name; 
    if(hqfrmcity.tagName == "INPUT") {
        from_name = hqfrmcity.value;
    } else {
        from_name = hqfrmcity.innerHTML;
    }
    var from = getCityCode(from_name);
    if(hqIsEmpty(from_name)) {
        alert("出发地不能为空");
        return false;
    } else {
        if(!hqisValidCity(from_name, 1)) {
            alert("出发地城市不正确");
            return false;
        }
    }
    var hqtocity = document.getElementById("hqtocity");
    var from_name; 
    if(hqfrmcity.tagName == "INPUT") {
        to_name = hqtocity.value;
    } else {
        to_name = hqtocity.innerHTML;
    }
    var to = getCityCode(to_name);
    if(hqIsEmpty(to_name)) {
        alert("目的地不能为空");
        return false;
    } else {
        if(!hqisValidCity(to_name, 0)) {
            alert("目的地城市不正确");
            return false;
        }
    }
    if(from == to) {
        alert("出发地和目的地不能相同");
        return false;
    }

    $('#hq_from_city').html(from_name);
    $('#hq_to_city').html(to_name);

	setHqVar('home_hq', from, to, 680, 350);
    createHQswf('PriceTrend');
    //initnewhq("hqfo","/hq.swf",hqwidth, hqheight,hqtype,from,to,"PriceTrend");
    //inithq(from, to, hqwidth, hqheight, hqtype);
}
function flashError(msg) {
	var pricediv = document.getElementById('PriceTrend');
	var explaindiv = document.getElementById('explaindiv');
    pricediv.style.display = "none";
    explaindiv.style.display = "none";
	var errordiv = document.getElementById('leerror');
	errordiv.innerHTML = "<h2><font color='#ff0000'>" + msg + "</font></h2>";
	errordiv.innerHTML = "<br><h3>暂无该区间机票行情</h3><br>";
	errordiv.style.display = "";
}
function CreateFlash(idad, swfurl, wad, had, vs){
  	var str = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"" + wad + "\" height=\"" + had + "\" id=\"" + idad + "\" align=\"middle\">";
     str += "<param name=\"allowScriptAccess\" value=\"always\">";
	 str += "<param name=\"wmode\" value=\"transparent\">";
	 str += "<param name=\"quality\" value=\"high\">";
	 str += "<param name=\"movie\" value=\"" + swfurl + "\">";
	 str += "<param name=\"flashvars\" value=\"" + vs + "\">";
	 str += "<embed src=\"" + swfurl + "\" flashvars=\"" + vs + "\" wmode=\"transparent\" quality=\"high\" width=\"" + wad + "\" height=\"" + had + "\" name=\"" + idad + "\" align=\"middle\" allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">";
	 str += "</object>";
	 return (str);
}
function gETop(x) {
    var t = 0;
    while(x) {
        t += x.offsetTop;
        x = x.offsetParent;
    }
    return t;
}
function gEBottom(x) {
    return (x.offsetHeight+gETop(x));
}
function gELeft(x) {
    var l = 0;
    while(x) {
        l += x.offsetLeft;
        x = x.offsetParent;
    }
    return l;
}
function gERight(x) {
    return (x.offsetWidth + gELeft(x));
}
function CityPicker(targetid, handler) {
    this.targetid = targetid;
    this.ahandler = handler;
    this.init();
}
CityPicker.cityArr = [
    ["北京", "PEK"],
    ["上海", "SHA"],
    ["广州", "CAN"],
    ["深圳", "SZX"],
    ["成都", "CTU"],
    ["重庆", "CKG"],
    ["西安", "XIY"],
    ["杭州", "HGH"],
    ["沈阳", "SHE"],
    ["大连", "DLC"],
    ["青岛", "TAO"],
    ["武汉", "WUH"],
    ["长沙", "CSX"],
    ["南京", "NKG"],
    ["厦门", "XMN"],
    ["天津", "TSN"],
    ["昆明", "KMG"],
    ["长春", "CGQ"],
    ["宁波", "NGB"],
    ["郑州", "CGO"],
    ["哈尔滨", "HRB"],
    ["海口", "HAK"],
    ["合肥", "HFE"],
    ["兰州", "LHW"],
    ["福州", "FOC"],
    ["贵阳", "KWE"],
    ["济南", "TNA"],
    ["乌鲁木齐", "URC"]
];
CityPicker.prototype.init = function () {
    if(!document.getElementById("citypicker")) {
        var _this = this;
        var div = document.createElement('div');
        div.style.display = "none";
        div.className = "index_ghcs1";
        div.setAttribute("id", "citypicker");
        var strHTML = new StringBuffer(); 
        strHTML.append('<div class="index_Layer2" onclick="event.cancelBubble=true;"><div class="index_point"><img src="/image/result_v3/img11.gif" /></div><div class="yy"><div class="xzcs"><p><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="right" height="30" colspan="7" class="index_Layer_title"><img class="index_close" id="cpclosebutton" src="/img/index_v2/close.gif" style="cursor:pointer;" /></td>');
        for(var i = 0; i < CityPicker.cityArr.length; i++) {
            if(i % 7 == 0) {
                strHTML.append('</tr><tr>');
            }
            strHTML.append('<td class="index_Layer_city"><span style="color:#026cc6;cursor:pointer;" citycode="' + CityPicker.cityArr[i][1] + '">' + CityPicker.cityArr[i][0] + '</span></td>');
        }
        strHTML.append('</tr><tr><td align="right" height="30" colspan="7"><input type="text" class="input_1" id="citypicker_cityname" value="" /><input class="input_2" type="image" src="/img/index_v2/tijiao.gif" id="citypicker_imgbutton" /></td></tr></table></p></div></div></div></div>');
        div.innerHTML = strHTML.toString();
        document.body.appendChild(div);
        var cpclosebutton = document.getElementById('cpclosebutton');
        cpclosebutton.onclick = function() {
            _this.hide();
        }
        addWindowResetEvent(function() {
                if(_this.htmlpart.style.display != "none") {
                    _this.show(true);
                }
            });
    }
    this.htmlpart = document.getElementById("citypicker");
}
CityPicker.prototype.show = function (onresize) {
    this.hide();
    if(onresize != true) {
        var _this = this;
        var actionArr = document.getElementById("citypicker").getElementsByTagName("span");
        for(var i = 0; i < actionArr.length; i++) {
            actionArr[i].onclick = function() {
                _this.submit(this.innerHTML, this.getAttribute("citycode"));
            }
        }
        document.getElementById("citypicker_imgbutton").onclick = function () {
            var cityname = document.getElementById("citypicker_cityname").value;
            var citycode = getCityCode(cityname);
            _this.submit(cityname, citycode);
        }
        this.htmlpart.onkeydown = function(event) {
            event = event || window.event;
            keynum = event.which || event.keyCode;
            if(keynum == 13) {
                var cityname = document.getElementById("citypicker_cityname").value;
                var citycode = getCityCode(cityname);
                _this.submit(cityname, citycode);
            }
        }
    }
    var atarget = document.getElementById(this.targetid);
    var aleft = gELeft(atarget);
    var aright = gERight(atarget);
    var cleft = (aright - aleft) / 2 + aleft - 54; 
    var ctop = gEBottom(atarget);
    this.htmlpart.style.top = ctop + "px";
    this.htmlpart.style.left = cleft + "px";
    this.htmlpart.style.display = "block";
}
CityPicker.prototype.hide = function () {
    if(gsug) {
        gsug.hide();
    }
    this.htmlpart.style.display = "none";
}
CityPicker.prototype.submit = function (cityname, citycode) {
    this.hide();
    var atarget = document.getElementById(this.targetid);
    if(citycode != null && citycode != "") {
        if(atarget.tagName == "INPUT") {
            atarget.value = cityname;
        } else {
            atarget.innerHTML = cityname;
        }
        this.ahandler(cityname, citycode);
    }
}
CityPicker.hide = function () {
    var citypicker = document.getElementById("citypicker");
    if(citypicker) {
       citypicker.style.display = "none"; 
    }
    if(gsug) {
        gsug.hide();
    }
}

function gETop(x) {
    var t = 0;
    while(x) {
        t += x.offsetTop;
        x = x.offsetParent;
    }
    return t;
}
function gEBottom(x) {
    return (x.offsetHeight+gETop(x));
}
function gELeft(x) {
    var l = 0;
    while(x) {
        l += x.offsetLeft;
        x = x.offsetParent;
    }
    return l;
}
function gERight(x) {
    return (x.offsetWidth + gELeft(x));
}
function CityPicker_fes(targetid, handler) {
    this.targetid = targetid;
    this.ahandler = handler;
    this.init();
}
CityPicker_fes.cityArr = [
    ["全国", "ALL"],
    ["北京", "PEK"],
    ["上海", "SHA"],
    ["广州", "CAN"],
    ["深圳", "SZX"],
    ["成都", "CTU"],
    ["重庆", "CKG"],
    ["西安", "XIY"],
    ["杭州", "HGH"],
    ["沈阳", "SHE"],
    ["大连", "DLC"],
    ["青岛", "TAO"],
    ["武汉", "WUH"],
    ["长沙", "CSX"],
    ["南京", "NKG"],
    ["厦门", "XMN"],
    ["天津", "TSN"],
    ["哈尔滨", "HRB"],
    ["乌鲁木齐", "URC"],
    ["昆明", "KMG"],
    ["长春", "CGQ"],
    ["宁波", "NGB"],
    ["郑州", "CGO"],
    ["济南", "TNA"],
    ["海口", "HAK"],
    ["合肥", "HFE"],
    ["兰州", "LHW"],
    ["福州", "FOC"]];
CityPicker_fes.prototype.init = function () {
    if(!document.getElementById("citypicker_fes")) {
        var _this = this;
        var div = document.createElement('div');
        div.style.display = "none";
        div.className = "index_ghcs1";
        div.setAttribute("id", "citypicker_fes");
        var strHTML = new StringBuffer(); 
        strHTML.append('<div class="index_Layer2" onclick="event.cancelBubble=true;"><div class="index_point"><img src="/img/index_v2/point1.gif" /></div><div class="yy"><div class="xzcs"><p><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td align="right" height="30" colspan="7" bgcolor="#f1f1f1" class="index_Layer_title"><img class="index_close" id="cpclosebutton_fes" src="/img/index_v2/close.gif" style="cursor:pointer;" /></td>');
        for(var i = 0; i < CityPicker_fes.cityArr.length; i++) {
            if(i % 7 == 0) {
                strHTML.append('</tr><tr>');
            }
            strHTML.append('<td class="index_Layer_city"><span style="color:#026cc6;cursor:pointer;" citycode="' + CityPicker_fes.cityArr[i][1] + '">' + CityPicker_fes.cityArr[i][0] + '</span></td>');
        }
        strHTML.append('</tr><tr><td align="right" height="30" colspan="7"><input type="text" class="input_1" id="citypicker_cityname_fes" value="" /><input class="input_2" type="image" src="/img/index_v2/tijiao.gif" id="citypicker_imgbutton_fes" /></td></tr></table></p></div></div></div></div>');
        div.innerHTML = strHTML.toString();
        document.body.appendChild(div);
        var cpclosebutton = document.getElementById('cpclosebutton_fes');
        cpclosebutton.onclick = function() {
            _this.hide();
        }
        addWindowResetEvent(function() {
                if(_this.htmlpart.style.display != "none") {
                    _this.show(true);
                }
            });
    }
    this.htmlpart = document.getElementById("citypicker_fes");
}
CityPicker_fes.prototype.show = function (onresize) {
    this.hide();
    if(onresize != true) {
        var _this = this;
        var actionArr = document.getElementById("citypicker_fes").getElementsByTagName("span");
        for(var i = 0; i < actionArr.length; i++) {
            actionArr[i].onclick = function() {
                _this.submit(this.innerHTML, this.getAttribute("citycode"));
            }
        }
        document.getElementById("citypicker_imgbutton_fes").onclick = function () {
            var cityname = document.getElementById("citypicker_cityname_fes").value;
            var citycode = getCityCode(cityname);
            _this.submit(cityname, citycode);
        }
        this.htmlpart.onkeydown = function(event) {
            event = event || window.event;
            keynum = event.which || event.keyCode;
            if(keynum == 13) {
                var cityname = document.getElementById("citypicker_cityname_fes").value;
                var citycode = getCityCode(cityname);
                _this.submit(cityname, citycode);
            }
        }
    }
    var atarget = document.getElementById(this.targetid);
    var aleft = gELeft(atarget);
    var aright = gERight(atarget);
    var cleft = (aright - aleft) / 2 + aleft - 54; 
    var ctop = gEBottom(atarget);
    this.htmlpart.style.top = ctop + "px";
    this.htmlpart.style.left = cleft + "px";
    this.htmlpart.style.display = "block";
}
CityPicker_fes.prototype.hide = function () {
    if(gsug) {
        gsug.hide();
    }
    this.htmlpart.style.display = "none";
}
CityPicker_fes.prototype.submit = function (cityname, citycode) {
    this.hide();
    var atarget = document.getElementById(this.targetid);
    if(citycode != null && citycode != "") {
        if(atarget.tagName == "INPUT") {
            atarget.value = cityname;
        } else {
            atarget.innerHTML = cityname;
        }
        this.ahandler(cityname, citycode);
    }
}
CityPicker_fes.hide = function () {
    var citypicker = document.getElementById("citypicker_fes");
    if(citypicker) {
       citypicker.style.display = "none"; 
    }
    if(gsug) {
        gsug.hide();
    }
}

$(document).ready(function(){
    //alert('I will set cookie for google analytics.');
    $('#search_query').click(function(){
        //alert('Clicked me?');
        timeCounter = new Date();
        $.cookie('analytics_start', timeCounter.getTime(), 60); 
        //alert('Did I set cookie?');
    });
});
var hq_swfid = "hq_tejia";
var hq_from_code = "PEK";
var hq_to_code = "SHA";
var hq_width = "610";
var hq_height = "260";
var hq_bg_width = "680";
var hq_bg_height = "300";
function setHqVar(swfid,from_city, to_city, width, height, bg_width, bg_height)
{
   hq_from_code = from_city;
   hq_to_code = to_city;
   hq_width = width;
   hq_height = height;
   hq_bg_width = bg_width;
   hq_bg_height = bg_height;
}
function upHqSwf(from_city)
{
    thisMovie("main").setApiURL(from,to);
}
function createHQswf(hq_div)
{
    /** set variable*/
    var path = '/js/main.swf';

    var fver = deconcept.SWFObjectUtil.getPlayerVersion();
    //js_debug('flash player is:' + fver.major);
    if( fver.major < 9 ){
        $('#' + hq_div).html('<div class="flash_error"><br />酷讯机票行情图需要flash player 9 以上版本浏览,请点击下面图片链接安装最新版本的flash <a href="/Flash_Player_10_ActiveX.exe" target="_blank"><br><div><br /><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></div></a></div>').show();
        return;
    }

    var so = new SWFObject(path, hq_swfid, hq_bg_width, hq_bg_height, 8, "#FFFFFF");
    so.addParam("wmode", "transparent");
    so.addVariable("hasTitle", "1");
    so.write(hq_div);
    $('#' + hq_div).show();

}
function setCity()
{
	return hq_from_code+"&"+hq_to_code;
}

function setWH()
{
	return hq_width+"&"+hq_height;
}


function thisMovie(movieName) 
{
	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		return window[movieName]
	}
	else
	{
		return document[movieName]
	}
}

function callExternalInterface() 
{
	var from = document.getElementById("frmcity").value;
	var to = document.getElementById("tocity").value;
	thisMovie("main").setApiURL(from,to);
	//thisMovie("main").setWH(600,400);
}

function thisMovie(movieName) 
{
	if (navigator.appName.indexOf("Microsoft") != -1)
	{
		return window[movieName]
	}
	else
	{
		return document[movieName]
	}
}

$(document).ready(function(){
    //js_debug('I am here. I will have external data.');
    //bind_pic_click();
    switch_ticket_type();           /** internal or external*/
    //switch_search_process_type();   /** single or round*/

    /** init suggestion*/
    //KX.AC.init(KX.AC.external);

    bind_hot_international();
    bind_pop_close();
    plugin_ie6_bug();

    bind_ext_recommend_list();

    patch_internal_search_box();

    bind_checkbox_switch();

    //patch_dashed_style();
});

function bind_pic_click()
{
    $('#search_from, #search_to').click(function(){
        var left = $(this).offset().left - 138;
        //js_debug('left is: ' + left);
        setTimeout(function(){
            $('#tanchu').css({'left': left + 'px'});
        }, 50);
    });
}

function switch_search_process_type()
{
    $('.search_type').change(function(){
        var attr = $(this).attr('attr');
        var type = $(this).val() || 1;
        var box;

        switch (attr)
        {
            case 'internal':
                box = $('#redate');
                changeAirType(type);
                //js_debug('Why no data.');
                break;

            case 'external':
                box = $('#ext_redate');
                break;

            default :
                return false;
        }
            
        if (1 == type)
        {
            box.hide();
        } else if (2 == type)
        {
            box.show();
        }
        
        /** bug#fix IE6 select bug*/
        fix_ie_bug('show');
    });
}

function switch_ticket_type()
{
    $('input[name=inter_exter]').click(function(){
        //js_debug('Hello, I am clicked, radio' + $(this).val());
        var value = $(this).val();
        if ('internal' == value)
        {
            show_internal_search();
        } else if ('external' == value)
        {
            show_external_search();
            ext_create_recommend(ext_get_current_city());
            //bind_ext_recommend_list();
        }
    });
}

function show_internal_search()
{
    $('#internal_form').show();
    $('#internal_search_right').show();
    $('#external_form').hide();
    $('#external_search_right').hide();
}

function show_external_search()
{
    $('#internal_form').hide();
    $('#internal_search_right').hide();
    $('#external_form').show();
    $('#external_search_right').show();
}

//KX.AC.external = [
//    {
//        "name":"JipiaoStart", 
//            "channel":"JipiaoGN",
//            "input":"ext_frmcity",
//            "container":"ext_container1",
//            "containerWidth":200,
//            "resultCount":10,
//            "resultsJsonTag":["sKey", "sJianpin", "sAbbr"]
//    },
//    {
//        "name":"JipiaoEnd", 
//        "channel":"JipiaoGJ",
//        "input":"ext_tocity",
//        "container":"ext_container2",
//        "containerWidth":200,
//        "resultCount":10,
//        "resultsJsonTag":["sKey", "sJianpin", "sAbbr"]
//    }
//];

function bind_hot_international()
{
    $('#ext_search_from').bind('click', function(){
        tanchu('search_from','ext_frmcity');
        //append_ga('HomePage','Click','Ext_DepCityIcon',1);
        
        var offset = $(this).offset();
        var left = offset.left - 140;
        var top = offset.top + 25;
        $('#tanchu').css({
            'left': left,
            'top': top
        });

        fix_ie_bug();        
        return false;
    });

    $('#ext_search_to').bind('click', function(){
        var popup = $('#tanchu');

        var offset = $(this).offset();
        var left = offset.left - 140;
        var top = offset.top + 25;
        
        popup.html($('#international_hot_city').html())
        .css({
            'left': left,
            'top': top
        })
        .show();
        
        setTimeout(function(){
            bind_hot_city_event();
        }, 100);
        
        return false;
    });
}

function bind_hot_city_event()
{
    $('.tc_ul > li').each(function(){
        $(this).click(function(){
            var city = $(this).html();
            if (city && '伦敦' == city)
            {
                city = '伦敦（英国）';
            }
            $('#ext_tocity').val(city);
        });
    });
}

function check_search_ext_int()
{
    var flag = $('input[name=inter_exter]').filter(':checked').val();
    var res = -1;
    switch (flag)
    {
        case 'internal':
            res = 1;
            break;

        case 'external':
            res = 2;
            break;
    }
    
    return res;
}

function goto_elong(data)
{
    /**
        single: list
        round: golist
    */
    //var url = 'http://www.elong.com/redirect/redirect.aspx?f=5012&u=http%3A%2F%2Ftravel.elong.com%2Fiflight%2Fcn%2F%list%2F%from_%to%2F%date%2FAll_1_0_Y_0%3FCampaign_ID%3D2000000000229187692';
    var url = 'http://www.elong.com/redirect/redirect.aspx?f=5012&u=http%3A%2F%2Ftravel.elong.com%2Fiflight%2Fcn%2F%list%2F%from_%to%2F%date%2FAll_1_0_Y_0%3FCampaign_ID%3D2000000000229187692';
    
    var ext_from = $('#ext_frmcity').val();
    var ext_to   = $('#ext_tocity').val();
    
    ext_from = int_city_code_map[ext_from] ? int_city_code_map[ext_from] : '';
    ext_to   = ext_city_code_map[ext_to] ? ext_city_code_map[ext_to] : '';
    
    if (data)
    {
        ext_from = data['from'];
        ext_to   = data['to'];
    }

    if (! ext_from || ! ext_to)
    {
        error_msg('城市码有误,请重新尝试搜索.');

        return false;
    }

    var go_date   = $('#ext_i-date').val();
    var back_date = $('#ext_i-date2').val();
    var type      = $('#external_search_type').val();
    var r_date    = '';

    if (data && data['go_date'] && data['back_date'])
    {
        go_date   = data['go_date'];
        back_date = data['back_date'];
    }

    if (data && data['type'])
    {
        type = data['type'];
    }

    if (2 == type)
    {
        r_date = go_date + '_' + back_date;
        url = url.replace('%list', 'golist');
    } else
    {
        r_date = go_date + '_' + go_date;
        url = url.replace('%list', 'list');
    }

    url = url.replace('%from', ext_from)
    .replace('%to', ext_to)
    .replace('%date', r_date);

    //error_msg(url);
    var log = ext_from + '|' + ext_to + '|' + go_date + '|' + back_date;
    log_google_tracker('Coop-Elong', 'click', log, 1)
    window.open(url); 
    
    return true;
}

function error_msg(msg)
{
    alert(msg);
}

function ext_create_recommend(city)
{
    var html = [];
    city = city || 'BJS';

    var url = '/api.php?action=extRecommend&do=other&city=' + city + '&p=' + (+(new Date()));
    $.get(url, function(data){
        $('#ext_recommend_content').html(data);
        setTimeout(function(){
            bind_recommend_click_price();
            /** add ga tracker*/
            plugin_track_cooperation();
        }, 100);
    });

    return false;
}

function bind_ext_recommend_list()
{
    $('#ex_recommend_list > li').each(function(){
        //alert($(this).attr('city'));
        $(this).unbind('click')
        .bind('click', function(){
            clear_ext_recommend_css();
            
            $(this).attr('class', 'here');
            var city = $(this).attr('city');
            ext_create_recommend(city);
        });
    });
}

function clear_ext_recommend_css()
{
    $('#ex_recommend_list > li').attr('class', '');
}

function bind_recommend_click_price()
{
    $('.ext_recommed_price').click(function(){
        var data = [];
        var type = $(this).attr('type');
        data['type'] = 'single' == type ? 1 : 2;
        //alert('date->type = ' +  data['type']);
        data['from'] = $(this).attr('fcity');
        data['to']   = $(this).attr('tcity');
        
        //show_elong_confirm_pop(data); 
        goto_elong(data);

        return false;
    });
}

function show_elong_confirm_pop(data)
{
    if (data)
    {
        if (1 == data['type'])
        {
            $('#ext_pop_go').attr('class', 'ext_center');
            $('#ext_pop_back').hide(); 
        } else
        {
            $('#ext_pop_go').attr('class', 'left');
            $('#ext_pop_back').show(); 
        }
        
        //$('#ext_popup_confirm').show();
        /* */
        $.blockUI({ 
            message : $('#ext_popup_confirm'),
            css: { 
                border: 'none',
                background: 'transparent',
                height: '140px'
            },
            overlayCSS: {backgroundColor: 'gray'}
        }); 
        /* maybe open soon.*/
    }

    setTimeout(function(){
        ext_popup_confirm_go(data);
    }, 100);
}

function ext_get_current_city()
{
    var city = '';
    
    $('#ex_recommend_list > li').each(function(){
        if ('here' == $(this).attr('class'))
        {
            city = $(this).attr('city');
        }
    });

    return city;
}

function bind_pop_close()
{
    $('#ext_pop_close').click(function(){
        $.unblockUI(); 

        return false;
    });
}

function ext_popup_confirm_go(data)
{
    $('#pop_ext_confirm').unbind('click')
    .bind('click', function(){
        goto_elong(data); 
        $.unblockUI();
        //alert(data['from'] + data['to']);
    });
}

function fix_ie_bug(action)
{
    action = action || 'hide';
    var inter = $('#internal_search_type');
    var exter = $('#external_search_type');

    if ($.browser.msie && 'hide' == action)
    {
        inter.hide();
        exter.hide();

    } else if ($.browser.msie && 'show' == action)
    {
        inter.show();
        exter.show();
    }
    //alert('action = ' + action);
}

function plugin_ie6_bug()
{
    $('#search_from').bind('click', function(){
        fix_ie_bug();
    });
    
    $('#search_to, #ext_search_to, #tanchu').bind('click', function(){
        fix_ie_bug('show');
    });

    $('body').bind('click', function(){
        setTimeout(function(){
            var stat = $('#tanchu').css('display');
            
            if (stat && 'none' == stat)
            {
                fix_ie_bug('show');
            }
            /** if return false, it will prevent all body click events.*/
            //return false;
        }, 50);
    });
}

function patch_internal_search_box()
{
    $('#frmcity, #tocity').bind('change', function(){
        patch_fix_round_box();
    })
    .bind('keyup', function(){
        patch_fix_round_box();
    });

    $('#tanchu').click(function(){
        patch_fix_round_box();
    });
}

function patch_fix_round_box()
{
    var type = $('#internal_search_type').val();
    if (type && 2 == type)
    {
        setTimeout(function(){
            $('#redate').show();
        }, 10);
    }
}

function bind_checkbox_switch()
{
    $('.gj_checkbox').bind('click', function(){
        var checked = $(this).attr('checked');
        var value   = $(this).attr('value');
        var pro = $(this).attr('pro');
        var opt = $(this).attr('opt');
        var def = $(this).attr('def');
        var other = $(this).attr('other');

        if (opt)
        {
            var obj = $('#' + opt);
            var back = $('#' + other);

            if (checked)
            {
                obj.attr('value', value)
                back.attr('disabled', false);
            } else
            {
                obj.attr('value', def || 1);
                back.attr('disabled', true); 
            }

            if ('int' == pro)
            {
                changeAirType(obj.attr('value')); 
            }
        } else
        {
            return false;
        }
        //alert(checked);
    });
}

function patch_dashed_style()
{
    $('label').bind('focus', function(){
        $(this).blur();
    });
}
$(document).ready(function(){
    var favorite = $('#header').find('#favorite');
    favorite.click(function(){
        //alert('Find me.');
        var title = '酷讯旅游搜索引擎-机票,机票,酒店,火车票,旅游度假';
        var url   = 'http://www.kuxun.cn';

        if (document.all)
        {
            window.external.AddFavorite(url, title);
        }
        else if (window.sidebar)
        {
            window.sidebar.addPanel(title, url, "");
        }

        return false;
    });

    plugin_track_cooperation();

    if (! perf_show_flight_flag && perf_start)
    {
        perf_show_flight_flag = 1;
        var perf_end = +(new Date());
        /*
        setTimeout(function(){
            log_google_tracker('search_homepage', 'Time', 'LoadTime', (perf_end - perf_start)); 
            //js_debug("'search_homepage', 'Time', 'LoadTime'" + (perf_end - perf_start));
            //js_debug(pageTracker || 'Sorry, Can\'t get google tracker...');
        }, 1000);
        */
    }
});


function js_debug(msg)
{
    $('#debug').show().append(msg + '<br />');
}

function plugin_track_cooperation()
{
    $('.tracker').unbind('click')
    .bind('click', function(){
        var cat = $(this).attr('cat');
        var act = $(this).attr('act');                                                                                                                
        var opl = $(this).attr('opl');

        if (cat && act && opl)
        {   
            log_google_tracker(cat, act, opl, 1); 
        }   
        //js_debug('click google event tracker.');
    }); 
}
/**
    @note: google analytics pageTracker
    category, action, optional_label, optional_value
*/
function log_google_tracker(category, action, optional_label, optional_value)
{
    if (pageTracker)
    {
        pageTracker._trackEvent(category, action, optional_label, optional_value);
    }
}
