// -- Flag as Published -----------------------------------------------------

function publish_flag(checkbox)
{
  var i = checkbox.checked ? 0 : 1;
  
  $$('select.publish').each(function(e) {
    e.selectedIndex = i;
  });
}

// -- Submit the hidden form to update the AdPlacements for the day this checkbox is assigned to.

function calendar_submit_day(e)
{
  var mday = e.id.split(/_/)[2];
  var f = $('calendar_form');
  var v = $('calendar_form_mday');

  v.name = "day[" + mday + "]";
  v.value = e.className.match(/populated/) ? 0 : 1;

  f.onsubmit();
}
