var dlgbox_counter = 0; function dlgBoxCreate(title, url, x, y, w, h) { dlgbox_counter++; $('body').append('
'+title+'
'); $('.dlg_'+dlgbox_counter).css('position', 'absolute'); $('.dlg_'+dlgbox_counter).css('left', x); $('.dlg_'+dlgbox_counter).css('top', y); $('.dlg_'+dlgbox_counter).css('width', w); $('.dlg_'+dlgbox_counter).css('height', h); $('.dlg_'+dlgbox_counter).hide(); $('.dlg_'+dlgbox_counter+'_main').load(url); dlgBoxShow(dlgbox_counter); console.log("dlgBoxCreate();"); return dlgbox_counter; } function dlgBoxShow(id) { $('.dlg_'+id+'_close').click(function (e) { $('.dlg_'+id).remove(); }); $('.dlg_'+id).show(); }