// Make sure we load this script only once per page
if(typeof PUBLITWEET_LOADED=='undefined') {

/*
GA
*/
(function(){var q=true,t=false,aa=window,u=undefined,ba=String,w=Math,ca="push",ea="cookie",x="charAt",z="indexOf",fa="gaGlobal",ga="getTime",ha="toString",A="window",B="length",C="document",D="split",E="location",ia="href",F="substring",H="join",I="toLowerCase";var ja="_gat",ka="_gaq",la="4.8.9",na="_gaUserPrefs",oa="ioo",K="&",L="=",N="__utma=",pa="__utmb=",qa="__utmc=",ra="__utmk=",sa="__utmv=",ta="__utmz=",ua="__utmx=",va="GASO=";var wa=function(){var k=this,l=[],g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";k.Dc=function(m){l[m]=q};k.Vb=function(){for(var m=[],j=0;j<l[B];j++)if(l[j])m[w.floor(j/6)]^=1<<j%6;for(j=0;j<m[B];j++)m[j]=g[x](m[j]||0);return m[H]("")}},xa=new wa;function O(k){xa.Dc(k)};var ya=function(k,l){var g=this;g.window=k;g.document=l;g.setTimeout=function(m,j){setTimeout(m,j)};g.$a=function(m){return navigator.userAgent[z](m)>=0};g.xd=function(){return g.$a("Firefox")&&![].reduce};g.mb=function(m){if(!m||!g.$a("Firefox"))return m;m=m.replace(/\n|\r/g," ");for(var j=0,p=m[B];j<p;++j){var h=m.charCodeAt(j)&255;if(h==10||h==13)m=m[F](0,j)+"?"+m[F](j+1)}return m}},P=new ya(aa,document);var za=function(k){return function(l,g,m){k[l]=function(){O(g);return m.apply(k,arguments)};return m}},Aa=function(k){return Object.prototype[ha].call(Object(k))=="[object Array]"},Q=function(k){return u==k||"-"==k||""==k},S=function(k,l,g){var m="-",j;if(!Q(k)&&!Q(l)&&!Q(g)){j=k[z](l);if(j>-1){g=k[z](g,j);if(g<0)g=k[B];m=k[F](j+l[z](L)+1,g)}}return m},Ba=function(k){var l=t,g=0,m,j;if(!Q(k)){l=q;for(m=0;m<k[B];m++){j=k[x](m);g+="."==j?1:0;l=l&&g<=1&&(0==m&&"-"==j||".0123456789"[z](j)>-1)}}return l},
T=function(k,l){var g=encodeURIComponent;if(g instanceof Function)return l?encodeURI(k):g(k);else{O(68);return escape(k)}},Ca=function(k,l){var g=decodeURIComponent,m;k=k[D]("+")[H](" ");if(g instanceof Function)try{m=l?decodeURI(k):g(k)}catch(j){O(17);m=unescape(k)}else{O(68);m=unescape(k)}return m},U=function(k,l){return k[z](l)>-1};
function Ea(k){if(!k||""==k)return"";for(;k[x](0)[B]>0&&" \n\r\t"[z](k[x](0))>-1;)k=k[F](1);for(;k[x](k[B]-1)[B]>0&&" \n\r\t"[z](k[x](k[B]-1))>-1;)k=k[F](0,k[B]-1);return k}var W=function(k,l){k[ca]||O(94);k[k[B]]=l},Fa=function(k){var l=1,g=0,m;if(!Q(k)){l=0;for(m=k[B]-1;m>=0;m--){g=k.charCodeAt(m);l=(l<<6&268435455)+g+(g<<14);g=l&266338304;l=g!=0?l^g>>21:l}}return l},Ga=function(){return w.round(w.random()*2147483647)},Ha=function(){};var Ia=function(k,l){this.Ra=k;this.eb=l},Ja=function(){function k(g){var m=[];g=g[D](",");for(var j,p=0;p<g[B];p++){j=g[p][D](":");m[ca](new Ia(j[0],j[1]))}return m}var l=this;l.ya="utm_campaign";l.za="utm_content";l.Aa="utm_id";l.Ba="utm_medium";l.Ca="utm_nooverride";l.Da="utm_source";l.Ea="utm_term";l.Fa="gclid";l.U=0;l.w=0;l.Ja=15768E6;l.rb=18E5;l.v=63072E6;l.la=[];l.na=[];l.nc="cse";l.oc="q";l.hb=5;l.P=k("daum:q,eniro:search_word,naver:query,pchome:q,images.google:q,google:q,yahoo:p,yahoo:q,msn:q,bing:q,aol:query,aol:encquery,aol:q,lycos:query,ask:q,altavista:q,netscape:query,cnn:query,about:terms,mamma:q,alltheweb:q,voila:rdata,virgilio:qs,live:q,baidu:wd,alice:qs,yandex:text,najdi:q,mama:query,seznam:q,search:q,wp:szukaj,onet:qt,szukacz:q,yam:k,kvasir:q,sesam:q,ozu:q,terra:query,mynet:q,ekolay:q,rambler:query,rambler:words");
l.f="/";l.Q=100;l.ia="/__utm.gif";l.Z=1;l.$=1;l.u="|";l.X=1;l.Ka=1;l.Ia=1;l.b="auto";l.D=1;l.Nc=10;l.Ob=10;l.Oc=0.2;l.n=u};var Ka=function(k){function l(a,c,i,e){var d="",r=0;d=S(a,"2"+c,";");if(!Q(d)){a=d[z]("^"+i+".");if(a<0)return["",0];d=d[F](a+i[B]+2);if(d[z]("^")>0)d=d[D]("^")[0];i=d[D](":");d=i[1];r=parseInt(i[0],10);if(!e&&r<j.r)d=""}if(Q(d))d="";return[d,r]}function g(a,c){return"^"+[[c,a[1]][H]("."),a[0]][H](":")}function m(a){var c=new Date;a=new Date(c[ga]()+a);return"expires="+a.toGMTString()+"; "}var j=this,p=k;j.r=(new Date)[ga]();var h=[N,pa,qa,ta,sa,ua,va];j.h=function(){var a=P[C][ea];return p.n?j.Wb(a,
p.n):a};j.Wb=function(a,c){for(var i=[],e,d=0;d<h[B];d++){e=l(a,h[d],c)[0];Q(e)||(i[i[B]]=h[d]+e+";")}return i[H]("")};j.l=function(a,c,i){var e=i>0?m(i):"";if(p.n){c=j.jc(P[C][ea],a,p.n,c,i);a="2"+a;e=i>0?m(p.v):""}a+=c;a=P.mb(a);if(a[B]>2E3){O(69);a=a[F](0,2E3)}e=a+"; path="+p.f+"; "+e+j.Ua();P[C].cookie=e};j.jc=function(a,c,i,e,d){var r="";d=d||p.v;e=g([e,j.r+d*1],i);r=S(a,"2"+c,";");if(!Q(r)){a=g(l(a,c,i,q),i);r=r[D](a)[H]("");return r=e+r}return e};j.Ua=function(){return Q(p.b)?"":"domain="+
p.b+";"}};var La=function(k){function l(f){f=Aa(f)?f[H]("."):"";return Q(f)?"-":f}function g(f,n){var s=[],o;if(!Q(f)){s=f[D](".");if(n)for(o=0;o<s[B];o++)Ba(s[o])||(s[o]="-")}return s}function m(f,n,s){var o=d.I,v,y;for(v=0;v<o[B];v++){y=o[v][0];y+=Q(n)?n:n+o[v][4];o[v][2](S(f,y,s))}}var j,p,h,a,c,i,e,d=this,r,b=k;d.g=new Ka(k);d.bb=function(){return u==r||r==d.L()};d.h=function(){return d.g.h()};d.ga=function(){return c?c:"-"};d.ub=function(f){c=f};d.qa=function(f){r=Ba(f)?f*1:"-"};d.fa=function(){return l(i)};
d.ra=function(f){i=g(f)};d.Ub=function(){d.g.l(sa,"",-1)};d.kc=function(){return r?r:"-"};d.Ua=function(){return Q(b.b)?"":"domain="+b.b+";"};d.da=function(){return l(j)};d.sb=function(f){j=g(f,1)};d.z=function(){return l(p)};d.pa=function(f){p=g(f,1)};d.ea=function(){return l(h)};d.tb=function(f){h=g(f,1)};d.ha=function(){return l(a)};d.vb=function(f){a=g(f);for(f=0;f<a[B];f++)if(f<4&&!Ba(a[f]))a[f]="-"};d.dc=function(){return e};d.Gc=function(f){e=f};d.Rb=function(){j=[];p=[];h=[];a=[];c=u;i=[];
r=u};d.L=function(){for(var f="",n=0;n<d.I[B];n++)f+=d.I[n][1]();return Fa(f)};d.ma=function(f){var n=d.h(),s=t;if(n){m(n,f,";");d.qa(ba(d.L()));s=q}return s};d.yc=function(f){m(f,"",K);d.qa(S(f,ra,K))};d.Lc=function(){var f=d.I,n=[],s;for(s=0;s<f[B];s++)W(n,f[s][0]+f[s][1]());W(n,ra+d.L());return n[H](K)};d.Sc=function(f,n){var s=d.I,o=b.f;d.ma(f);b.f=n;for(var v=0;v<s[B];v++)if(!Q(s[v][1]()))s[v][3]();b.f=o};d.Gb=function(){d.g.l(N,d.da(),b.v)};d.va=function(){d.g.l(pa,d.z(),b.rb)};d.Hb=function(){d.g.l(qa,
d.ea(),0)};d.xa=function(){d.g.l(ta,d.ha(),b.Ja)};d.Ib=function(){d.g.l(ua,d.ga(),b.v)};d.wa=function(){d.g.l(sa,d.fa(),b.v)};d.Uc=function(){d.g.l(va,d.dc(),0)};d.I=[[N,d.da,d.sb,d.Gb,"."],[pa,d.z,d.pa,d.va,""],[qa,d.ea,d.tb,d.Hb,""],[ua,d.ga,d.ub,d.Ib,""],[ta,d.ha,d.vb,d.xa,"."],[sa,d.fa,d.ra,d.wa,"."]]};var Ma=function(){var k=this;k.qb=function(l,g,m,j,p){g[B]<=2036||p?k.pb(l+"?"+g,j):k.pb(l+"?"+m+"&err=len&max=2036&len="+g[B],j)};k.pb=function(l,g){var m=new Image(1,1);m.src=l;m.onload=function(){m.onload=null;(g||Ha)()}}};var Na=function(k){var l=this,g=k,m=new La(g),j=new Ma,p=!X.Tc(),h=function(){};l.hc=function(){return"https:"==P[C][E].protocol?"https://ssl.google-analytics.com/__utm.gif":"http://www.google-analytics.com/__utm.gif"};l.C=function(a,c,i,e,d,r){var b=g.D,f=P[C][E];m.ma(i);var n=m.z()[D](".");if(n[1]<500||e){if(d){var s=(new Date)[ga](),o;o=(s-n[3])*(g.Oc/1E3);if(o>=1){n[2]=w.min(w.floor(n[2]*1+o),g.Ob);n[3]=s}}if(e||!d||n[2]>=1){if(!e&&d)n[2]=n[2]*1-1;n[1]=n[1]*1+1;d="utmwv="+la;s="&utmn="+Ga();e=
d+"e"+s;a=d+s+(Q(f.hostname)?"":"&utmhn="+T(f.hostname))+(g.Q==100?"":"&utmsp="+T(g.Q))+a;if(0==b||2==b){f=2==b?h:r||h;p&&j.qb(g.ia,a,e,f,q)}if(1==b||2==b){c="&utmac="+c;e+=c;a+=c+"&utmcc="+l.ac(i);if(X.Qa){i="&aip=1";e+=i;a+=i}a+="&utmu="+xa.Vb();p&&j.qb(l.hc(),a,e,r)}}}m.pa(n[H]("."));m.va()};l.ac=function(a){for(var c=[],i=[N,ta,sa,ua],e=m.h(),d,r=0;r<i[B];r++){d=S(e,i[r]+a,";");if(!Q(d)){if(i[r]==sa){d=d[D](a+".")[1][D]("|")[0];if(Q(d))continue;d=a+"."+d}W(c,i[r]+d+";")}}return T(c[H]("+"))}};var Oa=function(){var k=this;k.S=[];k.Za=function(l){for(var g,m=k.S,j=0;j<m[B];j++)g=l==m[j].p?m[j]:g;return g};k.Nb=function(l,g,m,j,p,h,a,c){var i=k.Za(l);if(u==i){i=new Oa.Kb(l,g,m,j,p,h,a,c);W(k.S,i)}else{i.Ha=g;i.Ab=m;i.yb=j;i.wb=p;i.Ma=h;i.xb=a;i.Oa=c}return i}};Oa.Jb=function(k,l,g,m,j,p){var h=this;h.Eb=k;h.ta=l;h.q=g;h.La=m;h.jb=j;h.kb=p;h.ua=function(){return"&"+["utmt=item","tid="+T(h.Eb),"ipc="+T(h.ta),"ipn="+T(h.q),"iva="+T(h.La),"ipr="+T(h.jb),"iqt="+T(h.kb)][H]("&utm")}};
Oa.Kb=function(k,l,g,m,j,p,h,a){var c=this;c.p=k;c.Ha=l;c.Ab=g;c.yb=m;c.wb=j;c.Ma=p;c.xb=h;c.Oa=a;c.N=[];c.Mb=function(i,e,d,r,b){var f=c.ec(i),n=c.p;if(u==f)W(c.N,new Oa.Jb(n,i,e,d,r,b));else{f.Eb=n;f.ta=i;f.q=e;f.La=d;f.jb=r;f.kb=b}};c.ec=function(i){for(var e,d=c.N,r=0;r<d[B];r++)e=i==d[r].ta?d[r]:e;return e};c.ua=function(){return"&"+["utmt=tran","id="+T(c.p),"st="+T(c.Ha),"to="+T(c.Ab),"tx="+T(c.yb),"sp="+T(c.wb),"ci="+T(c.Ma),"rg="+T(c.xb),"co="+T(c.Oa)][H]("&utmt")}};var Pa=function(k){function l(){var h,a,c;a="ShockwaveFlash";var i="$version",e=P[A].navigator;if((e=e?e.plugins:u)&&e[B]>0)for(h=0;h<e[B]&&!c;h++){a=e[h];if(U(a.name,"Shockwave Flash"))c=a.description[D]("Shockwave Flash ")[1]}else{a=a+"."+a;try{h=new ActiveXObject(a+".7");c=h.GetVariable(i)}catch(d){}if(!c)try{h=new ActiveXObject(a+".6");c="WIN 6,0,21,0";h.Vc="always";c=h.GetVariable(i)}catch(r){}if(!c)try{h=new ActiveXObject(a);c=h.GetVariable(i)}catch(b){}if(c){c=c[D](" ")[1][D](",");c=c[0]+"."+
c[1]+" r"+c[2]}}return c?c:m}var g=this,m="-",j=P[A].screen,p=P[A].navigator;g.ob=j?j.width+"x"+j.height:m;g.nb=j?j.colorDepth+"-bit":m;g.Qb=T(P[C].characterSet?P[C].characterSet:P[C].charset?P[C].charset:m);g.fb=(p&&p.language?p.language:p&&p.browserLanguage?p.browserLanguage:m)[I]();g.db=p&&p.javaEnabled()?1:0;g.Yb=k?l():m;g.Mc=function(){return K+"utm"+["cs="+T(g.Qb),"sr="+g.ob,"sc="+g.nb,"ul="+g.fb,"je="+g.db,"fl="+T(g.Yb)][H]("&utm")};g.$b=function(){var h=P[A].navigator,a=P[A].history[B];h=
h.appName+h.version+g.fb+h.platform+h.userAgent+g.db+g.ob+g.nb+(P[C][ea]?P[C][ea]:"")+(P[C].referrer?P[C].referrer:"");for(var c=h[B];a>0;)h+=a--^c++;return Fa(h)}};var Z=function(k,l,g,m){function j(a){var c="";c=a[D]("://")[1][I]();if(U(c,"/"))c=c[D]("/")[0];return c}var p=m,h=this;h.a=k;h.lb=l;h.r=g;h.Ya=function(a){var c=h.ca();return new Z.s(S(a,p.Aa+L,K),S(a,p.Da+L,K),S(a,p.Fa+L,K),h.M(a,p.ya,"(not set)"),h.M(a,p.Ba,"(not set)"),h.M(a,p.Ea,c&&!Q(c.G)?Ca(c.G):u),h.M(a,p.za,u))};h.ab=function(a){var c=j(a),i;i=a;var e="";i=i[D]("://")[1][I]();if(U(i,"/")){i=i[D]("/")[1];if(U(i,"?"))e=i[D]("?")[0]}i=e;if(U(c,"google")){a=a[D]("?")[H](K);if(U(a,K+p.oc+L))if(i==
p.nc)return q}return t};h.ca=function(){var a,c=h.lb,i,e=p.P;if(!(Q(c)||"0"==c||!U(c,"://")||h.ab(c))){a=j(c);for(var d=0;d<e[B];d++){i=e[d];if(U(a,i.Ra[I]())){c=c[D]("?")[H](K);if(U(c,K+i.eb+L)){a=c[D](K+i.eb+L)[1];if(U(a,K))a=a[D](K)[0];return new Z.s(u,i.Ra,u,"(organic)","organic",a,u)}}}}};h.M=function(a,c,i){a=S(a,c+L,K);return i=!Q(a)?Ca(a):!Q(i)?i:"-"};h.uc=function(a){var c=p.la,i=t;if(a&&"organic"==a.O){a=Ca(a.G)[I]();for(var e=0;e<c[B];e++)i=i||c[e][I]()==a}return i};h.Wa=function(){var a=
"",c="";a=h.lb;if(!(Q(a)||"0"==a||!U(a,"://")||h.ab(a))){a=a[D]("://")[1];if(U(a,"/")){c=a[F](a[z]("/"));c=c[D]("?")[0];a=a[D]("/")[0][I]()}if(0==a[z]("www."))a=a[F](4);return new Z.s(u,a,u,"(referral)","referral",u,c)}};h.Ta=function(a){var c="";if(p.U){c=a&&a.hash?a[ia][F](a[ia][z]("#")):"";c=""!=c?c+K:c}c+=a.search;return c};h.ba=function(){return new Z.s(u,"(direct)",u,"(direct)","(none)",u,u)};h.vc=function(a){var c=t,i=p.na;if(a&&"referral"==a.O){a=T(a.R)[I]();for(var e=0;e<i[B];e++)c=c||U(a,
i[e][I]())}return c};h.i=function(a){return u!=a&&a.cb()};h.yd=function(a){a=S(a,ta+h.a+".",";");var c=a[D](".");a=new Z.s;a.ib(c.slice(4)[H]("."));if(!h.i(a))return q;c=P[C][E];c=h.Ta(c);c=h.Ya(c);if(!h.i(c)){c=h.ca();h.i(c)||(c=h.Wa())}return h.i(c)&&a.H()[I]()!=c.H()[I]()};h.bc=function(a,c){if(p.Ka){var i="",e="-",d,r=0,b,f,n=h.a;if(a){f=a.h();i=h.Ta(P[C][E]);if(p.w&&a.bb()){e=a.ha();if(!Q(e)&&!U(e,";")){a.xa();return}}e=S(f,ta+n+".",";");d=h.Ya(i);if(h.i(d)){i=S(i,p.Ca+L,K);if("1"==i&&!Q(e))return}if(!h.i(d)){d=
h.ca();i=h.uc(d);if(!Q(e)&&i)return;if(i)d=h.ba()}if(!h.i(d)&&c){d=h.Wa();i=h.vc(d);if(!Q(e)&&i)return;if(i)d=h.ba()}if(!h.i(d))if(Q(e)&&c)d=h.ba();if(h.i(d)){if(!Q(e)){r=e[D](".");b=new Z.s;b.ib(r.slice(4)[H]("."));b=b.H()[I]()==d.H()[I]();r=r[3]*1}if(!b||c){f=S(f,N+n+".",";");b=f.lastIndexOf(".");f=b>9?f[F](b+1)*1:0;r++;f=0==f?1:f;a.vb([n,h.r,f,r,d.H()][H]("."));a.xa()}}}}}};
Z.s=function(k,l,g,m,j,p,h){var a=this;a.p=k;a.R=l;a.W=g;a.q=m;a.O=j;a.G=p;a.Na=h;a.H=function(){var c=[],i=[["cid",a.p],["csr",a.R],["gclid",a.W],["ccn",a.q],["cmd",a.O],["ctr",a.G],["cct",a.Na]],e,d;if(a.cb())for(e=0;e<i[B];e++)if(!Q(i[e][1])){d=i[e][1][D]("+")[H]("%20");d=d[D](" ")[H]("%20");W(c,"utm"+i[e][0]+L+d)}return P.mb(c[H]("|"))};a.cb=function(){return!(Q(a.p)&&Q(a.R)&&Q(a.W))};a.ib=function(c){var i=function(e){return Ca(S(c,"utm"+e+L,"|"))};a.p=i("cid");a.R=i("csr");a.W=i("gclid");a.q=
i("ccn");a.O=i("cmd");a.G=i("ctr");a.Na=i("cct")}};var Qa=function(k,l,g,m){var j=this,p=l,h=L,a=k,c=m;j.K=g;j.ka="";j.o={};j.sc=function(){var i;i=S(j.K.h(),sa+p+".",";")[D](p+".")[1];if(!Q(i)){i=i[D]("|");var e=j.o,d=i[1],r;if(!Q(d)){d=d[D](",");for(var b=0;b<d[B];b++){r=d[b];if(!Q(r)){r=r[D](h);if(r[B]==4)e[r[0]]=[r[1],r[2],1]}}}j.ka=i[0];j.T()}};j.T=function(){j.Pb();var i=j.ka,e,d,r="";for(e in j.o)if((d=j.o[e])&&1===d[2])r+=e+h+d[0]+h+d[1]+h+1+",";Q(r)||(i+="|"+r);if(Q(i))j.K.Ub();else{j.K.ra(p+"."+i);j.K.wa()}};j.Hc=function(i){j.ka=i;j.T()};
j.Fc=function(i,e,d,r){if(1!=r&&2!=r&&3!=r)r=3;var b=t;if(e&&d&&i>0&&i<=a.hb){e=T(e);d=T(d);if(e[B]+d[B]<=64){j.o[i]=[e,d,r];j.T();b=q}}return b};j.mc=function(i){if((i=j.o[i])&&1===i[2])return i[1]};j.Tb=function(i){var e=j.o;if(e[i]){delete e[i];j.T()}};j.Pb=function(){c.t(8);c.t(9);c.t(11);var i=j.o,e,d;for(d in i)if(e=i[d]){c.k(8,d,e[0]);c.k(9,d,e[1]);(e=e[2])&&3!=e&&c.k(11,d,""+e)}}};var Ra=function(){function k(o,v,y,M){if(u==h[o])h[o]={};if(u==h[o][v])h[o][v]=[];h[o][v][y]=M}function l(o,v,y){if(u!=h[o]&&u!=h[o][v])return h[o][v][y]}function g(o,v){if(u!=h[o]&&u!=h[o][v]){h[o][v]=u;var y=q,M;for(M=0;M<i[B];M++)if(u!=h[o][i[M]]){y=t;break}if(y)h[o]=u}}function m(o){var v="",y=t,M,V;for(M=0;M<i[B];M++){V=o[i[M]];if(u!=V){if(y)v+=i[M];y=[];var J=void 0,G=void 0;for(G=0;G<V[B];G++)if(u!=V[G]){J="";if(G!=s&&u==V[G-1])J+=G[ha]()+b;var R;R=V[G];var ma="",Y=void 0,da=void 0,Da=void 0;
for(Y=0;Y<R[B];Y++){da=R[x](Y);Da=n[da];ma+=u!=Da?Da:da}R=ma;J+=R;W(y,J)}V=e+y[H](r)+d;v+=V;y=t}else y=q}return v}var j=this,p=za(j),h={},a="k",c="v",i=[a,c],e="(",d=")",r="*",b="!",f="'",n={};n[f]="'0";n[d]="'1";n[r]="'2";n[b]="'3";var s=1;j.qc=function(o){return u!=h[o]};j.B=function(){var o="",v;for(v in h)if(u!=h[v])o+=v[ha]()+m(h[v]);return o};j.zc=function(o){if(o==u)return j.B();var v=o.B(),y;for(y in h)if(u!=h[y]&&!o.qc(y))v+=y[ha]()+m(h[y]);return v};j.k=p("_setKey",89,function(o,v,y){if(typeof y!=
"string")return t;k(o,a,v,y);return q});j.sa=p("_setValue",90,function(o,v,y){if(typeof y!="number"&&(u==Number||!(y instanceof Number))||w.round(y)!=y||y==NaN||y==Infinity)return t;k(o,c,v,y[ha]());return q});j.fc=p("_getKey",87,function(o,v){return l(o,a,v)});j.lc=p("_getValue",88,function(o,v){return l(o,c,v)});j.t=p("_clearKey",85,function(o){g(o,a)});j.V=p("_clearValue",86,function(o){g(o,c)})};var Sa=function(k,l){var g=this,m=za(g);g.Ad=l;g.xc=k;g.Bb=m("_trackEvent",91,function(j,p,h){return l.Bb(g.xc,j,p,h)})};var Ta=function(k,l){var g=this,m=P[A].external,j=P[A].webkitPerformance,p=10;g.gb=new Ra;g.gc=function(){var h,a="timing",c="onloadT";if(m&&m[c]!=u&&m.isValidLoadTime)h=m[c];else if(j&&j[a])h=j[a].loadEventStart-j[a].navigationStart;return h};g.Kc=function(){return k.F()&&k.Fb()%100<p};g.Bc=function(){var h="&utmt=event&utme="+T(g.gb.B())+k.oa();l.C(h,k.m,k.a,t,q)};g.zb=function(){var h=g.gc();if(h==u)return t;if(h<=0)return q;if(h>2147483648)return t;var a=g.gb;a.t(14);a.V(14);(h=a.k(14,1,"pl")&&
a.sa(14,1,h))&&g.Bc();m&&m.isValidLoadTime!=u&&m.setPageReadyTime();return t};g.Cb=function(){if(!g.Kc())return t;if(P[A].top!=P[A])return t;if(g.zb()){var h=P[A],a="load",c=g.zb;if(h.addEventListener)h.addEventListener(a,c,t);else h.attachEvent&&h.attachEvent("on"+a,c)}return q}};var $=function(){};$.Xb=function(k){var l="gaso=",g=P[C][E].hash;if(g&&1==g[z](l))k=S(g,l,K);else k=(g=P[A].name)&&0<=g[z](l)?S(g,l,K):S(k.h(),va,";");return k};$.wc=function(k,l){var g=(l||"www")+".google.com";g="https://"+g+"/analytics/reporting/overlay_js?gaso="+k+K+Ga();var m="_gasojs",j=P[C].createElement("script");j.type="text/javascript";j.src=g;if(m)j.id=m;(P[C].getElementsByTagName("head")[0]||P[C].getElementsByTagName("body")[0]).appendChild(j)};
$.load=function(k,l){if(!$.tc){var g=$.Xb(l),m=g&&g.match(/^(?:\|([-0-9a-z.]{1,30})\|)?([-.\w]{10,1200})$/i);if(m){l.Gc(g);l.Uc();X._gasoDomain=k.b;X._gasoCPath=k.f;$.wc(m[2],m[1])}$.tc=q}};var Ua=function(k,l,g){function m(){if("auto"==e.b){var b=P[C].domain;if("www."==b[F](0,4))b=b[F](4);e.b=b}e.b=e.b[I]()}function j(){m();var b=e.b,f=b[z]("www.google.")*b[z](".google.")*b[z]("google.");return f||"/"!=e.f||b[z]("google.org")>-1}function p(b,f,n){if(Q(b)||Q(f)||Q(n))return"-";b=S(b,N+a.a+".",f);if(!Q(b)){b=b[D](".");b[5]=""+(b[5]?b[5]*1+1:1);b[3]=b[4];b[4]=n;b=b[H](".")}return b}function h(){return"file:"!=P[C][E].protocol&&j()}var a=this,c=za(a),i=u,e=new Ja,d=t,r=u;a.q=k;a.r=w.round((new Date)[ga]()/
1E3);a.m=l||"UA-XXXXX-X";a.Pa=P[C].referrer;a.aa=u;a.d=u;a.A=t;a.J=u;a.e=u;a.Sa=u;a.ja=u;a.a=u;a.j=u;e.n=g?T(g):u;a.ic=function(){return Ga()^a.J.$b()&2147483647};a.cc=function(){if(!e.b||""==e.b||"none"==e.b){e.b="";return 1}m();return e.Ia?Fa(e.b):1};a.Zb=function(b,f){if(Q(b))b="-";else{f+=e.f&&"/"!=e.f?e.f:"";var n=b[z](f);b=n>=0&&n<=8?"0":"["==b[x](0)&&"]"==b[x](b[B]-1)?"-":b}return b};a.oa=function(b){var f="";f+=e.X?a.J.Mc():"";f+=e.Z&&!Q(P[C].title)?"&utmdt="+T(P[C].title):"";var n;n=u;if(P[A]&&
P[A][fa]&&P[A][fa].hid)n=P[A][fa].hid;else{n=Ga();P[A].gaGlobal=P[A][fa]?P[A][fa]:{};P[A][fa].hid=n}f+="&utmhid="+n+"&utmr="+T(ba(a.aa))+"&utmp="+T(a.Ac(b));return f};a.Ac=function(b){var f=P[C][E];b&&O(13);return b=u!=b&&""!=b?T(b,q):T(f.pathname+f.search,q)};a.Qc=function(b){if(a.F()){var f="";if(a.e!=u&&a.e.B()[B]>0)f+="&utme="+T(a.e.B());f+=a.oa(b);i.C(f,a.m,a.a)}};a.Sb=function(){var b=new La(e);return b.ma(a.a)?b.Lc():u};a.Va=c("_getLinkerUrl",52,function(b,f){var n=b[D]("#"),s=b,o=a.Sb();if(o)if(f&&
1>=n[B])s+="#"+o;else if(!f||1>=n[B])if(1>=n[B])s+=(U(b,"?")?K:"?")+o;else s=n[0]+(U(b,"?")?K:"?")+o+"#"+n[1];return s});a.pc=function(){var b=a.r,f=a.j,n=f.h(),s=a.a+"",o=P[A]?P[A][fa]:u,v,y=U(n,N+s+"."),M=U(n,pa+s),V=U(n,qa+s),J,G=[],R="",ma=t;n=Q(n)?"":n;if(e.w){v=P[C][E]&&P[C][E].hash?P[C][E][ia][F](P[C][E][ia][z]("#")):"";if(e.U&&!Q(v))R=v+K;R+=P[C][E].search;if(!Q(R)&&U(R,N)){f.yc(R);f.bb()||f.Rb();J=f.da()}v=f.ga;var Y=f.ub,da=f.Ib;if(!Q(v())){Y(Ca(v()));U(v(),";")||da()}v=f.fa;Y=f.ra;da=f.wa;
if(!Q(v())){Y(v());U(v(),";")||da()}}if(Q(J))if(y)if(J=!M||!V){J=p(n,";",ba(b));a.A=q}else{J=S(n,N+s+".",";");G=S(n,pa+s,";")[D](".")}else{J=[s,a.ic(),b,b,b,1][H](".");ma=a.A=q}else if(Q(f.z())||Q(f.ea())){J=p(R,K,ba(b));a.A=q}else{G=f.z()[D](".");s=G[0]}J=J[D](".");if(P[A]&&o&&o.dh==s&&!e.n){J[4]=o.sid?o.sid:J[4];if(ma){J[3]=o.sid?o.sid:J[4];if(o.vid){b=o.vid[D](".");J[1]=b[0];J[2]=b[1]}}}f.sb(J[H]("."));G[0]=s;G[1]=G[1]?G[1]:0;G[2]=u!=G[2]?G[2]:e.Nc;G[3]=G[3]?G[3]:J[4];f.pa(G[H]("."));f.tb(s);Q(f.kc())||
f.qa(f.L());f.Gb();f.va();f.Hb()};a.rc=function(){i=new Na(e)};a.getName=c("_getName",58,function(){return a.q});a.c=c("_initData",2,function(){var b;if(!d){if(!a.J)a.J=new Pa(e.$);a.a=a.cc();a.j=new La(e);a.e=new Ra;r=new Qa(e,ba(a.a),a.j,a.e);a.rc()}if(h()){if(!d){a.aa=a.Zb(a.Pa,P[C].domain);b=new Z(ba(a.a),a.aa,a.r,e)}a.pc(b);r.sc()}if(!d){h()&&b.bc(a.j,a.A);a.Sa=new Ra;$.load(e,a.j);d=q}});a.Fb=c("_visitCode",54,function(){a.c();var b=S(a.j.h(),N+a.a+".",";");b=b[D](".");return b[B]<4?"":b[1]});
a.ed=c("_cookiePathCopy",30,function(b){a.c();a.j&&a.j.Sc(a.a,b)});a.F=function(){return a.Fb()%1E4<e.Q*100};a.me=c("_trackPageview",1,function(b){if(h()){a.c();a.Pc();a.Qc(b);a.A=t}});a.Pc=function(){var b=P[A];if(Ga()%1E3===42)try{if(b.external&&b.external.onloadT!=u||b.webkitPerformance&&b.webkitPerformance.timing)O(12)}catch(f){}};a.ne=c("_trackTrans",18,function(){var b=a.a,f=[],n,s,o;a.c();if(a.d&&a.F()){for(n=0;n<a.d.S[B];n++){s=a.d.S[n];W(f,s.ua());for(o=0;o<s.N[B];o++)W(f,s.N[o].ua())}for(n=
0;n<f[B];n++)i.C(f[n],a.m,b,q)}});a.he=c("_setTrans",20,function(){var b,f,n,s;b=P[C].getElementById?P[C].getElementById("utmtrans"):P[C].utmform&&P[C].utmform.utmtrans?P[C].utmform.utmtrans:u;a.c();if(b&&b.value){a.d=new Oa;s=b.value[D]("UTM:");e.u=!e.u||""==e.u?"|":e.u;for(b=0;b<s[B];b++){s[b]=Ea(s[b]);f=s[b][D](e.u);for(n=0;n<f[B];n++)f[n]=Ea(f[n]);if("T"==f[0])a.Ga(f[1],f[2],f[3],f[4],f[5],f[6],f[7],f[8]);else"I"==f[0]&&a.Lb(f[1],f[2],f[3],f[4],f[5],f[6])}}});a.Ga=c("_addTrans",21,function(b,
f,n,s,o,v,y,M){a.d=a.d?a.d:new Oa;return a.d.Nb(b,f,n,s,o,v,y,M)});a.Lb=c("_addItem",19,function(b,f,n,s,o,v){var y;a.d=a.d?a.d:new Oa;(y=a.d.Za(b))||(y=a.Ga(b,"","","","","","",""));y.Mb(f,n,s,o,v)});a.je=c("_setVar",22,function(b){if(b&&""!=b&&j()){a.c();r.Hc(T(b));a.F()&&i.C("&utmt=var",a.m,a.a)}});a.Td=c("_setCustomVar",10,function(b,f,n,s){a.c();return r.Fc(b,f,n,s)});a.jd=c("_deleteCustomVar",35,function(b){a.c();r.Tb(b)});a.ud=c("_getVisitorCustomVar",50,function(b){a.c();return r.mc(b)});
a.ae=c("_setMaxCustomVariables",71,function(b){e.hb=b});a.link=c("_link",101,function(b,f){if(e.w&&b){a.c();P[C][E].href=a.Va(b,f)}});a.zd=c("_linkByPost",102,function(b,f){if(e.w&&b&&b.action){a.c();b.action=a.Va(b.action,f)}});a.ke=c("_setXKey",83,function(b,f,n){a.e.k(b,f,n)});a.le=c("_setXValue",84,function(b,f,n){a.e.sa(b,f,n)});a.vd=c("_getXKey",76,function(b,f){return a.e.fc(b,f)});a.wd=c("_getXValue",77,function(b,f){return a.e.lc(b,f)});a.cd=c("_clearXKey",72,function(b){a.e.t(b)});a.dd=
c("_clearXValue",73,function(b){a.e.V(b)});a.hd=c("_createXObj",75,function(){a.c();return new Ra});a.Cc=c("_sendXEvent",78,function(b){var f="";a.c();if(a.F()){f+="&utmt=event&utme="+T(a.e.zc(b))+a.oa();i.C(f,a.m,a.a,t,q)}});a.gd=c("_createEventTracker",74,function(b){a.c();return new Sa(b,a)});a.Bb=c("_trackEvent",4,function(b,f,n,s){a.c();var o=a.Sa;if(u!=b&&u!=f&&""!=b&&""!=f){o.t(5);o.V(5);(b=o.k(5,1,b)&&o.k(5,2,f)&&(u==n||o.k(5,3,n))&&(u==s||o.sa(5,1,s)))&&a.Cc(o)}else b=t;return b});a.Cb=c("_trackPageLoadTime",
100,function(){a.c();if(!a.ja)a.ja=new Ta(a,i);return a.ja.Cb()});a.nd=function(){return e};a.Wd=c("_setDomainName",6,function(b){e.b=b});a.Yc=c("_addOrganic",14,function(b,f,n){e.P.splice(n?0:e.P[B],0,new Ia(b,f))});a.bd=c("_clearOrganic",70,function(){e.P=[]});a.Wc=c("_addIgnoredOrganic",15,function(b){W(e.la,b)});a.$c=c("_clearIgnoredOrganic",97,function(){e.la=[]});a.Xc=c("_addIgnoredRef",31,function(b){W(e.na,b)});a.ad=c("_clearIgnoredRef",32,function(){e.na=[]});a.Dd=c("_setAllowHash",8,function(b){e.Ia=
b?1:0});a.Od=c("_setCampaignTrack",36,function(b){e.Ka=b?1:0});a.Pd=c("_setClientInfo",66,function(b){e.X=b?1:0});a.md=c("_getClientInfo",53,function(){return e.X});a.Qd=c("_setCookiePath",9,function(b){e.f=b});a.ie=c("_setTransactionDelim",82,function(b){e.u=b});a.Sd=c("_setCookieTimeout",25,function(b){a.Ec(b*1E3)});a.Ec=c("_setCampaignCookieTimeout",29,function(b){e.Ja=b});a.Ud=c("_setDetectFlash",61,function(b){e.$=b?1:0});a.od=c("_getDetectFlash",65,function(){return e.$});a.Vd=c("_setDetectTitle",
62,function(b){e.Z=b?1:0});a.pd=c("_getDetectTitle",56,function(){return e.Z});a.Yd=c("_setLocalGifPath",46,function(b){e.ia=b});a.qd=c("_getLocalGifPath",57,function(){return e.ia});a.$d=c("_setLocalServerMode",92,function(){e.D=0});a.de=c("_setRemoteServerMode",63,function(){e.D=1});a.Zd=c("_setLocalRemoteServerMode",47,function(){e.D=2});a.rd=c("_getServiceMode",59,function(){return e.D});a.ee=c("_setSampleRate",45,function(b){e.Q=b});a.fe=c("_setSessionTimeout",27,function(b){a.Ic(b*1E3)});a.Ic=
c("_setSessionCookieTimeout",26,function(b){e.rb=b});a.Ed=c("_setAllowLinker",11,function(b){e.w=b?1:0});a.Cd=c("_setAllowAnchor",7,function(b){e.U=b?1:0});a.Ld=c("_setCampNameKey",41,function(b){e.ya=b});a.Hd=c("_setCampContentKey",38,function(b){e.za=b});a.Id=c("_setCampIdKey",39,function(b){e.Aa=b});a.Jd=c("_setCampMediumKey",40,function(b){e.Ba=b});a.Kd=c("_setCampNOKey",42,function(b){e.Ca=b});a.Md=c("_setCampSourceKey",43,function(b){e.Da=b});a.Nd=c("_setCampTermKey",44,function(b){e.Ea=b});
a.Gd=c("_setCampCIdKey",37,function(b){e.Fa=b});a.kd=c("_getAccount",64,function(){return a.m});a.Bd=c("_setAccount",3,function(b){a.m=b});a.be=c("_setNamespace",48,function(b){e.n=b?T(b):u});a.td=c("_getVersion",60,function(){return la});a.Fd=c("_setAutoTrackOutbound",79,Ha);a.ge=c("_setTrackOutboundSubdomains",81,Ha);a.Xd=c("_setHrefExamineLimit",80,Ha);a.ce=c("_setReferrerOverride",49,function(b){a.Pa=b});a.Rd=c("_setCookiePersistence",24,function(b){a.Jc(b)});a.Jc=c("_setVisitorCookieTimeout",
28,function(b){e.v=b})};var Va=function(){var k=this,l=za(k);k.Qa=t;k.Db={};k.Rc=0;k._gasoDomain=u;k._gasoCPath=u;k.sd=l("_getTracker",0,function(g,m){return k.Y(g,u,m)});k.Y=l("_createTracker",55,function(g,m,j){m&&O(23);j&&O(67);if(m==u)m="~"+X.Rc++;return X.Db[m]=new Ua(m,g,j)});k.Xa=l("_getTrackerByName",51,function(g){g=g||"";return X.Db[g]||X.Y(u,g)});k.Tc=function(){var g=aa[na];return g&&g[oa]&&g[oa]()};k.Zc=l("_anonymizeIp",16,function(){k.Qa=q})};var Xa=function(){var k=this,l=za(k);k.fd=l("_createAsyncTracker",33,function(g,m){return X.Y(g,m||"")});k.ld=l("_getAsyncTracker",34,function(g){return X.Xa(g)});k.push=function(){O(5);for(var g=arguments,m=0,j=0;j<g[B];j++)try{if(typeof g[j]==="function")g[j]();else{var p="",h=g[j][0],a=h.lastIndexOf(".");if(a>0){p=h[F](0,a);h=h[F](a+1)}var c=p==ja?X:p==ka?Wa:X.Xa(p);c[h].apply(c,g[j].slice(1))}}catch(i){m++}return m}};var X=new Va;var Ya=aa[ja];if(Ya&&typeof Ya._getTracker=="function")X=Ya;else aa[ja]=X;var Wa=new Xa;a:{var Za=aa[ka],$a=t;if(Za&&typeof Za[ca]=="function"){$a=Aa(Za);if(!$a)break a}aa[ka]=Wa;$a&&Wa[ca].apply(Wa,Za)};})();

//if (typeof jQuery == 'undefined')
//{
/*!
 * jQuery JavaScript Library v1.5.1
 * http://jquery.com/
 *
 * Copyright 2011, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 * http://jquery.org/license
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 * Copyright 2011, The Dojo Foundation
 * Released under the MIT, BSD, and GPL Licenses.
 *
 * Date: Wed Feb 23 13:55:29 2011 -0500
 */
(function(a,b){function cg(a){return d.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cd(a){if(!bZ[a]){var b=d("<"+a+">").appendTo("body"),c=b.css("display");b.remove();if(c==="none"||c==="")c="block";bZ[a]=c}return bZ[a]}function cc(a,b){var c={};d.each(cb.concat.apply([],cb.slice(0,b)),function(){c[this]=a});return c}function bY(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function bX(){try{return new a.XMLHttpRequest}catch(b){}}function bW(){d(a).unload(function(){for(var a in bU)bU[a](0,1)})}function bQ(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var e=a.dataTypes,f={},g,h,i=e.length,j,k=e[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h==="string"&&(f[h.toLowerCase()]=a.converters[h]);l=k,k=e[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=f[m]||f["* "+k];if(!n){p=b;for(o in f){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=f[j[1]+" "+k];if(p){o=f[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&d.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function bP(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function bO(a,b,c,e){if(d.isArray(b)&&b.length)d.each(b,function(b,f){c||bq.test(a)?e(a,f):bO(a+"["+(typeof f==="object"||d.isArray(f)?b:"")+"]",f,c,e)});else if(c||b==null||typeof b!=="object")e(a,b);else if(d.isArray(b)||d.isEmptyObject(b))e(a,"");else for(var f in b)bO(a+"["+f+"]",b[f],c,e)}function bN(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bH,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l==="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bN(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bN(a,c,d,e,"*",g));return l}function bM(a){return function(b,c){typeof b!=="string"&&(c=b,b="*");if(d.isFunction(c)){var e=b.toLowerCase().split(bB),f=0,g=e.length,h,i,j;for(;f<g;f++)h=e[f],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bo(a,b,c){var e=b==="width"?bi:bj,f=b==="width"?a.offsetWidth:a.offsetHeight;if(c==="border")return f;d.each(e,function(){c||(f-=parseFloat(d.css(a,"padding"+this))||0),c==="margin"?f+=parseFloat(d.css(a,"margin"+this))||0:f-=parseFloat(d.css(a,"border"+this+"Width"))||0});return f}function ba(a,b){b.src?d.ajax({url:b.src,async:!1,dataType:"script"}):d.globalEval(b.text||b.textContent||b.innerHTML||""),b.parentNode&&b.parentNode.removeChild(b)}function _(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function $(a,b){if(b.nodeType===1){var c=b.nodeName.toLowerCase();b.clearAttributes(),b.mergeAttributes(a);if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(d.expando)}}function Z(a,b){if(b.nodeType===1&&d.hasData(a)){var c=d.expando,e=d.data(a),f=d.data(b,e);if(e=e[c]){var g=e.events;f=f[c]=d.extend({},e);if(g){delete f.handle,f.events={};for(var h in g)for(var i=0,j=g[h].length;i<j;i++)d.event.add(b,h+(g[h][i].namespace?".":"")+g[h][i].namespace,g[h][i],g[h][i].data)}}}}function Y(a,b){return d.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function O(a,b,c){if(d.isFunction(b))return d.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return d.grep(a,function(a,d){return a===b===c});if(typeof b==="string"){var e=d.grep(a,function(a){return a.nodeType===1});if(J.test(b))return d.filter(b,e,!c);b=d.filter(b,e)}return d.grep(a,function(a,e){return d.inArray(a,b)>=0===c})}function N(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function F(a,b){return(a&&a!=="*"?a+".":"")+b.replace(r,"`").replace(s,"&")}function E(a){var b,c,e,f,g,h,i,j,k,l,m,n,o,q=[],r=[],s=d._data(this,"events");if(a.liveFired!==this&&s&&s.live&&!a.target.disabled&&(!a.button||a.type!=="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var t=s.live.slice(0);for(i=0;i<t.length;i++)g=t[i],g.origType.replace(p,"")===a.type?r.push(g.selector):t.splice(i--,1);f=d(a.target).closest(r,a.currentTarget);for(j=0,k=f.length;j<k;j++){m=f[j];for(i=0;i<t.length;i++){g=t[i];if(m.selector===g.selector&&(!n||n.test(g.namespace))&&!m.elem.disabled){h=m.elem,e=null;if(g.preType==="mouseenter"||g.preType==="mouseleave")a.type=g.preType,e=d(a.relatedTarget).closest(g.selector)[0];(!e||e!==h)&&q.push({elem:h,handleObj:g,level:m.level})}}}for(j=0,k=q.length;j<k;j++){f=q[j];if(c&&f.level>c)break;a.currentTarget=f.elem,a.data=f.handleObj.data,a.handleObj=f.handleObj,o=f.handleObj.origHandler.apply(f.elem,arguments);if(o===!1||a.isPropagationStopped()){c=f.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function C(a,c,e){var f=d.extend({},e[0]);f.type=a,f.originalEvent={},f.liveFired=b,d.event.handle.call(c,f),f.isDefaultPrevented()&&e[0].preventDefault()}function w(){return!0}function v(){return!1}function g(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function f(a,c,f){if(f===b&&a.nodeType===1){f=a.getAttribute("data-"+c);if(typeof f==="string"){try{f=f==="true"?!0:f==="false"?!1:f==="null"?null:d.isNaN(f)?e.test(f)?d.parseJSON(f):f:parseFloat(f)}catch(g){}d.data(a,c,f)}else f=b}return f}var c=a.document,d=function(){function I(){if(!d.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(I,1);return}d.ready()}}var d=function(a,b){return new d.fn.init(a,b,g)},e=a.jQuery,f=a.$,g,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,i=/\S/,j=/^\s+/,k=/\s+$/,l=/\d/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=navigator.userAgent,w,x=!1,y,z="then done fail isResolved isRejected promise".split(" "),A,B=Object.prototype.toString,C=Object.prototype.hasOwnProperty,D=Array.prototype.push,E=Array.prototype.slice,F=String.prototype.trim,G=Array.prototype.indexOf,H={};d.fn=d.prototype={constructor:d,init:function(a,e,f){var g,i,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!e&&c.body){this.context=c,this[0]=c.body,this.selector="body",this.length=1;return this}if(typeof a==="string"){g=h.exec(a);if(!g||!g[1]&&e)return!e||e.jquery?(e||f).find(a):this.constructor(e).find(a);if(g[1]){e=e instanceof d?e[0]:e,k=e?e.ownerDocument||e:c,j=m.exec(a),j?d.isPlainObject(e)?(a=[c.createElement(j[1])],d.fn.attr.call(a,e,!0)):a=[k.createElement(j[1])]:(j=d.buildFragment([g[1]],[k]),a=(j.cacheable?d.clone(j.fragment):j.fragment).childNodes);return d.merge(this,a)}i=c.getElementById(g[2]);if(i&&i.parentNode){if(i.id!==g[2])return f.find(a);this.length=1,this[0]=i}this.context=c,this.selector=a;return this}if(d.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return d.makeArray(a,this)},selector:"",jquery:"1.5.1",length:0,size:function(){return this.length},toArray:function(){return E.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var e=this.constructor();d.isArray(a)?D.apply(e,a):d.merge(e,a),e.prevObject=this,e.context=this.context,b==="find"?e.selector=this.selector+(this.selector?" ":"")+c:b&&(e.selector=this.selector+"."+b+"("+c+")");return e},each:function(a,b){return d.each(this,a,b)},ready:function(a){d.bindReady(),y.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(E.apply(this,arguments),"slice",E.call(arguments).join(","))},map:function(a){return this.pushStack(d.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:D,sort:[].sort,splice:[].splice},d.fn.init.prototype=d.fn,d.extend=d.fn.extend=function(){var a,c,e,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i==="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!=="object"&&!d.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){e=i[c],f=a[c];if(i===f)continue;l&&f&&(d.isPlainObject(f)||(g=d.isArray(f)))?(g?(g=!1,h=e&&d.isArray(e)?e:[]):h=e&&d.isPlainObject(e)?e:{},i[c]=d.extend(l,h,f)):f!==b&&(i[c]=f)}return i},d.extend({noConflict:function(b){a.$=f,b&&(a.jQuery=e);return d},isReady:!1,readyWait:1,ready:function(a){a===!0&&d.readyWait--;if(!d.readyWait||a!==!0&&!d.isReady){if(!c.body)return setTimeout(d.ready,1);d.isReady=!0;if(a!==!0&&--d.readyWait>0)return;y.resolveWith(c,[d]),d.fn.trigger&&d(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!x){x=!0;if(c.readyState==="complete")return setTimeout(d.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",A,!1),a.addEventListener("load",d.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",A),a.attachEvent("onload",d.ready);var b=!1;try{b=a.frameElement==null}catch(e){}c.documentElement.doScroll&&b&&I()}}},isFunction:function(a){return d.type(a)==="function"},isArray:Array.isArray||function(a){return d.type(a)==="array"},isWindow:function(a){return a&&typeof a==="object"&&"setInterval"in a},isNaN:function(a){return a==null||!l.test(a)||isNaN(a)},type:function(a){return a==null?String(a):H[B.call(a)]||"object"},isPlainObject:function(a){if(!a||d.type(a)!=="object"||a.nodeType||d.isWindow(a))return!1;if(a.constructor&&!C.call(a,"constructor")&&!C.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a){}return c===b||C.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!=="string"||!b)return null;b=d.trim(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return a.JSON&&a.JSON.parse?a.JSON.parse(b):(new Function("return "+b))();d.error("Invalid JSON: "+b)},parseXML:function(b,c,e){a.DOMParser?(e=new DOMParser,c=e.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),e=c.documentElement,(!e||!e.nodeName||e.nodeName==="parsererror")&&d.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(a){if(a&&i.test(a)){var b=c.head||c.getElementsByTagName("head")[0]||c.documentElement,e=c.createElement("script");d.support.scriptEval()?e.appendChild(c.createTextNode(a)):e.text=a,b.insertBefore(e,b.firstChild),b.removeChild(e)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,e){var f,g=0,h=a.length,i=h===b||d.isFunction(a);if(e){if(i){for(f in a)if(c.apply(a[f],e)===!1)break}else for(;g<h;)if(c.apply(a[g++],e)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(var j=a[0];g<h&&c.call(j,g,j)!==!1;j=a[++g]){}return a},trim:F?function(a){return a==null?"":F.call(a)}:function(a){return a==null?"":(a+"").replace(j,"").replace(k,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var e=d.type(a);a.length==null||e==="string"||e==="function"||e==="regexp"||d.isWindow(a)?D.call(c,a):d.merge(c,a)}return c},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var c=0,d=b.length;c<d;c++)if(b[c]===a)return c;return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length==="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,b,c){var d=[],e;for(var f=0,g=a.length;f<g;f++)e=b(a[f],f,c),e!=null&&(d[d.length]=e);return d.concat.apply([],d)},guid:1,proxy:function(a,c,e){arguments.length===2&&(typeof c==="string"?(e=a,a=e[c],c=b):c&&!d.isFunction(c)&&(e=c,c=b)),!c&&a&&(c=function(){return a.apply(e||this,arguments)}),a&&(c.guid=a.guid=a.guid||c.guid||d.guid++);return c},access:function(a,c,e,f,g,h){var i=a.length;if(typeof c==="object"){for(var j in c)d.access(a,j,c[j],f,g,e);return a}if(e!==b){f=!h&&f&&d.isFunction(e);for(var k=0;k<i;k++)g(a[k],c,f?e.call(a[k],k,g(a[k],c)):e,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},_Deferred:function(){var a=[],b,c,e,f={done:function(){if(!e){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g<h;g++)i=c[g],j=d.type(i),j==="array"?f.done.apply(f,i):j==="function"&&a.push(i);k&&f.resolveWith(k[0],k[1])}return this},resolveWith:function(d,f){if(!e&&!b&&!c){c=1;try{while(a[0])a.shift().apply(d,f)}catch(g){throw g}finally{b=[d,f],c=0}}return this},resolve:function(){f.resolveWith(d.isFunction(this.promise)?this.promise():this,arguments);return this},isResolved:function(){return c||b},cancel:function(){e=1,a=[];return this}};return f},Deferred:function(a){var b=d._Deferred(),c=d._Deferred(),e;d.extend(b,{then:function(a,c){b.done(a).fail(c);return this},fail:c.done,rejectWith:c.resolveWith,reject:c.resolve,isRejected:c.isResolved,promise:function(a){if(a==null){if(e)return e;e=a={}}var c=z.length;while(c--)a[z[c]]=b[z[c]];return a}}),b.done(c.cancel).fail(b.cancel),delete b.cancel,a&&a.call(b,b);return b},when:function(a){var b=arguments.length,c=b<=1&&a&&d.isFunction(a.promise)?a:d.Deferred(),e=c.promise();if(b>1){var f=E.call(arguments,0),g=b,h=function(a){return function(b){f[a]=arguments.length>1?E.call(arguments,0):b,--g||c.resolveWith(e,f)}};while(b--)a=f[b],a&&d.isFunction(a.promise)?a.promise().then(h(b),c.reject):--g;g||c.resolveWith(e,f)}else c!==a&&c.resolve(a);return e},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}d.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.subclass=this.subclass,a.fn.init=function b(b,c){c&&c instanceof d&&!(c instanceof a)&&(c=a(c));return d.fn.init.call(this,b,c,e)},a.fn.init.prototype=a.fn;var e=a(c);return a},browser:{}}),y=d._Deferred(),d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){H["[object "+b+"]"]=b.toLowerCase()}),w=d.uaMatch(v),w.browser&&(d.browser[w.browser]=!0,d.browser.version=w.version),d.browser.webkit&&(d.browser.safari=!0),G&&(d.inArray=function(a,b){return G.call(b,a)}),i.test(" ")&&(j=/^[\s\xA0]+/,k=/[\s\xA0]+$/),g=d(c),c.addEventListener?A=function(){c.removeEventListener("DOMContentLoaded",A,!1),d.ready()}:c.attachEvent&&(A=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",A),d.ready())});return d}();(function(){d.support={};var b=c.createElement("div");b.style.display="none",b.innerHTML="   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";var e=b.getElementsByTagName("*"),f=b.getElementsByTagName("a")[0],g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=b.getElementsByTagName("input")[0];if(e&&e.length&&f){d.support={leadingWhitespace:b.firstChild.nodeType===3,tbody:!b.getElementsByTagName("tbody").length,htmlSerialize:!!b.getElementsByTagName("link").length,style:/red/.test(f.getAttribute("style")),hrefNormalized:f.getAttribute("href")==="/a",opacity:/^0.55$/.test(f.style.opacity),cssFloat:!!f.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,deleteExpando:!0,optDisabled:!1,checkClone:!1,noCloneEvent:!0,noCloneChecked:!0,boxModel:null,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableHiddenOffsets:!0},i.checked=!0,d.support.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,d.support.optDisabled=!h.disabled;var j=null;d.support.scriptEval=function(){if(j===null){var b=c.documentElement,e=c.createElement("script"),f="script"+d.now();try{e.appendChild(c.createTextNode("window."+f+"=1;"))}catch(g){}b.insertBefore(e,b.firstChild),a[f]?(j=!0,delete a[f]):j=!1,b.removeChild(e),b=e=f=null}return j};try{delete b.test}catch(k){d.support.deleteExpando=!1}!b.addEventListener&&b.attachEvent&&b.fireEvent&&(b.attachEvent("onclick",function l(){d.support.noCloneEvent=!1,b.detachEvent("onclick",l)}),b.cloneNode(!0).fireEvent("onclick")),b=c.createElement("div"),b.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";var m=c.createDocumentFragment();m.appendChild(b.firstChild),d.support.checkClone=m.cloneNode(!0).cloneNode(!0).lastChild.checked,d(function(){var a=c.createElement("div"),b=c.getElementsByTagName("body")[0];if(b){a.style.width=a.style.paddingLeft="1px",b.appendChild(a),d.boxModel=d.support.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,d.support.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="<div style='width:4px;'></div>",d.support.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";var e=a.getElementsByTagName("td");d.support.reliableHiddenOffsets=e[0].offsetHeight===0,e[0].style.display="",e[1].style.display="none",d.support.reliableHiddenOffsets=d.support.reliableHiddenOffsets&&e[0].offsetHeight===0,a.innerHTML="",b.removeChild(a).style.display="none",a=e=null}});var n=function(a){var b=c.createElement("div");a="on"+a;if(!b.attachEvent)return!0;var d=a in b;d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function"),b=null;return d};d.support.submitBubbles=n("submit"),d.support.changeBubbles=n("change"),b=e=f=null}})();var e=/^(?:\{.*\}|\[.*\])$/;d.extend({cache:{},uuid:0,expando:"jQuery"+(d.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?d.cache[a[d.expando]]:a[d.expando];return!!a&&!g(a)},data:function(a,c,e,f){if(d.acceptData(a)){var g=d.expando,h=typeof c==="string",i,j=a.nodeType,k=j?d.cache:a,l=j?a[d.expando]:a[d.expando]&&d.expando;if((!l||f&&l&&!k[l][g])&&h&&e===b)return;l||(j?a[d.expando]=l=++d.uuid:l=d.expando),k[l]||(k[l]={},j||(k[l].toJSON=d.noop));if(typeof c==="object"||typeof c==="function")f?k[l][g]=d.extend(k[l][g],c):k[l]=d.extend(k[l],c);i=k[l],f&&(i[g]||(i[g]={}),i=i[g]),e!==b&&(i[c]=e);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[c]:i}},removeData:function(b,c,e){if(d.acceptData(b)){var f=d.expando,h=b.nodeType,i=h?d.cache:b,j=h?b[d.expando]:d.expando;if(!i[j])return;if(c){var k=e?i[j][f]:i[j];if(k){delete k[c];if(!g(k))return}}if(e){delete i[j][f];if(!g(i[j]))return}var l=i[j][f];d.support.deleteExpando||i!=a?delete i[j]:i[j]=null,l?(i[j]={},h||(i[j].toJSON=d.noop),i[j][f]=l):h&&(d.support.deleteExpando?delete b[d.expando]:b.removeAttribute?b.removeAttribute(d.expando):b[d.expando]=null)}},_data:function(a,b,c){return d.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=d.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),d.fn.extend({data:function(a,c){var e=null;if(typeof a==="undefined"){if(this.length){e=d.data(this[0]);if(this[0].nodeType===1){var g=this[0].attributes,h;for(var i=0,j=g.length;i<j;i++)h=g[i].name,h.indexOf("data-")===0&&(h=h.substr(5),f(this[0],h,e[h]))}}return e}if(typeof a==="object")return this.each(function(){d.data(this,a)});var k=a.split(".");k[1]=k[1]?"."+k[1]:"";if(c===b){e=this.triggerHandler("getData"+k[1]+"!",[k[0]]),e===b&&this.length&&(e=d.data(this[0],a),e=f(this[0],a,e));return e===b&&k[1]?this.data(k[0]):e}return this.each(function(){var b=d(this),e=[k[0],c];b.triggerHandler("setData"+k[1]+"!",e),d.data(this,a,c),b.triggerHandler("changeData"+k[1]+"!",e)})},removeData:function(a){return this.each(function(){d.removeData(this,a)})}}),d.extend({queue:function(a,b,c){if(a){b=(b||"fx")+"queue";var e=d._data(a,b);if(!c)return e||[];!e||d.isArray(c)?e=d._data(a,b,d.makeArray(c)):e.push(c);return e}},dequeue:function(a,b){b=b||"fx";var c=d.queue(a,b),e=c.shift();e==="inprogress"&&(e=c.shift()),e&&(b==="fx"&&c.unshift("inprogress"),e.call(a,function(){d.dequeue(a,b)})),c.length||d.removeData(a,b+"queue",!0)}}),d.fn.extend({queue:function(a,c){typeof a!=="string"&&(c=a,a="fx");if(c===b)return d.queue(this[0],a);return this.each(function(b){var e=d.queue(this,a,c);a==="fx"&&e[0]!=="inprogress"&&d.dequeue(this,a)})},dequeue:function(a){return this.each(function(){d.dequeue(this,a)})},delay:function(a,b){a=d.fx?d.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){d.dequeue(c,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var h=/[\n\t\r]/g,i=/\s+/,j=/\r/g,k=/^(?:href|src|style)$/,l=/^(?:button|input)$/i,m=/^(?:button|input|object|select|textarea)$/i,n=/^a(?:rea)?$/i,o=/^(?:radio|checkbox)$/i;d.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"},d.fn.extend({attr:function(a,b){return d.access(this,a,b,!0,d.attr)},removeAttr:function(a,b){return this.each(function(){d.attr(this,a,""),this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.addClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"){var b=(a||"").split(i);for(var c=0,e=this.length;c<e;c++){var f=this[c];if(f.nodeType===1)if(f.className){var g=" "+f.className+" ",h=f.className;for(var j=0,k=b.length;j<k;j++)g.indexOf(" "+b[j]+" ")<0&&(h+=" "+b[j]);f.className=d.trim(h)}else f.className=a}}return this},removeClass:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.removeClass(a.call(this,b,c.attr("class")))});if(a&&typeof a==="string"||a===b){var c=(a||"").split(i);for(var e=0,f=this.length;e<f;e++){var g=this[e];if(g.nodeType===1&&g.className)if(a){var j=(" "+g.className+" ").replace(h," ");for(var k=0,l=c.length;k<l;k++)j=j.replace(" "+c[k]+" "," ");g.className=d.trim(j)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,e=typeof b==="boolean";if(d.isFunction(a))return this.each(function(c){var e=d(this);e.toggleClass(a.call(this,c,e.attr("class"),b),b)});return this.each(function(){if(c==="string"){var f,g=0,h=d(this),j=b,k=a.split(i);while(f=k[g++])j=e?j:!h.hasClass(f),h[j?"addClass":"removeClass"](f)}else if(c==="undefined"||c==="boolean")this.className&&d._data(this,"__className__",this.className),this.className=this.className||a===!1?"":d._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ";for(var c=0,d=this.length;c<d;c++)if((" "+this[c].className+" ").replace(h," ").indexOf(b)>-1)return!0;return!1},val:function(a){if(!arguments.length){var c=this[0];if(c){if(d.nodeName(c,"option")){var e=c.attributes.value;return!e||e.specified?c.value:c.text}if(d.nodeName(c,"select")){var f=c.selectedIndex,g=[],h=c.options,i=c.type==="select-one";if(f<0)return null;for(var k=i?f:0,l=i?f+1:h.length;k<l;k++){var m=h[k];if(m.selected&&(d.support.optDisabled?!m.disabled:m.getAttribute("disabled")===null)&&(!m.parentNode.disabled||!d.nodeName(m.parentNode,"optgroup"))){a=d(m).val();if(i)return a;g.push(a)}}if(i&&!g.length&&h.length)return d(h[f]).val();return g}if(o.test(c.type)&&!d.support.checkOn)return c.getAttribute("value")===null?"on":c.value;return(c.value||"").replace(j,"")}return b}var n=d.isFunction(a);return this.each(function(b){var c=d(this),e=a;if(this.nodeType===1){n&&(e=a.call(this,b,c.val())),e==null?e="":typeof e==="number"?e+="":d.isArray(e)&&(e=d.map(e,function(a){return a==null?"":a+""}));if(d.isArray(e)&&o.test(this.type))this.checked=d.inArray(c.val(),e)>=0;else if(d.nodeName(this,"select")){var f=d.makeArray(e);d("option",this).each(function(){this.selected=d.inArray(d(this).val(),f)>=0}),f.length||(this.selectedIndex=-1)}else this.value=e}})}}),d.extend({attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,e,f){if(!a||a.nodeType===3||a.nodeType===8||a.nodeType===2)return b;if(f&&c in d.attrFn)return d(a)[c](e);var g=a.nodeType!==1||!d.isXMLDoc(a),h=e!==b;c=g&&d.props[c]||c;if(a.nodeType===1){var i=k.test(c);if(c==="selected"&&!d.support.optSelected){var j=a.parentNode;j&&(j.selectedIndex,j.parentNode&&j.parentNode.selectedIndex)}if((c in a||a[c]!==b)&&g&&!i){h&&(c==="type"&&l.test(a.nodeName)&&a.parentNode&&d.error("type property can't be changed"),e===null?a.nodeType===1&&a.removeAttribute(c):a[c]=e);if(d.nodeName(a,"form")&&a.getAttributeNode(c))return a.getAttributeNode(c).nodeValue;if(c==="tabIndex"){var o=a.getAttributeNode("tabIndex");return o&&o.specified?o.value:m.test(a.nodeName)||n.test(a.nodeName)&&a.href?0:b}return a[c]}if(!d.support.style&&g&&c==="style"){h&&(a.style.cssText=""+e);return a.style.cssText}h&&a.setAttribute(c,""+e);if(!a.attributes[c]&&(a.hasAttribute&&!a.hasAttribute(c)))return b;var p=!d.support.hrefNormalized&&g&&i?a.getAttribute(c,2):a.getAttribute(c);return p===null?b:p}h&&(a[c]=e);return a[c]}});var p=/\.(.*)$/,q=/^(?:textarea|input|select)$/i,r=/\./g,s=/ /g,t=/[^\w\s.|`]/g,u=function(a){return a.replace(t,"\\$&")};d.event={add:function(c,e,f,g){if(c.nodeType!==3&&c.nodeType!==8){try{d.isWindow(c)&&(c!==a&&!c.frameElement)&&(c=a)}catch(h){}if(f===!1)f=v;else if(!f)return;var i,j;f.handler&&(i=f,f=i.handler),f.guid||(f.guid=d.guid++);var k=d._data(c);if(!k)return;var l=k.events,m=k.handle;l||(k.events=l={}),m||(k.handle=m=function(){return typeof d!=="undefined"&&!d.event.triggered?d.event.handle.apply(m.elem,arguments):b}),m.elem=c,e=e.split(" ");var n,o=0,p;while(n=e[o++]){j=i?d.extend({},i):{handler:f,data:g},n.indexOf(".")>-1?(p=n.split("."),n=p.shift(),j.namespace=p.slice(0).sort().join(".")):(p=[],j.namespace=""),j.type=n,j.guid||(j.guid=f.guid);var q=l[n],r=d.event.special[n]||{};if(!q){q=l[n]=[];if(!r.setup||r.setup.call(c,g,p,m)===!1)c.addEventListener?c.addEventListener(n,m,!1):c.attachEvent&&c.attachEvent("on"+n,m)}r.add&&(r.add.call(c,j),j.handler.guid||(j.handler.guid=f.guid)),q.push(j),d.event.global[n]=!0}c=null}},global:{},remove:function(a,c,e,f){if(a.nodeType!==3&&a.nodeType!==8){e===!1&&(e=v);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=d.hasData(a)&&d._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(e=c.handler,c=c.type);if(!c||typeof c==="string"&&c.charAt(0)==="."){c=c||"";for(h in t)d.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+d.map(m.slice(0).sort(),u).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!e){for(j=0;j<p.length;j++){q=p[j];if(l||n.test(q.namespace))d.event.remove(a,r,q.handler,j),p.splice(j--,1)}continue}o=d.event.special[h]||{};for(j=f||0;j<p.length;j++){q=p[j];if(e.guid===q.guid){if(l||n.test(q.namespace))f==null&&p.splice(j--,1),o.remove&&o.remove.call(a,q);if(f!=null)break}}if(p.length===0||f!=null&&p.length===1)(!o.teardown||o.teardown.call(a,m)===!1)&&d.removeEvent(a,h,s.handle),g=null,delete t[h]}if(d.isEmptyObject(t)){var w=s.handle;w&&(w.elem=null),delete s.events,delete s.handle,d.isEmptyObject(s)&&d.removeData(a,b,!0)}}},trigger:function(a,c,e){var f=a.type||a,g=arguments[3];if(!g){a=typeof a==="object"?a[d.expando]?a:d.extend(d.Event(f),a):d.Event(f),f.indexOf("!")>=0&&(a.type=f=f.slice(0,-1),a.exclusive=!0),e||(a.stopPropagation(),d.event.global[f]&&d.each(d.cache,function(){var b=d.expando,e=this[b];e&&e.events&&e.events[f]&&d.event.trigger(a,c,e.handle.elem)}));if(!e||e.nodeType===3||e.nodeType===8)return b;a.result=b,a.target=e,c=d.makeArray(c),c.unshift(a)}a.currentTarget=e;var h=d._data(e,"handle");h&&h.apply(e,c);var i=e.parentNode||e.ownerDocument;try{e&&e.nodeName&&d.noData[e.nodeName.toLowerCase()]||e["on"+f]&&e["on"+f].apply(e,c)===!1&&(a.result=!1,a.preventDefault())}catch(j){}if(!a.isPropagationStopped()&&i)d.event.trigger(a,c,i,!0);else if(!a.isDefaultPrevented()){var k,l=a.target,m=f.replace(p,""),n=d.nodeName(l,"a")&&m==="click",o=d.event.special[m]||{};if((!o._default||o._default.call(e,a)===!1)&&!n&&!(l&&l.nodeName&&d.noData[l.nodeName.toLowerCase()])){try{l[m]&&(k=l["on"+m],k&&(l["on"+m]=null),d.event.triggered=!0,l[m]())}catch(q){}k&&(l["on"+m]=k),d.event.triggered=!1}}},handle:function(c){var e,f,g,h,i,j=[],k=d.makeArray(arguments);c=k[0]=d.event.fix(c||a.event),c.currentTarget=this,e=c.type.indexOf(".")<0&&!c.exclusive,e||(g=c.type.split("."),c.type=g.shift(),j=g.slice(0).sort(),h=new RegExp("(^|\\.)"+j.join("\\.(?:.*\\.)?")+"(\\.|$)")),c.namespace=c.namespace||j.join("."),i=d._data(this,"events"),f=(i||{})[c.type];if(i&&f){f=f.slice(0);for(var l=0,m=f.length;l<m;l++){var n=f[l];if(e||h.test(n.namespace)){c.handler=n.handler,c.data=n.data,c.handleObj=n;var o=n.handler.apply(this,k);o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()));if(c.isImmediatePropagationStopped())break}}}return c.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(a){if(a[d.expando])return a;var e=a;a=d.Event(e);for(var f=this.props.length,g;f;)g=this.props[--f],a[g]=e[g];a.target||(a.target=a.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),!a.relatedTarget&&a.fromElement&&(a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement);if(a.pageX==null&&a.clientX!=null){var h=c.documentElement,i=c.body;a.pageX=a.clientX+(h&&h.scrollLeft||i&&i.scrollLeft||0)-(h&&h.clientLeft||i&&i.clientLeft||0),a.pageY=a.clientY+(h&&h.scrollTop||i&&i.scrollTop||0)-(h&&h.clientTop||i&&i.clientTop||0)}a.which==null&&(a.charCode!=null||a.keyCode!=null)&&(a.which=a.charCode!=null?a.charCode:a.keyCode),!a.metaKey&&a.ctrlKey&&(a.metaKey=a.ctrlKey),!a.which&&a.button!==b&&(a.which=a.button&1?1:a.button&2?3:a.button&4?2:0);return a},guid:1e8,proxy:d.proxy,special:{ready:{setup:d.bindReady,teardown:d.noop},live:{add:function(a){d.event.add(this,F(a.origType,a.selector),d.extend({},a,{handler:E,guid:a.handler.guid}))},remove:function(a){d.event.remove(this,F(a.origType,a.selector),a)}},beforeunload:{setup:function(a,b,c){d.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}}},d.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},d.Event=function(a){if(!this.preventDefault)return new d.Event(a);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?w:v):this.type=a,this.timeStamp=d.now(),this[d.expando]=!0},d.Event.prototype={preventDefault:function(){this.isDefaultPrevented=w;var a=this.originalEvent;a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=w;var a=this.originalEvent;a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=w,this.stopPropagation()},isDefaultPrevented:v,isPropagationStopped:v,isImmediatePropagationStopped:v};var x=function(a){var b=a.relatedTarget;try{if(b!==c&&!b.parentNode)return;while(b&&b!==this)b=b.parentNode;b!==this&&(a.type=a.data,d.event.handle.apply(this,arguments))}catch(e){}},y=function(a){a.type=a.data,d.event.handle.apply(this,arguments)};d.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){d.event.special[a]={setup:function(c){d.event.add(this,b,c&&c.selector?y:x,a)},teardown:function(a){d.event.remove(this,b,a&&a.selector?y:x)}}}),d.support.submitBubbles||(d.event.special.submit={setup:function(a,b){if(this.nodeName&&this.nodeName.toLowerCase()!=="form")d.event.add(this,"click.specialSubmit",function(a){var b=a.target,c=b.type;(c==="submit"||c==="image")&&d(b).closest("form").length&&C("submit",this,arguments)}),d.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,c=b.type;(c==="text"||c==="password")&&d(b).closest("form").length&&a.keyCode===13&&C("submit",this,arguments)});else return!1},teardown:function(a){d.event.remove(this,".specialSubmit")}});if(!d.support.changeBubbles){var z,A=function(a){var b=a.type,c=a.value;b==="radio"||b==="checkbox"?c=a.checked:b==="select-multiple"?c=a.selectedIndex>-1?d.map(a.options,function(a){return a.selected}).join("-"):"":a.nodeName.toLowerCase()==="select"&&(c=a.selectedIndex);return c},B=function B(a){var c=a.target,e,f;if(q.test(c.nodeName)&&!c.readOnly){e=d._data(c,"_change_data"),f=A(c),(a.type!=="focusout"||c.type!=="radio")&&d._data(c,"_change_data",f);if(e===b||f===e)return;if(e!=null||f)a.type="change",a.liveFired=b,d.event.trigger(a,arguments[1],c)}};d.event.special.change={filters:{focusout:B,beforedeactivate:B,click:function(a){var b=a.target,c=b.type;(c==="radio"||c==="checkbox"||b.nodeName.toLowerCase()==="select")&&B.call(this,a)},keydown:function(a){var b=a.target,c=b.type;(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&B.call(this,a)},beforeactivate:function(a){var b=a.target;d._data(b,"_change_data",A(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in z)d.event.add(this,c+".specialChange",z[c]);return q.test(this.nodeName)},teardown:function(a){d.event.remove(this,".specialChange");return q.test(this.nodeName)}},z=d.event.special.change.filters,z.focus=z.beforeactivate}c.addEventListener&&d.each({focus:"focusin",blur:"focusout"},function(a,b){function c(a){a=d.event.fix(a),a.type=b;return d.event.handle.call(this,a)}d.event.special[b]={setup:function(){this.addEventListener(a,c,!0)},teardown:function(){this.removeEventListener(a,c,!0)}}}),d.each(["bind","one"],function(a,c){d.fn[c]=function(a,e,f){if(typeof a==="object"){for(var g in a)this[c](g,e,a[g],f);return this}if(d.isFunction(e)||e===!1)f=e,e=b;var h=c==="one"?d.proxy(f,function(a){d(this).unbind(a,h);return f.apply(this,arguments)}):f;if(a==="unload"&&c!=="one")this.one(a,e,f);else for(var i=0,j=this.length;i<j;i++)d.event.add(this[i],a,h,e);return this}}),d.fn.extend({unbind:function(a,b){if(typeof a!=="object"||a.preventDefault)for(var e=0,f=this.length;e<f;e++)d.event.remove(this[e],a,b);else for(var c in a)this.unbind(c,a[c]);return this},delegate:function(a,b,c,d){return this.live(b,c,d,a)},undelegate:function(a,b,c){return arguments.length===0?this.unbind("live"):this.die(b,null,c,a)},trigger:function(a,b){return this.each(function(){d.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){var c=d.Event(a);c.preventDefault(),c.stopPropagation(),d.event.trigger(c,b,this[0]);return c.result}},toggle:function(a){var b=arguments,c=1;while(c<b.length)d.proxy(a,b[c++]);return this.click(d.proxy(a,function(e){var f=(d._data(this,"lastToggle"+a.guid)||0)%c;d._data(this,"lastToggle"+a.guid,f+1),e.preventDefault();return b[f].apply(this,arguments)||!1}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var D={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};d.each(["live","die"],function(a,c){d.fn[c]=function(a,e,f,g){var h,i=0,j,k,l,m=g||this.selector,n=g?this:d(this.context);if(typeof a==="object"&&!a.preventDefault){for(var o in a)n[c](o,e,a[o],m);return this}d.isFunction(e)&&(f=e,e=b),a=(a||"").split(" ");while((h=a[i++])!=null){j=p.exec(h),k="",j&&(k=j[0],h=h.replace(p,""));if(h==="hover"){a.push("mouseenter"+k,"mouseleave"+k);continue}l=h,h==="focus"||h==="blur"?(a.push(D[h]+k),h=h+k):h=(D[h]||h)+k;if(c==="live")for(var q=0,r=n.length;q<r;q++)d.event.add(n[q],"live."+F(h,m),{data:e,selector:m,handler:f,origType:h,origHandler:f,preType:l});else n.unbind("live."+F(h,m),f)}return this}}),d.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){d.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.bind(b,a,c):this.trigger(b)},d.attrFn&&(d.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}if(i.nodeType===1){f||(i.sizcache=c,i.sizset=g);if(typeof b!=="string"){if(i===b){j=!0;break}}else if(k.filter(b,[i]).length>0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g<h;g++){var i=d[g];if(i){var j=!1;i=i[a];while(i){if(i.sizcache===c){j=d[i.sizset];break}i.nodeType===1&&!f&&(i.sizcache=c,i.sizset=g);if(i.nodeName.toLowerCase()===b){j=i;break}i=i[a]}d[g]=j}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,e,g){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!=="string")return e;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(f.call(n)==="[object Array]")if(u)if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&e.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&e.push(j[t]);else e.push.apply(e,n);else p(n,e);o&&(k(o,h,e,g),k.uniqueSort(e));return e};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},k.matches=function(a,b){return k(a,null,null,b)},k.matchesSelector=function(a,b){return k(b,null,null,[a]).length>0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e<f;e++){var g,h=l.order[e];if(g=l.leftMatch[h].exec(a)){var j=g[1];g.splice(1,1);if(j.substr(j.length-1)!=="\\"){g[1]=(g[1]||"").replace(i,""),d=l.find[h](g,b,c);if(d!=null){a=a.replace(l.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!=="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},k.filter=function(a,c,d,e){var f,g,h=a,i=[],j=c,m=c&&c[0]&&k.isXML(c[0]);while(a&&c.length){for(var n in l.filter)if((f=l.leftMatch[n].exec(a))!=null&&f[2]){var o,p,q=l.filter[n],r=f[1];g=!1,f.splice(1,1);if(r.substr(r.length-1)==="\\")continue;j===i&&(i=[]);if(l.preFilter[n]){f=l.preFilter[n](f,j,d,i,e,m);if(f){if(f===!0)continue}else g=o=!0}if(f)for(var s=0;(p=j[s])!=null;s++)if(p){o=q(p,f,s,j);var t=e^!!o;d&&o!=null?t?g=!0:j[s]=!1:t&&(i.push(p),g=!0)}if(o!==b){d||(j=i),a=a.replace(l.match[n],"");if(!g)return[];break}}if(a===h)if(g==null)k.error(a);else break;h=a}return j},k.error=function(a){throw"Syntax error, unrecognized expression: "+a};var l=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b==="string",d=c&&!j.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1){}a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&k.filter(b,a,!0)},">":function(a,b){var c,d=typeof b==="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&k.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=u;typeof b==="string"&&!j.test(b)&&(b=b.toLowerCase(),d=b,g=t),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!=="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!=="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!=="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(i,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){return"text"===a.getAttribute("type")},radio:function(a){return"radio"===a.type},checkbox:function(a){return"checkbox"===a.type},file:function(a){return"file"===a.type},password:function(a){return"password"===a.type},submit:function(a){return"submit"===a.type},image:function(a){return"image"===a.type},reset:function(a){return"reset"===a.type},button:function(a){return"button"===a.type||a.nodeName.toLowerCase()==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}k.error(e)},CHILD:function(a,b){var c=b[1],d=a;switch(c){case"only":case"first":while(d=d.previousSibling)if(d.nodeType===1)return!1;if(c==="first")return!0;d=a;case"last":while(d=d.nextSibling)if(d.nodeType===1)return!1;return!0;case"nth":var e=b[2],f=b[3];if(e===1&&f===0)return!0;var g=b[0],h=a.parentNode;if(h&&(h.sizcache!==g||!a.nodeIndex)){var i=0;for(d=h.firstChild;d;d=d.nextSibling)d.nodeType===1&&(d.nodeIndex=++i);h.sizcache=g}var j=a.nodeIndex-f;return e===0?j===0:j%e===0&&j/e>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(f.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length==="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var r,s;c.documentElement.compareDocumentPosition?r=function(a,b){if(a===b){g=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(r=function(a,b){var c,d,e=[],f=[],h=a.parentNode,i=b.parentNode,j=h;if(a===b){g=!0;return 0}if(h===i)return s(a,b);if(!h)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return s(e[k],f[k]);return k===c?s(a,f[k],-1):s(e[k],b,1)},s=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),k.getText=function(a){var b="",c;for(var d=0;a[d];d++)c=a[d],c.nodeType===3||c.nodeType===4?b+=c.nodeValue:c.nodeType!==8&&(b+=k.getText(c.childNodes));return b},function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!=="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!=="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!=="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!=="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector,d=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(e){d=!0}b&&(k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(d||!l.match.PSEUDO.test(c)&&!/!=/.test(c))return b.call(a,c)}catch(e){}return k(c,null,null,[a]).length>0})}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!=="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g<h;g++)k(a,f[g],d);return k.filter(e,d)};d.find=k,d.expr=k.selectors,d.expr[":"]=d.expr.filters,d.unique=k.uniqueSort,d.text=k.getText,d.isXMLDoc=k.isXML,d.contains=k.contains}();var G=/Until$/,H=/^(?:parents|prevUntil|prevAll)/,I=/,/,J=/^.[^:#\[\.,]*$/,K=Array.prototype.slice,L=d.expr.match.POS,M={children:!0,contents:!0,next:!0,prev:!0};d.fn.extend({find:function(a){var b=this.pushStack("","find",a),c=0;for(var e=0,f=this.length;e<f;e++){c=b.length,d.find(a,this[e],b);if(e>0)for(var g=c;g<b.length;g++)for(var h=0;h<c;h++)if(b[h]===b[g]){b.splice(g--,1);break}}return b},has:function(a){var b=d(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(d.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(O(this,a,!1),"not",a)},filter:function(a){return this.pushStack(O(this,a,!0),"filter",a)},is:function(a){return!!a&&d.filter(a,this).length>0},closest:function(a,b){var c=[],e,f,g=this[0];if(d.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(e=0,f=a.length;e<f;e++)i=a[e],j[i]||(j[i]=d.expr.match.POS.test(i)?d(i,b||this.context):i);while(g&&g.ownerDocument&&g!==b){for(i in j)h=j[i],(h.jquery?h.index(g)>-1:d(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=L.test(a)?d(a,b||this.context):null;for(e=0,f=this.length;e<f;e++){g=this[e];while(g){if(l?l.index(g)>-1:d.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b)break}}c=c.length>1?d.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a==="string")return d.inArray(this[0],a?d(a):this.parent().children());return d.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a==="string"?d(a,b):d.makeArray(a),e=d.merge(this.get(),c);return this.pushStack(N(c[0])||N(e[0])?e:d.unique(e))},andSelf:function(){return this.add(this.prevObject)}}),d.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return d.dir(a,"parentNode")},parentsUntil:function(a,b,c){return d.dir(a,"parentNode",c)},next:function(a){return d.nth(a,2,"nextSibling")},prev:function(a){return d.nth(a,2,"previousSibling")},nextAll:function(a){return d.dir(a,"nextSibling")},prevAll:function(a){return d.dir(a,"previousSibling")},nextUntil:function(a,b,c){return d.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return d.dir(a,"previousSibling",c)},siblings:function(a){return d.sibling(a.parentNode.firstChild,a)},children:function(a){return d.sibling(a.firstChild)},contents:function(a){return d.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:d.makeArray(a.childNodes)}},function(a,b){d.fn[a]=function(c,e){var f=d.map(this,b,c),g=K.call(arguments);G.test(a)||(e=c),e&&typeof e==="string"&&(f=d.filter(e,f)),f=this.length>1&&!M[a]?d.unique(f):f,(this.length>1||I.test(e))&&H.test(a)&&(f=f.reverse());return this.pushStack(f,a,g.join(","))}}),d.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?d.find.matchesSelector(b[0],a)?[b[0]]:[]:d.find.matches(a,b)},dir:function(a,c,e){var f=[],g=a[c];while(g&&g.nodeType!==9&&(e===b||g.nodeType!==1||!d(g).is(e)))g.nodeType===1&&f.push(g),g=g[c];return f},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var P=/ jQuery\d+="(?:\d+|null)"/g,Q=/^\s+/,R=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/<([\w:]+)/,T=/<tbody/i,U=/<|&#?\w+;/,V=/<(?:script|object|embed|option|style)/i,W=/checked\s*(?:[^=]|=\s*.checked.)/i,X={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};X.optgroup=X.option,X.tbody=X.tfoot=X.colgroup=X.caption=X.thead,X.th=X.td,d.support.htmlSerialize||(X._default=[1,"div<div>","</div>"]),d.fn.extend({text:function(a){if(d.isFunction(a))return this.each(function(b){var c=d(this);c.text(a.call(this,b,c.text()))});if(typeof a!=="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return d.text(this)},wrapAll:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapAll(a.call(this,b))});if(this[0]){var b=d(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(d.isFunction(a))return this.each(function(b){d(this).wrapInner(a.call(this,b))});return this.each(function(){var b=d(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){d(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){d.nodeName(this,"body")||d(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=d(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,d(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,e;(e=this[c])!=null;c++)if(!a||d.filter(a,[e]).length)!b&&e.nodeType===1&&(d.cleanData(e.getElementsByTagName("*")),d.cleanData([e])),e.parentNode&&e.parentNode.removeChild(e);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&d.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return d.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(P,""):null;if(typeof a!=="string"||V.test(a)||!d.support.leadingWhitespace&&Q.test(a)||X[(S.exec(a)||["",""])[1].toLowerCase()])d.isFunction(a)?this.each(function(b){var c=d(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);else{a=a.replace(R,"<$1></$2>");try{for(var c=0,e=this.length;c<e;c++)this[c].nodeType===1&&(d.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(f){this.empty().append(a)}}return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(d.isFunction(a))return this.each(function(b){var c=d(this),e=c.html();c.replaceWith(a.call(this,b,e))});typeof a!=="string"&&(a=d(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;d(this).remove(),b?d(b).before(a):d(c).append(a)})}return this.pushStack(d(d.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,e){var f,g,h,i,j=a[0],k=[];if(!d.support.checkClone&&arguments.length===3&&typeof j==="string"&&W.test(j))return this.each(function(){d(this).domManip(a,c,e,!0)});if(d.isFunction(j))return this.each(function(f){var g=d(this);a[0]=j.call(this,f,c?g.html():b),g.domManip(a,c,e)});if(this[0]){i=j&&j.parentNode,d.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?f={fragment:i}:f=d.buildFragment(a,this,k),h=f.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&d.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)e.call(c?Y(this[l],g):this[l],f.cacheable||m>1&&l<n?d.clone(h,!0,!0):h)}k.length&&d.each(k,ba)}return this}}),d.buildFragment=function(a,b,e){var f,g,h,i=b&&b[0]?b[0].ownerDocument||b[0]:c;a.length===1&&typeof a[0]==="string"&&a[0].length<512&&i===c&&a[0].charAt(0)==="<"&&!V.test(a[0])&&(d.support.checkClone||!W.test(a[0]))&&(g=!0,h=d.fragments[a[0]],h&&(h!==1&&(f=h))),f||(f=i.createDocumentFragment(),d.clean(a,i,f,e)),g&&(d.fragments[a[0]]=h?f:1);return{fragment:f,cacheable:g}},d.fragments={},d.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){d.fn[a]=function(c){var e=[],f=d(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&f.length===1){f[b](this[0]);return this}for(var h=0,i=f.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();d(f[h])[b](j),e=e.concat(j)}return this.pushStack(e,a,f.selector)}}),d.extend({clone:function(a,b,c){var e=a.cloneNode(!0),f,g,h;if((!d.support.noCloneEvent||!d.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!d.isXMLDoc(a)){$(a,e),f=_(a),g=_(e);for(h=0;f[h];++h)$(f[h],g[h])}if(b){Z(a,e);if(c){f=_(a),g=_(e);for(h=0;f[h];++h)Z(f[h],g[h])}}return e},clean:function(a,b,e,f){b=b||c,typeof b.createElement==="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var g=[];for(var h=0,i;(i=a[h])!=null;h++){typeof i==="number"&&(i+="");if(!i)continue;if(typeof i!=="string"||U.test(i)){if(typeof i==="string"){i=i.replace(R,"<$1></$2>");var j=(S.exec(i)||["",""])[1].toLowerCase(),k=X[j]||X._default,l=k[0],m=b.createElement("div");m.innerHTML=k[1]+i+k[2];while(l--)m=m.lastChild;if(!d.support.tbody){var n=T.test(i),o=j==="table"&&!n?m.firstChild&&m.firstChild.childNodes:k[1]==="<table>"&&!n?m.childNodes:[];for(var p=o.length-1;p>=0;--p)d.nodeName(o[p],"tbody")&&!o[p].childNodes.length&&o[p].parentNode.removeChild(o[p])}!d.support.leadingWhitespace&&Q.test(i)&&m.insertBefore(b.createTextNode(Q.exec(i)[0]),m.firstChild),i=m.childNodes}}else i=b.createTextNode(i);i.nodeType?g.push(i):g=d.merge(g,i)}if(e)for(h=0;g[h];h++)!f||!d.nodeName(g[h],"script")||g[h].type&&g[h].type.toLowerCase()!=="text/javascript"?(g[h].nodeType===1&&g.splice.apply(g,[h+1,0].concat(d.makeArray(g[h].getElementsByTagName("script")))),e.appendChild(g[h])):f.push(g[h].parentNode?g[h].parentNode.removeChild(g[h]):g[h]);return g},cleanData:function(a){var b,c,e=d.cache,f=d.expando,g=d.event.special,h=d.support.deleteExpando;for(var i=0,j;(j=a[i])!=null;i++){if(j.nodeName&&d.noData[j.nodeName.toLowerCase()])continue;c=j[d.expando];if(c){b=e[c]&&e[c][f];if(b&&b.events){for(var k in b.events)g[k]?d.event.remove(j,k):d.removeEvent(j,k,b.handle);b.handle&&(b.handle.elem=null)}h?delete j[d.expando]:j.removeAttribute&&j.removeAttribute(d.expando),delete e[c]}}}});var bb=/alpha\([^)]*\)/i,bc=/opacity=([^)]*)/,bd=/-([a-z])/ig,be=/([A-Z])/g,bf=/^-?\d+(?:px)?$/i,bg=/^-?\d/,bh={position:"absolute",visibility:"hidden",display:"block"},bi=["Left","Right"],bj=["Top","Bottom"],bk,bl,bm,bn=function(a,b){return b.toUpperCase()};d.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return d.access(this,a,c,!0,function(a,c,e){return e!==b?d.style(a,c,e):d.css(a,c)})},d.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bk(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{zIndex:!0,fontWeight:!0,opacity:!0,zoom:!0,lineHeight:!0},cssProps:{"float":d.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,e,f){if(a&&a.nodeType!==3&&a.nodeType!==8&&a.style){var g,h=d.camelCase(c),i=a.style,j=d.cssHooks[h];c=d.cssProps[h]||h;if(e===b){if(j&&"get"in j&&(g=j.get(a,!1,f))!==b)return g;return i[c]}if(typeof e==="number"&&isNaN(e)||e==null)return;typeof e==="number"&&!d.cssNumber[h]&&(e+="px");if(!j||!("set"in j)||(e=j.set(a,e))!==b)try{i[c]=e}catch(k){}}},css:function(a,c,e){var f,g=d.camelCase(c),h=d.cssHooks[g];c=d.cssProps[g]||g;if(h&&"get"in h&&(f=h.get(a,!0,e))!==b)return f;if(bk)return bk(a,c,g)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]},camelCase:function(a){return a.replace(bd,bn)}}),d.curCSS=d.css,d.each(["height","width"],function(a,b){d.cssHooks[b]={get:function(a,c,e){var f;if(c){a.offsetWidth!==0?f=bo(a,b,e):d.swap(a,bh,function(){f=bo(a,b,e)});if(f<=0){f=bk(a,b,b),f==="0px"&&bm&&(f=bm(a,b,b));if(f!=null)return f===""||f==="auto"?"0px":f}if(f<0||f==null){f=a.style[b];return f===""||f==="auto"?"0px":f}return typeof f==="string"?f:f+"px"}},set:function(a,b){if(!bf.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),d.support.opacity||(d.cssHooks.opacity={get:function(a,b){return bc.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style;c.zoom=1;var e=d.isNaN(b)?"":"alpha(opacity="+b*100+")",f=c.filter||"";c.filter=bb.test(f)?f.replace(bb,e):c.filter+" "+e}}),c.defaultView&&c.defaultView.getComputedStyle&&(bl=function(a,c,e){var f,g,h;e=e.replace(be,"-$1").toLowerCase();if(!(g=a.ownerDocument.defaultView))return b;if(h=g.getComputedStyle(a,null))f=h.getPropertyValue(e),f===""&&!d.contains(a.ownerDocument.documentElement,a)&&(f=d.style(a,e));return f}),c.documentElement.currentStyle&&(bm=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bf.test(d)&&bg.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bk=bl||bm,d.expr&&d.expr.filters&&(d.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!d.support.reliableHiddenOffsets&&(a.style.display||d.css(a,"display"))==="none"},d.expr.filters.visible=function(a){return!d.expr.filters.hidden(a)});var bp=/%20/g,bq=/\[\]$/,br=/\r?\n/g,bs=/#.*$/,bt=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bu=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bv=/(?:^file|^widget|\-extension):$/,bw=/^(?:GET|HEAD)$/,bx=/^\/\//,by=/\?/,bz=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bA=/^(?:select|textarea)/i,bB=/\s+/,bC=/([?&])_=[^&]*/,bD=/(^|\-)([a-z])/g,bE=function(a,b,c){return b+c.toUpperCase()},bF=/^([\w\+\.\-]+:)\/\/([^\/?#:]*)(?::(\d+))?/,bG=d.fn.load,bH={},bI={},bJ,bK;try{bJ=c.location.href}catch(bL){bJ=c.createElement("a"),bJ.href="",bJ=bJ.href}bK=bF.exec(bJ.toLowerCase()),d.fn.extend({load:function(a,c,e){if(typeof a!=="string"&&bG)return bG.apply(this,arguments);if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var g=a.slice(f,a.length);a=a.slice(0,f)}var h="GET";c&&(d.isFunction(c)?(e=c,c=b):typeof c==="object"&&(c=d.param(c,d.ajaxSettings.traditional),h="POST"));var i=this;d.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?d("<div>").append(c.replace(bz,"")).find(g):c)),e&&i.each(e,[c,b,a])}});return this},serialize:function(){return d.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?d.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bA.test(this.nodeName)||bu.test(this.type))}).map(function(a,b){var c=d(this).val();return c==null?null:d.isArray(c)?d.map(c,function(a,c){return{name:b.name,value:a.replace(br,"\r\n")}}):{name:b.name,value:c.replace(br,"\r\n")}}).get()}}),d.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){d.fn[b]=function(a){return this.bind(b,a)}}),d.each(["get","post"],function(a,c){d[c]=function(a,e,f,g){d.isFunction(e)&&(g=g||f,f=e,e=b);return d.ajax({type:c,url:a,data:e,success:f,dataType:g})}}),d.extend({getScript:function(a,c){return d.get(a,b,c,"script")},getJSON:function(a,b,c){return d.get(a,b,c,"json")},ajaxSetup:function(a,b){b?d.extend(!0,a,d.ajaxSettings,b):(b=a,a=d.extend(!0,d.ajaxSettings,b));for(var c in {context:1,url:1})c in b?a[c]=b[c]:c in d.ajaxSettings&&(a[c]=d.ajaxSettings[c]);return a},ajaxSettings:{url:bJ,isLocal:bv.test(bK[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":d.parseJSON,"text xml":d.parseXML}},ajaxPrefilter:bM(bH),ajaxTransport:bM(bI),ajax:function(a,c){function v(a,c,l,n){if(r!==2){r=2,p&&clearTimeout(p),o=b,m=n||"",u.readyState=a?4:0;var q,t,v,w=l?bP(e,u,l):b,x,y;if(a>=200&&a<300||a===304){if(e.ifModified){if(x=u.getResponseHeader("Last-Modified"))d.lastModified[k]=x;if(y=u.getResponseHeader("Etag"))d.etag[k]=y}if(a===304)c="notmodified",q=!0;else try{t=bQ(e,w),c="success",q=!0}catch(z){c="parsererror",v=z}}else{v=c;if(!c||a)c="error",a<0&&(a=0)}u.status=a,u.statusText=c,q?h.resolveWith(f,[t,c,u]):h.rejectWith(f,[u,c,v]),u.statusCode(j),j=b,s&&g.trigger("ajax"+(q?"Success":"Error"),[u,e,q?t:v]),i.resolveWith(f,[u,c]),s&&(g.trigger("ajaxComplete",[u,e]),--d.active||d.event.trigger("ajaxStop"))}}typeof a==="object"&&(c=a,a=b),c=c||{};var e=d.ajaxSetup({},c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof d)?d(f):d.event,h=d.Deferred(),i=d._Deferred(),j=e.statusCode||{},k,l={},m,n,o,p,q,r=0,s,t,u={readyState:0,setRequestHeader:function(a,b){r||(l[a.toLowerCase().replace(bD,bE)]=b);return this},getAllResponseHeaders:function(){return r===2?m:null},getResponseHeader:function(a){var c;if(r===2){if(!n){n={};while(c=bt.exec(m))n[c[1].toLowerCase()]=c[2]}c=n[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){r||(e.mimeType=a);return this},abort:function(a){a=a||"abort",o&&o.abort(a),v(0,a);return this}};h.promise(u),u.success=u.done,u.error=u.fail,u.complete=i.done,u.statusCode=function(a){if(a){var b;if(r<2)for(b in a)j[b]=[j[b],a[b]];else b=a[u.status],u.then(b,b)}return this},e.url=((a||e.url)+"").replace(bs,"").replace(bx,bK[1]+"//"),e.dataTypes=d.trim(e.dataType||"*").toLowerCase().split(bB),e.crossDomain||(q=bF.exec(e.url.toLowerCase()),e.crossDomain=q&&(q[1]!=bK[1]||q[2]!=bK[2]||(q[3]||(q[1]==="http:"?80:443))!=(bK[3]||(bK[1]==="http:"?80:443)))),e.data&&e.processData&&typeof e.data!=="string"&&(e.data=d.param(e.data,e.traditional)),bN(bH,e,c,u);if(r===2)return!1;s=e.global,e.type=e.type.toUpperCase(),e.hasContent=!bw.test(e.type),s&&d.active++===0&&d.event.trigger("ajaxStart");if(!e.hasContent){e.data&&(e.url+=(by.test(e.url)?"&":"?")+e.data),k=e.url;if(e.cache===!1){var w=d.now(),x=e.url.replace(bC,"$1_="+w);e.url=x+(x===e.url?(by.test(e.url)?"&":"?")+"_="+w:"")}}if(e.data&&e.hasContent&&e.contentType!==!1||c.contentType)l["Content-Type"]=e.contentType;e.ifModified&&(k=k||e.url,d.lastModified[k]&&(l["If-Modified-Since"]=d.lastModified[k]),d.etag[k]&&(l["If-None-Match"]=d.etag[k])),l.Accept=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+(e.dataTypes[0]!=="*"?", */*; q=0.01":""):e.accepts["*"];for(t in e.headers)u.setRequestHeader(t,e.headers[t]);if(e.beforeSend&&(e.beforeSend.call(f,u,e)===!1||r===2)){u.abort();return!1}for(t in {success:1,error:1,complete:1})u[t](e[t]);o=bN(bI,e,c,u);if(o){u.readyState=1,s&&g.trigger("ajaxSend",[u,e]),e.async&&e.timeout>0&&(p=setTimeout(function(){u.abort("timeout")},e.timeout));try{r=1,o.send(l,v)}catch(y){status<2?v(-1,y):d.error(y)}}else v(-1,"No Transport");return u},param:function(a,c){var e=[],f=function(a,b){b=d.isFunction(b)?b():b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=d.ajaxSettings.traditional);if(d.isArray(a)||a.jquery&&!d.isPlainObject(a))d.each(a,function(){f(this.name,this.value)});else for(var g in a)bO(g,a[g],c,f);return e.join("&").replace(bp,"+")}}),d.extend({active:0,lastModified:{},etag:{}});var bR=d.now(),bS=/(\=)\?(&|$)|()\?\?()/i;d.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return d.expando+"_"+bR++}}),d.ajaxPrefilter("json jsonp",function(b,c,e){var f=typeof b.data==="string";if(b.dataTypes[0]==="jsonp"||c.jsonpCallback||c.jsonp!=null||b.jsonp!==!1&&(bS.test(b.url)||f&&bS.test(b.data))){var g,h=b.jsonpCallback=d.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2",m=function(){a[h]=i,g&&d.isFunction(i)&&a[h](g[0])};b.jsonp!==!1&&(j=j.replace(bS,l),b.url===j&&(f&&(k=k.replace(bS,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},e.then(m,m),b.converters["script json"]=function(){g||d.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),d.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){d.globalEval(a);return a}}}),d.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),d.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var bT=d.now(),bU,bV;d.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&bX()||bY()}:bX,bV=d.ajaxSettings.xhr(),d.support.ajax=!!bV,d.support.cors=bV&&"withCredentials"in bV,bV=b,d.support.ajax&&d.ajaxTransport(function(a){if(!a.crossDomain||d.support.cors){var c;return{send:function(e,f){var g=a.xhr(),h,i;a.username?g.open(a.type,a.url,a.async,a.username,a.password):g.open(a.type,a.url,a.async);if(a.xhrFields)for(i in a.xhrFields)g[i]=a.xhrFields[i];a.mimeType&&g.overrideMimeType&&g.overrideMimeType(a.mimeType),(!a.crossDomain||a.hasContent)&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(i in e)g.setRequestHeader(i,e[i])}catch(j){}g.send(a.hasContent&&a.data||null),c=function(e,i){var j,k,l,m,n;try{if(c&&(i||g.readyState===4)){c=b,h&&(g.onreadystatechange=d.noop,delete bU[h]);if(i)g.readyState!==4&&g.abort();else{j=g.status,l=g.getAllResponseHeaders(),m={},n=g.responseXML,n&&n.documentElement&&(m.xml=n),m.text=g.responseText;try{k=g.statusText}catch(o){k=""}j||!a.isLocal||a.crossDomain?j===1223&&(j=204):j=m.text?200:404}}}catch(p){i||f(-1,p)}m&&f(j,k,m,l)},a.async&&g.readyState!==4?(bU||(bU={},bW()),h=bT++,g.onreadystatechange=bU[h]=c):c()},abort:function(){c&&c(0,1)}}}});var bZ={},b$=/^(?:toggle|show|hide)$/,b_=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,ca,cb=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];d.fn.extend({show:function(a,b,c){var e,f;if(a||a===0)return this.animate(cc("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)e=this[g],f=e.style.display,!d._data(e,"olddisplay")&&f==="none"&&(f=e.style.display=""),f===""&&d.css(e,"display")==="none"&&d._data(e,"olddisplay",cd(e.nodeName));for(g=0;g<h;g++){e=this[g],f=e.style.display;if(f===""||f==="none")e.style.display=d._data(e,"olddisplay")||""}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cc("hide",3),a,b,c);for(var e=0,f=this.length;e<f;e++){var g=d.css(this[e],"display");g!=="none"&&!d._data(this[e],"olddisplay")&&d._data(this[e],"olddisplay",g)}for(e=0;e<f;e++)this[e].style.display="none";return this},_toggle:d.fn.toggle,toggle:function(a,b,c){var e=typeof a==="boolean";d.isFunction(a)&&d.isFunction(b)?this._toggle.apply(this,arguments):a==null||e?this.each(function(){var b=e?a:d(this).is(":hidden");d(this)[b?"show":"hide"]()}):this.animate(cc("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,e){var f=d.speed(b,c,e);if(d.isEmptyObject(a))return this.each(f.complete);return this[f.queue===!1?"each":"queue"](function(){var b=d.extend({},f),c,e=this.nodeType===1,g=e&&d(this).is(":hidden"),h=this;for(c in a){var i=d.camelCase(c);c!==i&&(a[i]=a[c],delete a[c],c=i);if(a[c]==="hide"&&g||a[c]==="show"&&!g)return b.complete.call(this);if(e&&(c==="height"||c==="width")){b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY];if(d.css(this,"display")==="inline"&&d.css(this,"float")==="none")if(d.support.inlineBlockNeedsLayout){var j=cd(this.nodeName);j==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)}else this.style.display="inline-block"}d.isArray(a[c])&&((b.specialEasing=b.specialEasing||{})[c]=a[c][1],a[c]=a[c][0])}b.overflow!=null&&(this.style.overflow="hidden"),b.curAnim=d.extend({},a),d.each(a,function(c,e){var f=new d.fx(h,b,c);if(b$.test(e))f[e==="toggle"?g?"show":"hide":e](a);else{var i=b_.exec(e),j=f.cur();if(i){var k=parseFloat(i[2]),l=i[3]||(d.cssNumber[c]?"":"px");l!=="px"&&(d.style(h,c,(k||1)+l),j=(k||1)/f.cur()*j,d.style(h,c,j+l)),i[1]&&(k=(i[1]==="-="?-1:1)*k+j),f.custom(j,k,l)}else f.custom(j,e,"")}});return!0})},stop:function(a,b){var c=d.timers;a&&this.queue([]),this.each(function(){for(var a=c.length-1;a>=0;a--)c[a].elem===this&&(b&&c[a](!0),c.splice(a,1))}),b||this.dequeue();return this}}),d.each({slideDown:cc("show",1),slideUp:cc("hide",1),slideToggle:cc("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){d.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),d.extend({speed:function(a,b,c){var e=a&&typeof a==="object"?d.extend({},a):{complete:c||!c&&b||d.isFunction(a)&&a,duration:a,easing:c&&b||b&&!d.isFunction(b)&&b};e.duration=d.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in d.fx.speeds?d.fx.speeds[e.duration]:d.fx.speeds._default,e.old=e.complete,e.complete=function(){e.queue!==!1&&d(this).dequeue(),d.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig||(b.orig={})}}),d.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(d.fx.step[this.prop]||d.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=d.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,b,c){function g(a){return e.step(a)}var e=this,f=d.fx;this.startTime=d.now(),this.start=a,this.end=b,this.unit=c||this.unit||(d.cssNumber[this.prop]?"":"px"),this.now=this.start,this.pos=this.state=0,g.elem=this.elem,g()&&d.timers.push(g)&&!ca&&(ca=setInterval(f.tick,f.interval))},show:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.show=!0,this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),d(this.elem).show()},hide:function(){this.options.orig[this.prop]=d.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b=d.now(),c=!0;if(a||b>=this.options.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),this.options.curAnim[this.prop]=!0;for(var e in this.options.curAnim)this.options.curAnim[e]!==!0&&(c=!1);if(c){if(this.options.overflow!=null&&!d.support.shrinkWrapBlocks){var f=this.elem,g=this.options;d.each(["","X","Y"],function(a,b){f.style["overflow"+b]=g.overflow[a]})}this.options.hide&&d(this.elem).hide();if(this.options.hide||this.options.show)for(var h in this.options.curAnim)d.style(this.elem,h,this.options.orig[h]);this.options.complete.call(this.elem)}return!1}var i=b-this.startTime;this.state=i/this.options.duration;var j=this.options.specialEasing&&this.options.specialEasing[this.prop],k=this.options.easing||(d.easing.swing?"swing":"linear");this.pos=d.easing[j||k](this.state,i,0,1,this.options.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update();return!0}},d.extend(d.fx,{tick:function(){var a=d.timers;for(var b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||d.fx.stop()},interval:13,stop:function(){clearInterval(ca),ca=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){d.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit:a.elem[a.prop]=a.now}}}),d.expr&&d.expr.filters&&(d.expr.filters.animated=function(a){return d.grep(d.timers,function(b){return a===b.elem}).length});var ce=/^t(?:able|d|h)$/i,cf=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?d.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(e){}var f=b.ownerDocument,g=f.documentElement;if(!c||!d.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=f.body,i=cg(f),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||d.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||d.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:d.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){d.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return d.offset.bodyOffset(b);d.offset.initialize();var c,e=b.offsetParent,f=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(d.offset.supportsFixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===e&&(l+=b.offsetTop,m+=b.offsetLeft,d.offset.doesNotAddBorder&&(!d.offset.doesAddBorderForTableAndCells||!ce.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),f=e,e=b.offsetParent),d.offset.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;d.offset.supportsFixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},d.offset={initialize:function(){var a=c.body,b=c.createElement("div"),e,f,g,h,i=parseFloat(d.css(a,"marginTop"))||0,j="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";d.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),e=b.firstChild,f=e.firstChild,h=e.nextSibling.firstChild.firstChild,this.doesNotAddBorder=f.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,f.style.position="fixed",f.style.top="20px",this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15,f.style.position=f.style.top="",e.style.overflow="hidden",e.style.position="relative",this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),a=b=e=f=g=h=null,d.offset.initialize=d.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;d.offset.initialize(),d.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(d.css(a,"marginTop"))||0,c+=parseFloat(d.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var e=d.css(a,"position");e==="static"&&(a.style.position="relative");var f=d(a),g=f.offset(),h=d.css(a,"top"),i=d.css(a,"left"),j=e==="absolute"&&d.inArray("auto",[h,i])>-1,k={},l={},m,n;j&&(l=f.position()),m=j?l.top:parseInt(h,10)||0,n=j?l.left:parseInt(i,10)||0,d.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):f.css(k)}},d.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),e=cf.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(d.css(a,"marginTop"))||0,c.left-=parseFloat(d.css(a,"marginLeft"))||0,e.top+=parseFloat(d.css(b[0],"borderTopWidth"))||0,e.left+=parseFloat(d.css(b[0],"borderLeftWidth"))||0;return{top:c.top-e.top,left:c.left-e.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&(!cf.test(a.nodeName)&&d.css(a,"position")==="static"))a=a.offsetParent;return a})}}),d.each(["Left","Top"],function(a,c){var e="scroll"+c;d.fn[e]=function(c){var f=this[0],g;if(!f)return null;if(c!==b)return this.each(function(){g=cg(this),g?g.scrollTo(a?d(g).scrollLeft():c,a?c:d(g).scrollTop()):this[e]=c});g=cg(f);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:d.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:f[e]}}),d.each(["Height","Width"],function(a,c){var e=c.toLowerCase();d.fn["inner"+c]=function(){return this[0]?parseFloat(d.css(this[0],e,"padding")):null},d.fn["outer"+c]=function(a){return this[0]?parseFloat(d.css(this[0],e,a?"margin":"border")):null},d.fn[e]=function(a){var f=this[0];if(!f)return a==null?null:this;if(d.isFunction(a))return this.each(function(b){var c=d(this);c[e](a.call(this,b,c[e]()))});if(d.isWindow(f)){var g=f.document.documentElement["client"+c];return f.document.compatMode==="CSS1Compat"&&g||f.document.body["client"+c]||g}if(f.nodeType===9)return Math.max(f.documentElement["client"+c],f.body["scroll"+c],f.documentElement["scroll"+c],f.body["offset"+c],f.documentElement["offset"+c]);if(a===b){var h=d.css(f,e),i=parseFloat(h);return d.isNaN(i)?h:i}return this.css(e,typeof a==="string"?a:a+"px")}}),a.jQuery=a.$=d})(window);//}

$.noConflict();

/*
 * FancyBox - jQuery Plugin
 * Simple and fancy lightbox alternative
 *
 * Copyright (c) 20010 Janis Skarnelis
 * Examples and documentation at: http://fancybox.net
 *
 * Version: 1.3.0 (02/02/2010)
 * Requires: jQuery v1.3+
 *
 * Dual licensed under the MIT and GPL licenses:
 *   http://www.opensource.org/licenses/mit-license.php
 *   http://www.gnu.org/licenses/gpl.html
 */

;(function(b){function H(){v.hide();r.onerror=r.onload=null;F&&F.abort();l.empty()}function Q(){b.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})}function B(){H();var a=q[s];e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));var d,f,o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?
b(a).children("img:first"):b(a);if(o==""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(I))f="image";else if(d.match(T))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!==
"swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,s,e)===false){h=false;return}l.css("padding",t+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":l.html(e.content);G();break;case "inline":b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",
function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(l.children())});b(a).appendTo(l);G();break;case "image":h=false;b.fancybox.showActivity();r=new Image;r.onerror=function(){Q()};r.onload=function(){r.onerror=null;r.onload=null;U()};r.src=d;break;case "swf":var u="",w="";u+='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+d+'"></param>';b.each(e.swf,function(p,R){u+=
'<param name="'+p+'" value="'+R+'"></param>';w+=" "+p+'="'+R+'"'});u+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+w+"></embed></object>";l.html(u);G();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];typeof f=="string"?(f+="&selector="+a[1]):(f.selector=a[1])}h=false;b.fancybox.showActivity();F=b.ajax(b.extend(e.ajax,{url:d,data:f,error:Q,success:function(p){if(F.status==200){l.html(p);G()}}}));break;case "iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+
(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(l);J();break}}function U(){h=true;e.width=r.width;e.height=r.height;b("<img />").attr({id:"fancybox-img",src:r.src,alt:e.title}).appendTo(l);J()}function G(){l.width(e.width);l.height(e.height);if(e.width=="auto")e.width=l.width();if(e.height=="auto")e.height=l.height();J()}function J(){v.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");
h=false;return}j=q;n=s;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){K&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});y.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}m=V();W();if(g.is(":visible")){b(z.add(C).add(D)).hide();var a=g.position();k={top:a.top,left:a.left,width:g.width(),height:g.height()};
var d=k.width==m.width&&k.height==m.height;i.fadeOut(c.changeFade,function(){function f(){i.html(l.contents()).fadeIn(c.changeFade,L)}b.event.trigger("fancybox-change");i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).empty().css("overflow","hidden");A.prop=0;b(A).animate({prop:1},{duration:d?0:c.changeSpeed,easing:c.easingChange,step:M,complete:f})})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=S();i.css({top:c.padding,
left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(l.contents());g.css(k).show();if(c.opacity)m.opacity=0;A.prop=0;b(A).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(m.width-c.padding*2,1),height:Math.max(m.height-c.padding*2-x,1)}).html(l.contents());g.css(m).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}}function M(a){var d=Math.round(k.width+(m.width-k.width)*a),
f=Math.round(k.height+(m.height-k.height)*a),o=Math.round(k.top+(m.top-k.top)*a),u=Math.round(k.left+(m.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:u+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+x*a),0);i.css({width:d+"px",height:f+"px"});if(typeof m.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)}function L(){i.css("overflow",overflow=c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");
if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&y.one("click",b.fancybox.close);c.showCloseButton&&z.show();X();b(window).bind("resize.fb",b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;Y()}function V(){var a=N(),d={},f=
c.margin,o=c.autoScale,u=(t+f)*2,w=(t+f)*2,p=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-t*2;o=false}else d.width=c.width+p;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-t*2;o=false}else d.height=c.height+p;if(o&&(d.width>a[0]-u||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){u+=p;w+=p;o=Math.min(Math.min(a[0]-u,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-p))+p;d.height=Math.round(o*
(d.height-p))+p}else{d.width=Math.min(d.width,a[0]-u);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+t*2))*0.5;d.left=a[2]+(a[0]-(d.width+t*2))*0.5;if(c.autoScale==false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d}function S(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Z(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-t,left:a.left-c.padding-t}}else{a=N();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d}
function X(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d==0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!=0)C.show();
if(c.cyclic&&j.length>1||n!=j.length-1)D.show()}}function Y(){if(j.length-1>n){var a=j[n+1].href;if(typeof a!=="undefined"&&a.match(I)){var d=new Image;d.src=a}}if(n>0){a=j[n-1].href;if(typeof a!=="undefined"&&a.match(I)){d=new Image;d.src=a}}}function $(){if(v.is(":visible")){b("div",v).css("top",O*-40+"px");O=(O+1)%12}else clearInterval(P)}function N(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]}function Z(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||
0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d}function W(){b("#fancybox-title").remove();x=0;if(c.titleShow!=false){var a=c.title;a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):aa(a);if(!(!a||a=="")){var d=m.width-c.padding*2;b('<div id="fancybox-title" class="'+("fancybox-title-"+c.titlePosition)+'" />').css({width:d,paddingLeft:c.padding,paddingRight:c.padding}).html(a).appendTo("body");
switch(c.titlePosition){case "inside":x=b("#fancybox-title").outerHeight(true)-c.padding;m.height+=x;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(E).hide();K&&b("#fancybox-title span").fixPNG()}}}function aa(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return'<span id="fancybox-title-over">'+a+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+
a+'</span><span id="fancybox-title-right"></span></span>'}return false}function ba(){if(!b("#fancybox-wrap").length){b("body").append(l=b('<div id="fancybox-tmp"></div>'),v=b('<div id="fancybox-loading"><div></div></div>'),y=b('<div id="fancybox-overlay"></div>'),g=b('<div id="fancybox-wrap"></div>'));E=b('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(g);
E.append(i=b('<div id="fancybox-inner"></div>'),z=b('<a id="fancybox-close"></a>'),C=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),D=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));z.click(b.fancybox.close);v.click(b.fancybox.cancel);C.click(function(a){a.preventDefault();b.fancybox.prev()});D.click(function(a){a.preventDefault();b.fancybox.next()});b.support.opacity||E.find(".fancy-bg").fixPNG();
if(K){b(z.add(".fancy-ico").add("div",v)).fixPNG();y.get(0).style.setExpression("height","document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");v.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");E.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}}
var l,v,y,g,E,i,z,C,D,s=0,e={},q=[],n=0,c={},j=[],F=null,r=new Image,I=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,T=/[^\.]\.(swf)\s*$/i,P,O=1,k,m,h=false,t=20,A=b.extend(b("<div/>")[0],{prop:0}),x=0,K=!b.support.opacity&&!window.XMLHttpRequest;b.fn.fixPNG=function(){return this.each(function(){var a=b(this).css("backgroundImage");if(a.match(/^url\(["']?(.*\.png)["']?\)$/i)){a=RegExp.$1;b(this).css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod="+
(b(this).css("backgroundRepeat")=="no-repeat"?"crop":"scale")+", src='"+a+"')"}).each(function(){var d=b(this).css("position");d!="absolute"&&d!="relative"&&b(this).css("position","relative")}).css("zoom",1)}})};b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a));b(this).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];s=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");s=
q.index(this)}B();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;q=[];s=0;if(b.isArray(a)){for(var f=0,o=a.length;f<o;f++)if(typeof a[f]=="object")b(a[f]).data("fancybox",b.extend({},d,a[f]));else a[f]=b({}).data("fancybox",b.extend({content:a[f]},d));q=jQuery.merge(q,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},d,a));else a=b({}).data("fancybox",b.extend({content:a},d));q.push(a)}B()}};b.fancybox.showActivity=function(){clearInterval(P);v.show();P=setInterval($,
66)};b.fancybox.hideActivity=function(){v.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);if(a>-1&&j.length>a){s=a;B()}if(c.cyclic&&j.length>1&&a<0){s=j.length-1;B()}if(c.cyclic&&j.length>1&&a>=j.length){s=0;B()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");H();e&&b.isFunction(e.onCancel)&&e.onCancel(q,s,e);h=false}};b.fancybox.close=function(){function a(){y.fadeOut("fast");
g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=s=0;c=e={};h=false}if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}H();b(z.add(C).add(D)).hide();b("#fancybox-title").remove();g.add(i).add(y).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=S();var d=g.position();m={top:d.top,left:d.left,
width:g.width(),height:g.height()};if(c.opacity)m.opacity=1;A.prop=1;b(A).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){if(!(h||g.is(":hidden"))){h=true;var a=i.wrapInner("<div style='overflow:auto'></div>").children(),d=a.height();g.css({height:d+c.padding*2+x});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=N(),d=c.margin,
f={};f.top=a[3]+(a[1]-(g.height()-x+t*2))*0.5;f.left=a[2]+(a[0]-(g.width()+t*2))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",
titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){ba()})})(jQuery);/*
 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
 *
 * Uses the built in easing capabilities added In jQuery 1.1
 * to offer multiple easing options
 *
 * TERMS OF USE - jQuery Easing
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2008 George McGinley Smith
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
*/

