manageProduct.js 94.3 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),define("ntab",function(require,exports,module){var ntab=function(a,b){this.target=a,this.opt={handler:null,eventType:"hover",hoverActive:!0,currentClass:"pdo-ntab_current",hideDelay:120,index:0,isAnimate:!0,onShow:function(){},onHide:function(){}},$.extend(this.opt,b),this.init()};return ntab.prototype={init:function(){var b=this;this.H=$(this.target).find(this.opt.handler),this.H.each(function(i){var a=$(this).attr("data-href")?$(this).attr("data-href"):$(this).attr("href"),cont=$(a);this.C=a&&cont.length?cont:$(this).next(),this.C&&this.C.length&&(this.C[0].H=this,b.opt.index!==i?$(this.C).hide():b.show(this))}),this.bind()},bind:function(){function delayShow(a){clearTimeout(stimer),clearTimeout(htimer),stimer=setTimeout(function(){b.show(a)},b.opt.hideDelay)}var b=this,stimer=htimer=null;/click/.test(this.opt.eventType)?this.H[this.opt.eventType](function(a){delayShow(this),a.preventDefault()}):(this.H[this.opt.eventType](function(){delayShow(this)},function(){}),$(this.target)[this.opt.eventType](function(){clearTimeout(htimer)},function(){})),/hover/.test(this.opt.eventType)&&this.opt.hoverActive&&this.H.each(function(){this.C&&$(this.C)[b.opt.eventType](function(){clearTimeout(htimer)},function(){})}),$(".ntab-handler").each(function(){this._bind||($(this).click(function(){var a=this,relato=$(this).attr("relato"),rela_elems=$(relato),orgi_target=null;return rela_elems.each(function(){$(this).attr("href")==$(a).attr("href")&&(orgi_target=this)}),$(orgi_target).click(),!1}),this._bind=!0)})},show:function(a){var b=this;this.H.each(function(){$(this)[this===a&&a.C&&a.C.length?"addClass":"removeClass"](b.opt.currentClass),this===a?(this.C&&$(this.C)[b.opt.isAnimate?"fadeIn":"show"](b.opt.isAnimate?200:0),b.opt.onShow.call(this,this.C)):/click/.test(b.opt.eventType)?$(this.C).hide():$(this.C)[b.opt.isAnimate?"fadeOut":"hide"](b.opt.isAnimate?200:0)})},hide:function(a){$(a).removeClass(this.opt.currentClass),/click/.test(this.opt.eventType)?$(a.C).hide():$(a.C).fadeOut(200),a||_this.show()}},ntab}),define("droll",function(require,exports,module){var droll=function(target,options){this.autoTimer=null,this.target=target,this.opt={step:null,moveNum:null,Media:!1,eventType:"click",isHori:!0,index:0,auto:!1,effect:"1",autoDelay:5e3,speed:500,fadeSpeed:400,dirButton:!0,indexButton:!1,showNum:!0,isCycle:!0,relaBtns:null,listCurClass:"pdo-droll_list_current",ibtnCurClass:"pdo-droll_btn_current",lockedClass:"pdo-droll_btn_locked",prevHtml:"&lt;",nextHtml:"&gt;",loop:!0,outerSelector:"ul",itemsSelector:"li",btnHoverActive:!1,onFinished:function(target,inview_elems){},onBeforeInView:function(target,inview_elems){},layoutWidth:null,layoutHeight:null},$.extend(this.opt,options),this.LENGTH=0,this.LOCKED=!1,this.I=this.opt.index,this.PREVI=this.opt.index,this.init()};return droll.prototype={init:function(){var _this=this;if(this.LENGTH=$(this.target).find(this.opt.outerSelector).find(this.opt.itemsSelector).length,this.LENGTH<=this.opt.moveNum&&(this.opt.loop=!1),this.printWrapper(),this.setParams(),this.bindEvents(),this.setListState(),this.setDirBtnState(),this.setIndexBtnState(this.opt.index),this.LENGTH<=this.opt.moveNum&&!this.opt.Media)return void this.opt.onBeforeInView.call(this.target,$(this.target).find(this.opt.outerSelector).find(this.opt.itemsSelector));if(0!==this.opt.index?this.move():this.opt.onBeforeInView.call(this.target,this.getInViewList()),2==this.opt.effect&&($(this.target).find(this.opt.itemsSelector).each(function(){$(this).css({left:0,top:0,position:"absolute"}).hide()}),this.move()),this.opt.auto&&(this.auto(),$(this.target).hover(function(){clearTimeout(_this.autoTimer)},function(){_this.auto()})),this.opt.Media){var _itemsSelector=$(_this.target).find(_this.opt.outerSelector).find(_this.opt.itemsSelector),_ml=parseFloat($(_itemsSelector).css("marginLeft")),_mr=parseFloat($(_itemsSelector).css("marginRight"));$(window).resize(function(){_this.opt.step=parseFloat($(_itemsSelector).outerWidth())+_ml+_mr,$(_this.target).find(".pdo-droll_layout , .pdo-droll").css({width:_this.opt.step*_this.opt.moveNum}),_this.setParams(),_this.move(1*_this.opt.moveNum)})}},printWrapper:function(){var numlists="",elem=$(this.target),style=this.opt.isHori?"width: "+(this.opt.layoutWidth||this.opt.step*this.opt.moveNum)+"px; height: "+(this.opt.layoutHeight||$(this.target).outerHeight())+"px;":"height: "+(this.opt.layoutHeight||this.opt.step*this.opt.moveNum)+"px; width: "+(this.opt.layoutWidth||$(this.target).outerWidth())+"px;";2==this.opt.effect&&(style="width:100%;height:100%;");for(var i=0;i<this.LENGTH/this.opt.moveNum;i++){var _i=this.opt.showNum?i+1:"&nbsp;";numlists+='<a href="javascript:void(0);">'+_i+"</a>"}elem.find(this.opt.outerSelector).wrap('<div style="'+style+'z-index:1;" class="pdo-droll"></div>'),elem.find(".pdo-droll").wrap('<div style="'+style+'" class="pdo-droll_layout"></div>'),this.LENGTH>this.opt.moveNum&&elem.find(".pdo-droll_layout").append('                        <div class="pdo-droll_dirbutton" style="display:none;">                            <a class="pdo-droll_prev" href="javascript:void(0);"><span><span></a>                            <a class="pdo-droll_next" href="javascript:void(0);"><span><span></a>                        </div>                        <div class="pdo-droll_numbutton" style="display:none;">'+numlists+"</div>                    ")},setParams:function(){var elem=$(this.target);this.ELEM={outer:elem.find("pdo-droll"),cont:elem.find(this.opt.outerSelector),dirbtn:elem.find("div.pdo-droll_dirbutton"),numbtn:elem.find("div.pdo-droll_numbutton"),prev:elem.find("a.pdo-droll_prev"),next:elem.find("a.pdo-droll_next")},this.opt.dirButton&&!this.opt.btnHoverActive&&this.ELEM.dirbtn.fadeIn(200),this.opt.indexButton&&this.LENGTH>this.opt.moveNum&&this.ELEM.numbtn.fadeIn(200);var size=this.opt.step*this.ELEM.cont.find(this.opt.itemsSelector).length;2==this.opt.effect&&(size="100%"),this.ELEM.cont[this.opt.isHori?"width":"height"](size).css("position","absolute")},bindEvents:function(){var _this=this;this.ELEM.prev.click(function(){_this.move(-1*_this.opt.moveNum)}),this.ELEM.next.click(function(){_this.move(1*_this.opt.moveNum)}),this.opt.btnHoverActive&&(this.target.ha_stimer=null,this.target.ha_htimer=null,$(this.target).hover(function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer),_this.target.ha_stimer=setTimeout(function(){_this.ELEM.dirbtn.fadeIn(120)},100)},function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer),_this.target.ha_htimer=setTimeout(function(){_this.ELEM.dirbtn.fadeOut(120)},100)}),this.ELEM.dirbtn.mouseover(function(){clearTimeout(_this.target.ha_stimer),clearTimeout(_this.target.ha_htimer)})),this.ELEM.numbtn.find("a")[this.opt.eventType](function(){_this.move($(this).index()*_this.opt.moveNum-_this.I)}),this.opt.relaBtns&&this.opt.relaBtns[this.opt.eventType](function(){var orgBtns=_this.ELEM.numbtn.find("a").eq($(this).index());orgBtns.triggerHandler(_this.opt.eventType)})},move:function(move_num,cur_ibtn_index){if(!(this.LENGTH<=this.opt.moveNum||1==this.opt.effect&&this.LOCKED)){this.LOCKED=!0;var _this=this,gs=this.getStep(move_num,cur_ibtn_index),step=1==this.opt.effect?gs.step:gs.toindex;if(1==this.opt.effect&&null===gs.step)return void(this.LOCKED=!1);if(this.opt.onBeforeInView.call(this.target,this.getInViewList()),this.setListState(),this.setDirBtnState(),this.setIndexBtnState(Math.abs(gs.toindex)),
1==this.opt.effect){var move_config={};move_config[this.opt.isHori?"left":"top"]=step,this.ELEM.cont.animate(move_config,this.opt.speed,function(){_this.LOCKED=!1,_this.opt.onFinished.call(_this.target,_this.getInViewList())})}if(2==this.opt.effect){var items=$(this.target).find(this.opt.itemsSelector);items.eq(gs.toindex).siblings().fadeOut(100),items.eq(gs.toindex).fadeIn(this.opt.fadeSpeed,function(){_this.opt.onFinished.call(_this.target,_this.getInViewList())})}}},getStep:function(move_num){var cycle=this.opt.isCycle;if(void 0==move_num)return this.I=0,{toindex:0,step:null};var range=[0,this.LENGTH-this.opt.moveNum],to_index=move_num+this.I;return to_index>range[1]&&(to_index=this.opt.loop?to_index<this.LENGTH?range[1]:cycle?0:range[1]:range[1]),to_index<range[0]&&(this.opt.loop?to_index+this.LENGTH>range[1]?to_index=0:cycle?to_index+=this.LENGTH:to_index=0:to_index=0),this.I=to_index,{toindex:to_index,step:to_index*this.opt.step*-1}},auto:function(){clearTimeout(this.autoTimer);var _this=this;this.autoTimer=setTimeout(function(){_this.move(1*_this.opt.moveNum),_this.auto()},this.opt.autoDelay)},getInViewList:function(){for(var arr=[],i=this.I;i<this.I+this.opt.moveNum;i++)arr.push(this.ELEM.cont.find(this.opt.itemsSelector).eq(i)[0]);return arr},setListState:function(){},setDirBtnState:function(){this.opt.loop||(this.ELEM.prev.removeClass(this.opt.lockedClass),this.ELEM.next.removeClass(this.opt.lockedClass),this.I<=0&&this.ELEM.prev.addClass(this.opt.lockedClass),this.I>=this.LENGTH-this.opt.moveNum&&this.ELEM.next.addClass(this.opt.lockedClass))},setIndexBtnState:function(index){this.opt.loop;var realIndex=Math.round(index/this.opt.moveNum),orgBtns=this.ELEM.numbtn.find("a");orgBtns.removeClass(this.opt.ibtnCurClass),orgBtns.eq(realIndex).addClass(this.opt.ibtnCurClass),this.opt.relaBtns&&(this.opt.relaBtns.removeClass(this.opt.ibtnCurClass),this.opt.relaBtns.eq(realIndex).addClass(this.opt.ibtnCurClass))}},droll}),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){var _Ntab=require("ntab"),_Droll=require("droll");require("fancybox"),require("validate"),require("validate.extend"),$(function(){$(".tab-title").length&&$(".tab-title").each(function(){new _Ntab(this,{handler:"li>a",eventType:"click",currentClass:"on",index:0,onShow:function(){},onHide:function(){}})}),$(".k-validate").length&&require.async(["validate.extend"],function(){$(".k-validate").validate({submitHandler:function(form){alert(1),form.submit()},rules:{onlythat:{required:!0,minlength:{param:5,depends:function(element){return console.log(element),!0}}}},messages:{onlythat:{required:"检查一下",minlength:"最少需要输入 {0} 个字符"}},debug:!0})}),jQuery.validator.addMethod("p-max",function(value,element,params){return this.optional(element)||value<=param},jQuery.validator.format("需要写的文字"));var obj={},manageProduct=function(){function _add(key,fn){var _k=null!=obj[key]?obj[key]:obj[key]=[];return _k.push(fn)}function _listen(key){for(var _key=obj[key],i=0,l=_key.length;l>i;i++)_key[i].call(__this,_class(key))}function _clear(key){obj[key].length=0}function _diff(target){var id=set.contentId,ul=(set.contentTag,set.contentUl),sdk=set.sdk,targetSdk=$(target).attr(sdk).split(set.split),gUl=$(id+" "+ul);$(id+" "+ul).html(" ");for(var i=0,l=gather.length;l>i;i++){var getSdk=gather.get(i);_arrayin(targetSdk,$(getSdk).attr(sdk))&&$(getSdk).clone(!0).appendTo(gUl)}}function _msg(c){var $html=$('<div class="chint"><div class="hint-word as-inline"><i class="as-inline as-true"></i><span class="msg-word">修改成功</span></div></div>');c===!1&&($html.find(".msg-word").html("修改失败"),$html.find("i.as-inline").removeClass("as-true").addClass("as-false")),$("body").append($html),_predict([function(){$html.addClass("chint-on")},function(){$html.remove()}],[200,3e3])}function _class(name){return $("."+name)}function _arrayin(arr,elem){for(var i=0,l=arr.length;l>i;i++)if(arr[i]==elem)return!0;return!1}function _predict(fn,n){var cache=n,l=cache.length,i=l-1;do setTimeout(l?fn[i]:fn,l?cache[i]:cache);while(i--)}var __this=this,set={sdk:"data-sdk",contentId:"#fancy-alter",contentUl:"ul",contentTag:"li",split:/[\,]/},gather=$(set.contentId+" "+set.contentTag).clone(!0);return{add:_add,listen:_listen,diff:_diff,msg:_msg,predict:_predict,clear:_clear}},handler=manageProduct();handler.add("act-price",function(target){$(target).on({click:function(){_this=this,$(this).fancybox({padding:0,beforeLoad:function(){handler.diff(_this)}})}}),$(target).click()}),handler.add("act-supply",function(target){$(target).on({click:function(){_this=this,$(this).fancybox({padding:0,beforeLoad:function(){handler.diff(_this)}})}}),$(target).click()}),handler.add("btn-ensure",function(target){$(target).on({click:function(){handler.msg()}})}),handler.add("btn-cancel",function(target){$(target).on({click:function(){handler.msg(!1)}})}),$(window).on({scroll:function(){var anchor=parseInt($(".lotstore").position().top),scrolltop=parseInt($(this).scrollTop());scrolltop>anchor?$(".batch-outer").addClass("batch-fixed"):$(".batch-outer").removeClass("batch-fixed")}});var checkPoduct=function(options){function setCheck(dom,bool){for(var d=$("."+dom),i=0,len=d.length;len>i;i++)d.eq(i)[0].checked=bool}function numChecked(checkbox){for(var box=$(checkbox),n=0,i=0,len=box.length;len>i;i++)box.eq(i)[0].checked?n++:n;return n}var name=$.extend({box:"lotstore",father:"chk-all",son:"chk-son",clickSon:function(){},clickFather:function(){},batch:"batch-outer",store:"store-got"},options),batch=$("."+name.batch),store=$("."+name.store),number=0;$("."+name.father).on({click:function(){var max=$("."+name.son).length;$(this)[0].checked?(setCheck(name.son,!0),setCheck(name.father,!0),batch.show(),store.find("span").html(max)):(setCheck(name.son,!1),setCheck(name.father,!1),batch.hide()),name.clickFather()}}),$("."+name.son).on({click:function(){var max=$("."+name.son).length,length=numChecked($("."+name.son));max==length?setCheck(name.father,!0):setCheck(name.father,!1),number=length?batch.show():batch.hide(),store.find("span").html(length),name.clickSon()}})};checkPoduct();var newcate=$(".newcate");$(".fancy-click-btn").fancybox({}),$(".newcate-btn").on({click:function(){newcate.show()}}),$(".newcate-sure").on({click:function(){var val=newcate.find(".iptText").val();val?$(".cate-select").append("<option>"+val+"</option>"):0,newcate.hide()}}),$(".act-ewmloop").fancybox({padding:0,scrolling:"visible"}),$(".ewmshow").length>0&&$(".ewmshow li").length>2&&$(".ewmshow").each(function(){new _Droll(this,{step:302,moveNum:2,isCycle:!1})});var pd=$(".printdemo"),ep=$(".ensureprint");$(".selectprint .s-select").on({change:function(){var cache=pd.attr("src").split("/"),number=/\d/.exec($(this).val())[0];cache[cache.length-1]=cache[cache.length-1].replace(/\d/,number),pd.attr("src",cache.join("/"));var href=ep.attr("href").split("=");href[href.length-1]=number,ep.attr("href",href.join("="))}})})});