function CalcDate(D){
  //args TimeValue & (Months|Days|Seconds) & (+|-)
  var TD=D.substring(0,D.length-2),TC=D.substring(D.length-2,D.length-1).toLowerCase(),MS=0,dO=new Date()
  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
  dO.setTime((D.substring(D.length-1,D.length)=="+")?dO.getTime()+MS:dO.getTime()-MS)
  return dO.toGMTString()
}
function DropDownGo(FO,W,R){
  var U=FO[FO.selectedIndex].value
  if(U!=null&&U!=""){;(W)?OpenWin(U,"DropdownPage"):window.top.location="".concat(U);if(R){;FO.selectedIndex=0;};}
}
function GenRandomNum(){
  var DO=new Date
  return "".concat(("".concat(Math.random()).replace(/\./g,""))*DO.getSeconds())
}
function GetCookie(N){
  //args cookieName(r)
  var co=document.cookie,pos=co.indexOf(N+"=")
  return (pos!=-1)?unescape(co.substring(pos+N.length+1,(co.indexOf("; ",pos)!=-1?co.indexOf("; ",pos):co.length))):null
}
function OpenWin(U,N,W,H,A,F,L,T,C){
  //args Url(r),Name(r),Width(opt),Height(opt),Attributes(opt),Focus(opt),Left(opt),Top(opt),Center(opt)
  var WO,WA=new Array(),a=new Array("directories","location","menubar","resizable","scrollbars","status","titlebar","toolbar")
  A=(A)?"".concat(A):"on"
  for(i=0;i<a.length;i++){;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.focus();}
}
function SetCookie(N,V,E,P,D,S){
  //args Name(r),Value(r),Expire(opt),Path(opt),Domain(opt),Secure(opt)
  if(E){;E=((E.charAt(E.length-1)=="+")||(E.charAt(E.length-1)=="-"))?CalcDate(E):E;}
  document.cookie=N+"="+escape(V)+((E)?"; expires="+E:"")+((P)?"; path="+P:"; path=/")+((D)?"; domain="+D:"; domain=.wsj.com")+((S)?"; secure="+S:"");
}
function SurveyPopUp(N,U,P,E,W,H,A,L,T){
  //args Name(r),Url(r),Percent(r),Expire(r),Width(r),Height(r),Attributes(r),Left(r),Top(r)
  var dO=new Date()
  if((!GetCookie("WSJIE_LOGIN"))&&GetCookie("user_type")!='subscribed'&&(!GetCookie(N))&&((dO.getTime()%100)<P)){
    SetCookie(N,"true",E)
    if(GetCookie(N))
      OpenWin(U,N,W,H,A,true,L,T)
  }
}
var loggedIn=(GetCookie("fastlogin")||GetCookie("wsjproducts"))?true:false
//***** Add custom functions below this line *****
function PJ_SetDefaultFocus(){
  var FO=(document.myForm)?((document.myForm.companyList)?document.myForm.companyList:((document.myForm.companyfund_1)?document.myForm.companyfund_1:((document.myForm.myLayout)?document.myForm.myLayout:""))):""
  if(FO){;FO.selectedIndex=0;FO.focus();}
}
function update_frame(myoptions){;DropDownGo(myoptions,false,1);}
document.onmousedown=isJournalURL
var suppress_popup=false
if(document.captureEvents)
  document.captureEvents(Event.MOUSEDOWN)
function isJournalURL(e){
  var re=/wsj.com/
  var e=(!e)?window.event:e
  suppress_popup=(e.srcElement)?((re.test(e.srcElement.href))?true:false):((e.target.parentNode)?((re.test(e.target.parentNode))?true:false):((re.test(e.target))?true:false))
}
var exitPath=/public\/us/
var ePu="http://public.wsj.com/expop/webbulletpoints.html",ePw=374,ePh=477
function exitPopup(){
  if(!suppress_popup&&!GetCookie("WSJIE_LOGIN")&&(GetCookie("user_type")!='subscribed')&&(exitPath.test(document.location)))
    OpenWin(ePu,"Farewell",ePw,ePh,"off",1,0,0)
}
function NewWindow(U,N,W,H,S){
  OpenWin(U,N,374,477,((S)?"scroll,resizable":"resizable"),true,100,100)
}
var userid=GetCookie("UBID"),userid=(userid)?((userid.indexOf(".")>-1)?(userid.split(".")[0]):userid):""
function GenericPopUp(U){
  OpenWin(U,"_blank",640,480,"scroll")
}
function hideConfirmation(cat) {
  OpenWin("/setup/hide_confirmation?category="+(cat.replace(/ /g,"+")),"newwin",310,260,"status",true,100,300)
}

function getDist(obj,isTop){
  var acum=0
  while(obj.tagName!="BODY"){
    acum+=isTop?obj.offsetTop:obj.offsetLeft
    obj=obj.offsetParent
  }
  return acum
}

function resizeSlider(){
  if((document.all.sliderSplash)&&(document.all.sliderSplash.style.pixelWidth>0)){
    document.all.sliderSplash.style.left=getDist(window.top.document.all.iframe4,false)
    document.all.sliderSplash.style.pixelWidth=document.all.iframe4.style.pixelWidth
  }
  if((document.all.sliderOpen)&&(document.all.sliderOpen.style.pixelWidth>0)){
    document.all.sliderOpen.style.pixelWidth=document.all.iframe4.style.pixelWidth
    document.all.sliderOpen.style.left=getDist(window.top.document.all.iframe4,false)
    blueBar=90
    iframeTop=getDist(document.all.iframe4,true)
    height=iframeTop-blueBar+250
    if(height<540)
      height=540
    document.all.sliderOpen.style.height=Height
  }
}
window.onresize=resizeSlider
var crumbs = (GetCookie("DMSEG"))?"".concat(GetCookie("DMSEG")).split("&"):"";
var howMany = (crumbs[4])?crumbs[4]:"";
var segments = (crumbs[5])?crumbs[5]:"";
var seg = (segments)?segments.split(","):"";
var mv = new Array("firstSeg","secondSeg","thirdSeg","fourthSeg","fifthSeg","sixthSeg")
for(i=0;i<mv.length;i++){
  eval("var "+mv[i]+" = (seg["+i+"])?seg["+i+"]:''");
}
var lastSeg = (seg[seg.length - 1])?seg[seg.length - 1]:"";