/*******************************
* Global Javascript Include
********************************/
$(document).ready(function() {

	// create the "print page" button
	// only works if javascript is enabled
	$("#wrapper-top-links li:last").removeClass("last");
	$("#wrapper-top-links ul").append("<li class='last'><a href='javascript:window.print();'><span>Print page</span></a></li>");

});

/*******************************
* Web Analytics for the Sorted Calculators
********************************/
function sortedCalculatorClick() {
	// initial tracking URL
	var strPageURL = "/outbound/sorted";
	// trim the URL to just the page
	var pathname = window.location.pathname;
	// do not track WCM URLs
	if (pathname.indexOf("/wcm/") < 0) {
		// not in WCM, track it
		// homepage test
		if (pathname == "/" || pathname == "/index.html") {
			strPageURL += "/index.html";
		}
		// else page must be content, show the full path
		else {
			// append full path
			strPageURL += pathname;
		
			// check to see if the pathname ends with .html, if missing add it
			if (pathname.indexOf(".html") < 0) {
				strPageURL += "index.html";
			}
		}
	}
	// WCM URL
	else {
		strPageURL = "";
	}
	
	//alert(strPageURL);
	
	// track using Urchin
	try {
		if(self.urchinTracker && strPageURL != "") {
			urchinTracker(strPageURL);
		}
	}
	catch(err) {}
}