$(document).ready(function(){
	var clickFunc = function(ev){
		$('#'+$(ev.target).attr('rel')).slideToggle('slow');
		var a =$(ev.target);
		if (a.hasClass('closed')){
			a.removeClass('closed').addClass('opened');
		}else{
			a.removeClass('opened').addClass('closed');
		}
	}
	$("span.arrow").click(clickFunc);
});

function showTTD(vr){
	$('div.ttd').hide();
	$('#'+vr).show();
	$('#'+vr).click(function(){
		var sel = '';
		if ( window.getSelection ){
			sel = window.getSelection().toString();
		} else if( document.selection ) {
			sel = document.selection.createRange().text;
		}
		if (sel.length == 0) $(this).hide();
		});
	return false;
}