(function(n,t,i){function u(n,t){$("#msg").html(n),t&&$("#ext_status").attr("src","mz://system/image/warn.jpg")}function h(n){var i=$e.getextension(n,"_MANIFEST"),t;if(i)return(t=$e.getextension(n,"index"),!t&&(t=$e.getextension(n,"setting"),!t))?-1:t}function c(n,t){if(r&&(n+=n.search(/#/ig)>-1?"&"+r:"?"+r,pat.length>1&&(n+="#"+pat[1])),t)return n;location.href=n;return}var f=$GET.name,e=$GET.action||"add",r=$GET.params||"",s='<div class="clear10"><\/div><div class="clear10"><\/div>',o;if(f){if(r&&(r=unescape(r)),e=="add")if(o=h(f),o==-1)u("您已经安装过该扩展，无需重装"+s+'<a href="javascript:window.close()" class="button green">关闭窗口<\/a>',!0);else if(o){c(o);return}u("正在为您"+(e=="add"?"安装":"更新")+"扩展..."),$e.run({_file:"extension.dst",action:e,extname:$GET.name,_name:"ext_update_"+$GET.name,_runecho:function(n,t){t.search(/:/ig)==0?(t=t.substring(1),u(t)):debugtime(t)},_runover2:function(n,t,r){var o=h(f),l=o==i?"":'&nbsp;<A href="'+c(o,!0)+'" class="button green">忽略更新<\/a>';if(r==":failversion")u("查询扩展最新版本失败"+s+'<A href="javascript:document.location.reload();" class="button">再试一次<\/a>'+l,!0);else if(r==":lock")u("该扩展已经锁定，不需要更新"+s+'<A href="javascript:document.location.reload()" class="button">再试一次<\/a>'+l,!0);else if(!r||r=="")if(o=h(f),o==-1)$("#msg").html("成功"+(e=="add"?"安装":"更新")+"扩展："+$e.getextension("title")+'。[<a href="javascript:window.close()">关闭窗口<\/a>]').addClass("tip_warning");else if(o){c(o);return}}})}})(window,document)