/* Author: 

*/

function activatePlaceholders() {

		var detect = navigator.userAgent.toLowerCase();
		if (detect.indexOf("safari") > 0) return false;
		
		var inputs = document.getElementsByTagName("*");
		for (var i=0;i<inputs.length;i++) {
				if ((inputs[i].getAttribute("type") == "text")|| (inputs[i].tagName.toLowerCase()=="textarea"))
				{
						var placeholder = inputs[i].getAttribute("placeholder");
						$(inputs[i]).addClass("dim");
						//$(inputs[i]).css("color","red");
						if (placeholder.length > 0) {
						
								inputs[i].value = placeholder;
								
								inputs[i].onfocus = function() {
									$(this).removeClass('dim');
									if (this.value == this.getAttribute("placeholder")) {
										this.value = "";
									}
									return false;
								
								}
								
								inputs[i].onblur = function() {
								
									if (this.value.length < 1) {
									
										this.value = this.getAttribute("placeholder");
										$(this).addClass('dim');
									
									}
								
								}
						
						}
				
				}
		
		}

}

