function parseVideoList(a,k){
    var t = "#"+k;
    $(".cols_3").hide();
    $(".cols_3").removeClass("vis");
    var nd = k.replace("-","%20");
    var nodash = nd.replace("-","%20");
	var u = "/massmedia/grab/?author="+a+"&category="+nodash+"&ajax";
		$.getJSON(u,
			function(data){
			    if(data){
			        $(t).parent().eq(0).show();
			        $(t).parent().eq(0).addClass("vis");
			    }
				$.each(data.items, function(i,item){
					t = "ul#"+k;
					$(t).append("<li><img src='"+item.thumbnail+"' width='75' height='50' /><p><a href='"+item.absolute_url+"'>"+item.title+"</a></p><p class='small grey'>"+item.creation_date+"</p></li>")
				});
			columnfix();
		});
	
}
function toggleVideoAuthors(au){
	$("ul.video-list").each(function(){
		$(this).empty();
		parseVideoList(au,$(this).attr("id"))
	});
}

function columnfix(cl){
    var cc = 1;
    $(".last").removeClass('last');
    $(".vis").each(function(){
        if(cc % 3 == 0){
            $(this).addClass("last");
        }
        cc++;
    })
}

$(document).ready(function(){
    if(document.getElementById('top10block')){
        $('#top10block').tabs({ selected: 0 });
    }
	toggleVideoAuthors("washington%20times");
	//     $("#authors").change(function(){
	// 	toggleVideoAuthors(this.options[this.selectedIndex].value);
	// })
});