/**
 * JavaScript for the blackboard module...
 */
 

/*
$(document).ready(function()
{


	var startHere = $('#node_ref div.bb_content:first');

	
	$('#node_ref h2 a').hover(function()
	{
		var id = $(this).attr('class');

		$('.bb_content.active').stop().hide().removeClass('active');
		$('div#node_ref div#' + id).addClass('active').slideDown(1000);
	});

	var divArea = $('#bb_header');

	var css = {
		'position' : 'absolute',
		'left' : '220px',
		'top' : '-40px',
	}

	var hidden = {'display' : 'none', 'width' : '100%'}

	$('.bb_content').css(hidden);

	startHere.addClass('active').slideDown(500);

//	$('<div id="bb_help"><h1></h1></div>').appendTo('#bb_header').hide().fadeIn(3000).css(css).fadeOut(10000);

	$('#bb_header h2').hover(function()
	{
		$('<div id="bb_hover"></div>').appendTo(this).css({
			'opacity' : '0.5',
			'position' : 'absolute',
			'top' : '40px',
		});
	}, function()
	{
		$('#bb_hover').remove();
	});

	var numSubjects = $('#bb_header h2').size();

		var i = 0;
});
*/
$.fn.wait = function(time, type) {
        time = time || 100;
        type = type || "fx";
        return this.queue(type, function() {
            var self = this;
            setTimeout(function() {
                $(self).dequeue();
            }, time);
        });
    };


$(document).ready(function()
{
	var startHere = $('#node_ref div.bb_content:first');

	var divArea = $('#bb_header');
	var css = {
		'position' : 'absolute',
		'left' : '220px',
		'top' : '-40px'
	}
	var hidden = {'display' : 'none', 'width' : '100%'}
	$('.bb_content').css(hidden);
	startHere.addClass('active').slideDown(300);
	$('#node_ref h2 a').hover(function()
	{
		if(!($(this).hasClass('hovered')))
		{
			var id = $(this).attr('class');
			
			$('#node_ref h2 a').removeClass('hovered');			
			$(this).addClass('hovered');
			$('.bb_content.active').hide().removeClass('active');
			$('div#node_ref div#' + id + ':not(\'.active\')').wait().addClass('active').slideDown(300);
		}

	});
	
});


 /*
$(document).ready(function()
{
	
	
	$('#node_ref h2 a').click(function()
	{
		var id = $(this).attr('class');
		
		$('.bb_content.active').removeClass('active').hide();
		$('div#node_ref div#' + id).addClass('active').slideDown(1000);
	});
	
	var divArea = $('#bb_header');
	
	var css = {
		'position' : 'absolute',
		'left' : '220px',
		'top' : '-40px',
	}
	
	var hidden = {'display' : 'none', 'width' : '100%'}
	
	$('.bb_content').css(hidden);
	
	
//	$('<div id="bb_help"><h1></h1></div>').appendTo('#bb_header').hide().fadeIn(3000).css(css).fadeOut(10000);
	
	$('#bb_header h2').hover(function()
	{
		$('<div id="bb_hover"></div>').appendTo(this).css({
			'opacity' : '0.5',
			'position' : 'absolute',
			'top' : '40px',
		});
	}, function()
	{
		$('#bb_hover').remove();
	});
	
	var numSubjects = $('#bb_header h2').size();
	
		var i = 0;
}); */