/**
Cross-browser script-inclusion logic and low-level events
Copyright 2006, 2007 Adam R. Wolff

Global Script script maintains an internal list of script libraries and adds them to the
document as needed. 

*/
/**
	object for including remote scripts
	*String baseURL = URL path to prepend to any, non-fully-qualified URL 
*/

/*
Packed JQuery:
*/
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}('7(1g 18.6=="I"){18.I=18.I;u 6=q(a,c){7(18==9||!9.3X)v 14 6(a,c);v 9.3X(a,c)};7(1g $!="I")6.1I$=$;u $=6;6.11=6.8r={3X:q(a,c){a=a||P;7(6.16(a))v 14 6(P)[6.11.1G?"1G":"1W"](a);7(1g a=="1s"){u m=/^[^<]*(<(.|\\s)+>)[^>]*$/.1V(a);7(m)a=6.31([m[1]]);B v 14 6(c).1L(a)}v 9.4E(a.15==2b&&a||(a.3C||a.C&&a!=18&&!a.1q&&a[0]!=I&&a[0].1q)&&6.2L(a)||[a])},3C:"1.1.3.1",7W:q(){v 9.C},C:0,1M:q(a){v a==I?6.2L(9):9[a]},1Z:q(a){u b=6(a);b.5q=9;v b},4E:q(a){9.C=0;[].R.O(9,a);v 9},F:q(a,b){v 6.F(9,a,b)},2p:q(a){u b=-1;9.F(q(i){7(9==a)b=i});v b},1b:q(f,d,e){u c=f;7(f.15==33)7(d==I)v 9.C&&6[e||"1b"](9[0],f)||I;B{c={};c[f]=d}v 9.F(q(a){E(u b V c)6.1b(e?9.T:9,b,6.4H(9,c[b],e,a,b))})},1f:q(b,a){v 9.1b(b,a,"2z")},2A:q(e){7(1g e=="1s")v 9.2Y().3e(P.66(e));u t="";6.F(e||9,q(){6.F(9.2S,q(){7(9.1q!=8)t+=9.1q!=1?9.5R:6.11.2A([9])})});v t},8b:q(){u a,1S=19;v 9.F(q(){7(!a)a=6.31(1S,9.2O);u b=a[0].3s(K);9.L.2K(b,9);1v(b.1d)b=b.1d;b.4g(9)})},3e:q(){v 9.2F(19,K,1,q(a){9.4g(a)})},5w:q(){v 9.2F(19,K,-1,q(a){9.2K(a,9.1d)})},5t:q(){v 9.2F(19,N,1,q(a){9.L.2K(a,9)})},5s:q(){v 9.2F(19,N,-1,q(a){9.L.2K(a,9.1X)})},2U:q(){v 9.5q||6([])},1L:q(t){u b=6.3k(9,q(a){v 6.1L(t,a)});v 9.1Z(/[^+>] [^+>]/.17(t)||t.J("..")>-1?6.5g(b):b)},7x:q(e){u d=9.1A(9.1L("*"));d.F(q(){9.1I$1a={};E(u a V 9.$1a)9.1I$1a[a]=6.1c({},9.$1a[a])}).3U();u r=9.1Z(6.3k(9,q(a){v a.3s(e!=I?e:K)}));d.F(q(){u b=9.1I$1a;E(u a V b)E(u c V b[a])6.S.1A(9,a,b[a][c],b[a][c].W);9.1I$1a=H});v r},1i:q(t){v 9.1Z(6.16(t)&&6.2s(9,q(b,a){v t.O(b,[a])})||6.2x(t,9))},4Y:q(t){v 9.1Z(t.15==33&&6.2x(t,9,K)||6.2s(9,q(a){v(t.15==2b||t.3C)?6.2w(a,t)<0:a!=t}))},1A:q(t){v 9.1Z(6.1T(9.1M(),t.15==33?6(t).1M():t.C!=I&&(!t.Q||t.Q=="6Z")?t:[t]))},37:q(a){v a?6.2x(a,9).C>0:N},6R:q(a){v a==I?(9.C?9[0].2v:H):9.1b("2v",a)},3F:q(a){v a==I?(9.C?9[0].27:H):9.2Y().3e(a)},2F:q(f,d,g,e){u c=9.C>1,a;v 9.F(q(){7(!a){a=6.31(f,9.2O);7(g<0)a.6E()}u b=9;7(d&&6.Q(9,"1r")&&6.Q(a[0],"2V"))b=9.3R("1z")[0]||9.4g(P.5h("1z"));6.F(a,q(){e.O(b,[c?9.3s(K):9])})})}};6.1c=6.11.1c=q(){u c=19[0],a=1;7(19.C==1){c=9;a=0}u b;1v((b=19[a++])!=H)E(u i V b)c[i]=b[i];v c};6.1c({6n:q(){7(6.1I$)$=6.1I$;v 6},16:q(a){v!!a&&1g a!="1s"&&!a.Q&&a.15!=2b&&/q/i.17(a+"")},40:q(a){v a.4z&&a.2O&&!a.2O.4y},Q:q(b,a){v b.Q&&b.Q.1D()==a.1D()},F:q(a,b,c){7(a.C==I)E(u i V a)b.O(a[i],c||[i,a[i]]);B E(u i=0,4x=a.C;i<4x;i++)7(b.O(a[i],c||[i,a[i]])===N)1F;v a},4H:q(c,b,d,e,a){7(6.16(b))b=b.3D(c,[e]);u f=/z-?2p|5Y-?8p|1e|5U|8i-?1u/i;v b&&b.15==3y&&d=="2z"&&!f.17(a)?b+"4o":b},12:{1A:q(b,c){6.F(c.2R(/\\s+/),q(i,a){7(!6.12.3w(b.12,a))b.12+=(b.12?" ":"")+a})},1E:q(b,c){b.12=c!=I?6.2s(b.12.2R(/\\s+/),q(a){v!6.12.3w(c,a)}).5M(" "):""},3w:q(t,c){v 6.2w(c,(t.12||t).3v().2R(/\\s+/))>-1}},4m:q(e,o,f){E(u i V o){e.T["2N"+i]=e.T[i];e.T[i]=o[i]}f.O(e,[]);E(u i V o)e.T[i]=e.T["2N"+i]},1f:q(e,p){7(p=="1u"||p=="29"){u b={},3r,3p,d=["83","81","80","7Y"];6.F(d,q(){b["7V"+9]=0;b["7T"+9+"7S"]=0});6.4m(e,b,q(){7(6(e).37(\':4f\')){3r=e.7Q;3p=e.7O}B{e=6(e.3s(K)).1L(":4b").5v("2B").2U().1f({48:"1y",3i:"7L",U:"2h",7K:"0",7I:"0"}).5o(e.L)[0];u a=6.1f(e.L,"3i")||"3n";7(a=="3n")e.L.T.3i="7G";3r=e.7E;3p=e.7D;7(a=="3n")e.L.T.3i="3n";e.L.3q(e)}});v p=="1u"?3r:3p}v 6.2z(e,p)},2z:q(e,a,d){u g;7(a=="1e"&&6.M.1h){g=6.1b(e.T,"1e");v g==""?"1":g}7(a.3t(/3x/i))a=6.1U;7(!d&&e.T[a])g=e.T[a];B 7(P.3f&&P.3f.3Y){7(a.3t(/3x/i))a="3x";a=a.1o(/([A-Z])/g,"-$1").2H();u b=P.3f.3Y(e,H);7(b)g=b.57(a);B 7(a=="U")g="1P";B 6.4m(e,{U:"2h"},q(){u c=P.3f.3Y(9,"");g=c&&c.57(a)||""})}B 7(e.3S){u f=a.1o(/\\-(\\w)/g,q(m,c){v c.1D()});g=e.3S[a]||e.3S[f]}v g},31:q(a,c){u r=[];c=c||P;6.F(a,q(i,b){7(!b)v;7(b.15==3y)b=b.3v();7(1g b=="1s"){u s=6.2C(b).2H(),1x=c.5h("1x"),1N=[];u a=!s.J("<1H")&&[1,"<2y>","</2y>"]||!s.J("<7g")&&[1,"<52>","</52>"]||(!s.J("<7c")||!s.J("<1z")||!s.J("<7a")||!s.J("<78"))&&[1,"<1r>","</1r>"]||!s.J("<2V")&&[2,"<1r><1z>","</1z></1r>"]||(!s.J("<75")||!s.J("<74"))&&[3,"<1r><1z><2V>","</2V></1z></1r>"]||!s.J("<73")&&[2,"<1r><4W>","</4W></1r>"]||[0,"",""];1x.27=a[1]+b+a[2];1v(a[0]--)1x=1x.1d;7(6.M.1h){7(!s.J("<1r")&&s.J("<1z")<0)1N=1x.1d&&1x.1d.2S;B 7(a[1]=="<1r>"&&s.J("<1z")<0)1N=1x.2S;E(u n=1N.C-1;n>=0;--n)7(6.Q(1N[n],"1z")&&!1N[n].2S.C)1N[n].L.3q(1N[n])}b=6.2L(1x.2S)}7(0===b.C&&(!6.Q(b,"34")&&!6.Q(b,"2y")))v;7(b[0]==I||6.Q(b,"34")||b.71)r.R(b);B r=6.1T(r,b)});v r},1b:q(c,d,a){u e=6.40(c)?{}:6.3H;7(e[d]){7(a!=I)c[e[d]]=a;v c[e[d]]}B 7(a==I&&6.M.1h&&6.Q(c,"34")&&(d=="70"||d=="6Y"))v c.6W(d).5R;B 7(c.4z){7(a!=I)c.6U(d,a);7(6.M.1h&&/4M|2u/.17(d)&&!6.40(c))v c.35(d,2);v c.35(d)}B{7(d=="1e"&&6.M.1h){7(a!=I){c.5U=1;c.1i=(c.1i||"").1o(/4L\\([^)]*\\)/,"")+(39(a).3v()=="6M"?"":"4L(1e="+a*4X+")")}v c.1i?(39(c.1i.3t(/1e=([^)]*)/)[1])/4X).3v():""}d=d.1o(/-([a-z])/6K,q(z,b){v b.1D()});7(a!=I)c[d]=a;v c[d]}},2C:q(t){v t.1o(/^\\s+|\\s+$/g,"")},2L:q(a){u r=[];7(1g a!="6I")E(u i=0,26=a.C;i<26;i++)r.R(a[i]);B r=a.51(0);v r},2w:q(b,a){E(u i=0,26=a.C;i<26;i++)7(a[i]==b)v i;v-1},1T:q(a,b){E(u i=0;b[i];i++)a.R(b[i]);v a},5g:q(a){u r=[],3P=6.1k++;E(u i=0,4G=a.C;i<4G;i++)7(3P!=a[i].1k){a[i].1k=3P;r.R(a[i])}v r},1k:0,2s:q(c,b,d){7(1g b=="1s")b=14 45("a","i","v "+b);u a=[];E(u i=0,30=c.C;i<30;i++)7(!d&&b(c[i],i)||d&&!b(c[i],i))a.R(c[i]);v a},3k:q(c,b){7(1g b=="1s")b=14 45("a","v "+b);u d=[];E(u i=0,30=c.C;i<30;i++){u a=b(c[i],i);7(a!==H&&a!=I){7(a.15!=2b)a=[a];d=d.6v(a)}}v d}});14 q(){u b=6u.6t.2H();6.M={4D:(b.3t(/.+(?:6s|6q|6o|6m)[\\/: ]([\\d.]+)/)||[])[1],20:/5l/.17(b),2a:/2a/.17(b),1h:/1h/.17(b)&&!/2a/.17(b),3j:/3j/.17(b)&&!/(6h|5l)/.17(b)};6.6g=!6.M.1h||P.6f=="6c";6.1U=6.M.1h?"1U":"5x",6.3H={"E":"68","67":"12","3x":6.1U,5x:6.1U,1U:6.1U,27:"27",12:"12",2v:"2v",2r:"2r",2B:"2B",65:"63",2T:"2T",62:"5Z"}};6.F({4v:"a.L",4p:"6.4p(a)",8o:"6.22(a,2,\'1X\')",8n:"6.22(a,2,\'4t\')",8k:"6.4q(a.L.1d,a)",8h:"6.4q(a.1d)"},q(i,n){6.11[i]=q(a){u b=6.3k(9,n);7(a&&1g a=="1s")b=6.2x(a,b);v 9.1Z(b)}});6.F({5o:"3e",8g:"5w",2K:"5t",8f:"5s"},q(i,n){6.11[i]=q(){u a=19;v 9.F(q(){E(u j=0,26=a.C;j<26;j++)6(a[j])[n](9)})}});6.F({5v:q(a){6.1b(9,a,"");9.8d(a)},8c:q(c){6.12.1A(9,c)},88:q(c){6.12.1E(9,c)},87:q(c){6.12[6.12.3w(9,c)?"1E":"1A"](9,c)},1E:q(a){7(!a||6.1i(a,[9]).r.C)9.L.3q(9)},2Y:q(){1v(9.1d)9.3q(9.1d)}},q(i,n){6.11[i]=q(){v 9.F(n,19)}});6.F(["5Q","5P","5O","5N"],q(i,n){6.11[n]=q(a,b){v 9.1i(":"+n+"("+a+")",b)}});6.F(["1u","29"],q(i,n){6.11[n]=q(h){v h==I?(9.C?6.1f(9[0],n):H):9.1f(n,h.15==33?h:h+"4o")}});6.1c({4n:{"":"m[2]==\'*\'||6.Q(a,m[2])","#":"a.35(\'2m\')==m[2]",":":{5P:"i<m[3]-0",5O:"i>m[3]-0",22:"m[3]-0==i",5Q:"m[3]-0==i",2Q:"i==0",2P:"i==r.C-1",5L:"i%2==0",5K:"i%2","2Q-3u":"a.L.3R(\'*\')[0]==a","2P-3u":"6.22(a.L.5J,1,\'4t\')==a","86-3u":"!6.22(a.L.5J,2,\'4t\')",4v:"a.1d",2Y:"!a.1d",5N:"(a.5H||a.85||\'\').J(m[3])>=0",4f:\'"1y"!=a.G&&6.1f(a,"U")!="1P"&&6.1f(a,"48")!="1y"\',1y:\'"1y"==a.G||6.1f(a,"U")=="1P"||6.1f(a,"48")=="1y"\',84:"!a.2r",2r:"a.2r",2B:"a.2B",2T:"a.2T||6.1b(a,\'2T\')",2A:"\'2A\'==a.G",4b:"\'4b\'==a.G",5F:"\'5F\'==a.G",4l:"\'4l\'==a.G",5E:"\'5E\'==a.G",4k:"\'4k\'==a.G",5D:"\'5D\'==a.G",5C:"\'5C\'==a.G",1J:\'"1J"==a.G||6.Q(a,"1J")\',5B:"/5B|2y|82|1J/i.17(a.Q)"},"[":"6.1L(m[2],a).C"},5A:[/^\\[ *(@)([\\w-]+) *([!*$^~=]*) *(\'?"?)(.*?)\\4 *\\]/,/^(\\[)\\s*(.*?(\\[.*?\\])?[^[]*?)\\s*\\]/,/^(:)([\\w-]+)\\("?\'?(.*?(\\(.*?\\))?[^(]*?)"?\'?\\)/,14 3o("^([:.#]*)("+(6.2J=6.M.20&&6.M.4D<"3.0.0"?"\\\\w":"(?:[\\\\w\\7Z-\\7X*1I-]|\\\\\\\\.)")+"+)")],2x:q(a,c,b){u d,1K=[];1v(a&&a!=d){d=a;u f=6.1i(a,c,b);a=f.t.1o(/^\\s*,\\s*/,"");1K=b?c=f.r:6.1T(1K,f.r)}v 1K},1L:q(t,l){7(1g t!="1s")v[t];7(l&&!l.1q)l=H;l=l||P;7(!t.J("//")){l=l.4h;t=t.2G(2,t.C)}B 7(!t.J("/")&&!l.2O){l=l.4h;t=t.2G(1,t.C);7(t.J("/")>=1)t=t.2G(t.J("/"),t.C)}u b=[l],2j=[],2P;1v(t&&2P!=t){u r=[];2P=t;t=6.2C(t).1o(/^\\/\\//,"");u k=N;u g=14 3o("^[/>]\\\\s*("+6.2J+"+)");u m=g.1V(t);7(m){u o=m[1].1D();E(u i=0;b[i];i++)E(u c=b[i].1d;c;c=c.1X)7(c.1q==1&&(o=="*"||c.Q.1D()==o.1D()))r.R(c);b=r;t=t.1o(g,"");7(t.J(" ")==0)7R;k=K}B{g=/^((\\/?\\.\\.)|([>\\/+~]))\\s*([a-z]*)/i;7((m=g.1V(t))!=H){r=[];u o=m[4],1k=6.1k++;m=m[1];E(u j=0,2e=b.C;j<2e;j++)7(m.J("..")<0){u n=m=="~"||m=="+"?b[j].1X:b[j].1d;E(;n;n=n.1X)7(n.1q==1){7(m=="~"&&n.1k==1k)1F;7(!o||n.Q.1D()==o.1D()){7(m=="~")n.1k=1k;r.R(n)}7(m=="+")1F}}B r.R(b[j].L);b=r;t=6.2C(t.1o(g,""));k=K}}7(t&&!k){7(!t.J(",")){7(l==b[0])b.4e();2j=6.1T(2j,b);r=b=[l];t=" "+t.2G(1,t.C)}B{u h=14 3o("^("+6.2J+"+)(#)("+6.2J+"+)");u m=h.1V(t);7(m){m=[0,m[2],m[3],m[1]]}B{h=14 3o("^([#.]?)("+6.2J+"*)");m=h.1V(t)}m[2]=m[2].1o(/\\\\/g,"");u f=b[b.C-1];7(m[1]=="#"&&f&&f.4d){u p=f.4d(m[2]);7((6.M.1h||6.M.2a)&&p&&1g p.2m=="1s"&&p.2m!=m[2])p=6(\'[@2m="\'+m[2]+\'"]\',f)[0];b=r=p&&(!m[3]||6.Q(p,m[3]))?[p]:[]}B{E(u i=0;b[i];i++){u a=m[1]!=""||m[0]==""?"*":m[2];7(a=="*"&&b[i].Q.2H()=="7P")a="2E";r=6.1T(r,b[i].3R(a))}7(m[1]==".")r=6.4c(r,m[2]);7(m[1]=="#"){u e=[];E(u i=0;r[i];i++)7(r[i].35("2m")==m[2]){e=[r[i]];1F}r=e}b=r}t=t.1o(h,"")}}7(t){u d=6.1i(t,r);b=r=d.r;t=6.2C(d.t)}}7(t)b=[];7(b&&l==b[0])b.4e();2j=6.1T(2j,b);v 2j},4c:q(r,m,a){m=" "+m+" ";u b=[];E(u i=0;r[i];i++){u c=(" "+r[i].12+" ").J(m)>=0;7(!a&&c||a&&!c)b.R(r[i])}v b},1i:q(t,r,h){u d;1v(t&&t!=d){d=t;u p=6.5A,m;E(u i=0;p[i];i++){m=p[i].1V(t);7(m){t=t.7N(m[0].C);m[2]=m[2].1o(/\\\\/g,"");1F}}7(!m)1F;7(m[1]==":"&&m[2]=="4Y")r=6.1i(m[3],r,K).r;B 7(m[1]==".")r=6.4c(r,m[2],h);B 7(m[1]=="@"){u g=[],G=m[3];E(u i=0,2e=r.C;i<2e;i++){u a=r[i],z=a[6.3H[m[2]]||m[2]];7(z==H||/4M|2u/.17(m[2]))z=6.1b(a,m[2])||\'\';7((G==""&&!!z||G=="="&&z==m[5]||G=="!="&&z!=m[5]||G=="^="&&z&&!z.J(m[5])||G=="$="&&z.2G(z.C-m[5].C)==m[5]||(G=="*="||G=="~=")&&z.J(m[5])>=0)^h)g.R(a)}r=g}B 7(m[1]==":"&&m[2]=="22-3u"){u e=6.1k++,g=[],17=/(\\d*)n\\+?(\\d*)/.1V(m[3]=="5L"&&"2n"||m[3]=="5K"&&"2n+1"||!/\\D/.17(m[3])&&"n+"+m[3]||m[3]),2Q=(17[1]||1)-0,d=17[2]-0;E(u i=0,2e=r.C;i<2e;i++){u j=r[i],L=j.L;7(e!=L.1k){u c=1;E(u n=L.1d;n;n=n.1X)7(n.1q==1)n.4a=c++;L.1k=e}u b=N;7(2Q==1){7(d==0||j.4a==d)b=K}B 7((j.4a+d)%2Q==0)b=K;7(b^h)g.R(j)}r=g}B{u f=6.4n[m[1]];7(1g f!="1s")f=6.4n[m[1]][m[2]];49("f = q(a,i){v "+f+"}");r=6.2s(r,f,h)}}v{r:r,t:t}},4p:q(c){u b=[];u a=c.L;1v(a&&a!=P){b.R(a);a=a.L}v b},22:q(a,e,c,b){e=e||1;u d=0;E(;a;a=a[c])7(a.1q==1&&++d==e)1F;v a},4q:q(n,a){u r=[];E(;n;n=n.1X){7(n.1q==1&&(!a||n!=a))r.R(n)}v r}});6.S={1A:q(d,e,c,b){7(6.M.1h&&d.3m!=I)d=18;7(!c.1Q)c.1Q=9.1Q++;7(b!=I){u f=c;c=q(){v f.O(9,19)};c.W=b;c.1Q=f.1Q}7(!d.$1a)d.$1a={};7(!d.$1p)d.$1p=q(){u a;7(1g 6=="I"||6.S.47)v a;a=6.S.1p.O(d,19);v a};u g=d.$1a[e];7(!g){g=d.$1a[e]={};7(d.46)d.46(e,d.$1p,N);B d.7M("5r"+e,d.$1p)}g[c.1Q]=c;7(!9.Y[e])9.Y[e]=[];7(6.2w(d,9.Y[e])==-1)9.Y[e].R(d)},1Q:1,Y:{},1E:q(b,c,a){u d=b.$1a,1Y,2p;7(d){7(c&&c.G){a=c.44;c=c.G}7(!c){E(c V d)9.1E(b,c)}B 7(d[c]){7(a)3l d[c][a.1Q];B E(a V b.$1a[c])3l d[c][a];E(1Y V d[c])1F;7(!1Y){7(b.43)b.43(c,b.$1p,N);B b.7J("5r"+c,b.$1p);1Y=H;3l d[c];1v(9.Y[c]&&((2p=6.2w(b,9.Y[c]))>=0))3l 9.Y[c][2p]}}E(1Y V d)1F;7(!1Y)b.$1p=b.$1a=H}},1t:q(c,b,d){b=6.2L(b||[]);7(!d)6.F(9.Y[c]||[],q(){6.S.1t(c,b,9)});B{u a,1Y,11=6.16(d[c]||H);b.5p(9.42({G:c,1O:d}));7(6.16(d.$1p)&&(a=d.$1p.O(d,b))!==N)9.47=K;7(11&&a!==N&&!6.Q(d,\'a\'))d[c]();9.47=N}},1p:q(b){u a;b=6.S.42(b||18.S||{});u c=9.$1a&&9.$1a[b.G],1S=[].51.3D(19,1);1S.5p(b);E(u j V c){1S[0].44=c[j];1S[0].W=c[j].W;7(c[j].O(9,1S)===N){b.2d();b.2D();a=N}}7(6.M.1h)b.1O=b.2d=b.2D=b.44=b.W=H;v a},42:q(c){u a=c;c=6.1c({},a);c.2d=q(){7(a.2d)v a.2d();a.7H=N};c.2D=q(){7(a.2D)v a.2D();a.7F=K};7(!c.1O&&c.5n)c.1O=c.5n;7(6.M.20&&c.1O.1q==3)c.1O=a.1O.L;7(!c.41&&c.4j)c.41=c.4j==c.1O?c.7C:c.4j;7(c.5k==H&&c.5j!=H){u e=P.4h,b=P.4y;c.5k=c.5j+(e&&e.5i||b.5i);c.7z=c.7y+(e&&e.5f||b.5f)}7(!c.3h&&(c.5e||c.5d))c.3h=c.5e||c.5d;7(!c.5c&&c.5b)c.5c=c.5b;7(!c.3h&&c.1J)c.3h=(c.1J&1?1:(c.1J&2?3:(c.1J&4?2:0)));v c}};6.11.1c({3g:q(c,a,b){v c=="3z"?9.3Z(c,a,b):9.F(q(){6.S.1A(9,c,b||a,b&&a)})},3Z:q(d,b,c){v 9.F(q(){6.S.1A(9,d,q(a){6(9).3U(a);v(c||b).O(9,19)},c&&b)})},3U:q(a,b){v 9.F(q(){6.S.1E(9,a,b)})},1t:q(a,b){v 9.F(q(){6.S.1t(a,b,9)})},1R:q(){u a=19;v 9.5a(q(e){9.4u=0==9.4u?1:0;e.2d();v a[9.4u].O(9,[e])||N})},7w:q(f,g){q 3W(e){u p=e.41;1v(p&&p!=9)2g{p=p.L}25(e){p=9};7(p==9)v N;v(e.G=="3V"?f:g).O(9,[e])}v 9.3V(3W).59(3W)},1G:q(f){7(6.3d)f.O(P,[6]);B 6.2q.R(q(){v f.O(9,[6])});v 9}});6.1c({3d:N,2q:[],1G:q(){7(!6.3d){6.3d=K;7(6.2q){6.F(6.2q,q(){9.O(P)});6.2q=H}7(6.M.3j||6.M.2a)P.43("58",6.1G,N);7(!18.7v.C)6(18).1W(q(){6("#3T").1E()})}}});14 q(){6.F(("7u,7t,1W,7s,7r,3z,5a,7q,"+"7p,7o,7n,3V,59,7m,2y,"+"4k,7l,7k,7j,2c").2R(","),q(i,o){6.11[o]=q(f){v f?9.3g(o,f):9.1t(o)}});7(6.M.3j||6.M.2a)P.46("58",6.1G,N);B 7(6.M.1h){P.7i("<7h"+"7f 2m=3T 7e=K "+"2u=//:><\\/3b>");u a=P.4d("3T");7(a)a.7d=q(){7(9.3a!="1n")v;6.1G()};a=H}B 7(6.M.20)6.3N=3m(q(){7(P.3a=="79"||P.3a=="1n"){3M(6.3N);6.3N=H;6.1G()}},10);6.S.1A(18,"1W",6.1G)};7(6.M.1h)6(18).3Z("3z",q(){u a=6.S.Y;E(u b V a){u c=a[b],i=c.C;7(i&&b!=\'3z\')77 c[i-1]&&6.S.1E(c[i-1],b);1v(--i)}});6.11.1c({76:q(c,b,a){9.1W(c,b,a,1)},1W:q(g,d,c,e){7(6.16(g))v 9.3g("1W",g);c=c||q(){};u f="3K";7(d)7(6.16(d)){c=d;d=H}B{d=6.2E(d);f="50"}u h=9;6.2Z({1C:g,G:f,W:d,2t:e,1n:q(a,b){7(b=="28"||!e&&b=="4V")h.1b("27",a.3c).3J().F(c,[a.3c,b,a]);B c.O(h,[a.3c,b,a])}});v 9},72:q(){v 6.2E(9)},3J:q(){v 9.1L("3b").F(q(){7(9.2u)6.4U(9.2u);B 6.3I(9.2A||9.5H||9.27||"")}).2U()}});6.F("4T,4I,4S,4R,4Q,4P".2R(","),q(i,o){6.11[o]=q(f){v 9.3g(o,f)}});6.1c({1M:q(e,c,a,d,b){7(6.16(c)){a=c;c=H}v 6.2Z({G:"3K",1C:e,W:c,28:a,3G:d,2t:b})},6X:q(d,b,a,c){v 6.1M(d,b,a,c,1)},4U:q(b,a){v 6.1M(b,H,a,"3b")},6V:q(c,b,a){v 6.1M(c,b,a,"4N")},6T:q(d,b,a,c){7(6.16(b)){a=b;b={}}v 6.2Z({G:"50",1C:d,W:b,28:a,3G:c})},6S:q(a){6.36.21=a},6Q:q(a){6.1c(6.36,a)},36:{Y:K,G:"3K",21:0,4O:"6P/x-6O-34-6N",4K:K,38:K,W:H},32:{},2Z:q(s){s=6.1c({},6.36,s);7(s.W){7(s.4K&&1g s.W!="1s")s.W=6.2E(s.W);7(s.G.2H()=="1M"){s.1C+=((s.1C.J("?")>-1)?"&":"?")+s.W;s.W=H}}7(s.Y&&!6.3L++)6.S.1t("4T");u f=N;u h=18.4Z?14 4Z("6L.6J"):14 4J();h.7b(s.G,s.1C,s.38);7(s.W)h.3Q("6H-6G",s.4O);7(s.2t)h.3Q("6F-3O-6D",6.32[s.1C]||"6C, 6B 6A 6z 4r:4r:4r 6y");h.3Q("X-6x-6w","4J");7(s.56)s.56(h);7(s.Y)6.S.1t("4P",[h,s]);u g=q(d){7(h&&(h.3a==4||d=="21")){f=K;7(i){3M(i);i=H}u c;2g{c=6.54(h)&&d!="21"?s.2t&&6.4F(h,s.1C)?"4V":"28":"2c";7(c!="2c"){u b;2g{b=h.3E("53-3O")}25(e){}7(s.2t&&b)6.32[s.1C]=b;u a=6.55(h,s.3G);7(s.28)s.28(a,c);7(s.Y)6.S.1t("4Q",[h,s])}B 6.2X(s,h,c)}25(e){c="2c";6.2X(s,h,c,e)}7(s.Y)6.S.1t("4S",[h,s]);7(s.Y&&!--6.3L)6.S.1t("4I");7(s.1n)s.1n(h,c);7(s.38)h=H}};u i=3m(g,13);7(s.21>0)4C(q(){7(h){h.6r();7(!f)g("21")}},s.21);2g{h.6p(s.W)}25(e){6.2X(s,h,H,e)}7(!s.38)g();v h},2X:q(s,a,b,e){7(s.2c)s.2c(a,b,e);7(s.Y)6.S.1t("4R",[a,s,e])},3L:0,54:q(r){2g{v!r.23&&7A.7B=="4l:"||(r.23>=5u&&r.23<6l)||r.23==5m||6.M.20&&r.23==I}25(e){}v N},4F:q(a,c){2g{u b=a.3E("53-3O");v a.23==5m||b==6.32[c]||6.M.20&&a.23==I}25(e){}v N},55:q(r,b){u c=r.3E("6k-G");u a=!b&&c&&c.J("4B")>=0;a=b=="4B"||a?r.6j:r.3c;7(b=="3b")6.3I(a);7(b=="4N")a=49("("+a+")");7(b=="3F")6("<1x>").3F(a).3J();v a},2E:q(a){u s=[];7(a.15==2b||a.3C)6.F(a,q(){s.R(2l(9.6i)+"="+2l(9.2v))});B E(u j V a)7(a[j]&&a[j].15==2b)6.F(a[j],q(){s.R(2l(j)+"="+2l(9))});B s.R(2l(j)+"="+2l(a[j]));v s.5M("&")},3I:q(a){7(18.4A)18.4A(a);B 7(6.M.20)18.4C(a,0);B 49.3D(18,a)}});6.11.1c({1m:q(b,a){v b?9.1w({1u:"1m",29:"1m",1e:"1m"},b,a):9.1i(":1y").F(q(){9.T.U=9.2i?9.2i:"";7(6.1f(9,"U")=="1P")9.T.U="2h"}).2U()},1j:q(b,a){v b?9.1w({1u:"1j",29:"1j",1e:"1j"},b,a):9.1i(":4f").F(q(){9.2i=9.2i||6.1f(9,"U");7(9.2i=="1P")9.2i="2h";9.T.U="1P"}).2U()},5G:6.11.1R,1R:q(a,b){v 6.16(a)&&6.16(b)?9.5G(a,b):a?9.1w({1u:"1R",29:"1R",1e:"1R"},a,b):9.F(q(){6(9)[6(9).37(":1y")?"1m":"1j"]()})},6e:q(b,a){v 9.1w({1u:"1m"},b,a)},6d:q(b,a){v 9.1w({1u:"1j"},b,a)},6b:q(b,a){v 9.1w({1u:"1R"},b,a)},6a:q(b,a){v 9.1w({1e:"1m"},b,a)},69:q(b,a){v 9.1w({1e:"1j"},b,a)},7U:q(c,a,b){v 9.1w({1e:a},c,b)},1w:q(d,h,f,g){v 9.1l(q(){u c=6(9).37(":1y"),1H=6.5z(h,f,g),5y=9;E(u p V d){7(d[p]=="1j"&&c||d[p]=="1m"&&!c)v 6.16(1H.1n)&&1H.1n.O(9);7(p=="1u"||p=="29"){1H.U=6.1f(9,"U");1H.2f=9.T.2f}}7(1H.2f!=H)9.T.2f="1y";9.2k=6.1c({},d);6.F(d,q(a,b){u e=14 6.2M(5y,1H,a);7(b.15==3y)e.2W(e.1K(),b);B e[b=="1R"?c?"1m":"1j":b](d)})})},1l:q(a,b){7(!b){b=a;a="2M"}v 9.F(q(){7(!9.1l)9.1l={};7(!9.1l[a])9.1l[a]=[];9.1l[a].R(b);7(9.1l[a].C==1)b.O(9)})}});6.1c({5z:q(b,a,c){u d=b&&b.15==64?b:{1n:c||!c&&a||6.16(b)&&b,1B:b,2I:c&&a||a&&a.15!=45&&a||(6.2I.4i?"4i":"4w")};d.1B=(d.1B&&d.1B.15==3y?d.1B:{61:60,89:5u}[d.1B])||8a;d.2N=d.1n;d.1n=q(){6.5I(9,"2M");7(6.16(d.2N))d.2N.O(9)};v d},2I:{4w:q(p,n,b,a){v b+a*p},4i:q(p,n,b,a){v((-5W.5X(p*5W.8e)/2)+0.5)*a+b}},1l:{},5I:q(b,a){a=a||"2M";7(b.1l&&b.1l[a]){b.1l[a].4e();u f=b.1l[a][0];7(f)f.O(b)}},3B:[],2M:q(f,e,g){u z=9;u y=f.T;z.a=q(){7(e.3A)e.3A.O(f,[z.2o]);7(g=="1e")6.1b(y,"1e",z.2o);B{y[g]=8m(z.2o)+"4o";y.U="2h"}};z.5V=q(){v 39(6.1f(f,g))};z.1K=q(){u r=39(6.2z(f,g));v r&&r>-8l?r:z.5V()};z.2W=q(c,b){z.4s=(14 5T()).5S();z.2o=c;z.a();6.3B.R(q(){v z.3A(c,b)});7(6.3B.C==1){u d=3m(q(){u a=6.3B;E(u i=0;i<a.C;i++)7(!a[i]())a.8j(i--,1);7(!a.C)3M(d)},13)}};z.1m=q(){7(!f.24)f.24={};f.24[g]=6.1b(f.T,g);e.1m=K;z.2W(0,9.1K());7(g!="1e")y[g]="8q";6(f).1m()};z.1j=q(){7(!f.24)f.24={};f.24[g]=6.1b(f.T,g);e.1j=K;z.2W(9.1K(),0)};z.3A=q(a,c){u t=(14 5T()).5S();7(t>e.1B+z.4s){z.2o=c;z.a();7(f.2k)f.2k[g]=K;u b=K;E(u i V f.2k)7(f.2k[i]!==K)b=N;7(b){7(e.U!=H){y.2f=e.2f;y.U=e.U;7(6.1f(f,"U")=="1P")y.U="2h"}7(e.1j)y.U="1P";7(e.1j||e.1m)E(u p V f.2k)6.1b(y,p,f.24[p])}7(b&&6.16(e.1n))e.1n.O(f);v N}B{u n=t-9.4s;u p=n/e.1B;z.2o=6.2I[e.2I](p,n,a,(c-a),e.1B);z.a()}v K}}})}',62,524,'||||||jQuery|if||this|||||||||||||||||function||||var|return||||||else|length||for|each|type|null|undefined|indexOf|true|parentNode|browser|false|apply|document|nodeName|push|event|style|display|in|data||global|||fn|className||new|constructor|isFunction|test|window|arguments|events|attr|extend|firstChild|opacity|css|typeof|msie|filter|hide|mergeNum|queue|show|complete|replace|handle|nodeType|table|string|trigger|height|while|animate|div|hidden|tbody|add|duration|url|toUpperCase|remove|break|ready|opt|_|button|cur|find|get|tb|target|none|guid|toggle|args|merge|styleFloat|exec|load|nextSibling|ret|pushStack|safari|timeout|nth|status|orig|catch|al|innerHTML|success|width|opera|Array|error|preventDefault|rl|overflow|try|block|oldblock|done|curAnim|encodeURIComponent|id||now|index|readyList|disabled|grep|ifModified|src|value|inArray|multiFilter|select|curCSS|text|checked|trim|stopPropagation|param|domManip|substr|toLowerCase|easing|chars|insertBefore|makeArray|fx|old|ownerDocument|last|first|split|childNodes|selected|end|tr|custom|handleError|empty|ajax|el|clean|lastModified|String|form|getAttribute|ajaxSettings|is|async|parseFloat|readyState|script|responseText|isReady|append|defaultView|bind|which|position|mozilla|map|delete|setInterval|static|RegExp|oWidth|removeChild|oHeight|cloneNode|match|child|toString|has|float|Number|unload|step|timers|jquery|call|getResponseHeader|html|dataType|props|globalEval|evalScripts|GET|active|clearInterval|safariTimer|Modified|num|setRequestHeader|getElementsByTagName|currentStyle|__ie_init|unbind|mouseover|handleHover|init|getComputedStyle|one|isXMLDoc|relatedTarget|fix|removeEventListener|handler|Function|addEventListener|triggered|visibility|eval|nodeIndex|radio|classFilter|getElementById|shift|visible|appendChild|documentElement|swing|fromElement|submit|file|swap|expr|px|parents|sibling|00|startTime|previousSibling|lastToggle|parent|linear|ol|body|tagName|execScript|xml|setTimeout|version|setArray|httpNotModified|fl|prop|ajaxStop|XMLHttpRequest|processData|alpha|href|json|contentType|ajaxSend|ajaxSuccess|ajaxError|ajaxComplete|ajaxStart|getScript|notmodified|colgroup|100|not|ActiveXObject|POST|slice|fieldset|Last|httpSuccess|httpData|beforeSend|getPropertyValue|DOMContentLoaded|mouseout|click|ctrlKey|metaKey|keyCode|charCode|scrollTop|unique|createElement|scrollLeft|clientX|pageX|webkit|304|srcElement|appendTo|unshift|prevObject|on|after|before|200|removeAttr|prepend|cssFloat|self|speed|parse|input|reset|image|password|checkbox|_toggle|textContent|dequeue|lastChild|odd|even|join|contains|gt|lt|eq|nodeValue|getTime|Date|zoom|max|Math|cos|font|maxLength|600|slow|maxlength|readOnly|Object|readonly|createTextNode|class|htmlFor|fadeOut|fadeIn|slideToggle|CSS1Compat|slideUp|slideDown|compatMode|boxModel|compatible|name|responseXML|content|300|ie|noConflict|ra|send|it|abort|rv|userAgent|navigator|concat|With|Requested|GMT|1970|Jan|01|Thu|Since|reverse|If|Type|Content|array|XMLHTTP|ig|Microsoft|NaN|urlencoded|www|application|ajaxSetup|val|ajaxTimeout|post|setAttribute|getJSON|getAttributeNode|getIfModified|method|FORM|action|options|serialize|col|th|td|loadIfModified|do|colg|loaded|tfoot|open|thead|onreadystatechange|defer|ipt|leg|scr|write|keyup|keypress|keydown|change|mousemove|mouseup|mousedown|dblclick|scroll|resize|focus|blur|frames|hover|clone|clientY|pageY|location|protocol|toElement|clientWidth|clientHeight|cancelBubble|relative|returnValue|left|detachEvent|right|absolute|attachEvent|substring|offsetWidth|object|offsetHeight|continue|Width|border|fadeTo|padding|size|uFFFF|Left|u0128|Right|Bottom|textarea|Top|enabled|innerText|only|toggleClass|removeClass|fast|400|wrap|addClass|removeAttribute|PI|insertAfter|prependTo|children|line|splice|siblings|10000|parseInt|prev|next|weight|1px|prototype'.split('|'),0,{}));

