$(document).ready(function(){
	//Some default variables
	var defaultEmail = 'e-mail';
	var defaultPassword = 'password';
	var defaultColor = '#b2b0b0';
	var focusColor = '#000';

	//Set default email and password values
	$('#login input.email').val(defaultEmail);
	$('#login input.password').val(defaultPassword);
	$('#login input').css('color', defaultColor);

	//Clear field if current value equals default value of email
	$('#login input').focus(function(){
		$(this).css('color', focusColor);
		if($(this).val() == defaultEmail || $(this).val() == defaultPassword)
		{
			$(this).val('');
		}
	});

	//reset do default value when focus is lost and the field is empty
	$('#login input').focusout(function(){
		if($('.email').val() == '' ||
		   $('.email').val() == defaultEmail)
		{
			//If email is empty, reset to default color and value
			$(this).css('color', defaultColor);
			$(this).val(defaultEmail);
		}else if($('.password').val() == '' || $('.email').val() == defaultPassword)
		{
			//If password is empty, reset to default color and value
			$(this).css('color', defaultColor);
			$(this).val(defaultPassword);
		}
	});

	$('.fancybox').fancybox();
});
