var mturl;
var mttitle;
function trimString(str, size) {
	var nstr = str;
	if (str.length>size) {
		nstr = nstr.substring(0, size);
		nstr += "...";
	}
	return nstr;
}
function tweet(ttl, link) {
	var url = 'http://twitter.com/intent/tweet?source=webclient&text=';
	url += encodeURIComponent(ttl) + ' ' + link;
	window.open(url, 'tweet', 'width=640, height=360');
}

function callback(bitlyResponse) {
	var url = 'http://twitter.com/intent/tweet?source=webclient&text=' 
	    + encodeURIComponent(
	         mttitle + ' ' 
	           + bitlyResponse.results[mturl]['shortUrl']
	      );
	window.open(url, 'tweet', 'width=640, height=360');
}


