user-release-of-goods.js 111 KB
/*! dili 2016-01-06 */
function isIdCardNo(num){num=num.toUpperCase();var intCheckDigit,factorArr=new Array(7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1),parityBit=new Array("1","0","X","9","8","7","6","5","4","3","2"),varArray=new Array,lngProduct=0,intStrLen=num.length,idNumber=num;if(15!=intStrLen&&18!=intStrLen)return!1;for(i=0;i<intStrLen;i++){if(varArray[i]=idNumber.charAt(i),(varArray[i]<"0"||varArray[i]>"9")&&17!=i)return!1;i<17&&(varArray[i]=varArray[i]*factorArr[i])}if(18==intStrLen){var date8=idNumber.substring(6,14);if(0==isDate8(date8))return!1;for(i=0;i<17;i++)lngProduct+=varArray[i];if(intCheckDigit=parityBit[lngProduct%11],varArray[17]!=intCheckDigit)return!1}else{var date6=idNumber.substring(6,12);if(0==isDate6(date6))return!1}return!0}function isDate6(sDate){if(!/^[0-9]{6}$/.test(sDate))return!1;var year,month,myDate=new Date,nowyear=myDate.getFullYear();return year=sDate.substring(0,4),month=sDate.substring(4,6),year>nowyear?!1:1700>year||year>2500?!1:1>month||month>12?!1:!0}function isDate8(sDate){if(!/^[0-9]{8}$/.test(sDate))return!1;var year,month,day,myDate=new Date,nowyear=myDate.getFullYear();year=sDate.substring(0,4),month=sDate.substring(4,6),day=sDate.substring(6,8);var iaMonthDays=[31,28,31,30,31,30,31,31,30,31,30,31];return year>nowyear?!1:1700>year||year>2500?!1:((year%4==0&&year%100!=0||year%400==0)&&(iaMonthDays[1]=29),1>month||month>12?!1:1>day||day>iaMonthDays[month-1]?!1:!0)}function reg(value){var len=value.length;switch(len){case 13:return/[0-9a-zA-Z]{13}/.test(value);case 15:return/[0-9a-zA-Z]{15}/.test(value);case 18:return/[0-9a-zA-Z]{18}/.test(value);default:return!1}}!function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0<a.indexOf("%")},l=function(a,d){var e=parseInt(a,10)||0;return d&&E(a)&&(e*=b.getViewport()[d]/100),Math.ceil(e)},w=function(a,b){return l(a,b)+"px"};f.extend(b,{version:"2.1.5",defaults:{padding:15,margin:20,width:800,height:600,minWidth:100,minHeight:100,maxWidth:9999,maxHeight:9999,pixelRatio:1,autoSize:!0,autoHeight:!1,autoWidth:!1,autoResize:!0,autoCenter:!s,fitToView:!0,aspectRatio:!1,topRatio:.5,leftRatio:.5,scrolling:"auto",wrapCSS:"",arrows:!0,closeBtn:!0,closeClick:!1,nextClick:!1,mouseWheel:!0,autoPlay:!1,playSpeed:3e3,preload:3,modal:!1,loop:!0,ajax:{dataType:"html",headers:{"X-fancyBox":!0}},iframe:{scrolling:"auto",preload:!0},swf:{wmode:"transparent",allowfullscreen:"true",allowscriptaccess:"always"},keys:{next:{13:"left",34:"up",39:"left",40:"up"},prev:{8:"right",33:"down",37:"right",38:"down"},close:[27],play:[32],toggle:[70]},direction:{next:"left",prev:"right"},scrollOutside:!0,index:0,type:null,href:null,content:null,title:null,tpl:{wrap:'<div class="fancybox-wrap" tabIndex="-1"><div class="fancybox-skin"><div class="fancybox-outer"><div class="fancybox-inner"></div></div></div></div>',image:'<img class="fancybox-image" src="{href}" alt="" />',iframe:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" frameborder="0" vspace="0" hspace="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen'+(I?' allowtransparency="true"':"")+"></iframe>",error:'<p class="fancybox-error">The requested content cannot be loaded.<br/>Please try again later.</p>',closeBtn:'<a title="关闭" class="fancybox-item fancybox-close" href="javascript:;"></a>',next:'<a title="Next" class="fancybox-nav fancybox-next" href="javascript:;"><span></span></a>',prev:'<a title="Previous" class="fancybox-nav fancybox-prev" href="javascript:;"><span></span></a>'},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){return a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0))?(f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var g,h,j,m,l,k={};"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,c.metadata())):k=c),g=d.href||k.href||(q(c)?c:null),h=d.title!==v?d.title:k.title||"",m=(j=d.content||k.content)?"html":d.type||k.type,!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox\.(\w+)/))?m[1]:null)),q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift())),j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&!g&&k.isDom&&(m="inline",j=c)),f.extend(k,{href:g,type:m,content:j,title:h,selector:l}),a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)):void 0},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||b._afterZoomOut(a))},close:function(a){b.cancel(),!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(b.isOpen&&!0!==a?(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitions[b.current.closeMethod]()):(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut())))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d(),b.current&&b.player.isActive&&(b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d(),p.unbind(".player"),b.player.isActive=!1,b.trigger("onPlayEnd")};!0===a||!b.player.isActive&&!1!==a?b.current&&(b.current.loop||b.current.index<b.group.length-1)&&(b.player.isActive=!0,p.bind({"onCancel.player beforeClose.player":c,"onUpdate.player":e,"beforeLoad.player":d}),e(),b.trigger("onPlayStart")):c()},next:function(a){var d=b.current;d&&(q(a)||(a=d.direction.next),b.jumpto(d.index+1,a,"next"))},prev:function(a){var d=b.current;d&&(q(a)||(a=d.direction.prev),b.jumpto(d.index-1,a,"prev"))},jumpto:function(a,d,e){var c=b.current;c&&(a=l(a),b.direction=d||c.direction[a>=c.index?"next":"prev"],b.router=e||"jumpto",c.loop&&(0>a&&(a=c.group.length+a%c.group.length),a%=c.group.length),c.group[a]!==v&&(b.cancel(),b._start(a)))},reposition:function(a,d){var k,e=b.current,c=e?e.wrap:null;c&&(k=b._getPosition(d),a&&"scroll"===a.type?(delete k.position,c.stop(!0,!0).animate(k,200)):(c.css(k),e.pos=f.extend({},e.dim,k)))},update:function(a){var d=a&&a.type,e=!d||"orientationchange"===d;e&&(clearTimeout(B),B=null),b.isOpen&&!B&&(B=setTimeout(function(){var c=b.current;c&&!b.isClosing&&(b.wrap.removeClass("fancybox-tmp"),(e||"load"===d||"resize"===d&&c.autoResize)&&b._setDimension(),"scroll"===d&&c.canShrink||b.reposition(a),b.trigger("onUpdate"),B=null)},e&&!s?0:300))},toggle:function(a){b.isOpen&&(b.current.fitToView="boolean"===f.type(a)?a:!b.current.fitToView,s&&(b.wrap.removeAttr("style").addClass("fancybox-tmp"),b.trigger("onUpdate")),b.update())},hideLoading:function(){p.unbind(".loading"),f("#fancybox-loading").remove()},showLoading:function(){var a,d;b.hideLoading(),a=f('<div id="fancybox-loading"><div></div></div>').click(b.cancel).appendTo("body"),p.bind("keydown.loading",function(a){27===(a.which||a.keyCode)&&(a.preventDefault(),b.cancel())}),b.defaults.fixed||(d=b.getViewport(),a.css({position:"absolute",top:.5*d.h+d.y,left:.5*d.w+d.x}))},getViewport:function(){var a=b.current&&b.current.locked||!1,d={x:n.scrollLeft(),y:n.scrollTop()};return a?(d.w=a[0].clientWidth,d.h=a[0].clientHeight):(d.w=s&&r.innerWidth?r.innerWidth:n.width(),d.h=s&&r.innerHeight?r.innerHeight:n.height()),d},unbindEvents:function(){b.wrap&&t(b.wrap)&&b.wrap.unbind(".fb"),p.unbind(".fb"),n.unbind(".fb")},bindEvents:function(){var d,a=b.current;a&&(n.bind("orientationchange.fb"+(s?"":" resize.fb")+(a.autoCenter&&!a.locked?" scroll.fb":""),b.update),(d=a.keys)&&p.bind("keydown.fb",function(e){var c=e.which||e.keyCode,k=e.target||e.srcElement;return 27===c&&b.coming?!1:void(!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.metaKey&&(!k||!k.type&&!f(k).is("[contenteditable]"))&&f.each(d,function(d,k){return 1<a.group.length&&k[c]!==v?(b[d](k[c]),e.preventDefault(),!1):-1<f.inArray(c,k)?(b[d](),e.preventDefault(),!1):void 0}))}),f.fn.mousewheel&&a.mouseWheel&&b.wrap.bind("mousewheel.fb",function(d,c,k,g){for(var h=f(d.target||null),j=!1;h.length&&!j&&!h.is(".fancybox-skin")&&!h.is(".fancybox-wrap");)j=h[0]&&!(h[0].style.overflow&&"hidden"===h[0].style.overflow)&&(h[0].clientWidth&&h[0].scrollWidth>h[0].clientWidth||h[0].clientHeight&&h[0].scrollHeight>h[0].clientHeight),h=f(h).parent();0!==c&&!j&&1<b.group.length&&!a.canShrink&&(g>0||k>0?b.prev(g>0?"down":"left"):(0>g||0>k)&&b.next(0>g?"up":"right"),d.preventDefault())}))},trigger:function(a,d){var e,c=d||b.coming||b.current;if(c){if(f.isFunction(c[a])&&(e=c[a].apply(c,Array.prototype.slice.call(arguments,1))),!1===e)return!1;c.helpers&&f.each(c.helpers,function(d,e){e&&b.helpers[d]&&f.isFunction(b.helpers[d][a])&&b.helpers[d][a](f.extend(!0,{},b.helpers[d].defaults,e),c)}),p.trigger(a)}},isImage:function(a){return q(a)&&a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)},isSWF:function(a){return q(a)&&a.match(/\.(swf)((\?|#).*)?$/i)},_start:function(a){var e,c,d={};if(a=l(a),e=b.group[a]||null,!e)return!1;if(d=f.extend(!0,{},b.opts,e),e=d.margin,c=d.padding,"number"===f.type(e)&&(d.margin=[e,e,e,e]),"number"===f.type(c)&&(d.padding=[c,c,c,c]),d.modal&&f.extend(!0,d,{closeBtn:!1,closeClick:!1,nextClick:!1,arrows:!1,mouseWheel:!1,keys:null,helpers:{overlay:{closeClick:!1}}}),d.autoSize&&(d.autoWidth=d.autoHeight=!0),"auto"===d.width&&(d.autoWidth=!0),"auto"===d.height&&(d.autoHeight=!0),d.group=b.group,d.index=a,b.coming=d,!1===b.trigger("beforeLoad"))b.coming=null;else{if(c=d.type,e=d.href,!c)return b.coming=null,b.current&&b.router&&"jumpto"!==b.router?(b.current.index=a,b[b.router](b.direction)):!1;if(b.isActive=!0,("image"===c||"swf"===c)&&(d.autoHeight=d.autoWidth=!1,d.scrolling="visible"),"image"===c&&(d.aspectRatio=!0),"iframe"===c&&s&&(d.scrolling="scroll"),d.wrap=f(d.tpl.wrap).addClass("fancybox-"+(s?"mobile":"desktop")+" fancybox-type-"+c+" fancybox-tmp "+d.wrapCSS).appendTo(d.parent||"body"),f.extend(d,{skin:f(".fancybox-skin",d.wrap),outer:f(".fancybox-outer",d.wrap),inner:f(".fancybox-inner",d.wrap)}),f.each(["Top","Right","Bottom","Left"],function(a,b){d.skin.css("padding"+b,w(d.padding[a]))}),b.trigger("onReady"),"inline"===c||"html"===c){if(!d.content||!d.content.length)return b._error("content")}else if(!e)return b._error("href");"image"===c?b._loadImage():"ajax"===c?b._loadAjax():"iframe"===c?b._loadIframe():b._afterLoad()}},_error:function(a){f.extend(b.coming,{type:"html",autoWidth:!0,autoHeight:!0,minWidth:0,minHeight:0,scrolling:"no",hasError:a,content:b.coming.tpl.error}),b._afterLoad()},_loadImage:function(){var a=b.imgPreload=new Image;a.onload=function(){this.onload=this.onerror=null,b.coming.width=this.width/b.opts.pixelRatio,b.coming.height=this.height/b.opts.pixelRatio,b._afterLoad()},a.onerror=function(){this.onload=this.onerror=null,b._error("image")},a.src=b.coming.href,!0!==a.complete&&b.showLoading()},_loadAjax:function(){var a=b.coming;b.showLoading(),b.ajaxLoad=f.ajax(f.extend({},a.ajax,{url:a.href,error:function(a,e){b.coming&&"abort"!==e?b._error("ajax",a):b.hideLoading()},success:function(d,e){"success"===e&&(a.content=d,b._afterLoad())}}))},_loadIframe:function(){var a=b.coming,d=f(a.tpl.iframe.replace(/\{rnd\}/g,(new Date).getTime())).attr("scrolling",s?"auto":a.iframe.scrolling).attr("src",a.href);f(a.wrap).bind("onReset",function(){try{f(this).find("iframe").hide().attr("src","//about:blank").end().empty()}catch(a){}}),a.iframe.preload&&(b.showLoading(),d.one("load",function(){f(this).data("ready",1),s||f(this).bind("load.fb",b.update),f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show(),b._afterLoad()})),a.content=d.appendTo(a.inner),a.iframe.preload||b._afterLoad()},_preloadImages:function(){var f,g,a=b.group,d=b.current,e=a.length,c=d.preload?Math.min(d.preload,e-1):0;for(g=1;c>=g;g+=1)f=a[(d.index+g)%e],"image"===f.type&&f.href&&((new Image).src=f.href)},_afterLoad:function(){var e,c,k,g,h,a=b.coming,d=b.current;if(b.hideLoading(),a&&!1!==b.isActive)if(!1===b.trigger("afterLoad",a,d))a.wrap.stop(!0).trigger("onReset").remove(),b.coming=null;else{switch(d&&(b.trigger("beforeChange",d),d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove()),b.unbindEvents(),e=a.content,c=a.type,k=a.scrolling,f.extend(b,{wrap:a.wrap,skin:a.skin,outer:a.outer,inner:a.inner,current:a,previous:d}),g=a.href,c){case"inline":case"ajax":case"html":a.selector?e=f("<div>").html(e).find(a.selector):t(e)&&(e.data("fancybox-placeholder")||e.data("fancybox-placeholder",f('<div class="fancybox-placeholder"></div>').insertAfter(e).hide()),e=e.show().detach(),a.wrap.bind("onReset",function(){f(this).find(e).length&&e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder",!1)}));break;case"image":e=a.tpl.image.replace("{href}",g);break;case"swf":e='<object id="fancybox-swf" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%"><param name="movie" value="'+g+'"></param>',h="",f.each(a.swf,function(a,b){e+='<param name="'+a+'" value="'+b+'"></param>',h+=" "+a+'="'+b+'"'}),e+='<embed src="'+g+'" type="application/x-shockwave-flash" width="100%" height="100%"'+h+"></embed></object>"}(!t(e)||!e.parent().is(a.inner))&&a.inner.append(e),b.trigger("beforeShow"),a.inner.css("overflow","yes"===k?"scroll":"no"===k?"hidden":k),b._setDimension(),b.reposition(),b.isOpen=!1,b.coming=null,b.bindEvents(),b.isOpened?d.prevMethod&&b.transitions[d.prevMethod]():f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove(),b.transitions[b.isOpened?a.nextMethod:a.openMethod](),b._preloadImages()}},_setDimension:function(){var v,z,t,C,A,F,B,D,H,a=b.getViewport(),d=0,e=!1,c=!1,e=b.wrap,k=b.skin,g=b.inner,h=b.current,c=h.width,j=h.height,m=h.minWidth,u=h.minHeight,n=h.maxWidth,p=h.maxHeight,s=h.scrolling,q=h.scrollOutside?h.scrollbarWidth:0,x=h.margin,y=l(x[1]+x[3]),r=l(x[0]+x[2]);if(e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp"),x=l(k.outerWidth(!0)-k.width()),v=l(k.outerHeight(!0)-k.height()),z=y+x,t=r+v,C=E(c)?(a.w-z)*l(c)/100:c,A=E(j)?(a.h-t)*l(j)/100:j,"iframe"===h.type){if(H=h.content,h.autoHeight&&1===H.data("ready"))try{H[0].contentWindow.document.location&&(g.width(C).height(9999),F=H.contents().find("body"),q&&F.css("overflow-x","hidden"),A=F.outerHeight(!0))}catch(G){}}else(h.autoWidth||h.autoHeight)&&(g.addClass("fancybox-tmp"),h.autoWidth||g.width(C),h.autoHeight||g.height(A),h.autoWidth&&(C=g.width()),h.autoHeight&&(A=g.height()),g.removeClass("fancybox-tmp"));if(c=l(C),j=l(A),D=C/A,m=l(E(m)?l(m,"w")-z:m),n=l(E(n)?l(n,"w")-z:n),u=l(E(u)?l(u,"h")-t:u),p=l(E(p)?l(p,"h")-t:p),F=n,B=p,h.fitToView&&(n=Math.min(a.w-z,n),p=Math.min(a.h-t,p)),z=a.w-y,r=a.h-r,h.aspectRatio?(c>n&&(c=n,j=l(c/D)),j>p&&(j=p,c=l(j*D)),m>c&&(c=m,j=l(c/D)),u>j&&(j=u,c=l(j*D))):(c=Math.max(m,Math.min(c,n)),h.autoHeight&&"iframe"!==h.type&&(g.width(c),j=g.height()),j=Math.max(u,Math.min(j,p))),h.fitToView)if(g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),h.aspectRatio)for(;(a>z||y>r)&&c>m&&j>u&&!(19<d++);)j=Math.max(u,Math.min(p,j-10)),c=l(j*D),m>c&&(c=m,j=l(c/D)),c>n&&(c=n,j=l(c/D)),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height();else c=Math.max(m,Math.min(c,c-(a-z))),j=Math.max(u,Math.min(j,j-(y-r)));q&&"auto"===s&&A>j&&z>c+x+q&&(c+=q),g.width(c).height(j),e.width(c+x),a=e.width(),y=e.height(),e=(a>z||y>r)&&c>m&&j>u,c=h.aspectRatio?F>c&&B>j&&C>c&&A>j:(F>c||B>j)&&(C>c||A>j),f.extend(h,{dim:{width:w(a),height:w(y)},origWidth:C,origHeight:A,canShrink:e,canExpand:c,wPadding:x,hPadding:v,wrapSpace:y-k.outerHeight(!0),skinSpace:k.height()-j}),!H&&h.autoHeight&&j>u&&p>j&&!c&&g.height("auto")},_getPosition:function(a){var d=b.current,e=b.getViewport(),c=d.margin,f=b.wrap.width()+c[1]+c[3],g=b.wrap.height()+c[0]+c[2],c={position:"absolute",top:c[0],left:c[3]};return d.autoCenter&&d.fixed&&!a&&g<=e.h&&f<=e.w?c.position="fixed":d.locked||(c.top+=e.y,c.left+=e.x),c.top=w(Math.max(c.top,c.top+(e.h-g)*d.topRatio)),c.left=w(Math.max(c.left,c.left+(e.w-f)*d.leftRatio)),c},_afterZoomIn:function(){var a=b.current;a&&(b.isOpen=b.isOpened=!0,b.wrap.css("overflow","visible").addClass("fancybox-opened"),b.update(),(a.closeClick||a.nextClick&&1<b.group.length)&&b.inner.css("cursor","pointer").bind("click.fb",function(d){!f(d.target).is("a")&&!f(d.target).parent().is("a")&&(d.preventDefault(),b[a.closeClick?"close":"next"]())}),a.closeBtn&&f(a.tpl.closeBtn).appendTo(b.skin).bind("click.fb",function(a){a.preventDefault(),b.close()}),a.arrows&&1<b.group.length&&((a.loop||0<a.index)&&f(a.tpl.prev).appendTo(b.outer).bind("click.fb",b.prev),(a.loop||a.index<b.group.length-1)&&f(a.tpl.next).appendTo(b.outer).bind("click.fb",b.next)),b.trigger("afterShow"),a.loop||a.index!==a.group.length-1?b.opts.autoPlay&&!b.player.isActive&&(b.opts.autoPlay=!1,b.play()):b.play(!1))},_afterZoomOut:function(a){a=a||b.current,f(".fancybox-wrap").trigger("onReset").remove(),f.extend(b,{group:{},opts:{},router:!1,current:null,isActive:!1,isOpened:!1,isOpen:!1,isClosing:!1,wrap:null,skin:null,outer:null,inner:null}),b.trigger("afterClose",a)}}),b.transitions={getOrigPosition:function(){var a=b.current,d=a.element,e=a.orig,c={},f=50,g=50,h=a.hPadding,j=a.wPadding,m=b.getViewport();return!e&&a.isDom&&d.is(":visible")&&(e=d.find("img:first"),e.length||(e=d)),t(e)?(c=e.offset(),e.is("img")&&(f=e.outerWidth(),g=e.outerHeight())):(c.top=m.y+(m.h-g)*a.topRatio,c.left=m.x+(m.w-f)*a.leftRatio),("fixed"===b.wrap.css("position")||a.locked)&&(c.top-=m.y,c.left-=m.x),c={top:w(c.top-h*a.topRatio),left:w(c.left-j*a.leftRatio),width:w(f+j),height:w(g+h)}},step:function(a,d){var e,c,f=d.prop;c=b.current;var g=c.wrapSpace,h=c.skinSpace;("width"===f||"height"===f)&&(e=d.end===d.start?1:(a-d.start)/(d.end-d.start),b.isClosing&&(e=1-e),c="width"===f?c.wPadding:c.hPadding,c=a-c,b.skin[f](l("width"===f?c:c-g*e)),b.inner[f](l("width"===f?c:c-g*e-h*e)))},zoomIn:function(){var a=b.current,d=a.pos,e=a.openEffect,c="elastic"===e,k=f.extend({opacity:1},d);delete k.position,c?(d=this.getOrigPosition(),a.openOpacity&&(d.opacity=.1)):"fade"===e&&(d.opacity=.1),b.wrap.css(d).animate(k,{duration:"none"===e?0:a.openSpeed,easing:a.openEasing,step:c?this.step:null,complete:b._afterZoomIn})},zoomOut:function(){var a=b.current,d=a.closeEffect,e="elastic"===d,c={opacity:.1};e&&(c=this.getOrigPosition(),a.closeOpacity&&(c.opacity=.1)),b.wrap.animate(c,{duration:"none"===d?0:a.closeSpeed,easing:a.closeEasing,step:e?this.step:null,complete:b._afterZoomOut})},changeIn:function(){var g,a=b.current,d=a.nextEffect,e=a.pos,c={opacity:1},f=b.direction;e.opacity=.1,"elastic"===d&&(g="down"===f||"up"===f?"top":"left","down"===f||"right"===f?(e[g]=w(l(e[g])-200),c[g]="+=200px"):(e[g]=w(l(e[g])+200),c[g]="-=200px")),"none"===d?b._afterZoomIn():b.wrap.css(e).animate(c,{duration:a.nextSpeed,easing:a.nextEasing,complete:b._afterZoomIn})},changeOut:function(){var a=b.previous,d=a.prevEffect,e={opacity:.1},c=b.direction;"elastic"===d&&(e["down"===c||"up"===c?"top":"left"]=("up"===c||"left"===c?"-":"+")+"=200px"),a.wrap.animate(e,{duration:"none"===d?0:a.prevSpeed,easing:a.prevEasing,complete:function(){f(this).trigger("onReset").remove()}})}},b.helpers.overlay={defaults:{closeClick:!0,speedOut:200,showEarly:!0,css:{},locked:!s,fixed:!0},overlay:null,fixed:!1,el:f("html"),create:function(a){a=f.extend({},this.defaults,a),this.overlay&&this.close(),this.overlay=f('<div class="fancybox-overlay"></div>').appendTo(b.coming?b.coming.parent:a.parent),this.fixed=!1,a.fixed&&b.defaults.fixed&&(this.overlay.addClass("fancybox-overlay-fixed"),this.fixed=!0)},open:function(a){var d=this;a=f.extend({},this.defaults,a),this.overlay?this.overlay.unbind(".overlay").width("auto").height("auto"):this.create(a),this.fixed||(n.bind("resize.overlay",f.proxy(this.update,this)),this.update()),a.closeClick&&this.overlay.bind("click.overlay",function(a){return f(a.target).hasClass("fancybox-overlay")?(b.isActive?b.close():d.close(),!1):void 0}),this.overlay.css(a.css).show()},close:function(){var a,b;n.unbind("resize.overlay"),this.el.hasClass("fancybox-lock")&&(f(".fancybox-margin").removeClass("fancybox-margin"),a=n.scrollTop(),b=n.scrollLeft(),this.el.removeClass("fancybox-lock"),n.scrollTop(a).scrollLeft(b)),f(".fancybox-overlay").remove().hide(),f.extend(this,{overlay:null,fixed:!1})},update:function(){var b,a="100%";this.overlay.width(a).height("100%"),I?(b=Math.max(G.documentElement.offsetWidth,G.body.offsetWidth),p.width()>b&&(a=p.width())):p.width()>n.width()&&(a=p.width()),this.overlay.width(a).height(p.height())},onReady:function(a,b){var e=this.overlay;f(".fancybox-overlay").stop(!0,!0),e||this.create(a),a.locked&&this.fixed&&b.fixed&&(e||(this.margin=p.height()>n.height()?f("html").css("margin-right").replace("px",""):!1),b.locked=this.overlay.append(b.wrap),b.fixed=!1),!0===a.showEarly&&this.beforeShow.apply(this,arguments)},beforeShow:function(a,b){var e,c;b.locked&&(!1!==this.margin&&(f("*").filter(function(){return"fixed"===f(this).css("position")&&!f(this).hasClass("fancybox-overlay")&&!f(this).hasClass("fancybox-wrap")}).addClass("fancybox-margin"),this.el.addClass("fancybox-margin")),e=n.scrollTop(),c=n.scrollLeft(),this.el.addClass("fancybox-lock"),n.scrollTop(e).scrollLeft(c)),this.open(a)},onUpdate:function(){this.fixed||this.update()},afterClose:function(a){this.overlay&&!b.coming&&this.overlay.fadeOut(a.speedOut,f.proxy(this.close,this))}},b.helpers.title={defaults:{type:"float",position:"bottom"},beforeShow:function(a){var d=b.current,e=d.title,c=a.type;if(f.isFunction(e)&&(e=e.call(d.element,d)),q(e)&&""!==f.trim(e)){switch(d=f('<div class="fancybox-title fancybox-title-'+c+'-wrap">'+e+"</div>"),c){case"inside":c=b.skin;break;case"outside":c=b.wrap;break;case"over":c=b.inner;break;default:c=b.skin,d.appendTo("body"),I&&d.width(d.width()),d.wrapInner('<span class="child"></span>'),b.current.margin[2]+=Math.abs(l(d.css("margin-bottom")))}d["top"===a.position?"prependTo":"appendTo"](c)}}},f.fn.fancybox=function(a){var d,e=f(this),c=this.selector||"",k=function(g){var k,l,h=f(this).blur(),j=d;!g.ctrlKey&&!g.altKey&&!g.shiftKey&&!g.metaKey&&!h.is(".fancybox-wrap")&&(k=a.groupAttr||"data-fancybox-group",l=h.attr(k),l||(k="rel",l=h.get(0)[k]),l&&""!==l&&"nofollow"!==l&&(h=c.length?f(c):e,h=h.filter("["+k+'="'+l+'"]'),j=h.index(this)),a.index=j,!1!==b.open(h,a)&&g.preventDefault())};return a=a||{},d=a.index||0,c&&!1!==a.live?p.undelegate(c,"click.fb-start").delegate(c+":not('.fancybox-item, .fancybox-nav')","click.fb-start",k):e.unbind("click.fb-start").bind("click.fb-start",k),this.filter("[data-fancybox-start=1]").trigger("click"),this},p.ready(function(){var a,d;if(f.scrollbarWidth===v&&(f.scrollbarWidth=function(){var a=f('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo("body"),b=a.children(),b=b.innerWidth()-b.height(99).innerWidth();return a.remove(),b}),f.support.fixedPosition===v){a=f.support,d=f('<div style="position:fixed;top:20px;"></div>').appendTo("body");var e=20===d[0].offsetTop||15===d[0].offsetTop;d.remove(),a.fixedPosition=e}f.extend(b.defaults,{scrollbarWidth:f.scrollbarWidth(),fixed:f.support.fixedPosition,parent:f("body")}),a=f(r).width(),J.addClass("fancybox-lock-test"),d=f(r).width(),J.removeClass("fancybox-lock-test"),f("<style type='text/css'>.fancybox-margin{margin-right:"+(d-a)+"px;}</style>").appendTo("head")})}(window,document,jQuery),function(b){b.fn.dragsort=function(k){if("destroy"!=k){var f=b.extend({},b.fn.dragsort.defaults,k),h=[],a=null,l=null;return this.each(function(k,j){b(j).is("table")&&1==b(j).children().size()&&b(j).children().is("tbody")&&(j=b(j).children().get(0));var m={draggedItem:null,placeHolderItem:null,pos:null,offset:null,offsetLimit:null,scroll:null,container:j,init:function(){var a=0==b(this.container).children().size()?"li":b(this.container).children(":first").get(0).tagName.toLowerCase();""==f.itemSelector&&(f.itemSelector=a),""==f.dragSelector&&(f.dragSelector=a),""==f.placeHolderTemplate&&(f.placeHolderTemplate="<"+a+">&nbsp;</"+a+">"),b(this.container).attr("data-listidx",k).mousedown(this.grabItem).bind("dragsort-uninit",this.uninit),this.styleDragHandlers(!0)},uninit:function(){var a=h[b(this).attr("data-listidx")];b(a.container).unbind("mousedown",a.grabItem).unbind("dragsort-uninit"),a.styleDragHandlers(!1)},getItems:function(){return b(this.container).children(f.itemSelector)},styleDragHandlers:function(a){this.getItems().map(function(){return b(this).is(f.dragSelector)?this:b(this).find(f.dragSelector).get()}).css("cursor",a?"pointer":"")},grabItem:function(a){if(!(1!=a.which||b(a.target).is(f.dragSelectorExclude)||0<b(a.target).closest(f.dragSelectorExclude).size()||0==b(a.target).closest(f.itemSelector).size())){a.preventDefault();for(var c=a.target;!b(c).is(f.dragSelector);){if(c==this)return;c=c.parentNode}b(c).attr("data-cursor",b(c).css("cursor")),b(c).css("cursor","move");var e=h[b(this).attr("data-listidx")],g=this,i=function(){e.dragStart.call(g,a),b(e.container).unbind("mousemove",i)};b(e.container).mousemove(i).mouseup(function(){b(e.container).unbind("mousemove",i),b(c).css("cursor",b(c).attr("data-cursor"))})}},dragStart:function(d){null!=a&&null!=a.draggedItem&&a.dropItem(),a=h[b(this).attr("data-listidx")],a.draggedItem=b(d.target).closest(f.itemSelector),a.draggedItem.attr("data-origpos",b(this).attr("data-listidx")+"-"+a.getItems().index(a.draggedItem));var c=parseInt(a.draggedItem.css("marginTop")),e=parseInt(a.draggedItem.css("marginLeft"));if(a.offset=a.draggedItem.offset(),a.offset.top=d.pageY-a.offset.top+(isNaN(c)?0:c)-1,a.offset.left=d.pageX-a.offset.left+(isNaN(e)?0:e)-1,f.dragBetween||(c=0==b(a.container).outerHeight()?Math.max(1,Math.round(.5+a.getItems().size()*a.draggedItem.outerWidth()/b(a.container).outerWidth()))*a.draggedItem.outerHeight():b(a.container).outerHeight(),a.offsetLimit=b(a.container).offset(),a.offsetLimit.right=a.offsetLimit.left+b(a.container).outerWidth()-a.draggedItem.outerWidth(),a.offsetLimit.bottom=a.offsetLimit.top+c-a.draggedItem.outerHeight()),c=a.draggedItem.height(),e=a.draggedItem.width(),"tr"==f.itemSelector?(a.draggedItem.children().each(function(){b(this).width(b(this).width())}),a.placeHolderItem=a.draggedItem.clone().attr("data-placeholder",!0),a.draggedItem.after(a.placeHolderItem),a.placeHolderItem.children().each(function(){b(this).css({borderWidth:0,width:b(this).width()+1,height:b(this).height()+1}).html("&nbsp;")})):(a.draggedItem.after(f.placeHolderTemplate),a.placeHolderItem=a.draggedItem.next().css({height:c,width:e}).attr("data-placeholder",!0)),"td"==f.itemSelector){var g=a.draggedItem.closest("table").get(0);b("<table id='"+g.id+"' style='border-width: 0px;' class='dragSortItem "+g.className+"'><tr></tr></table>").appendTo("body").children().append(a.draggedItem)}g=a.draggedItem.attr("style"),a.draggedItem.attr("data-origstyle",g?g:""),a.draggedItem.css({position:"absolute",opacity:.8,"z-index":999,height:c,width:e}),a.scroll={moveX:0,moveY:0,maxX:b(document).width()-b(window).width(),maxY:b(document).height()-b(window).height()},a.scroll.scrollY=window.setInterval(function(){if(f.scrollContainer!=window)b(f.scrollContainer).scrollTop(b(f.scrollContainer).scrollTop()+a.scroll.moveY);else{var c=b(f.scrollContainer).scrollTop();(0<a.scroll.moveY&&c<a.scroll.maxY||0>a.scroll.moveY&&c>0)&&(b(f.scrollContainer).scrollTop(c+a.scroll.moveY),a.draggedItem.css("top",a.draggedItem.offset().top+a.scroll.moveY+1))}},10),a.scroll.scrollX=window.setInterval(function(){if(f.scrollContainer!=window)b(f.scrollContainer).scrollLeft(b(f.scrollContainer).scrollLeft()+a.scroll.moveX);else{var c=b(f.scrollContainer).scrollLeft();(0<a.scroll.moveX&&c<a.scroll.maxX||0>a.scroll.moveX&&c>0)&&(b(f.scrollContainer).scrollLeft(c+a.scroll.moveX),a.draggedItem.css("left",a.draggedItem.offset().left+a.scroll.moveX+1))}},10),b(h).each(function(a,b){b.createDropTargets(),b.buildPositionTable()}),a.setPos(d.pageX,d.pageY),b(document).bind("mousemove",a.swapItems),b(document).bind("mouseup",a.dropItem),f.scrollContainer!=window&&b(window).bind("DOMMouseScroll mousewheel",a.wheel)},setPos:function(d,c){var e=c-this.offset.top,g=d-this.offset.left;if(f.dragBetween||(e=Math.min(this.offsetLimit.bottom,Math.max(e,this.offsetLimit.top)),g=Math.min(this.offsetLimit.right,Math.max(g,this.offsetLimit.left))),this.draggedItem.parents().each(function(){if("static"!=b(this).css("position")&&(!b.browser.mozilla||"table"!=b(this).css("display"))){var a=b(this).offset();return e-=a.top,g-=a.left,!1}}),f.scrollContainer==window)c-=b(window).scrollTop(),d-=b(window).scrollLeft(),c=Math.max(0,c-b(window).height()+5)+Math.min(0,c-5),d=Math.max(0,d-b(window).width()+5)+Math.min(0,d-5);else var i=b(f.scrollContainer),h=i.offset(),c=Math.max(0,c-i.height()-h.top)+Math.min(0,c-h.top),d=Math.max(0,d-i.width()-h.left)+Math.min(0,d-h.left);a.scroll.moveX=0==d?0:d*f.scrollSpeed/Math.abs(d),a.scroll.moveY=0==c?0:c*f.scrollSpeed/Math.abs(c),this.draggedItem.css({top:e,left:g})},wheel:function(d){if((b.browser.safari||b.browser.mozilla)&&a&&f.scrollContainer!=window){var c=b(f.scrollContainer),e=c.offset();d.pageX>e.left&&d.pageX<e.left+c.width()&&d.pageY>e.top&&d.pageY<e.top+c.height()&&(e=d.detail?5*d.detail:d.wheelDelta/-2,c.scrollTop(c.scrollTop()+e),d.preventDefault())}},buildPositionTable:function(){var d=[];this.getItems().not([a.draggedItem[0],a.placeHolderItem[0]]).each(function(a){var e=b(this).offset();e.right=e.left+b(this).outerWidth(),e.bottom=e.top+b(this).outerHeight(),e.elm=this,d[a]=e}),this.pos=d},dropItem:function(){if(null!=a.draggedItem){var d=a.draggedItem.attr("data-origstyle");return a.draggedItem.attr("style",d),""==d&&a.draggedItem.removeAttr("style"),a.draggedItem.removeAttr("data-origstyle"),a.styleDragHandlers(!0),a.placeHolderItem.before(a.draggedItem),a.placeHolderItem.remove(),b("[data-droptarget], .dragSortItem").remove(),window.clearInterval(a.scroll.scrollY),window.clearInterval(a.scroll.scrollX),a.draggedItem.attr("data-origpos")!=b(h).index(a)+"-"+a.getItems().index(a.draggedItem)&&f.dragEnd.apply(a.draggedItem),a.draggedItem.removeAttr("data-origpos"),a.draggedItem=null,b(document).unbind("mousemove",a.swapItems),b(document).unbind("mouseup",a.dropItem),f.scrollContainer!=window&&b(window).unbind("DOMMouseScroll mousewheel",a.wheel),!1}},swapItems:function(d){if(null==a.draggedItem)return!1;a.setPos(d.pageX,d.pageY);for(var c=a.findPos(d.pageX,d.pageY),e=a,g=0;-1==c&&f.dragBetween&&g<h.length;g++)c=h[g].findPos(d.pageX,d.pageY),e=h[g];if(-1==c)return!1;var i=function(){return b(e.container).children().not(e.draggedItem)},d=i().not(f.itemSelector).each(function(){this.idx=i().index(this)});return null==l||l.top>a.draggedItem.offset().top||l.left>a.draggedItem.offset().left?b(e.pos[c].elm).before(a.placeHolderItem):b(e.pos[c].elm).after(a.placeHolderItem),
d.each(function(){var a=i().eq(this.idx).get(0);this!=a&&i().index(this)<this.idx?b(this).insertAfter(a):this!=a&&b(this).insertBefore(a)}),b(h).each(function(a,b){b.createDropTargets(),b.buildPositionTable()}),l=a.draggedItem.offset(),!1},findPos:function(a,b){for(var e=0;e<this.pos.length;e++)if(this.pos[e].left<a&&this.pos[e].right>a&&this.pos[e].top<b&&this.pos[e].bottom>b)return e;return-1},createDropTargets:function(){f.dragBetween&&b(h).each(function(){var d=b(this.container).find("[data-placeholder]"),c=b(this.container).find("[data-droptarget]");0<d.size()&&0<c.size()?c.remove():0==d.size()&&0==c.size()&&("td"==f.itemSelector?b(f.placeHolderTemplate).attr("data-droptarget",!0).appendTo(this.container):b(this.container).append(a.placeHolderItem.removeAttr("data-placeholder").clone().attr("data-droptarget",!0)),a.placeHolderItem.attr("data-placeholder",!0))})}};m.init(),h.push(m)}),this}b(this.selector).trigger("dragsort-uninit")},b.fn.dragsort.defaults={itemSelector:"",dragSelector:"",dragSelectorExclude:"input, textarea",dragEnd:function(){},dragBetween:!1,placeHolderTemplate:"",scrollContainer:window,scrollSpeed:5}}(jQuery);var region=function(){var regions=[],param={floor:0},MultiLevel=function(){var _this=this,config={data:{},view:"",parameter:{url:"",setUrl:"",id:0,field:{pid:"parentId",did:"regionId",name:"regionName"},param:"parentId",setNmae:"city"},heads:[],sub:0,constraintTier:0,page:0,isEvents:!0,isinternation:0,forcePage:1},methods={foundView:function(verify,sub){var place=config.view.attr("data-place");place?0:place="请选择";var _v=verify,view='<div class="title"><span><input type="text" readonly="readonly" '+(_v?'class="required"':"")+"name=region"+sub+' placeholder="'+place+'"/></span><span class="s-live"></span><p class="region-data" style="display: none;"></p></div><div class="region-view"><div class="head"><ul></ul><span class="reset">重置</span></div><div class="cont clearfix"><ul></ul></div></div>';config.view.html(view),this.parseParam(),methods.events()},parseParam:function(){var param=null;try{param=config.view.attr("data"),param=param.split(","),config.parameter.setNmae=param[0],config.parameter.field.pid=param[1],config.parameter.field.did=param[2],config.parameter.field.name=param[3],config.parameter.param=param[4],config.constraintTier=parseInt(param[5]),config.forcePage=param[6]?parseInt(param[6]):1}catch(error){methods.error("朋友参数传递错误了,请仔细检查下",error)}return config.view.attr("setUrl")?(config.parameter.setUrl=config.view.attr("setUrl"),methods.setValue(),!1):void methods.http()},setUrl:function(){config.view.attr("url")?config.parameter.url=config.view.attr("url"):methods.error("朋友参数url没有设置,请仔细检查下"),config.parameter.url=config.parameter.url+"?"+config.parameter.param+"="+config.parameter.id},http:function(){return param.floor&&config.heads.length>=param.floor?(methods.setData(),!1):methods.getStorage(config.parameter.id)?(methods.setView(methods.getStorage(config.parameter.id)),!0):(methods.setUrl(),void $.ajax({type:"GET",url:config.parameter.url,dataType:"jsonp",success:function(data){methods.setStorage(data)},error:function(e,s,c){methods.error("请求数据异常~~~",{e:e,s:s,c:c})}}))},setStorage:function(data){data=methods.tidiesData(data),data&&data.length>0?(config.data[config.parameter.id]=data,methods.setView(data)):(methods.setData(),config.view.find(".region-view").hide())},tidiesData:function(data){var list=[];for(i in data)if(-9999==data[i][config.parameter.field.pid])data[i][config.parameter.field.pid]=0,list.push(data[i]),config.isinternation=1;else{if(0!=data[i][config.parameter.field.pid]||!config.isinternation)return data;data[i][config.parameter.field.pid]=-10,list.push(data[i])}return list},getStorage:function(id){return config.data[id]?config.data[id]:!1},setView:function(data){methods.setHead(data),methods.setCont(data)},setHead:function(data){config.view.find(".head ul").html("");var view="";for(i in config.heads)view+='<li class="" zindex="'+config.page+'" did="'+config.heads[i].id+'" pid="'+config.heads[i].pid+'">'+config.heads[i].name+"</li>";view+='<li class="act" zindex="'+config.page+'" pid="">请选择</li>',config.view.find(".head ul").html(view)},setCont:function(data){config.view.find(".cont ul").html("");var view="";for(i in data)"其他城市"!=data[i].regionName&&"其他省份"!=data[i].regionName&&"其他区县"!=data[i].regionName&&(view+='<li class="" zindex="'+config.page+'"                        pid="'+data[i][config.parameter.field.pid]+'"                        did="'+data[i][config.parameter.field.did]+'">'+data[i][config.parameter.field.name]+"</li>");config.view.find(".cont ul").html(view)},setData:function(data){var list=[],id=0,str="";list=data?data:config.heads;for(i in list)str+="  "+list[i].name,parseInt(i)==list.length-1&&(id=list[i].id);var isInput=config.view.prevAll(".region-hide");if(!isInput.attr("type")||"hidden"!=isInput.attr("type")&&"text"!=isInput.attr("type")){var view='<input type="hidden" class="region-hide" name="'+config.parameter.setNmae+'" value="'+(str+"/"+id)+'" />';config.view.before($(view)),isInput.val(str+"/"+id)}else isInput.val(str+"/"+id);isInput.trigger("change"),config.forcePage||$("body").trigger("click"),config.view.find(".title input").val(str),config.view.find(".region-data").html(JSON.stringify(config.heads));var _name=(config.heads.length-1,isInput.attr("name")),_errorTips=config.view.parent().siblings('label[for="'+_name+'"]');_errorTips.length>0&&_errorTips.hide()},headDel:function(id){var page=0;for(i in config.heads)config.heads[i].pid==id&&(page=parseInt(i));config.heads.splice(page,config.heads.length-page),methods.http()},headIsNmae:function(view){var text=view.html(),pid=view.attr("pid"),did=view.attr("did");for(i in config.heads)if(config.heads[i].pid==pid)return config.heads[i]={id:did,name:text,pid:pid},!1;return!0},isConstraintTier:function(){var leng=config.heads.length-1;return config.constraintTier&&leng>=config.constraintTier?!0:!1},events:function(){config.view.find(".head").on("click","li",function(){config.parameter.id=$(this).attr("pid"),methods.headDel(config.parameter.id)}),config.view.find(".cont").on("click","li",function(){config.parameter.id=$(this).attr("did"),methods.headIsNmae($(this))&&config.heads.push({id:$(this).attr("did"),name:$(this).html(),pid:$(this).attr("pid")}),/getCountryJsonpList/.test(config.view.attr("url"))&&1==config.view.attr("isLimit")&&-10==$(this).attr("pid")&&methods.setData(),methods.isConstraintTier()?(methods.setData(),config.forcePage&&methods.http()):methods.http()}),config.view.find(".title").click(function(){for(var rg=$("body").find(".m-region .region-view"),i=0,l=rg.length;l>i;i++)config.view.attr("sub")!=rg.eq(i).attr("sub")&&rg.eq(i).hide();return $(this).next().show(),!1}),config.view.find(".reset").click(function(){return _this.reset(),!1}),config.view.click(function(){return!1}),$(document).click(function(e){return $(e.target).hasClass("m-region")?!1:void config.view.find(".region-view").hide()})},error:function(txt,error){},setValue:function(){$.ajax({type:"GET",url:config.parameter.setUrl,dataType:"jsonp",success:function(data){try{data=data.reverse();var list=[];for(i in data)list.push({id:data[i][config.parameter.field.did],name:data[i][config.parameter.field.name],pid:data[i][config.parameter.field.pid]});methods.setData(list),config.parameter.id=0,config.heads=[]}catch(error){}methods.http()},error:function(error){methods.error("请求数据异常~~~",error)}})},listenChange:function(fn){var cacheInput=$('<input type="hidden" class="region_cache_'+config.view.attr("sub")+'" />');config.view.before(cacheInput),config.view.find(".cont").on("click","li",function(){var _cityNames=[],_cityIds=[];$.each(config.heads,function(i,elem){$.each(elem,function(k,v){"name"==k?_cityNames.push(v):"id"==k&&_cityIds.push(v)})}),cacheInput.val(_cityNames.join(",")+"/"+_cityIds.join(",")),"function"==typeof fn?fn():0})}};return this.start=function(view,sub,verify){config.sub=sub,config.view=$(view),config.view.attr("sub",sub),methods.foundView(verify,sub)},this.getData=function(){methods.getData()},this.update=function(){config.view.attr("setUrl")&&(config.parameter.setUrl=config.view.attr("setUrl"),methods.setValue())},this.reset=function(){config.heads=[],config.parameter.id=0,methods.http(),config.view.find(".title input").val(""),config.view.find(".s-live").html(""),config.view.prev().attr("value",""),config.view.find(".region-data").html("[]")},this.listenChange=function(fn){methods.listenChange(fn)},this};return{start:function(verify){this.allregion(verify)},allregion:function(verify){$(".m-region").each(function(){if(!$(this).attr("sub")){var ml=new MultiLevel;regions.push(ml),ml.start(this,regions.length-1,verify),ml.listenChange(verify)}})},aRegion:function(view){var ml=new MultiLevel;return regions.push(ml),ml.start(view,regions.length-1),ml},del:function(page){return page?($(".m-region").each(function(i){return i==page?(regions.splice(i,1),!0):void 0}),!1):!1},setParam:function(obj){$.extend(param,obj)}}}();define("pophint",function(require,exports,module){require("fancybox");var pophint=function(target,options){this.target=target,this.href=null,this._opts={showid:"s-cancel-ensure",content:"您确定要继续操作吗?",on:"s-f-confirm",off:"s-f-remove",onName:"确定",offName:"取消",operation:function(target){},cancelOpera:function(target){},showButton:!0,head:null},this._opts=$.extend(this._opts,options),this.init()};return pophint.prototype={init:function(){var _this=this;$(_this.target).is("a")&&(_this.href=$(_this.target).attr("href"),$(_this.target).attr("href","javascript:void( 0 )")),!$("#s-cancel-ensure").length>0&&this.makeHtml(),this.setContent(),_this.setpop()},makeHtml:function(){var _this=this,html='<span href="#s-cancel-ensure" id="fancybox-cancel-ensure"></span><div class="cancel-ensure" id="s-cancel-ensure" style="display: none;"><div class="s-chd"></div><div class="cbd">您确定要继续操作吗?</div><div class="s-cft"><button class="submitBtn  s-f-confirm">'+_this._opts.onName+'</button><button class="submitBtn grayBtn s-f-remove">'+_this._opts.offName+"</button></div></div>";!$("#s-cancel-ensure").length>0&&$("body").append(html),$("#fancybox-cancel-ensure").click(function(){}).fancybox({padding:0,closeBtn:!1,scrolling:"visible",keys:{close:null},helpers:{overlay:{closeClick:!1}},afterClose:function(){_this._opts.operation=function(){},_this._opts.cancelOpera=function(){}}})},setpop:function(){var _this=this;$("#fancybox-cancel-ensure").trigger("click"),_this._opts.showButton?$(".s-cft .s-f-remove").show():$(".s-cft .s-f-remove").hide(),$(".s-f-confirm").bind("click",function(){_this._opts.operation.call(_this,_this.target),$(_this.target).is("a")&&(window.location.href=_this.href),_this._opts.operation=function(){},_this._opts.cancelOpera=function(){},$.fancybox.close()}),$(".s-f-remove").bind("click",function(){return _this._opts.cancelOpera.call(_this,_this.target),$(_this.target).is("a")&&$(_this.target).attr("href",_this.href),_this._opts.cancelOpera=function(){},_this._opts.operation=function(){},$.fancybox.close(),!1})},setContent:function(){var _this=this,head=this._opts.head;$("#"+_this._opts.showid).find(".cbd").html(_this._opts.content),$("#"+_this._opts.showid).find(".s-f-confirm").html(_this._opts.onName),$("#"+_this._opts.showid).find(".s-f-remove").html(_this._opts.offName),"string"==typeof head&&head.length&&$("#"+_this._opts.showid).find(".s-chd").html(head).show()}},pophint}),define(function(require,exports,module){var SalesData=function(arges){var array=[],len=0,indexs={},config={odata:{},sdata:[],trview:arges.rootView&&$(arges.rootView).find("tr").length>0?$(arges.rootView).find("tr"):$(arges.rootView).find(".attribute"),radioview:arges.radioNmae?$(arges.radioNmae):null,currentview:arges.showView?$(arges.showView):null,titles:[],data:[],isdata:{},setview:null,res:[{"class":"price",dilipattern:"/^[0-9]+$/,可售量有误!",value:"",name:""},{"class":"stockNum",dilipattern:"/^[0-9]+$/,可售量有误!",dilimethod:"checkProductStockNum",value:"",name:""},{"class":"minNum",dilipattern:"/^[0-9]+$/,可售量有误!",dilimethod:"checkProductStockNum",value:"",name:""}],httpdata:{},sku:{}},events={change:null},methods={updata:function(){config.sdata=[],config.data=[],array=[];for(i in config.odata)config.sdata.push(config.odata[i].data);for(var i=0;i<config.sdata.length;i++){for(var list=[],k=0;k<config.sdata[i].length;k++)if(config.sdata[i][k].bl){var ack=config.sdata[i][k];list.push({txt:ack.name,val:ack.val,data:ack.data?ack.data:null})}list.length>0&&array.push(list)}len=array.length,methods.specialSort(-1),methods.setdata()},getdata:function(){for(var texts=[],skus={},i=0;i<config.setdata.length;i++)if(config.setdata[i].sku){for(var txt="",attribute=methods.skuString(config.setdata[i].sku),keys=config.setdata[i].sku.split(":"),k=0;k<attribute.length;k++)skus[keys[k]]||texts.push({txt:attribute[k],sku:keys[k]}),txt+=attribute[k];config.setdata[i].attribute=attribute,config.httpdata[txt]=config.setdata[i]}methods.upview(texts);var w=0;for(i in config.odata)config.odata[i].changeData(),w++},skuString:function(sku){for(var sku=sku.split(":"),attribute=[],i=0;i<sku.length;i++)attribute.push(config.sku[sku[i]]);return attribute},setdata:function(){var unit=config.radioview.find("option:selected").length>0?config.radioview.find("option:selected").text():$("#unit").text(),results=config.data,current=config.currentview.find("tbody");return current.html(""),methods.showdata(results),""==unit||results.length<=0||results[0].length<config.sdata.length?!1:void(config.setview?config.setview(unit):methods.updateview(unit))},showdata:function(results){config.isdata={};for(var i=0;i<results.length;i++){for(var text="",sku="",abj={},attribute=[],adata=results[i],k=0;k<adata.length;k++)sku+=adata[k].val,k!=adata.length-1&&(sku+=":"),text+=adata[k].txt,attribute.push(adata[k].txt);config.httpdata[text]?config.isdata[text]=config.httpdata[text]:(abj.sku=sku,abj.data=methods.copy(),abj.attribute=attribute,config.isdata[text]=abj)}},oevent:function(cals){this.data=[];var self=this;return $("."+cals).bind("change",function(){self.data=[],self.changeData()}),this.changeData=function(data){$("."+cals).each(function(){var name=$(this).attr("alt");"checked"==$(this).attr("checked")?self.data.push({bl:!0,name:name,val:$(this).attr("value"),data:data?data:null}):self.data.push({bl:!1,name:name,val:"",data:data?data:null})}),methods.updata()},this},upview:function(data){config.trview.find(":checkbox").prop("checked",!1),config.trview.each(function(){$(this).hasClass("attribute")&&$(this).find("input").each(function(){for(var val=$(this).val(),key=$(this).attr("alt"),i=0;i<data.length;i++)data[i].txt?val==data[i].sku&&$(this).prop("checked",!0):key==data[i]&&$(this).prop("checked",!0)})})},start:function(){$.extend(config,arges),config.trview.each(function(){if($(this).hasClass("attribute")){var title=$(this).find("input").attr("class"),checkbox=new methods.oevent(title);config.odata[title]=checkbox,config.sdata.push(checkbox.data),$(this).find("input").each(function(){config.sku[$(this).val()]=$(this).attr("alt")})}}),config.setdata&&methods.getdata(),methods.eventinput()},specialSort:function(start){if(start++,!(start>len-1))for(indexs[start]||(indexs[start]=0),array[start]instanceof Array||(array[start]=[array[start]]),indexs[start]=0;indexs[start]<array[start].length;indexs[start]++)if(methods.specialSort(start),start==len-1){for(var temp=[],i=len-1;i>=0;i--)array[start-i]instanceof Array||(array[start-i]=[array[start-i]]),temp.push(array[start-i][indexs[start-i]]);config.data.push(temp)}},unique:function(list){for(var res=[],json={},i=0;i<list.length;i++)json[list[i]]||(res.push(list[i]),json[list[i]]=1);return res},updateview:function(unit){var current=config.currentview.find("tbody");current.html("");var data=config.isdata;for(k in data){for(var view="<tr>",alist=data[k].attribute,moredata=data[k].data,i=0;i<alist.length;i++)view+='<td class="txt" val="'+data[k].sku+'">'+alist[i]+"</td>";view+=moredata&&moredata[0]?methods.issku(moredata,unit,data[k].sku):methods.onsku(moredata,unit,data[k].sku),current.append(view)}},issku:function(moredata,unit,sku){for(var view="",j=0;j<moredata.length;j++)view+='<td><input index="'+j+'" type="text" sku='+sku,view+=methods.automatic(moredata[j],sku),view+=" />"+(moredata[j]["class"]&&(methods.hasClass(moredata[j]["class"],"stockNum")||methods.hasClass(moredata[j]["class"],"minNum"))?"":"元/")+'<span class="t-unit">'+unit+"</span></td>";return view},onsku:function(moredata,unit,sku){for(var view="",k=0;k<moredata.length;k++)view+='<td><input index="'+k+'" type="text" sku='+sku+methods.automatic(config.res[k],sku)+" />"+(config.res[k]["class"]&&(methods.hasClass(config.res[k]["class"],"stockNum")||methods.hasClass(config.res[k]["class"],"minNum"))?"":"元/")+'<span class="t-unit">'+unit+"</span></td>";return view},automatic:function(data,sku){var view=" ";for(f in data)view+="name"!=f||data[f]?" "+f+'="'+data[f]+'"':" "+f+'="'+(sku+":"+data["class"])+'"';return view},eventinput:function(){var current=config.currentview;current.find("input").live("change",function(){var thisview=$(this),pview=thisview.parent().parent(),text="",index=0,attribute=[],sku="";if(pview.find(".txt").each(function(){text+=$(this).html(),attribute.push($(this).html())}),sku=thisview.attr("sku"),index=parseInt(thisview.attr("index")),config.httpdata[text])config.httpdata[text].data[index].value=thisview.val();else{var aobj={attribute:attribute,sku:sku,data:methods.copy()};aobj.data[index].value=thisview.val(),config.httpdata[text]=aobj}}),config.radioview.change(function(){events.change&&events.change()})},cloneObj:function(obj){var newO={};obj instanceof Array&&(newO=[]);for(var key in obj){var val=obj[key];newO[key]="object"==typeof val?arguments.callee(val):val}return newO},copy:function(){var res=new Array;for(i in config.res)res.push(methods.cloneObj(config.res[i]));return res},hasClass:function(text,txt){text=text.split(" ");for(i in text)if(text[i]==txt)return!0;return!1}};return this.event=function(key,callback){"function"==typeof callback&&(events[key]=callback)},this.setData=function(data){config.setdata=data,methods.getdata()},this.changeData=function(){var texts=[],data=[];for(i in config.isdata){i;data=config.isdata[i].attribute;for(var k=0;k<data.length;k++)texts.push(data[k])}methods.upview(methods.unique(texts));var w=0;for(i in config.odata)config.odata[i].changeData(),w++},this.eachData=function(){var data=[];config.odata.length;if(config.currentview.find("tbody tr").each(function(){var abj={data:[]};abj.sku=$(this).find("td").eq(0).attr("val").split(":").slice(1);for(var key="",k=0;k<abj.sku.length;k++)key+=abj.sku[k],k!=abj.sku.length-1&&(key+=":");abj.sku=key,$(this).find("input").each(function(){var elProp={};$(this).attr("dilipattern")&&(elProp.dilipattern=$(this).attr("dilipattern")),$(this).attr("dilimethod")&&(elProp.dilimethod=$(this).attr("dilimethod")),$(this).attr("money")&&(elProp.money=$(this).attr("money")),$(this).attr("digits")&&(elProp.digits=$(this).attr("digits")),$(this).attr("maxlength")&&(elProp.maxlength=$(this).attr("maxlength")),$(this).attr("range")&&(elProp.range=$(this).attr("range")),$(this).attr("min")&&(elProp.min=$(this).attr("min")),$(this).attr("max")&&(elProp.max=$(this).attr("max")),elProp.value=$(this).val(),elProp["class"]=$(this).attr("class"),elProp.sku=$(this).attr("sku"),elProp.vsku=$(this).attr("vsku"),elProp.name=$(this).attr("name"),abj.data.push(elProp)}),data.push(abj)}),data.length<=0)return!1;config.setdata=data,methods.getdata();var w=0;for(i in config.odata)config.odata[i].changeData(),w++},methods.start(),this};return SalesData}),function($){$.extend($.fn,{validate:function(options){if(!this.length)return void(options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing"));var validator=$.data(this[0],"validator");return validator?validator:(this.attr("novalidate","novalidate"),validator=new $.validator(options,this[0]),$.data(this[0],"validator",validator),validator.settings.onsubmit&&(this.validateDelegate(":submit","click",function(ev){validator.settings.submitHandler&&(validator.submitButton=ev.target),$(ev.target).hasClass("cancel")&&(validator.cancelSubmit=!0)}),this.submit(function(event){function handle(){var hidden;return validator.settings.submitHandler?(validator.submitButton&&(hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm)),validator.settings.submitHandler.call(validator,validator.currentForm,event),validator.submitButton&&hidden.remove(),!1):!0}return validator.settings.debug&&event.preventDefault(),validator.cancelSubmit?(validator.cancelSubmit=!1,handle()):validator.form()?validator.pendingRequest?(validator.formSubmitted=!0,!1):handle():(validator.focusInvalid(),!1)})),validator)},valid:function(){if($(this[0]).is("form"))return this.validate().form();var valid=!0,validator=$(this[0].form).validate();return this.each(function(){valid&=validator.element(this)}),valid},removeAttrs:function(attributes){var result={},$element=this;return $.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value),$element.removeAttr(value)}),result},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,"validator").settings,staticRules=settings.rules,existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument)),staticRules[element.name]=existingRules,argument.messages&&(settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages));break;case"remove":if(!argument)return delete staticRules[element.name],existingRules;var filtered={};return $.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method],delete existingRules[method]}),filtered}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required,data=$.extend({required:param},data)}return data}}),$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value)},filled:function(a){return!!$.trim(""+a.value)},unchecked:function(a){return!a.checked}}),$.validator=function(options,form){this.settings=$.extend(!0,{},$.validator.defaults,options),this.currentForm=form,this.init()},$.validator.format=function(source,params){return 1===arguments.length?function(){var args=$.makeArray(arguments);return args.unshift(source),$.validator.format.apply(this,args)}:(arguments.length>2&&params.constructor!==Array&&(params=$.makeArray(arguments).slice(1)),params.constructor!==Array&&(params=[params]),$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)}),source)},$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(element,event){this.lastActive=element,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(element)).hide())},onfocusout:function(element,event){this.checkable(element)||!(element.name in this.submitted)&&this.optional(element)||this.element(element)},onkeyup:function(element,event){(9!==event.which||""!==this.elementValue(element))&&(element.name in this.submitted||element===this.lastActive)&&this.element(element)},onclick:function(element,event){element.name in this.submitted?this.element(element):element.parentNode.name in this.submitted&&this.element(element.parentNode)},highlight:function(element,errorClass,validClass){"radio"===element.type?this.findByName(element.name).addClass(errorClass).removeClass(validClass):$(element).addClass(errorClass).removeClass(validClass)},unhighlight:function(element,errorClass,validClass){"radio"===element.type?this.findByName(element.name).removeClass(errorClass).addClass(validClass):$(element).removeClass(errorClass).addClass(validClass)}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator&&validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0],event)}this.labelContainer=$(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm),this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var groups=this.groups={};$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key})});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)}),$(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",delegate).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",delegate),this.settings.invalidHandler&&$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),$.extend(this.submitted,this.errorMap),this.invalid=$.extend({},this.errorMap),this.valid()||$(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var i=0,elements=this.currentElements=this.elements();elements[i];i++)this.check(elements[i]);return this.valid()},element:function(element){element=this.validationTargetFor(this.clean(element)),this.lastElement=element,this.prepareElement(element),this.currentElements=$(element);var result=this.check(element)!==!1;return result?delete this.invalid[element.name]:this.invalid[element.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),result},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors),this.errorList=[];for(var name in errors)this.errorList.push({message:errors[name],element:this.findByName(name)[0]});this.successList=$.grep(this.successList,function(element){return!(element.name in errors)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){$.fn.resetForm&&$(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(obj){var count=0;for(var i in obj)count++;return count},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&1===$.grep(this.errorList,function(n){return n.element.name===lastActive.name}).length&&lastActive},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in rulesCache||!validator.objectLength($(this).rules())?!1:(rulesCache[this.name]=!0,!0)})},clean:function(selector){return $(selector)[0]},errors:function(){var errorClass=this.settings.errorClass.replace(" ",".");return $(this.settings.errorElement+"."+errorClass,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=$([]),this.toHide=$([]),this.currentElements=$([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset(),this.toHide=this.errorsFor(element)},elementValue:function(element){var type=$(element).attr("type"),val=$(element).val();return"radio"===type||"checkbox"===type?$('input[name="'+$(element).attr("name")+'"]:checked').val():"string"==typeof val?val.replace(/\r/g,""):val},check:function(element){element=this.validationTargetFor(this.clean(element));var result,rules=$(element).rules(),dependencyMismatch=!1,val=this.elementValue(element);for(var method in rules){var rule={method:method,parameters:rules[method]};try{if(result=$.validator.methods[method].call(this,val,element,rule.parameters),"dependency-mismatch"===result){dependencyMismatch=!0;continue}if(dependencyMismatch=!1,"pending"===result)return void(this.toHide=this.toHide.not(this.errorsFor(element)));if(!result)return this.formatAndAdd(element,rule),!1}catch(e){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id+", check the '"+rule.method+"' method",e),e}}return dependencyMismatch?void 0:(this.objectLength(rules)&&this.successList.push(element),!0)},customMetaMessage:function(element,method){if($.metadata){var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method]}},customDataMessage:function(element,method){return $(element).data("msg-"+method.toLowerCase())||element.attributes&&$(element).attr("data-msg-"+method.toLowerCase())},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method])},findDefined:function(){for(var i=0;i<arguments.length;i++)if(void 0!==arguments[i])return arguments[i];return void 0},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customDataMessage(element,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||void 0,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>")},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;"function"==typeof message?message=message.call(this,rule.parameters,element):theregex.test(message)&&(message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters)),this.errorList.push({message:message,element:element}),this.errorMap[element.name]=message,this.submitted[element.name]=message;
},addWrapper:function(toToggle){return this.settings.wrapper&&(toToggle=toToggle.add(toToggle.parent(this.settings.wrapper))),toToggle},defaultShowErrors:function(){var i,elements;for(i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass),this.showLabel(error.element,error.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(i=0;this.successList[i];i++)this.showLabel(this.successList[i]);if(this.settings.unhighlight)for(i=0,elements=this.validElements();elements[i];i++)this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(element,message){var label=this.errorsFor(element);label.length?(label.removeClass(this.settings.validClass).addClass(this.settings.errorClass),label.attr("generated")&&label.html(message)):(label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:!0}).addClass(this.settings.errorClass).html(message||""),this.settings.wrapper&&(label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(label).length||(this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element))),!message&&this.settings.success&&(label.text(""),"string"==typeof this.settings.success?label.addClass(this.settings.success):this.settings.success(label,element)),this.toShow=this.toShow.add(label)},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr("for")===name})},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name)},validationTargetFor:function(element){return this.checkable(element)&&(element=this.findByName(element.name).not(this.settings.ignore)[0]),element},checkable:function(element){return/radio|checkbox/i.test(element.type)},findByName:function(name){return $(this.currentForm).find('[name="'+name+'"]')},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element))return this.findByName(element.name).filter(":checked").length}return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):!0},dependTypes:{"boolean":function(param,element){return param},string:function(param,element){return!!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch"},startRequest:function(element){this.pending[element.name]||(this.pendingRequest++,this.pending[element.name]=!0)},stopRequest:function(element,valid){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[element.name],valid&&0===this.pendingRequest&&this.formSubmitted&&this.form()?($(this.currentForm).submit(),this.formSubmitted=!1):!valid&&0===this.pendingRequest&&this.formSubmitted&&($(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:!0,message:this.defaultMessage(element,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(className,rules){className.constructor===String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className)},classRules:function(element){var rules={},classes=$(element).attr("class");return classes&&$.each(classes.split(" "),function(){this in $.validator.classRuleSettings&&$.extend(rules,$.validator.classRuleSettings[this])}),rules},attributeRules:function(element){var rules={},$element=$(element);for(var method in $.validator.methods){var value;"required"===method?(value=$element.get(0).getAttribute(method),""===value&&(value=!0),value=!!value):value=$element.attr(method),value?rules[method]=value:$element[0].getAttribute("type")===method&&(rules[method]=!0)}return rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)&&delete rules.maxlength,rules},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,"validator").settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");return validator.settings.rules&&(rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{}),rules},normalizeRules:function(rules,element){return $.each(rules,function(prop,val){if(val===!1)return void delete rules[prop];if(val.param||val.depends){var keepRule=!0;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element)}keepRule?rules[prop]=void 0!==val.param?val.param:!0:delete rules[prop]}}),$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter}),$.each(["minlength","maxlength","min","max"],function(){rules[this]&&(rules[this]=Number(rules[this]))}),$.each(["rangelength","range"],function(){var parts;rules[this]&&($.isArray(rules[this])?rules[this]=[Number(rules[this][0]),Number(rules[this][1])]:"string"==typeof rules[this]&&(parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/),rules[this]=[Number(parts[0]),Number(parts[1])]))}),$.validator.autoCreateRanges&&(rules.min&&rules.max&&(rules.range=[rules.min,rules.max],delete rules.min,delete rules.max),rules.minlength&&rules.maxlength&&(rules.rangelength=[rules.minlength,rules.maxlength],delete rules.minlength,delete rules.maxlength)),rules.messages&&delete rules.messages,rules},normalizeRule:function(data){if("string"==typeof data){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=!0}),data=transformed}return data},addMethod:function(name,method,message){$.validator.methods[name]=method,$.validator.messages[name]=void 0!==message?message:$.validator.messages[name],method.length<3&&$.validator.addClassRules(name,$.validator.normalizeRule(name))},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";if("select"===element.nodeName.toLowerCase()){var val=$(element).val();return val&&val.length>0}return this.checkable(element)?this.getLength(value,element)>0:$.trim(value).length>0},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(this.settings.messages[element.name]||(this.settings.messages[element.name]={}),previous.originalMessage=this.settings.messages[element.name].remote,this.settings.messages[element.name].remote=previous.message,param="string"==typeof param&&{url:param}||param,this.pending[element.name])return"pending";if(previous.old===value)return previous.valid;previous.old=value;var validator=this;this.startRequest(element);var data={};return data[element.name]=value,$.ajax($.extend(!0,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===!0||"true"===response;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element),validator.formSubmitted=submitted,validator.successList.push(element),delete validator.invalid[element.name],validator.showErrors()}else{var errors={},message=response||validator.defaultMessage(element,"remote");errors[element.name]=previous.message=$.isFunction(message)?message(value):message,validator.invalid[element.name]=!0,validator.showErrors(errors)}previous.valid=valid,validator.stopRequest(element,valid)}},param)),"pending"},minlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param},maxlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||param>=length},rangelength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param[0]&&length<=param[1]},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||param>=value},range:function(value,element,param){return this.optional(element)||value>=param[0]&&value<=param[1]},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value)},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value))},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value)},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9 \-]+/.test(value))return!1;var nCheck=0,nDigit=0,bEven=!1;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);nDigit=parseInt(cDigit,10),bEven&&(nDigit*=2)>9&&(nDigit-=9),nCheck+=nDigit,bEven=!bEven}return nCheck%10===0},equalTo:function(value,element,param){var target=$(param);return this.settings.onfocusout&&target.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid()}),value===target.val()}}}),$.format=$.validator.format}(jQuery),function($){var pendingRequests={};if($.ajaxPrefilter)$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;"abort"===settings.mode&&(pendingRequests[port]&&pendingRequests[port].abort(),pendingRequests[port]=xhr)});else{var ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;return"abort"===mode?(pendingRequests[port]&&pendingRequests[port].abort(),pendingRequests[port]=ajax.apply(this,arguments)):ajax.apply(this,arguments)}}}(jQuery),function($){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||$.each({focus:"focusin",blur:"focusout"},function(original,fix){function handler(e){return e=$.event.fix(e),e.type=fix,$.event.handle.call(this,e)}$.event.special[fix]={setup:function(){this.addEventListener(original,handler,!0)},teardown:function(){this.removeEventListener(original,handler,!0)},handler:function(e){var args=arguments;return args[0]=$.event.fix(e),args[0].type=fix,$.event.handle.apply(this,args)}}}),$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);return target.is(delegate)?handler.apply(target,arguments):void 0})}})}(jQuery),!function($){$.extend($.fn,{validate:function(options){if(!this.length)return void(options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing"));var validator=$.data(this[0],"validator");return validator?validator:(this.attr("novalidate","novalidate"),validator=new $.validator(options,this[0]),$.data(this[0],"validator",validator),validator.settings.onsubmit&&(this.validateDelegate(":submit","click",function(ev){validator.settings.submitHandler&&(validator.submitButton=ev.target),$(ev.target).hasClass("cancel")&&(validator.cancelSubmit=!0)}),this.submit(function(event){function handle(){var hidden;return validator.settings.submitHandler?(validator.submitButton&&(hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm)),validator.settings.submitHandler.call(validator,validator.currentForm,event),validator.submitButton&&hidden.remove(),!1):!0}return validator.settings.debug&&event.preventDefault(),validator.cancelSubmit?(validator.cancelSubmit=!1,handle()):validator.form()?validator.pendingRequest?(validator.formSubmitted=!0,!1):handle():(validator.focusInvalid(),!1)})),validator)},valid:function(){if($(this[0]).is("form"))return this.validate().form();var valid=!0,validator=$(this[0].form).validate();return this.each(function(){valid&=validator.element(this)}),valid},removeAttrs:function(attributes){var result={},$element=this;return $.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value),$element.removeAttr(value)}),result},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,"validator").settings,staticRules=settings.rules,existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument)),staticRules[element.name]=existingRules,argument.messages&&(settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages));break;case"remove":if(!argument)return delete staticRules[element.name],existingRules;var filtered={};return $.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method],delete existingRules[method]}),filtered}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required,data=$.extend({required:param},data)}return data}}),$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value)},filled:function(a){return!!$.trim(""+a.value)},unchecked:function(a){return!a.checked}}),$.validator=function(options,form){this.settings=$.extend(!0,{},$.validator.defaults,options),this.currentForm=form,this.init()},$.validator.format=function(source,params){return 1===arguments.length?function(){var args=$.makeArray(arguments);return args.unshift(source),$.validator.format.apply(this,args)}:(arguments.length>2&&params.constructor!==Array&&(params=$.makeArray(arguments).slice(1)),params.constructor!==Array&&(params=[params]),$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n)}),source)},$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(element,event){this.lastActive=element,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(element)).hide())},onfocusout:function(element,event){this.checkable(element)||!(element.name in this.submitted)&&this.optional(element)||this.element(element)},onkeyup:function(element,event){(9!==event.which||""!==this.elementValue(element))&&(element.name in this.submitted||element===this.lastActive)&&this.element(element)},onclick:function(element,event){element.name in this.submitted?this.element(element):element.parentNode.name in this.submitted&&this.element(element.parentNode)},highlight:function(element,errorClass,validClass){"radio"===element.type?this.findByName(element.name).addClass(errorClass).removeClass(validClass):$(element).addClass(errorClass).removeClass(validClass)},unhighlight:function(element,errorClass,validClass){"radio"===element.type?this.findByName(element.name).removeClass(errorClass).addClass(validClass):$(element).removeClass(errorClass).addClass(validClass)}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator&&validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0],event)}this.labelContainer=$(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm),this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var groups=this.groups={};$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key})});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)}),$(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",delegate).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",delegate),this.settings.invalidHandler&&$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),$.extend(this.submitted,this.errorMap),this.invalid=$.extend({},this.errorMap),this.valid()||$(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var i=0,elements=this.currentElements=this.elements();elements[i];i++)this.check(elements[i]);return this.valid()},element:function(element){element=this.validationTargetFor(this.clean(element)),this.lastElement=element,this.prepareElement(element),this.currentElements=$(element);var result=this.check(element)!==!1;return result?delete this.invalid[element.name]:this.invalid[element.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),result},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors),this.errorList=[];for(var name in errors)this.errorList.push({message:errors[name],element:this.findByName(name)[0]});this.successList=$.grep(this.successList,function(element){return!(element.name in errors)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){$.fn.resetForm&&$(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(obj){var count=0;for(var i in obj)count++;return count},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&1===$.grep(this.errorList,function(n){return n.element.name===lastActive.name}).length&&lastActive},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in rulesCache||!validator.objectLength($(this).rules())?!1:(rulesCache[this.name]=!0,!0)})},clean:function(selector){return $(selector)[0]},errors:function(){var errorClass=this.settings.errorClass.replace(" ",".");return $(this.settings.errorElement+"."+errorClass,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=$([]),this.toHide=$([]),this.currentElements=$([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset(),this.toHide=this.errorsFor(element)},elementValue:function(element){var type=$(element).attr("type"),val=$(element).val();return"radio"===type||"checkbox"===type?$('input[name="'+$(element).attr("name")+'"]:checked').val():"string"==typeof val?val.replace(/\r/g,""):val},check:function(element){element=this.validationTargetFor(this.clean(element));var result,rules=$(element).rules(),dependencyMismatch=!1,val=this.elementValue(element);for(var method in rules){var rule={method:method,parameters:rules[method]};try{if(result=$.validator.methods[method].call(this,val,element,rule.parameters),"dependency-mismatch"===result){dependencyMismatch=!0;continue}if(dependencyMismatch=!1,"pending"===result)return void(this.toHide=this.toHide.not(this.errorsFor(element)));if(!result)return this.formatAndAdd(element,rule),!1}catch(e){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id+", check the '"+rule.method+"' method",e),e}}return dependencyMismatch?void 0:(this.objectLength(rules)&&this.successList.push(element),!0)},customMetaMessage:function(element,method){if($.metadata){var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method]}},customDataMessage:function(element,method){return $(element).data("msg-"+method.toLowerCase())||element.attributes&&$(element).attr("data-msg-"+method.toLowerCase())},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method])},findDefined:function(){for(var i=0;i<arguments.length;i++)if(void 0!==arguments[i])return arguments[i];return void 0},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customDataMessage(element,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||void 0,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>")},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;"function"==typeof message?message=message.call(this,rule.parameters,element):theregex.test(message)&&(message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters)),this.errorList.push({message:message,element:element}),this.errorMap[element.name]=message,this.submitted[element.name]=message},addWrapper:function(toToggle){return this.settings.wrapper&&(toToggle=toToggle.add(toToggle.parent(this.settings.wrapper))),toToggle},defaultShowErrors:function(){var i,elements;for(i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass),this.showLabel(error.element,error.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(i=0;this.successList[i];i++)this.showLabel(this.successList[i]);if(this.settings.unhighlight)for(i=0,elements=this.validElements();elements[i];i++)this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow),this.hideErrors(),this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(element,message){var label=this.errorsFor(element);label.length?(label.removeClass(this.settings.validClass).addClass(this.settings.errorClass),label.attr("generated")&&label.html(message)):(label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:!0}).addClass(this.settings.errorClass).html(message||""),this.settings.wrapper&&(label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(label).length||(this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element))),!message&&this.settings.success&&(label.text(""),"string"==typeof this.settings.success?label.addClass(this.settings.success):this.settings.success(label,element)),this.toShow=this.toShow.add(label)},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr("for")===name})},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name)},validationTargetFor:function(element){return this.checkable(element)&&(element=this.findByName(element.name).not(this.settings.ignore)[0]),element},checkable:function(element){return/radio|checkbox/i.test(element.type)},findByName:function(name){return $(this.currentForm).find('[name="'+name+'"]')},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case"select":return $("option:selected",element).length;case"input":if(this.checkable(element))return this.findByName(element.name).filter(":checked").length}return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):!0},dependTypes:{"boolean":function(param,element){return param},string:function(param,element){return!!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch"},startRequest:function(element){this.pending[element.name]||(this.pendingRequest++,this.pending[element.name]=!0)},stopRequest:function(element,valid){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[element.name],valid&&0===this.pendingRequest&&this.formSubmitted&&this.form()?($(this.currentForm).submit(),this.formSubmitted=!1):!valid&&0===this.pendingRequest&&this.formSubmitted&&($(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:!0,message:this.defaultMessage(element,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(className,rules){className.constructor===String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className)},classRules:function(element){var rules={},classes=$(element).attr("class");return classes&&$.each(classes.split(" "),function(){this in $.validator.classRuleSettings&&$.extend(rules,$.validator.classRuleSettings[this])}),rules},attributeRules:function(element){var rules={},$element=$(element);for(var method in $.validator.methods){var value;"required"===method?(value=$element.get(0).getAttribute(method),""===value&&(value=!0),value=!!value):value=$element.attr(method),value?rules[method]=value:$element[0].getAttribute("type")===method&&(rules[method]=!0)}return rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)&&delete rules.maxlength,rules},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,"validator").settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata()},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");return validator.settings.rules&&(rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{}),rules},normalizeRules:function(rules,element){return $.each(rules,function(prop,val){if(val===!1)return void delete rules[prop];if(val.param||val.depends){var keepRule=!0;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element)}keepRule?rules[prop]=void 0!==val.param?val.param:!0:delete rules[prop]}}),$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter}),$.each(["minlength","maxlength","min","max"],function(){rules[this]&&(rules[this]=Number(rules[this]))}),$.each(["rangelength","range"],function(){var parts;rules[this]&&($.isArray(rules[this])?rules[this]=[Number(rules[this][0]),Number(rules[this][1])]:"string"==typeof rules[this]&&(parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/),
rules[this]=[Number(parts[0]),Number(parts[1])]))}),$.validator.autoCreateRanges&&(rules.min&&rules.max&&(rules.range=[rules.min,rules.max],delete rules.min,delete rules.max),rules.minlength&&rules.maxlength&&(rules.rangelength=[rules.minlength,rules.maxlength],delete rules.minlength,delete rules.maxlength)),rules.messages&&delete rules.messages,rules},normalizeRule:function(data){if("string"==typeof data){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=!0}),data=transformed}return data},addMethod:function(name,method,message){$.validator.methods[name]=method,$.validator.messages[name]=void 0!==message?message:$.validator.messages[name],method.length<3&&$.validator.addClassRules(name,$.validator.normalizeRule(name))},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";if("select"===element.nodeName.toLowerCase()){var val=$(element).val();return val&&val.length>0}return this.checkable(element)?this.getLength(value,element)>0:$.trim(value).length>0},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(this.settings.messages[element.name]||(this.settings.messages[element.name]={}),previous.originalMessage=this.settings.messages[element.name].remote,this.settings.messages[element.name].remote=previous.message,param="string"==typeof param&&{url:param}||param,this.pending[element.name])return"pending";if(previous.old===value)return previous.valid;previous.old=value;var validator=this;this.startRequest(element);var data={};return data[element.name]=value,$.ajax($.extend(!0,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===!0||"true"===response;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element),validator.formSubmitted=submitted,validator.successList.push(element),delete validator.invalid[element.name],validator.showErrors()}else{var errors={},message=response||validator.defaultMessage(element,"remote");errors[element.name]=previous.message=$.isFunction(message)?message(value):message,validator.invalid[element.name]=!0,validator.showErrors(errors)}previous.valid=valid,validator.stopRequest(element,valid)}},param)),"pending"},minlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param},maxlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||param>=length},rangelength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength($.trim(value),element);return this.optional(element)||length>=param[0]&&length<=param[1]},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||param>=value},range:function(value,element,param){return this.optional(element)||value>=param[0]&&value<=param[1]},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(value)},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value))},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(value)},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9 \-]+/.test(value))return!1;var nCheck=0,nDigit=0,bEven=!1;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);nDigit=parseInt(cDigit,10),bEven&&(nDigit*=2)>9&&(nDigit-=9),nCheck+=nDigit,bEven=!bEven}return nCheck%10===0},equalTo:function(value,element,param){var target=$(param);return this.settings.onfocusout&&target.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid()}),value===target.val()}}}),$.format=$.validator.format}(jQuery),function($){var pendingRequests={};if($.ajaxPrefilter)$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;"abort"===settings.mode&&(pendingRequests[port]&&pendingRequests[port].abort(),pendingRequests[port]=xhr)});else{var ajax=$.ajax;$.ajax=function(settings){var mode=("mode"in settings?settings:$.ajaxSettings).mode,port=("port"in settings?settings:$.ajaxSettings).port;return"abort"===mode?(pendingRequests[port]&&pendingRequests[port].abort(),pendingRequests[port]=ajax.apply(this,arguments)):ajax.apply(this,arguments)}}}(jQuery),function($){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||$.each({focus:"focusin",blur:"focusout"},function(original,fix){function handler(e){return e=$.event.fix(e),e.type=fix,$.event.handle.call(this,e)}$.event.special[fix]={setup:function(){this.addEventListener(original,handler,!0)},teardown:function(){this.removeEventListener(original,handler,!0)},handler:function(e){var args=arguments;return args[0]=$.event.fix(e),args[0].type=fix,$.event.handle.apply(this,args)}}}),$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);return target.is(delegate)?handler.apply(target,arguments):void 0})}})}(jQuery),jQuery.extend(jQuery.validator.messages,{required:"必填内容",remote:"请勿输入非法字符与非法关键词",email:"请输入正确格式的电子邮件",url:"请输入合法的网址",date:"请输入合法的日期",dateISO:"请输入合法的日期 (ISO).",number:"请输入合法的数字",digits:"只能输入正整数",creditcard:"请输入合法的信用卡号",equalTo:"请再次输入相同的值",accept:"请输入拥有合法后缀名的字符串",money:"请输入正确的金额格式",maxlength:jQuery.validator.format("请输入一个长度最多是 {0} 的字符串"),minlength:jQuery.validator.format("请输入一个长度最少是 {0} 的字符串"),rangelength:jQuery.validator.format("请输入一个长度介于 {0} 和 {1} 之间的字符串"),range:jQuery.validator.format("请输入一个介于 {0} 和 {1} 之间的值"),max:jQuery.validator.format("请输入一个最大为 {0} 的值"),min:jQuery.validator.format("请输入一个最小为 {0} 的值"),notIllegalCharacter:"请输入正确的内容",isPhone:"请输入正确的电话号码",isMultiPhone:"请输入正确的电话号码",isChar:"请填写正确的中文, 字母或者数字"}),$.validator.setDefaults({focusInvalid:!0,focusCleanup:!1}),$.validator.setDefaults({errorPlacement:function(error,element){try{element.parent().is("span")?error.addClass("new-error-placement").appendTo(element.parent().parent()):error.addClass("new-error-placement").appendTo(element.parent("td"))}catch(e){$(element).focus()}}}),jQuery.validator.addMethod("isIdCardNo",function(value,element){return this.optional(element)||isIdCardNo(value)},"请正确输入您的身份证号码"),jQuery.validator.addMethod("isMobile",function(value,element){var length=value.length;return this.optional(element)||11==length&&/^1[3-8]\d{9}$/.test(value)},"请填写正确的手机号码"),jQuery.validator.addMethod("isVerifCode",function(value,element){var length=value.length;return this.optional(element)||6==length&&/^\d{6}$/.test(value)},"请填写正确的验证码"),jQuery.validator.addMethod("isCompany",function(value,element){return value.length,this.optional(element)||/^[\u4E00-\u9FA5]+$/.test(value)},"请填写正确的企业名称"),jQuery.validator.addMethod("isChar",function(value,element){return value.length,this.optional(element)||/^[\u4E00-\u9FA50-9a-zA-Z]+$/.test(value)},"请填写正确的中文, 字母或者数字!"),jQuery.validator.addMethod("isConcat",function(value,element){return value.length,this.optional(element)||/^[\u4E00-\u9FA50-9a-zA-Z\-]+$/.test(value)},"输入中含有非法字符!"),jQuery.validator.addMethod("isRealName",function(value,element){return this.optional(element)||/^[\u4E00-\u9FA5+·]{2,10}$/.test(value)&&!/^[\u4E00-\u9FA5+·]{2,10}[·]$/.test(value)&&!/^[·][\u4E00-\u9FA5+.]{2,10}$/.test(value)},"请填写正确的名字"),jQuery.validator.addMethod("money",function(value,element){var money=/^([1-9][0-9]+|[0-9])(\.\d{1,2})?$/;return this.optional(element)||money.test(value)},"请输入正确的金额"),jQuery.validator.addMethod("isPhone",function(value,element){var phone=/((^\d{11}$)|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)/;return this.optional(element)||phone.test(value)},"请输入正确的电话号码"),jQuery.validator.addMethod("isMultiPhone",function(value,element){var phone=/^(((\d{11})|((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})))([;、;,、,]?))+$/;return this.optional(element)||phone.test(value)},"请输入正确的电话号码"),jQuery.validator.addMethod("isPlane",function(value,element){var tel=/^(\d{3,4}-)\d{7,9}$/g;return this.optional(element)||tel.test(value)},"请正确填写您的联系电话。"),jQuery.validator.addMethod("isTel",function(value,element){var length=value.length,mobile=/^1[3-8]\d{9}$/,tel=/^(\d{3,4}-)\d{7,9}$/g;return this.optional(element)||tel.test(value)||11==length&&mobile.test(value)},"请正确填写您的联系方式"),jQuery.validator.addMethod("notIllegalCharacter",function(value,element){var char=/^[^><\/\\;&]*$/;return this.optional(element)||char.test(value)},"请输入正确的内容"),jQuery.validator.addMethod("isBusinessReg",function(value,element){return this.optional(element)||reg(value)},"请填写正确的工商注册号码"),jQuery.validator.addMethod("diliMethod",function(value,element,param){var me=param,t=window[me].call(this,value,element);return 1!=t?($.validator.messages.diliMethod=t,!1):!0}),jQuery.validator.addMethod("diliPattern",function(value,element,param){var params=param.split("/,"),pa=eval(params[0]+"/"),msg=params[1],t=pa.test(value);return 0==t&&($.validator.messages.diliPattern=void 0!==msg?msg:$.validator.messages[msg]),t}),jQuery.validator.addMethod("isCarNo",function(value,element){var carNO=/^[\u4E00-\u9FA5]{1}[a-zA-Z]{1}[\da-zA-Z]{5}$/;return this.optional(element)||carNO.test(value)},"请输入正确的车牌号码!"),jQuery.validator.addMethod("isAddr",function(value,element){var reg=/[\#\<\>\=\'\"]+/g;return this.optional(element)||!reg.test(value)},"请输入正确的地址信息!"),jQuery.validator.addMethod("filterCharacter",function(value,element){var char=/^[0-9a-zA-Z\u4e00-\u9fa5\/()()&《》【】\+=\]\[]+$/g;return this.optional(element)||char.test(value)},"请输入正确的内容"),define(function(require,exports,module){require("region"),require("dragsort"),require("jqueryUI"),require("fancybox"),require("validate"),require("validate.extend");var _SalesData=require("SalesData"),_Jselect=require("jselect");_Pophint=require("pophint"),$(function(){var methods={updateunm:function(view){var mun=0;return $("#"+view+" .available").each(function(){var value=$(this).val();console.log(value),value&&!isNaN(value)&&(mun+=parseInt($(this).val()))}),mun},updateunit:function(){var unit=$("#unit").find("option:selected").length>0?$("#unit").find("option:selected").text():$("#unit").text();this.unit=unit,$(".t-unit").html(unit)},unit:"斤"};region.start(),$(".certification .certification-img").fancybox({padding:0}),$("#add-certification .add-mbox").click(function(){$.fancybox.close()}),$(".my-list p").click(function(){$(this).next().slideToggle()}),$(".release-stairs").draggable(),methods.updateunit();var priceTable=$("#purchases tbody");$(".addbtn").click(function(){var pkey='<tr><td>购买:<input type="text"><span class="jian">'+methods.unit+'</span>以上</td><td><input type="text">元/<span class="jian">'+methods.unit+'</span><span class="delete a-link">删除</span></td></tr>';$("#purchases tbody tr").length<3&&priceTable.append(pkey)}),$("#purchases .delete").live("click",function(){$("#purchases tbody tr").length>1&&$(this).parent().parent().remove()});var sales1=new _SalesData({rootView:"#transaction-set",showView:"#describe",radioNmae:"#unit"});sales1.event("change",function(){methods.updateunit()}),sales1.eachData();var sales2=new _SalesData({rootView:"#transaction-set",showView:"#interval",radioNmae:"#unit",res:[{"class":"price",dilipattern:"/^[0-9]+$/,可售量有误!",value:0}]});sales2.event("change",function(){methods.updateunit()}),sales2.eachData(),$("input[name='pricetype']").change(function(){"false"==$(this).val()?($(".interval-view").show(),$(".specifications-view").hide(),sales2.changeData()):($(".interval-view").hide(),$(".specifications-view").show(),sales1.changeData())}),$(".s-ntab li").click(function(){return $(".s-ntab li a").removeClass("current"),$(this).find("a").addClass("current"),$(".s-ntab-content").hide(),$(".s-ntab-content").eq($(this).index()).show(),!1}),$(".icon-stairs-colse").click(function(){$(".release-stairs").hide()}),$(".img-remove").click(function(){$(this).parents("li").remove()}),$("#user-list").dragsort({dragSelector:"span",dragBetween:!0,dragEnd:function(){}}),$(".release-stairs li").click(function(){var view=$(".form-box").eq($(this).index()),$body=window.opera?"CSS1Compat"==document.compatMode?$("html"):$("body"):$("html,body"),distance=view.offset().top;$body.stop().animate({scrollTop:distance},800)}),$(".release-stairs .top").click(function(){var $body=window.opera?"CSS1Compat"==document.compatMode?$("html"):$("body"):$("html,body");$body.stop().animate({scrollTop:0},800)}),$(".certification-img").hover(function(){""==$(this).find("img").attr("src")?$(this).next().hide():$(this).next().show()}),$(".available").live("change",function(){var getnum=0;getnum="true"==$('input[name="pricetype"]:checked').val()?methods.updateunm("describe"):methods.updateunm("interval"),$(".sell-num").html(getnum+""+methods.unit)}),require.async(["validate.extend"],function(){$(".s-form").validate({})}),$("#auto-title").click(function(){new _Pophint(this,{operation:function(target){},content:"你确定取消吗?",showButton:!1})}),$(".sea-select").each(function(){new _Jselect(this,{searchBar:!0})}),$("#c-nav-add").click(function(){var _html=$('<div class="c-nav-box">                            <select class="sea-select categoryItem" data-pid="0">                                <option value="">请选择分类</option>                            </select>                            <span class="submitBtn grayBtn c-nav-rmove">删除</span>                        </div>');$(_html).insertBefore($(this)),new _Jselect($(_html).find(".sea-select")[0],{searchBar:!0})}),$(".c-info").change(function(){$(this).is(":checked")?$("#"+$(this).attr("cdata")).show():$("#"+$(this).attr("cdata")).hide()})})});