﻿//typography
$('document').ready(function(){
	$('p').each(function(){
		var a = $(this).html();
		$(this).html(function() {
			a = a.replace(/ '/g," ‘");
			a = a.replace(/'/g,"’"); // this is regex
			a = a.replace(/ "/g," «"+"\u00a0");
			a = a.replace(/" /g,"\u00a0"+"» ");
			a = a.replace(/"\./g,"\u00a0"+"».");
			a = a.replace(/\?(?= )/g,"\u00a0"+"?");// (?= ) means that transformation is not applied when ? is not followed by whitespace (otherwise it would break hrefs)
			a = a.replace(/\:(?= )/g,"\u00a0"+":");// (?= ) means that transformation is not applied when : is not followed by whitespace (otherwise it would break hrefs)
			a = a.replace(/\!(?= )/g,"\u00a0"+":");
			return a; 
		});
	});
});

//add this button
var addthis_pub = "adwt";
var addthis_options = 'facebook, linkedin, stumbleupon, google, twitter, digg, live, magnolia, delicious, misterwong, bebo, blogmarks, diigo, faves, friendfeed, linkagogo, myspace, netvouz, plaxo, simply, spurl, tumblr, technorati, typepad, wordpress, yahoobkm';
var addthis_brand = "Wikitractatus";
