").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
$.ajaxSettings['cache'] = true;;// END OF /share/jquery.min.js
// STARTS OF /scripts/flexslider/jquery.flexslider-min.js
/*
* jQuery FlexSlider v2.6.3
* Copyright 2012 WooThemes
* Contributing Author: Tyler Smith
*/!function($){var e=!0;$.flexslider=function(t,a){var n=$(t);n.vars=$.extend({},$.flexslider.defaults,a);var i=n.vars.namespace,s=window.navigator&&window.navigator.msPointerEnabled&&window.MSGesture,r=("ontouchstart"in window||s||window.DocumentTouch&&document instanceof DocumentTouch)&&n.vars.touch,o="click touchend MSPointerUp keyup",l="",c,d="vertical"===n.vars.direction,u=n.vars.reverse,v=n.vars.itemWidth>0,p="fade"===n.vars.animation,m=""!==n.vars.asNavFor,f={};$.data(t,"flexslider",n),f={init:function(){n.animating=!1,n.currentSlide=parseInt(n.vars.startAt?n.vars.startAt:0,10),isNaN(n.currentSlide)&&(n.currentSlide=0),n.animatingTo=n.currentSlide,n.atEnd=0===n.currentSlide||n.currentSlide===n.last,n.containerSelector=n.vars.selector.substr(0,n.vars.selector.search(" ")),n.slides=$(n.vars.selector,n),n.container=$(n.containerSelector,n),n.count=n.slides.length,n.syncExists=$(n.vars.sync).length>0,"slide"===n.vars.animation&&(n.vars.animation="swing"),n.prop=d?"top":"marginLeft",n.args={},n.manualPause=!1,n.stopped=!1,n.started=!1,n.startTimeout=null,n.transitions=!n.vars.video&&!p&&n.vars.useCSS&&function(){var e=document.createElement("div"),t=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"];for(var a in t)if(void 0!==e.style[t[a]])return n.pfx=t[a].replace("Perspective","").toLowerCase(),n.prop="-"+n.pfx+"-transform",!0;return!1}(),n.ensureAnimationEnd="",""!==n.vars.controlsContainer&&(n.controlsContainer=$(n.vars.controlsContainer).length>0&&$(n.vars.controlsContainer)),""!==n.vars.manualControls&&(n.manualControls=$(n.vars.manualControls).length>0&&$(n.vars.manualControls)),""!==n.vars.customDirectionNav&&(n.customDirectionNav=2===$(n.vars.customDirectionNav).length&&$(n.vars.customDirectionNav)),n.vars.randomize&&(n.slides.sort(function(){return Math.round(Math.random())-.5}),n.container.empty().append(n.slides)),n.doMath(),n.setup("init"),n.vars.controlNav&&f.controlNav.setup(),n.vars.directionNav&&f.directionNav.setup(),n.vars.keyboard&&(1===$(n.containerSelector).length||n.vars.multipleKeyboard)&&$(document).bind("keyup",function(e){var t=e.keyCode;if(!n.animating&&(39===t||37===t)){var a=39===t?n.getTarget("next"):37===t?n.getTarget("prev"):!1;n.flexAnimate(a,n.vars.pauseOnAction)}}),n.vars.mousewheel&&n.bind("mousewheel",function(e,t,a,i){e.preventDefault();var s=0>t?n.getTarget("next"):n.getTarget("prev");n.flexAnimate(s,n.vars.pauseOnAction)}),n.vars.pausePlay&&f.pausePlay.setup(),n.vars.slideshow&&n.vars.pauseInvisible&&f.pauseInvisible.init(),n.vars.slideshow&&(n.vars.pauseOnHover&&n.hover(function(){n.manualPlay||n.manualPause||n.pause()},function(){n.manualPause||n.manualPlay||n.stopped||n.play()}),n.vars.pauseInvisible&&f.pauseInvisible.isHidden()||(n.vars.initDelay>0?n.startTimeout=setTimeout(n.play,n.vars.initDelay):n.play())),m&&f.asNav.setup(),r&&n.vars.touch&&f.touch(),(!p||p&&n.vars.smoothHeight)&&$(window).bind("resize orientationchange focus",f.resize),n.find("img").attr("draggable","false"),setTimeout(function(){n.vars.start(n)},200)},asNav:{setup:function(){n.asNav=!0,n.animatingTo=Math.floor(n.currentSlide/n.move),n.currentItem=n.currentSlide,n.slides.removeClass(i+"active-slide").eq(n.currentItem).addClass(i+"active-slide"),s?(t._slider=n,n.slides.each(function(){var e=this;e._gesture=new MSGesture,e._gesture.target=e,e.addEventListener("MSPointerDown",function(e){e.preventDefault(),e.currentTarget._gesture&&e.currentTarget._gesture.addPointer(e.pointerId)},!1),e.addEventListener("MSGestureTap",function(e){e.preventDefault();var t=$(this),a=t.index();$(n.vars.asNavFor).data("flexslider").animating||t.hasClass("active")||(n.direction=n.currentItem
=s&&t.hasClass(i+"active-slide")?n.flexAnimate(n.getTarget("prev"),!0):$(n.vars.asNavFor).data("flexslider").animating||t.hasClass(i+"active-slide")||(n.direction=n.currentItem '),n.pagingCount>1)for(var r=0;r ":' '+t+" ","thumbnails"===n.vars.controlNav&&!0===n.vars.thumbCaptions){var d=s.attr("data-thumbcaption");""!==d&&void 0!==d&&(a+='
'+d+" ")}n.controlNavScaffold.append("
"+a+" "),t++}n.controlsContainer?$(n.controlsContainer).append(n.controlNavScaffold):n.append(n.controlNavScaffold),f.controlNav.set(),f.controlNav.active(),n.controlNavScaffold.delegate("a, img",o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(n.direction=a>n.currentSlide?"next":"prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},setupManual:function(){n.controlNav=n.manualControls,f.controlNav.active(),n.controlNav.bind(o,function(e){if(e.preventDefault(),""===l||l===e.type){var t=$(this),a=n.controlNav.index(t);t.hasClass(i+"active")||(a>n.currentSlide?n.direction="next":n.direction="prev",n.flexAnimate(a,n.vars.pauseOnAction))}""===l&&(l=e.type),f.setToClearWatchedEvent()})},set:function(){var e="thumbnails"===n.vars.controlNav?"img":"a";n.controlNav=$("."+i+"control-nav li "+e,n.controlsContainer?n.controlsContainer:n)},active:function(){n.controlNav.removeClass(i+"active").eq(n.animatingTo).addClass(i+"active")},update:function(e,t){n.pagingCount>1&&"add"===e?n.controlNavScaffold.append($('
'+n.count+" ")):1===n.pagingCount?n.controlNavScaffold.find("li").remove():n.controlNav.eq(t).closest("li").remove(),f.controlNav.set(),n.pagingCount>1&&n.pagingCount!==n.controlNav.length?n.update(t,e):f.controlNav.active()}},directionNav:{setup:function(){var e=$('
");n.customDirectionNav?n.directionNav=n.customDirectionNav:n.controlsContainer?($(n.controlsContainer).append(e),n.directionNav=$("."+i+"direction-nav li a",n.controlsContainer)):(n.append(e),n.directionNav=$("."+i+"direction-nav li a",n)),f.directionNav.update(),n.directionNav.bind(o,function(e){e.preventDefault();var t;""!==l&&l!==e.type||(t=$(this).hasClass(i+"next")?n.getTarget("next"):n.getTarget("prev"),n.flexAnimate(t,n.vars.pauseOnAction)),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(){var e=i+"disabled";1===n.pagingCount?n.directionNav.addClass(e).attr("tabindex","-1"):n.vars.animationLoop?n.directionNav.removeClass(e).removeAttr("tabindex"):0===n.animatingTo?n.directionNav.removeClass(e).filter("."+i+"prev").addClass(e).attr("tabindex","-1"):n.animatingTo===n.last?n.directionNav.removeClass(e).filter("."+i+"next").addClass(e).attr("tabindex","-1"):n.directionNav.removeClass(e).removeAttr("tabindex")}},pausePlay:{setup:function(){var e=$('
');n.controlsContainer?(n.controlsContainer.append(e),n.pausePlay=$("."+i+"pauseplay a",n.controlsContainer)):(n.append(e),n.pausePlay=$("."+i+"pauseplay a",n)),f.pausePlay.update(n.vars.slideshow?i+"pause":i+"play"),n.pausePlay.bind(o,function(e){e.preventDefault(),""!==l&&l!==e.type||($(this).hasClass(i+"pause")?(n.manualPause=!0,n.manualPlay=!1,n.pause()):(n.manualPause=!1,n.manualPlay=!0,n.play())),""===l&&(l=e.type),f.setToClearWatchedEvent()})},update:function(e){"play"===e?n.pausePlay.removeClass(i+"pause").addClass(i+"play").html(n.vars.playText):n.pausePlay.removeClass(i+"play").addClass(i+"pause").html(n.vars.pauseText)}},touch:function(){function e(e){e.stopPropagation(),n.animating?e.preventDefault():(n.pause(),t._gesture.addPointer(e.pointerId),T=0,c=d?n.h:n.w,f=Number(new Date),l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c)}function a(e){e.stopPropagation();var a=e.target._slider;if(a){var n=-e.translationX,i=-e.translationY;return T+=d?i:n,m=T,y=d?Math.abs(T)
500)&&(e.preventDefault(),!p&&a.transitions&&(a.vars.animationLoop||(m=T/(0===a.currentSlide&&0>T||a.currentSlide===a.last&&T>0?Math.abs(T)/c+2:1)),a.setProps(l+m,"setTouch"))))}}function i(e){e.stopPropagation();var t=e.target._slider;if(t){if(t.animatingTo===t.currentSlide&&!y&&null!==m){var a=u?-m:m,n=a>0?t.getTarget("next"):t.getTarget("prev");t.canAdvance(n)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?t.flexAnimate(n,t.vars.pauseOnAction):p||t.flexAnimate(t.currentSlide,t.vars.pauseOnAction,!0)}r=null,o=null,m=null,l=null,T=0}}var r,o,l,c,m,f,g,h,S,y=!1,x=0,b=0,T=0;s?(t.style.msTouchAction="none",t._gesture=new MSGesture,t._gesture.target=t,t.addEventListener("MSPointerDown",e,!1),t._slider=n,t.addEventListener("MSGestureChange",a,!1),t.addEventListener("MSGestureEnd",i,!1)):(g=function(e){n.animating?e.preventDefault():(window.navigator.msPointerEnabled||1===e.touches.length)&&(n.pause(),c=d?n.h:n.w,f=Number(new Date),x=e.touches[0].pageX,b=e.touches[0].pageY,l=v&&u&&n.animatingTo===n.last?0:v&&u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:v&&n.currentSlide===n.last?n.limit:v?(n.itemW+n.vars.itemMargin)*n.move*n.currentSlide:u?(n.last-n.currentSlide+n.cloneOffset)*c:(n.currentSlide+n.cloneOffset)*c,r=d?b:x,o=d?x:b,t.addEventListener("touchmove",h,!1),t.addEventListener("touchend",S,!1))},h=function(e){x=e.touches[0].pageX,b=e.touches[0].pageY,m=d?r-b:r-x,y=d?Math.abs(m)t)&&(e.preventDefault(),!p&&n.transitions&&(n.vars.animationLoop||(m/=0===n.currentSlide&&0>m||n.currentSlide===n.last&&m>0?Math.abs(m)/c+2:1),n.setProps(l+m,"setTouch")))},S=function(e){if(t.removeEventListener("touchmove",h,!1),n.animatingTo===n.currentSlide&&!y&&null!==m){var a=u?-m:m,i=a>0?n.getTarget("next"):n.getTarget("prev");n.canAdvance(i)&&(Number(new Date)-f<550&&Math.abs(a)>50||Math.abs(a)>c/2)?n.flexAnimate(i,n.vars.pauseOnAction):p||n.flexAnimate(n.currentSlide,n.vars.pauseOnAction,!0)}t.removeEventListener("touchend",S,!1),r=null,o=null,m=null,l=null},t.addEventListener("touchstart",g,!1))},resize:function(){!n.animating&&n.is(":visible")&&(v||n.doMath(),p?f.smoothHeight():v?(n.slides.width(n.computedW),n.update(n.pagingCount),n.setProps()):d?(n.viewport.height(n.h),n.setProps(n.h,"setTotal")):(n.vars.smoothHeight&&f.smoothHeight(),n.newSlides.width(n.computedW),n.setProps(n.computedW,"setTotal")))},smoothHeight:function(e){if(!d||p){var t=p?n:n.viewport;e?t.animate({height:n.slides.eq(n.animatingTo).innerHeight()},e):t.innerHeight(n.slides.eq(n.animatingTo).innerHeight())}},sync:function(e){var t=$(n.vars.sync).data("flexslider"),a=n.animatingTo;switch(e){case"animate":t.flexAnimate(a,n.vars.pauseOnAction,!1,!0);break;case"play":t.playing||t.asNav||t.play();break;case"pause":t.pause()}},uniqueID:function(e){return e.filter("[id]").add(e.find("[id]")).each(function(){var e=$(this);e.attr("id",e.attr("id")+"_clone")}),e},pauseInvisible:{visProp:null,init:function(){var e=f.pauseInvisible.getHiddenProp();if(e){var t=e.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(t,function(){f.pauseInvisible.isHidden()?n.startTimeout?clearTimeout(n.startTimeout):n.pause():n.started?n.play():n.vars.initDelay>0?setTimeout(n.play,n.vars.initDelay):n.play()})}},isHidden:function(){var e=f.pauseInvisible.getHiddenProp();return e?document[e]:!1},getHiddenProp:function(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;tn.currentSlide?"next":"prev"),m&&1===n.pagingCount&&(n.direction=n.currentItemn.limit&&1!==n.visible?n.limit:S):h=0===n.currentSlide&&e===n.count-1&&n.vars.animationLoop&&"next"!==n.direction?u?(n.count+n.cloneOffset)*c:0:n.currentSlide===n.last&&0===e&&n.vars.animationLoop&&"prev"!==n.direction?u?0:(n.count+1)*c:u?(n.count-1-e+n.cloneOffset)*c:(e+n.cloneOffset)*c,n.setProps(h,"",n.vars.animationSpeed),n.transitions?(n.vars.animationLoop&&n.atEnd||(n.animating=!1,n.currentSlide=n.animatingTo),n.container.unbind("webkitTransitionEnd transitionend"),n.container.bind("webkitTransitionEnd transitionend",function(){clearTimeout(n.ensureAnimationEnd),n.wrapup(c)}),clearTimeout(n.ensureAnimationEnd),n.ensureAnimationEnd=setTimeout(function(){n.wrapup(c)},n.vars.animationSpeed+100)):n.container.animate(n.args,n.vars.animationSpeed,n.vars.easing,function(){n.wrapup(c)})}n.vars.smoothHeight&&f.smoothHeight(n.vars.animationSpeed)}},n.wrapup=function(e){p||v||(0===n.currentSlide&&n.animatingTo===n.last&&n.vars.animationLoop?n.setProps(e,"jumpEnd"):n.currentSlide===n.last&&0===n.animatingTo&&n.vars.animationLoop&&n.setProps(e,"jumpStart")),n.animating=!1,n.currentSlide=n.animatingTo,n.vars.after(n)},n.animateSlides=function(){!n.animating&&e&&n.flexAnimate(n.getTarget("next"))},n.pause=function(){clearInterval(n.animatedSlides),n.animatedSlides=null,n.playing=!1,n.vars.pausePlay&&f.pausePlay.update("play"),n.syncExists&&f.sync("pause")},n.play=function(){n.playing&&clearInterval(n.animatedSlides),n.animatedSlides=n.animatedSlides||setInterval(n.animateSlides,n.vars.slideshowSpeed),n.started=n.playing=!0,n.vars.pausePlay&&f.pausePlay.update("pause"),n.syncExists&&f.sync("play")},n.stop=function(){n.pause(),n.stopped=!0},n.canAdvance=function(e,t){var a=m?n.pagingCount-1:n.last;return t?!0:m&&n.currentItem===n.count-1&&0===e&&"prev"===n.direction?!0:m&&0===n.currentItem&&e===n.pagingCount-1&&"next"!==n.direction?!1:e!==n.currentSlide||m?n.vars.animationLoop?!0:n.atEnd&&0===n.currentSlide&&e===a&&"next"!==n.direction?!1:!n.atEnd||n.currentSlide!==a||0!==e||"next"!==n.direction:!1},n.getTarget=function(e){return n.direction=e,"next"===e?n.currentSlide===n.last?0:n.currentSlide+1:0===n.currentSlide?n.last:n.currentSlide-1},n.setProps=function(e,t,a){var i=function(){var a=e?e:(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo,i=function(){if(v)return"setTouch"===t?e:u&&n.animatingTo===n.last?0:u?n.limit-(n.itemW+n.vars.itemMargin)*n.move*n.animatingTo:n.animatingTo===n.last?n.limit:a;switch(t){case"setTotal":return u?(n.count-1-n.currentSlide+n.cloneOffset)*e:(n.currentSlide+n.cloneOffset)*e;case"setTouch":return u?e:e;case"jumpEnd":return u?e:n.count*e;case"jumpStart":return u?n.count*e:e;default:return e}}();return-1*i+"px"}();n.transitions&&(i=d?"translate3d(0,"+i+",0)":"translate3d("+i+",0,0)",a=void 0!==a?a/1e3+"s":"0s",n.container.css("-"+n.pfx+"-transition-duration",a),n.container.css("transition-duration",a)),n.args[n.prop]=i,(n.transitions||void 0===a)&&n.container.css(n.args),n.container.css("transform",i)},n.setup=function(e){if(p)n.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===e&&(r?n.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+n.vars.animationSpeed/1e3+"s ease",zIndex:1}).eq(n.currentSlide).css({opacity:1,zIndex:2}):0==n.vars.fadeFirstSlide?n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).css({opacity:1}):n.slides.css({opacity:0,display:"block",zIndex:1}).eq(n.currentSlide).css({zIndex:2}).animate({opacity:1},n.vars.animationSpeed,n.vars.easing)),n.vars.smoothHeight&&f.smoothHeight();else{var t,a;"init"===e&&(n.viewport=$('
').css({overflow:"hidden",position:"relative"}).appendTo(n).append(n.container),n.cloneCount=0,n.cloneOffset=0,u&&(a=$.makeArray(n.slides).reverse(),n.slides=$(a),n.container.empty().append(n.slides))),n.vars.animationLoop&&!v&&(n.cloneCount=2,n.cloneOffset=1,"init"!==e&&n.container.find(".clone").remove(),n.container.append(f.uniqueID(n.slides.first().clone().addClass("clone")).attr("aria-hidden","true")).prepend(f.uniqueID(n.slides.last().clone().addClass("clone")).attr("aria-hidden","true"))),n.newSlides=$(n.vars.selector,n),t=u?n.count-1-n.currentSlide+n.cloneOffset:n.currentSlide+n.cloneOffset,d&&!v?(n.container.height(200*(n.count+n.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){n.newSlides.css({display:"block"}),n.doMath(),n.viewport.height(n.h),n.setProps(t*n.h,"init")},"init"===e?100:0)):(n.container.width(200*(n.count+n.cloneCount)+"%"),n.setProps(t*n.computedW,"init"),setTimeout(function(){n.doMath(),n.newSlides.css({width:n.computedW,marginRight:n.computedM,"float":"left",display:"block"}),n.vars.smoothHeight&&f.smoothHeight()},"init"===e?100:0))}v||n.slides.removeClass(i+"active-slide").eq(n.currentSlide).addClass(i+"active-slide"),n.vars.init(n)},n.doMath=function(){var e=n.slides.first(),t=n.vars.itemMargin,a=n.vars.minItems,i=n.vars.maxItems;n.w=void 0===n.viewport?n.width():n.viewport.width(),n.h=e.height(),n.boxPadding=e.outerWidth()-e.width(),v?(n.itemT=n.vars.itemWidth+t,n.itemM=t,n.minW=a?a*n.itemT:n.w,n.maxW=i?i*n.itemT-t:n.w,n.itemW=n.minW>n.w?(n.w-t*(a-1))/a:n.maxWn.w?n.w:n.vars.itemWidth,n.visible=Math.floor(n.w/n.itemW),n.move=n.vars.move>0&&n.vars.moven.w?n.itemW*(n.count-1)+t*(n.count-1):(n.itemW+t)*n.count-n.w-t):(n.itemW=n.w,n.itemM=t,n.pagingCount=n.count,n.last=n.count-1),n.computedW=n.itemW-n.boxPadding,n.computedM=n.itemM},n.update=function(e,t){n.doMath(),v||(en.controlNav.length?f.controlNav.update("add"):("remove"===t&&!v||n.pagingCountn.last&&(n.currentSlide-=1,n.animatingTo-=1),f.controlNav.update("remove",n.last))),n.vars.directionNav&&f.directionNav.update()},n.addSlide=function(e,t){var a=$(e);n.count+=1,n.last=n.count-1,d&&u?void 0!==t?n.slides.eq(n.count-t).after(a):n.container.prepend(a):void 0!==t?n.slides.eq(t).before(a):n.container.append(a),n.update(t,"add"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.added(n)},n.removeSlide=function(e){var t=isNaN(e)?n.slides.index($(e)):e;n.count-=1,n.last=n.count-1,isNaN(e)?$(e,n.slides).remove():d&&u?n.slides.eq(n.last).remove():n.slides.eq(e).remove(),n.doMath(),n.update(t,"remove"),n.slides=$(n.vars.selector+":not(.clone)",n),n.setup(),n.vars.removed(n)},f.init()},$(window).blur(function(t){e=!1}).focus(function(t){e=!0}),$.flexslider.defaults={namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7e3,animationSpeed:600,initDelay:0,randomize:!1,fadeFirstSlide:!0,thumbCaptions:!1,pauseOnAction:!0,pauseOnHover:!1,pauseInvisible:!0,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",customDirectionNav:"",sync:"",asNavFor:"",itemWidth:0,itemMargin:0,minItems:1,maxItems:0,move:0,allowOneSlide:!0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){},init:function(){}},$.fn.flexslider=function(e){if(void 0===e&&(e={}),"object"==typeof e)return this.each(function(){var t=$(this),a=e.selector?e.selector:".slides > li",n=t.find(a);1===n.length&&e.allowOneSlide===!1||0===n.length?(n.fadeIn(400),e.start&&e.start(t)):void 0===t.data("flexslider")&&new $.flexslider(this,e)});var t=$(this).data("flexslider");switch(e){case"play":t.play();break;case"pause":t.pause();break;case"stop":t.stop();break;case"next":t.flexAnimate(t.getTarget("next"),!0);break;case"prev":case"previous":t.flexAnimate(t.getTarget("prev"),!0);break;default:"number"==typeof e&&t.flexAnimate(e,!0)}}}(jQuery);;// END OF /scripts/flexslider/jquery.flexslider-min.js
// STARTS OF /scripts/jQuery/jquery.validate.min.js
/*! jQuery Validation Plugin - v1.11.1 - 3/22/2013\n* https://github.com/jzaefferer/jquery-validation
* Copyright (c) 2013 Jörn Zaefferer; Licensed MIT */(function(t){t.extend(t.fn,{validate:function(e){if(!this.length)return e&&e.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."),void 0;var i=t.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new t.validator(e,this[0]),t.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(e){i.settings.submitHandler&&(i.submitButton=e.target),t(e.target).hasClass("cancel")&&(i.cancelSubmit=!0),void 0!==t(e.target).attr("formnovalidate")&&(i.cancelSubmit=!0)}),this.submit(function(e){function s(){var s;return i.settings.submitHandler?(i.submitButton&&(s=t(" ").attr("name",i.submitButton.name).val(t(i.submitButton).val()).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,e),i.submitButton&&s.remove(),!1):!0}return i.settings.debug&&e.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,s()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):s():(i.focusInvalid(),!1)})),i)},valid:function(){if(t(this[0]).is("form"))return this.validate().form();var e=!0,i=t(this[0].form).validate();return this.each(function(){e=e&&i.element(this)}),e},removeAttrs:function(e){var i={},s=this;return t.each(e.split(/\s/),function(t,e){i[e]=s.attr(e),s.removeAttr(e)}),i},rules:function(e,i){var s=this[0];if(e){var r=t.data(s.form,"validator").settings,n=r.rules,a=t.validator.staticRules(s);switch(e){case"add":t.extend(a,t.validator.normalizeRule(i)),delete a.messages,n[s.name]=a,i.messages&&(r.messages[s.name]=t.extend(r.messages[s.name],i.messages));break;case"remove":if(!i)return delete n[s.name],a;var u={};return t.each(i.split(/\s/),function(t,e){u[e]=a[e],delete a[e]}),u}}var o=t.validator.normalizeRules(t.extend({},t.validator.classRules(s),t.validator.attributeRules(s),t.validator.dataRules(s),t.validator.staticRules(s)),s);if(o.required){var l=o.required;delete o.required,o=t.extend({required:l},o)}return o}}),t.extend(t.expr[":"],{blank:function(e){return!t.trim(""+t(e).val())},filled:function(e){return!!t.trim(""+t(e).val())},unchecked:function(e){return!t(e).prop("checked")}}),t.validator=function(e,i){this.settings=t.extend(!0,{},t.validator.defaults,e),this.currentForm=i,this.init()},t.validator.format=function(e,i){return 1===arguments.length?function(){var i=t.makeArray(arguments);return i.unshift(e),t.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=t.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),t.each(i,function(t,i){e=e.replace(RegExp("\\{"+t+"\\}","g"),function(){return i})}),e)},t.extend(t.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:t([]),errorLabelContainer:t([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(t){this.lastActive=t,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,t,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(t)).hide())},onfocusout:function(t){this.checkable(t)||!(t.name in this.submitted)&&this.optional(t)||this.element(t)},onkeyup:function(t,e){(9!==e.which||""!==this.elementValue(t))&&(t.name in this.submitted||t===this.lastElement)&&this.element(t)},onclick:function(t){t.name in this.submitted?this.element(t):t.parentNode.name in this.submitted&&this.element(t.parentNode)},highlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).addClass(i).removeClass(s):t(e).addClass(i).removeClass(s)},unhighlight:function(e,i,s){"radio"===e.type?this.findByName(e.name).removeClass(i).addClass(s):t(e).removeClass(i).addClass(s)}},setDefaults:function(e){t.extend(t.validator.defaults,e)},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:t.validator.format("Please enter no more than {0} characters."),minlength:t.validator.format("Please enter at least {0} characters."),rangelength:t.validator.format("Please enter a value between {0} and {1} characters long."),range:t.validator.format("Please enter a value between {0} and {1}."),max:t.validator.format("Please enter a value less than or equal to {0}."),min:t.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function e(e){var i=t.data(this[0].form,"validator"),s="on"+e.type.replace(/^validate/,"");i.settings[s]&&i.settings[s].call(i,this[0],e)}this.labelContainer=t(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||t(this.currentForm),this.containers=t(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var i=this.groups={};t.each(this.settings.groups,function(e,s){"string"==typeof s&&(s=s.split(/\s/)),t.each(s,function(t,s){i[s]=e})});var s=this.settings.rules;t.each(s,function(e,i){s[e]=t.validator.normalizeRule(i)}),t(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",e).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",e),this.settings.invalidHandler&&t(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),t.extend(this.submitted,this.errorMap),this.invalid=t.extend({},this.errorMap),this.valid()||t(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var t=0,e=this.currentElements=this.elements();e[t];t++)this.check(e[t]);return this.valid()},element:function(e){e=this.validationTargetFor(this.clean(e)),this.lastElement=e,this.prepareElement(e),this.currentElements=t(e);var i=this.check(e)!==!1;return i?delete this.invalid[e.name]:this.invalid[e.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(e){if(e){t.extend(this.errorMap,e),this.errorList=[];for(var i in e)this.errorList.push({message:e[i],element:this.findByName(i)[0]});this.successList=t.grep(this.successList,function(t){return!(t.name in e)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){t.fn.resetForm&&t(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(t){var e=0;for(var i in t)e++;return e},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{t(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}},findLastActive:function(){var e=this.lastActive;return e&&1===t.grep(this.errorList,function(t){return t.element.name===e.name}).length&&e},elements:function(){var e=this,i={};return t(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&e.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!e.objectLength(t(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(e){return t(e)[0]},errors:function(){var e=this.settings.errorClass.replace(" ",".");return t(this.settings.errorElement+"."+e,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=t([]),this.toHide=t([]),this.currentElements=t([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(t){this.reset(),this.toHide=this.errorsFor(t)},elementValue:function(e){var i=t(e).attr("type"),s=t(e).val();return"radio"===i||"checkbox"===i?t("input[name='"+t(e).attr("name")+"']:checked").val():"string"==typeof s?s.replace(/\r/g,""):s},check:function(e){e=this.validationTargetFor(this.clean(e));var i,s=t(e).rules(),r=!1,n=this.elementValue(e);for(var a in s){var u={method:a,parameters:s[a]};try{if(i=t.validator.methods[a].call(this,n,e,u.parameters),"dependency-mismatch"===i){r=!0;continue}if(r=!1,"pending"===i)return this.toHide=this.toHide.not(this.errorsFor(e)),void 0;if(!i)return this.formatAndAdd(e,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+e.id+", check the '"+u.method+"' method.",o),o}}return r?void 0:(this.objectLength(s)&&this.successList.push(e),!0)},customDataMessage:function(e,i){return t(e).data("msg-"+i.toLowerCase())||e.attributes&&t(e).attr("data-msg-"+i.toLowerCase())},customMessage:function(t,e){var i=this.settings.messages[t];return i&&(i.constructor===String?i:i[e])},findDefined:function(){for(var t=0;arguments.length>t;t++)if(void 0!==arguments[t])return arguments[t];return void 0},defaultMessage:function(e,i){return this.findDefined(this.customMessage(e.name,i),this.customDataMessage(e,i),!this.settings.ignoreTitle&&e.title||void 0,t.validator.messages[i],"Warning: No message defined for "+e.name+" ")},formatAndAdd:function(e,i){var s=this.defaultMessage(e,i.method),r=/\$?\{(\d+)\}/g;"function"==typeof s?s=s.call(this,i.parameters,e):r.test(s)&&(s=t.validator.format(s.replace(r,"{$1}"),i.parameters)),this.errorList.push({message:s,element:e}),this.errorMap[e.name]=s,this.submitted[e.name]=s},addWrapper:function(t){return this.settings.wrapper&&(t=t.add(t.parent(this.settings.wrapper))),t},defaultShowErrors:function(){var t,e;for(t=0;this.errorList[t];t++){var i=this.errorList[t];this.settings.highlight&&this.settings.highlight.call(this,i.element,this.settings.errorClass,this.settings.validClass),this.showLabel(i.element,i.message)}if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(t=0;this.successList[t];t++)this.showLabel(this.successList[t]);if(this.settings.unhighlight)for(t=0,e=this.validElements();e[t];t++)this.settings.unhighlight.call(this,e[t],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 t(this.errorList).map(function(){return this.element})},showLabel:function(e,i){var s=this.errorsFor(e);s.length?(s.removeClass(this.settings.validClass).addClass(this.settings.errorClass),s.html(i)):(s=t("<"+this.settings.errorElement+">").attr("for",this.idOrName(e)).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(s=s.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(s).length||(this.settings.errorPlacement?this.settings.errorPlacement(s,t(e)):s.insertAfter(e))),!i&&this.settings.success&&(s.text(""),"string"==typeof this.settings.success?s.addClass(this.settings.success):this.settings.success(s,e)),this.toShow=this.toShow.add(s)},errorsFor:function(e){var i=this.idOrName(e);return this.errors().filter(function(){return t(this).attr("for")===i})},idOrName:function(t){return this.groups[t.name]||(this.checkable(t)?t.name:t.id||t.name)},validationTargetFor:function(t){return this.checkable(t)&&(t=this.findByName(t.name).not(this.settings.ignore)[0]),t},checkable:function(t){return/radio|checkbox/i.test(t.type)},findByName:function(e){return t(this.currentForm).find("[name='"+e+"']")},getLength:function(e,i){switch(i.nodeName.toLowerCase()){case"select":return t("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return e.length},depend:function(t,e){return this.dependTypes[typeof t]?this.dependTypes[typeof t](t,e):!0},dependTypes:{"boolean":function(t){return t},string:function(e,i){return!!t(e,i.form).length},"function":function(t,e){return t(e)}},optional:function(e){var i=this.elementValue(e);return!t.validator.methods.required.call(this,i,e)&&"dependency-mismatch"},startRequest:function(t){this.pending[t.name]||(this.pendingRequest++,this.pending[t.name]=!0)},stopRequest:function(e,i){this.pendingRequest--,0>this.pendingRequest&&(this.pendingRequest=0),delete this.pending[e.name],i&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(t(this.currentForm).submit(),this.formSubmitted=!1):!i&&0===this.pendingRequest&&this.formSubmitted&&(t(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(e){return t.data(e,"previousValue")||t.data(e,"previousValue",{old:null,valid:!0,message:this.defaultMessage(e,"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(e,i){e.constructor===String?this.classRuleSettings[e]=i:t.extend(this.classRuleSettings,e)},classRules:function(e){var i={},s=t(e).attr("class");return s&&t.each(s.split(" "),function(){this in t.validator.classRuleSettings&&t.extend(i,t.validator.classRuleSettings[this])}),i},attributeRules:function(e){var i={},s=t(e),r=s[0].getAttribute("type");for(var n in t.validator.methods){var a;"required"===n?(a=s.get(0).getAttribute(n),""===a&&(a=!0),a=!!a):a=s.attr(n),/min|max/.test(n)&&(null===r||/number|range|text/.test(r))&&(a=Number(a)),a?i[n]=a:r===n&&"range"!==r&&(i[n]=!0)}return i.maxlength&&/-1|2147483647|524288/.test(i.maxlength)&&delete i.maxlength,i},dataRules:function(e){var i,s,r={},n=t(e);for(i in t.validator.methods)s=n.data("rule-"+i.toLowerCase()),void 0!==s&&(r[i]=s);return r},staticRules:function(e){var i={},s=t.data(e.form,"validator");return s.settings.rules&&(i=t.validator.normalizeRule(s.settings.rules[e.name])||{}),i},normalizeRules:function(e,i){return t.each(e,function(s,r){if(r===!1)return delete e[s],void 0;if(r.param||r.depends){var n=!0;switch(typeof r.depends){case"string":n=!!t(r.depends,i.form).length;break;case"function":n=r.depends.call(i,i)}n?e[s]=void 0!==r.param?r.param:!0:delete e[s]}}),t.each(e,function(s,r){e[s]=t.isFunction(r)?r(i):r}),t.each(["minlength","maxlength"],function(){e[this]&&(e[this]=Number(e[this]))}),t.each(["rangelength","range"],function(){var i;e[this]&&(t.isArray(e[this])?e[this]=[Number(e[this][0]),Number(e[this][1])]:"string"==typeof e[this]&&(i=e[this].split(/[\s,]+/),e[this]=[Number(i[0]),Number(i[1])]))}),t.validator.autoCreateRanges&&(e.min&&e.max&&(e.range=[e.min,e.max],delete e.min,delete e.max),e.minlength&&e.maxlength&&(e.rangelength=[e.minlength,e.maxlength],delete e.minlength,delete e.maxlength)),e},normalizeRule:function(e){if("string"==typeof e){var i={};t.each(e.split(/\s/),function(){i[this]=!0}),e=i}return e},addMethod:function(e,i,s){t.validator.methods[e]=i,t.validator.messages[e]=void 0!==s?s:t.validator.messages[e],3>i.length&&t.validator.addClassRules(e,t.validator.normalizeRule(e))},methods:{required:function(e,i,s){if(!this.depend(s,i))return"dependency-mismatch";if("select"===i.nodeName.toLowerCase()){var r=t(i).val();return r&&r.length>0}return this.checkable(i)?this.getLength(e,i)>0:t.trim(e).length>0},email:function(t,e){return this.optional(e)||/^((([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(t)},url:function(t,e){return this.optional(e)||/^(https?|s?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(t)},date:function(t,e){return this.optional(e)||!/Invalid|NaN/.test(""+new Date(t))},dateISO:function(t,e){return this.optional(e)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(t)},number:function(t,e){return this.optional(e)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(t)},digits:function(t,e){return this.optional(e)||/^\d+$/.test(t)},creditcard:function(t,e){if(this.optional(e))return"dependency-mismatch";if(/[^0-9 \-]+/.test(t))return!1;var i=0,s=0,r=!1;t=t.replace(/\D/g,"");for(var n=t.length-1;n>=0;n--){var a=t.charAt(n);s=parseInt(a,10),r&&(s*=2)>9&&(s-=9),i+=s,r=!r}return 0===i%10},minlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s},maxlength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||s>=r},rangelength:function(e,i,s){var r=t.isArray(e)?e.length:this.getLength(t.trim(e),i);return this.optional(i)||r>=s[0]&&s[1]>=r},min:function(t,e,i){return this.optional(e)||t>=i},max:function(t,e,i){return this.optional(e)||i>=t},range:function(t,e,i){return this.optional(e)||t>=i[0]&&i[1]>=t},equalTo:function(e,i,s){var r=t(s);return this.settings.onfocusout&&r.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){t(i).valid()}),e===r.val()},remote:function(e,i,s){if(this.optional(i))return"dependency-mismatch";var r=this.previousValue(i);if(this.settings.messages[i.name]||(this.settings.messages[i.name]={}),r.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=r.message,s="string"==typeof s&&{url:s}||s,r.old===e)return r.valid;r.old=e;var n=this;this.startRequest(i);var a={};return a[i.name]=e,t.ajax(t.extend(!0,{url:s,mode:"abort",port:"validate"+i.name,dataType:"json",data:a,success:function(s){n.settings.messages[i.name].remote=r.originalMessage;var a=s===!0||"true"===s;if(a){var u=n.formSubmitted;n.prepareElement(i),n.formSubmitted=u,n.successList.push(i),delete n.invalid[i.name],n.showErrors()}else{var o={},l=s||n.defaultMessage(i,"remote");o[i.name]=r.message=t.isFunction(l)?l(e):l,n.invalid[i.name]=!0,n.showErrors(o)}r.valid=a,n.stopRequest(i,a)}},s)),"pending"}}}),t.format=t.validator.format})(jQuery),function(t){var e={};if(t.ajaxPrefilter)t.ajaxPrefilter(function(t,i,s){var r=t.port;"abort"===t.mode&&(e[r]&&e[r].abort(),e[r]=s)});else{var i=t.ajax;t.ajax=function(s){var r=("mode"in s?s:t.ajaxSettings).mode,n=("port"in s?s:t.ajaxSettings).port;return"abort"===r?(e[n]&&e[n].abort(),e[n]=i.apply(this,arguments),e[n]):i.apply(this,arguments)}}}(jQuery),function(t){t.extend(t.fn,{validateDelegate:function(e,i,s){return this.bind(i,function(i){var r=t(i.target);return r.is(e)?s.apply(r,arguments):void 0})}})}(jQuery);
;jQuery.validator.addMethod("CellPhone", function (value, element, params) {
var reg = /^[1][358]\d{9}$/;
return this.optional(element) || reg.test(value.replace(/\s/ig,""));
}, "例13800138000");
jQuery.validator.addMethod("isTel", function (value) {
var tel = /((\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 value ? tel.test(value) : true;
}, "例0757-82345678");
jQuery.validator.addMethod("CkDN", function (value) {
var reg = /^([a-zA-Z0-9\u4e00-\u9fa5][-a-zA-Z0-9\u4e00-\u9fa5]{0,62}(\.[a-zA-Z0-9\u4e00-\u9fa5][-a-zA-Z0-9\u4e00-\u9fa5]{0,62})+\.?)/;
return value ? reg.test(value) : true;
}, "输入域名的域名不正确!");;// END OF /scripts/jQuery/jquery.validate.min.js
// STARTS OF /share/jquery.vticker-min.js
/*
* vertical news ticker
* Tadas Juozapaitis ( kasp3rito@gmail.com )
* http://plugins.jquery.com/project/vTicker
*/
(function (a) { a.fn.vTicker = function (b) { var c = { speed: 700, pause: 4000, showItems: 3, animation: "", mousePause: true, isPaused: false, direction: "up", height: 0 }; var b = a.extend(c, b); moveUp = function (g, d, e) { if (e.isPaused) { return } var f = g.children("ul"); var h = f.children("li:first").clone(true); if (e.height > 0) { d = f.children("li:first").height() } f.animate({ top: "-=" + d + "px" }, e.speed, function () { a(this).children("li:first").remove(); a(this).css("top", "0px") }); if (e.animation == "fade") { f.children("li:first").fadeOut(e.speed); if (e.height == 0) { f.children("li:eq(" + e.showItems + ")").hide().fadeIn(e.speed) } } h.appendTo(f) }; moveDown = function (g, d, e) { if (e.isPaused) { return } var f = g.children("ul"); var h = f.children("li:last").clone(true); if (e.height > 0) { d = f.children("li:first").height() } f.css("top", "-" + d + "px").prepend(h); f.animate({ top: 0 }, e.speed, function () { a(this).children("li:last").remove() }); if (e.animation == "fade") { if (e.height == 0) { f.children("li:eq(" + e.showItems + ")").fadeOut(e.speed) } f.children("li:first").hide().fadeIn(e.speed) } }; return this.each(function () { var f = a(this); var e = 0; f.css({ overflow: "hidden", position: "relative" }).children("ul").css({ position: "absolute", margin: 0, padding: 0 }).children("li").css({ margin: 0, padding: 0 }); if (b.height == 0) { f.children("ul").children("li").each(function () { if (a(this).height() > e) { e = a(this).height() } }); f.children("ul").children("li").each(function () { a(this).height(e) }); f.height(e * b.showItems) } else { f.height(b.height) } var d = setInterval(function () { if (b.direction == "up") { moveUp(f, e, b) } else { moveDown(f, e, b) } }, b.pause); if (b.mousePause) { f.bind("mouseenter", function () { b.isPaused = true }).bind("mouseleave", function () { b.isPaused = false }) } }) } })(jQuery);;// END OF /share/jquery.vticker-min.js
// STARTS OF /share/global.js
function isDomain(str){
if(/^[0-9a-z\.]+[0-9a-z\-0-9a-z]+[\.]+[0-9a-z]+$/.test(str)==false) return false;
else return true;
}
function isEmail(s){
var regx = /\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
return regx.test(s);
}
function isTel(s){
var regx = /^(86\-)?\d{2,4}\-\d{6,10}(\-\d+)?$/;
return regx.test(s);
}
function isMobile(s){
var regx = /^(0)?(1)\d{10}$/;
return regx.test(s);
}
function isPostCode(s){
var regx = /^\d{6}$/;
return regx.test(s);
}
function isChinese(s){
var rxp = /^[\u4e00-\u9fa5]+$/g;
return rxp.test(s);
}
function isPostCode(str)
{
var reg = /^[0-9]{6}$/;
return (reg.test(str));
}
function isNumber(s)
{
var rxp = /^(-|\+)?\d+(\.\d+)?$/;
return rxp.test(s);
}
function isInt(s)
{
var rxp = /^\d+$/
return rxp.test(s);
}
function isIdCard(idCard) {
idCard = trim(idCard.replace(/ /g, "")); //去掉字符串头尾空格
if (idCard.length == 15) {
return isValidityBrithBy15IdCard(idCard); //进行15位身份证的验证
} else if (idCard.length == 18) {
var a_idCard = idCard.split(""); // 得到身份证数组
if (isValidityBrithBy18IdCard(idCard) && isTrueValidateCodeBy18IdCard(a_idCard)) { //进行18位身份证的基本验证和第18位的验证
return true;
} else {
return false;
}
} else {
return false;
}
}
function isValidityBrithBy15IdCard(idCard15) {
var year = idCard15.substring(6, 8);
var month = idCard15.substring(8, 10);
var day = idCard15.substring(10, 12);
var temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
// 对于老身份证中的你年龄则不需考虑千年虫问题而使用getYear()方法
if (temp_date.getYear() != parseFloat(year)
|| temp_date.getMonth() != parseFloat(month) - 1
|| temp_date.getDate() != parseFloat(day)) {
return false;
} else {
return true;
}
}
function isTrueValidateCodeBy18IdCard(a_idCard) {
var Wi = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2, 1]; // 加权因子
var ValideCode = [1, 0, 10, 9, 8, 7, 6, 5, 4, 3, 2]; // 身份证验证位值.10代表X
var sum = 0; // 声明加权求和变量
if (a_idCard[17].toLowerCase() == 'x') {
a_idCard[17] = 10; // 将最后位为x的验证码替换为10方便后续操作
}
for (var i = 0; i < 17; i++) {
sum += Wi[i] * a_idCard[i]; // 加权求和
}
valCodePosition = sum % 11; // 得到验证码所位置
if (a_idCard[17] == ValideCode[valCodePosition]) {
return true;
} else {
return false;
}
}
function isValidityBrithBy18IdCard(idCard18) {
var year = idCard18.substring(6, 10);
var month = idCard18.substring(10, 12);
var day = idCard18.substring(12, 14);
var temp_date = new Date(year, parseFloat(month) - 1, parseFloat(day));
// 这里用getFullYear()获取年份,避免千年虫问题
if (temp_date.getFullYear() != parseFloat(year)
|| temp_date.getMonth() != parseFloat(month) - 1
|| temp_date.getDate() != parseFloat(day)) {
return false;
} else {
return true;
}
}
function trim(str) {
return str.replace(/(^\s*)|(\s*$)/g, "");
}
function GetEvent(){
if(document.all) return window.event;//如果是ie
func = GetEvent.caller;
while(func != null){
var arg0 = func.arguments[0];
if(arg0)
{
if((arg0.constructor == Event || arg0.constructor == MouseEvent) ||(typeof(arg0) == "object" && arg0.preventDefault && arg0.stopPropagation))
{
return arg0;
}
}
func = func.caller;
}
return null;
}
//trim()
String.prototype.trim = function() {
return (this.replace(/^\s+|\s+$/g,""));
}
//ltrim()
String.prototype.ltrim = function() {
return (this.replace(/^\s*/,""));
}
//rtrim()
String.prototype.rtrim = function() {
return (this.replace(/\s*$/,""));
}
//delete html tags
String.prototype.stripTags = function() {
return this.replace(/<\/?[^>]+>/gi, '');
}
function numberCeil(num, digit) {
digit = parseInt(digit);
if (isNaN(digit)) {
digit = 0;
}
if (digit < 0)
throw Exception('digit must be greater or equal than 0');
var scale = 1;
for (var i = 0; i < digit; i++) {
scale *= 10;
}
return Math.ceil(num * scale) / scale;
}
//重载 setTimeout
var _st = window.setTimeout;
window.setTimeoutEx = function(fRef, mDelay)
{
if(typeof(fRef) == 'function')
{
var argu = Array.prototype.slice.call(arguments,2);
var f = (function(){ fRef.apply(null, argu);});
return _st(f, mDelay);
}
return _st(fRef,mDelay);
}
// end of 重载 setTimeout
//重载 setInterval
var _setInterval = window.setInterval;
window.setIntervalEx = function(fRef, mDelay)
{
if(typeof(fRef) == 'function')
{
var argu = Array.prototype.slice.call(arguments,2);
var f = (function(){ fRef.apply(null, argu);});
return _setInterval(f, mDelay);
}
return _setInterval(fRef,mDelay);
}
// end of 重载 setInterval
/*
Cookie 相关函数
*/
function getCookieVal(offset)
{
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1) endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function getCookie(cname)
{
var cookie = {};
var all = document.cookie;
if (all === "") {
return cookie;
}
var list = all.split("; ");
for (var i = 0; i < list.length; i++) {
var temp = list[i];
var pos = temp.indexOf("=");
var name = temp.substring(0, pos);
var value = temp.substring(pos + 1);
try{
value = decodeURIComponent(value);
}catch(ex){
console.log(ex);
}
cookie[name] = value;
}
return cookie[cname];
// var arg = name + "=";
// var alen = arg.length;
// var clen = document.cookie.length;
// var i = 0;
// var cookieArr = document.cookie.split(';'),
// cookieLen = cookieArr.length;
// for(var i; i ').appendTo('head'); });
else $(' ').appendTo('head');
window.addedCss[path] = true;
}
(function ($) {
$.fn.extend({
"addrSelector":function(options){
var defaults = {
loadDefaultAddr: null,
selectAddr: $.noop,
createNewAddr: $.noop,
selectedAddrID: 0,
isShowIdCardNo: false,
isManagePage:false//是不是地址管理页面 by hui
};
var opts = $.extend({}, defaults, options);
return this.each(function () {
if (typeof opts.loadDefaultAddr == 'function') {
$.getJSON('/index.php?c=front/Useraddr&a=GetDefaultAddr', {}, function (json) {
if (!json.success) {
alert(json.msg);
return;
}
opts.loadDefaultAddr(json.addr);
if (json && json.addr && !isNaN(Number(json.addr.ID)) && parseInt(json.addr.ID) > 0) {
opts.selectedAddrID = parseInt(json.addr.ID);
}
});
}
if(opts.isManagePage){
getUserAddrList(opts);
}else{
$(this).off('click.showAddrSelector').on('click.showAddrSelector', function () {
getUserAddrList(opts);
})
}
});
}
});
var getUserAddrList = function(opts){
if ($('#userAddrContent').length == 0) {
$.extend({
selectAddr: function (addr) {
if (typeof opts.selectAddr == 'function')
opts.selectAddr(addr);
},
createNewAddr: function (addr) {
if (typeof opts.createNewAddr == 'function')
opts.createNewAddr(addr);
},
selectedAddrID: opts.selectedAddrID,
isShowIdCardNo: opts.isShowIdCardNo,
isManagePage:opts.isManagePage
});
$.ajax({
type: 'get',
url: '/index.php?c=front/Useraddr',
dataType: 'html',
success: function (msg) {
$(msg).hide().appendTo('body');
$('#userAddrContent').stop().fadeIn();
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.responseText);
}
})
} else {
// $('#userAddrContent .addrList .addr .selectbtn').css('display','none');
// $('#userAddrContent .addrList .addr[addrID=' + $.selectedAddrID + '] .selectbtn').css('display','inline-block');
$('#userAddrContent .addrList .addr .select-status').hide();
$('#userAddrContent .addrList .addr[addrID=' + $.selectedAddrID + '] .select-status').show();
$('#userAddrContent').stop().fadeIn();
}
};
})(window.jQuery);
(function ($) {
$.fn.extend({
"districtSeletor": function (options) {
if (options == 'setValue') {
dataBind(arguments[1] || {}, this);
return this;
} else {
return this.each(function () {
var opts = $.extend({}, defaults, options);
var $this = $(this);
var sHtml = '';
sHtml = ''
sHtml += '中国 其他 ';
sHtml += ' ';
sHtml += ' ';
sHtml += ' ';
$this.html(sHtml).addClass('districtSelector')//.attr('relid=' + relid);
if (opts.showCountry) {
$this.find('.level1').show();
} else {
$this.find('.level1').hide();
}
$this.find('.level1').on('change', function () {
if ($(this).val() == 1) {
$(this).nextAll('select').show();
getNextLevelList(this);
} else {
$(this).nextAll('select').hide();
}
})
$this.find('.level2, .level3').on('change', function () {
getNextLevelList(this);
});
dataBind(opts, $this);
});
}
}
});
var defaults = {
countryID: 1,
provinceID: null,
cityID: null,
districtID: null,
showCountry: 1
};
var getNextLevelList = function (selectElem) {
selectElem = $(selectElem);
var id = parseInt(selectElem.val());
if (isNaN(id)) return;
var level = parseInt(selectElem.attr('level'));
selectElem.nextAll('select').html('--请选择-- ');
if (id <= 0) return;
$.ajax({
type: 'get',
url: '/index.php?c=front/district&a=getChildrenList',
data: { act: 'getChildrenList', id: id },
async: false,
dataType: 'json',
success: function (json) {
if (!json.success) {
alert(json.msg);
return;
}
var targetSelectElem = selectElem.nextAll('.level' + (level + 1));
var list = json.list || [];
for (var i = 0; i < list.length; i++) {
targetSelectElem.append('' + list[i].Name + ' ');
}
if (list.length == 0) {
targetSelectElem.hide();
targetSelectElem.nextAll('.level' + (level + 2)).hide();
targetSelectElem.nextAll('.level' + (level + 3)).hide();
} else {
targetSelectElem.show();
targetSelectElem.nextAll('.level' + (level + 2)).show();
targetSelectElem.nextAll('.level' + (level + 3)).show();
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.responseText);
}
})
};
var dataBind = function (opts, $this) {
if (opts.countryID && parseInt(opts.countryID) > 0) {
$this.find('.level1').val(opts.countryID).change();
} else {
$this.find('.level1').val(-1).change();
}
if (opts.provinceID && parseInt(opts.provinceID) > 0) {
$this.find('.level2').val(opts.provinceID).change();
}
if (opts.cityID && parseInt(opts.cityID) > 0) {
$this.find('.level3').val(opts.cityID).change();
}
if (opts.districtID && parseInt(opts.districtID) > 0) {
$this.find('.level4').val(opts.districtID).change();
}
};
$.fn.districtSeletor.setValue = function (opts) {
dataBind(opts);
}
})(window.jQuery);
// 获取当前页面url参数
if (!window.location.getQueryString) window.location.getQueryString = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return (r[2]); return null;
};// END OF /share/global.js
// STARTS OF /share/JScript.js
$(function () {
if(getCookie("SiteType") == "1"){
$(window).resize(function(e){
if(e.target === window){
showhideNav();
// setTimeout(function(){moduleImageTextHide();},20);
computeFreeModulePosition();
computeJiuGondHeight();
}
});
$(window).load(function(){showhideNav();computeFreeModulePosition();});
// setTimeout(function(){moduleImageTextHide();},20);
}
$(window).load(function(){initHoverAnimate();});
doSomeWhanPreview();
keepFullScreenModules100Width();
//广告
if($("#ChargeTips").height()){
$("body > .ModuleItem").each(function(i,item){ $(item).css("top",parseInt($(item).css("top")) + $("#ChargeTips").height()); });
}
setMobileNav();
matchNavAndFootNavBgColor();
setModuleCls();
NewsList();
TopNewLoad();
BindPagerAction(); //接管模块的分页链接,用ajax请求
SetImageWidth();
setZonePadding();
var $container = $('.masonry-container');
if ($container.length > 0) {
$container.imagesLoaded(function () {
$container.masonry({
columnWidth: '.productItem',
itemSelector: '.productItem'
});
});
}
replaceNewShopUrl(); // 强行改变建站的URL
// 处理积分商城 订单详情页 隐藏加入购物车按钮
if(isJiFenPage() == 1) {
$('.ShopCart').hide();
$('.mobile-joinCar').hide();
console.log($(".join-car").html(),12321321321321);
$(".join-car").remove();
}
});
function isMobileBroswer() {
var sUserAgent = navigator.userAgent.toLowerCase();
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
var bIsMidp = sUserAgent.match(/midp/i) == "midp";
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
var bIsAndroid = sUserAgent.match(/android/i) == "android";
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
var bIsWeixin = sUserAgent.match(/micromessenger/i) == "micromessenger";
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM || bIsWeixin) {
return true;
} else {
return false;
}
}
function setZonePadding(){
if($("#BodyLeftZone").length > 0 && $("#BodyLeftZone").css("display") != "none") $("#BodyMain1Zone,#BodyMain2Zone,#BodyMain3Zone,#BodyMain4Zone").css({"padding-left":"3px"});
else $("#BodyMain1Zone,#BodyMain2Zone,#BodyMain3Zone,#BodyMain4Zone").css({"padding-left":"0px"});
if($("#BodyRightZone").length > 0 && $("#BodyRightZone").css("display") != "none") $("#BodyMain1Zone,#BodyMain2Zone,#BodyMain3Zone,#BodyMain4Zone").css({"padding-right":"3px"});
else $("#BodyMain1Zone,#BodyMain2Zone,#BodyMain3Zone,#BodyMain4Zone").css({"padding-right":"0px"});
if(typeof CanDesign != 'undefined' && CanDesign == "True" && SiteType == "0") setTimeout(setZonePadding,300);
}
function hasAbsoluteObj(){
var flag = false;
if(SiteType == "1"){
$("#BodyHeaderZone,#BodyMain1Zone,#BodyFooterZone").find(".ModuleItem:visible").each(function(i,item){
if($(item).css("position") == "absolute"){
flag = true;
}
});
}
return flag;
}
function isJiFenPage()
{
if($('#isJiFen').val() === '1') {
return 1;
} else {
return 0;
}
}
// 详情页面重新计算区域高度
function computeZoneHeight(zoneElem) {
var oZone = $(zoneElem);
resizeZone(oZone);
if (oZone.find(".ModuleProductDetail, .ModuleNewsDetail, .ModuleDownDetail").length > 0) {
$(zoneElem).find('img').each(function () {
this.onload = function () {
resizeZone(oZone);
}
});
}
if (!oZone.hasClass('ModuleTabsContent')){
setTimeout(function () { resizeZone(zoneElem) }, 500);
setTimeout(function () { resizeZone(zoneElem) }, 1000);
setTimeout(function () { resizeZone(zoneElem) }, 2000);
setTimeout(function () { resizeZone(zoneElem) }, 4000);
}
}
//h5 计算自由模块的横坐标
function zoneHasAbsoluteObj(zone){
var hasAbsolute = false;
$(zone).find(".ModuleItem:visible").each(function(i,item){
if($(item).css("position") == "absolute"){
hasAbsolute = true;
}
});
return hasAbsolute;
}
function computeFreeModulePosition(module){
if(SiteType != "1") return;
window.nodelayimg = true; //H5站混合静态和自由模块时,不能使用图片延时加载,因为图片延时加载会改变页面的高度
if(module){
var m = null;
if(typeof module == 'object') m = $(module);
else m = $('#' + module);
var parent = m.closest("#HeaderZone,#FooterZone,#BodyMain1Zone");
if($(window).width() > 993){
if(m.attr('float') == 'free'){
var helperid = 'freemodulehelper';
var helper = $("#"+helperid);
var left = helper.offset().left + parseInt(m.attr('floatx'));
m.css({'visibility':'visible','display':'block','left':left+"px"});
}
m.parent().find('.ModuleGridContainer').each(function(i,grid){
$(grid).css('min-width',$(grid).css('max-width'));
});
//处理产品列表模块的响应横版PAD的功能
m.parent().find('.productsBox').each(function(i,prolist){
for(var k=1;k<11;k++){$(prolist).removeClass('col-md-'+k);$(prolist).removeClass('col-sm-'+k);$(prolist).removeClass('col-xs-'+k);}
$(prolist).addClass('col-xs-'+$(prolist).attr('pc-col'));
});
computeZoneHeight(parent);
}else{
m.css({'visibility':'hidden','display':'none'});
if(!zoneHasAbsoluteObj(parent)) parent.css("height","auto");
m.parent().find('.ModuleGridContainer').each(function(i,grid){
$(grid).css('min-width','0');
});
}
}else{
var modules = $(".ModuleItem[float=free]");
$.each(modules,function(i,item){
computeFreeModulePosition(item);
});
}
}
function resizeZone(oZone) {
var iZoneHeight = 0;
//var padscale = isPad();
oZone.children('.ModuleItem:visible').each(function () {
iZoneHeight = Math.max(iZoneHeight, $(this).outerHeight(false) + $(this).position().top);
});
oZone.css('height',iZoneHeight);
if(getCookie("SiteType") == "1" && !zoneHasAbsoluteObj(oZone)){
$(oZone).css('height', 'auto');
}
}
//让图片根据上级容器的尺寸自动适应大小
function resizeImage(imgo){
var img = new Image();
img.src = $(imgo).prop('src');
// 按比例缩放,原图小于外框不操作
var bw = $(imgo).parent().width();
var bh = $(imgo).parent().height();
var ow = img.width;
var oh = img.height;
var nw, nh;
if(ow > bw || oh > bh){
if(ow / oh >= bw / bh){
nw = bw;
nh = nw * oh / ow;
}else if(ow / oh < bw / bh){
nh = bh;
nw = nh * ow / oh;
}
}else{
nw = ow;
nh = oh;
}
$(imgo).width(nw);
$(imgo).height(nh);
$(imgo).css({'margin-top': (bh - $(imgo).outerHeight(false)) / 2 + 'px' });
}
function SetImageWidth() {
if (SiteType == "1") {
$("img").each(function () {
if ($(this).closest('.ModuleNewsDetail').length > 0 || $(this).closest('.ModuleJiuGong,.ModuleJiuGongV2').length > 0) return true;
// $(this).css('max-width', '100%');
});
$('.goods-detail-content table').each(function () {
if ($(this).width() > $("#pagebody").width()) {
$(this).css('width', '100%');
}
});
}
$("img").each(function () {
if ($(this).closest('.ModuleNewsDetail').length > 0 || $(this).hasClass('vCodeImg')) return true;
if ($(this).width() > $("#pagebody").width() && $("#pagebody").length > 0) {
var oldh = $(this).height();
var oldw = $(this).width();
try {
var offsetp = $(this).closest(".ModuleItem").offset().left;
var offset = $(this).offset().left;
var offsetx = offset - offsetp;
if (offsetx < 0) offsetx = 0;
} catch (e) { }
var w = parseInt($("#pagebody").width() * 0.95) - offsetx;
var h = parseInt(oldh / (oldw / w));
if(SiteType == 0) $(this).css({ "width": w, "height": h });
}
if ($(this).closest('.PIMG').length == 0) {
$(this).prop("src", $(this).attr("src"));
$(this).on('load', function () {
if ($(this).width > $("#pagebody").width()) {
var oldh = $(this).height();
var oldw = $(this).width();
try {
var offsetp = $(this).closest(".ModuleItem").offset().left;
var offset = $(this).offset().left;
var offsetx = offset - offsetp;
if (offsetx < 0) offsetx = 0;
} catch (e) { }
var w = parseInt($("#pagebody").width() * 0.95) - offsetx;
var h = parseInt(oldh / (oldw / w));
$(this).css({ "width": w, "height": h });
}
});
}
});
}
function showhideNav(){
if($("#MobileFootNav").attr("enable") == 1 && $("#pagebody").width() >= 1200 || $("#MobileFootNav").attr("enable") == 1 && ($("#pagebody").width() >= 975 && $("#pagebody").width() < 1200)){
$('#MobileFootNav,#MobileFootNavRenderElem').hide();
}else if($("#MobileFootNav").attr("enable") == 1 && ($("#pagebody").width() >= 751 && $("#pagebody").width() < 975) || $("#MobileFootNav").attr("enable") == 1 && $("#pagebody").width() < 751){
$('#MobileFootNav,#MobileFootNavRenderElem').show();
}else if($("#MobileFootNav").attr("enable") == 0 && $("#pagebody").width() >= 1200 || $("#MobileFootNav").attr("enable") == 0 && ($("#pagebody").width() >= 975 && $("#pagebody").width() < 1200) || $("#MobileFootNav").attr("enable") == 0 && ($("#pagebody").width() >= 751 && $("#pagebody").width() < 975) || $("#MobileFootNav").attr("enable") == 0 && $("#pagebody").width() < 751){
$('#MobileFootNav,#MobileFootNavRenderElem').hide();
}
if ($("#MobileNav").attr("enable") == 1 && $("#pagebody").width() >= 1200 || $("#MobileNav").attr("enable") == 1 && ($("#pagebody").width() >= 975 && $("#pagebody").width() < 1200)) {
$('#MobileNav,#MobileNavRenderElem,#MobileNavFloatLayer,#MobileNavMask').hide();
$('#pagebody').css("left", "0rem");
$("#MobileFootNav").removeClass("showFloatNav");
} else if($("#MobileNav").attr("enable") == 1 && ($("#pagebody").width() >= 751 && $("#pagebody").width() < 975) || $("#MobileNav").attr("enable") == 1 && $("#pagebody").width() < 740){
$('#MobileNav,#MobileNavRenderElem,#MobileNavFloatLayer,#MobileNavMask').show();
if($("#MobileNav").attr("navnum") == 4 || $("#MobileNav").attr("navnum") == 6 || $("#MobileNav").attr("navnum") == 7){
$('#MobileNavRenderElem').hide();
}else{
$('#MobileNavRenderElem').show();
}
if($("#MobileNavFloatLayer").hasClass("showFloatNav") == false){
$('#pagebody').css("left", "0rem");
$("#MobileFootNav").removeClass("showFloatNav");
}else{
if($("#MobileNav").attr("navnum") == 5){
$('#pagebody').css("left", "6.25rem");
$("#MobileFootNav").addClass("showFloatNav");
}else if($("#MobileNav").attr("navnum") == 1){
$('#pagebody').css("left", "10rem");
$("#MobileFootNav").addClass("showFloatNav");
}
}
} else if($("#MobileNav").attr("enable") == 0 && $("#pagebody").width() > 1200 || $("#MobileNav").attr("enable") == 0 && ($("#pagebody").width() >= 975 && $("#pagebody").width() < 1200) || $("#MobileNav").attr("enable") == 0 && ($("#pagebody").width() >= 751 && $("#pagebody").width() < 975) || $("#MobileNav").attr("enable") == 0 && $("#pagebody").width() < 740){
$('#MobileNav,#MobileNavRenderElem,#MobileNavFloatLayer,#MobileNavMask').hide();
}
if($('#MobileNav').attr('navnum') == 4){
if($("#pagebody").width() < 740){
$('#MobileNavFloatLayer').css("left","18.9%")
}else if($("#pagebody").width() > 500 && $("#pagebody").width() <= 751){
$('#MobileNavFloatLayer').css("left","13%")
}else if($("#pagebody").width() > 751 && $("#pagebody").width() <= 975){
$('#MobileNavFloatLayer').css("left","11.5%")
}else{
$('#MobileNavFloatLayer').css("left","8%")
}
}
if($("#pagebody").width() > 768){
$(".FootNavMask,.FootNavQRCodeImg,.QQList").hide();
$(".goods-btn").show();
}else{
$(".FootNavMask,.FootNavQRCodeImg,.QQList").show();
$(".goods-btn").hide();
}
if($("#MobileFootNav").length > 0){
if($("#MobileFootNav").is(":hidden")){
$('#pagebody').css('padding-bottom',"0")
}else{
$('#pagebody').css('padding-bottom',$("#MobileFootNav").height());
}
}
$(".FootNavQRCodeImg").css({
"width": "192px",
"height": "192px",
"top": "initial",
"bottom": $('#MobileFootNav').innerHeight(),
"left": ($('body').outerWidth() / 2 - $(".FootNavQRCodeImg").outerWidth() / 2)
});
}
function TopNewLoad() {
$(".TopNews").each(function () {
var repNum = Number($(this).attr("lang"));
var iWidth = ($(this).width() / repNum) - (repNum * 10); //($(this).find("li").width() / repNum) - (repNum * 10);
$(this).find("li>span").css({ "width": iWidth + "px", "margin-right": "8px" });
$(this).find("li").each(function () {
if ($(this).children("span").toArray().length > 1) {
$(this).children("span").last().css({ "margin-right": "0px", "float": "right" });
}
});
});
}
function NewsList() {
$(".BodyCenterNews").each(function () {
var repNum = parseInt($(this).attr("RepeatNum")) > 0 ? parseInt($(this).attr("RepeatNum")) : 1;
var iWidth = ($(this).find("li").width() / repNum) - (repNum * 9);
$(this).find("i").css({ /*"width": iWidth + "px",*/"margin-right": "5px", "overflow": "hidden" });
$(this).find("li").each(function () {
if ($(this).children("i").length > 1) {
$(this).children("i").last().css({ "margin-right": "0px", "float": "right" });
}
});
if ($(this).attr("value") !== "") {
var itemHeight = $(this).find(".vTicker").find("li").height();
var iHeight = $(this).find(".vTicker>ul").height();
var showItems = parseInt(iHeight / itemHeight);
$(this).find(".vTicker").vTicker({
speed: 500,
pause: 3000,
direction: $(this).attr("value"),
mousePause: true,
showItems: showItems
}).css({ "height": iHeight + "px" }).find("li").css({ "padding": "0 5px" });
}
});
}
function ProductList() {
$(".ModuleProductList").each(function () {
if ($(this).find(".myslider").attr("value") !== "") {
$(this).find(".myslider").easySlider({
auto: true,
continuous: true,
vertical: false,
controlsShow: false
});
}
});
}
function SetProductListImage(module,sitetype) {
if(typeof(module) != "object") module = $('#module_' + module);
module.find('.PIMG>img').each(function () {
var src = $(this).attr("src");
$(this).attr("src", '');
$(this).on('load', function () { resizeProductListImageSize(this); });
$(this).attr("src", src);
});
initProductListEffect(module, sitetype);
}
function resizeProductListImageSize(img) {
$(img).css({'width':'auto','height':'auto'}); //先清除图片的高宽
var picWrapper = $(img).closest('.PicWrapper');
var imgParent = $(img).parent();
var imgp_pl = parseFloat(imgParent.css('padding-left') ? imgParent.css('padding-left') : 0);
var imgp_pr = parseFloat(imgParent.css('padding-right') ? imgParent.css('padding-right') : 0);
var imgp_pt = parseFloat(imgParent.css('padding-top') ? imgParent.css('padding-top') : 0);
var imgp_pb = parseFloat(imgParent.css('padding-bottom') ? imgParent.css('padding-bottom') : 0);
var imgp_bl = parseFloat(imgParent.css('border-left') ? imgParent.css('border-left') : 0);
var imgp_br = parseFloat(imgParent.css('border-right') ? imgParent.css('border-right') : 0);
var imgp_bt = parseFloat(imgParent.css('border-top') ? imgParent.css('border-top') : 0);
var imgp_bb = parseFloat(imgParent.css('border-bottom') ? imgParent.css('border-bottom') : 0);
var bw = picWrapper.innerWidth() - imgp_pl - imgp_pr - imgp_bl - imgp_br;
var bh = picWrapper.innerHeight() - imgp_pt - imgp_pb - imgp_bt - imgp_bb;
var ow = img.width;
var oh = img.height;
var nw, nh;
if (ow > bw || oh > bh) {
if (ow / oh >= bw / bh) {
nw = bw;
nh = nw * oh / ow;
} else if (ow / oh < bw / bh) {
nh = bh;
nw = nh * ow / oh;
}
} else {
nw = ow;
nh = oh;
}
$(img).css({
width: nw + 'px',
height: nh + 'px'
});
$(img).css({ 'margin-top': (bh - $(img).outerHeight(false)) / 2 + 'px' });
if ($(img).parent().css('text-align').toLowerCase() != 'center') {
$(img).css({ 'margin-left': (bw - $(img).outerWidth(false)) / 2 + 'px' });
}
}
function initProductListEffect(module, sitetype) {
if(typeof(module) != "object") module = $('#module_' + module);
var oProductList = $(module).find('.ProductList');
var showstyle = oProductList.attr('showstyle');
var direction = oProductList.attr('direction');
var countPerGroup = oProductList.attr('repeatnum');
if(CanDesign == "True" && showstyle > 0){
module.resize(function(){ if(module.css("position") != 'absolute') oProductList.parent().css({'position': 'relative',overflow: 'hidden','width':module.width()+"px"});});
}
if (sitetype == 1) {
// 修复手机下,描述文字不确定导致".PDetail"高度不齐的的bug
if(!module.attr("haschangedetail")){
iRepeatnum = parseFloat(oProductList.attr('repeatnum'));
if (iRepeatnum == 0 || showstyle == 1 || showstyle == 2) {
var iMaxHeight = 0;
module.find('.PDetail').each(function () {
iMaxHeight = Math.max(iMaxHeight, $(this).height());
})
module.find('.PDetail').css('height', iMaxHeight);
} else {
var iTotalLine = Math.ceil(module.find('.PDetail').length / iRepeatnum);
var oPDetails = module.find('.PDetail');
for (var i = 0; i < iTotalLine; i++) {
var iMaxHeight = 0;
oPDetails.each(function (j) {
if (i * iRepeatnum <= j && j < (i + 1) * iRepeatnum) {
iMaxHeight = Math.max(iMaxHeight, $(this).height());
}
})
oPDetails.slice(i * iRepeatnum, (i + 1) * iRepeatnum).css('height', iMaxHeight);
}
}
module.attr("haschangedetail","1");
}
}
if (window['effectInterval_' + module.attr('id')]) {
clearInterval(window['effectInterval_' + module.attr('id')]);
}
if (module.length > 0) {
if (showstyle == 1) { // 连续滚动
var oProductBoxes = oProductList.children('.ProductBox').css({ float: 'left' });
if (sitetype == 1) {
oProductList.find('center').css('display', 'inline-block');
// 手机实际width通常是带小数的,但jquery所有方法返回宽度都是向下取的整数,所以为了计算准确,+1px
oProductBoxes.css({ width: 'auto' }).css({ width: oProductBoxes.width() + 1 });
}
var listWidth = module.width();
oProductList.parent().css({'position': 'relative',overflow: 'hidden','width':module.width()+"px"});
var iWidth = oProductBoxes.outerWidth(true) * oProductBoxes.length * 2;
var iHeight = oProductBoxes.outerHeight(true);
oProductList.css({ position: 'relative', left: '0px', width: iWidth + 'px', height: iHeight + 'px', overflow: 'hidden' });
if (module.width() > iWidth) return;
if(module.attr('hasinit')!=1){
oProductList.append(oProductList.clone(true).children());
module.attr('hasinit',1);
};
var iRefreshInterval = 40;
var iStep = 1;
if(window['effectInterval_' + module.attr('id')]){
clearInterval(window['effectInterval_' + module.attr('id')])
}
window['effectInterval_' + module.attr('id')] = setInterval(function () {
if (oProductList.attr('ishovering') == 1 && oProductList.attr('hoverstop') == 1) {
return;
}
if (direction == 'left') {
if (oProductList.position().left <= -oProductList.innerWidth() / 2) {
oProductList.css('left', (oProductList.position().left + oProductList.innerWidth() / 2) + 'px');
}
oProductList.css('left', (oProductList.position().left - parseInt(oProductList.parent().css('padding-left')) - iStep) + 'px');
} else {
if (oProductList.position().left >= 0) {
oProductList.css('left', (-oProductList.innerWidth() / 2) + 'px');
}
oProductList.css('left', (oProductList.position().left - parseInt(oProductList.parent().css('padding-left')) + iStep) + 'px');
}
}, iRefreshInterval);
} else if (showstyle == 2) { // 一屏屏滚动
var oProductBoxes = module.find('.ProductBox');
var iGroupCount = Math.ceil(oProductBoxes.length / countPerGroup);
for (var i = 0; i < iGroupCount; i++) {
$(oProductBoxes.slice(i * countPerGroup, i * countPerGroup + countPerGroup)).wrapAll('
');
}
if (sitetype == 1) {
oProductBoxes.css({ width: 'auto', height: 'auto', padding: '2px' });
}
oProductList.parent().css({'position': 'relative',overflow: 'hidden','width':module.width()+"px"});
var oProductGroups = module.find('.ProductGroup');
if(!oProductGroups.parent().is('.ProductGroupList')){
oProductGroups.wrapAll('
');
}
var oProductGroupList = module.find('.ProductGroupList');
if(module.css("position") != "absolute"){ iHeight = $(oProductBoxes[0]).height();}
oProductGroupList.css({ position: 'relative', top: '0px', width: module.innerWidth() * iGroupCount + 'px', overflow: 'hidden' });
oProductGroups.css({ float: 'left', width: module.innerWidth() + 'px', height: module.innerHeight() + 'px' });
if (iGroupCount <= 1) {
return;
}
if (direction == 'left') {
oProductGroupList.css({ left: '0px', right: 'auto' });
} else {
for (var i = 0 ; i < iGroupCount; i++) {
oProductGroups = module.find('.ProductGroup');
oProductGroups.eq(-1).insertBefore(oProductGroups.eq(i));
}
oProductGroupList.css({ left: 'auto', right: module.innerWidth() * (iGroupCount - 1) + 'px' });
}
module.find('.PDetail').css('width', module.find('.PicWrapper').width());
window['effectInterval_' + module.attr('id')] = setInterval(function () {
if (module.find('.ProductList').attr('ishovering') == 1 && module.find('.ProductList').attr('hoverstop') == 1) {
return;
}
var oProductGroupList = module.find('.ProductGroupList');
var oProductGroups = module.find('.ProductGroup');
if (direction == 'left') {
oProductGroupList.animate({
left: '-=' + oProductGroups.outerWidth(true) + 'px'
}, 1000, function () {
oProductGroups.eq(0).insertAfter(oProductGroups.eq(-1));
oProductGroupList.css('left', 0);
});
} else {
oProductGroupList.animate({
right: '-=' + oProductGroups.outerWidth(true) + 'px'
}, 1000, function () {
oProductGroups.eq(-1).insertBefore(oProductGroups.eq(0));
oProductGroupList.css('right', oProductGroups.outerWidth(true) * (iGroupCount - 1) + 'px');
});
}
}, 6000);
}
}
}
function showShopModal(productid, e, productShowType){
e = e || window.event;
e.stopPropagation && e.stopPropagation();
e.preventDefault && e.preventDefault();
e.cancelBubble = true;
if (!productid){
return false;
}
if(typeof productShowType == 'undefined'){
productShowType = 0;
}
var productSkus = [];
$.ajax({
url: '/index.php?c=Front/ProductData',
type: 'get',
data: { id: productid, productShowType: productShowType },
dataType: 'json',
async: false,
cache: false,
success: function (json) {
if (!json) {
alert('无此商品');
return;
}
var lg = json.lg;//多语言
var windowWidth = $(window).width();
productShowType = json.productShowType;
productSkus = json.productSkus || [];
var html = '';
html += '';
var dialog = bootbox.dialog({
title: lg.quick_purchase,
message: html,
show: false,
className: 'shopCartModal',
buttons: {}
}).on('shown.bs.modal', function (){
$('.pro_appeal').height($('.pro_appeal').width());
}).on('hidden.bs.modal',function(){
$('.swiper-container').each(function(){
$(this)[0].swiper.startAutoplay();
});
}).modal('show');
var surplus = parseInt(json.surplus);
if(isNaN(surplus) || surplus == 0){
$('.shopCartModal .Shtml').hide();
}else{
$('.shopCartModal .Shtml').show();
}
function checkValid() {
if (!/^\d+$/.test($('#ShopModalProNum').val() + '')) {
alert(lg.file_in_quantity);
return;
}
var enableInventory = $('.shopCartModal [name=enableInventory]').val();
if (enableInventory) {
var productQuantity = parseInt($('.shopCartModal .productQuantity').attr('productQuantity'));
if (!isNaN(productQuantity) && parseInt($('#ShopModalProNum').val()) > productQuantity) {
alert(lg.not_exceed_stock);
return false;
}
}
if(productSkus.length > 0 && !$('.shopCartModal [name="skuid"]').val()){
alert(lg.select_spec);
return false;
}
return true;
}
$('.shopCartModal .pro_amount').disableSelection();
$('.shopCartModal .sys_spec_text>li').off().on('click', function () {
if($(this).hasClass('outOfStock')){
return;
}
if($(this).hasClass('selected')){
$(this).removeClass('selected');
}else{
var attrkeyid = $(this).attr('attrkeyid');
$('[attrkeyid=' + attrkeyid +']').not(this).removeClass('selected');
$(this).addClass('selected');
}
var attrkeycount = $('.shopCartModal .sys_spec_text').length;
var attrvalselectedcount = $('.shopCartModal .sys_spec_text>li.selected').length;
if(attrkeycount - attrvalselectedcount == 1 || attrkeycount == attrvalselectedcount){
$('.shopCartModal .sys_spec_text>li').removeClass('outOfStock');
var elemAttrVals = $('.shopCartModal .sys_spec_text>li').not('.selected');
elemAttrVals.each(function(){
var path = '';
var elemAttrValInOtherKeys = $('.shopCartModal .sys_spec_text').not($(this).closest('.shopCartModal .sys_spec_text')).find('li.selected');
elemAttrValInOtherKeys.each(function(){
path += $(this).attr('attrvalid') + ',';
});
path += $(this).attr('attrvalid');
path = path.split(',').sort().join(',');
for(var i = 0; i < productSkus.length; i++){
var sku = productSkus[i];
var skuPath = (sku.Path || '').split(',').sort().join(',');
if(skuPath == path){
if(sku.ProductQuantity <= 0){
$(this).addClass('outOfStock');
}else{
$(this).removeClass('outOfStock');
}
break;
}
}
});
}else{
$('.shopCartModal .sys_spec_text>li').removeClass('outOfStock');
}
if(attrkeycount == attrvalselectedcount){
var attrkeyid = $(this).attr('attrkeyid');
$('[attrkeyid=' + attrkeyid +']').not(this).removeClass('selected');
$(this).addClass('selected');
var path = '';
$('.shopCartModal .sys_spec_text>li.selected').each(function(){
path += $(this).attr('attrvalid') + ',';
});
path = path.replace(/(^,)|(,$)/g, '');
path = path.split(',').sort().join(',');
var price = 0;
var point =0;
var skuid = 0;
var surplus=0;
var productQuantity = 0;
for(var i = 0; i < productSkus.length; i++){
if(path == productSkus[i].Path.split(',').sort().join(',')){
point = productSkus[i].Jf_convert;
price = productSkus[i].Price;
skuid = productSkus[i].SkuID;
surplus = productSkus[i].surplus;
productQuantity = productSkus[i].ProductQuantity;
break;
}
}
var priceHtml = '';
if(productShowType == 1){
point = parseFloat(point).toFixed(2);
surplus = parseFloat(surplus).toFixed(2);
$('.shopCartModal .price').text(point).data('singlePrice', price);
$(".shopCartModal .Shtml").attr('surplus', surplus).html(lg.pay_extra+'¥'+surplus);
var surplus = parseInt(json.surplus);
if(isNaN(surplus) || surplus == 0){
$('.shopCartModal .Shtml').hide();
}else{
$('.shopCartModal .Shtml').show();
}
priceHtml = point;
}else{
price = parseFloat(price).toFixed(2);
$('.shopCartModal .price').text('¥' + price).data('singlePrice', price);
}
$(".shopCartModal input[name=skuid]").val(skuid);
$('.shopCartModal .productQuantity').text(productQuantity).attr('productQuantity', productQuantity);
}else{
var minVal = -1, maxVal = 0, productQuantity = 0;
for(var i = 0; i < productSkus.length; i++){
var val = 0;
if(productShowType == 1){
val = parseFloat(productSkus[i].Jf_convert);
}else{
val = parseFloat(productSkus[i].Price);
}
minVal = minVal == -1 ? val : Math.min(minVal, val);
maxVal = maxVal == -1 ? val : Math.max(maxVal, val);
productQuantity += parseInt(productSkus[i].ProductQuantity);
}
var pHtml = minVal.toFixed(2);
if(minVal != maxVal){
pHtml = minVal.toFixed(2) + ' - ' + maxVal.toFixed(2);
}
if(productShowType != 1){
pHtml = '¥' + pHtml;
}
$(".shopCartModal .Shtml").hide();
$('.shopCartModal .price').text(pHtml);//.data('singlePrice', price);
$(".shopCartModal input[name=skuid]").val(skuid);
$('.shopCartModal .productQuantity').text(productQuantity).attr('productQuantity', productQuantity);
}
});
$('.shopCartModal .sys_spec_text>li:nth-child(1)').each(function () {
$(this).click();
});
$(".shopCartModal .reduce").off().on('click', function () {
var num = parseInt($("#ShopModalProNum").val());
if (num == 1) return;
else $("#ShopModalProNum").val(num - 1);
var price = $('.shopCartModal .price').data('singlePrice');
//$('.shopCartModal .price').text('¥' + ((parseFloat(price) * (num - 1))).toFixed(2));
});
$(".shopCartModal .add").off().on('click', function () {
var num = parseInt($("#ShopModalProNum").val());
$("#ShopModalProNum").val(num + 1);
var price = $('.shopCartModal .price').data('singlePrice');
//$('.shopCartModal .price').text('¥' + ((parseFloat(price) * (num + 1))).toFixed(2));
});
$(".shopCartModal #ShopModalProNum").off().on('change', function () {
var num = parseInt($("#ShopModalProNum").val());
var price = $('.shopCartModal .price').data('singlePrice');
//$('.shopCartModal .price').text('¥' + ((parseFloat(price) * num)).toFixed(2));
});
if (json.isSingleNorm) {
$('.shopCartModal .price').data('singlePrice', json.price);
}
/*
$('.shopCartModal .Buy').off().on('click',function(){
if (!checkValid()) return false;
$("form[name=ShopModalForm]").submit();
bootbox.hideAll();
});
*/
$('.shopCartModal .ShopCart,.shopCartModal .Buy').off().on('click',function(){
var islocation = $(this).attr('islocation');
var skuid = $("form[name=ShopModalForm]").find("input[name=skuid]").val();
var num = $("form[name=ShopModalForm]").find("input[name=Num]").val();
if (!checkValid()) return false;
$('.add-cart-result').remove();
var hintHtml = '';
$(hintHtml).appendTo('body');
$(".add-cart-result").find(".close").unbind('click').click(function () {
$(".add-cart-result").hide();
return false;
});
// console.log(window.location.host);
var url = '/index.php?c=front/Productorder&a=AddToCart&Action=Add&ProductID=' + productid + '&skuid=' + skuid + '&Num=' + num ;
var backurl = '/index.php?c=front/Productorder&Action=Add&ProductID=' + productid + '&skuid=' + skuid + '&Num=' + num;
// 新底层更改加入购物车
var params1 = "&productId=" + productid + "&skuId=" + skuid + "&count=" + num + '&isJiFen=' + isJiFenPage();
var url = "/index.php?c=Api/shop/Cart&a=addToCart&" + params1;
// 新底层更改立即购物
var buyImmediately = getUrlParam('72e') == '72e' ? backurl : "/jumpUrl=buyImmediately/productId=" + productid + '&skuId=' + skuid + '&amount=' + num + '&isJiFen=' + $(this).attr('isJiFenPage');
if (islocation == 1) {
location.href = buyImmediately;
return;
}
$.get(url, null, function (data, textStatus, jqXHR) {
if(data.redirectUrl){
location.href = data.redirectUrl;
return;
}
// if (data.success) {
if (data.code == 200) {
bootbox.hideAll();
//立即购买会跳转
if(islocation == 1){
location.href = backurl;
return;
}
$(".add-cart-result").css({
opacity: 1,
top: ($(window).height() - $(".add-cart-result").outerHeight()) / 2 + $(window).scrollTop() + 'px',
left: ($(window).width() - $(".add-cart-result").outerWidth()) / 2 + 'px',
position: 'absolute',
width: 'auto',
height: 'auto'
});
$("#cartnum").html("(" + data.productnum + ")");
$(".add-cart-result").slideToggle(300);
setTimeout(function () {
$(".add-cart-result").find(".close").click();
}, 2000);
if($('.footNavShopCartNum').length > 0){
//取出购物车数量显示
//getShopCartNum(function(num){
// $('.footNavShopCartNum').text(num);
//});
}
} else {
//没有登录的话直接跳到登录页面
if(data.isLogin == '0'){
location.href = '/index.php?c=front/Userlogin&a=GoLogin&BackUrl=' + escape(backurl);
return;
}
if(data.redirectUrl){
location.href = data.redirectUrl;
return;
}else{
alert(data.msg);
}
}
}, "json");
});
$('.shopCartModal .ViewCart').off().on('click',function(){
location = '/productorder';
});
},
error: function () {
alert('error');
}
});
}
function sortProductList(obj,moduleID,pageLink){
if($(obj).hasClass('selected') && !$(obj).hasClass('sort')) return;
var url = pageLink.replace("{PageNo}", 1);
var orderBy = $(obj).attr('value') || '';
var orderByStr = '&orderby=' + orderBy;
var sortByStr = "";
if($.inArray(orderBy, ['price','lastest']) > -1){
sortByStr = '&sortby=' + ($(obj).hasClass('descent') ? 0 : 1);
}
var newUrl = '/index.php?c=front/LoadModulePageData&' + url.substring(url.indexOf("?") + 1) + orderByStr + sortByStr;
$.ajax({
url: newUrl, async: true, dataType: "text/html", complete: function (request, status, error) {
$("#module_" + moduleID).replaceWith(request.responseText);
BindPagerAction();
}
});
}
function checkBowerTip(){
var $checkbower = $(''+
'
当前浏览器版本过低,影响整体的访问体验.建议升级到IE9以上版本,或者下载360浏览器 ,谷歌浏览器 等 '+
'
'+
'
');
$('body').prepend($checkbower);
$checkbower.width(window.innerWidth);
$checkbower.find('img').eq(0).click(function() {$checkbower.addClass('hidden');});
if($checkbower.width() < 400)$checkbower.css({'font-size':'12px','padding':'5px 0','text-align':'left'}).find('span').eq(0).css('padding-right','10px')
}
function filterProductList_Pc(obj1,obj2,moduleID,pageLink){
var url = pageLink.replace("{PageNo}", 1);
var params = '';
var filterid2 = $(obj2).attr('filterid');
var valueid2 = $(obj2).attr('valueid');
$(obj1).find('li').each(function(index,element){
var valueid = $(element).attr('valueid');
var filterid = $(element).attr('filterid');
if(filterid2 != filterid)
params += valueid + ',';
});
if($(obj2).hasClass('selected-light')){
params += valueid2 + ',';
}
var match = url.match(/filtervalue=([,]?\d+[,]?)+/);
if (match && match.length > 1){
url = url.replace(/filtervalue=([,]?\d+[,]?)+/,'filtervalue='+params);
}else{
url += '&filtervalue='+params;
}
var newUrl = '/index.php?c=front/LoadModulePageData&' + url.substring(url.indexOf("?") + 1);
$.ajax({
url: newUrl, async: true, dataType: "text/html", complete: function (request, status, error) {
//if(window.innerWidth > 992){
// //debugger
// //$("#module_" + moduleID +" .productListOrderCtrlTab").hide();
// //$("#module_" + moduleID +" .pro-container").replaceWith(request.responseText);
// $("#module_" + moduleID +" .pro-container").replaceWith(request.responseText);
// //$("#module_" + moduleID).replaceWith(request.responseText);
//}
//else{
//
//}
// $("#module_" + moduleID +" .pro-container").replaceWith(request.responseText);
$("#module_" + moduleID).replaceWith(request.responseText);
BindPagerAction();
}
});
}
function filterProductList_Mobile(obj,moduleID,pageLink){
var url = pageLink.replace("{PageNo}", 1);
var params = '';
$(obj).find('li.items-active').each(function(index,element){
var valueid = $(element).attr('valueid');
var filterid = $(element).attr('filterid');
params += valueid + ',';
});
var match = url.match(/filtervalue=([,]?\d+[,]?)+/);
if (match && match.length > 1){
url = url.replace(/filtervalue=([,]?\d+[,]?)+/,'filtervalue='+params);
}else{
url += '&filtervalue='+params;
}
loadingText = getLang('loading') + '...';
var pageLoadingHtml = '';
pageLoadingHtml += '
';
pageLoadingHtml += ' ';
//pageLoadingHtml += '' + loadingText + ' ';
pageLoadingHtml += '
';
pageLoadingHtml += '
';
$("#module_" + moduleID).children().append(pageLoadingHtml);
//debugger
var newUrl = '/index.php?c=front/LoadModulePageData&' + url.substring(url.indexOf("?") + 1);
$.ajax({
url: newUrl, async: true, dataType: "text/html", complete: function (request, status, error) {
$("#module_" + moduleID).replaceWith(request.responseText);
$("#module_" + moduleID).find('.PageLoading').remove();
BindPagerAction();
}
});
}
// 初始化产品展示的瀑布流
function initProductListMasonry(moduleid){
var $container = $('#module_' + moduleid + ' .masonry-container');
if ($container.length > 0) {
$container.imagesLoaded(function () {
$container.masonry({
columnWidth: '.productItem',
itemSelector: '.productItem'
});
});
}
}
// 初始化产品展示
function initProductList(options){
if(typeof options.ModuleID == 'undefined' || typeof options.ShowStyle == 'undefined') return;
var moduleid = parseInt(options.ModuleID);
var showStyle = parseInt(options.ShowStyle);
$(window).off('resize.productlistImgSizeType' + moduleid);
$(window).off('resize.initProductListSlide' + moduleid);
// 初始化瀑布流
if(showStyle == 13){
initProductListMasonry(moduleid);
}
// 设置产品展示图片,确保比例
var imgSizeType = options.ImgSizeType;
setProductListImg(moduleid, showStyle, imgSizeType);
// 是否显示滚动
var isScroll = options.IsScroll;
if(options.IsScroll == 1 && showStyle != 13){
var direction = options.Direction;
$('#module_' + moduleid + ' .ModuleProductList .proMore').remove();
$('#module_' + moduleid + ' .ModuleProductList').addClass('swiper-container');
if(direction == 'right'){
$('#module_' + moduleid + ' .ModuleProductList').attr('dir',"rtl");
}
$('#module_' + moduleid + ' .ModuleProductList .ProductList').addClass('swiper-wrapper').css('overflow','visible');
$('#module_' + moduleid + ' .ModuleProductList .ProductList .productsBox').addClass('swiper-slide');
var btnPrevNext = '
';
$('#module_' + moduleid + ' .ModuleProductList').after(btnPrevNext);
var slidePerGroup = calProductListSlidePerGroup(moduleid);
var mySwiper = new Swiper('#module_' + moduleid + ' .swiper-container', {
autoplay: 5000,
speed: 1000,
slidesPerView:slidePerGroup,
slidesPerGroup:slidePerGroup,
// loopedSlides:slidePerGroup,
loopAdditionalSlides:slidePerGroup,
spaceBetween:0,
autoplayDisableOnInteraction:false,
// prevButton: '#module_' + moduleid + (direction == 'left' ? ' .btnNext' : ' .btnPrev'),
// nextButton: '#module_' + moduleid + (direction == 'left' ? ' .btnPrev' : ' .btnNext'),
loop:true
});
$(window).off('resize.initProductListSlide' + moduleid).on('resize.initProductListSlide' + moduleid, function(){
var slidePerGroup = calProductListSlidePerGroup(moduleid);
mySwiper.params.slidesPerGroup = slidePerGroup;
mySwiper.params.slidesPerView = slidePerGroup;
mySwiper.params.loopedSlides = slidePerGroup;
mySwiper.updateSlidesSize();
mySwiper.updateContainerSize();
setProductListImg(moduleid, showStyle, imgSizeType);
});
$('#module_' + moduleid + ' .btnPrev').off().on('click', function(){
mySwiper.animating = false;
direction == 'left' ? mySwiper.slideNext() : mySwiper.slidePrev();
}).disableSelection();
$('#module_' + moduleid + ' .btnNext').off().on('click', function(){
mySwiper.animating = false;
direction == 'left' ? mySwiper.slidePrev() : mySwiper.slideNext();
}).disableSelection();
}else{
$(window).off('resize.initProductListSlide' + moduleid);
}
if($.inArray(showStyle,[11,12,13,14,15,16]) > -1){
var productShowType = options.ProductShowType;
// 购买按钮点击,弹出框
var event = 'touchend.pro_join' + moduleid +' click.pro_join' + moduleid;
$(document).off(event).on(event, '#module_' + moduleid + ' .pro_join, #module_' + moduleid + ' .proBuyBtn', function (evt) {
if(mySwiper){
if(mySwiper.animating) return false;
mySwiper.stopAutoplay();
}
showShopModal($(this).attr('productid'), evt, productShowType);
return false;
});
// 排序标签点击
$('#module_' + moduleid + ' .orderCtrlPanel>li').off('touchend.orderCtrl click.orderCtrl').on('touchend.orderCtrl click.orderCtrl', function (e) {
sortProductList(this, moduleid, options.PageLink);
});
}
// 绑定更多点击事件
var pcount = 2;
var pagecount = options.PageCount;
$('#module_' + moduleid +' .ProductListMore').off("click").on("click", function (e) {
if (pcount <= pagecount) {
var url = options.PageLink.replace('{PageNo}', pcount);
var self = this;
$.ajax({
type: "GET",
url: '/index.php?c=front/LoadModulePageData&' + url.substring(url.indexOf("?") + 1),
dataType: "html",
success: function (response) {
$resultlist = $(response).find(".ProductList");
var newitems = $resultlist.find(".productsBox").clone();
$('#module_' + moduleid + ' .ProductList').append(newitems);
setProductListImg(moduleid, showStyle, imgSizeType);
if($(self).closest('.ModuleItem').find('.masonry-container').length > 0){
$('#module_' + moduleid + ' .ProductList').imagesLoaded(function () {
$('#module_' + moduleid + ' .ProductList').masonry('appended', newitems);
});
}
if (pcount == pagecount)
$('#module_' + moduleid + ' .ProductListMore').removeClass('moreLoad').removeAttr('onclick').text(options.NoMoreProductText);
pcount++;
}
});
}
});
// 电脑访问点击产品,新开一个页面打开,移动设备在同一个页面跳转
$('#module_' + moduleid + ' .proCont').attr('target', isMobileBroswer() || parent != window ? '_self' : '_blank');
}
// 设置产品展示图片,确保比例
function setProductListImg(moduleid, showStyle, imgSizeType){
if($.inArray(showStyle,[12,15,16]) > -1 && imgSizeType == 3){
$('#module_' + moduleid + ' .proImg').height($('#module_' + moduleid + ' .proImg').width());
$(window).off('resize.productlistImgSizeType' + moduleid).on('resize.productlistImgSizeType' + moduleid, function(evt){
$('#module_' + moduleid + ' .proImg').height($('#module_' + moduleid + ' .proImg').width());
});
}else{
$(window).off('resize.productlistImgSizeType' + moduleid);
}
}
// 获取购物车数量
function getShopCartNum(callback){
$.ajax({
type:'get',
url: '/index.php?c=front/productorder&a=GetShopCartNum',
async: true,
dataType: "json",
success:function (json) {
if(json.success){
if(typeof callback == 'function'){
callback(json.num);
}
}
},
error:function () {
}
});
}
function calProductListSlidePerGroup(moduleid){
var itemCountPerGroup = 0;
var classText = $('#module_' + moduleid).find('.productsBox').prop('class');
var winWidth = window.innerWidth;
if(winWidth >= 1200){
itemCountPerGroup = 12 / parseInt(classText.match(/col-lg-(\d+)/)[1]);
}else if(winWidth >= 992){
itemCountPerGroup = 12 / parseInt(classText.match(/col-md-(\d+)/)[1]);
}else if(winWidth >= 768){
itemCountPerGroup = 12 / parseInt(classText.match(/col-sm-(\d+)/)[1]);
}else{
itemCountPerGroup = 12 / parseInt(classText.match(/col-xs-(\d+)/)[1]);
}
return itemCountPerGroup;
}
function productListMouseOver(elem) {
$(elem).attr('ishovering', 1);
}
function productListMouseOut(elem) {
$(elem).attr('ishovering', 0);
}
function BindPagerAction(){
$(".ModuleItem").off('click.pager_num_click').on('click.pager_num_click', '.PageNavigate a,.page-nav a,.page-more a' , function(evt){
// $(".PageNavigate a,.page-nav a,.page-more a").off('click').on('click', function(evt){
evt = evt || window.event;
evt.preventDefault && evt.preventDefault();
evt.stopPropagation && evt.stopPropagation();
pagerSubmit(this, $(this).attr("href"));
return false;
});
$(".ModuleItem").off('click.pager_submit').on('click.pager_submit', '.pagerGiant .submit' , function(evt){
// $('.pagerGiant .submit').off().on('click', function(){
var pageNo = $(this).closest('.pagerGiant').find('.inputer').val() || '';
var url = $(this).closest('.pagerGiant').find('[name=pagerUrl]').val() || '';
url = url.replace('{pageNo}', pageNo);
if(/^\d+$/.test(pageNo) && parseInt(pageNo) > 0){
var pagerCount = parseInt($(this).closest('.pagerGiant').find('[name=pagerCount]').val() || -1);
if(pagerCount > -1 && parseInt(pageNo) > pagerCount){
return false;
}
pagerSubmit(this, url);
}
return false;
});
$(".ModuleItem").off('keypress.pager_inputer').on('keypress.pager_inputer', '.pagerGiant .inputer' , function(evt){
// $('.pagerGiant .inputer').off().on('keypress', function(evt){
evt = evt || window.event;
var keyCode = evt.keyCode;
if((evt.keyCode < 48 || evt.keyCode > 57) && evt.keyCode != 13){
evt.preventDefault && evt.preventDefault();
evt.stopPropagation && evt.stopPropagation();
return false;
}
if(keyCode == 13){
var pageNo = $(this).closest('.pagerGiant').find('.inputer').val() || '';
var url = $(this).closest('.pagerGiant').find('[name=pagerUrl]').val() || '';
url = url.replace('{pageNo}', pageNo);
if(/^\d+$/.test(pageNo) && parseInt(pageNo) > 0){
var pagerCount = parseInt($(this).closest('.pagerGiant').find('[name=pagerCount]').val() || -1);
if(pagerCount > -1 && parseInt(pageNo) > pagerCount){
return false;
}
pagerSubmit(this, url);
}
}
});
}
/**
* js获取多语言
* @param string lang 要获取多语言的key
* @return string 多语言
*/
function getLang(lang){
if(window.AllLang){
return window.AllLang[lang];
} else {
var site_lang = (getCookie && getCookie('Lang')) ? getCookie('Lang') : 'en';
var lang_url = '/share/lang/lang_' + site_lang + '.json?v=' + Math.random(1,9999);
$.ajax({
url: lang_url,
type: 'GET',
dataType: 'json',
async: false,
success: function(json){
window.AllLang = json;
}
});
return window.AllLang[lang];
}
}
function pagerSubmit(item, url){
if(url && url.indexOf("PageNo=") > -1){
var path = url.split("?")[0];
var params = url.split("?")[1];
var classid = null;
if(params){
var match = params.match(/classid=(\d*)/i);
if (match && match.length > 1) classid = match[1];
}
var newUrl = "/index.php?c=Front/LoadModulePageData&" + params;
/responseModuleId=(\d+)/.test(newUrl);
var moduleId = parseInt(RegExp.$1);
if(moduleId > 0){
var ispagemore = $(item).is(".page-more") || $(item).parent().is(".page-more");
if(ispagemore){
if($(item).attr("pagecount") == $(item).attr("curpage")){
alert(getLang('last_page'));
return false;
}
}
// $("#module_" + moduleId).append("正在加载,请稍候...
");
var top = $("#module_" + moduleId).outerHeight() / 2;
loadingText = ispagemore ? getLang('loading_wait') : getLang('loading') + '...';
// var loadingText = 'Loading...';
// if(getCookie && getCookie('Lang') == 'cn'){
// loadingText = ispagemore ? '正在加载,请稍后' : '正在加载';
// }
if(ispagemore){
$("#module_" + moduleId).find('.page-more').hide();
var pageLoadingHtml = '';
pageLoadingHtml += '
';
pageLoadingHtml += ' ';
pageLoadingHtml += '' + loadingText + ' ';
pageLoadingHtml += '
';
pageLoadingHtml += '
';
$("#module_" + moduleId).find('.page-more').after(pageLoadingHtml);
}else{
$("#module_" + moduleId).find('.BodyCenter').css({'opacity':'0','visibility':'hidden'});
var pageLoadingHtml = '';
pageLoadingHtml += '
';
pageLoadingHtml += ' ';
pageLoadingHtml += '' + loadingText + ' ';
pageLoadingHtml += '
';
pageLoadingHtml += '
';
$("#module_" + moduleId).children().append(pageLoadingHtml);
}
$("#module_" + moduleId).children().css('position', 'relative');
$.ajax({
url: newUrl, async: true, dataType: "text/html", complete: function (request, status, error) {
if(ispagemore){
$("#module_" + moduleId).find('.PageLoading').remove();
$("#module_" + moduleId).find('.page-more-loading').remove();
$("#module_" + moduleId).find('.page-more').show();
var newitems = $(request.responseText).find(".news-container,.pro-container,.download-container,.guestbooklist-container,.gallery-container").children();
$("#module_" + moduleId).find(".news-container,.pro-container,.download-container,.guestbooklist-container,.gallery-container").append(newitems);
var initFunc = window['initFunc' + moduleId];
if(typeof initFunc == 'function'){
initFunc({
newitems:newitems
});
}
//同步分页的状态
var page_more = $(request.responseText).find(".page-more");
if(page_more.length == 0){
page_more = $('' + getLang('all_loaded') + '!
');
}
$(item).closest(".page-more").replaceWith(page_more);
$("#module_" + moduleId).find(".PageNavigate,.page-nav").replaceWith($(request.responseText).find(".PageNavigate,.page-nav"));
}else{
$("#module_" + moduleId).replaceWith(request.responseText);
}
BindPagerAction();
if (typeof CanDesign != 'undefined' && CanDesign != "True") {
var bodyClientHeight = document.documentElement.clientHeight // 因为有DOCTYPE
if (bodyClientHeight == 0) bodyClientHeight = window.innerHeight;
var bodySrollTop = $('body').scrollTop();
if (bodySrollTop == 0) bodySrollTop = $(window).scrollTop();
var relModule = $("#module_" + moduleId).eq(0);
var originModuleHeight = relModule.height();
if (relModule.length > 0) {
if(!ispagemore){
if (SiteType == 0) {
if (originModuleHeight > bodyClientHeight || getElementTop(relModule[0]) < bodySrollTop) {
$('body,html').animate({ scrollTop: getElementTop(relModule[0]) }, 1000);
}
} else {
window.location.href = "#module_" + moduleId;
}
}
}
}
//加载完成后 重新调用一下该模块的init方法
if(window["initFunc" + moduleId]){
window["initFunc" + moduleId]();
}
}
});
return false;
}
}
}
function getElementTop(obj) {
var i = obj.offsetTop;
if (obj.offsetParent != null) i += getElementTop(obj.offsetParent);
return i;
}
function getElementLeft(obj) {
var i = obj.offsetLeft;
if (obj.offsetParent != null) i += getElementLeft(obj.offsetParent);
return i;
}
function getElementTopWithBorder(obj) {
var i = obj.offsetTop + parseFloat($(obj).css('border-top-width'));
if (obj.offsetParent != null) i += getElementTopWithBorder(obj.offsetParent);
return i;
}
function getElementLeftWithBorder(obj) {
var i = obj.offsetLeft + parseFloat($(obj).css('border-left-width'));
if (obj.offsetParent != null) i += getElementLeftWithBorder(obj.offsetParent);
return i;
}
function AddFavorite(sURL, sTitle) {
if (!sURL) sURL = location.href;
if (!sTitle) sTitle = document.title;
try {
window.external.addFavorite(sURL, sTitle);
}catch (e) {
try {
window.sidebar.addPanel(sTitle, sURL, "");
}catch (e) {
alert("加入收藏失败,请使用Ctrl+D进行添加");
}
}
}
function SetHome() {
if (document.all){
document.body.style.behavior='url(#default#homepage)';
document.body.setHomePage(window.location.href);
}else if (window.sidebar){
if(window.netscape){
try{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}catch (e){
alert( "该操作被浏览器拒绝,如果想启用该功能,请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值改为true" );
}
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',window.location.href);
}else{
alert('您的浏览器不支持自动自动设置首页, 请使用浏览器菜单手动设置!');
}
}
/************
2015年3月24日14:21:59 创建人:郑江 主要针对模块的高级功能的js
************/
//图片的半透明效果
function ShowTransparent(obj) {
$(obj).animate({
opacity: 0.7
}, 300, function () {
});
}
//图片不透明
function HideTransparent(obj) {
$(obj).animate({
opacity: 1
}, 300, function () {
});
}
//浮影
var oSetTimeout = null;
function ImgShade(obj, type) {
var oDiv = $(obj).parent().find("div[name='shade']");
$(obj).parent().css("position","relative");
if($(obj).parent().is("a")) $(obj).parent().css("display","block");
if (oDiv.length == 0) {
oDiv = $("" + $(obj).attr('alt') + "
").appendTo($(obj).parent()).css('height', 0);
}
var bc = $(obj);//.closest('.BodyCenter');
var module = $(obj).closest('.ModuleItem');
var top = bc.position().top;
var left = bc.offset().left - $(obj).closest('.BodyCenter').offset().left;
var w = bc.width();
var h = bc.height();
if (type == 'ShadeTop'){
$(oDiv).attr("class", "showShadeTop").css({'width':w,'left':left,'top':0}).show();
}else if(type == 'ShadeBottom'){
$(oDiv).attr("class", "showShadeBottom").css({'width':w,'left':left,'bottom':0}).show();
}else{
$(oDiv).attr("class", "showShadeTop").css({'width':w,'left':left,'top':0}).show();
}
var isShadeAll = type == 'Shade';
if(isShadeAll) $(oDiv).css({'line-height':h +'px','font-size':'18px'});
$(oDiv).stop().animate({ height: (isShadeAll ? h +'px' :"50px") }, (isShadeAll ? 100:200), function () { });
//2015年6月1日17:44:45 郑江 当鼠标进入div(浮影)的时候关掉定时器
$(oDiv).mouseenter(function () {
clearTimeout(oSetTimeout);
});
$(oDiv).mouseleave(function () {
divZoom(oDiv,type);
});
}
function unImgShade(obj, type) {
if ($(obj).parent().find("div[name='shade']").length == 0) $(obj).parent().append("" + $(obj).attr('alt') + "
");
var oDiv = $(obj).parent().find("div[name='shade']");
oSetTimeout = setTimeout(function () {
divZoom(oDiv,type);
}, 200);
}
//2015年6月2日14:19:10 郑江 隐藏div动画
function divZoom(obj,type) {
$(obj).stop().animate({
height: "0px"
}, 200, function () {
if (type == 'ShadeTop') $(obj).attr("class", "hideShadeTop").hide();
else $(obj).attr("class", "hideShadeBottom").hide();
});
}
function moduleImageHover(obj) {
var width = $(obj).width();
$(obj).stop().animate({ opacity: 0 }, 250, function () {
$(this).css('visibility', 'hidden');
});
$(obj).parent().css('position','relative');
if(!$(obj).parent().is('.BodyCenter')){
$(obj).parent().css('display', 'block');
}
var left = ($(obj).parent().width() - $(obj).width()) / 2;
$(obj).siblings('img').stop().show().css({'visibility':'visible',
'box-sizing': 'border-box',
'top':'0',
'left': left + 'px',
'padding-top': $(obj).parent().css('padding-top') || 0,
'padding-left': $(obj).parent().css('padding-left') || 0,
'padding-bottom': $(obj).parent().css('padding-bottom') || 0,
'padding-right': $(obj).parent().css('padding-right') || 0
}).animate({ opacity: 1 }, 250);
}
function moduleImageUnHover(obj) {
// $('.ModuleImage img:eq(1)').stop().animate({ opacity: 0 }, 250, function () {
$(obj).stop().animate({ opacity: 0 }, 250, function () {
$(this).css('visibility', 'hidden');
});
$(obj).siblings('img').stop().show().css('visibility', 'visible').animate({ opacity: 1 }, 250);
}
function ImgZoom(obj){
var scale = $(obj).width() > 500 ? 1.02 : 1.10;
var step = $(obj).width() > 500 ? 0.001 : 0.005;
var curscale = 1;
$(obj).attr('zoom-step',step);
$(obj).parent().attr('zoom-overflow',$(obj).parent().css('overflow'));
$(obj).parent().css({'overflow':'hidden'});
if($(obj).parent().is('a')) $(obj).parent().css({'display':'block'});
var f = function(){
$(obj).attr('zoom-scale',curscale);
$(obj).css({'-webkit-transform':'scale('+curscale+')','-ms-transform':'scale('+curscale+')','-moz-transform':'scale('+curscale+')','-o-transform':'scale('+curscale+')','transform':'scale('+curscale+')' });
curscale += step;
if(curscale < scale) setTimeout(f,10);
}
f();
}
function unImgZoom(obj){
var scale = 1;
var curscale = parseFloat($(obj).attr('zoom-scale'));
var step = parseFloat($(obj).attr('zoom-step'));
var f = function(){
$(obj).css({'-webkit-transform':'scale('+curscale+')','-ms-transform':'scale('+curscale+')','-moz-transform':'scale('+curscale+')','-o-transform':'scale('+curscale+')','transform':'scale('+curscale+')' });
curscale -= step;
if(curscale > scale) setTimeout(f,10);
else $(obj).parent().css('overflow',$(obj).parent().attr('zoom-overflow'));
}
f();
}
/* start of 图文自动隐藏 */
function moduleImageTextHide(option) {
//多语言处理
if(!window.lang && typeof option != 'undefined'){
window.lang = {};
window.lang.show_more = option.lang.show_more;
}
var show_more = '显示更多';
if(typeof option != 'undefined'){
show_more = option.lang.show_more;
}else if(window.lang) {
show_more = window.lang.show_more;
}
//如果有绝对定位的模块,那自动隐藏就会有问题
if(SiteType == "1"){
$(".ModuleImageText,.ModuleImageTextV2,.ModuleImageTextGiant").each(function(i,item){
var m = $(item).closest(".ModuleItem");
var textcontainer = $(item).find(".imageTextContainer");
var id = m.attr('id');
var referwidth = $('#pagebody').width(); //m.width();
var hidew = 800;
if(textcontainer.attr('hidewidth')) hidew = parseInt(textcontainer.attr('hidewidth'));
var hideh = 150;
if(textcontainer.attr('hideheight')) hideh = parseInt(textcontainer.attr('hideheight'));
if((m.css("position") == 'static' || m.css("position") == '')){
if(referwidth < hidew && textcontainer.attr('autohide') == '1' && textcontainer.attr('hasResponsive') == '1' && textcontainer.attr('hasshow') != '1'){
if(m.find('.showHandle').length == 0){
$bodyc = m.find(".BodyCenter");
$bodyc.css({'height':hideh + 'px','overflow':'hidden'});
$bodyc.parent().append("");
}
}
else if(/*window.isDesignMode &&*/ referwidth > hidew){//添加到分栏时 编辑状态下 显示有问题 换为pagebody的宽度做比较
//else if(/*window.isDesignMode &&*/ m.width() > hidew){
moduleImageTextShow(id);
}
}
});
}
}
function moduleImageTextShow(id){
var m = $("#"+id);
m.find(".showHandle").remove();
m.find(".BodyCenter").css({'height':'auto','overflow':'visible'});
// if(CanDesign != "True") m.find(".imageTextContainer").attr("hasshow","1");
}
/* end of 图文自动隐藏 */
function showSubMenu(obj,direction,subItemLocation) {
var oModuleNav = $(obj).closest('.ModuleNav,.ModuleNavGiant');
var oModuleItem = $(obj).closest('.ModuleItem');
var oContent = $(obj).closest('.main-nav-content');
var oNavSubMenu = $(obj).children('.NavSubMenu,.sub-nav-item-group');
var subAlign = $(obj).closest('.pre_nav').attr('SubAlign'); //left:左对齐,right:右对齐, auto: 根据主菜单的在屏幕中的相对位置对齐
var subHolder = $(obj).closest('.pre_nav').attr('SubHolder');
$(obj).addClass('on').siblings().removeClass('on');
var timeoutId = "moduleNavTimeout";
if(typeof direction == 'undefined') direction = $(obj).closest('.pre_nav').attr('data-direction');
if(typeof subItemLocation == 'undefined') subItemLocation = $(obj).closest('.pre_nav').attr('data-subitem-location');
if (window[timeoutId]) {
clearTimeout(window[timeoutId]);
}
oModuleNav.find('.NavSubMenu,.sub-nav-item-group').not(oNavSubMenu).hide();
oModuleNav.find('.navMainItem,.main-nav-item').not($(obj).children('.navMainItem,.main-nav-item')).removeClass('navMainItemHover');
$(obj).children('.navMainItem,.main-nav-item').addClass('navMainItemHover');
if ($('.moduleNavFloatSubMenu').attr('submenuid') != $(obj).attr('id')) {
$('.moduleNavFloatSubMenu').remove();
}
if (oNavSubMenu.children().length == 0) return;
if (oModuleNav.is(".ModuleNavGiant") && oNavSubMenu.find(".sub-nav-item").length == 0) return;
var navSubMenuClone = $(obj).clone(true).attr('onmouseover', null);
var classes = oModuleItem.find(">div").attr('class');
$(".moduleNavFloatSubMenu").remove();$(".sub-nav-holder").hide();
var html = '';
var floatSubMenu = $(html);
if(window.isDesignMode == true){
floatSubMenu.appendTo('#pagebody');
} else {
floatSubMenu.appendTo('body');
}
var originOpacity = oModuleItem.css('opacity');
floatSubMenu.css('opacity', '1'); // 透明度不为1,会有bug。。。
navSubMenuClone.find('.NavSubMenu,.sub-nav-item-group').css('opacity', originOpacity);
floatSubMenu.find('dl').append(navSubMenuClone);
floatSubMenu.find('.pre_nav').addClass($(obj).closest('.pre_nav').attr('class'));
floatSubMenu.find('.navMainItem,.main-nav-item').remove();
floatSubMenu.css({ position: 'static', height:0, overflow: 'hidden' });
floatSubMenu.on('mouseenter', function () {
//debugger
if (window[timeoutId]) {
clearTimeout(window[timeoutId]);
}
});
$(subHolder).mouseenter(function(){ if (window[timeoutId])clearTimeout(window[timeoutId]); }).mouseleave(function(){hideSubMenu(obj)});
var iSubMenuMarginLeft = (floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').outerWidth() - $(obj).find('.navMainItem,.main-nav-item').outerWidth()) / 2;
var isAlignRight = false;
if(subAlign == 'left') iSubMenuMarginLeft = 0;
if(subAlign == 'auto'){
if($(obj).offset().left < (oModuleNav.offset().left + oModuleNav.width() / 2)) iSubMenuMarginLeft = 0;
else isAlignRight = true;
}
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
position: 'absolute',
display: 'block',
zIndex: '999999'
});
floatSubMenu.find('.main-nav-content').css('position', 'static');
//全屏的子菜单背景(layout-109 专用 )
//$(subHolder).css({"top":($(obj).offset().top + $(obj).height()) + "px","position":"absolute","left":"0","width":"100%"}).show();
if (direction == '1' && subItemLocation == '0') {
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
left: $(obj).offset().left - floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').outerWidth(),
top: $(obj).offset().top,
marginTop: $(obj).find('.navMainItem,.main-nav-item').css('margin-top')
});
} else if (direction == '1' && subItemLocation == '1') {
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
position: 'absolute',
display: 'block',
left: $(obj).offset().left + $(obj).outerWidth(),
top: $(obj).offset().top,
marginTop: $(obj).find('.navMainItem,.main-nav-item').css('margin-top')
});
} else if (direction == '0' && subItemLocation == '0') {
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
top: $(obj).offset().top - floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').outerHeight(),
left: $(obj).offset().left + (parseInt($(obj).css('padding-left')) || 0),
marginLeft: -iSubMenuMarginLeft
});
} else {
if (getCookie("SiteType") == "1") {
if (false && window.isDesignMode == true) {
var top = 0;
var left = 0;
var elem = $(obj)[0];
while (elem != null && $(elem).closest('#pagebody').length > 0 && !$(elem).is('#pagebody')) {
top += elem.offsetTop;
left += elem.offsetLeft;
elem = $(elem)[0].offsetParent;
}
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
top: top + $(obj).outerHeight(),
left: left,
marginLeft: -iSubMenuMarginLeft
});
} else {
// debugger
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
top: $(obj).offset().top + $(obj).outerHeight(),
left: $(obj).find('.sub-nav-side-group').children().length>0?$(obj).find('.OneRow').offset().left:$(obj).find('.sub-nav-side-group').hasClass('nav-giant-layout-112')?$(obj).offset().left-20:$(obj).offset().left,
marginLeft: $(obj).find('.sub-nav-side-group').hasClass('nav-giant-layout-112')?0:-iSubMenuMarginLeft,
maxWidth:window.innerWidth
});
}
floatSubMenu.find('.nav').show().css({ height: 0 });
} else {
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({
top: $(obj).offset().top + $(obj).outerHeight(),
left: $(obj).offset().left + (parseInt($(obj).css('padding-left')) || 0),
marginLeft: -iSubMenuMarginLeft
});
}
}
if(isAlignRight && !floatSubMenu.find('.sub-nav-item-group').hasClass('nav-giant-layout-112')){
floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').css({"left":$(obj).offset().left + $(obj).width() - floatSubMenu.find('.NavSubMenu,.sub-nav-item-group').outerWidth(true)});
}
//解决子菜单背景根据二级导航换行而自适应高度 by Kong 2017/8/1
var diffHeight = 0;
var subItemHeight = 40;
var treeNavHeight = 13;
if(floatSubMenu.find('.sub-nav-item').length > 0){
//2级菜单的高度
diffHeight = floatSubMenu.find('.sub-nav-item:last').offset().top - floatSubMenu.find('.sub-nav-item:first').offset().top;
subItemHeight = floatSubMenu.find('.sub-nav-item:first').outerHeight();
//如果存在三级菜单
if(floatSubMenu.find('.sub-nav-side-group.nav-giant-layout-112').children().length>0){
var objs = floatSubMenu.find('.sub-nav-side-group');
treeNavHeight += objs.eq(0).outerHeight();
$.each(objs, function(idx, obj) {
//当前这个ui的高度是否大于上一次ul的高度
if(idx>0){
if($(obj).outerHeight()>objs.eq(idx-1).outerHeight()){
treeNavHeight += $(obj).outerHeight();
}
}
});
}else{
treeNavHeight = 0;
}
}
// layout-111
if (floatSubMenu.find('.sub-nav-item-group').hasClass('nav-giant-layout-111') ) {
// 当前菜单距右的偏移
var navGiantOffsetRight = Math.abs($(window).width() - $(obj).offset().left);
// 当前菜单的二级菜单的总宽度
var navGiantWidth = floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').length *
parseInt(floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').eq(0).css('width')) +
parseInt(floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').eq(0).css('padding-right'));
// 判断对齐方向
if (oContent.css('text-align')) {
var navGiantStyleObj = '';
// 子菜单面板可能的最大宽度
var navGiantContentWidth = navGiantOffsetRight;
switch (oContent.css('text-align')) {
// left 对齐
case 'left':
// 如果右边已经满了,但是左边还有空隙
var navGiantContentStyleLeft = $(obj).offset().left
if (navGiantContentWidth < navGiantWidth) {
if (navGiantWidth < window.innerWidth) {
navGiantContentStyleLeft = window.innerWidth - navGiantWidth
} else {
navGiantContentStyleLeft = parseInt(floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').eq(0).css('width')) / 4
}
}
navGiantContentWidth += (navGiantContentStyleLeft * 6)
navGiantStyleObj = {
left: navGiantContentStyleLeft
}
break;
// center 对齐
case 'center':
navGiantContentWidth += (navGiantContentStyleLeft * 6)
navGiantStyleObj = {
marginLeft: 0
}
break;
// right 对齐
case 'right':
navGiantStyleObj = {
left: '',
right: navGiantOffsetRight - $(obj).width(),
marginLeft: 0
}
navGiantContentWidth = $(obj).offset().left
break;
}
}
// 当前二级菜单个数
var subMenuBoxItem = floatSubMenu.find('.sub-nav-item-group>.sub-menu-box').length;
// 用于储存每个二级列表下的三级列表个数
var threeItem = [];
// 查找每个二级列表下的三级列表个数
floatSubMenu.find('.sub-nav-item-group>.sub-menu-box').each(function () {
threeItem.push($(this).find('.three-nav-item-group>p').length)
});
// 判断个数
if (threeItem.length > 1) {
// 获取三级列表数组的个数最大值
var threeItemMAX = Math.max.apply(null, threeItem);
// 用子菜单面板可能的最大宽度跟当前菜单的二级菜单的总宽度来判断是否满足换行
if (navGiantContentWidth < navGiantWidth) {
// 重置圆角
floatSubMenu.find('.sub-nav-item-group>.sub-menu-box').eq(0).css('border-radius', '0px')
// 循环判断是从第几个开始换行
for (var i = 0, len = subMenuBoxItem; i < len; i++) {
if (navGiantContentWidth < (i * floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-111').children('.sub-menu-box').eq(0).width() + 25)) {
break;
}
}
// 重新设置换行后的圆角
floatSubMenu.find('.sub-nav-item-group>.sub-menu-box').eq(i).css('border-radius', '0px 0px 0px 16px')
// 判断是否需要补齐换行的宽度
if ((subMenuBoxItem / 2) < i) {
// 补全缺失的宽度
for (var j = 0, len = (i - (subMenuBoxItem - i)); j < len; j++) {
floatSubMenu.find('.sub-nav-item-group').append('')
}
}
}
}
floatSubMenu.find('.sub-nav-item-group').css(navGiantStyleObj)
}
if(floatSubMenu.find('.sub-nav-item-group').hasClass('nav-giant-layout-112')){
//已经放满
// debugger
if(window.innerWidth-(floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-112').offset().left+floatSubMenu.find('.sub-nav-item-group.nav-giant-layout-112').outerWidth()) < 168){
if(window.innerWidth - (floatSubMenu.find('.nav-list').length+1) * 168>0){
floatSubMenu.find('.sub-nav-item-group.sub-nav-item-group').css('left',window.innerWidth - (floatSubMenu.find('.nav-list').length+1) * 168)
}else{
floatSubMenu.find('.sub-nav-item-group.sub-nav-item-group').css('left',0)
}
}else{
floatSubMenu.find('.sub-nav-item-group').css('left',$(obj).offset().left+'px');
}
diffHeight = floatSubMenu.find('.sub-nav-item:last').offset().top - floatSubMenu.find('.sub-nav-item:first').offset().top;
}
$(subHolder).css({"top":($(obj).offset().top + $(obj).height()) + "px","position":"absolute","left":"0","width":"100%","height":+ (subItemHeight+diffHeight+treeNavHeight) + "px"}).show();
}
function hideSubMenu(obj, evt) {
var oModuleNav = $(obj).closest('.ModuleNav,.ModuleNavGiant');
var oModuleItem = $(obj).closest('.ModuleItem');
var subHolder = $(obj).closest('.pre_nav').attr('SubHolder');
var timeoutId = "moduleNavTimeout";
evt = evt || window.event || arguments.callee.caller.arguments[ 0 ];
var relatedTarget = evt.relatedTarget || evt.toElement;
if ($(relatedTarget).is('.moduleNavFloatSubMenu') || $(relatedTarget).closest('.moduleNavFloatSubMenu').length > 0) {
return false;
}
if (window[timeoutId]) {
clearTimeout(window[timeoutId]);
}
window[timeoutId] = setTimeout(function () {
$('.moduleNavFloatSubMenu').remove();
oModuleNav.find('.navMainItem').removeClass('navMainItemHover');
//全屏的子菜单背景(layout-109 专用 )
$(subHolder).hide();
$('.main-nav-item-group').removeClass('on').siblings().removeClass('on');
}, 100);
}
function isHorizontalPad() {
if (CanDesign != "True" && window.CanEditFront == "True") return false;
var padscale = false;
if (SiteType == "1" && CanDesign != "True") {
if(navigator.userAgent.toLowerCase().indexOf("pad") > -1 || window.location.toString().indexOf("testpad") > -1 || ($(window).height() > 768 && $(window).width() > 768 && $(window).height() <= 1024 && $(window).width() <= 1024) ){ //横向pad的分辨率一般都在7以上
padscale = true;
}
}
return padscale;
}
function showMobileNavFloatLayer(elem) {
var iCurNum = $('#MobileNav').attr('navnum') || 1;
if (iCurNum == 1 || iCurNum == 5) {
$("#pagebody").css({"-ms-transition": "0.5s","-webkit-transition": "0.5s","-khtml-transition": "0.5","-o-transition": "0.5s","-moz-transition": "0.5s","transition": "0.5s"});
var iTranslateX = 0;
// if (!$('#pagebody').hasClass('showFloatNav')) {
// if (iCurNum == 1) iTranslateX = 17 + 'rem';
// if (iCurNum == 5) iTranslateX = 6 + 'rem';
// }
$('#pagebody').css('left', iTranslateX);
} else {
$("#pagebody").css({"-ms-transition": "","-webkit-transition": "","-khtml-transition": "","-o-transition": "","-moz-transition": "","transition": ""});
}
$('#MobileNav').toggleClass('showFloatNav');
$('#MobileNavRenderElem').toggleClass('showFloatNav');
$('#MobileNavFloatLayer').toggleClass('showFloatNav');
$('#pagebody').toggleClass('showFloatNav');
$('#MobileFootNav').toggleClass('showFloatNav');
$('#MobileNavMask').toggleClass('showFloatNav');
}
function setMobileNav() {
if ($('#MobileNav').length > 0) {
var iCurNum = $('#MobileNav').attr('navnum') || 1;
var iCurColor = $('#MobileNav').attr('navcolor') || 'black';
var iItemType = $('#MobileNav').attr('navitemtype') || 0;
var iEnable = $('#MobileNav').attr('enable') || 0;
$('#MobileNav').attr('class', 'mobileNav mobileNav_' + iCurNum + ' ' + iCurColor);
$('#MobileNavRenderElem').attr('class', 'mobileNavRenderElem mobileNavRenderElem_' + iCurNum + ' ' + iCurColor);
$('#MobileNavFloatLayer').attr('class', 'mobileNavFloatLayer mobileNavFloatLayer_' + iCurNum + ' ' + iCurColor + ' itemType' + iItemType);
$('#pagebody').attr('class', $('#pagebody').attr('class').replace(/(pagebody_nav(_\d+)?)|(showFloatNav)/ig, '') + ' pagebody_nav pagebody_nav_' + iCurNum);
if ($('#MobileFootNav').length > 0) {
$('#MobileFootNav').attr('class', $('#MobileFootNav').attr('class').replace(/(mobileFootNav(_\d+)?)|(showFloatNav)/ig, '') + ' mobileFootNav_' + iCurNum);
}
$('#MobileNavMask').attr('class', 'mobileNavMask mobileNavMask_' + iCurNum).off('click').on('click', function () {
showMobileNavFloatLayer();
}).off('touchstart').on('touchstart', function () {
evt = window.event || evt;
evt.preventDefault();
showMobileNavFloatLayer();
return false;
})
$('#MobileNavFloatLayer').off('click'); $('#MobileNavFloatLayer').off('touchstart'); $('#MobileNavFloatLayer').off('touchmove');
// 分开写是因为pagebody scale后,会影响pagebody同级的100%高度的元素的高度
if ($.inArray(iCurNum, ["1", "2", "5", "8"]) > -1) {
$('#MobileNavFloatLayer').off().on('touchstart', function (evt) {
evt = window.event || evt;
iStartPosY = evt.targetTouches[0].pageY;
var top = $(this).children('.itemList').css('top');
if(top == 'auto' || top == '') top = 0;
iMobileNavItemListStartTop = parseInt(top);
}).on('touchmove', function (evt) {
if ($(window).height() > $(this).children('.itemList').outerHeight()) {
evt.preventDefault();
return false;
}
evt = window.event || evt;
evt.preventDefault();
iEndPosY = evt.targetTouches[0].pageY;
iSlideDistance = iEndPosY - iStartPosY;
var iTop = iMobileNavItemListStartTop + iSlideDistance;
if (iTop > 0) iTop = 0;
var iHiddenHeight = $(window).height() - $(this).children('.itemList').outerHeight() - $('#MobileNavFloatLayer').position().top - parseInt($(this).children('.itemList').css('margin-top'));
if (iTop < iHiddenHeight) iTop = iHiddenHeight;
if(typeof(window.top.frames['pageframe']) == 'undefined') $('#MobileNavFloatLayer .itemList').css('top', iTop + "px");
return false;
});
}
if($.inArray(iCurNum, ["2", "3", "8"]) > -1){
$('#MobileNavFloatLayer').css("top",$(".mobileNav").height())
}
if($.inArray(iCurNum, ["1", "5"]) > -1){
try{
if(typeof(window.top.frames['pageframe']) != 'undefined') $('#MobileNavFloatLayer').css("top",'0');
}catch(ex){
}
}
if(iEnable != 1 || $.inArray(iCurNum, ["4", "6", "7"]) > -1){
$('#MobileNavRenderElem').hide();
}else{
//$('#MobileNavRenderElem').show();
}
if ($.inArray(iCurNum, ["4"]) > -1) {
$('#MobileNavFloatLayer').off().on('touchstart', function (evt) {
evt = window.event || evt;
iStartPosY = evt.targetTouches[0].pageY;
iMobileNavItemListStartTop = parseInt($(this).children('.itemList').css('top'));
}).on('touchmove', function (evt) {
if ($(this).height() > $(this).children('.itemList').outerHeight()) {
evt.preventDefault();
return false;
}
evt = window.event || evt;
evt.preventDefault();
iEndPosY = evt.targetTouches[0].pageY;
iSlideDistance = iEndPosY - iStartPosY;
var iTop = iMobileNavItemListStartTop + iSlideDistance;
if (iTop > 0) iTop = 0;
var iHiddenHeight = $(this).height() - $(this).children('.itemList').outerHeight();
if (iTop < iHiddenHeight) iTop = iHiddenHeight;
$('#MobileNavFloatLayer .itemList').css('top', iTop + "px");
return false;
});
}
if (iCurNum == 6) {
if (typeof isDesignMode != 'undefined' && isDesignMode === true) {
$('#MobileNavFloatLayer').on('click', function () {
showMobileNavFloatLayer();
})
}
$('#MobileNavFloatLayer').on('touchstart', function (evt) {
evt = window.event || evt;
var curTarget = $(evt.targetTouches[0].target);
if (curTarget.is('.itemLink') || curTarget.is('.icon') || curTarget.is('.menuName')) {
return true;
}
evt.preventDefault();
showMobileNavFloatLayer();
return false;
});
}
if (iCurNum == 7) {
$('#MobileNavFloatLayer').on('touchstart', function (evt) {
evt = window.event || evt;
iStartPosX = evt.targetTouches[0].pageX;
iMobileNavFloatLayerItemListStartPosX = parseInt($(this).children('.itemList').css('left'));
});
$('#MobileNavFloatLayer').on('touchmove', function (evt) {
evt = window.event || evt;
if ($(this).width() > $(this).children('.itemList').outerWidth()) {
evt.preventDefault();
return false;
}
evt.preventDefault();
iEndPosX = evt.targetTouches[0].pageX;
iSlideDistance = iEndPosX - iStartPosX;
var iItemListLeft = iMobileNavFloatLayerItemListStartPosX + iSlideDistance;
if (iItemListLeft > 0) iItemListLeft = 0;
var iHiddenWidth = $(this).width() - $(this).children('.itemList').outerWidth();
if (iItemListLeft < iHiddenWidth) iItemListLeft = iHiddenWidth;
$('#MobileNavFloatLayer .itemList').css('left', iItemListLeft + "px");
return false;
});
} else {
$('#MobileNavFloatLayer .itemList').css({
width: ''
});
}
}
}
function matchNavAndFootNavBgColor() {
setInterval(function () {
if ($('#MobileFootNav').attr('bgcolorrelatedtomobilenav') == 0) {
var bgcolor = $('.ModuleMobileNavGiant #header').length > 0?$('.ModuleMobileNavGiant #header').css('background-color'):$('#MobileNav').css('background-color');
// console.log(bgcolor,'aaaa');
if($('#MobileFootNav .foot-nav-list').css('background-color') != bgcolor)
$('#MobileFootNav .foot-nav-list').css('background-color', bgcolor);
}
}, 50);
}
function doSomeWhanPreview() {
if (window.location.getQueryString('view') == '1') {
$("body").find('a').each(function (i, elm) {
if (/^(javascript|#)/i.test($(this).attr('href'))) {
return true;
}
if ($(this).prop('href').indexOf(location.protocol + "//" + location.hostname) == 0) {
var url = $(this).attr('href');
if (url) {
if($(this).hasClass("ui-tabs-anchor") == false){
// url = url.replace("#", "");
// url = url.indexOf("?") > -1 ? url + "&view=1" : url + "?view=1";
url = url.replace(/^([^\?#]*)(\??)([^#]*)(#?)/, '$1\?$3&view=1$4');
}
}
$(this).attr('href', url);
$(this).attr('target', '_self');
}
});
$('.ModuleUserLogin [registerurl]').off().on('click', function (evt) {
var url = $(this).attr('registerUrl');
window.location = url.indexOf("?") > -1 ? url + "&view=1" : url + "?view=1";
evt.preventDefault();
return false;
});
}
}
function doLoginWithUserNamePassword(obj) {
obj = $(obj);
var url = $(obj).attr('action');
if ($.trim($(obj).find('[name=BackUrl]').val()) == '') {
//$.trim($(obj).find('[name=BackUrl]').val(location.pathname));
}
var data = $(obj).serializeArray();
if (obj.length > 0) {
$.ajax({
type: "post",
url: url,
cache: false,
data: data,
dataType: "json",
success: function (data) {
if (!data.success) {
alert(data.msg);
return;
}
if (data.msg) {
window.location.href = decodeURIComponent(data.msg);
}
},
error: function (req) {
alert(req.responseText);
}
});
}
}
function AjaxResetPassword(obj) {
if (obj) {
var data=$(obj).serialize()+'&act=resetpassword'
$.ajax({
type: "POST",
url: $(obj).attr('action'),
cache: false,
beforeSend: function (XMLHttpRequest) {
$('input[type="submit"]', $(obj)).hide();
$('.Loading', $(obj)).show();
},
dataType: "json",
data: data,
success: function (data) {
console.log(data);
if (data) {
if (!data.success){
$('input[type="submit"]', $(obj)).show();
}
$('.Loading', $(obj)).hide();
$(".container", $(obj)).show();
$(".errorMsg", $(obj)).html(data.msg);
}
},
complete: function (XMLHttpRequest, textStatus) {
$('input[type="submit"]', $(obj)).show();
$('.Loading', $(obj)).hide();
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
$('input[type="submit"]', $(obj)).show();
$('.Loading', $(obj)).hide();
}
});
}
};
//弹出微信扫码支付的对话框
function WxScanPay(orderid) {
if (!-[1, ]) { // ie7,8不允许
alert('很抱歉,当前浏览器不支持微信扫码支付,请升级或更换其他浏览器重试。');
return;
}
$("#WxScanPayDiv").remove();
var WxScanPayDiv = $('
');
$("body").append(WxScanPayDiv);
$(WxScanPayDiv).dialog({
title: '微信支付 - Pay', modal: true, width: 500, position: 'center',
resizable: false,
buttons: {
"取消": function () {
$(this).dialog("close");
}
},
close: function () {
$("#WxScanPayDiv").remove();
}
});
}
// 全屏模块绝对定位100%宽度取的是屏幕的可视宽度,当设置的站点宽度超过屏幕可视宽度时候,全屏模块右侧留白,所以定时器设它门一个固定宽度
function keepFullScreenModules100Width() {
if(getCookie("SiteType") == "1") return;
setInterval(function () {
$('body>.ModuleItem').each(function(i,item){
if(!$(this).attr('float')) $(this).css('width', $('#pagebody').width()); //非浮动模块保持全屏
});
}, 200);
}
function runSlide(id,pattern,time,imageready){
var module = $("#module_" + id);
var mm = module.clone();
var text = $('#txt_'+ id);
if(text.length == 0){
var text = $("");
}
$("body").append(text);
var obj = $("#myFocus" + id);
// 以下特殊字符必须处理,防止myfocus解析错误
obj.find('img').each(function(){
$(this).attr('alt', ($(this).attr('alt') || '').replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];}));
$(this).attr('text', ($(this).attr('text') || '').replace(/[<>&"]/g,function(c){return {'<':'<','>':'>','&':'&','"':'"'}[c];}));
});
var readyCallback = function(){
// 修复mF_ladyQ风格下,标题文字在第一次循环不显示的bug
if(pattern == "mF_ladyQ"){
module.find('.txt li').css({
'-webkit-transition': 'none',
'-moz-transition': 'none',
'-o-transition': 'none'
});
}
}
if(module.css("position") != "absolute"){
var width = module.parent().width() - parseInt(module.parent().css("padding-left")) - parseInt(module.parent().css("padding-right"));
if(!obj.attr("hasreload")){
obj.find("*[name=slideImg]").each(function(i,item){
var src = $(item).attr("src");
$(item).src = '';
$(item).on("load",function(){
if(obj.attr("hasreload")) return;
if($(item).height() == 0) return;
obj.height($(item).height());
module.height($(item).height());
obj.width(width);
module.width(width);
obj.attr("hasreload","1");
myFocus.set({ id: "myFocus" + id, pattern: pattern, loadIMGTimeout: 0, time: time}, readyCallback);
});
$(item).src = src;
});
}
}else{
myFocus.set({ id: "myFocus" + id, pattern: pattern, loadIMGTimeout: 0, time: time}, readyCallback);
var $Img = module.find('img[name=slideImg]');
if(pattern == 'mF_slide3D'){
$Img.attr({'style':null,'width':null});
setTimeout(function(){
$('.mF_slide3D_wrap').css({'padding':0});
console.log($('.mF_slide3D_wrap'))},150)
}else if(pattern == 'mF_YSlider'){
var imgHeight = module.height();
$Img.attr({'style':'height:'+imgHeight+'px'});
}else if(pattern == 'mF_shutters'){
var imgHeight = module.height();
var imgWidth = module.width();
console.log(imgHeight,imgWidth);
$Img.attr({'style':'height:'+imgHeight+'px','width':imgWidth});
}
}
module.attr({"mid":id,"pattern":pattern,"time":time});
}
function runMobileSlide(moduleid){
$(window).load(function(){
$('#swiper' + moduleid).width($('#module_' + moduleid).parent().width());
$('#module_' + moduleid).resize(function(){
$('#swiper' + moduleid).width($('#module_' + moduleid).parent().width());
window['swiper' + moduleid].destroy(false);
window['swiper' + moduleid] = new Swiper('#swiper' + moduleid,{ autoplay:3000,loop : true,pagination : '.SNum' + moduleid });
});
window['swiper' + moduleid] = new Swiper('#swiper' + moduleid,{ autoplay:3000,loop : true,pagination : '.SNum' + moduleid });
});
}
// 调整幻灯片模块显示样式
function adjustModuleSlide(obj) {
if (!obj) {
var moduleSlides = $('.ModuleSlide').parent();
for (var i = 0; i < moduleSlides.length; i++) {
adjustModuleSlide(moduleSlides[i]);
}
}
obj = $(obj);
if (obj.children().is('.ModuleSlide') && SiteType == 0) {
var moduleid = obj.attr('id').replace(/module_/i, '');
var aa = $("#txt_" + moduleid);
var mm = $(aa.val().replace("runSlide",""));
mm.css({"position":obj.css("position"),"left":obj.css("left"),"top":obj.css("top"),"width":obj.width() + "px", "height":obj.height() + "px"});
var myfocusObj = mm.find('#myFocus' + moduleid);
var moduleHead = mm.find('.ModuleHead').get(0);
var moduleHeadHeight = moduleHead ? mm.find('.ModuleHead').get(0).offsetHeight : 0;
myfocusObj.height(mm.height() - moduleHeadHeight);
myfocusObj.width(mm.width());
$(obj).replaceWith(mm);
var id = obj.attr("mid");
var pattern = obj.attr("pattern");
var time = obj.attr("time");
runSlide(id,pattern,time);
}
}
//显示产品、文章等子分类
function setModuleCls(obj) {
var strCls = ".ModuleProductCls,.ModuleNewsCls,.ModuleDownCls,.ModuleNewsClsV2,.ModuleProductClsV2";
if (!obj) {
var moduleCls = $(strCls);
for (var i = 0; i < moduleCls.length; i++) {
setModuleCls(moduleCls[i]);
}
}
obj = $(obj);
var showStyle = obj.find("[class*=ModuleClsShowStyle]").attr('showstyle');
if (showStyle == 0) {
var hidesubTimer = new Object();
obj.find(".SHOWSUB>li").mouseover(function () {
var moduleid = $(this).closest('.ModuleItem').attr("id").replace('module_', '');
var id = 'subclass' + $(this).children("ul").attr("id");
var obj = $(this).get(0);
var type = '';
var moduleClasses = $(this).closest(strCls).attr('class').split(/\s+/);
var clsClasses = strCls.split(',');
for(var i = 0; i < moduleClasses.length; i++){
for(var j = 0; j < clsClasses.length; j++){
if(clsClasses[j].replace(/\s|\./g, '') == moduleClasses[i]){
type = moduleClasses[i];
break;
}
}
if(type) break;
}
$(obj).removeClass("SubMaskColor");
$(obj).removeClass("SubMaskBorder1");
$("#mask" + id).remove(); $("#" + id).remove();
if (!$(this).children("ul").html()) return;
var obj = $(this).get(0);
var p = $("
");
p.append($(this).children("ul").clone());
p.children("ul").css("display", "block");
p.off().mouseenter(function () {
clearTimeout(hidesubTimer[id]);
}).mouseleave(function () {
$("#" + id).remove();
$("#mask" + id).remove();
$(obj).removeClass("SubMaskColor");
$(obj).removeClass("SubMaskBorder1");
});
$("body").append(p);
var zindex = parseInt($(this).css("z-index"));
if (isNaN(zindex)) zindex = 0;
$("body").append("
");
$(this).addClass("SubMaskColor");
$(this).addClass("SubMaskBorder1");
var borderwidth = parseInt($("#" + id).css("border-top-width"));
if (isNaN(borderwidth)) borderwidth = 0;
var func = function () {
$("#" + id).css({ "display": "block", "top": $(obj).offset().top, "left": ($(obj).offset().left + $(obj).width()) });
$("#mask" + id).css({ "top": $(obj).offset().top + borderwidth, "left": ($(obj).offset().left + $(obj).width() - 3) });
};
func();
setTimeout(func, 50); //因为如果从一个分类快速切换到另一个分类,原分类会延时50ms才会消失,这时如果原分类有border,会占了几个像素的高度,会导致后面的分类位置计算不准,这里延时50ms重新计算一下解决了这个问题
}).mouseleave(function () {
$(this).children("ul").hide();
var id = 'subclass' + $(this).children("ul").attr("id");
var obj = $(this).get(0);
hidesubTimer[id] = setTimeout(function () {
$(obj).removeClass("SubMaskColor");
$(obj).removeClass("SubMaskBorder1");
$("#mask" + id).remove();
$("#" + id).remove();
}, 50);
});
} else if (showStyle == 3) {
obj.find('.MainClassItem:last-child').css({
borderBottom: '0px'
});
} else if (showStyle == 7) {
obj.find('.clsAllList > .clsItem').off().on('mouseenter', function () {
var moduleItem = $(this).closest('.ModuleItem');
var moduleid = moduleItem.attr('id');
moduleid = moduleid.replace('module_', '');
var floatElem = $('
').append('
');
floatElem.children('.clsAllList').append($(this).find('.clsItemList').clone());
$('body').append(floatElem);
$('body').append('
');
var moduleZIndex = parseFloat(moduleItem.css('z-index'));
if (isNaN(moduleZIndex)) moduleZIndex = 0;
moduleZIndex++; moduleZIndex = 9999;
var floatElemMinHeight = moduleItem.find('.clsAllList').height();
moduleItem.find('.clsAllList > .clsItem').removeClass('hover');
$(this).addClass('hover');
floatElem.css({
position: 'absolute',
top: getElementTopWithBorder(moduleItem[0]),
left: getElementLeftWithBorder(moduleItem[0]) + moduleItem.outerWidth(false),
zIndex: moduleZIndex
});
floatElem.find('.clsItemList').css({
position: 'static',
minHeight: floatElemMinHeight
}).show();
$('.ModuleProductClsStyle7_Mask').css({
position: 'absolute',
left: Math.ceil((getElementLeftWithBorder(this) + $(this).width()).toFixed(2)) * 100 / 100 - 1,
top: getElementTopWithBorder(this),
zIndex: moduleZIndex,
width: parseFloat(moduleItem.find('.clsAllList').css('border-right-width')) + parseFloat(moduleItem.css('border-right-width')) + parseFloat(floatElem.find('.clsAllList').css('border-left-width')) + 1,
height: parseFloat(moduleItem.find('.clsItem').height())
});
$('.ModuleClsShowStyle7_floatElem').off().on('mouseleave', function (evt) {
$('.ModuleClsShowStyle7_floatElem').remove();
$('.ModuleProductClsStyle7_Mask').remove();
$('#module_' + $(this).attr('relatedmoduleid')).find('.clsAllList > .clsItem').removeClass('hover');
});
$('.ModuleProductClsStyle7_Mask').off().on('mouseleave', function (evt) {
var relatedTarget = evt.toElement || evt.relatedTarget;
if (!$(relatedTarget).closest('.ModuleClsShowStyle7').hasClass('ModuleClsShowStyle7_floatElem')
&& !$(relatedTarget).hasClass('ModuleProductClsStyle7_Mask')) {
$('.ModuleClsShowStyle7_floatElem').remove();
$('.ModuleProductClsStyle7_Mask').remove();
$('#module_' + $(this).attr('relatedmoduleid')).find('.clsAllList > .clsItem').removeClass('hover');
}
});
}).on('mouseleave', function (evt) {
var relatedTarget = evt.toElement || evt.relatedTarget;
if (!$(relatedTarget).closest('.ModuleClsShowStyle7').hasClass('ModuleClsShowStyle7_floatElem')
&& !$(relatedTarget).hasClass('ModuleProductClsStyle7_Mask')) {
$('.ModuleClsShowStyle7_floatElem').remove();
$('.ModuleProductClsStyle7_Mask').remove();
$(this).removeClass('hover');
}
});
}
}
/**
* 克隆元素样式
* @author tang bin
* @version 0.1
* @see http://www.planeart.cn/?p=1499
* @param {HTMLElement} 被克隆的元素
* @param {Boolean} 是否启用缓存(默认true)
* @return {String} css类名
*/
var cloneStyle = (function (doc) {
var rstyle = /^(number|string)$/,
cloneName = '${cloneName}',
sData = {},
addHeadStyle = function (content) {
var style = sData[doc];
if (!style) {
style = sData[doc] = doc.createElement('style');
doc.getElementsByTagName('head')[0].appendChild(style);
};
style.styleSheet && (style.styleSheet.cssText += content) || style.appendChild(doc.createTextNode(content));
},
getStyle = 'getComputedStyle' in window ? function (elem, name) {
return getComputedStyle(elem, null)[name];
} : function (elem, name) {
return elem.currentStyle[name];
};
return function (source, cache) {
if (!cache && source[cloneName]) return source[cloneName];
var className, name,
cssText = [],
sStyle = source.style;
for (name in sStyle) {
var val = getStyle(source, name);
if (val !== '' && rstyle.test(typeof val)) {
name = name.replace(/([A-Z])/g, "-$1").toLowerCase();
cssText.push(name);
cssText.push(':');
cssText.push(val);
cssText.push(';');
};
};
cssText = cssText.join('');
source[cloneName] = className = 'clone' + (new Date).getTime();
addHeadStyle('.' + className + '{' + cssText + '}');
return className;
};
}(document));
function runAllAnimate(list){
if(!list) list = $(".ModuleItem");
$(list).each(function(i,item){
var html = $(item)[0].outerHTML;
var animatename = $(item).attr("animate");
if(!animatename){
var match = html.match(/wow\s+([a-z]+)/gi);
if(match){
animatename = match[0].replace(/wow\s+/,'');
}
}
if(animatename){
if(html.indexOf("ModuleFullSwitch") > -1) return;
$(item).removeClass(animatename);
var duration = $(item).attr("data-wow-duration");
var delay = $(item).attr("data-wow-delay");
var animate = {"animation-name":animatename};
if(duration) animate["animation-duration"] = duration;
if(delay) animate["animation-delay"] = delay;
$(item).css({"animation-name":'aaa'});
setTimeout(function(){
$(item).css({"animation-name":animatename,"animation-duration":duration,"animation-delay":delay});
},10);
$(item).attr("animate",animatename);
}
});
}
// pc相册
function adjustModuleSiteGallery(moduleID) {
// TODO box-sizing: content-box 计算margin
var iSingleItemWidth = $("#module_" + moduleID + " .imgItem").outerWidth();
var iModuleWidth = $("#module_" + moduleID).width();
var iModuleHeight = $("#module_" + moduleID).height();
var iColCount = Math.floor(iModuleWidth / iSingleItemWidth);
var iTotalCount = $("#module_" + moduleID + " .imgItem").length;
$("#module_" + moduleID + " .imgItem").each(function (i) {
if (i % iColCount == 0) {
$(this).css({ marginLeft: 0 });
} else if (i % iColCount == iColCount - 1) {
$(this).css({ marginRight: 0 });
}
if (i < iColCount) {
$(this).css({ marginTop: 0 });
} else if (i > iTotalCount - iColCount) {
$(this).css({ marginBottom: 0 });
}
});
}
// 初始化pc相册
function setModuleSiteGallery(obj) {
var defaults = {
padding: 0,
prevEffect: 'fade',
nextEffect: 'fade',
viewDetails: '查看详情',
closeBtn: true,
openOpacity: true,
helpers: {
overlay: {
css: { 'background': 'rgba(0,0,0, 0.9)' },
closeClick: false
},
title: { type: 'outside' },
//buttons: {},
thumbs: {
width: 50,
height: 50,
position: 'bottom'
}
},
modal: false,
tpl: {
next: ' ',
prev: ' '
},
beforeLoad: function () {
if (this.element) {
var oImg = $(this.element).children('img');
var sLink = '';
if (oImg.attr('redirectUrl') + '' != '') {
sLink = ''+obj.viewDetails+' ';
}
this.title = oImg.attr('alt') + sLink;
} else {
var sLink = '';
if (this.url) {
sLink = ''+obj.viewDetails+' ';
}
this.title = this.title + sLink;
}
},
afterShow: function () {
if ($('.fancybox-overlay>.fancybox-prev').length == 0) {
$('.fancybox-outer>.fancybox-prev').appendTo('.fancybox-overlay');
} else {
$('.fancybox-outer>.fancybox-prev').remove();
}
if ($('.fancybox-overlay>.fancybox-next').length == 0) {
$('.fancybox-outer>.fancybox-next').appendTo('.fancybox-overlay');
} else {
$('.fancybox-outer>.fancybox-next').remove();
}
if ($('.fancybox-overlay>.fancybox-close').length == 0) {
$('.fancybox-skin>.fancybox-close').appendTo('.fancybox-overlay').css({
right: "0px",
top: "0px"
});
} else {
$('.fancybox-skin>.fancybox-close').remove();
}
//更新前一张和下一张的遮盖高度,不遮住下面的超链接
var fancyboxInner = $(".fancybox-inner").eq(0);
var fancyboxWrap = $(".fancybox-wrap").eq(0);
if(fancyboxInner && fancyboxWrap) {
var top = parseInt(fancyboxWrap.css("top").replace("px", ""));
var height = fancyboxInner.height();
$(".fancybox-next").css("height", height + top);
$(".fancybox-prev").css("height", height + top);
}
}
}
if (obj.effectID != 0) delete defaults.helpers.thumbs;
$("#module_" + obj.moduleID + " .imgBox img").css('position', 'relative');
if (obj.isExpandDir == 0) {
$("#module_" + obj.moduleID + " .imgBox").off().click(function () {
$.fancybox.open(obj.galleryItems[$("#module_" + obj.moduleID + " .imgBox").index(this) + 1], defaults);
return false;
});
} else {
$("#module_" + obj.moduleID + " .imgBox").off().click(function () {
var items = obj.galleryItems[1] || [];
for (var i = 0; i < items.length; i++) {
if (($(this).prop('href') + '').replace(/\?.*$/, '').indexOf((items[i].href + '').replace(/\?.*$/, '')) > -1) {
break;
}
}
var opts = $.extend({}, defaults);
opts.index = i;
$.fancybox.open(obj.galleryItems[1], opts);
return false;
});
}
$("#module_" + obj.moduleID + " .imgBox img").each(function () {
var sSrc = $(this).attr('src');
$(this).attr('src', '');
$(this).off('load').on('load', function () {
$(this).attr('originWidth', $(this).parent().width());
$(this).attr('originHeight', $(this).parent().height());
});
$(this).attr('src', sSrc);
});
$("#module_" + obj.moduleID + " .imgBox img").off('mouseover').on('mouseover', function () {
var oZoomImage = $(this);
var iOriginWidth = oZoomImage.attr('originWidth') || $(this).parent().width();
var iOriginHeight = oZoomImage.attr('originHeight') || $(this).parent().height();
var iZoomPx = 50;
oZoomImage.stop().animate({
left: -iZoomPx / 2 + 'px',
top: -iZoomPx / 2 + 'px',
width: parseInt(iOriginWidth) + iZoomPx + 'px',
height: parseInt(iOriginHeight) + iZoomPx + 'px'
}, 600);
$('.imgMask').remove();
var iLeft = parseFloat($(this).closest('.imgItem').css('padding-left'));
var iTop = parseFloat($(this).closest('.imgItem').css('padding-top'));
$(' ').css({
left: iLeft + 'px',
top: iTop + 'px',
width: iOriginWidth + 'px',
height: iOriginHeight + 'px'
}).insertAfter(this).off().on('mouseleave', function () {
var oZoomImage = $(this).closest('.imgItem').find('.imgBox img');
var iOriginWidth = oZoomImage.attr('originWidth');
var iOriginHeight = oZoomImage.attr('originHeight');
oZoomImage.stop().animate({
left: '0',
top: '0',
width: iOriginWidth + 'px',
height: iOriginHeight + 'px'
}, 600);
$('.imgMask').remove();
}).on('click', function () {
})
});
}
function setMobileModuleSiteGallery(obj){
if (obj.isExpandDir == 0) {
$("#module_" + obj.moduleID + " .grid-cont").off().click(function () {
$(this).lightGallery({
dynamic: true,
thumbnail: true,
dynamicEl:obj.galleryItems[$("#module_" + obj.moduleID + " .grid-cont").index(this) + 1]
});
return false;
});
}
}
// 初始化音乐模块
function initModuleMusic(opts) {
var bgMusicFilePath = opts.bgMusicFilePath;
var moduleid = opts.moduleid;
var siteType = opts.siteType;
var isAutoPlay = opts.isAutoPlay;
var isLoop = opts.isLoop;
var canPlay = opts.canPlay;
if (canPlay) {
var ua = navigator.userAgent.toLowerCase();
var elem = $('#module_' + moduleid);
if (siteType == 0) {
if (ua.match(/msie ([\d.]+)/)) {
$(elem).find('#music' + moduleid).html(' ');
} else if (ua.match(/firefox\/([\d.]+)/)) {
$(elem).find('#music' + moduleid).html(' ');
} else if (ua.match(/chrome\/([\d.]+)/)) {
$(elem).find('#music' + moduleid).html(' ');
} else if (ua.match(/opera.([\d.]+)/)) {
$(elem).find('#music' + moduleid).html(' ');
} else if (ua.match(/version\/([\d.]+).*safari/)) {
$(elem).find('#music' + moduleid).html(' ');
} else {
$(elem).find('#music' + moduleid).html(' ');
}
} else {
$(elem).find('#music' + moduleid).html(' ');
}
if (/(iphone)|(ipad)/i.test(ua)) {
function forceSafariPlayAudio() {
audioEl.load(); // iOS 9 还需要额外的 load 一下, 否则直接 play 无效
audioEl.play(); // iOS 7/8 仅需要 play 一下
}
var audioEl = $('#music' + moduleid).find('audio')[0];
audioEl.addEventListener('play', function () {
// 当 audio 能够播放后, 移除这个事件
window.removeEventListener('touchstart', forceSafariPlayAudio, false);
}, false);
// 由于 iOS Safari 限制不允许 audio autoplay, 必须用户主动交互(例如 click)后才能播放 audio,
// 因此我们通过一个用户交互事件来主动 play 一下 audio.
window.addEventListener('touchstart', forceSafariPlayAudio, false);
audioEl.src = bgMusicFilePath;
}
}
function setMusicImg(moduleid, isPlaying) {
var musicImg = $('#musicPic' + moduleid).find('img');
if (isPlaying) {
musicImg.attr('src', musicImg.attr('playing_src')).addClass('playing');
} else {
musicImg.attr('src', musicImg.attr('_src')).removeClass('playing');
}
}
setMusicImg(moduleid, isAutoPlay);
$('#musicPic' + moduleid).off().on('click', function () {
var audioEl = $('#music' + moduleid).find('audio')[0];
if (audioEl) {
if (audioEl.paused) {
audioEl.play();
setMusicImg(moduleid, true);
} else {
audioEl.pause();
setMusicImg(moduleid, false);
}
}
audioEl = $('#music' + moduleid).find('embed')[0];
if (audioEl) {
if (audioEl.playState == 2) {
audioEl.pause();
setMusicImg(moduleid, false);
} else {
audioEl.play();
setMusicImg(moduleid, true);
}
}
audioEl = $('#music' + moduleid).find('object')[0];
if (audioEl) {
if (audioEl.PlayState == 2) {
audioEl.Pause();
setMusicImg(moduleid, false);
} else {
audioEl.Play();
setMusicImg(moduleid, true);
}
}
});
}
// 初始化标签页模块
function initModuleTabContainer(moduleID, showStyle, layout){
//layout仅仅用于标签模块,其他模块没必要的话勿抄
//有swiper组件的都要在初始化模块的时候讲模块名称增加"Swiper",以下为例子
//其余正常例子只需要initFunc
//*注:因为swper轮播组件初始化的时候回判断元素是否被隐藏,如果被隐藏泽不会被初始化成功
//swper模块必须注册该事件
//如果有swiper隐藏的模块,记得注册该事件
$("#module_"+moduleID+" .Nav-Container").on({
"click": function () {solvePluginEvent()},
"mouseover": function () {
setTimeout(function () {
solvePluginEvent()
}, 500)
}
});
var solvePluginEvent = function(){
for (var key in window) {
if (key.substr(0, 14) == 'initSwiperFunc' || key.substr(0, 11) == 'initMapFunc') {
var mid = key.replace(/[^0-9]/g,'');
if($("#module_"+moduleID+" #module_"+mid).length > 0){
window[key]();
}
}
}
}
//layout仅仅用于标签模块,其他模块没必要的话勿抄
if(parseInt(layout) == 107 || parseInt(layout) == 108 || parseInt(layout) == 109){
return;
}
if(showStyle == 0){
var module = $('#module_' + moduleID);
if(module.length == 0) return;
$('.btnScrollRight', module).on('click', function(){
var panelBtnScrollLeft = $(this).parent().position().left;
var targetElem = null;
var oldscrollLeft = $('.nav', module).scrollLeft();
$('.nav', module).children('li').each(function(i){
var leftEdgeLeft = $(this).position().left;
var rightEdgeLeft = $(this).position().left + $(this).outerWidth(true);
if(oldscrollLeft <= leftEdgeLeft){
targetElem = $(this);
return false;
}
});
if(targetElem){
var scrollLeft = $('.nav', module).scrollLeft() + targetElem.position().left + targetElem.outerWidth(true) - panelBtnScrollLeft;
var scrollLeft2 = $('.nav', module).scrollLeft() + targetElem.outerWidth(true);
var marginRight = 0;
if(targetElem.is($('.nav>li:last', module))){
marginRight = $('.panelBtnScroll', module).outerWidth(true) + 10;
scrollLeft = getNavRealWidth();
}
$('.nav', module).stop().animate({'scrollLeft': scrollLeft2, 'margin-right': marginRight}, 300, function(){
setButtonDisabled();
});
}
});
$('.btnScrollLeft', module).on('click', function(){
var targetElem = null;
$('.nav', module).children('li').each(function(i){
if($(this).position().left + $(this).outerWidth(true) >= 0){
targetElem = $(this);
return false;
}
});
if(targetElem){
var scrollLeft = $('.nav', module).scrollLeft() + targetElem.position().left;
$('.nav', module).stop().animate({'scrollLeft': scrollLeft, 'margin-right': 0}, 300, function(){
setButtonDisabled();
});
}
});
function getNavRealWidth(){
var width = 0;
$('.nav>li', module).each(function(){
width += $(this).outerWidth(true);
});
return width;
}
function setButtonDisabled(){
if($('.nav', module).scrollLeft() == 0){
$('.btnScrollLeft', module).css('color', '#ccc');
}else{
$('.btnScrollLeft', module).css('color', '');
}
var navRealWidth = getNavRealWidth();
if($('.nav', module).scrollLeft() + $('.nav', module).outerWidth(true) >= navRealWidth && parseFloat($('.nav', module).css('margin-right') || 0) > 0){
$('.btnScrollRight', module).css('color', '#ccc');
}else{
$('.btnScrollRight', module).css('color', '');
}
}
function setPanelBtnScroll(){
var navRealWidth = getNavRealWidth();
if(isMobileBroswer()){
$('.nav', module).css('overflow', 'auto');
}else{
$('.nav', module).css('overflow', 'hidden');
}
if(!isMobileBroswer() && navRealWidth > $('.nav', module).width()){
$('.panelBtnScroll', module).show();
}else{
$('.panelBtnScroll', module).hide();
}
$('.panelBtnScroll').css({
'height': $('.nav', module).outerHeight(),
'padding-top': ($('.nav', module).outerHeight() - $('.panelBtnScroll>:first-child', module).outerHeight()) / 2
});
/*如果是新的标签模块;左右的按钮重新定位(基于按钮居中)*/
if(module.find('.ModuleTabContainerGiant').length>0){
var pdtp = Number($('.Nav-Container li', module).css('margin-top').replace(/px/,''))+$('.Nav-Container li', module).outerHeight()/2-11;
module.find('.panelBtnScroll').css({
'padding-top':pdtp
})
}
setButtonDisabled();
}
setPanelBtnScroll();
$(window).off('resize.tabContainer' + moduleID).on('resize.tabContainer' + moduleID, function(){
setPanelBtnScroll();
});
$('.panelBtnScroll, .nav', module).disableSelection();
}
}
// 重调全屏幻灯片模块
function adjustModuleFullSlide(moduleid){
moduleid = (moduleid + '').replace(/^module_/i, '');
var data = $('#module_' + moduleid).find('#Full' + moduleid).data('params');
if(data){
var height = $('#module_' + moduleid).height();
CoolSlide('#Full' + moduleid, height, data.effect, data.time, data.imgshowtype);
}
}
// 产品详情二维码控制
function initProductDetailQrcode(qrcodeText){
var moduleProductDetailQrcodeTimeoutId = "moduleProductDetailQrcode";
$(".icon-qrcode").on("mouseenter click",function(){
if (window[moduleProductDetailQrcodeTimeoutId]) {
clearTimeout(window[moduleProductDetailQrcodeTimeoutId]);
}
$("#divQrcode").remove();
var html = "";
html += "
" + qrcodeText + "
";
html += "
";
$("body").append(html);
$('#pro-qrcode').qrcode({text:location.href.replace(/(\?|#).*$/,''),width:140,height:140});
$("#divQrcode").css({top:$(this).offset().top + 30,left:$(this).offset().left - $('#divQrcode').width() + 30});
$('#divQrcode').off('mouseenter').on('mouseenter', function(){
if (window[moduleProductDetailQrcodeTimeoutId]) {
clearTimeout(window[moduleProductDetailQrcodeTimeoutId]);
}
});
$(".icon-qrcode, #divQrcode").off("mouseleave").on("mouseleave",function(evt){
evt = evt || window.event;
var relatedTarget = evt.relatedTarget || evt.toElement;
if ($(relatedTarget).is('.icon-qrcode, #divQrcode') || $(relatedTarget).closest('.icon-qrcode, #divQrcode').length > 0) {
return false;
}
if (window[moduleProductDetailQrcodeTimeoutId]) {
clearTimeout(window[moduleProductDetailQrcodeTimeoutId]);
}
window[moduleProductDetailQrcodeTimeoutId] = setTimeout(function() {
$("#divQrcode").remove();
}, 300);
});
});
}
//点击发送短信验证码
var InterValObj; //timer变量,控制时间
var count = 60; //间隔函数,1秒执行
var curCount;//当前剩余秒数
function sendMessage(ModuleID) {
var mobile = $('#resetMobile'+ModuleID).val();
var mobilereg = /^1[3|4|5|7|8]\d{9}$/;
if(!mobilereg.test(mobile)){
alert('请输入有效的手机号码!');
return false;
}
curCount = count;
//设置button效果,开始计时
$("#btnSendCode"+ModuleID).attr("disabled", "true");
$("#btnSendCode"+ModuleID).text("请在" + curCount + "秒内输入验证码");
InterValObj = window.setInterval(function(){SetRemainTime(ModuleID);}, 1000); //启动计时器,1秒执行一次
//向后台发送处理数据
$.ajax({
type: "POST", //用POST方式传输
dataType: "JSON", //数据格式:JSON
url: '/index.php?c=Front/Userlogin&a=getcode', //目标地址
data: {mobile:mobile},
error: function (XMLHttpRequest, textStatus, errorThrown) { },
success: function (data){
if(data.success){
alert(data.msg);
}
if(!data.success){
alert(data.msg);
}
}
});
}
//timer处理函数
function SetRemainTime(ModuleID) {
if (curCount == 0) {
window.clearInterval(InterValObj);//停止计时器
$("#btnSendCode"+ModuleID).removeAttr("disabled");//启用按钮
$("#btnSendCode"+ModuleID).text("重新发送验证码");
}
else {
curCount--;
$("#btnSendCode"+ModuleID).text("请在" + curCount + "秒内输入验证码");
}
}
//将url中的querystring转为对象
function getQueryParam(){
if(!document.location.search) return null;
var URLParams = new Object();
var aParams = document.location.search.substr(1).split('&');
for (i = 0 ; i < aParams.length ; i++) {
var aParam = aParams[i].split('=');
var value = aParam[1];
if(value && value.indexOf("#") > -1) value = value.substring(0,value.indexOf("#"));
URLParams[aParam[0]] = decodeURIComponent(value);
}
return URLParams;
}
//替换指定的模块
window.replaceModules = {};
function replaceModule(moduleid){
if(window.replaceModules['moduleid'] || moduleid == 0 || moduleid == 'module_0') return;
var params = getQueryParam();
var str = '';
for(key in params){
if(key != 'c' && key != 'moduleId') str += "&"+key+"="+escape(params[key]);
}
$.get("/index.php?c=front/LoadModule&moduleId=" + moduleid + str,null,function(data){
window.replaceModules['moduleid'] = true;
$('#' + moduleid).replaceWith(data);
$('#' + moduleid).find('.ModuleUserLogin,.ModuleUserLoginV2').find('.userLoginContent').show().css('visibility','visible');
});
}
// 获取当前页面url参数
if (!window.location.getQueryString) window.location.getQueryString = function (name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (r != null) return (r[2]); return null;
}
// jquery resize事件
if (!jQuery.resize) {
(function ($, h, c) { var a = $([]), e = $.resize = $.extend($.resize, {}), i, k = "setTimeout", j = "resize", d = j + "-special-event", b = "delay", f = "throttleWindow"; e[b] = 250; e[f] = true; $.event.special[j] = { setup: function () { if (!e[f] && this[k]) { return false } var l = $(this); a = a.add(l); $.data(this, d, { w: l.width(), h: l.height() }); if (a.length === 1) { g() } }, teardown: function () { if (!e[f] && this[k]) { return false } var l = $(this); a = a.not(l); l.removeData(d); if (!a.length) { clearTimeout(i) } }, add: function (l) { if (!e[f] && this[k]) { return false } var n; function m(s, o, p) { var q = $(this), r = $.data(this, d); r.w = o !== c ? o : q.width(); r.h = p !== c ? p : q.height(); n.apply(this, arguments) } if ($.isFunction(l)) { n = l; return m } else { n = l.handler; l.handler = m } } }; function g() { i = h[k](function () { a.each(function () { var n = $(this), m = n.width(), l = n.height(), o = $.data(this, d); if (m !== o.w || l !== o.h) { n.trigger(j, [o.w = m, o.h = l]) } }); g() }, e[b]) } })(jQuery, this);
}
// *** 分享推广代码
// 如果原来没有设置推广来源
//$(window).load(function(){
var match = window.location.href.match(/#invite(\d+)/i);
if(match){
if(window.location.toString().indexOf("debug") > -1) alert(document.cookie);
$.get("/index.php?c=SetCookie&name=invite&value=" + match[1]); //用js设置cookie会令.net取不到正确的值,要改为用aspnet的程序来设置
}
//});
// 生成当前用户的推广链接
var match = document.cookie.match(/WebUserID=(\d+)/i);
if(match){
var WebUserID = match[1];
var um = navigator.userAgent.match(/MicroMessenger/gi);
if(um || true){
if(window.location.toString().indexOf("#invite") == -1 && window.location.toString().indexOf("?invite=" + WebUserID) == -1){
window.location.href = window.location + "#invite" + WebUserID;
}
}
}
// *** END OF 分享推广代码
//*** start of 自动转换字体大小
var rootfont = parseFloat($("html").css('font-size'));
function torem(px){
if(px > 22) px = 22;
if(px < 12) px = 12;
return parseFloat(px / rootfont)+'rem';
}
function changeFontSize(parentObj){
if(SiteType != "1") return;
var modules = null;
var selector = ".ModuleNewsDetail,.ModuleNewsDetailV2,.ModuleProductDetail,.ModuleProductDetailV2,.ModuleImageTextV2,.ModuleImageText,.ModuleNewsDetailGiant,.ModuleProductDetailGiant,.ModuleImageTextGiant";
if(parentObj) modules = $(parentObj).find(selector);
else modules = $(selector);
modules.each(function(i,module){
var mp = $(module).closest(".ModuleItem");
if(mp.css("position") == "absolute") return;
var texts = null;
if(mp.is(".ModuleProductDetail") || mp.is(".ModuleProductDetailV2")) texts = $(module).find(".goods-detail-content,.pro-detail-content").find("div,span,td,p,li,a,font");
else if(mp.is(".ModuleNewsDetail") || mp.is(".ModuleNewsDetailV2")) texts = $(module).find(".NewsContent").find("div,span,td,p,li,a,font");
else texts = $(module).find("div,span,td,p,li,a,font");
texts.each(function(j,item){
if($(item).is(".goods-attrval-name"))return;
// clone后,就算没加到body,clone元素里面的图片资源也会真的去请求
// 这个特性会导致验证码失效,所以会另外一种方法
// var tmp = $(item).clone();
var tmp = $(item).children().length == 0 ? $(item).clone() : $(""+$(item).html().replace(/
]+c=validatecode[^>]+>/ig, '')+"
");
tmp.find(':nth-child(n)').remove();
if(tmp.text().trim().length <= 4) return;
if($(window).width() > 900){
if($(item).attr('ori-font-size')){
$(item).css('font-size',$(item).attr('ori-font-size'));
$(item).attr('ori-font-size',null);
}
if($(item).attr('ori-line-height')){
$(item).css('line-height',$(item).attr('ori-line-height'));
$(item).attr('ori-line-height',null);
}
return;
}
var oldfontsize = $(item).css('font-size');
var lineheightScal = parseFloat($(item).css('line-height'))/parseFloat(oldfontsize);
if(/(px)$/.test(oldfontsize)){
var fontsize = parseFloat(oldfontsize);
var newsize = torem(fontsize);
$(item).css('font-size',newsize);
if(!$(item).attr('ori-font-size')) $(item).attr('ori-font-size',oldfontsize);
if(lineheightScal > 1){
$(item).css('line-height',(lineheightScal*100)+"%"); //保持比例
if(!$(item).attr('ori-line-height')) $(item).attr('ori-line-height',(lineheightScal*100)+"%");
}
}
});
});
}
$(window).load(function(){ console.log('JScsipt 自动转换字体大小'); initSubtreeFont=function(){};changeFontSize()});
$(window).resize(function(){changeFontSize()});
//*** end of 自动转换字体大小
//** start of 模块浮动
if(typeof(floaters) != 'undefined'){ //一些独立的页面(比如店掌柜的)要加载JScript,但又不需要模块浮动的功能,就不必初始化了
var floatplayer = new floaters();
var floatElems = new Array();
function runFloaters(module,action) {
if(typeof(module) == 'string') module = $('#'+module);
if(action == 'remove'){
module.css("overflow-y",'auto');
module.css("display","block");
floatplayer.remove(module.attr('id'));
return;
}
if(/^(float\-)/i.test(module.attr('float'))){
module.css("overflow-y",'hidden');
module.appendTo("body");
module.show();
var top = parseInt(module.attr('floaty'));
if(isNaN(top)) top = parseInt(module.css('top'));
var id = module.attr('id');
if(/^(float\-left)/i.test(module.attr('float'))){
var left = parseInt(module.attr('floatx'));
if(isNaN(left)) left = parseInt(module.css('left'));
var options = {'floaterID':id,'distanceFromPageLeft':left,'distanceFromPageTop':top,width:module.css('width'),'xFloat':'left'};
var floatElem = floatplayer.addItem2(options,action);
floatElems.push(floatElem);
}else if(/^(float\-right)/i.test(module.attr('float'))){
var right = parseInt(module.attr('floatx'));
if(isNaN(right)) right = parseInt(module.css('right'));
var options = {'floaterID':id,'distanceFromPageRight':right,'distanceFromPageTop':top,'xFloat':'right'};
var floatElem = floatplayer.addItem2(options,action);
floatElems.push(floatElem);
}
floatplayer.play2();
}
}
setInterval(function(){
for(var k=0;k 110) height = 110;
if((st == "2" || st == "4") && height > 80) height = 80;
$(item).height(height);
});
var hasText = false;
m.find(".JiuGongItemText").each(function(i,item){
if(st == 4) $(item).css('line-height',$(item).height()+'px');
hasText = true;
});
//只有图标没有标题时,不限制图标的大小
if(hasText == false){
m.find(".JiuGongItemImg").each(function(i,item){
$(item).css({"width":"auto","height":"auto"});
});
m.find(".JiuGongItem").each(function(i,item){
$(item).css({"width":"auto","height":"auto"});
});
return;
}
var cc = parseInt(m.find('.JiuGongTab').attr("CellCount"));
if(st == "0"){ //上下结构
m.find(".JiuGongItemImg").each(function(i,item){
var w = 50,h = 50;
if(cc >=5 && m.width() < 700) w = 40,h = 40;
$(item).css({"max-width":w,"max-height":h});
});
}
if(st == "2"){ //左右结构
m.find(".JiuGongItemImg,.JiuGongItemImg2").each(function(i,item){
var w = 30,h = 30;
if(cc <=2) w = 40,h = 40;
if(m.width() > 700) w = 50,h = 50;
$(item).css({"min-width":w,"min-height":h});
});
}
}else{
var modules = $(".ModuleJiuGongV2").closest(".ModuleItem");
$.each(modules,function(i,item){
computeJiuGondHeight(item);
});
}
}
//地图模块初始化
var citylocation, map, marker, infoWin = null;
function moduleMap(latitude, longitude, title) {
var center = new qq.maps.LatLng(latitude, longitude);
var map = new qq.maps.Map(document.getElementById('mapContainer{{ModuleID}}'), {
center: center,
zoom: 13
});
infoWin = new qq.maps.InfoWindow({
map: map
});
infoWin.open();
infoWin.setContent(title);
infoWin.setPosition(map.getCenter());
marker = new qq.maps.Marker({
position: center,
draggable: true,
map: map
});
}
// swiper animation 效果
function runAnimate(jqobj,animate,duration,delay) {
$(jqobj).css({ "animation-name": animate, "animation-duration": duration, "animation-delay": delay }).one(
'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
$(jqobj).css({ "animation-name": "none", "animation-duration": "none", "animation-delay": "none" });
}
);
}
//模块悬停动画
function initHoverAnimate(){
$(document).on("mouseenter",".ModuleItem",function(){
if(typeof CanDesign != 'undefined' && CanDesign == 'False'){
var jqobj = $(this);
if($(jqobj).attr('hover-effect')){
runAnimate($(jqobj),$(jqobj).attr('hover-effect'),$(jqobj).attr('hover-duration'),$(jqobj).attr('hover-delay'));
}
}
});
$(document).on("mouseenter",".image-animation,img",function(){
if(typeof CanDesign != 'undefined' && CanDesign == 'False'){
var jqobj = $(this).closest(".ModuleItem");
var imgobj = $(this).closest(".image-animation");
if(imgobj.length == 0) imgobj = $(this);
if($(jqobj).attr('image-hover-effect')){
if($(jqobj).attr('image-hover-effect') == 'zoom'){ ImgZoom(imgobj); imgobj.on("mouseleave",function(){ unImgZoom(imgobj) });}
else runAnimate($(imgobj),$(jqobj).attr('image-hover-effect'),$(jqobj).attr('image-hover-duration'),$(jqobj).attr('image-hover-delay'));
}
}
});
}
// 强行改变建站的URL
function replaceNewShopUrl(){
var href = '';
var regExp = new RegExp('(^' + location.protocol + '//' + location.host + ')|(\\?.*$)', 'i');
$('a').each(function(){
href = ($(this).prop('href') || '');
href = href.replace(regExp, '');
if(/^\/userindex/i.test(href)){ //会员中心
$(this).attr('href', '/jumpUrl=userIndex')
}
if(/^\/OrderList/i.test(href)){ //订单
$(this).attr('href', '/jumpUrl=userIndex')
}
if(/^\/ProductOrder/i.test(href)){ //购物车
$(this).attr('href', '/jumpUrl=shopCart')
}
if(/^\/UserJiFen/i.test(href)){ //积分
$(this).attr('href', '/jumpUrl=userIndex')
}
if(/^\/UserFenXiao/i.test(href)){ //分销
$(this).attr('href', '/jumpUrl=userIndex')
}
if(/^\/UserMessage/i.test(href)){ //会员留言
$(this).attr('href', '/jumpUrl=userIndex')
}
if(/^\/UserModify/i.test(href)){ //会员信息
$(this).attr('href', '/jumpUrl=userIndex')
}
});
};// END OF /share/JScript.js
// STARTS OF /share/imagesloaded.pkgd.min.js
/*!
* imagesLoaded PACKAGED v3.2.0
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
(function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;th;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}return this}return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}function c(){}function d(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}return a}function e(c){function e(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||f("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=c("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var g=document.body||document.documentElement;g.appendChild(e);var h=j(e);l=200===b(h.width),g.removeChild(e)}}}function h(a){if(e(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var c=j(a);if("none"===c.display)return d();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var h=f.isBorderBox=!(!k||!c[k]||"border-box"!==c[k]),m=0,n=g.length;n>m;m++){var o=g[m],p=c[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=h&&l,y=b(c.width);y!==!1&&(f.width=y+(x?0:r+v));var z=b(c.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}var j,k,l,m=!1;return h}var f="undefined"==typeof console?c:function(a){console.error(a)},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property")):a.getSize=e(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){function b(a,b){return a[g](b)}function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}function e(a,d){return c(a),b(a,d)}var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={},a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){function f(a){for(var b in a)return!1;return b=null,!0}function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}function h(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}var i=a.getComputedStyle,j=i?function(a){return i(a,null)}:function(a){return a.currentStyle},k=d("transition"),l=d("transform"),m=k&&l,n=!!d("perspective"),o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[k],p=["transform","transition","transitionDuration","transitionProperty"],q=function(){for(var a={},b=0,c=p.length;c>b;b++){var e=p[b],f=d(e);f&&f!==e&&(a[e]=f)}return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=q[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=j(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=a[c?"left":"right"],f=a[d?"top":"bottom"],g=this.layout.size,h=-1!=e.indexOf("%")?parseFloat(e)/100*g.width:parseInt(e,10),i=-1!=f.indexOf("%")?parseFloat(f)/100*g.height:parseInt(f,10);h=isNaN(h)?0:h,i=isNaN(i)?0:i,h-=c?g.paddingLeft:g.paddingRight,i-=d?g.paddingTop:g.paddingBottom,this.position.x=h,this.position.y=i},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];c[e]=this.getXValue(g),c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];c[i]=this.getYValue(k),c[j]="",this.css(c),this.emitEvent("layout",[this])},g.prototype.getXValue=function(a){var b=this.layout.options;return b.percentPosition&&!b.isHorizontal?a/this.layout.size.width*100+"%":a+"px"},g.prototype.getYValue=function(a){var b=this.layout.options;return b.percentPosition&&b.isHorizontal?a/this.layout.size.height*100+"%":a+"px"},g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={};j.transform=this.getTranslate(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.getTranslate=function(a,b){var c=this.layout.options;return a=c.isOriginLeft?a:-a,b=c.isOriginTop?b:-b,n?"translate3d("+a+"px, "+b+"px, 0)":"translate("+a+"px, "+b+"px)"},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=m?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r="opacity,"+h(q.transform||"transform");g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(o,this,!1))},g.prototype.transition=g.prototype[k?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(o,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!k||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.dispatchEvent(a+"Complete",null,[b])}function d(){g++,g===f&&c()}var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.dispatchEvent=function(a,b,c){var d=b?[b].concat(c):c;if(this.emitEvent(a,d),i)if(this.$element=this.$element||i(this.element),b){var e=i.Event(b);e.type=a,this.$element.trigger(e,c)}else this.$element.trigger(a,c)},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]},g.create=function(a,b){function c(){g.apply(this,arguments)}return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d});;// END OF /share/masonry.pkgd.min.js
// STARTS OF /share/jquery-ui-1.10.4.custom.min.js
/*! jQuery UI - v1.10.4 - 2017-03-21
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.tabs.js
* Copyright jQuery Foundation and other contributors; Licensed MIT */
(function(t,e){function i(e,i){var n,o,a,r=e.nodeName.toLowerCase();return"area"===r?(n=e.parentNode,o=n.name,e.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap=#"+o+"]")[0],!!a&&s(a)):!1):(/input|select|textarea|button|object/.test(r)?!e.disabled:"a"===r?e.href||i:i)&&s(e)}function s(e){return t.expr.filters.visible(e)&&!t(e).parents().addBack().filter(function(){return"hidden"===t.css(this,"visibility")}).length}var n=0,o=/^ui-id-\d+$/;t.ui=t.ui||{},t.extend(t.ui,{version:"1.10.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),t.fn.extend({focus:function(e){return function(i,s){return"number"==typeof i?this.each(function(){var e=this;setTimeout(function(){t(e).focus(),s&&s.call(e)},i)}):e.apply(this,arguments)}}(t.fn.focus),scrollParent:function(){var e;return e=t.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(t.css(this,"position"))&&/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(t.css(this,"overflow")+t.css(this,"overflow-y")+t.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!e.length?t(document):e},zIndex:function(i){if(i!==e)return this.css("zIndex",i);if(this.length)for(var s,n,o=t(this[0]);o.length&&o[0]!==document;){if(s=o.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(n=parseInt(o.css("zIndex"),10),!isNaN(n)&&0!==n))return n;o=o.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){o.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])},focusable:function(e){return i(e,!isNaN(t.attr(e,"tabindex")))},tabbable:function(e){var s=t.attr(e,"tabindex"),n=isNaN(s);return(n||s>=0)&&i(e,!n)}}),t("").outerWidth(1).jquery||t.each(["Width","Height"],function(i,s){function n(e,i,s,n){return t.each(o,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),n&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var o="Width"===s?["Left","Right"]:["Top","Bottom"],a=s.toLowerCase(),r={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+s]=function(i){return i===e?r["inner"+s].call(this):this.each(function(){t(this).css(a,n(this,i)+"px")})},t.fn["outer"+s]=function(e,i){return"number"!=typeof e?r["outer"+s].call(this,e):this.each(function(){t(this).css(a,n(this,e,!0,i)+"px")})}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t(" ").data("a-b","a").removeData("a-b").data("a-b")&&(t.fn.removeData=function(e){return function(i){return arguments.length?e.call(this,t.camelCase(i)):e.call(this)}}(t.fn.removeData)),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),t.support.selectstart="onselectstart"in document.createElement("div"),t.fn.extend({disableSelection:function(){return this.bind((t.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(t){t.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),t.extend(t.ui,{plugin:{add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i){var s,n=t.plugins[e];if(n&&t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType)for(s=0;n.length>s;s++)t.options[n[s][0]]&&n[s][1].apply(t.element,i)}},hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)}})})(jQuery);(function(t,e){var i=0,s=Array.prototype.slice,n=t.cleanData;t.cleanData=function(e){for(var i,s=0;null!=(i=e[s]);s++)try{t(i).triggerHandler("remove")}catch(o){}n(e)},t.widget=function(i,s,n){var o,a,r,h,l={},c=i.split(".")[0];i=i.split(".")[1],o=c+"-"+i,n||(n=s,s=t.Widget),t.expr[":"][o.toLowerCase()]=function(e){return!!t.data(e,o)},t[c]=t[c]||{},a=t[c][i],r=t[c][i]=function(t,i){return this._createWidget?(arguments.length&&this._createWidget(t,i),e):new r(t,i)},t.extend(r,a,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),h=new s,h.options=t.widget.extend({},h.options),t.each(n,function(i,n){return t.isFunction(n)?(l[i]=function(){var t=function(){return s.prototype[i].apply(this,arguments)},e=function(t){return s.prototype[i].apply(this,t)};return function(){var i,s=this._super,o=this._superApply;return this._super=t,this._superApply=e,i=n.apply(this,arguments),this._super=s,this._superApply=o,i}}(),e):(l[i]=n,e)}),r.prototype=t.widget.extend(h,{widgetEventPrefix:a?h.widgetEventPrefix||i:i},l,{constructor:r,namespace:c,widgetName:i,widgetFullName:o}),a?(t.each(a._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,r,i._proto)}),delete a._childConstructors):s._childConstructors.push(r),t.widget.bridge(i,r)},t.widget.extend=function(i){for(var n,o,a=s.call(arguments,1),r=0,h=a.length;h>r;r++)for(n in a[r])o=a[r][n],a[r].hasOwnProperty(n)&&o!==e&&(i[n]=t.isPlainObject(o)?t.isPlainObject(i[n])?t.widget.extend({},i[n],o):t.widget.extend({},o):o);return i},t.widget.bridge=function(i,n){var o=n.prototype.widgetFullName||i;t.fn[i]=function(a){var r="string"==typeof a,h=s.call(arguments,1),l=this;return a=!r&&h.length?t.widget.extend.apply(null,[a].concat(h)):a,r?this.each(function(){var s,n=t.data(this,o);return n?t.isFunction(n[a])&&"_"!==a.charAt(0)?(s=n[a].apply(n,h),s!==n&&s!==e?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):e):t.error("no such method '"+a+"' for "+i+" widget instance"):t.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+a+"'")}):this.each(function(){var e=t.data(this,o);e?e.option(a||{})._init():t.data(this,o,new n(a,this))}),l}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"",options:{disabled:!1,create:null},_createWidget:function(e,s){s=t(s||this.defaultElement||this)[0],this.element=t(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this.bindings=t(),this.hoverable=t(),this.focusable=t(),s!==this&&(t.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===s&&this.destroy()}}),this.document=t(s.style?s.ownerDocument:s.document||s),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:t.noop,_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(t.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:t.noop,widget:function(){return this.element},option:function(i,s){var n,o,a,r=i;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof i)if(r={},n=i.split("."),i=n.shift(),n.length){for(o=r[i]=t.widget.extend({},this.options[i]),a=0;n.length-1>a;a++)o[n[a]]=o[n[a]]||{},o=o[n[a]];if(i=n.pop(),1===arguments.length)return o[i]===e?null:o[i];o[i]=s}else{if(1===arguments.length)return this.options[i]===e?null:this.options[i];r[i]=s}return this._setOptions(r),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return this.options[t]=e,"disabled"===t&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!e).attr("aria-disabled",e),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var o,a=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=o=t(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,o=this.widget()),t.each(n,function(n,r){function h(){return i||a.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof r?a[r]:r).apply(a,arguments):e}"string"!=typeof r&&(h.guid=r.guid=r.guid||h.guid||t.guid++);var l=n.match(/^(\w+)\s*(.*)$/),c=l[1]+a.eventNamespace,u=l[2];u?o.delegate(u,c,h):s.bind(c,h)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.unbind(e).undelegate(e)},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){t(e.currentTarget).addClass("ui-state-hover")},mouseleave:function(e){t(e.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){t(e.currentTarget).addClass("ui-state-focus")},focusout:function(e){t(e.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}})})(jQuery);(function(t){var e=!1;t(document).mouseup(function(){e=!1}),t.widget("ui.mouse",{version:"1.10.4",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.bind("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).bind("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!e){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,o="string"==typeof this.options.cancel&&i.target.nodeName?t(i.target).closest(this.options.cancel).length:!1;return n&&!o&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===t.data(i.target,this.widgetName+".preventClickEvent")&&t.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return s._mouseMove(t)},this._mouseUpDelegate=function(t){return s._mouseUp(t)},t(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),e=!0,!0)):!0}},_mouseMove:function(e){return t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button?this._mouseUp(e):this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){return t(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),!1},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var o,a=Math.max,r=Math.abs,l=Math.round,h=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(o!==e)return o;var i,s,n=t("
"),a=n.children()[0];return t("body").append(n),i=a.offsetWidth,n.css("overflow","scroll"),s=a.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),o=i-s},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width
s?"left":i>0?"right":"center",vertical:0>o?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(l.horizontal="center"),d>g&&g>r(n+o)&&(l.vertical="middle"),l.important=a(r(i),r(s))>a(r(n),r(o))?"horizontal":"vertical",e.using.call(this,t,l)}),c.offset(t.extend(I,{using:h}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-o-n;e.collisionWidth>o?l>0&&0>=h?(i=t.left+l+e.collisionWidth-o-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+o-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=a(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,o=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-o-n;e.collisionHeight>o?l>0&&0>=h?(i=t.top+l+e.collisionHeight-o-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+o-e.collisionHeight:n:l>0?t.top+=l:h>0?t.top-=h:t.top=a(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,a=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-a-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-a-o,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,a=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-a-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-a-o,t.top+p+f+g>c&&(0>s||r(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,t.top+p+f+g>u&&(i>0||u>r(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,o,a=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(a?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},a&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(o in s)e.style[o]=s[o];e.appendChild(r),i=a||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);(function(t){t.widget("ui.draggable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"!==this.options.helper||/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},_destroy:function(){this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(t(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){t("
").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(t(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_mouseDrag:function(e,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||t.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1):!1},_mouseUp:function(e){return t("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.element.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,t(document).width()-this.helperProportions.width-this.margins.left,(t(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(e){var i,s,n,o,a=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=e.pageX,h=e.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,e.pageX-this.offset.click.lefti[2]&&(l=i[2]+this.offset.click.left),e.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,h=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s]),"drag"===e&&(this.positionAbs=this._convertPositionTo("absolute")),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i){var s=t(this).data("ui-draggable"),n=s.options,o=t.extend({},i,{item:s.element});s.sortables=[],t(n.connectToSortable).each(function(){var i=t.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",e,o))})},stop:function(e,i){var s=t(this).data("ui-draggable"),n=t.extend({},i,{item:s.element});t.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(e),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",e,n))})},drag:function(e,i){var s=t(this).data("ui-draggable"),n=this;t.each(s.sortables,function(){var o=!1,a=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(o=!0,t.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==a&&this.instance._intersectsWith(this.instance.containerCache)&&t.contains(a.instance.element[0],this.instance.element[0])&&(o=!1),o})),o?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=t(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},e.target=this.instance.currentItem[0],this.instance._mouseCapture(e,!0),this.instance._mouseStart(e,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",e),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(e)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",e,this.instance._uiHash(this.instance)),this.instance._mouseStop(e,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",e),s.dropped=!1)})}}),t.ui.plugin.add("draggable","cursor",{start:function(){var e=t("body"),i=t(this).data("ui-draggable").options;e.css("cursor")&&(i._cursor=e.css("cursor")),e.css("cursor",i.cursor)},stop:function(){var e=t(this).data("ui-draggable").options;e._cursor&&t("body").css("cursor",e._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(){var e=t(this).data("ui-draggable");e.scrollParent[0]!==document&&"HTML"!==e.scrollParent[0].tagName&&(e.overflowOffset=e.scrollParent.offset())},drag:function(e){var i=t(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-e.pageY=0;u--)r=p.snapElements[u].left,l=r+p.snapElements[u].width,h=p.snapElements[u].top,c=h+p.snapElements[u].height,r-g>_||m>l+g||h-g>b||v>c+g||!t.contains(p.snapElements[u].item.ownerDocument,p.snapElements[u].item)?(p.snapElements[u].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=!1):("inner"!==f.snapMode&&(s=g>=Math.abs(h-b),n=g>=Math.abs(c-v),o=g>=Math.abs(r-_),a=g>=Math.abs(l-m),s&&(i.position.top=p._convertPositionTo("relative",{top:h-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l}).left-p.margins.left)),d=s||n||o||a,"outer"!==f.snapMode&&(s=g>=Math.abs(h-v),n=g>=Math.abs(c-b),o=g>=Math.abs(r-m),a=g>=Math.abs(l-_),s&&(i.position.top=p._convertPositionTo("relative",{top:h,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:c-p.helperProportions.height,left:0}).top-p.margins.top),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:l-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[u].snapping&&(s||n||o||a||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,e,t.extend(p._uiHash(),{snapItem:p.snapElements[u].item})),p.snapElements[u].snapping=s||n||o||a||d)}}),t.ui.plugin.add("draggable","stack",{start:function(){var e,i=this.data("ui-draggable").options,s=t.makeArray(t(i.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});s.length&&(e=parseInt(t(s[0]).css("zIndex"),10)||0,t(s).each(function(i){t(this).css("zIndex",e+i)}),this.css("zIndex",e+s.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i){var s=t(i.helper),n=t(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(e,i){var s=t(this).data("ui-draggable").options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}})})(jQuery);(function(t){function e(t,e,i){return t>e&&e+i>t}t.widget("ui.droppable",{version:"1.10.4",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],undefined):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},t.ui.ddmanager.droppables[i.scope]=t.ui.ddmanager.droppables[i.scope]||[],t.ui.ddmanager.droppables[i.scope].push(this),i.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var e=0,i=t.ui.ddmanager.droppables[this.options.scope];i.length>e;e++)i[e]===this&&i.splice(e,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(e,i){"accept"===e&&(this.accept=t.isFunction(i)?i:function(t){return t.is(i)}),t.Widget.prototype._setOption.apply(this,arguments)},_activate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var e=t.data(this,"ui-droppable");return e.options.greedy&&!e.options.disabled&&e.options.scope===s.options.scope&&e.accept.call(e.element[0],s.currentItem||s.element)&&t.ui.intersect(s,t.extend(e,{offset:e.element.offset()}),e.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}}}),t.ui.intersect=function(t,i,s){if(!i.offset)return!1;var n,o,a=(t.positionAbs||t.position.absolute).left,r=(t.positionAbs||t.position.absolute).top,l=a+t.helperProportions.width,h=r+t.helperProportions.height,c=i.offset.left,u=i.offset.top,d=c+i.proportions().width,p=u+i.proportions().height;switch(s){case"fit":return a>=c&&d>=l&&r>=u&&p>=h;case"intersect":return a+t.helperProportions.width/2>c&&d>l-t.helperProportions.width/2&&r+t.helperProportions.height/2>u&&p>h-t.helperProportions.height/2;case"pointer":return n=(t.positionAbs||t.position.absolute).left+(t.clickOffset||t.offset.click).left,o=(t.positionAbs||t.position.absolute).top+(t.clickOffset||t.offset.click).top,e(o,u,i.proportions().height)&&e(n,c,i.proportions().width);case"touch":return(r>=u&&p>=r||h>=u&&p>=h||u>r&&h>p)&&(a>=c&&d>=a||l>=c&&d>=l||c>a&&l>d);default:return!1}},t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&t.ui.intersect(e,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").bind("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=t.ui.intersect(e,this,this.options.tolerance),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t.data(this,"ui-droppable").options.scope===n}),o.length&&(s=t.data(o[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").unbind("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}}})(jQuery);(function(t){function e(t){return parseInt(t,10)||0}function i(t){return!isNaN(parseInt(t,10))}t.widget("ui.resizable",t.ui.mouse,{version:"1.10.4",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var e,i,s,n,o,a=this,r=this.options;if(this.element.addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(t("
").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),e=this.handles.split(","),this.handles={},i=0;e.length>i;i++)s=t.trim(e[i]),o="ui-resizable-"+s,n=t("
"),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=t(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),t(this.handles[i]).length},this._renderAxis(this.element),this._handles=t(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),t(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(t(this).removeClass("ui-resizable-autohide"),a._handles.show())}).mouseleave(function(){r.disabled||a.resizing||(t(this).addClass("ui-resizable-autohide"),a._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,o,a=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=e(this.helper.css("left")),n=e(this.helper.css("top")),a.containment&&(s+=t(a.containment).scrollLeft()||0,n+=t(a.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof a.aspectRatio?a.aspectRatio:this.originalSize.width/this.originalSize.height||1,o=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===o?this.axis+"-resize":o),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(e){var i,s=this.helper,n={},o=this.originalMousePosition,a=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,c=this.size.height,u=e.pageX-o.left||0,d=e.pageY-o.top||0,p=this._change[a];return p?(i=p.apply(this,[e,u,d]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==c&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||this._trigger("resize",e,this.ui()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&t.ui.hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null,h=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(t){var e,s,n,o,a,r=this.options;a={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||t)&&(e=a.minHeight*this.aspectRatio,n=a.minWidth/this.aspectRatio,s=a.maxHeight*this.aspectRatio,o=a.maxWidth/this.aspectRatio,e>a.minWidth&&(a.minWidth=e),n>a.minHeight&&(a.minHeight=n),a.maxWidth>s&&(a.maxWidth=s),a.maxHeight>o&&(a.maxHeight=o)),this._vBoundaries=a},_updateCache:function(t){this.offset=this.helper.offset(),i(t.left)&&(this.position.left=t.left),i(t.top)&&(this.position.top=t.top),i(t.height)&&(this.size.height=t.height),i(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,s=this.size,n=this.axis;return i(t.height)?t.width=t.height*this.aspectRatio:i(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(s.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(s.height-t.height),t.left=e.left+(s.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,s=this.axis,n=i(t.width)&&e.maxWidth&&e.maxWidtht.width,r=i(t.height)&&e.minHeight&&e.minHeight>t.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,c=/sw|nw|w/.test(s),u=/nw|ne|n/.test(s);return a&&(t.width=e.minWidth),r&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),o&&(t.height=e.maxHeight),a&&c&&(t.left=h-e.minWidth),n&&c&&(t.left=h-e.maxWidth),r&&u&&(t.top=l-e.minHeight),o&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var t,e,i,s,n,o=this.helper||this.element;for(t=0;this._proportionallyResizeElements.length>t;t++){if(n=this._proportionallyResizeElements[t],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],e=0;i.length>e;e++)this.borderDif[e]=(parseInt(i[e],10)||0)+(parseInt(s[e],10)||0);n.css({height:o.height()-this.borderDif[0]-this.borderDif[2]||0,width:o.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("
"),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&t.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,c=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,o,a,r,h,l=t(this).data("ui-resizable"),c=l.options,u=l.element,d=c.containment,p=d instanceof t?d.get(0):/parent/.test(d)?u.parent().get(0):d;p&&(l.containerElement=t(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(i=t(p),s=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){s[t]=e(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,o=l.containerSize.height,a=l.containerSize.width,r=t.ui.hasScroll(p,"left")?p.scrollWidth:a,h=t.ui.hasScroll(p)?p.scrollHeight:o,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(e){var i,s,n,o,a=t(this).data("ui-resizable"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio),a.position.top=a._helper?h.top:0),a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top,i=Math.abs((a._helper?a.offset.left-u.left:a.offset.left-u.left)+a.sizeDiff.width),s=Math.abs((a._helper?a.offset.top-u.top:a.offset.top-h.top)+a.sizeDiff.height),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o&&(i-=Math.abs(a.parentData.left)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio))},stop:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=function(e){t(e).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseInt(e.width(),10),height:parseInt(e.height(),10),left:parseInt(e.css("left"),10),top:parseInt(e.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):t.each(i.alsoResize,function(t){s(t)})},resize:function(e,i){var s=t(this).data("ui-resizable"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0},h=function(e,s){t(e).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),o={},a=s&&s.length?s:e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(a,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(o[e]=i||null)}),e.css(o)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):t.each(n.alsoResize,function(t,e){h(t,e)})},stop:function(){t(this).removeData("resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).data("ui-resizable");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).data("ui-resizable");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e=t(this).data("ui-resizable"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&d>i.maxWidth,g=i.maxHeight&&p>i.maxHeight,m=i.minWidth&&i.minWidth>d,_=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),_&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):(p-l>0?(e.size.height=p,e.position.top=o.top-u):(e.size.height=l,e.position.top=o.top+n.height-l),d-h>0?(e.size.width=d,e.position.left=o.left-c):(e.size.width=h,e.position.left=o.left+n.width-h))}})})(jQuery);(function(t){var e,i="ui-button ui-widget ui-state-default ui-corner-all",s="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",n=function(){var e=t(this);setTimeout(function(){e.find(":ui-button").button("refresh")},1)},o=function(e){var i=e.name,s=e.form,n=t([]);return i&&(i=i.replace(/'/g,"\\'"),n=s?t(s).find("[name='"+i+"']"):t("[name='"+i+"']",e.ownerDocument).filter(function(){return!this.form})),n};t.widget("ui.button",{version:"1.10.4",defaultElement:"",options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset"+this.eventNamespace).bind("reset"+this.eventNamespace,n),"boolean"!=typeof this.options.disabled?this.options.disabled=!!this.element.prop("disabled"):this.element.prop("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var s=this,a=this.options,r="checkbox"===this.type||"radio"===this.type,h=r?"":"ui-state-active";null===a.label&&(a.label="input"===this.type?this.buttonElement.val():this.buttonElement.html()),this._hoverable(this.buttonElement),this.buttonElement.addClass(i).attr("role","button").bind("mouseenter"+this.eventNamespace,function(){a.disabled||this===e&&t(this).addClass("ui-state-active")}).bind("mouseleave"+this.eventNamespace,function(){a.disabled||t(this).removeClass(h)}).bind("click"+this.eventNamespace,function(t){a.disabled&&(t.preventDefault(),t.stopImmediatePropagation())}),this._on({focus:function(){this.buttonElement.addClass("ui-state-focus")},blur:function(){this.buttonElement.removeClass("ui-state-focus")}}),r&&this.element.bind("change"+this.eventNamespace,function(){s.refresh()}),"checkbox"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){return a.disabled?!1:undefined}):"radio"===this.type?this.buttonElement.bind("click"+this.eventNamespace,function(){if(a.disabled)return!1;t(this).addClass("ui-state-active"),s.buttonElement.attr("aria-pressed","true");var e=s.element[0];o(e).not(e).map(function(){return t(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown"+this.eventNamespace,function(){return a.disabled?!1:(t(this).addClass("ui-state-active"),e=this,s.document.one("mouseup",function(){e=null}),undefined)}).bind("mouseup"+this.eventNamespace,function(){return a.disabled?!1:(t(this).removeClass("ui-state-active"),undefined)}).bind("keydown"+this.eventNamespace,function(e){return a.disabled?!1:((e.keyCode===t.ui.keyCode.SPACE||e.keyCode===t.ui.keyCode.ENTER)&&t(this).addClass("ui-state-active"),undefined)}).bind("keyup"+this.eventNamespace+" blur"+this.eventNamespace,function(){t(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(e){e.keyCode===t.ui.keyCode.SPACE&&t(this).click()})),this._setOption("disabled",a.disabled),this._resetButton()},_determineButtonType:function(){var t,e,i;this.type=this.element.is("[type=checkbox]")?"checkbox":this.element.is("[type=radio]")?"radio":this.element.is("input")?"input":"button","checkbox"===this.type||"radio"===this.type?(t=this.element.parents().last(),e="label[for='"+this.element.attr("id")+"']",this.buttonElement=t.find(e),this.buttonElement.length||(t=t.length?t.siblings():this.element.siblings(),this.buttonElement=t.filter(e),this.buttonElement.length||(this.buttonElement=t.find(e))),this.element.addClass("ui-helper-hidden-accessible"),i=this.element.is(":checked"),i&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.prop("aria-pressed",i)):this.buttonElement=this.element},widget:function(){return this.buttonElement},_destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(i+" ui-state-active "+s).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title")},_setOption:function(t,e){return this._super(t,e),"disabled"===t?(this.element.prop("disabled",!!e),e&&this.buttonElement.removeClass("ui-state-focus"),undefined):(this._resetButton(),undefined)},refresh:function(){var e=this.element.is("input, button")?this.element.is(":disabled"):this.element.hasClass("ui-button-disabled");e!==this.options.disabled&&this._setOption("disabled",e),"radio"===this.type?o(this.element[0]).each(function(){t(this).is(":checked")?t(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):t(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):"checkbox"===this.type&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if("input"===this.type)return this.options.label&&this.element.val(this.options.label),undefined;var e=this.buttonElement.removeClass(s),i=t(" ",this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),n=this.options.icons,o=n.primary&&n.secondary,a=[];n.primary||n.secondary?(this.options.text&&a.push("ui-button-text-icon"+(o?"s":n.primary?"-primary":"-secondary")),n.primary&&e.prepend(" "),n.secondary&&e.append(" "),this.options.text||(a.push(o?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||e.attr("title",t.trim(i)))):a.push("ui-button-text-only"),e.addClass(a.join(" "))}}),t.widget("ui.buttonset",{version:"1.10.4",options:{items:"button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(t,e){"disabled"===t&&this.buttons.button("option",t,e),this._super(t,e)},refresh:function(){var e="rtl"===this.element.css("direction");this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},_destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return t(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy")}})})(jQuery);(function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("
"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(o.inline?e.parent()[0]:o.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.4"}});var o,a="datepicker";t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("
")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,a,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t(""+a+" "),e[r?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t(" ").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t(" ").addClass(this._triggerClass).html(o?t(" ").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,a,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,o,r){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t(" "),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],a,p)),n(p.settings,o||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=r?r.length?r:[r.pageX,r.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],a,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,a);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,a),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,a);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,a)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,o){var a,r,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(a=s||{},"string"==typeof s&&(a={},a[s]=o),c&&(this._curInst===c&&this._hideDatepicker(),r=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,a),null!==h&&a.dateFormat!==e&&a.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&a.dateFormat!==e&&a.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in a&&(a.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,r),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,o=t.datepicker._getInst(i.target);return t.datepicker._get(o,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(o,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,o,a,r,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),o=s?s.apply(e,[e,i]):{},o!==!1&&(n(i.settings,o),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),a=!1,t(e).parents().each(function(){return a|="fixed"===t(this).css("position"),!a}),r={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),r=t.datepicker._checkOffset(i,r,a),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":a?"fixed":"absolute",display:"none",left:r.left+"px",top:r.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,o=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],a=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,r=this._curInst;!r||e&&r!==t.data(e,a)||this._datepickerShowing&&(i=this._get(r,"showAnim"),s=this._get(r,"duration"),n=function(){t.datepicker._tidyDialog(r)},t.effects&&(t.effects.effect[i]||t.effects[i])?r.dpDiv.hide(i,t.datepicker._get(r,"showOptions"),s,n):r.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(r,"onClose"),o&&o.apply(r.input?r.input[0]:null,[r.input?r.input.val():"",r]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var o,a,r,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,g=(n?n.monthNames:null)||this._defaults.monthNames,m=-1,_=-1,v=-1,b=-1,y=!1,w=function(t){var e=i.length>o+1&&i.charAt(o+1)===t;return e&&o++,e},k=function(t){var e=w(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),o=s.substring(l).match(n);if(!o)throw"Missing number at position "+l;return l+=o[0].length,parseInt(o[0],10)},x=function(i,n,o){var a=-1,r=t.map(w(i)?o:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(r,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(a=i[0],l+=n.length,!1):e}),-1!==a)return a+1;throw"Unknown name at position "+l},C=function(){if(s.charAt(l)!==i.charAt(o))throw"Unexpected literal at position "+l;l++};for(o=0;i.length>o;o++)if(y)"'"!==i.charAt(o)||w("'")?C():y=!1;else switch(i.charAt(o)){case"d":v=k("d");break;case"D":x("D",d,p);break;case"o":b=k("o");break;case"m":_=k("m");break;case"M":_=x("M",f,g);break;case"y":m=k("y");break;case"@":h=new Date(k("@")),m=h.getFullYear(),_=h.getMonth()+1,v=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),m=h.getFullYear(),_=h.getMonth()+1,v=h.getDate();break;case"'":w("'")?C():y=!0;break;default:C()}if(s.length>l&&(r=s.substr(l),!/^\s+/.test(r)))throw"Extra/unparsed characters found in date: "+r;if(-1===m?m=(new Date).getFullYear():100>m&&(m+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=m?0:-100)),b>-1)for(_=1,v=b;;){if(a=this._getDaysInMonth(m,_-1),a>=v)break;_++,v-=a}if(h=this._daylightSavingAdjust(new Date(m,_-1,v)),h.getFullYear()!==m||h.getMonth()+1!==_||h.getDate()!==v)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,I,T,M,P,S,H,A,z,O,N,E,W,F,R,L=new Date,Y=this._daylightSavingAdjust(new Date(L.getFullYear(),L.getMonth(),L.getDate())),B=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),K=this._get(t,"hideIfNoPrevNext"),q=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),$=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=Q&&Q>e?Q:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=q?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-$,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?""+i+" ":K?"":""+i+" ",n=this._get(t,"nextText"),n=q?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+$,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?""+n+" ":K?"":""+n+" ",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:Y,a=q?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":""+this._get(t,"closeText")+" ",l=j?""+(B?h:"")+(this._isInRange(t,r)?""+a+" ":"")+(B?"":h)+"
":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",T="",X){if(T+=""}for(T+="
"+"",M=u?""+this._get(t,"weekHeader")+" ":"",w=0;7>w;w++)P=(w+c)%7,M+="=5?" class='ui-datepicker-week-end'":"")+">"+""+p[P]+" ";for(T+=M+" ",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((H+S)/7),z=X?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,O=this._daylightSavingAdjust(new Date(te,Z,1-H)),N=0;z>N;N++){for(T+="",E=u?""+this._get(t,"calculateWeek")(O)+" ":"",w=0;7>w;w++)W=m?m.apply(t.input?t.input[0]:null,[O]):[!0,""],F=O.getMonth()!==Z,R=F&&!v||!W[0]||Q&&Q>O||J&&O>J,E+=""+(F&&!_?" ":R?""+O.getDate()+" ":""+O.getDate()+" ")+" ",O.setDate(O.getDate()+1),O=this._daylightSavingAdjust(O);T+=E+" "}Z++,Z>11&&(Z=0,te++),T+="
"+(X?"
"+(U[0]>0&&C===U[1]-1?"
":""):""),x+=T}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="",y="";if(o||!m)y+=""+a[e]+" ";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+=""+r[c]+" ");y+=" "}if(v||(b+=y+(!o&&m&&_?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!_)b+=""+i+" ";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);
return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="";g>=f;f++)t.yearshtml+=""+f+" ";t.yearshtml+=" ",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":" ")+y),b+="
"},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.4"})(jQuery);(function(t){var e={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},i={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};t.widget("ui.dialog",{version:"1.10.4",options:{appendTo:"body",autoOpen:!0,buttons:[],closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i,s=this;if(this._isOpen&&this._trigger("beforeClose",e)!==!1){if(this._isOpen=!1,this._destroyOverlay(),!this.opener.filter(":focusable").focus().length)try{i=this.document[0].activeElement,i&&"body"!==i.nodeName.toLowerCase()&&t(i).blur()}catch(n){}this._hide(this.uiDialog,this.options.hide,function(){s._trigger("close",e)})}},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("
").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("
").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("
").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html(" "),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("
").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},o={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("
",s).button(o).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){s.position=[o.position.left-i.document.scrollLeft(),o.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,o=!1,a={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(o=!0),t in i&&(a[t]=s)}),o&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",a)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("
").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("
").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})})(jQuery);(function(t,e){function i(){return++n}function s(t){return t=t.cloneNode(!1),t.hash.length>1&&decodeURIComponent(t.href.replace(o,""))===decodeURIComponent(location.href.replace(o,""))}var n=0,o=/#.*$/;t.widget("ui.tabs",{version:"1.10.4",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,o){return t(o).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),o=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:o=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,o),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var o,a,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),c=l.attr("aria-controls");s(n)?(o=n.hash,a=e.element.find(e._sanitizeSelector(o))):(r=e._tabId(l),o="#"+r,a=e.element.find(o),a.length||(a=e._createPanel(r),a.insertAfter(e.panels[i-1]||e.tablist)),a.attr("aria-live","polite")),a.length&&(e.panels=e.panels.add(a)),c&&l.data("ui-tabs-aria-controls",c),l.attr({"aria-controls":o.substring(1),"aria-labelledby":h}),a.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.tablist||this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("
").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,o=this.tabs.eq(e),a=o.find(".ui-tabs-anchor"),r=this._getPanelForTab(o),h={tab:o,panel:r};s(a[0])||(this.xhr=t.ajax(this._ajaxSettings(a,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(o.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),o.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery);;// END OF /share/jquery-ui-1.10.4.custom.min.js
// STARTS OF /share/bootstrap.min.js
/*!
* Bootstrap v3.3.4 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.4",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.4",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.4",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.4",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.4",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('
').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j
').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.adjustDialog()},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport),this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-m
p.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.4",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.4",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.4",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a(document.body).height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);;// END OF /share/bootstrap.min.js
// STARTS OF /scripts/iconfont/iconfont.js
(function(window){var svgSprite=' ';var script=function(){var scripts=document.getElementsByTagName("script");return scripts[scripts.length-1]}();var shouldInjectCss=script.getAttribute("data-injectcss");var ready=function(fn){if(document.addEventListener){if(~["complete","loaded","interactive"].indexOf(document.readyState)){setTimeout(fn,0)}else{var loadFn=function(){document.removeEventListener("DOMContentLoaded",loadFn,false);fn()};document.addEventListener("DOMContentLoaded",loadFn,false)}}else if(document.attachEvent){IEContentLoaded(window,fn)}function IEContentLoaded(w,fn){var d=w.document,done=false,init=function(){if(!done){done=true;fn()}};var polling=function(){try{d.documentElement.doScroll("left")}catch(e){setTimeout(polling,50);return}init()};polling();d.onreadystatechange=function(){if(d.readyState=="complete"){d.onreadystatechange=null;init()}}}};var before=function(el,target){target.parentNode.insertBefore(el,target)};var prepend=function(el,target){if(target.firstChild){before(el,target.firstChild)}else{target.appendChild(el)}};function appendSvg(){var div,svg;div=document.createElement("div");div.innerHTML=svgSprite;svgSprite=null;svg=div.getElementsByTagName("svg")[0];if(svg){svg.setAttribute("aria-hidden","true");svg.style.position="absolute";svg.style.width=0;svg.style.height=0;svg.style.overflow="hidden";prepend(svg,document.body)}}if(shouldInjectCss&&!window.__iconfont__svg__cssinject__){window.__iconfont__svg__cssinject__=true;try{document.write("")}catch(e){console&&console.log(e)}}ready(appendSvg)})(window);// END OF /scripts/iconfont/iconfont.js
// STARTS OF /scripts/imgdelayload.js
//是否为ie,并读出ie版本
window.isIE = !! navigator.userAgent.match(/MSIE\b\s*([0-9]\.[0-9]);/img);
window.isIE && (window.isIE = RegExp.$1);
window.delayImages = [];
window.delayScroll = function(){
try{
//是否为chrome
var isGoo = !! navigator.userAgent.match(/AppleWebKit\b/img);
//获得可以触发scroll事件的对象
var box = window.isIE ? document.documentElement : document;
//读取滚动条的位置和浏览器窗口的显示大小
var doctop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop,
left = document.documentElement.scrollLeft || window.pageXOffset || document.body.scrollLeft,
width = document.documentElement.clientWidth,
height = document.documentElement.clientHeight;
//对所有图片进行批量判断是否在浏览器显示区域内
for (var i = 0; i < window.delayImages.length; i++) {
var _top = $(window.delayImages[i]).offset().top,
_left = $(window.delayImages[i]).offset().left;
//判断图片是否在显示区域内,有50个像素的偏移是为了提前预加载
//(_top + 100 >= doctop && _left >= left && _top - 100 <= doctop + height && _left <= left + width)
//当图片是居中对齐时,因为loading图很小,而图片的父框可能比较大,这里拿到的 _left > left + width,导致图片永远不能被加载,暂时不限制横向宽度,
//这样会导致有横向滚动条时,当拖动到否一位置时,右侧的所有图片都会被加载,但很少网站有横向滚动条,先不管了
var needshow = _top == 0; //一般图片在滚动组件内的情况(如新闻,产品等的滚动显示
needshow |= (_top + 100 >= doctop && _left >= left && _top - 100 <= doctop + height); //图片在可视区域的情况
needshow |= doctop + height + 400 > $(document).height(); //拖动到页底的情况,理想情况下其实不需要这行,因为理论上 doctop + height == $(document).height(),但在手机上实际获取到的scroll好像有点问题,所以+500
if (needshow){
var _src = window.delayImages[i].getAttribute('_src');
var _images = $("img[_src='"+_src+"']"); //有些图片对象是事后通过脚本复制来的,重新获取下这个图片,保证浏览器能找到这个对象
for(var k = 0;k < _images.length;k++){
//如果图片已经显示,则取消赋值
if (_src && $(_images[k]).attr('src') !== _src && (_top == 0 || $(_images[k]).is(":visible"))) {
$(_images[k]).attr('src',_src);
$(_images[k]).css('background','none');
}
}
}
}
}catch(e){
console.log('imgdelayload.js',e);
}
}
function check_webp_feature(feature, callback) {
var kTestImages = {
lossy: "UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",
lossless: "UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",
alpha: "UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",
animation: "UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"
};
var img = new Image();
img.onload = function () {
var result = (img.width > 0) && (img.height > 0);
callback(feature, result);
};
img.onerror = function () {
callback(feature, false);
};
img.src = "data:image/webp;base64," + kTestImages[feature];
}
window.supportWebp = false;
check_webp_feature('alpha',function(feature,result){ window.supportWebp = result;});
function delayload(option){
if(window.nodelayimg) return; //H5站混合静态和自由模块时,不能使用图片延时加载,因为图片延时加载会改变页面的高度
delayload2(option);
}
function delayload2(option){
if(window.isIE) return; //IE支持不好,IE先不启用延时加载
//图片未加载时显示的图片
var src = option.src ? option.src : '';
var bgsrc = option.bgsrc ? option.bgsrc : '';
//指定那些id下的img元素使用延迟显示
var id = option.id ? option.id : [];
//获得所有的图片元素
window.delayImages = [];
var top = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;
var width = document.documentElement.clientWidth;
var height = document.documentElement.clientHeight;
for (var i = 0; i < id.length; i++) {
var idbox = document.getElementById(id[i]),_imgs;
if (idbox && (_imgs = idbox.getElementsByTagName('img'))) {
for (var t = 0; t < _imgs.length; t++) {
if($(_imgs[t])[0].outerHTML.indexOf(src) > -1) continue; //避免与 mod_pagespeed 冲突
//window.delayImages.push(_imgs[t]);
var _top = $(_imgs[t]).offset().top;
var _showed = _top + 50 >= top && _top - 50 <= top + height;
if(_showed) continue;
var flag = true;
var m = $(_imgs[t]).closest(".ModuleItem");
if(m && (m.html() + "").toLowerCase().indexOf("slide") > -1) flag = false; //忽略幻灯片模块
if(m && m.find(".ProductList").length > 0 && m.find(".ProductList[showstyle=1]").length > 0 ) flag = false; //轮播的产品列表模块判断图片位置有问题,先忽略
if(m && m.find(".ModuleSiteGallery").length > 0 && m.find(".grid-item").length > 0 ) flag = false; //相册模块判断图片位置有问题,先忽略
if($(_imgs[t]).attr('nodelay') == '1') flag = false; //图片添加了不延时的属性
if($(_imgs[t]).attr('src').indexOf('c=validatecode') > -1) flag = false; //验证码图片不作处理
if(flag){
window.delayImages.push(_imgs[t]);
}
}
}
}
//将所有的图片设置为指定的loading图片
for (var i = 0; i < window.delayImages.length; i++) {
//图片本来的图片路径放入_src中
var osrc = window.delayImages[i].src;
if($(window.delayImages[i]).attr('data-pagespeed-lazy-src')) osrc = $(window.delayImages[i]).attr('data-pagespeed-lazy-src'); //避免与 mod_pagespeed 冲突
if(window.supportWebp && isPlatformVersion == '1' && osrc.indexOf('?') == -1 && osrc.indexOf("comdata/") > -1 && /\.(jpg|jpeg|png)$/i.test(osrc)){
//osrc += ".webp"; //共享目录的时候,对这个支持不好(会出现 IIS 的 Rewrite Module 错误,实际上是IIS的问题)
}
window.delayImages[i].setAttribute('_src', osrc);
window.delayImages[i].style.background = 'url('+src+') center center no-repeat'; //loading图用背景来处理
window.delayImages[i].src = bgsrc; //放个透明的图来占位
//这里要加一个onload事件处理产品模块的响应式问题和泽彬做的产品图片效果
if($.fn.masonry) $(window.delayImages[i]).on('load',function(){$('.masonry-container,.gallery-list').masonry()});
}
var load = new Image();
load.src = src;
load.onload = function() {
delayScroll();
};
$(window).on("scroll",function (){delayScroll();});
$(window).load(function (){delayScroll();});
$('body')[0].addEventListener("DOMSubtreeModified", function (ev) {
//兼容文章列表 滚动公告的效果 如果不延迟执行 chrome 会把文章列表强制滚动到可视区域的行为
if(window.delaytimer) clearTimeout(window.delaytimer);
window.delaytimer = setTimeout(function(){delayScroll();},500);
}, false);
}
/*delayload({
id: ['pagebody'],
src: 'http://h560.72dns.net/images/loading2.gif'
});*/;// END OF /scripts/imgdelayload.js
// STARTS OF /scripts/layer/layer.js
/*! layer-v3.0.3 Web弹层组件 MIT License http://layer.layui.com/ By 贤心 */
;!function(e,t){"use strict";var i,n,a=e.layui&&layui.define,o={getPath:function(){var e=document.scripts,t=e[e.length-1],i=t.src;if(!t.getAttribute("merge"))return i.substring(0,i.lastIndexOf("/")+1)}(),config:{},end:{},minIndex:0,minLeft:[],btn:["确定","取消"],type:["dialog","page","iframe","loading","tips"]},r={v:"3.0.3",ie:function(){var t=navigator.userAgent.toLowerCase();return!!(e.ActiveXObject||"ActiveXObject"in e)&&((t.match(/msie\s(\d+)/)||[])[1]||"11")}(),index:e.layer&&e.layer.v?1e5:0,path:o.getPath,config:function(e,t){return e=e||{},r.cache=o.config=i.extend({},o.config,e),r.path=o.config.path||r.path,"string"==typeof e.extend&&(e.extend=[e.extend]),o.config.path&&r.ready(),e.extend?(a?layui.addcss("modules/layer/"+e.extend):r.link("skin/"+e.extend),this):this},link:function(t,n,a){if(r.path){var o=i("head")[0],s=document.createElement("link");"string"==typeof n&&(a=n);var l=(a||t).replace(/\.|\//g,""),f="layuicss-"+l,c=0;s.rel="stylesheet",s.href=r.path+t,s.id=f,i("#"+f)[0]||o.appendChild(s),"function"==typeof n&&!function u(){return++c>80?e.console&&console.error("layer.css: Invalid"):void(1989===parseInt(i("#"+f).css("width"))?n():setTimeout(u,100))}()}},ready:function(e){var t="skinlayercss",i="303";return a?layui.addcss("modules/layer/default/layer.css?v="+r.v+i,e,t):r.link("../css/layer.css?v="+r.v+i,e,t),this},alert:function(e,t,n){var a="function"==typeof t;return a&&(n=t),r.open(i.extend({content:e,yes:n},a?{}:t))},confirm:function(e,t,n,a){var s="function"==typeof t;return s&&(a=n,n=t),r.open(i.extend({content:e,btn:o.btn,yes:n,btn2:a},s?{}:t))},msg:function(e,n,a){var s="function"==typeof n,f=o.config.skin,c=(f?f+" "+f+"-msg":"")||"layui-layer-msg",u=l.anim.length-1;return s&&(a=n),r.open(i.extend({content:e,time:3e3,shade:!1,skin:c,title:!1,closeBtn:!1,btn:!1,resize:!1,end:a},s&&!o.config.skin?{skin:c+" layui-layer-hui",anim:u}:function(){return n=n||{},(n.icon===-1||n.icon===t&&!o.config.skin)&&(n.skin=c+" "+(n.skin||"layui-layer-hui")),n}()))},load:function(e,t){return r.open(i.extend({type:3,icon:e||0,resize:!1,shade:.01},t))},tips:function(e,t,n){return r.open(i.extend({type:4,content:[e,t],closeBtn:!1,time:3e3,shade:!1,resize:!1,fixed:!1,maxWidth:210},n))}},s=function(e){var t=this;t.index=++r.index,t.config=i.extend({},t.config,o.config,e),document.body?t.creat():setTimeout(function(){t.creat()},30)};s.pt=s.prototype;var l=["layui-layer",".layui-layer-title",".layui-layer-main",".layui-layer-dialog","layui-layer-iframe","layui-layer-content","layui-layer-btn","layui-layer-close"];l.anim=["layer-anim","layer-anim-01","layer-anim-02","layer-anim-03","layer-anim-04","layer-anim-05","layer-anim-06"],s.pt.config={type:0,shade:.3,fixed:!0,move:l[1],title:"信息",offset:"auto",area:"auto",closeBtn:1,time:0,zIndex:19891014,maxWidth:360,anim:0,isOutAnim:!0,icon:-1,moveType:1,resize:!0,scrollbar:!0,tips:2},s.pt.vessel=function(e,t){var n=this,a=n.index,r=n.config,s=r.zIndex+a,f="object"==typeof r.title,c=r.maxmin&&(1===r.type||2===r.type),u=r.title?''+(f?r.title[0]:r.title)+"
":"";return r.zIndex=s,t([r.shade?'
':"",''+(e&&2!=r.type?"":u)+'
'+(0==r.type&&r.icon!==-1?' ':"")+(1==r.type&&e?"":r.content||"")+'
'+function(){var e=c?' ':"";return r.closeBtn&&(e+=' '),e}()+" "+(r.btn?function(){var e="";"string"==typeof r.btn&&(r.btn=[r.btn]);for(var t=0,i=r.btn.length;t
'+r.btn[t]+"";return' '+e+"
"}():"")+(r.resize?' ':"")+" "],u,i('
')),n},s.pt.creat=function(){var e=this,t=e.config,a=e.index,s=t.content,f="object"==typeof s,c=i("body");if(!t.id||!i("#"+t.id)[0]){switch("string"==typeof t.area&&(t.area="auto"===t.area?["",""]:[t.area,""]),t.shift&&(t.anim=t.shift),6==r.ie&&(t.fixed=!1),t.type){case 0:t.btn="btn"in t?t.btn:o.btn[0],r.closeAll("dialog");break;case 2:var s=t.content=f?t.content:[t.content,"auto"];t.content='';break;case 3:delete t.title,delete t.closeBtn,t.icon===-1&&0===t.icon,r.closeAll("loading");break;case 4:f||(t.content=[t.content,"body"]),t.follow=t.content[1],t.content=t.content[0]+' ',delete t.title,t.tips="object"==typeof t.tips?t.tips:[t.tips,!0],t.tipsMore||r.closeAll("tips")}e.vessel(f,function(n,r,u){c.append(n[0]),f?function(){2==t.type||4==t.type?function(){i("body").append(n[1])}():function(){s.parents("."+l[0])[0]||(s.data("display",s.css("display")).show().addClass("layui-layer-wrap").wrap(n[1]),i("#"+l[0]+a).find("."+l[5]).before(r))}()}():c.append(n[1]),i(".layui-layer-move")[0]||c.append(o.moveElem=u),e.layero=i("#"+l[0]+a),t.scrollbar||l.html.css("overflow","hidden").attr("layer-full",a)}).auto(a),2==t.type&&6==r.ie&&e.layero.find("iframe").attr("src",s[0]),4==t.type?e.tips():e.offset(),t.fixed&&n.on("resize",function(){e.offset(),(/^\d+%$/.test(t.area[0])||/^\d+%$/.test(t.area[1]))&&e.auto(a),4==t.type&&e.tips()}),t.time<=0||setTimeout(function(){r.close(e.index)},t.time),e.move().callback(),l.anim[t.anim]&&e.layero.addClass(l.anim[t.anim]),t.isOutAnim&&e.layero.data("isOutAnim",!0)}},s.pt.auto=function(e){function t(e){e=s.find(e),e.height(f[1]-c-u-2*(0|parseFloat(e.css("padding-top"))))}var a=this,o=a.config,s=i("#"+l[0]+e);""===o.area[0]&&o.maxWidth>0&&(r.ie&&r.ie<8&&o.btn&&s.width(s.innerWidth()),s.outerWidth()>o.maxWidth&&s.width(o.maxWidth));var f=[s.innerWidth(),s.innerHeight()],c=s.find(l[1]).outerHeight()||0,u=s.find("."+l[6]).outerHeight()||0;switch(o.type){case 2:t("iframe");break;default:""===o.area[1]?o.fixed&&f[1]>=n.height()&&(f[1]=n.height(),t("."+l[5])):t("."+l[5])}return a},s.pt.offset=function(){var e=this,t=e.config,i=e.layero,a=[i.outerWidth(),i.outerHeight()],o="object"==typeof t.offset;e.offsetTop=(n.height()-a[1])/2,e.offsetLeft=(n.width()-a[0])/2,o?(e.offsetTop=t.offset[0],e.offsetLeft=t.offset[1]||e.offsetLeft):"auto"!==t.offset&&("t"===t.offset?e.offsetTop=0:"r"===t.offset?e.offsetLeft=n.width()-a[0]:"b"===t.offset?e.offsetTop=n.height()-a[1]:"l"===t.offset?e.offsetLeft=0:"lt"===t.offset?(e.offsetTop=0,e.offsetLeft=0):"lb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=0):"rt"===t.offset?(e.offsetTop=0,e.offsetLeft=n.width()-a[0]):"rb"===t.offset?(e.offsetTop=n.height()-a[1],e.offsetLeft=n.width()-a[0]):e.offsetTop=t.offset),t.fixed||(e.offsetTop=/%$/.test(e.offsetTop)?n.height()*parseFloat(e.offsetTop)/100:parseFloat(e.offsetTop),e.offsetLeft=/%$/.test(e.offsetLeft)?n.width()*parseFloat(e.offsetLeft)/100:parseFloat(e.offsetLeft),e.offsetTop+=n.scrollTop(),e.offsetLeft+=n.scrollLeft()),i.attr("minLeft")&&(e.offsetTop=n.height()-(i.find(l[1]).outerHeight()||0),e.offsetLeft=i.css("left")),i.css({top:e.offsetTop,left:e.offsetLeft})},s.pt.tips=function(){var e=this,t=e.config,a=e.layero,o=[a.outerWidth(),a.outerHeight()],r=i(t.follow);r[0]||(r=i("body"));var s={width:r.outerWidth(),height:r.outerHeight(),top:r.offset().top,left:r.offset().left},f=a.find(".layui-layer-TipsG"),c=t.tips[0];t.tips[1]||f.remove(),s.autoLeft=function(){s.left+o[0]-n.width()>0?(s.tipLeft=s.left+s.width-o[0],f.css({right:12,left:"auto"})):s.tipLeft=s.left},s.where=[function(){s.autoLeft(),s.tipTop=s.top-o[1]-10,f.removeClass("layui-layer-TipsB").addClass("layui-layer-TipsT").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left+s.width+10,s.tipTop=s.top,f.removeClass("layui-layer-TipsL").addClass("layui-layer-TipsR").css("border-bottom-color",t.tips[1])},function(){s.autoLeft(),s.tipTop=s.top+s.height+10,f.removeClass("layui-layer-TipsT").addClass("layui-layer-TipsB").css("border-right-color",t.tips[1])},function(){s.tipLeft=s.left-o[0]-10,s.tipTop=s.top,f.removeClass("layui-layer-TipsR").addClass("layui-layer-TipsL").css("border-bottom-color",t.tips[1])}],s.where[c-1](),1===c?s.top-(n.scrollTop()+o[1]+16)<0&&s.where[2]():2===c?n.width()-(s.left+s.width+o[0]+16)>0||s.where[3]():3===c?s.top-n.scrollTop()+s.height+o[1]+16-n.height()>0&&s.where[0]():4===c&&o[0]+16-s.left>0&&s.where[1](),a.find("."+l[5]).css({"background-color":t.tips[1],"padding-right":t.closeBtn?"30px":""}),a.css({left:s.tipLeft-(t.fixed?n.scrollLeft():0),top:s.tipTop-(t.fixed?n.scrollTop():0)})},s.pt.move=function(){var e=this,t=e.config,a=i(document),s=e.layero,l=s.find(t.move),f=s.find(".layui-layer-resize"),c={};return t.move&&l.css("cursor","move"),l.on("mousedown",function(e){e.preventDefault(),t.move&&(c.moveStart=!0,c.offset=[e.clientX-parseFloat(s.css("left")),e.clientY-parseFloat(s.css("top"))],o.moveElem.css("cursor","move").show())}),f.on("mousedown",function(e){e.preventDefault(),c.resizeStart=!0,c.offset=[e.clientX,e.clientY],c.area=[s.outerWidth(),s.outerHeight()],o.moveElem.css("cursor","se-resize").show()}),a.on("mousemove",function(i){if(c.moveStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1],l="fixed"===s.css("position");if(i.preventDefault(),c.stX=l?0:n.scrollLeft(),c.stY=l?0:n.scrollTop(),!t.moveOut){var f=n.width()-s.outerWidth()+c.stX,u=n.height()-s.outerHeight()+c.stY;af&&(a=f),ou&&(o=u)}s.css({left:a,top:o})}if(t.resize&&c.resizeStart){var a=i.clientX-c.offset[0],o=i.clientY-c.offset[1];i.preventDefault(),r.style(e.index,{width:c.area[0]+a,height:c.area[1]+o}),c.isResize=!0,t.resizing&&t.resizing(s)}}).on("mouseup",function(e){c.moveStart&&(delete c.moveStart,o.moveElem.hide(),t.moveEnd&&t.moveEnd(s)),c.resizeStart&&(delete c.resizeStart,o.moveElem.hide())}),e},s.pt.callback=function(){function e(){var e=a.cancel&&a.cancel(t.index,n);e===!1||r.close(t.index)}var t=this,n=t.layero,a=t.config;t.openLayer(),a.success&&(2==a.type?n.find("iframe").on("load",function(){a.success(n,t.index)}):a.success(n,t.index)),6==r.ie&&t.IE6(n),n.find("."+l[6]).children("a").on("click",function(){var e=i(this).index();if(0===e)a.yes?a.yes(t.index,n):a.btn1?a.btn1(t.index,n):r.close(t.index);else{var o=a["btn"+(e+1)]&&a["btn"+(e+1)](t.index,n);o===!1||r.close(t.index)}}),n.find("."+l[7]).on("click",e),a.shadeClose&&i("#layui-layer-shade"+t.index).on("click",function(){r.close(t.index)}),n.find(".layui-layer-min").on("click",function(){var e=a.min&&a.min(n);e===!1||r.min(t.index,a)}),n.find(".layui-layer-max").on("click",function(){i(this).hasClass("layui-layer-maxmin")?(r.restore(t.index),a.restore&&a.restore(n)):(r.full(t.index,a),setTimeout(function(){a.full&&a.full(n)},100))}),a.end&&(o.end[t.index]=a.end)},o.reselect=function(){i.each(i("select"),function(e,t){var n=i(this);n.parents("."+l[0])[0]||1==n.attr("layer")&&i("."+l[0]).length<1&&n.removeAttr("layer").show(),n=null})},s.pt.IE6=function(e){i("select").each(function(e,t){var n=i(this);n.parents("."+l[0])[0]||"none"===n.css("display")||n.attr({layer:"1"}).hide(),n=null})},s.pt.openLayer=function(){var e=this;r.zIndex=e.config.zIndex,r.setTop=function(e){var t=function(){r.zIndex++,e.css("z-index",r.zIndex+1)};return r.zIndex=parseInt(e[0].style.zIndex),e.on("mousedown",t),r.zIndex}},o.record=function(e){var t=[e.width(),e.height(),e.position().top,e.position().left+parseFloat(e.css("margin-left"))];e.find(".layui-layer-max").addClass("layui-layer-maxmin"),e.attr({area:t})},o.rescollbar=function(e){l.html.attr("layer-full")==e&&(l.html[0].style.removeProperty?l.html[0].style.removeProperty("overflow"):l.html[0].style.removeAttribute("overflow"),l.html.removeAttr("layer-full"))},e.layer=r,r.getChildFrame=function(e,t){return t=t||i("."+l[4]).attr("times"),i("#"+l[0]+t).find("iframe").contents().find(e)},r.getFrameIndex=function(e){return i("#"+e).parents("."+l[4]).attr("times")},r.iframeAuto=function(e){if(e){var t=r.getChildFrame("html",e).outerHeight(),n=i("#"+l[0]+e),a=n.find(l[1]).outerHeight()||0,o=n.find("."+l[6]).outerHeight()||0;n.css({height:t+a+o}),n.find("iframe").css({height:t})}},r.iframeSrc=function(e,t){i("#"+l[0]+e).find("iframe").attr("src",t)},r.style=function(e,t,n){var a=i("#"+l[0]+e),r=a.find(".layui-layer-content"),s=a.attr("type"),f=a.find(l[1]).outerHeight()||0,c=a.find("."+l[6]).outerHeight()||0;a.attr("minLeft");s!==o.type[3]&&s!==o.type[4]&&(n||(parseFloat(t.width)<=260&&(t.width=260),parseFloat(t.height)-f-c<=64&&(t.height=64+f+c)),a.css(t),c=a.find("."+l[6]).outerHeight(),s===o.type[2]?a.find("iframe").css({height:parseFloat(t.height)-f-c}):r.css({height:parseFloat(t.height)-f-c-parseFloat(r.css("padding-top"))-parseFloat(r.css("padding-bottom"))}))},r.min=function(e,t){var a=i("#"+l[0]+e),s=a.find(l[1]).outerHeight()||0,f=a.attr("minLeft")||181*o.minIndex+"px",c=a.css("position");o.record(a),o.minLeft[0]&&(f=o.minLeft[0],o.minLeft.shift()),a.attr("position",c),r.style(e,{width:180,height:s,left:f,top:n.height()-s,position:"fixed",overflow:"hidden"},!0),a.find(".layui-layer-min").hide(),"page"===a.attr("type")&&a.find(l[4]).hide(),o.rescollbar(e),a.attr("minLeft")||o.minIndex++,a.attr("minLeft",f)},r.restore=function(e){var t=i("#"+l[0]+e),n=t.attr("area").split(",");t.attr("type");r.style(e,{width:parseFloat(n[0]),height:parseFloat(n[1]),top:parseFloat(n[2]),left:parseFloat(n[3]),position:t.attr("position"),overflow:"visible"},!0),t.find(".layui-layer-max").removeClass("layui-layer-maxmin"),t.find(".layui-layer-min").show(),"page"===t.attr("type")&&t.find(l[4]).show(),o.rescollbar(e)},r.full=function(e){var t,a=i("#"+l[0]+e);o.record(a),l.html.attr("layer-full")||l.html.css("overflow","hidden").attr("layer-full",e),clearTimeout(t),t=setTimeout(function(){var t="fixed"===a.css("position");r.style(e,{top:t?0:n.scrollTop(),left:t?0:n.scrollLeft(),width:n.width(),height:n.height()},!0),a.find(".layui-layer-min").hide()},100)},r.title=function(e,t){var n=i("#"+l[0]+(t||r.index)).find(l[1]);n.html(e)},r.close=function(e){var t=i("#"+l[0]+e),n=t.attr("type"),a="layer-anim-close";if(t[0]){var s="layui-layer-wrap",f=function(){if(n===o.type[1]&&"object"===t.attr("conType")){t.children(":not(."+l[5]+")").remove();for(var a=t.find("."+s),r=0;r<2;r++)a.unwrap();a.css("display",a.data("display")).removeClass(s)}else{if(n===o.type[2])try{var f=i("#"+l[4]+e)[0];f.contentWindow.document.write(""),f.contentWindow.close(),t.find("."+l[5])[0].removeChild(f)}catch(c){}t[0].innerHTML="",t.remove()}"function"==typeof o.end[e]&&o.end[e](),delete o.end[e]};t.data("isOutAnim")&&t.addClass(a),i("#layui-layer-moves, #layui-layer-shade"+e).remove(),6==r.ie&&o.reselect(),o.rescollbar(e),t.attr("minLeft")&&(o.minIndex--,o.minLeft.push(t.attr("minLeft"))),r.ie&&r.ie<10||!t.data("isOutAnim")?f():setTimeout(function(){f()},200)}},r.closeAll=function(e){i.each(i("."+l[0]),function(){var t=i(this),n=e?t.attr("type")===e:1;n&&r.close(t.attr("times")),n=null})};var f=r.cache||{},c=function(e){return f.skin?" "+f.skin+" "+f.skin+"-"+e:""};r.prompt=function(e,t){var a="";if(e=e||{},"function"==typeof e&&(t=e),e.area){var o=e.area;a='style="width: '+o[0]+"; height: "+o[1]+';"',delete e.area}var s,l=2==e.formType?'":function(){return' '}(),f=e.success;return delete e.success,r.open(i.extend({type:1,btn:["确定","取消"],content:l,skin:"layui-layer-prompt"+c("prompt"),maxWidth:n.width(),success:function(e){s=e.find(".layui-layer-input"),s.focus(),"function"==typeof f&&f(e)},resize:!1,yes:function(i){var n=s.val();""===n?s.focus():n.length>(e.maxlength||500)?r.tips("最多输入"+(e.maxlength||500)+"个字数",s,{tips:1}):t&&t(n,i,s)}},e))},r.tab=function(e){e=e||{};var t=e.tab||{},n=e.success;return delete e.success,r.open(i.extend({type:1,skin:"layui-layer-tab"+c("tab"),resize:!1,title:function(){var e=t.length,i=1,n="";if(e>0)for(n=''+t[0].title+" ";i"+t[i].title+"";return n}(),content:''+function(){var e=t.length,i=1,n="";if(e>0)for(n=''+(t[0].content||"no content")+" ";i'+(t[i].content||"no content")+"";return n}()+" ",success:function(t){var a=t.find(".layui-layer-title").children(),o=t.find(".layui-layer-tabmain").children();a.on("mousedown",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0;var n=i(this),a=n.index();n.addClass("layui-layer-tabnow").siblings().removeClass("layui-layer-tabnow"),o.eq(a).show().siblings().hide(),"function"==typeof e.change&&e.change(a)}),"function"==typeof n&&n(t)}},e))},r.photos=function(t,n,a){function o(e,t,i){var n=new Image;return n.src=e,n.complete?t(n):(n.onload=function(){n.onload=null,t(n)},void(n.onerror=function(e){n.onerror=null,i(e)}))}var s={};if(t=t||{},t.photos){var l=t.photos.constructor===Object,f=l?t.photos:{},u=f.data||[],d=f.start||0;s.imgIndex=(0|d)+1,t.img=t.img||"img";var y=t.success;if(delete t.success,l){if(0===u.length)return r.msg("没有图片")}else{var p=i(t.photos),h=function(){u=[],p.find(t.img).each(function(e){var t=i(this);t.attr("layer-index",e),u.push({alt:t.attr("alt"),pid:t.attr("layer-pid"),src:t.attr("layer-src")||t.attr("src"),thumb:t.attr("src")})})};if(h(),0===u.length)return;if(n||p.on("click",t.img,function(){var e=i(this),n=e.attr("layer-index");r.photos(i.extend(t,{photos:{start:n,data:u,tab:t.tab},full:t.full}),!0),h()}),!n)return}s.imgprev=function(e){s.imgIndex--,s.imgIndex<1&&(s.imgIndex=u.length),s.tabimg(e)},s.imgnext=function(e,t){s.imgIndex++,s.imgIndex>u.length&&(s.imgIndex=1,t)||s.tabimg(e)},s.keyup=function(e){if(!s.end){var t=e.keyCode;e.preventDefault(),37===t?s.imgprev(!0):39===t?s.imgnext(!0):27===t&&r.close(s.index)}},s.tabimg=function(e){if(!(u.length<=1))return f.start=s.imgIndex-1,r.close(s.index),r.photos(t,!0,e)},s.event=function(){s.bigimg.hover(function(){s.imgsee.show()},function(){s.imgsee.hide()}),s.bigimg.find(".layui-layer-imgprev").on("click",function(e){e.preventDefault(),s.imgprev()}),s.bigimg.find(".layui-layer-imgnext").on("click",function(e){e.preventDefault(),s.imgnext()}),i(document).on("keyup",s.keyup)},s.loadi=r.load(1,{shade:!("shade"in t)&&.9,scrollbar:!1}),o(u[d].src,function(n){r.close(s.loadi),s.index=r.open(i.extend({type:1,id:"layui-layer-photos",area:function(){var a=[n.width,n.height],o=[i(e).width()-100,i(e).height()-100];if(!t.full&&(a[0]>o[0]||a[1]>o[1])){var r=[a[0]/o[0],a[1]/o[1]];r[0]>r[1]?(a[0]=a[0]/r[0],a[1]=a[1]/r[0]):r[0] ",success:function(e,i){s.bigimg=e.find(".layui-layer-phimg"),s.imgsee=e.find(".layui-layer-imguide,.layui-layer-imgbar"),s.event(e),t.tab&&t.tab(u[d],e),"function"==typeof y&&y(e)},end:function(){s.end=!0,i(document).off("keyup",s.keyup)}},t))},function(){r.close(s.loadi),r.msg("当前图片地址异常
是否继续查看下一张?",{time:3e4,btn:["下一张","不看了"],yes:function(){u.length>1&&s.imgnext(!0,!0)}})})}},o.run=function(t){i=t,n=i(e),l.html=i("html"),r.open=function(e){var t=new s(e);return t.index}},e.layui&&layui.define?(r.ready(),layui.define("jquery",function(t){r.path=layui.cache.dir,o.run(layui.jquery),e.layer=r,t("layer",r)})):"function"==typeof define&&define.amd?define(["jquery"],function(){return o.run(e.jQuery),r}):function(){o.run(e.jQuery),r.ready()}()}(window);;// END OF /scripts/layer/layer.js
addScript('static/js/bootbox.min.js',null,true);
addScript('static/js/jquery.ajaxfileupload.js',null,true);
addScript('static/js/Region.js',null,true);