var oas = 'http://ads.mgnetwork.com/RealMedia/ads/';
var RN = new String (Math.random());
var RNS = RN.substring (2,11);

function DisplayOasAd (position) {
	var oaspage = sitepage + '/1' + RNS + '@' + position;
	if (_version < 11) {
		document.write ('<a href="' + oas + 'click_nx.ads/' + oaspage + '" target="_top"><img src="' + oas + 'adstream_nx.ads/' + oaspage + '" border="0"></a>');
	}
	else {
		document.write ('<script language="JavaScript1.1" src="' + oas + 'adstream_jx.ads/' + oaspage + '"><\/script>');
	}
}

// FRAME BUSTER
//
//if (self != top) {
//	if (document.images) {
//		top.location.replace(window.location.href);
//	} else {
//		top.location.href = window.location.href;
//	}
//}


function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function addIEFavorite() {
	if (window.external) {
		external.AddFavorite(location.href, document.title)
	}
	else {
		alert("Oops, your browser doesn't support this feature.\n" +
		"If you are using Netscape Navigator, click Bookmarks\n" +
		"and then Add Bookmark to add this site to your favorites.");
	}
}


function createWindow(pageURL,wWidth,hHeight) {
	window.open(pageURL, "secondWindow", "toolbar=no,scrollbars=yes,directories=no, status=no,menubar=no,resizable=no,width=" + wWidth + ",height=" + hHeight)
}

function writeDate() {
	var now = new Date();
	var currentDate = now.getDate();
	var currentMonth = now.getMonth();
	var viewMonth;
		if(currentMonth == 0) {viewMonth = "Jan.";}
		if(currentMonth == 1) {viewMonth = "Feb.";}
		if(currentMonth == 2) {viewMonth = "March";}
		if(currentMonth == 3) {viewMonth = "Apr.";}
		if(currentMonth == 4) {viewMonth = "May";}
		if(currentMonth == 5) {viewMonth = "June";}
		if(currentMonth == 6) {viewMonth = "July";}
		if(currentMonth == 7) {viewMonth = "Aug.";}
		if(currentMonth == 8) {viewMonth = "Sep.";}
		if(currentMonth == 9) {viewMonth = "Oct.";}
		if(currentMonth == 10){viewMonth = "Nov.";}
		if(currentMonth == 11){viewMonth = "Dec.";}
	document.write(viewMonth + " ");
	document.write(" " + currentDate + ", ");
	var currentYear = now.getFullYear();
	document.write(currentYear);
}

function goPtp(title, image_id, image_col, mimetype) {
  ptpServer = "www.pictopia.com";
  providerID = 107;
  win = window.open('http://' + ptpServer + '/perl/ptp?provider_id='
  + providerID +
 '&photo_name=www.journalnow.com/servlet/Satellite?blobkey=id%26blobtable=MGImage%26ssbinary=true%26blobheader='
  + mimetype
  + '%26blobwhere=' + image_id
  + '%26blobcol=' + image_col + '&time=' +
  new Date().getTime() + '&title=' + title,
  'ptp_' + providerID,
  'scrollbars=yes, resizable=yes, toolbar=no, '
  + 'status=yes, width=720,height=600, menubar=no');
  win.focus();
}

function goPtpToo(title, url) {
  ptpServer = "www.pictopia.com";
  providerID = 107;
  win = window.open('http://' + ptpServer + '/perl/ptp?provider_id='
  + providerID +
 '&photo_name='
  + url + '&time=' +
  new Date().getTime() + '&title=' + title,
  'ptp_' + providerID,
  'scrollbars=yes, resizable=yes, toolbar=no, '
  + 'status=yes, width=720,height=600, menubar=no');
  win.focus();
}

