var modal_cntr=0; function modal_show(title,content,btn_ok_label,callback_ok,close_on_ok,is_full_screen){ if(typeof(close_on_ok)=='undefined')close_on_ok=true; return (function(x,close_on_ok){ modal=''; modal=$(modal); $('body').append(modal); modal_inst=modal.remodal({closeOnConfirm:false}); modal_inst.open(); modal.on('closed',function(){$(this).remove();}); $('#modal-box-'+x+' #modal_ok').on('click',function(){ callback_ok(modal,modal_inst); if(close_on_ok) modal_inst.close(); }); return modal; })(modal_cntr++,close_on_ok); }