(function($) {
	$(document).ready(function() {
		$('a[href^="http://"]').attr('rel', 'external');
		$('a[href^="/fileadmin"]').attr('rel', 'external');
		$('a[href^="/uploads"]').attr('rel', 'external');
		$('a[rel=external]').attr('target', '_blank');

		/* Search box */
		$('#search_form input.sword').bind('focus', function(evt) {
			$(this).val('');
		});

		Cufon.replace('h2.csc-firstHeader');
		Cufon.replace('.carousel .items .highlight div strong');
		
		$('#content .tx-powermail-pi1_formwrap, .comment-form').corners('10px transparent');
		
		if (window.location.href.match(/#tx_tfe_blog_comment/)) {
			$(".tx-tfeblog-comment:first").animate({opacity: 0 }, 1);
			$(".tx-tfeblog-comment:first").animate({opacity: 1 }, 1000);
		}
		// Limit characters in comment field
		if ($('#tx_tfeblog_comment_form_comment').length > 0) {
			$('#tx_tfeblog_comment_form_comment').limit(1000, '#tx_tfeblog_comment_form_characters');
		}
	});
})(jQuery);
