var ROOT='http://lithuania.yoolk.com/';var mainROOT='http://main.yoolk.com/';var directory_id='11008';var googleMapKey='ABQIAAAA8VCT2KZcNaoXEEob-buO-BQa-WthAUHDtS5ynxkAgTzmE4ET9xTRbpT5BG5LeR9MDnd0PPS4SJ6tAg';var PNCODES=0;
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(G(){9(1m E!="W")H w=E;H E=18.15=G(a,b){I 6 7u E?6.5N(a,b):1u E(a,b)};9(1m $!="W")H D=$;18.$=E;H u=/^[^<]*(<(.|\\s)+>)[^>]*$|^#(\\w+)$/;E.1b=E.3A={5N:G(c,a){c=c||U;9(1m c=="1M"){H m=u.2S(c);9(m&&(m[1]||!a)){9(m[1])c=E.4D([m[1]],a);J{H b=U.3S(m[3]);9(b)9(b.22!=m[3])I E().1Y(c);J{6[0]=b;6.K=1;I 6}J c=[]}}J I 1u E(a).1Y(c)}J 9(E.1n(c))I 1u E(U)[E.1b.2d?"2d":"39"](c);I 6.6v(c.1c==1B&&c||(c.4c||c.K&&c!=18&&!c.1y&&c[0]!=W&&c[0].1y)&&E.2h(c)||[c])},4c:"1.2.1",7Y:G(){I 6.K},K:0,21:G(a){I a==W?E.2h(6):6[a]},2o:G(a){H b=E(a);b.4Y=6;I b},6v:G(a){6.K=0;1B.3A.1a.16(6,a);I 6},N:G(a,b){I E.N(6,a,b)},4I:G(a){H b=-1;6.N(G(i){9(6==a)b=i});I b},1x:G(f,d,e){H c=f;9(f.1c==3X)9(d==W)I 6.K&&E[e||"1x"](6[0],f)||W;J{c={};c[f]=d}I 6.N(G(a){L(H b 1i c)E.1x(e?6.R:6,b,E.1e(6,c[b],e,a,b))})},17:G(b,a){I 6.1x(b,a,"3C")},2g:G(e){9(1m e!="5i"&&e!=S)I 6.4n().3g(U.6F(e));H t="";E.N(e||6,G(){E.N(6.3j,G(){9(6.1y!=8)t+=6.1y!=1?6.6x:E.1b.2g([6])})});I t},5m:G(b){9(6[0])E(b,6[0].3H).6u().3d(6[0]).1X(G(){H a=6;1W(a.1w)a=a.1w;I a}).3g(6);I 6},8m:G(a){I 6.N(G(){E(6).6q().5m(a)})},8d:G(a){I 6.N(G(){E(6).5m(a)})},3g:G(){I 6.3z(1q,Q,1,G(a){6.58(a)})},6j:G(){I 6.3z(1q,Q,-1,G(a){6.3d(a,6.1w)})},6g:G(){I 6.3z(1q,P,1,G(a){6.12.3d(a,6)})},50:G(){I 6.3z(1q,P,-1,G(a){6.12.3d(a,6.2q)})},2D:G(){I 6.4Y||E([])},1Y:G(t){H b=E.1X(6,G(a){I E.1Y(t,a)});I 6.2o(/[^+>] [^+>]/.14(t)||t.1g("..")>-1?E.4V(b):b)},6u:G(e){H f=6.1X(G(){I 6.67?E(6.67)[0]:6.4R(Q)});H d=f.1Y("*").4O().N(G(){9(6[F]!=W)6[F]=S});9(e===Q)6.1Y("*").4O().N(G(i){H c=E.M(6,"2P");L(H a 1i c)L(H b 1i c[a])E.1j.1f(d[i],a,c[a][b],c[a][b].M)});I f},1E:G(t){I 6.2o(E.1n(t)&&E.2W(6,G(b,a){I t.16(b,[a])})||E.3m(t,6))},5V:G(t){I 6.2o(t.1c==3X&&E.3m(t,6,Q)||E.2W(6,G(a){I(t.1c==1B||t.4c)?E.2A(a,t)<0:a!=t}))},1f:G(t){I 6.2o(E.1R(6.21(),t.1c==3X?E(t).21():t.K!=W&&(!t.11||E.11(t,"2Y"))?t:[t]))},3t:G(a){I a?E.3m(a,6).K>0:P},7c:G(a){I 6.3t("."+a)},3i:G(b){9(b==W){9(6.K){H c=6[0];9(E.11(c,"24")){H e=c.4Z,a=[],Y=c.Y,2G=c.O=="24-2G";9(e<0)I S;L(H i=2G?e:0,33=2G?e+1:Y.K;i<33;i++){H d=Y[i];9(d.26){H b=E.V.1h&&!d.9V["1Q"].9L?d.2g:d.1Q;9(2G)I b;a.1a(b)}}I a}J I 6[0].1Q.1p(/\\r/g,"")}}J I 6.N(G(){9(b.1c==1B&&/4k|5j/.14(6.O))6.2Q=(E.2A(6.1Q,b)>=0||E.2A(6.2H,b)>=0);J 9(E.11(6,"24")){H a=b.1c==1B?b:[b];E("9h",6).N(G(){6.26=(E.2A(6.1Q,a)>=0||E.2A(6.2g,a)>=0)});9(!a.K)6.4Z=-1}J 6.1Q=b})},4o:G(a){I a==W?(6.K?6[0].3O:S):6.4n().3g(a)},6H:G(a){I 6.50(a).28()},6E:G(i){I 6.2J(i,i+1)},2J:G(){I 6.2o(1B.3A.2J.16(6,1q))},1X:G(b){I 6.2o(E.1X(6,G(a,i){I b.2O(a,i,a)}))},4O:G(){I 6.1f(6.4Y)},3z:G(f,d,g,e){H c=6.K>1,a;I 6.N(G(){9(!a){a=E.4D(f,6.3H);9(g<0)a.8U()}H b=6;9(d&&E.11(6,"1I")&&E.11(a[0],"4m"))b=6.4l("1K")[0]||6.58(U.5B("1K"));E.N(a,G(){H a=c?6.4R(Q):6;9(!5A(0,a))e.2O(b,a)})})}};G 5A(i,b){H a=E.11(b,"1J");9(a){9(b.3k)E.3G({1d:b.3k,3e:P,1V:"1J"});J E.5f(b.2g||b.6s||b.3O||"");9(b.12)b.12.3b(b)}J 9(b.1y==1)E("1J",b).N(5A);I a}E.1k=E.1b.1k=G(){H c=1q[0]||{},a=1,2c=1q.K,5e=P;9(c.1c==8o){5e=c;c=1q[1]||{}}9(2c==1){c=6;a=0}H b;L(;a<2c;a++)9((b=1q[a])!=S)L(H i 1i b){9(c==b[i])6r;9(5e&&1m b[i]==\'5i\'&&c[i])E.1k(c[i],b[i]);J 9(b[i]!=W)c[i]=b[i]}I c};H F="15"+(1u 3D()).3B(),6p=0,5c={};E.1k({8a:G(a){18.$=D;9(a)18.15=w;I E},1n:G(a){I!!a&&1m a!="1M"&&!a.11&&a.1c!=1B&&/G/i.14(a+"")},4a:G(a){I a.2V&&!a.1G||a.37&&a.3H&&!a.3H.1G},5f:G(a){a=E.36(a);9(a){9(18.6l)18.6l(a);J 9(E.V.1N)18.56(a,0);J 3w.2O(18,a)}},11:G(b,a){I b.11&&b.11.27()==a.27()},1L:{},M:G(c,d,b){c=c==18?5c:c;H a=c[F];9(!a)a=c[F]=++6p;9(d&&!E.1L[a])E.1L[a]={};9(b!=W)E.1L[a][d]=b;I d?E.1L[a][d]:a},30:G(c,b){c=c==18?5c:c;H a=c[F];9(b){9(E.1L[a]){2E E.1L[a][b];b="";L(b 1i E.1L[a])1T;9(!b)E.30(c)}}J{2a{2E c[F]}29(e){9(c.53)c.53(F)}2E E.1L[a]}},N:G(a,b,c){9(c){9(a.K==W)L(H i 1i a)b.16(a[i],c);J L(H i=0,48=a.K;i<48;i++)9(b.16(a[i],c)===P)1T}J{9(a.K==W)L(H i 1i a)b.2O(a[i],i,a[i]);J L(H i=0,48=a.K,3i=a[0];i<48&&b.2O(3i,i,3i)!==P;3i=a[++i]){}}I a},1e:G(c,b,d,e,a){9(E.1n(b))b=b.2O(c,[e]);H f=/z-?4I|7T-?7Q|1r|69|7P-?1H/i;I b&&b.1c==4W&&d=="3C"&&!f.14(a)?b+"2T":b},1o:{1f:G(b,c){E.N((c||"").2l(/\\s+/),G(i,a){9(!E.1o.3K(b.1o,a))b.1o+=(b.1o?" ":"")+a})},28:G(b,c){b.1o=c!=W?E.2W(b.1o.2l(/\\s+/),G(a){I!E.1o.3K(c,a)}).66(" "):""},3K:G(t,c){I E.2A(c,(t.1o||t).3s().2l(/\\s+/))>-1}},2k:G(e,o,f){L(H i 1i o){e.R["3r"+i]=e.R[i];e.R[i]=o[i]}f.16(e,[]);L(H i 1i o)e.R[i]=e.R["3r"+i]},17:G(e,p){9(p=="1H"||p=="2N"){H b={},42,41,d=["7J","7I","7G","7F"];E.N(d,G(){b["7C"+6]=0;b["7B"+6+"5Z"]=0});E.2k(e,b,G(){9(E(e).3t(\':3R\')){42=e.7A;41=e.7w}J{e=E(e.4R(Q)).1Y(":4k").5W("2Q").2D().17({4C:"1P",2X:"4F",19:"2Z",7o:"0",1S:"0"}).5R(e.12)[0];H a=E.17(e.12,"2X")||"3V";9(a=="3V")e.12.R.2X="7g";42=e.7e;41=e.7b;9(a=="3V")e.12.R.2X="3V";e.12.3b(e)}});I p=="1H"?42:41}I E.3C(e,p)},3C:G(h,j,i){H g,2w=[],2k=[];G 3n(a){9(!E.V.1N)I P;H b=U.3o.3Z(a,S);I!b||b.4y("3n")==""}9(j=="1r"&&E.V.1h){g=E.1x(h.R,"1r");I g==""?"1":g}9(j.1t(/4u/i))j=y;9(!i&&h.R[j])g=h.R[j];J 9(U.3o&&U.3o.3Z){9(j.1t(/4u/i))j="4u";j=j.1p(/([A-Z])/g,"-$1").2p();H d=U.3o.3Z(h,S);9(d&&!3n(h))g=d.4y(j);J{L(H a=h;a&&3n(a);a=a.12)2w.4w(a);L(a=0;a<2w.K;a++)9(3n(2w[a])){2k[a]=2w[a].R.19;2w[a].R.19="2Z"}g=j=="19"&&2k[2w.K-1]!=S?"2s":U.3o.3Z(h,S).4y(j)||"";L(a=0;a<2k.K;a++)9(2k[a]!=S)2w[a].R.19=2k[a]}9(j=="1r"&&g=="")g="1"}J 9(h.3Q){H f=j.1p(/\\-(\\w)/g,G(m,c){I c.27()});g=h.3Q[j]||h.3Q[f];9(!/^\\d+(2T)?$/i.14(g)&&/^\\d/.14(g)){H k=h.R.1S;H e=h.4v.1S;h.4v.1S=h.3Q.1S;h.R.1S=g||0;g=h.R.71+"2T";h.R.1S=k;h.4v.1S=e}}I g},4D:G(a,e){H r=[];e=e||U;E.N(a,G(i,d){9(!d)I;9(d.1c==4W)d=d.3s();9(1m d=="1M"){d=d.1p(/(<(\\w+)[^>]*?)\\/>/g,G(m,a,b){I b.1t(/^(70|6Z|6Y|9Q|4t|9N|9K|3a|9G|9E)$/i)?m:a+"></"+b+">"});H s=E.36(d).2p(),1s=e.5B("1s"),2x=[];H c=!s.1g("<9y")&&[1,"<24>","</24>"]||!s.1g("<9w")&&[1,"<6T>","</6T>"]||s.1t(/^<(9u|1K|9t|9r|9p)/)&&[1,"<1I>","</1I>"]||!s.1g("<4m")&&[2,"<1I><1K>","</1K></1I>"]||(!s.1g("<9m")||!s.1g("<9k"))&&[3,"<1I><1K><4m>","</4m></1K></1I>"]||!s.1g("<6Y")&&[2,"<1I><1K></1K><6L>","</6L></1I>"]||E.V.1h&&[1,"1s<1s>","</1s>"]||[0,"",""];1s.3O=c[1]+d+c[2];1W(c[0]--)1s=1s.5p;9(E.V.1h){9(!s.1g("<1I")&&s.1g("<1K")<0)2x=1s.1w&&1s.1w.3j;J 9(c[1]=="<1I>"&&s.1g("<1K")<0)2x=1s.3j;L(H n=2x.K-1;n>=0;--n)9(E.11(2x[n],"1K")&&!2x[n].3j.K)2x[n].12.3b(2x[n]);9(/^\\s/.14(d))1s.3d(e.6F(d.1t(/^\\s*/)[0]),1s.1w)}d=E.2h(1s.3j)}9(0===d.K&&(!E.11(d,"2Y")&&!E.11(d,"24")))I;9(d[0]==W||E.11(d,"2Y")||d.Y)r.1a(d);J r=E.1R(r,d)});I r},1x:G(c,d,a){H e=E.4a(c)?{}:E.5o;9(d=="26"&&E.V.1N)c.12.4Z;9(e[d]){9(a!=W)c[e[d]]=a;I c[e[d]]}J 9(E.V.1h&&d=="R")I E.1x(c.R,"9e",a);J 9(a==W&&E.V.1h&&E.11(c,"2Y")&&(d=="9d"||d=="9a"))I c.97(d).6x;J 9(c.37){9(a!=W){9(d=="O"&&E.11(c,"4t")&&c.12)6G"O 94 93\'t 92 91";c.90(d,a)}9(E.V.1h&&/6C|3k/.14(d)&&!E.4a(c))I c.4p(d,2);I c.4p(d)}J{9(d=="1r"&&E.V.1h){9(a!=W){c.69=1;c.1E=(c.1E||"").1p(/6O\\([^)]*\\)/,"")+(3I(a).3s()=="8S"?"":"6O(1r="+a*6A+")")}I c.1E?(3I(c.1E.1t(/1r=([^)]*)/)[1])/6A).3s():""}d=d.1p(/-([a-z])/8Q,G(z,b){I b.27()});9(a!=W)c[d]=a;I c[d]}},36:G(t){I(t||"").1p(/^\\s+|\\s+$/g,"")},2h:G(a){H r=[];9(1m a!="8P")L(H i=0,2c=a.K;i<2c;i++)r.1a(a[i]);J r=a.2J(0);I r},2A:G(b,a){L(H i=0,2c=a.K;i<2c;i++)9(a[i]==b)I i;I-1},1R:G(a,b){9(E.V.1h){L(H i=0;b[i];i++)9(b[i].1y!=8)a.1a(b[i])}J L(H i=0;b[i];i++)a.1a(b[i]);I a},4V:G(b){H r=[],2f={};2a{L(H i=0,6y=b.K;i<6y;i++){H a=E.M(b[i]);9(!2f[a]){2f[a]=Q;r.1a(b[i])}}}29(e){r=b}I r},2W:G(b,a,c){9(1m a=="1M")a=3w("P||G(a,i){I "+a+"}");H d=[];L(H i=0,4g=b.K;i<4g;i++)9(!c&&a(b[i],i)||c&&!a(b[i],i))d.1a(b[i]);I d},1X:G(c,b){9(1m b=="1M")b=3w("P||G(a){I "+b+"}");H d=[];L(H i=0,4g=c.K;i<4g;i++){H a=b(c[i],i);9(a!==S&&a!=W){9(a.1c!=1B)a=[a];d=d.8M(a)}}I d}});H v=8K.8I.2p();E.V={4s:(v.1t(/.+(?:8F|8E|8C|8B)[\\/: ]([\\d.]+)/)||[])[1],1N:/6w/.14(v),34:/34/.14(v),1h:/1h/.14(v)&&!/34/.14(v),35:/35/.14(v)&&!/(8z|6w)/.14(v)};H y=E.V.1h?"4h":"5h";E.1k({5g:!E.V.1h||U.8y=="8x",4h:E.V.1h?"4h":"5h",5o:{"L":"8w","8v":"1o","4u":y,5h:y,4h:y,3O:"3O",1o:"1o",1Q:"1Q",3c:"3c",2Q:"2Q",8u:"8t",26:"26",8s:"8r"}});E.N({1D:"a.12",8q:"15.4e(a,\'12\')",8p:"15.2I(a,2,\'2q\')",8n:"15.2I(a,2,\'4d\')",8l:"15.4e(a,\'2q\')",8k:"15.4e(a,\'4d\')",8j:"15.5d(a.12.1w,a)",8i:"15.5d(a.1w)",6q:"15.11(a,\'8h\')?a.8f||a.8e.U:15.2h(a.3j)"},G(i,n){E.1b[i]=G(a){H b=E.1X(6,n);9(a&&1m a=="1M")b=E.3m(a,b);I 6.2o(E.4V(b))}});E.N({5R:"3g",8c:"6j",3d:"6g",8b:"50",89:"6H"},G(i,n){E.1b[i]=G(){H a=1q;I 6.N(G(){L(H j=0,2c=a.K;j<2c;j++)E(a[j])[n](6)})}});E.N({5W:G(a){E.1x(6,a,"");6.53(a)},88:G(c){E.1o.1f(6,c)},87:G(c){E.1o.28(6,c)},86:G(c){E.1o[E.1o.3K(6,c)?"28":"1f"](6,c)},28:G(a){9(!a||E.1E(a,[6]).r.K){E.30(6);6.12.3b(6)}},4n:G(){E("*",6).N(G(){E.30(6)});1W(6.1w)6.3b(6.1w)}},G(i,n){E.1b[i]=G(){I 6.N(n,1q)}});E.N(["85","5Z"],G(i,a){H n=a.2p();E.1b[n]=G(h){I 6[0]==18?E.V.1N&&3y["84"+a]||E.5g&&38.33(U.2V["5a"+a],U.1G["5a"+a])||U.1G["5a"+a]:6[0]==U?38.33(U.1G["6n"+a],U.1G["6m"+a]):h==W?(6.K?E.17(6[0],n):S):6.17(n,h.1c==3X?h:h+"2T")}});H C=E.V.1N&&3x(E.V.4s)<83?"(?:[\\\\w*57-]|\\\\\\\\.)":"(?:[\\\\w\\82-\\81*57-]|\\\\\\\\.)",6k=1u 47("^>\\\\s*("+C+"+)"),6i=1u 47("^("+C+"+)(#)("+C+"+)"),6h=1u 47("^([#.]?)("+C+"*)");E.1k({55:{"":"m[2]==\'*\'||15.11(a,m[2])","#":"a.4p(\'22\')==m[2]",":":{80:"i<m[3]-0",7Z:"i>m[3]-0",2I:"m[3]-0==i",6E:"m[3]-0==i",3v:"i==0",3u:"i==r.K-1",6f:"i%2==0",6e:"i%2","3v-46":"a.12.4l(\'*\')[0]==a","3u-46":"15.2I(a.12.5p,1,\'4d\')==a","7X-46":"!15.2I(a.12.5p,2,\'4d\')",1D:"a.1w",4n:"!a.1w",7W:"(a.6s||a.7V||15(a).2g()||\'\').1g(m[3])>=0",3R:\'"1P"!=a.O&&15.17(a,"19")!="2s"&&15.17(a,"4C")!="1P"\',1P:\'"1P"==a.O||15.17(a,"19")=="2s"||15.17(a,"4C")=="1P"\',7U:"!a.3c",3c:"a.3c",2Q:"a.2Q",26:"a.26||15.1x(a,\'26\')",2g:"\'2g\'==a.O",4k:"\'4k\'==a.O",5j:"\'5j\'==a.O",54:"\'54\'==a.O",52:"\'52\'==a.O",51:"\'51\'==a.O",6d:"\'6d\'==a.O",6c:"\'6c\'==a.O",2r:\'"2r"==a.O||15.11(a,"2r")\',4t:"/4t|24|6b|2r/i.14(a.11)",3K:"15.1Y(m[3],a).K",7S:"/h\\\\d/i.14(a.11)",7R:"15.2W(15.32,G(1b){I a==1b.T;}).K"}},6a:[/^(\\[) *@?([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,1u 47("^([:.#]*)("+C+"+)")],3m:G(a,c,b){H d,2b=[];1W(a&&a!=d){d=a;H f=E.1E(a,c,b);a=f.t.1p(/^\\s*,\\s*/,"");2b=b?c=f.r:E.1R(2b,f.r)}I 2b},1Y:G(t,o){9(1m t!="1M")I[t];9(o&&!o.1y)o=S;o=o||U;H d=[o],2f=[],3u;1W(t&&3u!=t){H r=[];3u=t;t=E.36(t);H l=P;H g=6k;H m=g.2S(t);9(m){H p=m[1].27();L(H i=0;d[i];i++)L(H c=d[i].1w;c;c=c.2q)9(c.1y==1&&(p=="*"||c.11.27()==p.27()))r.1a(c);d=r;t=t.1p(g,"");9(t.1g(" ")==0)6r;l=Q}J{g=/^([>+~])\\s*(\\w*)/i;9((m=g.2S(t))!=S){r=[];H p=m[2],1R={};m=m[1];L(H j=0,31=d.K;j<31;j++){H n=m=="~"||m=="+"?d[j].2q:d[j].1w;L(;n;n=n.2q)9(n.1y==1){H h=E.M(n);9(m=="~"&&1R[h])1T;9(!p||n.11.27()==p.27()){9(m=="~")1R[h]=Q;r.1a(n)}9(m=="+")1T}}d=r;t=E.36(t.1p(g,""));l=Q}}9(t&&!l){9(!t.1g(",")){9(o==d[0])d.44();2f=E.1R(2f,d);r=d=[o];t=" "+t.68(1,t.K)}J{H k=6i;H m=k.2S(t);9(m){m=[0,m[2],m[3],m[1]]}J{k=6h;m=k.2S(t)}m[2]=m[2].1p(/\\\\/g,"");H f=d[d.K-1];9(m[1]=="#"&&f&&f.3S&&!E.4a(f)){H q=f.3S(m[2]);9((E.V.1h||E.V.34)&&q&&1m q.22=="1M"&&q.22!=m[2])q=E(\'[@22="\'+m[2]+\'"]\',f)[0];d=r=q&&(!m[3]||E.11(q,m[3]))?[q]:[]}J{L(H i=0;d[i];i++){H a=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];9(a=="*"&&d[i].11.2p()=="5i")a="3a";r=E.1R(r,d[i].4l(a))}9(m[1]==".")r=E.4X(r,m[2]);9(m[1]=="#"){H e=[];L(H i=0;r[i];i++)9(r[i].4p("22")==m[2]){e=[r[i]];1T}r=e}d=r}t=t.1p(k,"")}}9(t){H b=E.1E(t,r);d=r=b.r;t=E.36(b.t)}}9(t)d=[];9(d&&o==d[0])d.44();2f=E.1R(2f,d);I 2f},4X:G(r,m,a){m=" "+m+" ";H c=[];L(H i=0;r[i];i++){H b=(" "+r[i].1o+" ").1g(m)>=0;9(!a&&b||a&&!b)c.1a(r[i])}I c},1E:G(t,r,h){H d;1W(t&&t!=d){d=t;H p=E.6a,m;L(H i=0;p[i];i++){m=p[i].2S(t);9(m){t=t.7O(m[0].K);m[2]=m[2].1p(/\\\\/g,"");1T}}9(!m)1T;9(m[1]==":"&&m[2]=="5V")r=E.1E(m[3],r,Q).r;J 9(m[1]==".")r=E.4X(r,m[2],h);J 9(m[1]=="["){H g=[],O=m[3];L(H i=0,31=r.K;i<31;i++){H a=r[i],z=a[E.5o[m[2]]||m[2]];9(z==S||/6C|3k|26/.14(m[2]))z=E.1x(a,m[2])||\'\';9((O==""&&!!z||O=="="&&z==m[5]||O=="!="&&z!=m[5]||O=="^="&&z&&!z.1g(m[5])||O=="$="&&z.68(z.K-m[5].K)==m[5]||(O=="*="||O=="~=")&&z.1g(m[5])>=0)^h)g.1a(a)}r=g}J 9(m[1]==":"&&m[2]=="2I-46"){H e={},g=[],14=/(\\d*)n\\+?(\\d*)/.2S(m[3]=="6f"&&"2n"||m[3]=="6e"&&"2n+1"||!/\\D/.14(m[3])&&"n+"+m[3]||m[3]),3v=(14[1]||1)-0,d=14[2]-0;L(H i=0,31=r.K;i<31;i++){H j=r[i],12=j.12,22=E.M(12);9(!e[22]){H c=1;L(H n=12.1w;n;n=n.2q)9(n.1y==1)n.4U=c++;e[22]=Q}H b=P;9(3v==1){9(d==0||j.4U==d)b=Q}J 9((j.4U+d)%3v==0)b=Q;9(b^h)g.1a(j)}r=g}J{H f=E.55[m[1]];9(1m f!="1M")f=E.55[m[1]][m[2]];f=3w("P||G(a,i){I "+f+"}");r=E.2W(r,f,h)}}I{r:r,t:t}},4e:G(b,c){H d=[];H a=b[c];1W(a&&a!=U){9(a.1y==1)d.1a(a);a=a[c]}I d},2I:G(a,e,c,b){e=e||1;H d=0;L(;a;a=a[c])9(a.1y==1&&++d==e)1T;I a},5d:G(n,a){H r=[];L(;n;n=n.2q){9(n.1y==1&&(!a||n!=a))r.1a(n)}I r}});E.1j={1f:G(g,e,c,h){9(E.V.1h&&g.4j!=W)g=18;9(!c.2u)c.2u=6.2u++;9(h!=W){H d=c;c=G(){I d.16(6,1q)};c.M=h;c.2u=d.2u}H i=e.2l(".");e=i[0];c.O=i[1];H b=E.M(g,"2P")||E.M(g,"2P",{});H f=E.M(g,"2t",G(){H a;9(1m E=="W"||E.1j.4T)I a;a=E.1j.2t.16(g,1q);I a});H j=b[e];9(!j){j=b[e]={};9(g.4S)g.4S(e,f,P);J g.7N("43"+e,f)}j[c.2u]=c;6.1Z[e]=Q},2u:1,1Z:{},28:G(d,c,b){H e=E.M(d,"2P"),2L,4I;9(1m c=="1M"){H a=c.2l(".");c=a[0]}9(e){9(c&&c.O){b=c.4Q;c=c.O}9(!c){L(c 1i e)6.28(d,c)}J 9(e[c]){9(b)2E e[c][b.2u];J L(b 1i e[c])9(!a[1]||e[c][b].O==a[1])2E e[c][b];L(2L 1i e[c])1T;9(!2L){9(d.4P)d.4P(c,E.M(d,"2t"),P);J d.7M("43"+c,E.M(d,"2t"));2L=S;2E e[c]}}L(2L 1i e)1T;9(!2L){E.30(d,"2P");E.30(d,"2t")}}},1F:G(d,b,e,c,f){b=E.2h(b||[]);9(!e){9(6.1Z[d])E("*").1f([18,U]).1F(d,b)}J{H a,2L,1b=E.1n(e[d]||S),4N=!b[0]||!b[0].2M;9(4N)b.4w(6.4M({O:d,2m:e}));b[0].O=d;9(E.1n(E.M(e,"2t")))a=E.M(e,"2t").16(e,b);9(!1b&&e["43"+d]&&e["43"+d].16(e,b)===P)a=P;9(4N)b.44();9(f&&f.16(e,b)===P)a=P;9(1b&&c!==P&&a!==P&&!(E.11(e,\'a\')&&d=="4L")){6.4T=Q;e[d]()}6.4T=P}I a},2t:G(d){H a;d=E.1j.4M(d||18.1j||{});H b=d.O.2l(".");d.O=b[0];H c=E.M(6,"2P")&&E.M(6,"2P")[d.O],3q=1B.3A.2J.2O(1q,1);3q.4w(d);L(H j 1i c){3q[0].4Q=c[j];3q[0].M=c[j].M;9(!b[1]||c[j].O==b[1]){H e=c[j].16(6,3q);9(a!==P)a=e;9(e===P){d.2M();d.3p()}}}9(E.V.1h)d.2m=d.2M=d.3p=d.4Q=d.M=S;I a},4M:G(c){H a=c;c=E.1k({},a);c.2M=G(){9(a.2M)a.2M();a.7L=P};c.3p=G(){9(a.3p)a.3p();a.7K=Q};9(!c.2m&&c.65)c.2m=c.65;9(E.V.1N&&c.2m.1y==3)c.2m=a.2m.12;9(!c.4K&&c.4J)c.4K=c.4J==c.2m?c.7H:c.4J;9(c.64==S&&c.63!=S){H e=U.2V,b=U.1G;c.64=c.63+(e&&e.2R||b.2R||0);c.7E=c.7D+(e&&e.2B||b.2B||0)}9(!c.3Y&&(c.61||c.60))c.3Y=c.61||c.60;9(!c.5F&&c.5D)c.5F=c.5D;9(!c.3Y&&c.2r)c.3Y=(c.2r&1?1:(c.2r&2?3:(c.2r&4?2:0)));I c}};E.1b.1k({3W:G(c,a,b){I c=="5Y"?6.2G(c,a,b):6.N(G(){E.1j.1f(6,c,b||a,b&&a)})},2G:G(d,b,c){I 6.N(G(){E.1j.1f(6,d,G(a){E(6).5X(a);I(c||b).16(6,1q)},c&&b)})},5X:G(a,b){I 6.N(G(){E.1j.28(6,a,b)})},1F:G(c,a,b){I 6.N(G(){E.1j.1F(c,a,6,Q,b)})},7x:G(c,a,b){9(6[0])I E.1j.1F(c,a,6[0],P,b)},25:G(){H a=1q;I 6.4L(G(e){6.4H=0==6.4H?1:0;e.2M();I a[6.4H].16(6,[e])||P})},7v:G(f,g){G 4G(e){H p=e.4K;1W(p&&p!=6)2a{p=p.12}29(e){p=6};9(p==6)I P;I(e.O=="4x"?f:g).16(6,[e])}I 6.4x(4G).5U(4G)},2d:G(f){5T();9(E.3T)f.16(U,[E]);J E.3l.1a(G(){I f.16(6,[E])});I 6}});E.1k({3T:P,3l:[],2d:G(){9(!E.3T){E.3T=Q;9(E.3l){E.N(E.3l,G(){6.16(U)});E.3l=S}9(E.V.35||E.V.34)U.4P("5S",E.2d,P);9(!18.7t.K)E(18).39(G(){E("#4E").28()})}}});E.N(("7s,7r,39,7q,6n,5Y,4L,7p,"+"7n,7m,7l,4x,5U,7k,24,"+"51,7j,7i,7h,3U").2l(","),G(i,o){E.1b[o]=G(f){I f?6.3W(o,f):6.1F(o)}});H x=P;G 5T(){9(x)I;x=Q;9(E.V.35||E.V.34)U.4S("5S",E.2d,P);J 9(E.V.1h){U.7f("<7d"+"7y 22=4E 7z=Q "+"3k=//:><\\/1J>");H a=U.3S("4E");9(a)a.62=G(){9(6.2C!="1l")I;E.2d()};a=S}J 9(E.V.1N)E.4B=4j(G(){9(U.2C=="5Q"||U.2C=="1l"){4A(E.4B);E.4B=S;E.2d()}},10);E.1j.1f(18,"39",E.2d)}E.1b.1k({39:G(g,d,c){9(E.1n(g))I 6.3W("39",g);H e=g.1g(" ");9(e>=0){H i=g.2J(e,g.K);g=g.2J(0,e)}c=c||G(){};H f="4z";9(d)9(E.1n(d)){c=d;d=S}J{d=E.3a(d);f="5P"}H h=6;E.3G({1d:g,O:f,M:d,1l:G(a,b){9(b=="1C"||b=="5O")h.4o(i?E("<1s/>").3g(a.40.1p(/<1J(.|\\s)*?\\/1J>/g,"")).1Y(i):a.40);56(G(){h.N(c,[a.40,b,a])},13)}});I 6},7a:G(){I E.3a(6.5M())},5M:G(){I 6.1X(G(){I E.11(6,"2Y")?E.2h(6.79):6}).1E(G(){I 6.2H&&!6.3c&&(6.2Q||/24|6b/i.14(6.11)||/2g|1P|52/i.14(6.O))}).1X(G(i,c){H b=E(6).3i();I b==S?S:b.1c==1B?E.1X(b,G(a,i){I{2H:c.2H,1Q:a}}):{2H:c.2H,1Q:b}}).21()}});E.N("5L,5K,6t,5J,5I,5H".2l(","),G(i,o){E.1b[o]=G(f){I 6.3W(o,f)}});H B=(1u 3D).3B();E.1k({21:G(d,b,a,c){9(E.1n(b)){a=b;b=S}I E.3G({O:"4z",1d:d,M:b,1C:a,1V:c})},78:G(b,a){I E.21(b,S,a,"1J")},77:G(c,b,a){I E.21(c,b,a,"45")},76:G(d,b,a,c){9(E.1n(b)){a=b;b={}}I E.3G({O:"5P",1d:d,M:b,1C:a,1V:c})},75:G(a){E.1k(E.59,a)},59:{1Z:Q,O:"4z",2z:0,5G:"74/x-73-2Y-72",6o:Q,3e:Q,M:S},49:{},3G:G(s){H f,2y=/=(\\?|%3F)/g,1v,M;s=E.1k(Q,s,E.1k(Q,{},E.59,s));9(s.M&&s.6o&&1m s.M!="1M")s.M=E.3a(s.M);9(s.1V=="4b"){9(s.O.2p()=="21"){9(!s.1d.1t(2y))s.1d+=(s.1d.1t(/\\?/)?"&":"?")+(s.4b||"5E")+"=?"}J 9(!s.M||!s.M.1t(2y))s.M=(s.M?s.M+"&":"")+(s.4b||"5E")+"=?";s.1V="45"}9(s.1V=="45"&&(s.M&&s.M.1t(2y)||s.1d.1t(2y))){f="4b"+B++;9(s.M)s.M=s.M.1p(2y,"="+f);s.1d=s.1d.1p(2y,"="+f);s.1V="1J";18[f]=G(a){M=a;1C();1l();18[f]=W;2a{2E 18[f]}29(e){}}}9(s.1V=="1J"&&s.1L==S)s.1L=P;9(s.1L===P&&s.O.2p()=="21")s.1d+=(s.1d.1t(/\\?/)?"&":"?")+"57="+(1u 3D()).3B();9(s.M&&s.O.2p()=="21"){s.1d+=(s.1d.1t(/\\?/)?"&":"?")+s.M;s.M=S}9(s.1Z&&!E.5b++)E.1j.1F("5L");9(!s.1d.1g("8g")&&s.1V=="1J"){H h=U.4l("9U")[0];H g=U.5B("1J");g.3k=s.1d;9(!f&&(s.1C||s.1l)){H j=P;g.9R=g.62=G(){9(!j&&(!6.2C||6.2C=="5Q"||6.2C=="1l")){j=Q;1C();1l();h.3b(g)}}}h.58(g);I}H k=P;H i=18.6X?1u 6X("9P.9O"):1u 6W();i.9M(s.O,s.1d,s.3e);9(s.M)i.5C("9J-9I",s.5G);9(s.5y)i.5C("9H-5x-9F",E.49[s.1d]||"9D, 9C 9B 9A 5v:5v:5v 9z");i.5C("X-9x-9v","6W");9(s.6U)s.6U(i);9(s.1Z)E.1j.1F("5H",[i,s]);H c=G(a){9(!k&&i&&(i.2C==4||a=="2z")){k=Q;9(d){4A(d);d=S}1v=a=="2z"&&"2z"||!E.6S(i)&&"3U"||s.5y&&E.6R(i,s.1d)&&"5O"||"1C";9(1v=="1C"){2a{M=E.6Q(i,s.1V)}29(e){1v="5k"}}9(1v=="1C"){H b;2a{b=i.5s("6P-5x")}29(e){}9(s.5y&&b)E.49[s.1d]=b;9(!f)1C()}J E.5r(s,i,1v);1l();9(s.3e)i=S}};9(s.3e){H d=4j(c,13);9(s.2z>0)56(G(){9(i){i.9q();9(!k)c("2z")}},s.2z)}2a{i.9o(s.M)}29(e){E.5r(s,i,S,e)}9(!s.3e)c();I i;G 1C(){9(s.1C)s.1C(M,1v);9(s.1Z)E.1j.1F("5I",[i,s])}G 1l(){9(s.1l)s.1l(i,1v);9(s.1Z)E.1j.1F("6t",[i,s]);9(s.1Z&&!--E.5b)E.1j.1F("5K")}},5r:G(s,a,b,e){9(s.3U)s.3U(a,b,e);9(s.1Z)E.1j.1F("5J",[a,s,e])},5b:0,6S:G(r){2a{I!r.1v&&9n.9l=="54:"||(r.1v>=6N&&r.1v<9j)||r.1v==6M||E.V.1N&&r.1v==W}29(e){}I P},6R:G(a,c){2a{H b=a.5s("6P-5x");I a.1v==6M||b==E.49[c]||E.V.1N&&a.1v==W}29(e){}I P},6Q:G(r,b){H c=r.5s("9i-O");H d=b=="6K"||!b&&c&&c.1g("6K")>=0;H a=d?r.9g:r.40;9(d&&a.2V.37=="5k")6G"5k";9(b=="1J")E.5f(a);9(b=="45")a=3w("("+a+")");I a},3a:G(a){H s=[];9(a.1c==1B||a.4c)E.N(a,G(){s.1a(3f(6.2H)+"="+3f(6.1Q))});J L(H j 1i a)9(a[j]&&a[j].1c==1B)E.N(a[j],G(){s.1a(3f(j)+"="+3f(6))});J s.1a(3f(j)+"="+3f(a[j]));I s.66("&").1p(/%20/g,"+")}});E.1b.1k({1A:G(b,a){I b?6.1U({1H:"1A",2N:"1A",1r:"1A"},b,a):6.1E(":1P").N(G(){6.R.19=6.3h?6.3h:"";9(E.17(6,"19")=="2s")6.R.19="2Z"}).2D()},1z:G(b,a){I b?6.1U({1H:"1z",2N:"1z",1r:"1z"},b,a):6.1E(":3R").N(G(){6.3h=6.3h||E.17(6,"19");9(6.3h=="2s")6.3h="2Z";6.R.19="2s"}).2D()},6J:E.1b.25,25:G(a,b){I E.1n(a)&&E.1n(b)?6.6J(a,b):a?6.1U({1H:"25",2N:"25",1r:"25"},a,b):6.N(G(){E(6)[E(6).3t(":1P")?"1A":"1z"]()})},9c:G(b,a){I 6.1U({1H:"1A"},b,a)},9b:G(b,a){I 6.1U({1H:"1z"},b,a)},99:G(b,a){I 6.1U({1H:"25"},b,a)},98:G(b,a){I 6.1U({1r:"1A"},b,a)},96:G(b,a){I 6.1U({1r:"1z"},b,a)},95:G(c,a,b){I 6.1U({1r:a},c,b)},1U:G(k,i,h,g){H j=E.6D(i,h,g);I 6[j.3L===P?"N":"3L"](G(){j=E.1k({},j);H f=E(6).3t(":1P"),3y=6;L(H p 1i k){9(k[p]=="1z"&&f||k[p]=="1A"&&!f)I E.1n(j.1l)&&j.1l.16(6);9(p=="1H"||p=="2N"){j.19=E.17(6,"19");j.2U=6.R.2U}}9(j.2U!=S)6.R.2U="1P";j.3M=E.1k({},k);E.N(k,G(c,a){H e=1u E.2j(3y,j,c);9(/25|1A|1z/.14(a))e[a=="25"?f?"1A":"1z":a](k);J{H b=a.3s().1t(/^([+-]=)?([\\d+-.]+)(.*)$/),1O=e.2b(Q)||0;9(b){H d=3I(b[2]),2i=b[3]||"2T";9(2i!="2T"){3y.R[c]=(d||1)+2i;1O=((d||1)/e.2b(Q))*1O;3y.R[c]=1O+2i}9(b[1])d=((b[1]=="-="?-1:1)*d)+1O;e.3N(1O,d,2i)}J e.3N(1O,a,"")}});I Q})},3L:G(a,b){9(E.1n(a)){b=a;a="2j"}9(!a||(1m a=="1M"&&!b))I A(6[0],a);I 6.N(G(){9(b.1c==1B)A(6,a,b);J{A(6,a).1a(b);9(A(6,a).K==1)b.16(6)}})},9f:G(){H a=E.32;I 6.N(G(){L(H i=0;i<a.K;i++)9(a[i].T==6)a.6I(i--,1)}).5n()}});H A=G(b,c,a){9(!b)I;H q=E.M(b,c+"3L");9(!q||a)q=E.M(b,c+"3L",a?E.2h(a):[]);I q};E.1b.5n=G(a){a=a||"2j";I 6.N(G(){H q=A(6,a);q.44();9(q.K)q[0].16(6)})};E.1k({6D:G(b,a,c){H d=b&&b.1c==8Z?b:{1l:c||!c&&a||E.1n(b)&&b,2e:b,3J:c&&a||a&&a.1c!=8Y&&a};d.2e=(d.2e&&d.2e.1c==4W?d.2e:{8X:8W,8V:6N}[d.2e])||8T;d.3r=d.1l;d.1l=G(){E(6).5n();9(E.1n(d.3r))d.3r.16(6)};I d},3J:{6B:G(p,n,b,a){I b+a*p},5q:G(p,n,b,a){I((-38.9s(p*38.8R)/2)+0.5)*a+b}},32:[],2j:G(b,c,a){6.Y=c;6.T=b;6.1e=a;9(!c.3P)c.3P={}}});E.2j.3A={4r:G(){9(6.Y.2F)6.Y.2F.16(6.T,[6.2v,6]);(E.2j.2F[6.1e]||E.2j.2F.6z)(6);9(6.1e=="1H"||6.1e=="2N")6.T.R.19="2Z"},2b:G(a){9(6.T[6.1e]!=S&&6.T.R[6.1e]==S)I 6.T[6.1e];H r=3I(E.3C(6.T,6.1e,a));I r&&r>-8O?r:3I(E.17(6.T,6.1e))||0},3N:G(c,b,e){6.5u=(1u 3D()).3B();6.1O=c;6.2D=b;6.2i=e||6.2i||"2T";6.2v=6.1O;6.4q=6.4i=0;6.4r();H f=6;G t(){I f.2F()}t.T=6.T;E.32.1a(t);9(E.32.K==1){H d=4j(G(){H a=E.32;L(H i=0;i<a.K;i++)9(!a[i]())a.6I(i--,1);9(!a.K)4A(d)},13)}},1A:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1A=Q;6.3N(0,6.2b());9(6.1e=="2N"||6.1e=="1H")6.T.R[6.1e]="8N";E(6.T).1A()},1z:G(){6.Y.3P[6.1e]=E.1x(6.T.R,6.1e);6.Y.1z=Q;6.3N(6.2b(),0)},2F:G(){H t=(1u 3D()).3B();9(t>6.Y.2e+6.5u){6.2v=6.2D;6.4q=6.4i=1;6.4r();6.Y.3M[6.1e]=Q;H a=Q;L(H i 1i 6.Y.3M)9(6.Y.3M[i]!==Q)a=P;9(a){9(6.Y.19!=S){6.T.R.2U=6.Y.2U;6.T.R.19=6.Y.19;9(E.17(6.T,"19")=="2s")6.T.R.19="2Z"}9(6.Y.1z)6.T.R.19="2s";9(6.Y.1z||6.Y.1A)L(H p 1i 6.Y.3M)E.1x(6.T.R,p,6.Y.3P[p])}9(a&&E.1n(6.Y.1l))6.Y.1l.16(6.T);I P}J{H n=t-6.5u;6.4i=n/6.Y.2e;6.4q=E.3J[6.Y.3J||(E.3J.5q?"5q":"6B")](6.4i,n,0,1,6.Y.2e);6.2v=6.1O+((6.2D-6.1O)*6.4q);6.4r()}I Q}};E.2j.2F={2R:G(a){a.T.2R=a.2v},2B:G(a){a.T.2B=a.2v},1r:G(a){E.1x(a.T.R,"1r",a.2v)},6z:G(a){a.T.R[a.1e]=a.2v+a.2i}};E.1b.6m=G(){H c=0,3E=0,T=6[0],5t;9(T)8L(E.V){H b=E.17(T,"2X")=="4F",1D=T.12,23=T.23,2K=T.3H,4f=1N&&3x(4s)<8J;9(T.6V){5w=T.6V();1f(5w.1S+38.33(2K.2V.2R,2K.1G.2R),5w.3E+38.33(2K.2V.2B,2K.1G.2B));9(1h){H d=E("4o").17("8H");d=(d=="8G"||E.5g&&3x(4s)>=7)&&2||d;1f(-d,-d)}}J{1f(T.5l,T.5z);1W(23){1f(23.5l,23.5z);9(35&&/^t[d|h]$/i.14(1D.37)||!4f)d(23);9(4f&&!b&&E.17(23,"2X")=="4F")b=Q;23=23.23}1W(1D.37&&!/^1G|4o$/i.14(1D.37)){9(!/^8D|1I-9S.*$/i.14(E.17(1D,"19")))1f(-1D.2R,-1D.2B);9(35&&E.17(1D,"2U")!="3R")d(1D);1D=1D.12}9(4f&&b)1f(-2K.1G.5l,-2K.1G.5z)}5t={3E:3E,1S:c}}I 5t;G d(a){1f(E.17(a,"9T"),E.17(a,"8A"))}G 1f(l,t){c+=3x(l)||0;3E+=3x(t)||0}}})();',62,616,'||||||this|||if|||||||||||||||||||||||||||||||||function|var|return|else|length|for|data|each|type|false|true|style|null|elem|document|browser|undefined||options|||nodeName|parentNode||test|jQuery|apply|css|window|display|push|fn|constructor|url|prop|add|indexOf|msie|in|event|extend|complete|typeof|isFunction|className|replace|arguments|opacity|div|match|new|status|firstChild|attr|nodeType|hide|show|Array|success|parent|filter|trigger|body|height|table|script|tbody|cache|string|safari|start|hidden|value|merge|left|break|animate|dataType|while|map|find|global||get|id|offsetParent|select|toggle|selected|toUpperCase|remove|catch|try|cur|al|ready|duration|done|text|makeArray|unit|fx|swap|split|target||pushStack|toLowerCase|nextSibling|button|none|handle|guid|now|stack|tb|jsre|timeout|inArray|scrollTop|readyState|end|delete|step|one|name|nth|slice|doc|ret|preventDefault|width|call|events|checked|scrollLeft|exec|px|overflow|documentElement|grep|position|form|block|removeData|rl|timers|max|opera|mozilla|trim|tagName|Math|load|param|removeChild|disabled|insertBefore|async|encodeURIComponent|append|oldblock|val|childNodes|src|readyList|multiFilter|color|defaultView|stopPropagation|args|old|toString|is|last|first|eval|parseInt|self|domManip|prototype|getTime|curCSS|Date|top||ajax|ownerDocument|parseFloat|easing|has|queue|curAnim|custom|innerHTML|orig|currentStyle|visible|getElementById|isReady|error|static|bind|String|which|getComputedStyle|responseText|oWidth|oHeight|on|shift|json|child|RegExp|ol|lastModified|isXMLDoc|jsonp|jquery|previousSibling|dir|safari2|el|styleFloat|state|setInterval|radio|getElementsByTagName|tr|empty|html|getAttribute|pos|update|version|input|float|runtimeStyle|unshift|mouseover|getPropertyValue|GET|clearInterval|safariTimer|visibility|clean|__ie_init|absolute|handleHover|lastToggle|index|fromElement|relatedTarget|click|fix|evt|andSelf|removeEventListener|handler|cloneNode|addEventListener|triggered|nodeIndex|unique|Number|classFilter|prevObject|selectedIndex|after|submit|password|removeAttribute|file|expr|setTimeout|_|appendChild|ajaxSettings|client|active|win|sibling|deep|globalEval|boxModel|cssFloat|object|checkbox|parsererror|offsetLeft|wrapAll|dequeue|props|lastChild|swing|handleError|getResponseHeader|results|startTime|00|box|Modified|ifModified|offsetTop|evalScript|createElement|setRequestHeader|ctrlKey|callback|metaKey|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxStop|ajaxStart|serializeArray|init|notmodified|POST|loaded|appendTo|DOMContentLoaded|bindReady|mouseout|not|removeAttr|unbind|unload|Width|keyCode|charCode|onreadystatechange|clientX|pageX|srcElement|join|outerHTML|substr|zoom|parse|textarea|reset|image|odd|even|before|quickClass|quickID|prepend|quickChild|execScript|offset|scroll|processData|uuid|contents|continue|textContent|ajaxComplete|clone|setArray|webkit|nodeValue|fl|_default|100|linear|href|speed|eq|createTextNode|throw|replaceWith|splice|_toggle|xml|colgroup|304|200|alpha|Last|httpData|httpNotModified|httpSuccess|fieldset|beforeSend|getBoundingClientRect|XMLHttpRequest|ActiveXObject|col|br|abbr|pixelLeft|urlencoded|www|application|ajaxSetup|post|getJSON|getScript|elements|serialize|clientWidth|hasClass|scr|clientHeight|write|relative|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|right|dblclick|resize|focus|blur|frames|instanceof|hover|offsetWidth|triggerHandler|ipt|defer|offsetHeight|border|padding|clientY|pageY|Left|Right|toElement|Bottom|Top|cancelBubble|returnValue|detachEvent|attachEvent|substring|line|weight|animated|header|font|enabled|innerText|contains|only|size|gt|lt|uFFFF|u0128|417|inner|Height|toggleClass|removeClass|addClass|replaceAll|noConflict|insertAfter|prependTo|wrap|contentWindow|contentDocument|http|iframe|children|siblings|prevAll|nextAll|wrapInner|prev|Boolean|next|parents|maxLength|maxlength|readOnly|readonly|class|htmlFor|CSS1Compat|compatMode|compatible|borderTopWidth|ie|ra|inline|it|rv|medium|borderWidth|userAgent|522|navigator|with|concat|1px|10000|array|ig|PI|NaN|400|reverse|fast|600|slow|Function|Object|setAttribute|changed|be|can|property|fadeTo|fadeOut|getAttributeNode|fadeIn|slideToggle|method|slideUp|slideDown|action|cssText|stop|responseXML|option|content|300|th|protocol|td|location|send|cap|abort|colg|cos|tfoot|thead|With|leg|Requested|opt|GMT|1970|Jan|01|Thu|area|Since|hr|If|Type|Content|meta|specified|open|link|XMLHTTP|Microsoft|img|onload|row|borderLeftWidth|head|attributes'.split('|'),0,{}));
(function($){
$.fn.hint=function(blurClass){
if(!blurClass)blurClass='blur';
return this.each(function(){
var $$=$(this);
var title=$$.attr('title');
if(title){
$$.blur(function(){
if($$.val()==''){
$$.val(title).addClass(blurClass);
}
})
.focus(function(){
if($$.val()==title){
$$.val('').removeClass(blurClass);
}
else{
$$.removeClass(blurClass);
}
})
.parents('form:first').submit(function(){
if($$.val()==title){
$$.val('').removeClass(blurClass);
}
}).end()
.blur();
if($.browser.mozilla&&!$$.attr('autocomplete')){
setTimeout(function(){
if($$.val()==title)$$.val('');
$$.blur();
},10);
}
}
});
};
})(jQuery);
jQuery.fn.checkbox=function(options){
if(jQuery.browser.msie&&(parseFloat(jQuery.browser.version)<7))
{
}
var settings={
cls:'jquery-checkbox',
empty:ROOT+'images/px.gif'
};
settings=jQuery.extend(settings,options||{});
return this.each(function()
{
var div=jQuery('<div class="'+settings.cls+'-box"><div class="'+settings.cls+'"><div class="mark"><img src="'+settings.empty+'" /></div></div></div>').hover(
function(){jQuery('.'+settings.cls,this).addClass(settings.cls+'-hover');},
function(){jQuery('.'+settings.cls,this).removeClass(settings.cls+'-hover');}
);
if(this._div&&(oldDiv=jQuery(this._div)))
{
clearInterval(this._int);
oldDiv.replaceWith(jQuery(this));
}
jQuery(this).after(div).css({display:'none'}).appendTo(div);
this._div=div;
var el=this;
this._disabled=(this.disabled?true:false);
this._checked=(this.checked?true:false);
this._int=setInterval(function(){
if(el._disabled!=el.disabled){
el._disabled=(el.disabled?true:false);
if(el.disabled)
jQuery('.'+settings.cls,div).addClass(settings.cls+'-disabled');
else
jQuery('.'+settings.cls,div).removeClass(settings.cls+'-disabled');
}
if(el._checked!=el.checked){
el._checked=(el.checked?true:false);
if(el.checked)
div.addClass(settings.cls+'-checked');
else
div.removeClass(settings.cls+'-checked');
}
},10);
jQuery(div).click(function(){
jQuery('input',this).click();
});
jQuery('img',div).bind('dragstart',function(){return false;}).bind('mousedown',function(){return false;});
if(window.getSelection)
jQuery(div).css('MozUserSelect','none');
if(this.checked)
div.addClass(settings.cls+'-checked');
if(this.disabled)
jQuery('.'+settings.cls,div).addClass(settings.cls+'-disabled');
});
};
jQuery.fn.extend({
selectbox:function(options){
return this.each(function(){
new jQuery.SelectBox(this,options);
});
}
});
if(!window.console){
var console={
log:function(msg){
}
}
}
jQuery.SelectBox=function(selectobj,options){
var opt=options||{};
opt.inputClass=opt.inputClass||"selectbox";
opt.containerClass=opt.containerClass||"selectbox-wrapper";
opt.hoverClass=opt.hoverClass||"current";
opt.currentClass=opt.selectedClass||"selected"
opt.debug=opt.debug||false;
var elm_id=selectobj.id;
var active=0;
var inFocus=false;
var hasfocus=0;
var $select=$(selectobj);
var $container=setupContainer(opt);
var $input=setupInput(opt);
$select.hide().before($input).before($container);
init();
$input
.click(function(){
if(!inFocus){
$container.toggle();
}
})
.focus(function(){
if($container.not(':visible')){
inFocus=true;
$container.show();
}
})
.keydown(function(event){
switch(event.keyCode){
case 38:
event.preventDefault();
moveSelect(-1);
break;
case 40:
event.preventDefault();
moveSelect(1);
break;
case 13:
event.preventDefault();
$('li.'+opt.hoverClass).trigger('click');
break;
case 27:
hideMe();
break;
}
})
.blur(function(){
if($container.is(':visible')&&hasfocus>0){
if(opt.debug)console.log('container visible and has focus')
}else{
if($.browser.msie){
if(document.activeElement.getAttribute('id').indexOf('_container')==-1){
hideMe();
}else{
$input.focus();
}
}else{
hideMe();
}
}
});
function hideMe(){
hasfocus=0;
$container.hide();
}
function init(){
$container.append(getSelectOptions($input.attr('id'))).hide();
var width=$input.css('width');
$container.width(width);
}
function setupContainer(options){
var container=document.createElement("div");
$container=$(container);
$container.attr('id',elm_id+'_container');
$container.addClass(options.containerClass);
return $container;
}
function setupInput(options){
var input=document.createElement("input");
var $input=$(input);
$input.attr("id",elm_id+"_input");
$input.attr("type","text");
$input.addClass(options.inputClass);
$input.attr("autocomplete","off");
$input.attr("readonly","readonly");
$input.attr("tabIndex",$select.attr("tabindex"));
return $input;
}
function moveSelect(step){
var lis=$("li",$container);
if(!lis||lis.length==0)return false;
active+=step;
if(active<0){
active=lis.size();
}else if(active>lis.size()){
active=0;
}
scroll(lis,active);
lis.removeClass(opt.hoverClass);
$(lis[active]).addClass(opt.hoverClass);
}
function scroll(list,active){
var el=$(list[active]).get(0);
var list=$container.get(0);
if(el.offsetTop+el.offsetHeight>list.scrollTop+list.clientHeight){
list.scrollTop=el.offsetTop+el.offsetHeight-list.clientHeight;
}else if(el.offsetTop<list.scrollTop){
list.scrollTop=el.offsetTop;
}
}
function setCurrent(){
var li=$("li."+opt.currentClass,$container).get(0);
var ar=(''+li.id).split('_');
var el=ar[ar.length-1];
$select.val(el);
$input.val($(li).html());
return true;
}
function getCurrentSelected(){
return $select.val();
}
function getCurrentValue(){
return $input.val();
}
function getSelectOptions(parentid){
var select_options=new Array();
var ul=document.createElement('ul');
$select.children('option').each(function(){
var li=document.createElement('li');
li.setAttribute('id',parentid+'_'+$(this).val());
li.innerHTML=$(this).html();
if($(this).is(':selected')){
$input.val($(this).html());
$(li).addClass(opt.currentClass);
}
ul.appendChild(li);
$(li)
.mouseover(function(event){
hasfocus=1;
if(opt.debug)console.log('over on : '+this.id);
jQuery(event.target,$container).addClass(opt.hoverClass);
})
.mouseout(function(event){
hasfocus=-1;
if(opt.debug)console.log('out on : '+this.id);
jQuery(event.target,$container).removeClass(opt.hoverClass);
})
.click(function(event){
var fl=$('li.'+opt.hoverClass,$container).get(0);
if(opt.debug)console.log('click on :'+this.id);
$('li.'+opt.currentClass).removeClass(opt.currentClass);
$(this).addClass(opt.currentClass);
setCurrent();
$select.get(0).blur();
hideMe();
});
});
return ul;
}
};
var yoolk={};
$(document).ready(function(){
header.initAreas();
header.initCategoryList();
header.initCreateNewListing();
header.update();
language.init();
setScreenClass();
user.load();
log.pageView();
$('#areaList').listToDropDown();
if(hasMap)bindMapAddress();
if(header.activeTab=="newListingTab")loadNewListingMap();
if(turnOnLocation)
LL.loadEventMaps([MainEventMap,LocationEventMap]);
else
LL.loadEventMaps([MainEventMap]);
document.onclick=function(){
if(document.getElementById('div_dropDown'))Util.dom.hideItem(document.getElementById('div_dropDown'));
if(document.getElementById('dropdownLocation'))Util.dom.hideItem(document.getElementById('dropdownLocation'));
if(document.getElementById('dropdownSubpage'))Util.dom.hideItem(document.getElementById('dropdownSubpage'));
if(document.getElementById('dropdownLocationSubpage'))Util.dom.hideItem(document.getElementById('dropdownLocationSubpage'));
}
initUIHeader();
});
window.onload=function(){
focusSearchBox();
};
function focusSearchBox(){
var txtHome=document.getElementById('txtHome');
if(txtHome)txtHome.focus();
var txtSearchSubpage=document.getElementById('txtSearchSubpage');
if(txtSearchSubpage)txtSearchSubpage.focus();
}
function initUIHeader(){
$('input[title!=""]').hint();
$('textarea[title!=""]').hint();
if(document.getElementById('Home')!=null)
$('#areaDropdown').selectbox();
$('#searchBox input:checkbox').checkbox();
dropdownArea();
dropdownList('#language','#otherLanguage');
selectedArea();
}
dropdownArea=function(){
var open;
$('#subArea').hover(function(){
$(this).show();
open=$(this).parent();
},function(){
$(this).hide();
});
$('#moreArea').mouseover(function(){
if(open!=null)open.children('#subArea').hide();
if($(this)!=open)$(this).children('#subArea:hidden').show();
});
$('#subArea').mouseout(function(){
open=$(this);
});
}
dropdownList=function(elParent,elChild){
var open;
$(elChild).hover(function(){
$(this).show();
open=$(this).parent();
},function(){
$(this).hide();
});
$(elParent).mouseover(function(){
if(open!=null)open.children("ul").hide();
if($(this)!=open)$(this).children("ul:hidden").show();
});
$(elChild).mouseout(function(){
open=$(this);
});
}
selectedArea=function(){
$('#subArea li a').click(function(){
var currentArea=this.innerHTML;
$('#moreArea>a').empty();
$('#moreArea>a').append(currentArea);
$('#subArea').hide();
$('#subArea a').each(function(){
$(this).removeClass('active');
});
$(this).addClass('active');
$('#txtArea').attr('value',currentArea);
return submitSearch(this,$('#txtSearchSubpage'));
});
}
submitSearch=function(link,query){
var location=document.getElementById('txtLocation')?document.getElementById('txtLocation'):document.getElementById('txtLocationSubpage');
var txtLocation=''
if(location)
txtLocation=' '+location.value;
var area='';
var isAnyTown=(link.id=='anyTown');
var isEmmptyQuery=(query.val()==query.attr('title')||query.val()=="");
if(isAnyTown)
$('#txtArea').attr('value',area);
else
area=link.innerHTML;
if(!isEmmptyQuery){
window.location=ROOT+localizeUrl($searchUrl)+'/?q='+query.val()+txtLocation+'&area='+area;
return false;
}
else if(isAnyTown){
query.focus();
return false;
}
}
String.prototype.startsWith=function(str)
{return(this.match("^"+str)==str)}
String.prototype.endsWith=function(str)
{return(this.match(str+"$")==str)}
submitSearchBox=function(searchBoxId,locationId){
var txtSearchBox=document.getElementById(searchBoxId);
var isEmmptyQuery=(txtSearchBox.value==txtSearchBox.title||txtSearchBox.value=="");
var txtLocation=document.getElementById(locationId);
var location='';
var area=document.getElementById('txtArea').value;
if(txtLocation&&(txtLocation.value!=txtLocation.title&&txtLocation.value!=""))
location=' '+txtLocation.value;
if(txtSearchBox.value.startsWith('#')&&txtSearchBox.value.endsWith('#')){
window.location=ROOT+localizeUrl($searchUrl)+'/?q='+txtSearchBox.value.replace(/#/g,'%23');
return false;
}
if(!isEmmptyQuery){
window.location=ROOT+localizeUrl($searchUrl)+'/?q='+txtSearchBox.value+location+'&area='+area;
return false;
}
}
getSelectedArea=function(areaName){
if(areaName.length>16){
areaName=areaName.substring(0,13)+'...';
}
return areaName;
}
window.onresize=function(){setScreenClass();};
function setScreenClass(){
var w=document.documentElement.clientWidth;
document.body.className=(w>980)?"wide":"narrow";
header.updateIndex();
}
var user={
id:0,
load:function(reset,reload){
if(reload)location.reload(true);
var c=$('#userInfo');
var onHomePage=(document.body.id=="Home");
c.addClass('loading');
c.empty();
var f=reset?'signout':'user';
$.getJSON(ROOT+f+'.json?a='+ticks(),function(x){user.show(x,onHomePage);});
if(f=='signout'&&$("#editListing")!=undefined){
$("#editListing"+iq_l).attr('href','javascript:listingEdit.show();');
$("#editListing"+iq_l).attr("target","");
}
},
show:function(x,onHomePage){
user.id=x.id;
var t;
if(user.id){
t=$signedInAs+' <b>'+x.name+'</b> | <a href="./userprofile/?userid='+user.id+'&name='+escape(x.name)+'">'+$myProfile+'</a> | <a href="#" onclick="user.load(true);return false;">'+$signOut+'</a>';
}else{
t='<a href="javascript:bubble.freeze();" onmouseover="showLoginBubble(this);" onmouseout="bubble.hide();" onclick="">'+$signJoin+'</a>';
}
var c=$('#userInfo');
c.removeClass("loading");
c.append(t);
}
};
var language={
init:function(){
if(typeof(languageLinks)=='undefined')return;
var c='<ul id="otherLanguage">';
for(var lang=0;lang<languageLinks.length;lang++){
if(languageLinks[lang][1]=='http://yoolk.co.th/th'){
c+='<li><a title="'+languageLinks[lang][0]+'" href="http://thai.yoolk.co.th">'+languageLinks[lang][2]+'</a></li>';
continue;
}
if(languageLinks[lang][1]=='http://thai.yoolk.co.th/en'){
c+='<li><a title="'+languageLinks[lang][0]+'" href="http://yoolk.co.th/">'+languageLinks[lang][2]+'</a></li>';
continue;
}
c+='<li><a title="'+languageLinks[lang][0]+'" href="'+languageLinks[lang][1]+'">'+languageLinks[lang][2]+'</a></li>';
}
c+='</ul>';
$('#language').append(c);
}
};
var iq_pt,iq_c,iq_n,iq_t,iq_l,iq_f,iq_s,iq_sc;
var log={
pageView:function(){
if(iq_pt){
var d={
s:screen.width+'x'+screen.height,
u:escape(window.location),
iq_pt:iq_pt,
iq_c:iq_c,
iq_n:iq_n,
iq_t:iq_t,
iq_l:iq_l,
iq_f:iq_f,
iq_s:iq_s,
iq_sc:iq_sc,
r:escape(document.referrer)
};
log.call('a',d);
}
},
event:function(type,code){
log.call('b',{t:type,c:code});
},
listingClick:function(url,rank,fap){
var f=function(){document.location.href=url;};
log.call('d',{r:rank,f:fap},f);
return false;
},
mydirChange:function(){
log.call('c',{f:getCookie('Favorites')});
},
call:function(type,data,func){
var u=ROOT+type+'.logrequest.yolx';
data.a=ticks();
$.get(u,data,func);
}
};
function localizeUrl(url){
if(LANG=='')return url;
if(url[0]!='/')url='/'+url;
return LANG+url;
}
function showLoginBubble(el){
bubble.title=el.innerHTML;
bubble.width=400;
bubble.showLogin(el);
}
function bugBubble(el){
bubble.title=$reportBug;
var f=(user.id==0)?[new BubbleTxtBox($yourName,"name"),new BubbleTxtBox($yourEmail,"email")]:new Array();
f.push(new BubbleTxtBox($message,"_message",4));
var c=bubble.createContent($bugReportDescription,f);
c+='<input type="hidden" name="url" value="'+document.location.href+'"/>';
c+='<input type="hidden" name="screensize" value="'+document.documentElement.clientWidth+'x'+document.documentElement.clientHeight+'"/>';
bubble.formAction='bugreport.yolx?a='+ticks();
bubble.width=400;
bubble.content=c;
bubble.show(el);
}
function ce(e,i,c,h){
var x=document.createElement(e);
if(i)x.id=i;
if(c)x.className=c;
if(h)x.innerHTML=h;
return x;
}
var header={
activeTab:'searchTab',
update:function(){
var c=getCookie("activeTab");
if(c){this.activeTab=c;}
else{setCookie("activeTab",this.activeTab);}
$("#tabHeaders").empty();
$('#uiTabs>div>h2').each(
function(){
var el=$(this);
var id=$(el.parent()).attr('id');
var tab;
if(id==header.activeTab){
tab='<li class="active"><span>'+el.text()+'</span></li>';
el.parent().css({display:'block'});
}else{
tab='<li><a href="#" id="H'+id+'">'+el.text()+'</a></li>';
el.parent().css({display:'none'});
}
$("#tabHeaders").append(tab);
}
);
$('#tabHeaders li:first').addClass("first");
$("#tabHeaders a").click(function(){header.switchTab(this);return false;});
$("#HnewListingTab").click(loadNewListingMap);
if(this.activeTab=="searchTab"){
$('#subArea a').each(function(){
if(this.innerHTML==$('#txtArea').val()){
$(this).addClass('active');
$('#moreArea>a').empty();
$('#moreArea>a').append(this.innerHTML);
return;
}
});
focusSearchBox();
}
if(this.activeTab=="browseTab"){header.updateIndex();}
},
switchTab:function(e){
if(e){
this.activeTab=e.id.substring(1);
setCookie("activeTab",this.activeTab);
header.update();
}
},
updateIndex:function(){
var cols=(document.body.className=="narrow")?4:6;
var l=$("#browseTab table");
if(l.length===0){l=$('#browseTab div ul');}
$('#browseTab ul').addClass('linkList');
},
initCreateNewListing:function(){
var imageClass="image3";
var c="<h2>"+$createNewListing+"</h2>";
c+="<form  id='frmNewListing' >";
c+="<div id='newListingBrowseLine' class='redLine'></div>";
c+="<input type='hidden' name='subject' value='Create new listing' />";
c+="<table id='createNewListing' cellpadding='50'><tbody>";
c+="<tr><td><div class='image1'>"+$addKeyword+"</div></td>";
c+="<td align='right' style='padding-right:3px;'><a href='https://adwords.google.com/select/KeywordToolExternal' style='text-decoration:underline;' target='_blank'>"+$discoverKeyword+"</a></td></tr>";
c+="<tr><td colspan='2'><div class='textareaKeyword'><textarea id='taKeyword' name='keyword' rows='2' title='"+$keywordRequired+"' onkeyup='validateNewListingForm();' onclick='validateNewListingForm();' onselect='validateNewListingForm();'></textarea></div></td></tr>";
c+="<tr><td><div class='image2'>"+$buildListing+"</div></td>";
c+="<td align='right' style='padding-right:3px;'><a href='./GoodListing/' style='text-decoration:underline;' onclick='return popupWindow(\""+ROOT+LANG+"/GoodListing/\");'>"+$secretListing+"</a></td></tr>";
c+="<tr><td colspan='2'>";
c+="<div class='textareaControl'><textarea id='taCompanyProfile' name='listingInfo' value='' rows='14'>";
c+="</textarea></div></td></tr>";
if(hasMap){
c+="<tr><td colspan='2'><div class='image3'>"+$addLocation+"</div></td></tr>";
c+="<tr><td colspan='2'><input id='txtAddress' type='text' size='40' />&nbsp;&nbsp;<input id='btnFindLocation' type='button' value='"+$findLocation+"' /></td></tr>";
c+="<tr><td colspan='2'><div id='mapListing'></div></td></tr>";
c+="<tr><td colspan='2' style='font-size: 95%; font-weight: bold;'>"+$mapNote+"</td></tr>";
c+="<input name='Lat' id='txtLat' type='hidden' /><input name='Lng' id='txtLng' type='hidden' /><input name='Zoom' id='txtZoom' type='hidden' />";
imageClass="image4";
}
c+="<tr><td colspan='2'><div class='"+imageClass+"'>"+$subscribeAndSubmit+"</div></td></tr>";
c+="<tr><td colspan='2' style='padding-left:10px'><input type='checkbox' value='"+$statisticAndHealthReports+"' name='report' id='chkReport' />"+$statisticAndHealthReports+"<br />";
c+="<input type='checkbox' value='"+$notifyMe+"' name='notifyEmail' id='chkNotifyEmail' />"+$notifyMe+"<br />";
c+="<input type='checkbox' value='"+$ownerListing+"' name='ownerListing' id='chkOwnerListing' />"+$ownerListing+"</p></td></tr>";
c+="<tr><td width='53%'>";
c+="<div class='controlBox'><input type='text' name='yourName' id='txtYourName' maxlength='50' value='' title='"+$yourName+"' /></div>";
c+="<div class='controlBox'><input type='text' name='email' id='txtNotifyEmail' onkeyup='validateNewListingForm();' onclick='validateNewListingForm();' onselect='validateNewListingForm();' maxlength='50' value='' title='"+$yourEmailRequired+"' /><span class='requiredEmailHidden' id='emailRequire' /></div>";
c+="</td>";
c+="<td><div id='newListingControls'><input type='button' id='btnOk' disabled='disabled' class='disabled' onclick='submitNewListing(this);' value='"+$okButtonText+"'/>";
c+="<br /><br /><input type='button' id='btnCancel' onclick='switchToSearchTab();' value='"+$cancelButtonText+"'/></div></td></tr>";
c+="</tbody></table>";
c+="</form>";
$('#newListingTab').append(c);
var u=ROOT+LANG+'/listingAddGuideLine.json';
$.getJSON(u,function(x){
$('#taCompanyProfile').val(x.listingGuideLine);
});
},
initCategoryList:function(){
if(document.getElementById('Home')!=null)return;
var u=ROOT+LANG+'/categoryList.json';
$.getJSON(u,function(catList){
var c=linkList(catList,4,'linkList');
$('#browseTab').append(c);
});
},
initAreas:function(){
if(document.getElementById('Home')!=null)return;
var u=ROOT+LANG+'/areas.json';
$.getJSON(u,function(areas){
var c='<select id="areaDropdown" name="area">';
if(areas.length>1){
var selected=(iq_as=='')?'  selected=\"selected\"':'';
c+='<option value=""'+selected+'>'+$anyTown+'</option>'
for(var a in areas){
var selected=(areas[a].name==iq_as)?'  selected=\"selected\"':'';
c+='<option value="'+areas[a].name+'"'+selected+'>'+areas[a].name+'</option>';
}
}
if(areas.length==1){
c+='<option value="'+areas[0].name+'">'+areas[0].name+'</option>';
}
c+='</select><br/>';
var areaList=document.getElementById('areaListHeader').childNodes[1];
$(c).insertBefore(areaList);
$('#areaDropdown').selectbox();
});
}
};
$.fn.splitList=function(cols){
var s="<table><tbody><tr>";
var l=$('li',this);
var iMin=Math.floor(l.length/cols);
var iPlus=l.length%cols;
var i=0;
var ipc=iMin;
l.each(
function(){
if(i==0){
s+="<td><ul>";
if(iPlus){ipc=iMin+1;iPlus--;}
else{ipc=iMin;}
}
s+='<li>'+$(this).html()+'</li>';
i++;
if(i==ipc){
s+="</ul></td>";
i=0;
}
}
);
s+="</tr></tbody></table>";
$(this).replaceWith(s);
};
$.fn.listToDropDown=function(){
var l=$('li',this);
var s='<select ';
s+=(l.length>1)?'onchange="redirect(this.value);">':'disabled="disabled">';
for(var i=0;i<l.length;i++){
var a=l[i].childNodes[0];
if(a.tagName=='A')
s+='<option value="'+a.href+'">';
else
s+='<option selected="selected">';
s+=a.innerHTML+'</option>';
}
s+='</select>';
this.replaceWith(s);
};
function redirect(s){
if(s.length<7||s.substr(0,7)!='http://'){
s=ROOT+s;
}
window.location.href=s;
}
function isEmail(s){
var re=/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i;
return re.test(s);
}
function replaceHtml(el,html){
var oldEl=(typeof el==="string"?document.getElementById(el):el);
var newEl=document.createElement(oldEl.nodeName);
newEl.id=oldEl.id;
newEl.className=oldEl.className;
newEl.innerHTML=html;
oldEl.parentNode.replaceChild(newEl,oldEl);
return newEl;
}
function Ajax(u,f,ff,d){
var r=0;
var m=(d)?"POST":"GET";
if(window.XMLHttpRequest){
r=new XMLHttpRequest();
}else if(window.ActiveXObject){
try{
r=new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
r=new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){
r=0;
};
};
};
if(r){
r.onreadystatechange=function(){hR(f,ff)};
r.open(m,ROOT+u,true);
if(d)r.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8");
r.send(d);
};
function hR(f,ff){
if(r.readyState==4){
if(f&&r.status==200|304){
(r.responseXML!=null)?f(r.responseXML.documentElement):f();
}else if(ff){
ff();
};
};
};
}
function jL(s){
return'javascript:'+s;
}
function ticks(){
return(new Date()).getTime();
}
function getCookie(n){
var c=""+document.cookie;
var i=c.indexOf(n);
if(i<0)return"";
var j=c.indexOf(';',i);
if(j<0)j=c.length;
return unescape(c.substring(i+n.length+1,j));
}
function setCookie(name,value,nDays){
if(!nDays)nDays=1;
var expire=new Date();
expire.setTime(expire.getTime()+3600000*24*nDays);
document.cookie=name+"="+escape(value)
+";expires="+expire.toGMTString()
+";path=/";
}
function xy(o){
var x=y=0;
if(o.offsetParent){
x=o.offsetLeft;
y=o.offsetTop;
while(o=o.offsetParent){
x+=o.offsetLeft;
y+=o.offsetTop;
}
}
return[x,y];
}
function getWindowSize(){
var w=0,h=0;
if(typeof(window.innerWidth)=='number'){
w=window.innerWidth;
h=window.innerHeight;
}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){
w=document.documentElement.clientWidth;
h=document.documentElement.clientHeight;
}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){
w=document.body.clientWidth;
h=document.body.clientHeight;
}
return{width:w,height:h};
}
function getPageSize(){
var x,y,b=document.body,wi=window.innerHeight,ws=window.scrollMaxY;
if(wi&&ws){
x=b.scrollWidth;
y=wi+ws;
}else if(b.scrollHeight>b.offsetHeight){
x=b.scrollWidth;
y=b.scrollHeight;
}else{
x=b.offsetWidth;
y=b.offsetHeight;
};
var w,h,d=document.documentElement;
if(self.innerHeight){
w=self.innerWidth;
h=self.innerHeight;
}else if(d&&d.clientHeight){
w=d.clientWidth;
h=d.clientHeight;
}else if(b){
w=b.clientWidth;
h=b.clientHeight;
};
var pH=(y<h)?h:y,pW=(x<w)?w:x;
return new Array(pW,pH,w,h);
}
function getScrollTop(){
return window.pageYOffset||document.documentElement.scrollTop;
}
function bookmarkPage(){
var t=document.title,u=document.location.href,w=window;
if(w.sidebar)w.sidebar.addPanel(t,u,'');
else if(w.external)w.external.AddFavorite(u,t);
else if(w.opera&&w.print)return true;
}
function getFormValues(form){
var s="",ee=form.elements,e,rf=new Array();
if(ee.length==1)return'ok';
for(var i=0;i<ee.length;i++){
e=ee[i];
if(e.name.substring(0,1)=="_")rf.push(e.name);
switch(e.type){
case"radio":
case"checkbox":
if(e.checked)s+=e.name+"="+e.value+"&";
break;
default:
if(e.value&&(e.name.indexOf('email')<0||isEmail(e.value)))
s+=e.name+"="+e.value.replace(/&/g,"%26")+"&";
break;
};
};
for(var i=0;i<rf.length;i++)
if(s.indexOf(rf[i])<0)
return null;
return s.slice(0,-1);
}
function mailClick(c,i,u){
if(u.indexOf('http://')==0)u=u.replace(RootLanguage,'');
u=ROOT+c+','+i+'/'+u+'.ml.json';
$.getJSON(u,null,function(x){if(x.m)document.location.href='mailto:'+x.m;});
log.event(1,c);
return false;
}
function webLink(u,c,target){
window.open(ROOT+u,target);
log.event(2,c);
return false;
}
function linkToUrl(u,c,target){
window.open(ROOT+u,target);
return false;
}
function ad(campaign,param){
var url='bnr/'+campaign+'/'+param+'/';
writeAd('bannerAdFrame','bannerAd',120,240,url);
}
function tad(campaign,param){
var url='tad/'+campaign+'/'+param+'/';
writeAd('textAdFrame','tad3',160,300,url.replace(/[+]/g,'-'));
}
function writeAd(id,className,width,height,src){
if(src)src=ROOT+ticks()+'/'+src;
else src='';
document.write('<iframe id="'+id+'" class="'+className+'" width="'+width+'" height="'+height+'" src="'+src+'" frameborder="0" scrolling="no"></iframe>');
}
function mapViewClick(el,mapRefXY){
document.location='./listing.html#listing-map';
return false;
}
function setSelectedMap(el,hili_el){
el.removeClass('selected');
$(hili_el).addClass('selected');
}
function convertCharToNumber(string){
return string.charCodeAt(0)-64;
}
function convertNumberToChar(number){
var asciiNumber=number+64;
return String.fromCharCode(asciiNumber);
}
function submitNewListing(el){
var action="managelisting.yolx";
var d=getFormValues(document.getElementById("frmNewListing"));
Ajax(action,null,null,d);
bubble.title=$thankYou;
bubble.width=400;
bubble.showThanks($reviewYourListing);
bubble.show(el,null);
bubble._loading=true;
bubble._render();
document.getElementById("frmNewListing").reset();
var u=ROOT+'listingAddGuideLine.json';
$.getJSON(u,function(x){
$('#taCompanyProfile').val(x.listingGuideLine);
});
$("#emailRequire").addClass("hidden");
$("#emailRequire").removeClass("requireEmail");
var btn=document.getElementById('btnOk');
btn.className=btn.disabled="disabled";
setTimeout("header.switchTab(document.getElementById('HsearchTab')); window.scrollTo(0,0); focusSearchBox();",2100);
return false;
}
function validateNewListingForm(){
var btn=document.getElementById('btnOk');
if(isEmail($("#txtNotifyEmail").val())&&$("#taKeyword").val()!=""&&$("#taKeyword").val()!=$keywordRequired){
btn.className=btn.disabled="";
}
else{
btn.className=btn.disabled="disabled";
}
}
function switchToSearchTab(){
header.switchTab(document.getElementById('HsearchTab'));
}
function switchToCreateNewListingTabOnHomePage(){
setCookie("activeTab","newListingTab");
window.location='.';
return false;
}
function linkList(list,columns,listClassName){
if(list.length==0)return;
var itemsPerColumn=divideEvenly(list.length,columns);
var itemIndex=0;
var colIndex=0;
var c;
c='<div class="cols'+columns+'">';
var listStartTag;
if(listClassName=='')
{listStartTag='<ul>';}
else
{listStartTag='<ul class="'+listClassName+'">';}
for(var i=0;i<list.length;i++){
if(itemIndex==0)
c+=listStartTag;
c+='<li><a href="'+list[i].url+'">'+list[i].name+'</a></li>';
itemIndex++;
if(itemIndex>=itemsPerColumn[colIndex]){
c+='</ul>';
colIndex++;
itemIndex=0;
}
}
c+='<div class=\"clear\"></div>';
c+='</div>';
return c;
}
function divideEvenly(items,columns){
var extraItems=items%columns;
var itemsPerColumnMin=(items-extraItems)/columns;
var itemsPerColumn=new Array(columns);
for(var i=0;i<columns;i++){
itemsPerColumn[i]=itemsPerColumnMin;
if(extraItems>0){
itemsPerColumn[i]++;
extraItems--;
}
}
return itemsPerColumn;
}
function popupWindow(url){
var h=540;
var w=500;
var winLeft=(screen.width-w)/2;
var winTop=(screen.height-h)/2;
if(winLeft<0){winLeft=0;}
windowProps="height="+h+",width="+w+",top="+winTop+" ,left="+winLeft+",location=no,"
+"scrollbars=yes,menubars=no,toolbars=no,resizable=no,status=yes, directories=false";
var newWindow=window.open(url,"Popup",windowProps);
if(window.focus){newWindow.focus();}
return false;
}
function bindMapAddress(){
$("#taCompanyProfile").bind(
"keyup",
function(e){
var textCompanyProfile=document.getElementById("taCompanyProfile").value;
var textAddress=textCompanyProfile.match(/(ADDRESS|地址):.*/i);
if(textAddress){
textAddress=textAddress[0].split(":")[1];
}
textAddress=jQuery.trim(textAddress);
document.getElementById("txtAddress").value=textAddress;
}
);
}
var loadMapScript=function(callbackName){
var script=document.createElement("script");
script.type="text/javascript";
script.src="http://maps.google.com/maps?file=api&v=2.x&key="+googleMapKey+"&async=2&callback="+callbackName+"&hl="+googleMapLang;
document.body.appendChild(script);
};
var MapListing=function(divMapId,txtLatId,txtLngId,txtZoomId,txtAddressId,btnFindLocationId,mode){
var defaultLocation=areaName+', '+countryName;
var gIcon=new GIcon(G_DEFAULT_ICON);
gIcon.image=ROOT+"styles/marker-green.gif";
var width=mode=="add"?468:482;
var map=new GMap2(document.getElementById(divMapId),{size:new GSize(width,300)});
map.addControl(new GLargeMapControl3D());
var marker=new GMarker(new GLatLng(0,0),{icon:gIcon,draggable:true});
var assignLatLng=function(lat,lng){
document.getElementById(txtLatId).value=lat;
document.getElementById(txtLngId).value=lng;
if(!lat&&!lng)
document.getElementById(txtZoomId).value="";
else
document.getElementById(txtZoomId).value=map.getZoom();
};
GEvent.addListener(
map,
"click",
function(overlay,latlng){
if(!overlay){
marker.show();
marker.setLatLng(latlng);
assignLatLng(latlng.lat(),latlng.lng());
}
}
);
GEvent.addListener(
marker,
"dragend",
function(latlng){
assignLatLng(latlng.lat(),latlng.lng());
}
);
GEvent.addListener(
marker,
"click",
function(){
if(marker){
marker.hide();
assignLatLng("","");
}
}
);
GEvent.addListener(
map,
"zoomend",
function(oldZoom,newZoom){
document.getElementById(txtZoomId).value=newZoom;
}
);
var getLocation=function(address){
var geoCoder=new GClientGeocoder();
geoCoder.getLocations(
address,
function(location){
document.getElementById(txtAddressId).value=address;
if(location.Status.code==200){
var placeMark=location.Placemark[0];
var latLngBox=placeMark.ExtendedData.LatLonBox;
var latlng,zoom=7;
if(latLngBox){
var latLngBound=new GLatLngBounds(new GLatLng(latLngBox.south,latLngBox.west),new GLatLng(latLngBox.north,latLngBox.east));
zoom=map.getBoundsZoomLevel(latLngBound);
}
latlng=new GLatLng(placeMark.Point.coordinates[1],placeMark.Point.coordinates[0]);
map.setCenter(latlng,zoom);
marker.setLatLng(latlng);
assignLatLng(latlng.lat(),latlng.lng());
map.addOverlay(marker);
}else{
alert($addressNotFound);
}
}
);
}
if(mode=="add"){
getLocation(defaultLocation);
}
else{
if(iq_lat&&iq_lng){
var latlng=new GLatLng(iq_lat,iq_lng);
map.setCenter(latlng,iq_zoom);
marker.setLatLng(latlng);
assignLatLng(latlng.lat(),latlng.lng());
map.addOverlay(marker);
}else{
getLocation(defaultLocation);
}
}
$("#"+btnFindLocationId).click(
function(){
getLocation($("#"+txtAddressId).val());
}
);
$("#"+txtAddressId).keypress(
function(e){
if(e.which==13&&this.value)$("#"+btnFindLocationId).click();
}
);
};
var loadNewListingMap=function(){
if(!hasMap)return;
if(!window["GMap2"]){
loadMapScript("addMapListing");
}else if(typeof mapAddListing=="undefined"){
addMapListing();
};
};
var loadEditListingMap=function(){
if(!hasMap)return;
if(!window["GMap2"]){
loadMapScript("editMapListing");
}else{
editMapListing();
}
};
var addMapListing=function(){
var divMapId="mapListing";
var txtLatId="txtLat";
var txtLngId="txtLng";
var txtZoomId="txtZoom";
var txtAddressId="txtAddress";
var btnFindLocationId="btnFindLocation";
mapAddListing=new MapListing(divMapId,txtLatId,txtLngId,txtZoomId,txtAddressId,btnFindLocationId,"add");
};
var editMapListing=function(){
var divMapId="mapListingEdit";
var txtLatId="txtLatEdit";
var txtLngId="txtLngEdit";
var txtZoomId="txtZoomEdit";
var txtAddressId="txtAddressEdit";
var btnFindLocationId="btnFindLocationEdit";
var mapEditListing=new MapListing(divMapId,txtLatId,txtLngId,txtZoomId,txtAddressId,btnFindLocationId,"edit");
};$(document).ready(function(){
mydir.init();
});
var mydir={
init:function(){
$('#tbx').append('<div id="mydir"><h2>'+$myDirectory+'</h2><ul/><div class="clear"/></div>');
mydir.load(0);
},
load:function(code){
if(code&&!mydir.contains(code)){
var l=mydir.getCodes();
if(l&&l.length>=20){
alert($myDirectoryFull);
return;
}
}
$('#mydir *:nth-child(2)').replaceWith("<p>"+$loading+"...</p>");
var f=function(x){mydir.show(x,code);};
var d=(code)?{c:code}:null;
$.getJSON(ROOT+LANG+'/mydir.json',d,f);
},
show:function(x,c){
if(c){
var l=$('#mydir'+c)[0];
if(l)l.innerHTML=mydir.contains(c)?$removeFromMyDirectory:$addToMyDirectory;
log.mydirChange();
}
var m;
if(x.l.length==0){
m="<p>"+$myDirectoryEmpty+"</p>";
}else{
m='<ul class="linkList">';
for(var i=0;i<x.l.length;i++){
var a=x.l[i];
m+='<li style="border:1px solid #fff">';
m+='<a href=".'+a.u+'" style="padding-right:15px">'+a.n+'</a>';
m+='<a href="'+jL('mydir.load('+a.c+')')+'" class="x">x</a>';
m+='</li>';
}
m+='</ul>';
}
$('#mydir *:nth-child(2)').replaceWith(m);
},
contains:function(c){
var l=mydir.getCodes();
for(var i=0;i<l.length;i++)
if(l[i]==c)return true;
return false;
},
getCodes:function(){
var f=getCookie('Favorites');
return(f.length>0)?f.split(','):[];
}
};
var bubble;
$(document).ready(function(){
if(!bubble)bubble=new Bubble();
})
function Bubble(){
this._init();
};
Bubble.prototype._init=function(){
this._renderer=new BubbleRenderer();
this._tailSide="left";
this.width=200;
this.title="";
this.content="";
this._errorMsg="";
this._x=0;
this._y=0;
this._visible=false;
this._frozen=false;
this._loading=false;
this.formAction=null;
this.onSubmitSuccess=null;
this._edit=false;
};
Bubble.prototype.hide=function(){
if(!this._frozen)
this._hiding=setTimeout(function(){bubble._close();},300);
};
Bubble.prototype.show=function(caller,xMod,edit,yMod){
xMod=xMod||0;
yMod=yMod||0;
if(caller){
clearTimeout(this._hiding);
if(arguments.length==1)xMod=0;
this._loading=false;
this._frozen=false;
this._visible=true;
this._errorMsg="";
var callerXY=xy(caller);
var pageWidth=getPageSize()[0];
if(callerXY[0]>pageWidth-this.width-caller.offsetWidth){
this._x=callerXY[0]-this.width;
this._tailSide="right";
}else{
this._x=callerXY[0]+caller.offsetWidth+xMod;
this._tailSide="left";
};
this._y=callerXY[1]-25+yMod;
};
if(edit){
this._edit=true;
}else{
this._edit=false;
}
this._render(true);
this._renderer.validateForm();
};
Bubble.prototype.freeze=function(){
if(!this._frozen){
this._frozen=true;
this._renderer.toggleOverlay(true);
this._render();
};
this._renderer.validateForm();
};
Bubble.prototype._render=function(resetForm){
this._renderer.render(this,resetForm);
};
Bubble.prototype.showLogin=function(caller){
this._errorMsg="";
this.formAction="login.yolx";
this.onSubmitSuccess=function(x){user.load(false,true);};
var c='<p>'+$signJoinDesc+'</p>';
c+='<p><label for="_email">'+$myEmailAddressIs+'</label> <input type="text" class="txt" name="_email" id="_email"'+GetTxtBoxEvents()+' /></p>';
c+='<p><input type="radio" name="loginType" value="new" onclick="bubble._loginType(this);" onfocus="bubble._loginType(this);" checked="checked" id="loginTypeNew" /> <label for="loginTypeNew" id="loginTypeNewLbl">'+$newUserDesc+'</label></p>';
c+='<p><input type="radio" name="loginType" value="old" onclick="bubble._loginType(this);" onfocus="bubble._loginType(this);" id="loginTypeOld" /> <label for="loginTypeOld" id="loginTypeOldLbl" style="color:#aaa">'+$iHavePassword+':</label> <input type="password" name="password" id="password" disabled="disabled" class="txt disabled"'+GetTxtBoxEvents()+' /></p>';
this.content=c;
this.show(caller);
};
Bubble.prototype.createContent=function(message,fields){
var c="";
if(message)c="<p>"+message+"</p>";
if(fields){
c+='<table cellpadding="0" cellspacing="0"><tbody>';
for(var i=0;i<fields.length;i++)
c+=fields[i].toString();
c+="</tbody></table>";
}else{
this.formAction=null;
};
return c;
};
Bubble.prototype._loginType=function(el){
var pw=document.getElementById("password");
var nlbl=document.getElementById('loginTypeNewLbl');
var olbl=document.getElementById('loginTypeOldLbl');
if(el.value=="new"){
pw.className=pw.disabled="disabled";
nlbl.style.color='#000';
olbl.style.color='#aaa';
}else{
nlbl.style.color='#aaa';
olbl.style.color='#000';
pw.className=pw.disabled="";
pw.focus();
};
pw.className+=" txt";
this.freeze();
};
Bubble.prototype._update=function(){
this._renderer.setOverlaySize();
};
Bubble.prototype._close=function(){
this.onSubmitSuccess=null;
this._visible=false;
this._frozen=true;
this._loading=false;
this._renderer.toggleOverlay(false);
this._render();
};
Bubble.prototype.submit=function(){
this._loading=true;
this._render();
var d=getFormValues(document.getElementById("bubbleForm"));
var f=function(x){bubble.onSubmit(x);};
var a=new Ajax(this.formAction,f,null,d);
return false;
};
Bubble.prototype.onSubmit=function(x){
var errorCode=(x.firstChild.nodeName=='e')?parseInt(x.firstChild.firstChild.nodeValue):0;
switch(errorCode){
case 1:
this._loading=false;
this.showLogin();
break;
case 2:
this._errorMsg=x.childNodes[1].firstChild.nodeValue;
this._loading=false;
this._render();
break;
case 0:
var msg=(x.childNodes[1].childNodes.length)?x.childNodes[1].firstChild.nodeValue:$thankYou;
this.showThanks(msg);
if(this.onSubmitSuccess)this.onSubmitSuccess(x);
break;
};
};
Bubble.prototype.showThanks=function(s){
this._errorMsg="";
this.content='<p style="text-align:center;">'+s+'</p>';
this._render(true);
setTimeout(function(){bubble._close();},2000);
};
function BubbleRenderer(){this.init();};
BubbleRenderer.prototype.init=function(){
this._base=ce("div","bubble");
this._base.onmouseover=function(){clearTimeout(bubble._hiding);};
this._base.onmouseout=function(){bubble.hide();};
this._base.appendChild(ce("div","bubbleBg",null,this._noFlash));
this._closeBtn=ce("p","bubbleClose",null,'<a href="#" onclick="bubble._close();return false;">[x]</a>');
this._base.appendChild(this._closeBtn);
this._form=ce("form","bubbleForm");
this._form.onsubmit=function(){return bubble.submit();};
this._title=ce("h3","bubbleTitle");
this._content=ce("div","bubbleContent");
this._error=ce("p","bubbleError","clear");
this._controls=ce("div","bubbleControls",null,'<input type="button" value="'+$cancelButtonText+'" id="bubbleCancel" onclick="bubble._close()" /> <input type="submit" value="'+$okButtonText+'" id="bubbleOk" class="disabled" />');
this._form.appendChild(this._title);
this._form.appendChild(this._content);
this._form.appendChild(this._error);
this._form.appendChild(this._controls);
this._base.appendChild(this._form);
this._overlay=ce('a','overlay');
var bd=$('body')[0];
bd.appendChild(this._overlay);
bd.appendChild(this._base);
};
BubbleRenderer.prototype.render=function(bbl,resetForm){
this._base.style.display=bbl._visible?'block':'none';
if(!bbl._visible)return;
if(resetForm){
this._title.innerHTML=bbl.title;
this._content=replaceHtml(this._content,bbl.content);
if(iq_l)this._content.innerHTML+='<input type="hidden" name="listingCode" value="'+iq_l+'"/>';
};
this._error.innerHTML=bbl._errorMsg;
this._controls.className=bbl._loading?"loading":(bbl.formAction?"":"hidden");
$('#editLink').remove();
if(bbl._edit==true){
var editLink='<span id="editLink"><a href="#" onclick="bubble._close(); listingEdit.show(); return false;">'+$editLinkText+'</a></span>';
$('#bubbleControls').append(editLink);
}
this._base.style.width=bbl.width+'px';
this._form.style.width=bbl.width-59+'px';
var h=this._form.offsetHeight+19;
this._base.style.height=h+'px';
if(bbl._tailSide=="right"){
this._form.style.left='15px';
this._closeBtn.style.right='42px';
}else{
this._form.style.left='45px';
this._closeBtn.style.right='12px';
};
var shape=new yoolk.Shape(bbl.width,h,bbl._tailSide);
shape.draw($('#bubbleBg'));
this._base.style.left=bbl._x+'px';
this._base.style.top=bbl._y+'px';
}
BubbleRenderer.prototype.toggleOverlay=function(show){
var o=this._overlay;
var h=$('html')[0].style;
if(show){
this.setOverlaySize();
window.onresize=function(){setScreenClass();bubble._update();};
o.style.display='block';
}else{
h.overflowX='auto';
window.onresize=function(){setScreenClass();};
o.style.display='none';
}
};
BubbleRenderer.prototype.setOverlaySize=function(){
var o=this._overlay;
var pz=getPageSize();
o.style.width=pz[0]+'px';
o.style.height=pz[1]+'px';
};
BubbleRenderer.prototype.validateForm=function(){
var btn=document.getElementById('bubbleOk');
btn.className=btn.disabled=(getFormValues(this._form))?"":"disabled";
};
function BubbleTxtBox(label,id,rows,text){
if(id[0]=="_")label+='&nbsp;<span class="r">*</span>';
this._label=label;
this._id=id;
this._rows=rows;
this._text=(text)?text:"";
};
BubbleTxtBox.prototype.toString=function(){
var en=["onfocus","onblur","onchange","onclick","onkeypress"];
var txt=this._text;
var ee=(txt=="")?null:["if(this.value==\'"+txt+"\')this.value=\'\';","if(!this.value)this.value=\'"+txt+"\';"];
var evn=GetTxtBoxEvents(ee);
var c="<tr>";
c+='<th><label for="'+this._id+'">'+this._label+'</label></th>';
var id=' name="'+this._id+'" id="'+this._id+'"';
if(this._rows){
c+='<td><textarea rows="'+this._rows+'" cols="30"'+id+evn+'>'+txt+'</textarea></td>';
}else{
c+='<td><input type="text" class="txt" value="'+txt+'"'+id+evn+' /></td>';
};
return c+'</tr>';
};
function GetTxtBoxEvents(ee){
var en=["onfocus","onblur","onchange","onclick","onkeypress"];
var evn="";
for(var i=0;i<en.length;i++){
evn+=' '+en[i]+'="';
if(ee&&i<=ee.length)evn+=ee[i];
if(en[i]=="onblur"){evn+="this.className='txt';";}
else{evn+="this.className='txt focus';";}
evn+='bubble.freeze();"';
}
return evn;
}
function BubbleDropdown(label,id){
this._label=label;
this._id=id;
}
BubbleDropdown.prototype.toString=function(){
var c='<tr><th><label for="'+this._id+'">'+this._label+'</label></th>';
c+='<td><select>';
c+='<option>Select</option>';
c+='</select><td></tr>';
return c;
};
Bubble.prototype.showImageGallery=function(el,title,img,width,height){
this.title=title;
this.width=width+60;
this.height=height;
this.content='<p style="text-align:center;" class="loading"><a href="#"><img src="'+img+'"'+' width="'+width+'"'+' height="'+height+'"'+'/></a></p>';
this._render(true);
this.show(el,null,null,45);
};var popup;
$(document).ready(function(){
initPopup();
})
function initPopup(){
if(!popup)popup=new PopUp();
}
function PopUp(){
this._init();
}
PopUp.prototype._init=function(){
this._renderer=new PopUpRenderer();
this.width=200;
this.title="";
this.content="";
this._errorMsg="";
this._loading=false;
this.formAction=null;
this.onSubmitSuccess=null;
}
PopUp.prototype.close=function(){
this._loading=false;
this.formAction=null;
this.onSubmitSuccess=null;
this._errorMsg="";
this._renderer.hide();
}
PopUp.prototype.submit=function(){
var d=getFormValues(document.getElementById("popupForm"));
var f=function(x){popup.onSubmit(x);};
var a=new Ajax(this.formAction,f,null,d);
var btn=document.getElementById('popupOk');
btn.className=btn.disabled=true?"disabled":"";
return false;
};
PopUp.prototype.onSubmit=function(x){
this.showThanks($reviewYourListing);
};
PopUp.prototype.showThanks=function(s){
this.title=$thankYou;
this.width=280;
this.height=35;
this._errorMsg="";
this.content='<p style="text-align:center;">'+s+'</p>';
this._renderer.show(this);
$('#popupCloseBtn').addClass('hidden');
setTimeout(function(){popup.close();},2000);
};
PopUp.prototype.showListingEdit=function(){
this.title=$editListingTitle;
this.width=490;
this.height=545;
this.formAction="managelisting.yolx";
var u=ROOT+iq_l+',listingEditGuideLine.json';
var imageClass="image3";
c="<table id='editListing' style='width:40%;'><tbody>";
c+="<tr><td colspan='2'><div class='image1'>"+$keywords+"</div>";
c+="<div id='keywordTool'><a href='https://adwords.google.com/select/KeywordToolExternal' style='text-decoration:underline;' target='_blank'>"+$discoverKeyword+"</a></div></td></tr>";
c+="<tr><td colspan='2'><textarea id='keyword' name='keyword' class='txt' rows='2' cols='58' onkeyup='popup.validListingEditForm();' onclick='popup.validListingEditForm();' onselect='popup.validListingEditForm();' "+GetPopUpTxtBoxEvents()+"></textarea></td></tr>";
c+="<tr><td  colspan='2'><div class='image2'>"+$listingInfo+"</div>";
c+="<div id='goodListing'><a href='./GoodListing/' style='text-decoration:underline;' onclick='return popupWindow(\""+ROOT+LANG+"/GoodListing/\");'>"+$secretListing+"</a></div></td></tr>";
c+="<tr><td colspan='2'>";
c+="<div class='textareaControl'><textarea id='listingInfo' name='listingInfo' class='txt' rows='13' cols='58' "+GetPopUpTxtBoxEvents()+"></textarea>";
c+="</div></td></tr>";
if(hasMap){
c+="<tr><td colspan='2'><div class='image3'>"+$location+"</div></td></tr>";
c+="<tr><td colspan='2'><input id='txtAddressEdit' type='text' size='40' />&nbsp;&nbsp;<input id='btnFindLocationEdit' type='button' value='"+$findLocation+"' /></td></tr>";
c+="<tr><td colspan='2'><div id='mapListingEdit'></div></td></tr>";
c+="<input name='Lat' id='txtLatEdit' type='hidden' /><input name='Lng' id='txtLngEdit' type='hidden' /><input name='Zoom' id='txtZoomEdit' type='hidden' />";
imageClass="image4";
this.height=910;
}
c+="<tr><td colspan='2'><div class='"+imageClass+"'>"+$subscribeAndSubmit+"</div></td></tr>";
c+="<tr><td colspan='2' style='padding-left:10px'>";
c+='<p><input type="checkbox" id="report" name="report" value="'+$statisticAndHealthReports+'" /> <label for="report">'+$statisticAndHealthReports+'</label></p>';
c+='<p><input type="checkbox" id="notifyEmail" name="notifyEmail" value="'+$notifyMe+'" /> <label for="notifyEmail">'+$notifyMe+'</label></p>';
c+='<p><input type="checkbox" id="ownerListing" name="ownerListing" value="'+$ownerListing+'" /> <label for="ownerListing">'+$ownerListing+'</label></p>';
c+="</td></tr>";
c+='<tr><td style="padding:2px 10px 5px 0pt;width:20%;"><label for="yourName">'+$yourName+' </label></td><td><input type="text" class="txt" id="yourName" name="yourName" '+GetPopUpTxtBoxEvents()+'/></td>';
c+='</tr><tr>';
c+='<td style="padding:2px 10px 5px 0pt;width:20%;"><label for="email">'+$email+' <span class="r">*</span> </td><td></label><input type="text" class="txt" id="listingEditEmail" name="email" onkeyup="popup.validListingEditForm();" onclick="popup.validListingEditForm();" onselect="popup.validListingEditForm();"  '+GetPopUpTxtBoxEvents()+'/></td>';
c+='</tr></tbody></table>';
c+='<input type="hidden" name="subject" value="Edit Listing"/>';
c+='<input type="hidden" name="code" value="'+iq_l+'"/>';
c+='<input type="hidden" name="websiteUrl" value="'+location.href+'"/>';
popup.content=c;
this._loading=true;
popup._renderer.show(popup,true);
$.getJSON(u,function(x){
$('#keyword').val(x.listingKeyword);
$('#listingInfo').val(x.listingGuideLine);
$('#popupControls').removeClass('loading');
$('#popupCancel').removeClass('hidden');
$('#popupOk').removeClass('hidden');
});
};
PopUp.prototype.validListingEditForm=function(){
var btn=document.getElementById('popupOk');
if(isEmail($("#listingEditEmail").val())&&$("#keyword").val()!="")
{
btn.className=btn.disabled="";
}
else{
btn.className=btn.disabled="disabled";
}
};
PopUp.prototype.showImage=function(title,img,width,height){
this.width=width;
this.height=height;
if(img.substr(0,1)=="/")img=ROOT+img.substr(1);
this.title=title;
this.content='<p class="loading"><img src="'+img+'" width="'+width+'" height="'+height+'" /></p>';
$('#popupForm').width('auto');
this._renderer.show(this);
};
PopUp.prototype.showVideo=function(title,script){
this.width=425;
this.height=344;
this.title=title;
this.content='<p class="loading">'+script+'</p>';
$('#popupForm').width('auto');
this._renderer.show(this);
};
PopUp.prototype.showLargeMap=function(){
var gIcon=new GIcon(G_DEFAULT_ICON);
gIcon.image="styles/marker-green.gif";
var map=new GMap2(document.getElementById('map_popup'),{size:new GSize(this.width,this.height)});
map.addControl(new GLargeMapControl());
var latlng=new GLatLng(this._mapLat,this._mapLong);
map.setCenter(latlng,this._mapZoom);
var marker=new GMarker(latlng,{icon:gIcon});
map.addOverlay(marker);
var listingInfo="<p><span class='name'>"+this._listingName+"</span></p><p><strong>"+$address+": </strong>"+this._listingAddress+"</p>";
marker.openInfoWindowHtml(listingInfo);
marker.bindInfoWindowHtml(listingInfo);
};
PopUp.prototype.showMap=function(title,name,address,lat,lng,zoom){
this.width=600;
this.height=450;
this.title=title;
this.content='<div id="map_popup" style="width:'+this.width+'px; height:'+this.height+'px"><p class="loading"></p></div>';
$('#popupForm').width('auto');
this._renderer.show(this);
this._mapLat=lat;
this._mapLong=lng;
this._mapZoom=zoom;
this._listingName=name;
this._listingAddress=address;
if(!window['GMap2'])
loadMapScript("popup.showLargeMap");
else
this.showLargeMap();
};
function PopUpRenderer(){this._init();};
PopUpRenderer.prototype._init=function(){
this._base=ce("div","popup");
this._base.appendChild(ce("div","popupBg"));
this._closeBtn=ce("p","popupClose",null,'<a href="/" onclick="popup.close();return false;">[x]</a>');
this._base.appendChild(this._closeBtn);
this._form=ce("form","popupForm");
this._form.onsubmit=function(){return popup.submit();};
this._title=ce("h3","popupTitle");
this._content=ce("div","popupContent");
this._controls=ce("div","popupControls",null,'<input type="button" value="'+$close+'" id="popupCloseBtn" onclick="popup.close()" />');
this._form.appendChild(this._title);
this._form.appendChild(this._content);
this._form.appendChild(this._controls);
this._base.appendChild(this._form);
this._height=0;
var bd=$('body')[0];
bd.appendChild(this._base);
}
PopUpRenderer.prototype.show=function(pup,resetForm){
var w=pup.width+20;
var h=pup.height+90;
this._title.innerHTML=pup.title;
this._base.style.width=w+'px';
this._base.style.marginLeft=(-w/2)+'px';
var pageH=getPageSize()[1];
var windowHeight=getWindowSize().height;
this._top=windowHeight/2+getScrollTop();
this._base.style.top=this._top+'px';
this._content.innerHTML=pup.content;
$("div#popupControls").remove();
if(resetForm){
this._controls=ce("div","popupControls",null,'<input type="button" value="'+$cancelButtonText+'" id="popupCancel" onclick="popup.close()" class="hidden" /> <input type="submit" value="'+$okButtonText+'" id="popupOk" disabled="disabled" class="disabled hidden" />');
}else{
this._controls=ce("div","popupControls",null,'<input type="button" value="'+$close+'" id="popupCloseBtn" onclick="popup.close()" />');
}
$("#popupContent").after(this._controls);
this._controls.className=pup._loading?"loading":"";
var shape=new yoolk.Shape(w,h);
shape.draw($('#popupBg'));
document.getElementById('popupBg').style.height=h+'px';
this._content.style.height=pup.height+'px';
this._revealing=setInterval(function(){popup._renderer.reveal(h);},50);
bubble._renderer.toggleOverlay(true);
}
PopUpRenderer.prototype.reveal=function(maxHeight){
this._base.style.display='block';
if(this._height<maxHeight){
this._height+=50;
var top=this._top-25;
if(top>=0)this._top-=25;
}else{
this._height=maxHeight;
clearInterval(this._revealing);
}
this._update();
}
PopUpRenderer.prototype._update=function(){
var newHeight=(this._height>100)?this._height-100:0;
this._content.style.height=newHeight+'px';
this._base.style.top=this._top+'px';
}
PopUpRenderer.prototype.hide=function(pup){
bubble._renderer.toggleOverlay(false);
this._height=0;
this._base.style.display='none';
}
PopUpRenderer.prototype.validateForm=function(){
var btn=document.getElementById('popupOk');
btn.className=btn.disabled=(getFormValues(this._form))?"":"disabled";
};
function GetPopUpTxtBoxEvents(ee){
var en=["onfocus","onblur"];
var evn="";
for(var i=0;i<en.length;i++){
evn+=' '+en[i]+'="';
if(ee&&i<=ee.length)evn+=ee[i];
if(en[i]=="onblur"){evn+="this.className='txt';";}
else{evn+="this.className='txt focus';";}
evn+='bubble.freeze();"';
}
return evn;
}
PopUp.prototype.showListingStats=function(data){
this.title=$listingStatistics;
this.width=545;
this.height=545;
var monthString=['','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var calcHieght=function(actualNumber,maxNumber){
return Math.round((actualNumber/maxNumber)*100);
}
c="<div id=\"graphStats\">";
c+="<div class=\"graph\">";
c+="<p> "+$totalVisits+" "+data.AllTimeViewCount+"</p>";
c+="<table class=\"bargraphVertical\">";
c+="<tbody><tr>";
var byYearlyLen=data.yearly.length;
var byTwelveMonthLen=data.twelveMonth.length;
var maxViewByYearly=0;
var maxViewByTwelveMonth=0;
var totalViewByTwelveMonth=0;
for(var i=0;i<byYearlyLen;i++){
if(maxViewByYearly<data.yearly[i].ViewCount)
maxViewByYearly=data.yearly[i].ViewCount;
}
for(var i=0;i<byYearlyLen;i++){
c+="<td align=\"center\">"+data.yearly[i].ViewCount+"<img src=\"styles/column.gif\" alt=\""+data.yearly[i].ViewCount+"\" width=\"35\" height=\""+calcHieght(data.yearly[i].ViewCount,maxViewByYearly)+"\"></td>";
}
c+="</tr></tbody>";
c+="<tfoot><tr>";
for(var i=0;i<byYearlyLen;i++){
c+="<th align=\"center\">"+data.yearly[i].Year+"</th>";
}
c+="</tr></tfoot>";
c+="</table>";
c+="</div>";
for(var i=0;i<byTwelveMonthLen;i++){
totalViewByTwelveMonth=totalViewByTwelveMonth+data.twelveMonth[i].ViewCount;
if(maxViewByTwelveMonth<data.twelveMonth[i].ViewCount)
maxViewByTwelveMonth=data.twelveMonth[i].ViewCount;
}
c+="<div class=\"graph\">";
c+="<p> "+$last12MonthTotal+" "+totalViewByTwelveMonth+"</p>";
c+="<table class=\"bargraphVertical\">";
c+="<tbody><tr>";
for(var i=0;i<byTwelveMonthLen;i++){
c+="<td align=\"center\">"+data.twelveMonth[i].ViewCount+"<img src=\"styles/column.gif\" alt=\""+data.twelveMonth[i].ViewCount+"\" width=\"35\" height=\""+calcHieght(data.twelveMonth[i].ViewCount,maxViewByTwelveMonth)+"\"></td>";
}
c+="</tr></tbody>";
c+="<tfoot><tr>";
for(var i=0;i<byTwelveMonthLen;i++){
c+="<th align=\"center\">"+monthString[data.twelveMonth[i].Month]+" "+data.twelveMonth[i].Year+"</th>";
}
c+="</tr></tfoot>";
c+="</table>";
c+="</div>";
c+="<p> "+$tatalEmailClicks+" "+data.AllTimeEmailClick+"</p>";
c+="<p> "+$tatalWebsiteClicks+" "+data.AllTimeWebsiteClick+"</p>";
if(data.classificatiionStats){
for(var i=0;i<data.classificatiionStats.length;i++){
if(data.classificatiionStats[i]){
var maxViewByClassfication=0;
for(var j=0;j<byTwelveMonthLen;j++){
if(maxViewByClassfication<data.classificatiionStats[i][j].ViewCount)
maxViewByClassfication=data.classificatiionStats[i][j].ViewCount;
}
c+="<div class=\"graph\">";
c+="<table class=\"bargraphVertical\"><CAPTION>"+$viewFor+" "+data.classificatiionStats[i][0].ClassificationName+" "+$classification+"</CAPTION>";
c+="<tbody><tr>";
for(var k=0;k<data.classificatiionStats[i].length;k++){
c+="<td  align=\"center\">"+data.classificatiionStats[i][k].ViewCount+"<img src=\"styles/column.gif\" alt=\""+data.classificatiionStats[i][k].ViewCount+"\" width=\"35\" height=\""+calcHieght(data.classificatiionStats[i][k].ViewCount,maxViewByClassfication)+"\"></td>";
}
c+="</tr></tbody>";
for(var k=0;k<data.classificatiionStats[i].length;k++){
c+="<th>"+monthString[data.classificatiionStats[i][k].Month]+" "+data.classificatiionStats[i][k].Year+"</th>";
}
c+="</tr></tfoot>";
c+="</table>";
c+="</div>";
}
}
}
c+="<div id=\"topPerformers\">";
c+="<p><strong>"+$top5Performers+"</strong></p>";
if(data.topListing){
var maxListingCount=data.topListing.length;
for(var i=0;i<maxListingCount;i++){
var listingUrl=ROOT+localizeUrl($searchUrl)+'/?q=%23'+data.topListing[i].Code+'%23';
c+="<p><a href=\"javascript:void(0)\" onclick=\"window.location='"+listingUrl+"'\">"+data.topListing[i].Name+"</a><span> "+$totalVisits+" "+data.topListing[i].ViewCount+"</span></p>";
}
}
c+="</div>";
c+="</div>";
popup.content=c;
popup._renderer.show(popup,true);
};
var tooltip;
$(document).ready(function(){
if(!tooltip)tooltip=new Tooltip();
})
function Tooltip(){
this._init();
};
Tooltip.prototype._init=function(){
this._renderer=new TooltipRenderer();
this._tailSide="left";
this.width=150;
this.content="";
this._x=0;
this._y=0;
this._visible=false;
};
Tooltip.prototype.showListingInfo=function(caller){
this.width=130;
this.content='<p>'+$clickEditListing+'</p>';
this.show(caller);
};
Tooltip.prototype.hide=function(){
if(!this._frozen)
tooltip._close();
};
Tooltip.prototype.show=function(caller,xMod,yMod){
xMod=xMod||0;
yMod=yMod||0;
if(caller){
clearTimeout(this._hiding);
if(arguments.length==1)xMod=0;
this._visible=true;
var callerXY=xy(caller);
var pageWidth=getPageSize()[0];
if(callerXY[0]>pageWidth-this.width-caller.offsetWidth){
this._x=callerXY[0]-this.width;
this._tailSide="right";
}else{
this._x=callerXY[0]+caller.offsetWidth+xMod;
this._tailSide="left";
};
this._y=callerXY[1]-15+yMod;
};
this._render(true);
};
Tooltip.prototype._render=function(resetForm){
this._renderer.render(this,resetForm);
};
Tooltip.prototype._update=function(){
this._renderer.setOverlaySize();
};
Tooltip.prototype._close=function(){
this._visible=false;
this._renderer.toggleOverlay(false);
this._render();
};
function TooltipRenderer(){this.init();};
TooltipRenderer.prototype.init=function(){
this._base=ce("div","tooltip");
this._base.onmouseover=function(){clearTimeout(tooltip._hiding);};
this._base.onmouseout=function(){tooltip.hide();};
this._base.appendChild(ce("div","tooltipBg",null,this._noFlash));
this._form=ce("form","tooltipForm");
this._content=ce("div","tooltipContent");
this._form.appendChild(this._content);
this._base.appendChild(this._form);
this._overlay=ce('a','overlay');
var bd=$('body')[0];
bd.appendChild(this._base);
};
TooltipRenderer.prototype.render=function(bbl,resetForm){
this._base.style.display=bbl._visible?'block':'none';
if(!bbl._visible)return;
if(resetForm){
this._content=replaceHtml(this._content,bbl.content);
};
this._base.style.width=bbl.width+'px';
this._form.style.width=bbl.width-15+'px';
var h=this._form.offsetHeight+13;
this._base.style.height=h+'px';
var shape=new yoolk.Shape(bbl.width,h,bbl._tailSide,15);
shape.draw($('#tooltipBg'));
this._base.style.left=bbl._x+'px';
this._base.style.top=bbl._y+'px';
}
TooltipRenderer.prototype.toggleOverlay=function(show){
var o=this._overlay;
var h=$('html')[0].style;
if(show){
this.setOverlaySize();
window.onresize=function(){setScreenClass();tooltip._update();};
o.style.display='block';
}else{
h.overflowX='auto';
window.onresize=function(){setScreenClass();};
o.style.display='none';
}
};
TooltipRenderer.prototype.setOverlaySize=function(){
var o=this._overlay;
var pz=getPageSize();
o.style.width=pz[0]+'px';
o.style.height=pz[1]+'px';
};
Tooltip.prototype.showImageGallery=function(caller,caption,imageUrl,width,height){
this.width=width+50;
this.content="<p style=\"text-align:center;\">"+caption+"</p>";
this.content+='<p style="text-align:center;" class="loading"><a href="#"><img src="'+imageUrl+'"'+' width="'+width+'"'+' height="'+height+'"'+'/></a></p>';
this.show(caller,0,45);
};
var squigle={};
squigle.getAdapter=function(){
return squigle._adaptor;
};
squigle.preserveDecimals=false;
squigle.setAdapter=function(adaptor,preserveDecimals){
squigle._adaptor=adaptor;
if(typeof preserveDecimals=='boolean'){
squigle.preserveDecimals=preserveDecimals;
}
squigle.Point=adaptor.Point;
squigle.Size=adaptor.Size;
};
squigle.Canvas=function(size,coordSize,coordOrigin){
coordSize=coordSize||size;
coordOrigin=coordOrigin||new squigle.Point();
var _adaptor=squigle.getAdapter();
var _canvas=this._canvasDependancy||new _adaptor.Canvas(size,coordSize,coordOrigin);
var _node=_canvas.node();
var _container=_canvas.container();
this.append=function(shape){
_canvas.append(shape);
return shape.node();
};
this.remove=function(shape){
return _canvas.node().removeChild(shape.node());
};
this.node=function(){
return _node;
};
this.container=function(){
return _container;
};
this.preserveDecimals=function(){
return _preserveDecimals;
};
this.scale=function(resolution){
_canvas.scale(resolution);
};
};
squigle.Canvas.prototype={
_canvasDependancy:null
};
squigle.Rectangle=function(size,point,stroke,fill){
var _adaptor=squigle.getAdapter();
var _rectangle=this._rectangleDependancy||new _adaptor.Rectangle(size,point,stroke,fill);
this.node=function(){
return _rectangle.node();
};
this.stroke=function(){
return _rectangle.stroke();
};
};
squigle.Rectangle.prototype={
_rectangleDependancy:null
};
squigle.Path=function(stroke,fill){
var _adaptor=squigle.getAdapter();
var _path=this._pathDependancy||new _adaptor.Path(stroke,fill);
this.node=function(){
return _path.node();
};
this.stroke=function(){
return _path.stroke();
};
this.moveTo=function(point,relative){
_path.moveTo(point,relative);
return this;
};
this.lineTo=function(point,relative){
_path.lineTo(point,relative);
return this;
};
this.curveTo=function(controlPoint1,controlPoint2,endPoint,relative){
_path.curveTo(controlPoint1,controlPoint2,endPoint,relative);
return this;
};
this.roundTo=function(r,dir){
var R=.5522*r;
var o=_path;
var actions={
l:function(){
return{
u:function(){
o.curveTo(new squigle.Point(-R,0),new squigle.Point(-r,-(r-R)),new squigle.Point(-r,-r),true);
},
d:function(){
o.curveTo(new squigle.Point(-R,0),new squigle.Point(-r,r-R),new squigle.Point(-r,r),true);
}
};
},
r:function(){
return{
u:function(){
o.curveTo(new squigle.Point(R,0),new squigle.Point(r,-(r-R)),new squigle.Point(r,-r),true);
},
d:function(){
o.curveTo(new squigle.Point(R,0),new squigle.Point(r,r-R),new squigle.Point(r,r),true);
}
};
},
u:function(){
return{
r:function(){
o.curveTo(new squigle.Point(0,-R),new squigle.Point(-(R-r),-r),new squigle.Point(r,-r),true);
},
l:function(){
o.curveTo(new squigle.Point(0,-R),new squigle.Point(R-r,-r),new squigle.Point(-r,-r),true);
}
};
},
d:function(){
return{
r:function(){
o.curveTo(new squigle.Point(0,R),new squigle.Point(-(R-r),r),new squigle.Point(r,r),true);
},
l:function(){
o.curveTo(new squigle.Point(0,R),new squigle.Point(R-r,r),new squigle.Point(-r,r),true);
}
};
}
};
actions[dir.charAt(0)]()[dir.charAt(1)]();
return this;
};
this.close=function(){
_path.close();
return this;
};
this.clear=function(){};
};
squigle.Path.prototype={
_pathDependancy:null
};
squigle.Fill=function(color,opacity){
this.color=function(){
return color||"#FFFFFF";
};
this.opacity=function(){
if(typeof opacity=="number"){
return opacity;
}
return 100;
};
};
squigle.Stroke=function(color,opacity,size,endcap,linejoin,dash){
this.color=function(){
return color||"#000000";
};
this.opacity=function(){
if(typeof opacity=="number"){
return opacity;
}
return 100;
};
this.size=function(){
return size||1;
};
this.endcap=function(){
return endcap||"round";
};
this.linejoin=function(){
return linejoin||"round";
};
this.dash=function(){
return dash||"solid";
};
};
squigle.svgAdapter={};
squigle.svgAdapter.Point=function(x,y){
this.x=function(){
return x||0;
};
this.y=function(){
return y||0;
}
};
squigle.svgAdapter.Size=function(width,height){
this.width=function(){
return width;
};
this.height=function(){
return height;
};
};
squigle.svgAdapter.Canvas=function(size,coordSize,coordOrigin){
var _pixelResolution=(function(){
var coordDiameter=(coordSize.width()>coordSize.height())?coordSize.width():coordSize.height();
var canvasDiamter=(size.width()>size.height())?size.width():size.height();
return coordDiameter/canvasDiamter;
})();
var _container=document.createElement("div");
_container.style.width=size.width()+"px";
_container.style.height=size.height()+"px";
var _canvasDiameter=(coordSize.width()>coordSize.height())?coordSize.width():coordSize.height();
var _node=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");
_node.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");
_node.setAttribute("width",size.width()+"px");
_node.setAttribute("height",size.height()+"px");
_node.setAttribute("viewBox",[coordOrigin.x(),coordOrigin.y(),coordSize.width(),coordSize.height()].join(" "));
_container.appendChild(_node);
this.container=function(){
return _container;
};
this.append=function(shape){
_node.setAttribute("stroke-width",Math.round(shape.stroke().size()*_pixelResolution)+"px");
_node.appendChild(shape.node());
};
this.node=function(){
return _node;
};
this.scale=function(resolution){
_container.style.width=parseInt(_container.style.width)*resolution+"px";
_container.style.height=parseInt(_container.style.width)*resolution+"px";
_node.setAttribute("width",parseInt(_node.style.width)*resolution+"px");
_node.setAttribute("height",parseInt(_node.style.height)*resolution+"px");
};
};
squigle.svgAdapter.Rectangle=function(size,point,stroke,fill){
var _node=(
function(){
var node=document.createElementNS("http://www.w3.org/2000/svg","rect");
point=point||new squigle.Point();
node.setAttribute("width",size.width()+"px");
node.setAttribute("height",size.height()+"px");
node.setAttribute("x",point.x()+"px");
node.setAttribute("y",point.y()+"px");
stroke=stroke||new squigle.Stroke();
fill=fill||new squigle.Fill();
node.setAttribute("stroke-width",stroke.size()+"px");
node.setAttribute("stroke",stroke.color());
node.setAttribute("stroke-opacity",stroke.opacity()/100);
node.setAttribute("fill",fill.color());
node.setAttribute("fill-opacity",fill.opacity()/100);
return node;
}
)();
this.node=function(){
return _node;
};
this.stroke=function(){
return stroke;
};
};
squigle.svgAdapter.Path=function(stroke,fill){
var _path="";
var _node=(
function(){
var node=document.createElementNS("http://www.w3.org/2000/svg","path");
node.setAttribute("d",_path);
stroke=stroke||new squigle.Stroke();
fill=fill||new squigle.Fill();
var _endcap=(stroke.endcap()=="flat")?"butt":stroke.endcap();
var _dasharray={
solid:"none",
shortdash:[3,1],
shortdot:[1,1],
shortdashdot:[3,1,1,1],
shortdashdotdot:[3,1,1,1,1,1],
dot:[1,3],
dash:[4,3],
longdash:[8,3],
dashdot:[4,3,1,3],
longdashdot:[8,3,1,3],
longdashdotdot:[8,3,1,3,1,3]
};
var _dash=_dasharray[stroke.dash()];
if(_dash instanceof Array){
for(var i=0;i<_dash.length;i++){
_dash[i]*=stroke.size();
}
if(_endcap!="butt"){
for(var i=0;i<_dash.length;i+=2){
_dash[i]-=stroke.size();
if(_dash[i]<1){_dash[i]=1;}
}
for(var i=1;i<_dash.length;i+=2){
_dash[i]+=stroke.size();
}
}
_dash=_dash.join(",");
}
node.setAttribute("stroke",stroke.color());
node.setAttribute("stroke-opacity",stroke.opacity()/100);
node.setAttribute("stroke-linecap",_endcap);
node.setAttribute("stroke-linejoin",stroke.linejoin());
node.setAttribute("stroke-dasharray",_dash);
node.setAttribute("fill",fill.color());
node.setAttribute("fill-opacity",fill.opacity()/100);
return node;
}
)();
this.node=function(){
return _node;
};
this.stroke=function(){
return stroke;
};
this.moveTo=function(point,relative){
var letter=(relative)?"m":"M";
_path+=" "+letter+" "+point.x()+","+point.y();
_node.setAttribute("d",_path);
};
this.lineTo=function(point,relative){
var letter=(relative)?"l":"L";
_path+=" "+letter+" "+point.x()+","+point.y();
_node.setAttribute("d",_path);
};
this.curveTo=function(controlPoint1,controlPoint2,endPoint,relative){
var letter=(relative)?"c":"C";
_path+=" "+letter+" "+controlPoint1.x()+","+controlPoint1.y()+" "+controlPoint2.x()+","+controlPoint2.y()+" "+endPoint.x()+","+endPoint.y();
_node.setAttribute("d",_path);
};
this.close=function(){
_path+=" Z";
_node.setAttribute("d",_path);
};
this.clear=function(){};
};
squigle.vmlAdapter={};
squigle.vmlAdapter._stroke=function(stroke){
var node=document.createElement("v:stroke");
node.setAttribute("color",stroke.color());
node.setAttribute("opacity",stroke.opacity()+"%");
node.setAttribute("weight",stroke.size()+"px");
node.setAttribute("endcap",stroke.endcap());
node.setAttribute("joinstyle",stroke.linejoin());
node.setAttribute("dashstyle",stroke.dash());
return node;
};
squigle.vmlAdapter._fill=function(fill){
var node=document.createElement("v:fill");
node.setAttribute("color",fill.color());
node.setAttribute("opacity",fill.opacity()+"%");
return node;
};
if(document.namespaces&&!document.namespaces.olv){
window.onload=function(){
document.namespaces.add("v","urn:schemas-microsoft-com:vml");
var style=document.createStyleSheet();
style.addRule('v\\:*',"behavior: url(#default#VML); "+"position: absolute; display: inline-block;");
}
}
squigle.vmlAdapter.Point=function(x,y){
this.x=function(){
if(squigle.preserveDecimals){
return x*65536||0;
}
return Math.round(x)||0;
};
this.y=function(){
if(squigle.preserveDecimals){
return y*65536||0;
}
return Math.round(y)||0;
}
};
squigle.vmlAdapter.Size=function(width,height){
this.width=function(){
if(squigle.preserveDecimals){
return width*65536;
}
return Math.round(width);
};
this.height=function(){
if(squigle.preserveDecimals){
return height*65536;
}
return Math.round(height);
};
};
squigle.vmlAdapter.Canvas=function(size,coordSize,coordOrigin){
var _nonBinaryScaleWidth=(squigle.preserveDecimals)?size.width()/65536:size.width();
var _nonBinaryScaleHeight=(squigle.preserveDecimals)?size.height()/65536:size.height();
var _container=document.createElement("div");
_container.style.width=_nonBinaryScaleWidth+"px";
_container.style.height=_nonBinaryScaleHeight+"px";
var _clip=document.createElement("div");
_clip.style.width=_nonBinaryScaleWidth+"px";
_clip.style.height=_nonBinaryScaleHeight+"px";
_clip.style.position="absolute";
_clip.style.clip="rect(0px "+_nonBinaryScaleWidth+"px "+_nonBinaryScaleHeight+"px 0px)";
var _canvasDiameter=(coordSize.width()>coordSize.height())?coordSize.width():coordSize.height();
var _node=document.createElement("v:group");
_node.style.width=_nonBinaryScaleWidth+"px";
_node.style.height=_nonBinaryScaleHeight+"px";
_node.setAttribute("coordorigin",coordOrigin.x()+","+coordOrigin.y());
_node.setAttribute("coordsize",coordSize.width()+","+coordSize.height());
_container.appendChild(_clip);
_clip.appendChild(_node);
this.container=function(){
return _container;
};
this.append=function(shape){
_node.appendChild(shape.node());
};
this.scale=function(resolution){
_container.style.width=parseInt(_container.style.width)*resolution+"px";
_container.style.height=parseInt(_container.style.width)*resolution+"px";
_node.setAttribute("width",parseInt(_node.style.width)*resolution+"px");
_node.setAttribute("height",parseInt(_node.style.height)*resolution+"px");
_clip.setAttribute("width",parseInt(_clip.style.width)*resolution+"px");
_clip.setAttribute("height",parseInt(_clip.style.height)*resolution+"px");
};
this.node=function(){
return _node;
};
};
squigle.vmlAdapter.Rectangle=function(size,point,stroke,fill){
var _node=(
function(size){
var node=document.createElement("v:rect");
node.style.setAttribute("width",size.width()+"px");
node.style.setAttribute("height",size.height()+"px");
node.style.position="absolute";
node.style.left=point.x()+"px";
node.style.top=point.y()+"px";
stroke=stroke||new squigle.Stroke();
fill=fill||new squigle.Fill();
node.appendChild(squigle.vmlAdapter._stroke(stroke));
node.appendChild(squigle.vmlAdapter._fill(fill));
node.setAttribute("fillcolor",fill.color());
return node;
}
)(size);
this.node=function(){
return _node;
};
this.stroke=function(){
return stroke;
};
};
squigle.vmlAdapter.Path=function(stroke,fill){
var _path="";
var _currentPosition=new squigle.Point();
var _node=(
function(){
var node=document.createElement("v:shape");
node.style.position="absolute";
node.style.width="100%";
node.style.height="100%";
stroke=stroke||new squigle.Stroke();
fill=fill||new squigle.Fill();
node.appendChild(squigle.vmlAdapter._stroke(stroke));
node.appendChild(squigle.vmlAdapter._fill(fill));
node.setAttribute("fillcolor",fill.color());
return node;
}
)();
this.node=function(){
return _node;
};
this.stroke=function(){
return stroke;
};
this.moveTo=function(point,relative){
var letter=(relative)?"t":"m";
_path+=" "+letter+" "+point.x()+","+point.y();
_node.setAttribute("path",_path);
_currentPosition=point;
};
this.lineTo=function(point,relative){
var letter=(relative)?"r":"l";
_path+=" "+letter+" "+point.x()+","+point.y();
_node.setAttribute("path",_path);
_currentPosition=point;
};
this.curveTo=function(controlPoint1,controlPoint2,endPoint,relative){
var letter=(relative)?"v":"c";
_path+=" "+letter+" "+controlPoint1.x()+","+controlPoint1.y()+" "+controlPoint2.x()+","+controlPoint2.y()+" "+endPoint.x()+","+endPoint.y();
_node.setAttribute("path",_path);
_currentPosition=endPoint;
};
this.close=function(){
_path+=" x";
_node.setAttribute("path",_path);
};
this.clear=function(){};
};
var isMsie=/msie/.test(navigator.userAgent.toLowerCase())&&!/opera/.test(navigator.userAgent.toLowerCase());
if(isMsie){
squigle.setAdapter(squigle.vmlAdapter);
}else{
squigle.setAdapter(squigle.svgAdapter);
}
yoolk.Shape=function(width,height,tailSide,aboveTailHeight){
var _round=8;
var _aboveTailHeight=aboveTailHeight||25;
var _tailWidth=31;
var _tailHeight=15;
var _borderSize=1;
var _borderColor="#ccc";
var _bgColor="#fff";
var _tailSide=tailSide;
if(!tailSide)
_tailWidth=0;
var _height=height-(_round*2);
var _width=width-_tailWidth-(_round*2);
this.draw=function(el){
var canvasSize=calculateCanvasSize();
var canvas=new squigle.Canvas(new squigle.Size(canvasSize[0],canvasSize[1]));
var shape=createShape();
canvas.append(shape);
with(canvas.node().style){
position="absolute";
left="0px";
top="0px";
}
el.empty();
el.append(canvas.node());
}
var calculateCanvasSize=function(){
var width=_width+_tailWidth+(_round*2)+(_borderSize*2);
var height=_height+(_round*2)+(_borderSize*2);
return[width,height];
}
var calculateStartXY=function(){
var x=_tailSide=="left"?_tailWidth+_borderSize:_borderSize;
var y=_round+_borderSize;
return[x,y];
}
var createShape=function(){
var shape=new squigle.Path(
new squigle.Stroke(_borderColor,null,_borderSize),
new squigle.Fill(_bgColor)
);
var posXY=calculateStartXY();
var path=shape.moveTo(new squigle.Point(posXY[0],posXY[1]),true);
with(path){
roundTo(_round,"ur");
lineTo(new squigle.Point(_width,0),true);
roundTo(_round,"rd");
var underTailHeight=_height-_aboveTailHeight-_tailHeight;
if(_tailSide=="right"){
lineTo(new squigle.Point(0,_aboveTailHeight),true);
lineTo(new squigle.Point(_tailWidth,0),true);
lineTo(new squigle.Point(-_tailWidth,_tailHeight),true);
lineTo(new squigle.Point(0,underTailHeight),true);
}
else{
lineTo(new squigle.Point(0,_height),true);
}
roundTo(_round,"dl");
lineTo(new squigle.Point(-_width,0),true);
roundTo(_round,"lu");
if(_tailSide=="left"){
lineTo(new squigle.Point(0,-underTailHeight),true);
lineTo(new squigle.Point(-_tailWidth,-_tailHeight),true);
lineTo(new squigle.Point(_tailWidth,0),true);
}
close();
}
return shape;
}
};yoolk.InfoWindowTextBox=function(label,id,rows,text){
if(id[0]=="_")label+='&nbsp;<span class="r">*</span>';
this._label=label;
this._id=id;
this._rows=rows;
this._text=(text)?text:"";
};
yoolk.InfoWindowTextBox.prototype.toString=function(){
var en=["onfocus","onblur","onchange","onclick","onkeypress"];
var txt=this._text;
var ee=(txt=="")?null:["if(this.value==\'"+txt+"\')this.value=\'\';","if(!this.value)this.value=\'"+txt+"\';"];
var evn=GetTxtBoxEvents(ee);
var c="<tr>";
c+='<th><label for="'+this._id+'">'+this._label+'</label></th>';
var id=' name="'+this._id+'" id="'+this._id+'"';
if(this._rows){
c+='<td><textarea rows="'+this._rows+'" cols="30"'+id+evn+'>'+txt+'</textarea></td>';
}else{
c+='<td><input type="text" class="txt" value="'+txt+'"'+id+evn+' /></td>';
};
return c+'</tr>';
};
yoolk.InfoWindowDropdown=function(label,id){
this._label=label;
this._id=id;
}
yoolk.InfoWindowDropdown.prototype.toString=function(){
var c='<tr><th><label for="'+this._id+'">'+this._label+'</label></th>';
c+='<td><select>';
c+='<option>Select</option>';
c+='</select><td></tr>';
return c;
};
yoolk.Util={
createTextBoxEvents:function(ee)
{
var en=["onfocus","onblur","onchange","onclick","onkeypress"];
var evn="";
for(var i=0;i<en.length;i++){
evn+=' '+en[i]+'="';
if(ee&&i<=ee.length)evn+=ee[i];
if(en[i]=="onblur"){evn+="this.className='txt';";}
else{evn+="this.className='txt focus';";}
evn+='infoWindow.freeze();"';
}
return evn;
}
};MainEventMap={
"EventHandlers":[
{
"event":"{LL.Event.INIT}",
"ObjectBuilders":[
{
"generator":"{PredictiveSearchManager}"
},
{
"generator":"{PredictiveSearchView}"
}
],
"MethodInvokers":[
{
"generator":"{PredictiveSearchManager}",
"method":"loadCache"
}
]
},
{
"event":"{PredictiveSearchEvent.SEARCH_KEYPHRASES}",
"MethodInvokers":[
{
"generator":"{PredictiveSearchManager}",
"method":"searchKeyPhrases",
"arguments":"{[LL.lastEventObject.text]}"
}
]
},
{
"event":"{PredictiveSearchEvent.SEARCH_RESULT}",
"MethodInvokers":[
{
"generator":"{PredictiveSearchManager}",
"method":"searchResults",
"arguments":"{[LL.lastEventObject.listingUrl]}"
}
]
}
]
};
PredictiveSearchEvent=function(type,bubbles,cancelable){
var _event=document.createEvent("Events");
_event.initEvent(type,bubbles,cancelable);
_event.text='';
_event.listingId='';
_event.data='';
_event.listingName='';
return _event;
};
PredictiveSearchEvent.SEARCH_KEYPHRASES="PredictiveSearchEvent.SEARCH_KEYPHRASES";
PredictiveSearchEvent.SEARCH_RESULT="PredictiveSearchEvent.SEARCH_RESULT";
PredictiveSearchEvent.SEARCH_IDS="PredictiveSearchEvent.SEARCH_IDS";
PredictiveSearchEvent.FETCH_DATA="PredictiveSearchEvent.FETCH_DATA";
PredictiveSearchManager=function(){
this.view=LL.Proxy.instance(PredictiveSearchView);
var _self=this;
var _interval=null;
var _keyObj=[];
var _keySearch=[];
this.loadCache=function(){
RestService.get(
'./serachKeyPhraseClients.json',
function(){},
function(data){
if(!data)return;
var data=eval('('+data+')');
_keyObj=data;
}
);
};
this.searchKeyPhrases=function(text){
if(text=='')
return;
if(_keySearch.length>0){
for(var i=_keySearch.length-1;i>=0;i--){
if(_keySearch[i].toLowerCase()==text.toLowerCase()){
_self.view.displayResult(matchKeyPharase(_keyObj,text));
return;
}
}
}
_keySearch.push(text);
if(_keyObj){
_self.view.displayResult(matchKeyPharase(_keyObj,text));
}
if(text!=''){
if(_interval)clearInterval(_interval);
_interval=setInterval(
function(){
RestService.get(
'./listing_keyphrases.json?query='+text,
function(){
},
function(data){
if(!data)return;
var data=eval('('+data+')');
for(var i=0;i<data.length;i++){
_keyObj.push(data[i]);
}
_self.view.displayResult(matchKeyPharase(_keyObj,text));
}
);
clearInterval(_interval);
},
500
);
}
};
this.searchResults=function(listingUrl){
window.location=RootLanguage.substring(0,RootLanguage.length-1)+listingUrl;
};
var matchKeyPharase=function(keyobj,keypharse){
var data=[];
for(var i=0;i<keyobj.length;i++){
var b=false;
for(var j=0;j<keyobj[i].keyPhrases.length;j++){
if(keyobj[i].keyPhrases[j].toLowerCase()==keypharse.toLowerCase()){
for(var k=0;k<data.length;k++){
if(data[k].id==keyobj[i].id){
b=true;
break;
}
}
if(!b)
data.push(keyobj[i]);
}
}
}
return data;
}
};
PredictiveSearchView=function(parentId){
var _self=this;
var _interval=null;
var _index=-1;
var _div_results=[];
var _result=[];
var _listingUrl='';
var textbox_id='txtHome';
var dropdown_id='div_dropDown';
var div_container=Util.dom.create({'tag':'div','id':'div_container'});
if(document.getElementById("fieldset"))document.getElementById("fieldset").appendChild(div_container);
else{
document.getElementById("fieldsetInterface").appendChild(div_container);
textbox_id='txtSearchSubpage';
dropdown_id='dropdownSubpage'
}
var input_textbox=Util.dom.create({'append':div_container,'tag':'input','type':'text','id':textbox_id,'name':'q','class':'input_textbox','autocomplete':'off'});
var div_dropDown=Util.dom.create({'append':div_container,'tag':'div','id':dropdown_id});
var div_searchFor=Util.dom.create({'append':div_dropDown,'tag':'div','style':'text-align:center;'});
var label_searchFor=Util.dom.create({'append':div_searchFor,'tag':'label','class':'label_searchFor'});
var div_results_container=Util.dom.create({'append':div_dropDown,'tag':'div','class':'div_results_container'});
div_dropDown.style.zIndex=50;
if(turnOnLocation){
input_textbox.title=$businessSearch;
if(textbox_id=='txtSearchSubpage')
input_textbox.style.width='200px';
else
input_textbox.style.width='205px';
}
else{
input_textbox.title=$search+' '+currentLocality;
if(textbox_id=='txtSearchSubpage')
input_textbox.style.width='415px';
else
input_textbox.style.width='425px';
}
if(Util.dom.ie){
input_textbox.onkeydown=function(){
_self.handleKeyPressed(window.event);
};
}else{
input_textbox.onkeypress=function(e){
_self.handleKeyPressed(e);
};
}
input_textbox.onclick=function(e){
var event=e?e:window.event;
event.cancelBubble=true;
if(div_dropDown.childNodes[1].childNodes.length>0&&input_textbox.value!=""){
Util.dom.showItem(div_dropDown);
Util.dom.showItem(div_results_container);
}
if(document.getElementById('dropdownLocation'))Util.dom.hideItem(document.getElementById('dropdownLocation'));
if(document.getElementById('dropdownLocationSubpage'))Util.dom.hideItem(document.getElementById('dropdownLocationSubpage'));
};
div_searchFor.onmouseover=function(){
_listingUrl='';
Util.dom.hilightIndex(0,[div_searchFor]);
if(_self.getDivResults().length>0&&_self.getIndex()!=-1)Util.dom.dehilightItem(_self.getDivResults()[_self.getIndex()]);
};
div_searchFor.onclick=function(){
Util.dom.dehilightItem(div_searchFor);
Util.dom.hideItem(div_dropDown);
Util.dom.clearContent(div_dropDown.childNodes[1]);
};
this.handleKeyPressed=function(e){
var _self=this;
if(e.keyCode==13&&input_textbox.value!=""){
if(_listingUrl==''&&(div_dropDown.style.display=='none'||_index==-1)){
var txtLocationBox=textbox_id=='txtHome'?'txtLocation':'txtLocationSubpage';
submitSearchBox(textbox_id,txtLocationBox);
return;
}
if(_index==0){
Util.dom.hideItem(div_dropDown);
Util.dom.clearContent(div_dropDown.childNodes[1]);
this.setDivResults([]);
return;
}
Util.dom.hideItem(div_dropDown);
Util.dom.clearContent(div_dropDown.childNodes[1]);
this.setDivResults([]);
var event=new PredictiveSearchEvent(PredictiveSearchEvent.SEARCH_RESULT);
event.listingUrl=_listingUrl;
document.dispatchEvent(event);
_listingUrl=null;
}
if(e.keyCode==9){
if(document.getElementById('div_dropDown'))Util.dom.hideItem(document.getElementById('div_dropDown'));
if(document.getElementById('dropdownSubpage'))Util.dom.hideItem(document.getElementById('dropdownSubpage'));
}
if(e.keyCode!=40&&e.keyCode!=38&&e.keyCode!=13&&e.keyCode!=9){
if(_interval){
clearInterval(_interval);
}
_interval=setInterval(
function(){
var text=input_textbox.value;
Util.dom.clearContent(div_dropDown.childNodes[1]);
Util.dom.showItem(div_dropDown);
label_searchFor.innerHTML=$searchForKeypharse+text;
var event=new PredictiveSearchEvent(PredictiveSearchEvent.SEARCH_KEYPHRASES);
event.text=text;
document.dispatchEvent(event);
clearInterval(_interval);
},
500
);
}else{
if(this.getDivResults().length>1)this.activateArrowControl(e);
else{
Util.dom.hilightItem(div_searchFor);
this.setIndex(0);
}
}
};
this.setDivResults=function(divResults){
_div_results=divResults;
};
this.addDivResult=function(div_result){
_div_results.push(div_result);
};
this.getDivResults=function(){
return _div_results;
};
this.setIndex=function(index){
_index=index;
};
this.getIndex=function(){
return _index;
};
this.getResults=function(){
return _result;
};
this.setResults=function(results){
_result=results;
};
this.activateArrowControl=function(e){
var index=this.getIndex();
var div_results=this.getDivResults();
var results=this.getResults();
if(e.keyCode==40&&index<div_results.length-1){
++index;
this.setIndex(index);
Util.dom.hilightIndex(index,div_results);
_listingUrl=(index!=0)?_result[index-1].listingUrl:'';
}else if(e.keyCode==38&&index>=1){
index--;
this.setIndex(index);
Util.dom.hilightIndex(index,div_results);
_listingUrl=(index!=0)?_result[index-1].listingUrl:'';
}
};
this.displayResult=function(results){
this.setIndex(-1);
var div_results=[div_searchFor];
this.setDivResults([]);
if(results.length>0){
Util.dom.showItem(div_results_container);
Util.dom.clearContent(div_results_container);
_self.addDivResult(div_searchFor);
for(var i=0;i<results.length;i++){
var div_result=Util.dom.create({
'append':div_results_container,
'tag':'div',
'style':'height: 19px;text-align:left;cursor: default;',
'text':results[i].listingName
});
(function(){
var j=i;
var div_hili=div_result;
div_hili.onmouseover=function(){
Util.dom.dehilightItem(div_searchFor);
Util.dom.hilightIndex(j+1,_self.getDivResults());
_listingUrl=results[j].listingUrl;
_self.setIndex(j+1);
};
div_hili.onclick=function(){
input_textbox.focus();
Util.dom.hideItem(div_dropDown);
_self.setDivResults([]);
Util.dom.clearContent(div_dropDown.childNodes[1]);
var event=new PredictiveSearchEvent(PredictiveSearchEvent.SEARCH_RESULT);
event.listingUrl=_listingUrl;
document.dispatchEvent(event);
_listingUrl=null;
};
})();
this.addDivResult(div_result)
}
this.setResults(results);
}else Util.dom.hideItem(div_results_container);
};
};
RestService={
get:function(url,progressCallBack,successCallBack){
Util.ajax({
type:'GET',
url:url,
onProgress:function(state){
progressCallBack(state);
},
onSuccess:function(data){
successCallBack(data);
}
});
}
};
SearchResult=function(results){
this.results=results||[];
this.resultsLength=0;
this.getElements=function(){
return this.results;
};
this.getFirst=function(resultsLength){
this.resultsLength=resultsLength;
var returned=[];
for(var i=0;i<resultsLength;i++){
returned.push(this.results[i]);
}
return returned;
};
this.hasNext=function(){
return(this.resultsLength<this.results.length)?true:false;
};
this.getElementsInRange=function(from,to){
var results=[];
for(var i=from;i<=to;i++){
results.push(this.results[i]);
}
this.resultsLength=to;
return results;
};
this.appendElements=function(elements){
for(var i=0;i<elements.length;i++){
this.results.push(elements[i]);
}
};
this.removeElementsInRange=function(from,to){
var _length=parseInt(to)-parseInt(from);
this.results.splice(parseInt(from),_length);
};
};
SearchResultExtend=function(results){
SearchResult.apply(this,results);
this.appendElements=function(elements){
if(this.results.length==0){
this.results=this.results.concat(elements);
return;
}
for(var i=0;i<this.results.length;i++){
for(var j=0;j<elements.length;j++){
if(this.results[i].id==elements[j].id){
elements.splice(j);
break;
}
}
}
if(elements.length>0)this.results=this.results.concat(elements);
};
};
Util={
dom:{
ie:/*@cc_on!@*/false,
doc:document,
create:function(args){
if(!args.tag)return null;
var tag;
if((args.name||args.type)&&this.ie){
var name=(args.name)?"name='"+args.name+"'":"";
var type=(args.type)?"type='"+args.type+"'":"";
var html='<'+args.tag+' '+name+' '+type+' />';
tag=this.doc.createElement(html);
delete args.name;
}else tag=this.doc.createElement(args.tag);
delete args.tag;
if(args.append){
args.append.appendChild(tag);
delete args.append;
}
args.edit=tag;
tag=this.edit(args);
return tag;
},
edit:function(args){
var tag=args.edit;
delete args.edit;
if(args.text){
tag.appendChild(this.doc.createTextNode(args.text));
delete args.text;
}
for(property in args){
if(property=='class'){
tag.className=args[property];
}
else if(property=='type'){
tag.setType=args[property];
}
else
tag.setAttribute(property,args[property]);
}
return tag;
},
showItem:function(item){
item.style.display='block';
},
hideItem:function(item){
item.style.display='none';
},
hilightItem:function(item){
item.style.color='#FFFFFF';
item.style.backgroundColor='#0066FF';
},
dehilightItem:function(item){
item.style.color='';
item.style.backgroundColor='';
},
hilightIndex:function(index,elements){
for(var i=0;i<elements.length;i++){
if(i==index){
Util.dom.hilightItem(elements[i]);
}else{
Util.dom.dehilightItem(elements[i]);
}
}
},
isHilighted:function(item){
return(item.style.color!=''&&item.style.backgroundColor!='')?true:false;
},
clearContent:function(item){
if(item)item.innerHTML="";
}
},
ajax:function(options){
options={
type:options.type||"GET",
RequestHeader:options.requestHeader||"text/xml",
url:options.url||"",
timeout:options.timeout||5000,
onComplete:options.onComplete||function(){},
onError:options.onError||function(){},
onSuccess:options.onSuccess||function(){},
onProgress:options.onProgress||function(){},
data:options.data||""
};
if(typeof XMLHttpRequest=='undefined'){
http_request=new ActiveXObject(
navigator.userAgent.indexOf("MSIE 5")>=0?"Microsoft.XMLHTTP":"Msxml2.XMLHTTP"
);
}else{
http_request=new XMLHttpRequest();
if(http_request.overrideMimeType)http_request.overrideMimeType('text/xml');
}
http_request.open(options.type,options.url,true);
http_request.setRequestHeader("Content-Type",options.RequestHeader);
var timeoutLength=options.timeout;
var requestDone=false;
setTimeout(
function(){
requestDone=true;
},
timeoutLength
);
http_request.onreadystatechange=function(){
options.onProgress(http_request.readyState);
if(http_request.readyState==4&&!requestDone){
(httpSuccess(http_request))?options.onSuccess(httpData(http_request,options.type)):options.onError();
options.onComplete();
http_request=null;
}
};
http_request.send(options.data);
function httpSuccess(r){
try{
return!r.status&&location.protocol=="file:"||
(r.status>=200&&r.status<300)||
r.status==304||
navigator.userAgent.indexOf("Safari")>=0
&&typeof r.status=="undefined";
}catch(e){}
return false;
}
function httpData(r,type){
var ct=r.getResponseHeader("content-type");
var data=!type&&ct&&ct.indexOf("xml")>=0;
data=type=="xml"||data?r.responseXML:r.responseText;
if(type=="script")
eval.call(window,data);
return data;
}
}
};
function UUID(){
this.id=this.createUUID();
}
UUID.prototype.valueOf=function(){return this.id;}
UUID.prototype.toString=function(){return this.id;}
UUID.prototype.createUUID=function(){
var dg=new Date(1582,10,15,0,0,0,0);
var dc=new Date();
var t=dc.getTime()-dg.getTime();
var h='-';
var tl=UUID.getIntegerBits(t,0,31);
var tm=UUID.getIntegerBits(t,32,47);
var thv=UUID.getIntegerBits(t,48,59)+'1';
var csar=UUID.getIntegerBits(UUID.rand(4095),0,7);
var csl=UUID.getIntegerBits(UUID.rand(4095),0,7);
var n=UUID.getIntegerBits(UUID.rand(8191),0,7)+
UUID.getIntegerBits(UUID.rand(8191),8,15)+
UUID.getIntegerBits(UUID.rand(8191),0,7)+
UUID.getIntegerBits(UUID.rand(8191),8,15)+
UUID.getIntegerBits(UUID.rand(8191),0,15);
return tl+h+tm+h+thv+h+csar+csl+h+n;
}
UUID.getIntegerBits=function(val,start,end){
var base16=UUID.returnBase(val,16);
var quadArray=new Array();
var quadString='';
var i=0;
for(i=0;i<base16.length;i++){
quadArray.push(base16.substring(i,i+1));
}
for(i=Math.floor(start/4);i<=Math.floor(end/4);i++){
if(!quadArray[i]||quadArray[i]=='')quadString+='0';
else quadString+=quadArray[i];
}
return quadString;
}
UUID.returnBase=function(number,base){
return(number).toString(base).toUpperCase();
}
UUID.rand=function(max){
return Math.floor(Math.random()*(max+1));
}