/*
 * JS pour la Google Box
 */

// init namespace (à utiliser pour éviter toute collision)
if(!SOF) {var SOF = {};}

SOF.clearInput = function() {
	if(this.value == this.defaultValue) {
		this.value = '';
	}
};

SOF.restoreInput = function() {
	if(/^\s*$/.test(this.value)) {
		this.value = this.defaultValue;
	}
};

SOF.checkGBox = function() {
	var def = document.getElementById('mot-rech').defaultValue;
	var cur = document.getElementById('mot-rech').value;
	if(def != cur) submitGoogleForm();
};


Box.events.load(function() {
	var motRech = document.getElementById('mot-rech');
	if(motRech) {
		Box.events.add(motRech, 'focus', SOF.clearInput);
		Box.events.add(motRech, 'blur', SOF.restoreInput);
	}
});
