function sendToTwitter () {
	// Check if the send_to_twitter box is there. If it ain't, don't run this.
	if(!$('send_to_twitter')) return false;
	
	$('ajax_submit').setProperty('value', 'yes');
	
	// Make the send_to_twitter legend text a link, to indicate it's actionable
	$('send_to_twitter_toggle').empty();
	var twitterLinkToggle = new Element('a').setProperty('href', '#').setText('Send to Twitter');
	twitterLinkToggle.injectInside('send_to_twitter_toggle');
	
	// Hide the box and slide it out when the user wants it.
	var twitterSlide = new Fx.Slide('send_to_twitter_slide').hide();
	$('send_to_twitter_toggle').addEvent('click', function(e){
		e = new Event(e);
		twitterSlide.toggle();
		e.stop();
	});
	
	// Empty the input's content on focus
	$('username').addEvent('focus', function(e) {
		if ($('username').value == "username") {
			$('username').value = "";
		};
	});
	$('password').addEvent('focus', function(e) {
		if ($('password').value == "password") {
			$('password').value = "";
		};
	});
	
	// Message character count
	$('twitter_message').addEvent('keyup', function(e) {
		charcount = $('twitter_message').value.length;
		charleft = 140-charcount;
		$('character_total').setHTML(charleft);
	});
	
	// Axaxify the form
	$('send_to_twitter').addEvent('submit', function(e) {
		new Event(e).stop();
		var response = $('twitter_response').empty().addClass('ajax-loading');
		this.send({
			update: response,
			onComplete: function() {
				response.removeClass('ajax-loading');
			}
		});
	});
}
// When the DOM is loaded, run these functions
window.addEvent('domready', sendToTwitter);