Event.observe(window, 'load', init);

function init() {
    Event.observe($('q'), 'click', function(e) {
        if (this.value == this.getAttribute('title')) {
            this.value = '';
        }
    }.bindAsEventListener($('q')));
    Event.observe($('q'), 'blur', function(e) {
        if (this.value == this.getAttribute('title') || this.value == '') {
            this.value = this.getAttribute('title');
        }
    }.bindAsEventListener($('q')));
}