/*for browsers that don't support placeholder text*/
document.observe("dom:loaded", function() {
	if (!supports_input_placeholder())
	{
		var Placeholder = Class.create({
			initialize: function (element) {
				this.element = element;
				this.placeholder = element.readAttribute('placeholder');
				this.blur();
				Event.observe(this.element, 'focus', this.focus.bindAsEventListener(this));
				Event.observe(this.element, 'blur', this.blur.bindAsEventListener(this));
			},
			focus: function () {
				if (this.element.hasClassName('placeholder'))
					this.element.clear().removeClassName('placeholder');
			},
			blur: function () {
				if (this.element.value === '')
					this.element.addClassName('placeholder').value = this.placeholder;
			}
		});
		$$('input[placeholder]').each(function (input) {
			new Placeholder(input);
		});
	}
});
function supports_input_placeholder() {
  var i = document.createElement('input');
  return 'placeholder' in i;
}
