$(document).ready(function() {
        initClickHandler();
    });

initClickHandler = function() {

    $('input.clearandpopulate').each(function(l) {
            $(this).bind('focus', function(event) {
                    if ($(this).attr('title') == this.value) {
                        $(this).attr('value','');
                    }

                }).bind('blur', function(event) {
                        if (this.value == '') {
                            $(this).attr('value',$(this).attr('title'));
                    }
                });
        });

    $('form').bind('submit', function(e) {
            $('input.clearandpopulate').each(function(e) {
                    if ($(this).attr('title') !== undefined) {
                        if ($(this).attr('value') == $(this).attr('title')) $(this).attr('value','');
                    }
                });
        });

}