// t: current time, b: begInnIng value, c: change In value, d: duration
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))

/*
 *
 * TERMS OF USE - EASING EQUATIONS
 * 
 * Open source under the BSD License. 
 * 
 * Copyright © 2001 Robert Penner
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or without modification, 
 * are permitted provided that the following conditions are met:
 * 
 * Redistributions of source code must retain the above copyright notice, this list of 
 * conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, this list 
 * of conditions and the following disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * Neither the name of the author nor the names of contributors may be used to endorse 
 * or promote products derived from this software without specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 *  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 *  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 
 * OF THE POSSIBILITY OF SUCH DAMAGE. 
 *
 */

var NO_PREVIEW 				= ['nytimes.com','twitter.com','theatlantic.com','vimeo.com','boston.com','fannation.com'];
var PUBLITWEET_BASE_URL		= 'http://publitweet.tesial-tech.be/js/';
//var PUBLITWEET_BASE_URL		= 'http://localhost/tas/';
var PUBLITWEET_THUMBNAILS_BASE_URL = 'http://beta.publitweet.com/public/thumbnails/';

var PUBLITWEET_API_URL		= 'http://api.publitweet.com/1/';

var ADSERVER_API_URL		= 'http://tweetad.tesial-tech.be/tae/twitteraddisplay/display.do';
//var ADSERVER_API_URL		= 'http://ta-pt.tesial-tech.be/tae/twitteraddisplay/display.do';
//var ADSERVER_API_URL		= 'http://twitterad.publitweet.com:8070/twitterad-engine/twitteraddisplay/display.do';
var OPENXSERVER_URL			= 'ads.pubcity.be/www/delivery/ajs.php';


