// hide E-learning note if HTML2WP is the 1st (All-Citees is hidden)
function toggleNote13() {
	if (jQuery('#all-citees').is(':visible')) {
		jQuery('#note13').fadeIn(600);
	}
	else jQuery('#note13').fadeOut(400);
}


jQuery(function ($) {
	/* You can safely use $ in this code block to reference jQuery */

/* plugin for fading in elements one at a time. Used for portfolio work filter */
(function($){
$.fn.showdelay = function(){
var delay = 100;
return this.each(function(){
$(this).delay(delay).fadeIn(600);
delay += 600;
});
};
})(jQuery);


$(function() {

	/* show/hide notes */
	$('#notescontrol').show();
	// $('#noteslist').show(); //debug
	
	$('#notescontrol').toggle( function() {
		$(this).css('background-position', '0 -52px').html('Hide my notes');
		$('#noteslist').fadeIn(600);
		if ($('#all-citees').is(':hidden')) {
			$('#note13').hide();
		}
	}, function() {
		$(this).css('background-position', '0 -2px').html('Show my notes');
		$('#noteslist').fadeOut(400);
	});
	
	/* filter portfolio work */
	// show work based on selection onLoad
	$('#workform').show();
	$('.work').hide();
	var filterBy = $('#workselect').val();
	if (filterBy == 'all' || filterBy == undefined) {
		$('.work').show();
	}
	else {
	$('.' + filterBy).show();
	}
	
	// change work
	$('#workselect').change( function() {
		var filterBy = $(this).val();
		if (filterBy == 'all') {
			$('.work').hide().showdelay();
		}
		else {
			$('.work').hide();
			$('.' + filterBy).showdelay();
		}
	setTimeout('toggleNote13()', 1000);
	});	
	

	
});

});
