function FastClick(a){var b,c=this;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.touchBoundary=10;this.layer=a;if(!a||!a.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c, arguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)};FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchend", this.onTouchEnd,!1),a.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,f){var g=Node.prototype.removeEventListener;"click"===b?g.call(a,b,c.hijacked||c,f):g.call(a,b,c,f)},a.addEventListener=function(b,c,f){var g=Node.prototype.addEventListener;"click"===b?g.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),f):g.call(a,b,c,f)}),"function"===typeof a.onclick&&(b=a.onclick,a.addEventListener("click", function(a){b(a)},!1),a.onclick=null))}FastClick.prototype.deviceIsAndroid=0c.offsetHeight){b=c;a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)};FastClick.prototype.getTargetElementFromEventTarget=function(a){return a.nodeType===Node.TEXT_NODE?a.parentNode:a}; FastClick.prototype.onTouchStart=function(a){var b,c,d;if(1a.timeStamp-this.lastClickTime&&a.preventDefault();return!0};FastClick.prototype.touchHasMoved=function(a){a=a.changedTouches[0];var b=this.touchBoundary;return Math.abs(a.pageX-this.touchStartX)>b||Math.abs(a.pageY-this.touchStartY)>b?!0:!1};FastClick.prototype.findControl=function(a){return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")}; FastClick.prototype.onTouchEnd=function(a){var b,c,d;d=this.targetElement;if(this.touchHasMoved(a)||300a.timeStamp-this.lastClickTime)return this.cancelNextClick=!0;this.lastClickTime=a.timeStamp;b=this.trackingClickStart;this.trackingClick=!1;this.trackingClickStart=0;this.deviceIsIOSWithBadTarget&&(d=a.changedTouches[0],d=document.elementFromPoint(d.pageX-window.pageXOffset, d.pageY-window.pageYOffset));c=d.tagName.toLowerCase();if("label"===c){if(b=this.findControl(d)){this.focus(d);if(this.deviceIsAndroid)return!1;d=b}}else if(this.needsFocus(d)){if(100]*>/,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=q.createElement("table"),O=q.createElement("tr"),P={tr:q.createElement("tbody"),tbody:M,thead:M,tfoot:M,td:O,th:O,"*":q.createElement("div")},W=/complete|loaded|interactive/,X=/^[\w-]*$/,L={},R=L.toString,C={},J,K,Q=q.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 v.call(a,function(b,c){return a.indexOf(b)==c})};C.fragment=function(a,b,c){var d,e,E;S.test(a)&&(d=h(q.createElement(RegExp.$1)));d||(a.replace&&(a=a.replace(T,"<$1>")),b===x&&(b=I.test(a)&&RegExp.$1),b in P||(b="*"),E=P[b],E.innerHTML=""+a,d=h.each(u.call(E.childNodes),function(){E.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 B.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],q=!1;for("object"==typeof a&&(q=h(a));c&&!(q?0<=q.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 u.call(this.childNodes)})},siblings:function(a){return w(this.map(function(a,b){return v.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;E[b]||(c=q.createElement(b),q.body.appendChild(c),d=getComputedStyle(c,"").getPropertyValue("display"),c.parentNode.removeChild(c),"none"==d&&(d="block"),E[b]=d);a.display=E[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),q=d.parentNode||1arguments.length){var d=this[0],q=getComputedStyle(d,"");if(!d)return;if("string"==typeof b)return d.style[J(b)]||q.getPropertyValue(b); if(H(b)){var e={};h.each(b,function(a,b){e[b]=d.style[J(b)]||q.getPropertyValue(b)});return e}}var f="";if("string"==a(b))!c&&0!==c?this.each(function(){this.style.removeProperty(l(b))}):f=l(b)+":"+("number"==typeof c&&!G[l(b)]?c+"px":c);else for(r in b)!b[r]&&0!==b[r]?this.each(function(){this.style.removeProperty(l(r))}):f+=l(r)+":"+("number"==typeof b[r]&&!G[l(r)]?b[r]+"px":b[r])+";";return this.each(function(){this.style.cssText+=";"+f})},index:function(a){return a?this.indexOf(h(a)[0]):this.parent().children().indexOf(this[0])}, hasClass:function(a){return!a?!1:B.some.call(this,function(a){return this.test(A(a))},k(a))},addClass:function(a){return!a?this:this.each(function(b){if("className"in this){D=[];var c=A(this);n(this,a,b,c).split(/\s+/g).forEach(function(a){h(this).hasClass(a)||D.push(a)},this);D.length&&A(this,c+(c?" ":"")+D.join(" "))}})},removeClass:function(a){return this.each(function(b){if("className"in this){if(a===x)return A(this,"");D=A(this);n(this,a,b,D).split(/\s+/g).forEach(function(a){D=D.replace(k(a), " ")});A(this,D.trim())}})},toggleClass:function(a,b){return!a?this:this.each(function(c){var d=h(this);n(this,a,c,A(this)).split(/\s+/g).forEach(function(a){(b===x?!d.hasClass(a):b)?d.addClass(a):d.removeClass(a)})})},scrollTop:function(a){if(this.length){var b="scrollTop"in this[0];return a===x?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=== x?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||q.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(q){var f,e=this[0];return q===x?c(e)?e["inner"+b]:d(e)?e.documentElement["scroll"+b]:(f=this.offset())&&f[a]:this.each(function(b){e=h(this);e.css(a,n(this,q,b,e[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,E=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 g=h.contains(q.documentElement,f);e.forEach(function(a){if(E)a=a.cloneNode(!0);else if(!f)return h(a).remove();f.insertBefore(a,b);g&&y(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=s;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||A,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 k=e.context;e.error.call(k, d,c,a);f&&f.rejectWith(k,[d,c,a]);b(e,k,"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 m(){}function l(a){a&&(a=a.split(";",2)[0]);return a&&(a==B?"html":a==D?"json":r.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 p(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),k=a.isPlainObject(c);a.each(c,function(c,u){f=a.type(u);e&&(c=d?e:e+"["+(k||"object"==f||"array"==f?c:"")+"]");!e&&g?b.add(u.name,u.value):"array"==f||!d&&"object"==f?w(b,u,d,c):b.add(c,u)})}var n=0,A=window.document,s,y,x=/)<[^<]*)*<\/script>/gi, r=/^(?:text|application)\/javascript/i,h=/^(?:text|application)\/xml/i,D="application/json",B="text/html",u=/^\s*$/;a.active=0;a.ajaxJSONP=function(b,c){if(!("type"in b))return a.ajax(b);var g=b.jsonpCallback,k=(a.isFunction(g)?g():g)||"jsonp"+ ++n,u=A.createElement("script"),h=window[k],v,l=function(b){a(u).triggerHandler("error",b||"abort")},m={abort:l},p;c&&c.promise(m);a(u).on("load error",function(d,g){clearTimeout(p);a(u).off().remove();"error"==d.type||!v?f(null,g||"error",m,b,c):e(v[0],m, b,c);window[k]=h;v&&a.isFunction(h)&&h(v[0]);h=v=void 0});if(!1===d(m,b))return l("abort"),m;window[k]=function(){v=arguments};u.src=b.url.replace(/\?(.+)=\?/,"?$1="+k);A.head.appendChild(u);0n.status||304==n.status||0==n.status&&"file:"==x){v=v||l(g.mimeType||n.getResponseHeader("content-type"));b=n.responseText;try{"script"==v?(0,eval)(b):"xml"==v?b=n.responseXML:"json"==v&& (b=u.test(b)?null:a.parseJSON(b))}catch(d){c=d}c?f(c,"parsererror",n,g,h):e(b,n,g,h)}else f(n.statusText||null,n.status?"error":"abort",n,g,h)}};if(!1===d(n,g))return n.abort(),f(null,"abort",n,g,h),n;if(g.xhrFields)for(y in g.xhrFields)n[y]=g.xhrFields[y];n.open(g.type,g.url,"async"in g?g.async:!0,g.username,g.password);for(y in w)A.apply(n,w[y]);0").html(b.replace(x,"")).find(f):b);k&&k.apply(e,arguments)};a.ajax(b);return this};var v=encodeURIComponent; a.param=function(a,b){var c=[];c.add=function(a,b){this.push(v(a)+"="+v(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,m,l=[],k=!b.once&&[],z=function(a){c=b.memory&&a;d=!0;m=f||0;f=0;g=l.length;for(e=!0;l&&m=d&&setTimeout(function(){E.each(function(){F.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,g){return c(g,function(c,f,m){try{var s;!c&&f?c="*":l.test(c)&&(s=a(b).addClass(k),c="."+k+" "+c);var y=e(b,c)}catch(x){throw console.error("error performing selector: %o", g),x;}finally{s&&s.removeClass(k)}return!f?y:d.uniq(a.map(y,function(a,b){return f.call(a,b,y,m)}))})};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);m&&clearTimeout(m);l&&clearTimeout(l);k&&clearTimeout(k);g=m=l=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,m,l,k,z;a(document).ready(function(){var p,w,n=0,A=0,s,y;"MSGesture"in window&&(z=new MSGesture,z.target=document.body);a(document).bind("MSGestureEnd", function(a){if(a=1a.velocityX?"Left":1a.velocityY?"Up":null)f.el.trigger("swipe"),f.el.trigger("swipe"+a)}).on("touchstart MSPointerDown pointerdown",function(c){if(!(y=e(c,"down"))||d(c))s=y?c:c.touches[0],c.touches&&(1===c.touches.length&&f.x2)&&(f.x2=void 0,f.y2=void 0),p=Date.now(),w=p-(f.last||p),f.el=a("tagName"in s.target?s.target:s.target.parentNode),g&&clearTimeout(g),f.x1=s.pageX,f.y1=s.pageY,0=w&&(f.isDoubleTap=!0),f.last=p,k=setTimeout(b, 750),z&&y&&z.addPointer(c.pointerId)}).on("touchmove MSPointerMove pointermove",function(a){if(!(y=e(a,"move"))||d(a))s=y?a:a.touches[0],k&&clearTimeout(k),k=null,f.x2=s.pageX,f.y2=s.pageY,n+=Math.abs(f.x1-f.x2),A+=Math.abs(f.y1-f.y2)}).on("touchend MSPointerUp pointerup",function(b){if(!(y=e(b,"up"))||d(b))k&&clearTimeout(k),k=null,f.x2&&30=Math.abs(f.y1-f.y2)? 0n&&30>A?m=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={}),n=A=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 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(){$(".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")});$(".checks").each(function(a){$("[type=checkbox]",this)});$('[data-fn="back"]').on("click",function(){window.history.back()});Public.setHis()},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){var c=Public.popHtml(a,{cancel:"\u53d6\u6d88",sure:"\u786e\u5b9a"});$(".public_btns a",c).on("click",function(){var a= $(this).attr("data-val");c.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;ePublic.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){console.log("public");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:[],callback:null,init:function(){if(CheckStaion.runing)return!1;CheckStaion.runing=!0;CheckStaion.formatStation();CheckStaion.setHtml();CheckStaion.bindEvent()},formatStation:function(){CheckStaion.names=WIN.station_names.substr(1);CheckStaion.stationList=CheckStaion.names.split("@");for(var a="",b=[],c=0;c\u70ed\u95e8
    ',c=0,d=CheckStaion.hotList.length;c'+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.searchKey($.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");CheckStaion.callback&&CheckStaion.callback(c, d);$("#station_suggest ul").html("");$("#station_suggest").hide();$("#station_search").val("")})},showSuggest:function(a){if(!a||0==a.length)$("#station_suggest ul").html(""),$("#station_suggest").hide();else{for(var b="",c=0,d=a.length;c'+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"));Login.recode();$("#randcodeimg").click(function(a){Login.recode();return!1});$("#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\uff0c\u6b63\u5728\u8fdb\u5165\u8ba2\u7968\u9875\u9762\uff0c\u8bf7\u7a0d\u7b49 \u2764");setTimeout(function(){location.href="query.html"},1E3)}))}},recode:function(){$("#randcodeimg").attr("src",$("#randcodeimg").attr("data-loading"));$("#randcode").html("").focus();cn12306.loadRandCode("sjrand",function(a){$("#randcodeimg").attr("src",a)})},getRandCode:function(){cn12306.checkRandCode("sjrand",Login.formData.randcode,function(a){"Y"!== a.data?(Login.recode(),Public.toast("\u9a8c\u8bc1\u7801\u4e0d\u6b63\u786e\uff01")):Login.submitLogin(a)},function(a,b){Login.recode();Public.toast("\u6821\u9a8c\u9a8c\u8bc1\u7801\u5931\u8d25")},"login/init")},formData:null,submitLogin:function(){cn12306.ajax({url:"login/loginAysnSuggest",data:{"loginUserDTO.user_name":Login.formData.username,"userDTO.password":Login.formData.password,randCode:Login.formData.randcode},refer:"login/init",success:function(a){a&&a.data&&"Y"===a.data.loginCheck?Login.userPostLogin(): (a=(a.messages||["\u672a\u77e5\u9519\u8bef"]).join(";"),Login.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+"]"),1Query.checkNum&& Query.checkLogin()})},hasLogin:function(){$("#login").attr("href","javascript:;").attr("data-fn","loginout").html("\u9000\u51fa");$("body").removeClass("nologin");$("#menu_btn .icon_user").addClass("icon_user2");$("#login_tip").hide()},noLogin:function(){$("#login").attr("href","/12306/login.html").attr("data-fn","login").html("\u767b\u5f55");$("body").addClass("nologin");$("#menu_btn .icon_user").removeClass("icon_user2");$("#login_tip").show()},stationInt:function(){$("#startStation").on("click", function(){CheckStaion.callback=Query.startCallback;CheckStaion.cancelCallback=Query.cancelCallback;CheckStaion.show();$("#wrap").hide()});$("#endStation").on("click",function(){CheckStaion.callback=Query.endCallback;CheckStaion.cancelCallback=Query.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")})},startCallback:function(a,b){$("#startStation").html(a);$("#startStationName").val(a);$("#startStationCode").val(b);CheckStaion.hide();$("#wrap").show()},endCallback:function(a,b){$("#endStation").html(a);$("#endStationName").val(a);$("#endStationCode").val(b);CheckStaion.hide();$("#wrap").show()}, cancelCallback:function(){$("#wrap").show()}};var RunQuery={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;RunQuery.getQueryData();if(!RunQuery.curData)return window.location.href="query.html",!1;$("#filter_ok").on("click",function(){Public.hideInnerPage("filter");$("#query_form [name=filters]").val($("#filter_form").serialize());RunQuery.hisUpdata()});$("#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.checkLogin();RunQuery.setFilter();$("#filter_btn").on("click",function(){Public.showInnerPage("filter")});$("#filter_cancel").on("click",function(){Public.hideInnerPage()});RunQuery.queryTicket()},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));Public.calendar.setCurDate(a)},isLogin:!1,checkNum:0,checkLogin:function(){RunQuery.checkNum++;cn12306.isUserLogined(RunQuery.hasLogin,RunQuery.noLogin,function(){RunQuery.noLogin();2>RunQuery.checkNum&&RunQuery.checkLogin()})},hasLogin:function(){RunQuery.isLogin=!0;$("body").removeClass("nologin");$("#login_tip").hide()},noLogin:function(){RunQuery.isLogin=!1;$("body").addClass("nologin"); $("#login_tip").show()},queryTicket:function(){var a=Public.showLoading("\u6b63\u5728\u67e5\u7968");cn12306.ajax({type:"GET",url:"leftTicket/query",data:{"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"},refer:"leftTicket/init",success:function(b){!0==b.status&&200==b.httpstatus&&0";b+='
    ';b+=''+c.code+"";b+=''+c.from.time+"";b+='';c.from.code==c.start.code&&(b+='\u59cb'); b+=c.from.name+"";b+="
    ";b+='
    ';ls=c.elapsedTime.total.split(":");b+=''+(ls[0]?ls[0]+"\u5c0f\u65f6":"")+(ls[1]?ls[1]+"\u5206":"0\u5206")+"";b+='';b+=c.to.time+"";b+='';c.to.code==c.end.code&&(b+='\u7ec8');for(var b=b+(c.to.name+""),b=b+"
    ",e=0;e', "\u6709"==c.ticketMapSort[e].count?b+='\u6709':(b+=''+c.ticketMapSort[e].count+"",b+='\u5f20'),b+='\u62a2\u7968',b+="",b+=''+c.ticketMapSort[e].name+"",b+=''+c.ticketMapSort[e].price/10+"\u5143",b+="");b+= ""}$("#train_list").html(b);$(".station_title span").html("\u5171 "+$("#train_list li").length+" \u8d9f\u5217\u8f66")},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:{},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);console.log(a.ticketMapSort);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.trainMap[a.id]=a}RunQuery.trainData=d},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")),RunQuery.hisUpdata(),console.log(a)):(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()}};$().ready(function(){Public.init();Login.init();Query.init();RunQuery.init();Perfect.init()});