var isCountdown = true;

Event.observe(window, 'load', init, false);

function init() {
  new Form.EventObserver('customize_form', refresh_countdown);
}


function refresh_countdown() {
  
  formName = 'customize_form';
  
  $('refresh_button').value='Generating..';
  
  //$('refresh_button').style.display='none';
  
  new Ajax.Updater('countdown_swf','/bb/countdown/1',
    {
      method:'post',
      parameters: Form.serialize(formName),
      onFailure: function(){ alert('Something went wrong...') },
      onSuccess: function(){ $('refresh_button').value='Generate Countdown Now'; }
    });
}


function random_int() {
  
  return Math.floor(Math.random()*100000);
  
}



