var DEF_VAL   = "Search"; // Default Value
var isSafari = (navigator.userAgent.indexOf("AppleWebKit") !=-1);
// Detecting not only Safari but WebKit-based browsers

run();
function run()
{
    var oldOnload = window.onload; // window.onload will be overwritten, so save the old value
    if (typeof(window.onload) != "function") {
        window.onload = init;
    } else {
        window.onload = function() {
            oldOnload();
            init();
        }
    }
}

function init() {
    if (!document.getElementById) return;
    var theSearchField = document.getElementById('search');
    DEF_VAL = theSearchField.value;
    // Doing the 'Live Search'-displaying-&-hiding-stuff for non-WebKit-based browsers
    theSearchField.onfocus    = focusSearch;
    theSearchField.onblur     = blurSearch;
    if (theSearchField.value=='') theSearchField.value = DEF_VAL;
}

function focusSearch() {
    if (this.value==DEF_VAL) {
        this.value = '';
    }
}

function blurSearch() {
    if (this.value=='') {
        this.value = DEF_VAL;
    }
}