(function($){
	$(document).ready(function() {
		$("#pagefunctions").show();
		if($("#emailfriend").length !=0){
			// Strip anything after and including the krypto string
			var searchString = window.location.search;
			var kryptoPattern = /(\?\S+)(&krypto=)*/;
			var results = kryptoPattern.exec(searchString);
			if (results) var search = results[1];
			else var search = "";
					
			$("#emailfriend").href += "&EmailURL=" + encodeURIComponent( "http://" + window.location.hostname + window.location.pathname + search );
		}
		
		if( $('#print').length !=0) {
			$('#print').click(function(){
				window.print();		
			});
		}

	});
})(jQuery);