//var EMBEDLY_API_URL		= 'http://pro.embed.ly/1/objectify?key=fd5648786ffd11e088ae4040f9f86dcd&callback=?&urls=';
var EMBEDLY_API_URL		= 'http://publitweet.tesial-tech.be/tae/embedly/cache.do?callback=?&urls=';


var DEBUG					= true;


//var SESSION = ;
//FB.init("977c606f4c5b15e395863e0ec5488112");

function PublitweetSocket() {
	
	var instance = this;
	
	this.callers = new Object();
	
	this.request = function(url,feed,callback)
	{
		
		instance.callers[feed] = callback;

		if(url.indexOf('?'))
			url += '&';
		else
			url += '?';
			
		url += 'callback=PUBLITWEET_SOCKET.callback';
		

		//debug('Requesting '+url+' for '+feed,this.callers);
		this.xget(url);
	}
	
	this.callback = function(msg)
	{
		debug('calling back '+msg.feed+' callers: ',instance.callers);
		if(msg.feed)
		{
			if(typeof instance.callers[msg.feed]=='function')	
				instance.callers[msg.feed].call(instance,msg);			
		}
	}
	
	this.xget = function(url)
	{
		debug('requesting: '+url);
		jQuery('head').append('<script src="'+url+'"></script>');
	}
	
}
function PublitweetRouter() {
	
	var instance		= this;
	
	this.routes 		= new Object();
	this.scheduler		= new PublitweetScheduler();
	
	this.current_route	= '';
	this.previous_route = '';
	
	this.default_hash 	= '';
	
	this.started		= false;
	
	this.add = function(route)
	{
		hash = (route.hash).toLowerCase();
		
		if(hash.indexOf('$1')>0)
		{
			hash = hash.substr(0,hash.indexOf('$1'));
			route.arg = true;
		}
		route.hash = hash;
		this.routes[route.name] = route;
		
		//debug('Adding route '+route.name,route);
		
		if(route.isDefault==true && this.current_route == '')
		{
			this.current_route = route.hash;
			this.default_hash  = route.hash;
		}
	}
	
	this.exists = function(hash)
	{
		for(var i in this.routes)
		{
			if(hash.substr(0,this.routes[i].hash.length) == this.routes[i].hash)
				return this.routes[i];
		}
		
		//debug('Route '+hash+' does not exist',this.routes);
		return false;
	}
	
	this.history = function(msg)
	{
		newhash = (window.location.hash).toLowerCase();
		if(newhash=='')
			newhash = this.default_hash;
			
		if(newhash!=this.current_route)
		{
			this.execute(newhash);
		}
	}
	
	this.execute = function(hash)
	{
		debug('executing '+hash);
		
		this.previous_route	= this.current_route;
		this.current_route 	= hash;
		window.location.hash = hash;

		route = this.exists(hash.toLowerCase());
		if(!route)
			return false;
		
		arg = null;
		if(route.arg)
		{
			arg = hash.substr(route.hash.length);
		}
		debug('calling route '+arg,route);
		route.callback.call(this,arg);
	}
	
	this.refresh = function()
	{
		this.execute(this.current_route);
	}
	
	
	this.scheduler.addTask({
		'name'		: 'history',
		'callback'	: function() { instance.history(); } ,
		'interval'	: 500
	})
	
	this.start = function()
	{
		if(this.started)
			return false;
			
		this.scheduler.start();
		
		this.started = true;
	}

	this.stop = function()
	{
		if(!this.started)
			return false;
				
		this.scheduler.stop();
		
		// debug('stopping router scheduler');
		
		this.started = false;
	}
		
}

