/* WSJ.com Omniture Metadata Definition*/
var lookup = new Array(60);
var elookup = new Array(20);
var editionToNameMap = new Array(20);

lookup["pagename"]="pageName";
lookup["primaryproduct"]="channel";
lookup["sitedomain"]="server";
lookup["section"]="prop1";
lookup["subsection"]="prop2";
lookup["atype"]="prop3";
lookup["aheadline"]="prop4";
lookup["baseurl"]="prop5";
lookup["fullurl"]="prop6";
lookup["refresh"]="prop7";
lookup["csource"]="prop8";
lookup["caccess"]="prop9";
lookup["link"]="prop10";
lookup["reflink"]="prop11";
lookup["qtype"]="prop12";
lookup["qsymbol"]="prop13";
lookup["qcompanyname"]="prop14";
lookup["qexchange"]="prop15";
lookup["qdatarange"]="prop16";
//lookup["numads"]="prop17";
lookup["searchstatement"]="prop18";
lookup["ctype"]="prop19";
lookup["abasedocid"]="prop20";
lookup["author"]="prop21";
lookup["apage"]="prop22";
lookup["apublished"]="prop23";
lookup["edition"]="prop24";
lookup["userid"]="prop25";
lookup["basesection"]="prop26";
lookup["asub"]="prop27";          
lookup["targeturl"]="prop38";

elookup["sourcecode"]="eVar1";
elookup["promocode"]="eVar2";
elookup["userID"]="eVar3";
elookup["pagename"]="eVar4";
elookup["link"]="eVar5";
elookup["reflink"]="eVar6"
elookup["abtesting"]="eVar7";
elookup["searchstatement"]="eVar8"
elookup["downloadtype"]="eVar9";
elookup["downloadname"]="eVar10";
elookup["primaryproduct"]="eVar11";
elookup["subsection"]="eVar25";

editionToNameMap[""]="Edition_North_America_USA";
editionToNameMap["na,us"]="Edition_North_America_USA";
editionToNameMap["europe"]="Edition_Europe";
editionToNameMap["asia"]="Edition_Asia";
editionToNameMap["asia,india"]="Edition_Asia";

function setMetaData(param_name,param_value) {
  if(!lookup[param_name.toLowerCase()]){ return;}
  var cmd = "";
	if(param_value.indexOf('"') == -1){
		cmd='s.'+lookup[param_name.toLowerCase()]+'="'+param_value+'\"';
	}else{
		cmd='s.'+lookup[param_name.toLowerCase()]+'='+param_value;
	}
	eval(cmd);
}

function setEVar(param_name,param_value) {
  if(!elookup[param_name.toLowerCase()]){ return;}
  var cmd = 
's.'+elookup[param_name.toLowerCase()]+'='+param_value;
  eval(cmd);
}

/* SiteCatalyst code version: H.3.
Copyright 1997-2005 Omniture, Inc. More info available at
http://www.omniture.com */
/* Specify the Report Suite ID(s) to track here */
var s_account="djglobal,djwsj"
var env = document.location.host;
if (env.indexOf('qa') != -1 || env.indexOf('dev') != -1|| env.indexOf('reno') != -1) {
  s_account="dowjdev";
}
var s=s_gi(s_account)
/************************** CONFIG SECTION **************************/
/* You may add or alter any code config here. */
/* E-commerce Config */
s.currencyCode="USD"
/* Link Tracking Config */
s.trackDownloadLinks=true
s.trackExternalLinks=false
s.trackInlineStats=true
s.linkDownloadFileTypes="exe,zip,wav,mp3,mov,mpg,avi,wmv,doc,pdf,xls"
s.linkInternalFilters="javascript:,wsj.com,wallstreetjournal.com,bankrate.com,smartmoney.com,barrons.com,marketgauge.com,marketwatch.com,bigcharts.com,virtualstockexchange.com,hulbertinteractive.com,collegejournal.com,careercast.com,careerjournal.com,careerjournalasia.com,realestatejournal.com,loopnet.com,opinionjournal.com,politicaldiary.com,startupjournal.com,homefair.com,myplan.com,contacts.zoominfo.com,secure.theladders.com,selectrecruiters.com,kennedyinfo.com,allisontaylor.com,wsj.careerdev.org,wsj.resumeedge.com,newhomesource.com,blacksguide.com,rej.informars.com,wsj.miniplan.com,wsj.knowledgestorm.com,entrepreneur.com,toolkit.prnewswire.com,tsnn.com,autos.wsj.com"
s.linkLeaveQueryString=false
s.linkTrackVars="None"
s.linkTrackEvents="None"

/* WARNING: Changing the visitor namespace will cause drastic changes
to how your visitor data is collected.  Changes should only be made
when instructed to do so by your account manager.*/
s.visitorNamespace="dowjones"
s.trackingServer="om.dowjoneson.com"
s.trackingServerSecure="oms.dowjoneson.com"
s.vmk="44BD02B1"

/* Plugin Config */
s.usePlugins=true
function s_doPlugins(s) {
	/* Add calls to plugins here */
	s.campaign=s.getQueryParam('cid');
	s.prop49=s.getVisitNum();
}
s.doPlugins=s_doPlugins
/************************** PLUGINS SECTION *************************/
/* You may insert any plugins you wish to use here.                 */

/*
 * Plugin: getQueryParam 2.3
 */
s.getQueryParam=new Function("p","d","u",""
+"var s=this,v='',i,t;d=d?d:'';u=u?u:(s.pageURL?s.pageURL:s.wd.locati"
+"on);if(u=='f')u=s.gtfs().location;while(p){i=p.indexOf(',');i=i<0?p"
+".length:i;t=s.p_gpv(p.substring(0,i),u+'');if(t){t=t.indexOf('#')>-"
+"1?t.substring(0,t.indexOf('#')):t;}if(t)v+=v?d+t:t;p=p.substring(i="
+"=p.length?i:i+1)}return v");
s.p_gpv=new Function("k","u",""
+"var s=this,v='',i=u.indexOf('?'),q;if(k&&i>-1){q=u.substring(i+1);v"
+"=s.pt(q,'&','p_gvf',k)}return v");
s.p_gvf=new Function("t","k",""
+"if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'T"
+"rue':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return s."
+"epa(v)}return ''");
/*
 * Plugin: getPageName v2.0 - parse URL and return
 */
s.getPageName=new Function("u",""
+"var s=this,v=u?u:''+s.wd.location,x=v.indexOf(':'),y=v.indexOf('/',"
+"x+4),z=v.indexOf('?'),c=s.pathConcatDelim,e=s.pathExcludeDelim,g=s."
+"queryVarsList,d=s.siteID,n=d?d:'',q=z<0?'':v.substring(z+1),p=v.sub"
+"string(y+1,q?z:v.length);z=p.indexOf('#');p=z<0?p:s.fl(p,z);x=e?p.i"
+"ndexOf(e):-1;p=x<0?p:s.fl(p,x);p+=!p||p[p.length-1]=='/'?s.defaultP"
+"age:'';y=c?c:'/';while(p){x=p.indexOf('/');x=x<0?p.length:x;z=s.fl("
+"p,x);if(!s.pt(s.pathExcludeList,',','p_c',z))n+=n?y+z:z;p=p.substri"
+"ng(x+1)}y=c?c:'?';while(g){x=g.indexOf(',');x=x<0?g.length:x;z=s.fl"
+"(g,x);z=s.pt(q,'&','p_c',z);if(z){n+=n?y+z:z;y=c?c:'&'}g=g.substrin"
+"g(x+1)}return n");
/*                                                                  
 * Plugin: Visit Number By Month 2.0 - Return the user visit number 
 */
s.getVisitNum=new Function(""
+"var s=this,e=new Date(),cval,cvisit,ct=e.getTime(),c='s_vnum',c2='s"
+"_invisit';e.setTime(ct+30*24*60*60*1000);cval=s.c_r(c);if(cval){var"
+" i=cval.indexOf('&vn='),str=cval.substring(i+4,cval.length),k;}cvis"
+"it=s.c_r(c2);if(cvisit){if(str){e.setTime(ct+30*60*1000);s.c_w(c2,'"
+"true',e);return str;}else return 'unknown visit number';}else{if(st"
+"r){str++;k=cval.substring(0,i);e.setTime(k);s.c_w(c,k+'&vn='+str,e)"
+";e.setTime(ct+30*60*1000);s.c_w(c2,'true',e);return str;}else{s.c_w"
+"(c,ct+30*24*60*60*1000+'&vn=1',e);e.setTime(ct+30*60*1000);s.c_w(c2"
+",'true',e);return 1;}}"
);

/*
 * Plugin: Days Before Event 1.0.H - capture time before first event
 */
s.getDaysBeforeEvent=new Function(""
+"var s=this,e=new Date(),cval,pve,ct=e.getTime(),c='s_dbfe',pv='s_pv"
+"',day=24*60*60*1000;e.setTime(ct+3*365*day);cval=s.c_r(c);pve=s.c_r"
+"(pv);if(!pve){if(!cval){s.c_w(c,ct,e);return '';}else{var d"
+"=ct-cval;if(s.events.indexOf('event6') != -1){s.c_w(pv,ct,e);if(d>90*day){s.c_w(c"
+",ct,e);return"
+"'More than 90 Days';}if(d<90*day+1 && d>61*day){s.c_w(c,ct,e);return"
+"'61 - 90 Days';}if(d<60*day+1 && d>31*day){s.c_w(c,ct,e);return"
+"'31 - 60 Days';}if(d<30*day+1 && d>15*day){s.c_w(c,ct,e);return"
+"'15 - 30 Days';}if(d<14*day+1 && d>8*day){s.c_w(c,ct,e);return"
+"'8 - 14 Days';}if(d<7*day+1 && d>day){s.c_w(c,ct,e);return"
+"'2 - 7 Days';}if(d<day+1){s.c_w(c,ct,e);return 'Less than 1 D"
+"ay';}}else return '';}}"
);

/************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
var s_code='',s_objectID;function s_gi(un,pg,ss){var c="=fun`o(~.substring(~){`Ps=^O~.indexOf(~#2 ~;$2~`b$2~=new Fun`o(~.length~.toLowerCase()~`Ps#8c_#k^an+'],~=new Object~};s.~`YMigrationServer~.toU"
+"pperCase~){$2~','~s.wd~);s.~')q='~=new Array~ookieDomainPeriods~.location~^LingServer~dynamicAccount~var ~link~s.m_~=='~s.apv~BufferedRequests~Element~)$2x^b!Object#WObject.prototype#WObject.protot"
+"ype[x])~etTime~visitor~$w@c(~referrer~else ~s.pt(~s.maxDelay~}c#E(e){~#i+~=''~.lastIndexOf(~^wc_i~}$2~.protocol~=new Date~^wobjectID=s.ppu=$I=$Iv1=$Iv2=$Iv3~for(i=~ction~javaEnabled~onclick~Name~te"
+"rnalFilters~javascript~s.dl~@6s.b.addBehavior(\"# default# ~=parseFloat(~typeof(v)==\"~window~cookie~while(~s.vl_g~Type~;i#U{~tfs~s.un~&&s.~o^woid~browser~.parent~document~colorDepth~String~.host~s"
+".fl(~s.rep(~s.eo~'+tm@S~s.sq~parseInt(~t=s.ot(o)~track~nload~j='1.~this~#PURL~}else{~s.vl_l~lugins~'){q='~dynamicVariablePrefix~');~;for(~Sampling~s.rc[un]~Event~._i~&&(~loadModule~resolution~s.c_r"
+"(~s.c_w(~s.eh~s.isie~\"m_\"+n~Secure~Height~tcf~isopera~ismac~escape(~'s_~.href~screen.~s#8gi(~Version~harCode~variableProvider~.s_~)s_sv(v,n[k],i)}~')>=~){s.~)?'Y':'N'~u=m[t+1](~i)clearTimeout(~e&"
+"&l$bSESSION'~name~home#P~;try{~,$m)~s.ssl~s.oun~s.rl[u~Width~o.type~s.vl_t~=s.sp(~Lifetime~s.gg('objectID~sEnabled~'+n+'~.mrq(@wun+'\"~ExternalLinks~charSet~lnk~onerror~http~currencyCode~.src~disab"
+"le~.get~MigrationKey~(''+~&&!~f',~){t=~r=s[f](~u=m[t](~Opera~Math.~s.ape~s.fsg~s.ns6~conne~InlineStats~&&l$bNONE'~Track~'0123456789~true~+\"_c\"]~s.epa(~t.m_nl~s.va_t~m._d~n=s.oid(o)~,'sqs',q);~Lea"
+"veQuery~?'&~'=')~n){~\"'+~){n=~'_'+~'+n;~\",''),~,255)}~if(~vo)~s.sampled~=s.oh(o);~+(y<1900?~n]=~1);~&&o~:'';h=h?h~;'+(n?'o.~sess~campaign~lif~ in ~s.co(~ffset~s.pe~m._l~s.c_d~s.brl~s.nrs~s[mn]~,'"
+"vo~s.pl~=(apn~space~\"s_gs(\")~vo._t~b.attach~2o7.net'~Listener~Year(~d.create~=s.n.app~)}}}~!='~'||t~)+'/~s()+'~){p=~():''~a['!'+t]~&&c){~://')i+=~){v=s.n.~channel~100~rs,~.target~o.value~s_si(t)~"
+"')dc='1~\".tl(\")~etscape~s_')t=t~omePage~='+~&&t~[b](e);~\"){n[k]~';s.va_~a+1,b):~return~mobile~height~events~random~code~=s_~=un~,pev~'MSIE ~'fun~floor(~atch~transa~s.num(~m._e~s.c_gd~,'lt~tm.g~."
+"inner~;s.gl(~,f1,f2~',s.bc~page~Group,~.fromC~sByTag~')<~++)~)){~||!~+';'~i);~y+=~l&&~''+x~[t]=~[i]=~[n];~' '+~'+v]~>=5)~:'')~+1))~il['+s~!a[t])~~s._c=^pc';`H=`y`5!`H`i@v`H`il`K;`H`in=0;}s^al=`H`il"
+";s^an=`H`in;s^al[s^a$7s;`H`in++;s.an#8an;s.cls`0x,c){`Pi,y`g`5!c)c=^O.an;`n0;i<x`8^3n=x`1i,i+1)`5c`3n)>=0)#Zn}`4y`Cfl`0x,l){`4x?@Ux)`10,l):x`Cco`0o`F!o)`4o;`Pn`B,x^Wx$Fo)$2x`3'select#T0&&x`3'filter"
+"#T0)n[x]=o[x];`4n`Cnum`0x){x`g+x^W`Pp=0;p<x`8;p#U$2(@j')`3x`1p,p#j<0)`40;`41`Crep#8rep;s.sp#8sp;s.jn#8jn;@c`0x`2,h=@jABCDEF',i,c=s.@L,n,l,e,y`g;c=c?c`E$g`5x){x`g+x`5c`SAUTO'^b'').c^uAt){`n0;i<x`8^3"
+"c=x`1i,i+$8n=x.c^uAt(i)`5n>127){l=0;e`g;^0n||l<4){e=h`1n%16,n%16+1)+e;n=(n-n%16)/16;l++}#Z'%u'+e}`6c`S+')#Z'%2B';`b#Z^oc)}x=y^Qx=x?^F^o#b),'+`G%2B'):x`5x&&c^6em==1&&x`3'%u#T0&&x`3'%U#T0){i=x`3'%^V^"
+"0i>=0){i++`5h`18)`3x`1i,i+1)`E())>=0)`4x`10,i)+'u00'+x`1#Yi=x`3'%',i$a}`4x`Cepa`0x`2;`4x?un^o^F#b,'+`G ')):x`Cpt`0x,d,f,a`2,t=x,z=0,y,r;^0t){y=t`3d);y=y<0?t`8:y;t=t`10,y);@Yt,a)`5r)`4r;z+=y+d`8;t=x"
+"`1z,x`8);t=z<x`8?t:''}`4''`Cisf`0t,a){`Pc=a`3':')`5c>=0)a=a`10,c)`5t`10,2)`S$u`12);`4(t!`g$x==a)`Cfsf`0t,a`2`5`ca,`G,'is@Wt))@d+=(@d!`g?`G`ft;`40`Cfs`0x,f`2;@d`g;`cx,`G,'fs@Wf);`4@d`Csi`0wd`2,c`g+s"
+"_gi,a=c`3\"{\"),b=c`h\"}\"),m;c#8fe(a>0&&b>0?c`1#10)`5wd&&wd.^A$iwd.s`Xout(#C`o s_sv(o,n,k){`Pv=o[k],i`5v`F`xstring\"||`xnumber\")n[k]=v;`bif (`xarray$z`K;`n0;i<v`8;i++^x`bif (`xobject$z`B^Wi$Fv^x}"
+"}fun`o $q{`Pwd=`y,s,i,j,c,a,b;wd^wgi`7\"un\",\"pg\",\"ss\",@wc+'\");wd.^s@w@9+'\");s=wd.s;s.sa(@w^5+'\"`I^4=wd;`c^1,\",\",\"vo1\",t`I@M=^G=s.`Q`r=s.`Q^2=`H`m=\\'\\'`5t.m_#a@n)`n0;i<@n`8^3n=@n[i]`5@"
+"vm=t#ec=t[^i]`5m$ic=\"\"+c`5c`3\"fun`o\")>=0){a=c`3\"{\");b=c`h\"}\");c=a>0&&b>0?c`1#10;s[^i@l=c`5#H)s.^c(n)`5s[n])for(j=0;j<$J`8;j#Us_sv(m,s[n],$J[j]$a}}`Pe,o,t@6o=`y.opener`5o$9^wgi@Xo^wgi(@w^5+'"
+"\")`5t)$q}`e}',1)}`Cc_d`g;#If`0t,a`2`5!#Gt))`41;`40`Cc_gd`0`2,d=`H`M^D@4,n=s.fpC`L,p`5!n)n=s.c`L`5d@V$K@xn?^Jn):2;n=n>2?n:2;p=d`h'.')`5p>=0){^0p>=0&&n>1$fd`h'.',p-$8n--}$K=p>0&&`cd,'.`Gc_gd@W0)?d`1"
+"p):d}}`4$K`Cc_r`0k`2;k=@c(k);`Pc=#fs.d.`z,i=c`3#fk+@u,e=i<0?i:c`3';',i),v=i<0?'':@mc`1i+2+k`8,e<0?c`8:e));`4v$b[[B]]'?v:''`Cc_w`0k,v,e`2,d=#I(),l=s.`z@F,t;v`g+v;l=l?@Ul)`E$g`5@3@h@X(v!`g?^Jl?l:0):-"
+"60)`5t){e`l;e.s`X(e.g`X()+(t*$m0))}`jk@h^zd.`z=k+'`Zv!`g?v:'[[B]]')+'; path=/;'+(@3?' expires$we.toGMT^C()#X`f(d?' domain$wd#X:'^V`4^ek)==v}`40`Ceh`0o,e,r,f`2,b=^p'+e+@ys^an,n=-1,l,i,x`5!^gl)^gl`K;"
+"l=^gl;`n0;i<l`8&&n<0;i++`Fl[i].o==o&&l[i].e==e)n=i`jn<0@xi;l[n]`B}x=l#ex.o=o;x.e=e;f=r?x.b:f`5r||f){x.b=r?0:o[e];x.o[e]=f`jx.b){x.o[b]=x.b;`4b}`40`Ccet`0f,a,t,o,b`2,r,^l`5`T>=5^b!s.^m||`T>=7#V^l`7'"
+"s`Gf`Ga`Gt`G`Pe,r@6@Ya)`er=s[t](e)}`4r^Vr=^l(s,f,a,t)^Q$2s.^n^6u`3#B4^y0)r=s[b](a);else{^g(`H,'@N',0,o);@Ya`Ieh(`H,'@N',1)}}`4r`Cg^4et`0e`2;`4s.^4`Cg^4oe`7'e`G`Ac;^g(`y,\"@N\",1`Ie^4=1;c=s.t()`5c)s"
+".d.write(c`Ie^4=0;`4@k'`Ig^4fb`0a){`4`y`Cg^4f`0w`2,p=w^9,l=w`M;s.^4=w`5p&&p`M!=#ap`M^D==l^D^z^4=p;`4s.g^4f(s.^4)}`4s.^4`Cg^4`0`2`5!s.^4^z^4=`H`5!s.e^4)s.^4=s.cet('g^4@Ws.^4,'g^4et',s.g^4oe,'g^4fb')"
+"}`4s.^4`Cmrq`0u`2,l=@A],n,r;@A]=0`5l)for(n=0;n<l`8;n#U{r=l#es.mr(0,0,r.r,0,r.t,r.u)}`Cbr`0id,rs`2`5s.@R`U#W^f^pbr',rs))$L=rs`Cflush`U`0){^O.fbr(0)`Cfbr`0id`2,br=^e^pbr')`5!br)br=$L`5br`F!s.@R`U)^f^"
+"pbr`G'`Imr(0,0,br)}$L=0`Cmr`0$C,q,$nid,ta,u`2,dc=s.dc,t1=s.`N,t2=s.`N^j,tb=s.`NBase,p='.sc',ns=s.`Y`r$R,un=s.cls(u?u:(ns?ns:s.fun)),r`B,l,imn=^pi_'+(un),im,b,e`5!rs`Ft1`Ft2^6ssl)t1=t2^Q$2!tb)tb='$V"
+"`5dc)dc=@Udc)`9;`bdc='d1'`5tb`S$V`Fdc`Sd1$r12';`6dc`Sd2$r22';p`g}t1#9+'.'+dc+'.'+p+tb}rs='@O'+(@8?'s'`f'://'+t1+'/b/ss/'+^5+'/'+(s.#3?'5.1':'1'$dH.20.3/'+$C+'?AQB=1&ndh=1'+(q?q`f'&AQE=1'`5^h@Vs.^n`"
+"F`T>5.5)rs=^E$n4095);`brs=^E$n2047)`jid^zbr(id,rs);#2}`js.d.images&&`T>=3^b!s.^m||`T>=7)^b@e<0||`T>=6.1)`F!s.rc)s.rc`B`5!^Y){^Y=1`5!s.rl)s.rl`B;@An]`K;s`Xout('$2`y`il)`y`il['+s^an+']@J)',750)^Ql=@A"
+"n]`5l){r.t=ta;r.u#9;r.r=rs;l[l`8]=r;`4''}imn+=@y^Y;^Y++}im=`H[imn]`5!im)im=`H[im$7new Image;im^wl=0;im.o^M`7'e`G^O^wl=1;`Pwd=`y,s`5wd`il){s=wd`il['+s^an+'];s@J`Inrs--`5!$M)`Rm(\"rr\")}')`5!$M^znrs="
+"1;`Rm('rs')}`b$M++;im@Q=rs`5rs`3'&pe=^y0^b!ta||ta`S_self$ca`S_top'||(`H.@4$xa==`H.@4)#Vb=e`l;^0!im^w#ae.g`X()-b.g`X()<500)e`l}`4''}`4'<im'+'g sr'+'c=@wrs+'\" width=1 #4=1 border=0 alt=\"\">'`Cgg`0v"
+"`2`5!`H[^p#g)`H[^p#g`g;`4`H[^p#g`Cglf`0t,a`Ft`10,2)`S$u`12);`Ps=^O,v=s.gg(t)`5v)s#cv`Cgl`0v`2`5s.pg)`cv,`G,'gl@W0)`Crf`0x`2,y,i,j,h,l,a,b`g,c`g,t`5x){y`g+x;i=y`3'?')`5i>0){a=y`1i+$8y=y`10,#Yh=y`9;i"
+"=0`5h`10,7)`S@O$j7;`6h`10,8)`S@Os$j8;h=h`1#Yi=h`3\"/\")`5i>0){h=h`10,i)`5h`3'google^y0){a@Ea,'&')`5a`8>1){l=',q,ie,start,search_key,word,kw,cd,'^Wj=0;j<a`8;j++@Xa[j];i=t`3@u`5i>0&&l`3`G+t`10,i)+`G)"
+">=0)b+=(b@t'`ft;`bc+=(c@t'`ft`jb$i#Z'?'+b+'&'+c`5#b!=y)x=y}}}}}}`4x`Chav`0`2,qs`g,fv=s.`Q@iVa$nfe=s.`Q@i^Zs,mn,i`5$I){mn=$I`10,1)`E()+$I`11)`5$N){fv=$N.^LVars;fe=$N.^L^Zs}}fv=fv?fv+`G+^R+`G+^R2:'';"
+"`n0;i<@o`8^3`Pk=@o[i],v=s[k],b=k`10,4),x=k`14),n=^Jx),q=k`5v&&k$b`Q`r'&&k$b`Q^2'`F$I||s.@M||^G`Ffv^b`G+fv+`G)`3`G+k+`G)<0)v`g`5k`S#5'&&fe)v=s.fs(v,fe)`jv`Fk`S^U`JD';`6k`S`YID`Jvid';`6k`S^P^Tg';v=^E"
+"v$1`6k`S`a^Tr';v=^Es.rf(v)$1`6k`Svmk'||k`S`Y@T`Jvmt';`6k`S`D^Tvmf'`5@8^6`D^j)v`g}`6k`S`D^j^Tvmf'`5!@8^6`D)v`g}`6k`S@L^Tce'`5v`E()`SAUTO')v='ISO8859-1';`6s.em==2)v='UTF-8'}`6k`S`Y`r$R`Jns';`6k`Sc`L`"
+"Jcdp';`6k`S`z@F`Jcl';`6k`S^v`Jvvp';`6k`S@P`Jcc';`6k`S$l`Jch';`6k`S#F`oID`Jxact';`6k`S$D`Jv0';`6k`S^d`Js';`6k`S^B`Jc';`6k`S`t^t`Jj';`6k`S`p`Jv';`6k`S`z@H`Jk';`6k`S^8@B`Jbw';`6k`S^8^k`Jbh';`6k`S@f`o^"
+"2`Jct';`6k`S@5`Jhp';`6k`Sp^S`Jp';`6#Gx)`Fb`Sprop`Jc@z`6b`SeVar`Jv@z`6b`Slist`Jl@z`6b`Shier^Th@zv=^Ev$1`jv)qs+='&'+q+'$w(k`10,3)$bpev'?@c(v):v$a`4qs`Cltdf`0t,h@Xt?t`9$A`9:'';`Pqi=h`3'?^Vh=qi>=0?h`10"
+",qi):h`5t&&h`1h`8-(t`8#j`S.'+t)`41;`40`Cltef`0t,h@Xt?t`9$A`9:''`5t&&h`3t)>=0)`41;`40`Clt`0h`2,lft=s.`QDow^MFile^2s,lef=s.`QEx`s,$E=s.`QIn`s;$E=$E?$E:`H`M^D@4;h=h`9`5s.^LDow^MLinks&&lft&&`clft,`G#Jd"
+"@Wh))`4'd'`5s.^L@K&&h`10,1)$b# '^blef||$E)^b!lef||`clef,`G#Je@Wh))^b!$E#W`c$E,`G#Je@Wh)))`4'e';`4''`Clc`7'e`G`Ab=^g(^O,\"`q\"`I@M=$G^O`It(`I@M=0`5b)`4^O$y`4@k'`Ibc`7'e`G`Af,^l`5s.d^6d.all^6d.all.cp"
+"pXYctnr)#2;^G=e@Q`V?e@Q`V:e$o;^l`7\"s\",\"`Pe@6$2^G^b^G.tag`r||^G^9`V||^G^9Node))s.t()`e}\");^l(s`Ieo=0'`Ioh`0o`2,l=`H`M,h=o^q?o^q:'',i,j,k,p;i=h`3':^Vj=h`3'?^Vk=h`3'/')`5h^bi<0||(j>=0&&i>j)||(k>=0"
+"&&i>k))$fo`k$9`k`8>1?o`k:(l`k?l`k:'^Vi=l.path@4`h'/^Vh=(p?p+'//'`f(o^D?o^D:(l^D?l^D#i)+(h`10,1)$b/'?l.path@4`10,i<0?0:i$d'`fh}`4h`Cot`0o){`Pt=o.tag`r;t=t$x`E?t`E$g`5t`SSHAPE')t`g`5t`Ft`SINPUT'&&@C&"
+"&@C`E)t=@C`E();`6!t$9^q)t='A';}`4t`Coid`0o`2,^K,p,c,n`g,x=0`5t@V^7$fo`k;c=o.`q`5o^q^bt`SA$c`SAREA')^b!c#Wp||p`9`3'`t#T0))n$5`6c@x^Fs.rep(^Fs.rep@Uc,\"\\r$0\"\\n$0\"\\t$0' `G^Vx=2}`6$p^bt`SINPUT$c`S"
+"SUBMIT')@x$p;x=3}`6o@Q$x`SIMAGE')n=o@Q`5@v^7=^En@7;^7t=x}}`4^7`Crqf`0t,un`2,e=t`3@u,u=e>=0?`G+t`10,e)+`G:'';`4u&&u`3`G+un+`G)>=0?@mt`1e#j:''`Crq`0un`2,c#9`3`G),v=^e^psq'),q`g`5c<0)`4`cv,'&`Grq@Wun)"
+";`4`cun,`G,'rq',0)`Csqp`0t,a`2,e=t`3@u,q=e<0?'':@mt`1e+1)`Isqq[q]`g`5e>=0)`ct`10,e),`G@r`40`Csqs`0un,q`2;^Iu[u$7q;`40`Csq`0q`2,k=^psq',v=^ek),x,c=0;^Iq`B;^Iu`B;^Iq[q]`g;`cv,'&`Gsqp',0`Ipt(^5,`G@rv`"
+"g^Wx$F^Iu`W)^Iq[^Iu[x]]+=(^Iq[^Iu[x]]?`G`fx^Wx$F^Iq`W^6sqq[x]^bx==q||c<2#Vv+=(v@t'`f^Iq[x]+'`Zx);c++}`4^fk,v,0)`Cwdl`7'e`G`Ar=@k,b=^g(`H,\"o^M\"),i,o,oc`5b)r=^O$y`n0;i<s.d.`Qs`8^3o=s.d.`Qs[i];oc=o."
+"`q?\"\"+o.`q:\"\"`5(oc`3$S<0||oc`3\"^woc(\")>=0)$9c`3$s<0)^g(o,\"`q\",0,s.lc);}`4r^V`Hs`0`2`5`T>3^b!^h#Ws.^n||`T#h`Fs.b^6$U^Z)s.$U^Z('`q#O);`6s.b^6b.add^Z$W)s.b.add^Z$W('click#O,false);`b^g(`H,'o^M"
+"',0,`Hl)}`Cvs`0x`2,v=s.`Y^X,g=s.`Y^X#Qk=^pvsn_'+^5+(g?@yg#i,n=^ek),e`l,y=e@S$X);e.set$Xy+10$61900:0))`5v){v*=$m`5!n`F!^fk,x,e))`40;n=x`jn%$m00>v)`40}`41`Cdyasmf`0t,m`Ft&&m&&m`3t)>=0)`41;`40`Cdyasf`"
+"0t,m`2,i=t?t`3@u:-1,n,x`5i>=0&&m){`Pn=t`10,i),x=t`1i+1)`5`cx,`G,'dyasm@Wm))`4n}`40`Cuns`0`2,x=s.`OSele`o,l=s.`OList,m=s.`OM#E,n,i;^5=^5`9`5x&&l`F!m)m=`H`M^D`5!m.toLowerCase)m`g+m;l=l`9;m=m`9;n=`cl,"
+"';`Gdyas@Wm)`5n)^5=n}i=^5`3`G`Ifun=i<0?^5:^5`10,i)`Csa`0un`2;^5#9`5!@9)@9#9;`6(`G+@9+`G)`3`G+un+`G)<0)@9+=`G+un;^5s()`Cm_i`0n,a`2,m,f=n`10,1),r,l,i`5!`Rl)`Rl`B`5!`Rnl)`Rnl`K;m=`Rl[n]`5!a&&m&&#H@Vm^"
+"a)`Ra(n)`5!m){m`B,m._c=^pm';m^an=`H`in;m^al=s^al;m^al[m^a$7m;`H`in++;m.s=s;m._n=n;$J`K('_c`G_in`G_il`G_i`G_e`G_d`G_dl`Gs`Gn`G_r`G_g`G_g1`G_t`G_t1`G_x`G_x1`G_rs`G_rr`G_l'`Im_l[$7m;`Rnl[`Rnl`8]=n}`6m"
+"._r@Vm._m){r=m._r;r._m=m;l=$J;`n0;i<l`8;i#U$2m[l[i]])r[l[i]]=m[l[i]];r^al[r^a$7r;m=`Rl[$7r`jf==f`E())s[$7m;`4m`Cm_a`7'n`Gg`Ge`G$2!g)g=^i;`Ac=s[g@l,m,x,f=0`5!c)c=`H[\"s_\"+g@l`5c&&s_d)s[g]`7\"s\",s_"
+"ft(s_d(c)));x=s[g]`5!x)x=`H[\\'s_\\'+g]`5!x)x=`H[g];m=`Ri(n,1)`5x^b!m^a||g!=^i#Vm^a=f=1`5(\"\"+x)`3\"fun`o\")>=0)x(s);`b`Rm(\"x\",n,x,e)}m=`Ri(n,1)`5@pl)@pl=@p=0;`ut();`4f'`Im_m`0t,n,d,e@X@yt;`Ps=^"
+"O,i,x,m,f=@yt,r=0,u`5`R#a`Rnl)`n0;i<`Rnl`8^3x=`Rnl[i]`5!n||x==@vm=`Ri(x);u=m[t]`5u`F@Uu)`3#C`o^y0`Fd&&e)@Zd,e);`6d)@Zd);`b@Z)}`ju)r=1;u=m[t+1]`5u@Vm[f]`F@Uu)`3#C`o^y0`Fd&&e)@1d,e);`6d)@1d);`b@1)}}m"
+"[f]=1`5u)r=1}}`4r`Cm_ll`0`2,g=`Rdl,i,o`5g)`n0;i<g`8^3o=g[i]`5o)s.^c(o.n,o.u,o.d,o.l,o.e,$8g#d0}`C^c`0n,u,d,l,e,ln`2,m=0,i,g,o=0#N,c=s.h?s.h:s.b,b,^l`5@vi=n`3':')`5i>=0){g=n`1i+$8n=n`10,i)}`bg=^i;m="
+"`Ri(n)`j(l||(n@V`Ra(n,g)))&&u^6d&&c^6$Y`V`Fd){@p=1;@pl=1`jln`F@8)u=^Fu,'@O:`G@Os:^Vi=^ps:'+s^an+':@I:'+g;b='`Ao=s.d@S`VById(@wi+'\")`5s$9`F!o.#a`H.'+g+'){o.l=1`5o.@2o.#Yo.i=0;`Ra(\"@I\",@wg+'@w(e?'"
+",@we+'\"'`f')}';f2=b+'o.c++`5!`d)`d=250`5!o.l$9.c<(`d*2)/$m)o.i=s`Xout(o.f2@7}';f1`7'e',b+'}^V^l`7's`Gc`Gi`Gu`Gf1`Gf2`G`Pe,o=0@6o=s.$Y`V(\"script\")`5o){@C=\"text/`t\"$Bid=i;o.defer=@k;o.o^M=o.onre"
+"adystatechange=f1;o.f2=f2;o.l=0;'`f'o@Q=u;c.appendChild(o)$Bc=0;o.i=s`Xout(f2@7'`f'}`eo=0}`4o^Vo=^l(s,c,i,u#N)^Qo`B;o.n=n+':'+g;o.u=u;o.d=d;o.l=l;o.e=e;g=`Rdl`5!g)g=`Rdl`K;i=0;^0i<g`8&&g[i])i++;g#d"
+"o}}`6@vm=`Ri(n);#H=1}`4m`Cvo1`0t,a`Fa[t]||$h)^O#ca[t]`Cvo2`0t,a`F#l{a#c^O[t]`5#l$h=1}`Cdlt`7'`Ad`l,i,vo,f=0`5`ul)`n0;i<`ul`8^3vo=`ul[i]`5vo`F!`Rm(\"d\")||d.g`X()-$T>=`d){`ul#d0;s.t($3}`bf=1}`j`u@2`"
+"ui`Idli=0`5f`F!`ui)`ui=s`Xout(`ut,`d)}`b`ul=0'`Idl`0vo`2,d`l`5!$3vo`B;`c^1,`G$O2',$3;$T=d.g`X()`5!`ul)`ul`K;`ul[`ul`8]=vo`5!`d)`d=250;`ut()`Ct`0vo,id`2,trk=1,tm`l,sed=Math&&@b#6?@b#D@b#6()*$m000000"
+"00000):#K`X(),$C='s'+@b#D#K`X()/10800000)%10+sed,y=tm@S$X),vt=tm@SDate($d^HMonth($d'$6y+1900:y)+' ^HHour$e:^HMinute$e:^HSecond$e ^HDay()+#f#K`XzoneO$H(),^l,^4=s.g^4(),ta`g,q`g,qs`g,#7`g,vb`B#M^1`Iu"
+"ns(`Im_ll()`5!s.td){`Ptl=^4`M,a,o,i,x`g,c`g,v`g,p`g,bw`g,bh`g,^N0',k=^f^pcc`G@k',0@0,hp`g,ct`g,pn=0,ps`5^C&&^C.prototype){^N1'`5j.m#E){^N2'`5tm.setUTCDate){^N3'`5^h^6^n&&`T#h^N4'`5pn.toPrecisio@v^N"
+"5';a`K`5a.forEach){^N6';i=0;o`B;^l`7'o`G`Pe,i=0@6i=new Iterator(o)`e}`4i^Vi=^l(o)`5i&&i.next)^N7'}}}}`j`T>=4)x=^rwidth+'x'+^r#4`5s.isns||s.^m`F`T>=3$k`p(@0`5`T>=4){c=^rpixelDepth;bw=`H#L@B;bh=`H#L^"
+"k}}$P=s.n.p^S}`6^h`F`T>=4$k`p(@0;c=^r^B`5`T#h{bw=s.d.^A`V.o$H@B;bh=s.d.^A`V.o$H^k`5!s.^n^6b){^l`7's`Gtl`G`Pe,hp=0`vh$v\");hp=s.b.isH$v(tl)?\"Y\":\"N\"`e}`4hp^Vhp=^l(s,tl);^l`7's`G`Pe,ct=0`vclientCa"
+"ps\");ct=s.b.@f`o^2`e}`4ct^Vct=^l(s$a`br`g`j$P)^0pn<$P`8&&pn<30){ps=^E$P[pn].@4@7#X`5p`3ps)<0)p+=ps;pn++}s.^d=x;s.^B=c;s.`t^t=j;s.`p=v;s.`z@H=k;s.^8@B=bw;s.^8^k=bh;s.@f`o^2=ct;s.@5=hp;s.p^S=p;s.td="
+"1`j$3{`c^1,`G$O2',vb`Ipt(^1,`G$O1',$3`js.useP^S)s.doP^S(s);`Pl=`H`M,r=^4.^A.`a`5!s.^P)s.^P=l^q?l^q:l`5!s.`a@Vs._1_`a^z`a=r;s._1_`a=1`j(vo&&$T)#W`Rm('d'#V`Rm('g')`5s.@M||^G){`Po=^G?^G:s.@M`5!o)`4'';"
+"`Pp=s.#P`r,w=1,^K,@q,x=^7t,h,l,i,oc`5^G$9==^G){^0o@Vn$x$bBODY'){o=o^9`V?o^9`V:o^9Node`5!o)`4'';^K;@q;x=^7t}oc=o.`q?''+o.`q:''`5(oc`3$S>=0$9c`3\"^woc(\")<0)||oc`3$s>=0)`4''}ta=n?o$o:1;h$5i=h`3'?^Vh="
+"s.`Q@s^C||i<0?h:h`10,#Yl=s.`Q`r;t=s.`Q^2?s.`Q^2`9:s.lt(h)`5t^bh||l))q+='&pe=@M_'+(t`Sd$c`Se'?@c(t):'o')+(h@tpev1`Zh)`f(l@tpev2`Zl):'^V`btrk=0`5s.^L@g`F!p$fs.^P;w=0}^K;i=o.sourceIndex`5@G')@x@G^Vx=1"
+";i=1`jp&&n$x)qs='&pid`Z^Ep,255))+(w@tpidt$ww`f'&oid`Z^En@7)+(x@toidt$wx`f'&ot`Zt)+(i@toi$wi#i}`j!trk@Vqs)`4'';$4=s.vs(sed)`5trk`F$4)#7=s.mr($C,(vt@tt`Zvt)`fs.hav()+q+(qs?qs:s.rq(^5)),0,id,ta);qs`g;"
+"`Rm('t')`5s.p_r)s.p_r(`I`a`g}^I(qs);^Q`u($3;`j$3`c^1,`G$O1',vb`I@M=^G=s.`Q`r=s.`Q^2=`H`m`g`5s.pg)`H^w@M=`H^weo=`H^w`Q`r=`H^w`Q^2`g`5!id@Vs.tc^ztc=1;s.flush`U()}`4#7`Ctl`0o,t,n,vo`2;s.@M=$Go`I`Q^2=t"
+";s.`Q`r=n;s.t($3}`5pg){`H^wco`0o){`P^s\"_\",1,$8`4$Go)`Cwd^wgs`0u@v`P^sun,1,$8`4s.t()`Cwd^wdc`0u@v`P^sun,$8`4s.t()}}@8=(`H`M`k`9`3'@Os^y0`Id=^A;s.b=s.d.body`5s.d@S`V#S`r^zh=s.d@S`V#S`r('HEAD')`5s.h"
+")s.h=s.h[0]}s.n=navigator;s.u=s.n.userAgent;@e=s.u`3'N$t6/^V`Papn$Z`r,v$Z^t,ie=v`3#B'),o=s.u`3'@a '),i`5v`3'@a^y0||o>0)apn='@a';^h$Q`SMicrosoft Internet Explorer'`Iisns$Q`SN$t'`I^m$Q`S@a'`I^n=(s.u`"
+"3'Mac^y0)`5o>0)`T`ws.u`1o+6));`6ie>0){`T=^Ji=v`1ie+5))`5`T>3)`T`wi)}`6@e>0)`T`ws.u`1@e+10));`b`T`wv`Iem=0`5^C#R^u){i=^o^C#R^u(256))`E(`Iem=(i`S%C4%80'?2:(i`S%U0$m'?1:0))}s.sa(un`Ivl_l='^U,`YID,vmk,"
+"`Y@T,`D,`D^j,ppu,@L,`Y`r$R,c`L,`z@F,#P`r,^P,`a,@P#0l@E^R,`G`Ivl_t=^R+',^v,$l,server,#P^2,#F`oID,purchaseID,$D,state,zip,#5,products,`Q`r,`Q^2'^W`Pn=1;n<51;n#U@D+=',prop@I,eVar@I,hier@I,list@z^R2=',"
+"tnt,pe#A1#A2#A3,^d,^B,`t^t,`p,`z@H,^8@B,^8^k,@f`o^2,@5,p^S';@D+=^R2;@o@E@D,`G`Ivl_g=@D+',`N,`N^j,`NBase,fpC`L,@R`U,#3,`Y^X,`Y^X#Q`OSele`o,`OList,`OM#E,^LDow^MLinks,^L@K,^L@g,`Q@s^C,`QDow^MFile^2s,`"
+"QEx`s,`QIn`s,`Q@iVa$n`Q@i^Zs,`Q`rs,@M,eo,_1_`a#0g@E^1,`G`Ipg=pg#M^1)`5!ss)`Hs()",
w=window,l=w.s_c_il,n=navigator,u=n.userAgent,v=n.appVersion,e=v.indexOf('MSIE '),m=u.indexOf('Netscape6/'),a,i,s;if(un){un=un.toLowerCase();if(l)for(i=0;i<l.length;i++){s=l[i];if(!s._c||s._c=='s_c'){if(s.oun==un)return s;else if(s.fs&&s.sa&&s.fs(s.oun,un)){s.sa(un);return s}}}}w.s_an='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
w.s_sp=new Function("x","d","var a=new Array,i=0,j;if(x){if(x.split)a=x.split(d);else if(!d)for(i=0;i<x.length;i++)a[a.length]=x.substring(i,i+1);else while(i>=0){j=x.indexOf(d,i);a[a.length]=x.subst"
+"ring(i,j<0?x.length:j);i=j;if(i>=0)i+=d.length}}return a");
w.s_jn=new Function("a","d","var x='',i,j=a.length;if(a&&j>0){x=a[0];if(j>1){if(a.join)x=a.join(d);else for(i=1;i<j;i++)x+=d+a[i]}}return x");
w.s_rep=new Function("x","o","n","return s_jn(s_sp(x,o),n)");
w.s_d=new Function("x","var t='`^@$#',l=s_an,l2=new Object,x2,d,b=0,k,i=x.lastIndexOf('~~'),j,v,w;if(i>0){d=x.substring(0,i);x=x.substring(i+2);l=s_sp(l,'');for(i=0;i<62;i++)l2[l[i]]=i;t=s_sp(t,'');d"
+"=s_sp(d,'~');i=0;while(i<5){v=0;if(x.indexOf(t[i])>=0) {x2=s_sp(x,t[i]);for(j=1;j<x2.length;j++){k=x2[j].substring(0,1);w=t[i]+k;if(k!=' '){v=1;w=d[b+l2[k]]}x2[j]=w+x2[j].substring(1)}}if(v)x=s_jn("
+"x2,'');else{w=t[i]+' ';if(x.indexOf(w)>=0)x=s_rep(x,w,t[i]);i++;b+=62}}}return x");
w.s_fe=new Function("c","return s_rep(s_rep(s_rep(c,'\\\\','\\\\\\\\'),'\"','\\\\\"'),\"\\n\",\"\\\\n\")");
w.s_fa=new Function("f","var s=f.indexOf('(')+1,e=f.indexOf(')'),a='',c;while(s>=0&&s<e){c=f.substring(s,s+1);if(c==',')a+='\",\"';else if((\"\\n\\r\\t \").indexOf(c)<0)a+=c;s++}return a?'\"'+a+'\"':"
+"a");
w.s_ft=new Function("c","c+='';var s,e,o,a,d,q,f,h,x;s=c.indexOf('=function(');while(s>=0){s++;d=1;q='';x=0;f=c.substring(s);a=s_fa(f);e=o=c.indexOf('{',s);e++;while(d>0){h=c.substring(e,e+1);if(q){i"
+"f(h==q&&!x)q='';if(h=='\\\\')x=x?0:1;else x=0}else{if(h=='\"'||h==\"'\")q=h;if(h=='{')d++;if(h=='}')d--}if(d>0)e++}c=c.substring(0,s)+'new Function('+(a?a+',':'')+'\"'+s_fe(c.substring(o+1,e))+'\")"
+"'+c.substring(e+1);s=c.indexOf('=function(')}return c;");
c=s_d(c);if(e>0){a=parseInt(i=v.substring(e+5));if(a>3)a=parseFloat(i)}else if(m>0)a=parseFloat(u.substring(m+10));else a=parseFloat(v);if(a>=5&&v.indexOf('Opera')<0&&u.indexOf('Opera')<0){w.s_c=new Function("un","pg","ss","var s=this;"+c);return new s_c(un,pg,ss)}else s=new Function("un","pg","ss","var s=new Object;"+s_ft(c)+";return s");return s(un,pg,ss)}
if (typeof dj == "undefined") { dj = {}; }
if (typeof dj.context == "undefined") { dj.context = {}; }

/**
 * NOTE TO DEVELOPER:
 * 
 * This file is specific to the PROD environment. 
 * Please follow the following rules for editing this file:
 *  1. Do not move it to other environments.
 *  2. Do not edit it directly from MST. All changes are to be 
 *     performed and committed to the CVS repository first
 *     (module: 'djscript', path: 'src/main/javascript/dj/context/Context.prod.js')
 *     and only then deployed to the environment.
 *  3. Do comment every new property thoroughly. 
 */

(function() {
  var ctx = dj.context;
  
  /**
   * The 'core' object contains the properties 
   * global to a particular environment.
   */
  ctx.core = (ctx.core || {});
  // URL prefix; for dynamic content
  ctx.core.urlPrefix = "http://online.wsj.com/";
  // CDN prefix; for static content
  ctx.core.cdnPrefix = "http://s.wsj.net/";
  
  /**
   * VideoCenter widget properties.
   */
  ctx.videoCenter = (ctx.videoCenter || {});
  // Hostname of the video
  ctx.videoCenter.host = "video.wsj.com";
  
  /**
   * Dashboard properties.
   */
  ctx.dashboard = (ctx.dashboard || {});
  

}());//prototype.js
var Prototype={Version:'1.6.0.2',Browser:{IE:!!(window.attachEvent&&!window.opera),Opera:!!window.opera,WebKit:navigator.userAgent.indexOf('AppleWebKit/')>-1,Gecko:navigator.userAgent.indexOf('Gecko')>-1&&navigator.userAgent.indexOf('KHTML')==-1,MobileSafari:!!navigator.userAgent.match(/Apple.*Mobile.*Safari/)},BrowserFeatures:{XPath:!!document.evaluate,ElementExtensions:!!window.HTMLElement,SpecificElementExtensions:document.createElement('div').__proto__&&document.createElement('div').__proto__!==document.createElement('form').__proto__},ScriptFragment:'<script[^>]*>([\\S\\s]*?)<\/script>',JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(x){return x}};if(Prototype.Browser.MobileSafari)Prototype.BrowserFeatures.SpecificElementExtensions=false;var Class={create:function(){var a=null,properties=$A(arguments);if(Object.isFunction(properties[0]))a=properties.shift();function klass(){this.initialize.apply(this,arguments)}Object.extend(klass,Class.Methods);klass.superclass=a;klass.subclasses=[];if(a){var b=function(){};b.prototype=a.prototype;klass.prototype=new b;a.subclasses.push(klass)}for(var i=0;i<properties.length;i++)klass.addMethods(properties[i]);if(!klass.prototype.initialize)klass.prototype.initialize=Prototype.emptyFunction;klass.prototype.constructor=klass;return klass}};Class.Methods={addMethods:function(a){var b=this.superclass&&this.superclass.prototype;var c=Object.keys(a);if(!Object.keys({toString:true}).length)c.push("toString","valueOf");for(var i=0,length=c.length;i<length;i++){var d=c[i],value=a[d];if(b&&Object.isFunction(value)&&value.argumentNames().first()=="$super"){var e=value,value=Object.extend((function(m){return function(){return b[m].apply(this,arguments)}})(d).wrap(e),{valueOf:function(){return e},toString:function(){return e.toString()}})}this.prototype[d]=value}return this}};var Abstract={};Object.extend=function(a,b){for(var c in b)a[c]=b[c];return a};Object.extend(Object,{inspect:function(a){try{if(Object.isUndefined(a))return'undefined';if(a===null)return'null';return a.inspect?a.inspect():String(a)}catch(e){if(e instanceof RangeError)return'...';throw e;}},toJSON:function(a){var b=typeof a;switch(b){case'undefined':case'function':case'unknown':return;case'boolean':return a.toString()}if(a===null)return'null';if(a.toJSON)return a.toJSON();if(Object.isElement(a))return;var c=[];for(var d in a){var e=Object.toJSON(a[d]);if(!Object.isUndefined(e))c.push(d.toJSON()+': '+e)}return'{'+c.join(', ')+'}'},toQueryString:function(a){return $H(a).toQueryString()},toHTML:function(a){return a&&a.toHTML?a.toHTML():String.interpret(a)},keys:function(a){var b=[];for(var c in a)b.push(c);return b},values:function(a){var b=[];for(var c in a)b.push(a[c]);return b},clone:function(a){return Object.extend({},a)},isElement:function(a){return a&&a.nodeType==1},isArray:function(a){return a!=null&&typeof a=="object"&&'splice'in a&&'join'in a},isHash:function(a){return a instanceof Hash},isFunction:function(a){return typeof a=="function"},isString:function(a){return typeof a=="string"},isNumber:function(a){return typeof a=="number"},isUndefined:function(a){return typeof a=="undefined"}});Object.extend(Function.prototype,{argumentNames:function(){var a=this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");return a.length==1&&!a[0]?[]:a},bind:function(){if(arguments.length<2&&Object.isUndefined(arguments[0]))return this;var a=this,args=$A(arguments),object=args.shift();return function(){return a.apply(object,args.concat($A(arguments)))}},bindAsEventListener:function(){var b=this,args=$A(arguments),object=args.shift();return function(a){return b.apply(object,[a||window.event].concat(args))}},curry:function(){if(!arguments.length)return this;var a=this,args=$A(arguments);return function(){return a.apply(this,args.concat($A(arguments)))}},delay:function(){var a=this,args=$A(arguments),timeout=args.shift()*1000;return window.setTimeout(function(){return a.apply(a,args)},timeout)},wrap:function(a){var b=this;return function(){return a.apply(this,[b.bind(this)].concat($A(arguments)))}},methodize:function(){if(this._methodized)return this._methodized;var a=this;return this._methodized=function(){return a.apply(null,[this].concat($A(arguments)))}}});Function.prototype.defer=Function.prototype.delay.curry(0.01);Date.prototype.toJSON=function(){return'"'+this.getUTCFullYear()+'-'+(this.getUTCMonth()+1).toPaddedString(2)+'-'+this.getUTCDate().toPaddedString(2)+'T'+this.getUTCHours().toPaddedString(2)+':'+this.getUTCMinutes().toPaddedString(2)+':'+this.getUTCSeconds().toPaddedString(2)+'Z"'};var Try={these:function(){var a;for(var i=0,length=arguments.length;i<length;i++){var b=arguments[i];try{a=b();break}catch(e){}}return a}};RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,'\\$1')};var PeriodicalExecuter=Class.create({initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)},execute:function(){this.callback(this)},stop:function(){if(!this.timer)return;clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;this.execute()}finally{this.currentlyExecuting=false}}}});Object.extend(String,{interpret:function(a){return a==null?'':String(a)},specialChar:{'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','\\':'\\\\'}});Object.extend(String.prototype,{gsub:function(a,b){var c='',source=this,match;b=arguments.callee.prepareReplacement(b);while(source.length>0){if(match=source.match(a)){c+=source.slice(0,match.index);c+=String.interpret(b(match));source=source.slice(match.index+match[0].length)}else{c+=source,source=''}}return c},sub:function(b,c,d){c=this.gsub.prepareReplacement(c);d=Object.isUndefined(d)?1:d;return this.gsub(b,function(a){if(--d<0)return a[0];return c(a)})},scan:function(a,b){this.gsub(a,b);return String(this)},truncate:function(a,b){a=a||30;b=Object.isUndefined(b)?'...':b;return this.length>a?this.slice(0,a-b.length)+b:String(this)},strip:function(){return this.replace(/^\s+/,'').replace(/\s+$/,'')},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,'')},stripScripts:function(){return this.replace(new RegExp(Prototype.ScriptFragment,'img'),'')},extractScripts:function(){var b=new RegExp(Prototype.ScriptFragment,'img');var c=new RegExp(Prototype.ScriptFragment,'im');return(this.match(b)||[]).map(function(a){return(a.match(c)||['',''])[1]})},evalScripts:function(){return this.extractScripts().map(function(a){return eval(a)})},escapeHTML:function(){var a=arguments.callee;a.text.data=this;return a.div.innerHTML},unescapeHTML:function(){var c=new Element('div');c.innerHTML=this.stripTags();return c.childNodes[0]?(c.childNodes.length>1?$A(c.childNodes).inject('',function(a,b){return a+b.nodeValue}):c.childNodes[0].nodeValue):''},toQueryParams:function(e){var f=this.strip().match(/([^?#]*)(#.*)?$/);if(!f)return{};return f[1].split(e||'&').inject({},function(a,b){if((b=b.split('='))[0]){var c=decodeURIComponent(b.shift());var d=b.length>1?b.join('='):b[0];if(d!=undefined)d=decodeURIComponent(d);if(c in a){if(!Object.isArray(a[c]))a[c]=[a[c]];a[c].push(d)}else a[c]=d}return a})},toArray:function(){return this.split('')},succ:function(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)},times:function(a){return a<1?'':new Array(a+1).join(this)},camelize:function(){var a=this.split('-'),len=a.length;if(len==1)return a[0];var b=this.charAt(0)=='-'?a[0].charAt(0).toUpperCase()+a[0].substring(1):a[0];for(var i=1;i<len;i++)b+=a[i].charAt(0).toUpperCase()+a[i].substring(1);return b},capitalize:function(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()},underscore:function(){return this.gsub(/::/,'/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase()},dasherize:function(){return this.gsub(/_/,'-')},inspect:function(c){var d=this.gsub(/[\x00-\x1f\\]/,function(a){var b=String.specialChar[a[0]];return b?b:'\\u00'+a[0].charCodeAt().toPaddedString(2,16)});if(c)return'"'+d.replace(/"/g,'\\"')+'"';return"'"+d.replace(/'/g,'\\\'')+"'"},toJSON:function(){return this.inspect(true)},unfilterJSON:function(a){return this.sub(a||Prototype.JSONFilter,'#{1}')},isJSON:function(){var a=this;if(a.blank())return false;a=this.replace(/\\./g,'@').replace(/"[^"\\\n\r]*"/g,'');return(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(a)},evalJSON:function(a){var b=this.unfilterJSON();try{if(!a||b.isJSON())return eval('('+b+')')}catch(e){}throw new SyntaxError('Badly formed JSON string: '+this.inspect());},include:function(a){return this.indexOf(a)>-1},startsWith:function(a){return this.indexOf(a)===0},endsWith:function(a){var d=this.length-a.length;return d>=0&&this.lastIndexOf(a)===d},empty:function(){return this==''},blank:function(){return/^\s*$/.test(this)},interpolate:function(a,b){return new Template(this,b).evaluate(a)}});if(Prototype.Browser.WebKit||Prototype.Browser.IE)Object.extend(String.prototype,{escapeHTML:function(){return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;')},unescapeHTML:function(){return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>')}});String.prototype.gsub.prepareReplacement=function(b){if(Object.isFunction(b))return b;var c=new Template(b);return function(a){return c.evaluate(a)}};String.prototype.parseQuery=String.prototype.toQueryParams;Object.extend(String.prototype.escapeHTML,{div:document.createElement('div'),text:document.createTextNode('')});with(String.prototype.escapeHTML)div.appendChild(text);var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(f){if(Object.isFunction(f.toTemplateReplacements))f=f.toTemplateReplacements();return this.template.gsub(this.pattern,function(a){if(f==null)return'';var b=a[1]||'';if(b=='\\')return a[2];var c=f,expr=a[3];var d=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;a=d.exec(expr);if(a==null)return b;while(a!=null){var e=a[1].startsWith('[')?a[2].gsub('\\\\]',']'):a[1];c=c[e];if(null==c||''==a[3])break;expr=expr.substring('['==a[3]?a[1].length:a[0].length);a=d.exec(expr)}return b+String.interpret(c)})}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable={each:function(b,c){var d=0;b=b.bind(c);try{this._each(function(a){b(a,d++)})}catch(e){if(e!=$break)throw e;}return this},eachSlice:function(a,b,c){b=b?b.bind(c):Prototype.K;var d=-a,slices=[],array=this.toArray();while((d+=a)<array.length)slices.push(array.slice(d,d+a));return slices.collect(b,c)},all:function(c,d){c=c?c.bind(d):Prototype.K;var e=true;this.each(function(a,b){e=e&&!!c(a,b);if(!e)throw $break;});return e},any:function(c,d){c=c?c.bind(d):Prototype.K;var e=false;this.each(function(a,b){if(e=!!c(a,b))throw $break;});return e},collect:function(c,d){c=c?c.bind(d):Prototype.K;var e=[];this.each(function(a,b){e.push(c(a,b))});return e},detect:function(c,d){c=c.bind(d);var e;this.each(function(a,b){if(c(a,b)){e=a;throw $break;}});return e},findAll:function(c,d){c=c.bind(d);var e=[];this.each(function(a,b){if(c(a,b))e.push(a)});return e},grep:function(c,d,e){d=d?d.bind(e):Prototype.K;var f=[];if(Object.isString(c))c=new RegExp(c);this.each(function(a,b){if(c.match(a))f.push(d(a,b))});return f},include:function(b){if(Object.isFunction(this.indexOf))if(this.indexOf(b)!=-1)return true;var c=false;this.each(function(a){if(a==b){c=true;throw $break;}});return c},inGroupsOf:function(b,c){c=Object.isUndefined(c)?null:c;return this.eachSlice(b,function(a){while(a.length<b)a.push(c);return a})},inject:function(c,d,e){d=d.bind(e);this.each(function(a,b){c=d(c,a,b)});return c},invoke:function(b){var c=$A(arguments).slice(1);return this.map(function(a){return a[b].apply(a,c)})},max:function(c,d){c=c?c.bind(d):Prototype.K;var e;this.each(function(a,b){a=c(a,b);if(e==null||a>=e)e=a});return e},min:function(c,d){c=c?c.bind(d):Prototype.K;var e;this.each(function(a,b){a=c(a,b);if(e==null||a<e)e=a});return e},partition:function(c,d){c=c?c.bind(d):Prototype.K;var e=[],falses=[];this.each(function(a,b){(c(a,b)?e:falses).push(a)});return[e,falses]},pluck:function(b){var c=[];this.each(function(a){c.push(a[b])});return c},reject:function(c,d){c=c.bind(d);var e=[];this.each(function(a,b){if(!c(a,b))e.push(a)});return e},sortBy:function(e,f){e=e.bind(f);return this.map(function(a,b){return{value:a,criteria:e(a,b)}}).sort(function(c,d){var a=c.criteria,b=d.criteria;return a<b?-1:a>b?1:0}).pluck('value')},toArray:function(){return this.map()},zip:function(){var c=Prototype.K,args=$A(arguments);if(Object.isFunction(args.last()))c=args.pop();var d=[this].concat(args).map($A);return this.map(function(a,b){return c(d.pluck(b))})},size:function(){return this.toArray().length},inspect:function(){return'#<Enumerable:'+this.toArray().inspect()+'>'}};Object.extend(Enumerable,{map:Enumerable.collect,find:Enumerable.detect,select:Enumerable.findAll,filter:Enumerable.findAll,member:Enumerable.include,entries:Enumerable.toArray,every:Enumerable.all,some:Enumerable.any});function $A(a){if(!a)return[];if(a.toArray)return a.toArray();var b=a.length||0,results=new Array(b);while(b--)results[b]=a[b];return results}if(Prototype.Browser.WebKit){$A=function(a){if(!a)return[];if(!(Object.isFunction(a)&&a=='[object NodeList]')&&a.toArray)return a.toArray();var b=a.length||0,results=new Array(b);while(b--)results[b]=a[b];return results}}Array.from=$A;Object.extend(Array.prototype,Enumerable);if(!Array.prototype._reverse)Array.prototype._reverse=Array.prototype.reverse;Object.extend(Array.prototype,{_each:function(a){for(var i=0,length=this.length;i<length;i++)a(this[i])},clear:function(){this.length=0;return this},first:function(){return this[0]},last:function(){return this[this.length-1]},compact:function(){return this.select(function(a){return a!=null})},flatten:function(){return this.inject([],function(a,b){return a.concat(Object.isArray(b)?b.flatten():[b])})},without:function(){var b=$A(arguments);return this.select(function(a){return!b.include(a)})},reverse:function(a){return(a!==false?this:this.toArray())._reverse()},reduce:function(){return this.length>1?this:this[0]},uniq:function(d){return this.inject([],function(a,b,c){if(0==c||(d?a.last()!=b:!a.include(b)))a.push(b);return a})},intersect:function(c){return this.uniq().findAll(function(b){return c.detect(function(a){return b===a})})},clone:function(){return[].concat(this)},size:function(){return this.length},inspect:function(){return'['+this.map(Object.inspect).join(', ')+']'},toJSON:function(){var c=[];this.each(function(a){var b=Object.toJSON(a);if(!Object.isUndefined(b))c.push(b)});return'['+c.join(', ')+']'}});if(Object.isFunction(Array.prototype.forEach))Array.prototype._each=Array.prototype.forEach;if(!Array.prototype.indexOf)Array.prototype.indexOf=function(a,i){i||(i=0);var b=this.length;if(i<0)i=b+i;for(;i<b;i++)if(this[i]===a)return i;return-1};if(!Array.prototype.lastIndexOf)Array.prototype.lastIndexOf=function(a,i){i=isNaN(i)?this.length:(i<0?this.length+i:i)+1;var n=this.slice(0,i).reverse().indexOf(a);return(n<0)?n:i-n-1};Array.prototype.toArray=Array.prototype.clone;function $w(a){if(!Object.isString(a))return[];a=a.strip();return a?a.split(/\s+/):[]}if(Prototype.Browser.Opera){Array.prototype.concat=function(){var a=[];for(var i=0,length=this.length;i<length;i++)a.push(this[i]);for(var i=0,length=arguments.length;i<length;i++){if(Object.isArray(arguments[i])){for(var j=0,arrayLength=arguments[i].length;j<arrayLength;j++)a.push(arguments[i][j])}else{a.push(arguments[i])}}return a}}Object.extend(Number.prototype,{toColorPart:function(){return this.toPaddedString(2,16)},succ:function(){return this+1},times:function(a){$R(0,this,true).each(a);return this},toPaddedString:function(a,b){var c=this.toString(b||10);return'0'.times(a-c.length)+c},toJSON:function(){return isFinite(this)?this.toString():'null'}});$w('abs round ceil floor').each(function(a){Number.prototype[a]=Math[a].methodize()});function $H(a){return new Hash(a)};var Hash=Class.create(Enumerable,(function(){function toQueryPair(a,b){if(Object.isUndefined(b))return a;return a+'='+encodeURIComponent(String.interpret(b))}return{initialize:function(a){this._object=Object.isHash(a)?a.toObject():Object.clone(a)},_each:function(a){for(var b in this._object){var c=this._object[b],pair=[b,c];pair.key=b;pair.value=c;a(pair)}},set:function(a,b){return this._object[a]=b},get:function(a){return this._object[a]},unset:function(a){var b=this._object[a];delete this._object[a];return b},toObject:function(){return Object.clone(this._object)},keys:function(){return this.pluck('key')},values:function(){return this.pluck('value')},index:function(b){var c=this.detect(function(a){return a.value===b});return c&&c.key},merge:function(a){return this.clone().update(a)},update:function(c){return new Hash(c).inject(this,function(a,b){a.set(b.key,b.value);return a})},toQueryString:function(){return this.map(function(a){var b=encodeURIComponent(a.key),values=a.value;if(values&&typeof values=='object'){if(Object.isArray(values))return values.map(toQueryPair.curry(b)).join('&')}return toQueryPair(b,values)}).join('&')},inspect:function(){return'#<Hash:{'+this.map(function(a){return a.map(Object.inspect).join(': ')}).join(', ')+'}>'},toJSON:function(){return Object.toJSON(this.toObject())},clone:function(){return new Hash(this)}}})());Hash.prototype.toTemplateReplacements=Hash.prototype.toObject;Hash.from=$H;var ObjectRange=Class.create(Enumerable,{initialize:function(a,b,c){this.start=a;this.end=b;this.exclusive=c},_each:function(a){var b=this.start;while(this.include(b)){a(b);b=b.succ()}},include:function(a){if(a<this.start)return false;if(this.exclusive)return a<this.end;return a<=this.end}});var $R=function(a,b,c){return new ObjectRange(a,b,c)};var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()},function(){return new ActiveXObject('Msxml2.XMLHTTP')},function(){return new ActiveXObject('Microsoft.XMLHTTP')})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)},register:function(a){if(!this.include(a))this.responders.push(a)},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(b,c,d,f){this.each(function(a){if(Object.isFunction(a[b])){try{a[b].apply(a,[c,d,f])}catch(e){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:'post',asynchronous:true,contentType:'application/x-www-form-urlencoded',encoding:'UTF-8',parameters:'',evalJSON:true,evalJS:true};Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isString(this.options.parameters))this.options.parameters=this.options.parameters.toQueryParams();else if(Object.isHash(this.options.parameters))this.options.parameters=this.options.parameters.toObject()}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,c){$super(c);this.transport=Ajax.getTransport();this.request(b)},request:function(a){this.url=a;this.method=this.options.method;var b=Object.clone(this.options.parameters);if(!['get','post'].include(this.method)){b['_method']=this.method;this.method='post'}this.parameters=b;if(b=Object.toQueryString(b)){if(this.method=='get')this.url+=(this.url.include('?')?'&':'?')+b;else if(/Konqueror|Safari|KHTML/.test(navigator.userAgent))b+='&_='}try{var c=new Ajax.Response(this);if(this.options.onCreate)this.options.onCreate(c);Ajax.Responders.dispatch('onCreate',this,c);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);if(this.options.asynchronous)this.respondToReadyState.bind(this).defer(1);this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=='post'?(this.options.postBody||b):null;this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType)this.onStateChange()}catch(e){this.dispatchException(e)}},onStateChange:function(){var a=this.transport.readyState;if(a>1&&!((a==4)&&this._complete))this.respondToReadyState(this.transport.readyState)},setRequestHeaders:function(){var b={'X-Requested-With':'XMLHttpRequest','X-Prototype-Version':Prototype.Version,'Accept':'text/javascript, text/html, application/xml, text/xml, */*'};if(this.method=='post'){b['Content-type']=this.options.contentType+(this.options.encoding?'; charset='+this.options.encoding:'');if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005)b['Connection']='close'}if(typeof this.options.requestHeaders=='object'){var c=this.options.requestHeaders;if(Object.isFunction(c.push))for(var i=0,length=c.length;i<length;i+=2)b[c[i]]=c[i+1];else $H(c).each(function(a){b[a.key]=a.value})}for(var d in b)this.transport.setRequestHeader(d,b[d])},success:function(){var a=this.getStatus();return!a||(a>=200&&a<300)},getStatus:function(){try{return this.transport.status||0}catch(e){return 0}},respondToReadyState:function(a){var b=Ajax.Request.Events[a],response=new Ajax.Response(this);if(b=='Complete'){try{this._complete=true;(this.options['on'+response.status]||this.options['on'+(this.success()?'Success':'Failure')]||Prototype.emptyFunction)(response,response.headerJSON)}catch(e){this.dispatchException(e)}var c=response.getHeader('Content-type');if(this.options.evalJS=='force'||(this.options.evalJS&&this.isSameOrigin()&&c&&c.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))this.evalResponse()}try{(this.options['on'+b]||Prototype.emptyFunction)(response,response.headerJSON);Ajax.Responders.dispatch('on'+b,this,response,response.headerJSON)}catch(e){this.dispatchException(e)}if(b=='Complete'){this.transport.onreadystatechange=Prototype.emptyFunction}},isSameOrigin:function(){var m=this.url.match(/^\s*https?:\/\/[^\/]*/);return!m||(m[0]=='#{protocol}//#{domain}#{port}'.interpolate({protocol:location.protocol,domain:document.domain,port:location.port?':'+location.port:''}))},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(e){return null}},evalResponse:function(){try{return eval((this.transport.responseText||'').unfilterJSON())}catch(e){this.dispatchException(e)}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch('onException',this,a)}});Ajax.Request.Events=['Uninitialized','Loading','Loaded','Interactive','Complete'];Ajax.Response=Class.create({initialize:function(a){this.request=a;var b=this.transport=a.transport,readyState=this.readyState=b.readyState;if((readyState>2&&!Prototype.Browser.IE)||readyState==4){this.status=this.getStatus();this.statusText=this.getStatusText();this.responseText=String.interpret(b.responseText);this.headerJSON=this._getHeaderJSON()}if(readyState==4){var c=b.responseXML;this.responseXML=Object.isUndefined(c)?null:c;this.responseJSON=this._getResponseJSON()}},status:0,statusText:'',getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||''}catch(e){return''}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()}catch(e){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader('X-JSON');if(!a)return null;a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(e){this.request.dispatchException(e)}},_getResponseJSON:function(){var a=this.request.options;if(!a.evalJSON||(a.evalJSON!='force'&&!(this.getHeader('Content-type')||'').include('application/json'))||this.responseText.blank())return null;try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())}catch(e){this.request.dispatchException(e)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,d,e,f){this.container={success:(d.success||d),failure:(d.failure||(d.success?null:d))};f=Object.clone(f);var g=f.onComplete;f.onComplete=(function(a,b){this.updateContent(a.responseText);if(Object.isFunction(g))g(a,b)}).bind(this);$super(e,f)},updateContent:function(a){var b=this.container[this.success()?'success':'failure'],options=this.options;if(!options.evalScripts)a=a.stripScripts();if(b=$(b)){if(options.insertion){if(Object.isString(options.insertion)){var c={};c[options.insertion]=a;b.insert(c)}else options.insertion(b,a)}else b.update(a)}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,b,c,d){$super(d);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=b;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function $(a){if(arguments.length>1){for(var i=0,elements=[],length=arguments.length;i<length;i++)elements.push($(arguments[i]));return elements}if(Object.isString(a))a=document.getElementById(a);return Element.extend(a)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(a,b){var c=[];var d=document.evaluate(a,$(b)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var i=0,length=d.snapshotLength;i<length;i++)c.push(Element.extend(d.snapshotItem(i)));return c}}if(!window.Node)var Node={};if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})}(function(){var d=this.Element;this.Element=function(a,b){b=b||{};a=a.toLowerCase();var c=Element.cache;if(Prototype.Browser.IE&&b.name){a='<'+a+' name="'+b.name+'">';delete b.name;return Element.writeAttribute(document.createElement(a),b)}if(!c[a])c[a]=Element.extend(document.createElement(a));return Element.writeAttribute(c[a].cloneNode(false),b)};Object.extend(this.Element,d||{})}).call(window);Element.cache={};Element.Methods={visible:function(a){return $(a).style.display!='none'},toggle:function(a){a=$(a);Element[Element.visible(a)?'hide':'show'](a);return a},hide:function(a){$(a).style.display='none';return a},show:function(a){$(a).style.display='';return a},remove:function(a){a=$(a);a.parentNode.removeChild(a);return a},update:function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();if(Object.isElement(b))return a.update().insert(b);b=Object.toHTML(b);a.innerHTML=b.stripScripts();b.evalScripts.bind(b).defer();return a},replace:function(a,b){a=$(a);if(b&&b.toElement)b=b.toElement();else if(!Object.isElement(b)){b=Object.toHTML(b);var c=a.ownerDocument.createRange();c.selectNode(a);b.evalScripts.bind(b).defer();b=c.createContextualFragment(b.stripScripts())}a.parentNode.replaceChild(b,a);return a},insert:function(a,b){a=$(a);if(Object.isString(b)||Object.isNumber(b)||Object.isElement(b)||(b&&(b.toElement||b.toHTML)))b={bottom:b};var c,insert,tagName,childNodes;for(var d in b){c=b[d];d=d.toLowerCase();insert=Element._insertionTranslations[d];if(c&&c.toElement)c=c.toElement();if(Object.isElement(c)){insert(a,c);continue}c=Object.toHTML(c);tagName=((d=='before'||d=='after')?a.parentNode:a).tagName.toUpperCase();childNodes=Element._getContentFromAnonymousElement(tagName,c.stripScripts());if(d=='top'||d=='after')childNodes.reverse();childNodes.each(insert.curry(a));c.evalScripts.bind(c).defer()}return a},wrap:function(a,b,c){a=$(a);if(Object.isElement(b))$(b).writeAttribute(c||{});else if(Object.isString(b))b=new Element(b,c);else b=new Element('div',b);if(a.parentNode)a.parentNode.replaceChild(b,a);b.appendChild(a);return b},inspect:function(d){d=$(d);var e='<'+d.tagName.toLowerCase();$H({'id':'id','className':'class'}).each(function(a){var b=a.first(),attribute=a.last();var c=(d[b]||'').toString();if(c)e+=' '+attribute+'='+c.inspect(true)});return e+'>'},recursivelyCollect:function(a,b){a=$(a);var c=[];while(a=a[b])if(a.nodeType==1)c.push(Element.extend(a));return c},ancestors:function(a){return $(a).recursivelyCollect('parentNode')},descendants:function(a){return $(a).select("*")},firstDescendant:function(a){a=$(a).firstChild;while(a&&a.nodeType!=1)a=a.nextSibling;return $(a)},immediateDescendants:function(a){if(!(a=$(a).firstChild))return[];while(a&&a.nodeType!=1)a=a.nextSibling;if(a)return[a].concat($(a).nextSiblings());return[]},previousSiblings:function(a){return $(a).recursivelyCollect('previousSibling')},nextSiblings:function(a){return $(a).recursivelyCollect('nextSibling')},siblings:function(a){a=$(a);return a.previousSiblings().reverse().concat(a.nextSiblings())},match:function(a,b){if(Object.isString(b))b=new Selector(b);return b.match($(a))},up:function(a,b,c){a=$(a);if(arguments.length==1)return $(a.parentNode);var d=a.ancestors();return Object.isNumber(b)?d[b]:Selector.findElement(d,b,c)},down:function(a,b,c){a=$(a);if(arguments.length==1)return a.firstDescendant();return Object.isNumber(b)?a.descendants()[b]:a.select(b)[c||0]},previous:function(a,b,c){a=$(a);if(arguments.length==1)return $(Selector.handlers.previousElementSibling(a));var d=a.previousSiblings();return Object.isNumber(b)?d[b]:Selector.findElement(d,b,c)},next:function(a,b,c){a=$(a);if(arguments.length==1)return $(Selector.handlers.nextElementSibling(a));var d=a.nextSiblings();return Object.isNumber(b)?d[b]:Selector.findElement(d,b,c)},select:function(){var a=$A(arguments),element=$(a.shift());return Selector.findChildElements(element,a)},adjacent:function(){var a=$A(arguments),element=$(a.shift());return Selector.findChildElements(element.parentNode,a).without(element)},identify:function(a){a=$(a);var b=a.readAttribute('id'),self=arguments.callee;if(b)return b;do{b='anonymous_element_'+self.counter++}while($(b));a.writeAttribute('id',b);return b},readAttribute:function(a,b){a=$(a);if(Prototype.Browser.IE){var t=Element._attributeTranslations.read;if(t.values[b])return t.values[b](a,b);if(t.names[b])b=t.names[b];if(b.include(':')){return(!a.attributes||!a.attributes[b])?null:a.attributes[b].value}}return a.getAttribute(b)},writeAttribute:function(a,b,c){a=$(a);var d={},t=Element._attributeTranslations.write;if(typeof b=='object')d=b;else d[b]=Object.isUndefined(c)?true:c;for(var e in d){b=t.names[e]||e;c=d[e];if(t.values[e])b=t.values[e](a,c);if(c===false||c===null)a.removeAttribute(b);else if(c===true)a.setAttribute(b,b);else a.setAttribute(b,c)}return a},getHeight:function(a){return $(a).getDimensions().height},getWidth:function(a){return $(a).getDimensions().width},classNames:function(a){return new Element.ClassNames(a)},hasClassName:function(a,b){if(!(a=$(a)))return;var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=$(a)))return;if(!a.hasClassName(b))a.className+=(a.className?' ':'')+b;return a},removeClassName:function(a,b){if(!(a=$(a)))return;a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)"),' ').strip();return a},toggleClassName:function(a,b){if(!(a=$(a)))return;return a[a.hasClassName(b)?'removeClassName':'addClassName'](b)},cleanWhitespace:function(a){a=$(a);var b=a.firstChild;while(b){var c=b.nextSibling;if(b.nodeType==3&&!/\S/.test(b.nodeValue))a.removeChild(b);b=c}return a},empty:function(a){return $(a).innerHTML.blank()},descendantOf:function(b,c){b=$(b),c=$(c);var d=c;if(b.compareDocumentPosition)return(b.compareDocumentPosition(c)&8)===8;if(b.sourceIndex&&!Prototype.Browser.Opera){var e=b.sourceIndex,a=c.sourceIndex,nextAncestor=c.nextSibling;if(!nextAncestor){do{c=c.parentNode}while(!(nextAncestor=c.nextSibling)&&c.parentNode)}if(nextAncestor&&nextAncestor.sourceIndex)return(e>a&&e<nextAncestor.sourceIndex)}while(b=b.parentNode)if(b==d)return true;return false},scrollTo:function(a){a=$(a);var b=a.cumulativeOffset();window.scrollTo(b[0],b[1]);return a},getStyle:function(a,b){a=$(a);b=b=='float'?'cssFloat':b.camelize();var c=a.style[b];if(!c){var d=document.defaultView.getComputedStyle(a,null);c=d?d[b]:null}if(b=='opacity')return c?parseFloat(c):1.0;return c=='auto'?null:c},getOpacity:function(a){return $(a).getStyle('opacity')},setStyle:function(a,b){a=$(a);var c=a.style,match;if(Object.isString(b)){a.style.cssText+=';'+b;return b.include('opacity')?a.setOpacity(b.match(/opacity:\s*(\d?\.?\d*)/)[1]):a}for(var d in b)if(d=='opacity')a.setOpacity(b[d]);else c[(d=='float'||d=='cssFloat')?(Object.isUndefined(c.styleFloat)?'cssFloat':'styleFloat'):d]=b[d];return a},setOpacity:function(a,b){a=$(a);a.style.opacity=(b==1||b==='')?'':(b<0.00001)?0:b;return a},getDimensions:function(a){a=$(a);var b=$(a).getStyle('display');if(b!='none'&&b!=null)return{width:a.offsetWidth,height:a.offsetHeight};var c=a.style;var d=c.visibility;var e=c.position;var f=c.display;c.visibility='hidden';c.position='absolute';c.display='block';var g=a.clientWidth;var h=a.clientHeight;c.display=f;c.position=e;c.visibility=d;return{width:g,height:h}},makePositioned:function(a){a=$(a);var b=Element.getStyle(a,'position');if(b=='static'||!b){a._madePositioned=true;a.style.position='relative';if(window.opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=$(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=''}return a},makeClipping:function(a){a=$(a);if(a._overflow)return a;a._overflow=Element.getStyle(a,'overflow')||'auto';if(a._overflow!=='hidden')a.style.overflow='hidden';return a},undoClipping:function(a){a=$(a);if(!a._overflow)return a;a.style.overflow=a._overflow=='auto'?'':a._overflow;a._overflow=null;return a},cumulativeOffset:function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;a=a.offsetParent}while(a);return Element._returnOffset(valueL,b)},positionedOffset:function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;a=a.offsetParent;if(a){if(a.tagName=='BODY')break;var p=Element.getStyle(a,'position');if(p!=='static')break}}while(a);return Element._returnOffset(valueL,b)},absolutize:function(a){a=$(a);if(a.getStyle('position')=='absolute')return;var b=a.positionedOffset();var c=b[1];var d=b[0];var e=a.clientWidth;var f=a.clientHeight;a._originalLeft=d-parseFloat(a.style.left||0);a._originalTop=c-parseFloat(a.style.top||0);a._originalWidth=a.style.width;a._originalHeight=a.style.height;a.style.position='absolute';a.style.top=c+'px';a.style.left=d+'px';a.style.width=e+'px';a.style.height=f+'px';return a},relativize:function(a){a=$(a);if(a.getStyle('position')=='relative')return;a.style.position='relative';var b=parseFloat(a.style.top||0)-(a._originalTop||0);var c=parseFloat(a.style.left||0)-(a._originalLeft||0);a.style.top=b+'px';a.style.left=c+'px';a.style.height=a._originalHeight;a.style.width=a._originalWidth;return a},cumulativeScrollOffset:function(a){var b=0,valueL=0;do{b+=a.scrollTop||0;valueL+=a.scrollLeft||0;a=a.parentNode}while(a);return Element._returnOffset(valueL,b)},getOffsetParent:function(a){if(a.offsetParent)return $(a.offsetParent);if(a==document.body)return $(a);while((a=a.parentNode)&&a!=document.body)if(Element.getStyle(a,'position')!='static')return $(a);return $(document.body)},viewportOffset:function(a){var b=0,valueL=0;var c=a;do{b+=c.offsetTop||0;valueL+=c.offsetLeft||0;if(c.offsetParent==document.body&&Element.getStyle(c,'position')=='absolute')break}while(c=c.offsetParent);c=a;do{if(!Prototype.Browser.Opera||c.tagName=='BODY'){b-=c.scrollTop||0;valueL-=c.scrollLeft||0}}while(c=c.parentNode);return Element._returnOffset(valueL,b)},clonePosition:function(a,b){var c=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});b=$(b);var p=b.viewportOffset();a=$(a);var d=[0,0];var e=null;if(Element.getStyle(a,'position')=='absolute'){e=a.getOffsetParent();d=e.viewportOffset()}if(e==document.body){d[0]-=document.body.offsetLeft;d[1]-=document.body.offsetTop}if(c.setLeft)a.style.left=(p[0]-d[0]+c.offsetLeft)+'px';if(c.setTop)a.style.top=(p[1]-d[1]+c.offsetTop)+'px';if(c.setWidth)a.style.width=b.offsetWidth+'px';if(c.setHeight)a.style.height=b.offsetHeight+'px';return a}};Element.Methods.identify.counter=1;Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:'class',htmlFor:'for'},values:{}}};if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,e,f){switch(f){case'left':case'top':case'right':case'bottom':if(d(e,'position')==='static')return null;case'height':case'width':if(!Element.visible(e))return null;var g=parseInt(d(e,f),10);if(g!==e['offset'+f.capitalize()])return g+'px';var h;if(f==='height'){h=['border-top-width','padding-top','padding-bottom','border-bottom-width']}else{h=['border-left-width','padding-left','padding-right','border-right-width']}return h.inject(g,function(a,b){var c=d(e,b);return c===null?a:a-parseInt(c,10)})+'px';default:return d(e,f)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(a,b,c){if(c==='title')return b.title;return a(b,c)})}else if(Prototype.Browser.IE){Element.Methods.getOffsetParent=Element.Methods.getOffsetParent.wrap(function(a,b){b=$(b);var c=b.getStyle('position');if(c!=='static')return a(b);b.setStyle({position:'relative'});var d=a(b);b.setStyle({position:c});return d});$w('positionedOffset viewportOffset').each(function(f){Element.Methods[f]=Element.Methods[f].wrap(function(a,b){b=$(b);var c=b.getStyle('position');if(c!=='static')return a(b);var d=b.getOffsetParent();if(d&&d.getStyle('position')==='fixed')d.setStyle({zoom:1});b.setStyle({position:'relative'});var e=a(b);b.setStyle({position:c});return e})});Element.Methods.getStyle=function(a,b){a=$(a);b=(b=='float'||b=='cssFloat')?'styleFloat':b.camelize();var c=a.style[b];if(!c&&a.currentStyle)c=a.currentStyle[b];if(b=='opacity'){if(c=(a.getStyle('filter')||'').match(/alpha\(opacity=(.*)\)/))if(c[1])return parseFloat(c[1])/100;return 1.0}if(c=='auto'){if((b=='width'||b=='height')&&(a.getStyle('display')!='none'))return a['offset'+b.capitalize()]+'px';return null}return c};Element.Methods.setOpacity=function(b,c){function stripAlpha(a){return a.replace(/alpha\([^\)]*\)/gi,'')}b=$(b);var d=b.currentStyle;if((d&&!d.hasLayout)||(!d&&b.style.zoom=='normal'))b.style.zoom=1;var e=b.getStyle('filter'),style=b.style;if(c==1||c===''){(e=stripAlpha(e))?style.filter=e:style.removeAttribute('filter');return b}else if(c<0.00001)c=0;style.filter=stripAlpha(e)+'alpha(opacity='+(c*100)+')';return b};Element._attributeTranslations={read:{names:{'class':'className','for':'htmlFor'},values:{_getAttr:function(a,b){return a.getAttribute(b,2)},_getAttrNode:function(a,b){var c=a.getAttributeNode(b);return c?c.value:""},_getEv:function(a,b){b=a.getAttribute(b);return b?b.toString().slice(23,-2):null},_flag:function(a,b){return $(a).hasAttribute(b)?b:null},style:function(a){return a.style.cssText.toLowerCase()},title:function(a){return a.title}}}};Element._attributeTranslations.write={names:Object.extend({cellpadding:'cellPadding',cellspacing:'cellSpacing'},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b},style:function(a,b){a.style.cssText=b?b:''}}};Element._attributeTranslations.has={};$w('colSpan rowSpan vAlign dateTime accessKey tabIndex '+'encType maxLength readOnly longDesc').each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;Element._attributeTranslations.has[a.toLowerCase()]=a});(function(v){Object.extend(v,{href:v._getAttr,src:v._getAttr,type:v._getAttr,action:v._getAttrNode,disabled:v._flag,checked:v._flag,readonly:v._flag,multiple:v._flag,onload:v._getEv,onunload:v._getEv,onclick:v._getEv,ondblclick:v._getEv,onmousedown:v._getEv,onmouseup:v._getEv,onmouseover:v._getEv,onmousemove:v._getEv,onmouseout:v._getEv,onfocus:v._getEv,onblur:v._getEv,onkeypress:v._getEv,onkeydown:v._getEv,onkeyup:v._getEv,onsubmit:v._getEv,onreset:v._getEv,onselect:v._getEv,onchange:v._getEv})})(Element._attributeTranslations.read.values)}else if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1)?0.999999:(b==='')?'':(b<0.00001)?0:b;return a}}else if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=$(a);a.style.opacity=(b==1||b==='')?'':(b<0.00001)?0:b;if(b==1)if(a.tagName=='IMG'&&a.width){a.width++;a.width--}else try{var n=document.createTextNode(' ');a.appendChild(n);a.removeChild(n)}catch(e){}return a};Element.Methods.cumulativeOffset=function(a){var b=0,valueL=0;do{b+=a.offsetTop||0;valueL+=a.offsetLeft||0;if(a.offsetParent==document.body)if(Element.getStyle(a,'position')=='absolute')break;a=a.offsetParent}while(a);return Element._returnOffset(valueL,b)}}if(Prototype.Browser.IE||Prototype.Browser.Opera){Element.Methods.update=function(b,c){b=$(b);if(c&&c.toElement)c=c.toElement();if(Object.isElement(c))return b.update().insert(c);c=Object.toHTML(c);var d=b.tagName.toUpperCase();if(d in Element._insertionTranslations.tags){$A(b.childNodes).each(function(a){b.removeChild(a)});Element._getContentFromAnonymousElement(d,c.stripScripts()).each(function(a){b.appendChild(a)})}else b.innerHTML=c.stripScripts();c.evalScripts.bind(c).defer();return b}}if('outerHTML'in document.createElement('div')){Element.Methods.replace=function(b,c){b=$(b);if(c&&c.toElement)c=c.toElement();if(Object.isElement(c)){b.parentNode.replaceChild(c,b);return b}c=Object.toHTML(c);var d=b.parentNode,tagName=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[tagName]){var e=b.next();var f=Element._getContentFromAnonymousElement(tagName,c.stripScripts());d.removeChild(b);if(e)f.each(function(a){d.insertBefore(a,e)});else f.each(function(a){d.appendChild(a)})}else b.outerHTML=c.stripScripts();c.evalScripts.bind(c).defer();return b}}Element._returnOffset=function(l,t){var a=[l,t];a.left=l;a.top=t;return a};Element._getContentFromAnonymousElement=function(a,b){var c=new Element('div'),t=Element._insertionTranslations.tags[a];if(t){c.innerHTML=t[0]+b+t[1];t[2].times(function(){c=c.firstChild})}else c.innerHTML=b;return $A(c.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:['<table>','</table>',1],TBODY:['<table><tbody>','</tbody></table>',2],TR:['<table><tbody><tr>','</tr></tbody></table>',3],TD:['<table><tbody><tr><td>','</td></tr></tbody></table>',4],SELECT:['<select>','</select>',1]}};(function(){Object.extend(this.tags,{THEAD:this.tags.TBODY,TFOOT:this.tags.TBODY,TH:this.tags.TD})}).call(Element._insertionTranslations);Element.Methods.Simulated={hasAttribute:function(a,b){b=Element._attributeTranslations.has[b]||b;var c=$(a).getAttributeNode(b);return c&&c.specified}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);if(!Prototype.BrowserFeatures.ElementExtensions&&document.createElement('div').__proto__){window.HTMLElement={};window.HTMLElement.prototype=document.createElement('div').__proto__;Prototype.BrowserFeatures.ElementExtensions=true}Element.extend=(function(){if(Prototype.BrowserFeatures.SpecificElementExtensions)return Prototype.K;var c={},ByTag=Element.Methods.ByTag;var d=Object.extend(function(a){if(!a||a._extendedByPrototype||a.nodeType!=1||a==window)return a;var b=Object.clone(c),tagName=a.tagName,property,value;if(ByTag[tagName])Object.extend(b,ByTag[tagName]);for(property in b){value=b[property];if(Object.isFunction(value)&&!(property in a))a[property]=value.methodize()}a._extendedByPrototype=Prototype.emptyFunction;return a},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(c,Element.Methods);Object.extend(c,Element.Methods.Simulated)}}});d.refresh();return d})();Element.hasAttribute=function(a,b){if(a.hasAttribute)return a.hasAttribute(b);return Element.Methods.Simulated.hasAttribute(a,b)};Element.addMethods=function(f){var F=Prototype.BrowserFeatures,T=Element.Methods.ByTag;if(!f){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{"FORM":Object.clone(Form.Methods),"INPUT":Object.clone(Form.Element.Methods),"SELECT":Object.clone(Form.Element.Methods),"TEXTAREA":Object.clone(Form.Element.Methods)})}if(arguments.length==2){var g=f;f=arguments[1]}if(!g)Object.extend(Element.Methods,f||{});else{if(Object.isArray(g))g.each(extend);else extend(g)}function extend(a){a=a.toUpperCase();if(!Element.Methods.ByTag[a])Element.Methods.ByTag[a]={};Object.extend(Element.Methods.ByTag[a],f)}function copy(a,b,c){c=c||false;for(var d in a){var e=a[d];if(!Object.isFunction(e))continue;if(!c||!(d in b))b[d]=e.methodize()}}function findDOMClass(a){var b;var c={"OPTGROUP":"OptGroup","TEXTAREA":"TextArea","P":"Paragraph","FIELDSET":"FieldSet","UL":"UList","OL":"OList","DL":"DList","DIR":"Directory","H1":"Heading","H2":"Heading","H3":"Heading","H4":"Heading","H5":"Heading","H6":"Heading","Q":"Quote","INS":"Mod","DEL":"Mod","A":"Anchor","IMG":"Image","CAPTION":"TableCaption","COL":"TableCol","COLGROUP":"TableCol","THEAD":"TableSection","TFOOT":"TableSection","TBODY":"TableSection","TR":"TableRow","TH":"TableCell","TD":"TableCell","FRAMESET":"FrameSet","IFRAME":"IFrame"};if(c[a])b='HTML'+c[a]+'Element';if(window[b])return window[b];b='HTML'+a+'Element';if(window[b])return window[b];b='HTML'+a.capitalize()+'Element';if(window[b])return window[b];window[b]={};window[b].prototype=document.createElement(a).__proto__;return window[b]}if(F.ElementExtensions){copy(Element.Methods,HTMLElement.prototype);copy(Element.Methods.Simulated,HTMLElement.prototype,true)}if(F.SpecificElementExtensions){for(var h in Element.Methods.ByTag){var i=findDOMClass(h);if(Object.isUndefined(i))continue;copy(T[h],i.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh)Element.extend.refresh();Element.cache={}};document.viewport={getDimensions:function(){var a={};var B=Prototype.Browser;$w('width height').each(function(d){var D=d.capitalize();a[d]=(B.WebKit&&!document.evaluate)?self['inner'+D]:(B.Opera)?document.body['client'+D]:document.documentElement['client'+D]});return a},getWidth:function(){return this.getDimensions().width},getHeight:function(){return this.getDimensions().height},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)}};var Selector=Class.create({initialize:function(a){this.expression=a.strip();this.compileMatcher()},shouldUseXPath:function(){if(!Prototype.BrowserFeatures.XPath)return false;var e=this.expression;if(Prototype.Browser.WebKit&&(e.include("-of-type")||e.include(":empty")))return false;if((/(\[[\w-]*?:|:checked)/).test(this.expression))return false;return true},compileMatcher:function(){if(this.shouldUseXPath())return this.compileXPathMatcher();var e=this.expression,ps=Selector.patterns,h=Selector.handlers,c=Selector.criteria,le,p,m;if(Selector._cache[e]){this.matcher=Selector._cache[e];return}this.matcher=["this.matcher = function(root) {","var r = root, h = Selector.handlers, c = false, n;"];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){p=ps[i];if(m=e.match(p)){this.matcher.push(Object.isFunction(c[i])?c[i](m):new Template(c[i]).evaluate(m));e=e.replace(m[0],'');break}}}this.matcher.push("return h.unique(n);\n}");eval(this.matcher.join('\n'));Selector._cache[this.expression]=this.matcher},compileXPathMatcher:function(){var e=this.expression,ps=Selector.patterns,x=Selector.xpath,le,m;if(Selector._cache[e]){this.xpath=Selector._cache[e];return}this.matcher=['.//*'];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in ps){if(m=e.match(ps[i])){this.matcher.push(Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m));e=e.replace(m[0],'');break}}}this.xpath=this.matcher.join('');Selector._cache[this.expression]=this.xpath},findElements:function(a){a=a||document;if(this.xpath)return document._getElementsByXPath(this.xpath,a);return this.matcher(a)},match:function(a){this.tokens=[];var e=this.expression,ps=Selector.patterns,as=Selector.assertions;var b,p,m;while(e&&b!==e&&(/\S/).test(e)){b=e;for(var i in ps){p=ps[i];if(m=e.match(p)){if(as[i]){this.tokens.push([i,Object.clone(m)]);e=e.replace(m[0],'')}else{return this.findElements(document).include(a)}}}}var c=true,name,matches;for(var i=0,token;token=this.tokens[i];i++){name=token[0],matches=token[1];if(!Selector.assertions[name](a,matches)){c=false;break}}return c},toString:function(){return this.expression},inspect:function(){return"#<Selector:"+this.expression.inspect()+">"}});Object.extend(Selector,{_cache:{},xpath:{descendant:"//*",child:"/*",adjacent:"/following-sibling::*[1]",laterSibling:'/following-sibling::*',tagName:function(m){if(m[1]=='*')return'';return"[local-name()='"+m[1].toLowerCase()+"' or local-name()='"+m[1].toUpperCase()+"']"},className:"[contains(concat(' ', @class, ' '), ' #{1} ')]",id:"[@id='#{1}']",attrPresence:function(m){m[1]=m[1].toLowerCase();return new Template("[@#{1}]").evaluate(m)},attr:function(m){m[1]=m[1].toLowerCase();m[3]=m[5]||m[6];return new Template(Selector.xpath.operators[m[2]]).evaluate(m)},pseudo:function(m){var h=Selector.xpath.pseudos[m[1]];if(!h)return'';if(Object.isFunction(h))return h(m);return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m)},operators:{'=':"[@#{1}='#{3}']",'!=':"[@#{1}!='#{3}']",'^=':"[starts-with(@#{1}, '#{3}')]",'$=':"[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",'*=':"[contains(@#{1}, '#{3}')]",'~=':"[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",'|=':"[contains(concat('-', @#{1}, '-'), '-#{3}-')]"},pseudos:{'first-child':'[not(preceding-sibling::*)]','last-child':'[not(following-sibling::*)]','only-child':'[not(preceding-sibling::* or following-sibling::*)]','empty':"[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",'checked':"[@checked]",'disabled':"[@disabled]",'enabled':"[not(@disabled)]",'not':function(m){var e=m[6],p=Selector.patterns,x=Selector.xpath,le,v;var a=[];while(e&&le!=e&&(/\S/).test(e)){le=e;for(var i in p){if(m=e.match(p[i])){v=Object.isFunction(x[i])?x[i](m):new Template(x[i]).evaluate(m);a.push("("+v.substring(1,v.length-1)+")");e=e.replace(m[0],'');break}}}return"[not("+a.join(" and ")+")]"},'nth-child':function(m){return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ",m)},'nth-last-child':function(m){return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ",m)},'nth-of-type':function(m){return Selector.xpath.pseudos.nth("position() ",m)},'nth-last-of-type':function(m){return Selector.xpath.pseudos.nth("(last() + 1 - position()) ",m)},'first-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-of-type'](m)},'last-of-type':function(m){m[6]="1";return Selector.xpath.pseudos['nth-last-of-type'](m)},'only-of-type':function(m){var p=Selector.xpath.pseudos;return p['first-of-type'](m)+p['last-of-type'](m)},nth:function(c,m){var d,formula=m[6],predicate;if(formula=='even')formula='2n+0';if(formula=='odd')formula='2n+1';if(d=formula.match(/^(\d+)$/))return'['+c+"= "+d[1]+']';if(d=formula.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(d[1]=="-")d[1]=-1;var a=d[1]?Number(d[1]):1;var b=d[2]?Number(d[2]):0;predicate="[((#{fragment} - #{b}) mod #{a} = 0) and "+"((#{fragment} - #{b}) div #{a} >= 0)]";return new Template(predicate).evaluate({fragment:c,a:a,b:b})}}}},criteria:{tagName:'n = h.tagName(n, r, "#{1}", c);      c = false;',className:'n = h.className(n, r, "#{1}", c);    c = false;',id:'n = h.id(n, r, "#{1}", c);           c = false;',attrPresence:'n = h.attrPresence(n, r, "#{1}", c); c = false;',attr:function(m){m[3]=(m[5]||m[6]);return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}", c); c = false;').evaluate(m)},pseudo:function(m){if(m[6])m[6]=m[6].replace(/"/g,'\\"');return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m)},descendant:'c = "descendant";',child:'c = "child";',adjacent:'c = "adjacent";',laterSibling:'c = "laterSibling";'},patterns:{laterSibling:/^\s*~\s*/,child:/^\s*>\s*/,adjacent:/^\s*\+\s*/,descendant:/^\s/,tagName:/^\s*(\*|[\w\-]+)(\b|$)?/,id:/^#([\w\-\*]+)(\b|$)/,className:/^\.([\w\-\*]+)(\b|$)/,pseudo:/^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s|[:+~>]))/,attrPresence:/^\[([\w]+)\]/,attr:/\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/},assertions:{tagName:function(a,b){return b[1].toUpperCase()==a.tagName.toUpperCase()},className:function(a,b){return Element.hasClassName(a,b[1])},id:function(a,b){return a.id===b[1]},attrPresence:function(a,b){return Element.hasAttribute(a,b[1])},attr:function(a,b){var c=Element.readAttribute(a,b[1]);return c&&Selector.operators[b[2]](c,b[5]||b[6])}},handlers:{concat:function(a,b){for(var i=0,node;node=b[i];i++)a.push(node);return a},mark:function(a){var b=Prototype.emptyFunction;for(var i=0,node;node=a[i];i++)node._countedByPrototype=b;return a},unmark:function(a){for(var i=0,node;node=a[i];i++)node._countedByPrototype=undefined;return a},index:function(a,b,c){a._countedByPrototype=Prototype.emptyFunction;if(b){for(var d=a.childNodes,i=d.length-1,j=1;i>=0;i--){var e=d[i];if(e.nodeType==1&&(!c||e._countedByPrototype))e.nodeIndex=j++}}else{for(var i=0,j=1,d=a.childNodes;e=d[i];i++)if(e.nodeType==1&&(!c||e._countedByPrototype))e.nodeIndex=j++}},unique:function(a){if(a.length==0)return a;var b=[],n;for(var i=0,l=a.length;i<l;i++)if(!(n=a[i])._countedByPrototype){n._countedByPrototype=Prototype.emptyFunction;b.push(Element.extend(n))}return Selector.handlers.unmark(b)},descendant:function(a){var h=Selector.handlers;for(var i=0,results=[],node;node=a[i];i++)h.concat(results,node.getElementsByTagName('*'));return results},child:function(a){var h=Selector.handlers;for(var i=0,results=[],node;node=a[i];i++){for(var j=0,child;child=node.childNodes[j];j++)if(child.nodeType==1&&child.tagName!='!')results.push(child)}return results},adjacent:function(a){for(var i=0,results=[],node;node=a[i];i++){var b=this.nextElementSibling(node);if(b)results.push(b)}return results},laterSibling:function(a){var h=Selector.handlers;for(var i=0,results=[],node;node=a[i];i++)h.concat(results,Element.nextSiblings(node));return results},nextElementSibling:function(a){while(a=a.nextSibling)if(a.nodeType==1)return a;return null},previousElementSibling:function(a){while(a=a.previousSibling)if(a.nodeType==1)return a;return null},tagName:function(a,b,c,d){var e=c.toUpperCase();var f=[],h=Selector.handlers;if(a){if(d){if(d=="descendant"){for(var i=0,node;node=a[i];i++)h.concat(f,node.getElementsByTagName(c));return f}else a=this[d](a);if(c=="*")return a}for(var i=0,node;node=a[i];i++)if(node.tagName.toUpperCase()===e)f.push(node);return f}else return b.getElementsByTagName(c)},id:function(a,b,c,d){var e=$(c),h=Selector.handlers;if(!e)return[];if(!a&&b==document)return[e];if(a){if(d){if(d=='child'){for(var i=0,node;node=a[i];i++)if(e.parentNode==node)return[e]}else if(d=='descendant'){for(var i=0,node;node=a[i];i++)if(Element.descendantOf(e,node))return[e]}else if(d=='adjacent'){for(var i=0,node;node=a[i];i++)if(Selector.handlers.previousElementSibling(e)==node)return[e]}else a=h[d](a)}for(var i=0,node;node=a[i];i++)if(node==e)return[e];return[]}return(e&&Element.descendantOf(e,b))?[e]:[]},className:function(a,b,c,d){if(a&&d)a=this[d](a);return Selector.handlers.byClassName(a,b,c)},byClassName:function(a,b,c){if(!a)a=Selector.handlers.descendant([b]);var d=' '+c+' ';for(var i=0,results=[],node,nodeClassName;node=a[i];i++){nodeClassName=node.className;if(nodeClassName.length==0)continue;if(nodeClassName==c||(' '+nodeClassName+' ').include(d))results.push(node)}return results},attrPresence:function(a,b,c,d){if(!a)a=b.getElementsByTagName("*");if(a&&d)a=this[d](a);var e=[];for(var i=0,node;node=a[i];i++)if(Element.hasAttribute(node,c))e.push(node);return e},attr:function(a,b,c,d,e,f){if(!a)a=b.getElementsByTagName("*");if(a&&f)a=this[f](a);var g=Selector.operators[e],results=[];for(var i=0,node;node=a[i];i++){var h=Element.readAttribute(node,c);if(h===null)continue;if(g(h,d))results.push(node)}return results},pseudo:function(a,b,c,d,e){if(a&&e)a=this[e](a);if(!a)a=d.getElementsByTagName("*");return Selector.pseudos[b](a,c,d)}},pseudos:{'first-child':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++){if(Selector.handlers.previousElementSibling(node))continue;results.push(node)}return results},'last-child':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++){if(Selector.handlers.nextElementSibling(node))continue;results.push(node)}return results},'only-child':function(a,b,c){var h=Selector.handlers;for(var i=0,results=[],node;node=a[i];i++)if(!h.previousElementSibling(node)&&!h.nextElementSibling(node))results.push(node);return results},'nth-child':function(a,b,c){return Selector.pseudos.nth(a,b,c)},'nth-last-child':function(a,b,c){return Selector.pseudos.nth(a,b,c,true)},'nth-of-type':function(a,b,c){return Selector.pseudos.nth(a,b,c,false,true)},'nth-last-of-type':function(a,b,c){return Selector.pseudos.nth(a,b,c,true,true)},'first-of-type':function(a,b,c){return Selector.pseudos.nth(a,"1",c,false,true)},'last-of-type':function(a,b,c){return Selector.pseudos.nth(a,"1",c,true,true)},'only-of-type':function(a,b,c){var p=Selector.pseudos;return p['last-of-type'](p['first-of-type'](a,b,c),b,c)},getIndices:function(a,b,d){if(a==0)return b>0?[b]:[];return $R(1,d).inject([],function(c,i){if(0==(i-b)%a&&(i-b)/a>=0)c.push(i);return c})},nth:function(c,d,e,f,g){if(c.length==0)return[];if(d=='even')d='2n+0';if(d=='odd')d='2n+1';var h=Selector.handlers,results=[],indexed=[],m;h.mark(c);for(var i=0,node;node=c[i];i++){if(!node.parentNode._countedByPrototype){h.index(node.parentNode,f,g);indexed.push(node.parentNode)}}if(d.match(/^\d+$/)){d=Number(d);for(var i=0,node;node=c[i];i++)if(node.nodeIndex==d)results.push(node)}else if(m=d.match(/^(-?\d*)?n(([+-])(\d+))?/)){if(m[1]=="-")m[1]=-1;var a=m[1]?Number(m[1]):1;var b=m[2]?Number(m[2]):0;var k=Selector.pseudos.getIndices(a,b,c.length);for(var i=0,node,l=k.length;node=c[i];i++){for(var j=0;j<l;j++)if(node.nodeIndex==k[j])results.push(node)}}h.unmark(c);h.unmark(indexed);return results},'empty':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++){if(node.tagName=='!'||(node.firstChild&&!node.innerHTML.match(/^\s*$/)))continue;results.push(node)}return results},'not':function(a,b,c){var h=Selector.handlers,selectorType,m;var d=new Selector(b).findElements(c);h.mark(d);for(var i=0,results=[],node;node=a[i];i++)if(!node._countedByPrototype)results.push(node);h.unmark(d);return results},'enabled':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++)if(!node.disabled)results.push(node);return results},'disabled':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++)if(node.disabled)results.push(node);return results},'checked':function(a,b,c){for(var i=0,results=[],node;node=a[i];i++)if(node.checked)results.push(node);return results}},operators:{'=':function(a,v){return a==v},'!=':function(a,v){return a!=v},'^=':function(a,v){return a.startsWith(v)},'$=':function(a,v){return a.endsWith(v)},'*=':function(a,v){return a.include(v)},'~=':function(a,v){return(' '+a+' ').include(' '+v+' ')},'|=':function(a,v){return('-'+a.toUpperCase()+'-').include('-'+v.toUpperCase()+'-')}},split:function(a){var b=[];a.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/,function(m){b.push(m[1].strip())});return b},matchElements:function(a,b){var c=$$(b),h=Selector.handlers;h.mark(c);for(var i=0,results=[],element;element=a[i];i++)if(element._countedByPrototype)results.push(element);h.unmark(c);return results},findElement:function(a,b,c){if(Object.isNumber(b)){c=b;b=false}return Selector.matchElements(a,b||'*')[c||0]},findChildElements:function(a,b){b=Selector.split(b.join(','));var c=[],h=Selector.handlers;for(var i=0,l=b.length,selector;i<l;i++){selector=new Selector(b[i].strip());h.concat(c,selector.findElements(a))}return(l>1)?h.unique(c):c}});if(Prototype.Browser.IE){Object.extend(Selector.handlers,{concat:function(a,b){for(var i=0,node;node=b[i];i++)if(node.tagName!=="!")a.push(node);return a},unmark:function(a){for(var i=0,node;node=a[i];i++)node.removeAttribute('_countedByPrototype');return a}})}function $$(){return Selector.findChildElements(document,$A(arguments))}var Form={reset:function(a){$(a).reset();return a},serializeElements:function(c,d){if(typeof d!='object')d={hash:!!d};else if(Object.isUndefined(d.hash))d.hash=true;var e,value,submitted=false,submit=d.submit;var f=c.inject({},function(a,b){if(!b.disabled&&b.name){e=b.name;value=$(b).getValue();if(value!=null&&(b.type!='submit'||(!submitted&&submit!==false&&(!submit||e==submit)&&(submitted=true)))){if(e in a){if(!Object.isArray(a[e]))a[e]=[a[e]];a[e].push(value)}else a[e]=value}}return a});return d.hash?f:Object.toQueryString(f)}};Form.Methods={serialize:function(a,b){return Form.serializeElements(Form.getElements(a),b)},getElements:function(c){return $A($(c).getElementsByTagName('*')).inject([],function(a,b){if(Form.Element.Serializers[b.tagName.toLowerCase()])a.push(Element.extend(b));return a})},getInputs:function(a,b,c){a=$(a);var d=a.getElementsByTagName('input');if(!b&&!c)return $A(d).map(Element.extend);for(var i=0,matchingInputs=[],length=d.length;i<length;i++){var e=d[i];if((b&&e.type!=b)||(c&&e.name!=c))continue;matchingInputs.push(Element.extend(e))}return matchingInputs},disable:function(a){a=$(a);Form.getElements(a).invoke('disable');return a},enable:function(a){a=$(a);Form.getElements(a).invoke('enable');return a},findFirstElement:function(b){var c=$(b).getElements().findAll(function(a){return'hidden'!=a.type&&!a.disabled});var d=c.findAll(function(a){return a.hasAttribute('tabIndex')&&a.tabIndex>=0}).sortBy(function(a){return a.tabIndex}).first();return d?d:c.find(function(a){return['input','select','textarea'].include(a.tagName.toLowerCase())})},focusFirstElement:function(a){a=$(a);a.findFirstElement().activate();return a},request:function(a,b){a=$(a),b=Object.clone(b||{});var c=b.parameters,action=a.readAttribute('action')||'';if(action.blank())action=window.location.href;b.parameters=a.serialize(true);if(c){if(Object.isString(c))c=c.toQueryParams();Object.extend(b.parameters,c)}if(a.hasAttribute('method')&&!b.method)b.method=a.method;return new Ajax.Request(action,b)}};Form.Element={focus:function(a){$(a).focus();return a},select:function(a){$(a).select();return a}};Form.Element.Methods={serialize:function(a){a=$(a);if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return''},getValue:function(a){a=$(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)},setValue:function(a,b){a=$(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){$(a).value='';return a},present:function(a){return $(a).value!=''},activate:function(a){a=$(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!='input'||!['button','reset','submit'].include(a.type)))a.select()}catch(e){}return a},disable:function(a){a=$(a);a.blur();a.disabled=true;return a},enable:function(a){a=$(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers={input:function(a,b){switch(a.type.toLowerCase()){case'checkbox':case'radio':return Form.Element.Serializers.inputSelector(a,b);default:return Form.Element.Serializers.textarea(a,b)}},inputSelector:function(a,b){if(Object.isUndefined(b))return a.checked?a.value:null;else a.checked=!!b},textarea:function(a,b){if(Object.isUndefined(b))return a.value;else a.value=b},select:function(a,b){if(Object.isUndefined(b))return this[a.type=='select-one'?'selectOne':'selectMany'](a);else{var c,value,single=!Object.isArray(b);for(var i=0,length=a.length;i<length;i++){c=a.options[i];value=this.optionValue(c);if(single){if(value==b){c.selected=true;return}}else c.selected=b.include(value)}}},selectOne:function(a){var b=a.selectedIndex;return b>=0?this.optionValue(a.options[b]):null},selectMany:function(a){var b,length=a.length;if(!length)return null;for(var i=0,b=[];i<length;i++){var c=a.options[i];if(c.selected)b.push(this.optionValue(c))}return b},optionValue:function(a){return Element.extend(a).hasAttribute('value')?a.value:a.text}};Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,b,c,d){$super(d,c);this.element=$(b);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=$(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=='form')this.registerFormCallbacks();else this.registerCallback(this.element)},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case'checkbox':case'radio':Event.observe(a,'click',this.onElementEvent.bind(this));break;default:Event.observe(a,'change',this.onElementEvent.bind(this));break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)}});if(!window.Event)var Event={};Object.extend(Event,{KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{},relatedTarget:function(a){var b;switch(a.type){case'mouseover':b=a.fromElement;break;case'mouseout':b=a.toElement;break;default:return null}return Element.extend(b)}});Event.Methods=(function(){var e;if(Prototype.Browser.IE){var f={0:1,1:4,2:2};e=function(a,b){return a.button==f[b]}}else if(Prototype.Browser.WebKit){e=function(a,b){switch(b){case 0:return a.which==1&&!a.metaKey;case 1:return a.which==1&&a.metaKey;default:return false}}}else{e=function(a,b){return a.which?(a.which===b+1):(a.button===b)}}return{isLeftClick:function(a){return e(a,0)},isMiddleClick:function(a){return e(a,1)},isRightClick:function(a){return e(a,2)},element:function(a){var b=Event.extend(a).target;return Element.extend(b.nodeType==Node.TEXT_NODE?b.parentNode:b)},findElement:function(a,b){var c=Event.element(a);if(!b)return c;var d=[c].concat(c.ancestors());return Selector.findElement(d,b,0)},pointer:function(a){return{x:a.pageX||(a.clientX+(document.documentElement.scrollLeft||document.body.scrollLeft)),y:a.pageY||(a.clientY+(document.documentElement.scrollTop||document.body.scrollTop))}},pointerX:function(a){return Event.pointer(a).x},pointerY:function(a){return Event.pointer(a).y},stop:function(a){Event.extend(a);a.preventDefault();a.stopPropagation();a.stopped=true}}})();Event.extend=(function(){var c=Object.keys(Event.Methods).inject({},function(m,a){m[a]=Event.Methods[a].methodize();return m});if(Prototype.Browser.IE){Object.extend(c,{stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}});return function(a){if(!a)return false;if(a._extendedByPrototype)return a;a._extendedByPrototype=Prototype.emptyFunction;var b=Event.pointer(a);Object.extend(a,{target:a.srcElement,relatedTarget:Event.relatedTarget(a),pageX:b.x,pageY:b.y});return Object.extend(a,c)}}else{Event.prototype=Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(Event.prototype,c);return Prototype.K}})();Object.extend(Event,(function(){var h=Event.cache;function getEventID(a){if(a._prototypeEventID)return a._prototypeEventID[0];arguments.callee.id=arguments.callee.id||1;return a._prototypeEventID=[++arguments.callee.id]}function getDOMEventName(a){if(a&&a.include(':'))return"dataavailable";return a}function getCacheForID(a){return h[a]=h[a]||{}}function getWrappersForEventName(a,b){var c=getCacheForID(a);return c[b]=c[b]||[]}function createWrapper(b,d,e){var f=getEventID(b);var c=getWrappersForEventName(f,d);if(c.pluck("handler").include(e))return false;var g=function(a){if(!Event||!Event.extend||(a.eventName&&a.eventName!=d))return false;Event.extend(a);e.call(b,a)};g.handler=e;c.push(g);return g}function findWrapper(b,d,e){var c=getWrappersForEventName(b,d);return c.find(function(a){return a.handler==e})}function destroyWrapper(a,b,d){var c=getCacheForID(a);if(!c[b])return false;c[b]=c[b].without(findWrapper(a,b,d))}function destroyCache(){for(var a in h)for(var b in h[a])h[a][b]=null}if(window.attachEvent){window.attachEvent("onunload",destroyCache)}return{observe:function(a,b,c){a=$(a);var d=getDOMEventName(b);var e=createWrapper(a,b,c);if(!e)return a;if(a.addEventListener){a.addEventListener(d,e,false)}else{a.attachEvent("on"+d,e)}return a},stopObserving:function(b,c,d){b=$(b);var e=getEventID(b),name=getDOMEventName(c);if(!d&&c){getWrappersForEventName(e,c).each(function(a){b.stopObserving(c,a.handler)});return b}else if(!c){Object.keys(getCacheForID(e)).each(function(a){b.stopObserving(a)});return b}var f=findWrapper(e,c,d);if(!f)return b;if(b.removeEventListener){b.removeEventListener(name,f,false)}else{b.detachEvent("on"+name,f)}destroyWrapper(e,c,d);return b},fire:function(a,b,c){a=$(a);if(a==document&&document.createEvent&&!a.dispatchEvent)a=document.documentElement;var d;if(document.createEvent){d=document.createEvent("HTMLEvents");d.initEvent("dataavailable",true,true)}else{d=document.createEventObject();d.eventType="ondataavailable"}d.eventName=b;d.memo=c||{};if(document.createEvent){a.dispatchEvent(d)}else{a.fireEvent(d.eventType,d)}return Event.extend(d)}}})());Object.extend(Event,Event.Methods);Element.addMethods({fire:Event.fire,observe:Event.observe,stopObserving:Event.stopObserving});Object.extend(document,{fire:Element.Methods.fire.methodize(),observe:Element.Methods.observe.methodize(),stopObserving:Element.Methods.stopObserving.methodize(),loaded:false});(function(){var a;function fireContentLoadedEvent(){if(document.loaded)return;if(a)window.clearInterval(a);document.fire("dom:loaded");document.loaded=true}if(document.addEventListener){if(Prototype.Browser.WebKit){a=window.setInterval(function(){if(/loaded|complete/.test(document.readyState))fireContentLoadedEvent()},0);Event.observe(window,"load",fireContentLoadedEvent)}else{document.addEventListener("DOMContentLoaded",fireContentLoadedEvent,false)}}else{document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");$("__onDOMContentLoaded").onreadystatechange=function(){if(this.readyState=="complete"){this.onreadystatechange=null;fireContentLoadedEvent()}}}})();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(a,x,y){if(this.includeScrollOffsets)return this.withinIncludingScrolloffsets(a,x,y);this.xcomp=x;this.ycomp=y;this.offset=Element.cumulativeOffset(a);return(y>=this.offset[1]&&y<this.offset[1]+a.offsetHeight&&x>=this.offset[0]&&x<this.offset[0]+a.offsetWidth)},withinIncludingScrolloffsets:function(a,x,y){var b=Element.cumulativeScrollOffset(a);this.xcomp=x+b[0]-this.deltaX;this.ycomp=y+b[1]-this.deltaY;this.offset=Element.cumulativeOffset(a);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+a.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+a.offsetWidth)},overlap:function(a,b){if(!a)return 0;if(a=='vertical')return((this.offset[1]+b.offsetHeight)-this.ycomp)/b.offsetHeight;if(a=='horizontal')return((this.offset[0]+b.offsetWidth)-this.xcomp)/b.offsetWidth},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(a,b,c){c=c||{};return Element.clonePosition(b,a,c)}};if(!document.getElementsByClassName)document.getElementsByClassName=function(f){function iter(a){return a.blank()?null:"[contains(concat(' ', @class, ' '), ' "+a+" ')]"}f.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(a,b){b=b.toString().strip();var c=/\s/.test(b)?$w(b).map(iter).join(''):iter(b);return c?document._getElementsByXPath('.//*'+c,a):[]}:function(b,c){c=c.toString().strip();var d=[],classNames=(/\s/.test(c)?$w(c):null);if(!classNames&&!c)return d;var e=$(b).getElementsByTagName('*');c=' '+c+' ';for(var i=0,child,cn;child=e[i];i++){if(child.className&&(cn=' '+child.className+' ')&&(cn.include(c)||(classNames&&classNames.all(function(a){return!a.toString().blank()&&cn.include(' '+a+' ')}))))d.push(Element.extend(child))}return d};return function(a,b){return $(b||document.body).getElementsByClassName(a)}}(Element.Methods);Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=$(a)},_each:function(b){this.element.className.split(/\s+/).select(function(a){return a.length>0})._each(b)},set:function(a){this.element.className=a},add:function(a){if(this.include(a))return;this.set($A(this).concat(a).join(' '))},remove:function(a){if(!this.include(a))return;this.set($A(this).without(a).join(' '))},toString:function(){return $A(this).join(' ')}};Object.extend(Element.ClassNames.prototype,Enumerable);Element.addMethods();
//scriptaculous.js
var Scriptaculous={Version:'1.8.1',require:function(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>')},REQUIRED_PROTOTYPE:'1.6.0',load:function(){function convertVersionString(a){var r=a.split('.');return parseInt(r[0])*100000+parseInt(r[1])*1000+parseInt(r[2])}if((typeof Prototype=='undefined')||(typeof Element=='undefined')||(typeof Element.Methods=='undefined')||(convertVersionString(Prototype.Version)<convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))throw("script.aculo.us requires the Prototype JavaScript framework >= "+Scriptaculous.REQUIRED_PROTOTYPE);var d=/(proto|scripta)culous[a-z0-9._-]*\.js(\?.*)?$/;$A(document.getElementsByTagName("script")).findAll(function(s){return(s.src&&s.src.match(d))}).each(function(s){var b=s.src.replace(d,'');var c=(s.src.match(/\?.*load=([a-z,]*)/)||['',''])[1];c.split(',').without('').each(function(a){Scriptaculous.require(b+a+'.js')})})}};
//effects.js
String.prototype.parseColor=function(){var a='#';if(this.slice(0,4)=='rgb('){var b=this.slice(4,this.length-1).split(',');var i=0;do{a+=parseInt(b[i]).toColorPart()}while(++i<3)}else{if(this.slice(0,1)=='#'){if(this.length==4)for(var i=1;i<4;i++)a+=(this.charAt(i)+this.charAt(i)).toLowerCase();if(this.length==7)a=this.toLowerCase()}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(b){return $A($(b).childNodes).collect(function(a){return(a.nodeType==3?a.nodeValue:(a.hasChildNodes()?Element.collectTextNodes(a):''))}).flatten().join('')};Element.collectTextNodesIgnoreClass=function(b,c){return $A($(b).childNodes).collect(function(a){return(a.nodeType==3?a.nodeValue:((a.hasChildNodes()&&!Element.hasClassName(a,c))?Element.collectTextNodesIgnoreClass(a,c):''))}).flatten().join('')};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+'em'});if(Prototype.Browser.WebKit)window.scrollBy(0,0);return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||''};Element.forceRerendering=function(a){try{a=$(a);var n=document.createTextNode(' ');a.appendChild(n);a.removeChild(n)}catch(e){}};var Effect={_elementDoesNotExistError:{name:'ElementDoesNotExistError',message:'The specified DOM element does not exist, but is required for this effect to operate'},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(a,b){b=b||5;return(((a%(1/b))*b).round()==0?((a*b*2)-(a*b*2).floor()):1-((a*b*2)-(a*b*2).floor()))},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1.0,fps:100,sync:false,from:0.0,to:1.0,delay:0.0,queue:'parallel'},tagifyText:function(c){var d='position:relative';if(Prototype.Browser.IE)d+=';zoom:1';c=$(c);$A(c.childNodes).each(function(b){if(b.nodeType==3){b.nodeValue.toArray().each(function(a){c.insertBefore(new Element('span',{style:d}).update(a==' '?String.fromCharCode(160):a),b)});Element.remove(b)}})},multiple:function(c,d){var e;if(((typeof c=='object')||Object.isFunction(c))&&(c.length))e=c;else e=$(c).childNodes;var f=Object.extend({speed:0.1,delay:0.0},arguments[2]||{});var g=f.delay;$A(e).each(function(a,b){new d(a,Object.extend(f,{delay:b*f.speed+g}))})},PAIRS:{'slide':['SlideDown','SlideUp'],'blind':['BlindDown','BlindUp'],'appear':['Appear','Fade']},toggle:function(a,b){a=$(a);b=(b||'appear').toLowerCase();var c=Object.extend({queue:{position:'end',scope:(a.id||'global'),limit:1}},arguments[2]||{});Effect[a.visible()?Effect.PAIRS[b][1]:Effect.PAIRS[b][0]](a,c)}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];this.interval=null},_each:function(a){this.effects._each(a)},add:function(a){var b=new Date().getTime();var c=Object.isString(a.options.queue)?a.options.queue:a.options.queue.position;switch(c){case'front':this.effects.findAll(function(e){return e.state=='idle'}).each(function(e){e.startOn+=a.finishOn;e.finishOn+=a.finishOn});break;case'with-last':b=this.effects.pluck('startOn').max()||b;break;case'end':b=this.effects.pluck('finishOn').max()||b;break}a.startOn+=b;a.finishOn+=b;if(!a.options.queue.limit||(this.effects.length<a.options.queue.limit))this.effects.push(a);if(!this.interval)this.interval=setInterval(this.loop.bind(this),15)},remove:function(a){this.effects=this.effects.reject(function(e){return e==a});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var a=new Date().getTime();for(var i=0,len=this.effects.length;i<len;i++)this.effects[i]&&this.effects[i].loop(a)}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a))return a;return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get('global');Effect.Base=Class.create({position:null,start:function(c){function codeForEvent(a,b){return((a[b+'Internal']?'this.options.'+b+'Internal(this);':'')+(a[b]?'this.options.'+b+'(this);':''))}if(c&&c.transition===false)c.transition=Effect.Transitions.linear;this.options=Object.extend(Object.extend({},Effect.DefaultOptions),c||{});this.currentFrame=0;this.state='idle';this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;this.totalFrames=this.options.fps*this.options.duration;eval('this.render = function(pos){ '+'if (this.state=="idle"){this.state="running";'+codeForEvent(this.options,'beforeSetup')+(this.setup?'this.setup();':'')+codeForEvent(this.options,'afterSetup')+'};if (this.state=="running"){'+'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+'this.position=pos;'+codeForEvent(this.options,'beforeUpdate')+(this.update?'this.update(pos);':'')+codeForEvent(this.options,'afterUpdate')+'}}');this.event('beforeStart');if(!this.options.sync)Effect.Queues.get(Object.isString(this.options.queue)?'global':this.options.queue.scope).add(this)},loop:function(a){if(a>=this.startOn){if(a>=this.finishOn){this.render(1.0);this.cancel();this.event('beforeFinish');if(this.finish)this.finish();this.event('afterFinish');return}var b=(a-this.startOn)/this.totalTime,frame=(b*this.totalFrames).round();if(frame>this.currentFrame){this.render(b);this.currentFrame=frame}}},cancel:function(){if(!this.options.sync)Effect.Queues.get(Object.isString(this.options.queue)?'global':this.options.queue.scope).remove(this);this.state='finished'},event:function(a){if(this.options[a+'Internal'])this.options[a+'Internal'](this);if(this.options[a])this.options[a](this)},inspect:function(){var a=$H();for(property in this)if(!Object.isFunction(this[property]))a.set(property,this[property]);return'#<Effect:'+a.inspect()+',options:'+$H(this.options).inspect()+'>'}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke('render',a)},finish:function(b){this.effects.each(function(a){a.render(1.0);a.cancel();a.event('beforeFinish');if(a.finish)a.finish(b);a.event('afterFinish')})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(b,c,d){b=Object.isString(b)?$(b):b;var e=$A(arguments),method=e.last(),options=e.length==5?e[3]:null;this.method=Object.isFunction(method)?method.bind(b):Object.isFunction(b[method])?b[method].bind(b):function(a){b[method]=a};this.start(Object.extend({from:c,to:d},options||{}))},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(a){this.element=$(a);if(!this.element)throw(Effect._elementDoesNotExistError);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout))this.element.setStyle({zoom:1});var b=Object.extend({from:this.element.getOpacity()||0.0,to:1.0},arguments[1]||{});this.start(b)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(a){this.element=$(a);if(!this.element)throw(Effect._elementDoesNotExistError);var b=Object.extend({x:0,y:0,mode:'relative'},arguments[1]||{});this.start(b)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle('left')||'0');this.originalTop=parseFloat(this.element.getStyle('top')||'0');if(this.options.mode=='absolute'){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+'px',top:(this.options.y*a+this.originalTop).round()+'px'})}});Effect.MoveBy=function(a,b,c){return new Effect.Move(a,Object.extend({x:c,y:b},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(a,b){this.element=$(a);if(!this.element)throw(Effect._elementDoesNotExistError);var c=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:'box',scaleFrom:100.0,scaleTo:b},arguments[2]||{});this.start(c)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;this.elementPositioning=this.element.getStyle('position');this.originalStyle={};['top','left','width','height','fontSize'].each(function(k){this.originalStyle[k]=this.element.style[k]}.bind(this));this.originalTop=this.element.offsetTop;this.originalLeft=this.element.offsetLeft;var b=this.element.getStyle('font-size')||'100%';['em','px','%','pt'].each(function(a){if(b.indexOf(a)>0){this.fontSize=parseFloat(b);this.fontSizeType=a}}.bind(this));this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=='box')this.dims=[this.element.offsetHeight,this.element.offsetWidth];if(/^content/.test(this.options.scaleMode))this.dims=[this.element.scrollHeight,this.element.scrollWidth];if(!this.dims)this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]},update:function(a){var b=(this.options.scaleFrom/100.0)+(this.factor*a);if(this.options.scaleContent&&this.fontSize)this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType});this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish)this.element.setStyle(this.originalStyle)},setDimensions:function(a,b){var d={};if(this.options.scaleX)d.width=b.round()+'px';if(this.options.scaleY)d.height=a.round()+'px';if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var e=(b-this.dims[1])/2;if(this.elementPositioning=='absolute'){if(this.options.scaleY)d.top=this.originalTop-c+'px';if(this.options.scaleX)d.left=this.originalLeft-e+'px'}else{if(this.options.scaleY)d.top=-c+'px';if(this.options.scaleX)d.left=-e+'px'}}this.element.setStyle(d)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(a){this.element=$(a);if(!this.element)throw(Effect._elementDoesNotExistError);var b=Object.extend({startcolor:'#ffff99'},arguments[1]||{});this.start(b)},setup:function(){if(this.element.getStyle('display')=='none'){this.cancel();return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle('background-image');this.element.setStyle({backgroundImage:'none'})}if(!this.options.endcolor)this.options.endcolor=this.element.getStyle('background-color').parseColor('#ffffff');if(!this.options.restorecolor)this.options.restorecolor=this.element.getStyle('background-color');this._base=$R(0,2).map(function(i){return parseInt(this.options.startcolor.slice(i*2+1,i*2+3),16)}.bind(this));this._delta=$R(0,2).map(function(i){return parseInt(this.options.endcolor.slice(i*2+1,i*2+3),16)-this._base[i]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject('#',function(m,v,i){return m+((this._base[i]+(this._delta[i]*a)).round().toColorPart())}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(a){var b=arguments[1]||{},scrollOffsets=document.viewport.getScrollOffsets(),elementOffsets=$(a).cumulativeOffset(),max=document.viewport.getScrollOffsets[0]-document.viewport.getHeight();if(b.offset)elementOffsets[1]+=b.offset;return new Effect.Tween(null,scrollOffsets.top,elementOffsets[1]>max?max:elementOffsets[1],b,function(p){scrollTo(scrollOffsets.left,p.round())})};Effect.Fade=function(b){b=$(b);var c=b.getInlineOpacity();var d=Object.extend({from:b.getOpacity()||1.0,to:0.0,afterFinishInternal:function(a){if(a.options.to!=0)return;a.element.hide().setStyle({opacity:c})}},arguments[1]||{});return new Effect.Opacity(b,d)};Effect.Appear=function(b){b=$(b);var c=Object.extend({from:(b.getStyle('display')=='none'?0.0:b.getOpacity()||0.0),to:1.0,afterFinishInternal:function(a){a.element.forceRerendering()},beforeSetup:function(a){a.element.setOpacity(a.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,c)};Effect.Puff=function(b){b=$(b);var c={opacity:b.getInlineOpacity(),position:b.getStyle('position'),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0.0})],Object.extend({duration:1.0,beforeSetupInternal:function(a){Position.absolutize(a.effects[0].element)},afterFinishInternal:function(a){a.effects[0].element.hide().setStyle(c)}},arguments[1]||{}))};Effect.BlindUp=function(b){b=$(b);b.makeClipping();return new Effect.Scale(b,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(a){a.element.hide().undoClipping()}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var c=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:c.height,originalWidth:c.width},restoreAfterFinish:true,afterSetup:function(a){a.element.makeClipping().setStyle({height:'0px'}).show()},afterFinishInternal:function(a){a.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(c){c=$(c);var d=c.getInlineOpacity();return new Effect.Appear(c,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(b){new Effect.Scale(b.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(a){a.element.makePositioned().makeClipping()},afterFinishInternal:function(a){a.element.hide().undoClipping().undoPositioned().setStyle({opacity:d})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var c={top:b.getStyle('top'),left:b.getStyle('left'),opacity:b.getInlineOpacity()};return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0.0})],Object.extend({duration:0.5,beforeSetup:function(a){a.effects[0].element.makePositioned()},afterFinishInternal:function(a){a.effects[0].element.hide().undoPositioned().setStyle(c)}},arguments[1]||{}))};Effect.Shake=function(g){g=$(g);var h=Object.extend({distance:20,duration:0.5},arguments[1]||{});var i=parseFloat(h.distance);var j=parseFloat(h.duration)/10.0;var k={top:g.getStyle('top'),left:g.getStyle('left')};return new Effect.Move(g,{x:i,y:0,duration:j,afterFinishInternal:function(f){new Effect.Move(f.element,{x:-i*2,y:0,duration:j*2,afterFinishInternal:function(e){new Effect.Move(e.element,{x:i*2,y:0,duration:j*2,afterFinishInternal:function(d){new Effect.Move(d.element,{x:-i*2,y:0,duration:j*2,afterFinishInternal:function(c){new Effect.Move(c.element,{x:i*2,y:0,duration:j*2,afterFinishInternal:function(b){new Effect.Move(b.element,{x:-i,y:0,duration:j,afterFinishInternal:function(a){a.element.undoPositioned().setStyle(k)}})}})}})}})}})}})};Effect.SlideDown=function(b){b=$(b).cleanWhitespace();var c=b.down().getStyle('bottom');var d=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(a){a.element.makePositioned();a.element.down().makePositioned();if(window.opera)a.element.setStyle({top:''});a.element.makeClipping().setStyle({height:'0px'}).show()},afterUpdateInternal:function(a){a.element.down().setStyle({bottom:(a.dims[0]-a.element.clientHeight)+'px'})},afterFinishInternal:function(a){a.element.undoClipping().undoPositioned();a.element.down().undoPositioned().setStyle({bottom:c})}},arguments[1]||{}))};Effect.SlideUp=function(b){b=$(b).cleanWhitespace();var c=b.down().getStyle('bottom');var d=b.getDimensions();return new Effect.Scale(b,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:'box',scaleFrom:100,scaleMode:{originalHeight:d.height,originalWidth:d.width},restoreAfterFinish:true,afterSetup:function(a){a.element.makePositioned();a.element.down().makePositioned();if(window.opera)a.element.setStyle({top:''});a.element.makeClipping().show()},afterUpdateInternal:function(a){a.element.down().setStyle({bottom:(a.dims[0]-a.element.clientHeight)+'px'})},afterFinishInternal:function(a){a.element.hide().undoClipping().undoPositioned();a.element.down().undoPositioned().setStyle({bottom:c})}},arguments[1]||{}))};Effect.Squish=function(b){return new Effect.Scale(b,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(a){a.element.makeClipping()},afterFinishInternal:function(a){a.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var d=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});var e={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var f=c.getDimensions();var g,initialMoveY;var h,moveY;switch(d.direction){case'top-left':g=initialMoveY=h=moveY=0;break;case'top-right':g=f.width;initialMoveY=moveY=0;h=-f.width;break;case'bottom-left':g=h=0;initialMoveY=f.height;moveY=-f.height;break;case'bottom-right':g=f.width;initialMoveY=f.height;h=-f.width;moveY=-f.height;break;case'center':g=f.width/2;initialMoveY=f.height/2;h=-f.width/2;moveY=-f.height/2;break}return new Effect.Move(c,{x:g,y:initialMoveY,duration:0.01,beforeSetup:function(a){a.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(b){new Effect.Parallel([new Effect.Opacity(b.element,{sync:true,to:1.0,from:0.0,transition:d.opacityTransition}),new Effect.Move(b.element,{x:h,y:moveY,sync:true,transition:d.moveTransition}),new Effect.Scale(b.element,100,{scaleMode:{originalHeight:f.height,originalWidth:f.width},sync:true,scaleFrom:window.opera?1:0,transition:d.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(a){a.effects[0].element.setStyle({height:'0px'}).show()},afterFinishInternal:function(a){a.effects[0].element.undoClipping().undoPositioned().setStyle(e)}},d))}})};Effect.Shrink=function(b){b=$(b);var c=Object.extend({direction:'center',moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});var d={top:b.style.top,left:b.style.left,height:b.style.height,width:b.style.width,opacity:b.getInlineOpacity()};var e=b.getDimensions();var f,moveY;switch(c.direction){case'top-left':f=moveY=0;break;case'top-right':f=e.width;moveY=0;break;case'bottom-left':f=0;moveY=e.height;break;case'bottom-right':f=e.width;moveY=e.height;break;case'center':f=e.width/2;moveY=e.height/2;break}return new Effect.Parallel([new Effect.Opacity(b,{sync:true,to:0.0,from:1.0,transition:c.opacityTransition}),new Effect.Scale(b,window.opera?1:0,{sync:true,transition:c.scaleTransition,restoreAfterFinish:true}),new Effect.Move(b,{x:f,y:moveY,sync:true,transition:c.moveTransition})],Object.extend({beforeStartInternal:function(a){a.effects[0].element.makePositioned().makeClipping()},afterFinishInternal:function(a){a.effects[0].element.hide().undoClipping().undoPositioned().setStyle(d)}},c))};Effect.Pulsate=function(b){b=$(b);var c=arguments[1]||{};var d=b.getInlineOpacity();var e=c.transition||Effect.Transitions.sinoidal;var f=function(a){return e(1-Effect.Transitions.pulse(a,c.pulses))};f.bind(e);return new Effect.Opacity(b,Object.extend(Object.extend({duration:2.0,from:0,afterFinishInternal:function(a){a.element.setStyle({opacity:d})}},c),{transition:f}))};Effect.Fold=function(c){c=$(c);var d={top:c.style.top,left:c.style.left,width:c.style.width,height:c.style.height};c.makeClipping();return new Effect.Scale(c,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(b){new Effect.Scale(c,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(a){a.element.hide().undoClipping().setStyle(d)}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element)throw(Effect._elementDoesNotExistError);var d=Object.extend({style:{}},arguments[1]||{});if(!Object.isString(d.style))this.style=$H(d.style);else{if(d.style.include(':'))this.style=d.style.parseStyle();else{this.element.addClassName(d.style);this.style=$H(this.element.getStyles());this.element.removeClassName(d.style);var e=this.element.getStyles();this.style=this.style.reject(function(a){return a.value==e[a.key]});d.afterFinishInternal=function(b){b.element.addClassName(b.options.style);b.transforms.each(function(a){b.element.style[a.style]=''})}}}this.start(d)},setup:function(){function parseColor(a){if(!a||['rgba(0, 0, 0, 0)','transparent'].include(a))a='#ffffff';a=a.parseColor();return $R(0,2).map(function(i){return parseInt(a.slice(i*2+1,i*2+3),16)})}this.transforms=this.style.map(function(a){var b=a[0],value=a[1],unit=null;if(value.parseColor('#zzzzzz')!='#zzzzzz'){value=value.parseColor();unit='color'}else if(b=='opacity'){value=parseFloat(value);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout))this.element.setStyle({zoom:1})}else if(Element.CSS_LENGTH.test(value)){var c=value.match(/^([\+\-]?[0-9\.]+)(.*)$/);value=parseFloat(c[1]);unit=(c.length==3)?c[2]:null}var d=this.element.getStyle(b);return{style:b.camelize(),originalValue:unit=='color'?parseColor(d):parseFloat(d||0),targetValue:unit=='color'?parseColor(value):value,unit:unit}}.bind(this)).reject(function(a){return((a.originalValue==a.targetValue)||(a.unit!='color'&&(isNaN(a.originalValue)||isNaN(a.targetValue))))})},update:function(a){var b={},transform,i=this.transforms.length;while(i--)b[(transform=this.transforms[i]).style]=transform.unit=='color'?'#'+(Math.round(transform.originalValue[0]+(transform.targetValue[0]-transform.originalValue[0])*a)).toColorPart()+(Math.round(transform.originalValue[1]+(transform.targetValue[1]-transform.originalValue[1])*a)).toColorPart()+(Math.round(transform.originalValue[2]+(transform.targetValue[2]-transform.originalValue[2])*a)).toColorPart():(transform.originalValue+(transform.targetValue-transform.originalValue)*a).toFixed(3)+(transform.unit===null?'':transform.unit);this.element.setStyle(b,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(c){c.each(function(a){a=$H(a);var b=a.values().first();this.tracks.push($H({ids:a.keys().first(),effect:Effect.Morph,options:{style:b}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var b=a.get('ids'),effect=a.get('effect'),options=a.get('options');var c=[$(b)||$$(b)].flatten();return c.map(function(e){return new effect(e,Object.extend({sync:true},options))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w('backgroundColor backgroundPosition borderBottomColor borderBottomStyle '+'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth '+'borderRightColor borderRightStyle borderRightWidth borderSpacing '+'borderTopColor borderTopStyle borderTopWidth bottom clip color '+'fontSize fontWeight height left letterSpacing lineHeight '+'marginBottom marginLeft marginRight marginTop markerOffset maxHeight '+'maxWidth minHeight minWidth opacity outlineColor outlineOffset '+'outlineWidth paddingBottom paddingLeft paddingRight paddingTop '+'right textIndent top width wordSpacing zIndex');Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement('div');String.prototype.parseStyle=function(){var b,styleRules=$H();if(Prototype.Browser.WebKit)b=new Element('div',{style:this}).style;else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(a){if(b[a])styleRules.set(a,b[a])});if(Prototype.Browser.IE&&this.include('opacity'))styleRules.set('opacity',this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);return styleRules};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(c){var d=document.defaultView.getComputedStyle($(c),null);return Element.CSS_PROPERTIES.inject({},function(a,b){a[b]=d[b];return a})}}else{Element.getStyles=function(c){c=$(c);var d=c.currentStyle,styles;styles=Element.CSS_PROPERTIES.inject({},function(a,b){a[b]=d[b];return a});if(!styles.opacity)styles.opacity=c.getOpacity();return styles}}Effect.Methods={morph:function(a,b){a=$(a);new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a},visualEffect:function(a,b,c){a=$(a);var s=b.dasherize().camelize(),klass=s.charAt(0).toUpperCase()+s.substring(1);new Effect[klass](a,c);return a},highlight:function(a,b){a=$(a);new Effect.Highlight(a,b);return a}};$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+'pulsate shake puff squish switchOff dropOut').each(function(c){Effect.Methods[c]=function(a,b){a=$(a);Effect[c.charAt(0).toUpperCase()+c.substring(1)](a,b);return a}});$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each(function(f){Effect.Methods[f]=Element[f]});Element.addMethods(Effect.Methods);
//load additional files
Scriptaculous.load();
// script.aculo.us slider.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008

// Copyright (c) 2005-2007 Marty Haught, Thomas Fuchs 
//
// script.aculo.us is freely distributable under the terms of an MIT-style license.
// For details, see the script.aculo.us web site: http://script.aculo.us/

if (!Control) var Control = { };

// options:
//  axis: 'vertical', or 'horizontal' (default)
//
// callbacks:
//  onChange(value)
//  onSlide(value)
Control.Slider = Class.create({
  initialize: function(handle, track, options) {
    var slider = this;
    
    if (Object.isArray(handle)) {
      this.handles = handle.collect( function(e) { return $(e) });
    } else {
      this.handles = [$(handle)];
    }
    
    this.track   = $(track);
    this.options = options || { };

    this.axis      = this.options.axis || 'horizontal';
    this.increment = this.options.increment || 1;
    this.step      = parseInt(this.options.step || '1');
    this.range     = this.options.range || $R(0,1);
    
    this.value     = 0; // assure backwards compat
    this.values    = this.handles.map( function() { return 0 });
    this.spans     = this.options.spans ? this.options.spans.map(function(s){ return $(s) }) : false;
    this.options.startSpan = $(this.options.startSpan || null);
    this.options.endSpan   = $(this.options.endSpan || null);

    this.restricted = this.options.restricted || false;

    this.maximum   = this.options.maximum || this.range.end;
    this.minimum   = this.options.minimum || this.range.start;

    // Will be used to align the handle onto the track, if necessary
    this.alignX = parseInt(this.options.alignX || '0');
    this.alignY = parseInt(this.options.alignY || '0');
    
    this.trackLength = this.maximumOffset() - this.minimumOffset();

    this.handleLength = this.isVertical() ? 
      (this.handles[0].offsetHeight != 0 ? 
        this.handles[0].offsetHeight : this.handles[0].style.height.replace(/px$/,"")) : 
      (this.handles[0].offsetWidth != 0 ? this.handles[0].offsetWidth : 
        this.handles[0].style.width.replace(/px$/,""));

    this.active   = false;
    this.dragging = false;
    this.disabled = false;

    if (this.options.disabled) this.setDisabled();

    // Allowed values array
    this.allowedValues = this.options.values ? this.options.values.sortBy(Prototype.K) : false;
    if (this.allowedValues) {
      this.minimum = this.allowedValues.min();
      this.maximum = this.allowedValues.max();
    }

    this.eventMouseDown = this.startDrag.bindAsEventListener(this);
    this.eventMouseUp   = this.endDrag.bindAsEventListener(this);
    this.eventMouseMove = this.update.bindAsEventListener(this);

    // Initialize handles in reverse (make sure first handle is active)
    this.handles.each( function(h,i) {
      i = slider.handles.length-1-i;
      slider.setValue(parseFloat(
        (Object.isArray(slider.options.sliderValue) ? 
          slider.options.sliderValue[i] : slider.options.sliderValue) || 
         slider.range.start), i);
      h.makePositioned().observe("mousedown", slider.eventMouseDown);
    });
    
    this.track.observe("mousedown", this.eventMouseDown);
    document.observe("mouseup", this.eventMouseUp);
    document.observe("mousemove", this.eventMouseMove);
    
    this.initialized = true;
  },
  dispose: function() {
    var slider = this;    
    Event.stopObserving(this.track, "mousedown", this.eventMouseDown);
    Event.stopObserving(document, "mouseup", this.eventMouseUp);
    Event.stopObserving(document, "mousemove", this.eventMouseMove);
    this.handles.each( function(h) {
      Event.stopObserving(h, "mousedown", slider.eventMouseDown);
    });
  },
  setDisabled: function(){
    this.disabled = true;
  },
  setEnabled: function(){
    this.disabled = false;
  },  
  getNearestValue: function(value){
    if (this.allowedValues){
      if (value >= this.allowedValues.max()) return(this.allowedValues.max());
      if (value <= this.allowedValues.min()) return(this.allowedValues.min());
      
      var offset = Math.abs(this.allowedValues[0] - value);
      var newValue = this.allowedValues[0];
      this.allowedValues.each( function(v) {
        var currentOffset = Math.abs(v - value);
        if (currentOffset <= offset){
          newValue = v;
          offset = currentOffset;
        } 
      });
      return newValue;
    }
    if (value > this.range.end) return this.range.end;
    if (value < this.range.start) return this.range.start;
    return value;
  },
  setValue: function(sliderValue, handleIdx){
    if (!this.active) {
      this.activeHandleIdx = handleIdx || 0;
      this.activeHandle    = this.handles[this.activeHandleIdx];
      this.updateStyles();
    }
    handleIdx = handleIdx || this.activeHandleIdx || 0;
    if (this.initialized && this.restricted) {
      if ((handleIdx>0) && (sliderValue<this.values[handleIdx-1]))
        sliderValue = this.values[handleIdx-1];
      if ((handleIdx < (this.handles.length-1)) && (sliderValue>this.values[handleIdx+1]))
        sliderValue = this.values[handleIdx+1];
    }
    sliderValue = this.getNearestValue(sliderValue);
    this.values[handleIdx] = sliderValue;
    this.value = this.values[0]; // assure backwards compat
    
    this.handles[handleIdx].style[this.isVertical() ? 'top' : 'left'] = 
      this.translateToPx(sliderValue);
    
    this.drawSpans();
    if (!this.dragging || !this.event) this.updateFinished();
  },
  setValueBy: function(delta, handleIdx) {
    this.setValue(this.values[handleIdx || this.activeHandleIdx || 0] + delta, 
      handleIdx || this.activeHandleIdx || 0);
  },
  translateToPx: function(value) {
    return Math.round(
      ((this.trackLength-this.handleLength)/(this.range.end-this.range.start)) * 
      (value - this.range.start)) + "px";
  },
  translateToValue: function(offset) {
    return ((offset/(this.trackLength-this.handleLength) * 
      (this.range.end-this.range.start)) + this.range.start);
  },
  getRange: function(range) {
    var v = this.values.sortBy(Prototype.K); 
    range = range || 0;
    return $R(v[range],v[range+1]);
  },
  minimumOffset: function(){
    return(this.isVertical() ? this.alignY : this.alignX);
  },
  maximumOffset: function(){
    return(this.isVertical() ? 
      (this.track.offsetHeight != 0 ? this.track.offsetHeight :
        this.track.style.height.replace(/px$/,"")) - this.alignY : 
      (this.track.offsetWidth != 0 ? this.track.offsetWidth : 
        this.track.style.width.replace(/px$/,"")) - this.alignX);
  },  
  isVertical:  function(){
    return (this.axis == 'vertical');
  },
  drawSpans: function() {
    var slider = this;
    if (this.spans)
      $R(0, this.spans.length-1).each(function(r) { slider.setSpan(slider.spans[r], slider.getRange(r)) });
    if (this.options.startSpan)
      this.setSpan(this.options.startSpan,
        $R(0, this.values.length>1 ? this.getRange(0).min() : this.value ));
    if (this.options.endSpan)
      this.setSpan(this.options.endSpan, 
        $R(this.values.length>1 ? this.getRange(this.spans.length-1).max() : this.value, this.maximum));
  },
  setSpan: function(span, range) {
    if (this.isVertical()) {
      span.style.top = this.translateToPx(range.start);
      span.style.height = this.translateToPx(range.end - range.start + this.range.start);
    } else {
      span.style.left = this.translateToPx(range.start);
      span.style.width = this.translateToPx(range.end - range.start + this.range.start);
    }
  },
  updateStyles: function() {
    this.handles.each( function(h){ Element.removeClassName(h, 'selected') });
    Element.addClassName(this.activeHandle, 'selected');
  },
  startDrag: function(event) {
    if (Event.isLeftClick(event)) {
      if (!this.disabled){
        this.active = true;
        
        var handle = Event.element(event);
        var pointer  = [Event.pointerX(event), Event.pointerY(event)];
        var track = handle;
        if (track==this.track) {
          var offsets  = Position.cumulativeOffset(this.track); 
          this.event = event;
          this.setValue(this.translateToValue( 
           (this.isVertical() ? pointer[1]-offsets[1] : pointer[0]-offsets[0])-(this.handleLength/2)
          ));
          var offsets  = Position.cumulativeOffset(this.activeHandle);
          this.offsetX = (pointer[0] - offsets[0]);
          this.offsetY = (pointer[1] - offsets[1]);
        } else {
          // find the handle (prevents issues with Safari)
          while((this.handles.indexOf(handle) == -1) && handle.parentNode) 
            handle = handle.parentNode;
            
          if (this.handles.indexOf(handle)!=-1) {
            this.activeHandle    = handle;
            this.activeHandleIdx = this.handles.indexOf(this.activeHandle);
            this.updateStyles();
            
            var offsets  = Position.cumulativeOffset(this.activeHandle);
            this.offsetX = (pointer[0] - offsets[0]);
            this.offsetY = (pointer[1] - offsets[1]);
          }
        }
      }
      Event.stop(event);
    }
  },
  update: function(event) {
   if (this.active) {
      if (!this.dragging) this.dragging = true;
      this.draw(event);
      if (Prototype.Browser.WebKit) window.scrollBy(0,0);
      Event.stop(event);
   }
  },
  draw: function(event) {
    var pointer = [Event.pointerX(event), Event.pointerY(event)];
    var offsets = Position.cumulativeOffset(this.track);
    pointer[0] -= this.offsetX + offsets[0];
    pointer[1] -= this.offsetY + offsets[1];
    this.event = event;
    this.setValue(this.translateToValue( this.isVertical() ? pointer[1] : pointer[0] ));
    if (this.initialized && this.options.onSlide)
      this.options.onSlide(this.values.length>1 ? this.values : this.value, this);
  },
  endDrag: function(event) {
    if (this.active && this.dragging) {
      this.finishDrag(event, true);
      Event.stop(event);
    }
    this.active = false;
    this.dragging = false;
  },  
  finishDrag: function(event, success) {
    this.active = false;
    this.dragging = false;
    this.updateFinished();
  },
  updateFinished: function() {
    if (this.initialized && this.options.onChange) 
      this.options.onChange(this.values.length>1 ? this.values : this.value, this);
    this.event = null;
  }
});

if(typeof dj=="undefined"){dj={};}
dj.lang=function(){var doc=document;var EventCache={listEvents:[],add:function(node,sEventName,fHandler){this.listEvents.push(arguments);},flush:function(){var i,item;for(i=this.listEvents.length-1;i>=0;i=i-1){item=this.listEvents[i];if(item[0].removeEventListener){item[0].removeEventListener(item[1],item[2],item[3]);}
if(item[1].substring(0,2)!="on"){item[1]="on"+item[1];}
if(item[0].detachEvent){item[0].detachEvent(item[1],item[2]);}
item[0][item[1]]=null;}}};return{addEvent:function(obj,type,fn,context){if(context){var oldFunc=fn;fn=function(){oldFunc.apply(context,arguments);};}
if(obj.addEventListener){obj.addEventListener(type,fn,false);EventCache.add(obj,type,fn);}else if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj["e"+type+fn](window.event);};obj.attachEvent("on"+type,obj[type+fn]);EventCache.add(obj,type,fn);}else{obj["on"+type]=obj["e"+type+fn];}},removeEvent:function(obj,type,fn){if(typeof obj!=="object"){return;}
if(obj.detachEvent){obj.detachEvent("on"+type,obj[type+fn]);obj[type+fn]=null;}else{obj.removeEventListener(type,fn,false);}},stopEvent:function(ev){var e=(!ev)?window.event:ev;e.cancelBubble=true;e.returnValue=false;if(typeof e.stopPropagation==="function"){e.stopPropagation();}
if(typeof e.preventDefault==="function"){e.preventDefault();}
return false;},flushEventCache:function(){EventCache.flush();}};}();dj.lang.addEvent(window,'unload',dj.lang.flushEventCache);if(typeof dj=="undefined"){dj={};}
if(typeof dj.lang=="undefined"){dj.lang={};}
dj.lang.hasClassName=function(el,cname){if(typeof cname!=="string"){throw new TypeError("dj.lang.hasClassName: 'cname' must be a string");}
if(cname===""){return;}
el=this.byId(el);if(el===null){throw new TypeError("dj.lang.hasClassName: 'el' does not exist.");}
cname=cname.replace(/^\s+|\s+$/g,"");return(el.className.indexOf(cname)>-1);};dj.lang.addClassName=function(el,cname){if(typeof cname!=="string"){throw new TypeError("dj.lang.addClassName: 'cname' must be a string");}
if(cname===""){return;}
el=this.byId(el);if(el===null){throw new TypeError("dj.lang.addClassName: 'el' does not exist.");}
cname=cname.replace(/^\s+|\s+$/g,"");if(el.className.indexOf(cname)==-1){el.className+=(" "+cname);}};dj.lang.removeClassName=function(el,cname){if(typeof cname!=="string"){throw new TypeError("dj.lang.removeClassName: 'cname' must be a string");}
if(cname===""){return;}
el=this.byId(el);if(el===null){throw new TypeError("dj.lang.removeClassName: 'el' does not exist.");}
cname=cname.replace(/^\s+|\s+$/g,"");if(el.className.indexOf(cname)>-1){var re=new RegExp(cname,'g');el.className=el.className.replace(re,'');}};(function(){var dojo={};dojo.doc=window.document||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];};var d=dojo;var n=navigator;var dua=n.userAgent;var dav=n.appVersion;var tv=parseFloat(dav);dojo.isOpera=(dua.indexOf("Opera")>=0)?tv:0;var idx=Math.max(dav.indexOf("WebKit"),dav.indexOf("Safari"),0);if(idx){dojo.isSafari=parseFloat(dav.split("Version/")[1])||((parseFloat(dav.substr(idx+7))>=419.3)?3:2)||2;}
dojo.isKhtml=(dav.indexOf("Konqueror")>=0||dojo.isSafari)?tv:0;dojo.isMoz=(dua.indexOf("Gecko")>=0&&!dojo.isKhtml)?tv:0;if(dojo.isMoz){dojo.isFF=parseFloat(dua.split("Firefox/")[1])||0;}
if(document.all&&!dojo.isOpera){dojo.isIE=parseFloat(dav.split("MSIE ")[1])||0;}
dojo.body=function(){return(dojo.doc.body||dojo.doc.getElementsByTagName("body")[0]);};if(!d.isIE){dojo._toPixelValue=function(element,value){return parseFloat(value)||0;};}else{dojo._toPixelValue=function(element,avalue){if(!avalue){return 0;}
if(avalue=="medium"){return 4;}
if(avalue.slice&&(avalue.slice(-2)=='px')){return parseFloat(avalue);}
with(element){var sLeft=style.left;var rsLeft=runtimeStyle.left;runtimeStyle.left=currentStyle.left;try{style.left=avalue;avalue=style.pixelLeft;}catch(e){avalue=0;}
style.left=sLeft;runtimeStyle.left=rsLeft;}
return avalue;}}
var px=dojo._toPixelValue;dojo.coords=function(node,includeScroll){var n=dj.lang.byId(node),s=gcs(n),mb=d._getMarginBox(n,s);var abs=d._abs(n,includeScroll);mb.x=abs.x;mb.y=abs.y;return mb;};var gcs;if(d.isSafari){gcs=function(node){var s;if(node instanceof HTMLElement){var dv=node.ownerDocument.defaultView;s=dv.getComputedStyle(node,null);if(!s&&node.style){node.style.display="";s=dv.getComputedStyle(node,null);}}
return s||{};};}else if(d.isIE){gcs=function(node){return node.nodeType==1?node.currentStyle:{};};}else{gcs=function(node){return node instanceof HTMLElement?node.ownerDocument.defaultView.getComputedStyle(node,null):{};};}
dojo.getComputedStyle=gcs;dojo._getMarginBox=function(node,computedStyle){var s=computedStyle||gcs(node),me=d._getMarginExtents(node,s);var l=node.offsetLeft-me.l,t=node.offsetTop-me.t,p=node.parentNode;if(d.isMoz){var sl=parseFloat(s.left),st=parseFloat(s.top);if(!isNaN(sl)&&!isNaN(st)){l=sl,t=st;}else{if(p&&p.style){var pcs=gcs(p);if(pcs.overflow!="visible"){var be=d._getBorderExtents(p,pcs);l+=be.l,t+=be.t;}}}}else if(d.isOpera){if(p){var be=d._getBorderExtents(p);l-=be.l;t-=be.t;}}
return{l:l,t:t,w:node.offsetWidth+me.w,h:node.offsetHeight+me.h};};dojo._getMarginExtents=function(n,computedStyle){var
s=computedStyle||gcs(n),l=px(n,s.marginLeft),t=px(n,s.marginTop),r=px(n,s.marginRight),b=px(n,s.marginBottom);if(d.isSafari&&(s.position!="absolute")){r=l;}
return{l:l,t:t,w:l+r,h:t+b};};var _sumAncestorProperties=function(node,prop){if(!(node=(node||0).parentNode)){return 0};var val,retVal=0,_b=d.body();while(node&&node.style){if(gcs(node).position=="fixed"){return 0;}
val=node[prop];if(val){retVal+=val-0;if(node==_b){break;}}
node=node.parentNode;}
return retVal;};dojo._abs=function(node,includeScroll){var ownerDocument=node.ownerDocument;var ret={x:0,y:0};var db=d.body();if(d.isIE||(d.isFF>=3)){var client=node.getBoundingClientRect();var cs;if(d.isFF){var dv=node.ownerDocument.defaultView;cs=dv.getComputedStyle(db.parentNode,null);}
var offset=(d.isIE)?d._getIeDocumentElementOffset():{x:px(db.parentNode,cs.marginLeft),y:px(db.parentNode,cs.marginTop)};ret.x=client.left-offset.x;ret.y=client.top-offset.y;}else{if(node["offsetParent"]){var endNode;if(d.isSafari&&(gcs(node).position=="absolute")&&(node.parentNode==db)){endNode=db;}else{endNode=db.parentNode;}
var cs=gcs(node);var n=node;if(d.isOpera&&cs.position!="absolute"){n=n.offsetParent;}
ret.x-=_sumAncestorProperties(n,"scrollLeft");ret.y-=_sumAncestorProperties(n,"scrollTop");var curnode=node;do{var n=curnode.offsetLeft;if(!d.isOpera||n>0){ret.x+=isNaN(n)?0:n;}
var t=curnode.offsetTop;ret.y+=isNaN(t)?0:t;var cs=gcs(curnode);if(curnode!=node){if(d.isSafari){ret.x+=px(curnode,cs.borderLeftWidth);ret.y+=px(curnode,cs.borderTopWidth);}else if(d.isFF){ret.x+=2*px(curnode,cs.borderLeftWidth);ret.y+=2*px(curnode,cs.borderTopWidth);}}
if(d.isFF&&cs.position=="static"){var parent=curnode.parentNode;while(parent!=curnode.offsetParent){var pcs=gcs(parent);if(pcs.position=="static"){ret.x+=px(curnode,pcs.borderLeftWidth);ret.y+=px(curnode,pcs.borderTopWidth);}
parent=parent.parentNode;}}
curnode=curnode.offsetParent;}while((curnode!=endNode)&&curnode);}else if(node.x&&node.y){ret.x+=isNaN(node.x)?0:node.x;ret.y+=isNaN(node.y)?0:node.y;}}
if(includeScroll){var scroll=d._docScroll();ret.y+=scroll.y;ret.x+=scroll.x;}
return ret;};dojo._getIeDocumentElementOffset=function(){var de=d.doc.documentElement;return(d.isIE>=7)?{x:de.getBoundingClientRect().left,y:de.getBoundingClientRect().top}:{x:d._isBodyLtr()||window.parent==window?de.clientLeft:de.offsetWidth-de.clientWidth-de.clientLeft,y:de.clientTop};};dojo._isBodyLtr=function(){return!("_bodyLtr"in d)?d._bodyLtr=gcs(d.body()).direction=="ltr":d._bodyLtr;};dj.lang.coords=dojo.coords;}());dj.lang.byId=function(id){return(typeof id=="string")?document.getElementById(id):id;};(function(){var chunker=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,done=0,toString=Object.prototype.toString,hasDuplicate=false;var Sizzle=function(selector,context,results,seed){results=results||[];var origContext=context=context||document;if(context.nodeType!==1&&context.nodeType!==9){return[];}
if(!selector||typeof selector!=="string"){return results;}
var parts=[],m,set,checkSet,check,mode,extra,prune=true,contextXML=isXML(context);chunker.lastIndex=0;while((m=chunker.exec(selector))!==null){parts.push(m[1]);if(m[2]){extra=RegExp.rightContext;break;}}
if(parts.length>1&&origPOS.exec(selector)){if(parts.length===2&&Expr.relative[parts[0]]){set=posProcess(parts[0]+parts[1],context);}else{set=Expr.relative[parts[0]]?[context]:Sizzle(parts.shift(),context);while(parts.length){selector=parts.shift();if(Expr.relative[selector])
selector+=parts.shift();set=posProcess(selector,set);}}}else{if(!seed&&parts.length>1&&context.nodeType===9&&!contextXML&&Expr.match.ID.test(parts[0])&&!Expr.match.ID.test(parts[parts.length-1])){var ret=Sizzle.find(parts.shift(),context,contextXML);context=ret.expr?Sizzle.filter(ret.expr,ret.set)[0]:ret.set[0];}
if(context){var ret=seed?{expr:parts.pop(),set:makeArray(seed)}:Sizzle.find(parts.pop(),parts.length===1&&(parts[0]==="~"||parts[0]==="+")&&context.parentNode?context.parentNode:context,contextXML);set=ret.expr?Sizzle.filter(ret.expr,ret.set):ret.set;if(parts.length>0){checkSet=makeArray(set);}else{prune=false;}
while(parts.length){var cur=parts.pop(),pop=cur;if(!Expr.relative[cur]){cur="";}else{pop=parts.pop();}
if(pop==null){pop=context;}
Expr.relative[cur](checkSet,pop,contextXML);}}else{checkSet=parts=[];}}
if(!checkSet){checkSet=set;}
if(!checkSet){throw"Syntax error, unrecognized expression: "+(cur||selector);}
if(toString.call(checkSet)==="[object Array]"){if(!prune){results.push.apply(results,checkSet);}else if(context&&context.nodeType===1){for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&(checkSet[i]===true||checkSet[i].nodeType===1&&contains(context,checkSet[i]))){results.push(set[i]);}}}else{for(var i=0;checkSet[i]!=null;i++){if(checkSet[i]&&checkSet[i].nodeType===1){results.push(set[i]);}}}}else{makeArray(checkSet,results);}
if(extra){Sizzle(extra,origContext,results,seed);Sizzle.uniqueSort(results);}
return results;};Sizzle.uniqueSort=function(results){if(sortOrder){hasDuplicate=false;results.sort(sortOrder);if(hasDuplicate){for(var i=1;i<results.length;i++){if(results[i]===results[i-1]){results.splice(i--,1);}}}}};Sizzle.matches=function(expr,set){return Sizzle(expr,null,null,set);};Sizzle.find=function(expr,context,isXML){var set,match;if(!expr){return[];}
for(var i=0,l=Expr.order.length;i<l;i++){var type=Expr.order[i],match;if((match=Expr.match[type].exec(expr))){var left=RegExp.leftContext;if(left.substr(left.length-1)!=="\\"){match[1]=(match[1]||"").replace(/\\/g,"");set=Expr.find[type](match,context,isXML);if(set!=null){expr=expr.replace(Expr.match[type],"");break;}}}}
if(!set){set=context.getElementsByTagName("*");}
return{set:set,expr:expr};};Sizzle.filter=function(expr,set,inplace,not){var old=expr,result=[],curLoop=set,match,anyFound,isXMLFilter=set&&set[0]&&isXML(set[0]);while(expr&&set.length){for(var type in Expr.filter){if((match=Expr.match[type].exec(expr))!=null){var filter=Expr.filter[type],found,item;anyFound=false;if(curLoop==result){result=[];}
if(Expr.preFilter[type]){match=Expr.preFilter[type](match,curLoop,inplace,result,not,isXMLFilter);if(!match){anyFound=found=true;}else if(match===true){continue;}}
if(match){for(var i=0;(item=curLoop[i])!=null;i++){if(item){found=filter(item,match,i,curLoop);var pass=not^!!found;if(inplace&&found!=null){if(pass){anyFound=true;}else{curLoop[i]=false;}}else if(pass){result.push(item);anyFound=true;}}}}
if(found!==undefined){if(!inplace){curLoop=result;}
expr=expr.replace(Expr.match[type],"");if(!anyFound){return[];}
break;}}}
if(expr==old){if(anyFound==null){throw"Syntax error, unrecognized expression: "+expr;}else{break;}}
old=expr;}
return curLoop;};var Expr=Sizzle.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|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(elem){return elem.getAttribute("href");}},relative:{"+":function(checkSet,part,isXML){var isPartStr=typeof part==="string",isTag=isPartStr&&!/\W/.test(part),isPartStrNotTag=isPartStr&&!isTag;if(isTag&&!isXML){part=part.toUpperCase();}
for(var i=0,l=checkSet.length,elem;i<l;i++){if((elem=checkSet[i])){while((elem=elem.previousSibling)&&elem.nodeType!==1){}
checkSet[i]=isPartStrNotTag||elem&&elem.nodeName===part?elem||false:elem===part;}}
if(isPartStrNotTag){Sizzle.filter(part,checkSet,true);}},">":function(checkSet,part,isXML){var isPartStr=typeof part==="string";if(isPartStr&&!/\W/.test(part)){part=isXML?part:part.toUpperCase();for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){var parent=elem.parentNode;checkSet[i]=parent.nodeName===part?parent:false;}}}else{for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){checkSet[i]=isPartStr?elem.parentNode:elem.parentNode===part;}}
if(isPartStr){Sizzle.filter(part,checkSet,true);}}},"":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("parentNode",part,doneName,checkSet,nodeCheck,isXML);},"~":function(checkSet,part,isXML){var doneName=done++,checkFn=dirCheck;if(typeof part==="string"&&!part.match(/\W/)){var nodeCheck=part=isXML?part:part.toUpperCase();checkFn=dirNodeCheck;}
checkFn("previousSibling",part,doneName,checkSet,nodeCheck,isXML);}},find:{ID:function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?[m]:[];}},NAME:function(match,context,isXML){if(typeof context.getElementsByName!=="undefined"){var ret=[],results=context.getElementsByName(match[1]);for(var i=0,l=results.length;i<l;i++){if(results[i].getAttribute("name")===match[1]){ret.push(results[i]);}}
return ret.length===0?null:ret;}},TAG:function(match,context){return context.getElementsByTagName(match[1]);}},preFilter:{CLASS:function(match,curLoop,inplace,result,not,isXML){match=" "+match[1].replace(/\\/g,"")+" ";if(isXML){return match;}
for(var i=0,elem;(elem=curLoop[i])!=null;i++){if(elem){if(not^(elem.className&&(" "+elem.className+" ").indexOf(match)>=0)){if(!inplace)
result.push(elem);}else if(inplace){curLoop[i]=false;}}}
return false;},ID:function(match){return match[1].replace(/\\/g,"");},TAG:function(match,curLoop){for(var i=0;curLoop[i]===false;i++){}
return curLoop[i]&&isXML(curLoop[i])?match[1]:match[1].toUpperCase();},CHILD:function(match){if(match[1]=="nth"){var test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(match[2]=="even"&&"2n"||match[2]=="odd"&&"2n+1"||!/\D/.test(match[2])&&"0n+"+match[2]||match[2]);match[2]=(test[1]+(test[2]||1))-0;match[3]=test[3]-0;}
match[0]=done++;return match;},ATTR:function(match,curLoop,inplace,result,not,isXML){var name=match[1].replace(/\\/g,"");if(!isXML&&Expr.attrMap[name]){match[1]=Expr.attrMap[name];}
if(match[2]==="~="){match[4]=" "+match[4]+" ";}
return match;},PSEUDO:function(match,curLoop,inplace,result,not){if(match[1]==="not"){if(match[3].match(chunker).length>1||/^\w/.test(match[3])){match[3]=Sizzle(match[3],null,null,curLoop);}else{var ret=Sizzle.filter(match[3],curLoop,inplace,true^not);if(!inplace){result.push.apply(result,ret);}
return false;}}else if(Expr.match.POS.test(match[0])||Expr.match.CHILD.test(match[0])){return true;}
return match;},POS:function(match){match.unshift(true);return match;}},filters:{enabled:function(elem){return elem.disabled===false&&elem.type!=="hidden";},disabled:function(elem){return elem.disabled===true;},checked:function(elem){return elem.checked===true;},selected:function(elem){elem.parentNode.selectedIndex;return elem.selected===true;},parent:function(elem){return!!elem.firstChild;},empty:function(elem){return!elem.firstChild;},has:function(elem,i,match){return!!Sizzle(match[3],elem).length;},header:function(elem){return/h\d/i.test(elem.nodeName);},text:function(elem){return"text"===elem.type;},radio:function(elem){return"radio"===elem.type;},checkbox:function(elem){return"checkbox"===elem.type;},file:function(elem){return"file"===elem.type;},password:function(elem){return"password"===elem.type;},submit:function(elem){return"submit"===elem.type;},image:function(elem){return"image"===elem.type;},reset:function(elem){return"reset"===elem.type;},button:function(elem){return"button"===elem.type||elem.nodeName.toUpperCase()==="BUTTON";},input:function(elem){return/input|select|textarea|button/i.test(elem.nodeName);}},setFilters:{first:function(elem,i){return i===0;},last:function(elem,i,match,array){return i===array.length-1;},even:function(elem,i){return i%2===0;},odd:function(elem,i){return i%2===1;},lt:function(elem,i,match){return i<match[3]-0;},gt:function(elem,i,match){return i>match[3]-0;},nth:function(elem,i,match){return match[3]-0==i;},eq:function(elem,i,match){return match[3]-0==i;}},filter:{PSEUDO:function(elem,match,i,array){var name=match[1],filter=Expr.filters[name];if(filter){return filter(elem,i,match,array);}else if(name==="contains"){return(elem.textContent||elem.innerText||"").indexOf(match[3])>=0;}else if(name==="not"){var not=match[3];for(var i=0,l=not.length;i<l;i++){if(not[i]===elem){return false;}}
return true;}},CHILD:function(elem,match){var type=match[1],node=elem;switch(type){case'only':case'first':while(node=node.previousSibling){if(node.nodeType===1)return false;}
if(type=='first')return true;node=elem;case'last':while(node=node.nextSibling){if(node.nodeType===1)return false;}
return true;case'nth':var first=match[2],last=match[3];if(first==1&&last==0){return true;}
var doneName=match[0],parent=elem.parentNode;if(parent&&(parent.sizcache!==doneName||!elem.nodeIndex)){var count=0;for(node=parent.firstChild;node;node=node.nextSibling){if(node.nodeType===1){node.nodeIndex=++count;}}
parent.sizcache=doneName;}
var diff=elem.nodeIndex-last;if(first==0){return diff==0;}else{return(diff%first==0&&diff/first>=0);}}},ID:function(elem,match){return elem.nodeType===1&&elem.getAttribute("id")===match;},TAG:function(elem,match){return(match==="*"&&elem.nodeType===1)||elem.nodeName===match;},CLASS:function(elem,match){return(" "+(elem.className||elem.getAttribute("class"))+" ").indexOf(match)>-1;},ATTR:function(elem,match){var name=match[1],result=Expr.attrHandle[name]?Expr.attrHandle[name](elem):elem[name]!=null?elem[name]:elem.getAttribute(name),value=result+"",type=match[2],check=match[4];return result==null?type==="!=":type==="="?value===check:type==="*="?value.indexOf(check)>=0:type==="~="?(" "+value+" ").indexOf(check)>=0:!check?value&&result!==false:type==="!="?value!=check:type==="^="?value.indexOf(check)===0:type==="$="?value.substr(value.length-check.length)===check:type==="|="?value===check||value.substr(0,check.length+1)===check+"-":false;},POS:function(elem,match,i,array){var name=match[2],filter=Expr.setFilters[name];if(filter){return filter(elem,i,match,array);}}}};var origPOS=Expr.match.POS;for(var type in Expr.match){Expr.match[type]=new RegExp(Expr.match[type].source+/(?![^\[]*\])(?![^\(]*\))/.source);}
var makeArray=function(array,results){array=Array.prototype.slice.call(array);if(results){results.push.apply(results,array);return results;}
return array;};try{Array.prototype.slice.call(document.documentElement.childNodes);}catch(e){makeArray=function(array,results){var ret=results||[];if(toString.call(array)==="[object Array]"){Array.prototype.push.apply(ret,array);}else{if(typeof array.length==="number"){for(var i=0,l=array.length;i<l;i++){ret.push(array[i]);}}else{for(var i=0;array[i];i++){ret.push(array[i]);}}}
return ret;};}
var sortOrder;if(document.documentElement.compareDocumentPosition){sortOrder=function(a,b){var ret=a.compareDocumentPosition(b)&4?-1:a===b?0:1;if(ret===0){hasDuplicate=true;}
return ret;};}else if("sourceIndex"in document.documentElement){sortOrder=function(a,b){var ret=a.sourceIndex-b.sourceIndex;if(ret===0){hasDuplicate=true;}
return ret;};}else if(document.createRange){sortOrder=function(a,b){var aRange=a.ownerDocument.createRange(),bRange=b.ownerDocument.createRange();aRange.selectNode(a);aRange.collapse(true);bRange.selectNode(b);bRange.collapse(true);var ret=aRange.compareBoundaryPoints(Range.START_TO_END,bRange);if(ret===0){hasDuplicate=true;}
return ret;};}
(function(){var form=document.createElement("div"),id="script"+(new Date).getTime();form.innerHTML="<a name='"+id+"'/>";var root=document.documentElement;root.insertBefore(form,root.firstChild);if(!!document.getElementById(id)){Expr.find.ID=function(match,context,isXML){if(typeof context.getElementById!=="undefined"&&!isXML){var m=context.getElementById(match[1]);return m?m.id===match[1]||typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id").nodeValue===match[1]?[m]:undefined:[];}};Expr.filter.ID=function(elem,match){var node=typeof elem.getAttributeNode!=="undefined"&&elem.getAttributeNode("id");return elem.nodeType===1&&node&&node.nodeValue===match;};}
root.removeChild(form);root=form=null;})();(function(){var div=document.createElement("div");div.appendChild(document.createComment(""));if(div.getElementsByTagName("*").length>0){Expr.find.TAG=function(match,context){var results=context.getElementsByTagName(match[1]);if(match[1]==="*"){var tmp=[];for(var i=0;results[i];i++){if(results[i].nodeType===1){tmp.push(results[i]);}}
results=tmp;}
return results;};}
div.innerHTML="<a href='#'></a>";if(div.firstChild&&typeof div.firstChild.getAttribute!=="undefined"&&div.firstChild.getAttribute("href")!=="#"){Expr.attrHandle.href=function(elem){return elem.getAttribute("href",2);};}
div=null;})();if(document.querySelectorAll)(function(){var oldSizzle=Sizzle,div=document.createElement("div");div.innerHTML="<p class='TEST'></p>";if(div.querySelectorAll&&div.querySelectorAll(".TEST").length===0){return;}
Sizzle=function(query,context,extra,seed){context=context||document;if(!seed&&context.nodeType===9&&!isXML(context)){try{return makeArray(context.querySelectorAll(query),extra);}catch(e){}}
return oldSizzle(query,context,extra,seed);};for(var prop in oldSizzle){Sizzle[prop]=oldSizzle[prop];}
div=null;})();if(document.getElementsByClassName&&document.documentElement.getElementsByClassName)(function(){var div=document.createElement("div");div.innerHTML="<div class='test e'></div><div class='test'></div>";if(div.getElementsByClassName("e").length===0)
return;div.lastChild.className="e";if(div.getElementsByClassName("e").length===1)
return;Expr.order.splice(1,0,"CLASS");Expr.find.CLASS=function(match,context,isXML){if(typeof context.getElementsByClassName!=="undefined"&&!isXML){return context.getElementsByClassName(match[1]);}};div=null;})();function dirNodeCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1&&!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(elem.nodeName===cur){match=elem;break;}
elem=elem[dir];}
checkSet[i]=match;}}}
function dirCheck(dir,cur,doneName,checkSet,nodeCheck,isXML){var sibDir=dir=="previousSibling"&&!isXML;for(var i=0,l=checkSet.length;i<l;i++){var elem=checkSet[i];if(elem){if(sibDir&&elem.nodeType===1){elem.sizcache=doneName;elem.sizset=i;}
elem=elem[dir];var match=false;while(elem){if(elem.sizcache===doneName){match=checkSet[elem.sizset];break;}
if(elem.nodeType===1){if(!isXML){elem.sizcache=doneName;elem.sizset=i;}
if(typeof cur!=="string"){if(elem===cur){match=true;break;}}else if(Sizzle.filter(cur,[elem]).length>0){match=elem;break;}}
elem=elem[dir];}
checkSet[i]=match;}}}
var contains=document.compareDocumentPosition?function(a,b){return a.compareDocumentPosition(b)&16;}:function(a,b){return a!==b&&(a.contains?a.contains(b):true);};var isXML=function(elem){return elem.nodeType===9&&elem.documentElement.nodeName!=="HTML"||!!elem.ownerDocument&&elem.ownerDocument.documentElement.nodeName!=="HTML";};var posProcess=function(selector,context){var tmpSet=[],later="",match,root=context.nodeType?[context]:context;while((match=Expr.match.PSEUDO.exec(selector))){later+=match[0];selector=selector.replace(Expr.match.PSEUDO,"");}
selector=Expr.relative[selector]?selector+"*":selector;for(var i=0,l=root.length;i<l;i++){Sizzle(selector,root[i],tmpSet);}
return Sizzle.filter(later,tmpSet);};dj.lang.query=Sizzle;dj.lang.queryMatches=Sizzle.matches;})();if(typeof dj=="undefined"){dj={};}
if(typeof dj.lang=="undefined"){dj.lang={};}
dj.lang.extend=function(subClass,superClass){var F=function(){};F.prototype=superClass.prototype;subClass.prototype=new F();subClass.prototype.constructor=subClass;subClass.superclass=superClass.prototype;if(superClass.prototype.constructor==Object.prototype.constructor){superClass.prototype.constructor=superClass;}};dj.lang.mixin=function(rc,gc){if(typeof rc==="undefined"){throw new TypeError("dj.lang.mixin: receiving object is undefined");}
if(typeof gc==="undefined"){return rc;}
for(var method in gc){var rcm=rc[method],gcm=gc[method];if((rcm!==null)&&(typeof rcm=="object")&&(typeof gcm=="object")){this.mixin(rcm,gcm);}else if(typeof gcm!=="undefined"&&(rcm!==gcm)){rc[method]=gcm;}}};dj.lang.clone=function(obj){if(obj===null||typeof(obj)!='object'){return obj;}
var oClone=new obj.constructor();for(var key in obj){if(obj.hasOwnProperty(key)){oClone[key]=this.clone(obj[key]);}}
return oClone;};dj.lang.cloneMixin=function(rc,gc){var cl=this.clone(rc);this.mixin(cl,gc);return cl;};dj.lang.objectToString=function(obj,isRecursive){if(typeof obj!=="object"){return obj.toString();}
var out=[];var val=null;if(typeof obj.length==='number'&&!obj.propertyIsEnumerable('length')&&typeof obj.splice==='function'){return'['+obj.toString()+']';}
if(!obj.hasOwnProperty&&obj.childNodes){return(obj.id!=="")?("[Element: '"+obj.id+"']"):"[Element]";}else if(!obj.hasOwnProperty){return"[undefined]";}
for(var o in obj){if(obj.hasOwnProperty(o)){val=null;if(typeof obj[o]=="object"){val=((isRecursive)?this.objectToString(obj[o]):"[Object]");}
else if(typeof obj[o]=="function"){val="[Function]";}
else if(typeof obj[o]=="string"){val='"'+obj[o]+'"';}
else{val=obj[o];}
out[out.length]=(o+": "+val);}}
return'{'+out.join(", ")+'}';};(function(){var addEvent=dj.lang.addEvent,removeEvent=dj.lang.removeEvent,hasClassName=dj.lang.hasClassName,queryMatches=function(sel,el){return(dj.lang.queryMatches(sel,[el]).length>0);};if(window.Node&&Node.prototype&&!Node.prototype.contains){Node.prototype.contains=function(arg){return!!(this.compareDocumentPosition(arg)&16);};}
function cancelDefault(e){if(typeof e.preventDefault!='undefined'){e.preventDefault();return;}
e.returnValue=false;}
function cancelBubble(e){if(typeof e.stopPropagation!='undefined'){e.stopPropagation();return;}
e.cancelBubble=true;}
function getTarget(e){var targ=null;if(!e){e=window.event;}
if(e.target){targ=e.target;}
else if(e.srcElement){targ=e.srcElement;}
if(targ.nodeType==3){targ=targ.parentNode;}
return targ;}
function getRelatedTarget(e){if(!e){e=window.event;}
var rTarg=e.relatedTarget;if(!rTarg){if('mouseover'==e.type){rTarg=e.fromElement;}
if('mouseout'==e.type){rTarg=e.toElement;}}
return rTarg;}
var handlers={click:{},mousedown:{},mouseup:{},dblclick:{},keydown:{},keypress:{},keyup:{},focus:{},blur:{},mouseover:{},mouseout:{},submit:{},reset:{},change:{},select:{}};function getDepth(fargs){var result=null;for(var i=2;i<fargs.length;i++){if(!isNaN(parseInt(fargs[i],10))){result=fargs[i];break;}}
if(result===null){result=-1;}
if(result<-1){throw new Error("bad arg for depth, must be -1 or higher");}
return result;}
var handlerId=0;function pushFunc(selStr,handlerFunc,depth,evName,hoverFlag){var handler=handlers[evName];handlerId++;if(!handlerFunc||typeof handlerFunc!="function"){return;}
if(!handler[selStr]){handler[selStr]=[];}
var selHandler={id:handlerId,evName:evName,selector:selStr,handle:handlerFunc,depth:depth,hoverFlag:hoverFlag};handler[selStr].push(selHandler);return selHandler;}
function addLiveEvent(sel,evName,fn,funcContext){var oldFunc=fn,depth=getDepth(arguments),isHover=(evName==="mouseover"||evName==="mouseout");fn=(!funcContext)?fn:function(){oldFunc.apply(funcContext,arguments);};return pushFunc(sel,fn,depth,evName,isHover);}
function removeLiveEvent(evl){var handler=handlers[evl.evName],evBucket=handler[evl.selector];for(var i=0,len=evBucket.length;i<len;i++){if(evBucket[i].id===evl.id){delete evBucket[i];}}}
if(document.all&&!window.opera){function ieSubmitDelegate(e){delegate(handlers.submit,e);cancelBubble(e);}
function ieResetDelegate(e){delegate(handlers.reset,e);cancelBubble(e);}
function ieChangeDelegate(e){delegate(handlers.change,e);cancelBubble(e);}
function ieSelectDelegate(e){delegate(handlers.select,e);cancelBubble(e);}
addLiveEvent("form","focus",function(){removeEvent(this._submit_prep);this._submit_prep=addEvent(this,'submit',ieSubmitDelegate,false,true);removeEvent(this._reset_prep);this._reset_prep=addEvent(this,'reset',ieResetDelegate,false,true);});addLiveEvent("form","blur",function(){removeEvent(this._submit_prep);removeEvent(this._reset_prep);});addLiveEvent("select,input,textarea","focus",function(){removeEvent(this._change_prep);this._change_prep=addEvent(this,'change',ieChangeDelegate,false,true);});addLiveEvent("select,input,textarea","blur",function(){removeEvent(this._change_prep);});addLiveEvent("input,textarea","focus",function(){removeEvent(this._select_prep);this._select_prep=addEvent(this,'select',ieSelectDelegate,false,true);});addLiveEvent("input,textarea","blur",function(){removeEvent(this._select_prep);});}
function delegate(selectionHandlers,event){if(selectionHandlers){var targ=getTarget(event);for(var sel in selectionHandlers){if(!selectionHandlers.hasOwnProperty(sel)){continue;}
for(var a=0;a<selectionHandlers[sel].length;a++){var selHandler=selectionHandlers[sel][a];if(!selHandler){continue;}
var depth=(selHandler.depth==-1)?100:selHandler.depth;var el=targ;for(var b=-1;b<depth&&el&&el.nodeType==1;b++,el=el.parentNode){if(queryMatches(selHandler.selector,el)){if(selHandler.hoverFlag){var relTarg=getRelatedTarget(event);if(relTarg&&(el.contains(relTarg)||el==relTarg)){break;}}
var retVal=selHandler.handle.call(el,event);if(retVal!==undefined&&!retVal){cancelDefault(event);}
break;}}}}}}
var docEl=document.documentElement,isOnActiveObj=(typeof document.onactivate=='object'),focusEventType=(isOnActiveObj?'activate':'focus'),blurEventType=(isOnActiveObj?'deactivate':'blur');addEvent(docEl,'click',function(e){delegate(handlers.click,e);});addEvent(docEl,'mousedown',function(e){delegate(handlers.mousedown,e);});addEvent(docEl,'mouseup',function(e){delegate(handlers.mouseup,e);});addEvent(docEl,'dblclick',function(e){delegate(handlers.dblclick,e);});addEvent(docEl,'keydown',function(e){delegate(handlers.keydown,e);});addEvent(docEl,'keypress',function(e){delegate(handlers.keypress,e);});addEvent(docEl,'keyup',function(e){delegate(handlers.keyup,e);});addEvent(docEl,focusEventType,function(e){delegate(handlers.focus,e);},true);addEvent(docEl,blurEventType,function(e){delegate(handlers.blur,e);},true);addEvent(docEl,'mouseover',function(e){delegate(handlers.mouseover,e);});addEvent(docEl,'mouseout',function(e){delegate(handlers.mouseout,e);});addEvent(docEl,'submit',function(e){delegate(handlers.submit,e);});addEvent(docEl,'reset',function(e){delegate(handlers.reset,e);});addEvent(docEl,'change',function(e){delegate(handlers.change,e);});addEvent(docEl,'select',function(e){delegate(handlers.select,e);});dj.lang.addLiveEvent=addLiveEvent;dj.lang.removeLiveEvent=removeLiveEvent;})();
if(typeof dj=="undefined"){dj={};}
if(typeof dj.context=="undefined"){dj.context={};}
if(typeof dj.context.ads=="undefined"){dj.context.ads={};}
if(typeof dj.util=="undefined"){dj.util={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.module=="undefined"){dj.module={};}
if(!window.console){window.console={};var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];for(var i=0,len=names.length;i<len;i++){window.console[names[i]]=function(){};}}
if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
(dj.util.Observer=function(parent){this.parent=parent||null;this._subs=[];}).prototype={subscribe:function(callback,context){if(typeof callback!=="function"){throw new TypeError("Callback must be a function.");}
context=(context||this.parent);this._subs.push({name:null,cb:callback,ctx:context});},subscribeByName:function(name,callback,context){if(typeof name!=="string"){throw new TypeError("Name must be a string.");}
if(typeof callback!=="function"){throw new TypeError("Callback must be a function.");}
context=(context||this.parent);this._subs.push({name:name,cb:callback,ctx:context});},unsubscribe:function(cb){var newSubs=[];for(var i=0,len=this._subs.length,sub=null;i<len;i++){sub=this._subs[i];if(sub.cb!==cb){newSubs.push(sub);}}
this._subs=newSubs;},fire:function(){for(var i=0,sub,len=this._subs.length;i<len;i++){sub=this._subs[i];sub.cb.apply(sub.ctx,arguments);}},fireByName:function(name){if(typeof name!=="string"){throw new TypeError("Name must be a string.");}
var args=[];for(var i=1,arg,len=arguments.length;i<len;i++){args.push(arguments[i]);}
for(var j=0,sub,slen=this._subs.length;j<slen;j++){sub=this._subs[j];if((sub.name===null)||(sub.name!==name)){continue;}
sub.cb.apply(sub.ctx,args);}}};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Config=Class.create({initialize:function(owner){this.setOwner(owner);this.cfg=new Hash();this.obs=new Hash();this.hasFired=new Hash();},getOwner:function(){return this.owner;},setOwner:function(owner){this.owner=owner;},addProperty:function(key,config){key=key.toLowerCase();if(typeof config=="undefined"){throw Error("Config {key: '_', value: '_'} must be set for key '"+key+"'.");}else if(typeof config.value=="undefined"){throw Error("Config value must be defined for key '"+key+"'.");}else if(typeof config.handler=="undefined"){this.setProperty(key,config.value,true);return;}
var ob=new dj.util.Observer();var own=this.getOwner();ob.subscribe(config.handler.bindAsEventListener(own));this.obs.set(key,ob);this.setProperty(key,config.value,true);},getProperty:function(key){key=key.toLowerCase();return this.cfg.get(key);},setProperty:function(key,value,silent){key=key.toLowerCase();this.cfg.set(key,value);var ob=null;if(!silent){ob=this.obs.get(key);ob.fire(value);}},applyConfig:function(config,init){for(key in config){this.setProperty(key,config[key],true);}},fireQueue:function(ignoreFired){ignoreFired=(typeof ignoreFired=="undefined")?false:ignoreFired;var ob=null;var that=this;this.cfg.each(function(item){if(!ignoreFired&&that.hasFired.get(item.key)){return;}
ob=that.obs.get(item.key);if(typeof ob=="undefined"){return;}
ob.fire(item.value);that.hasFired.set(item.key,true);});}});if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.History=function(){var hHistory=null;var initted=false;var obs=null;function _init(){obs=new dj.util.Observer();hHistory=new Hash(dojo.back.getHash().toQueryParams());dojo.back.init();dojo.back.setInitialState({changeUrl:hHistory.toQueryString(),back:function(){obs.fireByName("_init",null);},forward:function(){obs.fireByName("_init",null);}});}
return{init:function(){if(initted){return;}initted=true;_init();},get:function(name){return hHistory.get(name);},set:function(name,value,suppressHistory){hHistory.set(name,value);var newUrl=hHistory.toQueryString();suppressHistory=(typeof suppressHistory==="boolean")?suppressHistory:false;if(suppressHistory===false){dojo.back.addToHistory({changeUrl:newUrl,back:function(){obs.fireByName(name,value);},forward:function(){obs.fireByName(name,value);}});}else{dojo.back.setHash(newUrl);}},subscribe:function(name,callback,context){obs.subscribeByName(name,callback,context);}};}();if(typeof dojo=="undefined"){dojo={};}
if(typeof dojo.back=="undefined"){dojo.back={};}
(function(){dojo.doc=window.document||null;dojo.body=function(){return dojo.doc.body||dojo.doc.getElementsByTagName("body")[0];};dojo.config={dojoIframeHistoryUrl:"/static_html_files/iframe_history.html"};var back=dojo.back;function getHash(){var h=window.location.hash;if(h.charAt(0)=="#"){h=h.substring(1);}
return Prototype.Browser.Gecko?h:decodeURIComponent(h);}
function setHash(h){if(!h){h="";}
window.location.hash=encodeURIComponent(h);historyCounter=history.length;}
back.getHash=getHash;back.setHash=setHash;var initialHref=(typeof(window)!=="undefined")?window.location.href:"";var initialHash=(typeof(window)!=="undefined")?getHash():"";var initialState=null;var locationTimer=null;var bookmarkAnchor=null;var historyIframe=null;var forwardStack=[];var historyStack=[];var moveForward=false;var changingUrl=false;var historyCounter;function handleBackButton(){var current=historyStack.pop();if(!current){return;}
var last=historyStack[historyStack.length-1];if(!last&&historyStack.length==0){last=initialState;}
if(last){if(last.kwArgs["back"]){last.kwArgs["back"]();}else if(last.kwArgs["backButton"]){last.kwArgs["backButton"]();}else if(last.kwArgs["handle"]){last.kwArgs.handle("back");}}
forwardStack.push(current);}
back.goBack=handleBackButton;function handleForwardButton(){var last=forwardStack.pop();if(!last){return;}
if(last.kwArgs["forward"]){last.kwArgs.forward();}else if(last.kwArgs["forwardButton"]){last.kwArgs.forwardButton();}else if(last.kwArgs["handle"]){last.kwArgs.handle("forward");}
historyStack.push(last);}
back.goForward=handleForwardButton;function createState(url,args,hash){return{"url":url,"kwArgs":args,"urlHash":hash};}
function getUrlQuery(url){var segments=url.split("?");if(segments.length<2){return null;}
else{return segments[1];}}
function loadIframeHistory(){var url=dojo.config["dojoIframeHistoryUrl"]+"?"+(new Date()).getTime();moveForward=true;if(historyIframe){Prototype.Browser.WebKit?historyIframe.location=url:window.frames[historyIframe.name].location=url;}else{}
return url;}
function checkLocation(){if(!changingUrl){var hsl=historyStack.length;var hash=getHash();if((hash===initialHash||window.location.href==initialHref)&&(hsl==1)){handleBackButton();return;}
if(forwardStack.length>0){if(forwardStack[forwardStack.length-1].urlHash===hash){handleForwardButton();return;}}
if((hsl>=2)&&(historyStack[hsl-2])){if(historyStack[hsl-2].urlHash===hash){handleBackButton();return;}}}};back.init=function(){if(document.getElementById("dj_history")){return;}
var src=dojo.config["dojoIframeHistoryUrl"];document.write('<iframe style="border:0;width:1px;height:1px;position:absolute;visibility:hidden;bottom:0;right:0;" name="dj_history" id="dj_history" src="'+src+'"></iframe>');};back.setInitialState=function(args){initialState=createState(initialHref,args,initialHash);};back.addToHistory=function(args){forwardStack=[];var hash=null;var url=null;if(!historyIframe){historyIframe=window.frames["dj_history"];}
if(!bookmarkAnchor){bookmarkAnchor=document.createElement("a");dojo.body().appendChild(bookmarkAnchor);bookmarkAnchor.style.display="none";}
if(args["changeUrl"]){hash=""+((args["changeUrl"]!==true)?args["changeUrl"]:(new Date()).getTime());if(historyStack.length==0&&initialState.urlHash==hash){initialState=createState(url,args,hash);return;}else if(historyStack.length>0&&historyStack[historyStack.length-1].urlHash==hash){historyStack[historyStack.length-1]=createState(url,args,hash);return;}
changingUrl=true;setTimeout(function(){setHash(hash);changingUrl=false;},1);bookmarkAnchor.href=hash;if(Prototype.Browser.IE){url=loadIframeHistory();var oldCB=args["back"]||args["backButton"]||args["handle"];var tcb=function(handleName){if(getHash()!=""){setTimeout(function(){setHash(hash);},1);}
oldCB.apply(this,[handleName]);};if(args["back"]){args.back=tcb;}else if(args["backButton"]){args.backButton=tcb;}else if(args["handle"]){args.handle=tcb;}
var oldFW=args["forward"]||args["forwardButton"]||args["handle"];var tfw=function(handleName){if(getHash()!=""){setHash(hash);}
if(oldFW){oldFW.apply(this,[handleName]);}};if(args["forward"]){args.forward=tfw;}else if(args["forwardButton"]){args.forwardButton=tfw;}else if(args["handle"]){args.handle=tfw;}}else if(!Prototype.Browser.IE){if(!locationTimer){locationTimer=setInterval(checkLocation,200);}}}else{url=loadIframeHistory();}
historyStack.push(createState(url,args,hash));};back._iframeLoaded=function(evt,ifrLoc){var query=getUrlQuery(ifrLoc.href);if(query==null){if(historyStack.length==1){handleBackButton();}
return;}
if(moveForward){moveForward=false;return;}
if(historyStack.length>=2&&query==getUrlQuery(historyStack[historyStack.length-2].url)){handleBackButton();}else if(forwardStack.length>0&&query==getUrlQuery(forwardStack[forwardStack.length-1].url)){handleForwardButton();}};})();if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Page=function(){var hQuery=null;var aChips=null;return{isReferrer:function(uri){return document.referrer.include(uri);},getQuery:function(){hQuery=(hQuery===null)?new Hash(location.search.replace(/^\?/,"").parseQuery()):hQuery;return hQuery;},hasQueryParam:function(paramName){if(hQuery===null){this.getQuery();}
return(typeof hQuery.get(paramName)!=="undefined");},getQueryParam:function(paramName){if(hQuery===null){this.getQuery();}
return this.hasQueryParam(paramName)?hQuery.get(paramName):"";},getHash:function(){return new Hash(location.hash.replace(/^#/,"").parseQuery());},hasHashParam:function(paramName){var hHash=this.getHash();return(typeof hHash.get(paramName)!=="undefined");},getHashParam:function(paramName){var hHash=this.getHash();return this.hasHashParam(paramName)?hHash.get(paramName):"";},getChips:function(){if(null===aChips){var loc=document.location.toString();loc=loc.replace(/\.html$/,"");loc=loc.replace(/\.js$/,"");aChips=loc.split("-");aChips.shift();}
return aChips;},addStylesheet:function(stylesheet,callback){if(typeof stylesheet=="undefined"){return;}
var cssNode=document.createElement('link');cssNode.type='text/css';cssNode.rel='stylesheet';cssNode.href=stylesheet;cssNode.onLoad=(callback)?callback:'';cssNode.media='screen';if(document.getElementsByTagName("head").length===0){var headNode=document.createElement("head");document.getElementsByTagName("html")[0].appendChild(headNode);}
document.getElementsByTagName("head")[0].appendChild(cssNode);}};}();if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Cookie=function(){var defSeparator="||";var defaultGroup="DJCOOKIE";var groups={};var _cookieDomain;var _doEncode=true;var _getDomain=function(){if(typeof this._cookieDomain=="string"){return this._cookieDomain;}
var aDomain=location.hostname.split('.');var aDomainLen=aDomain.length;this._cookieDomain=(aDomainLen>2)?'.'+aDomain[aDomainLen-2]+'.'+aDomain[aDomainLen-1]:location.hostname;return this._cookieDomain;};var cookieObjToStr=function(obj){if(typeof obj!=="object"){return;}
var out=[];for(var o in obj){out[out.length]=(o+"="+obj[o]);}
out=out.join(defSeparator);return out;};var cookieStrToObj=function(str){if(typeof str!=="string"){return;}
var obj={};var aStr=str.split(defSeparator);for(var i=0,len=aStr.length;i<len;i++){var spl=aStr[i].split("=");var name=spl.shift();obj[name]=spl.join("=");}
return(obj!=={})?obj:null;};var _createCookieString=function(name,value,encodeValue,options){var text=encodeURIComponent(name)+"="+(encodeValue?encodeURIComponent(value):value);if(typeof options!=="object"){return text;}
if(options.expires instanceof Date){text+="; expires="+options.expires.toGMTString();}
if((typeof options.path==="string")&&options.path!==""){text+="; path="+options.path;}
if((typeof options.domain==="string")&&options.domain!==""){text+="; domain="+options.domain;}
if(options.secure===true){text+="; secure";}
return text;};return{setCookie:function(name,value,days,group,doEncode){if((arguments.length>3)&&((typeof group==="string")||(typeof group==="boolean")&&(group!==false))){return this.setGroupCookie(group,name,value,days);}
var exp=null;if(days){exp=new Date();exp.setTime(exp.getTime()+(days*24*60*60*1000));}
doEncode=((typeof doEncode=="boolean")?doEncode:_doEncode);document.cookie=_createCookieString(name,value,doEncode,{expires:exp,path:'/',domain:_getDomain()});},getCookie:function(name,group,doDecode){if(arguments.length>1){return this.getGroupCookie(group,name);}
doDecode=((typeof doDecode=="boolean")?doDecode:_doEncode);var nameEQ=(doDecode?encodeURIComponent(name):name)+"=";var ca=document.cookie.split(';');for(var i=0,len=ca.length;i<len;i++){var c=ca[i].replace(/^\s+|\s+$/g,"");if(c.indexOf(nameEQ)===0){var val=c.substring(nameEQ.length,c.length);return(doDecode?decodeURIComponent(val):val);}}
return null;},deleteCookie:function(name,group){if(arguments.length>1){return this.deleteGroupCookie(group,name);}
this.setCookie(name,'',-1);},setGroupCookie:function(group,name,value,days){var isDelete=(days===-1);var isGroupDelete=false;var date=new Date();if(days){date.setTime(date.getTime()+(days*24*60*60*1000));}
var grp=(typeof group!=="boolean")?group:defaultGroup;groups[grp]=groups[grp]||cookieStrToObj(this.getCookie(grp))||{};groups[grp][name]=value;if(isDelete){delete groups[grp][name];var vcntr=0;for(var val in groups[grp]){if(groups[grp].hasOwnProperty(val)){vcntr++;}}
if(vcntr>0){date.setTime(date.getTime()+(365*24*60*60*1000));}else{groups[grp]={};isGroupDelete=true;}}
name=grp;value=cookieObjToStr(groups[grp]);document.cookie=_createCookieString(name,value,_doEncode,{expires:((isGroupDelete)?(new Date(-1)):date),path:'/',domain:_getDomain()});},getGroupCookie:function(group,name){var grp=(typeof group!=="boolean")?group:defaultGroup;var grpEq=(encodeURIComponent(grp)+"=");var nameEq=(name+"=");var ca=document.cookie.split(";");var cookie=null;var oCookie=null;var cookieValue=null;var cookieName=null;for(var i=0,len=ca.length;i<len;i++){cookie=ca[i].replace(/^\s+|\s+$/g,"");if(cookie.indexOf(grpEq)===0){cookieValue=cookie.split(grpEq)[1];oCookie=cookieStrToObj(decodeURIComponent(cookieValue));cookieName=oCookie[name];return(typeof cookieName!=="undefined")?cookieName:null;}}
return null;},deleteGroupCookie:function(group,name){this.setGroupCookie(group,name," ",-1);}};}();if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Element={contains:function(element,clientX,clientY){var offset=element.cumulativeOffset();var dimensions=element.getDimensions();var lx=offset[0];var ly=offset[1];var rx=lx+dimensions.width;var ry=ly+dimensions.height;var mx=clientX;var my=clientY;if(((mx>=lx)&&(mx<=rx))&&((my>=ly)&&(my<=ry))){return true;}else{return false;}},adjustToLargest:function(container,domObj,onLoadCallback){var containerEls=container.getElementsByTagName("*");var resWidth=0;var resHeight=0;for(var i=0,elen=containerEls.length;i<elen;i++){var el=containerEls[i];if((el.tagName=="SCRIPT")||(el.tagName=="NOSCRIPT")){continue;}
var dim=dj.util.Element.getDimensions(el);var width=dim[0];var height=dim[1];resWidth=(width>=resWidth)?width:resWidth;resHeight=(height>=resHeight)?height:resHeight;}
domObj.width=resWidth;domObj.height=resHeight;if(typeof onLoadCallback!="undefined"){onLoadCallback(domObj);}},getDimensions:function(el){var width=0;var height=0;width=el.offsetWidth;height=el.offsetHeight;if(Prototype.Browser.IE){width=el.scrollWidth;height=el.scrollHeight;}
if(el.style.width!==""){var tmpW=parseInt(el.style.width.split('px')[0],10);width=(width>tmpW)?width:tmpW;}
if(el.style.height!==""){var tmpH=parseInt(el.style.height.split('px')[0],10);height=(height>tmpH)?height:tmpH;}
return[width,height];}};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Form={submitOnEvent:function(elm,formName,event){event=event||"click";var el=$(elm);var frm=document[formName];if(el===null||typeof frm==="undefined"||frm===null){throw new Error("Element and/or form not found");}
el.observe(event,function(ev){Event.stop(ev);frm.submit();});},clearValue:function(id,defaultText){var defTxt=[];var oEl=$(id);if(oEl===null){throw new Error("Element not found");}
var fv=oEl.getValue().strip();if(typeof defaultText=="undefined"){oEl.setValue(" ");}else if(!Object.isArray(defaultText)){defTxt.push(defaultText);}else{defTxt=defaultText;}
defTxt.each(function(dt){if(dt==fv){oEl.setValue("");}});},checkEmpty:function(id,errorMessage){var oEl=$(id);if(oEl===null){throw new Error("Element not found");}
return(oEl.getValue().strip()==="");}};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Url={jsFrame:function(container,url,options){var oCnt=((typeof container==="string")?document.getElementById(container):container);if(oCnt===null){throw new Error("{dj.util.jsFrame} container \""+container+"\" not found");}else if(typeof url!=="string"){throw new TypeError("{dj.util.jsFrame} URL not found");}
var cfg={prefix:"/static_html_files/jsframe.html?jsuri=",doPrefix:true,style:"",doContainer:false,containerStyle:""};var compat={};if(typeof options!=="object"){compat.doPrefix=(typeof options==="boolean")?options:cfg.doPrefix;compat.prefix=arguments[3]||cfg.prefix;compat.style=arguments[4]||cfg.style;options=compat;}
Object.extend(cfg,options);var oIframe=new Element('iframe',{src:((cfg.doPrefix)?cfg.prefix+url:url),id:container+'iframe',scrolling:"no",frameBorder:0,marginWidth:0,marginHeight:0,hspace:0,vspace:0,border:0,style:cfg.style}).observe("load",function(){try{var bd=this.contentWindow.document.body;if(!cfg.doPrefix||cfg.doContainer){bd.innerHTML="<div style=\""+cfg.containerStyle+"\">"+bd.innerHTML+"<\/div>";}
dj.util.Element.adjustToLargest(bd,this);}catch(e){console.error("Unable to access iframe body for url: %s",this.src);}});Element.insert(oCnt,oIframe);return oIframe;},addStylesheet:function(stylesheet,callback){console.warn("{Url} addStylesheet has been moved to Page.addStylesheet");},openWin:function(U,N,W,H,A,F,L,T,C){var WO=[];var WA=[];var a=["directories","location","menubar","resizable","scrollbars","status","titlebar","toolbar"];A=(A)?("".concat(A)):"on";for(i=0,len=a.length;i<len;i++){if(a[i]=="resizable"){WA[WA.length]=a[i]+"="+"yes";}else{WA[WA.length]=a[i]+"="+((A.indexOf(a[i].substring(0,2))>-1||A=="on")?"yes":"no");}}
if(W){WA[WA.length]="width="+W;}
if(H){WA[WA.length]="height="+H;}
if(C&&W&&H){T=(screen.height-H)/2;L=(screen.width-W)/2;}
if(L){WA[WA.length]="left="+L;WA[WA.length]="screenX="+L;}
if(T){WA[WA.length]="top="+T;WA[WA.length]="screenY="+T;}
A=(WA.length)?WA.join(","):"";WO=window.open(U,N,A);if(F&&WO){WO.focus();}},changeRoot:function(selector,newRoot,container){var urls=(typeof container!="undefined")?$(container).select(selector):$$(selector);var href=window.location.href;var base=href.substring(0,href.lastIndexOf('/')+1);for(var i=0,url,len=urls.length;i<len;i++){url=urls[i];if(url.href.lastIndexOf(base)===0){url.href=newRoot+url.href.substring(base.length);}}}};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.User={STATUS:{LOGGED_IN:1,LOGGED_OUT:0,NON_SUB:2},_currentStatus:null,getStatus:function(doClearCache){try{throw Error("{User.getStatus} deprecated method");}
catch(e){console.dir(e);}
return this.STATUS.LOGGED_IN;},hasRole:function(roleName,callback){epiton.runOnReady(function(){var hr=epiton.gui.Credentials.hasRole(roleName.toUpperCase());callback(hr);});},isLoggedIn:function(callback){epiton.runOnReady(function(){var isLoggedIn=epiton.gui.Credentials.isLoggedIn();callback(isLoggedIn);});},isSubLoggedIn:function(callback,roleName){roleName=(typeof roleName==="string")?roleName.toUpperCase():"WSJ";epiton.runOnReady(function(){var isLoggedIn=epiton.gui.Credentials.isLoggedIn();if(roleName!=="WSJ"){var hr=epiton.gui.Credentials.hasRole(roleName);callback(isLoggedIn&&hr);}else{var hr1=epiton.gui.Credentials.hasRole("WSJ");var hr2=epiton.gui.Credentials.hasRole("WSJ-TRANSIENT");callback(isLoggedIn&&(hr1||hr2));}});},isRegLoggedIn:function(callback,roleName){roleName=(typeof roleName==="string")?roleName.toUpperCase():"WSJ";epiton.runOnReady(function(){var isLoggedIn=epiton.gui.Credentials.isLoggedIn();if(roleName!=="WSJ"){var hr=epiton.gui.Credentials.hasRole(roleName);callback(isLoggedIn&&!hr);}else{var hr1=epiton.gui.Credentials.hasRole("WSJ");var hr2=epiton.gui.Credentials.hasRole("WSJ-TRANSIENT");callback(isLoggedIn&&(!hr1&&!hr2));}});},renderCallsign:function(idOrElement){epiton.runOnReady(function(){epiton.gui.Callsign.renderIntoDiv(idOrElement);});},renderFirstName:function(idOrElement){epiton.runOnReady(function(){epiton.gui.FirstName.renderIntoDiv(idOrElement);});},renderLastName:function(idOrElement){epiton.runOnReady(function(){epiton.gui.LastName.renderIntoDiv(idOrElement);});},getUserId:function(callback){epiton.runOnReady(function(){var isLoggedIn=epiton.gui.Credentials.isLoggedIn();var userId="";if(isLoggedIn){userId=epiton.gui.Credentials.getUuid().toString();}
callback(userId);});}};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Region={getViewByRegion:function(){var cookie=document.cookie;var wsjregion="";var regionindex=cookie.indexOf("wsjregion");if(regionindex!=-1)
{var regioncookie=dj.util.Cookie.getCookie("wsjregion");if(regioncookie.indexOf("reset")!=-1){wsjregion=regioncookie.substring(0,regioncookie.indexOf("reset")-1);}else{wsjregion=regioncookie;}}
return wsjregion;},setViewByRegion:function(wsjregion){var cookie=document.cookie;var currentRegion=this.getViewByRegion();if(wsjregion!==""&&wsjregion!==currentRegion){dj.util.Cookie.setCookie("wsjregion",wsjregion+",reset,"+currentRegion,"",false,true);}}};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Tracking={omniture:{_initd:false,init:function(){var localSuppressOmniture=false;this._delayFirePixel=false;this._firePixelCount=0;try{if(typeof s==='undefined'){return;}
this._s=s;if(typeof setMetaData!=='undefined'){this.setMetaData=setMetaData;}
if(typeof setSuppressOmniture!=='undefined'){localSuppressOmniture=setSuppressOmniture();}}
catch(e){console.info("{Tracking} could not suppress omniture.");console.dir(e);}
if(localSuppressOmniture){console.info("{Tracking} localSuppressOmniture = %s",localSuppressOmniture);return;}
this._s.channel="Online Journal";var refresh=(dj.util.Page.getQueryParam('refresh')||dj.util.Page.getHashParam('refresh'));var refdom=this._s.getQueryParam('refdom');this.reflink=(dj.util.Page.getQueryParam('reflink')||dj.util.Page.getHashParam('reflink'));this.link=(dj.util.Page.getQueryParam('mod')||dj.util.Page.getHashParam('mod'));var targeturl=this._s.getQueryParam('url');if(!refresh){refresh='off';}
if(refdom){this._s.referrer=refdom;}
if(this.reflink){this.link="";}
else
if(this.link){this.reflink="";}
var fullurl=document.location.href;var baseurl=document.location.protocol+'//'+document.location.host+document.location.pathname;var caccess=((typeof loggedIn!=="undefined")&&(loggedIn===true))?"subscriber":"open";caccess=(fullurl.indexOf('/PA2VJBNA4R')!=-1)?"ppv":caccess;caccess=(fullurl.indexOf('/services/')!=-1)?"print":caccess;setMetaData('baseurl',baseurl);setMetaData('fullurl',fullurl);setMetaData('refresh',refresh);setMetaData('caccess',caccess);setMetaData('edition',editionToNameMap[dj.util.Region.getViewByRegion()]);if(this.link){setMetaData('link',this.link);}
if(this.reflink){setMetaData('reflink',this.reflink);}
if(targeturl){setMetaData('targeturl',targeturl);}
this.cookieTracking=dj.util.Cookie.getCookie("TR");this.cookieUserType=dj.util.Cookie.getCookie("user_type");this.cookieSpotlightSet=dj.util.Cookie.getCookie("spotlightSet");var that=this;dj.util.User.isLoggedIn(function(isLoggedIn){if(isLoggedIn){dj.util.User.isSubLoggedIn(function(subLoggedIn){if(subLoggedIn){setMetaData('asub','WSJ_sub_yes');}else{setMetaData('asub','WSJ_mem_yes');}});}else{if(that.cookieUserType===null||that.cookieUserType!=="subscribed"){setMetaData('asub','WSJ_free');}else{setMetaData('asub','WSJ_reg_yes');}}});if(typeof numads!=="undefined"){setMetaData('numads',numads.toString());}
if(this.cookieTracking!==null){setMetaData('userid',this.cookieTracking);}
this._initd=true;},delayFirePixel:function(){this._delayFirePixel=true;},resetPixel:function(){this._s.ios=0;},getMetaData:function(param_name){var prop=lookup[param_name];if(!prop){prop=param_name;}
return this._s[prop];},firePixel:function(delayOverride){if(this._initd!==true){console.info("{Tracking} tracking not initd.");return;}
if(this._firePixelCount>=1){console.warn("{Tracking} pixel fired %d times.",this._firePixelCount);}
if((typeof delayOverride==="undefined"||delayOverride===false)&&this._delayFirePixel===true){return;}
this._s.ios=0;var wsjPrefix='WSJ_';if(this._s.prop1=='Home')
{this._s.prop3=wsjPrefix+this._s.prop1+'_'+this._s.pageName;this._s.prop22=wsjPrefix+this._s.prop1+'_'+this._s.pageName;}
try{if(dj.widget.ad&&dj.widget.ad.Ad){this._s.prop13=dj.widget.ad.adPageZone;}}catch(e){}
if(this._s.prop1=='Article'||this._s.prop1=='Community')
{var articleType="";this._s.prop3=this._s.prop3.replace('Community','Article');if(this._s.prop1=='Community'){this._s.prop3=this._s.prop3.replace('Article','Community');}
if(this._s.prop3&&this._s.prop3.indexOf(wsjPrefix)!==0){articleType=this._s.prop3+'_';this._s.prop3=wsjPrefix+this._s.prop1+'_'+this._s.prop3;}
if(this._s.prop22&&this._s.prop22.indexOf(wsjPrefix)!==0){this._s.prop26=wsjPrefix+this._s.prop22;}
this._s.prop22=this._s.prop22.replace('Community','Article');if(this._s.prop1=='Community'){this._s.prop22=this._s.prop22.replace('Article','Community');}
if(this._s.prop22&&this._s.prop22.indexOf(wsjPrefix)!==0){this._s.prop22=wsjPrefix+this._s.prop1+'_'+this._s.prop22;}
if(this._s.prop4&&this._s.prop4.indexOf('WSJ_')!==0){if(this._s.prop20.indexOf('BT-')==0){this._s.prop4=wsjPrefix+'article_TWire_'+articleType+this._s.prop4;}
else if(this._s.prop20.indexOf('PR-')==0){this._s.prop4=wsjPrefix+'article_PRWire_'+articleType+this._s.prop4;}
else{this._s.prop4=wsjPrefix+"article_"+articleType+this._s.prop4;}}}
if(this._s.prop20.indexOf('BT-')===0){this._s.prop8='T Newswires';}
if(this._s.prop1=='Summaries')
{this._s.prop3=wsjPrefix+this._s.prop1+'_'+this._s.pageName;this._s.prop22=wsjPrefix+this._s.prop1+'_'+this._s.pageName;}
if(this._s.prop3=='Video')
{if(this._s.prop3.indexOf(wsjPrefix)!==0){this._s.prop3=wsjPrefix+this._s.prop1+'_'+'Video'+'_'+this._s.prop24;}}
if(this._s.pageName.indexOf(wsjPrefix)!==0){this._s.pageName=wsjPrefix+this._s.pageName;}
if(this._s.prop2.indexOf(wsjPrefix)!==0){if((this._s.prop20.indexOf('BT-')===0)||(this._s.prop20.indexOf('PR-')===0)){this._s.prop2=wsjPrefix+'Business';}
else{this._s.prop2=wsjPrefix+this._s.prop2;}}
if(this._s.prop19=='article'){this._s.hier1=[this._s.channel,this._s.prop1,this._s.prop2,this._s.prop22,this._s.prop3,this._s.prop20,this._s.prop4,this._s.prop6].join(",");}else{this._s.hier1=[this._s.channel,this._s.prop1,this._s.prop2,this._s.pageName,this._s.prop6].join(",");}
this._s.hier2=[this._s.channel,this._s.prop19,this._s.prop2,this._s.prop3].join(",");this._s.hier3=[this._s.channel,this._s.prop2,this._s.prop26,this._s.pageName].join(",");this._s.hier4=[this._s.channel,this._s.prop2,this._s.prop1].join(",");this._s.hier5=[this._s.channel,this._s.prop24,this._s.prop1,this._s.prop2,this._s.prop26].join(",");this._s.events="";if(!this._s.events){this._s.events="event12";}else{if(this._s.events.indexOf("event12")==-1){this._s.events=this._s.events?(this._s.events+",event12"):"event12";}}
if(this._s.prop19=='article'){if(this._s.events.indexOf("event18")==-1){this._s.events=this._s.events?(this._s.events+",event18"):"event18";}}
else if(this._s.prop19=='comments_tab'){if(this._s.events.indexOf("event32")==-1){this._s.events=this._s.events?(this._s.events+",event32"):"event32";}}
else if(this._s.prop19=='home page'){if(this._s.events.indexOf("event17")==-1){this._s.events=this._s.events?(this._s.events+",event17"):"event17";}}
else if(this._s.prop19=='marketing and support'){if(this._s.prop6.indexOf('reader-error')!=-1){this._s.events="event12,"+"event50";}
else if(this._s.prop6.indexOf('reader-confirm')!=-1){this._s.events="event12,"+"event49";}else{this._s.events="event12,"+"event48";}}
else{if(this._s.events.indexOf("event16")==-1){this._s.events=this._s.events?(this._s.events+",event16"):"event16";}}
if(s.prop9==='preview'&&s.prop19==='article'){this._s.prop19=s.prop19+'_'+s.prop9}
this._s.prop49=this._s.getVisitNum();this._s.prop23=this._s.getDaysBeforeEvent();this._s.eVar3="";if(this.cookieUserType!==null){this._s.eVar3=this.cookieTracking;}
if(this._s.eVar3===null){console.info("{Tracking} could not get cookie 'TR'.");}
this._s.eVar4=this._s.pageName;this._s.eVar5="";this._s.eVar6="";if(this.link){this._s.eVar5=this.link;}
if(this.reflink){this._s.eVar6=this.reflink;}
this._s.eVar8="";if(this._s.prop18){this._s.eVar8=this._s.prop18;}
this._s.eVar11=this._s.channel;this._s.eVar25=this._s.prop2;var dt=new Date();if(!this.weekday){this.weekday=[];this.weekday[0]="Sunday";this.weekday[1]="Monday";this.weekday[2]="Tuesday";this.weekday[3]="Wednesday";this.weekday[4]="Thursday";this.weekday[5]="Friday";this.weekday[6]="Saturday";}
this._s.eVar31=this.weekday[dt.getDay()];this._s.eVar32=dt.getHours()+":00";this._firePixelCount=this._firePixelCount+1;var s_code=this._s.t();if(s_code){this.generatePixel(s_code);}
this.generateSpotlightPixel();},generateSpotlightPixel:function(){if((this.cookieSpotlightSet===null)&&(this.cookieTracking!==null)){var cookieVal=this.cookieTracking;var randomNumber=Math.floor(Math.random()*1000000);var pixelSrc='http://ad.doubleclick.net/activity;src=1373310;type=rapta615;cat=track812;u='+cookieVal+';ord='+randomNumber+'?';var pixel=new Element("img",{"src":pixelSrc,"width":"2","height":"2","alt":"","border":"0"});console.debug("{Tracking} writing spotlightTag:"+pixelSrc);document.getElementsByTagName("body")[0].appendChild(pixel);console.debug("{Tracking} end of writing spotlightTag.");dj.util.Cookie.setCookie('spotlightSet','true','90d+');}},generatePixel:function(pixelImg){if(!pixelImg){return;}
pixelImg=''+pixelImg;var srcBegin=pixelImg.indexOf("src=")+5;var pixelSrc=pixelImg.substring(srcBegin);var srcEnd=pixelSrc.indexOf('"');this.pixelSrc=pixelSrc.substring(0,srcEnd);var piximg=document.getElementById('s_i_'+s.fun);if(piximg){piximg.src=this.pixelSrc;}},debugPixel:function(){window.open("","stats_debugger","width=600,height=600,location=0,menubar=0,status=1,toolbar=0,resizable=1,scrollbars=1").document.write("<script type=\"text/javascript\" src=\"/static_html_files/omniture/pixelDebug.html\"></"+"script>");}},rsi:{delayRsi:function(){this._delayRsi=true;},init:function(delayOverride){if((typeof delayOverride==="undefined"||delayOverride===false)&&this._delayRsi===true){return;}
if(typeof this._rsiInitted!=="undefined"){return;}else{this._rsiInitted=true;}
document.write("<script type=\"text\/javascript\" src=\"http://js.revsci.net/gateway/gw.js?csid=G07608\"><\/script>");try{this.doRsi();}
catch(err){console.info("{Tracking} could not find 'DM_tab' and/or 'saveSegment'.");}},doRsi:function(){var that=this;document.observe('dom:loaded',function(){that.saversicookie();});},saversicookie:function(){try{if(s.prop19==='article'||s.prop19==='article_preview'){DM_cat(s.channel+' > '+s.prop1+' > '+s.prop2+' > '+s.prop3);}
else{DM_cat(s.channel+' > '+s.prop1+' > '+s.prop2+' > '+s.pageName);}}catch(e){console.info("DM_CAT throws",e);}
try{DM_tag();}
catch(err){console.info("{Tracking} could not find 'DM_tab' and/or 'saveSegment'.");}}},addTrackingIFrame:function(){if(this._isTIFR){return;}else{this._isTIFR=true;}
var site=(typeof dj.widget.ad.adPageSite==='undefined')?"interactive.wsj.com":dj.widget.ad.adPageSite,zone=(typeof dj.widget.ad.adPageZone==='undefined')?"default":dj.widget.ad.adPageZone,pageId=pID,d=document,e=d.createElement('iframe');e.width=0;e.height=0;e.border=0;e.alt="";e.style.visibility="hidden";e.src="/public/resources/documents/PixelTracking.html?site="+site+"&zone="+zone+"&pageId="+pageId+"&cb="+Math.floor(Math.random()*1000000);var elm=d.getElementById("FIMTracking");if(elm){elm.appendChild(e);}},interstitial:{init:function(){console.info("{Tracking} executing interstitial.");}}};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,container,url,options){$super(options);this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.maxDecay=(this.options.maxDecay||10);this.updater={};this.container=container;this.url=url;this.start();},start:function(){this.options.onComplete=this.updateComplete.bind(this);this.onTimerEvent();},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments);},updateComplete:function(response){if(this.options.onUpdate){this.options.onUpdate.apply(this,$A(arguments));}
if(this.options.decay){this.decay=(response.responseText==this.lastText?this.decay*this.options.decay:1);this.decay=(this.decay>this.maxDecay)?this.maxDecay:this.decay;this.lastText=response.responseText;}
this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency);},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options);}});if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.RuntimeLogger={logUrl:"/runtimeLogger",initted:false,sent:false,init:function(url){if(this.initted){return;}else{this.initted=true;}
this.logUrl=url||this.logUrl;if(typeof window.console==="undefined"){window.console={};}
window.console.stack=[];window.console.warn=function(msg,e){try{this.stack.push("{"+msg.split(": %p")[0]+" "+e.name+": \""+e.message+"\"}");}catch(err){}};},send:function(){if(this.sent){return;}else{this.sent=true;}
var h=$H();var browser="";if(Prototype.Browser.IE){browser="IE";}
if(Prototype.Browser.Opera){browser="Opera";}
if(Prototype.Browser.WebKit){browser="WebKit";}
if(Prototype.Browser.Gecko){browser="Gecko";}
if(Prototype.Browser.MobileSafari){browser="MobileSafari";}
h.set("errors","["+new Date()+" - "+document.location.pathname+" - "+browser+"] "+window.console.stack.join(", "));var that=this;var img=new Element("img",{src:that.logUrl+"?"+h.toQueryString()});$$("body").first().insert(img);}};function OpenG(url){dj.util.Url.openWin(url,"",980,707,"off",true,40,10);}
function OpenWin(){dj.util.Url.openWin.apply(null,arguments);}
function launchAudio(aFilePath){var whichis=aFilePath.split("/");var numArgs=whichis.length;var theFileName=whichis[numArgs-1];var theLaunchPath="http://s.wsj.net/public/resources/documents/WSJ_audioPlayer08.html?audioFile="+aFilePath+"&trackName="+theFileName;OpenG(theLaunchPath);}
if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.XSLT=function(){var processor=(typeof window.ActiveXObject!='undefined'?null:new XSLTProcessor());var result=null;var xsl=null;var xml=null;var success=function(){};var error=function(){};var setXsl=function(S){xsl=S;};var setXml=function(M){xml=M;};return{transform:function(O){if(O.onError){error=O.onError;}
if(typeof O.xslUrl=='undefined'||O.xslUrl===null||typeof O.feedUrl=='undefined'||O.feedUrl===null){error('error: need xslUrl and feedUrl to proceed');return;}
if(O.onSuccess){success=O.onSuccess;}
var that=this,xsl,xml;try{if(processor===null){xsl=new ActiveXObject("Msxml2.DOMDocument.5.0");xml=new ActiveXObject("Msxml2.DOMDocument.5.0");xsl.async=true;xsl.onreadystatechange=function(){if(xsl.readyState==4){setXsl(xsl);that.doTransform();}};xsl.load(O.xslUrl);xml.async=true;xml.onreadystatechange=function(){if(xml.readyState==4){setXml(xml);that.doTransform();}};xml.load(O.feedUrl);}
else{xsl=new XMLHttpRequest();xml=new XMLHttpRequest();xsl.overrideMimeType('text/xml');xsl.onreadystatechange=function(){if(xsl.readyState==4&&xsl.status=='200'){setXsl(xsl.responseXML);that.doTransform();}};xsl.open('GET',O.xslUrl,true);xsl.send(null);xml.overrideMimeType('text/xml');xml.onreadystatechange=function(){if(xml.readyState==4&&xml.status=='200'){setXml(xml.responseXML);that.doTransform();}};xml.open('GET',O.feedUrl,true);xml.send(null);}}catch(e){error(e);}},doTransform:function(){if(xsl===null||xml===null){return;}
try{if(processor===null){var y=xml.transformNode(xsl),i=y.indexOf('?>');if(i!=-1){y=y.substring(i+2);}
var z=new Element('div');z.innerHTML=y;result=document.createDocumentFragment();while(z.childNodes.length>0){result.appendChild(z.childNodes[0]);}}
else{processor.importStylesheet(xsl);result=processor.transformToFragment(xml,document);processor.reset();}
success(result);}catch(e){error(e);}}};}();dj.util.Quote={isMutualFund:function(term)
{term=term.replace(/^\s+|\s+$/g,"").toUpperCase();var match=term.match(/[X|Y]$/);return match!==null&&match.length>0&&match[0].length>0;},doExchangeTypeMap:function(exchange){var hashExchange={};hashExchange["US"]="usstock usfund";hashExchange["SAO PAULO"]="brsp";hashExchange["TOR"]="tse";hashExchange["CSEC"]="vecsec";hashExchange["ASX"]="auasx";hashExchange["SHSE"]="shse";hashExchange["SSE"]="sse";hashExchange["HKSE"]="hkse";hashExchange["TSE"]="jptse";hashExchange["KLSE"]="myklse";hashExchange["NZSE"]="nzse";hashExchange["SES"]="sgses";hashExchange["TWSE"]="twtwse";hashExchange["BRUX"]="bebrux";hashExchange["COPN"]="copn";hashExchange["TALLINN"]="tallinn";hashExchange["HELS"]="hels";hashExchange["PARB"]="frparb";hashExchange["FRNK"]="defrnk";hashExchange["XETRA"]="dexetra";hashExchange["REYKJAVIK"]="reykjavik";hashExchange["DUBLIN"]="iedublin";hashExchange["MILAN"]="itmilan";hashExchange["RIGA"]="riga";hashExchange["LITHUANIA"]="lithuania";hashExchange["AMS"]="nlams";hashExchange["OSLO"]="nooslo";hashExchange["SIBE"]="escats";hashExchange["STKM"]="sestkm";hashExchange["ZSE"]="chzse";hashExchange["LONDON"]="lse";hashExchange["VTX"]="virtx";var type=hashExchange[exchange];return type;}};isMutualFund=function(){console.error("{isMutualFund is deprecated} Please switch to dj.util.Quote.isMutualFund by 11/09/08");return dj.util.Quote.isMutualFund.apply(null,arguments);};doExchangeTypeMap=function(){console.error("{doExchangeTypeMap is deprecated} Please switch to dj.util.Quote.doExchangeTypeMap by 11/09/08");return dj.util.Quote.doExchangeTypeMap.apply(null,arguments);};dj.util.Search={baseDomain:((typeof window.nSP)=='undefined'||nSP===null)?'http://'+document.domain:nSP,validateQuoteSearchBox:function(el){var isTextEntered=false;if(el.value===null||el.value.length==0)
{alert("Please Enter a Symbol or Keyword.");}
else
{isTextEntered=true;}
return isTextEntered;},doViewQuote:function(symbol){dj.util.User.isLoggedIn(function(loggedIn){symbol=symbol.replace(/^\s+|\s+$/g,"");symbol=symbol.replace(/,+/gi,",");symbol=symbol.replace(/,$|\.,$/,"");if(symbol.match(",")){var symbolslist=symbol.split(",");var querySymbol='';var exchange='';for(i=0;i<symbolslist.length;i++){tempSymb=symbolslist[i];tempEx='';if(symbolslist[i].indexOf('(')>0){tempSymb=symbolslist[i].substring(0,symbolslist[i].indexOf('('));tempEx=symbolslist[i].substring(symbolslist[i].indexOf('(')+1,symbolslist[i].length-1);}
else{tempEx='US';}
tempSymb=tempSymb.replace(/^\s+|\s+$/g,"");querySymbol=querySymbol+tempSymb+",";exchange=exchange+doExchangeTypeMap(tempEx)+",";}
querySymbol=querySymbol.substring(0,querySymbol.length-1);exchange=exchange.substring(0,exchange.length-1);querySymbol=querySymbol.replace(/\+/g,"%2B");var quoteURL=dj.util.Search.baseDomain+'/public/quotes/main.html?symbol='+querySymbol+'&type='+exchange+'&mod=DNH_S';window.location=quoteURL;}
else{var exchange='US';var querySymbol=symbol;if(symbol.indexOf('(')>0){querySymbol=symbol.substring(0,symbol.indexOf('('));exchange=symbol.substring(symbol.indexOf('(')+1,symbol.length-1);}
querySymbol=querySymbol.replace("+","%2B");var quoteURL=dj.util.Search.baseDomain+'/public/quotes/main.html?symbol='+querySymbol+'&type='+doExchangeTypeMap(exchange)+'&mod=DNH_S';window.location=quoteURL;}});},doKeyWordSearch:function(query){dj.util.User.isLoggedIn(function(loggedIn){query=query.replace(/^\s+|\s+$/g,"").replace(/,$|\.,$/,"");var searchURL=dj.util.Search.baseDomain+((loggedIn)?'/search':'/public/search/page/3_0466.html')+'?KEYWORDS='+escape(query)+'&mod=DNH_S';window.location=searchURL;});}};validateQuoteSearchBox=function(){console.error("{validateQuoteSearchBox is deprecated} Please switch to dj.util.Search.validateQuoteSearchBox by 11/09/08");return dj.util.Search.validateQuoteSearchBox.apply(null,arguments);};doViewQuote=function(){console.error("{doViewQuote is deprecated} Please switch to dj.util.Search.doViewQuote by 11/09/08");return dj.util.Search.doViewQuote.apply(null,arguments);};doKeyWordSearch=function(){console.error("{doKeyWordSearch is deprecated} Please switch to dj.util.Search.doKeyWordSearch by 11/09/08");return dj.util.Search.doKeyWordSearch.apply(null,arguments);};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
dj.util.Date={simpleDateFormat:{nibbles:{},character:"",output:"",index:0,labels:{month:['January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],day:['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat']},doubleDigit:function(x){return(x<0||x>9?"":"0")+x;},format:function(date,f){f=f+"";this.output="";this.index=0;var token="";var y=date.getYear()+"";var M=date.getMonth()+1;var E=date.getDay();var H=date.getHours();var m=date.getMinutes();var s=date.getSeconds();y="".concat((y.length<4)?(y-0+1900):y);this.nibbles.y=y;this.nibbles.yyyy=y;this.nibbles.yy=y.substring(2,4);this.nibbles.M=M;this.nibbles.MM=this.doubleDigit(M);this.nibbles.MMM=this.labels.month[M-1];this.nibbles.NNN=this.labels.month[M+11];this.nibbles.d=date.getDate();this.nibbles.dd=this.doubleDigit(date.getDate());this.nibbles.E=this.labels.day[E+7];this.nibbles.EE=this.labels.day[E];this.nibbles.H=H;this.nibbles.HH=this.doubleDigit(H);this.nibbles.h=(H==0)?12:((H>12)?H-12:H);this.nibbles.hh=this.doubleDigit(this.nibbles["h"]);this.nibbles.K=(H>11)?(H-12):H;this.nibbles.k=H+1;this.nibbles.KK=this.doubleDigit(this.nibbles["K"]);this.nibbles.kk=this.doubleDigit(this.nibbles["k"]);this.nibbles.a=(H>11)?"PM":"AM";this.nibbles.aa=(H>11)?"p.m.":"a.m.";this.nibbles.m=m;this.nibbles.mm=this.doubleDigit(m);this.nibbles.s=s;this.nibbles.ss=this.doubleDigit(s);while(this.index<f.length){this.character=f.charAt(this.index);token="";while((f.charAt(this.index)==this.character)&&(this.index<f.length)){token+=f.charAt(this.index++);}
this.output+=(typeof this.nibbles[token]!=="undefined")?this.nibbles[token]:token;}
return this.output;}},timezones:{'Australian Central Daylight Time':'ACDT','Australian Central Standard Time':'ACST','Atlantic Daylight Time':'ADT','Australian Eastern Daylight Time':'AEDT','Australian Eastern Standard Time':'AEST','Alaska Daylight Time':'AKDT','Alaska Standard Time':'AKST','Atlantic Standard Time':'AST','Australian Western Daylight Time':'AWDT','Australian Western Standard Time':'AWST','British Summer Time':'BST','Central Daylight Time':'CDT','Central European Daylight Time':'CEDT','Central European Summer Time':'CEST','Central European Time':'CET','Central Summer(Daylight) Time':'CST','Central Standard Time':'CST','Christmas Island Time':'CXT','Eastern Daylight Time':'EDT','Eastern European Daylight Time':'EEDT','Eastern European Summer Time':'EEST','Eastern European Time':'EET','Eastern Summer(Daylight) Time':'EST','Eastern Standard Time':'EST','Greenwich Mean Time':'GMT','Heure Avanc?e de l\',Atlantique':'HAA','Heure Avanc?e du Centre':'HAC','Hawaii-Aleutian Daylight Time':'HADT','Heure Avanc?e de l\',Est':'HAE','Heure Avanc?e du Pacifique':'HAP','Heure Avanc?e des Rocheuses':'HAR','Hawaii-Aleutian Standard Time':'HAST','Heure Avanc?e de Terre-Neuve':'HAT','Heure Avanc?e du Yukon':'HAY','Heure Normale de l\',Atlantique':'HNA','Heure Normale du Centre':'HNC','Heure Normale de l\',Est':'HNE','Heure Normale du Pacifique':'HNP','Heure Normale des Rocheuses':'HNR','Heure Normale de Terre-Neuve':'HNT','Heure Normale du Yukon':'HNY','Irish Summer Time':'IST','Mountain Daylight Time':'MDT','Mitteleurop?ische Sommerzeit':'MESZ','Mitteleurop?ische Zeit':'MEZ','Mountain Standard Time':'MST','Newfoundland Daylight Time':'NDT','Norfolk (Island) Time':'NFT','Newfoundland Standard Time':'NST','Pacific Daylight Time':'PDT','Pacific Standard Time':'PST','Coordinated Universal Time':'UTC','Western European Daylight Time':'WEDT','Western European Summer Time':'WEST','Western European Time':'WET','Western Summer(Daylight) Time':'WST','Western Standard Time':'WST'},getTimeZone:function(time){var tzs=time.toString().replace(/^.*\(|\)$/g,"");var tz=this.timezones[tzs];if(typeof tz!=="string"&&(tzs.length>=2)){for(var z in this.timezones){if(this.timezones[z]===tzs){return tzs;}}}
if(typeof(tz)=="undefined"||!tz){var d=time.toString();tz=d.substr(d.length-8,3);}
if(typeof(tz)=="undefined"){tz="";}
return tz;},displayTime:function(time,dtGMT){var tzs=((new Date().getTimezoneOffset()/60)*(-1)).toString();if(tzs.indexOf('.')!==-1)
{var hr=tzs.substring(0,tzs.indexOf('.'));var min=(tzs.substring(tzs.indexOf('.'),tzs.length)==".75")?":45":":30";tzs=hr+min;}
if(time!==""&&dtGMT!==""){if(tzs=="-4"||tzs=="-5"||tzs=="-6"||tzs=="-7"||tzs=="-8"||tzs=="-9"||tzs=="-10"||tzs=="-11"){return time;}
else if(dtGMT.indexOf('GMT')!==-1){pgDate=dtGMT.substring(dtGMT.indexOf(',')+1,dtGMT.length);var dtt=new Date(pgDate);var p1=this.simpleDateFormat.format(dtt,"EE, MMM d, y ");var p2="As of "+this.simpleDateFormat.format(dtt,"h:mm a ");var p3="(GMT "+(tzs.indexOf('-')!==-1?tzs:"+"+tzs)+" hours)";return p1+p2+p3;}
else{return dtGMT;}}},getAmericasDate:function(dt){if((typeof pDateinSpanish!=='undefined')&&(typeof pDateinPortuguese!=='undefined')){if(pID.substring(4,6)==='WS'){var adt=this.formatAmericasDate(pDateinSpanish);}else{var adt=this.formatAmericasDate(pDateinPortuguese);adt=adt.replace(/de/g,"X").replace(/X([^X]*)$/,"Y$1").replace("Y",",").replace(/X/g,"de");adt=adt.replace(' ,',',');}
var americasDate=document.getElementById('todaysDate');var myNode=document.createTextNode(adt);americasDate.appendChild(myNode);}},formatAmericasDate:function(dt){var r=dt.substring(0,dt.lastIndexOf(','));return r.substring(0,1).toUpperCase()+r.substring(1,r.length);}};if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
if(typeof dj.context.jsexec=="undefined"){dj.context.jsexec={};}
dj.util.JSExec=function(ctx){var djUtil=dj.util;var con=window.console;var emptyFunc=function(){};var djmark=(djUtil.Perf&&djUtil.Perf.mark)?djUtil.Perf.mark:emptyFunc;var djmeasure=(djUtil.Perf&&djUtil.Perf.measure)?djUtil.Perf.measure:emptyFunc;var warn=(con&&typeof con.warn=="function")?con.warn:emptyFunc;return function(execIndex,djexecname,func){try{djmark(djexecname);func.apply(ctx);djmeasure(djexecname);}catch(e){warn("JSExec %d: %o",execIndex,e);}};};
if(typeof dj=="undefined"){var dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.util=="undefined"){dj.util={};}
if(typeof dj.widget.ad=="undefined"){dj.widget['ad']={};}
dj.widget.ad.isRemoved=false;dj.widget.ad.adPageZone='adPageZone';dj.widget.ad.adPageSite='interactive.wsj.com';dj.widget.ad.Ad=Class.create({adUriPrefix:'http://ad.doubleclick.net/',adIframeClass:'advIframe',adImgClass:'advImg',adType:'iframe',adUrl:{},initialize:function(id,adType,options){this.adId=id;this.adType=adType;this.gAdClass=this.adId;this.width=options.width;this.height=options.height;this.size=options.size;this.style=options.style;this.zone=options.zone;this.site=options.site;this.adClass=options.adClass;this.meta=options.meta;this.tile=options.tile;this.category=options.category;this.ordRecalculate=options.ordRecalculate;this.refreshInterval=options.refreshInterval;this.classEnabled=options.classEnabled;this.classValue=options.classValue;this.styleValue=options.styleValue;this.conditionType=options.conditionType;this.conditionValue=options.conditionValue;this.conditionalString=options.conditionalString;this.registerKey=options.registerKey;var utilObj=new dj.util.Ads();var wsjRegion=dj.util.Region.getViewByRegion();switch(wsjRegion){case"europe":this.adUriPrefix="http://ad.uk.doubleclick.net/";dj.widget.ad.adPageSite='europe.wsj.com';break;case"asia":this.adUriPrefix="http://ad.hk.doubleclick.net/";dj.widget.ad.adPageSite='asia.wsj.com';break;case"asia,india":this.adUriPrefix="http://ad.in.doubleclick.net/";dj.widget.ad.adPageSite='asia.wsj.com';break;default:this.adUriPrefix="http://ad.doubleclick.net/";}
if(this.site=='bottom.wsj.com'){this.site='bottom.interactive.wsj.com';}
if(utilObj.isEmpty(this.site)){this.site='interactive.wsj.com';}
if(utilObj.isEmpty(this.zone)){this.zone='default';}
if(this.adId.endsWith('G')||this.adId.endsWith('A')||this.adId.endsWith('R')||this.adId.endsWith('L')||this.adId.startsWith('RollOutAd')||this.adId.startsWith('TopAd')){dj.widget.ad.adPageZone=this.zone;}
if(this.adType=='iframe'){this.iframeAd();}
else{if(dj.context.ads.JSAdSwitch){this.jsAd();}
else{this.iframeAd();}}
if(this.classEnabled==="false"){$(this.adId).removeClassName(this.classValue);}
if(this.styleValue!==undefined&&!this.styleValue.blank()){$(this.adId).setStyle(this.styleValue);}},iframeAd:function(){var adUriSuffix=this.calculateAdUrl(this.adType);var oAdCnt=$(this.adId);var oIframe=new Element('iframe',{src:this.adUriPrefix+'adi'+adUriSuffix,id:this.adId+dj.context.ads.iframe,width:this.width,height:this.height,scrolling:"no",frameBorder:"0",marginWidth:"0",marginHeight:"0",hspace:"0",vspace:"0",border:"0",style:"margin:0px; padding:0px"});oAdCnt.appendChild(oIframe);},jsAd:function(){var etsFlag=dj.util.Cookie.getCookie('etsFlag');var adUriSuffix=this.calculateAdUrl(this.adType);var url=this.adUriPrefix+"adj"+adUriSuffix;var jsa=new dj.util.Url.jsFrame(this.adId,url);},pullAdUrl:function(iframeId){return this.adUrl[iframeId];},pushAdUrl:function(iframeId,url){var urlSrc=this.adUriPrefix+"adi";if(this.adUrl[iframeId]===undefined&&url!==''){urlSrc+=this.calculateAdUrl(dj.context.ads.iframe);this.adUrl[iframeId]=urlSrc;}
else{this.adUrl[iframeId]=url;}},calculateAdUrl:function(adType){var adObj=new dj.util.Ads();this.tile=(this.tile>0)?this.tile:adObj.getAdTile('oneForAll');var ordCalculated='';adObj.saveSegQS();if(this.adClass==='A'&&dj.context.ads.adZone===''){dj.context.ads.adZone=this.zone;}
if(this.ordRecalculate=='true'){ordCalculated=adObj.appendOrd(adObj.calculateOrd());}
else{ordCalculated=adObj.getAdOrd('oneForAll');}
var categ=(this.category===undefined)?'':this.category;var userCookie=adObj.getUserCookie(this.adClass);var lMsrc=adObj.getAdMsrc(this.adClass);var lMC=adObj.getMC(this.adClass);var lSegQS=adObj.getSegQS();var lregistererKey=(this.registerKey===undefined)?'':';page='+this.registerKey;var adUriSuffix='/'+
adObj.getAdInternationalSite(this.adId,adObj.getAdSite(this.adId,this.site))+'/'+
this.zone+
userCookie+';!category='+
categ+
lregistererKey+
lMsrc+';'+
lSegQS+
lMC+';mtfInline=true'+';tile='+
this.tile;if(adType==dj.context.ads.iframe){adUriSuffix=adUriSuffix+';sz='+this.width+'x'+this.height;}
else{adUriSuffix=adUriSuffix+';sz='+this.size;}
adUriSuffix+=';ord='+ordCalculated+';';return adUriSuffix;}});if(typeof dj=="undefined"){var dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
if(typeof dj.context=="undefined"){dj.context={};}
if(typeof dj.context.article=="undefined"){dj.context.article={};}
dj.context.ads.JSAdSwitch=true;dj.context.ads.rsinetsegs="";dj.context.ads.segQS="";dj.context.ads.isFirstDoubleClickAd=0;dj.context.ads.refCookieVal="";dj.context.ads.adZone='';dj.context.ads.iframe='iframe';dj.context.ads.isSafariRefreshEnabled=Prototype.Browser.WebKit;dj.context.ads.randomId4RollAd=Math.random();dj.util.Ads=Class.create({classAdOrd:{},registeredAd:{},adTile:{},adTracking:{},zone:'',storedAd:new Hash(),initialize:function(){},getAdOrd:function(classType){if(this.classAdOrd[classType]===undefined){var adOrd=this.calculateOrd();this.classAdOrd[classType]=this.appendOrd(adOrd);}
return this.classAdOrd[classType];},removeCachedAd:function(){var ad=this.storedAd;var obj;ad.each(function(pair){obj=pair.value;});this.storedAd=new Hash();},calculateOrd:function(){var intOrd=Math.ceil(32768*Math.random());var adOrd=intOrd.toString();if(adOrd.length!==4){return this.calculateOrd();}
else{return adOrd;}},appendOrd:function(adOrd){return adOrd.times(4);},getArg:function(N){var i=0;var u="";u="".concat(window.location);u=(u.indexOf("?")>-1)?u.split("?")[1]:"";u=(u.indexOf("#")>-1)?u.split("#")[0]:u;u=(u.charAt(u.length-1)==="&")?u.substring(0,u.length-1):u;N+="=";while(i<u.length){var j=i+N.length;if(u.substring(i,j)===N){return unescape(u.substring(j,(u.indexOf("&",j)==-1)?u.length:u.indexOf("&",j)));}
i=u.indexOf("&",i)+1;if(i===0){break;}}
return null;},getRandomId:function(){return dj.context.ads.randomId4RollAd;},getAdTile:function(classType){if(this.adTile[classType]===undefined){this.adTile[classType]=1;}
else{var intTile=this.adTile[classType];this.adTile[classType]=++intTile;}
return this.adTile[classType];},getCurrentTile:function(classType){return this.adTile[classType];},getAdMsrc:function(classType){if(!this.isEmpty(this.adTracking.msrc)){return this.adTracking.msrc;}
this.adTracking.msrc=';msrc='+(dj.util.Cookie.getCookie('etsFlag')?dj.util.Cookie.getCookie('etsFlag'):this.getArg('mod'));var msrc=(this.adTracking.msrc===';msrc=null'?'':this.adTracking.msrc);this.adTracking.msrc=msrc;return msrc;},getUserCookie:function(classType){var userCookie=dj.util.Cookie.getCookie('TR');var userRsiCookieVal=dj.util.Cookie.getCookie('rsi_csl');var userValue=';u=';if(this.getCurrentTile('oneForAll')===1){if(userCookie!==null){userValue+=userCookie;}
if(userRsiCookieVal!==null){userValue+='^^'+userRsiCookieVal;}
return userValue;}
return'';},getMC:function(classType){var that=this;var mc=''
dj.util.User.isSubLoggedIn(function(subLoggedIn){if(!subLoggedIn){mc=that.adTracking.mc;if(that.isEmpty(mc)){var mcObj=new dj.util.MarketingZone();var mcCode=mcObj.getZone();mc=';mc='+mcCode;}}});return mc;},getAdInternationalSite:function(adId,site){var adsite=site;var brokerButtons="brokerbuttons.international.wsj.com";var wsjRegion=dj.util.Region.getViewByRegion();var intDomain="";intDomain=((wsjRegion.indexOf('europe')>=0))?"europe":intDomain;intDomain=((wsjRegion.indexOf('asia')>=0))?"asia":intDomain;if(intDomain.empty()){return adsite;}
adsite=adsite.replace("interactive",intDomain);if(site==="brokerbuttons.wsj.com"){adsite=brokerButtons.replace("international",intDomain);}
return adsite;},getAdSite:function(adId,site){var etsFlag=dj.util.Cookie.getCookie('etsFlag');var siteVal="";siteVal=(etsFlag)?"ets.wsj.com":this.getAdDomainOverride(adId,site);return siteVal;},getAdDomainOverride:function(adId,site){var adsite=site;if(adId==='headerPromoContainer'||adId==='footerPromoContainer'){if(dj.context.ads.refCookieVal===""){dj.context.ads.refCookieVal=this.getRefCookieVal();}
if((site.indexOf('.wsj.com')>=0)&&!this.isEmpty(dj.context.ads.refCookieVal)){adsite=dj.context.ads.refCookieVal;if(adId==='footerPromoContainer'){adsite='bottom.'+adsite;}}}
return adsite;},getRefCookieVal:function(){var adDomain=dj.util.Cookie.getCookie('adDomain');if(adDomain===null||this.isEmpty(adDomain)){var d=document;var r=d.referrer;if(r&&r!==null&&r!==""){adDomain='';var adDomains=new Hash({'www.yahoo.com':'yahoo.wsj.com','finance.yahoo.com':'yahoofi.wsj.com','cm.my.yahoo.com':'myyahoo.wsj.com','biz.yahoo.com':'yahoobiz.wsj.com','news.yahoo.com':'yahoonews.wsj.com','news.google.com':'google.wsj.com','moneycentral.msn.com':'msn.wsj.com','msnmoney.com':'msn.wsj.com','news.moneycentral.msn.com':'msn.wsj.com','www.comcast.net':'comcast.wsj.com','autoweek.com':'autoweek.wsj.com','buzz.yahoo.com':'yahoobuzz.wsj.com','www.myspace.com':'myspace.wsj.com','www.foxbusiness.com':'foxbusiness.wsj.com','news.myspace.com':'myspacenews.wsj.com','www.foxnews.com':'foxnews.wsj.com'});var domainSt=r.indexOf('//')+2;var refdom=r.substring(domainSt);var domainEnd=refdom.indexOf('/');refdom=refdom.substring(0,domainEnd);if(adDomains.get(refdom)){adDomain=adDomains.get(refdom);}
if(adDomain){dj.util.Cookie.setCookie('adDomain',adDomain);}}}
return adDomain;},saveSegQS:function(){if(!dj.context.ads.segQS.empty()){return;}
var rsiSegment=dj.util.Cookie.getCookie('rsi_segs');var rsiSeg=(rsiSegment)?rsiSegment.split("|"):"";rsiSeg.length=rsiSeg.length<20?rsiSeg.length:20;var segQS=rsiSeg.length>0?"s="+rsiSeg[0]:"";for(var i=1;i<rsiSeg.length;i++){segQS+=(";s"+"="+(rsiSeg[i]?rsiSeg[i]:""));}
segQS=segQS.replace(/G07608/ig,'8');dj.context.ads.segQS=segQS;},getSegQS:function(){var lenSegQS=0;var that=this;var segQS=dj.context.ads.segQS;dj.util.User.isSubLoggedIn(function(subLoggedIn){var demoQS=null;if(subLoggedIn){try{demoQS=dj.util.ads.Demographics.getUserDemographics();if(demoQS!==null){lenSegQS=(segQS?segQS.length:0);if(lenSegQS>0){segQS=segQS+";"+(that.isEmpty(demoQS)?'':demoQS);}
else{segQS=demoQS+";";}
that.adTracking.segQS=segQS;}}
catch(errMsg){}}
else{}});that.adTracking.segQS=segQS;return this.adTracking.segQS;},registerAd:function(key,value){if(this.registeredAd[key]===undefined){this.registeredAd[key]=value;}
else{var fromRegistry=this.registeredAd[key];fromRegistry=fromRegistry+"*"+value;this.registeredAd[key]=fromRegistry;}},loadAds:function(key,options){if(this.registeredAd[key]===undefined){}
else{var fromRegistry=this.registeredAd[key];var adURL=fromRegistry.split("*");var utilAdObj=new dj.util.Ads();adURL.each(function(item){var newVal=item.split(";");var sepearated=item.toQueryParams(';');var i=0;try{dj.widget.ad.AdManager.deleteAd(newVal[i]+dj.context.ads.iframe);}
catch(e){}
Object.extend(sepearated,options);var idUsed=newVal[i];if(sepearated.id!==undefined){idUsed=sepearated.id;}
var adObj=dj.widget.ad.AdManager.createAd(idUsed,newVal[++i],{width:sepearated.width,height:sepearated.height,size:sepearated.size,site:sepearated.site,zone:sepearated.zone,adClass:sepearated.adclass,meta:sepearated.meta,frequency:sepearated.frequency,cacheId:sepearated.cacheId,classEnabled:sepearated.classEnabled,classValue:sepearated.classValue,styleValue:sepearated.styleValue,conditionType:sepearated.conditionType,conditionValue:sepearated.conditionValue,conditionalString:sepearated.conditionalString,ordRecalculate:'true',registerKey:key});});}},getRegisteredAdsZone:function(key){if(this.isEmpty(key)||this.isEmpty(this.registeredAd[key])){return dj.context.ads.adZone;}
else{var fromRegistry=this.registeredAd[key];var adURL=fromRegistry.split("*");adURL.each(function(item){var sepearated=item.toQueryParams(';');return sepearated.zone;});}},modifyAdUrlWithOrd:function(url){var subUrl=url.substring(0,url.indexOf('ord='));var adObj=new dj.util.Ads();var ord=adObj.appendOrd(adObj.calculateOrd());return(subUrl+'ord='+ord);},isEmpty:function(value){try{if(value===undefined){return true;}
if(value===null){return true;}
if(value.blank()){return true;}}
catch(excion){}
return false;}});if(typeof dj.widget.ad=="undefined"){dj.widget['ad']={};}
dj.widget.ad.AdManager=function(){return{createAd:function(id,adType,options){try{var validated=dj.widget.ad.AdManager.validateConditons(id,adType,options);if(validated===true){return;}
var adOb=new dj.widget.ad.Ad(id,adType,options);if(!dj.context.ads.isSafariRefreshEnabled){if(options.frequency!==undefined&&!options.frequency.blank()&&options.frequency>0){options.ordRecalculate='true';dj.widget.ad.AdManager.updateAd(id,adType,options,id+dj.context.ads.iframe);}}
if(options.cacheId!==undefined&&!options.cacheId.blank()){dj.widget.ad.AdManager.storeAd(options.cacheId,{container:id,elementId:id+dj.context.ads.iframe,element:$(id+dj.context.ads.iframe),check:'saving'});}}
catch(e){}},validateConditons:function(id,adType,options){var conditionType=options.conditionType;var conditionValue=options.conditionValue;var status=false;var existingObject="";if(conditionType!==undefined&&!conditionType.blank()&&conditionValue!==undefined&&!conditionValue.blank()){if(conditionType==="excludeids"){conditionValue.scan(/\w+/,function(match){existingObject=$(match[0]);if(existingObject!==null){status=true;return;}});}}
return status;},updateAd:function(containerId,adType,options,iframeId){var periodicExc=new PeriodicalExecuter(function(pe){dj.widget.ad.AdManager.deleteAllElementsInContainer(containerId);var adobj=new dj.widget.ad.Ad(containerId,adType,options);},options.frequency);},deleteAllElementsInContainer:function(containerId){try{$(containerId).update();}catch(e){}},deleteAd:function(iframeId){try{$(iframeId).remove();}
catch(e){}},testRefreshAd:function(idRefresh,id){dj.widget.ad.AdManager.deleteAllElementsInContainer(idRefresh);dj.widget.ad.AdManager.refreshAd(id);},refreshAd:function(id){try{var adUtil=new dj.util.Ads();var ad=adUtil.storedAd.get(id);ad.each(function(pair){var obj=pair.value;$(obj.get('container')).insert(obj.get('element'));obj=null;});ad=null;}
catch(e){}},storeAd:function(id,options){try{var adUtil=new dj.util.Ads();var rtrve=adUtil.storedAd.get(id);var hOb=$H({container:options.container,elementId:options.elementId,element:options.element,check:options.check});if(rtrve==undefined){var one=new Hash();one.set(1,hOb);adUtil.storedAd.set(id,one);one=null;}
else{var j=rtrve.keys().size();rtrve.set(++j,hOb);adUtil.storedAd.set(id,rtrve);}
hOb=null;rtrve=null;}
catch(storeEx){}},iframeRefreshOnLoad:function(){var f=document.getElementsByTagName('iframe');for(var i=0;i<f.length;i++){f[i].src=f[i].src;}}};}
();if(typeof dj=="undefined"){var dj={};}
if(typeof dj.util=="undefined"){dj['util']={};}
dj.util.MarketingZone=Class.create({mktg_zone:'',partners:['yahoo','google','msn','other'],mktgZone:'',init:function(){this.mktg_zone=$H({"full_denial_bol":"bol_fullfree","full_denial_other_bol":"bol_fullfree","full_denial_yahoo_bol":"yahoo_bolfullfree","full_denial_google_bol":"google_bolfullfree","full_denial_msn_bol":"msn_bolfullfree","full_denial_other":"wsjexp_fullfree","full_denial_yahoo":"yahoo_wsjexpfullfree","full_denial_google":"google_wsjexpfullfree","full_denial_msn":"msn_wsjexpfullfree","full_yahoo":"yahoo_fullfree","full_google":"google_fullfree","full_msn":"msn_fullfree","full_other":"wsjfreezone","denial_bol":"bol_prev","denial_other_bol":"bol_prev","denial_yahoo_bol":"yahoo_bolprev","denial_google_bol":"google_bolprev","denial_msn_bol":"msn_bolprev","denial_other":"wsjexp_prev","denial_yahoo":"yahoo_wsjexpprev","denial_google":"google_wsjexpprev","denial_msn":"msn_wsjexpprev","yahoo":"yahoo","google":"google","msn":"msn","other":"b2pfreezone","other_super":"b2pfreezone_super","denial_other_super":"wsjexp_prev_super","denial_bol_super":"bol_prev_super","denial_bol_super":"bol_prev_super","yahoo_super":"yahoo_super","denial_yahoo_super":"yahoo_wsjexpprev_super","denial_yahoo_bol_super":"yahoo_bolprev_super","msn_super":"msn_super","denial_msn_super":"msn_wsjexpprev_super","denial_msn_bol":"msn_bolprev_super","google_super":"google_super","denial_google_super":"google_wsjexpprev_super","denial_google_bol_super":"google_bolprev_super"});},getPartner:function(modparam){var localMod="";if(modparam!==null&&modparam.length>0){for(var i=0;i<this.partners.length;i++){if(modparam.indexOf(this.partners[i])>-1){localMod=this.partners[i];break;}}}
return((localMod===null||localMod.length<1)?"other":localMod);},setZone:function(mod){this.mktgZone=this.mktg_zone.get(mod);},getZone:function(){this.setMktgZone();return this.mktgZone;},setMktgZone:function(){this.init();var localDenial=(typeof isDenial)==='undefined'?false:isDenial;var localFree=(typeof isFree)==='undefined'?false:isFree;var localTrial=(typeof isTrial)==='undefined'?false:isTrial;var localSuperSnippet=((typeof dj.context.article.isSuperSnippet)==='undefined'||(typeof dj.context.article.isSuperSnippet)==='boolean')?false:dj.context.article.isSuperSnippet;var modParam=new dj.util.Ads().getArg("mod");var whichMod=this.getPartner(modParam);var mod="";var localLaserBOL=false;var localLaserWSJ=false;var user=false;dj.util.User.isSubLoggedIn(function(subLoggedIn){if(subLoggedIn){user=true;}});dj.util.User.hasRole('Barrons',function(hasTheRole){if(hasTheRole){localLaserBOL=true;}});dj.util.User.hasRole('WSJ',function(hasTheRole){if(hasTheRole){localLaserWSJ=true;}});if(localDenial===true||localDenial==="true"){mod+="denial_";mod+=whichMod;if(localLaserBOL){mod+="_bol";}}
else{if(user&&!localLaserBOL&&!localLaserWSJ){mod+="denial_";mod+=whichMod;}
else{if(document.cookie.indexOf("reactivation=/myaccount/do/reactivate")!==-1){mod+="denial_";mod+=whichMod;}
else{mod+=whichMod;}}}
if(localFree===true||localFree==='true'||localTrial===true||localTrial==='true'){if(localSuperSnippet===true||localSuperSnippet==='true'){mod+='_super';}
else{mod="full_"+mod;}}
this.setZone(mod);}});if(typeof dj=="undefined"){dj={};}
if(typeof dj.util=="undefined"){dj.util={};}
if(typeof dj.util.ads=="undefined"){dj.util.ads={};}
dj.util.ads.Demographics=function(){var DEMO_COOKIE="djcs_demo";var END_OF_INPUT=-1;var base64Count=0;var base64Str=null;var base64Chars=[];var reverseBase64Chars=[];var cachedUserDemographics=null;function initBase64Chars(){base64Chars=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'];for(var i=0,len=base64Chars.length;i<len;i++){reverseBase64Chars[base64Chars[i]]=i;}}
function readReverseBase64(){if(!base64Str){return END_OF_INPUT;}
while(true){if(base64Count>=base64Str.length){return END_OF_INPUT;}
var nextCharacter=base64Str.charAt(base64Count);base64Count++;if(reverseBase64Chars[nextCharacter]){return reverseBase64Chars[nextCharacter];}
if(nextCharacter=='A'){return 0;}}
return END_OF_INPUT;}
function ntos(n){n=n.toString(16);n=(n.length==1)?("0"+n):n;n="%"+n;return unescape(n);}
function parseDemoCookie(cv){if(cv.search(/^V1:/)==-1||cv.length<4){return null;}
return cv.substring(3);}
function demoReadCookie(cookieName){var theCookie=""+document.cookie;var ind=theCookie.indexOf(cookieName);if(ind===-1||cookieName===""){return"";}
var ind1=theCookie.indexOf(';',ind);if(ind1===-1){ind1=theCookie.length;}
return unescape(theCookie.substring(ind+cookieName.length+1,ind1));}
function demoDeleteCookie(name,path,domain){if(demoReadCookie(name)){document.cookie=name+"="+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT";}}
function demoTrimString(sInString){sInString=sInString.replace(/^\s+/g,"");return sInString.replace(/\s+$/g,"");}
function base64Decode(str){base64Str=str;base64Count=0;var result="";var inBuffer=[];var done=false;while(!done&&(inBuffer[0]=readReverseBase64())!=END_OF_INPUT&&(inBuffer[1]=readReverseBase64())!=END_OF_INPUT){inBuffer[2]=readReverseBase64();inBuffer[3]=readReverseBase64();result+=ntos((((inBuffer[0]<<2)&0xff)|inBuffer[1]>>4));if(inBuffer[2]!=END_OF_INPUT){result+=ntos((((inBuffer[1]<<4)&0xff)|inBuffer[2]>>2));if(inBuffer[3]!=END_OF_INPUT){result+=ntos((((inBuffer[2]<<6)&0xff)|inBuffer[3]));}
else{done=true;}}
else{done=true;}}
return result;}
return{getUserDemographics:function(noCache){noCache=(typeof noCache!=="boolean")?false:noCache;if(noCache===false&&cachedUserDemographics!==null){return cachedUserDemographics;}
var val=demoReadCookie(DEMO_COOKIE);initBase64Chars();if(!val){return;}
val=demoTrimString(val);if(val.length<0){return null;}
val=base64Decode(val);val=parseDemoCookie(val);if(!val){demoDeleteCookie(DEMO_COOKIE);}
if(val!='!'){cachedUserDemographics=val;return val;}
return null;}};}
();
if(typeof dj=="undefined"){dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.tree=="undefined"){dj.widget.tree={};}
dj.widget.ProgressBar=Class.create({TYPES:["horizontal"],initialize:function(container,config){var that=this;this.cfg={indicator:"div",fps:100,timer:4,type:"horizontal"};Object.extend(this.cfg,(config||{}));this.oCnt=$(container);this.oInd=new Element(this.cfg.indicator);this.oCnt.update(this.oInd);this._pcToPixCache={};this._pba=null;},play:function(){if(this._pba!==null){this._pba.start(this._pba.options);return;}
var that=this;var len=this._pcToPix(100);this._pba=new Effect.Move(this.oInd,{x:len,y:0,fps:1,transition:Effect.Transitions.linear,duration:that.cfg.timer,beforeStart:that.cfg.beforeStart,beforeUpdate:that.cfg.beforeUpdate,afterUpdate:that.cfg.afterUpdate,afterFinish:that.cfg.afterFinish});},pause:function(){if(this._pba===null){return;}
this._pba.cancel();},stop:function(){if(this._pba===null){return;}
this.pause();this._pba.originalLeft=0;this._pba.update(0);},_pcToPix:function(pc,noCache){var cached=this._pcToPixCache[pc];if(!noCache&&typeof cached!=="undefined"){return cached;}
var max=this.oCnt.getWidth();pc=(pc<=100)?pc:100;pc=(pc>=0)?pc:0;var px=(max/100*pc);px=(px>=0)?px:0;this._pcToPixCache[pc]=px;return px;}});
if(typeof dj=="undefined"){dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.panels=="undefined"){dj.widget.panels={};}
if(typeof dj.widget.panels.view=="undefined"){dj.widget.panels.view={};}
if(typeof dj.widget.panels.controller=="undefined"){dj.widget.panels.controller={};}
dj.widget.panels.PanelsFactory={_CONFIG:{core:{panelGroup:".newsItem",panel:"> li",panelPrefix:"panelsPanel_",panels:undefined,panelToggleStyle:"hidden",activePanel:undefined,disabledPanels:undefined,panelIncrement:1,viewArea:undefined,paginationContainer:".pagination",controller:undefined,enableBrowserHistory:false,animationDuration:0.3},tabs:{tabPrefix:"panelsTab_",tabGroup:".newsItem",tab:"> li",navContainer:".nav-inline",prevButton:".prev",nextButton:".next",navButtonEnabledStyle:"enabled",tabOnEvent:"click",tabOnStyle:"active",tabOffStyle:"deselected"},carousel:{orientation:"horizontal",navContainer:".nav-inline",prevButton:".prev",nextButton:".next",prevButtonEnabledStyle:"enabledPrev",nextButtonEnabledStyle:"enabledNext"},rotator:{rotateTime:8,rotateIterations:3,pauseOnMouseOver:false,pauseButton:".nav-inline .pause",pauseButtonEnabledStyle:"enabledPause",progressBar:".progressbarBox"}},_panelsType:{NONE:0,SLIDE:1,SWITCH:2},_lookupType:{NONE:0,SELECTOR:1,PREFIX:2},create:function(container,cfg,doIgnoreOptCache){if(!container||(typeof cfg!=="object")){console.warn("{Panels} no container or config specified.");return;}
container=dj.lang.byId(container);if(container&&!doIgnoreOptCache){var optCache=['{',container.id,': ',dj.lang.objectToString(cfg,true),'}'].join('');var cntOpt=container.getAttribute("djw_optcache");if(cntOpt){var opts=cntOpt.split("_");for(var i=0,len=opts.length;i<len;i++){if(opts[i]==optCache){console.warn("{Panels} prevented attempt to reinitialize \""+container.id+"\".");return;}}}
if(cntOpt){container.setAttribute("djw_optcache",[optCache,cntOpt].join("_"));}else{container.setAttribute("djw_optcache",optCache);}}
try{var mvc=this._setupMvc(container,cfg);this._addCompatibilityMethods(mvc,container,cfg);return mvc.model;}catch(ex){console.warn(ex);return;}},createPanels:function(userCfg){var djwp=dj.widget.panels;var _lookupType=this._lookupType;var _panType=this._panelsType;var model=null,views={},controllers={};var config=dj.lang.clone(this._CONFIG.core);config.container="";config.doAddChangeListeners=true;config.panelsType=_panType.SWITCH;config.panelsLookupType=_lookupType.SELECTOR;dj.lang.mixin(config,userCfg);var panels=null;switch(config.panelsLookupType){case _lookupType.PREFIX:panels=this._lookupByPrefix(config.panelPrefix,config.panels);break;case _lookupType.SELECTOR:panels=this._lookupBySelector(config.container,config.panelGroup,config.panel);break;default:return;}
var rotType=(((config.type==djwp.PanelModel.prototype.ROTATION_TYPE.CIRCULAR)||(config.type=="circular"))?djwp.PanelModel.prototype.ROTATION_TYPE.CIRCULAR:djwp.PanelModel.prototype.ROTATION_TYPE.LINEAR);model=new djwp.PanelModel(this._panelsToPanelsDTO(panels),{rotationType:rotType});model.setActiveByPosition(1);var view=null;switch(config.panelsType){case _panType.SLIDE:view=new djwp.view.SlidePanel(model,panels,{animationDuration:config.animationDuration,viewArea:config.viewArea});break;case _panType.SWITCH:view=new djwp.view.Panel(model,panels,{selectedClass:config.selectedPanelClass,deselectedClass:config.deselectedPanelClass});break;}
views.panels=view;if(config.doAddChangeListeners){model.addChangeListener("success",view.displayActiveSuccess,view);}
return{"model":model,"views":views,"controllers":controllers};},addModuleNavArrows:function(mvc,userCfg){var _lookupType=this._lookupType;var model=mvc.model;var views=mvc.views;var controllers=mvc.controllers;var config=dj.lang.clone(this._CONFIG.carousel);config.container="";config.doAddEvents=true;config.doAddChangeListeners=true;config.doHide=false;dj.lang.mixin(config,userCfg);if(!config.container&&views.panels&&views.panels.getContainer){config.container=views.panels.getContainer();}
var navArrowsLookupType=_lookupType.NONE;if(!config.lookupType){navArrowsLookupType=(config)?_lookupType.SELECTOR:navArrowsLookupType;}else{navArrowsLookupType=config.lookupType;}
var navArrows={},lng=dj.lang;if(navArrowsLookupType==_lookupType.SELECTOR){navArrows.navContainer=lng.query(config.navContainer,config.container)[0];if(navArrows.navContainer){navArrows.prevButton=lng.query(config.prevButton,navArrows.navContainer)[0];navArrows.nextButton=lng.query(config.nextButton,navArrows.navContainer)[0];}else{return;}}else{return;}
if(config.doHide){navArrows.navContainer.style.visibility="hidden";return;}
var controller=new dj.widget.panels.controller.NavArrows(model,navArrows);controllers.navArrows=controller;var view=new dj.widget.panels.view.NavArrows(model,navArrows);view.displayActiveSuccess();views.navArrows=view;if(config.doAddEvents){controller.addEvents();}
if(config.doAddChangeListeners){model.addChangeListener("success",view.displayActiveSuccess,view);}},addModuleNavTabs:function(mvc,userCfg){var _lookupType=this._lookupType;var model=mvc.model;var views=mvc.views;var controllers=mvc.controllers;var config=dj.lang.clone(this._CONFIG.tabs);config.container="";config.panels=this._CONFIG.core.panels;config.doAddEvents=true;config.doAddChangeListeners=true;dj.lang.mixin(config,userCfg);if(!config.container&&views.panels&&views.panels.getContainer){config.container=views.panels.getContainer();}
var navTabsLookupType=_lookupType.NONE;if(!config.lookupType){navTabsLookupType=(userCfg)?_lookupType.SELECTOR:navTabsLookupType;navTabsLookupType=(userCfg&&userCfg.tabPrefix)?_lookupType.PREFIX:navTabsLookupType;}else{navTabsLookupType=config.lookupType;}
var navTabs=null;switch(navTabsLookupType){case _lookupType.PREFIX:navTabs=this._lookupByPrefix(config.tabPrefix,config.panels);break;case _lookupType.SELECTOR:navTabs=this._lookupBySelector(config.container,config.tabGroup,config.tab);break;default:return;}
var view=new dj.widget.panels.view.Panel(model,navTabs,{selectedClass:config.tabOnStyle,deselectedClass:config.tabOffStyle});var controller=new dj.widget.panels.controller.NavTabs(model,navTabs,{activeEvent:config.tabOnEvent});views.navTabs=view;controllers.navTabs=controller;if(config.doAddEvents){controller.addEvents();}
if(config.doAddChangeListeners){model.addChangeListener("success",view.displayActiveSuccess,view);}},addModulePagination:function(mvc,userCfg){var config={},djLang=dj.lang;var model=mvc.model,views=mvc.views;dj.lang.mixin((config={container:"",doAddChangeListeners:true,paginationContainer:this._CONFIG.core.paginationContainer,doHide:false}),userCfg);if(!config.container&&views.panels&&views.panels.getContainer){config.container=views.panels.getContainer();}
var oPaginationCnt=djLang.query(config.paginationContainer,config.container)[0];if(!oPaginationCnt){return;}
if(config.doHide){oPaginationCnt.style.visibility="hidden";return;}
var view=new dj.widget.panels.view.Pagination(model,oPaginationCnt);view.displayActiveSuccess();views.pagination=view;if(config.doAddChangeListeners){model.addChangeListener("success",view.displayActiveSuccess,view);}},addModuleTimer:function(mvc,userCfg){var config=dj.lang.clone(this._CONFIG.rotator);config.container="";config.doAddEvents=true;config.doAddChangeListeners=true;dj.lang.mixin(config,userCfg);var controllers=mvc.controllers;controllers.timer=new dj.widget.panels.controller.Timer(mvc.model,config);var oPause=dj.lang.query(config.pauseButton,config.container)[0];if(oPause){var view=new dj.widget.panels.view.Timer(mvc.model,{pauseButton:oPause},userCfg);if(config.doAddChangeListeners){mvc.model.addChangeListener("rotationStateSuccess",view.rotationStateSuccess,view);}}
if(config.doAddEvents){controllers.timer.addEvents();}},addModuleBrowserHistory:function(mvc,userCfg){var config={};dj.lang.mixin((config={doAddEvents:true}),userCfg);var controllers=mvc.controllers;controllers.browserHistory=new dj.widget.panels.controller.History(mvc.model,config);if(config.doAddEvents){controllers.browserHistory.addEvents();}},addController:function(mvc,cMvc){if(!cMvc||!cMvc.model||!cMvc.model.addChangeListener||!mvc||!mvc.model){throw new Error("{Panels.addController} mvc and/or controller is invalid.");}
var model=mvc.model;var controller=cMvc.model;controller.addChangeListener("success",function(panel){model.setActive(panel);});},_setupMvc:function(container,userConfig){var oCnt=dj.lang.byId(container);container=(oCnt.id||container);var config=dj.lang.clone(this._CONFIG);dj.lang.mixin(config,userConfig);var _panType=this._panelsType;var _lookType=this._lookupType;var typeCfg={};typeCfg.panelsType=_panType.NONE;typeCfg.panelsType=(userConfig.core)?_panType.SWITCH:typeCfg.panelsType;typeCfg.panelsType=(userConfig.carousel)?_panType.SLIDE:typeCfg.panelsType;typeCfg.panelsLookupType=_lookType.SELECTOR;typeCfg.panelsLookupType=(userConfig.core&&userConfig.core.panelPrefix)?_lookType.PREFIX:typeCfg.panelsLookupType;typeCfg.navTabsLookupType=_lookType.NONE;typeCfg.navTabsLookupType=(userConfig.tabs)?_lookType.SELECTOR:typeCfg.navTabsLookupType;typeCfg.navTabsLookupType=(userConfig.tabs&&userConfig.tabs.tabPrefix)?_lookType.PREFIX:typeCfg.navTabsLookupType;typeCfg.navArrowsLookupType=_lookType.NONE;typeCfg.navArrowsLookupType=(userConfig.carousel)?_lookType.SELECTOR:typeCfg.navArrowsLookupType;typeCfg.navArrowsLookupType=(userConfig.tab&&userConfig.tab.navContainer)?_lookType.SELECTOR:typeCfg.navArrowsLookupType;typeCfg.hasController=(userConfig.core&&(typeof userConfig.core.controller=="object"));typeCfg.hasNavArrows=(typeCfg.navArrowsLookupType!==_lookType.NONE);typeCfg.hasNavTabs=(typeCfg.navTabsLookupType!==_lookType.NONE);typeCfg.hasTimer=(typeof userConfig.rotator=="object"&&userConfig.rotator.rotateTime>0);typeCfg.hasBrowserHistory=(config.core.enableBrowserHistory);var panelsCfg={container:oCnt,doAddChangeListeners:false,panelsType:typeCfg.panelsType,panelsLookupType:typeCfg.panelsLookupType};dj.lang.mixin(panelsCfg,config.core);if(typeCfg.panelsType==_panType.SWITCH){dj.lang.mixin(panelsCfg,config.tabs);}else if(typeCfg.panelsType==_panType.SLIDE){dj.lang.mixin(panelsCfg,config.carousel);}
var mvc=this.createPanels(panelsCfg);var model=mvc.model;var views=mvc.views;var controllers=mvc.controllers;if(model.getNumberOfPanels()==-1){throw new Error("{Panels} container \""+container+"\" has no panels.");}
if(typeCfg.hasNavTabs){var navTabCfg=config.tabs;navTabCfg.container=oCnt;navTabCfg.panels=config.core.panels;navTabCfg.doAddEvents=false;navTabCfg.doAddChangeListeners=false;navTabCfg.lookupType=typeCfg.navTabsLookupType;this.addModuleNavTabs(mvc,navTabCfg);}
if(typeCfg.hasNavArrows){var navArrCfg=config.carousel;navArrCfg.container=oCnt;navArrCfg.doAddEvents=false;navArrCfg.doAddChangeListeners=false;navArrCfg.lookupType=typeCfg.navArrowsLookupType;navArrCfg.doHide=((typeCfg.panelsType==_panType.SLIDE)&&(views.panels.getViewArea()>=model.getNumberOfPanels()));this.addModuleNavArrows(mvc,navArrCfg);}
if(typeCfg.panelsType==_panType.SLIDE&&(views.panels.getViewArea()==1)){var paginCfg={container:oCnt,paginationContainer:config.core.paginationContainer,doAddEvents:false,doAddChangeListeners:false,doHide:(views.panels.getViewArea()!==1)};this.addModulePagination(mvc,paginCfg);}
if(typeCfg.hasTimer){var timerCfg=config.rotator;timerCfg.container=oCnt;timerCfg.doAddEvents=false;this.addModuleTimer(mvc,timerCfg);}
if(typeCfg.hasBrowserHistory){var histConf={container:(typeCfg.panelsLookupType==_lookType.SELECTOR)?oCnt.id:container,doAddEvents:false};this.addModuleBrowserHistory(mvc,histConf);}
if(typeCfg.hasController){this.addController(mvc,config.core.controller);}
var view=null;for(var viewName in views){if(views.hasOwnProperty(viewName)){view=views[viewName];if(view.displayActiveSuccess){model.addChangeListener("success",view.displayActiveSuccess,view);}
if(view.displayActiveFailure){model.addChangeListener("failure",view.displayActiveFailure,view);}}}
var controller=null;for(var controllerName in controllers){if(controllers.hasOwnProperty(controllerName)){controller=controllers[controllerName];controller.addEvents();}}
if(!typeCfg.hasBrowserHistory&&typeCfg.panelsType==_panType.SWITCH){model.setActiveByPosition(1);}
return mvc;},_addCompatibilityMethods:function(mvc,container,config){if(typeof mvc.model.update==="undefined"){var that=this;mvc.model.update=function(){for(var i=0,len=mvc.controllers.length;i<len;i++){mvc.controllers[i].removeEvents();}
return that.create((container.id||container),config,true);};}
if(mvc.controllers&&mvc.controllers.navTabs){var tabs=mvc.controllers.navTabs._tabs,djLang=dj.lang;mvc.model.observeTabs=function(callback,eventType){var cbBridge=function(ev){var tid=(ev.srcElement||ev.target).getAttribute("djw_tabId");if(mvc.controllers.navTabs._cfg.doStopEvent===true){djLang.stopEvent(ev);}
tid=(isNaN(parseInt(tid,10)))?tid:(mvc.model.getById(tid).getPosition()+"");callback.call(null,tid,mvc.model);};for(var tid in tabs){if(tabs.hasOwnProperty(tid)){djLang.addEvent((tabs[tid]).getElement(),eventType,cbBridge);}}};}
mvc.model.model=mvc.model;mvc.model.views=mvc.views;mvc.model.controllers=mvc.controllers;},_panelsToPanelsDTO:function(panels){var elms={};for(var panId in panels){if(panels.hasOwnProperty(panId)){var pan=panels[panId];elms[panId]=new dj.widget.panels.PanelDTO(pan.getId(),pan.getPosition());}}
return elms;},_lookupByPrefix:function(prefix,names){var elms={};for(var i=0,len=names.length,id=null,el=null,pos=1;i<len;i++){id=names[i];el=dj.lang.byId(prefix+id);if(el===null||el.firstChild===null){continue;}
elms[id]=new dj.widget.panels.Panel(id,pos++,el);}
return elms;},_lookupBySelector:function(container,group,node){if(!container||container===null){throw new Error('{dj.util.Panels} container for group: "'+group+'" is undefined.');}
var oCnt=dj.lang.byId(container);var oPanels=dj.lang.query((group+' '+node),oCnt);var elms={};for(var i=0,len=oPanels.length,el=null,pos=1;i<len;i++){el=oPanels[i];if(el===null||(el.tagName!=="IMG"&&el.firstChild===null)){continue;}
elms[pos-1]=new dj.widget.panels.Panel(pos-1,pos++,el);}
return elms;}};(function(){var _dwp=dj.widget.panels;(_dwp.PanelDTO=function(id,position){this._id=null;this._position=null;if(typeof id!=="undefined"){this.setId(id);}
if(typeof position!=="undefined"){this.setPosition(position);}}).prototype={getId:function(){return this._id;},setId:function(id){if(typeof id==="undefined"){throw new Error("ID must be defined.");}
this._id=id;},getPosition:function(){return this._position;},setPosition:function(position){if(typeof position!=="number"){throw new TypeError("Position must be a number.");}
this._position=position;}};_dwp.Panel=function(id,position,element){dj.widget.panels.PanelDTO.call(this,id,position);this._element=null;if(typeof element!=="undefined"){this.setElement(element);}};dj.lang.extend(_dwp.Panel,_dwp.PanelDTO);dj.lang.mixin(_dwp.Panel.prototype,{getElement:function(){return this._element;},setElement:function(element){if(typeof element!=="object"){throw new TypeError("Element must be an object.");}
this._element=element;}});}());(dj.widget.panels.PanelModel=function(panels,cfg){this._cfg=dj.lang.cloneMixin(this.DEFAULT_CONFIG,cfg);this._hPanels={};this._panelIds=[];this._prevInHistory=null;this._lastPosition=1;this._activePanel=null;this._activePanelObserver=new dj.util.Observer();this._direction=this.DIRECTION.NEXT;this._isLocked=false;this._lockObserver=0;this._rotationState=1;if(panels){this.addPanels(panels);}}).prototype={ROTATION_TYPE:{LINEAR:0,CIRCULAR:1},DIRECTION:{PREVIOUS:0,NEXT:1},DEFAULT_CONFIG:{rotationType:0},addPanel:function(panelId){var panel=new dj.widget.panels.Panel(panelId,this._lastPosition);this._panelIds[this._lastPosition]=panel.getId();this._hPanels[panelId]=panel;this._lastPosition++;},addPanels:function(panels){var that=this;for(var pid in panels){if(panels.hasOwnProperty(pid)){var panel=panels[pid];var panelId=panel.getId();that._panelIds[that._lastPosition]=panelId;that._hPanels[panelId]=panel;that._lastPosition++;}}},hasId:function(panelId){return(typeof this._hPanels[panelId]!=="undefined");},hasPosition:function(panelPosition){return((panelPosition>0)&&(panelPosition<this._panelIds.length));},getById:function(panelId){if(!this.hasId(panelId)){throw new Error("NoSuchElementException");}
return this._hPanels[panelId];},getByPosition:function(panelPosition){if(!this.hasPosition(panelPosition)){if(this._cfg.rotationType===this.ROTATION_TYPE.CIRCULAR){var numOfPan=this.getNumberOfPanels();panelPosition=(panelPosition%numOfPan);panelPosition=(panelPosition===0)?numOfPan:panelPosition;}else{return;}}
var pid=this._panelIds[panelPosition];return this._hPanels[pid];},getActive:function(){return this._activePanel;},getPrevInHistory:function(){return this._prevInHistory;},getAll:function(){var values=[];for(var value in this._hPanels){if(this._hPanels.hasOwnProperty(value)){values.push(this._hPanels[value]);}}
return values;},getNumberOfPanels:function(){return(this._panelIds.length-1);},getRotationState:function(){return this._rotationState;},setRotationState:function(state){if(state<0||state>1){this._activePanelObserver.fireByName("rotationStateFailure",state);}
this._rotationState=state;this._activePanelObserver.fireByName("rotationStateSuccess",state);},getDirection:function(){return this._direction;},setDirection:function(dir){if(dir<0||dir>1){throw new Error("IndexOutOfBoundsException");}
this._direction=dir;},getRotationType:function(){return this._cfg.rotationType;},setActive:function(panel){if(panel&&panel.getId){this.setActiveById(panel.getId());}},setActiveById:function(panelId){if(!this.hasId(panelId)){this._activePanelObserver.fireByName("failure",panelId);return;}
var panel=this.getById(panelId);this._prevInHistory=this._activePanel;this._activePanel=panel;this._activePanelObserver.fireByName("success",panel);},setActiveByPosition:function(panelPosition){if(!this.hasPosition(panelPosition)){if(this._cfg.rotationType===this.ROTATION_TYPE.CIRCULAR){var numOfPan=this.getNumberOfPanels();panelPosition=(panelPosition%numOfPan);panelPosition=(panelPosition===0)?numOfPan:panelPosition;}else{this._activePanelObserver.fireByName("failure",panelPosition);return;}}
var pid=this._panelIds[panelPosition];this.setActiveById(pid);},addChangeListener:function(event,listener,context){if(arguments.length<3&&(typeof event==="function")){context=listener;listener=event;event="success";}
context=(typeof context!=="undefined")?context:this;this._activePanelObserver.subscribeByName(event,listener,context);},isLocked:function(){return this._isLocked;},addLockListener:function(obs,context){this._lockObserver={cb:obs,ctx:context};},doLock:function(){this._isLocked=true;},releaseLock:function(){this._isLocked=false;if(this._lockObserver&&typeof this._lockObserver.cb=="function"){this._lockObserver.cb.call(this._lockObserver.ctx);}},getViewArea:function(){return this._viewArea;},setViewArea:function(va){this._viewArea=va;},getActivePanel:function(){return this.getActive().getId();},setActivePanel:function(pid){var meth=(typeof pid=="string")?this.setActiveById:this.setActiveByPosition;return meth.call(this,pid);},hasPanel:function(panel){var pid=(panel.getId)?panel.getId():panel;return this.hasId(pid);},observePanels:function(callback){this.addChangeListener(function(panel){callback.apply(this,[panel.getId(),panel.getId()]);},this);}};(dj.widget.panels.view.Panel=function(model,panels,cfg){this._cfg=dj.lang.cloneMixin(this.DEFAULT_CONFIG,cfg);this._model=model;this._oPanels=panels;}).prototype={DEFAULT_CONFIG:{selectedClass:"",deselectedClass:"hidden"},displayActiveSuccess:function(panel){this._deselectAllExcept(panel);this._select(panel);},getContainer:function(){if(this._oCnt){return this._oCnt;}
if(this._cfg.container&&this._cfg.container!==""){this._oCnt=dj.lang.byId(this._cfg.container);return this._oCnt;}
if(this._oPanelGroup){this._oCnt=this._oPanelGroup.parentNode;return this._oCnt;}
var ap=this._model.getByPosition(1);var el=this._oPanels[ap.getId()];if(!el.parentNode||!el.parentNode.parentNode){return null;}
var grp=el.parentNode;this._oCnt=grp.parentNode;return this._oCnt;},_deselectAllExcept:function(panelNotToHide){var panel=null;for(var pid in this._oPanels){if(this._oPanels.hasOwnProperty(pid)){panel=this._oPanels[pid];if(panelNotToHide.getId()==pid){continue;}
dj.lang.removeClassName(panel.getElement(),this._cfg.selectedClass);dj.lang.addClassName(panel.getElement(),this._cfg.deselectedClass);}}},_select:function(panel){var pid=panel.getId();var oPan=this._oPanels[pid];if(!oPan){return;}
dj.lang.removeClassName(oPan.getElement(),this._cfg.deselectedClass);dj.lang.addClassName(oPan.getElement(),this._cfg.selectedClass);}};(dj.widget.panels.view.SlidePanel=function(model,panels,cfg){this._cfg=dj.lang.cloneMixin(this.DEFAULT_CONFIG,cfg);this._model=model;this._panels=panels;this._isSetupDone=false;this._animation=null;this._deltaMap=[];}).prototype={DEFAULT_CONFIG:{animationDuration:0.3,animationType:"slide"},_getDelta:function(prevPanel,currPanel){var x=this._deltaMap[prevPanel.getPosition()];if(x){var y=x[currPanel.getPosition()];if(y){return y;}}
var pp=prevPanel.getPosition();var cp=currPanel.getPosition();var isInc=((cp-pp)>0);var ppl=this._panels[prevPanel.getId()].getElement().offsetLeft;var cpl=this._panels[currPanel.getId()].getElement().offsetLeft;var delta=isInc?(cpl-ppl):(ppl-cpl);delta*=((isInc)?-1:1);this._deltaMap[pp]=(this._deltaMap[pp]||[]);this._deltaMap[pp][cp]=delta;return delta;},displayActiveSuccess:function(activePanel){var model=this._model;model.doLock();if(!this._isSetupDone){this._setCoreValues();if(this._isRotationCircular){this._circularLoopSetup();}
this._isSetupDone=true;}
var prevPanel=model.getPrevInHistory();var prvPos=prevPanel.getPosition(),avePos=activePanel.getPosition();var afterFin=function(){model.releaseLock();},beforeStr=function(){};var isIncreasing=(model.getDirection()==model.DIRECTION.NEXT);var delta=0;var that=this;if(this._isRotationCircular){var isIncFlip=false;var isDecrFlip=false;if(isIncreasing&&(prvPos==this._numberOfPanels)&&(avePos==1)){isIncFlip=true;delta=-this._panelWidth;}else if(!isIncreasing&&(prvPos==1)&&(avePos==this._numberOfPanels)){isDecrFlip=true;delta=this._panelWidth;}else{delta=this._getDelta(prevPanel,activePanel);}
afterFin=function(){if(isIncFlip){that._oPanelGroup.style.left="0px";}
model.releaseLock();};beforeStr=function(){if(isDecrFlip){var mv=-that._getDelta(activePanel,prevPanel)-that._panelWidth;that._oPanelGroup.style.left=mv+"px";}};}else{delta=this._getDelta(prevPanel,activePanel);}
var animCfg={x:delta,y:0,duration:that._cfg.animationDuration,afterFinish:afterFin,beforeStart:beforeStr};if(this._animation===null){this._animation=new Effect.Move(this._oPanelGroup,animCfg);}
else{this._animation.start(animCfg);}},getContainer:function(){if(this._oCnt){return this._oCnt;}
if(this._cfg.container&&this._cfg.container!==""){this._oCnt=dj.lang.byId(this._cfg.container);return this._oCnt;}
if(this._oPanelGroup){this._oCnt=this._oPanelGroup.parentNode;return this._oCnt;}
var ap=this._model.getByPosition(1);var el=ap.getElement();if(!el.parentNode||!el.parentNode.parentNode){return null;}
var grp=el.parentNode;this._oCnt=grp.parentNode;return this._oCnt;},getViewArea:function(){if(!this._viewArea){if(typeof this._cfg.viewArea=="number"){this._viewArea=this._cfg.viewArea;}else{var djL=dj.lang;var el=(this._panels[this._model.getByPosition(1).getId()]).getElement();var cnt=el.parentNode.parentNode;this._viewArea=Math.round(djL.coords(cnt).w/djL.coords(el).w);this._model.setViewArea(this._viewArea);}}
return this._viewArea;},_setCoreValues:function(){if(this._isCoreValuesSet){return;}
var model=this._model,ap=this._panels[model.getByPosition(1).getId()];this._oPanelGroup=ap.getElement().parentNode;this._numberOfPanels=model.getNumberOfPanels();this._isRotationCircular=(model.getRotationType()==model.ROTATION_TYPE.CIRCULAR);this._panelWidth=dj.lang.coords(ap.getElement()).w;this._isCoreValuesSet=true;},_circularLoopSetup:function(){for(var i=1,element=null,clone=null,len=this.getViewArea();i<=len;i++){element=this._panels[this._model.getByPosition(i).getId()].getElement();clone=element.cloneNode(true);this._oPanelGroup.appendChild(clone);}}};(dj.widget.panels.view.Pagination=function(model,pagCnt){this._model=model;this._pagCnt=pagCnt;}).prototype={displayActiveSuccess:function(){var ap=this._model.getActive();var num=this._model.getNumberOfPanels();this._pagCnt.innerHTML=ap.getPosition()+"/"+num;}};(dj.widget.panels.view.NavArrows=function(model,nav,cfg){this._cfg=dj.lang.cloneMixin(this.DEFAULT_CONFIG,cfg);this._model=model;this._nav=nav;}).prototype={DEFAULT_CONFIG:{prevButtonEnabledStyle:"enabledPrev",nextButtonEnabledStyle:"enabledNext"},displayActiveSuccess:function(panel){var mod=this._model,lng=dj.lang;var pp=mod.getByPosition(mod.getActive().getPosition()-1);if(!pp){lng.removeClassName(this._nav.prevButton,this._cfg.prevButtonEnabledStyle);}
else{lng.addClassName(this._nav.prevButton,this._cfg.prevButtonEnabledStyle);}
var np=mod.getByPosition(mod.getActive().getPosition()+mod.getViewArea());if(!np){lng.removeClassName(this._nav.nextButton,this._cfg.nextButtonEnabledStyle);}
else{lng.addClassName(this._nav.nextButton,this._cfg.nextButtonEnabledStyle);}}};(dj.widget.panels.controller.NavTabs=function(model,tabs,cfg){this._model=model;this._tabs=tabs;dj.lang.mixin((this._cfg={activeEvent:"click",doStopEvent:true}),cfg);}).prototype={setActive:function(tid){this._model.setActiveById(tid);},addEvents:function(doRemoveEvents){var tidAttName="djw_tabId";var evm=(doRemoveEvents)?dj.lang.removeEvent:dj.lang.addEvent;var that=this;this._eventBridge=this._eventBridge||function(ev){var tid=(ev.srcElement||ev.target).getAttribute(tidAttName);if(that._cfg.doStopEvent===true){dj.lang.stopEvent(ev);}
that.setActive(tid);};for(var tid in this._tabs){if(this._tabs.hasOwnProperty(tid)){var tab=this._tabs[tid];var oTab=tab.getElement();oTab.setAttribute(tidAttName,tab.getId());for(var i=0,len=oTab.childNodes.length;i<len;i++){var node=oTab.childNodes[i];if(node.nodeType!=1){continue;}
node.setAttribute(tidAttName,tab.getId());}
evm(tab.getElement(),that._cfg.activeEvent,this._eventBridge);}}},removeEvents:function(){this._addEvents(true);}};(dj.widget.panels.controller.NavArrows=function(model,nav,cfg){this._cfg=dj.lang.cloneMixin(this.DEFAULT_CONFIG,cfg);this._model=model;this._nav=nav;this._procs=[];}).prototype={DEFAULT_CONFIG:{prevButtonEnabledStyle:"enabledPrev",nextButtonEnabledStyle:"enabledNext",doStopEvent:true,panelIncrement:1},setPreviousActive:function(){if(this._model.isLocked()){this._enqueueProc(this.setPreviousActive);return;}
this._model.setDirection(this._model.DIRECTION.PREVIOUS);this._model.setActiveByPosition(this._model.getActive().getPosition()-this._cfg.panelIncrement);},setNextActive:function(){var mdl=this._model;if(mdl.isLocked()){this._enqueueProc(this.setNextActive);return;}
var nxt=mdl.getByPosition(this._model.getActive().getPosition()+this._cfg.panelIncrement);if(mdl.getRotationType()==mdl.ROTATION_TYPE.LINEAR){var hasMore=(((mdl.getNumberOfPanels()-mdl.getViewArea())-mdl.getActive().getPosition())>=0);if(hasMore===false){return;}}
mdl.setDirection(mdl.DIRECTION.NEXT);mdl.setActiveByPosition(nxt.getPosition());},addEvents:function(){this._addEvent(this._nav.prevButton,"prev");this._addEvent(this._nav.nextButton,"next");},removeEvents:function(){this._removeEvent(this._nav.prevButton,"prev");this._removeEvent(this._nav.nextButton,"next");},_enqueueProc:function(proc){this._procs.push(proc);this._model.addLockListener(function(){var pr=this._procs.shift();if(pr){pr.call(this);}},this);},_setActiveByType:function(type){var proc=(type=="prev")?this.setPreviousActive:this.setNextActive;proc.call(this);},_removeEvent:function(oBtn,btnType){this._addEvent(oBtn,btnType,true);},_addEvent:function(oBtn,btnType,doRemoveEvent){var btnTypeAttName="djw_btnType";var evm=(doRemoveEvent)?dj.lang.removeEvent:dj.lang.addEvent;var that=this;this._beginEventBridge=this._eventBridge||function(ev){var type=(ev.srcElement||ev.target).getAttribute(btnTypeAttName);if(that._cfg.doStopEvent===true){dj.lang.stopEvent(ev);}
if(!that._nextInterval||that._nextInterval===null){that._setActiveByType(type);}
that._nextInterval=setInterval(function(){that._setActiveByType(type);},400);};this._endEventBridge=this._endEventBridge||function(ev){clearInterval(that._nextInterval);that._nextInterval=null;};this._stopEventBridge=this._stopEventBridge||function(ev){if(that._cfg.doStopEvent===true){dj.lang.stopEvent(ev);}};oBtn.setAttribute(btnTypeAttName,btnType);for(var i=0,len=oBtn.childNodes.length,node=null;i<len;i++){node=oBtn.childNodes[i];if(node.nodeType!=1){continue;}
node.setAttribute(btnTypeAttName,btnType);}
evm(oBtn,"click",this._stopEventBridge);evm(oBtn,'mousedown',this._beginEventBridge);evm(oBtn,'mouseup',this._endEventBridge);evm(oBtn,'mouseout',this._endEventBridge);}};(dj.widget.panels.controller.History=function(model,cfg){this._isEnabled=false;this._model=model;this._cfg=cfg||{};this._container=cfg.container;this._cfg.doSetActive=(typeof this._cfg.doSetActive==="boolean")?this._cfg.doSetActive:true;}).prototype={isEnabled:function(){return this._isEnabled;},addEvents:function(){if(this._isEnabled){console.warn("{Panels} browser-history has already been enabled for \""+this._container+"\"");return;}else{console.info("{Panels} browser-history enabled for \""+this._container+"\"");this._isEnabled=true;}
var hist=dj.util.History;hist.init();var model=this._model;var pid=hist.get(this._container);var panelId="";if((typeof pid==="string")&&model.hasId(pid)){panelId=pid;}else if(model.hasPosition(1)){panelId=model.getByPosition(1).getId();}else{console.warn("{Panels} browser-history failed. No panels found.");return;}
if(this._cfg.doSetActive){model.setActiveById(panelId);}
var fromHist=false;hist.subscribe("_init",function(){fromHist=true;model.setActiveById(panelId);});hist.subscribe(this._container,function(tid){fromHist=true;model.setActiveById(tid);});var that=this;model.addChangeListener(function(panel){if(fromHist){fromHist=false;return;}
hist.set(that._container,panel.getId());});}};(dj.widget.panels.controller.Timer=function(model,cfg){this._model=model;dj.lang.mixin((this._cfg={rotateTime:4,rotateIterations:3,progressBar:".progressbarBox",pauseButton:".nav-inline .pause"}),cfg);}).prototype={addEvents:function(){this._setupProgressBars();this._setupPauseButton();this._startTimer(this._cfg.rotateTime);this._addEvents();this._model.addChangeListener("rotationStateSuccess",function(state){if(state==0){this._pause();}
else{this._play();}},this);},removeEvents:function(){this._addEvents(true);},_setupProgressBars:function(){var progressBar=this._cfg.progressBar;var rotateTime=this._cfg.rotateTime;var pbs=[];var oPb=dj.lang.query(progressBar,this._cfg.container);for(var i=0,len=oPb.length;i<len;i++){pbs.push(new dj.widget.ProgressBar(oPb[i],{timer:rotateTime}));}
this._pbState="mt";this._pbIrupt=false;this._progressBars=pbs;var activePos=this._model.getActive().getPosition()-1;var ipb=this._progressBars[activePos];if(ipb){ipb.play();}},_setupPauseButton:function(){var oPause=dj.lang.query(this._cfg.pauseButton,this._cfg.container);if(oPause.length<1){return;}else{oPause=oPause[0];}
var btnOn=this._cfg.pauseButtonEnabledStyle;dj.lang.addEvent(oPause,"click",function(ev){dj.lang.stopEvent(ev);if(this._model.getRotationState()==0){this._model.setActive((this._model.getByPosition(this._model.getActive().getPosition()+1)||this._model.getByPosition(1)));this._model.setRotationState(1);}else{this._model.setRotationState(0);}},this);},_startTimer:function(seconds){if(((typeof this._intervalId!="undefined")&&(this._intervalId!==null))||(typeof seconds=="undefined")||(seconds===0)){return;}
var model=this._model;var nextPanel=null;this._maxIter=this._maxIter||(this._cfg.rotateIterations*model.getNumberOfPanels());this._iteration=(this._iteration||1);var that=this;this._intervalId=setInterval(function(){if(that._iteration>that._maxIter){that._intervalId=null;return;}
nextPanel=(model.getByPosition(model.getActive().getPosition()+1)||model.getByPosition(1));model.setActive(nextPanel);var pb=that._progressBars[nextPanel.getPosition()-1];if(typeof pb!=="undefined"){if(that._pbIrupt===false){pb.stop();pb.play();}else{pb.pause();}}
that._iteration++;},seconds*1000);},_addEvents:function(doRemoveEvents){var addEvent=(doRemoveEvents)?dj.lang.removeEvent:dj.lang.addEvent;var that=this;addEvent(this._cfg.container,"mouseover",function(){var tid=that._model.getActive().getPosition();that._pause(tid);});addEvent(this._cfg.container,"mouseout",function(){var tid=that._model.getActive().getPosition();that._play(tid);});},_play:function(tabNum){if(this._pbState==="mt"||(this._model.getRotationState()==0)){return;}else{this._pbState="mt";}
this._pbIrupt=true;this._startTimer(this._cfg.rotateTime);this._pbIrupt=false;var pb=this._progressBars[tabNum-1];if(pb){pb.play();}},_pause:function(tabNum){if(this._pbState==="mr"){return;}else{this._pbState="mr";}
if(this._intervalId){clearInterval(this._intervalId);this._intervalId=null;}
var pb=this._progressBars[tabNum-1];if(pb){pb.pause();}}};(dj.widget.panels.view.Timer=function(model,nav,cfg){this._cfg=dj.lang.cloneMixin(this.DEFAULT_CONFIG,cfg);this._model=model;this._nav=nav;}).prototype={DEFAULT_CONFIG:{pauseButtonEnabledStyle:"enabledPause"},rotationStateSuccess:function(state){if(state==1){dj.lang.removeClassName(this._nav.pauseButton,this._cfg.pauseButtonEnabledStyle);}else{dj.lang.addClassName(this._nav.pauseButton,this._cfg.pauseButtonEnabledStyle);}}};
if(typeof dj==="undefined"){dj={};}
if(typeof dj.widget==="undefined"){dj.widget={};}
if(typeof dj.widget.panel==="undefined"){dj.widget.panel={};}
dj.widget.panel.ModalPanel=Class.create({DEFAULT_CONFIG:{OPEN_MODAL_PANEL_EVENT_OPTION:{key:"openModalPanelEvent",value:"mouseover"},CLOSE_MODAL_PANEL_EVENT_OPTION:{key:"closeModalPanelEvent",value:"mouseout"},CLOSE_MODAL_PANEL_BUTTON_SELECTOR:{key:"closeModalPanelButtonSelector",value:null},CLOSE_MODAL_PANEL_EVENT_FOR_BUTTON_SELECTOR:{key:"closeModalPanelEventForButtonSelector",value:null}},initialize:function(modalId,modalContainer,config){this.oModalId=$(modalId);this.oModalContainer=$(modalContainer);this.observeOpenModalPanel=new dj.util.Observer();this.observeCloseModalPanel=new dj.util.Observer();this.cfg=new dj.util.Config(this);this._setupConfig();if(config){this.cfg.applyConfig(config,true);}
this.cfg.fireQueue();if(this.oModalId===null){this._setupTargetlessModalPanel(this.oModalContainer);}else{this._setupModalPanel(this.oModalId,this.oModalContainer);}},_setupModalPanel:function(oModalId,oModalContainer){oModalContainer.setStyle({visibility:"hidden"});var modalOpenEvent=this.cfg.getProperty(this.DEFAULT_CONFIG.OPEN_MODAL_PANEL_EVENT_OPTION.key);var modalCloseEvent=this.cfg.getProperty(this.DEFAULT_CONFIG.CLOSE_MODAL_PANEL_EVENT_OPTION.key);var that=this;oModalId.observe(modalOpenEvent,function(event){Event.stop(event);that.openModalPanel();}.bindAsEventListener(oModalId));var closeModalPanelSelector=this.cfg.getProperty(this.DEFAULT_CONFIG.CLOSE_MODAL_PANEL_BUTTON_SELECTOR.key);if(closeModalPanelSelector!==null){var closeModalPanelButtons=oModalContainer.getElementsBySelector(closeModalPanelSelector);var modalCloseEventForButtonSelector=(this.cfg.getProperty(this.DEFAULT_CONFIG.CLOSE_MODAL_PANEL_EVENT_FOR_BUTTON_SELECTOR.key)!==null)?this.cfg.getProperty(this.DEFAULT_CONFIG.CLOSE_MODAL_PANEL_EVENT_FOR_BUTTON_SELECTOR.key):modalCloseEvent;closeModalPanelButtons.each(function(oCloseModalPanelButton){oCloseModalPanelButton.observe(modalCloseEventForButtonSelector,function(event){Event.stop(event);that.closeModalPanel();}.bindAsEventListener(oCloseModalPanelButton));});}else
{oModalContainer.observe("mouseover",function(event){that.openModalPanel();}.bindAsEventListener(oModalContainer));oModalContainer.observe(modalCloseEvent,function(){that.closeModalPanel();}.bindAsEventListener(oModalContainer));}
if(modalCloseEvent=='blur'){document.observe("click",function(event){var isMousePointerinModalContainer=dj.util.Element.contains(oModalContainer,event.clientX,event.clientY);if(isMousePointerinModalContainer===false){that.closeModalPanel();}});}},_setupTargetlessModalPanel:function(oModalContainer){var modalCloseEvent=this.cfg.getProperty(this.DEFAULT_CONFIG.CLOSE_MODAL_PANEL_EVENT_OPTION.key);var closeModalPanelSelector=this.cfg.getProperty(this.DEFAULT_CONFIG.CLOSE_MODAL_PANEL_BUTTON_SELECTOR.key);this.openModalPanel();var that=this;if(closeModalPanelSelector!==null){var closeModalPanelButtons=oModalContainer.getElementsBySelector(closeModalPanelSelector);closeModalPanelButtons.each(function(oCloseModalPanelButton){oCloseModalPanelButton.observe(modalCloseEvent,function(event){Event.stop(event);that.closeModalPanel();}.bindAsEventListener(oCloseModalPanelButton));});}else{oCloseModalPanelButton.observe(modalCloseEvent,function(){that.closeModalPanel();}.bindAsEventListener(oCloseModalPanelButton));}},openModalPanel:function(){this.oModalContainer.setStyle({visibility:"visible"});},closeModalPanel:function(){this.oModalContainer.setStyle({visibility:"hidden"});},_setupConfig:function(config){var cfg=this.cfg;var defCfg=this.DEFAULT_CONFIG;cfg.addProperty(defCfg.OPEN_MODAL_PANEL_EVENT_OPTION.key,{value:defCfg.OPEN_MODAL_PANEL_EVENT_OPTION.value});cfg.addProperty(defCfg.CLOSE_MODAL_PANEL_EVENT_OPTION.key,{value:defCfg.CLOSE_MODAL_PANEL_EVENT_OPTION.value});cfg.addProperty(defCfg.CLOSE_MODAL_PANEL_BUTTON_SELECTOR.key,{value:defCfg.CLOSE_MODAL_PANEL_BUTTON_SELECTOR.value});cfg.addProperty(defCfg.CLOSE_MODAL_PANEL_EVENT_FOR_BUTTON_SELECTOR.key,{value:defCfg.CLOSE_MODAL_PANEL_EVENT_FOR_BUTTON_SELECTOR.value});}});if(typeof dj=="undefined"){var dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.panel=="undefined"){dj.widget.panel={};}
dj.widget.panel.SelectDropdownPanel=Class.create({DEFAULT_CONFIG:{SCROLL_CONTAINER_CLASS:{key:"scrollContainerClass",value:".scroll_container"},SCROLL_BAR_OPTION:{key:"scrollBarClass",value:".scrollbar"},SCROLL_TRACK_OPTION:{key:"scrollTrackClass",value:".scrollbar_container"},SCROLL_VALUES_CONTAINER_OPTION:{key:"scrollValuesContainerClass",value:".scroll_values_container"},DROPDOWN_COLLAPSED_CLASSNAME:{key:"dropdownCollapsedClassName",value:"dropdown_collapsed"},DROPDOWN_EXPANDED_CLASSNAME:{key:"dropdownExpandedClassName",value:"dropdown_open"},SCROLL_CONTAINER_COLLAPSED_CLASSNAME:{key:"scrollContainerCollapsedClassName",value:"collapsed"},SCROLL_CONTAINER_EXPANDED_CLASSNAME:{key:"scrollContainerExpandedClassName",value:"expanded"},SELECTED_CLASSNAME:{key:"selectedClassName",value:".selected"},SCROLLTRACK_CONTAINER_CLASSNAME:{key:"scrollTrackContainerClassName",value:".scroll_track"},DROPDOWN_SCROLLUP_ARROW_CLASSNAME:{key:"dropdownScrollUpArrow",value:".scroll_up"},DROPDOWN_SCROLLDOWN_ARROW_CLASSNAME:{key:"dropdownScrollDownArrow",value:".scroll_down"},SCROLL_TRACK_HEIGHT:{key:"scrollTrackHeight",value:"154"},SCROLL_VALUES_DISPLAY_HEIGHT:{key:"scrollValuesDisplayHeight",value:"190"},SCROLLBAR_ARROW_SHIFT_VALUE:{key:"scrollBarArrowShiftValue",value:"2"}},_setupConfig:function(config){var cfg=this.cfg;var defCfg=this.DEFAULT_CONFIG;cfg.addProperty(defCfg.SCROLL_CONTAINER_CLASS.key,{value:defCfg.SCROLL_CONTAINER_CLASS.value});cfg.addProperty(defCfg.SCROLL_BAR_OPTION.key,{value:defCfg.SCROLL_BAR_OPTION.value});cfg.addProperty(defCfg.SCROLL_TRACK_OPTION.key,{value:defCfg.SCROLL_TRACK_OPTION.value});cfg.addProperty(defCfg.SCROLL_VALUES_CONTAINER_OPTION.key,{value:defCfg.SCROLL_VALUES_CONTAINER_OPTION.value});cfg.addProperty(defCfg.DROPDOWN_COLLAPSED_CLASSNAME.key,{value:defCfg.DROPDOWN_COLLAPSED_CLASSNAME.value});cfg.addProperty(defCfg.DROPDOWN_EXPANDED_CLASSNAME.key,{value:defCfg.DROPDOWN_EXPANDED_CLASSNAME.value});cfg.addProperty(defCfg.SCROLL_CONTAINER_COLLAPSED_CLASSNAME.key,{value:defCfg.SCROLL_CONTAINER_COLLAPSED_CLASSNAME.value});cfg.addProperty(defCfg.SCROLL_CONTAINER_EXPANDED_CLASSNAME.key,{value:defCfg.SCROLL_CONTAINER_EXPANDED_CLASSNAME.value});cfg.addProperty(defCfg.SELECTED_CLASSNAME.key,{value:defCfg.SELECTED_CLASSNAME.value});cfg.addProperty(defCfg.SCROLLTRACK_CONTAINER_CLASSNAME.key,{value:defCfg.SCROLLTRACK_CONTAINER_CLASSNAME.value});cfg.addProperty(defCfg.DROPDOWN_SCROLLUP_ARROW_CLASSNAME.key,{value:defCfg.DROPDOWN_SCROLLUP_ARROW_CLASSNAME.value});cfg.addProperty(defCfg.DROPDOWN_SCROLLDOWN_ARROW_CLASSNAME.key,{value:defCfg.DROPDOWN_SCROLLDOWN_ARROW_CLASSNAME.value});cfg.addProperty(defCfg.SCROLL_TRACK_HEIGHT.key,{value:defCfg.SCROLL_TRACK_HEIGHT.value});cfg.addProperty(defCfg.SCROLL_VALUES_DISPLAY_HEIGHT.key,{value:defCfg.SCROLL_VALUES_DISPLAY_HEIGHT.value});cfg.addProperty(defCfg.SCROLLBAR_ARROW_SHIFT_VALUE.key,{value:defCfg.SCROLLBAR_ARROW_SHIFT_VALUE.value});},initialize:function(selectDropdownContainer,config){this.cfg=new dj.util.Config(this);this._setupConfig();if(config){this.cfg.applyConfig(config,true);}
this.cfg.fireQueue();var scrollBarClass=this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLL_BAR_OPTION.key);var scrollTrackClass=this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLL_TRACK_OPTION.key);var scrollContainerClass=this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLL_CONTAINER_CLASS.key);var scrollValuesContainerClass=this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLL_VALUES_CONTAINER_OPTION.key);this.oSelectDropDownContainer=$(selectDropdownContainer);if(this.oSelectDropDownContainer!==null){this.oScrollBar=this.oSelectDropDownContainer.down(scrollBarClass);this.oScrollTrack=this.oSelectDropDownContainer.down(scrollTrackClass);this.oScrollContainer=this.oSelectDropDownContainer.down(scrollContainerClass);this.oScrollValuesContainer=this.oSelectDropDownContainer.down(scrollValuesContainerClass);this._setupSelectDropdown(this.oSelectDropDownContainer,this.oScrollContainer,this.oScrollValuesContainer,this.oScrollBar,this.oScrollTrack);}},_setupSelectDropdown:function(oSelectDropdownContainer,oScrollContainer,oScrollValuesContainer,oScrollBar,oScrollTrack){var selectDropdownCollapsedClassName=this.cfg.getProperty(this.DEFAULT_CONFIG.DROPDOWN_COLLAPSED_CLASSNAME.key);var selectDropdownExpandedClassName=this.cfg.getProperty(this.DEFAULT_CONFIG.DROPDOWN_EXPANDED_CLASSNAME.key);var scrollContainerCollapsedClassName=this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLL_CONTAINER_COLLAPSED_CLASSNAME.key);var scrollContainerExpandedClassName=this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLL_CONTAINER_EXPANDED_CLASSNAME.key);var selectedClassName=this.cfg.getProperty(this.DEFAULT_CONFIG.SELECTED_CLASSNAME.key);this.oSelected=oSelectDropdownContainer.down(selectedClassName);var toggleDropdownClass=function(){if(oSelectDropdownContainer.hasClassName(selectDropdownCollapsedClassName)){oSelectDropdownContainer.removeClassName(selectDropdownCollapsedClassName);oSelectDropdownContainer.addClassName(selectDropdownExpandedClassName);}else
if(oSelectDropdownContainer.hasClassName(selectDropdownExpandedClassName)){oSelectDropdownContainer.removeClassName(selectDropdownExpandedClassName);oSelectDropdownContainer.addClassName(selectDropdownCollapsedClassName);}
if(oScrollContainer.hasClassName(scrollContainerCollapsedClassName)){oScrollContainer.removeClassName(scrollContainerCollapsedClassName);oScrollContainer.addClassName(scrollContainerExpandedClassName);}else
if(oScrollContainer.hasClassName(scrollContainerExpandedClassName)){oScrollContainer.removeClassName(scrollContainerExpandedClassName);oScrollContainer.addClassName(scrollContainerCollapsedClassName);}};this.oSelected.observe("click",function(event){toggleDropdownClass();}.bindAsEventListener(this.oDropdownIndicator));oScrollValuesContainer.observe("click",function(event){toggleDropdownClass();}.bindAsEventListener(oScrollValuesContainer));document.observe("click",function(event){var isMousePointerinModalContainer=dj.util.Element.contains(oScrollContainer,event.clientX,event.clientY);if(isMousePointerinModalContainer==false){if(oSelectDropdownContainer.hasClassName(selectDropdownExpandedClassName)){oSelectDropdownContainer.removeClassName(selectDropdownExpandedClassName);oSelectDropdownContainer.addClassName(selectDropdownCollapsedClassName);}
if(oScrollContainer.hasClassName(scrollContainerExpandedClassName)){oScrollContainer.removeClassName(scrollContainerExpandedClassName);oScrollContainer.addClassName(scrollContainerCollapsedClassName);}}});if(oScrollBar&&oScrollBar!==null&&oScrollTrack&&oScrollTrack!==null){var noOfValues=oScrollValuesContainer.childElements().length;var scrollTrackHeight=parseInt(this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLL_TRACK_HEIGHT.key),10);var scrollValuesDisplayHeight=parseInt(this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLL_VALUES_DISPLAY_HEIGHT.key),10);var scrollBarHeight=parseInt((scrollTrackHeight/(noOfValues/10)),10);oScrollBar.setStyle({height:scrollBarHeight+"px"});var scrollValuesTopShiftFactor=(scrollValuesDisplayHeight/scrollTrackHeight)*(noOfValues/10);var moveDropDown=function(value){var sliderPx=slider.translateToPx(value);var sliderPxValue=sliderPx.replace("px","");oScrollValuesContainer.setStyle({top:"-"+sliderPxValue*scrollValuesTopShiftFactor+"px"});};var slider=new Control.Slider(oScrollBar,oScrollTrack,{onSlide:moveDropDown,onChange:moveDropDown,axis:'vertical'});var scrollTrackContainerClass=this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLLTRACK_CONTAINER_CLASSNAME.key);this.oScrollTrackContainer=oSelectDropdownContainer.down(scrollTrackContainerClass);var scrollUpArrowClass=this.cfg.getProperty(this.DEFAULT_CONFIG.DROPDOWN_SCROLLUP_ARROW_CLASSNAME.key);var scrollDownArrowClass=this.cfg.getProperty(this.DEFAULT_CONFIG.DROPDOWN_SCROLLDOWN_ARROW_CLASSNAME.key);this.oScrollUpArrow=this.oScrollTrackContainer.down(scrollUpArrowClass);this.oScrollDownArrow=this.oScrollTrackContainer.down(scrollDownArrowClass);var scrollArrowShiftValue=parseInt(this.cfg.getProperty(this.DEFAULT_CONFIG.SCROLLBAR_ARROW_SHIFT_VALUE.key),10);var scrollBarTopPx;var scrollBarTop;var sliderValue;this.oScrollUpArrow.observe("click",function(event){scrollBarTopPx=oScrollBar.getStyle("top");scrollBarTop=parseInt(scrollBarTopPx.replace("px",""),10);sliderValue=slider.translateToValue(scrollBarTop-scrollArrowShiftValue);if(scrollBarTop>0){slider.setValue(sliderValue);}});this.oScrollDownArrow.observe("click",function(event){scrollBarTopPx=oScrollBar.getStyle("top");scrollBarTop=parseInt(scrollBarTopPx.replace("px",""),10);sliderValue=slider.translateToValue(scrollBarTop+scrollArrowShiftValue);if(scrollBarTop<(scrollTrackHeight-scrollBarHeight)){slider.setValue(sliderValue);}});}}});if(typeof dj=="undefined"){dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.panel=="undefined"){dj.widget.panel={};}
dj.widget.panel.Tooltip=Class.create({initialize:function(tooltipContainerClass,tooltipElementsContainerClass,tooltipTargetClass,tooltipClass,container,hideTooltipDelay){var oContainer=$(container);if((typeof oContainer!=='undefined')&&(oContainer!==null)){this.oTooltipContainers=oContainer.select(tooltipContainerClass);}else{this.oTooltipContainers=$$(tooltipContainerClass);}
this.tooltipContainerClass=tooltipContainerClass;this.tooltipElementsContainerClass=tooltipElementsContainerClass;this.tooltipTargetClass=tooltipTargetClass;this.tooltipClass=tooltipClass;var tooltipDelay=((typeof hideTooltipDelay!=='undefined')&&(hideTooltipDelay!==null))?hideTooltipDelay:100;this._setupTooltips(this.oTooltipContainers,this.tooltipElementsContainerClass,this.tooltipTargetClass,this.tooltipClass,tooltipDelay);},_setupTooltips:function(oTooltipContainers,tooltipElementsContainerClass,tooltipTargetClass,tooltipClass,tooltipDelay){var that=this;oTooltipContainers.each(function(oTooltipContainer){var oTooltipElementsContainer=oTooltipContainer.down(tooltipElementsContainerClass);var oTooltipTarget=oTooltipContainer.down(tooltipTargetClass);var oTooltip=oTooltipContainer.down(tooltipClass);if((typeof oTooltipElementsContainer!=='undefined')&&(oTooltipElementsContainer!==null)&&(typeof oTooltipTarget!=='undefined')&&(oTooltipTarget!==null)&&(typeof oTooltip!=='undefined')&&(oTooltip!==null)){var tipTarget=oTooltipElementsContainer.down(tooltipTargetClass);if((typeof tipTarget==='undefined')||(tipTarget===null)){Element.remove(oTooltipElementsContainer);Element.insert(oTooltipTarget,{'before':oTooltipElementsContainer});Element.remove(oTooltipTarget);Element.insert(oTooltip,{'before':oTooltipTarget});}
if(this.showTooltipOnTipTargetOverListener!==null){Event.stopObserving(oTooltipTarget,"mouseover",this.showTooltipOnTipTargetOverListener);}
if(this.hideTooltipOnTipTargetOutListener!==null){Event.stopObserving(oTooltipTarget,"mouseout",this.hideTooltipOnTipTargetOutListener);}
if(this.showTooltipOnTooltipOverListener!==null){Event.stopObserving(oTooltipTarget,"mouseout",this.showTooltipOnTooltipOverListener);}
if(this.hideTooltipOnTooltipOutListener!==null){Event.stopObserving(oTooltipTarget,"mouseout",this.hideTooltipOnTooltipOutListener);}
var tooltipVisibleFlag=false;var showTooltipListener=function(){tooltipVisibleFlag=true;tooltipVisibleFlag=true;that.showTooltip(oTooltip);};var hideTooltipListener=function(){tooltipVisibleFlag=false;;setTimeout(function(){if(tooltipVisibleFlag===false){that.hideTooltip(oTooltip);}},tooltipDelay);}
this.showTooltipOnTipTargetOverListener=function(event){showTooltipListener();}.bindAsEventListener(oTooltipTarget);this.hideTooltipOnTipTargetOutListener=function(){hideTooltipListener();}.bindAsEventListener(oTooltipTarget);this.showTooltipOnTooltipOverListener=function(event){showTooltipListener();}.bindAsEventListener(oTooltip);this.hideTooltipOnTooltipOutListener=function(event){hideTooltipListener();}.bindAsEventListener(oTooltip);oTooltipTarget.observe("mouseover",this.showTooltipOnTipTargetOverListener);oTooltipTarget.observe("mouseout",this.hideTooltipOnTipTargetOutListener);oTooltip.observe("mouseover",this.showTooltipOnTooltipOverListener);oTooltip.observe("mouseout",this.hideTooltipOnTooltipOutListener);}else{console.log("oTooltipTarget or oTooltip is not defined for tooltip container");}});},showTooltip:function(oTooltip){oTooltip.setStyle({display:"block"});},hideTooltip:function(oTooltip){oTooltip.setStyle({display:"none"});},refreshTooltips:function(container){this.initialize(this.tooltipContainerClass,this.tooltipElementsContainerClass,this.tooltipTargetClass,this.tooltipClass,container);}});
if(typeof dj=="undefined"){var dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.video=="undefined"){dj.widget.video={};}
if(typeof dj.context=="undefined"){dj.context={};}
if(typeof dj.context.video=="undefined"){dj.context.video={};}
if(!console){var console={};console.log=function(){};}
dj.widget.video.video=Class.create({initialize:function(args,objName){this.version="1.0.2";this.usrActnHash={'':this.handleResponse,'toBrowse':this.handleBrowsingResults,'toSearch':this.handleSearchResults,'current':this.handleCurrent,'next':this.handleNext};this.emailURL='http:\u002F\u002Fwww.emailthis.clickability.com\u002Fet\u002FemailThis?clickMap=create&fb=Y&url=@VIDEO_LINK_URL&title=@VIDEO_TITLE&random=@RANDOM_NUMBER&partnerID=@EMAIL_PARTNER_ID&image=@VIDEO_STILL_URL&expire=&summary=@VIDEO_DESCRIPTION';this.domainName='wsj';var siteFrmUrl=this.getUrlParam(window.location.href,'site');var siteFrmContxt='';try{siteFrmContxt=dj.context.videoCenter.host;}
catch(e){console.error("Error while getting site value from context. "+e.message);}
this.site=this.isNotBlankOrNull(siteFrmUrl)?siteFrmUrl:siteFrmContxt;this.msrc=this.getUrlParam(window.location.href,'msrc');this.embedConfigURL="http://wsj.vo.llnwd.net/o28/players/";this.microPlayers=[];this.microPlayersObjects={};this.videoIdMicroPlayerIdMap={};this.popUpWindow='';this.flashPlayerPath=cdnDomain+"/media/swf/";this.collectionsXMLPath="/static_html_files/";this.videoCenterPageUrl="/video-center";this.popUpPageUrl='/public/page/0_0_WP_3001.html';this.objName=objName;this.videoPlayerDivId='video_player';this.sideNavUlId='video_sidenav';this.topNavUlId='video_topnav';this.nextVideoDivId='next_video';this.videoResultsDivId='video_results';this.searchDivId='video_search';this.advertisementDivId='advertisement';this.collectionsSelectId='collectionsSelectId';this.videoSummaryDivId='video_headline';this.registeredVideosDivId='registered_videos';if(this.isNotBlankOrNull(args)){this.videoPlayerDivId=args.videoPlayerDivId?args.videoPlayerDivId:'video_player';this.sideNavUlId=args.sideNavUlId?args.sideNavUlId:'video_sidenav';this.topNavUlId=args.topNavUlId?args.topNavUlId:'video_topnav';this.nextVideoDivId=args.nextVideoDivId?args.nextVideoDivId:'next_video';this.videoResultsDivId=args.videoResultsDivId?args.videoResultsDivId:'video_results';this.searchDivId=args.searchDivId?args.searchDivId:'video_search';this.advertisementDivId=args.advertisementDivId?args.advertisementDivId:'advertisement';this.videoSummaryDivId=args.videoSummaryDivId?args.videoSummaryDivId:'video_headline';this.registeredVideosDivId=args.registeredVideosDivId?args.registeredVideosDivId:'';}
this.xmlDoc='';this.defaultCollectionName='News';this.rssUrlsObject={};this.contentUrlsObject={};this.collectionNamesArray=[];this.subcollectionsObject={};this.urlKeysCollectionMap=new Hash();this.urlKeysSubCollectionMap=new Hash();this.currentlyPlayingVideoId='';this.currentlyPlayingVideoIds=[];this.currentlyPlayingCollection='';this.currentlyPlayingSubCollection='';this.nextVideoId='';this.visibleCollectionId='';this.visibleSubCollectionId='';this.sortOrder='relevancy';this.currentSearchText='';this.isVideoResultsInSideNav=false;this.currentPlayingJsonObject={};this.currentBrowsingJsonObject={};this.currentSearchJsonObject={};this.currentVideoDetailsJsonObject={};this.nextVideoDetailsJsonObject={};this.registeredVideos=[];this.registeredVideosIds=[];this.playFromRegisteredVideos=false;this.relatedVideosCollection='';this.pageSize=12;this.userAction='';this.sourceApplicationName='';this.browsingGroup="collection";this.playingGroup="collection";this.skipCollection=true;this.bookMarkedId='';this.bookMarkedLocation='';this.prop24='';this.prop25='';this.prop27='';this.cookieUserType='';try{this.prop24=editionToNameMap[dj.util.Region.getViewByRegion()];}
catch(e){console.error("cookie read error while fetching prop24");}
try{this.prop25=dj.util.Cookie.getCookie('TR');}
catch(e){console.error("cookie read error while fetching prop25");}
try{this.cookieUserType=dj.util.Cookie.getCookie("user_type");}
catch(e){console.error("cookie read error while fetching cookieUserType");}
try{var that=this;dj.util.User.isLoggedIn(function(isLoggedIn){if(isLoggedIn){dj.util.User.isSubLoggedIn(function(subLoggedIn){if(subLoggedIn){that.prop27='WSJ_sub_yes';}
else{that.prop27='WSJ_mem_yes';}});}
else{if(that.cookieUserType===null||that.cookieUserType!=="subscribed"){that.prop27='WSJ_free';}
else{that.prop27='WSJ_reg_yes';}}});}
catch(e){console.error("cookie read error while fetching prop27");}},loadVideo:function(id,sourceApplicationName,domainName){console.info("video.js v"+this.version);if(this.isNotBlankOrNull(domainName)){this.domainName=domainName;}
this.sourceApplicationName=sourceApplicationName;if(this.isNotBlankOrNull(id)){if(id.indexOf('{')==-1){this.currentlyPlayingVideoId='{'+id+'}';}
else{this.currentlyPlayingVideoId=id;}}
if(swfobject.getFlashPlayerVersion().major>=9){this.createFlashPlayer();}
else{this.nonSupportingFlashPlayer(this.videoPlayerDivId);}},continueLoadVideo:function(){this.loadCollectionsDoc();this.parseInformationFromXmlDoc();if(this.sourceApplicationName=='articlePage'){this.visibleCollectionId='';var vObj='';if(this.isNotBlankOrNull(this.currentlyPlayingVideoId)){vObj=this.registeredVideos[this.registeredVideosIds.indexOf(this.currentlyPlayingVideoId)];this.playVideoByParam(vObj);}
else
if(this.isNotBlankOrNull(this.bookMarkedId)){this.currentlyPlayingVideoId=this.bookMarkedId;vObj=this.registeredVideos[this.registeredVideosIds.indexOf(this.currentlyPlayingVideoId)];vObj.seekTime=this.bookMarkedLocation;this.playVideoByParam(vObj);}
else{vObj=this.registeredVideos[0];this.currentlyPlayingVideoId=vObj.id;this.playVideoByParam(vObj);}
this.relatedVideosCollection=this.isNotBlankOrNull(this.registeredVideos[0]['wsj-section'])?this.registeredVideos[0]['wsj-section']:this.defaultCollectionName;this.currentlyPlayingCollection=this.registeredVideos[0]['wsj-section'];if(this.currentlyPlayingCollection=='Lifestyle'){this.currentlyPlayingCollection='Life & Style';}
this.getVideos(this.validateContentUrl(this.contentUrlsObject[this.currentlyPlayingCollection])+'&count=60','',false);}
else{if(typeof AT_VARS!='undefined'&&AT_VARS.baseDocId){this.currentlyPlayingVideoId='{'+AT_VARS.baseDocId+'}';}
if(this.isNotBlankOrNull(this.currentlyPlayingVideoId)){this.playVideoByVideoId(this.currentlyPlayingVideoId);this.currentlyPlayingCollection=this.currentVideoDetailsJsonObject['wsj-section'];this.currentlyPlayingSubCollection=this.currentVideoDetailsJsonObject['wsj-subsection'];if(this.isNotBlankOrNull(this.currentlyPlayingSubCollection)){this.visibleCollectionId=this.collectionNameForSubcollection(this.currentlyPlayingSubCollection);this.currentlyPlayingCollection=this.visibleCollectionId;this.getVideos(this.validateContentUrl(this.contentUrlsObject[this.currentlyPlayingSubCollection])+'&count=60','',false);}
else{if(!this.isNotBlankOrNull(this.currentlyPlayingCollection)){this.currentlyPlayingCollection=this.defaultCollectionName;}
this.getVideos(this.validateContentUrl(this.contentUrlsObject[this.currentlyPlayingCollection])+'&count=60','',false);}}
else{var browserUrl=window.location.pathname;this.currentlyPlayingCollection=this.defaultCollectionName;if(browserUrl.indexOf(".")!=-1){var urlKey=(browserUrl).split(".")[0].split('/').last();if(this.urlKeysCollectionMap.get(urlKey)){this.currentlyPlayingCollection=this.urlKeysCollectionMap.get(urlKey);}
if(this.urlKeysSubCollectionMap.get(urlKey)){this.currentlyPlayingSubCollection=this.urlKeysSubCollectionMap.get(urlKey);this.visibleCollectionId=this.collectionNameForSubcollection(this.currentlyPlayingSubCollection);this.currentlyPlayingCollection=this.visibleCollectionId;}}
if(this.isNotBlankOrNull(this.currentlyPlayingSubCollection)){this.getVideos(this.validateContentUrl(this.contentUrlsObject[this.currentlyPlayingSubCollection])+'&count=60','',false);}
else{this.getVideos(this.validateContentUrl(this.contentUrlsObject[this.currentlyPlayingCollection])+'&count=60','',false);}
this.currentlyPlayingVideoId=this.currentPlayingJsonObject.items[0].id;this.playVideoByVideoId(this.currentlyPlayingVideoId);}}
this.populateSideNav();this.populateTopNav();if(this.isNotBlankOrNull(this.currentlyPlayingSubCollection)){this.updateSideNavAppearance('subcollection',this.currentlyPlayingSubCollection);this.visibleSubCollectionId=this.currentlyPlayingSubCollection;this.browsingGroup="subcollection";this.playingGroup="subcollection";}
else{this.updateSideNavAppearance('collection',this.currentlyPlayingCollection);this.visibleCollectionId=this.currentlyPlayingCollection;}
this.currentBrowsingJsonObject=this.currentPlayingJsonObject;if(this.sourceApplicationName=='articlePage'&&this.registeredVideosIds.length>0){this.createRegisteredVideosThumbnails();this.updateVideoThumbnailVisual('','reg'+this.currentlyPlayingVideoId);}
this.updateTopNavAppearance('',this.currentlyPlayingCollection);this.createNextVideo();this.createSearch();this.createAdvertisementFramework();this.populateMoreVideos(1);this.loadPagination(1);this.updateRssFeed((this.visibleSubCollectionId!=='')?this.visibleSubCollectionId:this.visibleCollectionId);},validateContentUrl:function(contentUrl){if(this.isNotBlankOrNull(contentUrl)){return contentUrl;}
else{this.currentlyPlayingCollection=this.defaultCollectionName;return this.contentUrlsObject[this.defaultCollectionName];}},createAdvertisementFramework:function(){if(this.advertisementDivId){if(swfobject.getFlashPlayerVersion().major>=9){var dim={w:"336",h:"280"};swfobject.embedSWF(this.flashPlayerPath+"adPlayer.swf",this.advertisementDivId,dim.w,dim.h,"9.0.0","",{'objName':this.getName(),'movieWidth':dim.w,'movieHeight':dim.h,'host':location.host},{allowscriptaccess:"always",wmode:"opaque"},{});}
else{this.nonSupportingFlashPlayer(this.advertisementDivId);}}},nonSupportingFlashPlayer:function(divId){var str='';str+='<table width="75%" cellspacing="1" cellpadding="2" bordercolor="#336699" border="2">';str+='<tbody>';str+='<tr>';str+='</tr>';str+='<tr>';str+='<td align="left">';str+='<span style="font-size: 12px;">';str+='The version of Adobe Flash Player required to view this interactive has not been found.';str+='<br/>';str+='To enjoy our complete interactive experience, please download a free copy of the latest version of Adobe Flash Player ';str+='<b>';str+='<a target="_blank" href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">here.</a>';str+='</b>';str+='</span>';str+='</td>';str+='</tr>';str+='</tbody>';str+='</table>';$(divId).innerHTML=str;},collectionNameForSubcollection:function(subCol){for(var index=0,len=this.collectionNamesArray.length;index<len;++index){if(this.subcollectionsObject[(this.collectionNamesArray[index])].indexOf(subCol)!=-1){return this.collectionNamesArray[index];}}},pauseMicroPlayers:function(){try{for(var index=0,len=this.microPlayers.length;index<len;++index){swfobject.getObjectById(this.microPlayers[index]).pauseVideo();}}
catch(e){console.error("Error while pausing microPlayers. "+e.message);}},setBookMark:function(){try{this.bookMarkedId=this.currentlyPlayingVideoId;this.bookMarkedLocation=Math.floor(swfobject.getObjectById("flashPlayer").getSeek());swfobject.getObjectById("flashPlayer").pauseVideo();}
catch(e){console.error("Error while setting the bookmark. "+e.message);}},getUrlParam:function(srcUrl,name){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(srcUrl);if(results===null){return"";}
else{return results[1];}},updateVideoThumbnailVisual:function(cleanId,applyId){if(cleanId!==''&&$("li_"+cleanId)){$("li_"+cleanId).className="";}
if(applyId!==''&&$("li_"+applyId)){$("li_"+applyId).className="nowPlaying";}},isNotBlankOrNull:function(strVar){return(strVar!==''&&strVar!==null&&typeof strVar!='undefined');},parseInformationFromXmlDoc:function(){var collectionArray=this.xmlDoc.getElementsByTagName("collection");for(var index=0,len=collectionArray.length;index<len;++index){var item=collectionArray[index];this.urlKeysCollectionMap.set(item.getAttribute("urlkey"),item.getAttribute("name"));this.contentUrlsObject[item.getAttribute("name")]=item.getAttribute("contenturl");this.rssUrlsObject[item.getAttribute("name")]=item.getAttribute("rssurl");this.collectionNamesArray[this.collectionNamesArray.length]=item.getAttribute("name");var subCollectionArray=item.getElementsByTagName("subcollection");var subCollectionArrayLength=subCollectionArray.length;var subCollNamesAr=[];for(var sindex=0,slen=subCollectionArray.length;sindex<slen;++sindex){var sitem=subCollectionArray[sindex];this.urlKeysSubCollectionMap.set(sitem.getAttribute("urlkey"),sitem.getAttribute("name"));this.contentUrlsObject[sitem.getAttribute("name")]=sitem.getAttribute("contenturl");this.rssUrlsObject[sitem.getAttribute("name")]=sitem.getAttribute("rssurl");subCollNamesAr[sindex]=sitem.getAttribute("name");}
this.subcollectionsObject[item.getAttribute("name")]=subCollNamesAr;}},createFlashPlayer:function(){if($(this.videoPlayerDivId)){try{var dim={w:"512",h:"363"};swfobject.embedSWF(this.flashPlayerPath+"main.swf",this.videoPlayerDivId,dim.w,dim.h,"9.0.0","",{'objName':this.getName(),'allowPlayerPopup':'1','plyMediaEnabled':'1','movieWidth':dim.w,'movieHeight':dim.h,'host':location.host},{allowscriptaccess:"always",wmode:"opaque"},{id:"flashPlayer"});}
catch(e){console.error("Error occured createFlashPlayer.."+e.message);$(this.videoPlayerDivId).innerHTML='Couldn\'t load the flash player. \n Error message is: '+e.message;}}},convertCurrentPlayingJsonToIdsArray:function(){this.currentlyPlayingVideoIds=[];if(this.currentPlayingJsonObject.items.length>0){for(var index=0,len=this.currentPlayingJsonObject.items.length;index<len;++index){this.currentlyPlayingVideoIds[index]=this.currentPlayingJsonObject.items[index].id;}}},populateVideoSummary:function(name,description,formattedCreationDate){if($(this.videoSummaryDivId)){var str='';try{str+='<h2>'+name+' <small>'+formattedCreationDate.split(' ')[0]+'</small>';str+='</h2>';str+='<p>'+description+'</p>';}
catch(e){console.error("Error occured in populateVideoSummary."+e.message);str+='Couldn\'t get video summary.';}
$(this.videoSummaryDivId).innerHTML=str;}},createAdvertisement:function(imgUrl,link){try{swfobject.getObjectById(this.advertisementDivId).loadAd(imgUrl,link);}
catch(e){console.error("Error while loading ad in createAdvertisement : "+e);}},createNextVideo:function(){var str='Loading...';try{this.nextVideoId=this.getNextVideoId();if(this.nextVideoId!==''){var url='/api-video/get_video_info.asp?guid='+this.nextVideoId+'&fields=all';this.getVideos(url,'next',true);}
else{str='No more videos.';}}
catch(e){console.error("Error occured while executing createNextVideo() - "+e.message);str+='Couldn\'t determine next video details.';}
if($(this.nextVideoDivId)){$(this.nextVideoDivId).innerHTML=str;}},populateNextVideo:function(){var str='';try{var nameToDisplay=this.isNotBlankOrNull(this.currentlyPlayingSubCollection)?this.currentlyPlayingSubCollection:this.currentlyPlayingCollection;if(this.currentlyPlayingCollection=='Search Results'){str+='<h3>Next in Video '+this.currentlyPlayingCollection+'</h3>';}
else{str+='<h3>Next in '+nameToDisplay+' Video</h3>';}
str+='<ul class="newsItem video">';str+='<li>';str+='<a href="javascript:'+this.getName()+'.nextVideoThumbnailClicked(\''+this.nextVideoDetailsJsonObject.id+'\')" style="background-image: url('+this.nextVideoDetailsJsonObject.thumbnailURL+')" class="preview"><span>&nbsp;</span></a>';str+='<h2><a href="javascript:'+this.getName()+'.nextVideoThumbnailClicked(\''+this.nextVideoDetailsJsonObject.id+'\')">'+this.nextVideoDetailsJsonObject.name+'</a></h2>';var minutes=Math.floor(this.nextVideoDetailsJsonObject.duration/60);var seconds=this.nextVideoDetailsJsonObject.duration%60;if(seconds<10){seconds='0'+seconds;}
str+='<small>'+minutes+':'+seconds+'</small>';str+='<p>'+this.nextVideoDetailsJsonObject.description+'</p>';str+='</li>';str+='</ul>';}
catch(e){console.error("Error occured while executing populateNextVideo() - "+e.message);str+='Couldn\'t populate next video details.';}
if($(this.nextVideoDivId)){$(this.nextVideoDivId).innerHTML=str;}},nextVideoThumbnailClicked:function(videoId){this.userAction='';this.populateMoreVideos(1);this.loadPagination(1);this.updateVideoThumbnailVisual(this.currentlyPlayingVideoId,videoId);this.currentlyPlayingVideoId=videoId;this.playVideoByVideoId(videoId);this.createNextVideo();if(this.isNotBlankOrNull(this.currentlyPlayingSubCollection)){this.updateSideNavAppearance('subcollection',this.currentlyPlayingSubCollection);}
else{this.updateSideNavAppearance('collection',this.currentlyPlayingCollection);}},createSearch:function(){var str='';str+='<form id="searchForm" onSubmit="javascript:'+this.getName()+'.searchButtonClicked();return false;" class="" method="post" accept-charset="utf-8">';str+='<fieldset>';str+='<legend>Search Videos</legend>';str+='<div class="ctl">';str+='<label for="frmSearchSectCtl01">Search Videos</label>';str+='<input type="text" name="frmSearchSectCtl01" value="Search Video" id="frmSearchSectCtl01" class="text" onFocus="'+this.getName()+'.searchInputBoxFocused();"/>';str+='</div>';str+='<div class="ctl">';str+='<label for="frmSearchSectSub">Search</label>';str+='<button id="searchButton" type="submit">Search</button>';str+='</div>';str+='</fieldset>';str+='</form>';if($(this.searchDivId)){$(this.searchDivId).innerHTML=str;}},searchInputBoxFocused:function(){$("frmSearchSectCtl01").value="";$("searchForm").className="";},searchButtonClicked:function(){var searchTxt=$F("frmSearchSectCtl01").replace(/^\s+|\s+$/,'');if(searchTxt===''){$("searchForm").className="search_error";$("frmSearchSectCtl01").value="Please enter search terms";$("searchButton").focus();return false;}
this.currentSearchText=searchTxt;this.sortOrder='relevancy';if(!this.isVideoResultsInSideNav){this.insertVideoResultsInSideNav();this.isVideoResultsInSideNav=true;}
this.updateVideoResultsInSideNav(this.currentSearchText);this.updateSideNavAppearance('collection','Search Results');var searchUrl='/api-video/find_all_videos.asp?type=wsj-fulltext&query='+searchTxt;this.performSearch(searchUrl);$("searchButton").focus();},insertVideoResultsInSideNav:function(){var str='';str+='<li id="Search Results" class="noSubCollection">';str+='</li>';str+=$(this.sideNavUlId).innerHTML;$(this.sideNavUlId).innerHTML=str;},updateVideoResultsInSideNav:function(srchText){var fields='id,name,description,duration,thumbnailURL,videoURL,formattedCreationDate,wsj-section,wsj-subsection';var srchContentUrl='/api-video/find_all_videos.asp?type=wsj-fulltext&query='+srchText+'&fields='+fields;this.contentUrlsObject['Search Results']=srchContentUrl;var str='';str+='<a id="a_Search Results" class="" href="javascript:'+this.getName()+'.sideNavClicked(\'collection\',\'Search Results\');">';str+='Search Results</a>';$("Search Results").innerHTML=str;},performSearch:function(searchUrl){this.userAction='toSearch';var fields='id,name,description,duration,thumbnailURL,videoURL,formattedCreationDate,wsj-section,wsj-subsection';$(this.videoResultsDivId).innerHTML='<p class="noResults"> Loading ... </p>';this.getVideos(searchUrl+'&fields='+fields+'&count=60',this.userAction,true);},loadPagination:function(pageNumber){var varToDisplay='';if(this.userAction=='toBrowse'){if(typeof this.currentBrowsingJsonObject!="undefined"){varToDisplay=this.currentBrowsingJsonObject.items;}}
else
if(this.userAction=='toSearch'){if(typeof this.currentSearchJsonObject!="undefined"){varToDisplay=this.currentSearchJsonObject.items;}}
else{varToDisplay=this.currentPlayingJsonObject.items;}
var currentPageNumber=Number(pageNumber);var flr=Math.floor(varToDisplay.length/this.pageSize);var cl=Math.ceil(varToDisplay.length/this.pageSize);var lastPageNumber=Math.max(flr,cl);var str='';if(currentPageNumber==1){str+='<li id="previous" class="listFirst"><span>Previous</span></li>';}
else{str+='<li id="previous" class="listFirst"><a href="javascript:'+this.getName()+'.paginationClicked(\''+(currentPageNumber-1)+'\')">Previous</a></li>';}
for(var index=1;index<=lastPageNumber;index++){if(currentPageNumber==index){str+='<li><span>'+index+'</span></li>';}
else{str+='<li><a href="javascript:'+this.getName()+'.paginationClicked(\''+index+'\')" >'+index+'</a></li>';}}
if(currentPageNumber>=lastPageNumber){str+='<li id="next"><span>Next</span></li>';}
else{str+='<li id="next"><a href="javascript:'+this.getName()+'.paginationClicked(\''+(currentPageNumber+1)+'\')">Next</a></li>';}
$("pagination").innerHTML=str;},paginationClicked:function(pageNumber){this.populateMoreVideos(pageNumber);this.loadPagination(pageNumber);this.updateRssFeed((this.visibleSubCollectionId!=='')?this.visibleSubCollectionId:this.visibleCollectionId);},getVideos:function(url,userAction,async){var fun=this.usrActnHash[userAction];this.ajax=new Ajax.Request(url,{method:'get',asynchronous:async,requestHeaders:{Accept:'application/json'},onSuccess:fun.bindAsEventListener(this),onFailure:this.handleFailure.bindAsEventListener(this,url,userAction,async)});},handleFailure:function(obj,url,userAction,async){setTimeout(""+this.getName()+".getVideos('"+url+"','"+userAction+"','"+async+"')",10000);},handleResponse:function(json){this.currentPlayingJsonObject=json.responseText.evalJSON(true);this.convertCurrentPlayingJsonToIdsArray();},handleBrowsingResults:function(json){this.currentBrowsingJsonObject=json.responseText.evalJSON(true);this.populateMoreVideos(1);this.loadPagination(1);this.updateRssFeed((this.visibleSubCollectionId!=='')?this.visibleSubCollectionId:this.visibleCollectionId);},handleSearchResults:function(json){this.currentSearchJsonObject=json.responseText.evalJSON(true);this.populateMoreVideos(1);this.loadPagination(1);},handleCurrent:function(json){this.currentVideoDetailsJsonObject=json.responseText.evalJSON(true);this.currentlyPlayingCollection=this.currentVideoDetailsJsonObject['wsj-section'];this.currentlyPlayingSubCollection=this.currentVideoDetailsJsonObject['wsj-subsection'];this.playVideoByParam(this.currentVideoDetailsJsonObject);this.populateVideoSummary(this.currentVideoDetailsJsonObject.name,this.currentVideoDetailsJsonObject.description,this.currentVideoDetailsJsonObject.formattedCreationDate);},handleNext:function(json){this.nextVideoDetailsJsonObject=json.responseText.evalJSON(true);this.populateNextVideo();},populateSideNav:function(){var src='';var collectionArray=this.xmlDoc.getElementsByTagName("collection");for(var index=0,len=collectionArray.length;index<len;++index){var item=collectionArray[index];var subCollectionArray=item.getElementsByTagName("subcollection");var subCollectionArrayLength=subCollectionArray.length;if(subCollectionArrayLength>0){src+='<li class="expand" id="'+item.getAttribute("name")+'"><a id="a_'+item.getAttribute("name")+'" class="" href="javascript:'+this.getName()+'.sideNavClicked(\''+item.nodeName+'\',\''+item.getAttribute("name")+'\');">'+item.getAttribute("name")+'</a>';}
else{src+='<li class="noSubCollection" id="'+item.getAttribute("name")+'"><a id="a_'+item.getAttribute("name")+'" class="" href="javascript:'+this.getName()+'.sideNavClicked(\''+item.nodeName+'\',\''+item.getAttribute("name")+'\');">'+item.getAttribute("name")+'</a>';}
if(subCollectionArrayLength>0){src+='<ul id=Sub'+item.getAttribute("name")+'>';for(var sindex=0,slen=subCollectionArray.length;sindex<slen;++sindex){var sitem=subCollectionArray[sindex];src+='<li><a id="a_'+sitem.getAttribute("name")+'" class="current" href="javascript:'+this.getName()+'.sideNavClicked(\''+sitem.nodeName+'\',\''+sitem.getAttribute("name")+'\');">'+sitem.getAttribute("name")+'</a></li>';}
src+='</ul>';}
src+='</li>';}
$(this.sideNavUlId).innerHTML=src;},populateTopNav:function(){if($(this.topNavUlId)){var src='';var collectionArray=this.xmlDoc.getElementsByTagName("collection");for(var index=0,len=collectionArray.length;index<len;++index){var item=collectionArray[index];var itemName=item.getAttribute("name");if((itemName!='Most Popular Today')&&(itemName!='Management')&&(itemName!='Special Packages')){var className=itemName;className='navlink_'+className.toLowerCase().replace(/\s+/g,'_');if(index=='1'){src+='<li class="listFirst">';}
else{src+='<li>';}
src+='<a class='+className+' id="a_topnav_'+itemName+'" href="javascript:'+this.getName()+'.topNavClicked(\''+item.nodeName+'\',\''+itemName+'\');">'+itemName+'</a>';src+='</li>';}}
$(this.topNavUlId).innerHTML=src;}},topNavClicked:function(strType,strName){this.userAction='';this.updateSideNavAppearance(strType,strName);this.updateTopNavAppearance(strType,strName);this.currentlyPlayingCollection=strName;this.getVideos(this.validateContentUrl(this.contentUrlsObject[this.currentlyPlayingCollection])+'&count=60','',false);this.visibleCollectionId=this.currentlyPlayingCollection;this.currentBrowsingJsonObject=this.currentPlayingJsonObject;this.currentlyPlayingVideoId=this.currentPlayingJsonObject.items[0].id;this.playVideoByVideoId(this.currentlyPlayingVideoId);this.populateMoreVideos(1);this.loadPagination(1);this.browsingGroup="collection";this.playingGroup="collection";this.createNextVideo();},updateTopNavAppearance:function(strType,strName){var removeFrom=this.currentlyPlayingCollection;if(removeFrom=='Lifestyle'){removeFrom='Life & Style';}
if($('a_topnav_'+removeFrom)){var playingCollectionClassName=$('a_topnav_'+removeFrom).className;var newPlayingCollectionClassName=playingCollectionClassName.replace('selected ','');$('a_topnav_'+removeFrom).className=newPlayingCollectionClassName;}
if($('a_topnav_'+strName)){var classNameToApply='selected '+'navlink_'+strName.toLowerCase().replace(/\s+/g,'_');$('a_topnav_'+strName).className=classNameToApply;}},sideNavClicked:function(strType,strName){this.userAction='';if(this.isNotBlankOrNull(this.contentUrlsObject[strName])){this.browsingGroup=strType;if(strName=='Search Results'){this.userAction='toSearch';this.sortOrder='relevancy';}
else
if(((strType=='subcollection')&&(strName!=this.currentlyPlayingSubCollection))||((strType=='collection')&&(strName!=this.currentlyPlayingCollection))){this.userAction='toBrowse';}
this.updateSideNavAppearance(strType,strName);$(this.videoResultsDivId).innerHTML='<p class="noResults"> Loading ... </p>';if(this.isNotBlankOrNull(this.userAction)){this.getVideos(this.contentUrlsObject[strName]+'&count=60',this.userAction,true);}
else{this.populateMoreVideos(1);this.loadPagination(1);}}
else{this.updateSideNavAppearance(strType,strName);}},searchLinkClicked:function(searchUrl,sortParam){this.sortOrder=sortParam;this.performSearch(searchUrl);},populateMoreVideos:function(pageNumber){var varToDisplay='';if(this.userAction=='toBrowse'){if(typeof this.currentBrowsingJsonObject!="undefined"){varToDisplay=this.currentBrowsingJsonObject.items;}}
else
if(this.userAction=='toSearch'){if(typeof this.currentSearchJsonObject!="undefined"){varToDisplay=this.currentSearchJsonObject.items;}}
else{varToDisplay=this.currentPlayingJsonObject.items;}
var startIndex=(pageNumber-1)*12;var endIndex=Math.min(pageNumber*12-1,varToDisplay.length-1);var str='';if(this.userAction=='toSearch'&&varToDisplay.length>0){str+='<ul class="sort"><li class="listFirst">Sort by:</li>';var sUrl='/api-video/find_all_videos.asp?type=wsj-fulltext&query='+this.currentSearchText;if(this.sortOrder=='relevancy'){str+='<li class="selected"><span>relevance</span></li>';str+='<li class="listLast"><a href="javascript:'+this.getName()+'.searchLinkClicked(\''+sUrl+'&sort=date+desc\',\'date\')">Date</a></li>';}
else{str+='<li><a href="javascript:'+this.getName()+'.searchLinkClicked(\''+sUrl+'&sort=relevancy\',\'relevancy\')">Relevance</a></li>';str+='<li class="listLast selected"><span>Date</span></li>';}
str+='</ul>';str+='<p class="resultsLabel">'+(startIndex+1)+' - '+(endIndex+1)+' results out of '+varToDisplay.length+' for: '+this.currentSearchText+'</p>';}
if(this.userAction=='toSearch'&&varToDisplay.length===0){str+='<p class="noResults"> No content matches your search terms. Please try again. </p>';$(this.videoResultsDivId).innerHTML=str;return false;}
str+='<ul class="newsItem video videoListMed">';for(var i=startIndex;i<endIndex+1;i++){var title=varToDisplay[i];str+='<li id="li_'+title.id+'" class="">';str+='<a href="javascript:'+this.getName()+'.videoThumbnailClicked(\''+title.id+'\')" id="'+title.id+'" style="background-image: url('+unescape(title.thumbnailURL)+');" class="preview"><span>&nbsp;</span></a>';str+='<h2><a href="javascript:'+this.getName()+'.videoThumbnailClicked(\''+title.id+'\')">'+title.name+'</a></h2>';var minutes=Math.floor(title.duration/60);var seconds=title.duration%60;if(seconds<10){seconds='0'+seconds;}
str+='<small>'+minutes+':'+seconds+'</small>';if(this.isNotBlankOrNull(title.formattedCreationDate)){str+='<small> '+title.formattedCreationDate.split(' ')[0]+'</small>';}
str+='</li>';if(((i+1)%4)===0){str+='<li class="rowEnd"></li>';}}
str+='</ul>';str+='<ul id="pagination" class="pagination">';str+='</ul>';if(this.userAction!='toSearch'){var nameToDisplay=this.isNotBlankOrNull(this.visibleSubCollectionId)?this.visibleSubCollectionId:this.visibleCollectionId;str+='<a target="_blank" id="rssFeed" class="rss" href="">'+nameToDisplay+' Video Feed</a>';}
$(this.videoResultsDivId).innerHTML=str;if(!this.playFromRegisteredVideos){this.updateVideoThumbnailVisual('',this.currentlyPlayingVideoId);}},updateRssFeed:function(str){if($("rssFeed")){$("rssFeed").href=this.rssUrlsObject[str];}},videoThumbnailClicked:function(videoId){var videoDetails='';if(this.sourceApplicationName=='articlePage'){this.playFromRegisteredVideos=false;this.updateVideoThumbnailVisual('reg'+this.currentlyPlayingVideoId,'');videoDetails=this.getVideoDetails({'id':videoId,'fields':'linkRelativeURL,wsj-section'});}
if(videoDetails!==''&&(this.relatedVideosCollection!=videoDetails['wsj-section']||this.visibleCollectionId=='Search Results')){window.location.href=videoDetails.linkRelativeURL;}
else{this.playingGroup=this.browsingGroup;if(this.userAction=='toSearch'){this.currentPlayingJsonObject=this.currentSearchJsonObject;}
else
if(this.userAction=='toBrowse'){this.currentPlayingJsonObject=this.currentBrowsingJsonObject;}
this.convertCurrentPlayingJsonToIdsArray();this.updateTopNavAppearance('',this.visibleCollectionId);this.currentlyPlayingCollection=this.visibleCollectionId;this.currentlyPlayingSubCollection=this.visibleSubCollectionId;this.updateVideoThumbnailVisual(this.currentlyPlayingVideoId,videoId);this.currentlyPlayingVideoId=videoId;this.playVideoByVideoId(videoId);this.createNextVideo();}
if($("flashPlayer")){$("flashPlayer").scrollTo();}},playNextVideo:function(){if(this.nextVideoId!==''){this.updateVideoThumbnailVisual('reg'+this.currentlyPlayingVideoId,'reg'+this.nextVideoDetailsJsonObject.id);this.updateVideoThumbnailVisual(this.currentlyPlayingVideoId,this.nextVideoDetailsJsonObject.id);this.currentlyPlayingVideoId=this.nextVideoDetailsJsonObject.id;this.playVideoByParam(this.nextVideoDetailsJsonObject);this.populateVideoSummary(this.nextVideoDetailsJsonObject.name,this.nextVideoDetailsJsonObject.description,this.nextVideoDetailsJsonObject.formattedCreationDate);this.createNextVideo();}},getNextVideoId:function(){if(this.sourceApplicationName=='articlePage'){if(this.playFromRegisteredVideos&&this.registeredVideosIds.indexOf(this.currentlyPlayingVideoId)<this.registeredVideosIds.length-1){return this.registeredVideosIds[this.registeredVideosIds.indexOf(this.currentlyPlayingVideoId)+1];}
if(this.playFromRegisteredVideos&&this.registeredVideosIds.indexOf(this.currentlyPlayingVideoId)==this.registeredVideosIds.length-1){this.playFromRegisteredVideos=false;return this.currentlyPlayingVideoIds[0];}
if(this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)<(this.currentlyPlayingVideoIds.length-1)){return this.currentlyPlayingVideoIds[this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)+1];}
if(this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)==(this.currentlyPlayingVideoIds.length-1)){return'';}}
else{if(this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)==-1){return this.currentlyPlayingVideoIds[0];}
if(this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)<(this.currentlyPlayingVideoIds.length-1)){return this.currentlyPlayingVideoIds[this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)+1];}
if(this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)==(this.currentlyPlayingVideoIds.length-1)){if(this.currentlyPlayingCollection=='Search Results'){return'';}
if(this.playingGroup!==""&&this.playingGroup=='collection'){return this.getVideoIdFromNextCollection();}
if(this.playingGroup!==""&&this.playingGroup=='subcollection'){return this.getVideoIdFromNextSubCollection();}}}},getVideoIdFromNextSubCollection:function(){var subColAr=this.subcollectionsObject[this.currentlyPlayingCollection];if(subColAr.indexOf(this.currentlyPlayingSubCollection)!=subColAr.length-1){this.currentlyPlayingSubCollection=subColAr[subColAr.indexOf(this.currentlyPlayingSubCollection)+1];this.getVideos(this.contentUrlsObject[this.currentlyPlayingSubCollection]+'&count=60','',false);if(this.currentPlayingJsonObject.items.length===0){return this.getVideoIdFromNextSubCollection();}
else{return this.currentPlayingJsonObject.items[0].id;}}
else{this.currentlyPlayingSubCollection='';return this.getVideoIdFromNextCollection();}},getVideoIdFromNextCollection:function(){if(this.collectionNamesArray.indexOf(this.currentlyPlayingCollection)!=this.collectionNamesArray.length-1){if(this.skipCollection){this.currentlyPlayingCollection=this.collectionNamesArray[this.collectionNamesArray.indexOf(this.currentlyPlayingCollection)+1];}
this.skipCollection=true;this.getVideos(this.contentUrlsObject[this.currentlyPlayingCollection]+'&count=60','',false);if(this.currentPlayingJsonObject.items.length===0){return this.getVideoIdFromNextCollection();}
else{return this.currentPlayingJsonObject.items[0].id;}}
else{this.currentlyPlayingCollection=this.defaultCollectionName;this.skipCollection=false;return this.getVideoIdFromNextCollection();}},loadCollectionsDoc:function(){this.ajax=new Ajax.Request(this.collectionsXMLPath+"video-collections.xml",{method:'get',asynchronous:false,onSuccess:this.handleLoadCollectionsDoc.bindAsEventListener(this),onFailure:function(){alert('Failure while loading xml.');}});return this.xmlDoc;},handleLoadCollectionsDoc:function(transport){this.xmlDoc=transport.responseXML.documentElement;},updateSideNavAppearance:function(strType,id){if(this.visibleSubCollectionId!==''){if($('a_'+this.visibleSubCollectionId)){if($('a_'+this.visibleSubCollectionId).className=='subcollection-selected'){$('a_'+this.visibleSubCollectionId).className='current';}}}
if(strType=='collection'){if(this.visibleCollectionId!==''){var vCol=$(this.visibleCollectionId);var aVCol=$('a_'+this.visibleCollectionId);if(vCol.className=='expanded'){vCol.className='expand';aVCol.className='';}else if(vCol.className=='expand'){aVCol.className='';}else{vCol.className='noSubCollection';aVCol.className='';}}
if($(id).className=='expand'){$(id).className='expanded';$('a_'+id).className='collection-selected';}
else{$(id).className='noSubCollection-expanded';$('a_'+id).className='selected';}
this.visibleCollectionId=id;this.visibleSubCollectionId='';}
if(strType=='subcollection'){if(this.isNotBlankOrNull($('a_'+id))){$('a_'+id).className='subcollection-selected';}
if(this.isNotBlankOrNull($(this.visibleCollectionId))){$(this.visibleCollectionId).className='expanded';}
if(this.isNotBlankOrNull($('a_'+this.visibleCollectionId))){$('a_'+this.visibleCollectionId).className='';}
this.visibleSubCollectionId=id;}},getName:function(){return this.objName;},playVideoByVideoId:function(videoId){var url='/api-video/get_video_info.asp?guid='+videoId+'&fields=all';this.getVideos(url,'current',false);},playVideoByParam:function(params){var adZone=new dj.util.Ads().getRegisteredAdsZone('');var lineup=this.isNotBlankOrNull(this.currentlyPlayingSubCollection)?this.currentlyPlayingSubCollection:this.currentlyPlayingCollection;if(adZone!='default'&&adZone!=''){params.adZone=adZone;}
params.lineup=lineup;params.emailPartnerID=110626;params.site=this.site;params.msrc=this.msrc;params.adFrmt="frmt=2;";params.playerName=(this.sourceApplicationName=='articlePage')?"video_articletab":"video_videocenter";params.embedPlayerURL=this.flashPlayerPath+"main.swf";params.embedConfigURL=this.embedConfigURL;params.embedPlayerID="1000";params.embedName="flashPlayer";params.embedBaseURL=this.flashPlayerPath;params.embedHeight=363;params.embedWidth=512;params.larsID=91;params.larsAdTrackingID=1259;params.prop5=window.location.href.split('?')[0];params.prop6=window.location.href;params.prop10=this.getUrlParam(window.location.href,'mod');params.prop11=this.getUrlParam(window.location.href,'reflink');params.prop19=(this.sourceApplicationName=='articlePage')?"video_tab":"video";params.prop24=this.prop24;params.prop25=this.prop25;params.prop27=this.prop27;var subSecComponent=this.omnitureEncoding(this.currentlyPlayingCollection,this.currentlyPlayingSubCollection,'s');var secComponent=this.omnitureEncoding(this.currentlyPlayingCollection,this.currentlyPlayingSubCollection,'c');params.prop2="WSJ_"+secComponent;params.prop3="WSJ_Video_Video_"+secComponent;params.prop22="WSJ_Video_Video_"+subSecComponent;params.prop26="WSJ_"+subSecComponent;params.emailURL=this.emailURL;swfobject.getObjectById("flashPlayer").playVideo($H(params).toJSON());},omnitureEncoding:function(col,subcol,type){if(col=='News'){if(subcol=='Politics'&&type=='s'){return'Politics & Campaign';}
if((!this.isNotBlankOrNull(subcol))&&type=='c'){return'US';}
if((!this.isNotBlankOrNull(subcol))&&type=='s'){return'US';}}
if(col=='Management'){if((!this.isNotBlankOrNull(subcol))&&type=='c'){return'Business';}
if((!this.isNotBlankOrNull(subcol))&&type=='s'){return'Management';}
if(subcol=='Business Insight'&&type=='c'){return'Business';}
if(subcol=='Business Insight'&&type=='s'){return'Business Insight';}
return'Business';}
if(col=='Lifestyle'){return'Life & Style';}
if(col=='Special Packages'){if(subcol=='Journal Reports'&&type=='c'){return'Special';}
if(subcol=='Journal Reports'&&type=='s'){return'In-Depth Reports';}
if(subcol=='Journal Women'&&type=='c'){return'Careers';}
if(subcol=='Journal Women'&&type=='s'){return'Journal Women';}}
if(type=='s'&&!(this.isNotBlankOrNull(subcol))){return col;}
if(type=='s'){return subcol;}
if(type=='c'){return col;}},openPopUpPlayer:function(){var currentPlayingLocation=Math.floor(swfobject.getObjectById("flashPlayer").getSeek());var width='512';var height='660';var currentlyPlayingCollection=this.currentlyPlayingCollection;if((currentlyPlayingCollection=='Special Packages')||(currentlyPlayingCollection=='Search Results')){currentlyPlayingCollection=this.currentVideoDetailsJsonObject['wsj-section'];}
this.popUpWindow=window.open(this.popUpPageUrl+'?currentPlayingLocation='+currentPlayingLocation+'&currentlyPlayingCollection='+escape(currentlyPlayingCollection)+'&currentlyPlayingVideoId='+this.currentlyPlayingVideoId,'popUpPlayer','height='+height+',width='+width+',left='+((screen.width-Number(width))/2)+',top='+(screen.height-Number(height))/2+',resizable=yes,scrollbars=no,toolbar=no,status=no');},openMicroPopUpPlayer:function(id){var currentPlayingLocation=Math.floor(swfobject.getObjectById(this.videoIdMicroPlayerIdMap[id]).getSeek());var currentlyPlayingCollection=this.microPlayersObjects[id]['wsj-section'];if(currentlyPlayingCollection=='Lifestyle'){currentlyPlayingCollection='Life & Style';}
var currentlyPlayingVideoId=id;var width='512';var height='660';this.popUpWindow=window.open(this.popUpPageUrl+'?currentPlayingLocation='+currentPlayingLocation+'&currentlyPlayingCollection='+escape(currentlyPlayingCollection)+'&currentlyPlayingVideoId='+currentlyPlayingVideoId,'popUpPlayer','height='+height+',width='+width+',left='+((screen.width-Number(width))/2)+',top='+(screen.height-Number(height))/2+',resizable=yes,scrollbars=no,toolbar=no,status=no');},focusPopUp:function(){if(this.popUpWindow){this.popUpWindow.focus();}},createRegisteredVideosThumbnails:function(){if(this.registeredVideosIds.length>0){var str='';for(var index=0,len=this.registeredVideosIds.length;index<len;++index){var title=this.registeredVideos[index];str+='<li id="li_reg'+title.id+'" class="">';str+='<a href="javascript:'+this.getName()+'.regVideoThumbnailClicked(\''+title.id+'\',\''+unescape(title.videoURL)+'\')" id="'+title.id+'" style="background-image: url('+unescape(title.thumbnailURL)+');" class="preview"><span>&nbsp;</span></a>';str+='<h2><a href="javascript:'+this.getName()+'.regVideoThumbnailClicked(\''+title.id+'\',\''+unescape(title.videoURL)+'\')">'+title.name+'</a></h2>';var minutes=Math.floor(title.duration/60);var seconds=title.duration%60;if(seconds<10){seconds='0'+seconds;}
str+='<small>'+minutes+':'+seconds+'</small>';str+='</li>';if(((index+1)%4)===0){str+='<li class="rowEnd"></li>';}}
$(this.registeredVideosDivId).innerHTML=str;}},regVideoThumbnailClicked:function(videoId){this.playFromRegisteredVideos=true;this.updateVideoThumbnailVisual('reg'+this.currentlyPlayingVideoId,'reg'+videoId);this.updateVideoThumbnailVisual(this.currentlyPlayingVideoId,'');this.currentlyPlayingVideoId=videoId;this.playVideoByVideoId(videoId);this.createNextVideo();},registerVideo:function(videoId){this.playFromRegisteredVideos=true;if(videoId.indexOf('{')==-1){videoId='{'+videoId+'}';}
if(this.registeredVideosIds.indexOf(videoId)==-1){this.registeredVideosIds[this.registeredVideosIds.length]=videoId;this.registeredVideos[this.registeredVideos.length]=this.getVideoDetails({'id':videoId,'fields':'all'});}},loadSoloVideo:function(videoId,divId){if(videoId.indexOf('{')==-1){videoId='{'+videoId+'}';}
var microPlayerId="MicroPlayer_"+Math.floor(Math.random()*1000000);this.microPlayers[this.microPlayers.length]=microPlayerId;this.videoIdMicroPlayerIdMap[videoId]=microPlayerId;if(!dj.context.video){dj.context.video={};}
if(!dj.context.video.soloVideos){dj.context.video.soloVideos=[];}
dj.context.video.soloVideos[videoId]=this;if(swfobject.getFlashPlayerVersion().major>=9){var dim={w:"272",h:"180"};swfobject.embedSWF(this.flashPlayerPath+"microPlayer.swf",divId,dim.w,dim.h,"9.0.0","",{'objName':"dummy",'videoGUID':videoId,'allowPlayerPopup':'1','plyMediaEnabled':'1','movieWidth':dim.w,'movieHeight':dim.h,'host':location.host},{allowscriptaccess:"always",wmode:"opaque"},{id:microPlayerId});}
else{this.nonSupportingFlashPlayer(divId);}},getJSON:function(id){var url='/api-video/get_video_info.asp?guid='+id;url+='&fields=all';this.ajax=new Ajax.Request(url,{method:'get',asynchronous:false,requestHeaders:{Accept:'application/json'},onSuccess:this.handleGetJSON.bindAsEventListener(this),onFailure:function(){console.error("Failed while executing getJSON.");}});this.microPlayersObjects[id]=this.jsonData;return $H(this.jsonData).toJSON();},handleGetJSON:function(json){this.jsonData=json.responseText.evalJSON(true);var adZone=new dj.util.Ads().getRegisteredAdsZone('');if(adZone!='default'&&adZone!=''){this.jsonData.adZone=adZone;}
this.jsonData.emailPartnerID=110626;this.jsonData.site=this.site;this.jsonData.msrc=this.msrc;this.jsonData.adFrmt="frmt=0;";this.jsonData.playerName="video_articleembed";this.jsonData.videoCenterURL="http://"+window.location.host+"/video-center";this.jsonData.embedPlayerURL=this.flashPlayerPath+"microPlayer.swf";this.jsonData.embedConfigURL=this.embedConfigURL;this.jsonData.embedPlayerID="1000";this.jsonData.embedName="microflashPlayer";this.jsonData.embedBaseURL=this.flashPlayerPath;this.jsonData.embedHeight=180;this.jsonData.embedWidth=272;this.jsonData.larsID=91;this.jsonData.larsAdTrackingID=1259;this.jsonData.prop5=window.location.href.split('?')[0];this.jsonData.prop6=window.location.href;this.jsonData.prop10=this.getUrlParam(window.location.href,'mod');this.jsonData.prop11=this.getUrlParam(window.location.href,'reflink');this.jsonData.prop19="video_emb";this.jsonData.prop24=this.prop24;this.jsonData.prop25=this.prop25;this.jsonData.prop27=this.prop27;var subSecComponent=this.omnitureEncoding(this.jsonData['wsj-section'],this.jsonData['wsj-subsection'],'s');var secComponent=this.omnitureEncoding(this.jsonData['wsj-section'],this.jsonData['wsj-subsection'],'c');this.jsonData.prop2="WSJ_"+secComponent;this.jsonData.prop3="WSJ_Video_Video_"+secComponent;this.jsonData.prop22="WSJ_Video_Video_"+subSecComponent;this.jsonData.prop26="WSJ_"+subSecComponent;this.jsonData.emailURL=this.emailURL;var suprsAd='0';try{if(pID.indexOf('0_0_WH')!=-1){suprsAd='1';}}
catch(e){console.error("pID read error");}
this.jsonData.suppressAds=suprsAd;},getVideoDetails:function(args){if(!args.id){return"No Id.";}
var url='/api-video/get_video_info.asp?guid='+args.id;if(args.fields){url+='&fields='+args.fields;}
else{url+='&fields=all';}
this.ajax=new Ajax.Request(url,{method:'get',asynchronous:false,requestHeaders:{Accept:'application/json'},onSuccess:this.handleGetVideoDetails.bindAsEventListener(this),onFailure:function(){console.error("Failed while executing getVideoDetails.");}});return this.jsonData;},handleGetVideoDetails:function(json){this.jsonData=json.responseText.evalJSON(true);}});dj.widget.video.popupvideo=Class.create({initialize:function(objName){this.objName=objName;this.currentlyPlayingVideoIds=[];this.videoResultsDivId='video_results';this.defaultCollectionName='News';this.currentPlayingJsonObject={};this.currentBrowsingJsonObject={};this.visibleCollectionId='';this.currentlyPlayingCollection='';this.videoPlayerDivId='video_player';this.currentPlayingLocation='';this.currentlyPlayingCollection='';this.currentlyPlayingVideoId='';this.urlKeysCollectionMap=new Hash();this.contentUrlsObject={};this.rssUrlsObject={};this.collectionNamesArray=[];this.xmlDoc='';this.utilVideoObj=new dj.widget.video.video('','utilVideoObj');this.nextVideoId='';this.nextVideoDetailsJsonObject={};this.skipCollection=true;},getName:function(){return this.objName;},loadVideo:function(){this.createFlashPlayer();},continueLoadVideo:function(){var srcUrl=window.location.href;this.currentPlayingLocation=this.utilVideoObj.getUrlParam(srcUrl,'currentPlayingLocation');this.currentlyPlayingCollection=unescape(this.utilVideoObj.getUrlParam(srcUrl,'currentlyPlayingCollection'));this.currentlyPlayingVideoId=this.utilVideoObj.getUrlParam(srcUrl,'currentlyPlayingVideoId');if(this.currentlyPlayingCollection=='Lifestyle'){this.currentlyPlayingCollection='Life & Style';}
this.xmlDoc=this.utilVideoObj.loadCollectionsDoc();this.parseInformationFromXmlDoc();this.createPopUpFramework();this.popPopulateSelect();this.playVideoByVideoId(this.currentlyPlayingVideoId,this.currentPlayingLocation);this.getVideos(this.contentUrlsObject[this.currentlyPlayingCollection]+'&count=15','',false);this.popPopulateVideos(1);this.popPopulatePagination(1);this.utilVideoObj.updateVideoThumbnailVisual('',this.currentlyPlayingVideoId);this.updateSelect(this.currentlyPlayingCollection);this.createNextVideoParams();this.currentBrowsingJsonObject=this.currentPlayingJsonObject;this.visibleCollectionId=this.currentlyPlayingCollection;},createNextVideoParams:function(){this.nextVideoId=this.getNextVideoId();var url='/api-video/get_video_info.asp?guid='+this.nextVideoId+'&fields=all';this.getVideos(url,'next',true);},popThumbnailClicked:function(videoId){this.utilVideoObj.updateVideoThumbnailVisual(this.currentlyPlayingVideoId,videoId);this.currentPlayingJsonObject=this.currentBrowsingJsonObject;this.convertCurrentPlayingJsonToIdsArray();this.currentlyPlayingCollection=this.visibleCollectionId;this.currentlyPlayingVideoId=videoId;this.playVideoByVideoId(videoId);this.createNextVideoParams();},updateSelect:function(collName){$(collName).selected='true';},createPopUpFramework:function(){if($(this.videoResultsDivId)){var str='';str+='<ul id="popPagination" class="arrows">';str+='</ul>';str+='<h3>More Video in</h3>';str+='<form id="selForm" action="" method="">';str+='</form>';str+='<ul id="popVideoList" class="video videoPlaylist">';str+='</ul>';$(this.videoResultsDivId).innerHTML=str;}},playVideoByParam:function(params){var adZone=new dj.util.Ads().getRegisteredAdsZone('');var lineup=this.currentlyPlayingCollection;if(adZone!='default'&&adZone!=''){params.adZone=adZone;}
params.lineup=lineup;params.emailPartnerID=110626;params.site=this.utilVideoObj.site;params.msrc=this.utilVideoObj.msrc;params.adFrmt="frmt=0;";params.playerName="video_popup";params.embedPlayerURL=this.utilVideoObj.flashPlayerPath+"main.swf";params.embedConfigURL=this.utilVideoObj.embedConfigURL;params.embedPlayerID="1000";params.embedName="popupflashPlayer";params.embedBaseURL=this.utilVideoObj.flashPlayerPath;params.embedHeight=363;params.embedWidth=512;params.larsID=91;params.larsAdTrackingID=1259;params.prop5=window.location.href.split('?')[0];params.prop6=window.location.href;params.prop10=this.utilVideoObj.getUrlParam(window.location.href,'mod');params.prop11=this.utilVideoObj.getUrlParam(window.location.href,'reflink');params.prop19="video_popup";params.prop24=this.utilVideoObj.prop24;params.prop25=this.utilVideoObj.prop25;params.prop27=this.utilVideoObj.prop27;var subSecComponent=this.utilVideoObj.omnitureEncoding(this.currentlyPlayingCollection,'','s');var secComponent=this.utilVideoObj.omnitureEncoding(this.currentlyPlayingCollection,'','c');params.prop2="WSJ_"+secComponent;params.prop3="WSJ_Video_Video_"+secComponent;params.prop22="WSJ_Video_Video_"+subSecComponent;params.prop26="WSJ_"+subSecComponent;params.emailURL=this.utilVideoObj.emailURL;swfobject.getObjectById("popupflashPlayer").playVideo($H(params).toJSON());},getVideos:function(url,userAction,async){var fun=this.handleResponse;if(userAction=='toBrowse'){fun=this.handleBrowsingResults;}
if(userAction=='next'){fun=this.handleNext;}
this.ajax=new Ajax.Request(url,{method:'get',asynchronous:async,requestHeaders:{Accept:'application/json'},onSuccess:fun.bindAsEventListener(this),onFailure:this.handleFailure.bindAsEventListener(this,url,userAction,async)});},handleFailure:function(obj,url,userAction,async){setTimeout(""+this.getName()+".getVideos('"+url+"','"+userAction+"','"+async+"')",10000);},handleResponse:function(json){this.currentPlayingJsonObject=json.responseText.evalJSON(true);this.convertCurrentPlayingJsonToIdsArray();},handleBrowsingResults:function(json){this.currentBrowsingJsonObject=json.responseText.evalJSON(true);this.popPopulateVideos(1);this.popPopulatePagination(1);},handleNext:function(json){this.nextVideoDetailsJsonObject=json.responseText.evalJSON(true);},convertCurrentPlayingJsonToIdsArray:function(){if(this.currentPlayingJsonObject.items.length>0){for(var index=0,len=this.currentPlayingJsonObject.items.length;index<len;++index){this.currentlyPlayingVideoIds[index]=this.currentPlayingJsonObject.items[index].id;}}},playVideoByVideoId:function(videoId,duration){this.currentVideoDetailsJsonObject=this.utilVideoObj.getVideoDetails({'id':videoId,'fields':'all'});this.currentVideoDetailsJsonObject.seekTime=duration;this.playVideoByParam(this.currentVideoDetailsJsonObject);},popPopulateVideos:function(pageNumber){var varToDisplay='';if(this.userAction=='toBrowse'){if(typeof this.currentBrowsingJsonObject!="undefined"){varToDisplay=this.currentBrowsingJsonObject.items;}}
else{varToDisplay=this.currentPlayingJsonObject.items;}
var startIndex=(pageNumber-1);var endIndex=Math.min(startIndex+3,varToDisplay.length-1);var str='';for(var i=startIndex;i<endIndex+1;i++){var title=varToDisplay[i];str+='<li class="" id="li_'+title.id+'">';str+='<a href="#" onClick="'+this.getName()+'.popThumbnailClicked(\''+title.id+'\')" id="'+title.id+'" style="background-image: url('+unescape(title.thumbnailURL)+');" class="preview"><span>&nbsp;</span></a>';str+='<h2><a href="#" onClick="'+this.getName()+'.popThumbnailClicked(\''+title.id+'\')">'+title.name+'</a></h2>';var minutes=Math.floor(title.duration/60);var seconds=title.duration%60;if(seconds<10){seconds='0'+seconds;}
str+='<small>'+minutes+':'+seconds+'</small>';str+='</li>';}
$("popVideoList").innerHTML=str;},popPopulatePagination:function(pageNumber){var varToDisplay='';if(this.userAction=='toBrowse'){if(typeof this.currentBrowsingJsonObject!="undefined"){varToDisplay=this.currentBrowsingJsonObject.items;}}
else{varToDisplay=this.currentPlayingJsonObject.items;}
var lastPageNumber=Math.max(varToDisplay.length-3,1);var str='';if(pageNumber==1){str+='<li class="prev"><a><span>previous</span></a></li>';}
else{str+='<li class="prev"><a href="javascript:'+this.getName()+'.popPaginationClicked('+(Number(pageNumber)-1)+')"><span>previous</span></a></li>';}
if(pageNumber==lastPageNumber){str+='<li class="next"><a><span>next</span></a></li>';}
else{str+='<li class="next"><a href="javascript:'+this.getName()+'.popPaginationClicked('+(Number(pageNumber)+1)+')"><span>next</span></a></li>';}
$("popPagination").innerHTML=str;},popPaginationClicked:function(pageNumber){this.popPopulatePagination(pageNumber);this.popPopulateVideos(pageNumber);this.utilVideoObj.updateVideoThumbnailVisual('',this.currentlyPlayingVideoId);},popPopulateSelect:function(){var str='';str+='<select id="popSelect" onChange="javascript:'+this.getName()+'.popSelectChanged(this.value)">';var collectionArray=this.xmlDoc.getElementsByTagName("collection");for(var index=0,len=collectionArray.length;index<len;++index){var item=collectionArray[index];if(item.getAttribute("name")!="Special Packages"){str+='<option value="'+item.getAttribute("name")+'" id="'+item.getAttribute("name")+'">'+item.getAttribute("name")+'</option>';}}
str+='<option value="See More Video" id="See More Video">See More Video</option>';str+='</select>';$("selForm").innerHTML=str;},popSelectChanged:function(collectionName){this.visibleCollectionId=collectionName;if(collectionName=='See More Video'){window.open(this.utilVideoObj.videoCenterPageUrl);return;}
if(collectionName!=this.currentlyPlayingCollection){this.userAction='toBrowse';$("popVideoList").innerHTML='<p class="noResults"> Loading ... </p>';this.getVideos(this.contentUrlsObject[collectionName]+'&count=15',this.userAction,true);this.popPopulateVideos(1);this.popPopulatePagination(1);}
else{this.userAction='';this.popPopulateVideos(1);this.popPopulatePagination(1);this.utilVideoObj.updateVideoThumbnailVisual('',this.currentlyPlayingVideoId);}},createFlashPlayer:function(){if($(this.videoPlayerDivId)){var dim={w:"512",h:"363"};swfobject.embedSWF(this.utilVideoObj.flashPlayerPath+"main.swf",this.videoPlayerDivId,dim.w,dim.h,"9.0.0","",{'objName':this.getName(),'plyMediaEnabled':'1','movieWidth':dim.w,'movieHeight':dim.h,'host':location.host},{allowscriptaccess:"always",wmode:"opaque"},{id:"popupflashPlayer"});}},parseInformationFromXmlDoc:function(){var collectionArray=this.xmlDoc.getElementsByTagName("collection");for(var index=0,len=collectionArray.length;index<len;++index){var item=collectionArray[index];this.urlKeysCollectionMap.set(item.getAttribute("urlkey"),item.getAttribute("name"));this.contentUrlsObject[item.getAttribute("name")]=item.getAttribute("contenturl");this.rssUrlsObject[item.getAttribute("name")]=item.getAttribute("rssurl");this.collectionNamesArray[this.collectionNamesArray.length]=item.getAttribute("name");var subCollectionArray=item.getElementsByTagName("subcollection");var subCollectionArrayLength=subCollectionArray.length;for(var sindex=0,slen=subCollectionArray.length;sindex<slen;++sindex){var sitem=subCollectionArray[sindex];this.urlKeysCollectionMap.set(sitem.getAttribute("urlkey"),sitem.getAttribute("name"));this.contentUrlsObject[sitem.getAttribute("name")]=sitem.getAttribute("contenturl");}}},playNextVideo:function(){if(this.nextVideoId!==''){this.utilVideoObj.updateVideoThumbnailVisual(this.currentlyPlayingVideoId,this.nextVideoDetailsJsonObject.id);this.currentlyPlayingVideoId=this.nextVideoDetailsJsonObject.id;this.playVideoByParam(this.nextVideoDetailsJsonObject);this.createNextVideoParams();}},getNextVideoId:function(){if(this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)==-1){return this.currentlyPlayingVideoIds[0];}
if(this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)<(this.currentlyPlayingVideoIds.length-1)){return this.currentlyPlayingVideoIds[this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)+1];}
if(this.currentlyPlayingVideoIds.indexOf(this.currentlyPlayingVideoId)==(this.currentlyPlayingVideoIds.length-1)){return this.getVideoIdFromNextCollection();}},getVideoIdFromNextCollection:function(){if(this.collectionNamesArray.indexOf(this.currentlyPlayingCollection)!=this.collectionNamesArray.length-1){if(this.skipCollection){this.currentlyPlayingCollection=this.collectionNamesArray[this.collectionNamesArray.indexOf(this.currentlyPlayingCollection)+1];}
this.skipCollection=true;this.getVideos(this.contentUrlsObject[this.currentlyPlayingCollection]+'&count=15','',false);if(this.currentPlayingJsonObject.items.length===0){this.getVideoIdFromNextCollection();}
else{return this.currentPlayingJsonObject.items[0].id;}}
else{this.currentlyPlayingCollection=this.defaultCollectionName;this.skipCollection=false;return this.getVideoIdFromNextCollection();}}});
if(typeof dj=="undefined"){dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.video=="undefined"){dj.widget.video={};}
dj.widget.video.Video=Class.create({config:{thumbnail:{divclass:"headlineSummary video",onclickprefix:"dj.module.articleVideoPlayer.tabplay(",onclicksuffix:");",hrefprefix:"#articleTabs_video-"},bc:{src:"http://wsj.vo.llnwd.net/o28/plymedia/SWF/BrightPLYembed.swf",flashVars:"playerId=452319854&viewerSecureGatewayURL=https://services.brightcove.com/services/amfgateway&servicesURL=http://services.brightcove.com/services&cdnURL=http://admin.brightcove.com&domain=embed&autoStart=false&showTicker=true&flashId=flashObj&videoId=",base:"http://wsj.vo.llnwd.net/o28/plymedia/SWF",bgcolor:"#000000",name:"BrightPLYembed",pluginspage:"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash",flashversion:"8"}},initialize:function(id,v,w,h,c){if(!id){return;}
this.parentid=id;this.parent=$(id);if(!this.parent){console.log('id '+id+' not found');return;}
this.v=v;w=264;this.w=w;h=254;this.h=h;this.c=c;if(v){this.load(v,w,h,c);}},createwrapper:function(v,w,h){this.div=new Element('div',{'id':this.vidid});if(w&&!this.isguid(v)){this.tryw=''+w+'px';this.div.style.width=this.tryw;}
this.parent.appendChild(this.div);},createvideobc:function(v,w,h,c){this.so=new SWFObject(this.config.bc.src,v,w,h,this.config.bc.flashversion,this.config.bc.bgcolor);this.so.setAttribute('id','video_'+this.vidid);this.so.addParam('base',this.config.bc.base);this.so.addParam("flashVars",this.config.bc.flashVars+v+'&');this.so.addParam("seamlesstabbing","false");this.so.addParam("swLiveConnect","true");this.so.addParam("name",this.config.bc.name);this.so.addParam("pluginspage",this.config.bc.pluginspage);this.so.addParam("wmode","opaque");this.so.write(this.div);if(c){var caption=new Element('p',{'class':'targetCaption'}).update(c);this.div.appendChild(caption);}},createvideoguid:function(v){this.guidvideo=new dj.widget.video.video();this.guidvideo.loadSoloVideo(v,this.vidid);if(this.c){var caption=new Element('p',{'class':'targetCaption'}).update(this.c);this.parent.appendChild(caption);}},createvideo:function(v,w,h,c){if(this.isguid(v))
{this.createvideoguid(v);}else{this.createvideobc(v,w,h,c);}},load:function(v,w,h,c){if(!this.div){this.newId();this.createwrapper(v,w,h);this.createvideo(v,w,h,c);}},createthumbnail:function(playObserver){if(!this.guidvideo){console.error('no guidvideo');return;}
if(!this.guidvideo.details){console.error('no guidvideo.details');return;}
if(!playObserver){console.warn('no playObserver');}
var vtdiv=new Element('div',{'class':'videoTree'});this.div.appendChild(vtdiv);var vfdiv=new Element('div',{'class':'videoFrame'});vtdiv.appendChild(vfdiv);var aimg=new Element('a',{'href':"#"});var that=this;Event.observe(aimg,'click',function(){playObserver.fire(that.v);return false;});vfdiv.appendChild(aimg);var img=new Element('img',{'src':this.guidvideo.details.thumbnailURLSmall,'width':'115','height':'65','alt':'video'});aimg.appendChild(img);var spannbsp=new Element('span',{'class':'videoBug'});spannbsp.update('&nbsp;');aimg.appendChild(spannbsp);var title=new Element('h3',{'class':'first'});this.div.appendChild(title);var ah3=new Element('a',{"href":"#"}).update(this.guidvideo.details.name);var that2=this;Event.observe(ah3,'click',function(){playObserver.fire(that2.v);return false;});title.appendChild(ah3);var duration=new Element('small').update(this.formatduration(this.guidvideo.details.duration));this.div.appendChild(duration);var desc=new Element('p',{'class':'targetCaption'}).update(this.guidvideo.details.description);this.div.appendChild(desc);},loadthumbnail:function(v,w,h,playObserver){this.v=v;if(!this.isguid(v)){console.error('cannot create tumbnail to old video');return;}
this.getvideodetails();this.newId();this.createwrapper(v,w,h);this.createthumbnail(playObserver);},getvideodetails:function(){this.guidvideo=new dj.widget.video.video();this.guidvideo.details=this.guidvideo.getVideoDetails({'id':this.v,'fields':'name,id,duration,description,thumbnailURL,thumbnailURLSmall'});},setBookMark:function(){if(this.guidvideo){this.guidvideo.setBookMark();}},pauseMicroPlayer:function(){if(this.guidvideo){this.guidvideo.pauseMicroPlayers();}},isguid:function(g){g=''+g;if(g.substring(0,1)!='{'){g='{'+g;}
if(g.substring(0,1)=='{'&&g.substring(9,10)=='-'&&g.substring(14,15)=='-'&&g.substring(19,20)=='-'){return true;}else{return false;}},newId:function(){this.vidid="videodiv_"+Math.floor(Math.random()*999999);},formatduration:function(d){var minutes=Math.floor(d/60);var seconds=d%60;if(seconds<10){seconds='0'+seconds;}
return''+minutes+':'+seconds;}});
if(typeof dj==="undefined"){dj={};}
if(typeof dj.module==="undefined"){dj.module={};}
if(typeof dj.widget.videoModule==="undefined"){dj.widget.videoModule={};}
dj.module.videoModule={init:function(config){var djL=dj.lang;this.cfg=djL.mixin({videoModuleContainerId:"videoModule",autonomyVideoClassName:"autonomy_video"},config);var oVidMod=djL.byId(this.cfg.videoModuleContainerId);if(oVidMod===null){console.log("{VideoModule} is undefined.");return;}
if(djL.hasClassName(oVidMod,this.cfg.autonomyVideoClassName)){this._setupAutonomyVideo(oVidMod);}
this._setupVideo(oVidMod);},_setupVideo:function(oVidMod){this.panels=dj.widget.panels.PanelsFactory.create(oVidMod,{core:{},carousel:{}});},_setupAutonomyVideo:function(oVidMod){var djL=dj.lang;var oVideoElements=djL.query('.preview',oVidMod);var oVideoElId=null;for(var i=0,len=oVideoElements.length;i<len;i++){var oVideoEl=oVideoElements[i];oVideoElId=oVideoEl.id;var tempGUID=oVideoElId.split(':');var getImgGuid=tempGUID[1].replace(/_/g,'-');this.guidvideo=new dj.widget.video.video();var guidVideoDetails=this.guidvideo.getVideoDetails({'id':getImgGuid,'fields':'thumbnailURLSmall'});if(guidVideoDetails!=="undefined"){var getSmallThumnailURL='url('+guidVideoDetails.thumbnailURLSmall+')';if(getSmallThumnailURL!==null){oVideoEl.style.backgroundImage=getSmallThumnailURL;}}else{console.log('getSmallThumnailURL is '+getSmallThumnailURL);oVideoEl.style.backgroundImage='/img/bb/BB_DBlogo.gif';}}}};/* SWFObject v2.1 <http://code.google.com/p/swfobject/>
	Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
	This software is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
var swfobject=function(){var b="undefined",Q="object",n="Shockwave Flash",p="ShockwaveFlash.ShockwaveFlash",P="application/x-shockwave-flash",m="SWFObjectExprInst",j=window,K=document,T=navigator,o=[],N=[],i=[],d=[],J,Z=null,M=null,l=null,e=false,A=false;var h=function(){var v=typeof K.getElementById!=b&&typeof K.getElementsByTagName!=b&&typeof K.createElement!=b,AC=[0,0,0],x=null;if(typeof T.plugins!=b&&typeof T.plugins[n]==Q){x=T.plugins[n].description;if(x&&!(typeof T.mimeTypes!=b&&T.mimeTypes[P]&&!T.mimeTypes[P].enabledPlugin)){x=x.replace(/^.*\s+(\S+\s+\S+$)/,"$1");AC[0]=parseInt(x.replace(/^(.*)\..*$/,"$1"),10);AC[1]=parseInt(x.replace(/^.*\.(.*)\s.*$/,"$1"),10);AC[2]=/r/.test(x)?parseInt(x.replace(/^.*r(.*)$/,"$1"),10):0}}else{if(typeof j.ActiveXObject!=b){var y=null,AB=false;try{y=new ActiveXObject(p+".7")}catch(t){try{y=new ActiveXObject(p+".6");AC=[6,0,21];y.AllowScriptAccess="always"}catch(t){if(AC[0]==6){AB=true}}if(!AB){try{y=new ActiveXObject(p)}catch(t){}}}if(!AB&&y){try{x=y.GetVariable("$version");if(x){x=x.split(" ")[1].split(",");AC=[parseInt(x[0],10),parseInt(x[1],10),parseInt(x[2],10)]}}catch(t){}}}}var AD=T.userAgent.toLowerCase(),r=T.platform.toLowerCase(),AA=/webkit/.test(AD)?parseFloat(AD.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,q=false,z=r?/win/.test(r):/win/.test(AD),w=r?/mac/.test(r):/mac/.test(AD);/*@cc_on q=true;@if(@_win32)z=true;@elif(@_mac)w=true;@end@*/return{w3cdom:v,pv:AC,webkit:AA,ie:q,win:z,mac:w}}();var L=function(){if(!h.w3cdom){return }f(H);if(h.ie&&h.win){try{K.write("<script id=__ie_ondomload defer=true src=//:><\/script>");J=C("__ie_ondomload");if(J){I(J,"onreadystatechange",S)}}catch(q){}}if(h.webkit&&typeof K.readyState!=b){Z=setInterval(function(){if(/loaded|complete/.test(K.readyState)){E()}},10)}if(typeof K.addEventListener!=b){K.addEventListener("DOMContentLoaded",E,null)}R(E)}();function S(){if(J.readyState=="complete"){J.parentNode.removeChild(J);E()}}function E(){if(e){return }if(h.ie&&h.win){var v=a("span");try{var u=K.getElementsByTagName("body")[0].appendChild(v);u.parentNode.removeChild(u)}catch(w){return }}e=true;if(Z){clearInterval(Z);Z=null}var q=o.length;for(var r=0;r<q;r++){o[r]()}}function f(q){if(e){q()}else{o[o.length]=q}}function R(r){if(typeof j.addEventListener!=b){j.addEventListener("load",r,false)}else{if(typeof K.addEventListener!=b){K.addEventListener("load",r,false)}else{if(typeof j.attachEvent!=b){I(j,"onload",r)}else{if(typeof j.onload=="function"){var q=j.onload;j.onload=function(){q();r()}}else{j.onload=r}}}}}function H(){var t=N.length;for(var q=0;q<t;q++){var u=N[q].id;if(h.pv[0]>0){var r=C(u);if(r){N[q].width=r.getAttribute("width")?r.getAttribute("width"):"0";N[q].height=r.getAttribute("height")?r.getAttribute("height"):"0";if(c(N[q].swfVersion)){if(h.webkit&&h.webkit<312){Y(r)}W(u,true)}else{if(N[q].expressInstall&&!A&&c("6.0.65")&&(h.win||h.mac)){k(N[q])}else{O(r)}}}}else{W(u,true)}}}function Y(t){var q=t.getElementsByTagName(Q)[0];if(q){var w=a("embed"),y=q.attributes;if(y){var v=y.length;for(var u=0;u<v;u++){if(y[u].nodeName=="DATA"){w.setAttribute("src",y[u].nodeValue)}else{w.setAttribute(y[u].nodeName,y[u].nodeValue)}}}var x=q.childNodes;if(x){var z=x.length;for(var r=0;r<z;r++){if(x[r].nodeType==1&&x[r].nodeName=="PARAM"){w.setAttribute(x[r].getAttribute("name"),x[r].getAttribute("value"))}}}t.parentNode.replaceChild(w,t)}}function k(w){A=true;var u=C(w.id);if(u){if(w.altContentId){var y=C(w.altContentId);if(y){M=y;l=w.altContentId}}else{M=G(u)}if(!(/%$/.test(w.width))&&parseInt(w.width,10)<310){w.width="310"}if(!(/%$/.test(w.height))&&parseInt(w.height,10)<137){w.height="137"}K.title=K.title.slice(0,47)+" - Flash Player Installation";var z=h.ie&&h.win?"ActiveX":"PlugIn",q=K.title,r="MMredirectURL="+j.location+"&MMplayerType="+z+"&MMdoctitle="+q,x=w.id;if(h.ie&&h.win&&u.readyState!=4){var t=a("div");x+="SWFObjectNew";t.setAttribute("id",x);u.parentNode.insertBefore(t,u);u.style.display="none";var v=function(){u.parentNode.removeChild(u)};I(j,"onload",v)}U({data:w.expressInstall,id:m,width:w.width,height:w.height},{flashvars:r},x)}}function O(t){if(h.ie&&h.win&&t.readyState!=4){var r=a("div");t.parentNode.insertBefore(r,t);r.parentNode.replaceChild(G(t),r);t.style.display="none";var q=function(){t.parentNode.removeChild(t)};I(j,"onload",q)}else{t.parentNode.replaceChild(G(t),t)}}function G(v){var u=a("div");if(h.win&&h.ie){u.innerHTML=v.innerHTML}else{var r=v.getElementsByTagName(Q)[0];if(r){var w=r.childNodes;if(w){var q=w.length;for(var t=0;t<q;t++){if(!(w[t].nodeType==1&&w[t].nodeName=="PARAM")&&!(w[t].nodeType==8)){u.appendChild(w[t].cloneNode(true))}}}}}return u}function U(AG,AE,t){var q,v=C(t);if(v){if(typeof AG.id==b){AG.id=t}if(h.ie&&h.win){var AF="";for(var AB in AG){if(AG[AB]!=Object.prototype[AB]){if(AB.toLowerCase()=="data"){AE.movie=AG[AB]}else{if(AB.toLowerCase()=="styleclass"){AF+=' class="'+AG[AB]+'"'}else{if(AB.toLowerCase()!="classid"){AF+=" "+AB+'="'+AG[AB]+'"'}}}}}var AD="";for(var AA in AE){if(AE[AA]!=Object.prototype[AA]){AD+='<param name="'+AA+'" value="'+AE[AA]+'" />'}}v.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+AF+">"+AD+"</object>";i[i.length]=AG.id;q=C(AG.id)}else{if(h.webkit&&h.webkit<312){var AC=a("embed");AC.setAttribute("type",P);for(var z in AG){if(AG[z]!=Object.prototype[z]){if(z.toLowerCase()=="data"){AC.setAttribute("src",AG[z])}else{if(z.toLowerCase()=="styleclass"){AC.setAttribute("class",AG[z])}else{if(z.toLowerCase()!="classid"){AC.setAttribute(z,AG[z])}}}}}for(var y in AE){if(AE[y]!=Object.prototype[y]){if(y.toLowerCase()!="movie"){AC.setAttribute(y,AE[y])}}}v.parentNode.replaceChild(AC,v);q=AC}else{var u=a(Q);u.setAttribute("type",P);for(var x in AG){if(AG[x]!=Object.prototype[x]){if(x.toLowerCase()=="styleclass"){u.setAttribute("class",AG[x])}else{if(x.toLowerCase()!="classid"){u.setAttribute(x,AG[x])}}}}for(var w in AE){if(AE[w]!=Object.prototype[w]&&w.toLowerCase()!="movie"){F(u,w,AE[w])}}v.parentNode.replaceChild(u,v);q=u}}}return q}function F(t,q,r){var u=a("param");u.setAttribute("name",q);u.setAttribute("value",r);t.appendChild(u)}function X(r){var q=C(r);if(q&&(q.nodeName=="OBJECT"||q.nodeName=="EMBED")){if(h.ie&&h.win){if(q.readyState==4){B(r)}else{j.attachEvent("onload",function(){B(r)})}}else{q.parentNode.removeChild(q)}}}function B(t){var r=C(t);if(r){for(var q in r){if(typeof r[q]=="function"){r[q]=null}}r.parentNode.removeChild(r)}}function C(t){var q=null;try{q=K.getElementById(t)}catch(r){}return q}function a(q){return K.createElement(q)}function I(t,q,r){t.attachEvent(q,r);d[d.length]=[t,q,r]}function c(t){var r=h.pv,q=t.split(".");q[0]=parseInt(q[0],10);q[1]=parseInt(q[1],10)||0;q[2]=parseInt(q[2],10)||0;return(r[0]>q[0]||(r[0]==q[0]&&r[1]>q[1])||(r[0]==q[0]&&r[1]==q[1]&&r[2]>=q[2]))?true:false}function V(v,r){if(h.ie&&h.mac){return }var u=K.getElementsByTagName("head")[0],t=a("style");t.setAttribute("type","text/css");t.setAttribute("media","screen");if(!(h.ie&&h.win)&&typeof K.createTextNode!=b){t.appendChild(K.createTextNode(v+" {"+r+"}"))}u.appendChild(t);if(h.ie&&h.win&&typeof K.styleSheets!=b&&K.styleSheets.length>0){var q=K.styleSheets[K.styleSheets.length-1];if(typeof q.addRule==Q){q.addRule(v,r)}}}function W(t,q){var r=q?"visible":"hidden";if(e&&C(t)){C(t).style.visibility=r}else{V("#"+t,"visibility:"+r)}}function g(s){var r=/[\\\"<>\.;]/;var q=r.exec(s)!=null;return q?encodeURIComponent(s):s}var D=function(){if(h.ie&&h.win){window.attachEvent("onunload",function(){var w=d.length;for(var v=0;v<w;v++){d[v][0].detachEvent(d[v][1],d[v][2])}var t=i.length;for(var u=0;u<t;u++){X(i[u])}for(var r in h){h[r]=null}h=null;for(var q in swfobject){swfobject[q]=null}swfobject=null})}}();return{registerObject:function(u,q,t){if(!h.w3cdom||!u||!q){return }var r={};r.id=u;r.swfVersion=q;r.expressInstall=t?t:false;N[N.length]=r;W(u,false)},getObjectById:function(v){var q=null;if(h.w3cdom){var t=C(v);if(t){var u=t.getElementsByTagName(Q)[0];if(!u||(u&&typeof t.SetVariable!=b)){q=t}else{if(typeof u.SetVariable!=b){q=u}}}}return q},embedSWF:function(x,AE,AB,AD,q,w,r,z,AC){if(!h.w3cdom||!x||!AE||!AB||!AD||!q){return }AB+="";AD+="";if(c(q)){W(AE,false);var AA={};if(AC&&typeof AC===Q){for(var v in AC){if(AC[v]!=Object.prototype[v]){AA[v]=AC[v]}}}AA.data=x;AA.width=AB;AA.height=AD;var y={};if(z&&typeof z===Q){for(var u in z){if(z[u]!=Object.prototype[u]){y[u]=z[u]}}}if(r&&typeof r===Q){for(var t in r){if(r[t]!=Object.prototype[t]){if(typeof y.flashvars!=b){y.flashvars+="&"+t+"="+r[t]}else{y.flashvars=t+"="+r[t]}}}}f(function(){U(AA,y,AE);if(AA.id==AE){W(AE,true)}})}else{if(w&&!A&&c("6.0.65")&&(h.win||h.mac)){A=true;W(AE,false);f(function(){var AF={};AF.id=AF.altContentId=AE;AF.width=AB;AF.height=AD;AF.expressInstall=w;k(AF)})}}},getFlashPlayerVersion:function(){return{major:h.pv[0],minor:h.pv[1],release:h.pv[2]}},hasFlashPlayerVersion:c,createSWF:function(t,r,q){if(h.w3cdom){return U(t,r,q)}else{return undefined}},removeSWF:function(q){if(h.w3cdom){X(q)}},createCSS:function(r,q){if(h.w3cdom){V(r,q)}},addDomLoadEvent:f,addLoadEvent:R,getQueryParamValue:function(v){var u=K.location.search||K.location.hash;if(v==null){return g(u)}if(u){var t=u.substring(1).split("&");for(var r=0;r<t.length;r++){if(t[r].substring(0,t[r].indexOf("="))==v){return g(t[r].substring((t[r].indexOf("=")+1)))}}}return""},expressInstallCallback:function(){if(A&&M){var q=C(m);if(q){q.parentNode.replaceChild(M,q);if(l){W(l,true);if(h.ie&&h.win){M.style.display="block"}}M=null;l=null;A=false}}}}}();
/**
 * SWFObject v1.4.1: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){
if(!document.createElement||!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion(this.getAttribute("version"),_7);
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;
},getSWFHTML:function(){
var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}
_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(_23,_24){
var _25=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_25=new deconcept.PlayerVersion(x.description.replace(/([a-z]|[A-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
for(var i=3;axo!=null;i++){axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);_25=new deconcept.PlayerVersion([i,0,0]);}}
catch(e){}
if(_23&&_25.major>_23.major){return _25;}
if(!_23||((_23.minor!=0||_23.rev!=0)&&_25.major==_23.major)||_25.major!=6||_24){
try{_25=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}
catch(e){}}}return _25;};
deconcept.PlayerVersion=function(_29){
this.major=parseInt(_29[0])!=null?parseInt(_29[0]):0;
this.minor=parseInt(_29[1])||0;
this.rev=parseInt(_29[2])||0;};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){return false;}return true;};
deconcept.util={getRequestParameter:function(_2b){
var q=document.location.search||document.location.hash;
if(q){var _2d=q.indexOf(_2b+"=");
var _2e=(q.indexOf("&",_2d)>-1)?q.indexOf("&",_2d):q.length;
if(q.length>1&&_2d>-1){return q.substring(q.indexOf("=",_2d)+1,_2e);}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){
var _2f=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2f.length;i++){
for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=null;}}}};
if(typeof window.onunload=="function"){
var oldunload=window.onunload;
window.onunload=function(){deconcept.SWFObjectUtil.cleanupSWFs();oldunload();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}
if(Array.prototype.push==null){
Array.prototype.push=function(_32){
this[this.length]=_32;
return this.length;};}

var getQueryParamValue = deconcept.util.getRequestParameter;
var FlashObject = deconcept.SWFObject; // for backwards compatibility
var SWFObject = deconcept.SWFObject;


if(typeof dj=="undefined"){dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.flash=="undefined"){dj.widget.flash={};}
dj.widget.flash.Flash=Class.create({initialize:function(id,p,s,params){this.parent=$(id);if(typeof params=="undefined"){params={"noload":false};}
if(!params.noload){params.noload=false;}
this.config={};this.config.myMovie='/public/resources/documents/info-flash08-preloader.swf';this.p=p;this.s=s;this.getSettings=true;this.swfPrefix='info-';this.params=params;this.settingsObserver=new dj.util.Observer();if(p&&!params.noload){this.load(p,s);}},newId:function(){this.flid="flashdiv_"+Math.floor(Math.random()*999999);},loadsettings:function(p,s){this.p=p;this.s=s;if(!this.getSettings){this.swfsettings={};return;}
this.settingfile='/public/resources/documents/'+this.swfPrefix+p+'-settings.js';if(!this.swfsettings){this.swfsettings=null;var that=this;this.ajax=new Ajax.Request(this.settingfile,{method:'get',onSuccess:function(transport){that.raw_response=transport.responseText;if(that.raw_response){var json_start=that.raw_response.indexOf('{');var json_end=that.raw_response.lastIndexOf('}');if(json_start>-1){that.raw_response=that.raw_response.substring(json_start,json_end+1);}
that.raw_json=that.raw_response.evalJSON();that.finishsettings(transport);}}});}},finishsettings:function(){this.swfsettings=this.raw_json.swfsettings;this.swfpreloader=this.swfsettings.requiredSettings.preloader;this.swfwidth=this.swfsettings.requiredSettings.swfwidth;this.swfheight=this.swfsettings.requiredSettings.swfheight;this.settingsObserver.fire(this.p,this.s);},createwrapper:function(){this.newId();this.div=document.createElement('div');this.div.setAttribute('id',this.flid);this.parent.appendChild(this.div);},createflash:function(){if(this.so){return;}
if(this.swfpreloader){if(this.swfpreloader.substring(0,5)=="http:"){this.myMovie=this.swfpreloader;}else{this.myMovie='/public/resources/documents/'+this.swfpreloader+'?'+this.p;}}else{this.myMovie=this.config.myMovie+'?'+this.p;}
this.so=new SWFObject(this.myMovie,this.p,this.swfwidth,this.swfheight,"9.0.28","#FFFFFF");this.preload='info-'+this.p+'-preload.xml';this.so.addParam('allowScriptAccess','always');this.so.addParam("wmode","opaque");this.so.addParam('base','/public/resources/documents');this.so.addParam("menu","false");if(this.swfsettings&&this.swfsettings.optionalParameters){for(param in this.swfsettings.optionalParameters){this.so.addParam(param,this.swfsettings.optionalParameters[param]);}}
if(this.swfsettings&&this.swfsettings.optionalSettings){for(setting in this.swfsettings.optionalSettings){this.so.addVariable(setting,this.swfsettings.optionalSettings[setting]);}}
if(this.params&&this.params.flashVars){for(param in this.params.flashvars){this.so.addVariable(setting,this.params.flashvars[setting]);}}
this.so.addVariable("SlugName",this.p);this.so.addVariable("placement","tab");this.so.addVariable("PreloaderURL",this.preload);this.so.addVariable("MovieWidth",this.swfwidth);this.so.addVariable("MovieHeight",this.swfheight);this.so.addVariable("asub",dj.util.Cookie.getCookie("user_type"));this.so.addVariable("basePath",'/public/resources/documents');this.so.addVariable("cdnDomain",cdnDomain);this.so.addVariable("serverDomain",uP);this.so.addVariable("id",this.s);this.so.write(this.div);},load:function(p,s){var that=this;this.settingsObserver.subscribe(function(){that.create();});this.newId();this.loadsettings(p,s);if(this.swfsettings){this.create(p,s);}},create:function(p,s){this.createwrapper();this.createflash();this.settingsObserver.unsubscribe(this.create);}});dj.widget.flash.SlideshowFlash=Class.create(dj.widget.flash.Flash,{initialize:function($super,id,p,s,noload){$super(id,p,s,noload);this.config.myMovie='/public/resources/documents/info-slideshow08-preloader.swf';window.getContent=this.getContent;},getContent:function(){return null;}});
dj.module.globalHeader=function(){var cfg=new dj.util.Config(this);var DEFAULT_CONFIG={HEADER_CONTAINER_CLASS:{key:"headerContainerClass",value:".header"},TIMESTAMP_CLASS:{key:"timestamp",value:".date"},WSJ_LOGO_ID:{key:"wsjLogoId",value:"wsjLogo"},WSJ_LARGE_LOGO_CLASSNAME:{key:"wsjLargeLogoClassName",value:"logo_large"},WSJ_SMALL_LOGO_CLASSNAME:{key:"wsjSmallLogoClassName",value:"logo_small"},CURRENT_SUBSECTION_DISPLAY_CLASS:{key:"currentSubSectionDisplayClass",value:".currentSubSection"},GLOBALNAV_SUBSECTION_ELEMENT_ID:{key:"globalNavSubSectionElementId",value:"currentGlobalNavSubSection"},SUBSCRIBER_LOGIN_CLASS:{key:"subscriberLoginClass",value:".login"},HEADER_PROMO_CLASS:{key:"headerPromoClass",value:".promo"},SUBSCRIBER_DETAILS_ELEMENT_ID:{key:"subscriberDetailsElementId",value:"subscribedUserDetailsId"},COMMUNITY_FORUMS_LINK_CLASS:{key:"communityForumsLinkClass",value:".communityForumsLink"},TODAYS_PAPER_LINK_CLASS:{key:"todaysPaperLinkClass",value:".todaysPaperLink"},MOJ_LINK_CLASS:{key:"mojLinkClass",value:".myOnlineJournalLink"},MESSAGE_CENTER_LINK_CLASS:{key:"messageCenterLink",value:".messageCenterLink"},MESSAGE_COUNT_CLASS:{key:"messageCountClass",value:".messageCount"},LOGIN_USERNAME_ELEMENT_ID:{key:"loginUserElementId",value:"login_username"},LOGIN_PASSWORD_ELEMENT_ID:{key:"loginPasswordElementId",value:"login_password"},LOGIN_FORM_ID:{key:"loginFormId",value:"login_form"},PAGE_URL_ELEMENT_ID:{key:"pageUrlElementId",value:"page_url"},LOGOUT_LINK_ELEMENT_ID:{key:"logoutLinkElementId",value:"logoutLink"},LOGIN_BUTTON_ELEMENT_ID:{key:"loginButtonImageId",value:"login_button"},USER_NAME_ELEMENT_ID:{key:"userNameElementId",value:"userName"},WSJ_LOGO_FADE_APPEAR_DURATION:{key:"wsjLogoFadeAppearDuration",value:"1.0"},WSJ_LOGO_DELAY_DURATION:{key:"wsjLogoDelayDuration",value:"2000"},LOGGED_IN_COMMUNITY_URL:{key:"loggedInCommunityUrl",value:"/community"},LOGGED_IN_TODAYS_PAPER_URL:{key:"loggedInTodaysPaperUrl",value:"/page/us_in_todays_paper.html"},MESSAGE_CENTER_POST_URL:{key:"messageCenterPostUrl",value:"/community/integration/messagescount.html"},LOGOUT_URL:{key:"logoutUrl",value:"/static_html_files/logout_confirmation.htm"},SUBSCRIBER_HOMEPAGE_PID:{key:"subscriberHomepagePid",value:"0_0_WH_0001"},NONSUBSCRIBER_HOMEPAGE_PID:{key:"nonSubscriberHomepagePid",value:"0_0_WH_0001_public"},ASIA_PAGE_PID:{key:"asiaPagePid",value:"0_0_WP_2103"},EUROPE_PAGE_PID:{key:"europePagePid",value:"0_0_WP_2104"},NONSUBSCRIBER_NEWSLETTERS_ALERTS_PAGE_PID:{key:"nonSubNewslettersAlertsPagePid",value:"5_6007"},NONSUBSCRIBER_SEARCH_PAGE_PID:{key:"nonSubscriberSearchPagePid",value:"3_0466"},HOMEPAGE_SUBSCRIBER_URL:{key:"homePageSubscriberUrl",value:"/"},SEARCH_PAGE_SUBSCRIBER_URL:{key:"searchPageSubscriberUrl",value:"/search"},TODAYS_PAPER_LINK_CONTAINER_CLASS:{key:"todaysPaperLinkContainerClass",value:".todaysPaperLinkContainer"},VIDEO_LINK_CONTAINER_CLASS:{key:"videoLinkClass",value:".videoLinkContainer"},COLUMNS_LINK_CONTAINER_CLASS:{key:"columnsLinkClass",value:".columnsLinkContainer"},BLOGS_LINK_CONTAINER_CLASS:{key:"blogsLinkClass",value:".blogsLinkContainer"},INTERACTIVE_GRAPHICS_LINK_CONTAINER_CLASS:{key:"interactiveGraphicsLinkContainerClass",value:".interactiveGraphicsLinkContainer"},TOPICS_LINK_CONTAINER_CLASS:{key:"topicsLinkClass",value:".topicsLinkContainer"},COMMUNITY_FORUMS_LINK_CONTAINER_CLASS:{key:"communityForumsLinkContainerClass",value:".communityForumsLinkContainer"},TODAYS_PAPER_US_NONSUB_PID:{key:"todaysPaperUsNonSubPid",value:"2_0433"},TODAYS_PAPER_EUROPE_NONSUB_PID:{key:"todaysPaperEuropeNonSubPid",value:"2_0434"},TODAYS_PAPER_ASIA_NONSUB_PID:{key:"todaysPaperAsiaNonSubPid",value:"2_0435"},TODAYS_PAPER_US_PID:{key:"todaysPaperUsPid",value:"2_0133"},TODAYS_PAPER_EUROPE_PID:{key:"todaysPaperEuropePid",value:"2_0134"},TODAYS_PAPER_ASIA_PID:{key:"todaysPaperAsiaPid",value:"2_0135"},TODAYS_PAPER_PAST_EDITIONS_PID:{key:"todaysPaperPastEditionsPid",value:"2_0233"},TODAYS_PAPER_INDEX_BIZ_PID:{key:"todaysPaperIndexBizPid",value:"2_0156"},TODAYS_PAPER_INDEX_PEOPLE_PID:{key:"todaysPaperIndexPeoplePid",value:"2_0155"},TODAYS_PAPER_CORRECTIONS_PID:{key:"todaysPaperCorrectionsPid",value:"Corrections"},VIDEO_PID:{key:"videoPid",value:"0_0_WP_3000"},BLOGS_PID:{key:"blogsPid",value:"8_0019"},COLUMNS_PID:{key:"columnsPid",value:"2_0140"},INTERACTIVE_GRAPHICS_PID:{key:"interactiveGraphicsPid",value:"0_0_WP_2003"},TOPICS_PID:{key:"topicsIndexPid",value:"0_0_WT_0001"},NEWSLETTERS_ALERTS_SUB_PID:{key:"newslettersAlertsSubPid",value:"5_6001"},NEWSLETTERS_ALERTS_PUB_PID:{key:"newslettersAlertsSubPid",value:"5_6003"},MOJ_LINK_URL:{key:"mojLinkUrl",value:"/page/my-journal-main.html"},MDC_LINK_URL:{key:"mdcLinkUrl",value:"/mdc/page/marketsdata.html"},MDC_PAGE_PID:{key:"mdcPagePid",value:"2_3000"},COMMUNITY_HIGHLIGHT_COMPARE_URL:{key:"communityHighlightCompareUrl",value:"/community"},FORUMS_HIGHLIGHT_COMPARE_URL:{key:"forumnsHighlightCompareUrl",value:"forums.wsj.com"},FREE_REG_CLASS:{key:"freeregClass",value:".freereg"},LOCATION_NAV_CLASS:{key:"locationNavClass",value:".location_nav"},LOCATION_NAV_COLLAPSED_CLASSNAME:{key:"locDrpdwnCollapsedClassName",value:"location_collapsed"},LOCATION_NAV_EXPANDED_CLASSNAME:{key:"locDrpdwnExpandedClassName",value:"location_expanded"},US_EDITION_LINK_CLASS:{key:"usEditionLinkClass",value:".map_us"},EU_EDITION_LINK_CLASS:{key:"euEditionLinkClass",value:".map_europe"},ASIA_EDITION_LINK_CLASS:{key:"asiaEditionLinkClass",value:".map_asia"},IN_EDITION_LINK_CLASS:{key:"inEditionLinkClass",value:".map_india"},LOGGED_IN_TODAYS_PAPER_URL_ASIA:{key:"loggedInTodaysPaperUrlAsia",value:"/page/asia_in_todays_paper.html"},LOGGED_IN_TODAYS_PAPER_URL_EUROPE:{key:"loggedInTodaysPaperUrlEurope",value:"/page/europe_in_todays_paper.html"},US_EDITION_MDC_URL:{key:"usEditionMDCUrl",value:"/marketsdata"},EU_EDITION_MDC_URL:{key:"euEditionMDCUrl",value:"/mdc/public/page/marketsdata_europe.html"},ASIA_EDITION_MDC_URL:{key:"asiaEditionMDCUrl",value:"/mdc/public/page/marketsdata_asia.html"},IN_EDITION_MDC_URL:{key:"inEditionMDCUrl",value:"/mdc/public/page/marketsdata_asia.html"},MDC_COMPARE_URL:{key:"mdcCompareUrl",value:"/mdc/"},FOOTER_CONTAINER_CLASS:{key:"footerContainerClass",value:".pagefooter"}};var setupConfig=function(config){var defCfg=DEFAULT_CONFIG;cfg.addProperty(defCfg.HEADER_CONTAINER_CLASS.key,{value:defCfg.HEADER_CONTAINER_CLASS.value});cfg.addProperty(defCfg.TIMESTAMP_CLASS.key,{value:defCfg.TIMESTAMP_CLASS.value});cfg.addProperty(defCfg.WSJ_LOGO_ID.key,{value:defCfg.WSJ_LOGO_ID.value});cfg.addProperty(defCfg.WSJ_LARGE_LOGO_CLASSNAME.key,{value:defCfg.WSJ_LARGE_LOGO_CLASSNAME.value});cfg.addProperty(defCfg.WSJ_SMALL_LOGO_CLASSNAME.key,{value:defCfg.WSJ_SMALL_LOGO_CLASSNAME.value});cfg.addProperty(defCfg.CURRENT_SUBSECTION_DISPLAY_CLASS.key,{value:defCfg.CURRENT_SUBSECTION_DISPLAY_CLASS.value});cfg.addProperty(defCfg.GLOBALNAV_SUBSECTION_ELEMENT_ID.key,{value:defCfg.GLOBALNAV_SUBSECTION_ELEMENT_ID.value});cfg.addProperty(defCfg.SUBSCRIBER_LOGIN_CLASS.key,{value:defCfg.SUBSCRIBER_LOGIN_CLASS.value});cfg.addProperty(defCfg.HEADER_PROMO_CLASS.key,{value:defCfg.HEADER_PROMO_CLASS.value});cfg.addProperty(defCfg.SUBSCRIBER_DETAILS_ELEMENT_ID.key,{value:defCfg.SUBSCRIBER_DETAILS_ELEMENT_ID.value});cfg.addProperty(defCfg.COMMUNITY_FORUMS_LINK_CLASS.key,{value:defCfg.COMMUNITY_FORUMS_LINK_CLASS.value});cfg.addProperty(defCfg.TODAYS_PAPER_LINK_CLASS.key,{value:defCfg.TODAYS_PAPER_LINK_CLASS.value});cfg.addProperty(defCfg.MOJ_LINK_CLASS.key,{value:defCfg.MOJ_LINK_CLASS.value});cfg.addProperty(defCfg.MESSAGE_CENTER_LINK_CLASS.key,{value:defCfg.MESSAGE_CENTER_LINK_CLASS.value});cfg.addProperty(defCfg.MESSAGE_COUNT_CLASS.key,{value:defCfg.MESSAGE_COUNT_CLASS.value});cfg.addProperty(defCfg.LOGIN_USERNAME_ELEMENT_ID.key,{value:defCfg.LOGIN_USERNAME_ELEMENT_ID.value});cfg.addProperty(defCfg.LOGIN_PASSWORD_ELEMENT_ID.key,{value:defCfg.LOGIN_PASSWORD_ELEMENT_ID.value});cfg.addProperty(defCfg.LOGIN_BUTTON_ELEMENT_ID.key,{value:defCfg.LOGIN_BUTTON_ELEMENT_ID.value});cfg.addProperty(defCfg.PAGE_URL_ELEMENT_ID.key,{value:defCfg.PAGE_URL_ELEMENT_ID.value});cfg.addProperty(defCfg.LOGOUT_LINK_ELEMENT_ID.key,{value:defCfg.LOGOUT_LINK_ELEMENT_ID.value});cfg.addProperty(defCfg.USER_NAME_ELEMENT_ID.key,{value:defCfg.USER_NAME_ELEMENT_ID.value});cfg.addProperty(defCfg.WSJ_LOGO_FADE_APPEAR_DURATION.key,{value:defCfg.WSJ_LOGO_FADE_APPEAR_DURATION.value});cfg.addProperty(defCfg.WSJ_LOGO_DELAY_DURATION.key,{value:defCfg.WSJ_LOGO_DELAY_DURATION.value});cfg.addProperty(defCfg.LOGGED_IN_COMMUNITY_URL.key,{value:defCfg.LOGGED_IN_COMMUNITY_URL.value});cfg.addProperty(defCfg.LOGGED_IN_TODAYS_PAPER_URL.key,{value:defCfg.LOGGED_IN_TODAYS_PAPER_URL.value});cfg.addProperty(defCfg.MESSAGE_CENTER_POST_URL.key,{value:defCfg.MESSAGE_CENTER_POST_URL.value});cfg.addProperty(defCfg.LOGOUT_URL.key,{value:defCfg.LOGOUT_URL.value});cfg.addProperty(defCfg.HOMEPAGE_SUBSCRIBER_URL.key,{value:defCfg.HOMEPAGE_SUBSCRIBER_URL.value});cfg.addProperty(defCfg.SEARCH_PAGE_SUBSCRIBER_URL.key,{value:defCfg.SEARCH_PAGE_SUBSCRIBER_URL.value});cfg.addProperty(defCfg.NONSUBSCRIBER_HOMEPAGE_PID.key,{value:defCfg.NONSUBSCRIBER_HOMEPAGE_PID.value});cfg.addProperty(defCfg.NONSUBSCRIBER_NEWSLETTERS_ALERTS_PAGE_PID.key,{value:defCfg.NONSUBSCRIBER_NEWSLETTERS_ALERTS_PAGE_PID.value});cfg.addProperty(defCfg.NONSUBSCRIBER_SEARCH_PAGE_PID.key,{value:defCfg.NONSUBSCRIBER_SEARCH_PAGE_PID.value});cfg.addProperty(defCfg.SUBSCRIBER_HOMEPAGE_PID.key,{value:defCfg.SUBSCRIBER_HOMEPAGE_PID.value});cfg.addProperty(defCfg.EUROPE_PAGE_PID.key,{value:defCfg.EUROPE_PAGE_PID.value});cfg.addProperty(defCfg.ASIA_PAGE_PID.key,{value:defCfg.ASIA_PAGE_PID.value});cfg.addProperty(defCfg.MOJ_LINK_URL.key,{value:defCfg.MOJ_LINK_URL.value});cfg.addProperty(defCfg.TODAYS_PAPER_LINK_CONTAINER_CLASS.key,{value:defCfg.TODAYS_PAPER_LINK_CONTAINER_CLASS.value});cfg.addProperty(defCfg.VIDEO_LINK_CONTAINER_CLASS.key,{value:defCfg.VIDEO_LINK_CONTAINER_CLASS.value});cfg.addProperty(defCfg.BLOGS_LINK_CONTAINER_CLASS.key,{value:defCfg.BLOGS_LINK_CONTAINER_CLASS.value});cfg.addProperty(defCfg.COLUMNS_LINK_CONTAINER_CLASS.key,{value:defCfg.COLUMNS_LINK_CONTAINER_CLASS.value});cfg.addProperty(defCfg.INTERACTIVE_GRAPHICS_LINK_CONTAINER_CLASS.key,{value:defCfg.INTERACTIVE_GRAPHICS_LINK_CONTAINER_CLASS.value});cfg.addProperty(defCfg.TOPICS_LINK_CONTAINER_CLASS.key,{value:defCfg.TOPICS_LINK_CONTAINER_CLASS.value});cfg.addProperty(defCfg.COMMUNITY_FORUMS_LINK_CONTAINER_CLASS.key,{value:defCfg.COMMUNITY_FORUMS_LINK_CONTAINER_CLASS.value});cfg.addProperty(defCfg.TODAYS_PAPER_US_NONSUB_PID.key,{value:defCfg.TODAYS_PAPER_US_NONSUB_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_EUROPE_NONSUB_PID.key,{value:defCfg.TODAYS_PAPER_EUROPE_NONSUB_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_ASIA_NONSUB_PID.key,{value:defCfg.TODAYS_PAPER_ASIA_NONSUB_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_US_PID.key,{value:defCfg.TODAYS_PAPER_US_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_EUROPE_PID.key,{value:defCfg.TODAYS_PAPER_EUROPE_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_ASIA_PID.key,{value:defCfg.TODAYS_PAPER_ASIA_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_PAST_EDITIONS_PID.key,{value:defCfg.TODAYS_PAPER_PAST_EDITIONS_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_INDEX_BIZ_PID.key,{value:defCfg.TODAYS_PAPER_INDEX_BIZ_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_INDEX_PEOPLE_PID.key,{value:defCfg.TODAYS_PAPER_INDEX_PEOPLE_PID.value});cfg.addProperty(defCfg.TODAYS_PAPER_CORRECTIONS_PID.key,{value:defCfg.TODAYS_PAPER_CORRECTIONS_PID.value});cfg.addProperty(defCfg.VIDEO_PID.key,{value:defCfg.VIDEO_PID.value});cfg.addProperty(defCfg.COLUMNS_PID.key,{value:defCfg.COLUMNS_PID.value});cfg.addProperty(defCfg.BLOGS_PID.key,{value:defCfg.BLOGS_PID.value});cfg.addProperty(defCfg.INTERACTIVE_GRAPHICS_PID.key,{value:defCfg.INTERACTIVE_GRAPHICS_PID.value});cfg.addProperty(defCfg.TOPICS_PID.key,{value:defCfg.TOPICS_PID.value});cfg.addProperty(defCfg.NEWSLETTERS_ALERTS_SUB_PID.key,{value:defCfg.NEWSLETTERS_ALERTS_SUB_PID.value});cfg.addProperty(defCfg.NEWSLETTERS_ALERTS_PUB_PID.key,{value:defCfg.NEWSLETTERS_ALERTS_PUB_PID.value});cfg.addProperty(defCfg.LOGIN_FORM_ID.key,{value:defCfg.LOGIN_FORM_ID.value});cfg.addProperty(defCfg.MDC_LINK_URL.key,{value:defCfg.MDC_LINK_URL.value});cfg.addProperty(defCfg.MDC_PAGE_PID.key,{value:defCfg.MDC_PAGE_PID.value});cfg.addProperty(defCfg.COMMUNITY_HIGHLIGHT_COMPARE_URL.key,{value:defCfg.COMMUNITY_HIGHLIGHT_COMPARE_URL.value});cfg.addProperty(defCfg.FORUMS_HIGHLIGHT_COMPARE_URL.key,{value:defCfg.FORUMS_HIGHLIGHT_COMPARE_URL.value});cfg.addProperty(defCfg.FREE_REG_CLASS.key,{value:defCfg.FREE_REG_CLASS.value});cfg.addProperty(defCfg.LOCATION_NAV_CLASS.key,{value:defCfg.LOCATION_NAV_CLASS.value});cfg.addProperty(defCfg.LOCATION_NAV_COLLAPSED_CLASSNAME.key,{value:defCfg.LOCATION_NAV_COLLAPSED_CLASSNAME.value});cfg.addProperty(defCfg.LOCATION_NAV_EXPANDED_CLASSNAME.key,{value:defCfg.LOCATION_NAV_EXPANDED_CLASSNAME.value});cfg.addProperty(defCfg.US_EDITION_LINK_CLASS.key,{value:defCfg.US_EDITION_LINK_CLASS.value});cfg.addProperty(defCfg.EU_EDITION_LINK_CLASS.key,{value:defCfg.EU_EDITION_LINK_CLASS.value});cfg.addProperty(defCfg.ASIA_EDITION_LINK_CLASS.key,{value:defCfg.ASIA_EDITION_LINK_CLASS.value});cfg.addProperty(defCfg.IN_EDITION_LINK_CLASS.key,{value:defCfg.IN_EDITION_LINK_CLASS.value});cfg.addProperty(defCfg.LOGGED_IN_TODAYS_PAPER_URL_ASIA.key,{value:defCfg.LOGGED_IN_TODAYS_PAPER_URL_ASIA.value});cfg.addProperty(defCfg.LOGGED_IN_TODAYS_PAPER_URL_EUROPE.key,{value:defCfg.LOGGED_IN_TODAYS_PAPER_URL_EUROPE.value});cfg.addProperty(defCfg.US_EDITION_MDC_URL.key,{value:defCfg.US_EDITION_MDC_URL.value});cfg.addProperty(defCfg.EU_EDITION_MDC_URL.key,{value:defCfg.EU_EDITION_MDC_URL.value});cfg.addProperty(defCfg.ASIA_EDITION_MDC_URL.key,{value:defCfg.ASIA_EDITION_MDC_URL.value});cfg.addProperty(defCfg.IN_EDITION_MDC_URL.key,{value:defCfg.IN_EDITION_MDC_URL.value});cfg.addProperty(defCfg.MDC_COMPARE_URL.key,{value:defCfg.MDC_COMPARE_URL.value});cfg.addProperty(defCfg.FOOTER_CONTAINER_CLASS.key,{value:defCfg.FOOTER_CONTAINER_CLASS.value});if(config){cfg.applyConfig(config,true);}
cfg.fireQueue();};return{initialize:function(config){setupConfig(config);var headerContainerClass=cfg.getProperty(DEFAULT_CONFIG.HEADER_CONTAINER_CLASS.key);this.oHeader=$(document.body).down(headerContainerClass);this.editionDropdownSetUp();this.displaySubSection();this.displayTimeStamp();var that=this;this.currRegion=dj.util.Region.getViewByRegion();this.concatURL='';if((typeof gcDomain!=='undefined')&&(gcDomain!==null)&&(gcDomain!=="")){this.concatURL="http://"+gcDomain;}else{this.concatURL="http://"+document.domain;}
dj.util.User.isLoggedIn(function(isLoggedIn){if(isLoggedIn){that.displaySubscriberDetails();that.setupLogout();}else{that.setupLogin();var freeregClass=cfg.getProperty(DEFAULT_CONFIG.FREE_REG_CLASS.key);that.ofreereg=that.oHeader.down(freeregClass);that.ofreereg.setStyle({display:"block"});var subscriberLoginClass=cfg.getProperty(DEFAULT_CONFIG.SUBSCRIBER_LOGIN_CLASS.key);that.oSubscriberLogin=that.oHeader.down(subscriberLoginClass);that.oSubscriberLogin.setStyle({display:"block"});var headerPromoClass=cfg.getProperty(DEFAULT_CONFIG.HEADER_PROMO_CLASS.key);that.oHeaderPromo=that.oHeader.down(headerPromoClass);that.oHeaderPromo.setStyle({display:"block"});}});this.highlightFormFactorLinks();var todaysPaperLinkClass=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_LINK_CLASS.key);this.oTodaysPaperLink=this.oHeader.down(todaysPaperLinkClass);var loggedInTodaysPaperUrl=cfg.getProperty(DEFAULT_CONFIG.LOGGED_IN_TODAYS_PAPER_URL.key);var loggedInTodaysPaperUrlAsia=cfg.getProperty(DEFAULT_CONFIG.LOGGED_IN_TODAYS_PAPER_URL_ASIA.key);var loggedInTodaysPaperUrlEurope=cfg.getProperty(DEFAULT_CONFIG.LOGGED_IN_TODAYS_PAPER_URL_EUROPE.key);var currEdition="";if(this.currRegion=="asia"||this.currRegion=="asia,india"){loggedInTodaysPaperUrl=loggedInTodaysPaperUrlAsia;}else if(this.currRegion=="europe"){loggedInTodaysPaperUrl=loggedInTodaysPaperUrlEurope;}
if((typeof gcDomain!=='undefined')&&(gcDomain!==null)&&(gcDomain!=="")){this.oTodaysPaperLink.href="http://"+gcDomain+loggedInTodaysPaperUrl;}else{this.oTodaysPaperLink.href=loggedInTodaysPaperUrl;}
var that=this;dj.util.User.isSubLoggedIn(function(subLoggedIn){if(!subLoggedIn){if((typeof gcDomain!=='undefined')&&(gcDomain!==null)&&(gcDomain!=="")){that.oTodaysPaperLink.href="http://"+gcDomain+"/public"+loggedInTodaysPaperUrl;}else{that.oTodaysPaperLink.href="/public"+loggedInTodaysPaperUrl;}}});},editionDropdownSetUp:function(){var locationNavClass=cfg.getProperty(DEFAULT_CONFIG.LOCATION_NAV_CLASS.key);this.oLocationNav=this.oHeader.down(locationNavClass);var selLocDrpdwnCollapsedClassName=cfg.getProperty(DEFAULT_CONFIG.LOCATION_NAV_COLLAPSED_CLASSNAME.key);var selLocDrpdwnExpandedClassName=cfg.getProperty(DEFAULT_CONFIG.LOCATION_NAV_EXPANDED_CLASSNAME.key);var usEditionLinkClassName=cfg.getProperty(DEFAULT_CONFIG.US_EDITION_LINK_CLASS.key);var euEditionLinkClassName=cfg.getProperty(DEFAULT_CONFIG.EU_EDITION_LINK_CLASS.key);var inEditionLinkClassName=cfg.getProperty(DEFAULT_CONFIG.IN_EDITION_LINK_CLASS.key);var asiaEditionLinkClassName=cfg.getProperty(DEFAULT_CONFIG.ASIA_EDITION_LINK_CLASS.key);this.usEditionMDCUrl=cfg.getProperty(DEFAULT_CONFIG.US_EDITION_MDC_URL.key);this.euEditionMDCUrl=cfg.getProperty(DEFAULT_CONFIG.EU_EDITION_MDC_URL.key);this.inEditionMDCUrl=cfg.getProperty(DEFAULT_CONFIG.IN_EDITION_MDC_URL.key);this.asiaEditionMDCUrl=cfg.getProperty(DEFAULT_CONFIG.ASIA_EDITION_MDC_URL.key);var mdcCompareUrl=cfg.getProperty(DEFAULT_CONFIG.MDC_COMPARE_URL.key);this.oCurrentEdition=$("currentEdition");this.oUsEdition=$("usEdition");this.oEuEdition=$("europeEdition");this.oInEdition=$("indiaEdition");this.oAsiaEdition=$("asiaEdition");this.oChiEdition=$("chiEdition");this.oSpaEdition=$("spaEdition");this.oPorEdition=$("porEdition");this.osectionFooterSub=$("hrefNonSubId");this.osectionFooterNonSub=$("hrefSubId");this.oUsEditionFooter=$("usEditionFooter");this.currRegion=dj.util.Region.getViewByRegion();var currEdition="";if((typeof gcDomain!=='undefined')&&(gcDomain!==null)&&(gcDomain!=="")){this.tempConcatURL="http://"+gcDomain;}else{this.tempConcatURL="http://"+document.domain;}
this.isMDCPageFlag=((document.location.href!==null)&&(document.location.href!=="")&&(document.location.href.indexOf(mdcCompareUrl)!==-1));var that=this;if(this.oUsEdition!==null){this.oUsEdition.observe("click",function(ev){Event.stop(ev);dj.util.Region.setViewByRegion('na,us');dj.util.Cookie.setGroupCookie("DJCOOKIE","HOMEPAGE","/home-page",365);window.location=(that.isMDCPageFlag)?that.tempConcatURL+that.usEditionMDCUrl:that.oUsEdition.href;}.bindAsEventListener(this.oUsEdition));}
if(this.oUsEditionFooter!==null){this.oUsEditionFooter.observe("click",function(ev){Event.stop(ev);dj.util.Region.setViewByRegion('na,us');dj.util.Cookie.setGroupCookie("DJCOOKIE","HOMEPAGE","/home-page",365);window.location=(that.isMDCPageFlag)?that.tempConcatURL+that.usEditionMDCUrl:that.oUsEditionFooter.href;}.bindAsEventListener(this.oUsEditionFooter));}
if(this.oEuEdition!==null){this.oEuEdition.observe("click",function(ev){Event.stop(ev);window.location=(that.isMDCPageFlag)?that.tempConcatURL+that.euEditionMDCUrl:that.oEuEdition.href;if(that.isMDCPageFlag){dj.util.Region.setViewByRegion('europe');dj.util.Cookie.setGroupCookie("DJCOOKIE","HOMEPAGE","/home/europe",365);}}.bindAsEventListener(this.oEuEdition));}
if(this.oInEdition!==null){this.oInEdition.observe("click",function(ev){Event.stop(ev);window.location=(that.isMDCPageFlag)?that.tempConcatURL+that.inEditionMDCUrl:that.oInEdition.href;if(that.isMDCPageFlag){dj.util.Region.setViewByRegion('asia,india');dj.util.Cookie.setGroupCookie("DJCOOKIE","HOMEPAGE","/home/india",365);}}.bindAsEventListener(this.oInEdition));}
if(this.oAsiaEdition!==null){this.oAsiaEdition.observe("click",function(ev){Event.stop(ev);window.location=(that.isMDCPageFlag)?that.tempConcatURL+that.asiaEditionMDCUrl:that.oAsiaEdition.href;if(that.isMDCPageFlag){dj.util.Region.setViewByRegion('asia');dj.util.Cookie.setGroupCookie("DJCOOKIE","HOMEPAGE","/home/asia",365);}}.bindAsEventListener(this.oAsiaEdition));}
if(this.oChiEdition!==null){this.oChiEdition.observe("click",function(ev){Event.stop(ev);window.open(that.oChiEdition.href);}.bindAsEventListener(this.oChiEdition));}
if(this.oSpaEdition!==null){this.oSpaEdition.observe("click",function(ev){Event.stop(ev);window.location=that.oSpaEdition.href;}.bindAsEventListener(this.oSpaEdition));}
if(this.oPorEdition!==null){this.oPorEdition.observe("click",function(ev){Event.stop(ev);window.location=that.oPorEdition.href;}.bindAsEventListener(this.oPorEdition));}
if(this.osectionFooterSub!==null){this.osectionFooterSub.observe("click",function(ev){Event.stop(ev);window.location=that.osectionFooterSub.href;}.bindAsEventListener(this.osectionFooterSub));}
if(this.osectionFooterNonSub!==null){this.osectionFooterNonSub.observe("click",function(ev){Event.stop(ev);window.location=that.osectionFooterNonSub.href;}.bindAsEventListener(this.osectionFooterNonSub));}
if(this.currRegion=="asia"){currEdition="Asia Edition";this.oSelectedEdition=this.oHeader.down(asiaEditionLinkClassName);}
else
if(this.currRegion=="asia,india"){currEdition="Asia Edition";this.oSelectedEdition=this.oHeader.down(inEditionLinkClassName);}
else
if(this.currRegion=="europe"){currEdition="Europe Edition";this.oSelectedEdition=this.oHeader.down(euEditionLinkClassName);}
else{currEdition="U.S. Edition";this.oSelectedEdition=this.oHeader.down(usEditionLinkClassName);}
this.oSelectedEdition.addClassName("selected");this.oCurrentEdition.innerHTML=currEdition;this.oFormFactorContainer=$("formFactorContainer");this.oFormFactorContainer.show();this.oLocDropDownContainer=$("locNavContainer");this.oLocDropDownContainer.show();if(this.oLocDropDownContainer!==null){var toggleDropdownClass=function(){if(that.oLocDropDownContainer.hasClassName(selLocDrpdwnCollapsedClassName)){that.oLocDropDownContainer.removeClassName(selLocDrpdwnCollapsedClassName);that.oLocDropDownContainer.addClassName(selLocDrpdwnExpandedClassName);}
else if(that.oLocDropDownContainer.hasClassName(selLocDrpdwnExpandedClassName)){that.oLocDropDownContainer.removeClassName(selLocDrpdwnExpandedClassName);that.oLocDropDownContainer.addClassName(selLocDrpdwnCollapsedClassName);}};this.oLocationNav.observe("click",function(event){Event.stop(event);toggleDropdownClass();}.bindAsEventListener(this.oLocationNav));document.observe("click",function(event){var isMousePointerinModalContainer=dj.util.Element.contains(that.oLocDropDownContainer,event.clientX,event.clientY);if(isMousePointerinModalContainer==false){if(that.oLocDropDownContainer.hasClassName(selLocDrpdwnExpandedClassName)){that.oLocDropDownContainer.removeClassName(selLocDrpdwnExpandedClassName);that.oLocDropDownContainer.addClassName(selLocDrpdwnCollapsedClassName);}}});this.oSectionFooterNonSub=$("sectionFooterNonSub");this.oSectionFooterSub=$("sectionFooterSub");dj.util.User.isLoggedIn(function(isLoggedIn){if(isLoggedIn){that.oSectionFooterNonSub.hide();that.oSectionFooterSub.show();}
else{that.oSectionFooterNonSub.show();that.oSectionFooterSub.hide();}});}},displayTimeStamp:function(){var timestampClass=cfg.getProperty(DEFAULT_CONFIG.TIMESTAMP_CLASS.key);this.oTimestamp=this.oHeader.down(timestampClass);if((typeof pDate!=='undefined')&&(this.oTimestamp!==null)){if(window.pStl=="renovation"){var dateUtil=dj.util.Date;var pubDate=dateUtil.displayTime(pDate,pDateinGMT);this.oTimestamp.update(pubDate);}
else{this.oTimestamp.update(pDate);}}},displaySubSection:function(){var currentSubSectionClass=cfg.getProperty(DEFAULT_CONFIG.CURRENT_SUBSECTION_DISPLAY_CLASS.key);this.oCurrentSubSection=this.oHeader.down(currentSubSectionClass);var wsjLogoFadeAppearDuration=cfg.getProperty(DEFAULT_CONFIG.WSJ_LOGO_FADE_APPEAR_DURATION.key);var wsjLogoDelayDuration=cfg.getProperty(DEFAULT_CONFIG.WSJ_LOGO_DELAY_DURATION.key);if((typeof globalHeaderPageTitle!=='undefined')&&(globalHeaderPageTitle!==null)&&(globalHeaderPageTitle!=="")){this.oCurrentSubSection.innerHTML=globalHeaderPageTitle;var that=this;setTimeout(function(){that.oCurrentSubSection.appear({duration:wsjLogoFadeAppearDuration});},wsjLogoDelayDuration);}},displaySubscriberDetails:function(){var userNameElementId=cfg.getProperty(DEFAULT_CONFIG.USER_NAME_ELEMENT_ID.key);dj.util.User.renderCallsign(userNameElementId);this.setupSubscriberLinks();var messageCenterLinkClass=cfg.getProperty(DEFAULT_CONFIG.MESSAGE_CENTER_LINK_CLASS.key);this.oMessageCenterLink=this.oHeader.down(messageCenterLinkClass);var that=this;dj.util.User.isSubLoggedIn(function(subLoggedIn){if(subLoggedIn){that.setupMessageCenter();}
else{that.setUpMJLinksForReg();that.oMessageCenterLink.hide();}});var subscriberDetailsElementId=cfg.getProperty(DEFAULT_CONFIG.SUBSCRIBER_DETAILS_ELEMENT_ID.key);this.oSubscriberDetails=$(subscriberDetailsElementId);this.oSubscriberDetails.removeClassName("hidden");},setUpMJLinksForReg:function(){var that=this;var footerContainerClass=cfg.getProperty(DEFAULT_CONFIG.FOOTER_CONTAINER_CLASS.key);that.oFooter=$(document.body).down(footerContainerClass);var mojLinkUrl=cfg.getProperty(DEFAULT_CONFIG.MOJ_LINK_URL.key);var mojLinkClass=cfg.getProperty(DEFAULT_CONFIG.MOJ_LINK_CLASS.key);that.oMojLinkHeader=that.oHeader.down(mojLinkClass);that.oMojLinkFooter=that.oFooter.down(mojLinkClass);if((typeof gcDomain!=='undefined')&&(gcDomain!==null)&&(gcDomain!=="")){that.oMojLinkHeader.href="http://"+gcDomain+mojLinkUrl;that.oMojLinkFooter.href="http://"+gcDomain+mojLinkUrl;}else{that.oMojLinkHeader.href=mojLinkUrl;that.oMojLinkFooter.href=mojLinkUrl;}},setupSubscriberLinks:function(){var todaysPaperLinkClass=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_LINK_CLASS.key);this.oTodaysPaperLink=this.oHeader.down(todaysPaperLinkClass);var loggedInTodaysPaperUrl=cfg.getProperty(DEFAULT_CONFIG.LOGGED_IN_TODAYS_PAPER_URL.key);var that=this;dj.util.User.isSubLoggedIn(function(subLoggedIn){if(subLoggedIn){if((typeof gcDomain!=='undefined')&&(gcDomain!==null)&&(gcDomain!=="")){that.oTodaysPaperLink.href="http://"+gcDomain+loggedInTodaysPaperUrl;}else{that.oTodaysPaperLink.href=loggedInTodaysPaperUrl;}}});},setupMessageCenter:function(){var messageCenterLinkClass=cfg.getProperty(DEFAULT_CONFIG.MESSAGE_CENTER_LINK_CLASS.key);this.oMessageCenterLink=this.oHeader.down(messageCenterLinkClass);var messageCountClass=cfg.getProperty(DEFAULT_CONFIG.MESSAGE_COUNT_CLASS.key);this.oMessageCount=this.oHeader.down(messageCountClass);var that=this;var setupMsgCenterLink=function(noOfMessages){if(noOfMessages==='-1'){that.oMessageCenterLink.hide();}else{that.oMessageCount.innerHTML=noOfMessages;}};var noOfMessages=dj.util.Cookie.getCookie("msgCount");if(noOfMessages===null){var messageCenterPostUrl=cfg.getProperty(DEFAULT_CONFIG.MESSAGE_CENTER_POST_URL.key);var messageCountReq=new Ajax.Request(messageCenterPostUrl,{method:'post',onException:function(transport,exception){console.error('Exception occured while posting posting Ajax Request: %s',exception);},onSuccess:function(transport){noOfMessages=transport.responseText;dj.util.Cookie.setCookie("msgCount",noOfMessages,(5/24/60));setupMsgCenterLink(noOfMessages);}});}else{setupMsgCenterLink(noOfMessages);}},setupLogin:function(){var loginUserElementId=cfg.getProperty(DEFAULT_CONFIG.LOGIN_USERNAME_ELEMENT_ID.key);this.oUserName=$(loginUserElementId);var loginPasswordElementId=cfg.getProperty(DEFAULT_CONFIG.LOGIN_PASSWORD_ELEMENT_ID.key);this.oPassword=$(loginPasswordElementId);var loginButtonImageId=cfg.getProperty(DEFAULT_CONFIG.LOGIN_BUTTON_ELEMENT_ID.key);this.oLoginImg=$(loginButtonImageId);var loginFormId=cfg.getProperty(DEFAULT_CONFIG.LOGIN_FORM_ID.key);this.oLoginForm=$(loginFormId);this.oLoginForm.reset();var pageUrlId=cfg.getProperty(DEFAULT_CONFIG.PAGE_URL_ELEMENT_ID.key);this.oPageUrl=$(pageUrlId);var that=this;if(this.oPageUrl!==null){var nonSubscriberHomepagePid=cfg.getProperty(DEFAULT_CONFIG.NONSUBSCRIBER_HOMEPAGE_PID.key);var nonSubscriberSearchPagePid=cfg.getProperty(DEFAULT_CONFIG.NONSUBSCRIBER_SEARCH_PAGE_PID.key);var nonSubNewslettersAlertsPagePid=cfg.getProperty(DEFAULT_CONFIG.NONSUBSCRIBER_NEWSLETTERS_ALERTS_PAGE_PID.key);var mdcPagePid=cfg.getProperty(DEFAULT_CONFIG.MDC_PAGE_PID.key);var concatURL;if((typeof gcDomain!=='undefined')&&(gcDomain!==null)&&(gcDomain!=="")){concatURL="http://"+gcDomain;}else{concatURL="http://"+document.domain;}
var oCurrentUrl;if(Prototype.Browser.IE){oCurrentUrl=window.location.href;}else{oCurrentUrl=document.location.href;}
var url_value=oCurrentUrl;if(typeof pID!=='undefined'){if(pID===nonSubscriberHomepagePid){url_value=concatURL+cfg.getProperty(DEFAULT_CONFIG.HOMEPAGE_SUBSCRIBER_URL.key);}
else
if(pID===nonSubNewslettersAlertsPagePid){url_value=concatURL+'/email';}
else
if(pID===nonSubscriberSearchPagePid){url_value=concatURL+cfg.getProperty(DEFAULT_CONFIG.SEARCH_PAGE_SUBSCRIBER_URL.key);}
else
if(pID===mdcPagePid){url_value=concatURL+cfg.getProperty(DEFAULT_CONFIG.MDC_LINK_URL.key);}
else{url_value=oCurrentUrl;}
if(Prototype.Browser.IE){document.login_form.url.value=url_value;}else{this.oPageUrl.value=url_value;}}
if(this.oUserName!==null){this.oUserName.observe("focus",function(event){dj.util.Form.clearValue(that.oUserName,'User Name');}.bindAsEventListener(this.oUserName));this.oUserName.observe("click",function(event){dj.util.Form.clearValue(that.oUserName,'User Name');}.bindAsEventListener(this.oUserName));}
if(this.oPassword!==null){this.oPassword.observe("focus",function(event){dj.util.Form.clearValue(that.oPassword,'Password');that.oPassword.type="password";}.bindAsEventListener(that.oPassword));this.oPassword.observe("click",function(event){dj.util.Form.clearValue(that.oPassword,'Password');}.bindAsEventListener(that.oPassword));this.oPassword.observe("change",function(event){dj.util.Form.clearValue(that.oPassword,'Password');}.bindAsEventListener(that.oPassword));}
if(Prototype.Browser.IE){this.oLoginImg.observe("click",function(e){document.login_form.url.value=oCurrentUrl;that.oLoginForm.submit();}.bindAsEventListener(this.oLoginImg));}
this.oPassword.observe("keypress",function(e){var cKeyCode=e.keyCode||e.which;if(Prototype.Browser.IE){if(cKeyCode==Event.KEY_RETURN){document.login_form.url.value=oCurrentUrl;that.oLoginForm.submit();}}}.bindAsEventListener(this.oPassword));}},setupLogout:function(){var logoutLinkElementId=cfg.getProperty(DEFAULT_CONFIG.LOGOUT_LINK_ELEMENT_ID.key);this.oLogout=$(logoutLinkElementId);if(this.oLogout!==null){this.oLogout.observe("click",function(ev){Event.stop(ev);dj.util.Cookie.deleteCookie("msgCount");dj.util.Cookie.deleteCookie("HOMEPAGE",true);document.cookie="HOMEPAGE"+"="+";path=/"+";domain=.wsj.com"+";expires=Thu, 01-Jan-1970 00:00:01 GMT";if((typeof gcDomain!=='undefined')&&(gcDomain!==null)&&(gcDomain!=="")){window.location="/logout?url=http://"+gcDomain;}else{window.location="/logout";}}.bindAsEventListener(this.oLogout));}},highlightFormFactorLinks:function(){var todaysPaperLinkContainerClass=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_LINK_CONTAINER_CLASS.key);this.oTodaysPaperLinkContainer=this.oHeader.down(todaysPaperLinkContainerClass);var videoLinkContainerClass=cfg.getProperty(DEFAULT_CONFIG.VIDEO_LINK_CONTAINER_CLASS.key);this.oVideoLinkContainer=this.oHeader.down(videoLinkContainerClass);var blogsLinkContainerClass=cfg.getProperty(DEFAULT_CONFIG.BLOGS_LINK_CONTAINER_CLASS.key);this.oBlogsLinkContainer=this.oHeader.down(blogsLinkContainerClass);var columnsLinkContainerClass=cfg.getProperty(DEFAULT_CONFIG.COLUMNS_LINK_CONTAINER_CLASS.key);this.oColumnsLinkContainer=this.oHeader.down(columnsLinkContainerClass);var interactiveGraphicsLinkContainerClass=cfg.getProperty(DEFAULT_CONFIG.INTERACTIVE_GRAPHICS_LINK_CONTAINER_CLASS.key);this.oInteractiveGraphicsLinkContainer=this.oHeader.down(interactiveGraphicsLinkContainerClass);var topicsLinkContainerClass=cfg.getProperty(DEFAULT_CONFIG.TOPICS_LINK_CONTAINER_CLASS.key);this.oTopicsLinkContainer=this.oHeader.down(topicsLinkContainerClass);var communityForumsLinkContainerClass=cfg.getProperty(DEFAULT_CONFIG.COMMUNITY_FORUMS_LINK_CONTAINER_CLASS.key);this.oCommunityForumsLinkContainer=this.oHeader.down(communityForumsLinkContainerClass);var todaysPaperUsNonSubPid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_US_NONSUB_PID.key);var todaysPaperEuropeNonSubPid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_EUROPE_NONSUB_PID.key);var todaysPaperAsiaNonSubPid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_ASIA_NONSUB_PID.key);var todaysPaperUsPid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_US_PID.key);var todaysPaperEuropePid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_EUROPE_PID.key);var todaysPaperAsiaPid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_ASIA_PID.key);var todaysPaperPastEditionsPid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_PAST_EDITIONS_PID.key);var todaysPaperIndexBizPid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_INDEX_BIZ_PID.key);var todaysPaperIndexPeoplePid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_INDEX_PEOPLE_PID.key);var todaysPaperCorrectionsPid=cfg.getProperty(DEFAULT_CONFIG.TODAYS_PAPER_CORRECTIONS_PID.key);var videoPid=cfg.getProperty(DEFAULT_CONFIG.VIDEO_PID.key);var interactiveGraphicsPid=cfg.getProperty(DEFAULT_CONFIG.INTERACTIVE_GRAPHICS_PID.key);var topicsPid=cfg.getProperty(DEFAULT_CONFIG.TOPICS_PID.key);var newslettersAlertsPubPid=cfg.getProperty(DEFAULT_CONFIG.NEWSLETTERS_ALERTS_PUB_PID.key);var newslettersAlertsSubPid=cfg.getProperty(DEFAULT_CONFIG.NEWSLETTERS_ALERTS_SUB_PID.key);var columnsPid=cfg.getProperty(DEFAULT_CONFIG.COLUMNS_PID.key);var blogsPid=cfg.getProperty(DEFAULT_CONFIG.BLOGS_PID.key);var hostUrl=document.location.host;var communityUrl=hostUrl+cfg.getProperty(DEFAULT_CONFIG.COMMUNITY_HIGHLIGHT_COMPARE_URL.key);var compareForumsUrl=cfg.getProperty(DEFAULT_CONFIG.FORUMS_HIGHLIGHT_COMPARE_URL.key);if(typeof pID!=='undefined'){if((pID===todaysPaperUsNonSubPid)||(pID===todaysPaperEuropeNonSubPid)||(pID===todaysPaperAsiaNonSubPid)||(pID===todaysPaperUsPid)||(pID===todaysPaperEuropePid)||(pID===todaysPaperAsiaPid)||(pID===todaysPaperPastEditionsPid)||(pID===todaysPaperIndexBizPid)||(pID===todaysPaperIndexPeoplePid)||(pID===todaysPaperCorrectionsPid)){this.oTodaysPaperLinkContainer.addClassName("selected");}else
if(pID===videoPid){this.oVideoLinkContainer.addClassName("selected");}else
if(pID===interactiveGraphicsPid){this.oInteractiveGraphicsLinkContainer.addClassName("selected");}else
if(pID===columnsPid){this.oColumnsLinkContainer.addClassName("selected");}else
if(pID===blogsPid){this.oBlogsLinkContainer.addClassName("selected");}else
if(pID===topicsPid){this.oTopicsLinkContainer.addClassName("selected");}}
if((document.location.href!==null)&&(document.location.href!=="")&&(document.location.href.indexOf(communityUrl)!==-1)||(document.location.href.indexOf(compareForumsUrl)!==-1)){this.oCommunityForumsLinkContainer.addClassName("selected");}}};}();
dj.module.globalNav={setupQuicklinks:function(globalSubNavId,quicklinksContainerId){this.oHideQuickLinks=$(document.body).down('.hideQuickLinks');this.oGlobalSubNav=$(globalSubNavId);this.oQuicklinksContainer=$(quicklinksContainerId);if(typeof this.oHideQuickLinks==='undefined'){if(this.oGlobalSubNav===null){if(this.oQuicklinksContainer!=null){this.oQuicklinksContainer.removeClassName("subnav_hide");this.oQuicklinksContainer.addClassName("subnav_show");}}}}};
dj.module.newsReel={REEL_STATE:{FULL:0,COLLAPSED:1,SMALL:2},reelState:0,reelHeight:0,isAnimation:false,cfg:{reelOpenClass:"reelState-open",reelClosedClass:"reelState-closed",btnSelectedClass:"selected",stateCookieName:"newsReel_state",currentArticleClass:"currentArticle",currentPointerClass:"current",newsReelPointerClass:".newsreelPointer",reelLoadedClass:"reelState-loaded"},oCnt:null,cntId:null,init:function(newsreelContainer,adRegisterKey){this.oCnt=$(newsreelContainer);if(this.oCnt===null){throw new Error("{NewsReel} container is not located.");}
this.oCnt.addClassName(this.cfg.reelLoadedClass);this.currentArticle=null;var defState=this.REEL_STATE;this.reelState=defState.FULL;this.reel=this.initReel(this.oCnt);if(typeof adRegisterKey==='undefined'||adRegisterKey===null||adRegisterKey==='')return;this.initNewsReelAds(adRegisterKey,this.oCnt);},setId:function(newsreelContainer){this.cntId=newsreelContainer;},update:function(){this.init(this.cntId);return this;},initReel:function(cnt){var vid=this._setCurrentPanelActive(cnt);var reel=dj.widget.panels.PanelsFactory.create(cnt,{core:{panelGroup:"#newsReelContent > .reelContentTree .unitList",panel:"li",viewArea:4},carousel:{navContainer:".reelNav",prevButton:".newsreel_prev",nextButton:".newsreel_next",type:"circular"}});if(vid===null){return reel;}
this.reelPtrCnt=cnt.down(this.cfg.newsReelPointerClass);var pans=this.reelPtrCnt.select(".newsreel_pointer_container li");if(cnt.down(".unit.sponsor")){var element=pans[0];var grp=element.parentNode;var clone=new Element(element.tagName);element.classNames().each(function(cn){clone.addClassName(cn);});clone.update(element.innerHTML);grp.appendChild(clone);}
pans[vid].addClassName(this.cfg.currentPointerClass);var reelPtr=dj.widget.panels.PanelsFactory.create(this.reelPtrCnt,{core:{panelGroup:".newsreel_pointer_container",panel:"li",viewArea:4,controller:reel},carousel:{type:"circular"}});if(reel.getNumberOfPanels()>3){reel.setActiveById(vid);}
return reel;},_setCurrentPanelActive:function(cnt){var artCurrent=((typeof AT_VARS==="object"&&AT_VARS.baseDocId)?AT_VARS.baseDocId:dj.util.Page.getQueryParam('baseDocId'));var vid=null;var that=this;cnt.select("#newsReelContent > .reelContentTree .unitList li h2").each(function(el,pos){var anch=el.down("a");if((typeof anch!=='undefined')&&(anch.href!==null)&&(anch.href.indexOf(artCurrent)!==-1)){vid=pos;$(el.parentNode).addClassName(that.cfg.currentPointerClass);}});return vid;},initNewsReelAds:function(adRegisterKey,newsReelContainer){var adId="";newsReelContainer.select("#newsReelContent .newsReelAd").each(function(el){new dj.util.Ads().loadAds(adRegisterKey,{id:el.getAttribute("id")});});}};if (typeof dj == "undefined") { dj = function(){} }
if (typeof dj.community == "undefined") { dj.community = function(){} }
if (typeof dj.community.Answer == "undefined") { dj.community.Answer = function(){} }

dj.community.theTopic = undefined;


dj.community.ArticleComments = function(sbNumber, articleName, fullsiteroot, contentroot, onGetCommentsCount, onPostComment, isOpinion, onCommentPageChange) {
    this._fullSiteRoot = fullsiteroot;
    this._contenRoot = contentroot;
    this._subject = new dj.community.Subject(sbNumber, articleName, '', !isOpinion ? 'story' : 'opinion');

    this._onGetCommentsCount = onGetCommentsCount;
    this._onPostComment = onPostComment;
    this._onCommentPageChange = onCommentPageChange;

    this._userInfo = undefined;
    this._totalCommentsCount = undefined;

    this.__Init();
}

dj.community.ArticleComments.prototype.__Init = function() {

    var updateDiv = document.createElement("div");
    Element.extend(updateDiv);

    var args = {};
    args = $H(args).merge(this._subject);

    new Ajax.Updater(
        { success: updateDiv },
        this._fullSiteRoot + "/mdcrpc/comments/GetArticleCommentPopupBox.sync",
        {
            method: 'post',
            parameters: args.toQueryString(),
            onComplete: (function(transport, json) {
                this._userInfo = json.userInfo;
                document.body.appendChild(updateDiv);
                $('cmd0404174509').observe('click', this.__PostAndJoin.bind(this));
                $('cmd0404174609').observe('click', this.__JoinLater.bind(this));
                $('cmd0406115509').observe('click', this.__PostAndConfirmJoin.bind(this));
                $('cmd0406115609').observe('click', this.__JoinLater.bind(this));
                $('cmd0406115709').observe('click', this.__JoinLater.bind(this));
                this._totalCommentsCount = json.commentCount;
                if (this._onGetCommentsCount)
                    this._onGetCommentsCount(json.commentCount);
            }).bind(this),
            evalScripts: true
        });

    dj.community.theTopic = new dj.community.Comments('synccomments', this._subject, this._fullSiteRoot, this._contenRoot,
        $('topicreplyarea'),
        {
            ignoreProfileWizard: true,
            callbackOnNewCommentBox: this.__BindCommentBoxOnCommentsTab.bind(this),
            callbackOnPostComment: this.__OnPostComment.bind(this),
            callbackOnCommentPageChange: this._onCommentPageChange
        });
    }

dj.community.ArticleComments.prototype.GetCommentBox = function(targetContainer) {
    if (targetContainer == undefined)
        targetContainer = this._commentBoxDiv;

    this._commentBoxDiv = targetContainer;
    
    var args = {};
    args = $H(args).merge(this._subject);

    new Ajax.Updater(
        { success: $(targetContainer) },
        this._fullSiteRoot + "/mdcrpc/comments/GetArticleCommentBox.sync",
        {
            method: 'post',
            parameters: args.toQueryString(),
            onComplete: this.__OnGetCommentBox.bind(this),
            evalScripts: true
        });
}

dj.community.ArticleComments.prototype.GetComments = function(targetContainer) {
    dj.community.theTopic = new dj.community.Comments('synccomments', this._subject, this._fullSiteRoot, this._contenRoot,
        $('topicreplyarea'),
        {
            targetContainer: targetContainer,
            ignoreProfileWizard: true,
            callbackOnNewCommentBox: this.__BindCommentBoxOnCommentsTab.bind(this),
            callbackOnPostComment: this.__OnPostComment.bind(this),
            callbackOnCommentPageChange: this._onCommentPageChange
        }
        );
    dj.community.theTopic.GetArticlecommentsInitialPage();
}

dj.community.ArticleComments.prototype.__OnGetCommentBox = function(transport, json) {
    if (!$('cmd0409091704'))
        return;
        
    $('cmd0409091704').observe('click', (function() {
        if (this._onPostComment)
            this._onPostComment();
    }).bind(this));

    $('clearCommentBody0').observe('click', function() {
        $('commentBody0').value = '';
        $('commentBody0').focus();
        dj.community.Comments.ShowInlineMessage("errorOnPost0", "");
    });

    $('postComment0').observe('click', (function(event) {
        dj.community.Comments.ShowInlineMessage("errorOnPost0", "");
        if ($('commentBody0').value.length == 0) {
            dj.community.Comments.ShowInlineMessage("errorOnPost0", "Please enter your comment and then click post.");
            return false;
        }
        dj.community.Comments.ShowInlineMessage("errorOnPost0", "");
        this._currentCommentBox = $('commentBody0');
        this._currentTrackReply = $('cbxtrackreply0');
        this.__PostArticleComment(Event.element(event));
    }).bind(this));
}

dj.community.ArticleComments.prototype.__BindCommentBoxOnCommentsTab = function(total_comments_count) {
    if ($('cmd0406091327')) {
        $('cmd0406091327').setAttribute('onclick', '');
        $('cmd0406091327').observe('click', (function(event) {
            dj.community.Comments.ShowInlineMessage("errorOnPost", "");
            if ($('commentBody').value.length == 0) {
                dj.community.Comments.ShowInlineMessage("errorOnPost", "Please enter your comment and then click post.");
                return false;
            }
            dj.community.Comments.ShowInlineMessage("errorOnPost", "");
            this._currentCommentBox = $('commentBody');
            this._currentTrackReply = $('cbxtrackreply');
            this.__PostArticleComment(Event.element(event));
        }).bind(this));
    }
    if (total_comments_count != undefined) {
        this._totalCommentsCount = total_comments_count;
        if (this._onGetCommentsCount)
            this._onGetCommentsCount(this._totalCommentsCount);
    }
}


dj.community.ArticleComments.prototype.__PostArticleComment = function(clicked) {

    if (this._userInfo.isMember) {
        this.__CommentPost(false);
    }
    else {

        $("commentpopup").clonePosition(this._currentCommentBox, { setWidth: false, setHeight: false, offsetLeft: 20, offsetTop: -40 });

        if (this._userInfo.Status == "subscriber") {
            $("commentpopup").show();
            $("subscribercontent").show();
            $("freeregcontent").hide();
        }
        else if (this._userInfo.Status == "freereguser") {
            $("commentpopup").show();
            $("freeregcontent").show();
            $("subscribercontent").hide();
        }
    }
}


dj.community.ArticleComments.prototype.__PostAndJoin = function() {
    this.__CommentPost(true);
}

dj.community.ArticleComments.prototype.__PostAndConfirmJoin = function() {
    this.__CommentPost($("chkBecomeMember").checked);
}

dj.community.ArticleComments.prototype.__JoinLater = function() {
    $("commentpopup").hide();
}

dj.community.ArticleComments.prototype.__CommentPost = function(joinCommunity) {
    $("commentpopup").hide();
    dj.community.theTopic.PostArticleComment(this._currentCommentBox.value, joinCommunity, this._currentTrackReply.checked);

    if (!this._userInfo.isMember)
        this._userInfo.isMember = joinCommunity;

    this._currentCommentBox.value = '';    
    this._currentTrackReply.checked = false;
    this._currentCommentBox.focus();
}


dj.community.ArticleComments.prototype.__OnPostComment = function(userInfo, reload_comments, comments_total_count) {
    if (userInfo != undefined && userInfo.isSuspended) {
        this.GetCommentBox();
        if (reload_comments != undefined && reload_comments)
            dj.community.theTopic.GetArticlecommentsInitialPage();
        return;
    }

    if (comments_total_count == undefined)
        this._totalCommentsCount++;
    else
        this._totalCommentsCount = comments_total_count;

    if (this._onGetCommentsCount)
        this._onGetCommentsCount(this._totalCommentsCount);

    //will only get fired from the comment box on the article page
    if (this._currentCommentBox.id == 'commentBody0') {
        if (this._onPostComment)
            this._onPostComment($('newcommentarea0') ? 'newcommentarea0' : undefined);
    }
}

function toggleContent(id) { 
	$(id).toggle();
}


function CommunityIntegration(siteroot,fullsiteroot)
{
    this._siteroot = siteroot;
    this.fullsiteroot = fullsiteroot;
    
}

//for the ask a question module.
Event.observe(window, "load", function() {
   if( document.getElementById('hdnValues') != null )
	{
		fillSubCategoryJS();
	}
});

 function postQuestion(siteroot,fullsiteroot)
 {
      if(document.getElementById('message') != null)
        document.getElementById('message').innerHTML = "";
        var sDescText = document.getElementById('AskQDescription').value;
        if (sDescText == 'Enter your question*')
        {
            sDescText = '';
            document.getElementById('AskQDescription').value = '';
        }   
        var strimmedDesc = sDescText.replace(/^\s+|\s+$/g, '') ;
        
        var objErrorQstMandatory = document.getElementById('errorQstMandatory');
        var objErrorCatMandatory = document.getElementById('errorCatMandatory');
        var objErrorDefault = document.getElementById('errorDefault');
        var objErrorComplyPolicy = document.getElementById('errorComplyPolicy');
        var objDescription = document.getElementById('AskQDescription');
        var objErrorQuesLabel = document.getElementById('errorQuesLabel')
        var objCategory = document.getElementById('Category');
        var objSubCategoryId = document.getElementById('SubCategoryId');
        var objErrorSubCatMandatory = document.getElementById('errorSubCatMandatory');
        
        if(strimmedDesc.length == 0 && objCategory.value == "-1" && objSubCategoryId.value == "-1")
        {
            objErrorQuesLabel.style.display     = 'none';
            objErrorCatMandatory.style.display = 'none';
            objErrorDefault.style.display  = 'block';
            objErrorComplyPolicy.style.display = 'none';
            objErrorQstMandatory.style.display  = 'none';
            return;
        }        
        if(strimmedDesc.length == 0)
        {
            objErrorQstMandatory.style.display  = 'block';
            objErrorCatMandatory.style.display = 'none';
            objErrorSubCatMandatory.style.display = 'none';
            objErrorDefault.style.display  = 'none';
            objErrorComplyPolicy.style.display = 'none';
            objDescription.value = strimmedDesc;
            objDescription.focus();
            return;
        }
        if(strimmedDesc.length > 2000)
        {
            objErrorQuesLabel.style.display     = 'block';
            objErrorDefault.style.display  = 'none';
            objErrorComplyPolicy.style.display = 'none';
            objErrorQstMandatory.style.display  = 'none';
            objErrorCatMandatory.style.display = 'none';
            objErrorSubCatMandatory.style.display = 'none';
            objDescription.focus();
            return;
        }
        objDescription.value = strimmedDesc;
        if(objCategory.value == "-1")
        {
            objErrorQstMandatory.style.display  = 'none';
            objErrorDefault.style.display  = 'none';
            objErrorComplyPolicy.style.display = 'none';
            objErrorCatMandatory.style.display = 'block';
            objErrorSubCatMandatory.style.display = 'none';
            objCategory.focus();
            return;
        }
        if(objSubCategoryId.value == "-1")
        {
            objErrorQstMandatory.style.display  = 'none';
            objErrorCatMandatory.style.display = 'none';
            objErrorDefault.style.display  = 'none';
            objErrorComplyPolicy.style.display = 'none';
            objErrorSubCatMandatory.style.display = 'block';
            objSubCategoryId.focus();
            return;
        }
        
        var subCategoryvar = objSubCategoryId.value;
        var selectedCategoryIdvar = objCategory.value;
        var strimmedDesc = objDescription.value;
        var notifyMebool = document.getElementById('chkEmail').checked;
      
        var args = $H({mode : 0,
                        firstName : null,
						lastName : null,
                        subCategory: subCategoryvar,
						strDescription: strimmedDesc,
						notifyMe : notifyMebool						
				    });
	  
         dj.module.communityUser.ajaxPost(fullsiteroot + "/public/SaveQuestion.html", args, function(transport,json){
			
			//User is a community user and hence, successful post
			if (transport.status == 200) {
	                  document.location.href = fullsiteroot + "/answer/#identifier";
	      	} 
	      	else if( transport.status == 305 )
	      	{
	      	    objErrorQstMandatory.style.display  = 'none';
                objErrorCatMandatory.style.display = 'none';
                objErrorDefault.style.display  = 'none';
                objErrorSubCatMandatory.style.display = 'none';
                objErrorComplyPolicy.style.display = 'block';
                return false;
	      	}
	      	else
	      	{
			  //User is not a community user
			  if(transport.status == 300){
					dj.module.communityUser.handleError300(fullsiteroot + "/public/SaveQuestion.html", args,  json.FirstName, json.LastName, function(transport,json){
						if(transport.status == 200){
							 document.location.href = fullsiteroot + "/answer/#identifier";
			          	}
			          	else if( transport.status == 305 )
	      	            {
	      	                objErrorQstMandatory.style.display  = 'none';
                            objErrorCatMandatory.style.display = 'none';
                            objErrorDefault.style.display  = 'none';
                            objErrorSubCatMandatory.style.display = 'none';
                            objErrorComplyPolicy.style.display = 'block';
                            return false;
	      	            }
					});
			  }else if(transport.status == 301){
			    dj.module.communityUser.handleError301(json.FirstName, json.LastName);
			  }
		   }
	   });	   

 }

// keeping this function for backward compatibility. Should be removed once the main site started using the new AnswerAQuestion module.
function answerQuestion(siteroot,fullsiteroot)
{
    var  answerText = $('AnsDescription').value;
    if (answerText == 'Enter your answer')
    {
        answerText = '';
        $('AnsDescription').value = '';
    }  
    answerText = answerText.replace(/^\s+|\s+$/g, '') ;
    var questionId = $('hdnQuestionId').value;
    if(answerText.length == 0)
    {
        $('errorAnsDefault').show();
        $('errorAnsComplyPolicy').hide();
        $('errorAnsDefault').innerHTML = 'Please fill out the answer field.';
        return;
    } 
    if(answerText.length > 2000)
    {
        $('errorAnsDefault').show();
        $('errorAnsComplyPolicy').hide();
        $('errorAnsDefault').innerHTML = 'The Answer should not be more than 2000 characters';            
        return;
    }
    
    var args = $H({mode : 0,
                        firstName : null,
						lastName : null,
                        questionId: questionId,
						strDescription: answerText				
				    });
				    
	dj.module.communityUser.ajaxPost(fullsiteroot + "/public/SaveSectionAnswer.html", args, function(transport,json){
	
	    //User is a community member and successful post
        if(transport.status == 200) {
            document.location.href = fullsiteroot + "/answer/questions/" + questionId;
        }
        else if(transport.status == 305){
            $('errorAnsComplyPolicy').show();
            $('errorAnsDefault').hide();
            return false;
        }
        else{
            //User is not a community user
            if(transport.status == 300){
                dj.module.communityUser.handleError300(fullsiteroot + "/public/SaveSectionAnswer.html", args, json.FirstName, json.LastName, function(transport,json){
                    if(transport.status == 200){
                        document.location.href = fullsiteroot + "/answer/questions/" + questionId;
                    }
                    else if(transport.status == 305){
                        $('errorAnsComplyPolicy').show();
                        $('errorAnsDefault').hide();
                        return false;
                    }
                });
            }else if (transport.status == 301){
                dj.module.communityUser.handleError301(json.FirstName, json.LastName);
            }
        }		
    }); 
}
 
dj.community.Answer.ShowAnswerAQuestionBox = function() {
    var status = dj.util.Cookie.getCookie("userStatus");
    if (status == 'freereguser') status = 'subscriber';
    if (status == 'seamlessuser') status = 'invalid';
    if (status == null || status == '') status = 'anonymous';
    
    try {
        var boxId = status + 'AnswerBox';
        $(boxId).show();
    } catch (e) { }
}
 
dj.community.Answer.JoinLater = function() {
    $("answerpopup").hide();
}
 
dj.community.Answer.PostAnswer = function(siteroot, fullsiteroot) {
    var isMember = dj.util.Cookie.getCookie("isCommunityMember");
    if (isMember == null || isMember == '') isMember = 'false';
    
    if(isMember.toLowerCase() === 'true') {
        dj.community.Answer.AnswerQuestion(siteroot, fullsiteroot);
    } else {
        $("answerpopup").clonePosition($('answerModule'), { setWidth: false, setHeight: false, offsetLeft: -50});  
        $("answerpopup").show();
    }    
}
 
dj.community.Answer.AnswerQuestion = function(siteroot,fullsiteroot) {
    $("answerpopup").hide();
    var  answerText = $('AnsDescription').value;
    if (answerText == 'Enter your answer')
    {
        answerText = '';
        $('AnsDescription').value = '';
    }  
    answerText = answerText.replace(/^\s+|\s+$/g, '') ;
    var questionId = $('hdnQuestionId').value;
    if(answerText.length == 0)
    {
        $('errorAnsDefault').show();
        $('errorAnsDefault').innerHTML = 'Please fill out the answer field.';
        return;
    } 
    if(answerText.length > 2000)
    {
        $('errorAnsDefault').show();
        $('errorAnsDefault').innerHTML = 'The Answer should not be more than 2000 characters';            
        return;
    }
    var args = $H({questionId: questionId,
						answerDescription: answerText				
				    });
	
	new Ajax.Request(
	siteroot + "/answer/SaveModuleAnswer.sync",
	{
	    method: 'post',
	    parameters: args.toQueryString(),
	    onComplete: function(transport, json) {
	        if (json.success == 'False') {
	            $('errorAnsDefault').show();
	            $('errorAnsDefault').innerHTML = json.errorMsg;	
	        } else {
	            document.location.href = fullsiteroot + "/answer/questions/" + questionId;	            
	        }  
	    }
	});
} 

function fnOpenMessageBox(targetElement,URI,rowKey){
    if(document.getElementById('hdnLastShownId').value != ""){
        document.getElementById(document.getElementById('hdnLastShownId').value).style.display  = "none";
    }
    if(targetElement == 1){
        targetElement = 'dvMessage' + rowKey;
    }else{
        targetElement = 'dvConnect' + rowKey;
    }
    var subject = 'msgsubject' + rowKey;
    var message = 'msgeditor' + rowKey;
    var connectMessage = 'txtMessage' + rowKey;
    document.getElementById(targetElement).style.display  = 'block';
    document.getElementById('hdnMemberUri' + rowKey).value = URI;   
    document.getElementById('hdnLastShownId').value = targetElement;
    document.getElementById(subject).value = "Subject";
    document.getElementById(message).value = "Type your personal message.";
    
    subjectGotFocus = function subject_GotFocus(){
        if (document.getElementById(subject).value == "Subject"){
            document.getElementById(subject).value = "";
        }
    }
    subjectLostFocus = function subject_LostFocus(){
        if (document.getElementById(subject).value == ""){
            document.getElementById(subject).value = "Subject";
        }
    }
    messageGotFocus = function message_GotFocus(){
        if (document.getElementById(message).value == "Type your personal message."){
            document.getElementById(message).value = "";
        }
    }
    messageLostFocus = function message_LostFocus(){
        if (document.getElementById(message).value == ""){
            document.getElementById(message).value = "Type your personal message.";
        }
    }   
    messageConnectGotFocus = function messageConnect_GotFocus(){
        if (document.getElementById(connectMessage).value == "Type your personal message."){
            document.getElementById(connectMessage).value = "";
        }
    }
    messageConnectLostFocus = function messageConnect_LostFocus(){
        if (document.getElementById(connectMessage).value == ""){
            document.getElementById(connectMessage).value = "Type your personal message.";
        }
    }     
    Event.observe(document.getElementById(subject), 'focus', subjectGotFocus);
    Event.observe(document.getElementById(subject), 'blur', subjectLostFocus);    
    Event.observe(document.getElementById(message), 'focus', messageGotFocus);
    Event.observe(document.getElementById(message), 'blur', messageLostFocus); 
    Event.observe(document.getElementById(connectMessage), 'focus', messageConnectGotFocus);
    Event.observe(document.getElementById(connectMessage), 'blur', messageConnectLostFocus); 
}
 
function SetCommentFocus()
{
    if( $('commentBody') != null && $('commentBody') != 'undefined' )
    {
        $('commentBody').focus();
    }
}

function SetMostFocus()
{
    if( $('commentBody') != null && $('commentBody') != 'undefined' )
    {
        $('commentBody').focus();
		$('commentBody').blur();
    }
}


function ReportTopic1(ajaxFunction)
{
  new Ajax.Request(
  ajaxFunction,
  {
  onComplete: function(transport, json)
  {
  var reported = $H(json)["reported"];
  var alreadyreported = $H(json)["alreadyreported"];
  if (reported)
  {
  $('reporttopic').update("Topic Reported");
  }
  if (alreadyreported)
  {
  $('reporttopic').update("Topic is already reported");
  }
  }
  }
  );
}

function fnCloseMessage(Rowkey){
    document.getElementById('dvMessage' + Rowkey).style.display  = 'none';
}

function fnCloseMessageSent(Rowkey){
    document.getElementById('dvMessageSent' + Rowkey).style.display  = 'none';
}

function fnCloseConnectionSent(Rowkey){
    document.getElementById('dvConnectionSent' + Rowkey).style.display  = 'none';
}
  
function ReportComment(siteroot,CommentId)
{ 
      var args = $H({commentid: CommentId,
						mode : 0,
						firstName : null,
						lastName : null
				    });
      
      dj.module.communityUser.ajaxPost(siteroot + "/comments/report.sync", args, function(transport,json){
			
			//User is a community user and hence, successful post
			if (transport.status == 200)
			{
	             document.getElementById('reportcomment'+CommentId).innerHTML = transport.responseText;
	      	} 
	      	//User is not a community user
	      	else if(transport.status == 300)
			{
					
					dj.module.communityUser.handleError300(siteroot + "/comments/report.sync", args,  json.FirstName, json.LastName, function(transport,json){
						if(transport.status == 200)
						{
							 document.getElementById('reportcomment'+CommentId).innerHTML = transport.responseText;
			          	}
					});
			  }
			  else if(transport.status == 301)
			  {
			    dj.module.communityUser.handleError301(json.FirstName, json.LastName);
			  }
	   }); 
 }
  
  function fnSendMessage(siteroot,Rowkey)
  {
      var recipients    = trim($F('hdnMemberUri' + Rowkey));
      var subject       = trim($F('msgsubject' + Rowkey));
      var content       = trim($F('msgeditor' + Rowkey));
      
      if(subject.length <= 0 || subject == 'Subject'){
        document.getElementById('errorMsg' + Rowkey).style.display = "block";
        document.getElementById('errorMsg' + Rowkey).innerHTML = "Please enter valid subject.";
        return false;
      }
      if(content.length <= 0 || content == 'Type your personal message.'){
        document.getElementById('errorMsg' + Rowkey).style.display = "block";
        document.getElementById('errorMsg' + Rowkey).innerHTML = "Please enter valid message.";
        return false;
      }
      
      subject = fnReplaceHTMLTags(subject);
      content = fnReplaceHTMLTags(content);
      
      var targetElement = 'dvMessage' + Rowkey;
      var messageSent = 'dvMessageSent' + Rowkey;
      
      var args = $H({recipients: recipients,
						subject: subject,
						content: content,
						mode : 0,
						firstName : null,
						lastName : null
				    });
      dj.module.communityUser.ajaxPost(siteroot + "/member/sendmessage.sync", args, function(transport,json){
			//User is a community user and hence, successful post
			if (transport.status == 200) 
			{
	                  document.getElementById('errorMsg' + Rowkey).innerHTML = json['errorMsg'];  
	                  document.getElementById(targetElement).style.display  = 'none';
                      document.getElementById(messageSent).style.display  = 'block';
	      	}
	      	//User is not a community user
	      	else if(transport.status == 300)
	      	{
				dj.module.communityUser.handleError300(siteroot + "/member/sendmessage.sync", args,  json.FirstName, json.LastName, function(transport,json){
						if(transport.status == 200)
						{
							 document.getElementById('errorMsg' + Rowkey).innerHTML = json['errorMsg'];  
							 document.getElementById(targetElement).style.display  = 'none';
                             document.getElementById(messageSent).style.display  = 'block';
			          	}
					});
			 }else if(transport.status == 301)
			 {
			    dj.module.communityUser.handleError301(json.FirstName, json.LastName);
			 }			
	   });     
  }
  
  function fnCloseConnect(Rowkey){
  document.getElementById('dvConnect' + Rowkey).style.display  = 'none';
  }
  
  function fnSendInvite(siteroot,rowKey)
  {
      var name = trim(document.getElementById('hdnMemberUri' + rowKey).value);
      var message = trim(document.getElementById('txtMessage' + rowKey).value);
      
      message = fnReplaceHTMLTags(message);
      if(message.length <= 0 || message == 'Type your personal message.'){
        document.getElementById('errorMsgInvite' + rowKey).style.display = "block";
        document.getElementById('errorMsgInvite' + rowKey).innerHTML = "Please enter valid message.";
        return false;
      }
      
      var targetElement = 'dvConnect' + rowKey;
      var messageSent = 'dvConnectionSent' + rowKey;
      
      
      var args = $H({name: name,
						message: message,
					    mode : 0,
						firstName : null,
						lastName : null
				    });
      
      dj.module.communityUser.ajaxPost(siteroot + "/member/InviteFriend.sync", args, function(transport,json){
			
			//User is a community user and hence, successful post
			if (transport.status == 200) 
			{
	                  document.getElementById('errorMsgInvite' + rowKey).innerHTML = json['errorMsg']; 
	                  document.getElementById(targetElement).style.display  = 'none';
                      document.getElementById(messageSent).style.display  = 'block';  
	      	} else
				//User is not a community user
				if(transport.status == 300){
					
					dj.module.communityUser.handleError300(siteroot + "/member/InviteFriend.sync", args,  json.FirstName, json.LastName, function(transport,json){
						if(transport.status == 200){
							 document.getElementById('errorMsgInvite' + rowKey).innerHTML = json['errorMsg'];
							 document.getElementById(targetElement).style.display  = 'none';
                             document.getElementById(messageSent).style.display  = 'block';    
			          	}
					});
			  }else if(transport.status == 301){
			    dj.module.communityUser.handleError301(json.FirstName, json.LastName);
			  }			  
	   });
  }  

  GotFocus = function Connect_GotFocus()
  {
    if (document.getElementById('txtMessage${Rowkey}').value == "Type your personal message")
    {
      document.getElementById('txtMessage${Rowkey}').value = "";
    }
  }

  LostFocus = function Connect_LostFocus()
  {
      if (document.getElementById('txtMessage${Rowkey}').value == "")
      {
        document.getElementById('txtMessage${Rowkey}').value = "Type your personal message";
      }
  }
  
  function fillSubCategoryJS()
  {
      var parentCategoryId = document.getElementById('Category').value;
      
      if(parentCategoryId == '-1')
      {
          document.getElementById('SubCategoryId').options.length = 0;
          document.getElementById('SubCategoryId').options[0] = new Option('Sub-category','-1');
          return;
      }  
      var values = document.getElementById('hdnValues').value;
      var categories = values.split("~");
      document.getElementById('SubCategoryId').options.length = 0;
      var SelectedSubCategoryId =  document.getElementById('hdnSubCategoryId').value;
      
      for( i = 0; i < categories.length; i++ ){
          var subCatInfo = categories[i];
          var subCategories = subCatInfo.split("^");
          var categoryId = subCategories[0];
          if( categoryId == parentCategoryId )
          {
              for( j = 1; j < subCategories.length; j++ ){
                    var subCatValues = subCategories[j].split("=");
                    var subCategoryText = subCatValues[0];
                    var subCategoryId = subCatValues[1];
                    document.getElementById('SubCategoryId').options[j-1]=new Option(subCategoryText, subCategoryId);
                    if( SelectedSubCategoryId == subCategoryId )
                    {
                        document.getElementById('SubCategoryId').options[j-1].selected = true;
                    }
              }
          }
      }

	  if(SelectedSubCategoryId == -1)
	  {
		 document.getElementById('SubCategoryId').options[j-1] = new Option('Sub-category','-1');
         document.getElementById('SubCategoryId').options[j-1].selected = true;
	  }
  }
  
    function setCategorySubcategory(categoryId, subCategoryId)
	{
		var categoryDropDown = document.getElementById('Category');
			
		for(i=0; i < categoryDropDown.options.length ; i++)
		 {
			 if (categoryDropDown.options[i].value == categoryId )
			   {      
				  categoryDropDown.options[i].selected = true;     
			   }
		 }    
		
		if (subCategoryId == null) {
			subCategoryId = -1;
		}
		
		document.getElementById('hdnSubCategoryId').value = subCategoryId ;		
		fillSubCategoryJS();
		
	  }

  function SortArticleComments(SBNumber,siteRoot,index,sortId)
  {
    document.getElementById('sortId').value = sortId;
    new Ajax.Updater(document.getElementById('Commentsblock'),
    siteRoot + "/public/ArticleComments.html",
        {
            method: 'post',
            parameters: $H({SBNumber: SBNumber,index:index,sortIndex:sortId}).toQueryString()
        });
    }    
 
//************** Remove HTML tags ************** 
function fnReplaceHTMLTags(strValue){
    strValue = strValue.replace(/</g,'&lt;');
    strValue = strValue.replace(/>/g,'&gt;');
    return strValue;
}

function trim(str)
{
    return str.replace(/^\s+|\s+$/, '');
}

//************** Community Live Integration ************** 
dj.community.CommunityLive = function(communitySiteRoot, container, delayInterval) {

    pollCommunityLive = function(lastId) {
        
        var url; 
        
        if (!lastId) {
            url = communitySiteRoot + "/communitylive/newentries.sync?r=" + Math.floor(Math.random()*1000);
        }
        else {
            url = communitySiteRoot + "/communitylive/newentries.sync?lastId=" + lastId + '&r=' + Math.floor(Math.random()*1000);
        }
        
        new Ajax.Updater($('communityLiveList'),
            url,
            {
                method: 'get',
                onComplete: processResults,
                insertion: Insertion.Top
            });        
    };
    
    processResults = function(transport, json) {
        trimResults();
        startTimer(transport, json);
    };
    
    trimResults = function() {
        var list = $('communityLiveList');
        var itemCount = list.childElements().length - 1; // There is a special item in the list that should never be removed
        
        // Remove any items beyond 6
        var removalQueue = [];
        
        for (var i = 6; i < itemCount; i++) {
            var item = list.childElements()[i];
            removalQueue.push(item);
        }
        
        for (var i = 0; i < removalQueue.length; i++) {
            var item = removalQueue[i];
            item.remove();
        }
    };

    startTimer = function(transport, json) {
        setTimeout('pollCommunityLive(' + json.lastId + ')', delayInterval);
    };

    pollCommunityLive();
}

dj.module.freeReg={init:function(){this.oAnyUserLoggedIn=false;var that=this;dj.util.User.isLoggedIn(function(isLoggedIn){if(isLoggedIn){that.oAnyUserLoggedIn=true;}});if(!that.oAnyUserLoggedIn){this.inlineReg=new dj.widget.panel.ModalPanel('register','register_module',{openModalPanelEvent:"click",closeModalPanelEvent:"blur",closeModalPanelButtonSelector:".closeFreereg",closeModalPanelEventForButtonSelector:"click"});this.oRegister_module=this.inlineReg.oModalContainer;this.inlineLogin=new dj.widget.panel.ModalPanel('login','login_module',{openModalPanelEvent:"click",closeModalPanelEvent:"blur",closeModalPanelButtonSelector:".closeLogin",closeModalPanelEventForButtonSelector:"click"});this.logindiv=this.inlineLogin.oModalContainer;this.ologin_form=this.logindiv.down('#login_form');this.ologinMod=this.inlineLogin.oModalId;this.osublogin=this.logindiv.up('#subscriberLogin');this.ofreereg=this.oRegister_module.up('#freereg');this.oFree_reg=this.inlineReg.oModalId;this.oErrorCount=0;this.http_request=false;this.oRegFieldErrorMsgsValue="";this.oregFieldErrorMsg=this.oRegister_module.down('#oregFieldErrorMsg');this.oFr_confirm=this.oRegister_module.down('#fr_confirm');this.oFr_content=this.oRegister_module.down('#fr_content');this.oFreeRegistration_form=this.oRegister_module.down('#freeRegistration_form');this.oFreeregemailerrormsg=this.oRegister_module.down('#freeregemailerrormsg');this.oFreeregusererrormsg=this.oRegister_module.down('#freeregusererrormsg');this.oFreeRegServiceErrorMsg=this.oRegister_module.down('#freeRegServiceErrorMsg');this.oFreeRegSubButton=this.oRegister_module.down('#freeRegSubButton');this.oFreeRegConfirm=this.oRegister_module.down('#fr_confirmForm');this.oFreeRegEmail=this.oRegister_module.down('#regemail');this.oFreeRegWhyReason=this.oRegister_module.down('#whyreasons');this.ofreewhyregister=this.oRegister_module.down('#ofreewhyregister');this.regErrorCode=['userName-exists','userName-required','userName-invalid','firstName-required','firstName-invalid','lastName-required','lastName-invalid','emailAddress-exists','emailAddress-required','emailAddress-invalid','password-required','password-invalid','passwordConfirmation-invalid','userName-unique','emailAddress-unique','passwordConfirmation-required'];this.regErrorValue=['Please enter your First Name.','Please enter your Last Name.','Please enter a valid email address.','Please create a Password.','Please confirm Password.','The email addresses do not match. Please re-enter both.','Passwords do not match.','Password must be 5-15 characters in length.','Confirm Password must be 5-15 characters in length.','','','Please Confirm Email.','First name contains invalid characters.','Last name contains invalid characters.'];this.regFieldName=['firstNameReg','lastNameReg','emailAddressReg','passwordReg','passwordConfirmationReg','emailAddressConfirmationReg','passwordConfirmationReg','passwordReg','passwordConfirmationReg','sendEmailsReg','jcommunityReg','emailAddressConfirmationReg','firstNameReg','lastNameReg'];this.attachEvents();this.freeRegResetForm();}},attachEvents:function(){var that=this;var textFields=this.oFreeRegistration_form.select("input[type=text]");var passfields=this.oFreeRegistration_form.select("input[type=password]");textFields.each(function(ipt){Element.observe(ipt,"focus",function(ev){that.checkFreeRegFocus(ipt.name);});});textFields.each(function(ipt){Element.observe(ipt,"blur",function(ev){that.checkFreeRegFieldBlur(ipt.name);});});passfields.each(function(ipt){Element.observe(ipt,"focus",function(ev){that.checkFreeRegFocus(ipt.name);});});passfields.each(function(ipt){Element.observe(ipt,"blur",function(ev){that.checkFreeRegFieldBlur(ipt.name);});});this.oimagefields=this.oFreeRegistration_form.select("input[type=image]");this.oimagefields.each(function(ipt){Element.observe(ipt,"click",function(ev){that.submitregForm();});});this.okButtonClicked=this.oFreeRegConfirm.select("input[class=okButton]");this.okButtonClicked.each(function(ipt){Element.observe(ipt,"click",function(ev){that.closeRegSuccessBlock();});});this.oFreewhyReasons=this.oRegister_module.select("a[class=ofreewhyReasons]");this.oFreewhyReasons.each(function(ipt){Element.observe(ipt,"click",function(ev){that.oFreeRegWhyReason.style.display=(that.oFreeRegWhyReason.style.display=='block')?'none':'block';if(that.oFreeRegWhyReason.style.display==='block'){that.ofreewhyregister.className="why";}
else{that.ofreewhyregister.className="whynot";}});});this.oFreeTermsConditions=this.oRegister_module.select("a[class=ofreeTermsConditions]");this.oFreeTermsConditions.each(function(ipt){Element.observe(ipt,"click",function(ev){dj.util.Url.openWin('/public/page/subscriber_agreement.html','TermAndConditions',800,800,'scrollbars',1,300,100);});});this.oFreeEmailNewLetter=this.oRegister_module.select("a[class=ofreeEmailNewLetter]");this.oFreeEmailNewLetter.each(function(ipt){Element.observe(ipt,"click",function(ev){dj.util.Url.openWin('/public/email','EmailNewLetterLink');});});this.oprivacyPolicy=this.oRegister_module.select("a[class=oprivacyPolicy]");this.oprivacyPolicy.each(function(ipt){Element.observe(ipt,"click",function(ev){dj.util.Url.openWin('/public/page/privacy_policy.html','FreeRegPrivacyPolicy',800,800,'scrollbars',1,300,100);});});this.ologinMod.observe('click',function(ev){Event.stop(ev);that.closeRegOtherBlock(2);that.ologin_form.reset();});},freeRegResetForm:function(){var that=this;this.oFree_reg.observe('click',function(ev){Event.stop(ev);that.closeRegOtherBlock(1);that.oFreeRegistration_form.reset();that.oregFieldErrorMsg.hide();that.ofreewhyregister.className="whynot";that.oRegFieldErrorMsgsValue="";that.oFreeRegSubButton.disabled=false;that.oFreeregemailerrormsg.hide();that.oFreeRegServiceErrorMsg.hide();that.oFreeregusererrormsg.hide();that.oFreeRegistration_form[that.regFieldName[0]].style.backgroundColor='#ffffff';that.oFreeRegistration_form[that.regFieldName[1]].style.backgroundColor='#ffffff';that.oFreeRegistration_form[that.regFieldName[2]].style.backgroundColor='#ffffff';that.oFreeRegistration_form[that.regFieldName[3]].style.backgroundColor='#ffffff';that.oFreeRegistration_form[that.regFieldName[4]].style.backgroundColor='#ffffff';that.oFreeRegistration_form[that.regFieldName[5]].style.backgroundColor='#ffffff';});},closeRegSuccessBlock:function(){this.oFreeRegEmail.innerHTML="";this.oFr_confirm.hide();this.oFr_content.show();this.oRegister_module.hide();this.oFreeRegSubButton.disabled=false;this.oFreeRegistration_form.reset();},closeRegOtherBlock:function(val){if(val===1){this.ofreereg.className="freereg";this.osublogin.className+=" login_hidden";this.logindiv.hide();this.oRegister_module.show();this.oFreeRegWhyReason.style.display='block';this.oFreeRegWhyReason.style.display='none';}
if(val===2){this.osublogin.className="login";this.ofreereg.className+=" freereg_hidden";this.logindiv.show();this.oRegister_module.hide();}},checkFreeRegFieldBlur:function(oregFieldname){this.ofieldName=this.oFreeRegistration_form[oregFieldname];this.ofieldValue=this.ofieldName.value;var ovalid=this.ofieldValue.blank();if(ovalid){this.oErrorCount=1;this.oFreeRegSubButton.disabled=false;}else{this.ofieldName.style.color='#000000';this.ofieldName.style.backgroundColor='#ffffff';this.ofieldName.value=this.ofieldValue.strip();}},checkFreeRegBlur:function(oregFieldnumber){this.ofieldName=this.oFreeRegistration_form[this.regFieldName[oregFieldnumber]];this.ofieldValue=this.ofieldName.value;var ovalid=this.ofieldValue.blank();if(ovalid){this.changeFieldValue(oregFieldnumber);this.oErrorCount=1;this.oFreeRegSubButton.disabled=false;}else{this.ofieldName.style.color='#000000';this.ofieldName.style.backgroundColor='#ffffff';this.ofieldName.value=this.ofieldValue.strip();}},checkFreeRegFocus:function(oregFieldname){this.ofieldName=this.oFreeRegistration_form[oregFieldname];this.ofieldName.style.color='#000000';this.ofieldName.style.backgroundColor='#ffffff';},checkFreeRegEmail:function(email){var invalidEmailChars=" ?!#$%&*()\"||<>=+;:][{}/\\";for(var count=0,len=invalidEmailChars.length;count<len;count++){var badChar=invalidEmailChars.charAt(count);if(email.indexOf(badChar,0)>-1){this.oErrorCount=1;this.changeFieldValue(2);this.oFreeRegSubButton.disabled=false;return;}}
this.lastAtSign=email.lastIndexOf("@");this.firstAtSign=email.indexOf("@");this.lastPeriod=email.lastIndexOf(".");if(!(this.firstAtSign>0&&email.length>=5&&email.length<=100&&this.firstAtSign===this.lastAtSign&&email.lastIndexOf("..")<0&&this.lastPeriod>=(this.firstAtSign+2)&&this.lastPeriod<=(email.length-3)&&email.charAt(this.firstAtSign+1)!==".")){this.changeFieldValue(2);this.oFreeRegSubButton.disabled=false;this.oErrorCount=1;return;}},compareFreeRegEmail:function(){this.oEmailfieldValue=this.oFreeRegistration_form[this.regFieldName[2]].value;this.oEmailfieldConfValue=this.oFreeRegistration_form[this.regFieldName[5]].value;if((this.oEmailfieldValue!=''&&this.oEmailfieldConfValue!='')&&(this.oEmailfieldValue!==this.oEmailfieldConfValue)){this.changeFieldValue(5);this.oFreeRegSubButton.disabled=false;this.oErrorCount=1;}},compareFreeRegPassword:function(){this.oPassfieldValue=this.oFreeRegistration_form[this.regFieldName[3]].value;this.oCPassfieldValue=this.oFreeRegistration_form[this.regFieldName[4]].value;if(this.oPassfieldValue!==this.oCPassfieldValue){this.changeFieldValue(6);this.oFreeRegSubButton.disabled=false;this.oErrorCount=1;}},changeFieldValue:function(oregFieldnumber){this.oregFieldErrorMsg.show();this.ofieldName=this.oFreeRegistration_form[this.regFieldName[oregFieldnumber]];this.oRegFieldErrorMsgsValue+=" "+this.regErrorValue[oregFieldnumber];this.ofieldName.style.color='#ff0000';this.ofieldName.style.backgroundColor='#fff28d';},responseErrorData:function(responseData){var that=this;var oshow=0;var profileErrors=responseData.profile.errors;var emailAddressVal=profileErrors.emailAddress;var userNameVal=profileErrors.userName;var firstNameVal=profileErrors.firstName;var lastNameVal=profileErrors.lastName;var passwordVal=profileErrors.password;var compasswordVal=profileErrors.passwordConfirmation;if(emailAddressVal!==null&&emailAddressVal!==undefined){if(that.regErrorCode[7]===emailAddressVal||that.regErrorCode[14]===emailAddressVal){that.oFreeregemailerrormsg.show();that.ofieldName=that.oFreeRegistration_form[that.regFieldName[2]];that.ofieldName.style.backgroundColor='#fff28d';}else{that.changeFieldValue(2);oshow=1;}}
if(userNameVal!==null&&userNameVal!==undefined){if(that.regErrorCode[0]===userNameVal||that.regErrorCode[13]===userNameVal){that.oFreeregusererrormsg.show();that.ofieldName=that.oFreeRegistration_form[that.regFieldName[5]];that.ofieldName.style.backgroundColor='#fff28d';}else{that.changeFieldValue(5);oshow=1;}}
if(firstNameVal!==null&&firstNameVal!==undefined){if(firstNameVal===that.regErrorCode[4]){that.changeFieldValue(12);}else{that.changeFieldValue(0);}
oshow=1;}
if(lastNameVal!==null&&lastNameVal!==undefined){if(lastNameVal===that.regErrorCode[6]){that.changeFieldValue(13);}else{that.changeFieldValue(1);}
oshow=1;}
if(passwordVal!==null&&passwordVal!==undefined){if(passwordVal===that.regErrorCode[11]){that.changeFieldValue(7);}else{that.changeFieldValue(3);}
oshow=1;}
if(compasswordVal!==null&&compasswordVal!==undefined){if(compasswordVal===that.regErrorCode[12]){that.changeFieldValue(8);}else{that.changeFieldValue(4);}
oshow=1;}
console.log("inside responseError data"+that.oRegFieldErrorMsgsValue);if(oshow===1){that.oregFieldErrorMsg.show();that.oregFieldErrorMsg.innerHTML="<p>"+that.oRegFieldErrorMsgsValue+"</p>";console.log("inside responseError show data"+that.oRegFieldErrorMsgsValue);}},freeRegRequest:function(){this.ofirstName=this.oFreeRegistration_form[this.regFieldName[0]].value;this.olastName=this.oFreeRegistration_form[this.regFieldName[1]].value;this.oemailName=this.oFreeRegistration_form[this.regFieldName[2]].value;this.opassName=this.oFreeRegistration_form[this.regFieldName[3]].value;this.ocpassName=this.oFreeRegistration_form[this.regFieldName[4]].value;this.oemailConfName=this.oFreeRegistration_form[this.regFieldName[5]].value;this.oFeatureEmail=this.oFreeRegistration_form[this.regFieldName[9]].checked;this.oCommunityProfile=this.oFreeRegistration_form[this.regFieldName[10]].checked;this.data={'profile.firstName':this.ofirstName,'profile.lastName':this.olastName,'profile.emailAddress':this.oemailName.toLowerCase(),'profile.password':this.opassName,'profile.passwordConfirmation':this.ocpassName,'service.templateCode':'WSJ','service.registrationType':'FREE_REGISTRATION','profile.options.returnLink':window.location.href,'profile.options.featureEmailOptIn':this.oFeatureEmail};var that=this;var request=new Ajax.Request('/epiton/registration/v2/profile',{method:'post',requestHeaders:{Accept:'application/json'},parameters:this.data,onComplete:function(transport){var responseData=eval('('+transport.responseText+')');if(transport.status===200){that.oFreeRegEmail.innerHTML=that.oemailName;that.oFr_content.hide();that.oFr_confirm.show();that.oFreeRegistration_form.reset();}
else if(transport.status===412){that.oFreeRegSubButton.disabled=false;that.responseErrorData(responseData);}
else if(transport.status===500||transport.status===404){that.oFreeRegSubButton.disabled=false;that.oFreeRegServiceErrorMsg.show();}
else{that.oFreeRegSubButton.disabled=false;that.oFreeRegServiceErrorMsg.show();}}});},checkEmailInEmailCenter:function(){this.oemailName=this.oFreeRegistration_form[this.regFieldName[2]].value;var that=this;this.request=new Ajax.Request('/emailcheck/'+this.oemailName,{method:'get',onComplete:function(transport){if(transport.responseText!==null||transport.responseText!==undefined){if('false'===transport.responseText.strip()){that.freeRegRequest();}
else if('true'===transport.responseText.strip()){that.oFreeRegSubButton.disabled=false;}
else{that.oFreeRegSubButton.disabled=false;that.oFreeRegServiceErrorMsg.show();}}else{that.oFreeRegSubButton.disabled=false;that.oFreeRegServiceErrorMsg.show();}},onException:function(transport){that.oFreeRegSubButton.disabled=false;that.oFreeRegServiceErrorMsg.show();}});},submitregForm:function(){this.oErrorCount=0;this.oRegFieldErrorMsgsValue="";this.oFreeregemailerrormsg.hide();this.oFreeregusererrormsg.hide();this.oFreeRegServiceErrorMsg.hide();this.oFreeRegSubButton.disabled=true;this.checkFreeRegBlur(0);this.checkFreeRegBlur(1);this.checkFreeRegBlur(2);this.checkFreeRegBlur(11);this.checkFreeRegBlur(3);this.checkFreeRegBlur(4);this.compareFreeRegEmail();this.compareFreeRegPassword();if(this.oErrorCount===0){this.oRegFieldErrorMsgsValue="";}
if(this.oErrorCount>0){this.oregFieldErrorMsg.innerHTML="<p>"+this.oRegFieldErrorMsgsValue+"</p>";console.log(this.oRegFieldErrorMsgsValue);this.oregFieldErrorMsg.show();this.oFreeRegSubButton.disabled=false;return false;}
else{this.oFreeRegSubButton.disabled=true;this.oregFieldErrorMsg.hide();this.oRegFieldErrorMsgsValue="";this.oregFieldErrorMsg.innerHTML="";this.freeRegRequest();return false;}
return false;}};
dj.module.rssBlogTimes={init:function(getClasses){var timeStamps=$$(getClasses);if(timeStamps.length===0){console.log("{dj.module.xslTimestamp} no timestamps found.");return;}
for(var i=0,timeStamp;timeStamp=timeStamps[i++];){timeStamp=timeStamp.cleanWhitespace();var dur=this.calculateDuration(timeStamp.innerHTML.strip());timeStamp.update(dur);}},calculateDuration:function(getPubDate){var today=new Date();var newDate=new Date(getPubDate);var getTimeDIff=Math.ceil(today.getTime()-newDate.getTime());var one_min=1000*60;var getMins=Math.ceil(getTimeDIff/one_min);var getOutput='';if(getMins<1){getOutput="1 min ago";}else if(getMins<59){getOutput="6 mins ago";}else if(getMins>60&&getMins<240){var getHrs=newDate.getHours();var getAMPM="";if(getHrs<=12){getAMPM=" am";}else{getHrs=(getHrs-12);getAMPM=" pm";}
getOutput=newDate.getHours()+":"+newDate.getMinutes()+getAMPM;}
return(getOutput==='')?null:getOutput;}};
dj.module.assasinModule={init:function(flashNamespace){if(typeof flashNamespace=='undefined'){flashNamespace='';}
var cnt=$$('.viModule [id^=assasinMedia]');if(cnt===null){return;}
for(var index=0,length=cnt.length;index<length;++index){var t=cnt[index].className.split('::');if(t&&t[1]!=='undefined'){var source=t.first();var id=t[1];var caption=t[2];if(source===flashNamespace+'VIDEO'){this.videoPlayer=new dj.widget.video.Video(cnt[index].identify(),id,'','',caption);}
else if(source===flashNamespace+'FLASH'){this.flashPlayer=new dj.widget.flash.Flash(cnt[index].identify(),id,caption);}}}}};
dj.module.emailSignUpNonSub={init:function(){this.isPartner=document.getElementsByTagName("div")[0].hasClassName('subType-partner');if(this.isPartner){this.oEmailSignUpNonSub=$('emailSignUpNonSub');this.oEmailSignUpNonSub.getElementsByTagName('a')[0].href='/pznsetup/pub/email/setup.html';}},initializeContainer:function(oContainer){if(oContainer!==null){this.setUpControllers(oContainer);}},setUpControllers:function(oContainer){this.oemailSignUpNonSubSubmit=oContainer.down(".emailSignUpNonSubSubmit");var that=this;this.oemailSignUpNonSubSubmit.observe("click",function(ev){Event.stop(ev);that.signUp(oContainer);});oContainer.down(".txtEmail").observe("click",function(ev){Event.stop(ev);if(this.value==="Please enter your email"||this.value==="Enter Your Email Address"||this.value==="Please enter a valid email address"){this.value="";}});},signUp:function(oContainer){this.oContent=oContainer.down(".mainContentNonSub");this.oContentForm=this.oContent.down("form");this.oMessageSuccess=oContainer.down(".successMessageNonSub");this.oMessageError=this.oContent.down(".errorMessageNonSub");this.txtEmail=oContainer.down(".txtEmail");this.hiddenClass="hidden";this.signUpUrl="/emailservice/email-signup";this.userLoginName="null";this.userEmail="";this.displayNames="";var oForm=$H(this.oContentForm.serialize().parseQuery());var oFormLength=oForm.size();if(this.txtEmail.value===""||this.txtEmail.value==="Please enter your email"||this.txtEmail.value==="Enter Your Email Address"||this.txtEmail.value==="Enter Your Email Address"){this.txtEmail.value="Please enter your email";return;}
if(!this.validateEmail(this.txtEmail.value)){this.txtEmail.value="Please enter a valid email address";return;}
this.postBody=this.buildPostBody(oContainer);if(this.displayNames===""){return;}
this.displayNames=this.displayNames+"&nbsp;";this.oContainer=oContainer;var that=this;this.request=new Ajax.Request(this.signUpUrl,{method:'post',postBody:that.postBody,contentType:'text/xml',onComplete:function(transport,exception){if(200==transport.status){that.showSuccess();}else if(409==transport.status){that.showError();}else if(500==transport.status){that.showContent();console.error("{emailSignUpNonSub} error %s - server error",transport.status);}
that.oContainer.select(".userEmail").each(function(el){el.innerHTML=that.userEmail;});that.oContainer.select(".displayNames").each(function(el){el.innerHTML=that.displayNames;});}});},buildPostBody:function(oContainer){this.userEmail=oContainer.down(".txtEmail").value;var x=[];x[x.length]="<customer>";x[x.length]="<login-name></login-name>";x[x.length]="<contacts class=\"java.util.ArrayList\">";x[x.length]="<contact><last-modified-by>"+this.userEmail+"</last-modified-by><contact-address>"+this.userEmail+"</contact-address><contact-status>V</contact-status>";x[x.length]="<bulk-emails class=\"java.util.ArrayList\">";var that=this;var oForm=$H(this.oContentForm.serialize().parseQuery());oForm.each(function(el){if(el[0].startsWith("checkbox")){x[x.length]="<bulk-email><opt-in-flag>1</opt-in-flag><email-type-id>"+el[1]+"</email-type-id></bulk-email>";var temp=oForm.get("displayName"+el[1]);if(temp!==""){if(that.displayNames===""){that.displayNames=temp;}else{that.displayNames=that.displayNames+" and "+temp;}}}});x[x.length]="</bulk-emails>";x[x.length]="</contact>";x[x.length]="</contacts>";x[x.length]="<products class=\"java.util.ArrayList\">";x[x.length]="<product><id>2</id><name>WSJ</name><description>WSJ Email Product</description></product>";x[x.length]="</products>";x[x.length]="</customer>";x=x.join('\n');return x;},showSuccess:function(){this.oContent.addClassName(this.hiddenClass);this.oMessageError.addClassName(this.hiddenClass);this.oMessageSuccess.removeClassName(this.hiddenClass);},showError:function(){this.oContent.removeClassName(this.hiddenClass);this.oMessageSuccess.addClassName(this.hiddenClass);this.oMessageError.removeClassName(this.hiddenClass);},showContent:function(){this.oMessageSuccess.addClassName(this.hiddenClass);this.oMessageError.addClassName(this.hiddenClass);this.oContent.removeClassName(this.hiddenClass);},validateEmail:function(email){this.invalidEmailChars=" ?!#$%&*()\"||<>=+;:][{}/\\";if(email==""){return false;}
for(count=0;count<this.invalidEmailChars.length;count++){this.badChar=this.invalidEmailChars.charAt(count);if(email.indexOf(this.badChar,0)>-1){return false;}}
this.lastAtSign=email.lastIndexOf("@");this.firstAtSign=email.indexOf("@");this.lastPeriod=email.lastIndexOf(".");return(this.firstAtSign>0&&this.firstAtSign==this.lastAtSign&&this.lastPeriod>=this.firstAtSign+2&&this.lastPeriod<=email.length-3&&email.charAt(this.firstAtSign+1)!=".");}};
dj.module.emailSignUp={init:function(){this.isPartner=$(document.getElementsByTagName("div")[0]).hasClassName('subType-partner');if(this.isPartner){this.oEmailSignUpNonSub=$('emailSignUpNonSub');this.oEmailSignUpNonSub.getElementsByTagName('a')[0].href='/pznsetup/pub/email/setup.html';}
this.oContainers=$$("div.emailSignUp");var that=this;this.oContainers.each(function(el){that.initializeContainer(el);});},initializeContainer:function(oContainer){if(oContainer!==null){this.setUpControllers(oContainer);oContainer.down(".userLoginName").setAttribute('id','emailFNameLName');dj.util.User.renderCallsign('emailFNameLName');this.setSpanishTexts(oContainer);}},setSpanishTexts:function(oContainer){if(oContainer.down("h3").innerHTML.indexOf("Spanish")!==-1){oContainer.down("h3").innerHTML="Bolet&iacute;n de Noticias WSJ Americas";oContainer.down("p").innerHTML="Suscr&iacute;base al bolet&iacute;n de The Wall Street Journal Americas para recibir en su email una selecci&oacute;n diaria de las principales noticias, an&aacute;lisis, columnas y video en espa&ntilde;ol.";var name=oContainer.down(".successMessage").down("p").down("strong").innerHTML;oContainer.down(".successMessage").down("p").innerHTML="Gracias <strong>"+name+"!</strong><br/>Usted recibir&aacute; el "+"<span class='displayNames'>Bolet?n de Noticias de WSJ Americas</span>"+"en su bandeja de entrada.";}},setUpControllers:function(oContainer){this.oemailSignUpSubmit=oContainer.down(".emailSignUpSubmit");var that=this;this.oemailSignUpSubmit.observe("click",function(ev){Event.stop(ev);that.signUp(oContainer);});oContainer.down(".txtEmail").observe("click",function(ev){this.value="";});},signUp:function(oContainer){this.oContent=oContainer.down(".mainContent");this.oContentForm=this.oContent.down("form");this.oMessageSuccess=oContainer.down(".successMessage");this.oMessageError=this.oContent.down(".errorMessage");this.oemailSignUpSubmit=oContainer.down(".emailSignUpSubmit");this.txtEmail=oContainer.down(".txtEmail");this.hiddenClass="hidden";this.signUpUrl="/emailservice/email-signup";this.userLoginName="";var that=this;this.userEmail=oContainer.down(".userEmail").innerHTML;dj.util.User.getUserId(function(userId){that.userLoginName=userId});epiton.runOnReady(function(){that.userEmail=epiton.userinfo.UserInfo.getEmailAddress()});this.displayNames="";var oForm=$H(this.oContentForm.serialize().parseQuery());var oFormLength=oForm.size();if(this.txtEmail.value===''||this.txtEmail.value==="Please enter your email"){this.txtEmail.value="Please enter your email";return;}
this.postBody=this.buildPostBody();if(this.displayNames===""){return;}
this.displayNames=this.displayNames+"&nbsp;";this.request=new Ajax.Request(this.signUpUrl,{method:'post',postBody:that.postBody,contentType:'text/xml',onComplete:function(transport,exception){if(200==transport.status){that.showSuccess(oContainer);}else if(409==transport.status){that.showError();}else if(500==transport.status){that.showContent();console.error("{emailSignUp} error %s - server error",transport.status);}}});},buildPostBody:function(){if(this.txtEmail.value!=="Enter Your Email Address"){this.userEmail=this.txtEmail.value;}
var isReg=false;dj.util.User.isLoggedIn(function(isLoggedIn){if(isLoggedIn){dj.util.User.isSubLoggedIn(function(subLoggedIn){if(!subLoggedIn){isReg=true;}});}});var region=dj.util.Region.getViewByRegion();var x=[];x[x.length]="<customer>";x[x.length]="<login-name>"+this.userLoginName+"</login-name>";x[x.length]="<contacts class=\"java.util.ArrayList\">";x[x.length]="<contact><last-modified-by>"+this.userLoginName+"</last-modified-by><contact-address>"+this.userEmail+"</contact-address><contact-status>V</contact-status>";x[x.length]="<bulk-emails class=\"java.util.ArrayList\">";var that=this;var oForm=$H(this.oContentForm.serialize().parseQuery());oForm.each(function(el){if(el[0].startsWith("checkbox")){var id=el[1];if(el[1]==="88"){if(region==="europe"){id="169";}else if(region==="asia"){id="167";}else if(region==="asia,india"){id="172";}else{}}else if(el[1]==="89"){if(region==="europe"){id="170";}else if(region==="asia"){id="168";}else if(region==="asia,india"){id="173";}else{}}
x[x.length]="<bulk-email><opt-in-flag>1</opt-in-flag><email-type-id>"+id+"</email-type-id></bulk-email>";var temp=oForm.get("displayName"+el[1]);if(temp!==""){if(temp.indexOf("In Spanish")!==-1){temp="Bolet&iacute;n de Noticias de WSJ Americas";}
if(that.displayNames===""){that.displayNames=temp;}else{that.displayNames=that.displayNames+" and "+temp;}}}});x[x.length]="</bulk-emails>";x[x.length]="</contact>";x[x.length]="</contacts>";x[x.length]="<products class=\"java.util.ArrayList\">";if(isReg){x[x.length]="<product><id>281</id><name>WSJ</name><description>WSJ Email Product</description></product>";}else{x[x.length]="<product><id>2</id><name>WSJ</name><description>WSJ Email Product</description></product>";}
x[x.length]="</products>";x[x.length]="</customer>";x=x.join('\n');return x;},showSuccess:function(oContainer){var that=this;oContainer.select(".userLoginName").each(function(el){el.innerHTML=$$("div.emailSignUp")[0].down(".userLoginName").innerHTML;});oContainer.select(".displayNames").each(function(el){el.innerHTML=that.displayNames;});this.oContent.addClassName(this.hiddenClass);this.oMessageError.addClassName(this.hiddenClass);this.oMessageSuccess.removeClassName(this.hiddenClass);},showError:function(){this.userEmail="";this.oContent.removeClassName(this.hiddenClass);this.oMessageSuccess.addClassName(this.hiddenClass);this.oMessageError.removeClassName(this.hiddenClass);},showContent:function(){this.oMessageSuccess.addClassName(this.hiddenClass);this.oMessageError.addClassName(this.hiddenClass);this.oContent.removeClassName(this.hiddenClass);}};
dj.module.communityUser={ajaxPost:function(postUrl,args,callback){var req=new Ajax.Request(postUrl,{method:'post',parameters:args.toQueryString(),onException:function(transport,exception){console.error('Exception occured while posting posting Ajax Request : '+exception);},onComplete:function(transport,json){callback(transport,json);}});},ajaxUpdate:function(oElement,postUrl,args,callback){var req=new Ajax.Updater(oElement,postUrl,{method:'post',parameters:args.toQueryString(),onException:function(transport,exception){console.error('Exception occured during Ajax Request :'+exception);},onComplete:function(transport,json){callback(transport,json);}});},handleError300:function(postUrl,args,uFirstName,uLastName,callback){this.initializeCommunityUserPopup(postUrl,args,uFirstName,uLastName,300,callback);this._openCommunityUserPopup();},handleError301:function(uFirstName,uLastName){this.initializeCommunityUserPopup("","",uFirstName,uLastName,301);this._openCommunityUserPopup();},_openCommunityUserPopup:function(){this.oPopup.absolutize();var dOffsets=document.viewport.getScrollOffsets();var dOffsetTop=dOffsets.top;var popupOffset=dOffsetTop+200;this.oPopup.setStyle({top:popupOffset+"px"});var panel=new dj.widget.panel.ModalPanel(null,$$("div.communityUserPopup").first(),{closeModalPanelEvent:"click",closeModalPanelButtonSelector:".popupClose"});},initializeCommunityUserPopup:function(postUrl,args,uFirstName,uLastName,errorCode,callback){this.oPopup=$$("div.communityUserPopup").first();this.oUnblockedUserContainer=this.oPopup.down(".unblockedUser");this.oBlockedUserContainer=this.oPopup.down(".blockedUser");this.oCommentsText=this.oPopup.down(".commentsText");this.oAskQuestionText=this.oPopup.down(".askQuestionText");this.oUserFirstName=this.oPopup.getElementsBySelector(".userFirstName");this.oUserLastName=this.oPopup.getElementsBySelector(".userLastName");if((postUrl!==null)&&(postUrl.indexOf('SaveQuestion')!==-1)){this.oAskQuestionText.show();this.oCommentsText.hide();}else{this.oAskQuestionText.hide();this.oCommentsText.show();}
var that=this;var isUserFirstLastNamePresent=true;if(((uFirstName===null)||(uFirstName===''))&&((uLastName===null)||(uLastName===''))){isUserFirstLastNamePresent=false;}
if(errorCode===300){this.oBlockedUserContainer.setStyle({display:"none"});this.oUnblockedUserContainer.setStyle({display:"block"});this.oPost=this.oPopup.down(".post");this.oChkBox=this.oPopup.down(".chkBox");this.oWhyLink=this.oPopup.down(".whyLink");this.oWhyLinkPara=this.oPopup.down(".whyLinkPara");this.oFirstNameText=this.oPopup.down(".firstNameText");this.oLastNameText=this.oPopup.down(".lastNameText");this.oUserNameInfoContainer=this.oPopup.down(".userNameInfoContainer");this.oErrorMessage=this.oPopup.down(".errorMessage");this.oCommunityLink=this.oPopup.down(".communityLink");this.oPrivacyLink=this.oPopup.down(".privacyLink");this.oTermsLink=this.oPopup.down(".termsLink");if(isUserFirstLastNamePresent===false){this.oUserNameInfoContainer.show();}else{this.oUserNameInfoContainer.hide();this.oUserFirstName.each(function(oFirstName){oFirstName.innerHTML=", "+uFirstName;});this.oUserLastName.each(function(oLastName){oLastName.innerHTML=uLastName+",";});}
if(this.whyLinkListener!==null){Event.stopObserving(this.oWhyLink,"click",this.whyLinkListener);}
if(this.communityLinkListener!==null){Event.stopObserving(this.oCommunityLink,"click",this.communityLinkListener);}
if(this.privacyLinkListener!==null){Event.stopObserving(this.oPrivacyLink,"click",this.privacyLinkListener);}
if(this.termsLinkListener!==null){Event.stopObserving(this.oTermsLink,"click",this.termsLinkListener);}
if(this.postListener!==null){Event.stopObserving(this.oPost,"click",this.postListener);}
this.whyLinkListener=function(event){that.oWhyLinkPara.show();that.oWhyLink.hide();}.bindAsEventListener(this.oWhyLink);this.communityLinkListener=function(event){Event.stop(event);dj.util.Url.openWin("/community");}.bindAsEventListener(this.oCommunityLink);this.privacyLinkListener=function(event){Event.stop(event);dj.util.Url.openWin("/public/page/privacy_policy.html");}.bindAsEventListener(this.oPrivacyLink);this.termsLinkListener=function(event){Event.stop(event);dj.util.Url.openWin("/public/page/subscriber_agreement.html");}.bindAsEventListener(this.oTermsLink);this.postListener=function(event){if(that.oChkBox.checked===true){args.set('mode',2);}else
if(that.oChkBox.checked===false){args.set('mode',1);}
if(isUserFirstLastNamePresent===false){if(((that.oFirstNameText.value===null)||(that.oFirstNameText.value===''))&&((that.oLastNameText.value===null)||(that.oLastNameText.value===''))){Event.stop(event);that.oErrorMessage.show();that._openCommunityUserPopup();}else{args.set('firstName',that.oFirstNameText.value);args.set('lastName',that.oLastNameText.value);that.ajaxPost(postUrl,args,callback);}}else{args.set('firstName',uFirstName);args.set('lastName',uLastName);that.ajaxPost(postUrl,args,callback);}}.bindAsEventListener(this.oPost);this.oWhyLink.observe("click",this.whyLinkListener);this.oCommunityLink.observe("click",this.communityLinkListener);this.oPrivacyLink.observe("click",this.privacyLinkListener);this.oTermsLink.observe("click",this.termsLinkListener);this.oPost.observe("click",this.postListener);}else
if(errorCode===301){this.oBlockedUserContainer.setStyle({display:"block"});this.oUnblockedUserContainer.setStyle({display:"none"});if(isUserFirstLastNamePresent===true){this.oUserFirstName.each(function(oFirstName){oFirstName.innerHTML=uFirstName;});this.oUserLastName.each(function(oLastName){oLastName.innerHTML=uLastName;});}}}};/*
  networkHat object...loads scripts needed for autocomplete only when user interacts
  with the search box.  Traps mouseover and focus events, and then loads and initializes
  the infocomplete for the
*/
if (typeof dj == "undefined") { dj = {}; }
if (typeof dj.widget == "undefined") { dj.widget = {}; }
if (typeof dj.widget.networkHat == "undefined") { dj.widget.networkHat = {}; }
if (typeof dj.context.networkHat == "undefined") { dj.context.networkHat = {}; }

dj.widget.networkHat.AutoComplete=Class.create({
    initialize: function() {

        this.d=document;

        if (typeof cdnDomain != 'undefined') {
            this.cdnDomain=cdnDomain;
        }
        this.uP="";
        if (typeof uP != 'undefined') {
            this.uP=uP;
        }

        var dt = new Date();
        var dtStamp=""+dt.getFullYear()+dt.getMonth()+dt.getDay();

        if (this.d.location.host.indexOf('s.dev') != -1 || this.d.location.host.indexOf('idev') != -1) {
            //  A hack until cdnDomain for SAT/IDEV actually wil serve up /djscript URLs
            this.jScript = this.uP + "/djscript/j_networkHat-"+dtStamp+".js";
        } else {
            this.jScript = this.cdnDomain + "/djscript/j_networkHat-"+dtStamp+".js";
        }

        // Set the required globals
        var fw = this.d.getElementsByTagName("div")[0];
        var loggedIn = (fw.className.indexOf("subType-subscribed") !== -1);

        //loggedIn = (typeof loggedIn !== "undefined") ? loggedIn : false;
        var searchBoxID = 'hat_input_auto';
        this.inputDefaultText="News, Quotes, Companies, Videos";

        // Retrieve the needed dom-elements
        var oHat = $("hat_div");
        this.oHatInput = $("hat_input_auto");
        var oHatSelect = oHat.select(".hat_select");
        var oHatSelectItems = oHat.select(".hat_drop_item");
        var oHatTabs = oHat.select(".hat_tab").reject(function(n) { return n.hasClassName("hat_select"); });
        var oHatMenu = $("hat_more_menu");

        // Set default style
        if (Prototype.Browser.IE && (this.d.domain.indexOf('ds.sat.wsj.com') != -1 ||this.d.domain.indexOf('ds.wsj.com') != -1)) {
            dj.util.Url.addStylesheet("http://s.wsj.net/css/hatIEPortfolio.css");
        }
        oHat.setStyle({
            "width": "989px",
            "height": "28px",
            "position": "relative",
            "zIndex": 999999
        });

        oHatMenu.setStyle({
            width: "155px"
        });

        // attach event handlers to menu buttons/tabs at top
        oHatTabs.invoke("observe", "mouseover", function(ev){
            hat.tabover(this);
        });
        oHatTabs.invoke("observe", "mouseout", function(ev){
            hat.tabout(this);
        });

        oHatSelect.invoke("observe", "mouseover", function(ev){
            hat.moremenu();
        });
        oHatSelect.invoke("observe", "mouseout", function(ev){
            hat.moremenuhide();
        });

        oHatSelectItems.invoke("observe", "mouseover", function(ev){
            hat.menuover(this);
        });
        oHatSelectItems.invoke("observe", "mouseout", function(ev){
            hat.menuout(this);
        });

        var that=this;
        //  Instead of loading /djscript/j_networkHat.js up-front, load it on certain events in the search box:
        this.eventProxy = {
            bload: function(event) {
                that.onHatLoad();
            },
            bclearField: function(event) {
                that.clearField();
                return true;
            }
        };
        this.eventProxy.bload = this.eventProxy.bload.bindAsEventListener(this.eventProxy);
        this.eventProxy.bclearField = this.eventProxy.bclearField.bindAsEventListener(this.eventProxy);

        this.oHatInput.observe("focus", this.eventProxy.bload );
        this.oHatInput.observe("mouseover", this.eventProxy.bload );
        this.oHatInput.observe("click", this.eventProxy.bclearField );
        this.oHatInput.observe("keydown", this.eventProxy.bclearField );

        if ( this.oHatInput.value !== "" && this.oHatInput.value != this.inputDefaultText ||
                dj.context.networkHat.jnetworkHatJsLoaded ) {
            //if text already in field, initialize hat.  User got focus or clicked before the hanlder was attached
            this.onHatLoad();
        }
        this.setFieldDefault();
    },
    setFieldDefault: function() {
        // Add "prompt" text to oHatInput if it's blank, if user has not typed
        if (this.oHatInput.value === "") {
            this.oHatInput.value=this.inputDefaultText;
            this.oHatInput.addClassName("unUsed");
        }

    },
    clearField: function(){
        this.stopObservingClick();
        var unUsed = this.oHatInput.hasClassName("unUsed");
        if (unUsed)
        {
            this.oHatInput.value="";
        }
        this.oHatInput.removeClassName("unUsed");
    },
    stopObservingClick: function() {
        this.oHatInput.stopObserving("click", this.eventProxy.bclearField );
        this.oHatInput.stopObserving("keydown", this.eventProxy.bclearField );
    },
    onHatLoad: function() {

        this.oHatInput.stopObserving("focus", this.eventProxy.bload );
        this.oHatInput.stopObserving("mouseover", this.eventProxy.bload);

        // if j_networkHat.js already loaded, skip to init
        if ( dj.context.networkHat.jnetworkHatJsLoaded ) {
            this.initInfoComplete();
            return;
        }

        //load j_networkhat.js
        var hds=this.d.getElementsByTagName('head');
        var hd;
        if (!hds) {
            hd = new Element('head');
            this.d.getElementsByTagName('body')[0].appendChild(hd);
        } else {
            hd = hds[0];
        }
        this.jsNode=this.loadAutoCompleteScript(this.jScript);

    },
    loadAutoCompleteScript: function(jScript) {

        var jsNode = this.d.createElement("script");
        jsNode.type = "text/javascript";
        jsNode.src = jScript;

        if (this.d.getElementsByTagName("head").length === 0) {
            var headNode = this.d.createElement("head");
            this.d.getElementsByTagName("html")[0].appendChild(headNode);
        }

        this.d.getElementsByTagName("head")[0].appendChild(jsNode);
        return jsNode;
    },
    initInfoComplete: function() {

        // Set default style
        if (Prototype.Browser.IE && (this.d.domain.indexOf('ds.sat.wsj.com') != -1 || this.d.domain.indexOf('ds.wsj.com') != -1)) {
            dj.util.Url.addStylesheet("http://s.wsj.net/css/hatIEPortfolio.css");
        }

        initInfoComplete();
        this.stopObservingClick();

        // Set-up event listeners
        this.oHatInput.observe("focus", function(ev){
            searchFieldOnFocus(this);
            setFocused(this);
        });

        this.oHatInput.observe("keypress", showHideCRDrpdwn, 'hide');
        this.oHatInput.observe("blur", showHideCRDrpdwn, 'show');

        var textValue =this.oHatInput.value;

        if (textValue && textValue != this.inputDefaultText) {
            InfoComplete.autoComplete.sendQuery(textValue);
        }
    }
});


if(typeof dj=="undefined"){dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.uberHat=="undefined"){dj.widget.uberHat={};}
(function(){var _du=dj.util;var _dwu=dj.widget.uberHat;(_dwu.UberHat=function(cfg){this._cfg=dj.lang.clone(this.DEFAULT_CONFIG);dj.lang.mixin(this._cfg,cfg);this.matchingHat="";if(this._cfg.divExists){this.loadPartnerDiv();}else{this.getUserInfo();}}).prototype={DEFAULT_CONFIG:{partnerDivExists:false,partnerDivId:"partnerHat",partnerClassPrefix:"uberHatPartner-",hatInfo:{"HILTON":{"id":"hiltonHat","className":"wsj_partnerhat","CSSFILE":"hilton.css","content":'<div class="partnerhat_container"><div class="partnerhat_content">'+'<div class="partnerhat_col1"></div><div class="partnerhat_col2">'+'<ul class="inlineNav"><li class="listFirst"><a href="http://www.hilton.com/">Hilton.com</a></li><li><a href="http://www.weather.com/">Weather</a></li>'+'<li class="listLast"><a href="http://www.foxsports.com/">Fox Sports</a></li></ul>'+'<span class="partnerhat_subscribe"><a href="https://order.wsj.com/sub/xdef/027/6BCWNM_OOT">Subscribe to The Wall Street Journal</a></span>'+'</div></div></div><div class="partnerhat_shadow"> </div>'}}},getUserInfo:function(){var hatInfo=this._cfg.hatInfo;for(var key in hatInfo){if(hatInfo.hasOwnProperty(key)){this.localCallbackWrapper(key);}}},localCallbackWrapper:function(roleName){var that=this;var role=roleName;dj.util.User.hasRole(roleName,function(userHasRole){that.userCallback(userHasRole,role);});},userCallback:function(userHasRole,role){if(userHasRole){this.renderHat(this._cfg.hatInfo[role]);}},renderHat:function(hatInfo){var reallywide=dj.lang.query("div.fullwide")[0];var hat=document.createElement('div');hat.className=(hatInfo.className)||"uberHat";hat.id=(hatInfo.id)||"uberHat";reallywide.insertBefore(hat,reallywide.firstChild);hat.innerHTML=hatInfo.content;},loadPartnerDiv:function(){var div=dj.lang.byId(this._cfg.partnerDivId);if(div){var divClasses=div.className;var classArray=divClasses.split(' ');var pcPrefix=this._cfg.partnerClassPrefix;var partner="";for(var i=0,caLength=classArray.length;i<caLength;i++){var className=classArray[i];if(className.indexOf(pcPrefix)===0){partner=className.substring(pcPrefix.length);}}
if(partner){var hatInfo=this._cfg.hatInfo[partner];this.insertHat(div,hatInfo);}
var isIE6=(window.external&&typeof window.XMLHttpRequest=="undefined");if(isIE6){var iframe=document.createElement('iframe');iframe.className="wsj_partnerhat_iframe";iframe.setAttribute("id","partnerhat_iframe");iframe.setAttribute("src","javascript:'';");iframe.setAttribute("marginHeight","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("scrolling","no");iframe.setAttribute("frameBorder","0");div.parentNode.appendChild(iframe);var thehat=document.getElementById("partnerhat");var thehat_iframe=document.getElementById("partnerhat_iframe");var d=document;window.onscroll=function(){var iebody=(d.compatMode&&d.compatMode!="BackCompat")?d.documentElement:d.body;var thisy=iebody.scrollTop;thehat.style.top=thisy+"px";thehat_iframe.style.top=thisy+"px";};}}},insertHat:function(div,hatInfo){if(hatInfo){div.innerHTML=hatInfo.content;}}};}());
if(typeof dj=="undefined"){dj={};}
if(typeof dj.widget=="undefined"){dj.widget={};}
if(typeof dj.widget.survey=="undefined"){dj.widget.survey={};}
(function(){var _du=dj.util;var _dws=dj.widget.survey;(_dws.SurveyPopup=function(cfg){this._cfg=dj.lang.cloneMixin(this.DEFAULT_CONFIG,cfg);this._duu=dj.util.Url;this._duc=dj.util.Cookie;try{if(this._cfg.userHasRole){var that=this;dj.util.User.hasRole(this._cfg.userHasRole,function(userHasRole){if(userHasRole){that.popup();}});}else{this.popup();}}catch(e){throw e;}}).prototype={DEFAULT_CONFIG:{"url":"","width":740,"height":425,"bottom":"15px","left":"10%","cookieName":"survey","windowName":"survey","userHasRole":"","enableInterval":"","noRepeatInterval":"7d+","frequencyPercent":100,"cookieGroupExpirationDays":90,"divId":"sd1Scrim","iframeId":"sw1","closeUrlSuffix":"?closeDomain="+window.location.host,"newsReelMatch":"NewsReel"},popup:function(){var Cookie=this._duc;var Url=this._duu;if(this._canShowPopup()){this._setNoRepeatCookie(this._cfg.noRepeatInterval);this.insertIframe();this.showIframe();}},insertIframe:function(){this.body=document.body;var body=this.body;if(body){var surveyDiv=document.createElement('div');this.surveyDiv=surveyDiv;surveyDiv.id=this._cfg.divId;surveyDiv.name=this._cfg.divId;surveyDiv.style.zIndex="9999";surveyDiv.innerHTML=['<div id="sd1Frame">','<div id="sd1">','<iframe name="',this._cfg.iframeId,'" id="',this._cfg.iframeId,'" src="about:blank" height="',this._cfg.height,'" width="',this._cfg.width,'">','</div>','</div>'].join('');body.appendChild(surveyDiv);this.surveyIframe=dj.lang.byId(this._cfg.iframeId);}},showIframe:function(){this.surveyIframe.src=this._cfg.url+this._cfg.closeUrlSuffix;this.surveyDiv.style.display="";var that=this;window.CloseSurvey=function(){that.hideIframe();};},hideIframe:function(){this.surveyDiv.style.display="none";},showIframeDelay:function(){var that=this;setTimeout(function(){that.showIframe();},this._calcMilliseconds(this._cfg.enableInterval));},_canShowPopup:function(){if(document.location.href.indexOf(this._cfg.newsReelMatch)>-1){return false;}
var showPopup=true;var noRepeatCookie=this._duc.getGroupCookie("DJCOOKIE",this._cfg.cookieName+"NoRepeat");var now=new Date();if(noRepeatCookie){var noRepeatDate=new Date(noRepeatCookie);if((noRepeatDate-now)>0){showPopup=false;}else{this._setEnableIntervalCookie(this._cfg.enableInterval);this._duc.deleteGroupCookie("DJCOOKIE",this._cfg.cookieName+"NoRepeat");}}
if(this._cfg.enableInterval){var enableCookie=this._duc.getGroupCookie("DJCOOKIE",this._cfg.cookieName+"Enable");if(enableCookie){var enableDate=new Date(enableCookie);if((enableDate-now)>0){showPopup=false;}}else{this._setEnableIntervalCookie(this._cfg.enableInterval);showPopup=false;var that=this;setTimeout(function(){that.popup();},this._calcMilliseconds(this._cfg.enableInterval));}}
if(showPopup&&this._cfg.frequencyPercent){var dice=Math.floor(Math.random()*100);if(dice>=this._cfg.frequencyPercent){showPopup=false;}}
return showPopup;},_setNoRepeatCookie:function(interval){var noRepeatDate=this._calcDate(interval);this._duc.setGroupCookie("DJCOOKIE",this._cfg.cookieName+"NoRepeat",noRepeatDate,this._cfg.cookieGroupExpirationDays);},_setEnableIntervalCookie:function(interval){var enableDate=this._calcDate(interval);this._duc.setGroupCookie("DJCOOKIE",this._cfg.cookieName+"Enable",enableDate,this._cfg.cookieGroupExpirationDays);},_calcDate:function(D){var MS=this._calcMilliseconds(D),dO=new Date();dO.setTime((D.substring(D.length-1,D.length)=="+")?dO.getTime()+MS:dO.getTime()-MS);return dO.toGMTString();},_calcMilliseconds:function(D){var TD=D.substring(0,D.length-2),TC=D.substring(D.length-2,D.length-1).toLowerCase(),MS=0;MS=(TC=="m")?TD*((24*60*60*1000)*30):MS;MS=(TC=="d")?TD*(24*60*60*1000):MS;MS=(TC=="s")?TD*1000:MS;return MS;}};}());<!-- fastdynapage - sbkj2kapachep07 - Mon 08/31/09 - 00:56:51 EDT -->