function DisplayColumnist (who) {
var displayInfo, image, bioLink, email, name, noshow;

// image is the link to the Columnists in-article display image
// bioLink is the Satellite server link to the bio of the person
// email is the email address to the Columnist
// name is how you would like the name to show up bolded under the picture


	if(who == "By David Bare") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/bare.jpg";
		bioLink = "http://extras.journalnow.com/columnists/bare.html";
		email = "dfelder@wsjournal.com";
		name = "David Bare";
	}

	else if(who == "By Linda Brinson") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/brinson.jpg";
		bioLink = "http://extras.journalnow.com/columnists/brinson.html";
		email = "lbrinson@wsjournal.com";
		name = "Linda Brinson";
	}

	else if(who == "By Ed Bumgardner") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/bumgardner.gif";
		bioLink = "http://extras.journalnow.com/columnists/bumgardner.html";
		email = "ebumgardner@wsjournal.com";
		name = "Ed Bumgardner";
	}

	else if(who == "By Mark Burger") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/burger.gif";
		bioLink = "http://extras.journalnow.com/columnists/burger.html";
		email = "mburger@wsjournal.com";
		name = "Mark Burger";
	}

	else if(who == "By Dan Collins") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/collins.jpg";
		bioLink = "http://extras.journalnow.com/columnists/collins.html";
		email = "dcollins@wsjournal.com";
		name = "Dan Collins";
	}

	else if(who == "By Richard Creed") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/creed.jpg";
		bioLink = "http://extras.journalnow.com/columnists/creed.html";
		email = "richcreed@triad.rr.com";
		name = "Richard Creed";
	}

	else if(who == "By John Dell") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/dell.jpg";
		bioLink = "http://extras.journalnow.com/columnists/dell.html";
		email = "jdell@wsjournal.com";
		name = "John Dell";
	}

	else if(who == "By John Delong") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/delong.jpg";
		bioLink = "http://extras.journalnow.com/columnists/delong.html";
		email = "jdelong@wsjournal.com";
		name = "John Delong";
	}

	else if(who == "By Ellen Dockham") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/dockham.jpg";
		bioLink = "http://extras.journalnow.com/columnists/dockham.html";
		email = "jhinton@wsjournal.com";
		name = "Ellen Dockham";
	}

	else if(who == "By Gwynne Dyer") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/dyerg.jpg";
		bioLink = "http://extras.journalnow.com/columnists/dyer.html";
		email = "letters@wsjournal.com";
		name = "Gwynne Dyer";
	}

	else if(who == "By Mary Garber") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/garber.jpg";
		bioLink = "http://extras.journalnow.com/columnists/garber.html";
		email = "mgarber@wsjournal.com";
		name = "Mary Garber";
	}

	else if(who == "By John Gates") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/gates.jpg";
		bioLink = "http://extras.journalnow.com/columnists/gates.html";
		email = "jgates@wsjournal.com";
		name = "John Gates";
	}

	else if(who == "By Mary Giunca") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/giunca.jpg";
		bioLink = "http://extras.journalnow.com/columnists/giunca.html";
		email = "mgiunca@wsjournal.com";
		name = "Mary Giunca";
	}

	else if(who == "By John Hall") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/hallj.jpg";
		bioLink = "http://extras.journalnow.com/columnists/hall.html";
		email = "JHALL@mediageneral.com";
		name = "John Hall";
	}

		else if(who == "By Michael Hastings") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/hastings.jpg";
		bioLink = "http://extras.journalnow.com/columnists/hastings.html";
		email = "mhastings@wsjournal.com";
		name = "Michael Hastings";
	}

		else if(who == "By Scott Hollifield") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/hollifield.jpg";
		bioLink = "http://extras.journalnow.com/columnists/hollifield.html";
		email = "rhollifield@mcdowellnews.com";
		name = "Scott Hollifield";
	}

	else if(who == "By Nat Irvin") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/irvin.jpg";
		bioLink = "http://extras.journalnow.com/columnists/irvin.html";
		email = "nat.irvin@mba.wfu.edu";
		name = "Nat Irvin";
	}

	else if(who == "By Ken Keuffel") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/keuffel.jpg";
		bioLink = "http://extras.journalnow.com/columnists/keuffel.html";
		email = "kkeuffel@wsjournal.com";
		name = "Ken Keuffel";
	}

	else if(who == "By Dan Kibler") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/kibler.jpg";
		bioLink = "http://extras.journalnow.com/columnists/kibler.html";
		email = "wkibler@wsjournal.com";
		name = "Dan Kibler";
	}

	else if(who == "By Joe Menzer") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/menzer.jpg";
		bioLink = "http://extras.journalnow.com/columnists/menzer.html";
		email = "jmenzer@wsjournal.com";
		name = "Joe Menzer";
	}

	else if(who == "By Marsha Mercer") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/mercerm.jpg";
		bioLink = "http://extras.journalnow.com/columnists/mercer.html";
		email = "MMercer@mediageneral.com";
		name = "Marsha Mercer";
	}

	else if(who == "By Mike Mulhern") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/mulhern.jpg";
		bioLink = "http://extras.journalnow.com/columnists/mulhern.html";
		email = "mmulhern@wsjournal.com";
		name = "Mike Mulhern";
	}

	else if(who == "By Paul O'Connor") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/oconnor.jpg";
		bioLink = "http://extras.journalnow.com/columnists/oconnor.html";
		email = "poconnor@wsjournal.com";
		name = "Paul O'Connor";
	}

	else if(who == "By Lisa O'Donnell") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/odonnell.jpg";
		bioLink = "http://extras.journalnow.com/columnists/odonnell.html";
		email = "lshu@wsjournal.com";
		name = "Lisa O'Donnell";
	}

	else if(who == "By 	Tom Patterson") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/patterson.jpg";
		bioLink = "http://extras.journalnow.com/columnists/patterson.html";
		email = "features@wsjournal.com";
		name = "Tom Patterson";
	}

	else if(who == "By John Railey") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/railey.jpg";
		bioLink = "http://extras.journalnow.com/columnists/railey.html";
		email = "jrailey@wsjournal.com";
		name = "John Railey";
	}

	else if(who == "By Lenox Rawlings") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/rawlings.jpg";
		bioLink = "http://extras.journalnow.com/columnists/rawlings.html";
		email = "lrawlings@wsjournal.com";
		name = "Lenox Rawlings";
	}


	else if(who == "By Kim Underwood") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/underwood.jpg";
		bioLink = "http://extras.journalnow.com/columnists/underwood.html";
		email = "runderwood@wsjournal.com";
		name = "Kim Underwood";
	}

	else if(who == "By Jack White") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/whitej.jpg";
		bioLink = "http://extras.journalnow.com/columnists/white.html";
		email = "jhinton@wsjournal.com";
		name = "Jack White";
	}

	else if(who == "By Phoebe Zerwick") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/zerwick.jpg";
		bioLink = "http://extras.journalnow.com/columnists/zerwick.html";
		email = "pzerwick@wsjournal.com";
		name = "Phoebe Zerwick";
	}

	else if(who == "By Scott Sexton") {
		image = "http://media.gatewaync.com/wsj/photos/columnists/sexton.jpg";
		bioLink = "http://extras.journalnow.com/columnists/sexton.html";
		email = "ssexton@wsjournal.com";
		name = "Scott Sexton";
	}

	else { noshow = 1;  }


	if(noshow != 1) {
		//
		// Do not edit below this line. Unless you fully understand the process
		//  You will alter existing pages.
		document.write('<table width="100" cellpadding="0" cellspacing="1" align="left">');
		document.write('<tr><td colspan="2" valign="top"><img src="' + image + '" height="102" width="90"><td></tr>');
		document.write('<tr><td colspan="2" valign="top" align="center"><font size="-1" face="arial"><b>' + name + '</b></font></td></tr>');
		document.write('<tr><td align="center"><font size="-1" face="arial"><a class="inf_lnktext" href="mailto:' + email + '">Email</a></font></td>');
		document.write('<td align="center"><font size="-1" face="arial"><a class="inf_lnktext" href="' + bioLink + '" onClick="window.open(\'\',\'popup\',\'height=500,width=400,scrollbars=yes\')" target="popup">Bio</a></font></td></tr>');
		document.write('</table>');
	}
}

