/*
 * jQuery Bookmarklet - version 0.5
 * Written By: Brett Barros
 *
 * If you use this script, please link back to the source
 *
 * Copyright (c) 2010 Latent Motion (http://latentmotion.com/how-to-create-a-jquery-bookmarklet/)
 * Released under the Creative Commons Attribution 3.0 Unported License,
 * as defined here: http://creativecommons.org/licenses/by/3.0/
 *
 */
 
// Where can we get jQuery?
var jqPath="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js";

// Where is your CSS? Add versioning to prevent caching problems
var myCSS = "http://tablesorter.com/themes/blue/style.css";

// What are your other required scripts (ie: jquery plugins)?
var js =[
  	 "http://tablesorter.com/jquery.tablesorter.js"
  //  Note: You can include any number of scripts
	];

// This function will be called after loading jQuery
function jqReady(){

	// This function will be called after loading all of your scripts
	function jqCustom(){
		
		// You can add the stylesheet of our choice
		$(document.createElement('link') ).attr({href: myCSS,rel: 'stylesheet'}).appendTo('head');

		// Initiate table sorter
		$("table").tablesorter().addClass("tablesorter"); 

	}

	// If needed, load and wait for dependency scripts
	var b=js.length;if(b!==0){var c=1,d=function(){c++==b&&jqCustom()};for(var e in js)$.getScript(js[e],d)}else jqCustom()

}

// Guts to load jQuery dynamically -> http://ow.ly/1tcA2
z=function(){z.getScript(jqPath);z.tryReady(0)};z.getScript=function(a){var b=document.createElement("script");b.setAttribute("type","text/javascript");b.setAttribute("src",a);typeof b!="undefined"&&document.getElementsByTagName("head")[0].appendChild(b)};
z.tryReady=function(a){if(typeof $=="undefined")a<=5E3?setTimeout("z.tryReady("+(a+200)+")",200):alert("Timed out while calling jQuery.");else jqReady()};z();