jQuery.noConflict();
jQuery(document).ready(function($){
	$(document.createElement('link')).attr({type: 'text/css', href: '/features/nextamericandream/standard/css/widget_css.css', rel: 'stylesheet', media: 'screen'}).appendTo($('head'));

	var markup = "";
	$.getJSON("widget_content.json",
    function(data){
		markup += data.intro;
		var toExclude = "";
	
		//retrieve from html the shows to be excluded
		if ($("#tnad_module").attr("class")){
			toExclude = $("#tnad_module").attr("class").split(" ")
		}
	
		//if a show name in json doc is NOT in the array of shows to exclude, then add show desc to markup
		$.each(data.shows, function(i,show){
			if (!($.inArray(show.name, toExclude) != -1)){
				markup += show.description;
			}
		});

		markup += data.outro;
			
		$("#tnad_module").html(markup);
    });

});