function getImgIndex(imgName) {
      index = 0;
      for ( i = 0; i < document.images.length; i++ ) {
           if ( document.images[i].name == imgName ) {
                index = i;
                break;
           }
      }
      return index;
 }


function ChangeImage (ImageName,FileName, FileHeight, FileWidth) {
document.images[getImgIndex(ImageName)].src = FileName;
document.images[getImgIndex(ImageName)].height = FileHeight;
document.images[getImgIndex(ImageName)].width = FileWidth;
}

function VoteWindow() {
		window.open("/wsj/blank.htm","pollpage","toolbar=no,scrollbars=yes,directories=no, status=no,menubar=no,resizable=no,width=400,height=400")
}

browserName = navigator.appName;
browserVer = parseInt(navigator.appVersion);
if (browserName == "Netscape" && browserVer <= 3) version = "NS3";
else version = "NS4";
if (browserName == "Microsoft Internet Explorer" && browserVer >= 0) version = "IE";

function tearOff() {
	if (version == "NS3") {
		tearoff = window.open("http://partners.thomsoninvest.net/MediaGeneral/tearoff/index.htm",'TheTearoff','width=185,height=410,resizable=0,scrollbars=0,toolbar=0,location=0,directories=0,menubar=0');
	}
	else if (version =="NS4" ) {
		tearoff = window.open("http://partners.thomsoninvest.net/MediaGeneral/tearoff/index.htm",'TheTearoff','width=185,height=400,resizable=0,scrollbars=0,toolbar=0,location=0,directories=0,menubar=0');
	}
   else if (version == "IE") {
		tearoff = window.open("http://partners.thomsoninvest.net/MediaGeneral/tearoff/index.htm",'TheTearoff','width=185,height=400,resizable=0,scrollbars=0,toolbar=0,location=0,directories=0,menubar=0');
	}
	else {
		tearoff = window.open("http://partners.thomsoninvest.net/MediaGeneral/tearoff/index.htm",'TheTearoff','width=185,height=410,resizable=0,scrollbars=0,toolbar=0,location=0,directories=0,menubar=0');
	}
}

