var isOpen = 0;
var allHeight = 0;
var notIE = 0;
var isIE = 0;
function showTweets(){
	document.getElementById('allTweets').style.display = 'inline';
	bringIn = setInterval('tweetsIn()', 10);
	isOpen = 1;
}

function tweetsIn(){
	allHeight = allHeight + 20;
	isIE = isIE + 4;
	notIE = notIE + 5;
	if (notIE >= 100){
		notIE = 99;
	}
	document.getElementById('allTweets').style.opacity = '0.' + notIE;
	document.getElementById('allTweets').style.height = allHeight + 'px';
	if (allHeight >= 500){
		clearInterval(bringIn);
	}
}

function closeTweet(){
	isOpen = 0;
	closeHeight = document.getElementById('allTweets').style.height;
	closeHeight = closeHeight.replace(/px/,'');
	fadeOut = 100;
	bringOut = setInterval('tweetsOut(closeHeight)', 10);
}

function tweetsOut(val){
	closeHeight = val;
	closeHeight = closeHeight * 1;
	closeHeight = closeHeight - 50;
	fadeOut = fadeOut - 10;
	document.getElementById('allTweets').style.height = closeHeight + 'px';
	document.getElementById('allTweets').style.opacity = '0.' + fadeOut;
	if (closeHeight == 0){
		document.getElementById('allTweets').style.display = 'none';
		clearInterval(bringOut);
		allHeight = 0;
		notIE = 0;
		isIE = 0;
	}
}

function checkTweet(){
	if (isOpen == 1){
		closeTweet();
	}
}