// Function to add search box placeholder
function add_placeholder() {
    // Variables
    var form = $('#mailing-list-form');
    var input = form.find('input[type="text"]').first();
    var ph_txt = form.find('label').first().text();
    var ph_cls = 'input-placeholder';
    // Set value using text from label
    form.find('label').hide();
    input.addClass(ph_cls);
    input.val(ph_txt);
    // If value is label text on focus, remove value
    input.focus( function() {
        $(this).removeClass(ph_cls);
        if( $(this).val() == ph_txt ) {
            $(this).val('');
        }
    });
    // If value is empty on blur, add label text
    input.blur( function() {
        if( $(this).val() == '' ) {
            $(this).val(ph_txt);
            $(this).addClass(ph_cls);
        }
    });
}

// Functions to run on load
$(document).ready( function() {

	// Search placeholder
	add_placeholder();

});

