// code stolen from somewhere...

var DEF_VAL = "Search for images..."; // Default Value

var isSafari = ((parseInt(navigator.productSub)>=20020000)&&     // detecting WebCore
               (navigator.vendor.indexOf("Apple Computer")!=-1));

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;
    // finding all input[type=text].search's 
    var theInputs = document.getElementsByTagName('input');
    for (var i=0; i<theInputs.length; i++) {
        var theInput = theInputs[i];
        if (theInput.className == 'search') 
        {
            // found one.
            if (isSafari) 
            {
                // changing type to "search"
                theInput.setAttribute('type', 'search');
                theInput.setAttribute('placeholder', DEF_VAL);
                theInput.setAttribute('results', '5');
                theInput.setAttribute('autosave', 'com.luckylookimages.www');
            } 
        }
    }
}
