function activatePlaceholders() {
	var detect = navigator.userAgent.toLowerCase();
	
	if (detect.indexOf("safari") > 0) return false;
	
	var inputs = document.getElementsByTagName("input");
	
	for (var i=0;i<inputs.length;i++) {
		
		if (inputs[i].getAttribute("type") == "text") {
			
			if (inputs[i].getAttribute("placeholder") && inputs[i].getAttribute("placeholder").length > 0) {
				if (inputs[i].getAttribute("placeholder") == "Zoeken...") {
					inputs[i].style.background = '#FFFFFF url(/img/google_custom_search_watermark.gif) left no-repeat';
				} else {
					inputs[i].value = inputs[i].getAttribute("placeholder");
					
				}
				
				inputs[i].onclick = function() {
					
					if (this.value == this.getAttribute("placeholder")) {
						this.value = "";
						
					} else if (this.value == "" && this.getAttribute("placeholder") == "Zoeken...") {
						this.style.background = '#FFFFFF';
					
					}
					
					return false;
				}
				
				inputs[i].onblur = function() {
					
					if (this.value.length < 1) {
						if (this.getAttribute("placeholder") == "Zoeken...") {
							this.style.background = '#FFFFFF url(/img/google_custom_search_watermark.gif) left no-repeat';
						} else {
							this.value = this.getAttribute("placeholder");
						}
					}
				}
			}
		}
	}
}
window.onload=function() {
	activatePlaceholders();
}

