Array.prototype.delRepeat=function(){var a=[],b=[],j=0;for(var i=this.length;i>0;i--){if(!a[this[i-1]])a[this[i-1]]=1;else{if(a[this[i-1]]++==1)b[j++]=this[i-1];this.splice(i-1,1);}}return b;};
String.prototype.replaceAll = function(a,b,c){return (!RegExp.prototype.isPrototypeOf(a))?this.replace(new RegExp(a,(c?"gi":"g")),b):this.replace(a,b)};
String.prototype.right = function(a){return(this.length-a>=0&&this.length>=0&&this.length-a<=this.length?this.substring(this.length-a,this.length):null)};
String.prototype.left = function(a){return(a>0?this.substring(0,a):null)};
String.prototype.trim = function(a){var v=this;if(nul(v))return '';v=(v+'').replace(/(\s+)$/g,'').replace(/^\s+/g,'');if(!nul(a)){var l=a.length;var s1=v.substring(0,l),s2=v.substring(v.length-l,v.length);if(s1==a)v=v.substring(l,v.length);if(s2==a)v=v.substring(0,v.length-l);v=v.replaceAll(a+a,a,true)}return v};
String.prototype.trimA = function(a){return(this.right(this.length)==a?this.left(this.length-a.length):this)};
String.prototype.encode = function(a){return(nul(a)?"":escape(a).replace(/\+/g,'%2B').replace(/\"/g,'%22').replace(/\'/g,'%27').replace(/\//g,'%2F'))};
Date.prototype.format = function(a){var Week=['日','一','二','三','四','五','六'];return a.replace(/yyyy|YYYY/,this.getFullYear()).replace(/yy|YY/,(this.getYear() % 100)>9?(this.getYear() % 100).toString():'0' + (this.getYear() % 100)).replace(/MM/,(this.getMonth()+1)>9?(this.getMonth()+1).toString():'0' + (this.getMonth()+1)).replace(/M/g,(this.getMonth()+1)).replace(/w|W/g,Week[this.getDay()]).replace(/dd|DD/,this.getDate()>9?this.getDate().toString():'0' + this.getDate()).replace(/d|D/g,this.getDate())};
var isIE=navigator.appName=='Microsoft Internet Explorer';
var nul=function(a){return typeof(a)=='undefined'||a=="null"||a==""||a==null?true:false}
var _=function(a,b){if(typeof(a)=='string')var a=document.getElementById(a);return a}
function $v(a,b){var o=_(a,b);if(nul(o)){return "NULL";alert('ID: "'+a+'" 不是有效对象,取值错误。');}else return o.value.trim()}
function show(a,b,c,d,e){
var v=arguments,l=v.length,i=typeof(b)=='object'?b:document.getElementById(b),isi=function(x){return x?"|INPUT|TEXTAREA|OPTION|".indexOf(x.nodeName.toUpperCase())>-1?1:0:0},pt=isi(i),o,oc=ot='';
if(l==1||(l==2&&!i)){document.write(a);return}else if(l==2&&i){pt?i.value=a:i.innerHTML=a;return}
if(typeof(c)=="number"&&(l==3||l==4)){o=pt?i.value:i.innerHTML;setTimeout(function(){if(pt)i.value=a;else{i.innerHTML=a}},1);setTimeout(function(){if(l==4&&d=='del')o.parentNode.removeChild(o);else{if(pt)i.value=o;else{i.innerHTML=o}}o=null},c);return}
var ON='AUTO_GEN',rnd=function(){return Math.ceil(Math.random()*1000)},p={type:"text",id:ON+rnd()};for(var k in c)p[k]=c[k];
var pos=i?i:document.body,g=(!i||p.mode=="append"||p.tag)?1:0,g1=i?0:1,g2=p.mode=="append"?1:0,nt=function(a){return typeof(a)=='undefined'||a=="null"||String(a)==""||a==null?true:false},h=!isNaN(d)?d>0?1:0:0;
if(!pt){if(!g2){if(h)oc=pos.innerHTML;pos.innerHTML=''}}else{if(!g2)if(h)oc=pos.value;}if(g){o=document.createElement(p.tag?p.tag:'span');o.id=p.id;ot=isi(o);if(ot){o.type=p.type;o.name=p.id}if(!pt)pos.appendChild(o);}else{o=pos;ot=pt}
if(!nt(p.display)){o.style.display=String(p.display)=="1"?'block':String(p.display)=="0"?'none':p.display}else{var sd=window.getComputedStyle?window.getComputedStyle(o,null)['display']:o.currentStyle["display"];if(sd=='none')o.style.display='block'}
if(p.style){var s=p.style.split(";");for(var z=0;z<s.length;z++){var v=s[z].split(":");o.style[v[0]]=v[1]}}
if(ot){
if(!nt(p.autocomplete))o.autocomplete=p.autocomplete?"on":"off";
if(!nt(p.readonly))o.readOnly=p.readonly?true:false;
if(!nt(p.disabled))o.disabled=p.disabled?true:false;
if(!nt(p.checked)) o.checked =p.checked ?true:false;
if(!nt(p.selected))o.selected=p.selected?true:false;
}
if(ot&&a!=';')o.value=a;else if(a!=';')o.innerHTML=a;
if(h){setTimeout(function(){if(e=='del')o.parentNode.removeChild(o);else{if(isi(o))o.value=oc;else o.innerHTML=oc;oc=''}},d)}
}
function NoHTML(a){
var txt=a;if(nul(txt))return'';
txt=txt.replace(/<style[^>]*>[\s\S]*?<\/style[^>]*>/gi,'').replace(/<script[^>]*>[\s\S]*?<\/script[^>]*>/gi,'');
return trim(txt.replace(/<(?!br).*?>/g,'').replace(/<br.*?>/g,'\n').replace(/\0x34/g,"\"").replace(/\0x39/g,"\'"));
}
function jsencode(a){
if(!nul(a))return(nul(a)?"":a.replace(/\+/g,'%2B').replace(/\"/g,'%22').replace(/\'/g,'%27').replace(/\//g,'%2F').replace(/\|/,'\|'))
}
function $hide(a){
_(a).style.display='none'
}
function $show(obj){
_(obj).style.display=''
}
function $t(a,b){
if(b)b=_(b);
return ((typeof(b)=='object'?b:document).getElementsByTagName(a))
}
function $n(a,b){
return((typeof(b)=='object'?b:document).getElementsByName(a))
}
function encode(a){
return(nul(a)?"":escape(a).replace(/\+/g,'%2B').replace(/\"/g,'%22').replace(/\'/g,'%27').replace(/\//g,'%2F'))
}
function getRoot(a) {
var s=document.URL;
s=s.replace(/^.*?\:\/\/[^\/]+/,"").replace(/[^\/]+$/,"");
if(!a)return s;if(!/\/$/.test(s))s += "/";
if(/^\.\.\//.test(a)){
var Re=new RegExp("^\\.\\.\\/"),c=0;
while(Re.exec(a)!=null) {
a=a.replace(Re,"");
c++;
}
for(var i=0; i<c;i++){
s=s.replace(/[^\/]+\/$/,"");
}
if(s=="")return "/";
return s+a;
}
a=a.replace(/^\.\//,"");
return s+a;
}
var getXHR=function(){
var r=false;
if(window.XMLHttpRequest){
r=new XMLHttpRequest();
if(r.overrideMimeType)r.overrideMimeType('text/xml')
}
else if(window.ActiveXObject){
var v=['MSXML2.XMLHTTP','MSXML.XMLHTTP','Microsoft.XMLHTTP'];
for(var i=0;i<v.length;i++){
try{
r=new ActiveXObject(v[i]);
if(r)return r
}catch(e){}
}
}
return r
};
function isArray(o){return Object.prototype.toString.call(o)==='[object Array]'}
function req(u,o){
var P={
asyn:true,
type:"get",
dat:"",
rdt:"txt",
timeout:[90000,""],
cache:true,
fail:function(e,u,t,d,s){
u="http://"+window.location.host;
alert("错误类型:["+e+"]\nURI:["+t+"]["+u+"]\n\nData:{"+d+"}");
window.clipboardData.setData("Text",(("post"==t.toLowerCase())?u+(u.match(/\?/)?'&':'?')+d:u))
}
};
for(var key in o){P[key]=o[key]}
P.type=(P.type.toLowerCase()=='post')?'post':"get";
var r=getXHR(),L=P.loading,l,S,I,C,X=false,Z;
if(!L)l=false;
else if('string'==typeof(L)){l=true;C=null;I=L;S=false}
else if(isArray(L)){l=true;I=L[0],C=L[1];S=L[2]}
else l=false;
var _b=function(s){return(typeof(s)=="string"?_(s)?_(s):false:s)};
function _a(u,s){
if(!u.nodeName)return;
var v="|"+u.nodeName.toLowerCase()+"|";
if("|input|textarea|option|".indexOf(v)>-1)
u.value=s;
else u.innerHTML=s
}
function _q(_s){
var x=P.extra;
var d=P.rdt.toLowerCase();
var m=d&&d=="xml"?r.responseXML:r.responseText;
if(d=="json"&&m.indexOf("{",1)>-1){
try{
eval("m="+m)
}catch(e){show("执行JSON时发生语法错误(E1B2),原因:"+e.message,"MOStatus");setTimeout(function(){$hide("MOStatus")},10000);}
}
if(typeof(_s)=="function"){
var y=[m];
if(nul(x)){return _s(m)}
else if(isArray(x)){y.push.apply(y,x)}
else{y.push(x)}
try{_s.apply(_s,y)}catch(e){show("在回传附加参数时发生错误(E1A4),原因:"+e.message.replace("。","")+",请检查程序是否正确。","MOStatus");setTimeout(function(){$hide("MOStatus")},10000);return}
}
else{
try{
var t=_b(_s);
if(t)
_a(t,m);
else if("string"==typeof(_s))
eval(_s);
else _s(m)
}catch(e){
show("执行语句时发生错误(E1B2),原因:"+e.message.replace("。","")+",请检查程序是否正确。","MOStatus");setTimeout(function(){$hide("MOStatus")},10000)}
}
}
var _f=function(z){
var u="",y="",t=z.elements,v,a;
for(var x=0;x<t.length;++x){
v=t[x];
if(v.name!==""){
a=undefined;
switch(v.type){
case"select-one":