<!--
	function update_counters() {
		print_char_count();
		print_tweet_count();
	}
	
	function print_char_count() {
		var contents = document.getElementById('statusbox').value;
		if (contents == 'Just write your tweet, as long or short as you want to. ezTweets does the rest!') {
			document.getElementById('char_count').innerHTML = 0;
		} else {
			document.getElementById('char_count').innerHTML = contents.length;
		}
	}
	
	function print_tweet_count() {
		var count = tweet_count();
		document.getElementById('tweet_count').innerHTML = count + " Tweet";
		if (count != 1) {
			document.getElementById('tweet_count').innerHTML += 's';
		}
	}
	
	function clear_default() {
		var contents = document.getElementById('statusbox').value;
		if (contents == 'Just write your tweet, as long or short as you want to. ezTweets does the rest!') {
			document.getElementById('statusbox').value = '';
		}
	}
	
	function restore_default() {
		var contents = document.getElementById('statusbox').value;
		if (contents == '') {
			document.getElementById('statusbox').value = 'Just write your tweet, as long or short as you want to. ezTweets does the rest!';	
		}
	}

	function tweet_count() {
		var content = document.getElementById('statusbox').value;
		var header = '';
		
		if (content.substring(0,1) == '@') {
			var contentArray = content.split(' ');
			header =  contentArray[0] + ' ';
			delete contentArray[0];
			content = contentArray.join(' ');
		} else if (content.substring(0,2) == 'D ') {
			var contentArray = content.split(' ');
			header = 'D ' + contentArray[1];
			delete contentArray[0];
			delete contentArray[1];
			content = contentArray.join(' ');
		} else if (content.substring(0,3) == 'RT ') {
			var contentArray = content.split(' ');
			header = 'RT ' + contentArray[1];
			delete contentArray[0];
			delete contentArray[1];
			content = contentArray.join(' ');
		}
		
		var str = content.replace("\b", " ");
		var words = str.split(" ");
		var iwidth = 140-header.length;
		var counter = 0;
		var length = 0;
		var tweets = 1;
		
		for (counter; counter < words.length; counter++) {
			if (length + words[counter].length > iwidth) {
				tweets += 1;
				length = words[counter].length+1;
			} else {
				length += words[counter].length+1;
			}
		}		
		return tweets;
	}
//-->
