Event.observe( document, 'dom:loaded', function() {
	var ins = $$( '.toblur' );
	ins.each( function(inp) {
		if ( $F(inp) == '' || $F(inp) == $(inp).readAttribute('ref') ) {
			inp.addClassName( 'blur' );
			inp.setValue( inp.readAttribute('ref') );
		} else if ( inp.readAttribute('id') != 'SubmissionSearch' ) {
			$('form').show();
			$('formBtn').update( 'Hide the Form' );
		}
		Event.observe( inp, 'focus', function() {
			if ( $F(this) == this.readAttribute('ref') ) {
				this.removeClassName( 'blur' );	
				this.setValue( '' );
			}
		} );
		Event.observe( inp, 'blur', function() {
			if ( $F(this) == '' ) {
				this.addClassName( 'blur' );	
				this.setValue( this.readAttribute('ref') );
			}
		} );
	} );
	if ( $('formBtn') ) {
		Event.observe( $('formBtn'), 'click', function() {
			if ( $('form').visible() )
				$('formBtn').update( 'Submit a Tweet!' );
			else $('formBtn').update( 'Hide the Form' );
			Effect.toggle( 'form', 'appear', {duration:0.3} );
		} );
	}
} );

var hideWelcome = function ( e ) {
	Effect.Fade( 'welcome', {duration:0.3} );
}
