var _____onMultipleForm,_____onSubmit,_____onBeforePushPassword,_____onBeforeInsert;(function(g,k){var m="$$$UserName$$$",n="$$$Password$$$",u="$$$AutoLoginScriptId$$$",p=function(){this.inpPwd=this.inpName=null},q=function(a,c,d){var b;try{k.createEvent?(g.Event?(b=k.createEvent("Events"),b.initEvent&&b.initEvent(c,!0,!0),b.keyCode=d,b.which=d):g.KeyboardEvent?(b=k.createEvent("KeyboardEvent"),b.initKeyboardEvent(c,!0,!0,g,String.fromCharCode(d),0,"",0),delete b.keyCode,"undefined"===typeof b.keyCode?Object.defineProperty(b,"keyCode",{value:d}):b.key=String.fromCharCode(d)):g.KeyEvent?(b=k.createEvent("KeyEvents"),b.initKeyEvent(c,!0,!0,g,!1,!1,!1,!1,d,0)):(b=k.createEvent("UIEvents"),b.initUIEvent(c,!0,!0,g,1),delete b.keyCode,"undefined"===typeof b.keyCode?Object.defineProperty(b,"keyCode",{value:d}):b.key=String.fromCharCode(d)),a.dispatchEvent(b)):k.createEventObject&&(b=k.createEventObject(),b.keyCode=d,a.fireEvent("on"+c,b))}catch(f){}},v=function(a){r(a,13)},r=function(a,c){q(a,"keydown",c);q(a,"keypress",c);q(a,"keyup",c)},s=function(a){if(a){var c=/login|\u767b[\u5f55\u9646]|((^| )btn_(dl|log)($| ))|denglu/i,d;if((d=a.className)&&c.test(d)||(d=a.id)&&c.test(d)||(d="A"===a.tagName?a.textContent||a.innerText:a.value)&&c.test(d))return!0}},z=function(a){for(;null!=a;){if("FORM"===a.tagName){for(var c=a.getElementsByTagName("input"),d=c.length,b=0;b<d;b++){var f=c[b],e=f.getAttribute("type");if("submit"===e||"image"===e||"button"===e&&s(f))return f}c=a.getElementsByTagName("button");d=c.length;for(b=0;b<d;b++)if(f=c[b],e=f.getAttribute("type"),"submit"===e||"image"===e||(!e||"button"===e)&&s(f))return f;c=a.getElementsByTagName("a");d=c.length;for(b=0;b<d;b++)if(f=c[b],s(f))return f}a=a.parentNode}return null},w=function(a){"function"===typeof _____onBeforePushPassword&&_____onBeforePushPassword.call(g,a);a.inpName.focus();for(var c=m.length,d=0;d<c;d++)r(a.inpName,m.charCodeAt(d));a.inpName.value=m;a.inpPwd.focus();c=n.length;for(d=0;d<c;d++)r(a.inpPwd,n.charCodeAt(d));a.inpPwd.value=n;if("function"!==typeof _____onSubmit||!0===_____onSubmit.call(g,a))(c=z(a.inpName))?c.click():(a.inpPwd.focus(),v(a.inpPwd));delete a.inpName;delete a.inpPwd},x=function(a){a="http://zs.913you.com/Interface/AutoLoginScriptFailReport.aspx?ver\x3d2.0\x26rnd\x3d"+(new Date).getTime()+"\x26AutoLoginScriptId\x3d"+u+"\x26type\x3d"+a+"\x26LoginURL\x3d"+encodeURIComponent(g.location.href);var c=k.head||k.body;c&&(reportSEl=k.createElement("script"),reportSEl.type="text/javascript",reportSEl.charset="utf-8",reportSEl.src=a,c.insertBefore(reportSEl,c.firstChild))},l=function(){this._nextAutoLogin_handle=null;this._tryCount=0;this._tryCountMax=10;this._nextTryMilSecondTime=1500};l.prototype.checkTryCount=function(a){return this._tryCount<this._tryCountMax?(a&&(this._tryCount+=1),!0):!1};l.prototype.nextAutoLogin=function(){this._nextAutoLogin_dispose();if(!this.checkTryCount(!1))return!1;var a=this;this._nextAutoLogin_handle=g.setTimeout(function(){a.autoLogin();a=null},this._nextTryMilSecondTime);return!0};l.prototype._nextAutoLogin_dispose=function(){null!==this._nextAutoLogin_handle&&(g.clearTimeout(this._nextAutoLogin_handle),this._nextAutoLogin_handle=null)};l.prototype.autoLogin=function(){if(this.checkTryCount(!0)){this._nextAutoLogin_dispose();for(var a=k.getElementsByTagName("input"),c=a.length-1,d=[],b=0;b<=c;b++){var f=a[b],e=f.getAttribute("type");e&&"password"!==e&&"text"!==e||d.push(f)}for(var c=d.length-1,a=[],h=[],l=0,b=0;b<=c;b++)f=d[b],e=f.getAttribute("type"),"password"===e?0!==h.length&&(l+=1,h.push(f),b<c&&"password"!==d[b+1].getAttribute("type")&&(1===l&&(e=new p,e.inpName=h[h.length-2],e.inpPwd=f,a.push(e)),l=0,h=[])):(e=f.value,-1===e.indexOf("\u5bc6\u7801")&&-1===e.indexOf("password")&&h.push(f));1===l&&(e=new p,e.inpName=h[h.length-2],e.inpPwd=h[h.length-1],a.push(e));c=a.length;if(0===c)this.nextAutoLogin()||y();else{if(1===c)w(a[0]);else{if("function"===typeof _____onMultipleForm&&(h=_____onMultipleForm.call(g,a),h instanceof p)){w(h);return}x(1)}y()}}};var t=new l,y=function(){_____onBeforeInsert=_____onBeforePushPassword=_____onSubmit=_____onMultipleForm=t=x=q=l=v=r=u=m=n=p=g=k=null};g.setTimeout(function(){"function"===typeof _____onBeforeInsert&&!0===_____onBeforeInsert(t)||t.autoLogin()},10)})(window,document);