var processing=false;
function isntProcessing(ms){;if(!processing){;return (processing=true);}else{;setTimeout("processing=false",ms);return false;};}
function doSearch() {;return isntProcessing(15000);}
function resetSearch() {;processing=false;}
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.location="".concat(U);if(R){;FO.selectedIndex=0;};}
}
function GenRandomNum(){
  var DO=new Date
  return "".concat(("".concat(Math.random()).replace(/\./g,""))*DO.getSeconds())
}
function GetArg(N){;var i=0,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;}
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){;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:"");
}
var googleMod=/(mod=google)|(mod=msn)|(mod=nopop)/
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)&&(!googleMod.test(document.location))){
    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)?((e.srcElement.href && re.test(e.srcElement.href))?true:((e.srcElement.onclick && re.test(e.srcElement.onclick))?true:((e.srcElement.parentNode.href && re.test(e.srcElement.parentNode.href))?true:false))):((e.target)?((e.target.href && re.test(e.target.href))?true:((e.target.onclick && re.test(e.target.onclick))?true:((e.target.parentNode)?((e.target.parentNode.href && re.test(e.target.parentNode.href))?true:false):false))):false)  
}
var today = new Date();
var isFreeFriday = false;
var freeFriday = [new Date(2006, 9, 22), new Date(2006, 9, 29), new Date(2006, 10, 06), new Date(2006, 10, 13), new Date(2006, 10, 20), new Date(2006, 10, 27), new Date(2006, 11, 10)];
for (var i = 0; i < 7 && !isFreeFriday; i++){
	if(today.getDate()==freeFriday[i].getDate()&&today.getMonth()==(freeFriday[i].getMonth()-1)){
		isFreeFriday = true;
	}
}
// FreeFriday 12/15/2006
if(today.getMonth() == 11 && today.getDate() == 15){
	isFreeFriday = true;
}
if(isFreeFriday){
	var exitPath=new RegExp ("")
	//var ffSegment=new RegExp ("6_10245") // (exitPath.test(ffSegment))
	var ePu="http://online.wsj.com/ad/exit/freefriday-short.html",ePw=400,ePh=350
	function exitPopup(){
		if(!suppress_popup&&!GetCookie("WSJIE_LOGIN")&&(GetCookie("user_type")!='subscribed')&&(exitPath.test(document.location))&&(!googleMod.test(document.location)))
   	OpenWin(ePu,"Farewell",ePw,ePh,"off",1,0,0)
	}
}else{
	var exitPath=/public\/us/
	var ffSegment=new RegExp ("")
	var ePu="http://public.wsj.com/marketing/expop/exit_popup_3b.html",ePw=373,ePh=475
	function exitPopup(){
		if(!suppress_popup&&!GetCookie("WSJIE_LOGIN")&&(GetCookie("user_type")!='subscribed')&&(exitPath.test(document.location))&&(!googleMod.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"&&obj.tagName!="HTML"){
    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.adR,false)
    document.all.sliderSplash.style.pixelWidth=document.all.adR.style.pixelWidth
  }
  if((document.all.sliderOpen)&&(document.all.sliderOpen.style.pixelWidth>0)){
    document.all.sliderOpen.style.pixelWidth=document.all.adR.style.pixelWidth
    document.all.sliderOpen.style.left=getDist(window.top.document.all.adR,false)
    blueBar=90
    iframeTop=getDist(document.all.adR,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]:"";

var segQS = "";
var rsinetsegs = "";  // init in case RSI doesn't set this
function saveSegment(rsinetsegs){
var crumbs = (GetCookie("DMSEG"))?"".concat(GetCookie("DMSEG")).split("&"):"";
var howMany = (crumbs[4])?crumbs[4]:"";
var segments = (crumbs[5])?crumbs[5]:"";
var dmSegs = (segments)?segments.split(","):"";
var segQS = dmSegs.length > 0 ? "s=" + dmSegs[0] : "s=";
for (var i = 1; i < 12; i++){
segQS += (";s=" + (dmSegs[i]?dmSegs[i]:""));
}
for (var i = 12; i < 24; i++) {
segQS += (";s=" + (rsinetsegs[i-12]?""+rsinetsegs[i-12].substring(5):""));
}
SetCookie('RSISEG',segQS,'365d+');
} 
segQS = GetCookie("RSISEG");

var msrc=(GetCookie("etsFlag"))?GetCookie("etsFlag"):(GetArg("mod"));
var numads=0;
function changeIframeSrc(iframeId,iframeSrc){
	var iobj=document.getElementById("".concat(iframeId));
	if(iobj){
		try {
			var idoc;
			if (iobj.contentDocument) {
				// For NS6
				idoc= iobj.contentDocument; 
			} else if (iobj.contentWindow) {
				// For IE5.5 and IE6
				idoc=iobj.contentWindow.document;
			} else if (document.frames) {
				// For IE5/Mac
				iobj=document.frames[iframeId];
				idoc=iobj.document;
			} else if(document.all) {
				// For IE5
				iobj=document.all[iframeId];
				idoc=iobj.document;
			} else if (iobj.document) {
				idoc=iobj.document;
			} else {
				iobj.src=iframeSrc;
			}
			if ( idoc ) {
				idoc.location.replace(iframeSrc);
                                numads=numads+1;
			}
			return false;
		} catch ( errMsg ) {
			return true;
		}
	}
}

var ListOfIframes = new Object()
function LoadIframes(){
	for(ifid in ListOfIframes){
		var results = changeIframeSrc(ifid,"".concat(ListOfIframes[ifid]));
		if (!results) {
			continue;
		}
	}
	return false;
}

var segmentid = "";
var isSafari=(navigator.userAgent.toLowerCase().indexOf('safari') != -1);
var subscriber = (GetCookie("user_type") == "subscribed");

if(GetCookie("EDITOR")){;var u='104116116112058047047112114111100046101100119101098046100111119106111110101115046110101116',t='';for(i=0;i<u.length;i=i+3){;t+=String.fromCharCode(u.substring(i,i+3));};document.write('<script type="text/javascript" src="'+t+'/javascript/'+GetCookie("EDITOR")+'.js"></script>');}

/*	NEW REFRESH	*/
var a=new Array("window.location.reload(false)","window.location.replace(url)","window.location.href=url");var tempHTML = "";for(var i=0;i<a.length;i++){;tempHTML+='<script language="JavaScript'+((i>0)?"1."+i:"")+'">\n<!--\nfunction refreshWin(url){;'+a[i]+';}\n\/\/-->\n<\/script>';};document.write(tempHTML)
function printDoc(){  
  if (window.print) {
    window.print() ;  
  } else {
    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
    document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
    WebBrowser1.ExecWB(6, 2);
  }
}
function uescEnt(s){;return s.replace(/\&amp\;/ig,'&');}
function showSummary(linkObj, sbID){
  var so = document.getElementById("summary_"+sbID);
  var l = getDist(linkObj,false);
  if(so){
    so.className="p12 rolloverSummary"
    so.style.top=(getDist(linkObj,true)+linkObj.offsetHeight)+"px"
    so.style.left= (((l+so.offsetWidth)>document.body.offsetWidth)?((document.body.offsetWidth-so.offsetWidth)-20):(l))+"px"
  }
}
function hideSummary(sbID){
  var so = document.getElementById("summary_"+sbID);
  if(so){
    so.className="hidden"
  }
}

