/** J 
*	Functions for adding HTML5 niceties to older browsers
*	To my pleasure, this file is relatively short
*	
*/

// Supply the below function with an array of elements needing enhancement
function activate_placeholders (elements) {
	
	
	for (var i = 0; i < elements.length; i++) {
		
		el = elements[i];
		
		el.onfocus = function () { //on focus
			if(this.value == this.placeholder) { //delete text if placeholder and value are identical
				this.value = '';
				el.style.cssText  = '';
			}
		};

		el.onblur = function () { //on blur
			if(this.value.length == 0) { //if value is zero, fill with placeholder text
				this.value = this.placeholder;
				el.style.cssText = 'color:#A9A9A9;';
			}
		};

		el.onblur(); // start the element as blurred.
		
	}
	

}
