$(document).ready( function() {
	
	// Add placeholder text and class to the login form in the header
	$('.header .login_form input:not(input[type=submit])').addClass('placeholder').val('Tu usuario');

	// Clear any inputs with the class placeholder on focus
	$('input.placeholder').focus( function() {
		$(this).val('').removeClass('placeholder');
	});
	
	// For accessibility perfection, place a real submit button in the
	// header and replace it with a fake one i javascript
	$('.header .login_form input[type=submit]').addClass('hidden');
	$('.header .login_form form').append('<div class="fake_submit"></div>');
	$('.header .login_form .fake_submit').bind( 'mousedown', function() {
		$(this).addClass('active');
	}).bind( 'mouseup mouseout', function() {
		$(this).removeClass('active');
	}).bind( 'mouseup', function() {
		$(this).parent('form').submit();
	});
	
	// Fancy detail – add active class to fake submit upon form submission
	$('.header .login_form form').submit( function() {
		$(this).find('.fake_submit').addClass('active');
	});
	
});