to your HTML
Add class="sortable" to any table you'd like to make sortable
Click on the headers to sort
Thanks to many, many people for contributions and suggestions.
Licenced as X11: http://www.kryogenix.org/code/browser/licence.html
This basically means: do what you want with it.
*/
var stIsIE = /*@cc_on!@*/false;
sorttable = {
init: function() {
// quit if this function has already been called
if (arguments.callee.done) return;
// flag this function so we don't do the same thing twice
arguments.callee.done = true;
// kill the timer
if (_timer) clearInterval(_timer);
if (!document.createElement || !document.getElementsByTagName) return;
sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
forEach(document.getElementsByTagName('table'), function(table) {
if (table.className.search(/\bsortable\b/) != -1) {
sorttable.makeSortable(table);
}
});
},
makeSortable: function(table) {
if (table.getElementsByTagName('thead').length == 0) {
// table doesn't have a tHead. Since it should have, create one and
// put the first table row in it.
the = document.createElement('thead');
the.appendChild(table.rows[0]);
table.insertBefore(the,table.firstChild);
}
// Safari doesn't support table.tHead, sigh
if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0];
if (table.tHead.rows.length != 1) return; // can't cope with two header rows
// Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
// "total" rows, for example). This is B&R, since what you're supposed
// to do is put them in a tfoot. So, if there are sortbottom rows,
// for backwards compatibility, move them to tfoot (creating it if needed).
sortbottomrows = [];
for (var i=0; i

Previously on Political Calculations, we discovered that we can use international trade data to diagnose the relative health of national economies.

The way this works is to consider that a growing economy will demand more goods - a portion of which will be imported from outside the country. By measuring the growth rate of both imports and exports between two nations, we can determine how relatively "healthy" the economies of both nations are.

Our favorite two nations to look at are the U.S. and China. When we looked at the international trade through May 2010 between these two nations, we found that both the U.S. and China had growing economies following recessions and that China's economy seemed to be driving the U.S. economy.

Today, nearly a year later, we find that both nations would appear to have growing economies, but that after the Chinese economy surge in the last quarter of 2009, and the U.S. economy surging in the first half of 2010, both the U.S. and Chinese economies are growing much more slowly.

A special concern now is that the rate of growth of U.S. imports from China is slowing, which indicates that economic growth in the U.S. is comparatively weaker than it is in China.

We confirm that outlook in examining our doubling rate chart showing the level of U.S. imports from China from January 1985 through April 2011.

Here, we see that it has been more than five years since the U.S. doubled the amount that it imports from China, which is significantly more than the 3 to 4 years that these imports doubled in the twenty years from 1985 through 2005.

By contrast, see that the value of U.S. exports to China has almost doubled since January 2009, which is putting the period since that time on a pace to potentially beat the shortest doubling time recorded for the value of U.S. exports to China of 32 months, which was set between January 2001 and July 2003.

We suspect that this extremely rapid rate of growth for U.S. exports to China is being largely driven by the China's massive economic bubble, so we would anticipate that U.S. exports may drop considerably once that bubble enters into its deflation phase.

Which like all economic bubbles, will happen. It's only a matter of when and how.

Welcome to the blogosphere's toolchest! Here, unlike other blogs dedicated to analyzing current events, we create easy-to-use, simple tools to do the math related to them so you can get in on the action too! If you would like to learn more about these tools, or if you would like to contribute ideas to develop for this blog, please e-mail us at:

Materials on this website are published by Political Calculations to provide visitors with free information and insights regarding the incentives created by the laws and policies described. However, this website is not designed for the purpose of providing legal, medical or financial advice to individuals. Visitors should not rely upon information on this website as a substitute for personal legal, medical or financial advice. While we make every effort to provide accurate website information, laws can change and inaccuracies happen despite our best efforts. If you have an individual problem, you should seek advice from a licensed professional in your state, i.e., by a competent authority with specialized knowledge who can apply it to the particular circumstances of your case.