// Safari searchbox
var DEF_VAL = "Suchen"; // Default Value
var AUTOSAVE_URL = "com.iogt.schweiz" // Autosave URL
var NUM_RESULTS = 5 // Number of Results

var isSafari = ((parseInt(navigator.productSub)>=20020000)&&     // detecting WebCore
               (navigator.vendor.indexOf("Apple Computer")!=-1));
var myrules = {
    'input.search' : function(element){
        if (isSafari) {
            // changing type to "search"
            element.setAttribute('type', 'search');
			element.setAttribute('class', 'marginSafari'); 
            element.setAttribute('placeholder', DEF_VAL);
            element.setAttribute('autosave', AUTOSAVE_URL);
            element.setAttribute('results', NUM_RESULTS);
        } else {
            // doing the "Search this Site..."-Displaying- & -Hiding-Stuff
            element.onfocus = function() { if (this.value==DEF_VAL) this.value = ''; };
            element.onblur  = function() { if (this.value=='')      this.value = DEF_VAL; };
            if (element.value=='') element.value = DEF_VAL;
        }
    }
};

Behaviour.register(myrules);