$(document).ready(function() {
	$('#ttimeline').jTweetsAnywhere({
			searchParams: ['q=%23formtips'],
			count: 5
	});
	$('#article .twitter').one('click', function(){
		aa.f.shorten_url();
		return false;
	});
	var h = $('#article .main_text .left').height();
	$('#article .main_text .right').height(h);
	$('#tips.top .curated .media').biggerlink();
// document end
});
// Bit.ly AJAX CALL
aa.f.shorten_url = function() {
	var longurl = encodeURIComponent(aa.v.canonicalUrl);
	var login = "aatwitter";
	var apikey = "R_de0d17b657ad9ef83c93d3a7b4cd9259";
	var version = "2.0.1";
	var url;
	$.ajax({
		url: 'http://api.bit.ly/shorten?'+'version='+version+'&'+'longUrl='+longurl+'&'+'login='+login+'&'+'apiKey='+apikey+'&'+''
		,async: false
		,dataType: 'jsonp'
		,scriptCharset: 'utf-8'
		,timeout: 5000
		,success: function(data){
			aa.v.shortUrl = data.results[aa.v.canonicalUrl].shortUrl;
			$('#tbox').jTweetsAnywhere({
				showTweetBox:{
					counter: true
					,width: 600
					,height: 65
					,label: '<span style="color: #D1C7BA">このTipsへのコメントはこちら</span>'
					,defaultContent: ' | #formtips ' + aa.v.shortUrl + ' '
				}
			});
		}
	});
}
