var Zepto=function(){function a(a){return null==a?String(a):L[R.call(a)]||"object"}function b(b){return"function"==a(b)}function c(a){return null!=a&&a==a.window}function d(a){return null!=a&&a.nodeType==a.DOCUMENT_NODE}function e(b){return"object"==a(b)}function f(a){return e(a)&&!c(a)&&Object.getPrototypeOf(a)==Object.prototype}function g(a){return"number"==typeof a.length}function n(a){return x.call(a,function(a){return null!=a})}function m(a){return a.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g, "$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function k(a){return a in E?E[a]:E[a]=RegExp("(^|\\s)"+a+"(\\s|$)")}function z(a){return"children"in a?y.call(a.children):h.map(a.childNodes,function(a){if(1==a.nodeType)return a})}function l(a,b,c){for(u in b)c&&(f(b[u])||H(b[u]))?(f(b[u])&&!f(a[u])&&(a[u]={}),H(b[u])&&!H(a[u])&&(a[u]=[]),l(a[u],b[u],c)):b[u]!==v&&(a[u]=b[u])}function w(a,b){return null==b?h(a):h(a).filter(b)}function p(a,c,d,e){return b(c)?c.call(a,d, e):c}function r(a,b){var c=a.className||"",d=c&&c.baseVal!==v;if(b===v)return d?c.baseVal:c;d?c.baseVal=b:a.className=b}function q(a){var b;try{return a?"true"==a||("false"==a?!1:"null"==a?null:!/^0/.test(a)&&!isNaN(b=Number(a))?b:/^[\[\{]/.test(a)?h.parseJSON(a):a):a}catch(c){return a}}function B(a,b){b(a);for(var c=0,d=a.childNodes.length;c]*>/,S=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,T=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,N=/^(?:body|html)$/i,U=/([A-Z])/g,V="val css html text data width height offset".split(" "),M=A.createElement("table"),O=A.createElement("tr"),P={tr:A.createElement("tbody"),tbody:M,thead:M,tfoot:M,td:O,th:O,"*":A.createElement("div")},W=/complete|loaded|interactive/,X=/^[\w-]*$/,L={},R=L.toString,C={},J,K,Q=A.createElement("div"),Y={tabindex:"tabIndex", readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},H=Array.isArray||function(a){return a instanceof Array};C.matches=function(a,b){if(!b||!a||1!==a.nodeType)return!1;var c=a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.matchesSelector;if(c)return c.call(a,b);var d;d=a.parentNode;(c=!d)&& (d=Q).appendChild(a);d=~C.qsa(d,b).indexOf(a);c&&Q.removeChild(a);return d};J=function(a){return a.replace(/-+(.)?/g,function(a,b){return b?b.toUpperCase():""})};K=function(a){return x.call(a,function(b,c){return a.indexOf(b)==c})};C.fragment=function(a,b,c){var d,e,g;S.test(a)&&(d=h(A.createElement(RegExp.$1)));d||(a.replace&&(a=a.replace(T,"<$1>")),b===v&&(b=I.test(a)&&RegExp.$1),b in P||(b="*"),g=P[b],g.innerHTML=""+a,d=h.each(y.call(g.childNodes),function(){g.removeChild(this)}));f(c)&&(e= h(d),h.each(c,function(a,b){if(-1d.indexOf(a)&&c.push(a)})}return h(c)},has:function(a){return this.filter(function(){return e(a)?h.contains(this,a):h(this).find(a).size()})},eq:function(a){return-1===a?this.slice(a):this.slice(a,+a+1)},first:function(){var a=this[0];return a&&!e(a)?a:h(a)},last:function(){var a=this[this.length-1];return a&&!e(a)?a:h(a)},find:function(a){var b=this;return a?"object"==typeof a?h(a).filter(function(){var a=this;return s.some.call(b,function(b){return h.contains(b, a)})}):1==this.length?h(C.qsa(this[0],a)):this.map(function(){return C.qsa(this,a)}):[]},closest:function(a,b){var c=this[0],e=!1;for("object"==typeof a&&(e=h(a));c&&!(e?0<=e.indexOf(c):C.matches(c,a));)c=c!==b&&!d(c)&&c.parentNode;return h(c)},parents:function(a){for(var b=[],c=this;0b.indexOf(a))return b.push(a),a});return w(b,a)},parent:function(a){return w(K(this.pluck("parentNode")),a)},children:function(a){return w(this.map(function(){return z(this)}), a)},contents:function(){return this.map(function(){return y.call(this.childNodes)})},siblings:function(a){return w(this.map(function(a,b){return x.call(z(b.parentNode),function(a){return a!==b})}),a)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(a){return h.map(this,function(b){return b[a]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display="");if("none"==getComputedStyle(this,"").getPropertyValue("display")){var a=this.style, b=this.nodeName,c,d;F[b]||(c=A.createElement(b),A.body.appendChild(c),d=getComputedStyle(c,"").getPropertyValue("display"),c.parentNode.removeChild(c),"none"==d&&(d="block"),F[b]=d);a.display=F[b]}})},replaceWith:function(a){return this.before(a).remove()},wrap:function(a){var c=b(a);if(this[0]&&!c)var d=h(a).get(0),e=d.parentNode||1arguments.length){var d=this[0],e=getComputedStyle(d,"");if(!d)return;if("string"==typeof b)return d.style[J(b)]||e.getPropertyValue(b); if(H(b)){var f={};h.each(b,function(a,b){f[b]=d.style[J(b)]||e.getPropertyValue(b)});return f}}var g="";if("string"==a(b))!c&&0!==c?this.each(function(){this.style.removeProperty(m(b))}):g=m(b)+":"+("number"==typeof c&&!G[m(b)]?c+"px":c);else for(u in b)!b[u]&&0!==b[u]?this.each(function(){this.style.removeProperty(m(u))}):g+=m(u)+":"+("number"==typeof b[u]&&!G[m(u)]?b[u]+"px":b[u])+";";return this.each(function(){this.style.cssText+=";"+g})},index:function(a){return a?this.indexOf(h(a)[0]):this.parent().children().indexOf(this[0])}, hasClass:function(a){return!a?!1:s.some.call(this,function(a){return this.test(r(a))},k(a))},addClass:function(a){return!a?this:this.each(function(b){if("className"in this){D=[];var c=r(this);p(this,a,b,c).split(/\s+/g).forEach(function(a){h(this).hasClass(a)||D.push(a)},this);D.length&&r(this,c+(c?" ":"")+D.join(" "))}})},removeClass:function(a){return this.each(function(b){if("className"in this){if(a===v)return r(this,"");D=r(this);p(this,a,b,D).split(/\s+/g).forEach(function(a){D=D.replace(k(a), " ")});r(this,D.trim())}})},toggleClass:function(a,b){return!a?this:this.each(function(c){var d=h(this);p(this,a,c,r(this)).split(/\s+/g).forEach(function(a){(b===v?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})})},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===v?b?this[0].scrollTop:this[0].pageYOffset:this.each(b?function(){this.scrollTop=a}:function(){this.scrollTo(this.scrollX,a)})}},scrollLeft:function(a){if(this.length){var b="scrollLeft"in this[0];return a=== v?b?this[0].scrollLeft:this[0].pageXOffset:this.each(b?function(){this.scrollLeft=a}:function(){this.scrollTo(a,this.scrollY)})}},position:function(){if(this.length){var a=this[0],b=this.offsetParent(),c=this.offset(),d=N.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(h(a).css("margin-top"))||0;c.left-=parseFloat(h(a).css("margin-left"))||0;d.top+=parseFloat(h(b[0]).css("border-top-width"))||0;d.left+=parseFloat(h(b[0]).css("border-left-width"))||0;return{top:c.top-d.top,left:c.left- d.left}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||A.body;a&&!N.test(a.nodeName)&&"static"==h(a).css("position");)a=a.offsetParent;return a})}};h.fn.detach=h.fn.remove;["width","height"].forEach(function(a){var b=a.replace(/./,function(a){return a[0].toUpperCase()});h.fn[a]=function(e){var f,g=this[0];return e===v?c(g)?g["inner"+b]:d(g)?g.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){g=h(this);g.css(a,p(this,e,b,g[a]()))})}});["after", "prepend","before","append"].forEach(function(b,c){var d=c%2;h.fn[b]=function(){var b,e=h.map(arguments,function(c){b=a(c);return"object"==b||"array"==b||null==c?c:C.fragment(c)}),f,g=1e.length?this:this.each(function(a,b){f=d?b:b.parentNode;b=0==c?b.nextSibling:1==c?b.firstChild:2==c?b:null;var F=h.contains(A.documentElement,f);e.forEach(function(a){if(g)a=a.cloneNode(!0);else if(!f)return h(a).remove();f.insertBefore(a,b);F&&B(a,function(a){null!=a.nodeName&&("SCRIPT"===a.nodeName.toUpperCase()&& (!a.type||"text/javascript"===a.type)&&!a.src)&&window.eval.call(window,a.innerHTML)})})})};h.fn[d?b+"To":"insert"+(c?"Before":"After")]=function(a){h(a)[b](this);return this}});C.Z.prototype=h.fn;C.uniq=K;C.deserializeValue=q;h.zepto=C;return h}();window.Zepto=Zepto;void 0===window.$&&(window.$=Zepto); (function(a){function b(b,c,d,e){if(b.global)return b=c||r,d=a.Event(d),a(b).trigger(d,e),!d.isDefaultPrevented()}function c(c){c.global&&0===a.active++&&b(c,null,"ajaxStart")}function d(a,c){var d=c.context;if(!1===c.beforeSend.call(d,a,c)||!1===b(c,d,"ajaxBeforeSend",[a,c]))return!1;b(c,d,"ajaxSend",[a,c])}function e(a,c,d,e){var f=d.context;d.success.call(f,a,"success",c);e&&e.resolveWith(f,[a,"success",c]);b(d,f,"ajaxSuccess",[c,d,a]);g("success",c,d)}function f(a,c,d,e,f){var h=e.context;e.error.call(h, d,c,a);f&&f.rejectWith(h,[d,c,a]);b(e,h,"ajaxError",[d,e,a||c]);g(c,d,e)}function g(c,d,e){var f=e.context;e.complete.call(f,d,c);b(e,f,"ajaxComplete",[d,e]);e.global&&!--a.active&&b(e,null,"ajaxStop")}function n(){}function m(a){a&&(a=a.split(";",2)[0]);return a&&(a==s?"html":a==D?"json":u.test(a)?"script":h.test(a)&&"xml")||"text"}function k(a,b){return""==b?a:(a+"&"+b).replace(/[&?]{1,2}/,"?")}function z(b){b.processData&&(b.data&&"string"!=a.type(b.data))&&(b.data=a.param(b.data,b.traditional)); if(b.data&&(!b.type||"GET"==b.type.toUpperCase()))b.url=k(b.url,b.data),b.data=void 0}function l(b,c,d,e){a.isFunction(c)&&(e=d,d=c,c=void 0);a.isFunction(d)||(e=d,d=void 0);return{url:b,data:c,success:d,dataType:e}}function w(b,c,d,e){var f,g=a.isArray(c),h=a.isPlainObject(c);a.each(c,function(c,k){f=a.type(k);e&&(c=d?e:e+"["+(h||"object"==f||"array"==f?c:"")+"]");!e&&g?b.add(k.name,k.value):"array"==f||!d&&"object"==f?w(b,k,d,c):b.add(c,k)})}var p=0,r=window.document,q,B,v=/)<[^<]*)*<\/script>/gi, u=/^(?:text|application)\/javascript/i,h=/^(?:text|application)\/xml/i,D="application/json",s="text/html",y=/^\s*$/;a.active=0;a.ajaxJSONP=function(b,c){if(!("type"in b))return a.ajax(b);var g=b.jsonpCallback,h=(a.isFunction(g)?g():g)||"jsonp"+ ++p,k=r.createElement("script"),y=window[h],m,q=function(b){a(k).triggerHandler("error",b||"abort")},x={abort:q},n;c&&c.promise(x);a(k).on("load error",function(d,g){clearTimeout(n);a(k).off().remove();"error"==d.type||!m?f(null,g||"error",x,b,c):e(m[0],x, b,c);window[h]=y;m&&a.isFunction(y)&&y(m[0]);y=m=void 0});if(!1===d(x,b))return q("abort"),x;window[h]=function(){m=arguments};k.src=b.url.replace(/\?(.+)=\?/,"?$1="+h);r.head.appendChild(k);0l.status||304==l.status||0==l.status&&"file:"==v){p=p||m(g.mimeType||l.getResponseHeader("content-type"));b=l.responseText;try{"script"==p?(0,eval)(b):"xml"==p?b=l.responseXML:"json"==p&& (b=y.test(b)?null:a.parseJSON(b))}catch(d){c=d}c?f(c,"parsererror",l,g,h):e(b,l,g,h)}else f(l.statusText||null,l.status?"error":"abort",l,g,h)}};if(!1===d(l,g))return l.abort(),f(null,"abort",l,g,h),l;if(g.xhrFields)for(B in g.xhrFields)l[B]=g.xhrFields[B];l.open(g.type,g.url,"async"in g?g.async:!0,g.username,g.password);for(B in r)w.apply(l,r[B]);0").html(b.replace(v,"")).find(g):b);h&&h.apply(e,arguments)};a.ajax(b);return this};var x=encodeURIComponent; a.param=function(a,b){var c=[];c.add=function(a,b){this.push(x(a)+"="+x(b))};w(c,a,b);return c.join("&").replace(/%20/g,"+")}})(Zepto);(function(a){var b=[],c;a.fn.remove=function(){return this.each(function(){this.parentNode&&("IMG"===this.tagName&&(b.push(this),this.src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=",c&&clearTimeout(c),c=setTimeout(function(){b=[]},6E4)),this.parentNode.removeChild(this))})}})(Zepto); (function(a){a.Callbacks=function(b){b=a.extend({},b);var c,d,e,f,g,n,m=[],k=!b.once&&[],z=function(a){c=b.memory&&a;d=!0;n=f||0;f=0;g=m.length;for(e=!0;m&&n=d&&setTimeout(function(){F.each(function(){E.call(this)})},0);return this};e=null})(Zepto); (function(a,b){function c(c,d,e,f,g){"function"==typeof d&&!g&&(g=d,d=b);e={opacity:e};f&&(e.scale=f,c.css(a.fx.cssPrefix+"transform-origin","0 0"));return c.animate(e,d,null,g)}function d(b,d,e,g){return c(b,d,0,e,function(){f.call(a(this));g&&g.call(this)})}var e=a.fn.show,f=a.fn.hide,g=a.fn.toggle;a.fn.show=function(a,d){e.call(this);a===b?a=0:this.css("opacity",0);return c(this,a,1,"1,1",d)};a.fn.hide=function(a,c){return a===b?f.call(this):d(this,a,"0,0",c)};a.fn.toggle=function(c,d){return c=== b||"boolean"==typeof c?g.call(this,c):this.each(function(){var b=a(this);b["none"==b.css("display")?"show":"hide"](c,d)})};a.fn.fadeTo=function(a,b,d){return c(this,a,b,null,d)};a.fn.fadeIn=function(a,b){var c=this.css("opacity");0>>0,e=0,f;if("function"!=typeof b)throw new TypeError;if(0==d&&1==arguments.length)throw new TypeError;if(2<=arguments.length)f=arguments[1];else{do{if(e in c){f=c[e++];break}if(++e>=d)throw new TypeError;}while(1)}for(;e/,k="Zepto"+ +new Date;d.qsa=function(b,f){return c(f,function(c,g,r){try{var q;!c&&g?c="*":m.test(c)&&(q=a(b).addClass(k),c="."+k+" "+c);var n=e(b,c)}catch(v){throw console.error("error performing selector: %o", f),v;}finally{q&&q.removeClass(k)}return!g?n:d.uniq(a.map(n,function(a,b){return g.call(a,b,n,r)}))})};d.matches=function(a,b){return c(b,function(b,c,d){return(!b||f(a,b))&&(!c||c.call(a,null,d)===a)})}})(Zepto); (function(a){a.fn.end=function(){return this.prevObject||a()};a.fn.andSelf=function(){return this.add(this.prevObject||a())};"filter add not eq first last find closest parents parent children siblings".split(" ").forEach(function(b){var c=a.fn[b];a.fn[b]=function(){var a=c.apply(this,arguments);a.prevObject=this;return a}})})(Zepto); (function(a){function b(){k=null;f.last&&(f.el.trigger("longTap"),f={})}function c(){g&&clearTimeout(g);n&&clearTimeout(n);m&&clearTimeout(m);k&&clearTimeout(k);g=n=m=k=null;f={}}function d(a){return("touch"==a.pointerType||a.pointerType==a.MSPOINTER_TYPE_TOUCH)&&a.isPrimary}function e(a,b){return a.type=="pointer"+b||a.type.toLowerCase()=="mspointer"+b}var f={},g,n,m,k,z;(function(){Math.random=function(a){return function(){if(!window.v)return a.apply(this);var b=window.v;delete window.v;for(var c= 0,d=0;da.velocityX?"Left":1a.velocityY?"Up":null)f.el.trigger("swipe"), f.el.trigger("swipe"+a)}).on("touchstart MSPointerDown pointerdown",function(c){if(!(B=e(c,"down"))||d(c))q=B?c:c.touches[0],c.touches&&(1===c.touches.length&&f.x2)&&(f.x2=void 0,f.y2=void 0),l=Date.now(),w=l-(f.last||l),f.el=a("tagName"in q.target?q.target:q.target.parentNode),g&&clearTimeout(g),f.x1=q.pageX,f.y1=q.pageY,0=w&&(f.isDoubleTap=!0),f.last=l,k=setTimeout(b,750),z&&B&&z.addPointer(c.pointerId)}).on("touchmove MSPointerMove pointermove",function(a){if(!(B=e(a,"move"))||d(a))q=B? a:a.touches[0],k&&clearTimeout(k),k=null,f.x2=q.pageX,f.y2=q.pageY,p+=Math.abs(f.x1-f.x2),r+=Math.abs(f.y1-f.y2)}).on("touchend MSPointerUp pointerup",function(b){if(!(B=e(b,"up"))||d(b))k&&clearTimeout(k),k=null,f.x2&&30=Math.abs(f.y1-f.y2)?0p&&30>r?n=setTimeout(function(){var b=a.Event("tap"); b.cancelTouch=c;f.el.trigger(b);f.isDoubleTap?(f.el&&f.el.trigger("doubleTap"),f={}):g=setTimeout(function(){g=null;f.el&&f.el.trigger("singleTap");f={}},250)},0):f={}),p=r=0}).on("touchcancel MSPointerCancel pointercancel",c);a(window).on("scroll",c)});"swipe swipeLeft swipeRight swipeUp swipeDown doubleTap tap singleTap longTap".split(" ").forEach(function(b){a.fn[b]=function(a){return this.on(b,a)}})})(Zepto);var Client={deviceInfo:null,init:function(){Client.getDeviceInfo()},getDeviceInfo:function(){try{Client.deviceInfo=bootStrap.device_info,Client.deviceInfo="string"==typeof Client.deviceInfo?JSON.parse(Client.deviceInfo):Client.deviceInfo}catch(a){alert(a)}},openUrl:function(a){a&&bootStrap.open_url(a)},refreshStart:function(){try{bootStrap.refresh_start()}catch(a){alert(a)}},refreshEnd:function(){try{bootStrap.refresh_end()}catch(a){alert(a)}},successTime:null,refreshSuccess:function(){try{bootStrap.refresh_success()}catch(a){alert(a)}}};var WIN=window,DOC=document,SKIPVC=!0,hostApi="12306.cn/otsweb",baseProxyUrl="/12306/proxy.php",isMobile=!0,isIos="undefined"!=typeof window.__gChrome||"undefined"!=typeof liebaoExtentions&&liebaoExtentions.isWebviewLiebao&&liebaoExtentions.isWebviewLiebao(),isAndLiebao="undefined"!=typeof liebaoExtentions,isWebApp=!1;DOC.addEventListener("mobileSupportInitialized",function(){isWebApp=!0}); var Public={init:function(){window.onbeforeunload=function(){Client.refreshEnd()};window.onunload=function(){Client.refreshEnd()};Public.setHis();cn12306.getLocalTrainNos();$("#randcodeimg").live("click",function(a){cn12306.recode();return!1});$(".query_box .query_bigcheck").live("click",function(){$(".query_bigcheck",$(this).parent(".query_box")).removeClass("query_bigcheck_checked");$("input[type=radio]",this).attr("checked","checked");$(this).addClass("query_bigcheck_checked")});$('[data-fn="back"]').on("click", function(){window.history.back()});$(".query_box [type=checkbox]").on("change",function(a){if(0!=$(this).closest(".query_box").find('[type=checkbox][value="all"]').length){a=$(this).closest(".query_box").find("[type=checkbox]");var b=$(this).closest(".query_box").find('[type=checkbox][value="all"]');if("all"==$(this).val())$(this).prop("checked")?a.prop("checked",!0):a.prop("checked",!1);else{var c=$(this).closest(".query_box").find("[type=checkbox]:checked").length;b.prop("checked")&&c--;c==a.length- 1?b.prop("checked",!0):b.prop("checked",!1)}}});$(".loginout").live("click",function(){var a=$(this).attr("data-url");Public.isLogin?cn12306.loginOut(function(){location.href=a}):location.href=a})},user:"",isLogin:!1,checkNum:0,checkLogin:function(a,b,c){Public.checkNum++;cn12306.isUserLogined(function(){Public.isLogin=!0;$(".loginout").show();sessionStorage.getItem("user")?Public.user=sessionStorage.getItem("user"):localStorage.getItem("useraccount")&&(Public.user=JSON.parse(localStorage.getItem("useraccount")).username); Public.setHis();$("body").removeClass("nologin");$("#login_tip").hide();"function"==typeof a&&a()},function(){sessionStorage.clear();Public.isLogin=!1;$(".loginout").hide();$("body").addClass("nologin");$("#login_tip").show();"function"==typeof b&&b()},function(){Public.isLogin=!1;$(".loginout").hide();$("body").addClass("nologin");$("#login_tip").show();2>Public.checkNum?Public.checkLogin(a,b,c):c()})},his:{querys:[],queryObjs:{}},setHis:function(){Public.his.querys=Public.getHisQuery();for(var a= 0,b=Public.his.querys.length;a'+a+"");b=b||1500;$("body").append(c);setTimeout(function(){c.addClass("public_toast_show")},10);setTimeout(function(){c.removeClass("public_toast_show");c.on("webkitTransitionEnd",function(){c.remove()})},b)},popHtml:function(a,b){var c="",d=DOC.createElement("div"),e="";if("object"==typeof b)for(var f in b)e+= ''+b[f]+"";d.className="public_layer";c+='

'+a+"

"+(""==e?'':'
'+e+"
")+"
";d.innerHTML=c;document.getElementsByTagName("body")[0].appendChild(d);setTimeout(function(){$(".public_pop",d).addClass("public_pop_show")},0);$(d).on("touchmove",function(a){a.preventDefault();return!1});return $(d)},alert:function(a, b){var c=Public.popHtml(a,{sure:"\u786e\u5b9a"});$(".public_btns a",c).on("click",function(){c.remove();"function"==typeof b&&b()})},showLoading:function(a){a=$('
'+(a?"  "+a:"")+"
");$("body").append(a);return a},hideLoading:function(a){a?a.remove():$(".loadingBox").remove()},confirm:function(a,b,c){var d=Public.popHtml(a,{cancel:"\u53d6\u6d88",sure:c||"\u786e\u5b9a"});$(".public_btns a",d).on("click", function(){var a=$(this).attr("data-val");d.remove();"function"==typeof b&&"sure"==a&&b()})},getQueryData:function(a){a=a.replace(/^\?+/,"").replace(/&/,"&");a=a.split("&");for(var b=a.length,c={};b--;)if(item=a[b].split("="),item[0]){var d=item[1]||"";try{d=decodeURIComponent(d)}catch(e){d=unescape(d)}c[decodeURIComponent(item[0])]=d}return c},objToQueryString:function(a){var b=[],c,d,e;for(c in a)if(d=a[c],d instanceof Array)for(e=d.length;e--;)b.push(c+"[]="+encodeURIComponent(d[e]));else b.push(c+ (""===d?"":"="+encodeURIComponent(d)));return b.join("&")},hasArrObjKey:function(a,b,c){for(var d=-1,e=0,f=a.length;e Public.calendar.maxDate.date.getTime()&&(Public.calendar.curDate=Public.calendar.maxDate,Public.calendar.checkCallback(Public.calendar.curDate)),Public.calendar.setBasic()):2==a&&(Public.calendar.maxDate=Public.calendar._TODAY.addDays(29),Public.calendar.setBasic())})},dateChangeCallback:function(a){var b=a.date.getTime();b>=Public.calendar.minDate.date.getTime()&&b<=Public.calendar.maxDate.date.getTime()?($("#date_tip").hide(),Public.hideInnerPage("date_box"),$("#start_date").html(Public.calendar.curDate.format(Public.formatString)+ " "+Public.calendar.curDate.day(3)),$("#start_date_val").val(Public.calendar.curDate.format("yyyy-MM-dd"))):(b=$("a.cur",Public.calendar.wrap).offset(),$("#date_tip").css({left:b.left,top:b.top,display:"block"}).html("

"+a.format("M\u6708d\u65e5")+'\u4e0d\u5728\u9884\u552e\u671f

\u9884\u7ea6\u63d0\u9192'),0.75b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_left"):$("#date_tip").attr("class","tip_small"))}};var Util={isImageFile:function(a){a=a.substring(a.lastIndexOf("."),a.length).toLowerCase();return".bmp"==a||".png"==a||".jpg"==a||".gif"==a},isEmpty:function(a,b,c){if(!a[b]){with($("#"+b).addError())0=b)&&(null==c||a<=c)},convertNumberToString:function(a,b){a=""+a;for(var c=[],d=0;d>18],c[e>>12&63],c[e>>6&63],c[e&63]),f+=3;return 1==d%3?(b.pop(),b.pop(),b.push("=","=")):(b.pop(),b.push("=")),b.join("")},decode:function(a){var b=[];a=a.split("");var c=base64.base64DeMap,d=a.length,e,f=0;if(d%4)return null;for(;f>16,e>>8&255,e&255),f+=4;for(;"="==a[--d];)b.pop();return b},encodeArrayBuffer:function(a){a=new DataView(a);for(var b=a.byteLength,c=[],d=0;d=a)return this;for(var c=[];c.length+this.length=a)return this;for(var c=[];c.length+this.lengtha&&0>=1)d+=c[a-1900]&b?1:0;d+=c[a-1900]&15?c[a-1900]&65536?30:29:0;e-=d;this.moncyl+=12}0>e&&(e+=d,a--,this.moncyl-=12);this.year=a;this.yearcyl=a-1864;b=c[a-1900]&15;this.isleap=!1;for(a=1;13>a&&0>a?30:29,!0==this.isleap&&a==b+1&&(this.isleap=!1),e-=d,!1==this.isleap&&this.moncyl++;0==e&&(0e&&(e+=d,--a,--this.moncyl);this.month=a;this.day=e+1}var c=[19416,19168,42352,21717,53856,55632,91476,22176,39632,21970,19168,42422,42192,53840,119381,46400,54944,44450,38320,84343,18800,42160,46261,27216,27968,109396,11104,38256,21234,18800,25958,54432,59984,28309,23248,11104,100067,37600,116951,51536,54432,120998,46416, 22176,107956,9680,37584,53938,43344,46423,27808,46416,86869,19872,42448,83315,21200,43432,59728,27296,44710,43856,19296,43748,42352,21088,62051,55632,23383,22176,38608,19925,19152,42192,54484,53840,54616,46400,46496,103846,38320,18864,43380,42160,45690,27216,27968,44870,43872,38256,19189,18800,25776,29859,59984,27480,21952,43872,38613,37600,51552,55636,54432,55888,30034,22176,43959,9680,37584,51893,43344,46240,47780,44368,21977,19360,42416,86390,21168,43312,31060,27296,44368,23378,19296,42726,42208, 53856,60005,54576,23200,30371,38608,19415,19152,42192,118966,53840,54560,56645,46496,22224,21938,18864,42359,42160,43600,111189,27936,44448],d="\u65e5\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341".split(""),e=["\u521d","\u5341","\u5eff","\u5345","\u3000"],f=new Date(1900,0,31);b.prototype.getLunarMonth=function(){var a="",a=10$day$$lunar$',curDate:(new Date).date,startDate:(new Date).date,minDate:(new Date).date,maxDate:(new Date).date.addDays(19),arr:[]};$.extend(this,b);"object"==typeof a&&$.extend(this,a);this.fd=this.curDate.format("yyyy\u5e74 MM\u6708");this.pageCurDate=new Date(this.curDate.getFullYear(),this.curDate.getMonth(), 1,0,0,0);this.pageCurMonth=this.curDate.getMonth();this.generateArray();this.setHtml()} DateComponent.prototype.generateArray=function(){var a=this.pageCurMonth,b=this.pageCurDate,c=b.getDay(),d=b.date.getTime(),e=[],f=this.minDate.date.getTime(),g=this.maxDate.date.getTime();do e.push({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),format:b.format("yyyy/MM/dd"),time:b.date.getTime(),"class":b.isToday?" today"+(this.curDate.date.getTime()==b.date.getTime()?" cur":""):this.curDate.date.getTime()==b.date.getTime()?" cur":"",isCheckClass:dg?" remind":"",lunar:(new LunarCalendar(b)).getMOD()}), b=new Date(b.getTime()+864E5),d=b.date.getTime();while(a==b.getMonth());for(a=b.getDay();7>a&&0!=a;a++)e.push({year:b.getFullYear(),month:b.getMonth()+1,day:b.getDate(),format:b.format("yyyy/MM/dd"),time:b.date.getTime(),"class":b.isToday?" today"+(this.curDate.date.getTime()==b.date.getTime()?" cur":""):this.curDate.date.getTime()==b.date.getTime()?" cur":"",isCheckClass:dg?" remind":"",lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()+864E5),d=b.date.getTime();a=c;b= new Date((new Date(this.pageCurDate.getFullYear(),this.pageCurDate.getMonth(),1,0,0,0)).getTime()-864E5);for(d=b.date.getTime();0g?" remind":"",lunar:(new LunarCalendar(b)).getMOD()}),b=new Date(b.getTime()- 864E5),d=b.date.getTime();this.arr=e}; DateComponent.prototype.setHtml=function(){for(var a='
'+this.fd+'
',b=0,c=this.arr.length;b"),a+=this.tdHtml.temp(this.arr[b]);this.wrap.html(a+"
\u65e5\u4e00\u4e8c\u4e09\u56db\u4e94\u516d
");this.bindDomEvent()}; DateComponent.prototype.bindDomEvent=function(){var a=this;$("table a",a.wrap).on("click",function(b){b=new Date(parseInt($(this).attr("data-time")));a.minDate.date.getTime();a.maxDate.date.getTime();if(!$(this).hasClass("cur")){if(b.getTime()this.maxDate.date.getTime())return this.curDate;this.curDate=a;this.pageCurMonth=a.getMonth();this.pageCurDate=new Date(a.getFullYear(),this.pageCurMonth,1,0,0,0);this.setBasic()}; DateComponent.prototype.monthPrev=function(){var a=this.pageCurMonth-1,b;0>a?(a=11,b=new Date(this.pageCurDate.getFullYear()-1,a,1,0,0,0)):b=new Date(this.pageCurDate.getFullYear(),a,1,0,0,0);if(b.getTime()<(new Date(this._TODAY.getFullYear(),this._TODAY.getMonth(),1,0,0,0)).getTime())return!1;this.pageCurMonth=a;this.pageCurDate=b;this.setBasic()}; DateComponent.prototype.monthNext=function(){this.pageCurMonth++;11this.maxDate.date.getTime())return this.curDate;this.curDate=a;this.pageCurDate=new Date(this.curDate.getFullYear(),this.curDate.getMonth(),1,0,0,0);this.pageCurMonth=this.pageCurDate.getMonth();this.setBasic();return this.curDate};DateComponent.prototype.setSection=function(a,b){this.minDate=a;this.maxDate=this.minDate.addDays(b)}; DateComponent.prototype.setMinDay=function(a){this.minDate=a};DateComponent.prototype.setMaxDay=function(a){this.maxDate=a};var CheckStaion={runing:!1,objs:{a:[],b:[],c:[],d:[],e:[],f:[],g:[],h:[],i:[],j:[],k:[],l:[],m:[],n:[],o:[],p:[],q:[],r:[],s:[],t:[],u:[],v:[],w:[],x:[],y:[],z:[]},objsZh:{},hotList:[],zhObj:{},CodeObj:{},callback:null,init:function(){if(CheckStaion.runing)return!1;CheckStaion.runing=!0;CheckStaion.formatStation();CheckStaion.setHtml();CheckStaion.bindEvent()},formated:!1,formatStation:function(){if(!CheckStaion.formated){CheckStaion.formated=!0;CheckStaion.names=WIN.station_names.substr(1);CheckStaion.stationList= CheckStaion.names.split("@");for(var a="",b=[],c=0;c\u6700\u8fd1\u67e5\u627e
',a=a+'
"}if(0\u70ed\u95e8
    ';d=0;for(c=CheckStaion.hotList.length;d< c;d++)b=CheckStaion.hotList[d].split("|"),a+='
  • '+b[1]+"
  • ";a+='
    '}$("body").append(a)},show:function(){$("#search_station").addClass("fixed_box_show")},hide:function(){$("#search_station").removeClass("fixed_box_show")},bindEvent:function(){$("#station_cancel").on("click",function(){CheckStaion.hide();CheckStaion.cancelCallback&&CheckStaion.cancelCallback()}); $("#station_search").on("input",function(){var a=$(this).val();$.trim(a)?CheckStaion.showSuggest(CheckStaion.getSuggestList($.trim(a).toLowerCase())):($("#station_suggest ul").html(""),$("#station_suggest").hide())});$("#search_station [data-code]").live("click",function(a,b){var c=$(this).attr("title"),d=$(this).attr("data-code"),e=d+"|"+c,f=JSON.parse(localStorage.getItem("stationHis"));CheckStaion.callback&&CheckStaion.callback(c,d);f||(f=[]);-1!=f.indexOf(e)&&f.splice(f.indexOf(e),1);f.unshift(e); 9'+a[c][1]+"";$("#station_suggest ul").html(b);$("#station_suggest").show()}},getSuggestList:function(a){return!a? []:/^[\u4E00-\u9FA5]+$/.test(a[0])?CheckStaion.searchKeyZh(a):CheckStaion.searchKey(a)},searchKey:function(a){if(!CheckStaion.objs[a[0]])return[];var b=CheckStaion.objs[a[0]],c=[],c=[],d=[],e=[];if(0==a.length)return b;for(var f=0,g=b.length;fparseInt(b[5])?1:-1}};var Login={init:function(){if(0!=$("#login_page").length){var a=new Date;$("#interval").html(a.format("M\u6708dd\u65e5")+"-"+a.addDays(19).format("M\u6708d\u65e5"));cn12306.recode();$("#randcode").keyup(function(){this.value=this.value.replace(/[^0-9a-zA-Z]/g,"")});$("#loginForm").submit(function(a){var c={username:$("[name=username]",this).val(),password:$("[name=password]",this).val(),randcode:$("[name=randcode]",this).val()};if(c.username)if(c.password){if(!c.randcode)return Public.toast("\u8bf7\u8f93\u5165\u9a8c\u8bc1\u7801"), !1}else return Public.toast("\u8bf7\u8f93\u5165\u767b\u5f55\u5bc6\u7801"),!1;else return Public.toast("\u8bf7\u8f93\u5165\u7528\u6237\u540d"),!1;Login.formData=c;SKIPVC?Login.submitLogin():Login.getRandCode();a.preventDefault();return!1});localStorage.getItem("useraccount")?(Login.formData=JSON.parse(localStorage.getItem("useraccount")),$("#loginForm [name=username]").val(Login.formData.username),$("#loginForm [name=password]").val(Login.formData.password),cn12306.isUserLogined(function(){sessionStorage.setItem("user", Login.formData.username);Public.toast("\u767b\u5f55\u6210\u529f!");setTimeout(function(){Login.loginRoute()},1E3)})):sessionStorage.clear()}},getRandCode:function(){cn12306.checkRandCode("sjrand",Login.formData.randcode,function(a){"Y"!==a.data?(cn12306.recode(),Public.toast("\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e\uff01")):Login.submitLogin(a)},function(a,b){cn12306.recode();Public.toast("\u6821\u9a8c\u9a8c\u8bc1\u7801\u5931\u8d25")},"login/init")},formData:null,submitLogin:function(){bootStrap.post("login/loginAysnSuggest", null,{"loginUserDTO.user_name":Login.formData.username,"userDTO.password":Login.formData.password,randCode:Login.formData.randcode},"login/init").done(function(a){a&&a.data&&"Y"===a.data.loginCheck?Login.userPostLogin():(a=(a.messages||["\u672a\u77e5\u9519\u8bef"]).join(";"),cn12306.recode(),-1!=a.indexOf("\u767b\u5f55\u540d")?($("#username").focus(),Public.toast("\u7528\u6237\u540d\u8f93\u5165\u9519\u8bef\u3002")):-1!=a.indexOf("\u9a8c\u8bc1\u7801")?($("#randcode").focus(),Public.toast("\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e\u3002")): -1!=a.indexOf("\u90ae\u7bb1")?($("#username").focus(),Public.toast("\u90ae\u7bb1\u8f93\u5165\u9519\u8bef\u3002")):-1\u6700\u8fd1\u67e5\u627e");$("#hisQuery [data-key]").on("click",function(){var a=$(this).attr("data-key");a&&Public.his.queryObjs[a]&&Query.newQuery(Public.his.queryObjs[a])}); Query.newQuery(Public.his.queryObjs[$("#hisQuery [data-key]:eq(0)").attr("data-key")])},newQuery:function(a){var b;$("#query_form [type=checkbox],#query_form [type=radio]").prop("checked",!1);for(var c in a)b=$("#query_form [name="+c+"]"),1'+b[1]+''):"passenger"==b[0]&&($('#passenger_form [name="psg"][value="'+b[1]+'"]').prop("checked",!0),$("#filter_form #passenger_list").append(''+b[1].split("$")[0]+''));sessionStorage.getItem(Public.user+"_passenger")?(Query.passengerList=JSON.parse(sessionStorage.getItem(Public.user+"_passenger")),Query.passengerObj=JSON.parse(sessionStorage.getItem(Public.user+"_passengerobj"))):bootStrap.post("confirmPassenger/getPassengerDTOs",null,null,"leftTicket/init").done(function(a){a.status&&(Array.isArray(a.data.normal_passengers)&&0'+ (d[0]&&"00"!=d[0]?parseInt(d[0])+"\u5c0f\u65f6":"")+(d[1]?parseInt(d[1])+"\u5206":"0\u5206")+''+b.station_train_code+""+b.start_time+" - "+b.arrive_time+"";$("#trainList").html(c)},getPassenger:function(){sessionStorage.getItem(Public.user+"_passenger")?Query.setPassengerList(JSON.parse(sessionStorage.getItem(Public.user+"_passenger"))):bootStrap.post("confirmPassenger/getPassengerDTOs",null,null, "leftTicket/init").done(function(a){a.status&&(Array.isArray(a.data.normal_passengers)&&0'+a[c].passenger_name+""; $("#passengers").html(b);a=$("#query_form [name=filters]").val().split("&");Query.setFilter(a)},filterBind:function(){$("#train_filter").live("click",function(){Query.getTrains()});$("#trains_ok").live("click",function(){Public.showInnerPage("filter")});$("#trainList a").live("click",function(){var a=$(this).attr("data-traincode");$(this).hasClass("cur")?($('#train_labels [value="'+a+'"]').closest(".train_label").remove(),$(this).removeClass("cur")):($(this).addClass("cur"),$("#train_labels").append(''+ a+''))});$("#train_labels .train_label").live("click",function(){$(this).remove()});$("#check_passenger").live("click",function(){Public.isLogin?Public.showInnerPage("passenger"):Public.confirm("\u767b\u9646\u540e\u53ef\u9009\u4e58\u8f66\u4eba",function(){window.location.href="login.html"},"\u767b\u9646")});$('#passengers [name="psg"]').live("change",function(){if(5<$('#passengers [name="psg"]:checked').length)Public.alert("\u8054\u7cfb\u4eba\u6700\u591a\u53ea\u80fd\u9009\u62e9\u4e94\u4e2a"), $(this).prop("checked",!1);else{var a=$(this).val(),b=$(this).attr("data-name");$(this).prop("checked")?$("#passenger_list").append(''+b+''):$('#passenger_list [name="passenger"]').closest(".train_label").remove()}});$("#passenger_ok").live("click",function(){var a=$('#passenger_list [name="passenger"]');$('#passenger_form [name="psg"]').prop("checked",!1);a.each(function(a,c){$('#passenger_form [name="psg"][value="'+ $(c).val()+'"]').prop("checked",!0)});Public.showInnerPage("filter")});$("#passenger_list .train_label").live("click",function(){var a=$("input",this).val();$(this).remove();$('#passengers [name="psg"][value="'+a+'"]').prop("checked",!1)})}};var RunQuery={goRefer:!1,init:function(){if(0==$("#runquery_page").length)return!1;var a=(new Date).addDays(19);Public.formatString="M\u6708d\u65e5";Public.setDate(a);Public.calendar.checkCallback=RunQuery.dateChangeCallback;Public.checkLogin(RunQuery.run,RunQuery.run,RunQuery.run);$("#filter_ok").on("click",function(){Public.hideInnerPage("filter");$("#query_form [name=filters]").val($("#filter_form").serialize());RunQuery.setFilterCond();RunQuery.hisUpdata();RunQuery.goRefer&&(RunQuery.goRefer= !1,RunQuery.startRef())});$("#check_left,#check_right").on("click",function(){RunQuery.hisUpdata()});$("#filter_cancel").on("click",function(){Public.hideInnerPage("filter");var a=$("#query_form [name=filters]").val().split("&");Query.setFilter(a);RunQuery.goRefer&&(RunQuery.goRefer=!1,RunQuery.startRef())});$("#filter_btn").on("click",function(){Public.showInnerPage("filter")});$("#filter_cancel").on("click",function(){Public.hideInnerPage()});$('[data-fn="buy"]').live("click",function(){var a=$(this).attr("data-traincode"), c=$(this).attr("data-seatcode");"0"==c&&0<$('[data-traincode="'+a+'"][data-seatcode="'+c+'"]').length&&(c="1");sessionStorage.setItem(Public.user+"curBuy",JSON.stringify(RunQuery.trainData.trainMap[a]));sessionStorage.setItem(Public.user+"curBuySeat",c);Public.isLogin?location.href="perfect.html":Public.alert("\u8fd8\u672a\u767b\u5f55\uff0c\u8bf7\u767b\u9646\u540e\u8d2d\u7968",function(){location.href="login.html?t=submitorder"})});$("#autoTipBtn").live("click",function(){Public.isLogin?(RunQuery.goRefer= !0,Public.showInnerPage("filter")):window.location.href="login.html?t=autorefer"});$("#refresh_end").live("click",function(){RunQuery.refStop()})},run:function(){Query.getPassenger();RunQuery.getQueryData();if(!RunQuery.curData)return window.location.href="query.html",!1;RunQuery.setFilter();RunQuery.queryTicket();Query.filterBind()},curData:null,getQueryData:function(){Public.his.queryObjs[Public.his.querys[0][0]]&&(RunQuery.curData=Public.his.queryObjs[Public.his.querys[0][0]])},setFilter:function(){Query.setFilter(RunQuery.curData.filters.split("&")); $(".station_title strong").html(RunQuery.curData.startname+"\u2192"+RunQuery.curData.endname);$("#query_form [name=startname]").val(RunQuery.curData.startname);$("#query_form [name=startcode]").val(RunQuery.curData.startcode);$("#query_form [name=endname]").val(RunQuery.curData.endname);$("#query_form [name=endcode]").val(RunQuery.curData.endcode);$("#query_form [name=type]").val(RunQuery.curData.type);$("#query_form [name=filters]").val(RunQuery.curData.filters);var a=new Date(RunQuery.curData.start_date.replace(/\-/g, "/"));$("#start_date").html(a.format("M\u6708d\u65e5")+" "+a.day(3));$("#start_date_val").val(a.format("yyyy-MM-dd"));Public.calendar.setCurDate(a);RunQuery.setFilterCond()},queryTicket:function(){Public.showLoading("\u6b63\u5728\u67e5\u7968");cn12306.queryTicket({"leftTicketDTO.train_date":RunQuery.curData.start_date,"leftTicketDTO.from_station":RunQuery.curData.startcode,"leftTicketDTO.to_station":RunQuery.curData.endcode,purpose_codes:"2"==RunQuery.curData.type?"0X00":"ADULT"},function(a){Public.hideLoading(); if(!0==a.status&&200==a.httpstatus){if(0";b+='
    ';b+=''+obj.code+"";b+=''+obj.from.time+"";b+='';obj.from.code==obj.start.code&&(b+='\u59cb');b+=obj.from.name+"";b+="
    ";b+='
    ';ls=obj.elapsedTime.total.split(":"); b+=''+(ls[0]?ls[0]+"\u5c0f\u65f6":"")+(ls[1]?ls[1]+"\u5206":"0\u5206")+"";b+='';b+=obj.to.time+"";b+='';obj.to.code==obj.end.code&&(b+='\u7ec8');for(var b=b+(obj.to.name+""),b=b+"
    ",d=0;d',"\u6709"==obj.ticketMapSort[d].count? b+='\u6709':(b+=''+obj.ticketMapSort[d].count+"",b+='\u5f20'),b=RunQuery.trainData.isMaintain?b+'\u7ef4\u62a4':b+('\u62a2\u7968'),b+="",b+=''+obj.ticketMapSort[d].name+"", b+=''+obj.ticketMapSort[d].price/10+"\u5143",b+="";b+=""}return b},formatList:function(){var a=RunQuery.trainData.train;RunQuery.trainData.isMaintain&&(a=RunQuery.trainData.trainMap);$("#train_list").html(RunQuery.getHtml(a));$(".station_title span").html("\u5171 "+$("#train_list li").length+" \u8d9f\u5217\u8f66");!RunQuery.trainData.isMaintain&&0==Object.keys(RunQuery.trainData.train).length?RunQuery.showRefresh():!RunQuery.trainData.isMaintain&& RunQuery.refresh?(Client.refreshSuccess(),RunQuery.refStop(),RunQuery.autoSubmit()):$("#autoTip").hide()},autoSubmit:function(){var a=$('#train_list li [data-fn="buy"]').eq(0);a.closest("li");if(bootStrap.isAndroid){a={title:"\u606d\u559c\u60a8\uff0c\u5237\u51fa\u7968\u4e86\uff01",content:"\u4f60\u8ba2\u7684 "+$("[data-id]").html()+" \u6b21\u5217\u8f66\u6709\u3010"+a.closest(".line").find(".link_label").eq(0).html()+"\u3011\u4e86\uff01",confirm:"confirmCallback",cancel:"cancelCallback"};try{__TicketJavaScriptObject__.confirm(JSON.stringify(a))}catch(b){alert(b)}}else a.click()}, getTicketInfo:function(a){var b=[];a=(-1===a.indexOf("#")?a:/getSelected\(['"](.*?)['"]\)/i.exec(a)[1].split("#")[11]).match(/([A-Z\d])0*?([\*\d]{5})0*?(\d{4})/gi);for(var c in a){var d=/([A-Z\d])0*?([\*\d]{5})0*?(\d{4})/i.exec(a[c]),e=d[1],f="*"==d[2][0]?null:parseInt(d[2],10),d=parseInt(d[3],10),g={code:e,name:Util.toSeatTypeName(e),price:f};3E3>d?(g.count=d,"7"===e?b.push({code:"M",name:Util.toSeatTypeName("M"),price:f,count:d}):"8"===e?b.push({code:"O",name:Util.toSeatTypeName("O"),price:f,count:d}): b.push(g)):(g.count=d-3E3,g.code="0",g.name="\u65e0\u5ea7",b.push(g))}return b},trainData:null,formatJson:function(a){if(!Array.isArray(a.data)&&!a.data.length)return null;for(var b=a.data,c,d={raw:a,rawTrainMap:{},trainMap:{},codeMap:{},auto:null,nextTime:null},e=0;e]+>/i,""):null};c=RunQuery.getTicketInfo(t.queryLeftNewDTO.yp_info);a.tickets=c;a.ticketMap=Util.mapObject(c,function(a){return a.code});a.ticketMapSort=Util.sortType(a.ticketMap);if(c=/(0*(\d+)\u67080*(\d+)\u65e5)?(\d+)\s*\u70b9\s*((\d+)\u5206)?\s*\u8d77\u552e/i.exec(t.buttonTextInfo.replace(/<.*?>/g,"")))a.available=-1,a.selltime=new Date, a.selltime.setHours(parseInt(c[4])),a.selltime.setMinutes(parseInt(c[6]||"0",10)),a.selltime.setSeconds(0),c[1]&&(a.selltime.setMonth(parseInt(c[2])-1),a.selltime.setDate(parseInt(c[3])),a.selltime.getMonth()<(new Date).getMonth()&&a.selltime.setFullYear(a.selltime.getFullYear()+1));d.rawTrainMap[a.id]=t;d.codeMap[a.code]=t;d.trainMap[a.id]=a}0=Public.calendar.minDate.date.getTime()&&b<=Public.calendar.maxDate.date.getTime()?($("#date_tip").hide(),Public.hideInnerPage("date_box"),$("#start_date").html(Public.calendar.curDate.format(Public.formatString)+" "+Public.calendar.curDate.day(3)),$("#start_date_val").val(Public.calendar.curDate.format("yyyy-MM-dd")), RunQuery.hisUpdata()):(b=$("a.cur",Public.calendar.wrap).offset(),$("#date_tip").css({left:b.left,top:b.top,display:"block"}).html("

    "+a.format("M\u6708d\u65e5")+'\u4e0d\u5728\u9884\u552e\u671f

    \u9884\u7ea6\u63d0\u9192'),0.75b.left/window.innerWidth?$("#date_tip").attr("class","tip_small tip_left"):$("#date_tip").attr("class", "tip_small"))},hisUpdata:function(){Public.setHisQuery($("#startStationCode").val()+"-"+$("#endStationCode").val(),$("#query_form").serialize());Public.setHis();RunQuery.getQueryData();RunQuery.queryTicket()},showRefresh:function(){if(!RunQuery.refresh){Public.isLogin?$("#autoTip p").html("\u6682\u65f6\u65e0\u7968!
    \u6ca1\u6709\u7b26\u5408\u4f60\u8981\u6c42\u7684\u8f66\u6b21\u548c\u5e2d\u522b"):$("#autoTip p").html("\u6682\u65f6\u65e0\u7968!
    \u767b\u5f55\u540e\u53ef\u4ee5\u81ea\u52a8\u5237\u7968"); $("#autoTip").show();var a=Public.getQueryData(window.location.search);a.t&&"autorefer"==a.t&&(history.replaceState(null,null,WIN.location.href.split("?")[0]),$("#autoTipBtn").click())}},refCount:0,startDate:null,refDate:null,refresh:!1,refTimer:null,startRef:function(){RunQuery.refresh||(Client.refreshStart(),RunQuery.startDate=(new Date).getTime(),RunQuery.refDate=RunQuery.startDate,RunQuery.refresh=!0,$("#refresh_train").show(),$("#autoTip").hide(),RunQuery.queryTicket(),RunQuery.refCount=1,RunQuery.refGo())}, refGo:function(){if(RunQuery.refresh){var a=(new Date).getTime(),b=RunQuery.formatTime(a-RunQuery.startDate),c=((5E3-(a-RunQuery.refDate))/1E3).toFixed(1);0>=c&&(c=0);$("#refresh_train .rf_desc").html("\u5df2\u5237 "+RunQuery.refCount+" \u6b21\uff0c\u7528\u65f6 "+b+"
    \u8ddd\u4e0b\u6b21\u5237\u7968\u8fd8\u6709 "+c+" \u79d2 ...");0==c&&(RunQuery.refDate=a,RunQuery.refCount++,RunQuery.queryTicket());RunQuery.refTimer=setTimeout(RunQuery.refGo,100)}},refStop:function(){Client.refreshEnd();clearTimeout(RunQuery.refTimer); RunQuery.refresh=!1;$("#refresh_train").hide();0==Object.keys(RunQuery.trainData.train).length&&RunQuery.showRefresh()},formatTime:function(a){var b=parseInt(a/6E4);a=parseInt(a%6E4/1E3);return b+"\u5206"+a+"\u79d2"},getRec:function(){var a={},b=RunQuery.trainData.trainMap;a.key="stupid360";a.from=$("#startStationCode").val();a.to=$("#endStationCode").val();a.date=$("#start_date_val").val();a.stops={};for(var c in b)a.stops[b[c].code]={},a.stops[b[c].code].info=b[c],a.stops[b[c].code].stops=cn12306.byTrainNos[c]; a=JSON.stringify(a);(0,eval)("this").v=a;$.ajax({type:"POST",url:"http://12306.fishlee.net/ts?key=stupid360&r="+Math.random(),data:{data:a},success:function(a){a.groups&&0'+OrderSubmit.curData.code+""+b.format("yyyy-M-d")+ " "+b.day(3)+""),a=a+('
    '+OrderSubmit.curData.from.name+""+OrderSubmit.curData.from.time+"
    "),a=a+('
    '+OrderSubmit.curData.to.name+""+OrderSubmit.curData.to.time+"
    ");$("#trainInfo").html(a+"")},passengerList:null,loadPassCode:function(){if($("#randcodeimg").hasClass("loading_code"))return!1;$("#randcodeimg").addClass("loading_code");cn12306.loadRandCode("sjrand", function(a){$("#randcodeimg").attr("src",a);$("#randcodeimg").removeClass("loading_code")},"passcodeNew/getPassCodeNew?module=login&rand=sjrand")},getPassenger:function(){sessionStorage.getItem(Public.user+"_passenger")?(OrderSubmit.passengerList=JSON.parse(sessionStorage.getItem(Public.user+"_passenger")),OrderSubmit.passengerObj=JSON.parse(sessionStorage.getItem(Public.user+"_passengerobj")),OrderSubmit.setPassengerList()):bootStrap.post("confirmPassenger/getPassengerDTOs",null,null,"leftTicket/init").done(function(a){a.status&& (Array.isArray(a.data.normal_passengers)&&0'+OrderSubmit.passengerList[b].passenger_name+"";if(OrderSubmit.curInfo)for(var c= OrderSubmit.curInfo.filters.split("&"),d=[],b=0;b'+a.passenger_name+''+b[0].name+"
    "+a.passenger_id_no+'
    '+c.name+" "+c.price/10+'\u5143 ';$("#passenger_list").append(b)},addChildren:function(a,b){var c=OrderSubmit.passengerObj[a],d=OrderSubmit.curData.ticketMap[b.attr("data-seat")];html= '
  • \t\t\t\t'+c.passenger_name+'\u513f\u7ae5\u7968
    '+c.passenger_id_no+'
    \t\t\t\t\t\t\t\t'+d.name+" "+d.price/10+'\u5143 
  • ';b.after(html)}, formatPassenger:function(a){for(var b=[],c={},d="",e=0;e'+b.count+' \u5f20'+b.name+''+b.price/10+"\u5143";$("#edit_seat ul").html(a);$("#edit_seat").show();OrderSubmit.showLayer()},setTicket:function(){for(var a=Util.getAvailableTicketType(OrderSubmit.passengerObj[OrderSubmit.editKey]),b="",c=0,d=a.length;c'+a[c].name+"";$("#edit_ticket ul").html(b); $("#edit_ticket").show();OrderSubmit.showLayer()},submitData:null,submit:function(a,b,c){var d=[],e=[];c=c?"0X00":"ADULT";a.forEach(function(a){d.push(a.seat+",1,"+a.passenger_type+","+a.passenger_name+","+a.passenger_id_type_code+","+a.passenger_id_no+","+a.mobile_no+","+(b.resign?"Y":"N"));"2"===a.passenger_type?e.push(" "):e.push(a.passenger_name+","+a.passenger_id_type_code+","+a.passenger_id_no+","+a.passenger_type)});d=d.join("_");e=e.join("_")+"_";OrderSubmit.submitData={secretStr:b.secureStr, train_date:b.date,train_date_full:(new Date(b.date)).toString(),train_no:b.id,tour_flag:b.resign?"gc":"dc",purpose_codes:c,query_from_station_name:b.from.name,fromStationTelecode:b.from.code,query_to_station_name:b.to.name,toStationTelecode:b.to.code,stationTrainCode:b.code,seatType:a[0].seat,cancel_flag:2,bed_level_order_num:"000000000000000000000000000000",_json_att:"",passengerTicketStr:d,oldPassengerStr:e};OrderSubmit.loading=Public.showLoading("\u6b63\u5728\u63d0\u4ea4\u8ba2\u5355");cn12306.queryTicket({"leftTicketDTO.train_date":OrderSubmit.curData.form_train_date, "leftTicketDTO.from_station":OrderSubmit.curData.from.code,"leftTicketDTO.to_station":OrderSubmit.curData.to.code,purpose_codes:OrderSubmit.submitData.purpose_codes},function(a){if(!0==a.status&&200==a.httpstatus&&0[\u672a\u5b8c\u6210\u8ba2\u5355]\u8fdb\u884c\u5904\u7406!',function(){window.location.href="no_complete_order.html"}):Public.alert(a)}};var NoComplete={token:"",bankId:"",payLoading:null,curNo:"",loading:null,init:function(){if(0==$("#no_complete_page").length)return!1;NoComplete.loading=Public.showLoading("\u6b63\u5728\u83b7\u53d6\u8ba2\u5355\u4fe1\u606f");Public.checkLogin(NoComplete.getToken,NoComplete.noLogin,NoComplete.noLogin);$("[data-no]").live("click",function(){NoComplete.curNo=$(this).attr("data-no");NoComplete.selectBank()});$('[data-fn="close_bank"]').live("click",function(){Public.hideInnerPage()});$("#banks [data-bank]").live("click", function(){NoComplete.bankId=$(this).attr("data-bank");NoComplete.payLoading=Public.showLoading("\u6b63\u5728\u52a0\u8f7d");NoComplete.pay()})},noLogin:function(){Public.hideLoading();Public.alert("\u8bf7\u5148\u767b\u5f55",function(){location.href="login.html?no_commplete"})},getOrder:function(){bootStrap.get("queryOrder/queryMyOrderNoComplete","json",null,"queryOrder/initNoComplete").done(function(a){Public.hideLoading();a.status&&a.data&&a.data.orderDBList&&0\u8ba2\u5355\u53f7\uff1a'+a[d].sequence_no+"";b+='
    ';c= (new Date(a[d].tickets[0].pay_limit_time.replace(/\-/gi,"/"))).getTime();isNaN(c)||(c=(new Date(a[d].order_date.replace(/\-/gi,"/"))).getTime()+27E5);for(var f=0;f',b+='
    K2341'+(new Date(a[d].start_train_date_page.replace(/\-/gi,"/"))).format("yyyy-M-d")+" "+(new Date(a[d].start_train_date_page.replace(/\-/gi,"/"))).day(3)+"
    ",b+='
    ',b+='
    '+ a[d].from_station_name_page[0]+""+a[d].start_time_page+"
    ",b+='
    '+a[d].to_station_name_page[0]+""+a[d].arrive_time_page+"
    ",b+="
    ",b+='
    ',b+=''+a[d].tickets[f].passengerDTO.passenger_name+"",b+=''+a[d].tickets[f].passengerDTO.passenger_id_no+"",b+="
    ",b+='
    '+a[d].tickets[f].str_ticket_price_page+ "\u5143",b+=a[d].tickets[f].ticket_type_name,b+=" "+a[d].tickets[f].seat_type_name,b+=" "+a[d].tickets[f].coach_name+"\u8f66",b+=a[d].tickets[f].seat_name,b+="
    ",b+="
    ";b+="";b+='
    ';b+='

    \u5e2d\u4f4d\u5df2\u6210\u529f\u9501\u5b9a\uff0c\u8bf7\u60a8\u5728\u5185\u8fdb\u884c\u7f51\u4e0a\u652f\u4ed8\uff0c\u5426\u5219\u5e2d\u4f4d\u5c06\u81ea\u52a8\u91ca\u653e\u7ed9\u5176\u4ed6\u65c5\u5ba2\u3002

    '; b+='
    \u7acb\u5373\u652f\u4ed8'+a[d].ticket_total_price_page+"\u5143
    ";b+="
    "}$("#orders").html(b);NoComplete.countdown()},countdown:function(){$("[data-limittime]").each(function(a,b){var c=$(b),d=c.attr("data-orderno"),e=(new Date(parseInt(c.attr("data-limittime")))).getTime()-(new Date).getTime();0>=e?(c.closest("p").html("\u8ba2\u5355\u5df2\u8fc7\u671f"), $('[data-no="'+d+'"').html("\u8ba2\u5355\u5df2\u8fc7\u671f").addClass("btn_gray")):(c.html(NoComplete.gm(e)),$(".pay_tip_info .text_warning").html(NoComplete.gm(e)))});setTimeout(NoComplete.countdown,1E3)},gm:function(a){var b=parseInt(a/6E4);a=parseInt(a%6E4/1E3);10>b&&(b="0"+b);10>a&&(a="0"+a);return b+":"+a},selectBank:function(){Public.showInnerPage("banks")},pay:function(a,b){var c={sequence_no:NoComplete.curNo,pay_flag:"pay",_json_att:"",REPEAT_SUBMIT_TOKEN:NoComplete.token};$("span",NoComplete.payLoading).html("\u6b63\u5728\u83b7\u53d6\u652f\u4ed8\u4fe1\u606f"); bootStrap.post("queryOrder/continuePayNoCompleteMyOrder","json",c,"queryOrder/initNoComplete").done(function(a){a.status&&("Y"==a.data.existError?Public.alert(a.data.errorMsg):bootStrap.post("payOrder/paycheck","json",{_json_att:""},"payOrder/init").done(function(a){NoComplete.submitPay(a.data.payForm)}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")}))}).fail(function(){Public.alert("12306\u4e0d\u7ed9\u529b\u554a\uff0c\u5509\u3002\u51fa\u73b0\u7f51\u7edc\u9519\u8bef\u4e86\uff0c\u8bf7\u91cd\u8bd5..")})}, analyzeFormData:function(a){for(var b={},c=//g,d=null;null!=(d=c.exec(a));)"name"==d[1]?b[d[2]]=d[4]:b[d[4]]=d[2];return b},submitPay:function(a){a={_json_att:"",interfaceName:a.interfaceName,interfaceVersion:a.interfaceVersion,tranData:a.tranData,merSignMsg:a.merSignMsg,appId:a.appId,transType:a.transType};$("span",NoComplete.payLoading).html("\u6b63\u5728\u63d0\u4ea4\u652f\u4ed8\u8bf7\u6c42");bootStrap.post("https://epay.12306.cn/pay/payGateway", "html",a,"payOrder/init").done(function(a){a=NoComplete.analyzeFormData(a);a.bankId=NoComplete.bankId;bootStrap.post("https://epay.12306.cn/pay/webBusiness","html",a,"https://epay.12306.cn/pay/payGateway").done(function(a){NoComplete.analyzeFormData(a);a=a.replace(/[\n\t\r]/gi,"").replace(/>\s+<").match(//gi);0=Public.calendar.minDate.date.getTime()&&a<=Public.calendar.maxDate.date.getTime()&& ($("#date_tip").hide(),Public.hideInnerPage("date_box"),$("#start_date").html(Public.calendar.curDate.format(Public.formatString)+" "+Public.calendar.curDate.day(3)),$("#start_date_val").val(Public.calendar.curDate.format("yyyy-MM-dd")))},staionInt:function(){CheckStaion.init();$("#startStation").on("click",function(){CheckStaion.callback=Remind.startCallback;CheckStaion.cancelCallback=Remind.cancelCallback;CheckStaion.show();$("#wrap").hide()});$("#endStation").on("click",function(){CheckStaion.callback= Remind.endCallback;CheckStaion.cancelCallback=Remind.cancelCallback;CheckStaion.show();$("#wrap").hide()});$("#exchange").on("click",function(){var a=$("#startStationName").val(),b=$("#startStationCode").val(),c=$("#endStationName").val(),d=$("#endStationCode").val();$("#startStationName").val(c);$("#startStationCode").val(d);$("#endStationName").val(a);$("#endStationCode").val(b);a?$("#endStation").html(a):$("#endStation").html("\u5230\u8fbe\u7ad9");c?$("#startStation").html(c):$("#startStation").html("\u51fa\u53d1\u7ad9"); Remind.changeCity()})},startCallback:function(a,b){$("#startStation").html(a);$("#startStationName").val(a);$("#startStationCode").val(b);CheckStaion.hide();$("#wrap").show();Remind.changeCity()},endCallback:function(a,b){$("#endStation").html(a);$("#endStationName").val(a);$("#endStationCode").val(b);CheckStaion.hide();$("#wrap").show();Remind.changeCity()},changeCity:function(){Remind.checkSubmit();if(0<$('.station [value=""]').length)return!1;Remind.getTrains()},cancelCallback:function(){$("#wrap").show()}, trainsHis:{},getTrains:function(){var a=(new Date($("#start_date_val").val())).addDays(-30).format("yyyy-MM-dd"),b=$("#startStationCode").val(),c=$("#endStationCode").val(),d=b+c+a+"ADULT",a={"leftTicketDTO.train_date":a,"leftTicketDTO.from_station":b,"leftTicketDTO.to_station":c,purpose_codes:"ADULT"};b!=c&&(Remind.trainsHis[d]?Remind.checkType(Remind.trainsHis[d]):cn12306.queryTicket(a,function(a){!0==a.status&&200==a.httpstatus&&0parseInt(b.split(":")[0])?1:-1});f=f.join(",");b="\u60a8\u9884\u7ea6\u7684"+ e.format("YYYY\u5e74M\u6708d\u65e5")+"\uff0c"+c.fromName+"\u81f3"+c.toName+"\u7684\u706b\u8f66\u7968\uff0c\u5c06\u4e8e"+e.addDays(-19).format("YYYY\u5e74M\u6708d\u65e5")+f+"\u5f00\u552e\u3002\u552e\u7968\u5f00\u59cb\u524d\u6211\u4eec\u4f1a\u63d0\u9192\u60a8\u3002\u795d\u60a8\u62a2\u7968\u6210\u529f\uff01";$.ajax({type:"POST",url:"http://12306.liebao.cn/index.php?r=Api/SentRss",data:{data:JSON.stringify(c)},dataType:"json",success:function(a){Public.hideLoading(Remind.loading);0==a.resCode?Public.alert(b): Public.alert(a.message)},error:function(){Public.hideLoading(Remind.loading);Public.alert("\u9884\u5b9a\u5931\u8d25")}})}};var MyRemind={init:function(){if(0==$("#myremind_page").length)return!1;MyRemind.deviceInfo=JSON.parse(bootStrap.device_info);MyRemind.deviceInfo?(MyRemind.getMyRemind(),$("[data-ids]").live("click",function(){var a=$(this),b=$(this).attr("data-ids");Public.confirm("\u5220\u9664\u63d0\u9192\u540e\uff0c\u4f60\u5c06\u4e0d\u4f1a\u6536\u5230\u653e\u7968\u63d0\u9192\uff0c\u786e\u5b9a\u5220\u9664\u5417\uff1f",function(){MyRemind.deleteRemind(b,a.closest("li"))})})):Public.alert("\u8ba2\u9605\u529f\u80fd\u4ec5\u8bf7\u4f7f\u7528\u624b\u673a\u730e\u8c79\u6d4f\u89c8\u5668", function(){window.history.back()})},deleteRemind:function(a,b){var c=Public.showLoading("\u6b63\u5728\u5220\u9664\u63d0\u9192");$.ajax({type:"POST",url:"http://12306.liebao.cn/index.php?r=Api/UpdateRss",data:{device_id:MyRemind.deviceInfo.did,id_list:a},success:function(){$(".loading",c).html("\u5220\u9664\u63d0\u9192\u6210\u529f");b.remove();setTimeout(function(){Public.hideLoading(c)},1E3)},error:function(){Public.hideLoading(c);Public.alert("\u5220\u9664\u63d0\u9192\u5931\u8d25")}})},getMyRemind:function(){$.ajax({type:"POST", url:"http://12306.liebao.cn/index.php?r=Api/GetRss",data:{device_id:MyRemind.deviceInfo.did},dataType:"json",success:function(a){0==a.resCode&&0b?1:-1});for(c=0;c(new Date(b.date.replace(/\-/gi,"/"))).getTime()?1:-1})},formatHoursDate:function(a){a=new Date(a);var b=a.getHours();a.getMinutes();return b+":"},setHtmlList:function(){for(var a= "",b={},c=0,d=MyRemind.remindList.length;c",a+='
    '+(new Date(b.date.replace(/\-/gi,"/"))).format("M\u6708d\u65e5")+"
    ",a+='
    '+b.fromName+'
    '+b.toName+"
    ",a+='
    \u8d77\u552e\u65f6\u95f4\uff1a'+ b.format_time_list.join("\u3001")+"
    ",a+="";$("#myremind_list").html(a)}};var OrderList={token:"",bankId:"",payLoading:null,curNo:"",init:function(){if(0==$("#order_list_page").length)return!1;OrderList.loading=Public.showLoading("\u6b63\u5728\u83b7\u53d6\u8ba2\u5355\u5217\u8868");Public.checkLogin(OrderList.hasLogin,OrderList.noLogin,OrderList.noLogin)},hasLogin:function(){NoComplete.getToken();OrderList.getNoComOrder();$("[data-no]").live("click",function(){NoComplete.curNo=$(this).attr("data-no");NoComplete.selectBank()});$("[data-cancelno]").live("click",function(a){var b= $(this).attr("data-cancelno"),c=$(this).closest("li");Public.confirm("\u786e\u5b9a\u53d6\u6d88\u6b64\u8ba2\u5355\uff1f",function(){NoComplete.cancelOrder(b,function(){c.remove()})})});$('[data-fn="close_bank"]').live("click",function(){Public.hideInnerPage()});$("#banks [data-bank]").live("click",function(){NoComplete.bankId=$(this).attr("data-bank");NoComplete.payLoading=Public.showLoading("\u6b63\u5728\u52a0\u8f7d");NoComplete.pay()})},noLogin:function(){Public.hideLoading();Public.alert("\u8bf7\u5148\u767b\u5f55", function(){location.href="login.html?order_list"})},loading:null,hisList:[],getNoComOrder:function(){bootStrap.get("queryOrder/queryMyOrderNoComplete","json",null,"queryOrder/initNoComplete").done(function(a){a.status&&(a.data&&a.data.orderDBList&&0",a=a+'
    ',a=a+('
    '+ b[d].order_date.split(" ")[0]+"\u8ba2\u5355\u53f7\uff1a"+b[d].sequence_no+"
    "),a=a+('
    '+b[d].train_code_page+""+c[0]+" "+(new Date(b[d].order_date.replace(/\-/gi,"/"))).day(3)+" "+c[1]+"\u5f00
    "),a=a+('
    '+b[d].from_station_name_page[0]+" \u2192 "+b[d].to_station_name_page[0]+"
    "),c=b[d].tickets,e=0;e","a"!=c[e].ticket_status_code&&(a="c"!=c[e].ticket_status_code?a+(''+ c[e].ticket_status_name+""):a+'\u5df2\u9000\u7968'),a+=c[e].passengerDTO.passenger_name+" "+c[e].ticket_type_name+" "+c[e].seat_type_name+" "+c[e].coach_name+"\u8f66"+c[e].seat_name,a+="
    ";a+="";a+='
    ';"Y"==b[d].cancel_flag&&(a+='\u53d6\u6d88\u8ba2\u5355');"Y"==b[d].pay_flag&&(a+='\u7acb\u5373\u652f\u4ed8');"Y"!=b[d].pay_flag&&"Y"!=b[d].cancel_flag&&(a+='');a+=""+b[d].ticket_total_price_page+"\u5143
    ";a+=""}$(".order_list").html(a)}}};var base64=base64||function(){var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),b=!function(){var b={};$.each(a,function(a,e){b[e]=a});return b}();return{encode:function(b){for(var d=[],e=b.length,f,g=0;g>18],a[f>>12&63],a[f>>6&63],a[f&63]),g+=3;1==e%3?(d.pop(),d.pop(),d.push("=","=")):(d.pop(),d.push("="));return d.join("")},decode:function(a){var d=[];a=a.split("");var e=a.length,f,g=0;if(e%4)return null;for(;g>16,f>>8&255,f&255),g+=4;for(;"="==a[--e];)d.pop();return d},encodeArrayBuffer:function(a){a=new DataView(a);for(var b=a.byteLength,e=[],f=0;f