var modal={ init:function(obj){ this.init.title=obj.title; this.init.url=obj.url; this.init.func = obj.func; }, show:function(){ if(window.top!=window.self){ $("body",top.document).append('

'+window.top.init.title+'

'); }else{ if($(".loading").length==0) { $("body").append('

'+window.top.modal.init.title+'

'); } } }, remove:function(){ if(window.top!=window.self){ $(".mb",top.document).remove(); }else{ if($(".mb").length>0) $(".mb").remove(); } if(window.top.modal.init.func){ window.top.modal.init.func(); } } } $(document).on("click",".close",function(){ window.top.modal.remove(); })