
/*   formattingWordCounts.js

For the long notes on this script file, go to the bottom of this document */

function showWordCounts(tag)
{
	var docCts = new docCounts(document);
	pnode = document.getElementById("count-params");
	node = document.createElement(tag);
	node.setAttribute("style", "float:left;margin:0;");
	node.appendChild(document.createTextNode("word count: " + docCts.wordCount +
		" words"));
	pnode.appendChild(node);
	pnode = document.getElementById("count-params");
	node = document.createElement(tag);
	node.setAttribute("style", "text-align:right;margin-bottom:0;");
	node.appendChild(document.createTextNode("reading time: " +
			docCts.readingTimeExpression));
	pnode.appendChild(node);
	delete docCts;
}

/*

For the opinion articles, do the following:

1. place the following DIV element on ONE LINE and just below the subtitle and
		above the "contentbox"

  <div id="count-params" class="parameters"></div>

In general, if you want to re-format, you can omit the CLASS attribute and
add a STYLE attribute or use the ID or CLASS.  All parameters are placed within
the DIV tag.

You can also change DIV to P:  but if you do, change the 'p' argument in 3 to
'span'.

2. In the HEAD element, add the TWO following SCRIPT elements.

		<script type="text/javascript" src="WordCount.js"></script>
		<script type="text/javascript" src="formattingWordCounts.js"></script>

The script files should be in the same directory, or the SRC attributes changed to
indicate their location absolutely or relatively.


3. In the BODY tag, add the attribute:

      onload="showWordCounts('p');"

You MUST change the 'p' argument to 'span' if you use a P element in 1.

*/
