$(document).ready(function(){
	$('#comment-form-box a.toggle').toggle(function(){
		el = $(this);
		$(this).parent('<h3>').parent('div').next('div').slideToggle('fast',function(){
		el.removeClass('close').addClass('open');
	});
		return false;
	},function(){
			el = $(this);
			$(this).parent('<h3>').parent('div').next('div').slideToggle('fast',function(){
			el.removeClass('open').addClass('close');
		});
		return false;
	});

	$('#column-right a.toggle').removeClass('close').addClass('open');
	$('#column-right div.box-body').hide();

	// toggle boxes
	$('#column-right a.toggle').toggle(function(){
			el = $(this);
			$(this).parent('<h3>').parent('div').next('div').slideToggle('fast',function(){
			el.removeClass('open').addClass('close');
		});
		return false;
	},function(){
			el = $(this);
			$(this).parent('<h3>').parent('div').next('div').slideToggle('fast',function(){
			el.removeClass('close').addClass('open');
		});
		return false;
	});

	
	// apply 'imagelink' class to images in the main content
	$('a img').parent('a').addClass('imagelink');
	// apply 'textlink' class to regular links in the main content
	$('p a').addClass('textlink');
	//$('#main-entry-container ul li a').addClass('textlink');
	// apply 'textlink' class to author box links
	$('p.generic-text a').addClass('textlink');
	// apply 'citelink' class to links in block quote
	$('blockquote a').addClass('citelink');
	
	// attach a function to the quote comment link
	$('a.quote-comment').click( function() { 
		var tb = $('#comment');
		var strQuote = $(this).attr('title');
		// assign the value
		tb.val('<blockquote>' + strQuote + '</blockquote>');
		return false;
	 });
	
	// assign blockquote styles to comment boxes
	$('div.box-body blockquote').addClass('blockquote-quote');
	
});