// clear the text in the form fields

$(document).ready(function() {
	// edit: prepend h2 to form, move label values to textfields, remove submit value
	$('#sidebar-right h2:first').prependTo('#sidebar-right form');
	$('#sidebar-right form input[type="text"], #sidebar-right form textarea').each(function() {
		var text = $(this).parent().prev().children('label').text();
		$(this).parent().prev().children('label').remove();
		$(this).val(text);
	});
	$('#sidebar-right form input[type="submit"]').addClass('frm-btn');
	$('#sidebar-right form input[type="submit"]').val('Send');
	$('#sidebar-right form input, #sidebar-right form textarea').each(function(){
			$(this).data('iVal', $(this).val());
			$(this).addClass('inactive');
		})
		.focus(function(){
		if($(this).val() === $(this).data('iVal'))
			$(this).val('');
			$(this).removeClass('inactive');
		})
		.blur(function(){
        if ($(this).val() === '') {
	        $(this).val($(this).data('iVal'));
	        $(this).addClass('inactive');
        }
	});
});
