$(document).ready(function(){
	
	// flags hover highlight effect:
	$('.flags img, .social_buttons li').css('opacity', '0.5');
	$('.flags img, .social_buttons li').hover(
		function() {
			$(this).css('opacity', '1');
		},
		function() {
			$(this).css('opacity', '0.5');
		}
	);
	
	$('#sidebar ul li ul li:last-child').css('border-bottom', 'none');
	
	// comments form agreement
	$commentSubmit = $('#commentform #submit');
	
	if ($('input[name=accept_terms]').attr('checked') === true) {
		$commentSubmit.css('color', '#FFF');
	}
	
	$('input[name=accept_terms]').change(function(){
		if ($(this).attr('checked') === true) {
			$commentSubmit.css('color', '#FFFFFF');
		}
		else {
			$commentSubmit.css('color', '#676157');
		}
	});
	
	$commentSubmit.click(function(){
		if ($('input[name=accept_terms]').attr('checked') === true) {
			$('.agreement_error').hide();
			$('#commentform').css('padding-bottom', '70px');
			return true;
		}
		else {
			$('.agreement_error').show();
			$('#commentform').css('padding-bottom', '20px');
			return false;
		}
	});
});
