var DEF_VAL = "Google Search..."; // Default Value
var NUM_RESULTS = 5 // Number of Results

var isSafari = ((parseInt(navigator.productSub)>=20020000)&&     // detecting WebCore
			   (navigator.vendor.indexOf("Apple Computer")!=-1));
var myrules = {
	'input#text' : function(element){
		if (isSafari) {
			// changing type to "search"
			element.setAttribute('type', 'search');
			element.setAttribute('autosave');
			element.setAttribute('placeholder', DEF_VAL);
			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);
