jQuery.ajaxSetup({
  'beforeSend': function(xhr){xhr.setRequestHeader("Accept", "text/javascript")}
});

$(document).ready(function(){
  $("#new_review").submit(function(){
    $.post($(this).attr("action"), $(this).serialize(), null, "script");
    return false;
  });
  
  $('#payment_foo').click(function(){
    alert('foo');
  });
  
  $('#payment_link_to').click(function(){
    $("#payment_iframe").attr("src", $('#payment_link_to').attr("href"));
    $('#payment_link_to').attr('href', '#');
    $('#micropayment').show();
    //$('#payment_link_to').attr("href"));
    $('#payment_iframe').show();
  });
});

function show_micropayment(payment_url){
  $("#payment_iframe").attr("src", payment_url);
  $('#payment_link_to').attr('href', '#');
  $('#payment_link_to').hide();
  $('#micropayment').show();
  $('#payment_iframe').show();
}

function stop_playback_in(secs){
  niftyplayer('niftyPlayer1').registerEvent('onStop', 'show_play_buttons()');
  setTimeout("niftyplayer('niftyPlayer1').stop()",secs*1000);
}
function show_play_buttons(){
  $("span.stop_button").hide();
  $("span.play_button").show();
}
function toggle_cover(path_to_image, url, highlight, url){
  $('#img_cover').attr('src', path_to_image);
  $('#album_cover').attr('href', path_to_image);
  $('#album_cover').attr('href', url);
  $('.info li').removeClass("active");
  $('#'+highlight).addClass("active");
}