function showDetail(sid)
{
//get the info on the show from the api

var apiurl = '/ajaxShowData.php?sid='+sid; //?format=JSON&sid='+sid;
/**
  $.getJSON(apiurl, {sid: sid},  
                  function(json) 
				  {  
                     var result = json.responseData.venue_name;  
					 
                      
                  }  
              ); 
**/
$.get(apiurl,{sid:sid} ,
   function(data){
   //decode data as json
   
   
   var obj = jQuery.parseJSON(data);

   //DEBUG
    //$("#json").html(data);
	var d = new Date(obj.show_date);
	//var sdate = d.format("MM/d/y");
	//var stime = '';
	
	//2010-11-18 - 19:00
	//to
	//11/18/2010 - 7:00
	
	
	
    //set all the fields
     var showdate = obj.show_date+' - '+obj.show_time;
	//var showdate = sdate+' - '+obj.show_time;
     $("#detail_date").html(showdate);
	 var venueinfo = obj.venue_name+' - '+obj.venue_city+', '+obj.venue_state;
	 $("#detail_venue").html(venueinfo);
	 $("#detail_phone").html(obj.venue_phone);
	 $("#detail_info").html(obj.show_support);
	 
	 if(obj.sale_link_type == 'presale')
	 {
	 var presalelink = '<a href="'+obj.presale_url+'" target="_blank">Buy Tickets</a>'; 
	 $("#detail_ticketing").html(presalelink);
	 }
	 else if(obj.sale_link_type == 'onsale')
	 {
	 $("#detail_ticketing").html( '<a href="'+obj.onsale_url+'" target="_blank">Buy Tickets</a>');
	 }
	 
	 
	 
	 if(obj.venue_url > '')
	 { 
	 var venueurl = '<a href="'+obj.venue_url+'" target="_blank">'+obj.venue_url+'</a>'; 
	 $("#detail_url").html(venueurl); 
	 }
	 else
	 {
	 $("#detail_url").html(""); 
	 }
	 
	 
    //display the popup
    $("#show_detail").show();	
   });	

}			  


function closeDetail()
{
$("#show_detail").hide();
}
