/**
 * @author Ian Farrell @ Addison
 */

function clearField() {
	if (!document.getElementsByTagName) return false;
	if (!document.getElementById) return false;
	
	if(!document.getElementById("search")) {
		return false;
	}
	
	var clear = document.getElementById("search");
	var field = clear.getElementsByTagName("input");
	for(var i=0; i < field.length; i++) {
		field[i].onclick = function() {
			if (this.value == 'Zoek'){
				this.value = '';
			}
		}
	}
	for(var i=0; i < field.length; i++) {
		field[i].onblur = function() {
			if (this.value == ''){
				this.value = 'Zoek';
			}
		}
	}
}

window.onload = clearField;
