$( function(){


	$( 'ul.thelists li' ).click( function(){
		if( $( this ).hasClass( 'selected' ) ){
			return false;
		}
		/*var width = $( '.body .top ul.left' ).hide().filter( '#' + $( this ).html() ).show().width();
		var left = $( this ).position().left + $( this ).width() / 2 - width / 2;
		if( left < 10 ){
			left = 10;
		}*/
		//$( '.body .top ul.left:visible' ).css( 'marginLeft', left );
		
		var typeID = TextToType($(this).text());
		$( 'ul.thelists li' ).removeClass( 'selected' );
		$( this ).addClass( 'selected' );
		getMusicContent(typeID);
	});


	
	
});

function TextToType( text ){
	switch ( text ){
		case "TOP 10 TRACKS":
			return 1;
		case "TOP 10 ALBUMS":
			return 2;
		case "NEW RELEASES":
			return 3;
	}
	return false;
}


function getMusicContent(type_id)
{
	//$( '.moreslideshows .loader' ).show();

$.ajax({
  url : "/ajax/getMusicContent",
  type : "GET",
  data : "type_id=" + type_id,
  dataType : "html",
  error : function (xhr, desc, exception) {
	  //alert(xhr.responseText);
	  //$( '.slidelists' ).html( xhr.responseText );
	  },
  success : function (data) {
	  if(data) {
		//$( '.moreslideshows .loader' ).hide();
		$( '.musiccontent' ).html( data );
	  }
}
	  
});

}
