  $(document).ready(function(){
	 /* $("#sporcular-container").ajaxStart(function(){
		  $(this).html('<img src="/site_media/img/loading.gif" />');
	  });
         */
      if($("#medal").length !=0)
      {
      	$("#medal").tablesorter({sortList: [[0,0]]});
      }

      $(".playerselect").change(function(){
             return get_player($(this).val());
      });

      function get_player(id){
       $.ajax({
             type: "GET",
             url : "/term/player/",
             data: "id=" + id,
             success: function(result){
		   $("#sporcular-container").html("");
		   $("#sporcular-container").slideUp("normal");
		   $("#sporcular-container").html(result);
		   $("#sporcular-container").slideDown("slow");
             }
       })
       return false;

      };
      
      var content = $("#program").html();
      if(content != null){
	  var stripped = content.replace(/(<([^>]+)>)/ig,"");
	  $("#program").html("<p>"+stripped.slice(0,1400)+" ... </p>");
	  $("#devam").bind("click",function(e){
		  $(this).remove();
		  $("#program").slideUp("fast");
		  $("#program").html(content);
		  $("#program").slideDown("slow");
		  return false;
	  });
      }

  });

