var default_form_values = {
	'EMAIL': 'Email Address',
	'POSTALCODE': 'Enter your zip code',
	'FREE_EMAIL': 'Enter your email address',
	'FREE_SCREENNAME': 'Enter your screen name',
	'FREE_FIRSTNAME': 'First Name',
	'FREE_LASTNAME': 'Last Name',
	'POSTALCODELOCATION': 'Zip Code'
};

$(function() {
	
	$('input.embedded-label').focus(function() {
		var name = $(this).attr('name');
		if($(this).val() == default_form_values[name])
		{
			$(this).addClass('focused');
			this.selectionStart = this.selectionEnd = 0;
		}
	});

	$('input.embedded-label').blur(function() {
		$(this).removeClass('focused');

		var name = $(this).attr('name');
		if($(this).val() == '')
			$(this).val(default_form_values[name]);
	});

	$('input.embedded-label').change(function() {
		var name = $(this).attr('name');
		if($(this).val() != default_form_values[name])
			$(this).removeClass('focused');
	});

	$('input.embedded-label').keypress(function() {
		var name = $(this).attr('name');
		if($(this).val() == default_form_values[name]) {
			$(this).val('');
			$(this).removeClass('focused');
		}
	});
	
});
