
// Twitter script based on: 
// http://www.saschakimmel.com/2009/05/how-to-create-a-dynamic-tweet-this-button-with-javascript/ 

// button from:
// http://blog.assbach.de/2009/01/11/freie-tweet-this-buttons/

// see also:
// http://richardxthripp.thripp.com/tweet-this-icons



// === only thing specific to this site is where you get the image from: ===================

var imgurl = "http://MarkHumphrys.com/Bitmaps/twitter.2.png";



var myurl    		= location.href;
var availableLength 	= 140 - myurl.length - 3 - 1;


var mytitle  		= document.title;
if ( mytitle.length > availableLength ) 
{
 mytitle = mytitle.substr ( 0, (availableLength - 3 - 1) ) 	+ '...'; 
}


var twitterurl 	= 'http://twitter.com/home?status=' 	+ encodeURIComponent( myurl + ' [' + mytitle + ']' );

document.write ( '<a target=_blank href="' + twitterurl + '">' );
document.write ( '<img align=absmiddle border=0 alt="Tweet This" src="' + imgurl + '"></a>' );

