/* jQuery */
(function($) {
    // Populate placeholder text
    $('#s').attr('placeholder', 'search');
    $('#content-sidebar .wpcf7-form-control-wrap :text').each(function() {
        var placeholder_text = $(this).attr('name').replace(/-/i, ' ');
        $(this).attr('placeholder', placeholder_text);
    });

    // Bind input placeholder text
    $(document).ready(function() {
        // Check for placeholder support
        var i = document.createElement('input');
        if (('placeholder' in i) == false) {
            $('input[placeholder]').each(function() {
                // Set initial value and class
                if ($(this).val() == '' || $(this).val() == $(this).attr('placeholder')) {
                    $(this).val($(this).attr('placeholder')).addClass('placeholder-text');
                }

                // Bind handlers
                $(this).blur(function() {
                    if ($(this).val() == '') {
                        $(this).val($(this).attr('placeholder')).addClass('placeholder-text');
                    }
                }).focus(function() {
                    if ($(this).val() == $(this).attr('placeholder')) {
                        $(this).val('').removeClass('placeholder-text');
                    }
                });
            });
        }
    });
})(jQuery);

