<!--

function MM_jumpMenu(targ,selObj,restore){ //v3.0
	if ( !selObj || selObj.options[selObj.selectedIndex].value == "" )
		return;

	// if menu2 then external URL; pop new window
	if ( selObj && selObj.name == "menu2" ) {
      // MG  2000/8/30 - no longer spawinging new window to WSJ.com
      var target = selObj.options[selObj.selectedIndex].value;
      self.location.href = target;
      //var winName = 'WSJ';
      //var winParams = '';
		//window.open( target, winName )	
		//winName.focus;
		//return;	
	}
		
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore)
		selObj.selectedIndex=0;
}

function MM_findObj(n, d) { //v3.0
	var p,i,x;
	if(!d)
		d=document;
	if( (p=n.indexOf("?") ) > 0 && parent.frames.length ) {
		d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
	if( !(x=d[n]) && d.all )
		x=d.all[n];
	for  (i=0; !x && i < d.forms.length; i++ )
		x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++)
		x=MM_findObj(n,d.layers[i].document); 
   return x;
}

function MM_jumpMenuGo( selName, targ, restore ) { //v3.0
	var selObj = MM_findObj(selName);
	if (selObj)
		MM_jumpMenu(targ,selObj,restore);
}


function submitSearch() {
   if( document.forms['ojsearch'].where[1].checked ) {
		var target = "http://online.wsj.com/archive/search.cgi?template=atlas-srch-searchrecent-nf.tmpl&";
			target += "form=atlas-srch-searchrecent-nf.html&from-and=AND&to-and=AND&sort=Article-Doc-Date+desc&qand=&";
			target += "bool_query=" + escape(document.forms['ojsearch'].words.value) + "&dbname=wsjie&named=dbname&location=article&period=:27&maxitems=30";
			window.open(target,"");
	} else {
		document.forms['ojsearch'].submit();
	}
}

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();}
}

// --------- BEGIN NEW RSI CODE ---------------------
/*
document.write('<SCRIPT TYPE="text/javascript" SRC="http://js.revsci.net/gateway/gw.js?csid=C05506" CHARSET="ISO-8859-1"></SCRIPT>');
// use rsinetsegs array from JS call above.
var segQS = "";
if ( typeof rsinetsegs != 'undefined' ) {
	segQS = rsinetsegs.length > 0 ? "s0=" + rsinetsegs[0] : "";
	for (var i = 1; i < rsinetsegs.length; i++)
		segQS += (";s" + i + "=" + rsinetsegs[i]);
}
*/
// --------- END NEW RSI CODE ---------------------

// --------- BEGIN DM_SEGMENT code ------------------

// segment params
/*
var mv = new Array(
   "firstSeg", "secondSeg", "thirdSeg", 
   "fourthSeg", "fifthSeg", "sixthSeg", "lastSeg"
   );

// initialize and globalize segment params
for( i=0; i<mv.length; i++ ) {
    eval( "var "+mv[i]+" = ''" );
}
*/

// parse cookie and set segment params
//parseDmSegment();

function parseDmSegment() {
	var crumbs = (getDMCookie("DMSEG")) ? "".concat(getDMCookie("DMSEG")).split("&") : "";
	var howMany = (crumbs[4]) ? crumbs[4] : "";
	var segments = (crumbs[5]) ? crumbs[5] : "";
	var seg = (segments) ? segments.split(",") : "";
	for( i=0; i<mv.length; i++ ) {
		eval( mv[i]+" = (seg["+i+"]) ? seg["+i+"] : ''");
	}
	lastSeg = (seg[seg.length - 1]) ? seg[seg.length - 1] : "";
}
	
// Supporting function to extract cookie value
function getDMCookie(n) {
   var co = document.cookie;
   var pos = co.indexOf(n+"=");
   return pos != -1 ? co.substring(pos+n.length+1,(co.indexOf("; ",pos)!= -1 ? co.indexOf("; ",pos):co.length)):null;
}

