// Adds some support for some new HTML 5 features to older browsers. Depends on Modernizr and JQuery 1.4.2 or later.
$(document).ready(function() {
	if (Modernizr !== undefined) {
		// Add support for placeholder text if the browser doesn't support it.
		if (!Modernizr.input.placeholder) {
			$('input[placeholder]').each(function(i, e) {
				var def = $(this).attr('placeholder');
				$(this).val(def).focusin(function() { ($(this).val() == def) ? $(this).val('').css('color', '#000') : false; }).focusout(function() { ($(this).val() == '') ? $(this).val(def).css('color', '#ccc') : false; });
				($(this).val() == def) ? $(this).css('color', '#ccc') : $(this).css('color', '#000');
			});
		}
		// Add support for the new autofocus attribute.
		if (!Modernizr.input.autofocus) {
			$('input[autofocus], select[autofocus], textarea[autofocus]').focus();
		}
		//Add support for first-child and last-child CSS selectors on lists.
		if ($.browser.msie) {
			$('ul > li:first-child').addClass('first-child');
			$('ul > li:last-child').addClass('last-child');
		}
	}
});
