function getChannels(odCategory) {
	$('#navList li a').each(function() {
		$(this).unbind()
	});
	$('#navListBottom li a').each(function() {
		$(this).unbind()
	});
	

	$(document).ready(function (){
			$.ajax({
				type: "GET",
				url: "/xml/on_demand.xml",
				/*data: {
				  key: "value"
				},*/
				dataType: "xml",
				success: function(xml) {
					$('#fodMain').val("");
					$('#fodMain').text("");
					$('.navList li a').each(function() {
						$(this).bind('click', function() {
							getChannels($(this).attr("id"));
							linkCode($(this),"OD" + odCategory,"","17");
						});
						if ($(this).attr("id") === odCategory) {
							($(this).attr("class").indexOf("bottomNavLink") != -1) ? $(this).removeClass("topNavOff").addClass("topNavOn2") : $(this).removeClass("topNavOff").addClass("topNavOn");
						} else {
							($(this).attr("class").indexOf("bottomNavLink") != -1) ? $(this).removeClass("topNavOn2").addClass("topNavOff") : $(this).removeClass("topNavOn").addClass("topNavOff");
						}
					});

					$(xml).find("channel").each(function() {
					   
					   var imageSrc = $(this).attr("id");
					   var type = $(this).attr("category");
					   var channelName = $(this).attr("name");
					   var noBorder = $(this).attr("last");
					   var description = $(this).find("description").text();

					   (noBorder === "yes") ? boxClass = "contentBox noborders" : boxClass = "contentBox";

					   if (odCategory === type) {

						   $("<div/>", {
								"class": boxClass,
								"id": imageSrc
							}).appendTo("#fodMain");
							$("<div/>", {
								"class": "contentImage"
							}).append('<img src="/images/io/on_demand/free/' + imageSrc + '.gif" width="200" height="100" border="0" alt="' + channelName + '"/>').appendTo("#" + imageSrc);
							$("<div/>", {
								"class": "contentBlurb",
								"id": "content" + imageSrc
							}).appendTo("#" + imageSrc);
							$("<h2/>", {
								"class": "dark"
							}).append(channelName).appendTo("#content" + imageSrc);
							$("<p/>").append(description).appendTo("#content" + imageSrc);
					   }
				   }
				   
				   );
				},
				failure: function() {alert("There was a problem retrieving the XML data.")}
			 });

	});
}