var PUBLITWEET_GA = false;


function PublitweetTracker(feed) {
	
	var instance				= this;
	
	this.trackEvent_url 				= PUBLITWEET_BASE_URL+'track.php';
	this.feed					= feed;
	this.ga						= null; // Google Analytics account. If null will try to automatically set it up. If false, skip. If true, assume it exists

	this.xget = function(url)
	{
		jQuery('head').append('<script src="'+url+'"></script>');
	}
	
	this.trackEvent = function(event,value)
	{
		this.initializeGA();
		if(this.ga)
			{
				debug("Event: " + event + " - Feed: " + this.feed + " - Value :" + value);
				//pageTracker._trackEvent('Publitweet-'+this.feed, event, value);
				_gaq.push(['_trackEvent', 'Publitweet-'+this.feed, event, value]);
			}

		// PAL - No need for the moment
		// url = this.trackEvent_url+'?feed='+this.feed+'&user=&event='+event+'&value='+value;
		// this.xget(url);
	}
	
	this.initializeGA = function() 
	{
		if(this.ga==null) // Make sure we initialize GA max once
		{
			this.ga = false;
			try {
				//ga = pageTracker._getAccount();
				_gaq.push(['_setAccount', 'UA-108008-15']);
				ga = _gaq.push(['_getAccount']);
				if(!PUBLITWEET_GA)
				{
					PUBLITWEET_GA = true;
					this.ga = true;
					debug("Publitweet using GA account: "+ga);
				}
			} catch(err) {
				debug("Cannot fetch GA account ",err);
			}
		}
		return true;
	}
	
	jQuery(document).ready(function() {
		instance.initializeGA();
	});
	
}

