window.addEvent('domready', function(){
	if (!('placeholder' in document.createElement('input'))) {
		$$('input').each(function(e){
			if (e.get('placeholder')) {
				e.addEvent('focus', function(){
					if (e.get('value') == e.get('placeholder')) {
						e.set({
							'value': ''
							, 'styles': {'color':'#333'}
						});
					}
				});

				e.addEvent('blur', function(){
					if (e.get('value') == '') {
						e.set({
							'value': e.get('placeholder')
							, 'styles': {'color':'#999'}
						});
					}
				});

				e.fireEvent('blur');
			}
		});
	}
});

