/* JavaScript to run on byteberry.net */

$(document).ready(function(){ 

    $("#MusicContainer").hide()
    $("#MusicContainer").load("music.php");  
    $("#middleMenu").click(function () {
	
      $("#MusicContainer").slideToggle("slow");
	  
    });

});  

$().ajaxSend(function(r,s){  
	$("#contentLoading").show();  
});  
  
$().ajaxStop(function(r,s){  
	$("#contentLoading").fadeOut("fast");  
});


 $('#commentForm').submit(function() {
            
          var inputs = [];
          $(':input', this).each(function() {
            inputs.push(this.name + '=' + escape(this.value));
          })
          
          jQuery.ajax({
            data: inputs.join('&'),
            url: this.action,
            timeout: 2000,
            error: function() {
              console.log('Failed to submit');
            },
            success: function(r) { 
	      window.location.reload();
              tb_remove();
            }
          }) 
          
          return false;
        })