var script = new function(){

	var lib = new Array();
	var subscribers = {};
    var theScript = this;
    var draghandles = {}; /*keep a list of assigned drag handles.*/

	this.errlog = new Array();
	this.evtlog = new Array();
	this.baseURL = "./";
   
   
    this.lastX = null;
    this.lastY = null;
    this.dragee = null;
    this.dropee = null;
    this.dragsrc = null;
    this.dragaxis = null;
    this.sizee = new Array();

	/*
	Default configuration:
	*/
	
	/**
		Associate an object class name with a URL. Will overwrite existing association.
		* String strObj = the class name, represented as a string
		* String strURL = URL location of the script defining the class.
		*/
	this.setLib = function(strObj, strURL){
		lib[strObj] = strURL;
	};
	
	function srcloaded(strSrc){
		var s = document.getElementsByTagName("script");
		for(var x=0; x<s.length; x++){
			if(s[x].getAttribute("src")==strSrc) return true;
		}
		return false;
	};
	
	/**
		Import a JS file defining one or more objects.
		@ String strURL = the URL of the script.
		@ String strVarWatch = name of global variable to watch for loading into memory
		@ String strType = the variable type expected for the global (e.g. "object" or "function")
		@ Function fnOnScriptLoad = the function to execute when the script loads.
	*/
	this.loadScript = function(strURL){
		if(!srcloaded(strURL)){
			var s = document.createElement("script");
			s.src = strURL;
			s.setAttribute('language', 'javascript');
			s.setAttribute('type', 'text/javascript');
			document.getElementsByTagName("head")[0].appendChild(s);
		}
	};
	
	/**
	    Load 1..x scripts, test for availability and callback.
	    @ Array arrScriptDef = script definitions
	        - Each object in the array is:
	            @ String strURL = the URL of the script.
		        @ String strVarWatch = name of global variable to watch for loading into memory
		        @ String strType = the variable type expected for the global (e.g. "object" or "function")
	    @ Function fnOnScriptLoad = the function to execute when all of the scripts have loaded and initialized as expected.
	    @ Function fnOnScriptFail = the function to execute when something fails to initialize as expected.
	    @ Integer intTimeout = # seconds to wait for all resources to load.
	*/
	this.loadDependencies = function(arrScriptDef,fnOnScriptLoaded,fnOnScriptFail,intTimeout){
	    var startLoad = (new Date()).getTime();
	    if(typeof(intTimeout)=="undefined"){intTimeout=30;}
	    var watchLoaded = setInterval(function(){
	        var loaded = 0;
	        for(var x=0; x<arrScriptDef.length; x++){
	            if(eval("typeof("+arrScriptDef[x]["strVarWatch"]+")")!="undefined"){loaded++;}
	        }
	        if(loaded==arrScriptDef.length){
	              clearInterval(watchLoaded);
	              var init = 0;
	              for(var x=0; x<arrScriptDef.length; x++){
	                   if(eval("typeof("+arrScriptDef[x]["strVarWatch"]+")")==arrScriptDef[x]["strType"]){
	                    init++;
	                   }else{
	                    theScript.errlog.push("Unexpected type: '"+(arrScriptDef[x]["strVarWatch"])+"' is '"+(eval("typeof("+arrScriptDef[x]["strVarWatch"]+")"))+"'; should have been '"+(arrScriptDef[x]["strType"])+"'");
	                   }
	              }
	              if(init==arrScriptDef.length){
	                    if(typeof(fnOnScriptLoaded)=="function"){fnOnScriptLoaded();}
	              }else{
	                    theScript.errlog.push("Some resources did not load the correct type.");
	                    if(typeof(fnOnScriptFail)=="function"){fnOnScriptFail();}
	              }
	        }else{
	            var now = (new Date()).getTime();
	            if((now - startLoad)>(intTimeout*1000)){
	                clearInterval(watchLoaded);
	                theScript.errlog.push("Some resources failed to load within the time window.");
	                if(typeof(fnOnScriptFail)=="function"){fnOnScriptFail();}
	            }
	        }
	    },50);
	    for(var x=0; x<arrScriptDef.length; x++){
	        var strURL = arrScriptDef[x]["strURL"];
	        if(!srcloaded(strURL)){
			    var s = document.createElement("script");
			    s.src = strURL;
			    s.setAttribute('language', 'javascript');
			    s.setAttribute('type', 'text/javascript');
			    document.getElementsByTagName("head")[0].appendChild(s);
		    }
	    }
	    
	};
	
	//Alias:
	this.include = function(strURL){
	    this.loadScript(strURL);
	};
	
	/**
	    Get a new object by its class name.
	*/
	this.createObject = function(strObj){
		if(typeof(lib[strObj])!="undefined"){
			this.loadScript(lib[strObj]);
			try{
				return eval("new "+strObj+"()");
			}catch(err){
				this.errlog.push(err);
			}
		}else{
			return null;
		}
	};
	
	/**
	Cookie controlers
	*/
	this.createCookie = function(name,value,days) {
			if (days) {
				var date = new Date();
				date.setTime(date.getTime()+(days*24*60*60*1000));
				var expires = "; expires="+date.toGMTString();
			}
			else var expires = "";
			document.cookie = name+"="+value+expires+"; path=/";
		};
		
	this.readCookie = function(name) {
			var nameEQ = name + "=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++) {
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
			}
			return null;
		};
		
	this.eraseCookie = function(name) {
			createCookie(name,"",-1);
		};
    
    
    /* ================================================================= */
    /*From http://laurens.vd.oever.nl/weblog/items2005/closures/ */
    Function.prototype.closure = function(obj){
        if (!window.__objs){
            window.__objs = [];
            window.__funs = [];
        }
        var fun = this;
        var objId = obj.__objId;
        if (!objId){
            __objs[objId = obj.__objId = __objs.length] = obj;
        }
        var funId = fun.__funId;
        if (!funId){
            __funs[funId = fun.__funId = __funs.length] = fun;
        }

        if (!obj.__closures){
            obj.__closures = [];
        }
        var closure = obj.__closures[funId];
        if (closure){
            return closure;
        }
        obj = null;
        fun = null;
        return __objs[objId].__closures[funId] = function (){
            return __funs[funId].apply(__objs[objId], arguments);
        };
    };



    
    /* ================================================================= */
    
    
     /**
        Add event handlers to an object.
        * HTMLElement objTarget = target object
        * String strType = type of event (minus the "on")
        * Function fnHandler = function to invoke on the event.
        */
    this.addEvent = function(objTarget,strType,fnHandler){
        if(typeof(fnHandler)!="function") return false;
        if (objTarget.addEventListener){
            objTarget.addEventListener(strType, fnHandler, false);
            return true;
        }else if(objTarget.attachEvent){
            objTarget.attachEvent("on"+strType,fnHandler.closure(objTarget));
            /*objTarget.attachEvent("on"+strType,fnHandler);*/
            return true;
        }else{
            return false;
        }     
    };
    
    this.purgeEvents = function(obj){
           if(typeof(obj.__closures)=="object"){
               window.status = "|";
               for(x in obj.__closures){
                    if(typeof(obj.__closures[x])=="function"){
                        obj.__closures[x]=null;
                    }
               }
               window.status = "-";
           }else{
                /* alert("No closed events in "+obj.nodeName); */
           }
           var cn = obj.childNodes;
           for(var x=0; x<cn.length; x++){
                if(cn[x].nodeType==1){
                    theScript.purgeEvents(cn[x]);
                }
           }
  
       function callPurge(me){
            return function(){theScript.purgeEvents(me);};
       };
    };
    
    /*theScript.addEvent(window,"unload",function(){theScript.purgeEvents(document.body);});*/
    
    /**
        Subscribe to an event: notify an object when something happens to a class of object.
            * Object objMe = the object to notify
            * String strTopic = the topic to listen for.
            * Function fnOnEvent = public method of object to call when the event fires.
    */
    this.subscribe = function(objMe,strTopic,fnOnEvent){
       if(typeof(subscribers[strTopic])=="undefined"){
          subscribers[strTopic] = [];
       }
       subscribers[strTopic].push({"obj":objMe,"fn":fnOnEvent});
    };
    
    /**
        Let subscribers know that a change happened.
            * String strTopic = the topic that happened.
            * JSONObject objData = the data associated with the topic. This will be the one argument of each
            	subscriber's onSubscribedEvent method.
           
    */
    this.publish = function(strTopic,objData){
        if(typeof(subscribers[strTopic])=="object"){
            for(var x=0; x<subscribers[strTopic].length; x++){
                /*
                if(typeof(subscribers[strTopic][x].onSubscribedEvent)=="function"){
                    subscribers[strTopic][x].onSubscribedEvent(objData);
                }
                */
                if(typeof(subscribers[strTopic][x].obj) == "object" && typeof(subscribers[strTopic][x].fn)=="function"){
                	/* (subscribers[strTopic][x].obj).subscribers[strTopic][x].fn(objData); */
                	subscribers[strTopic][x].fn(objData);
                }
            }
        }
    };
    
    /**
			Start resizing an object.
			*HTMLElement objSize = object to resize.
			*Integer intRX = multiplier for resizing LR:
				1: grow width
				-1: shrink width
				defaults to 0.
			* Integer intRY = multiplier for resizing TB:
				1: grow height
				-1: shrink height
				defaults to 0.
			*Integer intMX = multiplier for moving LR:
				1: move right
				-1: move left
				0: don't move LR
			*Integer intMX = multiplier for moving TB:
				1: move down
				-1: move up
				0: don't move TB
		*/
	this.startSize = function(objSize,intRX,intRY,intMX,intMY){
		intRX = (!isNaN(intRX)) ? intRX : 0;
		intRY = (!isNaN(intRY)) ? intRY : 0;
		intMX = (!isNaN(intMX)) ? intMX : 0;
		intMY = (!isNaN(intMY)) ? intMY : 0;
		
		if(objSize.style.width=="") objSize.style.width = objSize.offsetWidth;
		if(objSize.style.height=="") objSize.style.height = objSize.offsetHeight;
		this.sizee.push({obj:objSize,rx:intRX,ry:intRY,mx:intMX,my:intMY});
	};

    /**
			Make an object dragable.
			* HTMLElement me = target object; must be block level
			* Boolean bUseOrig = Drag the original object? Defaults to false (drag a copy)
			* String strAxis = Single axis along which to drag; defaults to null (drag both axes).
			* DOMObject handle = the part of the drag object to use as a handle; a new one will be created if this is null
			
			returns the drag handle.
		*/
	this.makeDragable = function(me,bUseOrig,strAxis,handle){
	    try{
	        if(me.getAttribute("_dragable")==1){
	            return null;
	        }
	    }catch(err){
	        window.status = "Can't make dragable.";
	    }
		var myType = String(me.nodeName).toUpperCase();
		if(myType=="TD"){
			var me2 = document.createElement("div");
			var c = me.childNodes;
			for(var x=0; x<c.length; x++){
				me2.appendChild(c[x].cloneNode(true));
				me.removeChild(c[x]);
			}
			me.appendChild(me2);
			me = me2;
			myType="DIV";
		}
		
		if(myType=="DIV" || myType=="P"){
			if(me.style.position==""){me.style.position="relative";}
			me.style.width = "" + me.offsetWidth + "px";
			var h = (typeof(handle)=="object")? handle : me.appendChild(document.createElement("div"));
			h.title="Click here to drag.";
			h.style.cursor = "move";
			h.onmousedown=function(){
				theScript.startDrag(me,bUseOrig,strAxis);
			};
			if(h!=handle){
			    with(h.style){
				    cursor="move";
				    opacity=0;
				    filter="alpha(opacity=0)";
				    position="absolute";
				    top=0;
				    left=0;
				    width="100%";
				    height="15px";
				    zIndex="100";
				    overflow="hidden";
				    backgroundColor="white";	
			    }
			    h.onmouseover=function(){
				    with(this.style){
					    opacity=0.3;
					    filter="alpha(opacity=30)";
					    backgroundColor="black";
				    }
			    };
			    h.onmouseout=function(){
				    with(this.style){
					    opacity=0;
					    filter="alpha(opacity=0)";
					    backgroundColor="white";
				    }
			    };
			    h.onmouseup=function(){
			        window.status=("Mousing up on handle");
				    with(this.style){
					    opacity=0;
					    filter="alpha(opacity=0)";
					    backgroundColor="white";	
				    }
				    window.status = "The handle type is "+h.nodeName;
			    };
			}
			me.setAttribute("_dragable",1);
			return h;
		}
	};

    /**
			Start dragging an object
			* HTMLElement objDrag = object to drag.
			* Boolean bUseOrig = Drag the original object? Defaults to false (drag a copy)
			* String strAxis = Single axis along which to drag; defaults to null (drag both axes).
		*/
	this.startDrag = function(objDrag,bUseOrig,strAxis){
			if(typeof(bUseOrig)=="undefined") bUseOrig = false;
			this.dragaxis = (typeof(strAxis)=="string") ? strAxis.toUpperCase(): "";
			this.dragsrc = objDrag;
			this.dragee = (bUseOrig) ? objDrag : objDrag.cloneNode(true);
			if(bUseOrig){
			    try{
			        this.dragee.setAttribute("_filter",this.dragee.style.filter);
			        this.dragee.setAttribute("_opacity",this.dragee.style.opacity);
			        this.dragee.setAttribute("_mozOpacity",this.dragee.style.mozOpacity);
			    }catch(err){
			        
			    }
			}
			with(this.dragee.style){
				position = "absolute";
				/*
				top = "" + (objDrag.offsetTop) + "px";
				left = "" + objDrag.offsetLeft + "px";
				*/
				top = "" + theScript.findPosY(objDrag) + "px";
				left = "" + theScript.findPosX(objDrag) + "px";
				
				zIndex = 100;
				filter = "alpha(opacity=40)";
				opacity = 0.4;
				mozOpacity = 0.4;
			}
			if(!bUseOrig){
				document.body.appendChild(this.dragee);
			}
	};
	
	/**
			Add all eight size handles to an object
			* HTMLElement objSize = the element to resize.
		*/
	this.addAllSizeHandles = function(objSize){
		
		this.addSizeHandle(objSize,"n");
 		this.addSizeHandle(objSize,"s");
 		this.addSizeHandle(objSize,"e");
 		this.addSizeHandle(objSize,"w");
 		this.addSizeHandle(objSize,"nw");
 		this.addSizeHandle(objSize,"ne");
 		this.addSizeHandle(objSize,"sw");
 		this.addSizeHandle(objSize,"se");
	};
	
	/**
		Add a handle for resizing an object.
		* HTMLElement objSize = the element to resize.
		* String strType = type of handle to add, defined by compass point: N,S,E,W,NW,NE,SW,SE
		*/
	this.addSizeHandle = function(objSize,strType){
		if(objSize.getAttribute("_dragable")==1 && strType.toUpperCase()=="N"){
		    return false;
		}
		if(parseInt(objSize.style.padding)<5) objSize.style.padding = "5px";
		if(objSize.style.position=="") objSize.style.position = "relative";
		var d = document.createElement("div");
		with(d.style){
			position = "absolute";
			height="3px";
			width="3px";
			zIndex=100;
			
		}
		switch(strType.toUpperCase()){
			case "N":
				d.style.top = 0;
				d.style.left=0;
				d.style.width="100%";
				d.style.cursor = "n-resize";
				this.addEvent(d,"mousedown",function(){theScript.startSize(objSize,0,-1,0,1)});
			break;
			
			case "S":
				d.style.top = "";
				d.style.bottom=0;
				d.style.left = 0;
				d.style.width="100%";
				d.style.cursor = "s-resize";
				this.addEvent(d,"mousedown",function(){theScript.startSize(objSize,0,1,0,0)});
			break;
			case "W":
				d.style.top = 0;
				d.style.left = 0;
				d.style.height="100%";
				d.style.cursor = "w-resize";
				this.addEvent(d,"mousedown",function(){theScript.startSize(objSize,-1,0,1,0)});
			break;
			case "E":
				d.style.top = 0;
				d.style.right = 0;
				d.style.height="100%";
				d.style.cursor = "e-resize";
				this.addEvent(d,"mousedown",function(){theScript.startSize(objSize,1,0,0,0)});
			break;
			
			case "NW":
				d.style.top = 0;
				d.style.left = 0;
				d.style.cursor = "nw-resize";
				this.addEvent(d,"mousedown",function(){theScript.startSize(objSize,-1,-1,1,1)});
			break;
			
			case "NE":
				d.style.top = 0;
				d.style.right = 0;
				d.style.cursor = "ne-resize";
				this.addEvent(d,"mousedown",function(){theScript.startSize(objSize,1,-1,0,1)});
			break;
			case "SW":
				d.style.top = "";
				d.style.bottom = 0;
				d.style.left = 0;
				d.style.cursor = "sw-resize";
				this.addEvent(d,"mousedown",function(){theScript.startSize(objSize,-1,1,1,0)});
			break;
			
			case "SE":
				d.style.top = "";
				d.style.bottom = 0;
				d.style.right = 0;
				d.style.cursor = "se-resize";
				this.addEvent(d,"mousedown",function(){theScript.startSize(objSize,1,1,0,0)});
			break;
		}
		objSize.appendChild(d);
	};
	
	
	this.findPosX = function(obj){
    	var curleft = 0;
	    if (obj.offsetParent){
	        while (obj.offsetParent){
			    curleft += obj.offsetLeft;
			    obj = obj.offsetParent;
		    }
	    }else if (obj.x){
		    curleft += obj.x;
	    }
	    return curleft;
    };
    
    
    
    this.findPosY = function(obj){
	    var curtop = 0;
	    if (obj.offsetParent){
		    while (obj.offsetParent)
		    {
			    curtop += obj.offsetTop;
			    obj = obj.offsetParent;
		    }
	    }else if (obj.y){
		    curtop += obj.y;
	    }
	    return curtop;
    };
    
	
	/**
	    Cross-browser, manual event trigger
	    * HTMLElement obj = the object on which to fire the event.
	    * String eventType = the type of event to fire (e.g. "onchange," "onblur," etc.)
	*/
	this.fireEvent = function(obj,eventType){
        if(typeof(obj.fireEvent) != "undefined"){
            obj.fireEvent(/^on/.test(eventType) ? eventType : "on" + eventType);
        }else{
            var evt = document.createEvent("HTMLEvents");
            evt.initEvent(eventType.replace(/^on/,""),true,true);
            obj.dispatchEvent(evt);
        }
    };


     /**
        Sort an array of objects; use [array].sort(script.compField(fld,desc))
        * String fld = name of field on which to sort.
        * Int desc = direction; 1 = ascending; -1 = descending
        
    */
     this.compField = function(fld,desc){
	    if(typeof(desc)=="undefined") desc = 1;
		return function(me,you){
			myVal = me[fld];
			yourVal = you[fld];
			return desc * ((isNaN(myVal) && isNaN(yourVal)) ? ((myVal > yourVal) ? +1:-1) : ((Number(myVal) > Number(yourVal)) ? +1:-1));
		}
	};
	
	/**
			Set the action to take when a dragged object is dropped on another object.
			* HTMLElement objTarget = target object, on which the object is dropped.
			* Function fnAction = function to execute on drop.
				- first argument is objTarget
				- second argument is the object dropped.
		*/
	this.setDrop = function(objTarget,fnAction){
		if(typeof(objTarget)!="object" || typeof(fnAction)!="function") return false;
		this.addEvent(objTarget,"mouseover",function(){
			if(theScript.dropee!=null){
			    var myDropee = theScript.dropee;
			    theScript.dropee = null;
				fnAction(objTarget,myDropee);
	   			
			}else{
			   /* alert("Nothing to drop"); */
			}
		});
	};
   
   this.df = new function(){
        var theDF = this;
        
       /**
            Shorthand for creating DOM objects. Returns a reference to the object
            @ DOMObject parent = the parent to which to append the new node.
            @ String node = name of the node to add
            @ Object attribs = key-value pairs of attributes (e.g. "class":"important","id":"mynode"
            @ String content = text content of node
            @ Array content = array of nodes to add, using node,attribs,content,handlers for recursive call
            @ Object handers = key-value pairs of handlers, with keys being events sans "on" and values being functions
            @ Boolean suppress = don't publish the element add; defaults false
       */
       this.addNode = function(parent,node,content,attribs,handlers,suppress){
            if(typeof(parent)!="object"){return null;}
            if(parent.nodeType!=1){return null;}
            if(typeof(suppress)=="undefined"){suppress=false;}
            var doc = parent.ownerDocument;
            var dash = new RegExp("^([a-z]+)\-([a-z]{1})([a-z]+)$");
            try{
                /* Append @ end to allow for input types === */
                //var o = doc.createElement(node);
                
                if(typeof(attribs)=="object"){
                    if(typeof(attribs["name"])=="string"){
                        try{
                            var o = doc.createElement("<"+node+" name='"+attribs["name"]+"'>");
                        }catch(err){
                            var o = doc.createElement(node); 
                            o.name = attribs["name"];
                        }
                    }else{
                      var o = doc.createElement(node);  
                    }
                }else{
                 var o = doc.createElement(node);  
                }
                
                for(a in attribs){
                    switch(a){
                        case "class":
                            o.className = attribs[a];
                        break;
                        case "style":
                            var s = String(attribs[a]).split(";");
                            for(var x=0; x<s.length; x++){
                                var e = String(s[x]).split(":");
                                if(e[0]!=""){
                                    if(e[0].match(dash)){
                                        var cap = String(e[0].replace(dash,"$2")).toUpperCase();
                                        cn = e[0].replace(dash,("$1"+cap+"$3"));
                                    }else{
                                        cn = e[0];
                                    }
                                    o.style[cn] = e[1];
                                }  
                            }
                        break;
                        case "colspan":
                                try{o.colSpan = Number(attribs[a]);}catch(err){alert("Could not set");}
                        break;
                        case "id":
                            o.id = attribs[a];
                        break;
                        default:
                            o.setAttribute(a,attribs[a]);
                           
                            try{o[a]=attribs[a];}catch(err2){}
                        break;
                    }
                }
                var o = parent.appendChild(o);
                if(typeof(content)!="undefined"){
                    switch(typeof(content)){
                        case "string":
                            if(node!="br" && node!="img" && node!="hr" && node!="table" && node!="tr" && node!="tbody" && node!="input"){
                                o.appendChild(doc.createTextNode(content));
                            }
                        break;
                        case "object":
                            if(content!=null){
                                for(var x=0; x<content.length; x++){
                                    theDF.addNode(o,content[x][0],content[x][1],content[x][2],content[x][3],true);
                                }
                            }
                        break;
                    }
                }
                if(typeof(handlers)!="undefined" && handlers!=null){
                    for(h in handlers){
                        if(typeof(handlers[h])=="function"){
                            theScript.addEvent(o,h,handlers[h]);
                        }
                    }
                }
                
                
                try{
                    for(a in attribs){
                        switch(a){
                            case "checked":
                                window.status = typeof(attribs[a]);
                                o.checked = attribs[a];
                            break;
                            case "selected":
                                o.selected = attribs[a];
                            break;  
                            case "disabled":
                                o.disabled = attribs[a];
                            break;
                             case "id":
                                o.id = attribs[a];
                            break;
                            default:
                            break;
                        }
                    }
                 }catch(err){
                 
                 }
                 if(!suppress){theScript.publish("/add/element",{"element":o});}
                return o;
            }catch(err){
                theScript.errlog.push("Failed to append object: "+err.description);
            }
            
       };
   };
   
   /**
   ========================================================================================
   	Initialization
   */
   	
    theScript.addEvent(document,"mousemove",function(ev){
        if(!ev) ev = event;
        if(theScript.lastX==null) theScript.lastX = ev.screenX;
	    if(theScript.lastY==null) theScript.lastY = ev.screenY;
	    var dX = (ev.screenX-theScript.lastX);
	    var dY = (ev.screenY-theScript.lastY);
	    theScript.lastX = ev.screenX;
	    theScript.lastY = ev.screenY;
	    
	    if(theScript.dragee!=null){
	    	if(theScript.dragaxis!="X") theScript.dragee.style.top = "" + (parseInt(theScript.dragee.style.top) + dY) +"px";
	    	if(theScript.dragaxis!="Y") theScript.dragee.style.left = "" + (parseInt(theScript.dragee.style.left) + dX) +"px";
	    }
	    var sizee;
	    for(var x=0; x<theScript.sizee.length; x++){
	    	sizee = theScript.sizee[x];
	    	try{
		    	with(sizee.obj.style){
		    		if(position=="absolute"){
		    			top = + (parseInt(top) + (sizee.my*dY)) +"px";
		    			left = + (parseInt(left) + (sizee.mx*dX)) +"px";
		    		}
		    		height = + (parseInt(height) + (sizee.ry*dY)) +"px";
		    		width = + (parseInt(width) + (sizee.rx*dX)) +"px";
		    	}
	    	}catch(err){
	    	
	    	}
	    }
    });
    
   theScript.addEvent(document,"mouseup",function(evt){
	   	if(!evt){evt=window.event;}
	   	if(theScript.dragee!=null){
	   		if(theScript.dragee != theScript.dragsrc){
	   			document.body.removeChild(theScript.dragee);
	   		}else{
	   			with(theScript.dragee.style){
	   				filter = "alpha(opacity=100)";
					opacity = 1;
					mozOpacity = 1;
	   			}
	   			try{
					theScript.dragee.style.filter = theScript.dragee.getAttribute("_filter");
			        theScript.dragee.style.opacity = theScript.dragee.getAttribute("_opacity");
			        theScript.dragee.style.mozOpacity = theScript.dragee.getAttribute("_mozOpacity");
			    }catch(err){
				}
	   		}
	   		theScript.dropee = theScript.dragee;
	   		setTimeout(function(){
	   		  theScript.dropee = null;
	   		  theScript.dragsrc = null;	  
	   		},500);
	   		
	   		theScript.dropee_x = theScript.dragee.offsetLeft;
	   		theScript.dropee_y = theScript.dragee.offsetTop;
	   		theScript.dragee = null;
	   		//theScript.dragsrc = null;	
	   		/*
	   		setTimeout(function(){
	   			theScript.dragee = null;
	   			theScript.dropee = null;
	   			theScript.dragsrc = null;	
	   		},100);
	   		*/
	   	}
	   	while(theScript.sizee.length>0){
	   		theScript.sizee.pop(0);
	   	}
   });
};