function PublitweetScheduler() {
	
	this.tasks = new Object();
	
	this.started = false;
	
	this.addTask = function(task)
	{
		this.tasks[task.name] = task;
		
		//this.tasks[task.name].intervalId = setInterval(task.callback,task.interval);
		//debug('adding task '+task.name);
	}

	this.start = function() 
	{
		if(this.started)
			return false;

		for(var t in this.tasks)
			this.startTask(t);

		this.started = true;
	}

	this.stop = function() 
	{		
		if(!this.started)
			return false;

		for(t in this.tasks)
		{
			// debug('Stopping task',t);
			this.stopTask(t.name);
		}


		this.started = false;
	}

	this.startTask = function(taskName)
	{
		if(taskName===undefined)
			return false;
			
		//debug('starting task '+taskName);
		this.tasks[taskName].callback.call(this);
		this.tasks[taskName].intervalId = setInterval(this.tasks[taskName].callback,this.tasks[taskName].interval);
	}
	
	this.stopTask = function(taskName)
	{
		if(taskName===undefined)
			return false;

		// debug('stopping task '+taskName);
		clearInterval(this.tasks[taskName].intervalId);
	}
	
}function PublitweetTabs(feed,tabsNode) {
	
	var instance	= this;

	this.tabs		= new Object();
	this.tabsNode	= '#'+tabsNode;
	
	this.tracker 	= new PublitweetTracker(feed);
	
	this.open = function(tabAction)
	{
		this.tabs[tabAction].callback.call();
		this.tracker.trackEvent('openTab',tabAction);
	}
	
	this.selectTab = function(tabAction)
	{
		for(var i in this.tabs)
			this.tabs[i].node.removeClass('selected');
			
		this.tabs[tabAction].node.addClass('selected');
	}
	
	this.close = function(tabAction)
	{
		
	}
	
	this.behaviour = function()
	{
		
	}
	
	this.write = function()
	{
		for(var i in this.tabs)
		{
			//debug($(this.tabsNode).size()+' - writing tab '+this.tabs[i].node,this.tabs[i].node);
			jQuery(this.tabsNode).append(this.tabs[i].node);
		}
		
		jQuery(this.tabsNode).find('li:first').addClass('publitweetFirstTab');
	}
	
	this.update = function()
	{
		//debug('Updating tabs',this.tabs);
			
		jQuery(this.tabsNode).remove('li');
		this.write();
	}
	
	this.exists = function(tabAction)
	{
		for(var i in this.tabs)
		{
			if(i == tabAction)
				return true;
		}
		return false;
	}
	
	this.remove = function(tabAction)
	{
		instance.tabs[tabAction].node.remove();
				
		newtabs = new Object();
		for(var i in this.tabs)
	    { 
	        if(i!=tabAction)
				newtabs[i] = this.tabs[i];
	    }
		this.tabs = newtabs;
		
		this.tracker.trackEvent('closeTab',tabAction);
		
		this.tabs['latest'].callback.call();
	}
	
	this.add = function(tabInfo)
	{
		if(this.exists(tabInfo.action))
			return;
			
		this.tabs[tabInfo.action] = tabInfo;
		
		html = '<li event="'+tabInfo.action+'">'+tabInfo.label;
		
		if(tabInfo.closeable)
			html += ' <a event="Close'+tabInfo.action.replace('/','_')+'" class="close">[x]</a>';
		
		html += '</li>';
		
		node = jQuery(html);
		
		if(tabInfo.cssClass!='')
			node.addClass(tabInfo.cssClass);
		
		node.find('a[event="Close'+tabInfo.action.replace('/','_')+'"]').click(function() {
			instance.remove(tabInfo.action);
		});

		node.click(function(e) {
			e.preventDefault();
			instance.open(tabInfo.action);
			return false;
		});
		
		this.tabs[tabInfo.action].node = node;
		
	}
	
}/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 5/25/2009
 * @author Ariel Flesler
 * @version 1.4.2
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);/*
 * jQuery UI Effects 1.8rc3
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/
 */
