var show_wait_dialog = function() {}; //overridden elsewhere
function activate_forward(){
    $('.forward_button').bind('click', function(event){
        event.preventDefault();
    	show_wait_dialog();
        $('#step_form').submit();
        $('.forward_button').unbind('click');
        setTimeout(activate_forward, 2000);
    });
}

function activate_back(){
    $('.back_button').bind('click', function(event){
        event.preventDefault();
        var current_step = $('#wizard_step').attr('value');
        if (current_step > 0){
            $("#wizard_step").attr('value' ,current_step-1);
        }
        $('#step_form').submit();
        $('.back_button').unbind('click');
        setTimeout( activate_forward, 2000);
    });
}

$(document).ready(function(){    
    activate_forward();
    activate_back();
    $("#popup_form .close_button").click(function(){
        $(this).parent().hide('slow');
    });
    
    
});

