function getShows()
{
    new Ajax.Request('javascripts/shows.json', {
  method:'get',
  //requestHeaders: {Accept: 'application/json'},
  onSuccess: function(transport){
	 
	  var text = "/*-secure-\n"+transport.responseText+"\n*/";
	  text=text.evalJSON(true);
	  var k = text.shows.length;
	  //alert(k);
	  $('oldShows').update();
	  //clears out the div
		  for(l=0;l<k;l++)
		  {
		      var i = text.shows[l].bandsites.length;
		      //loop to build the category links
        	  var links = "a";
		      for(j=0;j<i;j++)
                {
                    //loop through the artists and links to construct multiple artsist/multiple links
                    if(links!="a"){
                        links = links + "<a href='"+text.shows[l].bandsites[j]+"'>"+text.shows[l].bands[j]+"</a>";
                    }else{
                        links = "<a href='"+text.shows[l].bandsites[j]+"'>"+text.shows[l].bands[j]+"</a>";
                    }
                }
    		$('oldShows').insert('<li id="showList"><p>'+text.shows[l].date+' &#8226 <a href="'+text.shows[l].venueURL+'">'+text.shows[l].venue+'</a> &#8226 '+text.shows[l].location+'<h4>'+links+'</h4></p></li>');
		  }
	  }
	});
}

function showAlbumsChron()
{
	new Ajax.Request('../javascripts/disc.json', {
  method:'get',
  //requestHeaders: {Accept: 'application/json'},
  onSuccess: function(transport){
	 
	  var text = "/*-secure-\n"+transport.responseText+"\n*/";
	  text=text.evalJSON(true);
	  var k = text.shows.length;
	  //alert(k);
	  $('discMain').update();
	  //clears out the div
		  for(n=0;n<k;n++)
		  {
		      var m = k-n;
		      for(l=0;l<k;l++){
		          if(text.shows[l].id==m){
        		      var i = text.shows[l].artist.length;
        		      //loop to build the category links
        		      var links = "a";
        		      for(j=0;j<i;j++)
                        {
                            //loop through the artists and links to construct multiple artsist/multiple links
                            if(links!="a"){
                                links = links + "<a href='"+text.shows[l].website[j]+"'>"+text.shows[l].artist[j]+"</a>";
                            }else{
                                links = "<a href='"+text.shows[l].website[j]+"'>"+text.shows[l].artist[j]+"</a>";
                            }
                            
                        }
        		            var image = text.shows[l].img;
                    		$('discMain').insert('<li id="discList"><p><img width="100px" src="'+image+'" align="right"/><h4>'+links+'</h4><em>'+text.shows[l].album+'</em><br/>'+text.shows[l].info+'</p></li>');			  
    		        }
		        }
		    }
		      
	  }
	});
	//change the link color to blue for the inactive link
	$('discChron').setStyle({
	    color: '#000000'
	    });
	$('discAlpha').setStyle({
	    color: '#0000EE'
	    });
}