function LeftPromo() {
		var image_src = "";
var link_href = "";
var count = 13;
var date = new Date();
var seconds = date.getSeconds();
var choice = seconds % count;

if (choice == 0)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/arts2.gif";
link_href = "http://www.journalnow.com/wsj/entertain/calendars/arts/index.shtml";

}
else if (choice == 1)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/entertainmentcalendar.gif";
link_href = "http://www.journalnow.com/wsj/entertain/calendars/entertain/index.shtml";

}
else if (choice == 2)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/classifieds.gif";
link_href = "http://classifieds.wsjournal.com/";

}
else if (choice == 3)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/hastings2.gif";
link_href = "http://www.journalnow.com/wsj/living/food/index.shtml";

}
else if (choice == 4)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/jane2.gif";
link_href = "http://www.journalnow.com/wsj/business/index.shtml";

}
else if (choice == 5)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/natirvin.gif";
link_href = "http://www.journalnow.com/wsj/opinion/columnists/irvin/index.shtml";

}
else if (choice == 6)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/prepsports.gif";
link_href = "http://www.journalnow.com/wsj/sports/preps/index.shtml";

}
else if (choice == 7)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/subscribe2.gif";
link_href = "https://secure.journalnow.com/subscribe.html";

}
else if (choice == 8)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/lunchmenu.gif";
link_href = "http://www.journalnow.com/wsj/living/food/lunchmenus/index.shtml";

}
else if (choice == 9)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/travel.gif";
link_href = "http://www.journalnow.com/wsj/living/travel/index.shtml";

}
else if (choice == 10)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/milestones.gif";
link_href = "http://www.journalnow.com/wsj/living/community/index.shtml";

}
else if (choice == 11)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/crosswords.gif";
link_href = "http://www2.uclick.com/client/jws/cx/";

}
else if (choice == 12)
{
image_src = "http://media.gatewaync.com/wsj/photos/promos/weather.gif";
link_href = "http://weather.mgnetwork.com/cgi-bin/weatherIMD3/weather.cgi?user=WSJ2&alt=MGIMD_local_currents";

}
if (image_src != "")
{
image_html = '<A HREF="'+ link_href + '"><IMG SRC="' + image_src + '" WIDTH=234 HEIGHT=60 BORDER=0></A>';
	}
}


