$(function(){	
	// Load Initial Secondary Content.
	$.get('/resources/library/processors/secContentProc/proc.sec_content_video.php', function(data){
		$("#leftSideContent").html(data);
	});
	
	//toggles showing of video under category. 
	$('a.showVideo').live('click', function() {
		$(this).siblings(".categoryWrapper, .linksWrapper").slideToggle("slow");
		return false;
	});
	
	// Load Video using AHAH.
	$(".linkName a").live("click", function(){
		var episode_id = $(this).attr("value");
		$.ajax({
			url: '/resources/library/processors/videoProc/proc.SingleVideo.php',
			type: "POST",
			data: "video_id=" + episode_id,
			cache: true,
			async: false,
			success: function(response){
				$("#rightSideContent .divBlockContent").html(response);
			}
		});
		return false;
	});
	
	//	Hide all Nested Elements
	$(".categoryWrapper a.showVideo").livequery(function(){
		$(this).siblings(".categoryWrapper, .linksWrapper").hide();
	});
});