// --------- END DM_SEGMENT code ------------------

// -------------------------------------------------
// doubleclick, segment code & UBID

// for layers to be exposed at end of page before body
var dcLayerExpose = new Array();

// this will expose all of the doubleclick ad layers
function exposeDcLayers() 
{
   if ( dcLayerExpose && document.layers ) {
   	var i;
   	for ( i=0; i<dcLayerExpose.length; i++ ) {
   		document.write( dcLayerExpose[i] );
   	}
   }
}

// for page's doubleclick ads
// var globalRand;
var UBIDCookie;
var segmentCookie;

// Assign my default segment value if no cookie segments are available
// var firstSeg = '';
// var secondSeg = '';
// var thirdSeg = '';

function getCookieVal (offset) { 
   var endstr = document.cookie.indexOf (";", offset); 
   if (endstr == -1) 
      endstr = document.cookie.length; 
   return unescape(document.cookie.substring(offset, endstr)); 
} 

function getCookie(name) {
	return GetCookie(name);
}

function GetCookie (name) { 

        var arg = name + "="; 
        var alen = arg.length; 
        var clen = document.cookie.length; 
        var i = 0; 

        while (i < clen) { 
                var j = i + alen; 
                if (document.cookie.substring(i, j) == arg) 
                        return getCookieVal (j); 
                i = document.cookie.indexOf(" ", i) + 1; 
                        if (i == 0) 
                                break; 
                } 
   return null; 
} 

function getUBID(ubid) {
	GetUBID(ubid);
}

function GetUBID (ubid) { 
	var str = ubid;
	if(str == null) return "";	
	var end=(str.indexOf("!"));
	
	if (end == "0" || end == "") {
		
		return "";
		
	} else {
		
		return escape(str.substring(0,end));
	}

} 


function parseDmSegment_20040825() {
   // Declare variables
	var segCookie, ampTokens, numSegs, segs;
	
	// Segment cookie name
	var cookieNameDm = "DMSEG";
	
	// Grab the segment cookie
	if( (segCookie = getDMCookie(cookieNameDm)) != null)
	{
	
	// Decode cookie
	segCookie = unescape(segCookie);	
	
	// Split the segment cookie
	ampTokens = segCookie.split("&");
	
		// Check to make sure there are 6 tokens
		if(ampTokens.length >= 6)
		{
		
			// Split out the segments
			segs = ampTokens[5].split(",");
			if (segs.length > 0)
			{
			
				// Grab the highest priority segment
				firstSeg = segs[0];
							
				// Grab the highest priority segment
				secondSeg = segs[1];
		
				// Grab the highest priority segment
				thirdSeg = segs[2];
		
			}
		}
	}
   return;
}
	
// Supporting function to extract cookie value
function getDMCookie_20040825(n) {

   var co = document.cookie;
   var pos = co.indexOf(n+"=");
   return pos != -1 ? co.substring(pos+n.length+1,(co.indexOf("; ",pos)!= -1 ?
   co.indexOf("; ",pos):co.length)):null;
}

// assigns firstSeg, secondSeg, & thirdSeg
// parseDmSegment();

// ----------------------------
// BEGIN doubleclick-related vars

var globalRand = Math.round( Math.random() * 9000000000000000 ) + 1000000000000000;
var billingSite;
var ubidID = getCookie("UBID");
var segID = getCookie("segment");

if ( !ubidID ) {
   ubidID = "";
}
if ( !segID ) {
   segID = "";
}

// for layers to be exposed at end of page before body
var dcLayerExpose = new Array();

// 2004-07-30 temp support for old variables 
var UBIDCookie = ubidID;
var segmentCookie = segID;

// END doubleclick-related vars
// ----------------------------

// doubleclick-specific vars
// globalRand = Math.round( Math.random() * 9000000000000000 ) + 1000000000000000;
// UBIDCookie = GetUBID(GetCookie("UBID"));
// segmentCookie = ( GetCookie("segment") ) ? GetCookie("segment") : "";

//-->


