/*
 * jQuery placeholder fallback.
 * Requires Modernizr
 */
;(function($) {

	$(function() {
		// No need to run if the browser is already going to do it
		if (Modernizr.input.placeholder)
			return;
		$('input').each(function() {
			$this = $(this);
			var ph = $this.attr('placeholder');
			if (ph != '' && $this.val() == '') {
				$this.val(ph);
				$this.addClass('placeholder');
				$this.focus(function() {
					if ($(this).val() == ph) {
						$(this).val('');
						$(this).removeClass('placeholder');
					}
				});
				$this.blur(function() {
					if ($(this).val() == '') {
						$(this).val(ph);
						$(this).addClass('placeholder');
					}
				});
			}
		});
	});

})(jQuery);