jQuery.effects||(function(g){g.effects={};g.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(l,k){g.fx.step[k]=function(m){if(!m.colorInit){m.start=j(m.elem,k);m.end=i(m.end);m.colorInit=true}m.elem.style[k]="rgb("+Math.max(Math.min(parseInt((m.pos*(m.end[0]-m.start[0]))+m.start[0],10),255),0)+","+Math.max(Math.min(parseInt((m.pos*(m.end[1]-m.start[1]))+m.start[1],10),255),0)+","+Math.max(Math.min(parseInt((m.pos*(m.end[2]-m.start[2]))+m.start[2],10),255),0)+")"}});function i(l){var k;if(l&&l.constructor==Array&&l.length==3){return l}if(k=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(l)){return[parseInt(k[1],10),parseInt(k[2],10),parseInt(k[3],10)]}if(k=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(l)){return[parseFloat(k[1])*2.55,parseFloat(k[2])*2.55,parseFloat(k[3])*2.55]}if(k=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(l)){return[parseInt(k[1],16),parseInt(k[2],16),parseInt(k[3],16)]}if(k=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(l)){return[parseInt(k[1]+k[1],16),parseInt(k[2]+k[2],16),parseInt(k[3]+k[3],16)]}if(k=/rgba\(0, 0, 0, 0\)/.exec(l)){return a.transparent}return a[g.trim(l).toLowerCase()]}function j(m,k){var l;do{l=g.curCSS(m,k);if(l!=""&&l!="transparent"||g.nodeName(m,"body")){break}k="backgroundColor"}while(m=m.parentNode);return i(l)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var e=["add","remove","toggle"],c={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};function f(){var n=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,o={},l,m;if(n&&n.length&&n[0]&&n[n[0]]){var k=n.length;while(k--){l=n[k];if(typeof n[l]=="string"){m=l.replace(/\-(\w)/g,function(p,q){return q.toUpperCase()});o[m]=n[l]}}}else{for(l in n){if(typeof n[l]==="string"){o[l]=n[l]}}}return o}function b(l){var k,m;for(k in l){m=l[k];if(m==null||g.isFunction(m)||k in c||(/scrollbar/).test(k)||(!(/color/i).test(k)&&isNaN(parseFloat(m)))){delete l[k]}}return l}function h(k,m){var n={_:0},l;for(l in m){if(k[l]!=m[l]){n[l]=m[l]}}return n}g.effects.animateClass=function(k,l,n,m){if(g.isFunction(n)){m=n;n=null}return this.each(function(){var r=g(this),o=r.attr("style")||" ",s=b(f.call(this)),q,p=r.attr("className");g.each(e,function(t,u){if(k[u]){r[u+"Class"](k[u])}});q=b(f.call(this));r.attr("className",p);r.animate(h(s,q),l,n,function(){g.each(e,function(t,u){if(k[u]){r[u+"Class"](k[u])}});if(typeof r.attr("style")=="object"){r.attr("style").cssText="";r.attr("style").cssText=o}else{r.attr("style",o)}if(m){m.apply(this,arguments)}})})};g.fn.extend({_addClass:g.fn.addClass,addClass:function(l,k,n,m){return k?g.effects.animateClass.apply(this,[{add:l},k,n,m]):this._addClass(l)},_removeClass:g.fn.removeClass,removeClass:function(l,k,n,m){return k?g.effects.animateClass.apply(this,[{remove:l},k,n,m]):this._removeClass(l)},_toggleClass:g.fn.toggleClass,toggleClass:function(m,l,k,o,n){if(typeof l=="boolean"||l===undefined){if(!k){return this._toggleClass(m,l)}else{return g.effects.animateClass.apply(this,[(l?{add:m}:{remove:m}),k,o,n])}}else{return g.effects.animateClass.apply(this,[{toggle:m},l,k,o])}},switchClass:function(k,m,l,o,n){return g.effects.animateClass.apply(this,[{add:m,remove:k},l,o,n])}});g.extend(g.effects,{version:"1.8rc3",save:function(l,m){for(var k=0;k<m.length;k++){if(m[k]!==null){l.data("ec.storage."+m[k],l[0].style[m[k]])}}},restore:function(l,m){for(var k=0;k<m.length;k++){if(m[k]!==null){l.css(m[k],l.data("ec.storage."+m[k]))}}},setMode:function(k,l){if(l=="toggle"){l=k.is(":hidden")?"show":"hide"}return l},getBaseline:function(l,m){var n,k;switch(l[0]){case"top":n=0;break;case"middle":n=0.5;break;case"bottom":n=1;break;default:n=l[0]/m.height}switch(l[1]){case"left":k=0;break;case"center":k=0.5;break;case"right":k=1;break;default:k=l[1]/m.width}return{x:k,y:n}},createWrapper:function(k){if(k.parent().is(".ui-effects-wrapper")){return k.parent()}var l={width:k.outerWidth(true),height:k.outerHeight(true),"float":k.css("float")},m=g("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});k.wrap(m);m=k.parent();if(k.css("position")=="static"){m.css({position:"relative"});k.css({position:"relative"})}else{g.extend(l,{position:k.css("position"),zIndex:k.css("z-index")});g.each(["top","left","bottom","right"],function(n,o){l[o]=k.css(o);if(isNaN(parseInt(l[o],10))){l[o]="auto"}});k.css({position:"relative",top:0,left:0})}return m.css(l).show()},removeWrapper:function(k){if(k.parent().is(".ui-effects-wrapper")){return k.parent().replaceWith(k)}return k},setTransition:function(l,n,k,m){m=m||{};g.each(n,function(p,o){unit=l.cssUnit(o);if(unit[0]>0){m[o]=unit[0]*k+unit[1]}});return m}});function d(l,k,m,n){if(typeof l=="object"){n=k;m=null;k=l;l=k.effect}if(g.isFunction(k)){n=k;m=null;k={}}if(typeof k=="number"||g.fx.speeds[k]){n=m;m=k;k={}}k=k||{};m=m||k.duration;m=g.fx.off?0:typeof m=="number"?m:g.fx.speeds[m]||g.fx.speeds._default;n=n||k.complete;return[l,k,m,n]}g.fn.extend({effect:function(n,m,p,q){var l=d.apply(this,arguments),o={options:l[1],duration:l[2],callback:l[3]},k=g.effects[n];return k&&!g.fx.off?k.call(this,o):this},_show:g.fn.show,show:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]){return this._show.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="show";return this.effect.apply(this,k)}},_hide:g.fn.hide,hide:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]){return this._hide.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="hide";return this.effect.apply(this,k)}},__toggle:g.fn.toggle,toggle:function(l){if(!l||typeof l=="number"||g.fx.speeds[l]||typeof l=="boolean"||g.isFunction(l)){return this.__toggle.apply(this,arguments)}else{var k=d.apply(this,arguments);k[1].mode="toggle";return this.effect.apply(this,k)}},cssUnit:function(k){var l=this.css(k),m=[];g.each(["em","px","%","pt"],function(n,o){if(l.indexOf(o)>0){m=[parseFloat(l),o]}});return m}});g.easing.jswing=g.easing.swing;g.extend(g.easing,{def:"easeOutQuad",swing:function(l,m,k,o,n){return g.easing[g.easing.def](l,m,k,o,n)},easeInQuad:function(l,m,k,o,n){return o*(m/=n)*m+k},easeOutQuad:function(l,m,k,o,n){return -o*(m/=n)*(m-2)+k},easeInOutQuad:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m+k}return -o/2*((--m)*(m-2)-1)+k},easeInCubic:function(l,m,k,o,n){return o*(m/=n)*m*m+k},easeOutCubic:function(l,m,k,o,n){return o*((m=m/n-1)*m*m+1)+k},easeInOutCubic:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m+k}return o/2*((m-=2)*m*m+2)+k},easeInQuart:function(l,m,k,o,n){return o*(m/=n)*m*m*m+k},easeOutQuart:function(l,m,k,o,n){return -o*((m=m/n-1)*m*m*m-1)+k},easeInOutQuart:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m*m+k}return -o/2*((m-=2)*m*m*m-2)+k},easeInQuint:function(l,m,k,o,n){return o*(m/=n)*m*m*m*m+k},easeOutQuint:function(l,m,k,o,n){return o*((m=m/n-1)*m*m*m*m+1)+k},easeInOutQuint:function(l,m,k,o,n){if((m/=n/2)<1){return o/2*m*m*m*m*m+k}return o/2*((m-=2)*m*m*m*m+2)+k},easeInSine:function(l,m,k,o,n){return -o*Math.cos(m/n*(Math.PI/2))+o+k},easeOutSine:function(l,m,k,o,n){return o*Math.sin(m/n*(Math.PI/2))+k},easeInOutSine:function(l,m,k,o,n){return -o/2*(Math.cos(Math.PI*m/n)-1)+k},easeInExpo:function(l,m,k,o,n){return(m==0)?k:o*Math.pow(2,10*(m/n-1))+k},easeOutExpo:function(l,m,k,o,n){return(m==n)?k+o:o*(-Math.pow(2,-10*m/n)+1)+k},easeInOutExpo:function(l,m,k,o,n){if(m==0){return k}if(m==n){return k+o}if((m/=n/2)<1){return o/2*Math.pow(2,10*(m-1))+k}return o/2*(-Math.pow(2,-10*--m)+2)+k},easeInCirc:function(l,m,k,o,n){return -o*(Math.sqrt(1-(m/=n)*m)-1)+k},easeOutCirc:function(l,m,k,o,n){return o*Math.sqrt(1-(m=m/n-1)*m)+k},easeInOutCirc:function(l,m,k,o,n){if((m/=n/2)<1){return -o/2*(Math.sqrt(1-m*m)-1)+k}return o/2*(Math.sqrt(1-(m-=2)*m)+1)+k},easeInElastic:function(l,n,k,u,r){var o=1.70158;var q=0;var m=u;if(n==0){return k}if((n/=r)==1){return k+u}if(!q){q=r*0.3}if(m<Math.abs(u)){m=u;var o=q/4}else{var o=q/(2*Math.PI)*Math.asin(u/m)}return -(m*Math.pow(2,10*(n-=1))*Math.sin((n*r-o)*(2*Math.PI)/q))+k},easeOutElastic:function(l,n,k,u,r){var o=1.70158;var q=0;var m=u;if(n==0){return k}if((n/=r)==1){return k+u}if(!q){q=r*0.3}if(m<Math.abs(u)){m=u;var o=q/4}else{var o=q/(2*Math.PI)*Math.asin(u/m)}return m*Math.pow(2,-10*n)*Math.sin((n*r-o)*(2*Math.PI)/q)+u+k},easeInOutElastic:function(l,n,k,u,r){var o=1.70158;var q=0;var m=u;if(n==0){return k}if((n/=r/2)==2){return k+u}if(!q){q=r*(0.3*1.5)}if(m<Math.abs(u)){m=u;var o=q/4}else{var o=q/(2*Math.PI)*Math.asin(u/m)}if(n<1){return -0.5*(m*Math.pow(2,10*(n-=1))*Math.sin((n*r-o)*(2*Math.PI)/q))+k}return m*Math.pow(2,-10*(n-=1))*Math.sin((n*r-o)*(2*Math.PI)/q)*0.5+u+k},easeInBack:function(l,m,k,p,o,n){if(n==undefined){n=1.70158}return p*(m/=o)*m*((n+1)*m-n)+k},easeOutBack:function(l,m,k,p,o,n){if(n==undefined){n=1.70158}return p*((m=m/o-1)*m*((n+1)*m+n)+1)+k},easeInOutBack:function(l,m,k,p,o,n){if(n==undefined){n=1.70158}if((m/=o/2)<1){return p/2*(m*m*(((n*=(1.525))+1)*m-n))+k}return p/2*((m-=2)*m*(((n*=(1.525))+1)*m+n)+2)+k},easeInBounce:function(l,m,k,o,n){return o-g.easing.easeOutBounce(l,n-m,0,o,n)+k},easeOutBounce:function(l,m,k,o,n){if((m/=n)<(1/2.75)){return o*(7.5625*m*m)+k}else{if(m<(2/2.75)){return o*(7.5625*(m-=(1.5/2.75))*m+0.75)+k}else{if(m<(2.5/2.75)){return o*(7.5625*(m-=(2.25/2.75))*m+0.9375)+k}else{return o*(7.5625*(m-=(2.625/2.75))*m+0.984375)+k}}}},easeInOutBounce:function(l,m,k,o,n){if(m<n/2){return g.easing.easeInBounce(l,m*2,0,o,n)*0.5+k}return g.easing.easeOutBounce(l,m*2-n,0,o,n)*0.5+o*0.5+k}})})(jQuery);;/*
 * jQuery UI Effects Blind 1.8rc3
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Blind
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/*
 * jQuery UI Effects Highlight 1.8rc3
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Highlight
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a){a.effects.highlight=function(b){return this.queue(function(){var d=a(this),c=["backgroundImage","backgroundColor","opacity"],f=a.effects.setMode(d,b.options.mode||"show"),e={backgroundColor:d.css("backgroundColor")};if(f=="hide"){e.opacity=0}a.effects.save(d,c);d.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(e,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){(f=="hide"&&d.hide());a.effects.restore(d,c);(f=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"));(b.callback&&b.callback.apply(this,arguments));d.dequeue()}})})}})(jQuery);;/*
 * jQuery UI Effects Slide 1.8rc3
 *
 * Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 *
 * http://docs.jquery.com/UI/Effects/Slide
 *
 * Depends:
 *	jquery.effects.core.js
 */
(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;
//var PUBLITWEET_ROUTER = new PublitweetRouter();
var PUBLITWEET_SOCKET = new PublitweetSocket();


function Publitweet(settings) {
	
	var instance		= this;

	this.settings		= settings;
	this.lang = {
		'en' : {
			'LatestTweets'		: 'Latest Tweets',
			'MostPopular'		: 'Most popular',
			'LiveTweets'		: 'Live tweets',
			'FeaturedTweets'	: 'Sponsored tweet',
			'ProfileOf'			: 'Profile of',
			'QuickView'			: 'quick view',
			'ShareThisTweet'	: 'Share this tweet:',
			'ShareTwitter'		: 'Share on Twitter',
			'ShareFacebook'		: 'Share on Facebook',
			'ShareEmail'		: 'Send by email',
			'second'			: 'second',
			'seconds'			: 'seconds',
			'minute'			: 'minute',
			'minutes'			: 'minutes',
			'hour'				: 'hour',
			'hours'				: 'hours',
			'timesince_before'	: '',
			'timesince_after'	: 'ago',
			'day'				: 'day',
			'days'				: 'days',
			'yesterday'			: 'yesterday',
			'RightNow'			: 'right now',
			'MoreThanAYearAgo'	: 'over a year ago',
			'FollowThisFeed'	: 'Follow this feed',
			'SendTo'			: 'Send this tweet to:',
			'SendToPlaceholder'	: 'recipient@domain.com',
			'SendFrom'			: 'From:',
			'SendFromPlaceholder': 'Your email address',
			'SendMsg'			: 'Message: (optional)',
			'Send'				: 'Send',
			'Cancel'			: 'Cancel',
			'MoreTweets'		: '+ More tweets',
			'sponsored'			: 'sponsored'
		},
		'fr' : {
			'LatestTweets'		: 'Derniers tweets',
			'MostPopular'		: 'Plus populaires',
			'LiveTweets'		: 'Tweets en direct',
			'FeaturedTweets'	: 'Tweet sponsoris&eacute;',
			'ProfileOf'			: 'Profil de',
			'QuickView'			: 'aper&ccedil;u',
			'ShareThisTweet'	: 'Partager ce tweet:',
			'ShareTwitter'		: 'Partager sur Twitter',
			'ShareFacebook'		: 'Partager sur Facebook',
			'ShareEmail'		: 'Envoyer par email',
			'second'			: 'seconde',
			'seconds'			: 'secondes',
			'minute'			: 'minute',
			'minutes'			: 'minutes',
			'hour'				: 'heure',
			'hours'				: 'heures',
			'timesince_before'	: 'Il y a',
			'timesince_after'	: '',
			'day'				: 'jour',
			'days'				: 'jours',
			'yesterday'			: 'hier',
			'RightNow'			: 'juste maintenant',
			'MoreThanAYearAgo'	: 'il y a plus d\'un an',
			'FollowThisFeed'	: 'S\'abonner &agrave; ce contenu',
			'SendTo'			: 'Envoyer ce tweet &agrave:',
			'SendToPlaceholder'	: 'email destinataire',
			'SendFrom'			: 'De:',
			'SendFromPlaceholder': 'Votre adresse email',
			'SendMsg'			: 'Message: (optionnel)',
			'Send'				: 'Envoyer',
			'Cancel'			: 'Annuler',
			'MoreTweets'		: '+ Voir plus de tweets',
			'sponsored'			: 'sponsoris&eacute;'
		}
	};
	this.tweets = [];

	this.getSetting = function(label,defaultvalue)
	{
		if(!this.settings)
			return defaultvalue;
			
		if(this.settings[label] != undefined)
			return this.settings[label];
		return defaultvalue;
	}
	
	
	// START OF SETTINGS
	this.feed			= this.getSetting('feed','nytimes/staff');
	
	this.title 			= this.getSetting('title','@'+this.feed);
	this.description	= this.getSetting('description','Latest tweets');
	this.language		= this.getSetting('language','en');
	
	this.headerBackground = this.getSetting('headerBackground','white');
	this.headerTextColor= this.getSetting('headerTextColor','black');
	this.borderColor	= this.getSetting('borderColor','');
	
	this.width 			= this.getSetting('width',300);
	this.height 		= this.getSetting('height',400);
	
	this.filters 		= this.getSetting('filters',{'keywords':'','not':''});
	this.limit			= this.getSetting('limit',10); // Maximum number of tweets to display on screen;
	
	this.tabs			= this.getSetting('tabs',false);
	this.popular		= this.getSetting('popular',false);
	this.iframe			= this.getSetting('iframe',false);

	this.signature		= this.getSetting('signature','/via @tesial');
	this.profilePage 	= this.getSetting('profilePage','http://twitter.com/'); // Leave blank to use the tabbing system, otherwise open the profile using the provided url
	this.morePage	 	= this.getSetting('morePage',''); // Leave blank to use the tabbing system, otherwise open the profile using the provided url

	this.mentionSymbol	= this.getSetting('mentionSymbol',''); // default: &#10149;
	this.showFooter		= this.getSetting('showFooter',true);
	this.showHeader		= this.getSetting('showHeader',true);
	this.showUrlDescription = this.getSetting('showUrlDescription',true);
	this.showUrlMetadata = this.getSetting('showUrlMetadata',true);
	this.enableQuickView= this.getSetting('enableQuickView',true);

	this.actions		= this.getSetting('actions',null);
	
	this.adserver_api_key = this.getSetting('adserver_api_key',null);
	this.ads_zone_id	= this.getSetting('ads_zone_id',null);
	
	this.onUpdate		= this.getSetting('onUpdate',''); // Callback function to call whenever new tweets are added to the widget

	// END OF SETTINGS
	
	
	this.current_status_id	= 0;
	
	this.socket 		= PUBLITWEET_SOCKET;
	
	this.hasLoadedOnce	= false;
	this.started		= false;
	
	this.last_since_id  	= 0;
	this.latest_query_options = new Object();
	
	this.setupWidget = function() 
	{
		this.feed 				= this.feed.toLowerCase();
		
		this.tracker 			= new PublitweetTracker(this.feed);
//		this.router				= PUBLITWEET_ROUTER;
		this.router				= new PublitweetRouter();

		this.filters.per_page		= this.limit*2;

		this.publitweet_feed		= PUBLITWEET_BASE_URL+this.feed;
		this.widgetNodeID			= 'publitweet-'+this.feed.replace('/','_');
		this.featuredNodeID 		= 'publitweet-featured-'+this.feed.replace('/','_');
		this.timelineNodeID 		= 'publitweet-timeline-'+this.feed.replace('/','_');
		this.publitweet_tabsNodeID	= this.widgetNodeID+' .publitweet-tabs ul';
	
		this.scheduler 				= new PublitweetScheduler();
	
		this.featuredTweets			= new FeaturedTweets();
		this.featuredTweets.containerNodeID = '#'+this.featuredNodeID;
	
		if(this.feed.indexOf('/')==-1)
		{
			this.profilePage = 'http://twitter.com/';
		}
	
		this.scheduler.addTask({
			'name'		: 'refresh',
			'callback'	: function() { instance.refresh(); } ,
			'interval'	: 1000*61
		})
	
		this.router.add({
			'name'			: 'latest',
			'isDefault'		: true,
			'hash'			: '#publitweet/'+instance.feed+'/latest',
			'callback'		: function() { 
								if(instance.tabs)
									instance.tabsController.selectTab('latest'); 
								instance.filters.since_id = 0;
								instance.filters.screen_name = '';
								instance.loadFeed(instance.feed,instance.filters); 
								}
		});
	
		if(this.popular)
		this.router.add({
			'name'			: 'popular',
			'hash'			: '#publitweet/'+instance.feed+'/popular',
			'callback'		: function() { 
								if(instance.tabs)
									instance.tabsController.selectTab('popular'); 
								instance.loadFeed(p.feed,{'sort':'popular'}); 
								}
		});
	
		this.router.add({
			'name'			: 'profile',
			'hash'			: '#publitweet/'+instance.feed+'/profile/$1',
			'callback'		: function(screen_name) { if(screen_name) { instance.openProfile(screen_name); } }
		});
	
	
		if(this.tabs)
		{
			this.profilePage 			= ''; // Make sure we open profiles within a new tab
			this.tabsController			= new PublitweetTabs(this.feed,this.publitweet_tabsNodeID);

			this.tabsController.add({
				'label':instance.localize('LatestTweets'),
				'action':'latest',
				'cssClass':'selected',
				'callback':function() { instance.router.execute('#publitweet/'+instance.feed+'/latest'); }
				});

			if(this.popular)
			this.tabsController.add({
				'label'		:instance.localize('MostPopular'),
				'action'	: 'popular',
				'callback'	: function() { instance.router.execute('#publitweet/'+instance.feed+'/popular'); },
				'closeable'	: false
				});
		}
		
		if(this.feed.indexOf('/')>0)
			this.publisher = this.feed.substr(0,this.feed.indexOf('/'));
		else
			this.publisher = this.feed;
			
		this.setBehaviour(jQuery('#'+this.widgetNodeID));
	}
		

	this.localize = function(index)
	{
		return instance.lang[instance.language][index];
	}

	this.xget = function(url)
	{
		jQuery('head').append('<script src="'+url+'"></script>');
	}
	
	this.loadProfile = function(screen_name)
	{
		// Loading profile
		this.filters.screen_name = screen_name;

		filters = this.filters;
		
		url = PUBLITWEET_API_URL+this.feed+'.json';
		url_args = '';
		
		if(filters)
		{
			for(var i in filters)
			{
				if(filters[i])
					url_args += '&'+i+'='+filters[i];
			}
			
		}
		
		if(url_args!='')
			url += '?'+url_args.substr(1);

		instance.socket.request(url,this.feed,instance.showFeed);
	}

	// Used in the profile.php when updating the search terms
	this.update = function()
	{
		this.router.refresh();
	}
	

	this.refresh = function()
	{
//		filters = instance.latest_query_options;
		filters = this.filters;
		
		// Disabling refresh when displaying popular items
		if(filters.sort == 'popular')
			return false;
		
		filters.since_id = instance.last_since_id;
		
		url = PUBLITWEET_API_URL+this.feed+'.json';
		url_args = '';
		if(filters)
		{
			for(var i in filters)
			{
				if(filters[i])
					url_args += '&'+i+'='+filters[i];
			}
		}
		
		if(this.isTwitterList(this.feed)) {
			if(this.feed.indexOf('favorites')!=-1)
				url = 'https://api.twitter.com/1/favorites.json?id='+this.getTwitterUserFromFeed(this.feed)+'&per_page='+this.limit+'&other=';
			else
				url = 'https://api.twitter.com/1/'+this.getTwitterUserFromFeed(this.feed)+'/lists/'+this.getTwitterListNameFromFeed(this.feed)+'/statuses.json';
		}
		else {
				url = 'https://api.twitter.com/1/statuses/user_timeline/'+this.getTwitterUserFromFeed(this.feed)+'.json';
		}
			
		if(url_args!='')
			url += '?'+url_args.substr(1);

		debug('calling '+url);
//		instance.socket.request(url,instance.feed,instance.refreshFeed);
		jQuery.getJSON(url+'&callback=?',function(json) {
			instance.refreshFeed(json);
		});
	}

	this.loadFeed = function(feed,filters)
	{
		// Loading profile
		
		url = PUBLITWEET_API_URL+feed+'.json';
		url_args = '&per_page=30';
		if(filters)
		{
			for(var i in filters)
			{
				if(filters[i])
					url_args += '&'+i+'='+filters[i];
			}

			instance.latest_query_options = filters;
			
		}
		
		if(this.isTwitterList(this.feed)) {
			url = 'https://api.twitter.com/1/'+this.getTwitterUserFromFeed(this.feed)+'/lists/'+this.getTwitterListNameFromFeed(this.feed)+'/statuses.json';
		}
		else {
			url = 'https://api.twitter.com/1/statuses/user_timeline/'+this.getTwitterUserFromFeed(this.feed)+'.json';
		}
		
		if(url_args!='')
			url += '?'+url_args.substr(1);

		instance.socket.request(url,instance.feed,instance.showFeed);
	}
	
	this.getTwitterListNameFromFeed = function(feed) {
		return feed.substr(feed.indexOf('/')+1);
	}
	
	this.getTwitterUserFromFeed = function(feed) {
		if (feed.indexOf('/') > 1)
			return feed.substr(0,feed.indexOf('/'));
		else
			return feed;
	}
	
	this.isTwitterList = function(feed) {
		if(feed.indexOf('/') > 1 ) {
			return true;
		}
		return false;
	}
	
	this.objectToArray = function(json) {
		var r=[];
		
		for (var i = 0; i < json.length; i++){
		//for (var i in json) {
			r.push(json[i]);
		};
		return r;
	}

	this.refreshFeed = function(json)
	{
		json = instance.objectToArray(json);
		debug('Tweets size: '+ instance.tweets.length +' Refreshing feed '+instance.feed+' with json',json);
		if(json.length==0)
			return;
		
		if(instance.tweets.length > 0)
			instance.addTweets(json);
		else
			instance.showAd(json,instance.showTweets);
			
		this.embedly();	
			
		if(typeof instance.onUpdate=='function')
		{
			instance.onUpdate.call(instance,json.tweets);
		}
	}

	this.showFeed = function(json)
	{
		debug(instance.feed+': JSON received',json);
			
		instance.removeTweets();
		instance.showTweets(json);
		
		this.embedly();
	}
	
	this.removeTweets = function()
	{
		jQuery('#'+this.widgetNodeID+' .publitweet-tweet').remove();
	}
	
	this.show = function()
	{
		
		if(jQuery.browser.msie && jQuery.browser.version < 8 && this.iframe!=true && this.height!='auto')
	    {
	    	document.write('<iframe src="'+PUBLITWEET_BASE_URL+'iframe.php?feed='+this.feed+'&width='+this.width+'&height='+this.height+'&limit='+this.limit+'&title='+this.title+'&description='+this.description+'&showUrlDescription='+this.showUrlDescription+'&morePage='+encodeURIComponent(this.morePage)+'&profilePage='+encodeURIComponent(this.profilePage)+'&headerBackground='+encodeURIComponent(this.headerBackground)+'&borderColor='+encodeURIComponent(this.borderColor)+'" frameborder=0 width='+this.width+' height='+this.height+'></iframe>');
	    	return;
	    }

		this.setupWidget();
		
		this.displayHeader();

		/*
		if(this.tweets.length>0)
			this.showTweets(this.tweets);
		else
			this.loadFeed(this.feed,this.filters);
		*/
		
		this.displayFooter();


		if(this.tabs)
		{
			this.tabsController.write();
		}


		this.layout();	
		
		instance.lazyLoad(); // Do not wait to move the scrollbar to test if the widget is in the fold!
		jQuery(document).bind('scroll',function(event) { instance.lazyLoad(); });	
	}
	
	this.destroy = function()
	{
		jQuery('#'+this.widgetNodeID).remove();
	}
	
	this.rewrite = function()
	{
		this.destroy();
		this.show();
	}

	this.addTweets = function(newtweets)
	{		

		if(newtweets.length==0)
			return false;
					
		newtweets = newtweets.reverse();
		this.tweets = newtweets.concat(this.tweets);
		setTimeout(function() {
			instance.addNextTweet(newtweets,0);
		},0);		
	}
	
	this.addNextTweet = function(tweets,i)
	{
		if(i < tweets.length)
		{
			//debug('Adding tweet '+i+' out of '+tweets.length);
			var tweet = new Tweet(tweets[i]);
			this.showTweet(tweet,{'position':'prepend','style':'display:none;'});
			this.updateLastSyncID(tweet);
			
			// jQuery('#tweet-'+tweets[i]._id).effect('highlight',{},1500);
			jQuery('#tweet-'+tweet._id_str).slideDown(1500,function() {
				i = i+1;
				instance.removeLastTweet();
				setTimeout(function(thisObj) { thisObj.addNextTweet(tweets,i); }, 1000, instance);
			});
		}
	}
	
	this.removeLastTweet = function()
	{
		lastIndex = this.tweets.length - 1;
		//debug('Removing last tweet ' + this.tweets[lastIndex].id);
		//debug('Removing last tweet ' + this.tweets[lastIndex].id_str);
		if(this.tweets[lastIndex])
		{
			//debug('Removing tweet #'+lastIndex+': '+this.tweets[lastIndex].id_str);
			jQuery('#tweet-'+this.tweets[lastIndex].id_str).remove();
			this.tweets = this.tweets.slice(0,lastIndex);
		}	
	}
	
	this.effectNewTweet = function(node)
	{
		// node.hide();
		node.effect('slide',{'direction':'up'},2000,function() {
			jQuery(this).effect('highlight',{},2000);
		});
		
	}
	
	this.updateLastSyncID = function(tweet)
	{
		if(tweet._id > this.last_since_id)
			this.last_since_id = tweet._id;
	}
	
	this.showAd = function(tweets,callback) {
		// ADSERVER
		debug('calling ad server '+ADSERVER_API_URL);
		if(ADSERVER_API_URL && instance.adserver_api_key) {
			jQuery.getJSON(ADSERVER_API_URL+'?callback=?&externalId='+instance.adserver_api_key,function(json) {
				if(json) {
					//debug('getting ad',json);
					var tweet = json.sponsorizedTweet;
					if (tweet._id){
						tweet.id		= tweet._id_str;
						tweet.id_str		= tweet._id_str;
						tweet._id		= tweet._id_str;
						tweet.featured=true;
						tweet.ts		= tweet.ts /1000;
						instance.showTweet(tweet,{className:"featured"});
				}
				}
				callback(tweets);
				instance.embedly();
			});
		}
		else {
			callback(tweets);
		}
	}
	
	this.showTweets = function(tweets)
	{		
		if(tweets.length==0)
			return false;
			
		this.tweets = [];
		
		jQuery('#'+instance.widgetNodeID+' .publitweet-loading').hide();
	
		
		for(var i = 0 ; i < tweets.length && instance.tweets.length < instance.limit ; i++)
		{
			if(tweets[i].text.substr(0,1)!='@') {
				instance.tweets.push(tweets[i]);
				var tweet = new Tweet(tweets[i]);
				instance.showTweet(tweet);
				instance.updateLastSyncID(tweet);
			}
		}
		
		if(this.current_status_id>0)
		{
			jQuery('#'+this.widgetNodeID+' .timeline').scrollTo(jQuery('#tweet-'+this.current_status_id),500);
		}
		
	}

	this.embedly = function() {
		// Embedly
		var urls = [];
		var url2node = {};
		jQuery('div.publitweet-tweet a.embedly').each(function() {

			if(urls.length>3)
				return instance.embedly();

			jQuery(this).removeClass('embedly');
			var url	 		= jQuery(this).attr('href');
			var tweet_node 	= jQuery(this).parents('div.publitweet-tweet');
			url2node[url] 	= tweet_node;
			urls.push(url);
		});

		var urls_str = urls.map(function(x) { return encodeURIComponent(x); }).join(',');
		if(urls_str.length > 5) {
					debug('calling embedly '+ EMBEDLY_API_URL +urls_str);
					jQuery.getJSON(EMBEDLY_API_URL + urls_str,function(json) {
							for(var i=0,len=json.length;i<len;i++) {
								var url = {
									shorturl	: urls[i],
									url			: json[i].url,
									favicon		: json[i].favicon,
									img			: json[i].thumbnail_url,
									title		: json[i].title,
									description	: json[i].description
								};
								debug('getting attachement for URL ',url);
								html = instance.getAttachments(url);
								url2node[urls[i]].find('.metadata').before(html);
							}
			//				debug('embed:',json);
					});
					debug('urls:',urls.join(','));
		}
	}
	
	this.layout = function()
	{
		headerSize = 10;
		if(this.tabs)
			headerSize += 25;
		if(this.showHeader && this.title!='')
			headerSize += 20;
		if(this.showHeader && this.description!='')
			headerSize += 20;

		if (this.ads_zone_id!=null){
			footerSize = 109;
		}
		else
		{
			footerSize = 29;
		}
			
		jQuery('#'+this.widgetNodeID).css('width',this.width);
		jQuery('#'+this.widgetNodeID).css('height',this.height);
		
		if(this.height!='auto')
			jQuery('#'+this.widgetNodeID+' .publitweet-body').css('height',this.height-headerSize-footerSize);
			
		jQuery('#'+this.widgetNodeID+' .publitweet-body').css('overflow','auto');
		
		if(this.headerBackground)
		{
			jQuery('#'+this.widgetNodeID + ' .publitweet-header').css('background',this.headerBackground);
			jQuery('#'+this.widgetNodeID + ' .publitweet-tabs').css('background',this.headerBackground);
			jQuery('#'+this.widgetNodeID + ' .publitweet-ft').css('background',this.headerBackground);
		}

		if(this.headerTextColor != 'black')
		{
			jQuery('#'+this.widgetNodeID + ' .publitweet-header').css('color',this.headerTextColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-tabs').css('color',this.headerTextColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-ft').css('color',this.headerTextColor);
		}
		
		if(this.borderColor)
		{
			jQuery('#'+this.widgetNodeID + ' .publitweet-header').css('border-top','1px solid '+this.borderColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-header').css('border-left','1px solid '+this.borderColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-header').css('border-right','1px solid '+this.borderColor);

			jQuery('#'+this.widgetNodeID + ' .publitweet-tabs').css('border-left','1px solid '+this.borderColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-tabs').css('border-right','1px solid '+this.borderColor);

			jQuery('#'+this.widgetNodeID + ' .publitweet-tabs ul').css('border-bottom','1px solid '+this.borderColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-tabs ul li').css('border','1px solid '+this.borderColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-tweet').css('border-bottom','1px dotted '+this.borderColor);

			jQuery('#'+this.widgetNodeID + ' .publitweet-body').css('border-left','1px solid '+this.borderColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-body').css('border-right','1px solid '+this.borderColor);

			jQuery('#'+this.widgetNodeID + ' .publitweet-ft').css('border-left','1px solid '+this.borderColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-ft').css('border-right','1px solid '+this.borderColor);
			jQuery('#'+this.widgetNodeID + ' .publitweet-ft').css('border-bottom','1px solid '+this.borderColor);
		}
		
	}
	
	this.lazyLoad = function() 
	{
		if(!instance.belowthefold('#'+instance.widgetNodeID,{'threshold':0,'container':document}))
		{
			// debug("########### start");
			instance.start();
			// instance.tracker.trackEvent('start','');
		}
		else
		{
			// debug("########### stop");
			instance.stop();
			// instance.tracker.trackEvent('stop','');
		}
	}
	
	this.start = function()
	{
		if(instance.started)
			return false;
			
		// debug('Starting publitweet widget for '+instance.feed,this.filters);
		
		if(!instance.hasLoadedOnce)
		{
			instance.hasLoadedOnce = true;
			instance.tracker.trackEvent('load','');
		}	
		
		instance.router.start();
		instance.scheduler.start();
		
		instance.started = true;
	}
	
	this.stop = function()
	{
		if(!instance.started)
			return false;
		
		// debug('Stopping publitweet widget for '+instance.feed);
					
		instance.router.stop();
		instance.scheduler.stop();
		
		instance.started = false;
	}
	
    /* Use as  belowthefold(element, {threshold : 100, container : window}) */
    this.belowthefold = function(element, settings) {
        if (settings.container === undefined || settings.container === document) {
            var fold = jQuery(window).height() + jQuery(window).scrollTop();
        } else {
            var fold = jQuery(settings.container).offset().top + jQuery(settings.container).height();
        }
//alert("scroll:" + jQuery(window).scrollTop());
//alert("windows height:" + jQuery(window).height());
//alert("doc height:" + jQuery(document).height());
//alert("fold:" + fold);
//alert("element top:"+jQuery(element).offset().top);

        return fold <= jQuery(element).offset().top - settings.threshold;
    }
	
	this.displayHeader = function()
	{
		css = 'style';
		if(this.width < 350)
			css = 'styleSmall';
			
		jQuery('head').prepend('<link rel="stylesheet" href="'+PUBLITWEET_BASE_URL+'css/'+css+'.css?v=1.1" type="text/css" />');
		
		html = '<div id="'+this.widgetNodeID+'" class="publitweet">';
		
		if(this.showHeader)
		{
			html += '<div class="publitweet-header">							\n\
					<h3>'+this.title+'</h3>								\n\
					<h4>'+this.description+'</h4>						\n\
				</div>';
				
			/*
			html += '<div class="publitweet-header">							\n\
					<div class="publitweet-headerleft"> \n\
					<h3>'+this.title+'</h3>								\n\
					<h4>'+this.feed+'</h4>						\n\
					</div>\n\
					<div class="publitweet-headerright"> \n\
					Curated by '+this.curator.name+'<img src="'+this.curator.profile_image_url+'" border=0 />\n\
					</div>\n\
				</div>';
			*/

		} 
		
		if(this.tabs)
			html += '<div class="publitweet-tabs"><ul></ul></div>';

		html += '			<div class="publitweet-body">							\n\
								<div class="publitweet-loading">loading</div>		\n\
								<div class="featuredTweets">						\n\
								<h3 class="featuredTweets" style="display:none;">'+instance.localize('FeaturedTweets')+'</h3>	\n\
								<div class="timeline featured" id="'+this.featuredNodeID+'"> \n\
								\n\
								</div>												\n\
								</div>												\n\
								<div class="liveTweets">						\n\
								<h3 class="liveTweets" style="display:none;">'+instance.localize('LiveTweets')+'</h3>	\n\
								<div class="timeline" id="'+this.timelineNodeID+'">';
		
		document.write(html);
		
	}

	this.displayFooter = function() 
	{
		var html = '					</div>										\n\
									</div></div>';
		
		if(this.showFooter)
		{
			html += '<div class="publitweet-ft">';

			if(this.ads_zone_id!=null){
				html += '<div class="publitweet-banner">\n\
					<script type=\'text/javascript\'><!--//<![CDATA[\n\
					var m3_u = (location.protocol==\'https:\'?\'https://'+OPENXSERVER_URL+'\':\'http://'+OPENXSERVER_URL+'\');\n\
					var m3_r = Math.floor(Math.random()*99999999999);\n\
					if (!document.MAX_used) document.MAX_used = \',\';\n\
					document.write (\"<scr\"+\"ipt type=\'text/javascript\' src=\'\"+m3_u);\n\
					document.write (\"?zoneid='+ this.ads_zone_id+'\");\n\
					document.write (\'&amp;cb=\' + m3_r);\n\
					if (document.MAX_used != \',\') document.write (\"&amp;exclude=\" + document.MAX_used);\n\
					document.write (document.charset ? \'&amp;charset=\'+document.charset : (document.characterSet ? \'&amp;charset=\'+document.characterSet : \'\'));\n\
					document.write (\"&amp;loc=\" + escape(window.location));\n\
					if (document.referrer) document.write (\"&amp;referer=\" + escape(document.referrer));\n\
					if (document.context) document.write (\"&context=\" + escape(document.context));\n\
					if (document.mmm_fo) document.write (\"&amp;mmm_fo=1\");\n\
					document.write (\"\'><\/scr\"+\"ipt>\");\n\
					//]]>--></script>\n\
					</div>\n\
					';
			}
			
			html += '<div class="publitweet-subscribe">';
			
			if(this.morePage!='')
			{
				html += '<a href="'+this.morePage+'" target="_parent pbtTrackEvent" event="MoreTweets">'+instance.localize('MoreTweets')+'</a>';
			}	
			else
			{
				html += '									\n\
							<span class="pbt-label">'+instance.localize('FollowThisFeed')+' </span>		\n\
																	\n\
							<a href="http://twitter.com/'+this.feed+'" target="_blank">		\n\
								 <img height="15" src="'+PUBLITWEET_BASE_URL+'img/twitter.png" alt="">\n\
							</a>';
			}
			html += '									\n\
					</div>										\n\
																\n\
					<span class="pbt-poweredby">										\n\
						<a href="http://tesial.be" target="_blank">\n\
							Publitweet (by Tesial)				\n\
						</a>									\n\
					</span>										\n\
				</div>';
		}

		html += '</div>';

		document.write(html);
		
	}
	
	this.openProfile = function(screen_name)
	{
		if(screen_name.indexOf('/')>0)
		{
			status 		= screen_name.substr(screen_name.indexOf('/')+1);
			screen_name	= screen_name.substr(0,screen_name.indexOf('/'));
			
			this.current_status_id = status;
		}
		else
			this.current_status_id = null;
			
		if(this.tabs)
		{
			this.tabsController.add({
				'label' 	: instance.localize('ProfileOf')+' '+screen_name,
				'action'	: 'profile/'+screen_name,
				'callback'	: function() { instance.router.execute('#publitweet/'+instance.feed+'/profile/'+screen_name); },
				'closeable'	: true
			});

			this.tabsController.update();

			this.tabsController.selectTab('profile/'+screen_name);
		}
		
		this.loadProfile(screen_name);
	}
		
	this.slideSendEmail = function(node)
	{
		if(jQuery('#emailInput_window').size()==1)
		{
			return jQuery('#emailInput_window').slideUp('slow',function() {jQuery(this).remove()});
		}
		tweet_id = jQuery(node).attr('href');
		html = '<div id="emailInput_window" style="display:none;" tweet_id="'+tweet_id+'"> \n\
					<form id="form_sendEmail">\n\
					<div class="row"><label>'+instance.localize('SendTo')+'</label>	<input type="email" id="email_to" placeholder="'+instance.localize('SendToPlaceholder')+'" /></div>		\n\
					<div class="row"><label>'+instance.localize('SendFrom')+'</label>	<input type="email" id="email_from" placeholder="'+instance.localize('SendFromPlaceholder')+'" /></div> \n\
					<div class="row"><label>'+instance.localize('SendMsg')+'</label>	<textarea id="email_msg" cols=10 rows=4></textarea></div> \n\
					<div class="row clearleft"><input type="submit" value="'+instance.localize('Send')+'" id="submit_sendEmail" /> <input type="button" value="'+instance.localize('Cancel')+'" id="button_sendEmail_cancel"></div>	\n\
					</form>\n\
				</div>';
		n = jQuery(html);
		jQuery(node).parent().after(n);
		n.slideDown('slow');
		
		jQuery('#form_sendEmail').submit(function(e) {
			e.preventDefault();
			email_from 	= jQuery('#email_from').val();
			email_to	= jQuery('#email_to').val();
			msg			= jQuery('#email_msg').val();
			
			instance.tracker.trackEvent('SendEmail',email_from+':'+email_to);
			instance.xget(PUBLITWEET_BASE_URL+'sendemail.php?email_from='+email_from+'&email_to='+email_to+'&msg='+escape(msg)+'&feed='+instance.feed+'&tweet_id='+tweet_id);
			
			jQuery('#emailInput_window').slideUp('slow',function() {jQuery(this).remove()});
			return false;
		});
		
		jQuery('#button_sendEmail_cancel').click(function(e) {
			jQuery('#emailInput_window').slideUp('slow',function() {jQuery(this).remove()});
		});
	}
	
		this.setBehaviour = function(jNode)
		{
			jNode.find('a[event="ShareEmail"]').live('click',function(e) {
				e.preventDefault();
				instance.slideSendEmail(this);
				return false;
			});

			jNode.find('a[event="ShareFacebook"]').live('click',function(e) {
				e.preventDefault();
				t=(screen.height/2)-436;
				l=(screen.width/2)-626;
				url = jQuery(this).attr('href');
				window.open(url,'sharer','toolbar=0,status=0,width=626,height=436,top='+t+',left='+l);
				//instance.FBShare('Check this out!',{'name':'Test','href':url,'description':'This is the msg','media':[{'type':'image','src':'image.jpg','href':url}]},[{'text':'View the stream','href':PUBLITWEET_BASE_URL+instance.feed}]);
				return false;
			});

			if(!instance.iframe && instance.enableQuickView)
			{
				jNode.find('.iframe').live('mouseover',function() {
					jQuery(this).fancybox({
					'transitionIn'	: 'elastic',
					'transitionOut'	: 'elastic',
					'title'			: jQuery(this).attr('title'),
					'titlePosition'	: 'inside',	
					'width'			: 900,
					'height'		: 600
					});
				});

				jNode.find('.iframe.youtube').live('mouseover',function() {
					jQuery(this).fancybox({
							'padding'		: 0,
							'autoScale'		: false,
							'transitionIn'	: 'elastic',
							'transitionOut'	: 'elastic',
							'title'			: jQuery(this).attr('title'),
							'width'			: 680,
							'height'		: 495,
							'href'			: jQuery(this).attr('href').replace(new RegExp("watch\\?v=", "i"), 'v/'),
							'type'			: 'swf',
							'swf'			: {
							   	 'wmode'		: 'transparent',
								'allowfullscreen'	: 'true'
							}
						});
					});
			}

			jNode.find('a.pbtTrackEvent').live('click',function(e) {
				current_event = jQuery(this).attr('event');
				if(!current_event)
					current_event = 'link';

				instance.tracker.trackEvent(current_event,jQuery(this).attr('href'));
			});

			jNode.find('a[event="ShowProfile"]').live('click',function(e) {

				if(instance.profilePage!='')
				{
					//debug('Loading profile on twitter');
					return true;
				}

				e.preventDefault();
				screen_name = jQuery(this).attr('screen_name');
				instance.router.execute('#publitweet/'+instance.feed+'/profile/'+screen_name);
				return false;
			});

			if(this.actions)
			{
				jQuery.each(
					instance.actions,
					function(k,v) {
						jNode.find('a[event="'+k+'"]').live('click',function() {
							tweet_id = jQuery(this).attr('tweet_id');
							v.call(instance,instance.getTweet(tweet_id));
						})
					}
					);
			}

		}
	
	this.getTweet = function(tweet_id)
	{
		tweets = instance.tweets;
		for(var i = 0 ; i < tweets.length ; i ++)
		{
			if(tweets[i]._id == tweet_id)
				return tweets[i];
		}
		return false;
	}
	
	this.humanize = function(tweet)
	{
		tweet.human_content = tweet.content;
		tweet.human_content = tweet.human_content.replace(/#([a-z0-9]*)/ig,'<span class="hashtag">#$1</span>');
		tweet.human_content = tweet.human_content.replace(/(http:\/\/\S+)/g, "<a href='$1' target='_new' class='pbtTrackEvent embedly'>$1</a>");

		/*
		if(tweet.metadata.mentions)
		{
			tweet.human_content = tweet.human_content.replace(/RT @([a-z_]){1,15} ?:? ?/ig,'');
			
			sources = '';
			for(var i in tweet.metadata.sources)
			{
				if(tweet.metadata.sources[i])
					sources += ', ' + '<a href="http://twitter.com/'+i+'" event="ShowMention" target="_blank" class="pbtTrackEvent" title="'+tweet.metadata.sources[i].name+' ('+tweet.metadata.sources[i].location+'): \r\n'+tweet.metadata.sources[i].description+'">'+tweet.metadata.sources[i].name + '</a>';
			}
			
			// We remove the short URL	
			if(this.showUrlMetadata)
			{
				jQuery.each(
					tweet.metadata.urls,
					function(k,v) 
					{
						tweet.human_content = tweet.human_content.replace(k,'');
					}
					);
			}
			else
			{
				tweet.human_content = tweet.human_content.replace(/(http:\/\/\S+)/g, "<a href='$1' target='_new' class='pbtTrackEvent embedly'>$1</a>");
			}
			

			if(sources != '')
			{
				tweet.human_content += ' (source: '+sources.substr(2)+')';
			}
			
			jQuery.each(
				tweet.metadata.mentions,
				function(k,v) 
				{
					if(v)
						tweet.human_content = tweet.human_content.replace('@'+k,'<a class="pbtTrackEvent mention" event="ShowMention" target="_blank" title="'+v.name+' ('+v.location+'): \r\n'+v.description+'" href="http://twitter.com/'+k+'"> '+instance.mentionSymbol+v.name+'</a>');
				}
				);
			
	
		}
		*/
		return tweet;
	}
	
	this.previewAvailable = function(domain)
	{
		// If the widget is in an iframe, then we cannot use preview :-(
		if(instance.iframe || !instance.enableQuickView)
			return false;
			
		for ( var i = 0 ; i < NO_PREVIEW.length ; i ++ )
		{
			if ( NO_PREVIEW[i] == domain.substr(domain.length-NO_PREVIEW[i].length) )
				return false;
		}
		return true;
	}
	
	// Url {url,img,shorturl,title,description,favicon}
	this.getAttachments = function(url)
	{
		attachments = '';
		
		if(!this.showUrlMetadata)
			return '';
		

		domain = url.url.replace(/^(http:\/\/)(www\.)?/i,'');
		domain = domain.replace(/\/.*/g,'');
		
		preview = '';
		
		if(instance.previewAvailable(domain))
			preview = '<a href="'+url.shorturl+'" event="preview" class="pbtTrackEvent iframe" title="'+url.title+'">['+instance.localize('QuickView')+']</a>';
			
		attachments += '<div class="attachment '+url.type+'">';
								
		if(url.img)
		{
			attachments += '<div class="attachment_img"><a href="'+url.shorturl+'" class="pbtTrackEvent';
			if(url.type=='video')
				attachments += ' youtube';
			attachments += '" target="_blank"><img class="thumbnail" src="'+url.img+'" /></a></div>';
		}
		else if(url.favicon)	
			attachments += '<div class="attachment_img favicon"><a href="'+url.shorturl+'" class="pbtTrackEvent" target="_blank"><img class="favicon" src="'+url.favicon+'" /></a></div>';
		else
			attachments += '<div class="attachment_img favicon" style="background:url(\'http://'+domain+'/favicon.ico\') no-repeat top left;"></div>';

//			attachments += '<div class="attachment_img favicon" style="background:url(\'http://'+domain+'/favicon.ico\') no-repeat top left;"><a href="'+url.url+'" class="pbtTrackEvent" target="_blank"><img class="favicon" src="'+url.favicon+'" /></a></div>';
			
		attachments += '	<div class="description_block">\n\
							<h3>\n\
								<a class="pbtTrackEvent" href="'+url.shorturl+'" target="_blank">'+url.title+'</a>\n\
								<div class="domain">'+domain+'\n\
									'+preview+'\n\
								</div>\n\
							</h3>\n\
							';
								
		if(instance.showUrlDescription && url.description != '' && url.description!=null)
		{
			attachments += '<div class="description">'+url.description+'</div>';
		}
		
		attachments += '	</div></div>';

		
		if(attachments!='')
			return '<div class="attachments">'+attachments+'</div>';
		else
			return '';
	}
	
	this.getActions = function(tweet)
	{
		tweet.permalink = 'http://twitter.com/'+tweet.user.screen_name+'/status/'+tweet._id;
		
		retweet_content = 'RT @'+tweet.user.screen_name+' '+tweet.content;		
		if((retweet_content+this.signature).length <= 139)
			retweet_content += ' '+this.signature;
		
		actions = '';
		actions += '<div class="publitweet-actions">';
		if(instance.actions)
		{
			actions += '<div class="custom_actions">';
			jQuery.each(
				instance.actions,
				function(k,v) {
					actions += '<a event="'+k+'" href="#" tweet_id="'+tweet._id+'" class="pbtTrackEvent publitweet-action">'+k+'</a> ';
				}
				);
			actions += '</div>';
		}
		actions += '<label>'+instance.localize('ShareThisTweet')+'</label> \n\
		<a event="ShareTwitter" href="http://twitter.com/?status='+encodeURIComponent(retweet_content)+'" class="pbtTrackEvent publitweet-action ShareTwitter" target="_blank" title="'+instance.localize('ShareTwitter')+'"> </a>	\n\
		<a event="ShareFacebook" href="http://facebook.com/sharer.php?u='+encodeURIComponent(tweet.permalink)+'&t='+encodeURIComponent(tweet.content)+'" class="ShareFacebook pbtTrackEvent publitweet-action" target="_blank" title="'+instance.localize('ShareFacebook')+'"> </a>';
		
//		actions += '<a event="ShareEmail" href="'+tweet._id+'" class="pbtTrackEvent publitweet-action ShareEmail" target="_blank" title="'+instance.localize('ShareEmail')+'"> </a>';
		actions += '</div>';
//			<a name="fb_share" type="icon" share_url="YOUR_URL"></a> 

		return actions;	
	}
	
	this.showTweet = function(tweet,options)
	{
//		attachments 	= this.getAttachments(tweet);
		attachments 	= '';
		tweet 			= this.humanize(tweet);
		actions			= this.getActions(tweet);
		
		tweet.controller = new Object();
		
		//tweet.controller.annotation = new Annotation(tweet);
		
		if(!options)
			options = {};
			
		//  style="background:url(\''+url.favicon+'\') no-repeat top left;"
		
		(tweet._id==this.current_status_id) ? highlight_class = 'highlight' : highlight_class = '';
		
		if(tweet.featured)
			highlight_class += ' featured';
		
		//debug('tweet',tweet);
		
		var html = '<div id="tweet-'+tweet._id+'" class="publitweet-tweet '+highlight_class+' '+options.className+'" style="opacity: 1;'+options.style+'"> \n\
						<div class="publitweet-tweet-wrap">';

		if(options.className=='sponsored') {
			html += '<div class="sponsoredLabel">'+instance.localize('sponsored')+'</div>';
		}
		if(this.feed.indexOf('/')>0)
		{
			html += '			<div class="publitweet-avatar">           \n\
									<div class="publitweet-img">			 \n\
										<a event="ShowProfile" screen_name="'+tweet.user.screen_name+'" href="'+this.profilePage+tweet.user.screen_name+'" class="" target="_top" title="'+tweet.user.name+' ('+tweet.user.location+'): \r\n'+tweet.user.description+'">	\n\
											<img src="'+tweet.user.avatar+'" alt="'+tweet.user.screen_name+' profile">	\n\
										</a>							\n\
									</div>								 \n\
								</div>';
			html += '       	<div class="publitweet-tweet-content">';
		}
		else
			html += '       	<div class="publitweet-tweet-content" style="margin-left:5px !important">';

		if(this.feed.indexOf('/')>0)
			html += '					<a class="publitweet-author" href="'+this.profilePage+tweet.user.screen_name+'" screen_name="'+tweet.user.screen_name+'" event="ShowProfile" target="_top" title="'+tweet.user.name+' ('+tweet.user.location+'): \r\n'+tweet.user.description+'">'+tweet.user.name+'</a>';
		html += '					'+tweet.human_content+'			           \n\
							</div>												  \n\
							'+attachments+'\n\
							<div class="metadata">		\n\
								<div class="timesince"> \n\
									<a href="http://twitter.com/'+tweet.user.screen_name+'/status/'+tweet._id+'" class="pbtTrackEvent publitweet-timestamp" target="_blank">\n\
									'+instance.timesince(tweet.ts)+'\n\
									</a> \n\
								</div> \n\
							</div> \n\
							'+actions+'\n\
				       </div>		\n\
					</div>';
		
		tweet.html = html;
		tweet.node = jQuery(tweet.html);

		if(tweet.featured)
		{
			instance.featuredTweets.add(tweet);
		}
		else
		{
			if(options.position=='prepend')
				jQuery('#'+this.timelineNodeID).prepend(tweet.node);
			else
				jQuery('#'+this.timelineNodeID).append(tweet.node);
		}
		
		//tweet.controller.annotation.show();	

		// We show the share actions here to make sure they don't mess up during the animation
		tweet.node.find('div.publitweet-actions').css('display','block');
	}
	
	
	this.timesince = function(h)
	{
			var j=new Date();
			var f=new Date(h*1000);

			//if(B.ie) { f = Date.parse(h.replace(/( \+)/," UTC$1")) }

			var i=j-f;
			var c=1000,d=c*60,e=d*60,g=e*24,b=g*7;

			if(isNaN(i)||i<0){return""}
			if(i<c*7){return instance.localize('RightNow'); }
			if(i<d){return instance.localize('timesince_before') + ' ' + Math.floor(i/c) + " " + instance.localize('seconds') + ' ' + instance.localize('timesince_after'); }
			if(i<d*2){return instance.localize('timesince_before') + " 1 " + instance.localize('minute') + " " + instance.localize('timesince_after')}
			if(i<e){return instance.localize('timesince_before') + ' ' +Math.floor(i/d)+" "+instance.localize('minutes')+" "+instance.localize('timesince_after')}
			if(i<e*2){return instance.localize('timesince_before') + " 1 "+instance.localize('hour')+" "+instance.localize('timesince_after')}
			if(i<g){return instance.localize('timesince_before') + ' '+Math.floor(i/e)+" "+instance.localize('hours')+" "+instance.localize('timesince_after')}
			if(i>g&&i<g*2){return instance.localize('yesterday')}
			if(i<g*365){return instance.localize('timesince_before') + ' '+Math.floor(i/g)+" "+instance.localize('days')+" "+instance.localize('timesince_after')}
			else{return instance.localize('timesince_before') + ' '+instance.localize('MoreThanAYear')}
	}
	
	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);
	}
	
}

/*
function Annotation(tweet) {
	
	var instance = this;

	this.feed = '';
	
	this.tweet = tweet;
	this.node;
	this.editing = false;

	if(!tweet.annotation || !typeof tweet.annotation.content=='string')
		this.content = '';
	else
		this.content = tweet.content;
		
	html = '<div class="publitweet-annotation"> \n\
			'+this.content+'\n\
			</div>';

	this.node = jQuery(html);
	
	this.containerID = 'div.publitweet #tweet-'+tweet._id;
	
	this.edit = function() {
		html = '<div id="annotation_edit" style="display:none;"> \n\
				<form id="annotationSlide_form"> \n\
				<textarea id="annotation_text" cols=20 rows=2>'+this.content+'</textarea>\n\
				</form>\n\
				</div>';
				
		this.node.html(html);
		
		this.editing = true;
		
		this.behaviour();
	}
	
	this.behaviour = function() {
		
		if(this.editing)
		{
			this.node.find('textarea').blur(function() {
				content = jQuery(this).val();
				instance.save(content);
				return false;
			});
		}
		else 
		{
			this.node.click(function() {
				instance.edit(instance.tweet);
			});
		}
		
	}
	
	this.save = function(annotation_content) {
		this.content = annotation_content;
		jQuery.getJSON(PUBLITWEET_BASE_URL+'proxyapi.php?feed='+instance.feed+'&method=annotate&tweet_id='+tweet._id+'&text='+this.content);
		this.node.html(annotation_content);
	}
	
	this.show = function() {
		//debug('Prepending ',jQuery(this.containerID));
		jQuery('#'+this.containerID).prepend(instance.node);
		this.behaviour();
	}
	
}
*/

function FeaturedTweets() {
	
	var instance = this;
	
	this.tweets = new Array();
	
	this.limit = 2;
	this.containerNodeID;
	
	this.add = function(tweet) {
		tweet.featured=true;
		this.tweets.push(tweet);
	
		this.tweets.sort(function(a,b) {
			return (a._id < b._id);
		});
	
		tweet.node = jQuery(tweet.html);
	
		jQuery(this.containerNodeID).prepend(tweet.node);
		if(tweet.node.find('.publitweet-actions a[event="Feature"]').size()>0)
			tweet.node.find('.publitweet-actions a[event="Feature"]').html(tweet.node.find('.publitweet-actions a[event="Feature"]').html().replace(/Feature/g,'Unfeature'));
		tweet.node.addClass('featured');
		tweet.node.find('div.publitweet-actions').css('display','block');
	
		debug('Adding tweet to featuredTweets',tweet);
		this._showHeaders();
	}
	
	this.remove = function(tweet) {
		
		twts = new Array();
		for (var i = 0 ; i < instance.tweets.length ; i++)
		{
			if(instance.tweets[i]._id != tweet._id)
			{
				twts.push(tweet);
			}
		}
				
		tweet.featured=false;		
		tweet.node.fadeOut('slow');
		if(tweet.node.find('.publitweet-actions a[event="Feature"]').size()>0)
			tweet.node.find('.publitweet-actions a[event="Feature"]').html(tweet.node.find('.publitweet-actions a[event="Feature"]').html().replace(/Unfeature/g,'Feature'));
		tweet.node.removeClass('featured');
		tweet.node.remove();

		instance.tweets = twts;
		
		if(this.tweets.length==0)
			this._showHeaders();
	}
	
	this._showHeaders = function() {
		
		debug('_showHeaders',this.tweets.length);
		if(this.tweets.length>0)
		{
			jQuery('div.publitweet h3.featuredTweets').show();
			jQuery('div.publitweet h3.liveTweets').show();
		}
		else
		{
			jQuery('div.publitweet h3.featuredTweets').hide();
			jQuery('div.publitweet h3.liveTweets').hide();
		}
	}
	
	this.show = function() {

		this._showHeaders();

		limit = Math.min(instance.tweets.length,this.limit);

		for (var i = 0 ; i < limit ; i++)
		{
			this.add(instance.tweets[i]);
		}
	}
	
	this.update = function() {
		
	}
	
	this.next = function() {
		
	}
	
	this.previous = function() {
		
	}
	
}

function debug(msg,obj) {
	
	if(!DEBUG)
		return false;

	if(!obj)
		obj = '';

	if(window.console)
		console.info(msg,obj);
	
}

;

(function() {
	
	Tweet = function(tweet) {
		
		if(!tweet.user)
		{
			tweet.user = {
				'screen_name' 		: tweet.from_user,
				'profile_image_url'	: tweet.profile_image_url
			};
		}

		this._id_str		= tweet.id_str;
		this._id		= tweet.id_str;
		this.user		= tweet.user;
		this.user.avatar= tweet.user.profile_image_url;
		this.content	= tweet.text;
		this.source		= tweet.source;
		this.ts 		= (new Date(tweet.created_at)).getTime()/1000;
		this.type		= '';
		this.metadata 	= {};
		
		//debug('new tweet',this);
		
	}
	
})();

PUBLITWEET_LOADED = true;
} // end of if(!PUBLITWEET_LOADED)



