/*
# -- BEGIN LICENSE BLOCK ----------------------------------
# This file is part of Zenstyle's blog, a theme for Dotclear.
# 
# Copyright (c) 2009 Tomtom
# http://blog.zenstyle.fr/
# 
# Licensed under the GPL version 2.0 license.
# A copy of this license is available in LICENSE file or at
# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# -- END LICENSE BLOCK ------------------------------------
*/
$(document).ready(function(){
	$('p.error#pr').backgroundFade(
		{sColor:'#ffffff',
		eColor:'#ff9999',
		steps:50},
		function(){
			$(this).backgroundFade(
				{sColor:'#ff9999',
				eColor:'#ffffff'}
			);
		}
	);
	$('p.message#pr').backgroundFade(
		{sColor:'#ffffff',
		eColor:'#99ff99',
		steps:50},
		function(){
			$(this).backgroundFade(
				{sColor:'#99ff99',
				eColor:'#ffffff'}
			);
		}
	);
});

$(function() {
	if ($('body.dc-post, body.dc-page').length == 0) { return; }
	if ($('#pr').length > 0) { return; }
	
	var link = $('<a href="#">' + $('#comment-form h3:first').text() + '</a>').click(function() {
		$('#comment-form fieldset:first').show(200);
		$('#c_name').focus();
		$(this).parent().removeClass('add-comment').html($(this).text());
		return false;
	});
	$('#comment-form h3:first').empty().append(link).addClass('add-comment');
	$('#comment-form fieldset:first').hide();
});