").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.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"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.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,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){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===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.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=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],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=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.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&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.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)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.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 On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=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 u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.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,On.push(o)),s&&b.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){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.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,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.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,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.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||(b.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?b.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=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.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)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.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=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._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=b.timers,a=b._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)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),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}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.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,b.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},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.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?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.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?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
/*
* jQuery BlockUI; v20141123
* http://jquery.malsup.com/block/
* Copyright (c) 2014 M. Alsup; Dual licensed: MIT/GPL
*/
(function(){"use strict";function e(e){function o(o,i){var s,h,k=o==window,v=i&&void 0!==i.message?i.message:void 0;if(i=e.extend({},e.blockUI.defaults,i||{}),!i.ignoreIfBlocked||!e(o).data("blockUI.isBlocked")){if(i.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,i.overlayCSS||{}),s=e.extend({},e.blockUI.defaults.css,i.css||{}),i.onOverlayClick&&(i.overlayCSS.cursor="pointer"),h=e.extend({},e.blockUI.defaults.themedCSS,i.themedCSS||{}),v=void 0===v?i.message:v,k&&b&&t(window,{fadeOut:0}),v&&"string"!=typeof v&&(v.parentNode||v.jquery)){var y=v.jquery?v[0]:v,m={};e(o).data("blockUI.history",m),m.el=y,m.parent=y.parentNode,m.display=y.style.display,m.position=y.style.position,m.parent&&m.parent.removeChild(y)}e(o).data("blockUI.onUnblock",i.onUnblock);var g,I,w,U,x=i.baseZ;g=r||i.forceIframe?e('
'):e('
'),I=i.theme?e('
'):e('
'),i.theme&&k?(U='
',i.title&&(U+='"),U+='
',U+="
"):i.theme?(U='
"):U=k?'
':'
',w=e(U),v&&(i.theme?(w.css(h),w.addClass("ui-widget-content")):w.css(s)),i.theme||I.css(i.overlayCSS),I.css("position",k?"fixed":"absolute"),(r||i.forceIframe)&&g.css("opacity",0);var C=[g,I,w],S=k?e("body"):e(o);e.each(C,function(){this.appendTo(S)}),i.theme&&i.draggable&&e.fn.draggable&&w.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var O=f&&(!e.support.boxModel||e("object,embed",k?null:o).length>0);if(u||O){if(k&&i.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(u||!e.support.boxModel)&&!k)var E=d(o,"borderTopWidth"),T=d(o,"borderLeftWidth"),M=E?"(0 - "+E+")":0,B=T?"(0 - "+T+")":0;e.each(C,function(e,o){var t=o[0].style;if(t.position="absolute",2>e)k?t.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+i.quirksmodeOffsetHack+') + "px"'):t.setExpression("height",'this.parentNode.offsetHeight + "px"'),k?t.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):t.setExpression("width",'this.parentNode.offsetWidth + "px"'),B&&t.setExpression("left",B),M&&t.setExpression("top",M);else if(i.centerY)k&&t.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),t.marginTop=0;else if(!i.centerY&&k){var n=i.css&&i.css.top?parseInt(i.css.top,10):0,s="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+n+') + "px"';t.setExpression("top",s)}})}if(v&&(i.theme?w.find(".ui-widget-content").append(v):w.append(v),(v.jquery||v.nodeType)&&e(v).show()),(r||i.forceIframe)&&i.showOverlay&&g.show(),i.fadeIn){var j=i.onBlock?i.onBlock:c,H=i.showOverlay&&!v?j:c,z=v?j:c;i.showOverlay&&I._fadeIn(i.fadeIn,H),v&&w._fadeIn(i.fadeIn,z)}else i.showOverlay&&I.show(),v&&w.show(),i.onBlock&&i.onBlock.bind(w)();if(n(1,o,i),k?(b=w[0],p=e(i.focusableElements,b),i.focusInput&&setTimeout(l,20)):a(w[0],i.centerX,i.centerY),i.timeout){var W=setTimeout(function(){k?e.unblockUI(i):e(o).unblock(i)},i.timeout);e(o).data("blockUI.timeout",W)}}}function t(o,t){var s,l=o==window,a=e(o),d=a.data("blockUI.history"),c=a.data("blockUI.timeout");c&&(clearTimeout(c),a.removeData("blockUI.timeout")),t=e.extend({},e.blockUI.defaults,t||{}),n(0,o,t),null===t.onUnblock&&(t.onUnblock=a.data("blockUI.onUnblock"),a.removeData("blockUI.onUnblock"));var r;r=l?e("body").children().filter(".blockUI").add("body > .blockUI"):a.find(">.blockUI"),t.cursorReset&&(r.length>1&&(r[1].style.cursor=t.cursorReset),r.length>2&&(r[2].style.cursor=t.cursorReset)),l&&(b=p=null),t.fadeOut?(s=r.length,r.stop().fadeOut(t.fadeOut,function(){0===--s&&i(r,d,t,o)})):i(r,d,t,o)}function i(o,t,i,n){var s=e(n);if(!s.data("blockUI.isBlocked")){o.each(function(){this.parentNode&&this.parentNode.removeChild(this)}),t&&t.el&&(t.el.style.display=t.display,t.el.style.position=t.position,t.el.style.cursor="default",t.parent&&t.parent.appendChild(t.el),s.removeData("blockUI.history")),s.data("blockUI.static")&&s.css("position","static"),"function"==typeof i.onUnblock&&i.onUnblock(n,i);var l=e(document.body),a=l.width(),d=l[0].style.width;l.width(a-1).width(a),l[0].style.width=d}}function n(o,t,i){var n=t==window,l=e(t);if((o||(!n||b)&&(n||l.data("blockUI.isBlocked")))&&(l.data("blockUI.isBlocked",o),n&&i.bindEvents&&(!o||i.showOverlay))){var a="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";o?e(document).bind(a,i,s):e(document).unbind(a,s)}}function s(o){if("keydown"===o.type&&o.keyCode&&9==o.keyCode&&b&&o.data.constrainTabKey){var t=p,i=!o.shiftKey&&o.target===t[t.length-1],n=o.shiftKey&&o.target===t[0];if(i||n)return setTimeout(function(){l(n)},10),!1}var s=o.data,a=e(o.target);return a.hasClass("blockOverlay")&&s.onOverlayClick&&s.onOverlayClick(o),a.parents("div."+s.blockMsgClass).length>0?!0:0===a.parents().children().filter("div.blockUI").length}function l(e){if(p){var o=p[e===!0?p.length-1:0];o&&o.focus()}}function a(e,o,t){var i=e.parentNode,n=e.style,s=(i.offsetWidth-e.offsetWidth)/2-d(i,"borderLeftWidth"),l=(i.offsetHeight-e.offsetHeight)/2-d(i,"borderTopWidth");o&&(n.left=s>0?s+"px":"0"),t&&(n.top=l>0?l+"px":"0")}function d(o,t){return parseInt(e.css(o,t),10)||0}e.fn._fadeIn=e.fn.fadeIn;var c=e.noop||function(){},r=/MSIE/.test(navigator.userAgent),u=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent);document.documentMode||0;var f=e.isFunction(document.createElement("div").style.setExpression);e.blockUI=function(e){o(window,e)},e.unblockUI=function(e){t(window,e)},e.growlUI=function(o,t,i,n){var s=e('
');o&&s.append("
"+o+"
"),t&&s.append("
"+t+"
"),void 0===i&&(i=3e3);var l=function(o){o=o||{},e.blockUI({message:s,fadeIn:o.fadeIn!==void 0?o.fadeIn:700,fadeOut:o.fadeOut!==void 0?o.fadeOut:1e3,timeout:o.timeout!==void 0?o.timeout:i,centerY:!1,showOverlay:!1,onUnblock:n,css:e.blockUI.defaults.growlCSS})};l(),s.css("opacity"),s.mouseover(function(){l({fadeIn:0,timeout:3e4});var o=e(".blockMsg");o.stop(),o.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(t){if(this[0]===window)return e.blockUI(t),this;var i=e.extend({},e.blockUI.defaults,t||{});return this.each(function(){var o=e(this);i.ignoreIfBlocked&&o.data("blockUI.isBlocked")||o.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,o(this,t)})},e.fn.unblock=function(o){return this[0]===window?(e.unblockUI(o),this):this.each(function(){t(this,o)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"
Please wait...
",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var b=null,p=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)})();
/*!
* jQuery Cookie Plugin v1.4.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2006, 2014 Klaus Hartl
* Released under the MIT license
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(l){var i=/\+/g;function x(e){return v.raw?e:encodeURIComponent(e)}function g(e,n){var o=v.raw?e:function(e){0===e.indexOf('"')&&(e=e.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return e=decodeURIComponent(e.replace(i," ")),v.json?JSON.parse(e):e}catch(e){}}(e);return l.isFunction(n)?n(o):o}var v=l.cookie=function(e,n,o){var i,t,r;if(1
").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;a.length>i;i++)n.append(a[i].name,a[i].value);if(t.extraData){var o=r(t.extraData);for(i=0;o.length>i;i++)o[i]&&n.append(o[i][0],o[i][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:u||"POST"});t.uploadProgress&&(s.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(100*(a/n))),t.uploadProgress(e,a,n,r)},!1),r}),s.data=null;var l=s.beforeSend;return s.beforeSend=function(e,t){t.data=n,l&&l.call(this,e,t)},e.ajax(s)}function s(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(r){a("cannot get iframe.contentWindow document: "+r)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function o(){function t(){try{var e=n(g).readyState;a("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(r){a("Server abort: ",r," (",r.name,")"),s(D),j&&clearTimeout(j),j=void 0}}var r=f.attr2("target"),i=f.attr2("action");w.setAttribute("target",d),(!u||/post/i.test(u))&&w.setAttribute("method","POST"),i!=m.url&&w.setAttribute("action",m.url),m.skipEncodingOverride||u&&!/post/i.test(u)||f.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),m.timeout&&(j=setTimeout(function(){T=!0,s(k)},m.timeout));var o=[];try{if(m.extraData)for(var l in m.extraData)m.extraData.hasOwnProperty(l)&&(e.isPlainObject(m.extraData[l])&&m.extraData[l].hasOwnProperty("name")&&m.extraData[l].hasOwnProperty("value")?o.push(e('
').val(m.extraData[l].value).appendTo(w)[0]):o.push(e('
').val(m.extraData[l]).appendTo(w)[0]));m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(c){var p=document.createElement("form").submit;p.apply(w)}}finally{w.setAttribute("action",i),r?w.setAttribute("target",r):f.removeAttr("target"),e(o).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=D),t===k&&x)return x.abort("timeout"),S.reject(x,"timeout"),void 0;if(t==D&&x)return x.abort("server abort"),S.reject(x,"error","server abort"),void 0;if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),setTimeout(s,250),void 0;var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var l=(m.dataType||"").toLowerCase(),c=/(json|script|text)/.test(l);if(c||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(c){var d=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];d?x.responseText=d.textContent?d.textContent:d.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==l&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,l,m)}catch(b){i="parsererror",x.error=r=b||i}}catch(b){a("error caught: ",b),i="error",x.error=r=b||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&300>x.status||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),p&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),p&&e.event.trigger("ajaxError",[x,m,r])),p&&e.event.trigger("ajaxComplete",[x,m]),p&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var l,c,m,p,d,v,g,x,b,y,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(c=0;h.length>c;c++)l=e(h[c]),i?l.prop("disabled",!1):l.removeAttr("disabled");if(m=e.extend(!0,{},e.ajaxSettings,t),m.context=m.context||m,d="jqFormIO"+(new Date).getTime(),m.iframeTarget?(v=e(m.iframeTarget),y=v.attr2("name"),y?d=y:v.attr2("name",d)):(v=e('
'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),p&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},p=m.global,p&&0===e.active++&&e.event.trigger("ajaxStart"),p&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.call(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;b=w.clk,b&&(y=b.name,y&&!b.disabled&&(m.extraData=m.extraData||{},m.extraData[y]=b.value,"image"==b.type&&(m.extraData[y+".x"]=w.clk_x,m.extraData[y+".y"]=w.clk_y)));var k=1,D=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(m.extraData=m.extraData||{},m.extraData[L]=A),m.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,l,c,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),l=t.url||this.attr2("action"),c="string"==typeof l?e.trim(l):"",c=c||window.location.href||"",c&&(c=(c.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:c,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var p=t.traditional;void 0===p&&(p=e.ajaxSettings.traditional);var d,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,d=e.param(t.data,p)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,p);d&&(g=g?g+"&"+d:d),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var b=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(b,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var y=t.error;t.error=function(e,r,a){var n=t.context||this;y.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),w=j.length>0,S="multipart/form-data",k=f.attr("enctype")==S||f.attr("encoding")==S,D=n.fileapi&&n.formdata;a("fileAPI :"+D);var A,L=(w||k)&&!D;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||k)&&D?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;h.length>E;E++)h[E]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n){if(n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var i={s:this.selector,c:this.context};return!e.isReady&&i.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(i.s,i.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().bind("submit.form-plugin",n,t).bind("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r){var a=[];if(0===this.length)return a;var i=this[0],o=t?i.getElementsByTagName("*"):i.elements;if(!o)return a;var s,u,l,c,f,m,p;for(s=0,m=o.length;m>s;s++)if(f=o[s],l=f.name,l&&!f.disabled)if(t&&i.clk&&"image"==f.type)i.clk==f&&(a.push({name:l,value:e(f).val(),type:f.type}),a.push({name:l+".x",value:i.clk_x},{name:l+".y",value:i.clk_y}));else if(c=e.fieldValue(f,!0),c&&c.constructor==Array)for(r&&r.push(f),u=0,p=c.length;p>u;u++)a.push({name:l,value:c[u]});else if(n.fileapi&&"file"==f.type){r&&r.push(f);var d=f.files;if(d.length)for(u=0;d.length>u;u++)a.push({name:l,value:d[u],type:f.type});else a.push({name:l,value:"",type:f.type})}else null!==c&&c!==void 0&&(r&&r.push(f),a.push({name:l,value:c,type:f.type,required:f.required}));if(!t&&i.clk){var h=e(i.clk),v=h[0];l=v.name,l&&!v.disabled&&"image"==v.type&&(a.push({name:l,value:h.val()}),a.push({name:l+".x",value:i.clk_x},{name:l+".y",value:i.clk_y}))}return a},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor==Array)for(var i=0,o=n.length;o>i;i++)r.push({name:a,value:n[i]});else null!==n&&n!==void 0&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||void 0===o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,l="select-one"==n,c=l?o+1:u.length,f=l?o:0;c>f;f++){var m=u[f];if(m.selected){var p=m.value;if(p||(p=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),l)return p;s.push(p)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1})("undefined"!=typeof jQuery?jQuery:window.Zepto);
/*! jQuery & Zepto Lazy v1.7.10 - http://jquery.eisbehr.de/lazy - MIT&GPL-2.0 license - Copyright 2012-2018 Daniel 'Eisbehr' Kern */
!function(t,e){"use strict";function r(r,a,i,u,l){function f(){L=t.devicePixelRatio>1,i=c(i),a.delay>=0&&setTimeout(function(){s(!0)},a.delay),(a.delay<0||a.combined)&&(u.e=v(a.throttle,function(t){"resize"===t.type&&(w=B=-1),s(t.all)}),u.a=function(t){t=c(t),i.push.apply(i,t)},u.g=function(){return i=n(i).filter(function(){return!n(this).data(a.loadedName)})},u.f=function(t){for(var e=0;e
e.top&&-ne.left&&-n=0?w:w=n(t).width()}function h(){return B>=0?B:B=n(t).height()}function m(t){return t.tagName.toLowerCase()}function b(t,e){if(e){var r=t.split(",");t="";for(var a=0,n=r.length;at||!a.enableThrottle||u?l():n=setTimeout(l,t-f)}}function p(){--z,i.length||z||y("onFinishedAll")}function y(t,e,n){return!!(t=a[t])&&(t.apply(r,[].slice.call(arguments,1)),!0)}var z=0,w=-1,B=-1,L=!1,T="afterLoad",D="load",I="error",N="img",E="src",F="srcset",C="sizes",O="background-image";"event"===a.bind||o?f():n(t).on(D+"."+l,f)}function a(a,o){var u=this,l=n.extend({},u.config,o),f={},c=l.name+"-"+ ++i;return u.config=function(t,r){return r===e?l[t]:(l[t]=r,u)},u.addItems=function(t){return f.a&&f.a("string"===n.type(t)?n(t):t),u},u.getItems=function(){return f.g?f.g():{}},u.update=function(t){return f.e&&f.e({},!t),u},u.force=function(t){return f.f&&f.f("string"===n.type(t)?n(t):t),u},u.loadAll=function(){return f.e&&f.e({all:!0},!0),u},u.destroy=function(){return n(l.appendScroll).off("."+c,f.e),n(t).off("."+c),f={},e},r(u,l,a,f,c),l.chainable?a:u}var n=t.jQuery||t.Zepto,i=0,o=!1;n.fn.Lazy=n.fn.lazy=function(t){return new a(this,t)},n.Lazy=n.lazy=function(t,r,i){if(n.isFunction(r)&&(i=r,r=[]),n.isFunction(i)){t=n.isArray(t)?t:[t],r=n.isArray(r)?r:[r];for(var o=a.prototype.config,u=o._f||(o._f={}),l=0,f=t.length;l=f[g]?0:Math.min(f[g],n));!a&&1$1").replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/<(\/?strong)>/g,"<$1>")}function f(a,b){return''+b+"
"}var g=function(){return{escapeRegExChars:function(a){return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(a){var b=document.createElement("div");return b.className=a,b.style.position="absolute",b.style.display="none",b}}}(),h={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40},i=a.noop;b.utils=g,a.Autocomplete=b,b.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:e,formatGroup:f,delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:i,onSearchComplete:i,onSearchError:i,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,preventBadQueries:!0,lookupFilter:c,paramName:"query",transformResult:d,showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},b.prototype={initialize:function(){var c,d=this,e="."+d.classes.suggestion,f=d.classes.selected,g=d.options;d.element.setAttribute("autocomplete","off"),d.noSuggestionsContainer=a('').html(this.options.noSuggestionNotice).get(0),d.suggestionsContainer=b.utils.createNode(g.containerClass),c=a(d.suggestionsContainer),c.appendTo(g.appendTo||"body"),"auto"!==g.width&&c.css("width",g.width),c.on("mouseover.autocomplete",e,function(){d.activate(a(this).data("index"))}),c.on("mouseout.autocomplete",function(){d.selectedIndex=-1,c.children("."+f).removeClass(f)}),c.on("click.autocomplete",e,function(){d.select(a(this).data("index"))}),c.on("click.autocomplete",function(){clearTimeout(d.blurTimeoutId)}),d.fixPositionCapture=function(){d.visible&&d.fixPosition()},a(window).on("resize.autocomplete",d.fixPositionCapture),d.el.on("keydown.autocomplete",function(a){d.onKeyPress(a)}),d.el.on("keyup.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("blur.autocomplete",function(){d.onBlur()}),d.el.on("focus.autocomplete",function(){d.onFocus()}),d.el.on("change.autocomplete",function(a){d.onKeyUp(a)}),d.el.on("input.autocomplete",function(a){d.onKeyUp(a)})},onFocus:function(){var a=this;a.disabled||(a.fixPosition(),a.el.val().length>=a.options.minChars&&a.onValueChange())},onBlur:function(){var b=this,c=b.options,d=b.el.val(),e=b.getQuery(d);b.blurTimeoutId=setTimeout(function(){b.hide(),b.selection&&b.currentValue!==e&&(c.onInvalidateSelection||a.noop).call(b.element)},200)},abortAjax:function(){var a=this;a.currentRequest&&(a.currentRequest.abort(),a.currentRequest=null)},setOptions:function(b){var c=this,d=a.extend({},c.options,b);c.isLocal=Array.isArray(d.lookup),c.isLocal&&(d.lookup=c.verifySuggestionsFormat(d.lookup)),d.orientation=c.validateOrientation(d.orientation,"bottom"),a(c.suggestionsContainer).css({"max-height":d.maxHeight+"px",width:d.width+"px","z-index":d.zIndex}),this.options=d},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var a=this;a.disabled=!0,clearTimeout(a.onChangeTimeout),a.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var b=this,c=a(b.suggestionsContainer),d=c.parent().get(0);if(d===document.body||b.options.forceFixPosition){var e=b.options.orientation,f=c.outerHeight(),g=b.el.outerHeight(),h=b.el.offset(),i={top:h.top,left:h.left};if("auto"===e){var j=a(window).height(),k=a(window).scrollTop(),l=-k+h.top-f,m=k+j-(h.top+g+f);e=Math.max(l,m)===l?"top":"bottom"}if("top"===e?i.top+=-f:i.top+=g,d!==document.body){var n,o=c.css("opacity");b.visible||c.css("opacity",0).show(),n=c.offsetParent().offset(),i.top-=n.top,i.top+=d.scrollTop,i.left-=n.left,b.visible||c.css("opacity",o).hide()}"auto"===b.options.width&&(i.width=b.el.outerWidth()+"px"),c.css(i)}},isCursorAtEnd:function(){var a,b=this,c=b.el.val().length,d=b.element.selectionStart;return"number"==typeof d?d===c:!document.selection||(a=document.selection.createRange(),a.moveStart("character",-c),c===a.text.length)},onKeyPress:function(a){var b=this;if(!b.disabled&&!b.visible&&a.which===h.DOWN&&b.currentValue)return void b.suggest();if(!b.disabled&&b.visible){switch(a.which){case h.ESC:b.el.val(b.currentValue),b.hide();break;case h.RIGHT:if(b.hint&&b.options.onHint&&b.isCursorAtEnd()){b.selectHint();break}return;case h.TAB:if(b.hint&&b.options.onHint)return void b.selectHint();if(b.selectedIndex===-1)return void b.hide();if(b.select(b.selectedIndex),b.options.tabDisabled===!1)return;break;case h.RETURN:if(b.selectedIndex===-1)return void b.hide();b.select(b.selectedIndex);break;case h.UP:b.moveUp();break;case h.DOWN:b.moveDown();break;default:return}a.stopImmediatePropagation(),a.preventDefault()}},onKeyUp:function(a){var b=this;if(!b.disabled){switch(a.which){case h.UP:case h.DOWN:return}clearTimeout(b.onChangeTimeout),b.currentValue!==b.el.val()&&(b.findBestHint(),b.options.deferRequestBy>0?b.onChangeTimeout=setTimeout(function(){b.onValueChange()},b.options.deferRequestBy):b.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)return void(this.ignoreValueChange=!1);var b=this,c=b.options,d=b.el.val(),e=b.getQuery(d);return b.selection&&b.currentValue!==e&&(b.selection=null,(c.onInvalidateSelection||a.noop).call(b.element)),clearTimeout(b.onChangeTimeout),b.currentValue=d,b.selectedIndex=-1,c.triggerSelectOnValidInput&&b.isExactMatch(e)?void b.select(0):void(e.lengthh&&(c.suggestions=c.suggestions.slice(0,h)),c},getSuggestions:function(b){var c,d,e,f,g=this,h=g.options,i=h.serviceUrl;if(h.params[h.paramName]=b,h.onSearchStart.call(g.element,h.params)!==!1){if(d=h.ignoreParams?null:h.params,a.isFunction(h.lookup))return void h.lookup(b,function(a){g.suggestions=a.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,a.suggestions)});g.isLocal?c=g.getSuggestionsLocal(b):(a.isFunction(i)&&(i=i.call(g.element,b)),e=i+"?"+a.param(d||{}),c=g.cachedResponse[e]),c&&Array.isArray(c.suggestions)?(g.suggestions=c.suggestions,g.suggest(),h.onSearchComplete.call(g.element,b,c.suggestions)):g.isBadQuery(b)?h.onSearchComplete.call(g.element,b,[]):(g.abortAjax(),f={url:i,data:d,type:h.type,dataType:h.dataType},a.extend(f,h.ajaxSettings),g.currentRequest=a.ajax(f).done(function(a){var c;g.currentRequest=null,c=h.transformResult(a,b),g.processResponse(c,b,e),h.onSearchComplete.call(g.element,b,c.suggestions)}).fail(function(a,c,d){h.onSearchError.call(g.element,b,a,c,d)}))}},isBadQuery:function(a){if(!this.options.preventBadQueries)return!1;for(var b=this.badQueries,c=b.length;c--;)if(0===a.indexOf(b[c]))return!0;return!1},hide:function(){var b=this,c=a(b.suggestionsContainer);a.isFunction(b.options.onHide)&&b.visible&&b.options.onHide.call(b.element,c),b.visible=!1,b.selectedIndex=-1,clearTimeout(b.onChangeTimeout),a(b.suggestionsContainer).hide(),b.signalHint(null)},suggest:function(){if(!this.suggestions.length)return void(this.options.showNoSuggestionNotice?this.noSuggestions():this.hide());var b,c=this,d=c.options,e=d.groupBy,f=d.formatResult,g=c.getQuery(c.currentValue),h=c.classes.suggestion,i=c.classes.selected,j=a(c.suggestionsContainer),k=a(c.noSuggestionsContainer),l=d.beforeRender,m="",n=function(a,c){var f=a.data[e];return b===f?"":(b=f,d.formatGroup(a,b))};return d.triggerSelectOnValidInput&&c.isExactMatch(g)?void c.select(0):(a.each(c.suggestions,function(a,b){e&&(m+=n(b,g,a)),m+=''+f(b,g,a)+"
"}),this.adjustContainerWidth(),k.detach(),j.html(m),a.isFunction(l)&&l.call(c.element,j,c.suggestions),c.fixPosition(),j.show(),d.autoSelectFirst&&(c.selectedIndex=0,j.scrollTop(0),j.children("."+h).first().addClass(i)),c.visible=!0,void c.findBestHint())},noSuggestions:function(){var b=this,c=b.options.beforeRender,d=a(b.suggestionsContainer),e=a(b.noSuggestionsContainer);this.adjustContainerWidth(),e.detach(),d.empty(),d.append(e),a.isFunction(c)&&c.call(b.element,d,b.suggestions),b.fixPosition(),d.show(),b.visible=!0},adjustContainerWidth:function(){var b,c=this,d=c.options,e=a(c.suggestionsContainer);"auto"===d.width?(b=c.el.outerWidth(),e.css("width",b>0?b:300)):"flex"===d.width&&e.css("width","")},findBestHint:function(){var b=this,c=b.el.val().toLowerCase(),d=null;c&&(a.each(b.suggestions,function(a,b){var e=0===b.value.toLowerCase().indexOf(c);return e&&(d=b),!e}),b.signalHint(d))},signalHint:function(b){var c="",d=this;b&&(c=d.currentValue+b.value.substr(d.currentValue.length)),d.hintValue!==c&&(d.hintValue=c,d.hint=b,(this.options.onHint||a.noop)(c))},verifySuggestionsFormat:function(b){return b.length&&"string"==typeof b[0]?a.map(b,function(a){return{value:a,data:null}}):b},validateOrientation:function(b,c){return b=a.trim(b||"").toLowerCase(),a.inArray(b,["auto","bottom","top"])===-1&&(b=c),b},processResponse:function(a,b,c){var d=this,e=d.options;a.suggestions=d.verifySuggestionsFormat(a.suggestions),e.noCache||(d.cachedResponse[c]=a,e.preventBadQueries&&!a.suggestions.length&&d.badQueries.push(b)),b===d.getQuery(d.currentValue)&&(d.suggestions=a.suggestions,d.suggest())},activate:function(b){var c,d=this,e=d.classes.selected,f=a(d.suggestionsContainer),g=f.find("."+d.classes.suggestion);return f.find("."+e).removeClass(e),d.selectedIndex=b,d.selectedIndex!==-1&&g.length>d.selectedIndex?(c=g.get(d.selectedIndex),a(c).addClass(e),c):null},selectHint:function(){var b=this,c=a.inArray(b.hint,b.suggestions);b.select(c)},select:function(a){var b=this;b.hide(),b.onSelect(a)},moveUp:function(){var b=this;if(b.selectedIndex!==-1)return 0===b.selectedIndex?(a(b.suggestionsContainer).children("."+b.classes.suggestion).first().removeClass(b.classes.selected),b.selectedIndex=-1,b.ignoreValueChange=!1,b.el.val(b.currentValue),void b.findBestHint()):void b.adjustScroll(b.selectedIndex-1)},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&a.adjustScroll(a.selectedIndex+1)},adjustScroll:function(b){var c=this,d=c.activate(b);if(d){var e,f,g,h=a(d).outerHeight();e=d.offsetTop,f=a(c.suggestionsContainer).scrollTop(),g=f+c.options.maxHeight-h,eg&&a(c.suggestionsContainer).scrollTop(e-c.options.maxHeight+h),c.options.preserveInput||(c.ignoreValueChange=!0,c.el.val(c.getValue(c.suggestions[b].value))),c.signalHint(null)}},onSelect:function(b){var c=this,d=c.options.onSelect,e=c.suggestions[b];c.currentValue=c.getValue(e.value),c.currentValue===c.el.val()||c.options.preserveInput||c.el.val(c.currentValue),c.signalHint(null),c.suggestions=[],c.selection=e,a.isFunction(d)&&d.call(c.element,e)},getValue:function(a){var b,c,d=this,e=d.options.delimiter;return e?(b=d.currentValue,c=b.split(e),1===c.length?a:b.substr(0,b.length-c[c.length-1].length)+a):a},dispose:function(){var b=this;b.el.off(".autocomplete").removeData("autocomplete"),a(window).off("resize.autocomplete",b.fixPositionCapture),a(b.suggestionsContainer).remove()}},a.fn.devbridgeAutocomplete=function(c,d){var e="autocomplete";return arguments.length?this.each(function(){var f=a(this),g=f.data(e);"string"==typeof c?g&&"function"==typeof g[c]&&g[c](d):(g&&g.dispose&&g.dispose(),g=new b(this,c),f.data(e,g))}):this.first().data(e)},a.fn.autocomplete||(a.fn.autocomplete=a.fn.devbridgeAutocomplete)});
/*! fancyBox v2.1.5 fancyapps.com | fancyapps.com/fancybox/#license */
(function (r, G, f, v) {
var J = f("html"),
n = f(r),
p = f(G),
b = (f.fancybox = function () {
b.open.apply(this, arguments);
}),
I = navigator.userAgent.match(/msie/i),
B = null,
s = G.createTouch !== v,
t = function (a) {
return a && a.hasOwnProperty && a instanceof f;
},
q = function (a) {
return a && "string" === f.type(a);
},
E = function (a) {
return q(a) && 0 < a.indexOf("%");
},
l = function (a, d) {
var e = parseInt(a, 10) || 0;
d && E(a) && (e *= b.getViewport()[d] / 100);
return Math.ceil(e);
},
w = function (a, b) {
return l(a, b) + "px";
};
f.extend(b, {
version: "2.1.5",
defaults: {
padding: 15,
margin: 20,
width: 800,
height: 600,
minWidth: 100,
minHeight: 100,
maxWidth: 9999,
maxHeight: 9999,
pixelRatio: 1,
autoSize: !0,
autoHeight: !1,
autoWidth: !1,
autoResize: !0,
autoCenter: !s,
fitToView: !0,
aspectRatio: !1,
topRatio: 0.5,
leftRatio: 0.5,
scrolling: "auto",
wrapCSS: "",
arrows: !0,
closeBtn: !0,
closeClick: !1,
nextClick: !1,
mouseWheel: !0,
autoPlay: !1,
playSpeed: 3e3,
preload: 3,
modal: !1,
loop: !0,
ajax: { dataType: "html", headers: { "X-fancyBox": !0 } },
iframe: { scrolling: "auto", preload: !0 },
swf: { wmode: "transparent", allowfullscreen: "true", allowscriptaccess: "always" },
keys: { next: { 13: "left", 34: "up", 39: "left", 40: "up" }, prev: { 8: "right", 33: "down", 37: "right", 38: "down" }, close: [27], play: [32], toggle: [70] },
direction: { next: "left", prev: "right" },
scrollOutside: !0,
index: 0,
type: null,
href: null,
content: null,
title: null,
tpl: {
wrap: '',
image: '
',
iframe:
'",
error: '頁面請求失敗,請刷新重試!
',
closeBtn: '',
next: '',
prev: '',
},
openEffect: "fade",
openSpeed: 250,
openEasing: "swing",
openOpacity: !0,
openMethod: "zoomIn",
closeEffect: "fade",
closeSpeed: 250,
closeEasing: "swing",
closeOpacity: !0,
closeMethod: "zoomOut",
nextEffect: "elastic",
nextSpeed: 250,
nextEasing: "swing",
nextMethod: "changeIn",
prevEffect: "elastic",
prevSpeed: 250,
prevEasing: "swing",
prevMethod: "changeOut",
helpers: { overlay: !0, title: !0 },
onCancel: f.noop,
beforeLoad: f.noop,
afterLoad: f.noop,
beforeShow: f.noop,
afterShow: f.noop,
beforeChange: f.noop,
beforeClose: f.noop,
afterClose: f.noop,
},
group: {},
opts: {},
previous: null,
coming: null,
current: null,
isActive: !1,
isOpen: !1,
isOpened: !1,
wrap: null,
skin: null,
outer: null,
inner: null,
player: { timer: null, isActive: !1 },
ajaxLoad: null,
imgPreload: null,
transitions: {},
helpers: {},
open: function (a, d) {
if (a && (f.isPlainObject(d) || (d = {}), !1 !== b.close(!0)))
return (
f.isArray(a) || (a = t(a) ? f(a).get() : [a]),
f.each(a, function (e, c) {
var k = {},
g,
h,
j,
m,
l;
"object" === f.type(c) &&
(c.nodeType && (c = f(c)),
t(c) ? ((k = { href: c.data("fancybox-href") || c.attr("href"), title: c.data("fancybox-title") || c.attr("title"), isDom: !0, element: c }), f.metadata && f.extend(!0, k, c.metadata())) : (k = c));
g = d.href || k.href || (q(c) ? c : null);
h = d.title !== v ? d.title : k.title || "";
m = (j = d.content || k.content) ? "html" : d.type || k.type;
!m && k.isDom && ((m = c.data("fancybox-type")), m || (m = (m = c.prop("class").match(/fancybox\.(\w+)/)) ? m[1] : null));
q(g) &&
(m || (b.isImage(g) ? (m = "image") : b.isSWF(g) ? (m = "swf") : "#" === g.charAt(0) ? (m = "inline") : q(c) && ((m = "html"), (j = c))),
"ajax" === m && ((l = g.split(/\s+/, 2)), (g = l.shift()), (l = l.shift())));
j || ("inline" === m ? (g ? (j = f(q(g) ? g.replace(/.*(?=#[^\s]+$)/, "") : g)) : k.isDom && (j = c)) : "html" === m ? (j = g) : !m && !g && k.isDom && ((m = "inline"), (j = c)));
f.extend(k, { href: g, type: m, content: j, title: h, selector: l });
a[e] = k;
}),
(b.opts = f.extend(!0, {}, b.defaults, d)),
d.keys !== v && (b.opts.keys = d.keys ? f.extend({}, b.defaults.keys, d.keys) : !1),
(b.group = a),
b._start(b.opts.index)
);
},
cancel: function () {
var a = b.coming;
a &&
!1 !== b.trigger("onCancel") &&
(b.hideLoading(),
b.ajaxLoad && b.ajaxLoad.abort(),
(b.ajaxLoad = null),
b.imgPreload && (b.imgPreload.onload = b.imgPreload.onerror = null),
a.wrap && a.wrap.stop(!0, !0).trigger("onReset").remove(),
(b.coming = null),
b.current || b._afterZoomOut(a));
},
close: function (a) {
b.cancel();
!1 !== b.trigger("beforeClose") &&
(b.unbindEvents(),
b.isActive &&
(!b.isOpen || !0 === a
? (f(".fancybox-wrap").stop(!0).trigger("onReset").remove(), b._afterZoomOut())
: ((b.isOpen = b.isOpened = !1), (b.isClosing = !0), f(".fancybox-item, .fancybox-nav").remove(), b.wrap.stop(!0, !0).removeClass("fancybox-opened"), b.transitions[b.current.closeMethod]())));
},
play: function (a) {
var d = function () {
clearTimeout(b.player.timer);
},
e = function () {
d();
b.current && b.player.isActive && (b.player.timer = setTimeout(b.next, b.current.playSpeed));
},
c = function () {
d();
p.unbind(".player");
b.player.isActive = !1;
b.trigger("onPlayEnd");
};
if (!0 === a || (!b.player.isActive && !1 !== a)) {
if (b.current && (b.current.loop || b.current.index < b.group.length - 1))
(b.player.isActive = !0), p.bind({ "onCancel.player beforeClose.player": c, "onUpdate.player": e, "beforeLoad.player": d }), e(), b.trigger("onPlayStart");
} else c();
},
next: function (a) {
var d = b.current;
d && (q(a) || (a = d.direction.next), b.jumpto(d.index + 1, a, "next"));
},
prev: function (a) {
var d = b.current;
d && (q(a) || (a = d.direction.prev), b.jumpto(d.index - 1, a, "prev"));
},
jumpto: function (a, d, e) {
var c = b.current;
c &&
((a = l(a)),
(b.direction = d || c.direction[a >= c.index ? "next" : "prev"]),
(b.router = e || "jumpto"),
c.loop && (0 > a && (a = c.group.length + (a % c.group.length)), (a %= c.group.length)),
c.group[a] !== v && (b.cancel(), b._start(a)));
},
reposition: function (a, d) {
var e = b.current,
c = e ? e.wrap : null,
k;
c && ((k = b._getPosition(d)), a && "scroll" === a.type ? (delete k.position, c.stop(!0, !0).animate(k, 200)) : (c.css(k), (e.pos = f.extend({}, e.dim, k))));
},
update: function (a) {
var d = a && a.type,
e = !d || "orientationchange" === d;
e && (clearTimeout(B), (B = null));
b.isOpen &&
!B &&
(B = setTimeout(
function () {
var c = b.current;
c &&
!b.isClosing &&
(b.wrap.removeClass("fancybox-tmp"), (e || "load" === d || ("resize" === d && c.autoResize)) && b._setDimension(), ("scroll" === d && c.canShrink) || b.reposition(a), b.trigger("onUpdate"), (B = null));
},
e && !s ? 0 : 300
));
},
toggle: function (a) {
b.isOpen && ((b.current.fitToView = "boolean" === f.type(a) ? a : !b.current.fitToView), s && (b.wrap.removeAttr("style").addClass("fancybox-tmp"), b.trigger("onUpdate")), b.update());
},
hideLoading: function () {
p.unbind(".loading");
f("#fancybox-loading").remove();
},
showLoading: function () {
var a, d;
b.hideLoading();
a = f('').click(b.cancel).appendTo("body");
p.bind("keydown.loading", function (a) {
if (27 === (a.which || a.keyCode)) a.preventDefault(), b.cancel();
});
b.defaults.fixed || ((d = b.getViewport()), a.css({ position: "absolute", top: 0.5 * d.h + d.y, left: 0.5 * d.w + d.x }));
},
getViewport: function () {
var a = (b.current && b.current.locked) || !1,
d = { x: n.scrollLeft(), y: n.scrollTop() };
a ? ((d.w = a[0].clientWidth), (d.h = a[0].clientHeight)) : ((d.w = s && r.innerWidth ? r.innerWidth : n.width()), (d.h = s && r.innerHeight ? r.innerHeight : n.height()));
return d;
},
unbindEvents: function () {
b.wrap && t(b.wrap) && b.wrap.unbind(".fb");
p.unbind(".fb");
n.unbind(".fb");
},
bindEvents: function () {
var a = b.current,
d;
a &&
(n.bind("orientationchange.fb" + (s ? "" : " resize.fb") + (a.autoCenter && !a.locked ? " scroll.fb" : ""), b.update),
(d = a.keys) &&
p.bind("keydown.fb", function (e) {
var c = e.which || e.keyCode,
k = e.target || e.srcElement;
if (27 === c && b.coming) return !1;
!e.ctrlKey &&
!e.altKey &&
!e.shiftKey &&
!e.metaKey &&
(!k || (!k.type && !f(k).is("[contenteditable]"))) &&
f.each(d, function (d, k) {
if (1 < a.group.length && k[c] !== v) return b[d](k[c]), e.preventDefault(), !1;
if (-1 < f.inArray(c, k)) return b[d](), e.preventDefault(), !1;
});
}),
f.fn.mousewheel &&
a.mouseWheel &&
b.wrap.bind("mousewheel.fb", function (d, c, k, g) {
for (var h = f(d.target || null), j = !1; h.length && !j && !h.is(".fancybox-skin") && !h.is(".fancybox-wrap"); )
(j = h[0] && !(h[0].style.overflow && "hidden" === h[0].style.overflow) && ((h[0].clientWidth && h[0].scrollWidth > h[0].clientWidth) || (h[0].clientHeight && h[0].scrollHeight > h[0].clientHeight))),
(h = f(h).parent());
if (0 !== c && !j && 1 < b.group.length && !a.canShrink) {
if (0 < g || 0 < k) b.prev(0 < g ? "down" : "left");
else if (0 > g || 0 > k) b.next(0 > g ? "up" : "right");
d.preventDefault();
}
}));
},
trigger: function (a, d) {
var e,
c = d || b.coming || b.current;
if (c) {
f.isFunction(c[a]) && (e = c[a].apply(c, Array.prototype.slice.call(arguments, 1)));
if (!1 === e) return !1;
c.helpers &&
f.each(c.helpers, function (d, e) {
if (e && b.helpers[d] && f.isFunction(b.helpers[d][a])) b.helpers[d][a](f.extend(!0, {}, b.helpers[d].defaults, e), c);
});
p.trigger(a);
}
},
isImage: function (a) {
return q(a) && a.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i);
},
isSWF: function (a) {
return q(a) && a.match(/\.(swf)((\?|#).*)?$/i);
},
_start: function (a) {
var d = {},
e,
c;
a = l(a);
e = b.group[a] || null;
if (!e) return !1;
d = f.extend(!0, {}, b.opts, e);
e = d.margin;
c = d.padding;
"number" === f.type(e) && (d.margin = [e, e, e, e]);
"number" === f.type(c) && (d.padding = [c, c, c, c]);
d.modal && f.extend(!0, d, { closeBtn: !1, closeClick: !1, nextClick: !1, arrows: !1, mouseWheel: !1, keys: null, helpers: { overlay: { closeClick: !1 } } });
d.autoSize && (d.autoWidth = d.autoHeight = !0);
"auto" === d.width && (d.autoWidth = !0);
"auto" === d.height && (d.autoHeight = !0);
d.group = b.group;
d.index = a;
b.coming = d;
if (!1 === b.trigger("beforeLoad")) b.coming = null;
else {
c = d.type;
e = d.href;
if (!c) return (b.coming = null), b.current && b.router && "jumpto" !== b.router ? ((b.current.index = a), b[b.router](b.direction)) : !1;
b.isActive = !0;
if ("image" === c || "swf" === c) (d.autoHeight = d.autoWidth = !1), (d.scrolling = "visible");
"image" === c && (d.aspectRatio = !0);
"iframe" === c && s && (d.scrolling = "scroll");
d.wrap = f(d.tpl.wrap)
.addClass("fancybox-" + (s ? "mobile" : "desktop") + " fancybox-type-" + c + " fancybox-tmp " + d.wrapCSS)
.appendTo(d.parent || "body");
f.extend(d, { skin: f(".fancybox-skin", d.wrap), outer: f(".fancybox-outer", d.wrap), inner: f(".fancybox-inner", d.wrap) });
f.each(["Top", "Right", "Bottom", "Left"], function (a, b) {
d.skin.css("padding" + b, w(d.padding[a]));
});
b.trigger("onReady");
if ("inline" === c || "html" === c) {
if (!d.content || !d.content.length) return b._error("content");
} else if (!e) return b._error("href");
"image" === c ? b._loadImage() : "ajax" === c ? b._loadAjax() : "iframe" === c ? b._loadIframe() : b._afterLoad();
}
},
_error: function (a) {
f.extend(b.coming, { type: "html", autoWidth: !0, autoHeight: !0, minWidth: 0, minHeight: 0, scrolling: "no", hasError: a, content: b.coming.tpl.error });
b._afterLoad();
},
_loadImage: function () {
var a = (b.imgPreload = new Image());
a.onload = function () {
this.onload = this.onerror = null;
b.coming.width = this.width / b.opts.pixelRatio;
b.coming.height = this.height / b.opts.pixelRatio;
b._afterLoad();
};
a.onerror = function () {
this.onload = this.onerror = null;
b._error("image");
};
a.src = b.coming.href;
!0 !== a.complete && b.showLoading();
},
_loadAjax: function () {
var a = b.coming;
b.showLoading();
b.ajaxLoad = f.ajax(
f.extend({}, a.ajax, {
url: a.href,
error: function (a, e) {
b.coming && "abort" !== e ? b._error("ajax", a) : b.hideLoading();
},
success: function (d, e) {
"success" === e && ((a.content = d), b._afterLoad());
},
})
);
},
_loadIframe: function () {
var a = b.coming,
d = f(a.tpl.iframe.replace(/\{rnd\}/g, new Date().getTime()))
.attr("scrolling", s ? "auto" : a.iframe.scrolling)
.attr("src", a.href);
f(a.wrap).bind("onReset", function () {
try {
f(this).find("iframe").hide().attr("src", "//about:blank").end().empty();
} catch (a) {}
});
a.iframe.preload &&
(b.showLoading(),
d.one("load", function () {
f(this).data("ready", 1);
s || f(this).bind("load.fb", b.update);
f(this).parents(".fancybox-wrap").width("100%").removeClass("fancybox-tmp").show();
b._afterLoad();
}));
a.content = d.appendTo(a.inner);
a.iframe.preload || b._afterLoad();
},
_preloadImages: function () {
var a = b.group,
d = b.current,
e = a.length,
c = d.preload ? Math.min(d.preload, e - 1) : 0,
f,
g;
for (g = 1; g <= c; g += 1) (f = a[(d.index + g) % e]), "image" === f.type && f.href && (new Image().src = f.href);
},
_afterLoad: function () {
var a = b.coming,
d = b.current,
e,
c,
k,
g,
h;
b.hideLoading();
if (a && !1 !== b.isActive)
if (!1 === b.trigger("afterLoad", a, d)) a.wrap.stop(!0).trigger("onReset").remove(), (b.coming = null);
else {
d && (b.trigger("beforeChange", d), d.wrap.stop(!0).removeClass("fancybox-opened").find(".fancybox-item, .fancybox-nav").remove());
b.unbindEvents();
e = a.content;
c = a.type;
k = a.scrolling;
f.extend(b, { wrap: a.wrap, skin: a.skin, outer: a.outer, inner: a.inner, current: a, previous: d });
g = a.href;
switch (c) {
case "inline":
case "ajax":
case "html":
a.selector
? (e = f("").html(e).find(a.selector))
: t(e) &&
(e.data("fancybox-placeholder") || e.data("fancybox-placeholder", f('
').insertAfter(e).hide()),
(e = e.show().detach()),
a.wrap.bind("onReset", function () {
f(this).find(e).length && e.hide().replaceAll(e.data("fancybox-placeholder")).data("fancybox-placeholder", !1);
}));
break;
case "image":
e = a.tpl.image.replace("{href}", g);
break;
case "swf":
(e = '
");
}
(!t(e) || !e.parent().is(a.inner)) && a.inner.append(e);
b.trigger("beforeShow");
a.inner.css("overflow", "yes" === k ? "scroll" : "no" === k ? "hidden" : k);
b._setDimension();
b.reposition();
b.isOpen = !1;
b.coming = null;
b.bindEvents();
if (b.isOpened) {
if (d.prevMethod) b.transitions[d.prevMethod]();
} else f(".fancybox-wrap").not(a.wrap).stop(!0).trigger("onReset").remove();
b.transitions[b.isOpened ? a.nextMethod : a.openMethod]();
b._preloadImages();
}
},
_setDimension: function () {
var a = b.getViewport(),
d = 0,
e = !1,
c = !1,
e = b.wrap,
k = b.skin,
g = b.inner,
h = b.current,
c = h.width,
j = h.height,
m = h.minWidth,
u = h.minHeight,
n = h.maxWidth,
p = h.maxHeight,
s = h.scrolling,
q = h.scrollOutside ? h.scrollbarWidth : 0,
x = h.margin,
y = l(x[1] + x[3]),
r = l(x[0] + x[2]),
v,
z,
t,
C,
A,
F,
B,
D,
H;
e.add(k).add(g).width("auto").height("auto").removeClass("fancybox-tmp");
x = l(k.outerWidth(!0) - k.width());
v = l(k.outerHeight(!0) - k.height());
z = y + x;
t = r + v;
C = E(c) ? ((a.w - z) * l(c)) / 100 : c;
A = E(j) ? ((a.h - t) * l(j)) / 100 : j;
if ("iframe" === h.type) {
if (((H = h.content), h.autoHeight && 1 === H.data("ready")))
try {
H[0].contentWindow.document.location && (g.width(C).height(9999), (F = H.contents().find("body")), q && F.css("overflow-x", "hidden"), (A = F.outerHeight(!0)));
} catch (G) {}
} else if (h.autoWidth || h.autoHeight) g.addClass("fancybox-tmp"), h.autoWidth || g.width(C), h.autoHeight || g.height(A), h.autoWidth && (C = g.width()), h.autoHeight && (A = g.height()), g.removeClass("fancybox-tmp");
c = l(C);
j = l(A);
D = C / A;
m = l(E(m) ? l(m, "w") - z : m);
n = l(E(n) ? l(n, "w") - z : n);
u = l(E(u) ? l(u, "h") - t : u);
p = l(E(p) ? l(p, "h") - t : p);
F = n;
B = p;
h.fitToView && ((n = Math.min(a.w - z, n)), (p = Math.min(a.h - t, p)));
z = a.w - y;
r = a.h - r;
h.aspectRatio
? (c > n && ((c = n), (j = l(c / D))), j > p && ((j = p), (c = l(j * D))), c < m && ((c = m), (j = l(c / D))), j < u && ((j = u), (c = l(j * D))))
: ((c = Math.max(m, Math.min(c, n))), h.autoHeight && "iframe" !== h.type && (g.width(c), (j = g.height())), (j = Math.max(u, Math.min(j, p))));
if (h.fitToView)
if ((g.width(c).height(j), e.width(c + x), (a = e.width()), (y = e.height()), h.aspectRatio))
for (; (a > z || y > r) && c > m && j > u && !(19 < d++); )
(j = Math.max(u, Math.min(p, j - 10))), (c = l(j * D)), c < m && ((c = m), (j = l(c / D))), c > n && ((c = n), (j = l(c / D))), g.width(c).height(j), e.width(c + x), (a = e.width()), (y = e.height());
else (c = Math.max(m, Math.min(c, c - (a - z)))), (j = Math.max(u, Math.min(j, j - (y - r))));
q && "auto" === s && j < A && c + x + q < z && (c += q);
g.width(c).height(j);
e.width(c + x);
a = e.width();
y = e.height();
e = (a > z || y > r) && c > m && j > u;
c = h.aspectRatio ? c < F && j < B && c < C && j < A : (c < F || j < B) && (c < C || j < A);
f.extend(h, { dim: { width: w(a), height: w(y) }, origWidth: C, origHeight: A, canShrink: e, canExpand: c, wPadding: x, hPadding: v, wrapSpace: y - k.outerHeight(!0), skinSpace: k.height() - j });
!H && h.autoHeight && j > u && j < p && !c && g.height("auto");
},
_getPosition: function (a) {
var d = b.current,
e = b.getViewport(),
c = d.margin,
f = b.wrap.width() + c[1] + c[3],
g = b.wrap.height() + c[0] + c[2],
c = { position: "absolute", top: c[0], left: c[3] };
d.autoCenter && d.fixed && !a && g <= e.h && f <= e.w ? (c.position = "fixed") : d.locked || ((c.top += e.y), (c.left += e.x));
c.top = w(Math.max(c.top, c.top + (e.h - g) * d.topRatio));
c.left = w(Math.max(c.left, c.left + (e.w - f) * d.leftRatio));
return c;
},
_afterZoomIn: function () {
var a = b.current;
a &&
((b.isOpen = b.isOpened = !0),
b.wrap.css("overflow", "visible").addClass("fancybox-opened"),
b.update(),
(a.closeClick || (a.nextClick && 1 < b.group.length)) &&
b.inner.css("cursor", "pointer").bind("click.fb", function (d) {
!f(d.target).is("a") && !f(d.target).parent().is("a") && (d.preventDefault(), b[a.closeClick ? "close" : "next"]());
}),
a.closeBtn &&
f(a.tpl.closeBtn)
.appendTo(b.skin)
.bind("click.fb", function (a) {
a.preventDefault();
b.close();
}),
a.arrows && 1 < b.group.length && ((a.loop || 0 < a.index) && f(a.tpl.prev).appendTo(b.outer).bind("click.fb", b.prev), (a.loop || a.index < b.group.length - 1) && f(a.tpl.next).appendTo(b.outer).bind("click.fb", b.next)),
b.trigger("afterShow"),
!a.loop && a.index === a.group.length - 1 ? b.play(!1) : b.opts.autoPlay && !b.player.isActive && ((b.opts.autoPlay = !1), b.play()));
},
_afterZoomOut: function (a) {
a = a || b.current;
f(".fancybox-wrap").trigger("onReset").remove();
f.extend(b, { group: {}, opts: {}, router: !1, current: null, isActive: !1, isOpened: !1, isOpen: !1, isClosing: !1, wrap: null, skin: null, outer: null, inner: null });
b.trigger("afterClose", a);
},
});
b.transitions = {
getOrigPosition: function () {
var a = b.current,
d = a.element,
e = a.orig,
c = {},
f = 50,
g = 50,
h = a.hPadding,
j = a.wPadding,
m = b.getViewport();
!e && a.isDom && d.is(":visible") && ((e = d.find("img:first")), e.length || (e = d));
t(e) ? ((c = e.offset()), e.is("img") && ((f = e.outerWidth()), (g = e.outerHeight()))) : ((c.top = m.y + (m.h - g) * a.topRatio), (c.left = m.x + (m.w - f) * a.leftRatio));
if ("fixed" === b.wrap.css("position") || a.locked) (c.top -= m.y), (c.left -= m.x);
return (c = { top: w(c.top - h * a.topRatio), left: w(c.left - j * a.leftRatio), width: w(f + j), height: w(g + h) });
},
step: function (a, d) {
var e,
c,
f = d.prop;
c = b.current;
var g = c.wrapSpace,
h = c.skinSpace;
if ("width" === f || "height" === f)
(e = d.end === d.start ? 1 : (a - d.start) / (d.end - d.start)),
b.isClosing && (e = 1 - e),
(c = "width" === f ? c.wPadding : c.hPadding),
(c = a - c),
b.skin[f](l("width" === f ? c : c - g * e)),
b.inner[f](l("width" === f ? c : c - g * e - h * e));
},
zoomIn: function () {
var a = b.current,
d = a.pos,
e = a.openEffect,
c = "elastic" === e,
k = f.extend({ opacity: 1 }, d);
delete k.position;
c ? ((d = this.getOrigPosition()), a.openOpacity && (d.opacity = 0.1)) : "fade" === e && (d.opacity = 0.1);
b.wrap.css(d).animate(k, { duration: "none" === e ? 0 : a.openSpeed, easing: a.openEasing, step: c ? this.step : null, complete: b._afterZoomIn });
},
zoomOut: function () {
var a = b.current,
d = a.closeEffect,
e = "elastic" === d,
c = { opacity: 0.1 };
e && ((c = this.getOrigPosition()), a.closeOpacity && (c.opacity = 0.1));
b.wrap.animate(c, { duration: "none" === d ? 0 : a.closeSpeed, easing: a.closeEasing, step: e ? this.step : null, complete: b._afterZoomOut });
},
changeIn: function () {
var a = b.current,
d = a.nextEffect,
e = a.pos,
c = { opacity: 1 },
f = b.direction,
g;
e.opacity = 0.1;
"elastic" === d && ((g = "down" === f || "up" === f ? "top" : "left"), "down" === f || "right" === f ? ((e[g] = w(l(e[g]) - 200)), (c[g] = "+=200px")) : ((e[g] = w(l(e[g]) + 200)), (c[g] = "-=200px")));
"none" === d ? b._afterZoomIn() : b.wrap.css(e).animate(c, { duration: a.nextSpeed, easing: a.nextEasing, complete: b._afterZoomIn });
},
changeOut: function () {
var a = b.previous,
d = a.prevEffect,
e = { opacity: 0.1 },
c = b.direction;
"elastic" === d && (e["down" === c || "up" === c ? "top" : "left"] = ("up" === c || "left" === c ? "-" : "+") + "=200px");
a.wrap.animate(e, {
duration: "none" === d ? 0 : a.prevSpeed,
easing: a.prevEasing,
complete: function () {
f(this).trigger("onReset").remove();
},
});
},
};
b.helpers.overlay = {
defaults: { closeClick: !0, speedOut: 200, showEarly: !0, css: {}, locked: !s, fixed: !0 },
overlay: null,
fixed: !1,
el: f("html"),
create: function (a) {
a = f.extend({}, this.defaults, a);
this.overlay && this.close();
this.overlay = f('
').appendTo(b.coming ? b.coming.parent : a.parent);
this.fixed = !1;
a.fixed && b.defaults.fixed && (this.overlay.addClass("fancybox-overlay-fixed"), (this.fixed = !0));
},
open: function (a) {
var d = this;
a = f.extend({}, this.defaults, a);
this.overlay ? this.overlay.unbind(".overlay").width("auto").height("auto") : this.create(a);
this.fixed || (n.bind("resize.overlay", f.proxy(this.update, this)), this.update());
a.closeClick &&
this.overlay.bind("click.overlay", function (a) {
if (f(a.target).hasClass("fancybox-overlay")) return b.isActive ? b.close() : d.close(), !1;
});
this.overlay.css(a.css).show();
},
close: function () {
var a, b;
n.unbind("resize.overlay");
this.el.hasClass("fancybox-lock") && (f(".fancybox-margin").removeClass("fancybox-margin"), (a = n.scrollTop()), (b = n.scrollLeft()), this.el.removeClass("fancybox-lock"), n.scrollTop(a).scrollLeft(b));
f(".fancybox-overlay").remove().hide();
f.extend(this, { overlay: null, fixed: !1 });
},
update: function () {
var a = "100%",
b;
this.overlay.width(a).height("100%");
I ? ((b = Math.max(G.documentElement.offsetWidth, G.body.offsetWidth)), p.width() > b && (a = p.width())) : p.width() > n.width() && (a = p.width());
this.overlay.width(a).height(p.height());
},
onReady: function (a, b) {
var e = this.overlay;
f(".fancybox-overlay").stop(!0, !0);
e || this.create(a);
a.locked && this.fixed && b.fixed && (e || (this.margin = p.height() > n.height() ? f("html").css("margin-right").replace("px", "") : !1), (b.locked = this.overlay.append(b.wrap)), (b.fixed = !1));
!0 === a.showEarly && this.beforeShow.apply(this, arguments);
},
beforeShow: function (a, b) {
var e, c;
b.locked &&
(!1 !== this.margin &&
(f("*")
.filter(function () {
return "fixed" === f(this).css("position") && !f(this).hasClass("fancybox-overlay") && !f(this).hasClass("fancybox-wrap");
})
.addClass("fancybox-margin"),
this.el.addClass("fancybox-margin")),
(e = n.scrollTop()),
(c = n.scrollLeft()),
this.el.addClass("fancybox-lock"),
n.scrollTop(e).scrollLeft(c));
if (!$('html').hasClass('fancybox-lock')) {
$('html').addClass('fancybox-lock')
}
this.open(a);
},
onUpdate: function () {
this.fixed || this.update();
},
afterClose: function (a) {
this.overlay && !b.coming && this.overlay.fadeOut(a.speedOut, f.proxy(this.close, this));
},
};
b.helpers.title = {
defaults: { type: "float", position: "bottom" },
beforeShow: function (a) {
var d = b.current,
e = d.title,
c = a.type;
f.isFunction(e) && (e = e.call(d.element, d));
if (q(e) && "" !== f.trim(e)) {
d = f('
' + e + "
");
switch (c) {
case "inside":
c = b.skin;
break;
case "outside":
c = b.wrap;
break;
case "over":
c = b.inner;
break;
default:
(c = b.skin), d.appendTo("body"), I && d.width(d.width()), d.wrapInner('
'), (b.current.margin[2] += Math.abs(l(d.css("margin-bottom"))));
}
d["top" === a.position ? "prependTo" : "appendTo"](c);
}
},
};
f.fn.fancybox = function (a) {
var d,
e = f(this),
c = this.selector || "",
k = function (g) {
var h = f(this).blur(),
j = d,
k,
l;
!g.ctrlKey &&
!g.altKey &&
!g.shiftKey &&
!g.metaKey &&
!h.is(".fancybox-wrap") &&
((k = a.groupAttr || "data-fancybox-group"),
(l = h.attr(k)),
l || ((k = "rel"), (l = h.get(0)[k])),
l && "" !== l && "nofollow" !== l && ((h = c.length ? f(c) : e), (h = h.filter("[" + k + '="' + l + '"]')), (j = h.index(this))),
(a.index = j),
!1 !== b.open(h, a) && g.preventDefault());
};
a = a || {};
d = a.index || 0;
!c || !1 === a.live ? e.unbind("click.fb-start").bind("click.fb-start", k) : p.undelegate(c, "click.fb-start").delegate(c + ":not('.fancybox-item, .fancybox-nav')", "click.fb-start", k);
this.filter("[data-fancybox-start=1]").trigger("click");
return this;
};
p.ready(function () {
var a, d;
f.scrollbarWidth === v &&
(f.scrollbarWidth = function () {
var a = f('
').appendTo("body"),
b = a.children(),
b = b.innerWidth() - b.height(99).innerWidth();
a.remove();
return b;
});
if (f.support.fixedPosition === v) {
a = f.support;
d = f('
').appendTo("body");
var e = 20 === d[0].offsetTop || 15 === d[0].offsetTop;
d.remove();
a.fixedPosition = e;
}
f.extend(b.defaults, { scrollbarWidth: f.scrollbarWidth(), fixed: f.support.fixedPosition, parent: f("body") });
a = f(r).width();
J.addClass("fancybox-lock-test");
d = f(r).width();
J.removeClass("fancybox-lock-test");
f("").appendTo("head");
});
})(window, document, jQuery);
/** image rotator */
!function(r){var l={},m=null,v=null;function a(){var t;!m||(t=l[m])&&t.thumb&&t.thumbInitial&&(t.thumb.src=t.thumbInitial),v=m=null}function c(t,n,i){if(a(),t){var e,u=t.src;if(0==u.indexOf("data:image"))return;0
e.left+a(s).width()||oe.top+a(s).height())&&r()}}),a(document).mousemove(function(t){if(s){var e=a(s).offset(),n=t.pageX,o=t.pageY;(ne.left+a(s).width()||oe.top+a(s).height())&&r()}}),a(window).on("blur",function(){r()}),a.fn.videopreview=function(){return this.each(function(){var t=this,e=a(this).attr("data-preview");if(e){var n=function(){r(),u=setTimeout(function(){a(t.parentNode).addClass("preview-loading")},100),s=document.createElement("VIDEO"),a(s).css({position:"absolute",left:"0",top:"0",width:t.offsetWidth+"px",height:t.offsetHeight+"px",background:"#000000",visibility:"hidden"}),a(s).on("error",function(){r()}),a(s).on("loadeddata",function(){u&&clearTimeout(u),a(s.parentNode).removeClass("preview-loading"),a(s).css({visibility:"visible"})}),s.controls=!1,s.autoplay=!0,s.muted=!0,s.loop=!0,s.src=e,s.setAttribute("webkit-playsinline","true"),s.setAttribute("playsinline","true"),t.parentNode.appendChild(s)};if("ontouchstart"in document){a(this).offsetParent().append(a('').on("touchstart",function(t){t.preventDefault(),n()}).on("contextmenu",function(t){t.preventDefault()}));var o=0,i=!1;a(this).on("touchstart",function(t){var e=t.originalEvent?t.originalEvent.touches:t.touches;e&&e.length&&(o=e[0].clientX,i=!0)}),a(this).on("touchmove",function(t){var e=t.originalEvent?t.originalEvent.touches:t.touches;e&&e.length&&i&&40").parent("form").trigger("reset"),n.unwrap(),r.parent().append(n)),r.find('[type="text"]').val((r.find(".button").html()||"")+" "+t)}),l.find(".list-selector").each(function(){var p=$(this);p.find('[type="text"]').focus(function(){var l=$(this),e=p.attr("data-selector"),f=p.attr("data-name"),u=(p.attr("data-selected")||"").split(",");p.find(".list-selector-popup").exists()?(p.find(".list-selector-popup").show(),p.find('[name="filter"]').focus()):e&&f&&$.ajax({url:e,type:"GET",beforeSend:function(){l.block({message:null}),l.css({cursor:"wait"})},complete:function(){l.unblock(),l.css({cursor:"text"})},success:function(e){for(var r=[],s=[],t="",o=$('"),a=o.find('[name="filter"]'),i=0;i'));else{for(t=0;t'))),t=s[0],l.prop("value",t),l.change())}).focus(function(){a.focus()}),a.focus().keyup(function(){a.val()!=t&&(t=this.value.toLowerCase(),p.find(".item").each(function(){var e=$(this);""==t?e.show():e.toggle(0<=e.find("label").html().toLowerCase().indexOf(t))}))}),$(document).mouseup(function(e){p.is(e.target)||0!==p.has(e.target).length||o.hide()})}})})}),l.find(".smileys-support img").each(function(){$(this).attr("title",$(this).attr("alt")),$(this).click(function(){var e,t,a,i,n,r=$(this).parents(".smileys-support").find("textarea");r.exists()&&(e=r.get(0),t=$(this).attr("alt"),document.selection?(e.focus(),document.selection.createRange().text=t,e.focus()):e.selectionStart||"0"==e.selectionStart?(a=e.selectionStart,i=e.selectionEnd,n=e.scrollTop,e.value=e.value.substring(0,a)+t+e.value.substring(i,e.value.length),e.focus(),e.selectionStart=a+t.length,e.selectionEnd=a+t.length,e.scrollTop=n):(e.value+=t,e.focus()))})}),l.find("[data-expand-id]").click(function(){var e,t=$(this),a=t.attr("data-expand-id");a&&(e=$("#"+a),t.hasClass("expand")?(e.slideDown(u,function(){$(window).trigger("scroll")}),t.removeClass("expand").addClass("collapse")):(e.slideUp(u,function(){}),t.removeClass("collapse").addClass("expand")))}),l.find('[data-action="choose"]').each(function(){$(this).click(function(){var e,t,a;$(this).hasClass("disabled")||(e=$(this).parents("form"),t=$(this).find("input"),e.find('[data-action="choose"] [type="radio"]').prop("checked",!1),t.prop("checked",!0),t.prop("checked")&&(e.find('[data-action="choose"]').removeClass("active"),$(this).addClass("active"),(a=e.find(".captcha-control")).exists()&&("payment_option"==t.attr("name")?(a.append(a.parent().find('[type="submit"]')),a.parent().find("label").removeClass("hidden"),a.removeClass("hidden")):"card_package_id"==t.attr("name")&&(a.parent().append(a.find('[type="submit"]')),a.parent().find("label").addClass("hidden"),a.addClass("hidden")))))})}),t&&a(l)}for(var b={list_videos_my_favourite_videos:1,list_videos_my_uploaded_videos:1,list_albums_my_favourite_albums:1,list_albums_my_created_albums:1,list_playlists_my_created_playlists:1,list_dvds_my_created_channels:1,list_videos_my_channel_videos:1,list_members_subscriptions_my_subscriptions:1,list_videos_videos_from_my_subscriptions:1,list_albums_albums_from_my_subscriptions:1,list_videos_my_purchased_videos:1,list_albums_my_purchased_albums:1,list_members_my_conversations:1,list_members_my_friends:1,list_messages_my_conversation_messages:1},_=function(e,t,a){$.fancybox([{href:t,type:"ajax"}],{afterShow:function(){a||(this.inner.find('[data-form="ajax"]').each(function(){k($(this))}),this.inner.find('[data-form="ajax-upload"]').each(function(){i($(this))}),this.inner.find('[data-fancybox="ajax"]').each(function(){$(this).click(function(e){e.preventDefault(),_($(this),this.href||$(this).attr("data-href"))})})),l(this.inner),a&&a.call(this)},beforeClose:function(){return this.inner.find('[data-fancybox="refresh"]').exists()?e&&e.attr("data-fancybox-refresh-id")?w(e.attr("data-fancybox-refresh-id"),e,!1,!0):window.location.reload():e&&e.attr("data-fancybox-refresh-id")&&w(e.attr("data-fancybox-refresh-id"),e,!1,!0),!0},helpers:{overlay:{closeClick:!1}},type:"ajax",topRatio:.3})},w=function(r,a,t,s){var o,i,n;r?(o=null,f[r]&&(o=f[r]),n=0,(i={success:function(e,i){f[r]=o;var n=s?.1:1;t&&p($("#"+r)),$("#"+r).animate({opacity:n},u,function(){var e=document.createElement("div");e.innerHTML=i;var t,a=$(e).children().first();$(a).css("opacity",n),$(this).replaceWith(a),$("#"+r).animate({opacity:1},u),C($("#"+r)),"undefined"!=typeof Storage&&(t="",y&&y.userId&&(t=y.userId+":"),sessionStorage.setItem(t+location.href+"#"+r,$("#"+r).html()),sessionStorage.setItem(t+location.href+"#"+r+":params",JSON.stringify(o)))})}}).error=function(){n++;var e=!1;for(var t in o)o.hasOwnProperty(t)&&0==t.indexOf("from")&&1 ')),r.find(".progressbar .progress").stop(!0,!0).animate({width:e+"%"}),r.find(".progressbar .text").html(parseInt(e)+"%"),55s.length||((e=new FormData).append("filename",o),e.append("files",s.length.toString()),e.append("index",t),0n?(b(d/i*100),c(n+1)):(b(100),c(0))):b(100,e.data):r.kvsProcessFormErrors(e).removeClass("uploading").unblock().find(".progressbar").hide().remove()},error:function(e){0!=e.status?(r.find(".generic-error").html(x).show(),r.removeClass("uploading").unblock().find(".progressbar").hide().remove()):setTimeout(function(){c(t)},1e4)},data:e,processData:!1,contentType:!1}))};return setTimeout(function(){r.block({message:null}),c(n+1)},0),!1}if("upload_file"==t)if("file"==a){if((e=r.find('[name="content"]')).exists()&&(s=e.get(0).files)&&1==s.length){var l=9437184;y&&y.upload_chunk_size&&(l=parseInt(y.upload_chunk_size));var f=s[0].size||0,u=Math.floor(f/l),p=0;0/gi,"\n").replace(/>/gi,">").replace(/</gi,"<").replace(/"/gi,'"')).replace(//gi,"$1"),e.find('[name="comment"], [name="entry"]').val(t),k(e,{success:function(){$.fancybox.close();var r=$(".block-comments").attr("data-block-id");r&&v(r,null,{success:function(e,t){var a;"undefined"!=typeof Storage&&(a="",y&&y.userId&&(a=y.userId+":"),sessionStorage.removeItem(a+location.href+"#"+r),sessionStorage.removeItem(a+location.href+"#"+r+":params"));var i=document.createElement("DIV");i.innerHTML=t;var n=$(i).find('.item[data-comment-id="'+o+'"] .comment-text').html()||"";s.find(".comment-text").html(n)}})}}),l(this.inner)},helpers:{overlay:{closeClick:!1}},topRatio:.3}))})},C,function(){$('[data-form="ajax"]').each(function(){k($(this))})},function(){$("[data-subscribe-to], [data-unsubscribe-to]").click(function(e){e.preventDefault();var t,a,i,n,r=$(this);r.hasClass("done")||(t=r.attr("data-subscribe-to")||r.attr("data-unsubscribe-to"),a=r.attr("data-confirm"),i=r.attr("data-id"),t&&i&&(n={action:"subscribe"},r.attr("data-subscribe-to")||(n.action="unsubscribe"),"category"==t?n[n.action+"_category_id"]=i:"model"==t?n[n.action+"_model_id"]=i:"content_source"==t?n[n.action+"_cs_id"]=i:"user"==t?n[n.action+"_user_id"]=i:"playlist"==t?n[n.action+"_playlist_id"]=i:"dvd"==t&&(n[n.action+"_dvd_id"]=i),a&&!confirm(a)||g(r,n,function(e){var t;"success"==e.status&&(r.addClass("done"),(t=r.parents().first().find(".button-info")).exists()&&("subscribe"==n.action?t.html(parseInt(t.html())+1):t.html(parseInt(t.html())-1)))})))})},function(){var c,l="";if("undefined"!=typeof Storage)if(y&&y.userId&&(l=y.userId+":"),c=(c=sessionStorage.getItem(l+location.href+"#search_filter"))||sessionStorage.getItem(location.href+"#search_filter")){for(var e in c=JSON.parse(c))$("#"+e).prop("checked",!0);c.search_string_filter||$("#search_string_filter").prop("checked",!1)}else c={search_string_filter:!0};"function"==typeof $.Autocomplete&&$.Autocomplete.defaults.serviceUrl&&$('#search_form input[type="text"]').autocomplete({paramName:"q",onSelect:function(e){e&&e.data&&e.data.url&&(window.location=e.data.url)}}),$("#search_form").submit(function(e){try{if(""==this.q.value)return this.q.focus(),void e.preventDefault();var t;$(this).attr("data-url")&&(t=this.q.value.replace(/[-]/g,"[dash]").replace(/[ ]+/g,"-").replace(/[?]/g,"").replace(/[&]/g,"%26").replace(/[?]/g,"%3F").replace(/[/]/g,"%2F").replace(/\[dash\]/g,"--"),window.location=$(this).attr("data-url").replace("%QUERY%",encodeURIComponent(t)),e.preventDefault())}catch(e){}}),$("#search_form .search-button").click(function(){$(this).submit()}),$("[data-search-filter-ids] input, [data-search-filter-ids] button").click(function(){var e=$(this).parents("[data-search-filter-ids]");"button"==$(this).prop("type")||"button"==$(this).prop("tagName").toLowerCase()?e.find('input[name*="[]"]').each(function(){var e=$(this);e.prop("checked",!1),c&&(e.attr("id")&&(e.prop("checked")?c[e.attr("id")]=!0:delete c[e.attr("id")]),sessionStorage.setItem(l+location.href+"#search_filter",JSON.stringify(c)))}):c&&($(this).attr("id")&&($(this).prop("checked")?c[$(this).attr("id")]=!0:delete c[$(this).attr("id")]),sessionStorage.setItem(l+location.href+"#search_filter",JSON.stringify(c)));var t=e.attr("data-search-filter-ids").split(","),n={},r={};for(var a in e.find("input").each(function(){var e,t,a,i=$(this);("hidden"==i.prop("type")||"checkbox"==i.prop("type")&&i.prop("checked")||"radio"==i.prop("type")&&i.prop("checked"))&&(0/gi,"\n").replace(/>/gi,">").replace(/</gi,"<").replace(/"/gi,'"')).replace(//gi,"$1")).trim(),t.find('[name="message"]').val(i).focus()))})},function(){function e(e){var t=window.location.href;if(0