/**
 * This code was written by Mike Moore November 2009 and is the property of OnNowTV.com Broadcasting Association...Copyright 2008
 * This code MAY NOT BE USED without the expressed written consent of 
 * OnNowTV.com Broadcasting Association - all rights reserved.
 
 * File name:     jq_categoryfilter.js
 * Description:   define common global variables below:
 * History:       
 *   mm/dd/yyyy - Name - brief description of changes              
 */

$(function() {
	
	$("#categoryListLink").click(function(){
		if ($("#categoryListing").is(":hidden")){
			$("#categoryListing").slideDown("slow");
		} else {
			$("#categoryListing").slideUp("slow");
		}
	});
	
	
	$("p.categoryitems").click( function() {
		updateCategoryList($(this).attr("id"));
	});
	
	var updateCategoryList = function(displayCategories) {
		$('#channelList li').show();
		
		if (displayCategories != 'showall') {
			$('#channelList li').filter(function(){
				return $(this).attr("class") != displayCategories;
			}).hide();
		}
	}
	
});
