function check_placeholder_support() {
	var i = document.createElement('input');
	return 'placeholder' in i;
}

function check_addressable_option() {
	var answer = $('input.addressable:checked').attr('id');
	if (answer == 'yes') {
		$("#address-opt").show("blind");
	} else {
		$("#address-opt").hide("blind");
	}
}

$(document).ready(function(){
	if (check_placeholder_support()) {
		// rejoice, a modern user
	} else {
		$('input[class*=replace]').each(function(){
			var p = $(this).attr('placeholder');
			if (p != '') {
				if (window.location.pathname.match('forum')) {
					$(this).before('<h2 class="top-padded">' + p + '</h2>');
				} else {
					$(this).before('<div class="placeholder">' + p + '</div>');
				}
			}
		});
	}
});

$(document).ready(function(){
	$("select#news-archive").change(function(){
		var value = $("select option:selected").attr('value');
		if ( value != "" ) {
			window.location = "/news" + value
		}
	});
});

$(document).ready(function(){
	check_addressable_option();
	$("input.addressable").change(function(){
		var answer = $(this).attr('id');
		if (answer == 'yes') {
			$("#address-opt").show("blind");
		} else {
			$("#address-opt").hide("blind");
		}
	});
});

$(document).ready(function(){
	var err = $("div.error"); 
	var notice = $("div.notice");
	if (err || notice) {
		err.animate({opacity: 1.0}, 2000).effect("fade", 3000);
		notice.animate({opacity: 1.0}, 2000).effect("fade", 3000);
	}
});

$(document).ready(function(){
	var today = new Date();
	var month = today.getMonth() + 1;
	var cell_id = month + '/' + today.getDate() + '/' + today.getFullYear();
	$('table.minimonth td').each(function(){
		if ( $(this).attr('id') == cell_id ) {
			$(this).addClass('today');
			$(this).parent().addClass('proud_papa');
		}
	});
});