/*=====================================================================
    Extensions
    ======================
    */
    
    /*
    Format a date based on PHP-style formatting patterns
        Args
            String strFormat = PHP formatting pattern
                d = day of month (1-31)
                D = short, literal day (Mon-Sun)
                l = full, literal day (Monday - Sunday)
                F = full, literal month (January - December)
                M = short, literal month (Jan - Dec)
                m = numeric month, padded to two places
                n = numeric month w/o padding
                H = hour (24-hour clock)
                h = hour (12-hour clock)
                i = minute
                s = second
                Y = year (4-digit)
                a = "a.m."/"p.m."
            String strLang = ISO language identifier
    */
    Date.prototype.formatString = function(strFormat,strLang){
    	if(typeof(strLang)=="undefined"){
    		strLang = "en";
    	}
    	var litDay = [{"en":"Sunday"},{"en":"Monday"},{"en":"Tuesday"},{"en":"Wednesday"},{"en":"Thursday"},{"en":"Friday"},{"en":"Saturday"}];
    	var litMonth = [{"en":"January"},{"en":"February"},{"en":"March"},{"en":"April"},{"en":"May"},{"en":"June"},{"en":"July"},{"en":"August"},{"en":"September"},{"en":"October"},{"en":"November"},{"en":"December"}];
    	var litDayShort = [{"en":"Sun"},{"en":"Mon"},{"en":"Tues"},{"en":"Wed"},{"en":"Thur"},{"en":"Fri"},{"en":"Sat"}];
    	var litMonthShort = [{"en":"Jan"},{"en":"Feb"},{"en":"Mar"},{"en":"Apr"},{"en":"May"},{"en":"Jun"},{"en":"Jul"},{"en":"Aug"},{"en":"Sep"},{"en":"Oct"},{"en":"Nov"},{"en":"Dec"}];
    	var rxDF = new RegExp("(d|D|l|F|M|n|Y|m|a|h|H|i|s)","g");
    	var f = strFormat.match(rxDF);
    	var r;
    	for(var x=0; x<f.length; x++){
    		switch(f[x]){
    			case "d":
    				r = this.getDate();
    			break;
    			case "D":
    				r = litDayShort[this.getDay()][strLang];
    			break;
    			case "l":
    				r = litDay[this.getDay()][strLang];
    			break;
    			case "F":
    				r = litMonth[this.getMonth()][strLang];
    			break;
    			case "M":
    				r = litMonthShort[this.getMonth()][strLang];
    			break;
    			case "m":
    				r = ""+((this.getMonth<9)?"0":"")+(this.getMonth()+1);
    			break;
    			case "n":
    				r = (this.getMonth()+1);
    			break;
    			case "a":
    				r = (this.getHours()<12)? "a.m." : "p.m.";
    			break;
    			case "h":
    				r = (this.getHours()>12)? (this.getHours()-12):(this.getHours()>0)?this.getHours():12;  
    			break;
    			case "H":
    				r = ""+((this.getHours()<10)?"0":"")+this.getHours();
    			break;
    			case "i":
    				r = ""+((this.getMinutes()<10)?"0":"")+this.getMinutes();
    			break;
    			case "s":
    				r = ""+((this.getSeconds()<10)?"0":"")+this.getSeconds();
    			break;
    			case "Y":
    				r = this.getFullYear();
    			break;
    		}
    		strFormat = strFormat.replace(new RegExp("^(.*)"+f[x]+"(.*)$"),"$1"+r+"$2");
    	}
    	return strFormat;
    };
    
  
    String.prototype.trim = function(){ 
        return this.replace(/^\W+|\W+$/g,"");
    };

    String.prototype.ltrim = function(){ 
        return this.replace(/^\W+/,"");
    };

    String.prototype.rtrim = function(){ 
        return this.replace(/\W+$/,"");
    };
    
    
   
/*===================================================================== */
