/* Minification failed. Returning unminified contents.
(8065,29-30): run-time error JS1195: Expected expression: >
(8065,46-47): run-time error JS1004: Expected ';': )
(8066,13-14): run-time error JS1195: Expected expression: .
(8070,26-27): run-time error JS1195: Expected expression: )
(8070,28-29): run-time error JS1004: Expected ';': {
(8140,6-7): run-time error JS1195: Expected expression: ,
(8142,37-38): run-time error JS1004: Expected ';': {
(8145,6-7): run-time error JS1195: Expected expression: ,
(8147,33-34): run-time error JS1004: Expected ';': {
(8181,6-7): run-time error JS1195: Expected expression: ,
(8183,33-34): run-time error JS1004: Expected ';': {
(8227,6-7): run-time error JS1195: Expected expression: ,
(8229,32-33): run-time error JS1195: Expected expression: )
(8229,34-35): run-time error JS1004: Expected ';': {
(8246,6-7): run-time error JS1195: Expected expression: ,
(8248,31-32): run-time error JS1195: Expected expression: )
(8248,33-34): run-time error JS1004: Expected ';': {
(8257,6-7): run-time error JS1195: Expected expression: ,
(8260,43-44): run-time error JS1195: Expected expression: )
(8260,45-46): run-time error JS1004: Expected ';': {
(8269,6-7): run-time error JS1195: Expected expression: ,
(8271,38-39): run-time error JS1004: Expected ';': {
(8295,1-2): run-time error JS1002: Syntax error: }
(8298,1): run-time error JS1197: Too many errors. The file might not be a JavaScript file
(8077,13-19): run-time error JS1018: 'return' statement outside of function: return
 */
/*!
 * jQuery JavaScript Library v2.1.1
 * http://jquery.com/
 *
 * Includes Sizzle.js
 * http://sizzlejs.com/
 *
 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 *
 * Date: 2014-05-01T17:11Z
 */
(function(n,t){typeof module=="object"&&typeof module.exports=="object"?module.exports=n.document?t(n,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return t(n)}:t(n)})(typeof window!="undefined"?window:this,function(n,t){function ui(n){var t=n.length,r=i.type(n);return r==="function"||i.isWindow(n)?!1:n.nodeType===1&&t?!0:r==="array"||t===0||typeof t=="number"&&t>0&&t-1 in n}function fi(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){return!!t.call(n,i,n)!==r});if(t.nodeType)return i.grep(n,function(n){return n===t!==r});if(typeof t=="string"){if(ef.test(t))return i.filter(t,n,r);t=i.filter(t,n)}return i.grep(n,function(n){return et.call(t,n)>=0!==r})}function ur(n,t){while((n=n[t])&&n.nodeType!==1);return n}function of(n){var t=ei[n]={};return i.each(n.match(c)||[],function(n,i){t[i]=!0}),t}function ct(){u.removeEventListener("DOMContentLoaded",ct,!1);n.removeEventListener("load",ct,!1);i.ready()}function p(){Object.defineProperty(this.cache={},0,{get:function(){return{}}});this.expando=i.expando+Math.random()}function fr(n,t,r){var u;if(r===undefined&&n.nodeType===1)if(u="data-"+t.replace(hf,"-$1").toLowerCase(),r=n.getAttribute(u),typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:sf.test(r)?i.parseJSON(r):r}catch(f){}e.set(n,t,r)}else r=undefined;return r}function at(){return!0}function g(){return!1}function hr(){try{return u.activeElement}catch(n){}}function vr(n,t){return i.nodeName(n,"table")&&i.nodeName(t.nodeType!==11?t:t.firstChild,"tr")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function bf(n){return n.type=(n.getAttribute("type")!==null)+"/"+n.type,n}function kf(n){var t=pf.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function oi(n,t){for(var i=0,u=n.length;i<u;i++)r.set(n[i],"globalEval",!t||r.get(t[i],"globalEval"))}function yr(n,t){var f,c,o,s,h,l,a,u;if(t.nodeType===1){if(r.hasData(n)&&(s=r.access(n),h=r.set(t,s),u=s.events,u)){delete h.handle;h.events={};for(o in u)for(f=0,c=u[o].length;f<c;f++)i.event.add(t,o,u[o][f])}e.hasData(n)&&(l=e.access(n),a=i.extend({},l),e.set(t,a))}}function o(n,t){var r=n.getElementsByTagName?n.getElementsByTagName(t||"*"):n.querySelectorAll?n.querySelectorAll(t||"*"):[];return t===undefined||t&&i.nodeName(n,t)?i.merge([n],r):r}function df(n,t){var i=t.nodeName.toLowerCase();i==="input"&&er.test(n.type)?t.checked=n.checked:(i==="input"||i==="textarea")&&(t.defaultValue=n.defaultValue)}function pr(t,r){var f,u=i(r.createElement(t)).appendTo(r.body),e=n.getDefaultComputedStyle&&(f=n.getDefaultComputedStyle(u[0]))?f.display:i.css(u[0],"display");return u.detach(),e}function hi(n){var r=u,t=si[n];return t||(t=pr(n,r),t!=="none"&&t||(vt=(vt||i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement),r=vt[0].contentDocument,r.write(),r.close(),t=pr(n,r),vt.detach()),si[n]=t),t}function rt(n,t,r){var e,o,s,u,f=n.style;return r=r||yt(n),r&&(u=r.getPropertyValue(t)||r[t]),r&&(u!==""||i.contains(n.ownerDocument,n)||(u=i.style(n,t)),ci.test(u)&&wr.test(t)&&(e=f.width,o=f.minWidth,s=f.maxWidth,f.minWidth=f.maxWidth=f.width=u,u=r.width,f.width=e,f.minWidth=o,f.maxWidth=s)),u!==undefined?u+"":u}function br(n,t){return{get:function(){if(n()){delete this.get;return}return(this.get=t).apply(this,arguments)}}}function gr(n,t){if(t in n)return t;for(var r=t[0].toUpperCase()+t.slice(1),u=t,i=dr.length;i--;)if(t=dr[i]+r,t in n)return t;return u}function nu(n,t,i){var r=ne.exec(t);return r?Math.max(0,r[1]-(i||0))+(r[2]||"px"):t}function tu(n,t,r,u,f){for(var e=r===(u?"border":"content")?4:t==="width"?1:0,o=0;e<4;e+=2)r==="margin"&&(o+=i.css(n,r+w[e],!0,f)),u?(r==="content"&&(o-=i.css(n,"padding"+w[e],!0,f)),r!=="margin"&&(o-=i.css(n,"border"+w[e]+"Width",!0,f))):(o+=i.css(n,"padding"+w[e],!0,f),r!=="padding"&&(o+=i.css(n,"border"+w[e]+"Width",!0,f)));return o}function iu(n,t,r){var o=!0,u=t==="width"?n.offsetWidth:n.offsetHeight,e=yt(n),s=i.css(n,"boxSizing",!1,e)==="border-box";if(u<=0||u==null){if(u=rt(n,t,e),(u<0||u==null)&&(u=n.style[t]),ci.test(u))return u;o=s&&(f.boxSizingReliable()||u===n.style[t]);u=parseFloat(u)||0}return u+tu(n,t,r||(s?"border":"content"),o,e)+"px"}function ru(n,t){for(var e,u,s,o=[],f=0,h=n.length;f<h;f++)(u=n[f],u.style)&&(o[f]=r.get(u,"olddisplay"),e=u.style.display,t?(o[f]||e!=="none"||(u.style.display=""),u.style.display===""&&it(u)&&(o[f]=r.access(u,"olddisplay",hi(u.nodeName)))):(s=it(u),e==="none"&&s||r.set(u,"olddisplay",s?e:i.css(u,"display"))));for(f=0;f<h;f++)(u=n[f],u.style)&&(t&&u.style.display!=="none"&&u.style.display!==""||(u.style.display=t?o[f]||"":"none"));return n}function s(n,t,i,r,u){return new s.prototype.init(n,t,i,r,u)}function fu(){return setTimeout(function(){nt=undefined}),nt=i.now()}function bt(n,t){var r,u=0,i={height:n};for(t=t?1:0;u<4;u+=2-t)r=w[u],i["margin"+r]=i["padding"+r]=n;return t&&(i.opacity=i.width=n),i}function eu(n,t,i){for(var u,f=(ut[t]||[]).concat(ut["*"]),r=0,e=f.length;r<e;r++)if(u=f[r].call(i,t,n))return u}function fe(n,t,u){var f,a,p,v,o,w,h,b,l=this,y={},s=n.style,c=n.nodeType&&it(n),e=r.get(n,"fxshow");u.queue||(o=i._queueHooks(n,"fx"),o.unqueued==null&&(o.unqueued=0,w=o.empty.fire,o.empty.fire=function(){o.unqueued||w()}),o.unqueued++,l.always(function(){l.always(function(){o.unqueued--;i.queue(n,"fx").length||o.empty.fire()})}));n.nodeType===1&&("height"in t||"width"in t)&&(u.overflow=[s.overflow,s.overflowX,s.overflowY],h=i.css(n,"display"),b=h==="none"?r.get(n,"olddisplay")||hi(n.nodeName):h,b==="inline"&&i.css(n,"float")==="none"&&(s.display="inline-block"));u.overflow&&(s.overflow="hidden",l.always(function(){s.overflow=u.overflow[0];s.overflowX=u.overflow[1];s.overflowY=u.overflow[2]}));for(f in t)if(a=t[f],re.exec(a)){if(delete t[f],p=p||a==="toggle",a===(c?"hide":"show"))if(a==="show"&&e&&e[f]!==undefined)c=!0;else continue;y[f]=e&&e[f]||i.style(n,f)}else h=undefined;if(i.isEmptyObject(y))(h==="none"?hi(n.nodeName):h)==="inline"&&(s.display=h);else{e?"hidden"in e&&(c=e.hidden):e=r.access(n,"fxshow",{});p&&(e.hidden=!c);c?i(n).show():l.done(function(){i(n).hide()});l.done(function(){var t;r.remove(n,"fxshow");for(t in y)i.style(n,t,y[t])});for(f in y)v=eu(c?e[f]:0,f,l),f in e||(e[f]=v.start,c&&(v.end=v.start,v.start=f==="width"||f==="height"?1:0))}}function ee(n,t){var r,f,e,u,o;for(r in n)if(f=i.camelCase(r),e=t[f],u=n[r],i.isArray(u)&&(e=u[1],u=n[r]=u[0]),r!==f&&(n[f]=u,delete n[r]),o=i.cssHooks[f],o&&"expand"in o){u=o.expand(u);delete n[f];for(r in u)r in n||(n[r]=u[r],t[r]=e)}else t[f]=e}function ou(n,t,r){var e,o,s=0,l=wt.length,f=i.Deferred().always(function(){delete c.elem}),c=function(){if(o)return!1;for(var s=nt||fu(),t=Math.max(0,u.startTime+u.duration-s),h=t/u.duration||0,i=1-h,r=0,e=u.tweens.length;r<e;r++)u.tweens[r].run(i);return f.notifyWith(n,[u,i,t]),i<1&&e?t:(f.resolveWith(n,[u]),!1)},u=f.promise({elem:n,props:i.extend({},t),opts:i.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:nt||fu(),duration:r.duration,tweens:[],createTween:function(t,r){var f=i.Tween(n,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(f),f},stop:function(t){var i=0,r=t?u.tweens.length:0;if(o)return this;for(o=!0;i<r;i++)u.tweens[i].run(1);return t?f.resolveWith(n,[u,t]):f.rejectWith(n,[u,t]),this}}),h=u.props;for(ee(h,u.opts.specialEasing);s<l;s++)if(e=wt[s].call(u,n,h,u.opts),e)return e;return i.map(h,eu,u),i.isFunction(u.opts.start)&&u.opts.start.call(n,u),i.fx.timer(i.extend(c,{elem:n,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 pu(n){return function(t,r){typeof t!="string"&&(r=t,t="*");var u,f=0,e=t.toLowerCase().match(c)||[];if(i.isFunction(r))while(u=e[f++])u[0]==="+"?(u=u.slice(1)||"*",(n[u]=n[u]||[]).unshift(r)):(n[u]=n[u]||[]).push(r)}}function wu(n,t,r,u){function e(s){var h;return f[s]=!0,i.each(n[s]||[],function(n,i){var s=i(t,r,u);if(typeof s!="string"||o||f[s]){if(o)return!(h=s)}else return t.dataTypes.unshift(s),e(s),!1}),h}var f={},o=n===li;return e(t.dataTypes[0])||!f["*"]&&e("*")}function ai(n,t){var r,u,f=i.ajaxSettings.flatOptions||{};for(r in t)t[r]!==undefined&&((f[r]?n:u||(u={}))[r]=t[r]);return u&&i.extend(!0,n,u),n}function ae(n,t,i){for(var e,u,f,o,s=n.contents,r=n.dataTypes;r[0]==="*";)r.shift(),e===undefined&&(e=n.mimeType||t.getResponseHeader("Content-Type"));if(e)for(u in s)if(s[u]&&s[u].test(e)){r.unshift(u);break}if(r[0]in i)f=r[0];else{for(u in i){if(!r[0]||n.converters[u+" "+r[0]]){f=u;break}o||(o=u)}f=f||o}if(f)return f!==r[0]&&r.unshift(f),i[f]}function ve(n,t,i,r){var h,u,f,s,e,o={},c=n.dataTypes.slice();if(c[1])for(f in n.converters)o[f.toLowerCase()]=n.converters[f];for(u=c.shift();u;)if(n.responseFields[u]&&(i[n.responseFields[u]]=t),!e&&r&&n.dataFilter&&(t=n.dataFilter(t,n.dataType)),e=u,u=c.shift(),u)if(u==="*")u=e;else if(e!=="*"&&e!==u){if(f=o[e+" "+u]||o["* "+u],!f)for(h in o)if(s=h.split(" "),s[1]===u&&(f=o[e+" "+s[0]]||o["* "+s[0]],f)){f===!0?f=o[h]:o[h]!==!0&&(u=s[0],c.unshift(s[1]));break}if(f!==!0)if(f&&n.throws)t=f(t);else try{t=f(t)}catch(l){return{state:"parsererror",error:f?l:"No conversion from "+e+" to "+u}}}return{state:"success",data:t}}function vi(n,t,r,u){var f;if(i.isArray(t))i.each(t,function(t,i){r||pe.test(n)?u(n,i):vi(n+"["+(typeof i=="object"?t:"")+"]",i,r,u)});else if(r||i.type(t)!=="object")u(n,t);else for(f in t)vi(n+"["+f+"]",t[f],r,u)}function ku(n){return i.isWindow(n)?n:n.nodeType===9&&n.defaultView}var k=[],a=k.slice,bi=k.concat,ii=k.push,et=k.indexOf,ot={},nf=ot.toString,ri=ot.hasOwnProperty,f={},u=n.document,ki="2.1.1",i=function(n,t){return new i.fn.init(n,t)},tf=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,rf=/^-ms-/,uf=/-([\da-z])/gi,ff=function(n,t){return t.toUpperCase()},y,st,nr,tr,ir,rr,c,ei,ht,l,d,vt,si,oe,su,tt,hu,kt,cu,dt,gt,yi,ti,pi,wi,du,gu;i.fn=i.prototype={jquery:ki,constructor:i,selector:"",length:0,toArray:function(){return a.call(this)},get:function(n){return n!=null?n<0?this[n+this.length]:this[n]:a.call(this)},pushStack:function(n){var t=i.merge(this.constructor(),n);return t.prevObject=this,t.context=this.context,t},each:function(n,t){return i.each(this,n,t)},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(n){var i=this.length,t=+n+(n<0?i:0);return this.pushStack(t>=0&&t<i?[this[t]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:ii,sort:k.sort,splice:k.splice};i.extend=i.fn.extend=function(){var e,f,r,t,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for(typeof n=="boolean"&&(h=n,n=arguments[u]||{},u++),typeof n=="object"||i.isFunction(n)||(n={}),u===c&&(n=this,u--);u<c;u++)if((e=arguments[u])!=null)for(f in e)(r=n[f],t=e[f],n!==t)&&(h&&t&&(i.isPlainObject(t)||(o=i.isArray(t)))?(o?(o=!1,s=r&&i.isArray(r)?r:[]):s=r&&i.isPlainObject(r)?r:{},n[f]=i.extend(h,s,t)):t!==undefined&&(n[f]=t));return n};i.extend({expando:"jQuery"+(ki+Math.random()).replace(/\D/g,""),isReady:!0,error:function(n){throw new Error(n);},noop:function(){},isFunction:function(n){return i.type(n)==="function"},isArray:Array.isArray,isWindow:function(n){return n!=null&&n===n.window},isNumeric:function(n){return!i.isArray(n)&&n-parseFloat(n)>=0},isPlainObject:function(n){return i.type(n)!=="object"||n.nodeType||i.isWindow(n)?!1:n.constructor&&!ri.call(n.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(n){for(var t in n)return!1;return!0},type:function(n){return n==null?n+"":typeof n=="object"||typeof n=="function"?ot[nf.call(n)]||"object":typeof n},globalEval:function(n){var t,r=eval;n=i.trim(n);n&&(n.indexOf("use strict")===1?(t=u.createElement("script"),t.text=n,u.head.appendChild(t).parentNode.removeChild(t)):r(n))},camelCase:function(n){return n.replace(rf,"ms-").replace(uf,ff)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()},each:function(n,t,i){var u,r=0,f=n.length,e=ui(n);if(i){if(e){for(;r<f;r++)if(u=t.apply(n[r],i),u===!1)break}else for(r in n)if(u=t.apply(n[r],i),u===!1)break}else if(e){for(;r<f;r++)if(u=t.call(n[r],r,n[r]),u===!1)break}else for(r in n)if(u=t.call(n[r],r,n[r]),u===!1)break;return n},trim:function(n){return n==null?"":(n+"").replace(tf,"")},makeArray:function(n,t){var r=t||[];return n!=null&&(ui(Object(n))?i.merge(r,typeof n=="string"?[n]:n):ii.call(r,n)),r},inArray:function(n,t,i){return t==null?-1:et.call(t,n,i)},merge:function(n,t){for(var u=+t.length,i=0,r=n.length;i<u;i++)n[r++]=t[i];return n.length=r,n},grep:function(n,t,i){for(var u,f=[],r=0,e=n.length,o=!i;r<e;r++)u=!t(n[r],r),u!==o&&f.push(n[r]);return f},map:function(n,t,i){var u,r=0,e=n.length,o=ui(n),f=[];if(o)for(;r<e;r++)u=t(n[r],r,i),u!=null&&f.push(u);else for(r in n)u=t(n[r],r,i),u!=null&&f.push(u);return bi.apply([],f)},guid:1,proxy:function(n,t){var u,f,r;return(typeof t=="string"&&(u=n[t],t=n,n=u),!i.isFunction(n))?undefined:(f=a.call(arguments,2),r=function(){return n.apply(t||this,f.concat(a.call(arguments)))},r.guid=n.guid=n.guid||i.guid++,r)},now:Date.now,support:f});i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(n,t){ot["[object "+t+"]"]=t.toLowerCase()});y=function(n){function r(n,t,i,r){var w,h,c,v,k,y,d,l,nt,g;if((t?t.ownerDocument||t:s)!==e&&p(t),t=t||e,i=i||[],!n||typeof n!="string")return i;if((v=t.nodeType)!==1&&v!==9)return[];if(a&&!r){if(w=sr.exec(n))if(c=w[1]){if(v===9)if(h=t.getElementById(c),h&&h.parentNode){if(h.id===c)return i.push(h),i}else return i;else if(t.ownerDocument&&(h=t.ownerDocument.getElementById(c))&&ot(t,h)&&h.id===c)return i.push(h),i}else{if(w[2])return b.apply(i,t.getElementsByTagName(n)),i;if((c=w[3])&&u.getElementsByClassName&&t.getElementsByClassName)return b.apply(i,t.getElementsByClassName(c)),i}if(u.qsa&&(!o||!o.test(n))){if(l=d=f,nt=t,g=v===9&&n,v===1&&t.nodeName.toLowerCase()!=="object"){for(y=et(n),(d=t.getAttribute("id"))?l=d.replace(hr,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",k=y.length;k--;)y[k]=l+yt(y[k]);nt=gt.test(n)&&ii(t.parentNode)||t;g=y.join(",")}if(g)try{return b.apply(i,nt.querySelectorAll(g)),i}catch(tt){}finally{d||t.removeAttribute("id")}}}return si(n.replace(at,"$1"),t,i,r)}function ni(){function n(r,u){return i.push(r+" ")>t.cacheLength&&delete n[i.shift()],n[r+" "]=u}var i=[];return n}function h(n){return n[f]=!0,n}function c(n){var t=e.createElement("div");try{return!!n(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function ti(n,i){for(var u=n.split("|"),r=n.length;r--;)t.attrHandle[u[r]]=i}function wi(n,t){var i=t&&n,r=i&&n.nodeType===1&&t.nodeType===1&&(~t.sourceIndex||ai)-(~n.sourceIndex||ai);if(r)return r;if(i)while(i=i.nextSibling)if(i===t)return-1;return n?1:-1}function cr(n){return function(t){var i=t.nodeName.toLowerCase();return i==="input"&&t.type===n}}function lr(n){return function(t){var i=t.nodeName.toLowerCase();return(i==="input"||i==="button")&&t.type===n}}function tt(n){return h(function(t){return t=+t,h(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function ii(n){return n&&typeof n.getElementsByTagName!==ut&&n}function bi(){}function yt(n){for(var t=0,r=n.length,i="";t<r;t++)i+=n[t].value;return i}function ri(n,t,i){var r=t.dir,u=i&&r==="parentNode",e=ki++;return t.first?function(t,i,f){while(t=t[r])if(t.nodeType===1||u)return n(t,i,f)}:function(t,i,o){var s,h,c=[v,e];if(o){while(t=t[r])if((t.nodeType===1||u)&&n(t,i,o))return!0}else while(t=t[r])if(t.nodeType===1||u){if(h=t[f]||(t[f]={}),(s=h[r])&&s[0]===v&&s[1]===e)return c[2]=s[2];if(h[r]=c,c[2]=n(t,i,o))return!0}}}function ui(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function ar(n,t,i){for(var u=0,f=t.length;u<f;u++)r(n,t[u],i);return i}function pt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=t!=null;f<s;f++)(e=n[f])&&(!i||i(e,r,u))&&(o.push(e),h&&t.push(f));return o}function fi(n,t,i,r,u,e){return r&&!r[f]&&(r=fi(r)),u&&!u[f]&&(u=fi(u,e)),h(function(f,e,o,s){var l,c,a,p=[],y=[],w=e.length,k=f||ar(t||"*",o.nodeType?[o]:o,[]),v=n&&(f||!t)?pt(k,p,n,o,s):k,h=i?u||(f?n:w||r)?[]:e:v;if(i&&i(v,h,o,s),r)for(l=pt(h,y),r(l,[],o,s),c=l.length;c--;)(a=l[c])&&(h[y[c]]=!(v[y[c]]=a));if(f){if(u||n){if(u){for(l=[],c=h.length;c--;)(a=h[c])&&l.push(v[c]=a);u(null,h=[],l,s)}for(c=h.length;c--;)(a=h[c])&&(l=u?nt.call(f,a):p[c])>-1&&(f[l]=!(e[l]=a))}}else h=pt(h===e?h.splice(w,h.length):h),u?u(null,e,h,s):b.apply(e,h)})}function ei(n){for(var s,u,r,o=n.length,h=t.relative[n[0].type],c=h||t.relative[" "],i=h?1:0,l=ri(function(n){return n===s},c,!0),a=ri(function(n){return nt.call(s,n)>-1},c,!0),e=[function(n,t,i){return!h&&(i||t!==ct)||((s=t).nodeType?l(n,t,i):a(n,t,i))}];i<o;i++)if(u=t.relative[n[i].type])e=[ri(ui(e),u)];else{if(u=t.filter[n[i].type].apply(null,n[i].matches),u[f]){for(r=++i;r<o;r++)if(t.relative[n[r].type])break;return fi(i>1&&ui(e),i>1&&yt(n.slice(0,i-1).concat({value:n[i-2].type===" "?"*":""})).replace(at,"$1"),u,i<r&&ei(n.slice(i,r)),r<o&&ei(n=n.slice(r)),r<o&&yt(n))}e.push(u)}return ui(e)}function vr(n,i){var u=i.length>0,f=n.length>0,o=function(o,s,h,c,l){var y,d,w,k=0,a="0",g=o&&[],p=[],nt=ct,tt=o||f&&t.find.TAG("*",l),it=v+=nt==null?1:Math.random()||.1,rt=tt.length;for(l&&(ct=s!==e&&s);a!==rt&&(y=tt[a])!=null;a++){if(f&&y){for(d=0;w=n[d++];)if(w(y,s,h)){c.push(y);break}l&&(v=it)}u&&((y=!w&&y)&&k--,o&&g.push(y))}if(k+=a,u&&a!==k){for(d=0;w=i[d++];)w(g,p,s,h);if(o){if(k>0)while(a--)g[a]||p[a]||(p[a]=gi.call(c));p=pt(p)}b.apply(c,p);l&&!o&&p.length>0&&k+i.length>1&&r.uniqueSort(c)}return l&&(v=it,ct=nt),g};return u?h(o):o}var it,u,t,ht,oi,et,wt,si,ct,y,rt,p,e,l,a,o,g,lt,ot,f="sizzle"+-new Date,s=n.document,v=0,ki=0,hi=ni(),ci=ni(),li=ni(),bt=function(n,t){return n===t&&(rt=!0),0},ut=typeof undefined,ai=-2147483648,di={}.hasOwnProperty,w=[],gi=w.pop,nr=w.push,b=w.push,vi=w.slice,nt=w.indexOf||function(n){for(var t=0,i=this.length;t<i;t++)if(this[t]===n)return t;return-1},kt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",i="[\\x20\\t\\r\\n\\f]",ft="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",yi=ft.replace("w","w#"),pi="\\["+i+"*("+ft+")(?:"+i+"*([*^$|!~]?=)"+i+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+yi+"))|)"+i+"*\\]",dt=":("+ft+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+pi+")*)|.*)\\)|)",at=new RegExp("^"+i+"+|((?:^|[^\\\\])(?:\\\\.)*)"+i+"+$","g"),tr=new RegExp("^"+i+"*,"+i+"*"),ir=new RegExp("^"+i+"*([>+~]|"+i+")"+i+"*"),rr=new RegExp("="+i+"*([^\\]'\"]*?)"+i+"*\\]","g"),ur=new RegExp(dt),fr=new RegExp("^"+yi+"$"),vt={ID:new RegExp("^#("+ft+")"),CLASS:new RegExp("^\\.("+ft+")"),TAG:new RegExp("^("+ft.replace("w","w*")+")"),ATTR:new RegExp("^"+pi),PSEUDO:new RegExp("^"+dt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:"+kt+")$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},er=/^(?:input|select|textarea|button)$/i,or=/^h\d$/i,st=/^[^{]+\{\s*\[native \w/,sr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gt=/[+~]/,hr=/'|\\/g,k=new RegExp("\\\\([\\da-f]{1,6}"+i+"?|("+i+")|.)","ig"),d=function(n,t,i){var r="0x"+t-65536;return r!==r||i?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,r&1023|56320)};try{b.apply(w=vi.call(s.childNodes),s.childNodes);w[s.childNodes.length].nodeType}catch(yr){b={apply:w.length?function(n,t){nr.apply(n,vi.call(t))}:function(n,t){for(var i=n.length,r=0;n[i++]=t[r++];);n.length=i-1}}}u=r.support={};oi=r.isXML=function(n){var t=n&&(n.ownerDocument||n).documentElement;return t?t.nodeName!=="HTML":!1};p=r.setDocument=function(n){var v,r=n?n.ownerDocument||n:s,h=r.defaultView;return r===e||r.nodeType!==9||!r.documentElement?e:(e=r,l=r.documentElement,a=!oi(r),h&&h!==h.top&&(h.addEventListener?h.addEventListener("unload",function(){p()},!1):h.attachEvent&&h.attachEvent("onunload",function(){p()})),u.attributes=c(function(n){return n.className="i",!n.getAttribute("className")}),u.getElementsByTagName=c(function(n){return n.appendChild(r.createComment("")),!n.getElementsByTagName("*").length}),u.getElementsByClassName=st.test(r.getElementsByClassName)&&c(function(n){return n.innerHTML="<div class='a'><\/div><div class='a i'><\/div>",n.firstChild.className="i",n.getElementsByClassName("i").length===2}),u.getById=c(function(n){return l.appendChild(n).id=f,!r.getElementsByName||!r.getElementsByName(f).length}),u.getById?(t.find.ID=function(n,t){if(typeof t.getElementById!==ut&&a){var i=t.getElementById(n);return i&&i.parentNode?[i]:[]}},t.filter.ID=function(n){var t=n.replace(k,d);return function(n){return n.getAttribute("id")===t}}):(delete t.find.ID,t.filter.ID=function(n){var t=n.replace(k,d);return function(n){var i=typeof n.getAttributeNode!==ut&&n.getAttributeNode("id");return i&&i.value===t}}),t.find.TAG=u.getElementsByTagName?function(n,t){if(typeof t.getElementsByTagName!==ut)return t.getElementsByTagName(n)}:function(n,t){var i,r=[],f=0,u=t.getElementsByTagName(n);if(n==="*"){while(i=u[f++])i.nodeType===1&&r.push(i);return r}return u},t.find.CLASS=u.getElementsByClassName&&function(n,t){if(typeof t.getElementsByClassName!==ut&&a)return t.getElementsByClassName(n)},g=[],o=[],(u.qsa=st.test(r.querySelectorAll))&&(c(function(n){n.innerHTML="<select msallowclip=''><option selected=''><\/option><\/select>";n.querySelectorAll("[msallowclip^='']").length&&o.push("[*^$]="+i+"*(?:''|\"\")");n.querySelectorAll("[selected]").length||o.push("\\["+i+"*(?:value|"+kt+")");n.querySelectorAll(":checked").length||o.push(":checked")}),c(function(n){var t=r.createElement("input");t.setAttribute("type","hidden");n.appendChild(t).setAttribute("name","D");n.querySelectorAll("[name=d]").length&&o.push("name"+i+"*[*^$|!~]?=");n.querySelectorAll(":enabled").length||o.push(":enabled",":disabled");n.querySelectorAll("*,:x");o.push(",.*:")})),(u.matchesSelector=st.test(lt=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.msMatchesSelector))&&c(function(n){u.disconnectedMatch=lt.call(n,"div");lt.call(n,"[s!='']:x");g.push("!=",dt)}),o=o.length&&new RegExp(o.join("|")),g=g.length&&new RegExp(g.join("|")),v=st.test(l.compareDocumentPosition),ot=v||st.test(l.contains)?function(n,t){var r=n.nodeType===9?n.documentElement:n,i=t&&t.parentNode;return n===i||!!(i&&i.nodeType===1&&(r.contains?r.contains(i):n.compareDocumentPosition&&n.compareDocumentPosition(i)&16))}:function(n,t){if(t)while(t=t.parentNode)if(t===n)return!0;return!1},bt=v?function(n,t){if(n===t)return rt=!0,0;var i=!n.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(n.ownerDocument||n)===(t.ownerDocument||t)?n.compareDocumentPosition(t):1,i&1||!u.sortDetached&&t.compareDocumentPosition(n)===i)?n===r||n.ownerDocument===s&&ot(s,n)?-1:t===r||t.ownerDocument===s&&ot(s,t)?1:y?nt.call(y,n)-nt.call(y,t):0:i&4?-1:1}:function(n,t){if(n===t)return rt=!0,0;var i,u=0,o=n.parentNode,h=t.parentNode,f=[n],e=[t];if(o&&h){if(o===h)return wi(n,t)}else return n===r?-1:t===r?1:o?-1:h?1:y?nt.call(y,n)-nt.call(y,t):0;for(i=n;i=i.parentNode;)f.unshift(i);for(i=t;i=i.parentNode;)e.unshift(i);while(f[u]===e[u])u++;return u?wi(f[u],e[u]):f[u]===s?-1:e[u]===s?1:0},r)};r.matches=function(n,t){return r(n,null,null,t)};r.matchesSelector=function(n,t){if((n.ownerDocument||n)!==e&&p(n),t=t.replace(rr,"='$1']"),u.matchesSelector&&a&&(!g||!g.test(t))&&(!o||!o.test(t)))try{var i=lt.call(n,t);if(i||u.disconnectedMatch||n.document&&n.document.nodeType!==11)return i}catch(f){}return r(t,e,null,[n]).length>0};r.contains=function(n,t){return(n.ownerDocument||n)!==e&&p(n),ot(n,t)};r.attr=function(n,i){(n.ownerDocument||n)!==e&&p(n);var f=t.attrHandle[i.toLowerCase()],r=f&&di.call(t.attrHandle,i.toLowerCase())?f(n,i,!a):undefined;return r!==undefined?r:u.attributes||!a?n.getAttribute(i):(r=n.getAttributeNode(i))&&r.specified?r.value:null};r.error=function(n){throw new Error("Syntax error, unrecognized expression: "+n);};r.uniqueSort=function(n){var r,f=[],t=0,i=0;if(rt=!u.detectDuplicates,y=!u.sortStable&&n.slice(0),n.sort(bt),rt){while(r=n[i++])r===n[i]&&(t=f.push(i));while(t--)n.splice(f[t],1)}return y=null,n};ht=r.getText=function(n){var r,i="",u=0,t=n.nodeType;if(t){if(t===1||t===9||t===11){if(typeof n.textContent=="string")return n.textContent;for(n=n.firstChild;n;n=n.nextSibling)i+=ht(n)}else if(t===3||t===4)return n.nodeValue}else while(r=n[u++])i+=ht(r);return i};t=r.selectors={cacheLength:50,createPseudo:h,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(n){return n[1]=n[1].replace(k,d),n[3]=(n[3]||n[4]||n[5]||"").replace(k,d),n[2]==="~="&&(n[3]=" "+n[3]+" "),n.slice(0,4)},CHILD:function(n){return n[1]=n[1].toLowerCase(),n[1].slice(0,3)==="nth"?(n[3]||r.error(n[0]),n[4]=+(n[4]?n[5]+(n[6]||1):2*(n[3]==="even"||n[3]==="odd")),n[5]=+(n[7]+n[8]||n[3]==="odd")):n[3]&&r.error(n[0]),n},PSEUDO:function(n){var i,t=!n[6]&&n[2];return vt.CHILD.test(n[0])?null:(n[3]?n[2]=n[4]||n[5]||"":t&&ur.test(t)&&(i=et(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(n[0]=n[0].slice(0,i),n[2]=t.slice(0,i)),n.slice(0,3))}},filter:{TAG:function(n){var t=n.replace(k,d).toLowerCase();return n==="*"?function(){return!0}:function(n){return n.nodeName&&n.nodeName.toLowerCase()===t}},CLASS:function(n){var t=hi[n+" "];return t||(t=new RegExp("(^|"+i+")"+n+"("+i+"|$)"))&&hi(n,function(n){return t.test(typeof n.className=="string"&&n.className||typeof n.getAttribute!==ut&&n.getAttribute("class")||"")})},ATTR:function(n,t,i){return function(u){var f=r.attr(u,n);return f==null?t==="!=":t?(f+="",t==="="?f===i:t==="!="?f!==i:t==="^="?i&&f.indexOf(i)===0:t==="*="?i&&f.indexOf(i)>-1:t==="$="?i&&f.slice(-i.length)===i:t==="~="?(" "+f+" ").indexOf(i)>-1:t==="|="?f===i||f.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(n,t,i,r,u){var s=n.slice(0,3)!=="nth",o=n.slice(-4)!=="last",e=t==="of-type";return r===1&&u===0?function(n){return!!n.parentNode}:function(t,i,h){var a,k,c,l,y,w,b=s!==o?"nextSibling":"previousSibling",p=t.parentNode,g=e&&t.nodeName.toLowerCase(),d=!h&&!e;if(p){if(s){while(b){for(c=t;c=c[b];)if(e?c.nodeName.toLowerCase()===g:c.nodeType===1)return!1;w=b=n==="only"&&!w&&"nextSibling"}return!0}if(w=[o?p.firstChild:p.lastChild],o&&d){for(k=p[f]||(p[f]={}),a=k[n]||[],y=a[0]===v&&a[1],l=a[0]===v&&a[2],c=y&&p.childNodes[y];c=++y&&c&&c[b]||(l=y=0)||w.pop();)if(c.nodeType===1&&++l&&c===t){k[n]=[v,y,l];break}}else if(d&&(a=(t[f]||(t[f]={}))[n])&&a[0]===v)l=a[1];else while(c=++y&&c&&c[b]||(l=y=0)||w.pop())if((e?c.nodeName.toLowerCase()===g:c.nodeType===1)&&++l&&(d&&((c[f]||(c[f]={}))[n]=[v,l]),c===t))break;return l-=u,l===r||l%r==0&&l/r>=0}}},PSEUDO:function(n,i){var e,u=t.pseudos[n]||t.setFilters[n.toLowerCase()]||r.error("unsupported pseudo: "+n);return u[f]?u(i):u.length>1?(e=[n,n,"",i],t.setFilters.hasOwnProperty(n.toLowerCase())?h(function(n,t){for(var r,f=u(n,i),e=f.length;e--;)r=nt.call(n,f[e]),n[r]=!(t[r]=f[e])}):function(n){return u(n,0,e)}):u}},pseudos:{not:h(function(n){var i=[],r=[],t=wt(n.replace(at,"$1"));return t[f]?h(function(n,i,r,u){for(var e,o=t(n,null,u,[]),f=n.length;f--;)(e=o[f])&&(n[f]=!(i[f]=e))}):function(n,u,f){return i[0]=n,t(i,null,f,r),!r.pop()}}),has:h(function(n){return function(t){return r(n,t).length>0}}),contains:h(function(n){return function(t){return(t.textContent||t.innerText||ht(t)).indexOf(n)>-1}}),lang:h(function(n){return fr.test(n||"")||r.error("unsupported lang: "+n),n=n.replace(k,d).toLowerCase(),function(t){var i;do if(i=a?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===n||i.indexOf(n+"-")===0;while((t=t.parentNode)&&t.nodeType===1);return!1}}),target:function(t){var i=n.location&&n.location.hash;return i&&i.slice(1)===t.id},root:function(n){return n===l},focus:function(n){return n===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(n.type||n.href||~n.tabIndex)},enabled:function(n){return n.disabled===!1},disabled:function(n){return n.disabled===!0},checked:function(n){var t=n.nodeName.toLowerCase();return t==="input"&&!!n.checked||t==="option"&&!!n.selected},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},empty:function(n){for(n=n.firstChild;n;n=n.nextSibling)if(n.nodeType<6)return!1;return!0},parent:function(n){return!t.pseudos.empty(n)},header:function(n){return or.test(n.nodeName)},input:function(n){return er.test(n.nodeName)},button:function(n){var t=n.nodeName.toLowerCase();return t==="input"&&n.type==="button"||t==="button"},text:function(n){var t;return n.nodeName.toLowerCase()==="input"&&n.type==="text"&&((t=n.getAttribute("type"))==null||t.toLowerCase()==="text")},first:tt(function(){return[0]}),last:tt(function(n,t){return[t-1]}),eq:tt(function(n,t,i){return[i<0?i+t:i]}),even:tt(function(n,t){for(var i=0;i<t;i+=2)n.push(i);return n}),odd:tt(function(n,t){for(var i=1;i<t;i+=2)n.push(i);return n}),lt:tt(function(n,t,i){for(var r=i<0?i+t:i;--r>=0;)n.push(r);return n}),gt:tt(function(n,t,i){for(var r=i<0?i+t:i;++r<t;)n.push(r);return n})}};t.pseudos.nth=t.pseudos.eq;for(it in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[it]=cr(it);for(it in{submit:!0,reset:!0})t.pseudos[it]=lr(it);return bi.prototype=t.filters=t.pseudos,t.setFilters=new bi,et=r.tokenize=function(n,i){var e,f,s,o,u,h,c,l=ci[n+" "];if(l)return i?0:l.slice(0);for(u=n,h=[],c=t.preFilter;u;){(!e||(f=tr.exec(u)))&&(f&&(u=u.slice(f[0].length)||u),h.push(s=[]));e=!1;(f=ir.exec(u))&&(e=f.shift(),s.push({value:e,type:f[0].replace(at," ")}),u=u.slice(e.length));for(o in t.filter)(f=vt[o].exec(u))&&(!c[o]||(f=c[o](f)))&&(e=f.shift(),s.push({value:e,type:o,matches:f}),u=u.slice(e.length));if(!e)break}return i?u.length:u?r.error(n):ci(n,h).slice(0)},wt=r.compile=function(n,t){var r,u=[],e=[],i=li[n+" "];if(!i){for(t||(t=et(n)),r=t.length;r--;)i=ei(t[r]),i[f]?u.push(i):e.push(i);i=li(n,vr(e,u));i.selector=n}return i},si=r.select=function(n,i,r,f){var s,e,o,l,v,c=typeof n=="function"&&n,h=!f&&et(n=c.selector||n);if(r=r||[],h.length===1){if(e=h[0]=h[0].slice(0),e.length>2&&(o=e[0]).type==="ID"&&u.getById&&i.nodeType===9&&a&&t.relative[e[1].type]){if(i=(t.find.ID(o.matches[0].replace(k,d),i)||[])[0],i)c&&(i=i.parentNode);else return r;n=n.slice(e.shift().value.length)}for(s=vt.needsContext.test(n)?0:e.length;s--;){if(o=e[s],t.relative[l=o.type])break;if((v=t.find[l])&&(f=v(o.matches[0].replace(k,d),gt.test(e[0].type)&&ii(i.parentNode)||i))){if(e.splice(s,1),n=f.length&&yt(e),!n)return b.apply(r,f),r;break}}}return(c||wt(n,h))(f,i,!a,r,gt.test(n)&&ii(i.parentNode)||i),r},u.sortStable=f.split("").sort(bt).join("")===f,u.detectDuplicates=!!rt,p(),u.sortDetached=c(function(n){return n.compareDocumentPosition(e.createElement("div"))&1}),c(function(n){return n.innerHTML="<a href='#'><\/a>",n.firstChild.getAttribute("href")==="#"})||ti("type|href|height|width",function(n,t,i){if(!i)return n.getAttribute(t,t.toLowerCase()==="type"?1:2)}),u.attributes&&c(function(n){return n.innerHTML="<input/>",n.firstChild.setAttribute("value",""),n.firstChild.getAttribute("value")===""})||ti("value",function(n,t,i){if(!i&&n.nodeName.toLowerCase()==="input")return n.defaultValue}),c(function(n){return n.getAttribute("disabled")==null})||ti(kt,function(n,t,i){var r;if(!i)return n[t]===!0?t.toLowerCase():(r=n.getAttributeNode(t))&&r.specified?r.value:null}),r}(n);i.find=y;i.expr=y.selectors;i.expr[":"]=i.expr.pseudos;i.unique=y.uniqueSort;i.text=y.getText;i.isXMLDoc=y.isXML;i.contains=y.contains;var di=i.expr.match.needsContext,gi=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ef=/^.[^:#\[\.,]*$/;i.filter=function(n,t,r){var u=t[0];return r&&(n=":not("+n+")"),t.length===1&&u.nodeType===1?i.find.matchesSelector(u,n)?[u]:[]:i.find.matches(n,i.grep(t,function(n){return n.nodeType===1}))};i.fn.extend({find:function(n){var t,u=this.length,r=[],f=this;if(typeof n!="string")return this.pushStack(i(n).filter(function(){for(t=0;t<u;t++)if(i.contains(f[t],this))return!0}));for(t=0;t<u;t++)i.find(n,f[t],r);return r=this.pushStack(u>1?i.unique(r):r),r.selector=this.selector?this.selector+" "+n:n,r},filter:function(n){return this.pushStack(fi(this,n||[],!1))},not:function(n){return this.pushStack(fi(this,n||[],!0))},is:function(n){return!!fi(this,typeof n=="string"&&di.test(n)?i(n):n||[],!1).length}});nr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;tr=i.fn.init=function(n,t){var r,f;if(!n)return this;if(typeof n=="string"){if(r=n[0]==="<"&&n[n.length-1]===">"&&n.length>=3?[null,n,null]:nr.exec(n),r&&(r[1]||!t)){if(r[1]){if(t=t instanceof i?t[0]:t,i.merge(this,i.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:u,!0)),gi.test(r[1])&&i.isPlainObject(t))for(r in t)i.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return f=u.getElementById(r[2]),f&&f.parentNode&&(this.length=1,this[0]=f),this.context=u,this.selector=n,this}return!t||t.jquery?(t||st).find(n):this.constructor(t).find(n)}return n.nodeType?(this.context=this[0]=n,this.length=1,this):i.isFunction(n)?typeof st.ready!="undefined"?st.ready(n):n(i):(n.selector!==undefined&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))};tr.prototype=i.fn;st=i(u);ir=/^(?:parents|prev(?:Until|All))/;rr={children:!0,contents:!0,next:!0,prev:!0};i.extend({dir:function(n,t,r){for(var u=[],f=r!==undefined;(n=n[t])&&n.nodeType!==9;)if(n.nodeType===1){if(f&&i(n).is(r))break;u.push(n)}return u},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)n.nodeType===1&&n!==t&&i.push(n);return i}});i.fn.extend({has:function(n){var t=i(n,this),r=t.length;return this.filter(function(){for(var n=0;n<r;n++)if(i.contains(this,t[n]))return!0})},closest:function(n,t){for(var r,f=0,o=this.length,u=[],e=di.test(n)||typeof n!="string"?i(n,t||this.context):0;f<o;f++)for(r=this[f];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(e?e.index(r)>-1:r.nodeType===1&&i.find.matchesSelector(r,n))){u.push(r);break}return this.pushStack(u.length>1?i.unique(u):u)},index:function(n){return n?typeof n=="string"?et.call(i(n),this[0]):et.call(this,n.jquery?n[0]:n):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(n,t){return this.pushStack(i.unique(i.merge(this.get(),i(n,t))))},addBack:function(n){return this.add(n==null?this.prevObject:this.prevObject.filter(n))}});i.each({parent:function(n){var t=n.parentNode;return t&&t.nodeType!==11?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return ur(n,"nextSibling")},prev:function(n){return ur(n,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling((n.parentNode||{}).firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return n.contentDocument||i.merge([],n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return n.slice(-5)!=="Until"&&(u=r),u&&typeof u=="string"&&(f=i.filter(u,f)),this.length>1&&(rr[n]||i.unique(f),ir.test(n)&&f.reverse()),this.pushStack(f)}});c=/\S+/g;ei={};i.Callbacks=function(n){n=typeof n=="string"?ei[n]||of(n):i.extend({},n);var u,h,o,c,f,e,t=[],r=!n.once&&[],l=function(i){for(u=n.memory&&i,h=!0,e=c||0,c=0,f=t.length,o=!0;t&&e<f;e++)if(t[e].apply(i[0],i[1])===!1&&n.stopOnFalse){u=!1;break}o=!1;t&&(r?r.length&&l(r.shift()):u?t=[]:s.disable())},s={add:function(){if(t){var r=t.length;(function e(r){i.each(r,function(r,u){var f=i.type(u);f==="function"?n.unique&&s.has(u)||t.push(u):u&&u.length&&f!=="string"&&e(u)})})(arguments);o?f=t.length:u&&(c=r,l(u))}return this},remove:function(){return t&&i.each(arguments,function(n,r){for(var u;(u=i.inArray(r,t,u))>-1;)t.splice(u,1),o&&(u<=f&&f--,u<=e&&e--)}),this},has:function(n){return n?i.inArray(n,t)>-1:!!(t&&t.length)},empty:function(){return t=[],f=0,this},disable:function(){return t=r=u=undefined,this},disabled:function(){return!t},lock:function(){return r=undefined,u||s.disable(),this},locked:function(){return!r},fireWith:function(n,i){return t&&(!h||r)&&(i=i||[],i=[n,i.slice?i.slice():i],o?r.push(i):l(i)),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!h}};return s};i.extend({Deferred:function(n){var u=[["resolve","done",i.Callbacks("once memory"),"resolved"],["reject","fail",i.Callbacks("once memory"),"rejected"],["notify","progress",i.Callbacks("memory")]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},then:function(){var n=arguments;return i.Deferred(function(f){i.each(u,function(u,e){var o=i.isFunction(n[u])&&n[u];t[e[1]](function(){var n=o&&o.apply(this,arguments);n&&i.isFunction(n.promise)?n.promise().done(f.resolve).fail(f.reject).progress(f.notify):f[e[0]+"With"](this===r?f.promise():this,o?[n]:arguments)})});n=null}).promise()},promise:function(n){return n!=null?i.extend(n,r):r}},t={};return r.pipe=r.then,i.each(u,function(n,i){var e=i[2],o=i[3];r[i[1]]=e.add;o&&e.add(function(){f=o},u[n^1][2].disable,u[2][2].lock);t[i[0]]=function(){return t[i[0]+"With"](this===t?r:this,arguments),this};t[i[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var t=0,u=a.call(arguments),r=u.length,e=r!==1||n&&i.isFunction(n.promise)?r:0,f=e===1?n:i.Deferred(),h=function(n,t,i){return function(r){t[n]=this;i[n]=arguments.length>1?a.call(arguments):r;i===o?f.notifyWith(t,i):--e||f.resolveWith(t,i)}},o,c,s;if(r>1)for(o=new Array(r),c=new Array(r),s=new Array(r);t<r;t++)u[t]&&i.isFunction(u[t].promise)?u[t].promise().done(h(t,s,u)).fail(f.reject).progress(h(t,c,o)):--e;return e||f.resolveWith(s,u),f.promise()}});i.fn.ready=function(n){return i.ready.promise().done(n),this};i.extend({isReady:!1,readyWait:1,holdReady:function(n){n?i.readyWait++:i.ready(!0)},ready:function(n){(n===!0?--i.readyWait:i.isReady)||(i.isReady=!0,n!==!0&&--i.readyWait>0)||(ht.resolveWith(u,[i]),i.fn.triggerHandler&&(i(u).triggerHandler("ready"),i(u).off("ready")))}});i.ready.promise=function(t){return ht||(ht=i.Deferred(),u.readyState==="complete"?setTimeout(i.ready):(u.addEventListener("DOMContentLoaded",ct,!1),n.addEventListener("load",ct,!1))),ht.promise(t)};i.ready.promise();l=i.access=function(n,t,r,u,f,e,o){var s=0,c=n.length,h=r==null;if(i.type(r)==="object"){f=!0;for(s in r)i.access(n,t,s,r[s],!0,e,o)}else if(u!==undefined&&(f=!0,i.isFunction(u)||(o=!0),h&&(o?(t.call(n,u),t=null):(h=t,t=function(n,t,r){return h.call(i(n),r)})),t))for(;s<c;s++)t(n[s],r,o?u:u.call(n[s],s,t(n[s],r)));return f?n:h?t.call(n):c?t(n[0],r):e};i.acceptData=function(n){return n.nodeType===1||n.nodeType===9||!+n.nodeType};p.uid=1;p.accepts=i.acceptData;p.prototype={key:function(n){if(!p.accepts(n))return 0;var r={},t=n[this.expando];if(!t){t=p.uid++;try{r[this.expando]={value:t};Object.defineProperties(n,r)}catch(u){r[this.expando]=t;i.extend(n,r)}}return this.cache[t]||(this.cache[t]={}),t},set:function(n,t,r){var f,e=this.key(n),u=this.cache[e];if(typeof t=="string")u[t]=r;else if(i.isEmptyObject(u))i.extend(this.cache[e],t);else for(f in t)u[f]=t[f];return u},get:function(n,t){var i=this.cache[this.key(n)];return t===undefined?i:i[t]},access:function(n,t,r){var u;return t===undefined||t&&typeof t=="string"&&r===undefined?(u=this.get(n,t),u!==undefined?u:this.get(n,i.camelCase(t))):(this.set(n,t,r),r!==undefined?r:t)},remove:function(n,t){var u,r,f,o=this.key(n),e=this.cache[o];if(t===undefined)this.cache[o]={};else for(i.isArray(t)?r=t.concat(t.map(i.camelCase)):(f=i.camelCase(t),t in e?r=[t,f]:(r=f,r=r in e?[r]:r.match(c)||[])),u=r.length;u--;)delete e[r[u]]},hasData:function(n){return!i.isEmptyObject(this.cache[n[this.expando]]||{})},discard:function(n){n[this.expando]&&delete this.cache[n[this.expando]]}};var r=new p,e=new p,sf=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,hf=/([A-Z])/g;i.extend({hasData:function(n){return e.hasData(n)||r.hasData(n)},data:function(n,t,i){return e.access(n,t,i)},removeData:function(n,t){e.remove(n,t)},_data:function(n,t,i){return r.access(n,t,i)},_removeData:function(n,t){r.remove(n,t)}});i.fn.extend({data:function(n,t){var o,f,s,u=this[0],h=u&&u.attributes;if(n===undefined){if(this.length&&(s=e.get(u),u.nodeType===1&&!r.get(u,"hasDataAttrs"))){for(o=h.length;o--;)h[o]&&(f=h[o].name,f.indexOf("data-")===0&&(f=i.camelCase(f.slice(5)),fr(u,f,s[f])));r.set(u,"hasDataAttrs",!0)}return s}return typeof n=="object"?this.each(function(){e.set(this,n)}):l(this,function(t){var r,f=i.camelCase(n);if(u&&t===undefined)return(r=e.get(u,n),r!==undefined)?r:(r=e.get(u,f),r!==undefined)?r:(r=fr(u,f,undefined),r!==undefined)?r:void 0;this.each(function(){var i=e.get(this,f);e.set(this,f,t);n.indexOf("-")!==-1&&i!==undefined&&e.set(this,n,t)})},null,t,arguments.length>1,null,!0)},removeData:function(n){return this.each(function(){e.remove(this,n)})}});i.extend({queue:function(n,t,u){var f;if(n)return t=(t||"fx")+"queue",f=r.get(n,t),u&&(!f||i.isArray(u)?f=r.access(n,t,i.makeArray(u)):f.push(u)),f||[]},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),e=r.length,u=r.shift(),f=i._queueHooks(n,t),o=function(){i.dequeue(n,t)};u==="inprogress"&&(u=r.shift(),e--);u&&(t==="fx"&&r.unshift("inprogress"),delete f.stop,u.call(n,o,f));!e&&f&&f.empty.fire()},_queueHooks:function(n,t){var u=t+"queueHooks";return r.get(n,u)||r.access(n,u,{empty:i.Callbacks("once memory").add(function(){r.remove(n,[t+"queue",u])})})}});i.fn.extend({queue:function(n,t){var r=2;return(typeof n!="string"&&(t=n,n="fx",r--),arguments.length<r)?i.queue(this[0],n):t===undefined?this:this.each(function(){var r=i.queue(this,n,t);i._queueHooks(this,n);n==="fx"&&r[0]!=="inprogress"&&i.dequeue(this,n)})},dequeue:function(n){return this.each(function(){i.dequeue(this,n)})},clearQueue:function(n){return this.queue(n||"fx",[])},promise:function(n,t){var u,e=1,o=i.Deferred(),f=this,s=this.length,h=function(){--e||o.resolveWith(f,[f])};for(typeof n!="string"&&(t=n,n=undefined),n=n||"fx";s--;)u=r.get(f[s],n+"queueHooks"),u&&u.empty&&(e++,u.empty.add(h));return h(),o.promise(t)}});var lt=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=["Top","Right","Bottom","Left"],it=function(n,t){return n=t||n,i.css(n,"display")==="none"||!i.contains(n.ownerDocument,n)},er=/^(?:checkbox|radio)$/i;(function(){var i=u.createDocumentFragment(),n=i.appendChild(u.createElement("div")),t=u.createElement("input");t.setAttribute("type","radio");t.setAttribute("checked","checked");t.setAttribute("name","t");n.appendChild(t);f.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked;n.innerHTML="<textarea>x<\/textarea>";f.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue})();d=typeof undefined;f.focusinBubbles="onfocusin"in n;var cf=/^key/,lf=/^(?:mouse|pointer|contextmenu)|click/,or=/^(?:focusinfocus|focusoutblur)$/,sr=/^([^.]*)(?:\.(.+)|)$/;i.event={global:{},add:function(n,t,u,f,e){var v,y,w,p,b,h,s,l,o,k,g,a=r.get(n);if(a)for(u.handler&&(v=u,u=v.handler,e=v.selector),u.guid||(u.guid=i.guid++),(p=a.events)||(p=a.events={}),(y=a.handle)||(y=a.handle=function(t){return typeof i!==d&&i.event.triggered!==t.type?i.event.dispatch.apply(n,arguments):undefined}),t=(t||"").match(c)||[""],b=t.length;b--;)(w=sr.exec(t[b])||[],o=g=w[1],k=(w[2]||"").split(".").sort(),o)&&(s=i.event.special[o]||{},o=(e?s.delegateType:s.bindType)||o,s=i.event.special[o]||{},h=i.extend({type:o,origType:g,data:f,handler:u,guid:u.guid,selector:e,needsContext:e&&i.expr.match.needsContext.test(e),namespace:k.join(".")},v),(l=p[o])||(l=p[o]=[],l.delegateCount=0,s.setup&&s.setup.call(n,f,k,y)!==!1||n.addEventListener&&n.addEventListener(o,y,!1)),s.add&&(s.add.call(n,h),h.handler.guid||(h.handler.guid=u.guid)),e?l.splice(l.delegateCount++,0,h):l.push(h),i.event.global[o]=!0)},remove:function(n,t,u,f,e){var p,k,h,v,w,s,l,a,o,b,d,y=r.hasData(n)&&r.get(n);if(y&&(v=y.events)){for(t=(t||"").match(c)||[""],w=t.length;w--;){if(h=sr.exec(t[w])||[],o=d=h[1],b=(h[2]||"").split(".").sort(),!o){for(o in v)i.event.remove(n,o+t[w],u,f,!0);continue}for(l=i.event.special[o]||{},o=(f?l.delegateType:l.bindType)||o,a=v[o]||[],h=h[2]&&new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"),k=p=a.length;p--;)s=a[p],(e||d===s.origType)&&(!u||u.guid===s.guid)&&(!h||h.test(s.namespace))&&(!f||f===s.selector||f==="**"&&s.selector)&&(a.splice(p,1),s.selector&&a.delegateCount--,l.remove&&l.remove.call(n,s));k&&!a.length&&(l.teardown&&l.teardown.call(n,b,y.handle)!==!1||i.removeEvent(n,o,y.handle),delete v[o])}i.isEmptyObject(v)&&(delete y.handle,r.remove(n,"events"))}},trigger:function(t,f,e,o){var w,s,c,b,a,v,l,p=[e||u],h=ri.call(t,"type")?t.type:t,y=ri.call(t,"namespace")?t.namespace.split("."):[];if((s=c=e=e||u,e.nodeType!==3&&e.nodeType!==8)&&!or.test(h+i.event.triggered)&&(h.indexOf(".")>=0&&(y=h.split("."),h=y.shift(),y.sort()),a=h.indexOf(":")<0&&"on"+h,t=t[i.expando]?t:new i.Event(h,typeof t=="object"&&t),t.isTrigger=o?2:3,t.namespace=y.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=e),f=f==null?[t]:i.makeArray(f,[t]),l=i.event.special[h]||{},o||!l.trigger||l.trigger.apply(e,f)!==!1)){if(!o&&!l.noBubble&&!i.isWindow(e)){for(b=l.delegateType||h,or.test(b+h)||(s=s.parentNode);s;s=s.parentNode)p.push(s),c=s;c===(e.ownerDocument||u)&&p.push(c.defaultView||c.parentWindow||n)}for(w=0;(s=p[w++])&&!t.isPropagationStopped();)t.type=w>1?b:l.bindType||h,v=(r.get(s,"events")||{})[t.type]&&r.get(s,"handle"),v&&v.apply(s,f),v=a&&s[a],v&&v.apply&&i.acceptData(s)&&(t.result=v.apply(s,f),t.result===!1&&t.preventDefault());return t.type=h,o||t.isDefaultPrevented()||(!l._default||l._default.apply(p.pop(),f)===!1)&&i.acceptData(e)&&a&&i.isFunction(e[h])&&!i.isWindow(e)&&(c=e[a],c&&(e[a]=null),i.event.triggered=h,e[h](),i.event.triggered=undefined,c&&(e[a]=c)),t.result}},dispatch:function(n){n=i.event.fix(n);var o,s,e,u,t,h=[],c=a.call(arguments),l=(r.get(this,"events")||{})[n.type]||[],f=i.event.special[n.type]||{};if(c[0]=n,n.delegateTarget=this,!f.preDispatch||f.preDispatch.call(this,n)!==!1){for(h=i.event.handlers.call(this,n,l),o=0;(u=h[o++])&&!n.isPropagationStopped();)for(n.currentTarget=u.elem,s=0;(t=u.handlers[s++])&&!n.isImmediatePropagationStopped();)(!n.namespace_re||n.namespace_re.test(t.namespace))&&(n.handleObj=t,n.data=t.data,e=((i.event.special[t.origType]||{}).handle||t.handler).apply(u.elem,c),e!==undefined&&(n.result=e)===!1&&(n.preventDefault(),n.stopPropagation()));return f.postDispatch&&f.postDispatch.call(this,n),n.result}},handlers:function(n,t){var e,u,f,o,h=[],s=t.delegateCount,r=n.target;if(s&&r.nodeType&&(!n.button||n.type!=="click"))for(;r!==this;r=r.parentNode||this)if(r.disabled!==!0||n.type!=="click"){for(u=[],e=0;e<s;e++)o=t[e],f=o.selector+" ",u[f]===undefined&&(u[f]=o.needsContext?i(f,this).index(r)>=0:i.find(f,this,null,[r]).length),u[f]&&u.push(o);u.length&&h.push({elem:r,handlers:u})}return s<t.length&&h.push({elem:this,handlers:t.slice(s)}),h},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(n,t){return n.which==null&&(n.which=t.charCode!=null?t.charCode:t.keyCode),n}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(n,t){var e,i,r,f=t.button;return n.pageX==null&&t.clientX!=null&&(e=n.target.ownerDocument||u,i=e.documentElement,r=e.body,n.pageX=t.clientX+(i&&i.scrollLeft||r&&r.scrollLeft||0)-(i&&i.clientLeft||r&&r.clientLeft||0),n.pageY=t.clientY+(i&&i.scrollTop||r&&r.scrollTop||0)-(i&&i.clientTop||r&&r.clientTop||0)),n.which||f===undefined||(n.which=f&1?1:f&2?3:f&4?2:0),n}},fix:function(n){if(n[i.expando])return n;var f,e,o,r=n.type,s=n,t=this.fixHooks[r];for(t||(this.fixHooks[r]=t=lf.test(r)?this.mouseHooks:cf.test(r)?this.keyHooks:{}),o=t.props?this.props.concat(t.props):this.props,n=new i.Event(s),f=o.length;f--;)e=o[f],n[e]=s[e];return n.target||(n.target=u),n.target.nodeType===3&&(n.target=n.target.parentNode),t.filter?t.filter(n,s):n},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==hr()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===hr()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if(this.type==="checkbox"&&this.click&&i.nodeName(this,"input"))return this.click(),!1},_default:function(n){return i.nodeName(n.target,"a")}},beforeunload:{postDispatch:function(n){n.result!==undefined&&n.originalEvent&&(n.originalEvent.returnValue=n.result)}}},simulate:function(n,t,r,u){var f=i.extend(new i.Event,r,{type:n,isSimulated:!0,originalEvent:{}});u?i.event.trigger(f,null,t):i.event.dispatch.call(t,f);f.isDefaultPrevented()&&r.preventDefault()}};i.removeEvent=function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)};i.Event=function(n,t){if(!(this instanceof i.Event))return new i.Event(n,t);n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||n.defaultPrevented===undefined&&n.returnValue===!1?at:g):this.type=n;t&&i.extend(this,t);this.timeStamp=n&&n.timeStamp||i.now();this[i.expando]=!0};i.Event.prototype={isDefaultPrevented:g,isPropagationStopped:g,isImmediatePropagationStopped:g,preventDefault:function(){var n=this.originalEvent;this.isDefaultPrevented=at;n&&n.preventDefault&&n.preventDefault()},stopPropagation:function(){var n=this.originalEvent;this.isPropagationStopped=at;n&&n.stopPropagation&&n.stopPropagation()},stopImmediatePropagation:function(){var n=this.originalEvent;this.isImmediatePropagationStopped=at;n&&n.stopImmediatePropagation&&n.stopImmediatePropagation();this.stopPropagation()}};i.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(n,t){i.event.special[n]={delegateType:t,bindType:t,handle:function(n){var u,f=this,r=n.relatedTarget,e=n.handleObj;return r&&(r===f||i.contains(f,r))||(n.type=e.origType,u=e.handler.apply(this,arguments),n.type=t),u}}});f.focusinBubbles||i.each({focus:"focusin",blur:"focusout"},function(n,t){var u=function(n){i.event.simulate(t,n.target,i.event.fix(n),!0)};i.event.special[t]={setup:function(){var i=this.ownerDocument||this,f=r.access(i,t);f||i.addEventListener(n,u,!0);r.access(i,t,(f||0)+1)},teardown:function(){var i=this.ownerDocument||this,f=r.access(i,t)-1;f?r.access(i,t,f):(i.removeEventListener(n,u,!0),r.remove(i,t))}}});i.fn.extend({on:function(n,t,r,u,f){var e,o;if(typeof n=="object"){typeof t!="string"&&(r=r||t,t=undefined);for(o in n)this.on(o,t,r,n[o],f);return this}if(r==null&&u==null?(u=t,r=t=undefined):u==null&&(typeof t=="string"?(u=r,r=undefined):(u=r,r=t,t=undefined)),u===!1)u=g;else if(!u)return this;return f===1&&(e=u,u=function(n){return i().off(n),e.apply(this,arguments)},u.guid=e.guid||(e.guid=i.guid++)),this.each(function(){i.event.add(this,n,u,r,t)})},one:function(n,t,i,r){return this.on(n,t,i,r,1)},off:function(n,t,r){var u,f;if(n&&n.preventDefault&&n.handleObj)return u=n.handleObj,i(n.delegateTarget).off(u.namespace?u.origType+"."+u.namespace:u.origType,u.selector,u.handler),this;if(typeof n=="object"){for(f in n)this.off(f,t,n[f]);return this}return(t===!1||typeof t=="function")&&(r=t,t=undefined),r===!1&&(r=g),this.each(function(){i.event.remove(this,n,r,t)})},trigger:function(n,t){return this.each(function(){i.event.trigger(n,t,this)})},triggerHandler:function(n,t){var r=this[0];if(r)return i.event.trigger(n,t,r,!0)}});var cr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,lr=/<([\w:]+)/,af=/<|&#?\w+;/,vf=/<(?:script|style|link)/i,yf=/checked\s*(?:[^=]|=\s*.checked.)/i,ar=/^$|\/(?:java|ecma)script/i,pf=/^true\/(.*)/,wf=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,h={option:[1,"<select multiple='multiple'>","<\/select>"],thead:[1,"<table>","<\/table>"],col:[2,"<table><colgroup>","<\/colgroup><\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:[0,"",""]};h.optgroup=h.option;h.tbody=h.tfoot=h.colgroup=h.caption=h.thead;h.th=h.td;i.extend({clone:function(n,t,r){var u,c,s,e,h=n.cloneNode(!0),l=i.contains(n.ownerDocument,n);if(!f.noCloneChecked&&(n.nodeType===1||n.nodeType===11)&&!i.isXMLDoc(n))for(e=o(h),s=o(n),u=0,c=s.length;u<c;u++)df(s[u],e[u]);if(t)if(r)for(s=s||o(n),e=e||o(h),u=0,c=s.length;u<c;u++)yr(s[u],e[u]);else yr(n,h);return e=o(h,"script"),e.length>0&&oi(e,!l&&o(n,"script")),h},buildFragment:function(n,t,r,u){for(var f,e,y,l,p,a,s=t.createDocumentFragment(),v=[],c=0,w=n.length;c<w;c++)if(f=n[c],f||f===0)if(i.type(f)==="object")i.merge(v,f.nodeType?[f]:f);else if(af.test(f)){for(e=e||s.appendChild(t.createElement("div")),y=(lr.exec(f)||["",""])[1].toLowerCase(),l=h[y]||h._default,e.innerHTML=l[1]+f.replace(cr,"<$1><\/$2>")+l[2],a=l[0];a--;)e=e.lastChild;i.merge(v,e.childNodes);e=s.firstChild;e.textContent=""}else v.push(t.createTextNode(f));for(s.textContent="",c=0;f=v[c++];)if((!u||i.inArray(f,u)===-1)&&(p=i.contains(f.ownerDocument,f),e=o(s.appendChild(f),"script"),p&&oi(e),r))for(a=0;f=e[a++];)ar.test(f.type||"")&&r.push(f);return s},cleanData:function(n){for(var f,t,o,u,h=i.event.special,s=0;(t=n[s])!==undefined;s++){if(i.acceptData(t)&&(u=t[r.expando],u&&(f=r.cache[u]))){if(f.events)for(o in f.events)h[o]?i.event.remove(t,o):i.removeEvent(t,o,f.handle);r.cache[u]&&delete r.cache[u]}delete e.cache[t[e.expando]]}}});i.fn.extend({text:function(n){return l(this,function(n){return n===undefined?i.text(this):this.empty().each(function(){(this.nodeType===1||this.nodeType===11||this.nodeType===9)&&(this.textContent=n)})},null,n,arguments.length)},append:function(){return this.domManip(arguments,function(n){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=vr(this,n);t.appendChild(n)}})},prepend:function(){return this.domManip(arguments,function(n){if(this.nodeType===1||this.nodeType===11||this.nodeType===9){var t=vr(this,n);t.insertBefore(n,t.firstChild)}})},before:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this)})},after:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling)})},remove:function(n,t){for(var r,f=n?i.filter(n,this):this,u=0;(r=f[u])!=null;u++)t||r.nodeType!==1||i.cleanData(o(r)),r.parentNode&&(t&&i.contains(r.ownerDocument,r)&&oi(o(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var n,t=0;(n=this[t])!=null;t++)n.nodeType===1&&(i.cleanData(o(n,!1)),n.textContent="");return this},clone:function(n,t){return n=n==null?!1:n,t=t==null?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){return l(this,function(n){var t=this[0]||{},r=0,u=this.length;if(n===undefined&&t.nodeType===1)return t.innerHTML;if(typeof n=="string"&&!vf.test(n)&&!h[(lr.exec(n)||["",""])[1].toLowerCase()]){n=n.replace(cr,"<$1><\/$2>");try{for(;r<u;r++)t=this[r]||{},t.nodeType===1&&(i.cleanData(o(t,!1)),t.innerHTML=n);t=0}catch(f){}}t&&this.empty().append(n)},null,n,arguments.length)},replaceWith:function(){var n=arguments[0];return this.domManip(arguments,function(t){n=this.parentNode;i.cleanData(o(this));n&&n.replaceChild(t,this)}),n&&(n.length||n.nodeType)?this:this.remove()},detach:function(n){return this.remove(n,!0)},domManip:function(n,t){n=bi.apply([],n);var h,v,s,c,u,y,e=0,l=this.length,w=this,b=l-1,a=n[0],p=i.isFunction(a);if(p||l>1&&typeof a=="string"&&!f.checkClone&&yf.test(a))return this.each(function(i){var r=w.eq(i);p&&(n[0]=a.call(this,i,r.html()));r.domManip(n,t)});if(l&&(h=i.buildFragment(n,this[0].ownerDocument,!1,this),v=h.firstChild,h.childNodes.length===1&&(h=v),v)){for(s=i.map(o(h,"script"),bf),c=s.length;e<l;e++)u=h,e!==b&&(u=i.clone(u,!0,!0),c&&i.merge(s,o(u,"script"))),t.call(this[e],u,e);if(c)for(y=s[s.length-1].ownerDocument,i.map(s,kf),e=0;e<c;e++)u=s[e],ar.test(u.type||"")&&!r.access(u,"globalEval")&&i.contains(y,u)&&(u.src?i._evalUrl&&i._evalUrl(u.src):i.globalEval(u.textContent.replace(wf,"")))}return this}});i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){i.fn[n]=function(n){for(var u,f=[],e=i(n),o=e.length-1,r=0;r<=o;r++)u=r===o?this:this.clone(!0),i(e[r])[t](u),ii.apply(f,u.get());return this.pushStack(f)}});si={};var wr=/^margin/,ci=new RegExp("^("+lt+")(?!px)[a-z%]+$","i"),yt=function(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)};(function(){function h(){t.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute";t.innerHTML="";e.appendChild(r);var i=n.getComputedStyle(t,null);s=i.top!=="1%";o=i.width==="4px";e.removeChild(r)}var s,o,e=u.documentElement,r=u.createElement("div"),t=u.createElement("div");t.style&&(t.style.backgroundClip="content-box",t.cloneNode(!0).style.backgroundClip="",f.clearCloneStyle=t.style.backgroundClip==="content-box",r.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",r.appendChild(t),n.getComputedStyle&&i.extend(f,{pixelPosition:function(){return h(),s},boxSizingReliable:function(){return o==null&&h(),o},reliableMarginRight:function(){var f,i=t.appendChild(u.createElement("div"));return i.style.cssText=t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",t.style.width="1px",e.appendChild(r),f=!parseFloat(n.getComputedStyle(i,null).marginRight),e.removeChild(r),f}}))})();i.swap=function(n,t,i,r){var f,u,e={};for(u in t)e[u]=n.style[u],n.style[u]=t[u];f=i.apply(n,r||[]);for(u in t)n.style[u]=e[u];return f};var gf=/^(none|table(?!-c[ea]).+)/,ne=new RegExp("^("+lt+")(.*)$","i"),te=new RegExp("^([+-])=("+lt+")","i"),ie={position:"absolute",visibility:"hidden",display:"block"},kr={letterSpacing:"0",fontWeight:"400"},dr=["Webkit","O","Moz","ms"];i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=rt(n,"opacity");return i===""?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(n,t,r,u){if(n&&n.nodeType!==3&&n.nodeType!==8&&n.style){var o,h,e,s=i.camelCase(t),c=n.style;if(t=i.cssProps[s]||(i.cssProps[s]=gr(c,s)),e=i.cssHooks[t]||i.cssHooks[s],r!==undefined){if(h=typeof r,h==="string"&&(o=te.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(i.css(n,t)),h="number"),r==null||r!==r)return;h!=="number"||i.cssNumber[s]||(r+="px");f.clearCloneStyle||r!==""||t.indexOf("background")!==0||(c[t]="inherit");e&&"set"in e&&(r=e.set(n,r,u))===undefined||(c[t]=r)}else return e&&"get"in e&&(o=e.get(n,!1,u))!==undefined?o:c[t]}},css:function(n,t,r,u){var f,s,e,o=i.camelCase(t);return(t=i.cssProps[o]||(i.cssProps[o]=gr(n.style,o)),e=i.cssHooks[t]||i.cssHooks[o],e&&"get"in e&&(f=e.get(n,!0,r)),f===undefined&&(f=rt(n,t,u)),f==="normal"&&t in kr&&(f=kr[t]),r===""||r)?(s=parseFloat(f),r===!0||i.isNumeric(s)?s||0:f):f}});i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,u){if(r)return gf.test(i.css(n,"display"))&&n.offsetWidth===0?i.swap(n,ie,function(){return iu(n,t,u)}):iu(n,t,u)},set:function(n,r,u){var f=u&&yt(n);return nu(n,r,u?tu(n,t,u,i.css(n,"boxSizing",!1,f)==="border-box",f):0)}}});i.cssHooks.marginRight=br(f.reliableMarginRight,function(n,t){if(t)return i.swap(n,{display:"inline-block"},rt,[n,"marginRight"])});i.each({margin:"",padding:"",border:"Width"},function(n,t){i.cssHooks[n+t]={expand:function(i){for(var r=0,f={},u=typeof i=="string"?i.split(" "):[i];r<4;r++)f[n+w[r]+t]=u[r]||u[r-2]||u[0];return f}};wr.test(n)||(i.cssHooks[n+t].set=nu)});i.fn.extend({css:function(n,t){return l(this,function(n,t,r){var f,e,o={},u=0;if(i.isArray(t)){for(f=yt(n),e=t.length;u<e;u++)o[t[u]]=i.css(n,t[u],!1,f);return o}return r!==undefined?i.style(n,t,r):i.css(n,t)},n,t,arguments.length>1)},show:function(){return ru(this,!0)},hide:function(){return ru(this)},toggle:function(n){return typeof n=="boolean"?n?this.show():this.hide():this.each(function(){it(this)?i(this).show():i(this).hide()})}});i.Tween=s;s.prototype={constructor:s,init:function(n,t,r,u,f,e){this.elem=n;this.prop=r;this.easing=f||"swing";this.options=t;this.start=this.now=this.cur();this.end=u;this.unit=e||(i.cssNumber[r]?"":"px")},cur:function(){var n=s.propHooks[this.prop];return n&&n.get?n.get(this):s.propHooks._default.get(this)},run:function(n){var t,r=s.propHooks[this.prop];return this.pos=this.options.duration?t=i.easing[this.easing](n,this.options.duration*n,0,1,this.options.duration):t=n,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):s.propHooks._default.set(this),this}};s.prototype.init.prototype=s.prototype;s.propHooks={_default:{get:function(n){var t;return n.elem[n.prop]!=null&&(!n.elem.style||n.elem.style[n.prop]==null)?n.elem[n.prop]:(t=i.css(n.elem,n.prop,""),!t||t==="auto"?0:t)},set:function(n){i.fx.step[n.prop]?i.fx.step[n.prop](n):n.elem.style&&(n.elem.style[i.cssProps[n.prop]]!=null||i.cssHooks[n.prop])?i.style(n.elem,n.prop,n.now+n.unit):n.elem[n.prop]=n.now}}};s.propHooks.scrollTop=s.propHooks.scrollLeft={set:function(n){n.elem.nodeType&&n.elem.parentNode&&(n.elem[n.prop]=n.now)}};i.easing={linear:function(n){return n},swing:function(n){return.5-Math.cos(n*Math.PI)/2}};i.fx=s.prototype.init;i.fx.step={};var nt,pt,re=/^(?:toggle|show|hide)$/,uu=new RegExp("^(?:([+-])=|)("+lt+")([a-z%]*)$","i"),ue=/queueHooks$/,wt=[fe],ut={"*":[function(n,t){var f=this.createTween(n,t),s=f.cur(),u=uu.exec(t),e=u&&u[3]||(i.cssNumber[n]?"":"px"),r=(i.cssNumber[n]||e!=="px"&&+s)&&uu.exec(i.css(f.elem,n)),o=1,h=20;if(r&&r[3]!==e){e=e||r[3];u=u||[];r=+s||1;do o=o||".5",r=r/o,i.style(f.elem,n,r+e);while(o!==(o=f.cur()/s)&&o!==1&&--h)}return u&&(r=f.start=+r||+s||0,f.unit=e,f.end=u[1]?r+(u[1]+1)*u[2]:+u[2]),f}]};i.Animation=i.extend(ou,{tweener:function(n,t){i.isFunction(n)?(t=n,n=["*"]):n=n.split(" ");for(var r,u=0,f=n.length;u<f;u++)r=n[u],ut[r]=ut[r]||[],ut[r].unshift(t)},prefilter:function(n,t){t?wt.unshift(n):wt.push(n)}});i.speed=function(n,t,r){var u=n&&typeof n=="object"?i.extend({},n):{complete:r||!r&&t||i.isFunction(n)&&n,duration:n,easing:r&&t||t&&!i.isFunction(t)&&t};return u.duration=i.fx.off?0:typeof u.duration=="number"?u.duration:u.duration in i.fx.speeds?i.fx.speeds[u.duration]:i.fx.speeds._default,(u.queue==null||u.queue===!0)&&(u.queue="fx"),u.old=u.complete,u.complete=function(){i.isFunction(u.old)&&u.old.call(this);u.queue&&i.dequeue(this,u.queue)},u};i.fn.extend({fadeTo:function(n,t,i,r){return this.filter(it).css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,u,f){var s=i.isEmptyObject(n),o=i.speed(t,u,f),e=function(){var t=ou(this,i.extend({},n),o);(s||r.get(this,"finish"))&&t.stop(!0)};return e.finish=e,s||o.queue===!1?this.each(e):this.queue(o.queue,e)},stop:function(n,t,u){var f=function(n){var t=n.stop;delete n.stop;t(u)};return typeof n!="string"&&(u=t,t=n,n=undefined),t&&n!==!1&&this.queue(n||"fx",[]),this.each(function(){var s=!0,t=n!=null&&n+"queueHooks",o=i.timers,e=r.get(this);if(t)e[t]&&e[t].stop&&f(e[t]);else for(t in e)e[t]&&e[t].stop&&ue.test(t)&&f(e[t]);for(t=o.length;t--;)o[t].elem===this&&(n==null||o[t].queue===n)&&(o[t].anim.stop(u),s=!1,o.splice(t,1));(s||!u)&&i.dequeue(this,n)})},finish:function(n){return n!==!1&&(n=n||"fx"),this.each(function(){var t,e=r.get(this),u=e[n+"queue"],o=e[n+"queueHooks"],f=i.timers,s=u?u.length:0;for(e.finish=!0,i.queue(this,n,[]),o&&o.stop&&o.stop.call(this,!0),t=f.length;t--;)f[t].elem===this&&f[t].queue===n&&(f[t].anim.stop(!0),f.splice(t,1));for(t=0;t<s;t++)u[t]&&u[t].finish&&u[t].finish.call(this);delete e.finish})}});i.each(["toggle","show","hide"],function(n,t){var r=i.fn[t];i.fn[t]=function(n,i,u){return n==null||typeof n=="boolean"?r.apply(this,arguments):this.animate(bt(t,!0),n,i,u)}});i.each({slideDown:bt("show"),slideUp:bt("hide"),slideToggle:bt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){i.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});i.timers=[];i.fx.tick=function(){var r,n=0,t=i.timers;for(nt=i.now();n<t.length;n++)r=t[n],r()||t[n]!==r||t.splice(n--,1);t.length||i.fx.stop();nt=undefined};i.fx.timer=function(n){i.timers.push(n);n()?i.fx.start():i.timers.pop()};i.fx.interval=13;i.fx.start=function(){pt||(pt=setInterval(i.fx.tick,i.fx.interval))};i.fx.stop=function(){clearInterval(pt);pt=null};i.fx.speeds={slow:600,fast:200,_default:400};i.fn.delay=function(n,t){return n=i.fx?i.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(t,i){var r=setTimeout(t,n);i.stop=function(){clearTimeout(r)}})},function(){var n=u.createElement("input"),t=u.createElement("select"),i=t.appendChild(u.createElement("option"));n.type="checkbox";f.checkOn=n.value!=="";f.optSelected=i.selected;t.disabled=!0;f.optDisabled=!i.disabled;n=u.createElement("input");n.value="t";n.type="radio";f.radioValue=n.value==="t"}();tt=i.expr.attrHandle;i.fn.extend({attr:function(n,t){return l(this,i.attr,n,t,arguments.length>1)},removeAttr:function(n){return this.each(function(){i.removeAttr(this,n)})}});i.extend({attr:function(n,t,r){var u,f,e=n.nodeType;if(n&&e!==3&&e!==8&&e!==2){if(typeof n.getAttribute===d)return i.prop(n,t,r);if(e===1&&i.isXMLDoc(n)||(t=t.toLowerCase(),u=i.attrHooks[t]||(i.expr.match.bool.test(t)?su:oe)),r!==undefined)if(r===null)i.removeAttr(n,t);else return u&&"set"in u&&(f=u.set(n,r,t))!==undefined?f:(n.setAttribute(t,r+""),r);else return u&&"get"in u&&(f=u.get(n,t))!==null?f:(f=i.find.attr(n,t),f==null?undefined:f)}},removeAttr:function(n,t){var r,u,e=0,f=t&&t.match(c);if(f&&n.nodeType===1)while(r=f[e++])u=i.propFix[r]||r,i.expr.match.bool.test(r)&&(n[u]=!1),n.removeAttribute(r)},attrHooks:{type:{set:function(n,t){if(!f.radioValue&&t==="radio"&&i.nodeName(n,"input")){var r=n.value;return n.setAttribute("type",t),r&&(n.value=r),t}}}}});su={set:function(n,t,r){return t===!1?i.removeAttr(n,r):n.setAttribute(r,r),r}};i.each(i.expr.match.bool.source.match(/\w+/g),function(n,t){var r=tt[t]||i.find.attr;tt[t]=function(n,t,i){var u,f;return i||(f=tt[t],tt[t]=u,u=r(n,t,i)!=null?t.toLowerCase():null,tt[t]=f),u}});hu=/^(?:input|select|textarea|button)$/i;i.fn.extend({prop:function(n,t){return l(this,i.prop,n,t,arguments.length>1)},removeProp:function(n){return this.each(function(){delete this[i.propFix[n]||n]})}});i.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(n,t,r){var f,u,o,e=n.nodeType;if(n&&e!==3&&e!==8&&e!==2)return o=e!==1||!i.isXMLDoc(n),o&&(t=i.propFix[t]||t,u=i.propHooks[t]),r!==undefined?u&&"set"in u&&(f=u.set(n,r,t))!==undefined?f:n[t]=r:u&&"get"in u&&(f=u.get(n,t))!==null?f:n[t]},propHooks:{tabIndex:{get:function(n){return n.hasAttribute("tabindex")||hu.test(n.nodeName)||n.href?n.tabIndex:-1}}}});f.optSelected||(i.propHooks.selected={get:function(n){var t=n.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}});i.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){i.propFix[this.toLowerCase()]=this});kt=/[\t\r\n\f]/g;i.fn.extend({addClass:function(n){var o,t,r,u,s,f,h=typeof n=="string"&&n,e=0,l=this.length;if(i.isFunction(n))return this.each(function(t){i(this).addClass(n.call(this,t,this.className))});if(h)for(o=(n||"").match(c)||[];e<l;e++)if(t=this[e],r=t.nodeType===1&&(t.className?(" "+t.className+" ").replace(kt," "):" "),r){for(s=0;u=o[s++];)r.indexOf(" "+u+" ")<0&&(r+=u+" ");f=i.trim(r);t.className!==f&&(t.className=f)}return this},removeClass:function(n){var o,t,r,u,s,f,h=arguments.length===0||typeof n=="string"&&n,e=0,l=this.length;if(i.isFunction(n))return this.each(function(t){i(this).removeClass(n.call(this,t,this.className))});if(h)for(o=(n||"").match(c)||[];e<l;e++)if(t=this[e],r=t.nodeType===1&&(t.className?(" "+t.className+" ").replace(kt," "):""),r){for(s=0;u=o[s++];)while(r.indexOf(" "+u+" ")>=0)r=r.replace(" "+u+" "," ");f=n?i.trim(r):"";t.className!==f&&(t.className=f)}return this},toggleClass:function(n,t){var u=typeof n;return typeof t=="boolean"&&u==="string"?t?this.addClass(n):this.removeClass(n):i.isFunction(n)?this.each(function(r){i(this).toggleClass(n.call(this,r,this.className,t),t)}):this.each(function(){if(u==="string")for(var t,e=0,f=i(this),o=n.match(c)||[];t=o[e++];)f.hasClass(t)?f.removeClass(t):f.addClass(t);else(u===d||u==="boolean")&&(this.className&&r.set(this,"__className__",this.className),this.className=this.className||n===!1?"":r.get(this,"__className__")||"")})},hasClass:function(n){for(var i=" "+n+" ",t=0,r=this.length;t<r;t++)if(this[t].nodeType===1&&(" "+this[t].className+" ").replace(kt," ").indexOf(i)>=0)return!0;return!1}});cu=/\r/g;i.fn.extend({val:function(n){var t,r,f,u=this[0];return arguments.length?(f=i.isFunction(n),this.each(function(r){var u;this.nodeType===1&&(u=f?n.call(this,r,i(this).val()):n,u==null?u="":typeof u=="number"?u+="":i.isArray(u)&&(u=i.map(u,function(n){return n==null?"":n+""})),t=i.valHooks[this.type]||i.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,u,"value")!==undefined||(this.value=u))})):u?(t=i.valHooks[u.type]||i.valHooks[u.nodeName.toLowerCase()],t&&"get"in t&&(r=t.get(u,"value"))!==undefined)?r:(r=u.value,typeof r=="string"?r.replace(cu,""):r==null?"":r):void 0}});i.extend({valHooks:{option:{get:function(n){var t=i.find.attr(n,"value");return t!=null?t:i.trim(i.text(n))}},select:{get:function(n){for(var o,t,s=n.options,r=n.selectedIndex,u=n.type==="select-one"||r<0,h=u?null:[],c=u?r+1:s.length,e=r<0?c:u?r:0;e<c;e++)if(t=s[e],(t.selected||e===r)&&(f.optDisabled?!t.disabled:t.getAttribute("disabled")===null)&&(!t.parentNode.disabled||!i.nodeName(t.parentNode,"optgroup"))){if(o=i(t).val(),u)return o;h.push(o)}return h},set:function(n,t){for(var u,r,f=n.options,e=i.makeArray(t),o=f.length;o--;)r=f[o],(r.selected=i.inArray(r.value,e)>=0)&&(u=!0);return u||(n.selectedIndex=-1),e}}}});i.each(["radio","checkbox"],function(){i.valHooks[this]={set:function(n,t){if(i.isArray(t))return n.checked=i.inArray(i(n).val(),t)>=0}};f.checkOn||(i.valHooks[this].get=function(n){return n.getAttribute("value")===null?"on":n.value})});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(n,t){i.fn[t]=function(n,i){return arguments.length>0?this.on(t,null,n,i):this.trigger(t)}});i.fn.extend({hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)},bind:function(n,t,i){return this.on(n,null,t,i)},unbind:function(n,t){return this.off(n,null,t)},delegate:function(n,t,i,r){return this.on(t,n,i,r)},undelegate:function(n,t,i){return arguments.length===1?this.off(n,"**"):this.off(t,n||"**",i)}});dt=i.now();gt=/\?/;i.parseJSON=function(n){return JSON.parse(n+"")};i.parseXML=function(n){var t,r;if(!n||typeof n!="string")return null;try{r=new DOMParser;t=r.parseFromString(n,"text/xml")}catch(u){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&i.error("Invalid XML: "+n),t};var b,v,se=/#.*$/,lu=/([?&])_=[^&]*/,he=/^(.*?):[ \t]*([^\r\n]*)$/mg,ce=/^(?:GET|HEAD)$/,le=/^\/\//,au=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,vu={},li={},yu="*/".concat("*");try{v=location.href}catch(ge){v=u.createElement("a");v.href="";v=v.href}b=au.exec(v.toLowerCase())||[];i.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:v,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(b[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":yu,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":i.parseJSON,"text xml":i.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(n,t){return t?ai(ai(n,i.ajaxSettings),t):ai(i.ajaxSettings,n)},ajaxPrefilter:pu(vu),ajaxTransport:pu(li),ajax:function(n,t){function w(n,t,h,c){var v,it,b,y,w,l=t;e!==2&&(e=2,d&&clearTimeout(d),s=undefined,k=c||"",u.readyState=n>0?4:0,v=n>=200&&n<300||n===304,h&&(y=ae(r,u,h)),y=ve(r,y,u,v),v?(r.ifModified&&(w=u.getResponseHeader("Last-Modified"),w&&(i.lastModified[f]=w),w=u.getResponseHeader("etag"),w&&(i.etag[f]=w)),n===204||r.type==="HEAD"?l="nocontent":n===304?l="notmodified":(l=y.state,it=y.data,b=y.error,v=!b)):(b=l,(n||!l)&&(l="error",n<0&&(n=0))),u.status=n,u.statusText=(t||l)+"",v?nt.resolveWith(o,[it,l,u]):nt.rejectWith(o,[u,l,b]),u.statusCode(p),p=undefined,a&&g.trigger(v?"ajaxSuccess":"ajaxError",[u,r,v?it:b]),tt.fireWith(o,[u,l]),a&&(g.trigger("ajaxComplete",[u,r]),--i.active||i.event.trigger("ajaxStop")))}typeof n=="object"&&(t=n,n=undefined);t=t||{};var s,f,k,y,d,h,a,l,r=i.ajaxSetup({},t),o=r.context||r,g=r.context&&(o.nodeType||o.jquery)?i(o):i.event,nt=i.Deferred(),tt=i.Callbacks("once memory"),p=r.statusCode||{},it={},rt={},e=0,ut="canceled",u={readyState:0,getResponseHeader:function(n){var t;if(e===2){if(!y)for(y={};t=he.exec(k);)y[t[1].toLowerCase()]=t[2];t=y[n.toLowerCase()]}return t==null?null:t},getAllResponseHeaders:function(){return e===2?k:null},setRequestHeader:function(n,t){var i=n.toLowerCase();return e||(n=rt[i]=rt[i]||n,it[n]=t),this},overrideMimeType:function(n){return e||(r.mimeType=n),this},statusCode:function(n){var t;if(n)if(e<2)for(t in n)p[t]=[p[t],n[t]];else u.always(n[u.status]);return this},abort:function(n){var t=n||ut;return s&&s.abort(t),w(0,t),this}};if(nt.promise(u).complete=tt.add,u.success=u.done,u.error=u.fail,r.url=((n||r.url||v)+"").replace(se,"").replace(le,b[1]+"//"),r.type=t.method||t.type||r.method||r.type,r.dataTypes=i.trim(r.dataType||"*").toLowerCase().match(c)||[""],r.crossDomain==null&&(h=au.exec(r.url.toLowerCase()),r.crossDomain=!!(h&&(h[1]!==b[1]||h[2]!==b[2]||(h[3]||(h[1]==="http:"?"80":"443"))!==(b[3]||(b[1]==="http:"?"80":"443"))))),r.data&&r.processData&&typeof r.data!="string"&&(r.data=i.param(r.data,r.traditional)),wu(vu,r,t,u),e===2)return u;a=r.global;a&&i.active++==0&&i.event.trigger("ajaxStart");r.type=r.type.toUpperCase();r.hasContent=!ce.test(r.type);f=r.url;r.hasContent||(r.data&&(f=r.url+=(gt.test(f)?"&":"?")+r.data,delete r.data),r.cache===!1&&(r.url=lu.test(f)?f.replace(lu,"$1_="+dt++):f+(gt.test(f)?"&":"?")+"_="+dt++));r.ifModified&&(i.lastModified[f]&&u.setRequestHeader("If-Modified-Since",i.lastModified[f]),i.etag[f]&&u.setRequestHeader("If-None-Match",i.etag[f]));(r.data&&r.hasContent&&r.contentType!==!1||t.contentType)&&u.setRequestHeader("Content-Type",r.contentType);u.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+(r.dataTypes[0]!=="*"?", "+yu+"; q=0.01":""):r.accepts["*"]);for(l in r.headers)u.setRequestHeader(l,r.headers[l]);if(r.beforeSend&&(r.beforeSend.call(o,u,r)===!1||e===2))return u.abort();ut="abort";for(l in{success:1,error:1,complete:1})u[l](r[l]);if(s=wu(li,r,t,u),s){u.readyState=1;a&&g.trigger("ajaxSend",[u,r]);r.async&&r.timeout>0&&(d=setTimeout(function(){u.abort("timeout")},r.timeout));try{e=1;s.send(it,w)}catch(ft){if(e<2)w(-1,ft);else throw ft;}}else w(-1,"No Transport");return u},getJSON:function(n,t,r){return i.get(n,t,r,"json")},getScript:function(n,t){return i.get(n,undefined,t,"script")}});i.each(["get","post"],function(n,t){i[t]=function(n,r,u,f){return i.isFunction(r)&&(f=f||u,u=r,r=undefined),i.ajax({url:n,type:t,dataType:f,data:r,success:u})}});i.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){i.fn[t]=function(n){return this.on(t,n)}});i._evalUrl=function(n){return i.ajax({url:n,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})};i.fn.extend({wrapAll:function(n){var t;return i.isFunction(n)?this.each(function(t){i(this).wrapAll(n.call(this,t))}):(this[0]&&(t=i(n,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var n=this;n.firstElementChild;)n=n.firstElementChild;return n}).append(this)),this)},wrapInner:function(n){return i.isFunction(n)?this.each(function(t){i(this).wrapInner(n.call(this,t))}):this.each(function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()}});i.expr.filters.hidden=function(n){return n.offsetWidth<=0&&n.offsetHeight<=0};i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)};var ye=/%20/g,pe=/\[\]$/,bu=/\r?\n/g,we=/^(?:submit|button|image|reset|file)$/i,be=/^(?:input|select|textarea|keygen)/i;i.param=function(n,t){var r,u=[],f=function(n,t){t=i.isFunction(t)?t():t==null?"":t;u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)};if(t===undefined&&(t=i.ajaxSettings&&i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){f(this.name,this.value)});else for(r in n)vi(r,n[r],t,f);return u.join("&").replace(ye,"+")};i.fn.extend({serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var n=i.prop(this,"elements");return n?i.makeArray(n):this}).filter(function(){var n=this.type;return this.name&&!i(this).is(":disabled")&&be.test(this.nodeName)&&!we.test(n)&&(this.checked||!er.test(n))}).map(function(n,t){var r=i(this).val();return r==null?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(bu,"\r\n")}}):{name:t.name,value:r.replace(bu,"\r\n")}}).get()}});i.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(n){}};var ke=0,ni={},de={0:200,1223:204},ft=i.ajaxSettings.xhr();if(n.ActiveXObject)i(n).on("unload",function(){for(var n in ni)ni[n]()});return f.cors=!!ft&&"withCredentials"in ft,f.ajax=ft=!!ft,i.ajaxTransport(function(n){var t;if(f.cors||ft&&!n.crossDomain)return{send:function(i,r){var f,u=n.xhr(),e=++ke;if(u.open(n.type,n.url,n.async,n.username,n.password),n.xhrFields)for(f in n.xhrFields)u[f]=n.xhrFields[f];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType);n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(f in i)u.setRequestHeader(f,i[f]);t=function(n){return function(){t&&(delete ni[e],t=u.onload=u.onerror=null,n==="abort"?u.abort():n==="error"?r(u.status,u.statusText):r(de[u.status]||u.status,u.statusText,typeof u.responseText=="string"?{text:u.responseText}:undefined,u.getAllResponseHeaders()))}};u.onload=t();u.onerror=t("error");t=ni[e]=t("abort");try{u.send(n.hasContent&&n.data||null)}catch(o){if(t)throw o;}},abort:function(){t&&t()}}}),i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(n){return i.globalEval(n),n}}}),i.ajaxPrefilter("script",function(n){n.cache===undefined&&(n.cache=!1);n.crossDomain&&(n.type="GET")}),i.ajaxTransport("script",function(n){if(n.crossDomain){var r,t;return{send:function(f,e){r=i("<script>").prop({async:!0,charset:n.scriptCharset,src:n.url}).on("load error",t=function(n){r.remove();t=null;n&&e(n.type==="error"?404:200,n.type)});u.head.appendChild(r[0])},abort:function(){t&&t()}}}}),yi=[],ti=/(=)\?(?=&|$)|\?\?/,i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=yi.pop()||i.expando+"_"+dt++;return this[n]=!0,n}}),i.ajaxPrefilter("json jsonp",function(t,r,u){var f,o,e,s=t.jsonp!==!1&&(ti.test(t.url)?"url":typeof t.data=="string"&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ti.test(t.data)&&"data");if(s||t.dataTypes[0]==="jsonp")return f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(ti,"$1"+f):t.jsonp!==!1&&(t.url+=(gt.test(t.url)?"&":"?")+t.jsonp+"="+f),t.converters["script json"]=function(){return e||i.error(f+" was not called"),e[0]},t.dataTypes[0]="json",o=n[f],n[f]=function(){e=arguments},u.always(function(){n[f]=o;t[f]&&(t.jsonpCallback=r.jsonpCallback,yi.push(f));e&&i.isFunction(o)&&o(e[0]);e=o=undefined}),"script"}),i.parseHTML=function(n,t,r){if(!n||typeof n!="string")return null;typeof t=="boolean"&&(r=t,t=!1);t=t||u;var f=gi.exec(n),e=!r&&[];return f?[t.createElement(f[1])]:(f=i.buildFragment([n],t,e),e&&e.length&&i(e).remove(),i.merge([],f.childNodes))},pi=i.fn.load,i.fn.load=function(n,t,r){if(typeof n!="string"&&pi)return pi.apply(this,arguments);var u,o,s,f=this,e=n.indexOf(" ");return e>=0&&(u=i.trim(n.slice(e)),n=n.slice(0,e)),i.isFunction(t)?(r=t,t=undefined):t&&typeof t=="object"&&(o="POST"),f.length>0&&i.ajax({url:n,type:o,dataType:"html",data:t}).done(function(n){s=arguments;f.html(u?i("<div>").append(i.parseHTML(n)).find(u):n)}).complete(r&&function(n,t){f.each(r,s||[n.responseText,t,n])}),this},i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length},wi=n.document.documentElement,i.offset={setOffset:function(n,t,r){var e,o,s,h,u,c,v,l=i.css(n,"position"),a=i(n),f={};l==="static"&&(n.style.position="relative");u=a.offset();s=i.css(n,"top");c=i.css(n,"left");v=(l==="absolute"||l==="fixed")&&(s+c).indexOf("auto")>-1;v?(e=a.position(),h=e.top,o=e.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);i.isFunction(t)&&(t=t.call(n,r,u));t.top!=null&&(f.top=t.top-u.top+h);t.left!=null&&(f.left=t.left-u.left+o);"using"in t?t.using.call(n,f):a.css(f)}},i.fn.extend({offset:function(n){if(arguments.length)return n===undefined?this:this.each(function(t){i.offset.setOffset(this,n,t)});var r,f,t=this[0],u={top:0,left:0},e=t&&t.ownerDocument;if(e)return(r=e.documentElement,!i.contains(r,t))?u:(typeof t.getBoundingClientRect!==d&&(u=t.getBoundingClientRect()),f=ku(e),{top:u.top+f.pageYOffset-r.clientTop,left:u.left+f.pageXOffset-r.clientLeft})},position:function(){if(this[0]){var n,r,u=this[0],t={top:0,left:0};return i.css(u,"position")==="fixed"?r=u.getBoundingClientRect():(n=this.offsetParent(),r=this.offset(),i.nodeName(n[0],"html")||(t=n.offset()),t.top+=i.css(n[0],"borderTopWidth",!0),t.left+=i.css(n[0],"borderLeftWidth",!0)),{top:r.top-t.top-i.css(u,"marginTop",!0),left:r.left-t.left-i.css(u,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||wi;n&&!i.nodeName(n,"html")&&i.css(n,"position")==="static";)n=n.offsetParent;return n||wi})}}),i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,r){var u="pageYOffset"===r;i.fn[t]=function(i){return l(this,function(t,i,f){var e=ku(t);if(f===undefined)return e?e[r]:t[i];e?e.scrollTo(u?n.pageXOffset:f,u?f:n.pageYOffset):t[i]=f},t,i,arguments.length,null)}}),i.each(["top","left"],function(n,t){i.cssHooks[t]=br(f.pixelPosition,function(n,r){if(r)return r=rt(n,t),ci.test(r)?i(n).position()[t]+"px":r})}),i.each({Height:"height",Width:"width"},function(n,t){i.each({padding:"inner"+n,content:t,"":"outer"+n},function(r,u){i.fn[u]=function(u,f){var e=arguments.length&&(r||typeof u!="boolean"),o=r||(u===!0||f===!0?"margin":"border");return l(this,function(t,r,u){var f;return i.isWindow(t)?t.document.documentElement["client"+n]:t.nodeType===9?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):u===undefined?i.css(t,r,o):i.style(t,r,u,o)},t,e?u:undefined,e,null)}})}),i.fn.size=function(){return this.length},i.fn.andSelf=i.fn.addBack,typeof define=="function"&&define.amd&&define("jquery",[],function(){return i}),du=n.jQuery,gu=n.$,i.noConflict=function(t){return n.$===i&&(n.$=gu),t&&n.jQuery===i&&(n.jQuery=du),i},typeof t===d&&(n.jQuery=n.$=i),i});
//# sourceMappingURL=jquery-2.1.1.min.js.map
;
/*! jQuery Validation Plugin - v1.13.0 - 7/1/2014
 * http://jqueryvalidation.org/
 * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){a.extend(a.fn,{validate:function(b){if(!this.length)return void(b&&b.debug&&window.console&&console.warn("Nothing selected, can't validate, returning nothing."));var c=a.data(this[0],"validator");return c?c:(this.attr("novalidate","novalidate"),c=new a.validator(b,this[0]),a.data(this[0],"validator",c),c.settings.onsubmit&&(this.validateDelegate(":submit","click",function(b){c.settings.submitHandler&&(c.submitButton=b.target),a(b.target).hasClass("cancel")&&(c.cancelSubmit=!0),void 0!==a(b.target).attr("formnovalidate")&&(c.cancelSubmit=!0)}),this.submit(function(b){function d(){var d;return c.settings.submitHandler?(c.submitButton&&(d=a("<input type='hidden'/>").attr("name",c.submitButton.name).val(a(c.submitButton).val()).appendTo(c.currentForm)),c.settings.submitHandler.call(c,c.currentForm,b),c.submitButton&&d.remove(),!1):!0}return c.settings.debug&&b.preventDefault(),c.cancelSubmit?(c.cancelSubmit=!1,d()):c.form()?c.pendingRequest?(c.formSubmitted=!0,!1):d():(c.focusInvalid(),!1)})),c)},valid:function(){var b,c;return a(this[0]).is("form")?b=this.validate().form():(b=!0,c=a(this[0].form).validate(),this.each(function(){b=c.element(this)&&b})),b},removeAttrs:function(b){var c={},d=this;return a.each(b.split(/\s/),function(a,b){c[b]=d.attr(b),d.removeAttr(b)}),c},rules:function(b,c){var d,e,f,g,h,i,j=this[0];if(b)switch(d=a.data(j.form,"validator").settings,e=d.rules,f=a.validator.staticRules(j),b){case"add":a.extend(f,a.validator.normalizeRule(c)),delete f.messages,e[j.name]=f,c.messages&&(d.messages[j.name]=a.extend(d.messages[j.name],c.messages));break;case"remove":return c?(i={},a.each(c.split(/\s/),function(b,c){i[c]=f[c],delete f[c],"required"===c&&a(j).removeAttr("aria-required")}),i):(delete e[j.name],f)}return g=a.validator.normalizeRules(a.extend({},a.validator.classRules(j),a.validator.attributeRules(j),a.validator.dataRules(j),a.validator.staticRules(j)),j),g.required&&(h=g.required,delete g.required,g=a.extend({required:h},g),a(j).attr("aria-required","true")),g.remote&&(h=g.remote,delete g.remote,g=a.extend(g,{remote:h})),g}}),a.extend(a.expr[":"],{blank:function(b){return!a.trim(""+a(b).val())},filled:function(b){return!!a.trim(""+a(b).val())},unchecked:function(b){return!a(b).prop("checked")}}),a.validator=function(b,c){this.settings=a.extend(!0,{},a.validator.defaults,b),this.currentForm=c,this.init()},a.validator.format=function(b,c){return 1===arguments.length?function(){var c=a.makeArray(arguments);return c.unshift(b),a.validator.format.apply(this,c)}:(arguments.length>2&&c.constructor!==Array&&(c=a.makeArray(arguments).slice(1)),c.constructor!==Array&&(c=[c]),a.each(c,function(a,c){b=b.replace(new RegExp("\\{"+a+"\\}","g"),function(){return c})}),b)},a.extend(a.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:a([]),errorLabelContainer:a([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(a){this.lastActive=a,this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,a,this.settings.errorClass,this.settings.validClass),this.hideThese(this.errorsFor(a)))},onfocusout:function(a){this.checkable(a)||!(a.name in this.submitted)&&this.optional(a)||this.element(a)},onkeyup:function(a,b){(9!==b.which||""!==this.elementValue(a))&&(a.name in this.submitted||a===this.lastElement)&&this.element(a)},onclick:function(a){a.name in this.submitted?this.element(a):a.parentNode.name in this.submitted&&this.element(a.parentNode)},highlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).addClass(c).removeClass(d):a(b).addClass(c).removeClass(d)},unhighlight:function(b,c,d){"radio"===b.type?this.findByName(b.name).removeClass(c).addClass(d):a(b).removeClass(c).addClass(d)}},setDefaults:function(b){a.extend(a.validator.defaults,b)},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:a.validator.format("Please enter no more than {0} characters."),minlength:a.validator.format("Please enter at least {0} characters."),rangelength:a.validator.format("Please enter a value between {0} and {1} characters long."),range:a.validator.format("Please enter a value between {0} and {1}."),max:a.validator.format("Please enter a value less than or equal to {0}."),min:a.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function b(b){var c=a.data(this[0].form,"validator"),d="on"+b.type.replace(/^validate/,""),e=c.settings;e[d]&&!this.is(e.ignore)&&e[d].call(c,this[0],b)}this.labelContainer=a(this.settings.errorLabelContainer),this.errorContext=this.labelContainer.length&&this.labelContainer||a(this.currentForm),this.containers=a(this.settings.errorContainer).add(this.settings.errorLabelContainer),this.submitted={},this.valueCache={},this.pendingRequest=0,this.pending={},this.invalid={},this.reset();var c,d=this.groups={};a.each(this.settings.groups,function(b,c){"string"==typeof c&&(c=c.split(/\s/)),a.each(c,function(a,c){d[c]=b})}),c=this.settings.rules,a.each(c,function(b,d){c[b]=a.validator.normalizeRule(d)}),a(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'], [type='radio'], [type='checkbox']","focusin focusout keyup",b).validateDelegate("select, option, [type='radio'], [type='checkbox']","click",b),this.settings.invalidHandler&&a(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler),a(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required","true")},form:function(){return this.checkForm(),a.extend(this.submitted,this.errorMap),this.invalid=a.extend({},this.errorMap),this.valid()||a(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var a=0,b=this.currentElements=this.elements();b[a];a++)this.check(b[a]);return this.valid()},element:function(b){var c=this.clean(b),d=this.validationTargetFor(c),e=!0;return this.lastElement=d,void 0===d?delete this.invalid[c.name]:(this.prepareElement(d),this.currentElements=a(d),e=this.check(d)!==!1,e?delete this.invalid[d.name]:this.invalid[d.name]=!0),a(b).attr("aria-invalid",!e),this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),e},showErrors:function(b){if(b){a.extend(this.errorMap,b),this.errorList=[];for(var c in b)this.errorList.push({message:b[c],element:this.findByName(c)[0]});this.successList=a.grep(this.successList,function(a){return!(a.name in b)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){a.fn.resetForm&&a(this.currentForm).resetForm(),this.submitted={},this.lastElement=null,this.prepareForm(),this.hideErrors(),this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(a){var b,c=0;for(b in a)c++;return c},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(a){a.not(this.containers).text(""),this.addWrapper(a).hide()},valid:function(){return 0===this.size()},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{a(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(b){}},findLastActive:function(){var b=this.lastActive;return b&&1===a.grep(this.errorList,function(a){return a.element.name===b.name}).length&&b},elements:function(){var b=this,c={};return a(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&b.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in c||!b.objectLength(a(this).rules())?!1:(c[this.name]=!0,!0)})},clean:function(b){return a(b)[0]},errors:function(){var b=this.settings.errorClass.split(" ").join(".");return a(this.settings.errorElement+"."+b,this.errorContext)},reset:function(){this.successList=[],this.errorList=[],this.errorMap={},this.toShow=a([]),this.toHide=a([]),this.currentElements=a([])},prepareForm:function(){this.reset(),this.toHide=this.errors().add(this.containers)},prepareElement:function(a){this.reset(),this.toHide=this.errorsFor(a)},elementValue:function(b){var c,d=a(b),e=b.type;return"radio"===e||"checkbox"===e?a("input[name='"+b.name+"']:checked").val():"number"===e&&"undefined"!=typeof b.validity?b.validity.badInput?!1:d.val():(c=d.val(),"string"==typeof c?c.replace(/\r/g,""):c)},check:function(b){b=this.validationTargetFor(this.clean(b));var c,d,e,f=a(b).rules(),g=a.map(f,function(a,b){return b}).length,h=!1,i=this.elementValue(b);for(d in f){e={method:d,parameters:f[d]};try{if(c=a.validator.methods[d].call(this,i,b,e.parameters),"dependency-mismatch"===c&&1===g){h=!0;continue}if(h=!1,"pending"===c)return void(this.toHide=this.toHide.not(this.errorsFor(b)));if(!c)return this.formatAndAdd(b,e),!1}catch(j){throw this.settings.debug&&window.console&&console.log("Exception occurred when checking element "+b.id+", check the '"+e.method+"' method.",j),j}}if(!h)return this.objectLength(f)&&this.successList.push(b),!0},customDataMessage:function(b,c){return a(b).data("msg"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase())||a(b).data("msg")},customMessage:function(a,b){var c=this.settings.messages[a];return c&&(c.constructor===String?c:c[b])},findDefined:function(){for(var a=0;a<arguments.length;a++)if(void 0!==arguments[a])return arguments[a];return void 0},defaultMessage:function(b,c){return this.findDefined(this.customMessage(b.name,c),this.customDataMessage(b,c),!this.settings.ignoreTitle&&b.title||void 0,a.validator.messages[c],"<strong>Warning: No message defined for "+b.name+"</strong>")},formatAndAdd:function(b,c){var d=this.defaultMessage(b,c.method),e=/\$?\{(\d+)\}/g;"function"==typeof d?d=d.call(this,c.parameters,b):e.test(d)&&(d=a.validator.format(d.replace(e,"{$1}"),c.parameters)),this.errorList.push({message:d,element:b,method:c.method}),this.errorMap[b.name]=d,this.submitted[b.name]=d},addWrapper:function(a){return this.settings.wrapper&&(a=a.add(a.parent(this.settings.wrapper))),a},defaultShowErrors:function(){var a,b,c;for(a=0;this.errorList[a];a++)c=this.errorList[a],this.settings.highlight&&this.settings.highlight.call(this,c.element,this.settings.errorClass,this.settings.validClass),this.showLabel(c.element,c.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(a=0;this.successList[a];a++)this.showLabel(this.successList[a]);if(this.settings.unhighlight)for(a=0,b=this.validElements();b[a];a++)this.settings.unhighlight.call(this,b[a],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 a(this.errorList).map(function(){return this.element})},showLabel:function(b,c){var d,e,f,g=this.errorsFor(b),h=this.idOrName(b),i=a(b).attr("aria-describedby");g.length?(g.removeClass(this.settings.validClass).addClass(this.settings.errorClass),g.html(c)):(g=a("<"+this.settings.errorElement+">").attr("id",h+"-error").addClass(this.settings.errorClass).html(c||""),d=g,this.settings.wrapper&&(d=g.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.length?this.labelContainer.append(d):this.settings.errorPlacement?this.settings.errorPlacement(d,a(b)):d.insertAfter(b),g.is("label")?g.attr("for",h):0===g.parents("label[for='"+h+"']").length&&(f=g.attr("id"),i?i.match(new RegExp("\b"+f+"\b"))||(i+=" "+f):i=f,a(b).attr("aria-describedby",i),e=this.groups[b.name],e&&a.each(this.groups,function(b,c){c===e&&a("[name='"+b+"']",this.currentForm).attr("aria-describedby",g.attr("id"))}))),!c&&this.settings.success&&(g.text(""),"string"==typeof this.settings.success?g.addClass(this.settings.success):this.settings.success(g,b)),this.toShow=this.toShow.add(g)},errorsFor:function(b){var c=this.idOrName(b),d=a(b).attr("aria-describedby"),e="label[for='"+c+"'], label[for='"+c+"'] *";return d&&(e=e+", #"+d.replace(/\s+/g,", #")),this.errors().filter(e)},idOrName:function(a){return this.groups[a.name]||(this.checkable(a)?a.name:a.id||a.name)},validationTargetFor:function(a){return this.checkable(a)&&(a=this.findByName(a.name).not(this.settings.ignore)[0]),a},checkable:function(a){return/radio|checkbox/i.test(a.type)},findByName:function(b){return a(this.currentForm).find("[name='"+b+"']")},getLength:function(b,c){switch(c.nodeName.toLowerCase()){case"select":return a("option:selected",c).length;case"input":if(this.checkable(c))return this.findByName(c.name).filter(":checked").length}return b.length},depend:function(a,b){return this.dependTypes[typeof a]?this.dependTypes[typeof a](a,b):!0},dependTypes:{"boolean":function(a){return a},string:function(b,c){return!!a(b,c.form).length},"function":function(a,b){return a(b)}},optional:function(b){var c=this.elementValue(b);return!a.validator.methods.required.call(this,c,b)&&"dependency-mismatch"},startRequest:function(a){this.pending[a.name]||(this.pendingRequest++,this.pending[a.name]=!0)},stopRequest:function(b,c){this.pendingRequest--,this.pendingRequest<0&&(this.pendingRequest=0),delete this.pending[b.name],c&&0===this.pendingRequest&&this.formSubmitted&&this.form()?(a(this.currentForm).submit(),this.formSubmitted=!1):!c&&0===this.pendingRequest&&this.formSubmitted&&(a(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(b){return a.data(b,"previousValue")||a.data(b,"previousValue",{old:null,valid:!0,message:this.defaultMessage(b,"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(b,c){b.constructor===String?this.classRuleSettings[b]=c:a.extend(this.classRuleSettings,b)},classRules:function(b){var c={},d=a(b).attr("class");return d&&a.each(d.split(" "),function(){this in a.validator.classRuleSettings&&a.extend(c,a.validator.classRuleSettings[this])}),c},attributeRules:function(b){var c,d,e={},f=a(b),g=b.getAttribute("type");for(c in a.validator.methods)"required"===c?(d=b.getAttribute(c),""===d&&(d=!0),d=!!d):d=f.attr(c),/min|max/.test(c)&&(null===g||/number|range|text/.test(g))&&(d=Number(d)),d||0===d?e[c]=d:g===c&&"range"!==g&&(e[c]=!0);return e.maxlength&&/-1|2147483647|524288/.test(e.maxlength)&&delete e.maxlength,e},dataRules:function(b){var c,d,e={},f=a(b);for(c in a.validator.methods)d=f.data("rule"+c.charAt(0).toUpperCase()+c.substring(1).toLowerCase()),void 0!==d&&(e[c]=d);return e},staticRules:function(b){var c={},d=a.data(b.form,"validator");return d.settings.rules&&(c=a.validator.normalizeRule(d.settings.rules[b.name])||{}),c},normalizeRules:function(b,c){return a.each(b,function(d,e){if(e===!1)return void delete b[d];if(e.param||e.depends){var f=!0;switch(typeof e.depends){case"string":f=!!a(e.depends,c.form).length;break;case"function":f=e.depends.call(c,c)}f?b[d]=void 0!==e.param?e.param:!0:delete b[d]}}),a.each(b,function(d,e){b[d]=a.isFunction(e)?e(c):e}),a.each(["minlength","maxlength"],function(){b[this]&&(b[this]=Number(b[this]))}),a.each(["rangelength","range"],function(){var c;b[this]&&(a.isArray(b[this])?b[this]=[Number(b[this][0]),Number(b[this][1])]:"string"==typeof b[this]&&(c=b[this].replace(/[\[\]]/g,"").split(/[\s,]+/),b[this]=[Number(c[0]),Number(c[1])]))}),a.validator.autoCreateRanges&&(b.min&&b.max&&(b.range=[b.min,b.max],delete b.min,delete b.max),b.minlength&&b.maxlength&&(b.rangelength=[b.minlength,b.maxlength],delete b.minlength,delete b.maxlength)),b},normalizeRule:function(b){if("string"==typeof b){var c={};a.each(b.split(/\s/),function(){c[this]=!0}),b=c}return b},addMethod:function(b,c,d){a.validator.methods[b]=c,a.validator.messages[b]=void 0!==d?d:a.validator.messages[b],c.length<3&&a.validator.addClassRules(b,a.validator.normalizeRule(b))},methods:{required:function(b,c,d){if(!this.depend(d,c))return"dependency-mismatch";if("select"===c.nodeName.toLowerCase()){var e=a(c).val();return e&&e.length>0}return this.checkable(c)?this.getLength(b,c)>0:a.trim(b).length>0},email:function(a,b){return this.optional(b)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(a)},url:function(a,b){return this.optional(b)||/^(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(a)},date:function(a,b){return this.optional(b)||!/Invalid|NaN/.test(new Date(a).toString())},dateISO:function(a,b){return this.optional(b)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(a)},number:function(a,b){return this.optional(b)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(a)},digits:function(a,b){return this.optional(b)||/^\d+$/.test(a)},creditcard:function(a,b){if(this.optional(b))return"dependency-mismatch";if(/[^0-9 \-]+/.test(a))return!1;var c,d,e=0,f=0,g=!1;if(a=a.replace(/\D/g,""),a.length<13||a.length>19)return!1;for(c=a.length-1;c>=0;c--)d=a.charAt(c),f=parseInt(d,10),g&&(f*=2)>9&&(f-=9),e+=f,g=!g;return e%10===0},minlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d},maxlength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||d>=e},rangelength:function(b,c,d){var e=a.isArray(b)?b.length:this.getLength(a.trim(b),c);return this.optional(c)||e>=d[0]&&e<=d[1]},min:function(a,b,c){return this.optional(b)||a>=c},max:function(a,b,c){return this.optional(b)||c>=a},range:function(a,b,c){return this.optional(b)||a>=c[0]&&a<=c[1]},equalTo:function(b,c,d){var e=a(d);return this.settings.onfocusout&&e.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){a(c).valid()}),b===e.val()},remote:function(b,c,d){if(this.optional(c))return"dependency-mismatch";var e,f,g=this.previousValue(c);return this.settings.messages[c.name]||(this.settings.messages[c.name]={}),g.originalMessage=this.settings.messages[c.name].remote,this.settings.messages[c.name].remote=g.message,d="string"==typeof d&&{url:d}||d,g.old===b?g.valid:(g.old=b,e=this,this.startRequest(c),f={},f[c.name]=b,a.ajax(a.extend(!0,{url:d,mode:"abort",port:"validate"+c.name,dataType:"json",data:f,context:e.currentForm,success:function(d){var f,h,i,j=d===!0||"true"===d;e.settings.messages[c.name].remote=g.originalMessage,j?(i=e.formSubmitted,e.prepareElement(c),e.formSubmitted=i,e.successList.push(c),delete e.invalid[c.name],e.showErrors()):(f={},h=d||e.defaultMessage(c,"remote"),f[c.name]=g.message=a.isFunction(h)?h(b):h,e.invalid[c.name]=!0,e.showErrors(f)),g.valid=j,e.stopRequest(c,j)}},d)),"pending")}}}),a.format=function(){throw"$.format has been deprecated. Please use $.validator.format instead."};var b,c={};a.ajaxPrefilter?a.ajaxPrefilter(function(a,b,d){var e=a.port;"abort"===a.mode&&(c[e]&&c[e].abort(),c[e]=d)}):(b=a.ajax,a.ajax=function(d){var e=("mode"in d?d:a.ajaxSettings).mode,f=("port"in d?d:a.ajaxSettings).port;return"abort"===e?(c[f]&&c[f].abort(),c[f]=b.apply(this,arguments),c[f]):b.apply(this,arguments)}),a.extend(a.fn,{validateDelegate:function(b,c,d){return this.bind(c,function(c){var e=a(c.target);return e.is(b)?d.apply(e,arguments):void 0})}})});;
var ozdisanLocalization = (function () {

    return {
        general: {
            adblockTitle: {
                'en-US': 'AdBlock',
                'tr-TR': 'AdBlock'
            },
            adblockMsg: {
                'en-US': 'Your have an AdBlock. Please turn off before payment',
                'tr-TR': 'Sisteminizde AdBlock tarzı bir uygulama bulunduğu için işleminize devam edemiyoruz. Lütfen AdBlok unuzu kapatın!'
            },
            noInstallment: {
                'en-US': 'No Installment',
                'tr-TR': 'Tek Çekim'
            },
            installment: {
                'en-US': 'Installment',
                'tr-TR': 'Taksit'
            },     
            myBasket: {
                'en-US': 'My Basket',
                'tr-TR': 'Sepetim'
            },
            delivery: {
                'en-US': 'Delivery',
                'tr-TR': 'Teslimat'
            },
            payment: {
                'en-US': 'Payment',
                'tr-TR': 'Ödeme'
            },
            onlinePayment: {
                'en-US': 'Online Payment',
                'tr-TR': 'Online Ödeme'
            },
            installmentSelection: {
                'en-US': 'Installments',
                'tr-TR': 'Taksit Seçenekleri'
            },
            convertToOrder: {
                "en-US": 'Place Order',
                'tr-TR': 'Siparişe Dönüştür'
            },
            completeOrder: {
                "en-US": 'Complete Order',
                'tr-TR': 'Siparişi Tamamla'
            },
            prevStep: {
                "en-US": "Previous Step",
                "tr-TR": "Önceki Adım"
            },
            continue: {
                "en-US": "Continue",
                "tr-TR": "Devam Et"
            },
            emptyBasket: {
                "en-US": "Empty Basket",
                "tr-TR": "Sepeti Boşalt"
            },
            update: {
                "en-US": "Update",
                "tr-TR": "Güncelle"
            },
            doPressPatmentButtonMessage: {
                "en-US": "Please press Complete Order button",
                "tr-TR": "Lütfen siparişi tamamlaya basınız"
            },
            buttonEmptyBasketDescription: {
                "en-US": "This button is clear all basket items",
                "tr-TR": "Sepetteki Tüm Kalemleri Siler"
            },
            basketPayMessage: {
                'en-US': 'Process is Running....',
                'tr-TR': 'işlemleriniz yapılıyor, lütfen bekleyiniz...'
            },
            basketPayError:
            {
                'en-US': 'System error occurred while creating your order!',
                'tr-TR': 'Sipariş oluşturma esnasında sistem hatası oluştu!'
            },
            basketUpdate:
                {
                    'en-US': 'Product has been updated.',
                    'tr-TR': 'Ürün güncellenmiştir.'
                },
            basketUpdateError:
                {
                    'en-US': 'Cart product update system error has occurred',
                    'tr-TR': 'Sepet ürün güncelleme sistem hatası oluştu'
                },
            basketProductRemoveError:
                {
                    'en-US': 'An error occurred during deleting items from the cart',
                    'tr-TR': 'Sepetten ürün silme sırasında hata'
                },
            basketProductRemoveSystemError:
                {
                    'en-US': 'Systematic error during delete items from the cart',
                    'tr-TR': 'Sepetten ürün silme sırasında sistemsel hata'
                },
            basketMoqMessage:
                {
                    'en-US': 'The product does not meet the MOQ field.',
                    'tr-TR': 'Ürün MOQ alanını karşılamamaktadır.'
                },
            basketError:
                {
                    'en-US': 'An error has occurred',
                    'tr-TR': 'Bir hata meydana geldi'
                },
            TarihAraligi:
                {
                    'en-US': 'Date Range',
                    'tr-TR': 'Tarih Aralığı'
                },
            BaslangicTarihi:
                {
                    'en-US': 'Start Date',
                    'tr-TR': 'Başlangıç Tarihi'
                },
            BitisTarihi:
                {
                    'en-US': 'End Date',
                    'tr-TR': 'Bitiş Tarihi'
                },
            Gun:
                {
                    'en-US': 'Day',
                    'tr-TR': 'Gün'
                },
            Listele:
                {
                    'en-US': 'Lists',
                    'tr-TR': 'Listele'
                },
            HesapEkstresi:
                {
                    'en-US': 'Account Statement',
                    'tr-TR': 'Hesap Ekstresi'
                },
            Tamam: {
                'en-US': 'Okey',
                'tr-TR': 'Tamam'
            },
            Iptal: {
                'en-US': 'Cancel',
                'tr-TR': 'Iptal'
            },
            GirisKontrol: {
                'en-US': 'Lüften bekleyiniz. Bilgileriniz kontrol ediliyor... / Please wait, your log in information is checking',
                'tr-TR': 'Lüften bekleyiniz. Bilgileriniz kontrol ediliyor...'
            },
            MoqAlanKontrol: {
                'en-US': "You must enter a quantity ",
                'tr-TR': "Ürün Min. Sipariş Adedi:"
            },
            BasketCShtmlPleaseSelectAddress: {
                'en-US': "Please select address",
                'tr-TR': "Lütfen adres seçiniz"
            },
            BasketCShtmlPleaseAcceptContracts: {
                'en-US': "Please accept contracts",
                'tr-TR': "Lütfen Sözleşmeleri Kabul Ediniz."
            },
            OrderCreateConfirmDescription: {
                'en-US': "Your order will be recorded. Do you confirm ?",
                'tr-TR': "Siparişiniz kaydedilecektir. Onaylıyormusunuz ?"
            },
            OrderCreateProformaConfirm: {
                'en-US': "Your order proforma will be recorded. Do you confirm ?",
                'tr-TR': "Proforma Siparişiniz kaydedilecektir. Onaylıyormusunuz ?"
            },
            OrderCreateRemitenceConfirmDescription: {
                'en-US': "Your remitence order will be recorded. Do you confirm ?",
                'tr-TR': "Havale bilgileriniz kaydedilecektir. Onaylıyormusunuz ?"
            },
            OrderCreateRemitenceCompleted: {
                'en-US': "Your order has been completed. ",
                'tr-TR': "Siparişiniz onaylanmıştır."
            },
            OfferCreateConfirmDescription: {
                'en-US': "Your bid will be saved. Do you confirm ?",
                'tr-TR': "Teklifiniz kaydedilecektir. Onaylıyormusunuz ?"
            },
            GetAllStock: {
                'en-US': "Do you want to take all stock ?",
                'tr-TR': "Tüm stoğu almak ister misiniz ?"
            },
            BasketCShtmlSepetGuncellemeHatasi: {
                'en-US': "An error occurred while updating the basket.",
                'tr-TR': "Sepet güncellenirken bir hata meydana geldi."
            },
            MoqAlanKontrol1: {
                'en-US': "or multiples of ",
                'tr-TR': "veya katları olmalıdır."
            },
            Info: {
                'en-US': "Notification",
                'tr-TR': "Bilgi"
            },
            btnYes: {
                'en-US': "Yes",
                'tr-TR': "Evet"
            },
            btnNo: {
                'en-US': "No",
                'tr-TR': "Hayır"
            },
            btnOk: {
                'en-US': "Ok",
                'tr-TR': "Tamam"
            },
            btnPriceZeroError: {
                'en-US': "An error has occured! Please try again later",
                'tr-TR': "Sistemsel bir sorun oluştu! Daha sonra tekrar deneyin"
            },
            BasketCShtmlPleaseSelectDeliveryAddress: {
                'en-US': "Please select delivery address",
                'tr-TR': "Lütfen teslimat adresi seçiniz"
            },
            BasketCShtmlPleaseSelectBillingAddress: {
                'en-US': "Please select billing address",
                'tr-TR': "Lütfen fatura adresi seçiniz"
            },
            BasketPleaseSelectCargo: {
                'en-US': "Please select cargo ",
                'tr-TR': "Lütfen kargo seçiniz"
            },

            IHaveReadAcceptTheWarehouseDeliveryTerms: {
                'en-US': "You have not read and approved the warehouse delivery terms",
                'tr-TR': "Depo teslim şartlarını okuyup onaylayınız"
            },
            ReceiverPersonNotValid: {
                'en-US': "Receiver person information is not valid",
                'tr-TR': "Teslim alacak kullanıcı bilgileri geçerli değil"
            },

            ResetDefaultShippingText: {
                'en-US': "Due to the delivery address you chose, the cargo company has been changed to  {0}",
                'tr-TR': "Seçtiğiniz teslimat adresi sebebiyle kargo firması {0} olarak değiştirilmiştir."
            },

            MesafeliSatisSozlesmesiOnay: {
                'en-US': "Please accept contracts",
                'tr-TR': "Lütfen tüm sözleşmeleri kabul ediniz."
            },
            IptalveIadeSozlesmesiOnay: {
                'en-US': "Please accept contracts",
                'tr-TR': "Lütfen tüm sözleşmeleri kabul ediniz."
            },
            OnBilgilendirmeOnay: {
                'en-US': "Please accept contracts",
                'tr-TR': "Lütfen tüm sözleşmeleri kabul ediniz."
            },
            LoginSuccess: {
                'en-US': "Giriş başarılı !.../ Login success... !",
                'tr-TR': "Giriş başarılı."
            },
            Choose: {
                'en-US': "Choose",
                'tr-TR': "Seçiniz"
            },
            DeleteDeliveryAddress: {
                'en-US': "Are you sure you want to delete the address?",
                'tr-TR': "Adresi silmek istediğinize emin misiniz?"

            },
            DeleteBillingAddress: {
                'en-US': "<b style='color:red'>This process will result in the deletion if you have for your discount rates!!!</b> </br></br> are you sure you want to delete the billing address? ",
                'tr-TR': " <b style='color:red'>Bu işlem varsa indirim oranlarınızın da silinmesine yol açacaktır!!!</b> </br></br>Fatura adresini silmek istediğinize emin misiniz?  "

            },
            IslemBasarili: {
                'en-US': "Successful",
                'tr-TR': "İşlem başarılı"
            },
            HataOlustu: {
                'en-US': "Error",
                'tr-TR': "Hata oluştu"
            },
            Warning: {
                'en-US': "Warning",
                'tr-TR': "Uyarı"
            },
            Success: {
                'en-US': "Success",
                'tr-TR': "Kaydedildi"
            },
            ChooseBank: {
                'en-US': "Please select any bank account !",
                'tr-TR': "Havale ödemesi  için lütfen  banka seçiniz."
            },
            IadeNedeniSecin: {
                'en-US': "You must select the refund reason",
                'tr-TR': "İade nedeni seçmelisiniz"
            },
            IadeUrunVeyaUrunleriSecin: {
                'en-US': "You want to return the product or products you should choose.",
                'tr-TR': "İade etmek istediğiniz ürün veya ürünleri seçmelisiniz."
            },
            UyelikSozlesmeOnay: {
                'en-US': "You want to return the product or products you should choose.",
                'tr-TR': "Üyelik sözleşmesini onaylamalısınız!"
            },
            HesapAktif: {
                'en-US': "Account is active",
                'tr-TR': "Hesap aktif"
            },
            HesapPasif: {
                'en-US': "Account is passive",
                'tr-TR': "Hesap pasif"
            },
            SilmeBasarili: {
                'en-US': "Deletion process was completed.",
                'tr-TR': "Silme işlemi başarılı"
            },
            KullaniciYetkiEklendi: {
                'en-US': "User permissions added",
                'tr-TR': "Kullanıcı yetkileri eklendi"
            },
            KullaniciYetkiGuncellendi: {
                'en-US': "User permissions updated",
                'tr-TR': "Kullanıcı yetkileri güncellendi"
            },
            SepetAktarimOnay: {
                'en-US': "After reseting your cart, ıtems in the user's cart you have chosen will be added into your cart.",
                'tr-TR': "Sepetiniz sıfırlanıp seçtiğiniz kullanıcının sepetindeki ürünler eklenecektir. Onaylıyor musunuz?"
            },
            SepetAktarimOnayYeni: {
                'en-US': "The user will select the basket that you have selected. <br /> After this process your basket <u> will be reset. </u> <br /> Do you confirm?",
                'tr-TR': "Kullanıcının sepeti seçmiş olduğunuz sepete aktarılacaktır. <br /> Bu işlem sonrası sepetiniz <u>sıfırlanacaktır.</u> <br /> Onaylıyor musunuz?"
            },
            SepetTransferBasarili: {
                'en-US': "Transfer is completed.",
                'tr-TR': "Transfer işlemi başarılı"
            },
            IptalIadeMesaj: {
                'en-US': "You need to agree with the terms of cancellation and return conditions",
                'tr-TR': "İptal ve iade koşullarını kabul etmeniz gerekmektedir."
            },
            SiparisIadeHataOlustu: {
                'en-US': "An error occured during the order return",
                'tr-TR': "Sipariş iade edilirken hata oluştu"
            },
            KullaniciSilmeOnay: {
                'en-US': "Are you sure you want to delete the user?",
                'tr-TR': "Kullanıcıyı silmek istediğinize emin misiniz?"
            },
            OdemeTipiSeciniz: {
                'en-US': "Please choose payment type",
                'tr-TR': "Lütfen ödeme türü seçiniz."
            },
            OdenenTutarveGonderen: {
                'en-US': "The amount of the payment required to be paid or the sender fields filled.",
                'tr-TR': "Ödenen tutar veya Ödemeyi gönderen kişi alanlarının doldurulması gereklidir."
            },
            EpostaZorunlu: {
                'en-US': "Email is required",
                'tr-TR': "Eposta adresi gereklidir."
            },
            AdSoyad: {
                'en-US': "Name Surname is required",
                'tr-TR': "Ad Soyad gereklidir."
            },
            ToplamAlinabilir: {
                'en-US': "Total pieces can be taken to:",
                'tr-TR': "Toplam satın alınabilir adet:"
            },
            StokYetersiz: {
                'en-US': "Insufficient stock",
                'tr-TR': "Stok yetersiz"
            },
            YurtdisiKargoSeciniz: {
                'en-US': "Please choose shipment !",
                'tr-TR': "Lütfen kargo türü seçiniz."
            },
            YurtdisihesapNoYaz: {
                'en-US': "Please write Account No!",
                'tr-TR': "Lütfen kargo hesap no yazınız ."
            },
            TeklifAdediAltiHatasi: {
                'en-US': "You can not buy less than the offer quantity!",
                'tr-TR': "Teklif adedinin altında ürün alamazsınız! Teklif adedi:"
            },
            SepetEkraniAdresAdi: {
                'en-US': "Address Name :",
                'tr-TR': "Adres Adı :"
            },
            SepetEkraniSirket: {
                'en-US': "Company Name : ",
                'tr-TR': "Şirket : "
            },
            SepetEkraniAdres1: {
                'en-US': "Address 1 : ",
                'tr-TR': "Adres 1 : "
            },
            SepetEkraniAdres2: {
                'en-US': "Address 2 : ",
                'tr-TR': "Adres 2 : "
            },
            SepetEkraniGsm: {
                'en-US': "GSM 1 : ",
                'tr-TR': "GSM : "
            },
            SepetEkraniUlke: {
                'en-US': "Country : ",
                'tr-TR': "Ülke : "
            },
            SepetEkraniSehir: {
                'en-US': "City  : ",
                'tr-TR': "Şehir : "
            },
            SepetEkraniIlce: {
                'en-US': "District : ",
                'tr-TR': "İlçe : "
            },
            SepetEkraniPostaKodu: {
                'en-US': "Zip Code : ",
                'tr-TR': "Posta Kodu : "
            },
            SepetEkraniTeslimatAdresiChange: {
                'en-US': "You must first select a billing address",
                'tr-TR': "Önce fatura adresi seçmelisiniz"
            },
            AdresiEkleyenSilebilir: {
                'en-US': "You can delete that user adds an address",
                'tr-TR': "Adresi ekleyen kullanıcı silebilir"
            },
            UlkeSecimiYapiniz: {
                'en-US': "Choose the country",
                'tr-TR': "Ülke seçimi yapınız"
            },
            GetProjectAllStock: {
                'en-US': "Would you like to buy all the remaining stock in your project?",
                'tr-TR': "Projenizde kalan tüm stoğu almak ister misiniz?"
            },
            ProjeKalanAlinabilirAdet: {
                'en-US': "The remaining pieces of your project can be taken to: ",
                'tr-TR': "Projenizde kalan alınabilir adet: "
            },
            Moq0Kontrol: {
                'en-US': "Value can not be less than zero",
                'tr-TR': "Değer sıfırdan küçük olamaz"
            },
            ProjeMaxAlinabilirAdet: {
                'en-US': "Maximum may be taken: ",
                'tr-TR': "Maksimum alınabilir adet: "
            },
            IptalNedeniSecin: {
                'en-US': "Select a cancel reason",
                'tr-TR': "İptal nedeni seçmelisiniz."
            },
            SearchWarnigText3Char: {
                'en-US': "Please write the least 3 character for search.",
                'tr-TR': "Lütfen aramak istediğiniz ile ilgili en az 3 karakterlik bilgi giriniz."
            },
            Son: {
                'en-US': "Last",
                'tr-TR': "Son"
            },
            Ilk: {
                'en-US': "First",
                'tr-TR': "İlk"
            },
            Sayfa: {
                'en-US': "Page",
                'tr-TR': "Sayfa"
            },
            Kayit: {
                'en-US': "Count",
                'tr-TR': "Kayıt"
            },
            ProductAddedToFavorite: {
                'en-US': "Product was added your favorite products ! !",
                'tr-TR': "Ürün favorilerinize eklendi !"
            },
            ProductDeletedToFavorite: {
                'en-US': "Product was removed  your favorite products !",
                'tr-TR': "Ürün favorilerinizden  silindi !"
            },
            AllOfThemDeleted: {
                'en-US': "All of them was removed  !",
                'tr-TR': "Tümü silindi !"
            },
            DeletedCompareProducts: {
                'en-US': "Product was removed from your compare products ! ",
                'tr-TR': "Ürün karşılaştırma sepetinden kaldırıldı !"
            },
            Bilgilendirme: {
                'en-US': "Attention! ",
                'tr-TR': "Bilgilendirme!"
            },
            OdemeBildirimFormuBasarili: {
                'en-US': "Your payment notification form has been received by us",
                'tr-TR': "Ödeme bildirim formunuz tarafımıza ulaşmıştır."
            },
            SepettenUrunSilindi: {
                'en-US': "The product has been removed from your cart.",
                'tr-TR': "Sepetinizden ürün silinmiştir."
            },
            YeniSepetKayitHata: {
                'en-US': "There was an error saving the new basket",
                'tr-TR': "Yeni sepet kaydederken hata oluştu"
            },
            SepetAdiGuncellemeHata: {
                'en-US': "There was an error updating the basket name",
                'tr-TR': "Sepet adı güncellenirken hata oluştu"
            },
            SepetDegisirkenHata: {
                'en-US': "Error occurred while basket is changing",
                'tr-TR': "Sepet değişirken hata oluştu"
            },
            SepetConfirm: {
                'en-US': "All products in your cart will be deleted. <br /> Are you sure you want to delete it?",
                'tr-TR': "Sepetinizdeki tüm ürünler silinecektir. <br /> Silmek istediğinize eminmisiniz?"
            },
            TransferEtmekIstediginizSepetSeciniz: {
                'en-US': "Select your basket to transfer",
                'tr-TR': "Transfer etmek istediğiniz sepetinizi seçiniz"
            },
            SilmeOnay: {
                'en-US': "Are you sure you want to delete it?",
                'tr-TR': "Silmek istediğinize emin misiniz?"
            },
            TumSilmeOnay: {
                'en-US': "Are you sure you want to delete all basket items?",
                'tr-TR': "Tüm kalemleri silmek istediğinize emin misiniz?"
            },
            FavoriSepetAdiBos: {
                'en-US': "Favorite basket name can not be empty",
                'tr-TR': "Favori sepet adı boş geçilemez"
            },
            SepetEkranTaxNumber: {
                'en-US': "Tax Number",
                'tr-TR': "Vergi No"
            },
            Var: {
                'en-US': "Available",
                'tr-TR': "VAR"
            },
            Yok: {
                'en-US': "Unavailable",
                'tr-TR': "YOK"
            },
            KeywordOrPart: {
                'en-US': "Product Search ...",
                'tr-TR': "Ürün Ara ..."
            },
            EklemeBasariliKaydedildi: {
                'en-US': "Insert successfully saved.",
                'tr-TR': "Ekleme başarıyla kaydedildi."
            },
            DuzenlemeBasariliKaydedildi: {
                'en-US': "Process successfully saved.",
                'tr-TR': "Düzenleme başarıyla kaydedildi."
            },
            SilmeBasariliKaydedildi: {
                'en-US': "Delete item successfully saved.",
                'tr-TR': "Silme işlemi başarıyla kaydedildi."
            },
            UyariSiparisOlusmadi: {
                'en-US': "Warning ! The order could not be saved.",
                'tr-TR': "Uyarı ! Siparişiniz kaydedilemedi."
            },
            UyariTelefonZorunlu: {
                'en-US': "Phone area is required.",
                'tr-TR': "Telefon alanı zorunludur."
            },
            UyariAdresAdiZorunlu: {
                'en-US': "The address name field is required.",
                'tr-TR': "Adres adı alanı zorunludur."
            },
            UyariPostaKoduZorunlu: {
                'en-US': "The zip code field is required.",
                'tr-TR': "Posta kodu alanı zorunludur."
            },
            UyariEmailZorunlu: {
                'en-US': "Email field is required.",
                'tr-TR': "Email alanı zorunludur."
            },
            UyariEmailGecersiz: {
                'en-US': "Please enter a valid email address",
                'tr-TR': "Lütfen geçerli bir email adresi giriniz"
            },
            UyariAdZorunlu: {
                'en-US': "The namespace is obsolete.",
                'tr-TR': "Ad alanı zorunludur."
            },
            UyariSoyadZorunlu: {
                'en-US': "The surname field is obsolete.",
                'tr-TR': "Soyad alanı zorunludur."
            },
            UyariTcZorunlu: {
                'en-US': "The Tc Identification field is mandatory.",
                'tr-TR': "Tc Kimlik alanı zorunludur."
            },
            UyariVergiNoZorunlu: {
                'en-US': "Tax number field is obligatory.",
                'tr-TR': "Vergi numarası alanı zorunludur."
            },
            UyariFirmaAdiZorunlu: {
                'en-US': "Company name field is required.",
                'tr-TR': "Firma adı alanı zorunludur."
            },
            UyariSehirZorunlu: {
                'en-US': "City selection is mandatory.",
                'tr-TR': "Şehir seçilmesi zorunludur."
            },
            UyariTeslimAlacak: {
                'en-US': "Receiving Name Surname or Customer Title field is required.",
                'tr-TR': "Teslim Alacak Ad Soyad ya da Müşteri Ünvan alanı zorunludur."
            },
            UyariAdresZorunlu: {
                'en-US': "Address field is required.",
                'tr-TR': "Adres alanı zorunludur."
            },
            UyariFirmaTipiZorunlu: {
                'en-US': "Company type field is required.",
                'tr-TR': "Firma tipi alanı zorunludur."
            },
            Copied:
            {
                'en-US': "Copied.",
                'tr-TR': "Kopyalandı."

            },                   
            allProductAddedToFavorite: {
                'en-US': "Product was removed  your favorite products !",
                'tr-TR': "Sepetteki Tüm Ürünler Favorilerinize Eklendi !"
            },
            allProductDeleteFromFavorite: {
                'en-US': "All of them was removed  !",
                'tr-TR': "Sepeteki Tüm Ürünler Favorilerden Çıkarıldı !"
            },
            infoDeleteAllItem: {
                'en-US': "Are you sure you want to delete all the items in your shopping cart?",
                'tr-TR': "Sepetinizdeki tüm ürünleri silmek istediğinize emin misiniz?"
                
            },
            infoDeleteSelectedItem: {
                'en-US': "Are you sure you want to delete the selected items in your cart?",
                'tr-TR': "Sepetinizdeki seçili ürünleri silmek istediğinize emin misiniz?"

            },
            infoSelectedProductAddedToFavorite: {
                'en-US': "Are you sure you want to add the products you have chosen to your favorites?",
                'tr-TR': "Seçtiğiniz ürünleri favorilerinize eklemek istediğinize emin misiniz?"
            },
            islemBasariliSecilenlerFavorilereEklendi: {
                'en-US': "The products you selected have been added to your Favorite list",
                'tr-TR': "Seçtiğiniz ürünler Favori listenize eklendi"
            },
            infoSelectedProductIsFavourites: {
                'en-US': "You have selected products are in your Favorite List.",
                'tr-TR': "Seçtiğiniz Ürünler Favori Listenizde ",
               
            },
            iadeOnay: {
                'en-US': "You have selected products are in your Favorite List.",
                'tr-TR': "Iade talebiniz alınmıştır. Iade Takip Numaranız : ",
            },
            iadeDescription: {
                'en-US': "You have selected products are in your Favorite List.",
                'tr-TR': "Lütfen Açıklama Ekleyiniz",
            },
            iadeDescriptionCharacter: {
                'en-US': "Description must contains at least 20 characters.",
                'tr-TR': "Açıklama en az 20 karakter içermelidir.",
            },
            minQuantity: {
                'en-US': "The number of products you will receive must be {0} or more",
                'tr-TR': "Alacağınız ürün adeti {0} adet veya daha fazla olmalı",
            },
            multiplesQuantity: {
                'en-US': "The number of products you will receive must be {0} and its multiples.",
                'tr-TR': "Alacağınız ürün adedi {0} ve katları olmalı",
            },
            limitedQuantity: {
                'en-US': "The number of products you can buy: ",
                'tr-TR': "Alabileceğiniz maksimum ürün adedi: ",
            },
            sepetteFaturaAdresi: {
                'en-US': "Your Billing Address Information is Missing. Please update from the pop-up window! ",
                'tr-TR': "Fatura Adresi Bilgileriniz Eksik. Işleme devam edebilmek için Lütfen açılan pencereden güncelleyiniz ! ",
            },
            sepetteFaturaAdresiCreateOrderUyari: {
                'en-US': "Your Billing Address Information is Missing. Please update from the pop-up window! ",
                'tr-TR': "Fatura Adresi Bilgileriniz Eksik. Please update to continue ordering. ! ",
            },
             sepetteTeslimatAdresi: {
                 'en-US': "Your Delivery Address Information is Missing. Please update from the pop-up window!",
                 'tr-TR': "Teslimat Adresi Bilgileriniz Eksik. Işleme devam edebilmek için Lütfen açılan pencereden güncelleyiniz !",
            },
            sepetteSevkTarihiBilgilendirme: {
                'en-US': "The estimated shipping date of the product with code SEEED-1109916XX-4GB in your cart is the 4th Week of April 2022.",
                'tr-TR': "Sepetinizdeki SEEED-1109916XX-4GB kodlu ürünün tahmini sevkiyat tarihi Nisan 2022’nin 4. Haftasıdır.",
            },
            captcha: {
                'en-US': "Captcha Cannot Be Empty",
                'tr-TR': "Captcha Boş Geçilemez",
            }

        },  
        card: {
            holderName: {
                "en-US": "Card Holder Name",
                "tr-TR": "Kart Sahibi"
            },
            cardNumber: {
                "en-US": "Card Number",
                "tr-TR": "Kart No"
            },
            expireMonth: {
                "en-US": "exp.Month",
                "tr-TR": "SKT Ay"
            },
            expireYear: {
                "en-US": "exp.Year",
                "tr-TR": "SKT Yıl"
            },
            cvc: {
                "en-US": "CVV or CV2",
                "tr-TR": "CVV"
            },
            wantToTDS: {
                "en-US": "I want to pay with 3D Secure",
                "tr-TR": "3D Secure ile ödemek istiyorum"
            },
            wantToTDSInfo: {
                "en-US": "To be able to pay with 3D Secure, your card must be open to 3D transactions. In addition, 3D Secure should be supported by your bank.",
                "tr-TR": "3D Secure ile ödeme yapabilmek için kartınızın 3D işlemlerine açık olması gerekmektedir. Ayrıca 3D Secure sisteminin bankanız tarafından da desktekleniyor olması gerekmektedir."
            },
            amountToBePaid: {
                "en-US": "Amount to be Paid",
                "tr-TR": "Ödenecek Tutar"
            },
            doPayment: {
                "en-US": "PAY",
                "tr-TR": "Ödeme Yap"  
            },
            errors: {
                holderName: {
                    "en-US": "Please fill card holder name",
                    "tr-TR": "Kart Sahibi alanını doldurun!"
                },
                cardNumber: {
                    "en-US": "Please fill card number",
                    "tr-TR": "Kart Numarası Alanını doldurun!"
                },
                cardNumberisWrong: {
                    "en-US": "Card number is wrong!, Please check card number",
                    "tr-TR": "Kart Numarası Hatalı Lütfen kontorol edin!"
                },
                expiry: {
                    "en-US": "Please fill card expire",
                    "tr-TR": "Son Kullanım Tarihi alanını doldurun!"
                },
                expireMonth: {
                    "en-US": "Please fill expire month",
                    "tr-TR": "Son Kullanım Tarihi Ay alanını doldurun!"
                },
                expireYear: {
                    "en-US": "Please fill expire year",
                    "tr-TR": "Son Kullanım Tarihi Yıl alanını doldurun!"
                },
                expireYearMust2Digit: {
                    "en-US": "The Expiry Year must be card year last 2 characters",
                    "tr-TR": "Son Kullanım Yılı 2 karakter olmalı.Örn. 2021 ise 21 yazınız."
                },
                cvc: {
                    "en-US": "Please fill cvv or cv2",
                    "tr-TR": "Güvenlik Kodu alanını doldurun!"
                },
                installment: {
                    "en-US": "Please check installment or payment method",
                    "tr-TR": "Kredi Kartı taksit seçiniz"
                }

                
            }
        },
        bom: {
            errors: {
                bomFileColumnPartNumberMustBeSelected: { "tr-TR": "Parça kodu sütunu seçilmemiş", "en-US": "Manufacturer part number column must be selected" },
                bomFileColumnQuantityMustBeSelected: { "tr-TR": "Adet sütunu seçilmemiş", "en-US": "Quantity column must be selected" },
                bomFileRead: { "tr-TR": "Dosya okunamadı. Hata : {code}", "en-US": "File could not be read! Code {code}"}
            }
        },
        seeedErrors: {
            "general": { "tr-TR": "Bilinmeyen hata", "en-US": "Unknown error" },
            "1001": { "tr-TR": "Sistem referans hatası", "en-US": "System reference error" },
            "1002": { "tr-TR": "geçersiz parametreler", "en-US": "Invalid parameters" },
            "1003": { "tr-TR": "Eksik parametreler", "en-US": "Missing parameters" },
            "1004": { "tr-TR": "Veri kaydedilirken hata oluştu", "en-US": "Error saving data" },
            "1005": { "tr-TR": "Var olmayan yöntem", "en-US": "Non existent method" },
            "1006": { "tr-TR": "Kaynak bulunamadı", "en-US": "Not found resource" },
            "1100": { "tr-TR": "Lojistik alan kodu geçersiz", "en-US": "Logistics area code is invalid" },
            "1101": { "tr-TR": "Ulusal adres bulunamadı", "en-US": "Not found National address" },
            "1102": { "tr-TR": "Var olmayan lojistik kimliği", "en-US": "Non existent logistics ID" },
            "1400": { "tr-TR": "Döviz Kuru Hatası Al", "en-US": "Obtain Exchange Rate Error" },
            "2000": { "tr-TR": "Erişim reddedildi", "en-US": "Access denied" },
            "2001": { "tr-TR": "İmza parametrelerinin olmaması", "en-US": "Lack of signature parameters" },
            "2002": { "tr-TR": "İmza başarısız oldu", "en-US": "Signature failed" },
            "2003": { "tr-TR": "Açık kaynak bulunamadı", "en-US": "Not found open resource" },
            "2004": { "tr-TR": "Kaynaklara erişim sınırlarının ötesinde", "en-US": "Beyond the limits to access resources" },
            "2100": { "tr-TR": "Eksik Ürün parametreleri", "en-US": "Missing Product parameters" },
            "2101": { "tr-TR": "Mantıksız PCB miktarı", "en-US": "Illogical PCB quantity" },
            "2102": { "tr-TR": "PCB kalınlığı aralığın dışında", "en-US": "PCB thickness is out of the range" },
            "2103": { "tr-TR": "PCB bakır aralığın dışında", "en-US": "PCB copper is out of the range" },
            "2104": { "tr-TR": "PCB miktarı aralığın dışında", "en-US": "PCB quantity is out of the range" },
            "2105": { "tr-TR": "PCB soneki aralığın dışında", "en-US": "PCB suffix is out of the range" },
            "2106": { "tr-TR": "MPN eşleşemiyor", "en-US": "MPN cannot match" },
            "2107": { "tr-TR": "Var olmayan ürün", "en-US": "Non existent product" },
            "2108": { "tr-TR": "Yanlış ürün tipi", "en-US": "Wrong product type" },
            "2109": { "tr-TR": "Sadece Fusion ürünü için", "en-US": "Only for Fusion's product" },
            "2130": { "tr-TR": "PCB parametresi görünür değil isteğe bağlı", "en-US": "PCB parameter of visible not optional" },
            "2131": { "tr-TR": "Tanınmayan PCB parametresi", "en-US": "PCB parameter of not recognition" },
            "2132": { "tr-TR": "PCB genişliği sınırlarının ötesinde", "en-US": "Beyond the limits of PCB width" },
            "2133": { "tr-TR": "PCB yüksekliği sınırlarının ötesinde", "en-US": "Beyond the limits of PCB height" },
            "2134": { "tr-TR": "PCB alanının sınırlarının ötesinde", "en-US": "Beyond the limits of PCB area" },
            "2135": { "tr-TR": "PCB kalınlığı sınırlarının ötesinde", "en-US": "Beyond the limits of PCB thickness" },
            "2136": { "tr-TR": "PCB renginin sınırlarının ötesinde", "en-US": "Beyond the limits of PCB color" },
            "2137": { "tr-TR": "PCB kör sınırlarının ötesinde", "en-US": "Beyond the limits of PCB blind via" },
            "2138": { "tr-TR": "PCB bakır sınırlarının ötesinde", "en-US": "Beyond the limits of PCB copper" },
            "2139": { "tr-TR": "PCB iz / aralık sınırlarının ötesinde", "en-US": "Beyond the limits of PCB trace/spacing" },
            "2140": { "tr-TR": "PCB delik boyutu sınırlarının ötesinde", "en-US": "Beyond the limits of PCB hole size" },
            "2141": { "tr-TR": "PCB Panelize sınırlarının ötesinde", "en-US": "Beyond the limits of PCB Panelized" },
            "2142": { "tr-TR": "PCB malzemesinin sınırlarının ötesinde", "en-US": "Beyond the limits of PCB material" },
            "2143": { "tr-TR": "PCB katmanının sınırlarının ötesinde", "en-US": "Beyond the limits of PCB layer" },
            "2144": { "tr-TR": "PCB siparişini tekrarlayın", "en-US": "Repeat the PCB order" },
            "2170": { "tr-TR": "Mantıksız PCBA miktarı", "en-US": "Illogical PCBA quantity" },
            "2260": { "tr-TR": "Alışveriş sepeti fiyat hatası", "en-US": "Shopping cart price error" },
            "2261": { "tr-TR": "Boş alışveriş sepeti fiyatı", "en-US": "Empty shopping cart price" },
            "2281": { "tr-TR": "Boş ürün ağacı verileri", "en-US": "Empty redis BOM data" },
            "2282": { "tr-TR": "Kullanıcı boş ürün ağacı seçer", "en-US": "The user selects empty BOM" },
            "2283": { "tr-TR": "PCBA miktarı eksikliği", "en-US": "Lack of PCBA quantity" },
            "2284": { "tr-TR": "Bom format hatası", "en-US": "Bom format error" },
            "2310": { "tr-TR": "Mevcut olmayan şablon uzunluğu", "en-US": "Non existent stencil length" },
            "2311": { "tr-TR": "Mevcut olmayan şablon yüzeyi", "en-US": "Non existent stencil surface" },
            "2312": { "tr-TR": "Şablonun geçersiz parametreleri", "en-US": "Invalid parameters of stencil" },
            "2313": { "tr-TR": "Şablon miktarının eksik parametreleri", "en-US": "Missing parameters of stencil quantity" },
            "2381": { "tr-TR": "Dosya zip veya rar biçiminde olmalıdır", "en-US": "The file must be in zip or rar format" },
            "2451": { "tr-TR": "Mevcut olmayan sipariş", "en-US": "Non existent order" }
        }

    }
})();;
!function(n){function r(){return new Date(Date.UTC.apply(Date,arguments))}var u=function(r,u){var o=this,f,e;for(this.element=n(r),this.container=u.container||"body",this.language=u.language||this.element.data("date-language")||"en",this.language=(this.language in i)?this.language:"en",this.isRTL=i[this.language].rtl||!1,this.formatType=u.formatType||this.element.data("format-type")||"standard",this.format=t.parseFormat(u.format||this.element.data("date-format")||i[this.language].format||t.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.fontAwesome=u.fontAwesome||this.element.data("font-awesome")||!1,this.bootcssVer=u.bootcssVer||(this.isInput?this.element.is(".form-control")?3:2:this.bootcssVer=this.element.is(".input-group")?3:2),this.component=this.element.is(".date")?this.bootcssVer==3?this.element.find(".input-group-addon .glyphicon-th, .input-group-addon .glyphicon-time, .input-group-addon .glyphicon-calendar, .input-group-addon .glyphicon-calendar .fa-calendar .fa-clock-o").parent():this.element.find(".add-on .icon-th, .add-on .icon-time, .add-on .icon-calendar .fa-calendar .fa-clock-o").parent():!1,this.componentReset=this.element.is(".date")?this.bootcssVer==3?this.element.find(".input-group-addon .glyphicon-remove .fa-times").parent():this.element.find(".add-on .icon-remove .fa-times").parent():!1,this.hasInput=this.component&&this.element.find("input").length,this.component&&this.component.length===0&&(this.component=!1),this.linkField=u.linkField||this.element.data("link-field")||!1,this.linkFormat=t.parseFormat(u.linkFormat||this.element.data("link-format")||t.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=u.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=u.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=u.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=u.initialDate||new Date,this.icons={leftArrow:this.fontAwesome?"fa-arrow-left":this.bootcssVer===3?"glyphicon-arrow-left":"icon-arrow-left",rightArrow:this.fontAwesome?"fa-arrow-right":this.bootcssVer===3?"glyphicon-arrow-right":"icon-arrow-right"},this.icontype=this.fontAwesome?"fa":"glyphicon",this._attachEvents(),this.formatViewType="datetime",("formatViewType"in u)?this.formatViewType=u.formatViewType:("formatViewType"in this.element.data())&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,("minView"in u)?this.minView=u.minView:("minView"in this.element.data())&&(this.minView=this.element.data("min-view")),this.minView=t.convertViewMode(this.minView),this.maxView=t.modes.length-1,("maxView"in u)?this.maxView=u.maxView:("maxView"in this.element.data())&&(this.maxView=this.element.data("max-view")),this.maxView=t.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,("wheelViewModeNavigation"in u)?this.wheelViewModeNavigation=u.wheelViewModeNavigation:("wheelViewModeNavigation"in this.element.data())&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,("wheelViewModeNavigationInverseDirection"in u)?this.wheelViewModeNavigationInverseDirection=u.wheelViewModeNavigationInverseDirection:("wheelViewModeNavigationInverseDirection"in this.element.data())&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,("wheelViewModeNavigationDelay"in u)?this.wheelViewModeNavigationDelay=u.wheelViewModeNavigationDelay:("wheelViewModeNavigationDelay"in this.element.data())&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,("startView"in u)?this.startViewMode=u.startView:("startView"in this.element.data())&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=t.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,("viewSelect"in u)?this.viewSelect=u.viewSelect:("viewSelect"in this.element.data())&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=t.convertViewMode(this.viewSelect),this.forceParse=!0,("forceParse"in u)?this.forceParse=u.forceParse:("dateForceParse"in this.element.data())&&(this.forceParse=this.element.data("date-force-parse")),f=this.bootcssVer===3?t.templateV3:t.template;f.indexOf("{iconType}")!==-1;)f=f.replace("{iconType}",this.icontype);while(f.indexOf("{leftArrow}")!==-1)f=f.replace("{leftArrow}",this.icons.leftArrow);while(f.indexOf("{rightArrow}")!==-1)f=f.replace("{rightArrow}",this.icons.rightArrow);if(this.picker=n(f).appendTo(this.isInline?this.element:this.container).on({click:n.proxy(this.click,this),mousedown:n.proxy(this.mousedown,this)}),this.wheelViewModeNavigation)if(n.fn.mousewheel)this.picker.on({mousewheel:n.proxy(this.mousewheel,this)});else console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option");this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu");this.isRTL&&(this.picker.addClass("datetimepicker-rtl"),e=this.bootcssVer===3?".prev span, .next span":".prev i, .next i",this.picker.find(e).toggleClass(this.icons.leftArrow+" "+this.icons.rightArrow));n(document).on("mousedown",function(t){n(t.target).closest(".datetimepicker").length===0&&o.hide()});this.autoclose=!1;"autoclose"in u?this.autoclose=u.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose"));this.keyboardNavigation=!0;"keyboardNavigation"in u?this.keyboardNavigation=u.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation"));this.todayBtn=u.todayBtn||this.element.data("date-today-btn")||!1;this.todayHighlight=u.todayHighlight||this.element.data("date-today-highlight")||!1;this.weekStart=(u.weekStart||this.element.data("date-weekstart")||i[this.language].weekStart||0)%7;this.weekEnd=(this.weekStart+6)%7;this.startDate=-Infinity;this.endDate=Infinity;this.daysOfWeekDisabled=[];this.setStartDate(u.startDate||this.element.data("date-startdate"));this.setEndDate(u.endDate||this.element.data("date-enddate"));this.setDaysOfWeekDisabled(u.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled"));this.setMinutesDisabled(u.minutesDisabled||this.element.data("date-minute-disabled"));this.setHoursDisabled(u.hoursDisabled||this.element.data("date-hour-disabled"));this.fillDow();this.fillMonths();this.update();this.showMode();this.isInline&&this.show()},i,t;u.prototype={constructor:u,_events:[],_attachEvents:function(){this._detachEvents();this.isInput?this._events=[[this.element,{focus:n.proxy(this.show,this),keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:n.proxy(this.show,this),keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)}],[this.component,{click:n.proxy(this.show,this)}]],this.componentReset&&this._events.push([this.componentReset,{click:n.proxy(this.reset,this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:n.proxy(this.show,this)}]];for(var t=0,i,r;t<this._events.length;t++){i=this._events[t][0];r=this._events[t][1];i.on(r)}},_detachEvents:function(){for(var n=0,t,i;n<this._events.length;n++)t=this._events[n][0],i=this._events[n][1],t.off(i);this._events=[]},show:function(t){this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.forceParse&&this.update();this.place();n(window).on("resize",n.proxy(this.place,this));t&&(t.stopPropagation(),t.preventDefault());this.isVisible=!0;this.element.trigger({type:"show",date:this.date})},hide:function(){this.isVisible&&(this.isInline||(this.picker.hide(),n(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||n(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.isVisible=!1,this.element.trigger({type:"hide",date:this.date})))},remove:function(){this._detachEvents();this.picker.remove();delete this.picker;delete this.element.data().datetimepicker},getDate:function(){var n=this.getUTCDate();return new Date(n.getTime()+n.getTimezoneOffset()*6e4)},getUTCDate:function(){return this.date},setDate:function(n){this.setUTCDate(new Date(n.getTime()-n.getTimezoneOffset()*6e4))},setUTCDate:function(n){n>=this.startDate&&n<=this.endDate?(this.date=n,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:n,startDate:this.startDate,endDate:this.endDate})},setFormat:function(n){this.format=t.parseFormat(n,this.formatType);var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input"));i&&i.val()&&this.setValue()},setValue:function(){var t=this.getFormattedDate();this.isInput?this.element.val(t):(this.component&&this.element.find("input").val(t),this.element.data("date",t));this.linkField&&n("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(n){return n==undefined&&(n=this.format),t.formatDate(this.date,n,this.language,this.formatType)},setStartDate:function(n){this.startDate=n||-Infinity;this.startDate!==-Infinity&&(this.startDate=t.parseDate(this.startDate,this.format,this.language,this.formatType));this.update();this.updateNavArrows()},setEndDate:function(n){this.endDate=n||Infinity;this.endDate!==Infinity&&(this.endDate=t.parseDate(this.endDate,this.format,this.language,this.formatType));this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(t){this.daysOfWeekDisabled=t||[];n.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/));this.daysOfWeekDisabled=n.map(this.daysOfWeekDisabled,function(n){return parseInt(n,10)});this.update();this.updateNavArrows()},setMinutesDisabled:function(t){this.minutesDisabled=t||[];n.isArray(this.minutesDisabled)||(this.minutesDisabled=this.minutesDisabled.split(/,\s*/));this.minutesDisabled=n.map(this.minutesDisabled,function(n){return parseInt(n,10)});this.update();this.updateNavArrows()},setHoursDisabled:function(t){this.hoursDisabled=t||[];n.isArray(this.hoursDisabled)||(this.hoursDisabled=this.hoursDisabled.split(/,\s*/));this.hoursDisabled=n.map(this.hoursDisabled,function(n){return parseInt(n,10)});this.update();this.updateNavArrows()},place:function(){var r,e,i,u,t,f;this.isInline||(r=0,n("div").each(function(){var t=parseInt(n(this).css("zIndex"),10);t>r&&(r=t)}),e=r+10,f=this.container instanceof n?this.container.offset():n(this.container).offset(),this.component?(i=this.component.offset(),t=i.left,(this.pickerPosition=="bottom-left"||this.pickerPosition=="top-left")&&(t+=this.component.outerWidth()-this.picker.outerWidth())):(i=this.element.offset(),t=i.left),t+220>document.body.clientWidth&&(t=document.body.clientWidth-220),u=this.pickerPosition=="top-left"||this.pickerPosition=="top-right"?i.top-this.picker.outerHeight():i.top+this.height,u=u-f.top,t=t-f.left,this.picker.css({top:u,left:t,zIndex:e}))},update:function(){var n,i=!1;arguments&&arguments.length&&(typeof arguments[0]=="string"||arguments[0]instanceof Date)?(n=arguments[0],i=!0):(n=(this.isInput?this.element.val():this.element.find("input").val())||this.element.data("date")||this.initialDate,(typeof n=="string"||n instanceof String)&&(n=n.replace(/^\s+|\s+$/g,"")));n||(n=new Date,i=!1);this.date=t.parseDate(n,this.format,this.language,this.formatType);i&&this.setValue();this.viewDate=this.date<this.startDate?new Date(this.startDate):this.date>this.endDate?new Date(this.endDate):new Date(this.date);this.fill()},fillDow:function(){for(var t=this.weekStart,n="<tr>";t<this.weekStart+7;)n+='<th class="dow">'+i[this.language].daysMin[t++%7]+"<\/th>";n+="<\/tr>";this.picker.find(".datetimepicker-days thead").append(n)},fillMonths:function(){for(var n="",t=0;t<12;)n+='<span class="month">'+i[this.language].monthsShort[t++]+"<\/span>";this.picker.find(".datetimepicker-months td").html(n)},fill:function(){var tt,e,it,y,o,s,ut,p,rt,b,ft,u;if(this.date!=null&&this.viewDate!=null){var w=new Date(this.viewDate),f=w.getUTCFullYear(),c=w.getUTCMonth(),k=w.getUTCDate(),v=w.getUTCHours(),et=w.getUTCMinutes(),d=this.startDate!==-Infinity?this.startDate.getUTCFullYear():-Infinity,ot=this.startDate!==-Infinity?this.startDate.getUTCMonth()+1:-Infinity,g=this.endDate!==Infinity?this.endDate.getUTCFullYear():Infinity,st=this.endDate!==Infinity?this.endDate.getUTCMonth()+1:Infinity,ht=new r(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),nt=new Date;for(this.picker.find(".datetimepicker-days thead th:eq(1)").text(i[this.language].months[c]+" "+f),this.formatViewType=="time"?(tt=this.getFormattedDate(),this.picker.find(".datetimepicker-hours thead th:eq(1)").text(tt),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(tt)):(this.picker.find(".datetimepicker-hours thead th:eq(1)").text(k+" "+i[this.language].months[c]+" "+f),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(k+" "+i[this.language].months[c]+" "+f)),this.picker.find("tfoot th.today").text(i[this.language].today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths(),e=r(f,c-1,28,0,0,0,0),it=t.getDaysInMonth(e.getUTCFullYear(),e.getUTCMonth()),e.setUTCDate(it),e.setUTCDate(it-(e.getUTCDay()-this.weekStart+7)%7),y=new Date(e),y.setUTCDate(y.getUTCDate()+42),y=y.valueOf(),o=[];e.valueOf()<y;)e.getUTCDay()==this.weekStart&&o.push("<tr>"),s="",e.getUTCFullYear()<f||e.getUTCFullYear()==f&&e.getUTCMonth()<c?s+=" old":(e.getUTCFullYear()>f||e.getUTCFullYear()==f&&e.getUTCMonth()>c)&&(s+=" new"),this.todayHighlight&&e.getUTCFullYear()==nt.getFullYear()&&e.getUTCMonth()==nt.getMonth()&&e.getUTCDate()==nt.getDate()&&(s+=" today"),e.valueOf()==ht&&(s+=" active"),(e.valueOf()+864e5<=this.startDate||e.valueOf()>this.endDate||n.inArray(e.getUTCDay(),this.daysOfWeekDisabled)!==-1)&&(s+=" disabled"),o.push('<td class="day'+s+'">'+e.getUTCDate()+"<\/td>"),e.getUTCDay()==this.weekEnd&&o.push("<\/tr>"),e.setUTCDate(e.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(o.join(""));o=[];var l="",h="",a="",ct=this.hoursDisabled||[];for(u=0;u<24;u++)ct.indexOf(u)===-1&&(p=r(f,c,k,u),s="",p.valueOf()+36e5<=this.startDate||p.valueOf()>this.endDate?s+=" disabled":v==u&&(s+=" active"),this.showMeridian&&i[this.language].meridiem.length==2?(h=u<12?i[this.language].meridiem[0]:i[this.language].meridiem[1],h!=a&&(a!=""&&o.push("<\/fieldset>"),o.push('<fieldset class="hour"><legend>'+h.toUpperCase()+"<\/legend>")),a=h,l=u%12?u%12:12,o.push('<span class="hour'+s+" hour_"+(u<12?"am":"pm")+'">'+l+"<\/span>"),u==23&&o.push("<\/fieldset>")):(l=u+":00",o.push('<span class="hour'+s+'">'+l+"<\/span>")));for(this.picker.find(".datetimepicker-hours td").html(o.join("")),o=[],l="",h="",a="",ut=this.minutesDisabled||[],u=0;u<60;u+=this.minuteStep)ut.indexOf(u)===-1&&(p=r(f,c,k,v,u,0),s="",p.valueOf()<this.startDate||p.valueOf()>this.endDate?s+=" disabled":Math.floor(et/this.minuteStep)==Math.floor(u/this.minuteStep)&&(s+=" active"),this.showMeridian&&i[this.language].meridiem.length==2?(h=v<12?i[this.language].meridiem[0]:i[this.language].meridiem[1],h!=a&&(a!=""&&o.push("<\/fieldset>"),o.push('<fieldset class="minute"><legend>'+h.toUpperCase()+"<\/legend>")),a=h,l=v%12?v%12:12,o.push('<span class="minute'+s+'">'+l+":"+(u<10?"0"+u:u)+"<\/span>"),u==59&&o.push("<\/fieldset>")):(l=u+":00",o.push('<span class="minute'+s+'">'+v+":"+(u<10?"0"+u:u)+"<\/span>")));for(this.picker.find(".datetimepicker-minutes td").html(o.join("")),rt=this.date.getUTCFullYear(),b=this.picker.find(".datetimepicker-months").find("th:eq(1)").text(f).end().find("span").removeClass("active"),rt==f&&b.eq(this.date.getUTCMonth()+2).addClass("active"),(f<d||f>g)&&b.addClass("disabled"),f==d&&b.slice(0,ot+1).addClass("disabled"),f==g&&b.slice(st).addClass("disabled"),o="",f=parseInt(f/10,10)*10,ft=this.picker.find(".datetimepicker-years").find("th:eq(1)").text(f+"-"+(f+9)).end().find("td"),f-=1,u=-1;u<11;u++)o+='<span class="year'+(u==-1||u==10?" old":"")+(rt==f?" active":"")+(f<d||f>g?" disabled":"")+'">'+f+"<\/span>",f+=1;ft.html(o);this.place()}},updateNavArrows:function(){var i=new Date(this.viewDate),n=i.getUTCFullYear(),t=i.getUTCMonth(),r=i.getUTCDate(),u=i.getUTCHours();switch(this.viewMode){case 0:this.startDate!==-Infinity&&n<=this.startDate.getUTCFullYear()&&t<=this.startDate.getUTCMonth()&&r<=this.startDate.getUTCDate()&&u<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.endDate!==Infinity&&n>=this.endDate.getUTCFullYear()&&t>=this.endDate.getUTCMonth()&&r>=this.endDate.getUTCDate()&&u>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:this.startDate!==-Infinity&&n<=this.startDate.getUTCFullYear()&&t<=this.startDate.getUTCMonth()&&r<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.endDate!==Infinity&&n>=this.endDate.getUTCFullYear()&&t>=this.endDate.getUTCMonth()&&r>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:this.startDate!==-Infinity&&n<=this.startDate.getUTCFullYear()&&t<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.endDate!==Infinity&&n>=this.endDate.getUTCFullYear()&&t>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:this.startDate!==-Infinity&&n<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.endDate!==Infinity&&n>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(t){if(t.preventDefault(),t.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var u=t.originalEvent,r=u.wheelDelta,i=r>0?1:r===0?0:-1;this.wheelViewModeNavigationInverseDirection&&(i=-i);this.showMode(i);setTimeout(n.proxy(function(){this.wheelPause=!1},this),this.wheelViewModeNavigationDelay)}},click:function(i){var u,l,e,v;if(i.stopPropagation(),i.preventDefault(),u=n(i.target).closest("span, td, th, legend"),u.is("."+this.icontype)&&(u=n(u).parent().closest("span, td, th, legend")),u.length==1){if(u.is(".disabled")){this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});return}switch(u[0].nodeName.toLowerCase()){case"th":switch(u[0].className){case"switch":this.showMode(1);break;case"prev":case"next":l=t.modes[this.viewMode].navStep*(u[0].className=="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,l);break;case 1:this.viewDate=this.moveDate(this.viewDate,l);break;case 2:this.viewDate=this.moveMonth(this.viewDate,l);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,l)}this.fill();this.element.trigger({type:u[0].className+":"+this.convertViewModeText(this.viewMode),date:this.viewDate,startDate:this.startDate,endDate:this.endDate});break;case"today":e=new Date;e=r(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),0);e<this.startDate?e=this.startDate:e>this.endDate&&(e=this.endDate);this.viewMode=this.startViewMode;this.showMode(0);this._setDate(e);this.fill();this.autoclose&&this.hide()}break;case"span":if(!u.is(".disabled")){var s=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),h=this.viewDate.getUTCDate(),o=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),a=this.viewDate.getUTCSeconds();u.is(".month")?(this.viewDate.setUTCDate(1),f=u.parent().find("span").index(u),h=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(f),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(r(s,f,h,o,c,a,0))):u.is(".year")?(this.viewDate.setUTCDate(1),s=parseInt(u.text(),10)||0,this.viewDate.setUTCFullYear(s),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(r(s,f,h,o,c,a,0))):u.is(".hour")?(o=parseInt(u.text(),10)||0,(u.hasClass("hour_am")||u.hasClass("hour_pm"))&&(o==12&&u.hasClass("hour_am")?o=0:o!=12&&u.hasClass("hour_pm")&&(o+=12)),this.viewDate.setUTCHours(o),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(r(s,f,h,o,c,a,0))):u.is(".minute")&&(c=parseInt(u.text().substr(u.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(c),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(r(s,f,h,o,c,a,0)));this.viewMode!=0?(v=this.viewMode,this.showMode(-1),this.fill(),v==this.viewMode&&this.autoclose&&this.hide()):(this.fill(),this.autoclose&&this.hide())}break;case"td":if(u.is(".day")&&!u.is(".disabled")){var h=parseInt(u.text(),10)||1,s=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),o=this.viewDate.getUTCHours(),c=this.viewDate.getUTCMinutes(),a=this.viewDate.getUTCSeconds();u.is(".old")?f===0?(f=11,s-=1):f-=1:u.is(".new")&&(f==11?(f=0,s+=1):f+=1);this.viewDate.setUTCFullYear(s);this.viewDate.setUTCMonth(f,h);this.element.trigger({type:"changeDay",date:this.viewDate});this.viewSelect>=2&&this._setDate(r(s,f,h,o,c,a,0))}v=this.viewMode;this.showMode(-1);this.fill();v==this.viewMode&&this.autoclose&&this.hide()}}},_setDate:function(n,t){t&&t!="date"||(this.date=n);t&&t!="view"||(this.viewDate=n);this.fill();this.setValue();var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input"));i&&(i.change(),this.autoclose&&(!t||t=="date"));this.element.trigger({type:"changeDate",date:this.date})},moveMinute:function(n,t){if(!t)return n;var i=new Date(n.valueOf());return i.setUTCMinutes(i.getUTCMinutes()+t*this.minuteStep),i},moveHour:function(n,t){if(!t)return n;var i=new Date(n.valueOf());return i.setUTCHours(i.getUTCHours()+t),i},moveDate:function(n,t){if(!t)return n;var i=new Date(n.valueOf());return i.setUTCDate(i.getUTCDate()+t),i},moveMonth:function(n,t){var f;if(!t)return n;var i=new Date(n.valueOf()),e=i.getUTCDate(),o=i.getUTCMonth(),s=Math.abs(t),r,u;if(t=t>0?1:-1,s==1)u=t==-1?function(){return i.getUTCMonth()==o}:function(){return i.getUTCMonth()!=r},r=o+t,i.setUTCMonth(r),(r<0||r>11)&&(r=(r+12)%12);else{for(f=0;f<s;f++)i=this.moveMonth(i,t);r=i.getUTCMonth();i.setUTCDate(e);u=function(){return r!=i.getUTCMonth()}}while(u())i.setUTCDate(--e),i.setUTCMonth(r);return i},moveYear:function(n,t){return this.moveMonth(n,t*12)},dateWithinRange:function(n){return n>=this.startDate&&n<=this.endDate},keydown:function(n){var u,t,i,r,e,f;if(this.picker.is(":not(:visible)")){n.keyCode==27&&this.show();return}u=!1;switch(n.keyCode){case 27:this.hide();n.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;t=n.keyCode==37?-1:1;viewMode=this.viewMode;n.ctrlKey?viewMode+=2:n.shiftKey&&(viewMode+=1);viewMode==4?(i=this.moveYear(this.date,t),r=this.moveYear(this.viewDate,t)):viewMode==3?(i=this.moveMonth(this.date,t),r=this.moveMonth(this.viewDate,t)):viewMode==2?(i=this.moveDate(this.date,t),r=this.moveDate(this.viewDate,t)):viewMode==1?(i=this.moveHour(this.date,t),r=this.moveHour(this.viewDate,t)):viewMode==0&&(i=this.moveMinute(this.date,t),r=this.moveMinute(this.viewDate,t));this.dateWithinRange(i)&&(this.date=i,this.viewDate=r,this.setValue(),this.update(),n.preventDefault(),u=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;t=n.keyCode==38?-1:1;viewMode=this.viewMode;n.ctrlKey?viewMode+=2:n.shiftKey&&(viewMode+=1);viewMode==4?(i=this.moveYear(this.date,t),r=this.moveYear(this.viewDate,t)):viewMode==3?(i=this.moveMonth(this.date,t),r=this.moveMonth(this.viewDate,t)):viewMode==2?(i=this.moveDate(this.date,t*7),r=this.moveDate(this.viewDate,t*7)):viewMode==1?this.showMeridian?(i=this.moveHour(this.date,t*6),r=this.moveHour(this.viewDate,t*6)):(i=this.moveHour(this.date,t*4),r=this.moveHour(this.viewDate,t*4)):viewMode==0&&(i=this.moveMinute(this.date,t*4),r=this.moveMinute(this.viewDate,t*4));this.dateWithinRange(i)&&(this.date=i,this.viewDate=r,this.setValue(),this.update(),n.preventDefault(),u=!0);break;case 13:this.viewMode!=0?(e=this.viewMode,this.showMode(-1),this.fill(),e==this.viewMode&&this.autoclose&&this.hide()):(this.fill(),this.autoclose&&this.hide());n.preventDefault();break;case 9:this.hide()}u&&(this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change(),this.element.trigger({type:"changeDate",date:this.date}))},showMode:function(n){if(n){var i=Math.max(0,Math.min(t.modes.length-1,this.viewMode+n));i>=this.minView&&i<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:i}),this.viewMode=i)}this.picker.find(">div").hide().filter(".datetimepicker-"+t.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()},reset:function(){this._setDate(null,"date")},convertViewModeText:function(n){switch(n){case 4:return"decade";case 3:return"year";case 2:return"month";case 1:return"day";case 0:return"hour"}}};n.fn.datetimepicker=function(t){var r=Array.apply(null,arguments),i;return r.shift(),this.each(function(){var e=n(this),f=e.data("datetimepicker"),o=typeof t=="object"&&t;return f||e.data("datetimepicker",f=new u(this,n.extend({},n.fn.datetimepicker.defaults,o))),typeof t=="string"&&typeof f[t]=="function"&&(i=f[t].apply(f,r),i!==undefined)?!1:void 0}),i!==undefined?i:this};n.fn.datetimepicker.defaults={};n.fn.datetimepicker.Constructor=u;i=n.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today"}};t={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,i){return[31,t.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][i]},getDefaultFormat:function(n,t){if(n=="standard")return t=="input"?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if(n=="php")return t=="input"?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.");},validParts:function(n){if(n=="standard")return/hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if(n=="php")return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.");},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(n,t){var i=n.replace(this.validParts(t),'\0').split('\0'),r=n.match(this.validParts(t));if(!i||!i.length||!r||r.length==0)throw new Error("Invalid date format.");return{separators:i,parts:r}},parseDate:function(t,f,e,o){var b,k,h,l,v,g,s,y;if(t instanceof Date)return b=new Date(t.valueOf()-t.getTimezoneOffset()*6e4),b.setMilliseconds(0),b;if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(t)&&(f=this.parseFormat("yyyy-mm-dd",o)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(t)&&(f=this.parseFormat("yyyy-mm-dd hh:ii",o)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(t)&&(f=this.parseFormat("yyyy-mm-dd hh:ii:ss",o)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(t)){for(k=/([-+]\d+)([dmwy])/,h=t.match(/([-+]\d+)([dmwy])/g),t=new Date,s=0;s<h.length;s++){l=k.exec(h[s]);v=parseInt(l[1]);switch(l[2]){case"d":t.setUTCDate(t.getUTCDate()+v);break;case"m":t=u.prototype.moveMonth.call(u.prototype,t,v);break;case"w":t.setUTCDate(t.getUTCDate()+v*7);break;case"y":t=u.prototype.moveYear.call(u.prototype,t,v)}}return r(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),0)}var h=t&&t.match(this.nonpunctuation)||[],t=new Date(0,0,0,0,0,0,0),p={},d=["hh","h","ii","i","ss","s","yyyy","yy","M","MM","m","mm","D","DD","d","dd","H","HH","p","P"],c={hh:function(n,t){return n.setUTCHours(t)},h:function(n,t){return n.setUTCHours(t)},HH:function(n,t){return n.setUTCHours(t==12?0:t)},H:function(n,t){return n.setUTCHours(t==12?0:t)},ii:function(n,t){return n.setUTCMinutes(t)},i:function(n,t){return n.setUTCMinutes(t)},ss:function(n,t){return n.setUTCSeconds(t)},s:function(n,t){return n.setUTCSeconds(t)},yyyy:function(n,t){return n.setUTCFullYear(t)},yy:function(n,t){return n.setUTCFullYear(2e3+t)},m:function(n,t){for(t-=1;t<0;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!=t;){if(isNaN(n.getUTCMonth()))return n;n.setUTCDate(n.getUTCDate()-1)}return n},d:function(n,t){return n.setUTCDate(t)},p:function(n,t){return n.setUTCHours(t==1?n.getUTCHours()+12:n.getUTCHours())}},a,w,l;if(c.M=c.MM=c.mm=c.m,c.dd=c.d,c.P=c.p,t=r(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()),h.length==f.parts.length){for(s=0,g=f.parts.length;s<g;s++){if(a=parseInt(h[s],10),l=f.parts[s],isNaN(a))switch(l){case"MM":w=n(i[e].months).filter(function(){var n=this.slice(0,h[s].length),t=h[s].slice(0,n.length);return n==t});a=n.inArray(w[0],i[e].months)+1;break;case"M":w=n(i[e].monthsShort).filter(function(){var n=this.slice(0,h[s].length),t=h[s].slice(0,n.length);return n.toLowerCase()==t.toLowerCase()});a=n.inArray(w[0],i[e].monthsShort)+1;break;case"p":case"P":a=n.inArray(h[s].toLowerCase(),i[e].meridiem)}p[l]=a}for(s=0;s<d.length;s++)y=d[s],y in p&&!isNaN(p[y])&&c[y](t,p[y])}return t},formatDate:function(r,u,f,e){var o,r,s,h,c;if(r==null)return"";if(e=="standard")o={yy:r.getUTCFullYear().toString().substring(2),yyyy:r.getUTCFullYear(),m:r.getUTCMonth()+1,M:i[f].monthsShort[r.getUTCMonth()],MM:i[f].months[r.getUTCMonth()],d:r.getUTCDate(),D:i[f].daysShort[r.getUTCDay()],DD:i[f].days[r.getUTCDay()],p:i[f].meridiem.length==2?i[f].meridiem[r.getUTCHours()<12?0:1]:"",h:r.getUTCHours(),i:r.getUTCMinutes(),s:r.getUTCSeconds()},o.H=i[f].meridiem.length==2?o.h%12==0?12:o.h%12:o.h,o.HH=(o.H<10?"0":"")+o.H,o.P=o.p.toUpperCase(),o.hh=(o.h<10?"0":"")+o.h,o.ii=(o.i<10?"0":"")+o.i,o.ss=(o.s<10?"0":"")+o.s,o.dd=(o.d<10?"0":"")+o.d,o.mm=(o.m<10?"0":"")+o.m;else if(e=="php")o={y:r.getUTCFullYear().toString().substring(2),Y:r.getUTCFullYear(),F:i[f].months[r.getUTCMonth()],M:i[f].monthsShort[r.getUTCMonth()],n:r.getUTCMonth()+1,t:t.getDaysInMonth(r.getUTCFullYear(),r.getUTCMonth()),j:r.getUTCDate(),l:i[f].days[r.getUTCDay()],D:i[f].daysShort[r.getUTCDay()],w:r.getUTCDay(),N:r.getUTCDay()==0?7:r.getUTCDay(),S:r.getUTCDate()%10<=i[f].suffix.length?i[f].suffix[r.getUTCDate()%10-1]:"",a:i[f].meridiem.length==2?i[f].meridiem[r.getUTCHours()<12?0:1]:"",g:r.getUTCHours()%12==0?12:r.getUTCHours()%12,G:r.getUTCHours(),i:r.getUTCMinutes(),s:r.getUTCSeconds()},o.m=(o.n<10?"0":"")+o.n,o.d=(o.j<10?"0":"")+o.j,o.A=o.a.toString().toUpperCase(),o.h=(o.g<10?"0":"")+o.g,o.H=(o.G<10?"0":"")+o.G,o.i=(o.i<10?"0":"")+o.i,o.s=(o.s<10?"0":"")+o.s;else throw new Error("Invalid format type.");for(r=[],s=n.extend([],u.separators),h=0,c=u.parts.length;h<c;h++)s.length&&r.push(s.shift()),r.push(o[u.parts[h]]);return s.length&&r.push(s.shift()),r.join("")},convertViewMode:function(n){switch(n){case 4:case"decade":n=4;break;case 3:case"year":n=3;break;case 2:case"month":n=2;break;case 1:case"day":n=1;break;case 0:case"hour":n=0}return n},headTemplate:'<thead><tr><th class="prev"><i class="{leftArrow}"/><\/th><th colspan="5" class="switch"><\/th><th class="next"><i class="{rightArrow}"/><\/th><\/tr><\/thead>',headTemplateV3:'<thead><tr><th class="prev"><span class="{iconType} {leftArrow}"><\/span> <\/th><th colspan="5" class="switch"><\/th><th class="next"><span class="{iconType} {rightArrow}"><\/span> <\/th><\/tr><\/thead>',contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><\/tfoot>'};t.template='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datetimepicker-hours"><table class=" table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datetimepicker-days"><table class=" table-condensed">'+t.headTemplate+"<tbody><\/tbody>"+t.footTemplate+'<\/table><\/div><div class="datetimepicker-months"><table class="table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datetimepicker-years"><table class="table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+"<\/table><\/div><\/div>";t.templateV3='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+t.headTemplateV3+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datetimepicker-hours"><table class=" table-condensed">'+t.headTemplateV3+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datetimepicker-days"><table class=" table-condensed">'+t.headTemplateV3+"<tbody><\/tbody>"+t.footTemplate+'<\/table><\/div><div class="datetimepicker-months"><table class="table-condensed">'+t.headTemplateV3+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datetimepicker-years"><table class="table-condensed">'+t.headTemplateV3+t.contTemplate+t.footTemplate+"<\/table><\/div><\/div>";n.fn.datetimepicker.DPGlobal=t;n.fn.datetimepicker.noConflict=function(){return n.fn.datetimepicker=old,this};n(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(t){var i=n(this);i.data("datetimepicker")||(t.preventDefault(),i.datetimepicker("show"))});n(function(){n('[data-provide="datetimepicker-inline"]').datetimepicker()})}(window.jQuery);
//# sourceMappingURL=bootstrap-datetimepicker.min.js.map
;
(function(A){A.StringBuilder=function(){var C=this;var B=[];this.Append=function(D){B[B.length]=D};this.Clear=function(){B=[]};this.IsEmpty=function(){return B.length===0};this.ToString=function(){return B.join("")}}})(jQuery);;
(function(window,document,n){(function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):jQuery&&!jQuery.fn.dataTable&&n(jQuery)})(function($){"use strict";var t=function(i){function bt(i,r){var u=t.defaults.columns,f=i.aoColumns.length,o=$.extend({},t.models.oColumn,u,{sSortingClass:i.oClasses.sSortable,sSortingClassJUI:i.oClasses.sSortJUI,nTh:r?r:document.createElement("th"),sTitle:u.sTitle?u.sTitle:r?r.innerHTML:"",aDataSort:u.aDataSort?u.aDataSort:[f],mData:u.mData?u.oDefaults:f}),e;i.aoColumns.push(o);i.aoPreSearchCols[f]===n||i.aoPreSearchCols[f]===null?i.aoPreSearchCols[f]=$.extend({},t.models.oSearch):(e=i.aoPreSearchCols[f],e.bRegex===n&&(e.bRegex=!0),e.bSmart===n&&(e.bSmart=!0),e.bCaseInsensitive===n&&(e.bCaseInsensitive=!0));kt(i,f,null)}function kt(t,i,u){var f=t.aoColumns[i],e,o;u!==n&&u!==null&&(u.mDataProp&&!u.mData&&(u.mData=u.mDataProp),u.sType!==n&&(f.sType=u.sType,f._bAutoType=!1),$.extend(f,u),r(f,u,"sWidth","sWidthOrig"),u.iDataSort!==n&&(f.aDataSort=[u.iDataSort]),r(f,u,"aDataSort"));e=f.mRender?ut(f.mRender):null;o=ut(f.mData);f.fnGetData=function(n,t){var i=o(n,t);return f.mRender&&t&&t!==""?e(i,t,n):i};f.fnSetData=gi(f.mData);t.oFeatures.bSort||(f.bSortable=!1);f.bSortable&&($.inArray("asc",f.asSorting)!=-1||$.inArray("desc",f.asSorting)!=-1)?$.inArray("asc",f.asSorting)==-1&&$.inArray("desc",f.asSorting)==-1?(f.sSortingClass=t.oClasses.sSortable,f.sSortingClassJUI=t.oClasses.sSortJUI):$.inArray("asc",f.asSorting)!=-1&&$.inArray("desc",f.asSorting)==-1?(f.sSortingClass=t.oClasses.sSortableAsc,f.sSortingClassJUI=t.oClasses.sSortJUIAscAllowed):$.inArray("asc",f.asSorting)==-1&&$.inArray("desc",f.asSorting)!=-1&&(f.sSortingClass=t.oClasses.sSortableDesc,f.sSortingClassJUI=t.oClasses.sSortJUIDescAllowed):(f.sSortingClass=t.oClasses.sSortableNone,f.sSortingClassJUI="")}function ct(n){if(n.oFeatures.bAutoWidth===!1)return!1;vi(n);for(var t=0,i=n.aoColumns.length;t<i;t++)n.aoColumns[t].nTh.style.width=n.aoColumns[t].sWidth}function wi(n,t){var i=p(n,"bVisible");return typeof i[t]=="number"?i[t]:null}function dt(n,t){var r=p(n,"bVisible"),i=$.inArray(t,r);return i!==-1?i:null}function it(n){return p(n,"bVisible").length}function p(n,t){var i=[];return $.map(n.aoColumns,function(n,r){n[t]&&i.push(r)}),i}function gt(n){for(var r,u=t.ext.aTypes,f=u.length,i=0;i<f;i++)if(r=u[i](n),r!==null)return r;return"string"}function bi(n,t){for(var i,e=t.split(","),u=[],r=0,f=n.aoColumns.length;r<f;r++)for(i=0;i<f;i++)if(n.aoColumns[r].sName==e[i]){u.push(i);break}return u}function ni(n){for(var t="",i=0,r=n.aoColumns.length;i<r;i++)t+=n.aoColumns[i].sName+",";return t.length==r?"":t.slice(0,-1)}function ki(n,t,i,r){var e,s,f,h,o,c,u;if(t)for(e=t.length-1;e>=0;e--)for(u=t[e].aTargets,$.isArray(u)||v(n,1,"aTargets must be an array of targets, not a "+typeof u),f=0,h=u.length;f<h;f++)if(typeof u[f]=="number"&&u[f]>=0){while(n.aoColumns.length<=u[f])bt(n);r(u[f],t[e])}else if(typeof u[f]=="number"&&u[f]<0)r(n.aoColumns.length+u[f],t[e]);else if(typeof u[f]=="string")for(o=0,c=n.aoColumns.length;o<c;o++)(u[f]=="_all"||$(n.aoColumns[o].nTh).hasClass(u[f]))&&r(o,t[e]);if(i)for(e=0,s=i.length;e<s;e++)r(e,i[e])}function w(n,i){var r,l=$.isArray(i)?i.slice():$.extend(!0,{},i),f=n.aoData.length,h=$.extend(!0,{},t.models.oRow),s,u,c,o;for(h._aData=l,n.aoData.push(h),u=0,c=n.aoColumns.length;u<c;u++)r=n.aoColumns[u],typeof r.fnRender=="function"&&r.bUseRendered&&r.mData!==null?y(n,f,u,ft(n,f,u)):y(n,f,u,e(n,f,u)),r._bAutoType&&r.sType!="string"&&(o=e(n,f,u,"type"),o!==null&&o!==""&&(s=gt(o),r.sType===null?r.sType=s:r.sType!=s&&r.sType!="html"&&(r.sType="string")));return n.aiDisplayMaster.push(f),n.oFeatures.bDeferRender||ui(n,f),f}function di(n){var o,v,w,b,k,u,h,p,f,it,r,d,a,i,l;if(n.bDeferLoading||n.sAjaxSource===null)for(h=n.nTBody.firstChild;h;){if(h.nodeName.toUpperCase()=="TR")for(p=n.aoData.length,h._DT_RowIndex=p,n.aoData.push($.extend(!0,{},t.models.oRow,{nTr:h})),n.aiDisplayMaster.push(p),u=h.firstChild,w=0;u;)a=u.nodeName.toUpperCase(),(a=="TD"||a=="TH")&&(y(n,p,w,$.trim(u.innerHTML)),w++),u=u.nextSibling;h=h.nextSibling}for(k=st(n),b=[],o=0,v=k.length;o<v;o++)for(u=k[o].firstChild;u;)a=u.nodeName.toUpperCase(),(a=="TD"||a=="TH")&&b.push(u),u=u.nextSibling;for(r=0,d=n.aoColumns.length;r<d;r++){i=n.aoColumns[r];i.sTitle===null&&(i.sTitle=i.nTh.innerHTML);var rt=i._bAutoType,ut=typeof i.fnRender=="function",et=i.sClass!==null,ot=i.bVisible,s,g,nt,tt;if(rt||ut||et||!ot)for(f=0,it=n.aoData.length;f<it;f++)l=n.aoData[f],s=b[f*d+r],rt&&i.sType!="string"&&(tt=e(n,f,r,"type"),tt!==""&&(g=gt(tt),i.sType===null?i.sType=g:i.sType!=g&&i.sType!="html"&&(i.sType="string"))),i.mRender?s.innerHTML=e(n,f,r,"display"):i.mData!==r&&(s.innerHTML=e(n,f,r,"display")),ut&&(nt=ft(n,f,r),s.innerHTML=nt,i.bUseRendered&&y(n,f,r,nt)),et&&(s.className+=" "+i.sClass),ot?l._anHidden[r]=null:(l._anHidden[r]=s,s.parentNode.removeChild(s)),i.fnCreatedCell&&i.fnCreatedCell.call(n.oInstance,s,e(n,f,r,"display"),l._aData,f,r)}if(n.aoRowCreatedCallback.length!==0)for(o=0,v=n.aoData.length;o<v;o++)l=n.aoData[o],c(n,"aoRowCreatedCallback",null,[l.nTr,l._aData,o])}function b(t,i){return i._DT_RowIndex!==n?i._DT_RowIndex:null}function ti(n,t,i){for(var u=d(n,t),r=0,f=n.aoColumns.length;r<f;r++)if(u[r]===i)return r;return-1}function lt(n,t,i,r){for(var f=[],u=0,o=r.length;u<o;u++)f.push(e(n,t,r[u],i));return f}function e(t,i,r,u){var f,e=t.aoColumns[r],o=t.aoData[i]._aData;if((f=e.fnGetData(o,u))===n)return t.iDrawError!=t.iDraw&&e.sDefaultContent===null&&(v(t,0,"Requested unknown parameter "+(typeof e.mData=="function"?"{mData function}":"'"+e.mData+"'")+" from the data source for row "+i),t.iDrawError=t.iDraw),e.sDefaultContent;if(f===null&&e.sDefaultContent!==null)f=e.sDefaultContent;else if(typeof f=="function")return f();return u=="display"&&f===null?"":f}function y(n,t,i,r){var u=n.aoColumns[i],f=n.aoData[t]._aData;u.fnSetData(f,r)}function ut(t){if(t===null)return function(){return null};if(typeof t=="function")return function(n,i,r){return t(n,i,r)};if(typeof t=="string"&&(t.indexOf(".")!==-1||t.indexOf("[")!==-1)){var i=function(t,r,u){var e=u.split("."),o,s,l,f,a,h,v,c;if(u!=="")for(f=0,a=e.length;f<a;f++){if(o=e[f].match(rt),o){for(e[f]=e[f].replace(rt,""),e[f]!==""&&(t=t[e[f]]),s=[],e.splice(0,f+1),l=e.join("."),h=0,v=t.length;h<v;h++)s.push(i(t[h],r,l));c=o[0].substring(1,o[0].length-1);t=c===""?s:s.join(c);break}if(t===null||t[e[f]]===n)return n;t=t[e[f]]}return t};return function(n,r){return i(n,r,t)}}return function(n){return n[t]}}function gi(t){if(t===null)return function(){};if(typeof t=="function")return function(n,i){t(n,"set",i)};if(typeof t=="string"&&(t.indexOf(".")!==-1||t.indexOf("[")!==-1)){var i=function(t,r,u){for(var o,a,f=u.split("."),s,c,h,l,e=0,v=f.length-1;e<v;e++){if(c=f[e].match(rt),c){for(f[e]=f[e].replace(rt,""),t[f[e]]=[],s=f.slice(),s.splice(0,e+1),l=s.join("."),o=0,a=r.length;o<a;o++)h={},i(h,r[o],l),t[f[e]].push(h);return}(t[f[e]]===null||t[f[e]]===n)&&(t[f[e]]={});t=t[f[e]]}t[f[f.length-1].replace(rt,"")]=r};return function(n,r){return i(n,r,t)}}return function(n,i){n[t]=i}}function at(n){for(var i=[],r=n.aoData.length,t=0;t<r;t++)i.push(n.aoData[t]._aData);return i}function ii(n){n.aoData.splice(0,n.aoData.length);n.aiDisplayMaster.splice(0,n.aiDisplayMaster.length);n.aiDisplay.splice(0,n.aiDisplay.length);s(n)}function ri(n,t){for(var r=-1,i=0,u=n.length;i<u;i++)n[i]==t?r=i:n[i]>t&&n[i]--;r!=-1&&n.splice(r,1)}function ft(n,t,i){var r=n.aoColumns[i];return r.fnRender({iDataRow:t,iDataColumn:i,oSettings:n,aData:n.aoData[t]._aData,mDataProp:r.mData},e(n,t,i,"display"))}function ui(n,t){var i=n.aoData[t],f,r,o,u;if(i.nTr===null){for(i.nTr=document.createElement("tr"),i.nTr._DT_RowIndex=t,i._aData.DT_RowId&&(i.nTr.id=i._aData.DT_RowId),i._aData.DT_RowClass&&(i.nTr.className=i._aData.DT_RowClass),r=0,o=n.aoColumns.length;r<o;r++)u=n.aoColumns[r],f=document.createElement(u.sCellType),f.innerHTML=typeof u.fnRender=="function"&&(!u.bUseRendered||u.mData===null)?ft(n,t,r):e(n,t,r,"display"),u.sClass!==null&&(f.className=u.sClass),u.bVisible?(i.nTr.appendChild(f),i._anHidden[r]=null):i._anHidden[r]=f,u.fnCreatedCell&&u.fnCreatedCell.call(n.oInstance,f,e(n,t,r,"display"),i._aData,t,r);c(n,"aoRowCreatedCallback",null,[i.nTr,i._aData,t])}}function nr(n){var t,i,r,s=$("th, td",n.nTHead).length,e,u,o,f;if(s!==0)for(t=0,r=n.aoColumns.length;t<r;t++)i=n.aoColumns[t].nTh,i.setAttribute("role","columnheader"),n.aoColumns[t].bSortable&&(i.setAttribute("tabindex",n.iTabIndex),i.setAttribute("aria-controls",n.sTableId)),n.aoColumns[t].sClass!==null&&$(i).addClass(n.aoColumns[t].sClass),n.aoColumns[t].sTitle!=i.innerHTML&&(i.innerHTML=n.aoColumns[t].sTitle);else{for(e=document.createElement("tr"),t=0,r=n.aoColumns.length;t<r;t++)i=n.aoColumns[t].nTh,i.innerHTML=n.aoColumns[t].sTitle,i.setAttribute("tabindex","0"),n.aoColumns[t].sClass!==null&&$(i).addClass(n.aoColumns[t].sClass),e.appendChild(i);$(n.nTHead).html("")[0].appendChild(e);ot(n.aoHeader,n.nTHead)}if($(n.nTHead).children("tr").attr("role","row"),n.bJUI)for(t=0,r=n.aoColumns.length;t<r;t++)i=n.aoColumns[t].nTh,u=document.createElement("div"),u.className=n.oClasses.sSortJUIWrapper,$(i).contents().appendTo(u),o=document.createElement("span"),o.className=n.oClasses.sSortIcon,u.appendChild(o),i.appendChild(u);if(n.oFeatures.bSort)for(t=0;t<n.aoColumns.length;t++)n.aoColumns[t].bSortable!==!1?yi(n,n.aoColumns[t].nTh,t):$(n.aoColumns[t].nTh).addClass(n.oClasses.sSortableNone);if(n.oClasses.sFooterTH!==""&&$(n.nTFoot).children("tr").children("th").addClass(n.oClasses.sFooterTH),n.nTFoot!==null)for(f=g(n,null,n.aoFooter),t=0,r=n.aoColumns.length;t<r;t++)f[t]&&(n.aoColumns[t].nTf=f[t],n.aoColumns[t].sClass&&$(f[t]).addClass(n.aoColumns[t].sClass))}function et(t,i,r){var u,l,f,v,a,y,h,e=[],c=[],p=t.aoColumns.length,o,s;for(r===n&&(r=!1),u=0,l=i.length;u<l;u++){for(e[u]=i[u].slice(),e[u].nTr=i[u].nTr,f=p-1;f>=0;f--)t.aoColumns[f].bVisible||r||e[u].splice(f,1);c.push([])}for(u=0,l=e.length;u<l;u++){if(h=e[u].nTr,h)while(y=h.firstChild)h.removeChild(y);for(f=0,v=e[u].length;f<v;f++)if(o=1,s=1,c[u][f]===n){for(h.appendChild(e[u][f].cell),c[u][f]=1;e[u+o]!==n&&e[u][f].cell==e[u+o][f].cell;)c[u+o][f]=1,o++;while(e[u][f+s]!==n&&e[u][f].cell==e[u][f+s].cell){for(a=0;a<o;a++)c[u+a][f+s]=1;s++}e[u][f].cell.rowSpan=o;e[u][f].cell.colSpan=s}}}function o(t){var ft=c(t,"aoPreDrawCallback","preDraw",[t]),w,b,r,u,e,y,o,h,p,f,k,ut,d;if($.inArray(!1,ft)!==-1){a(t,!1);return}var l,g,nt,i=[],v=0,tt=t.asStripeClasses.length,rt=t.aoOpenRows.length;if(t.bDrawing=!0,t.iInitDisplayStart!==n&&t.iInitDisplayStart!=-1&&(t._iDisplayStart=t.oFeatures.bServerSide?t.iInitDisplayStart:t.iInitDisplayStart>=t.fnRecordsDisplay()?0:t.iInitDisplayStart,t.iInitDisplayStart=-1,s(t)),t.bDeferLoading)t.bDeferLoading=!1,t.iDraw++;else if(t.oFeatures.bServerSide){if(!t.bDestroying&&!ir(t))return}else t.iDraw++;if(t.aiDisplay.length!==0){for(w=t._iDisplayStart,b=t._iDisplayEnd,t.oFeatures.bServerSide&&(w=0,b=t.aoData.length),r=w;r<b;r++)if(u=t.aoData[t.aiDisplay[r]],u.nTr===null&&ui(t,t.aiDisplay[r]),e=u.nTr,tt!==0&&(y=t.asStripeClasses[v%tt],u._sRowStripe!=y&&($(e).removeClass(u._sRowStripe).addClass(y),u._sRowStripe=y)),c(t,"aoRowCallback",null,[e,t.aoData[t.aiDisplay[r]]._aData,v,r]),i.push(e),v++,rt!==0)for(o=0;o<rt;o++)if(e==t.aoOpenRows[o].nParent){i.push(t.aoOpenRows[o].nTr);break}}else i[0]=document.createElement("tr"),t.asStripeClasses[0]&&(i[0].className=t.asStripeClasses[0]),h=t.oLanguage,p=h.sZeroRecords,t.iDraw!=1||t.sAjaxSource===null||t.oFeatures.bServerSide?h.sEmptyTable&&t.fnRecordsTotal()===0&&(p=h.sEmptyTable):p=h.sLoadingRecords,f=document.createElement("td"),f.setAttribute("valign","top"),f.colSpan=it(t),f.className=t.oClasses.sRowEmpty,f.innerHTML=ci(t,p),i[v].appendChild(f);if(c(t,"aoHeaderCallback","header",[$(t.nTHead).children("tr")[0],at(t),t._iDisplayStart,t.fnDisplayEnd(),t.aiDisplay]),c(t,"aoFooterCallback","footer",[$(t.nTFoot).children("tr")[0],at(t),t._iDisplayStart,t.fnDisplayEnd(),t.aiDisplay]),k=document.createDocumentFragment(),ut=document.createDocumentFragment(),t.nTBody){if(d=t.nTBody.parentNode,ut.appendChild(t.nTBody),!t.oScroll.bInfinite||!t._bInitComplete||t.bSorted||t.bFiltered)while(nt=t.nTBody.firstChild)t.nTBody.removeChild(nt);for(l=0,g=i.length;l<g;l++)k.appendChild(i[l]);t.nTBody.appendChild(k);d!==null&&d.appendChild(t.nTBody)}c(t,"aoDrawCallback","draw",[t]);t.bSorted=!1;t.bFiltered=!1;t.bDrawing=!1;t.oFeatures.bServerSide&&(a(t,!1),t._bInitComplete||pt(t))}function vt(n){n.oFeatures.bSort?nt(n,n.oPreviousSearch):n.oFeatures.bFilter?k(n,n.oPreviousSearch):(s(n),o(n))}function tr(n){var p=$("<div><\/div>")[0],s,h,u,f,i,o,a,r,c,e,v,y,l,w;for(n.nTable.parentNode.insertBefore(p,n.nTable),n.nTableWrapper=$('<div id="'+n.sTableId+'_wrapper" class="'+n.oClasses.sWrapper+'" role="grid"><\/div>')[0],n.nTableReinsertBefore=n.nTable.nextSibling,s=n.nTableWrapper,h=n.sDom.split(""),e=0;e<h.length;e++){if(f=0,i=h[e],i=="<"){if(o=$("<div><\/div>")[0],a=h[e+1],a=="'"||a=='"'){for(r="",c=2;h[e+c]!=a;)r+=h[e+c],c++;r=="H"?r=n.oClasses.sJUIHeader:r=="F"&&(r=n.oClasses.sJUIFooter);r.indexOf(".")!=-1?(v=r.split("."),o.id=v[0].substr(1,v[0].length-1),o.className=v[1]):r.charAt(0)=="#"?o.id=r.substr(1,r.length-1):o.className=r;e+=c}s.appendChild(o);s=o}else if(i==">")s=s.parentNode;else if(i=="l"&&n.oFeatures.bPaginate&&n.oFeatures.bLengthChange)u=ar(n),f=1;else if(i=="f"&&n.oFeatures.bFilter)u=fr(n),f=1;else if(i=="r"&&n.oFeatures.bProcessing)u=yr(n),f=1;else if(i=="t")u=pr(n),f=1;else if(i=="i"&&n.oFeatures.bInfo)u=cr(n),f=1;else if(i=="p"&&n.oFeatures.bPaginate)u=vr(n),f=1;else if(t.ext.aoFeatures.length!==0)for(y=t.ext.aoFeatures,l=0,w=y.length;l<w;l++)if(i==y[l].cFeature){u=y[l].fnInit(n);u&&(f=1);break}f==1&&u!==null&&(typeof n.aanFeatures[i]!="object"&&(n.aanFeatures[i]=[]),n.aanFeatures[i].push(u),s.appendChild(u))}p.parentNode.replaceChild(n.nTableWrapper,p)}function ot(n,t){var h=$(t).children("tr"),c,r,i,e,o,s,l,a,u,f,v,y=function(n,t,i){for(var r=n[t];r[i];)i++;return i};for(n.splice(0,n.length),i=0,s=h.length;i<s;i++)n.push([]);for(i=0,s=h.length;i<s;i++)for(c=h[i],a=0,r=c.firstChild;r;){if(r.nodeName.toUpperCase()=="TD"||r.nodeName.toUpperCase()=="TH")for(u=r.getAttribute("colspan")*1,f=r.getAttribute("rowspan")*1,u=!u||u===0||u===1?1:u,f=!f||f===0||f===1?1:f,l=y(n,i,a),v=u===1?!0:!1,o=0;o<u;o++)for(e=0;e<f;e++)n[i+e][l+o]={cell:r,unique:v},n[i+e].nTr=c;r=r.nextSibling}}function g(n,t,i){var f=[],u,e,r,o;for(i||(i=n.aoHeader,t&&(i=[],ot(i,t))),u=0,e=i.length;u<e;u++)for(r=0,o=i[u].length;r<o;r++)!i[u][r].unique||f[r]&&n.bSortCellsTop||(f[r]=i[u][r].cell);return f}function ir(n){if(n.bAjaxDataGet){n.iDraw++;a(n,!0);var i=n.aoColumns.length,t=rr(n);return fi(n,t),n.fnServerData.call(n.oInstance,n.sAjaxSource,t,function(t){ur(n,t)},n),!1}return!0}function rr(n){var u=n.aoColumns.length,i=[],o,f,s,t,e,r;for(i.push({name:"sEcho",value:n.iDraw}),i.push({name:"iColumns",value:u}),i.push({name:"sColumns",value:ni(n)}),i.push({name:"iDisplayStart",value:n._iDisplayStart}),i.push({name:"iDisplayLength",value:n.oFeatures.bPaginate!==!1?n._iDisplayLength:-1}),t=0;t<u;t++)o=n.aoColumns[t].mData,i.push({name:"mDataProp_"+t,value:typeof o=="function"?"function":o});if(n.oFeatures.bFilter!==!1)for(i.push({name:"sSearch",value:n.oPreviousSearch.sSearch}),i.push({name:"bRegex",value:n.oPreviousSearch.bRegex}),t=0;t<u;t++)i.push({name:"sSearch_"+t,value:n.aoPreSearchCols[t].sSearch}),i.push({name:"bRegex_"+t,value:n.aoPreSearchCols[t].bRegex}),i.push({name:"bSearchable_"+t,value:n.aoColumns[t].bSearchable});if(n.oFeatures.bSort!==!1){for(r=0,f=n.aaSortingFixed!==null?n.aaSortingFixed.concat(n.aaSorting):n.aaSorting.slice(),t=0;t<f.length;t++)for(s=n.aoColumns[f[t][0]].aDataSort,e=0;e<s.length;e++)i.push({name:"iSortCol_"+r,value:s[e]}),i.push({name:"sSortDir_"+r,value:f[t][1]}),r++;for(i.push({name:"iSortingCols",value:r}),t=0;t<u;t++)i.push({name:"bSortable_"+t,value:n.aoColumns[t].bSortable})}return i}function fi(n,t){c(n,"aoServerParams","serverParams",[t])}function ur(t,i){var e,s,c,u,r,l,h,f,v;if(i.sEcho!==n){if(i.sEcho*1<t.iDraw)return;t.iDraw=i.sEcho*1}for((!t.oScroll.bInfinite||t.oScroll.bInfinite&&(t.bSorted||t.bFiltered))&&ii(t),t._iRecordsTotal=parseInt(i.iTotalRecords,10),t._iRecordsDisplay=parseInt(i.iTotalDisplayRecords,10),e=ni(t),s=i.sColumns!==n&&e!==""&&i.sColumns!=e,s&&(c=bi(t,i.sColumns)),u=ut(t.sAjaxDataProp)(i),r=0,l=u.length;r<l;r++)if(s){for(h=[],f=0,v=t.aoColumns.length;f<v;f++)h.push(u[r][c[f]]);w(t,h)}else w(t,u[r]);t.aiDisplay=t.aiDisplayMaster.slice();t.bAjaxDataGet=!1;o(t);t.bAjaxDataGet=!0;a(t,!1)}function fr(n){var r=n.oPreviousSearch,i=n.oLanguage.sSearch,t,u;return i=i.indexOf("_INPUT_")!==-1?i.replace("_INPUT_",'<input type="text" />'):i===""?'<input type="text" />':i+' <input type="text" />',t=document.createElement("div"),t.className=n.oClasses.sFilter,t.innerHTML="<label>"+i+"<\/label>",n.aanFeatures.f||(t.id=n.sTableId+"_filter"),u=$('input[type="text"]',t),t._DT_Input=u[0],u.val(r.sSearch.replace('"',"&quot;")),u.bind("keyup.DT",function(){for(var i=n.aanFeatures.f,u=this.value===""?"":this.value,t=0,f=i.length;t<f;t++)i[t]!=$(this).parents("div.dataTables_filter")[0]&&$(i[t]._DT_Input).val(u);u!=r.sSearch&&k(n,{sSearch:u,bRegex:r.bRegex,bSmart:r.bSmart,bCaseInsensitive:r.bCaseInsensitive})}),u.attr("aria-controls",n.sTableId).bind("keypress.DT",function(n){if(n.keyCode==13)return!1}),t}function k(n,t,i){var u=n.oPreviousSearch,f=n.aoPreSearchCols,e=function(n){u.sSearch=n.sSearch;u.bRegex=n.bRegex;u.bSmart=n.bSmart;u.bCaseInsensitive=n.bCaseInsensitive},r;if(n.oFeatures.bServerSide)e(t);else{for(sr(n,t.sSearch,i,t.bRegex,t.bSmart,t.bCaseInsensitive),e(t),r=0;r<n.aoPreSearchCols.length;r++)or(n,f[r].sSearch,r,f[r].bRegex,f[r].bSmart,f[r].bCaseInsensitive);er(n)}n.bFiltered=!0;$(n.oInstance).trigger("filter",n);n._iDisplayStart=0;s(n);o(n);ei(n,0)}function er(n){for(var r,i,o,f,s,e=t.ext.afnFiltering,h=p(n,"bSearchable"),u=0,c=e.length;u<c;u++)for(r=0,i=0,o=n.aiDisplay.length;i<o;i++)f=n.aiDisplay[i-r],s=e[u](n,lt(n,f,"filter",h),f),s||(n.aiDisplay.splice(i-r,1),r++)}function or(n,t,i,r,u,f){var s,h,o,c;if(t!=="")for(s=0,h=si(t,r,u,f),o=n.aiDisplay.length-1;o>=0;o--)c=hr(e(n,n.aiDisplay[o],i,"filter"),n.aoColumns[i].sType),h.test(c)||(n.aiDisplay.splice(o,1),s++)}function sr(n,i,r,u,f,e){var o,h=si(i,u,f,e),c=n.oPreviousSearch,s;if(r||(r=0),t.ext.afnFiltering.length!==0&&(r=1),i.length<=0)n.aiDisplay.splice(0,n.aiDisplay.length),n.aiDisplay=n.aiDisplayMaster.slice();else if(n.aiDisplay.length==n.aiDisplayMaster.length||c.sSearch.length>i.length||r==1||i.indexOf(c.sSearch)!==0)for(n.aiDisplay.splice(0,n.aiDisplay.length),ei(n,1),o=0;o<n.aiDisplayMaster.length;o++)h.test(n.asDataSearch[o])&&n.aiDisplay.push(n.aiDisplayMaster[o]);else for(s=0,o=0;o<n.asDataSearch.length;o++)h.test(n.asDataSearch[o])||(n.aiDisplay.splice(o-s,1),s++)}function ei(n,t){var u,r,i,f;if(!n.oFeatures.bServerSide)for(n.asDataSearch=[],u=p(n,"bSearchable"),r=t===1?n.aiDisplayMaster:n.aiDisplay,i=0,f=r.length;i<f;i++)n.asDataSearch[i]=oi(n,lt(n,r[i],"filter",u))}function oi(n,t){var i=t.join("  ");return i.indexOf("&")!==-1&&(i=$("<div>").html(i).text()),i.replace(/[\n\r]/g," ")}function si(n,t,i,r){var u,f;return i?(u=t?n.split(" "):hi(n).split(" "),f="^(?=.*?"+u.join(")(?=.*?")+").*$",new RegExp(f,r?"i":"")):(n=t?n:hi(n),new RegExp(n,r?"i":""))}function hr(n,i){return typeof t.ext.ofnSearch[i]=="function"?t.ext.ofnSearch[i](n):n===null?"":i=="html"?n.replace(/[\r\n]/g," ").replace(/<.*?>/g,""):typeof n=="string"?n.replace(/[\r\n]/g," "):n}function hi(n){var t=new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^|\\-)","g");return n.replace(t,"\\$1")}function cr(n){var t=document.createElement("div");return t.className=n.oClasses.sInfo,n.aanFeatures.i||(n.aoDrawCallback.push({fn:lr,sName:"information"}),t.id=n.sTableId+"_info"),n.nTable.setAttribute("aria-describedby",n.sTableId+"_info"),t}function lr(n){var f,r,o;if(n.oFeatures.bInfo&&n.aanFeatures.i.length!==0){var i=n.oLanguage,s=n._iDisplayStart+1,h=n.fnDisplayEnd(),e=n.fnRecordsTotal(),u=n.fnRecordsDisplay(),t;for(t=u===0?i.sInfoEmpty:i.sInfo,u!=e&&(t+=" "+i.sInfoFiltered),t+=i.sInfoPostFix,t=ci(n,t),i.fnInfoCallback!==null&&(t=i.fnInfoCallback.call(n.oInstance,n,s,h,e,u,t)),f=n.aanFeatures.i,r=0,o=f.length;r<o;r++)$(f[r]).html(t)}}function ci(n,t){var r=n._iDisplayStart+1,i=n.fnFormatNumber(r),u=n.fnDisplayEnd(),f=n.fnFormatNumber(u),e=n.fnRecordsDisplay(),o=n.fnFormatNumber(e),s=n.fnRecordsTotal(),h=n.fnFormatNumber(s);return n.oScroll.bInfinite&&(i=n.fnFormatNumber(1)),t.replace(/_START_/g,i).replace(/_END_/g,f).replace(/_TOTAL_/g,o).replace(/_MAX_/g,h)}function yt(n){var t,r,f=n.iInitDisplayStart,i;if(n.bInitialised===!1){setTimeout(function(){yt(n)},200);return}for(tr(n),nr(n),et(n,n.aoHeader),n.nTFoot&&et(n,n.aoFooter),a(n,!0),n.oFeatures.bAutoWidth&&vi(n),t=0,r=n.aoColumns.length;t<r;t++)n.aoColumns[t].sWidth!==null&&(n.aoColumns[t].nTh.style.width=u(n.aoColumns[t].sWidth));if(n.oFeatures.bSort?nt(n):n.oFeatures.bFilter?k(n,n.oPreviousSearch):(n.aiDisplay=n.aiDisplayMaster.slice(),s(n),o(n)),n.sAjaxSource!==null&&!n.oFeatures.bServerSide){i=[];fi(n,i);n.fnServerData.call(n.oInstance,n.sAjaxSource,i,function(i){var r=n.sAjaxDataProp!==""?ut(n.sAjaxDataProp)(i):i;for(t=0;t<r.length;t++)w(n,r[t]);n.iInitDisplayStart=f;n.oFeatures.bSort?nt(n):(n.aiDisplay=n.aiDisplayMaster.slice(),s(n),o(n));a(n,!1);pt(n,i)},n);return}n.oFeatures.bServerSide||(a(n,!1),pt(n))}function pt(n,t){n._bInitComplete=!0;c(n,"aoInitComplete","init",[n,t])}function li(n){var i=t.defaults.oLanguage;!n.sEmptyTable&&n.sZeroRecords&&i.sEmptyTable==="No data available in table"&&r(n,n,"sZeroRecords","sEmptyTable");!n.sLoadingRecords&&n.sZeroRecords&&i.sLoadingRecords==="Loading..."&&r(n,n,"sZeroRecords","sLoadingRecords")}function ar(n){var r;if(n.oScroll.bInfinite)return null;var e='name="'+n.sTableId+'_length"',f='<select size="1" '+e+">",t,u,i=n.aLengthMenu;if(i.length==2&&typeof i[0]=="object"&&typeof i[1]=="object")for(t=0,u=i[0].length;t<u;t++)f+='<option value="'+i[0][t]+'">'+i[1][t]+"<\/option>";else for(t=0,u=i.length;t<u;t++)f+='<option value="'+i[t]+'">'+i[t]+"<\/option>";return f+="<\/select>",r=document.createElement("div"),n.aanFeatures.l||(r.id=n.sTableId+"_length"),r.className=n.oClasses.sLength,r.innerHTML="<label>"+n.oLanguage.sLengthMenu.replace("_MENU_",f)+"<\/label>",$('select option[value="'+n._iDisplayLength+'"]',r).attr("selected",!0),$("select",r).bind("change.DT",function(){var r=$(this).val(),i=n.aanFeatures.l;for(t=0,u=i.length;t<u;t++)i[t]!=this.parentNode&&$("select",i[t]).val(r);n._iDisplayLength=parseInt(r,10);s(n);n.fnDisplayEnd()==n.fnRecordsDisplay()&&(n._iDisplayStart=n.fnDisplayEnd()-n._iDisplayLength,n._iDisplayStart<0&&(n._iDisplayStart=0));n._iDisplayLength==-1&&(n._iDisplayStart=0);o(n)}),$("select",r).attr("aria-controls",n.sTableId),r}function s(n){n._iDisplayEnd=n.oFeatures.bPaginate===!1?n.aiDisplay.length:n._iDisplayStart+n._iDisplayLength>n.aiDisplay.length||n._iDisplayLength==-1?n.aiDisplay.length:n._iDisplayStart+n._iDisplayLength}function vr(n){if(n.oScroll.bInfinite)return null;var i=document.createElement("div");return i.className=n.oClasses.sPaging+n.sPaginationType,t.ext.oPagination[n.sPaginationType].fnInit(n,i,function(n){s(n);o(n)}),n.aanFeatures.p||n.aoDrawCallback.push({fn:function(n){t.ext.oPagination[n.sPaginationType].fnUpdate(n,function(n){s(n);o(n)})},sName:"pagination"}),i}function ai(n,t){var r=n._iDisplayStart,i;return typeof t=="number"?(n._iDisplayStart=t*n._iDisplayLength,n._iDisplayStart>n.fnRecordsDisplay()&&(n._iDisplayStart=0)):t=="first"?n._iDisplayStart=0:t=="previous"?(n._iDisplayStart=n._iDisplayLength>=0?n._iDisplayStart-n._iDisplayLength:0,n._iDisplayStart<0&&(n._iDisplayStart=0)):t=="next"?n._iDisplayLength>=0?n._iDisplayStart+n._iDisplayLength<n.fnRecordsDisplay()&&(n._iDisplayStart+=n._iDisplayLength):n._iDisplayStart=0:t=="last"?n._iDisplayLength>=0?(i=parseInt((n.fnRecordsDisplay()-1)/n._iDisplayLength,10)+1,n._iDisplayStart=(i-1)*n._iDisplayLength):n._iDisplayStart=0:v(n,0,"Unknown paging action: "+t),$(n.oInstance).trigger("page",n),r!=n._iDisplayStart}function yr(n){var t=document.createElement("div");return n.aanFeatures.r||(t.id=n.sTableId+"_processing"),t.innerHTML=n.oLanguage.sProcessing,t.className=n.oClasses.sProcessing,n.nTable.parentNode.insertBefore(t,n.nTable),t}function a(n,t){var r,i,u;if(n.oFeatures.bProcessing)for(r=n.aanFeatures.r,i=0,u=r.length;i<u;i++)r[i].style.visibility=t?"visible":"hidden";$(n.oInstance).trigger("processing",[n,t])}function pr(n){var f;if(n.oScroll.sX===""&&n.oScroll.sY==="")return n.nTable;var c=document.createElement("div"),t=document.createElement("div"),v=document.createElement("div"),i=document.createElement("div"),r=document.createElement("div"),y=document.createElement("div"),l=n.nTable.cloneNode(!1),a=n.nTable.cloneNode(!1),p=n.nTable.getElementsByTagName("thead")[0],e=n.nTable.getElementsByTagName("tfoot").length===0?null:n.nTable.getElementsByTagName("tfoot")[0],h=n.oClasses;return t.appendChild(v),r.appendChild(y),i.appendChild(n.nTable),c.appendChild(t),c.appendChild(i),v.appendChild(l),l.appendChild(p),e!==null&&(c.appendChild(r),y.appendChild(a),a.appendChild(e)),c.className=h.sScrollWrapper,t.className=h.sScrollHead,v.className=h.sScrollHeadInner,i.className=h.sScrollBody,r.className=h.sScrollFoot,y.className=h.sScrollFootInner,n.oScroll.bAutoCss&&(t.style.overflow="hidden",t.style.position="relative",r.style.overflow="hidden",i.style.overflow="auto"),t.style.border="0",t.style.width="100%",r.style.border="0",v.style.width=n.oScroll.sXInner!==""?n.oScroll.sXInner:"100%",l.removeAttribute("id"),l.style.marginLeft="0",n.nTable.style.marginLeft="0",e!==null&&(a.removeAttribute("id"),a.style.marginLeft="0"),f=$(n.nTable).children("caption"),f.length>0&&(f=f[0],f._captionSide==="top"?l.appendChild(f):f._captionSide==="bottom"&&e&&a.appendChild(f)),n.oScroll.sX!==""&&(t.style.width=u(n.oScroll.sX),i.style.width=u(n.oScroll.sX),e!==null&&(r.style.width=u(n.oScroll.sX)),$(i).scroll(function(){t.scrollLeft=this.scrollLeft;e!==null&&(r.scrollLeft=this.scrollLeft)})),n.oScroll.sY!==""&&(i.style.height=u(n.oScroll.sY)),n.aoDrawCallback.push({fn:wr,sName:"scrolling"}),n.oScroll.bInfinite&&$(i).scroll(function(){n.bDrawing||$(this).scrollTop()===0||$(this).scrollTop()+$(this).height()>$(n.nTable).height()-n.oScroll.iLoadGap&&n.fnDisplayEnd()<n.fnRecordsDisplay()&&(ai(n,"next"),s(n),o(n))}),n.nScrollHead=t,n.nScrollFoot=r,c}function wr(n){var c=n.nScrollHead.getElementsByTagName("div")[0],ot=c.getElementsByTagName("table")[0],t=n.nTable.parentNode,e,tt,it,o,r,rt,f,ut,a,y,p=[],w=[],i,b=n.nTFoot!==null?n.nScrollFoot.getElementsByTagName("div")[0]:null,st=n.nTFoot!==null?b.getElementsByTagName("table")[0]:null,k=n.oBrowser.bScrollOversize,ft=function(n){f=n.style;f.paddingTop="0";f.paddingBottom="0";f.borderTopWidth="0";f.borderBottomWidth="0";f.height=0},d,s,et,h,nt;for($(n.nTable).children("thead, tfoot").remove(),a=$(n.nTHead).clone()[0],n.nTable.insertBefore(a,n.nTable.childNodes[0]),it=n.nTHead.getElementsByTagName("tr"),o=a.getElementsByTagName("tr"),n.nTFoot!==null&&(y=$(n.nTFoot).clone()[0],n.nTable.insertBefore(y,n.nTable.childNodes[1]),rt=n.nTFoot.getElementsByTagName("tr"),r=y.getElementsByTagName("tr")),n.oScroll.sX===""&&(t.style.width="100%",c.parentNode.style.width="100%"),d=g(n,a),e=0,tt=d.length;e<tt;e++)ut=wi(n,e),d[e].style.width=n.aoColumns[ut].sWidth;n.nTFoot!==null&&l(function(n){n.style.width=""},r);n.oScroll.bCollapse&&n.oScroll.sY!==""&&(t.style.height=t.offsetHeight+n.nTHead.offsetHeight+"px");i=$(n.nTable).outerWidth();n.oScroll.sX===""?(n.nTable.style.width="100%",k&&($("tbody",t).height()>t.offsetHeight||$(t).css("overflow-y")=="scroll")&&(n.nTable.style.width=u($(n.nTable).outerWidth()-n.oScroll.iBarWidth))):n.oScroll.sXInner!==""?n.nTable.style.width=u(n.oScroll.sXInner):i==$(t).width()&&$(t).height()<$(n.nTable).height()?(n.nTable.style.width=u(i-n.oScroll.iBarWidth),$(n.nTable).outerWidth()>i-n.oScroll.iBarWidth&&(n.nTable.style.width=u(i))):n.nTable.style.width=u(i);i=$(n.nTable).outerWidth();l(ft,o);l(function(n){p.push(u($(n).width()))},o);l(function(n,t){n.style.width=p[t]},it);$(o).height(0);n.nTFoot!==null&&(l(ft,r),l(function(n){w.push(u($(n).width()))},r),l(function(n,t){n.style.width=w[t]},rt),$(r).height(0));l(function(n,t){n.innerHTML="";n.style.width=p[t]},o);n.nTFoot!==null&&l(function(n,t){n.innerHTML="";n.style.width=w[t]},r);$(n.nTable).outerWidth()<i?(s=t.scrollHeight>t.offsetHeight||$(t).css("overflow-y")=="scroll"?i+n.oScroll.iBarWidth:i,k&&(t.scrollHeight>t.offsetHeight||$(t).css("overflow-y")=="scroll")&&(n.nTable.style.width=u(s-n.oScroll.iBarWidth)),t.style.width=u(s),n.nScrollHead.style.width=u(s),n.nTFoot!==null&&(n.nScrollFoot.style.width=u(s)),n.oScroll.sX===""?v(n,1,"The table cannot fit into the current element which will cause column misalignment. The table has been drawn at its minimum possible width."):n.oScroll.sXInner!==""&&v(n,1,"The table cannot fit into the current element which will cause column misalignment. Increase the sScrollXInner value or remove it to allow automatic calculation")):(t.style.width=u("100%"),n.nScrollHead.style.width=u("100%"),n.nTFoot!==null&&(n.nScrollFoot.style.width=u("100%")));n.oScroll.sY===""&&k&&(t.style.height=u(n.nTable.offsetHeight+n.oScroll.iBarWidth));n.oScroll.sY!==""&&n.oScroll.bCollapse&&(t.style.height=u(n.oScroll.sY),et=n.oScroll.sX!==""&&n.nTable.offsetWidth>t.offsetWidth?n.oScroll.iBarWidth:0,n.nTable.offsetHeight<t.offsetHeight&&(t.style.height=u(n.nTable.offsetHeight+et)));h=$(n.nTable).outerWidth();ot.style.width=u(h);c.style.width=u(h);nt=$(n.nTable).height()>t.clientHeight||$(t).css("overflow-y")=="scroll";c.style.paddingRight=nt?n.oScroll.iBarWidth+"px":"0px";n.nTFoot!==null&&(st.style.width=u(h),b.style.width=u(h),b.style.paddingRight=nt?n.oScroll.iBarWidth+"px":"0px");$(t).scroll();(n.bSorted||n.bFiltered)&&(t.scrollTop=0)}function l(n,t,i){for(var e=0,u=0,o=t.length,r,f;u<o;){for(r=t[u].firstChild,f=i?i[u].firstChild:null;r;)r.nodeType===1&&(i?n(r,f,e):n(r,e),e++),r=r.nextSibling,f=i?f.nextSibling:null;u++}}function br(n,t){if(!n||n===null||n==="")return 0;t||(t=document.body);var r,i=document.createElement("div");return i.style.width=u(n),t.appendChild(i),r=i.offsetWidth,t.removeChild(i),r}function vi(n){for(var ut=n.nTable.offsetWidth,k=0,e,d=0,h=n.aoColumns.length,r,a,nt=$("th",n.nTHead),v=n.nTable.getAttribute("width"),c=n.nTable.parentNode,p,w,o,s,f,y,b,t=0;t<h;t++)n.aoColumns[t].bVisible&&(d++,n.aoColumns[t].sWidth!==null&&(e=br(n.aoColumns[t].sWidthOrig,c),e!==null&&(n.aoColumns[t].sWidth=u(e)),k++));if(h==nt.length&&k===0&&d==h&&n.oScroll.sX===""&&n.oScroll.sY==="")for(t=0;t<n.aoColumns.length;t++)e=$(nt[t]).width(),e!==null&&(n.aoColumns[t].sWidth=u(e));else{var i=n.nTable.cloneNode(!1),tt=n.nTHead.cloneNode(!0),it=document.createElement("tbody"),rt=document.createElement("tr");for(i.removeAttribute("id"),i.appendChild(tt),n.nTFoot!==null&&(i.appendChild(n.nTFoot.cloneNode(!0)),l(function(n){n.style.width=""},i.getElementsByTagName("tr"))),i.appendChild(it),it.appendChild(rt),p=$("thead th",i),p.length===0&&(p=$("tbody tr:eq(0)>td",i)),w=g(n,tt),r=0,t=0;t<h;t++)o=n.aoColumns[t],o.bVisible&&o.sWidthOrig!==null&&o.sWidthOrig!==""?w[t-r].style.width=u(o.sWidthOrig):o.bVisible?w[t-r].style.width="":r++;for(t=0;t<h;t++)n.aoColumns[t].bVisible&&(s=dr(n,t),s!==null&&(s=s.cloneNode(!0),n.aoColumns[t].sContentPadding!==""&&(s.innerHTML+=n.aoColumns[t].sContentPadding),rt.appendChild(s)));if(c.appendChild(i),n.oScroll.sX!==""&&n.oScroll.sXInner!==""?i.style.width=u(n.oScroll.sXInner):n.oScroll.sX!==""?(i.style.width="",$(i).width()<c.offsetWidth&&(i.style.width=u(c.offsetWidth))):n.oScroll.sY!==""?i.style.width=u(c.offsetWidth):v&&(i.style.width=u(v)),i.style.visibility="hidden",kr(n,i),f=$("tbody tr:eq(0)",i).children(),f.length===0&&(f=g(n,$("thead",i)[0])),n.oScroll.sX!==""){for(y=0,r=0,t=0;t<n.aoColumns.length;t++)n.aoColumns[t].bVisible&&(y+=n.aoColumns[t].sWidthOrig===null?$(f[r]).outerWidth():parseInt(n.aoColumns[t].sWidth.replace("px",""),10)+($(f[r]).outerWidth()-$(f[r]).width()),r++);i.style.width=u(y);n.nTable.style.width=u(y)}for(r=0,t=0;t<n.aoColumns.length;t++)n.aoColumns[t].bVisible&&(a=$(f[r]).width(),a!==null&&a>0&&(n.aoColumns[t].sWidth=u(a)),r++);b=$(i).css("width");n.nTable.style.width=b.indexOf("%")!==-1?b:u($(i).outerWidth());i.parentNode.removeChild(i)}v&&(n.nTable.style.width=u(v))}function kr(n,t){if(n.oScroll.sX===""&&n.oScroll.sY!==""){var i=$(t).width();t.style.width=u($(t).outerWidth()-n.oScroll.iBarWidth)}else n.oScroll.sX!==""&&(t.style.width=u($(t).outerWidth()))}function dr(n,t){var i=gr(n,t),r;return i<0?null:n.aoData[i].nTr===null?(r=document.createElement("td"),r.innerHTML=e(n,i,t,""),r):d(n,i)[t]}function gr(n,t){for(var i,u=-1,f=-1,r=0;r<n.aoData.length;r++)i=e(n,r,t,"display")+"",i=i.replace(/<.*?>/g,""),i.length>u&&(u=i.length,f=r);return f}function u(n){if(n===null)return"0px";if(typeof n=="number")return n<0?"0px":n+"px";var t=n.charCodeAt(n.length-1);return t<48||t>57?n:n+"px"}function nu(){var i=document.createElement("p"),n=i.style,t,u,r;return n.width="100%",n.height="200px",n.padding="0px",t=document.createElement("div"),n=t.style,n.position="absolute",n.top="0px",n.left="0px",n.visibility="hidden",n.width="200px",n.height="150px",n.padding="0px",n.overflow="hidden",t.appendChild(i),document.body.appendChild(t),u=i.offsetWidth,t.style.overflow="scroll",r=i.offsetWidth,u==r&&(r=t.clientWidth),document.body.removeChild(t),u-r}function nt(i,r){var u,p,c,st,l,ht,w,a,f=[],rt=[],ut=t.ext.oSort,b=i.aoData,h=i.aoColumns,nt=i.oLanguage.oAria,d,ct,ft,et,ot,g,it,lt;if(!i.oFeatures.bServerSide&&(i.aaSorting.length!==0||i.aaSortingFixed!==null)){for(f=i.aaSortingFixed!==null?i.aaSortingFixed.concat(i.aaSorting):i.aaSorting.slice(),u=0;u<f.length;u++)if(d=f[u][0],ct=dt(i,d),w=i.aoColumns[d].sSortDataType,t.ext.afnSortData[w])if(ft=t.ext.afnSortData[w].call(i.oInstance,i,d,ct),ft.length===b.length)for(c=0,st=b.length;c<st;c++)y(i,c,d,ft[c]);else v(i,0,"Returned data sort array (col "+d+") is the wrong length");for(u=0,p=i.aiDisplayMaster.length;u<p;u++)rt[i.aiDisplayMaster[u]]=u;for(et=f.length,u=0,p=b.length;u<p;u++)for(c=0;c<et;c++)for(g=h[f[c][0]].aDataSort,l=0,ht=g.length;l<ht;l++)w=h[g[l]].sType,ot=ut[(w?w:"string")+"-pre"],b[u]._aSortData[g[l]]=ot?ot(e(i,u,g[l],"sort")):e(i,u,g[l],"sort");i.aiDisplayMaster.sort(function(n,t){for(var i,s,e,u,o,r=0;r<et;r++)for(u=h[f[r][0]].aDataSort,i=0,s=u.length;i<s;i++)if(o=h[u[i]].sType,e=ut[(o?o:"string")+"-"+f[r][1]](b[n]._aSortData[u[i]],b[t]._aSortData[u[i]]),e!==0)return e;return ut["numeric-asc"](rt[n],rt[t])})}for((r===n||r)&&!i.oFeatures.bDeferRender&&tt(i),u=0,p=i.aoColumns.length;u<p;u++)it=h[u].sTitle.replace(/<.*?>/g,""),a=h[u].nTh,a.removeAttribute("aria-sort"),a.removeAttribute("aria-label"),h[u].bSortable?f.length>0&&f[0][0]==u?(a.setAttribute("aria-sort",f[0][1]=="asc"?"ascending":"descending"),lt=h[u].asSorting[f[0][2]+1]?h[u].asSorting[f[0][2]+1]:h[u].asSorting[0],a.setAttribute("aria-label",it+(lt=="asc"?nt.sSortAscending:nt.sSortDescending))):a.setAttribute("aria-label",it+(h[u].asSorting[0]=="asc"?nt.sSortAscending:nt.sSortDescending)):a.setAttribute("aria-label",it);i.bSorted=!0;$(i.oInstance).trigger("sort",i);i.oFeatures.bFilter?k(i,i.oPreviousSearch,1):(i.aiDisplay=i.aiDisplayMaster.slice(),i._iDisplayStart=0,s(i),o(i))}function yi(n,t,i,r){ru(t,{},function(t){if(n.aoColumns[i].bSortable!==!1){var u=function(){var f,r,e,u;if(t.shiftKey){for(e=!1,u=0;u<n.aaSorting.length;u++)if(n.aaSorting[u][0]==i){e=!0;f=n.aaSorting[u][0];r=n.aaSorting[u][2]+1;n.aoColumns[f].asSorting[r]?(n.aaSorting[u][1]=n.aoColumns[f].asSorting[r],n.aaSorting[u][2]=r):n.aaSorting.splice(u,1);break}e===!1&&n.aaSorting.push([i,n.aoColumns[i].asSorting[0],0])}else n.aaSorting.length==1&&n.aaSorting[0][0]==i?(f=n.aaSorting[0][0],r=n.aaSorting[0][2]+1,n.aoColumns[f].asSorting[r]||(r=0),n.aaSorting[0][1]=n.aoColumns[f].asSorting[r],n.aaSorting[0][2]=r):(n.aaSorting.splice(0,n.aaSorting.length),n.aaSorting.push([i,n.aoColumns[i].asSorting[0],0]));nt(n)};n.oFeatures.bProcessing?(a(n,!0),setTimeout(function(){u();n.oFeatures.bServerSide||a(n,!1)},0)):u();typeof r=="function"&&r(n)}})}function tt(n){for(var w,u,h,r,f,v=n.aoColumns.length,i=n.oClasses,y,b,e,c,l,a,k,p,o,s,t=0;t<v;t++)n.aoColumns[t].bSortable&&$(n.aoColumns[t].nTh).removeClass(i.sSortAsc+" "+i.sSortDesc+" "+n.aoColumns[t].sSortingClass);for(r=n.aaSortingFixed!==null?n.aaSortingFixed.concat(n.aaSorting):n.aaSorting.slice(),t=0;t<n.aoColumns.length;t++)if(n.aoColumns[t].bSortable){for(f=n.aoColumns[t].sSortingClass,h=-1,u=0;u<r.length;u++)if(r[u][0]==t){f=r[u][1]=="asc"?i.sSortAsc:i.sSortDesc;h=u;break}$(n.aoColumns[t].nTh).addClass(f);n.bJUI&&(y=$("span."+i.sSortIcon,n.aoColumns[t].nTh),y.removeClass(i.sSortJUIAsc+" "+i.sSortJUIDesc+" "+i.sSortJUI+" "+i.sSortJUIAscAllowed+" "+i.sSortJUIDescAllowed),b=h==-1?n.aoColumns[t].sSortingClassJUI:r[h][1]=="asc"?i.sSortJUIAsc:i.sSortJUIDesc,y.addClass(b))}else $(n.aoColumns[t].nTh).addClass(n.aoColumns[t].sSortingClass);if(f=i.sSortColumn,n.oFeatures.bSort&&n.oFeatures.bSortClasses){for(e=d(n),a=[],t=0;t<v;t++)a.push("");for(t=0,c=1;t<r.length;t++)l=parseInt(r[t][0],10),a[l]=f+c,c<3&&c++;for(k=new RegExp(f+"[123]"),t=0,w=e.length;t<w;t++)l=t%v,o=e[t].className,s=a[l],p=o.replace(k,s),p!=o?e[t].className=$.trim(p):s.length>0&&o.indexOf(s)==-1&&(e[t].className=o+" "+s)}}function pi(n){if(n.oFeatures.bStateSave&&!n.bDestroying){for(var u=n.oScroll.bInfinite,i={iCreate:(new Date).getTime(),iStart:u?0:n._iDisplayStart,iEnd:u?n._iDisplayLength:n._iDisplayEnd,iLength:n._iDisplayLength,aaSorting:$.extend(!0,[],n.aaSorting),oSearch:$.extend(!0,{},n.oPreviousSearch),aoSearchCols:$.extend(!0,[],n.aoPreSearchCols),abVisCols:[]},t=0,r=n.aoColumns.length;t<r;t++)i.abVisCols.push(n.aoColumns[t].bVisible);c(n,"aoStateSaveParams","stateSaveParams",[n,i]);n.fnStateSave.call(n.oInstance,n,i)}}function tu(n,t){var i,u,r;if(n.oFeatures.bStateSave&&(i=n.fnStateLoad.call(n.oInstance,n),i)&&(u=c(n,"aoStateLoadParams","stateLoadParams",[n,i]),$.inArray(!1,u)===-1)){for(n.oLoadedState=$.extend(!0,{},i),n._iDisplayStart=i.iStart,n.iInitDisplayStart=i.iStart,n._iDisplayEnd=i.iEnd,n._iDisplayLength=i.iLength,n.aaSorting=i.aaSorting.slice(),n.saved_aaSorting=i.aaSorting.slice(),$.extend(n.oPreviousSearch,i.oSearch),$.extend(!0,n.aoPreSearchCols,i.aoSearchCols),t.saved_aoColumns=[],r=0;r<i.abVisCols.length;r++)t.saved_aoColumns[r]={},t.saved_aoColumns[r].bVisible=i.abVisCols[r];c(n,"aoStateLoaded","stateLoaded",[n,i])}}function ou(sName,sValue,iSecs,sBaseName,fnCallback){var date=new Date,aParts,sNameFile,sFullCookie,oData,i,iLen,aSplitCookie,old;date.setTime(date.getTime()+iSecs*1e3);aParts=window.location.pathname.split("/");sNameFile=sName+"_"+aParts.pop().replace(/[\/:]/g,"").toLowerCase();fnCallback!==null?(oData=typeof $.parseJSON=="function"?$.parseJSON(sValue):eval("("+sValue+")"),sFullCookie=fnCallback(sNameFile,oData,date.toGMTString(),aParts.join("/")+"/")):sFullCookie=sNameFile+"="+encodeURIComponent(sValue)+"; expires="+date.toGMTString()+"; path="+aParts.join("/")+"/";var aCookies=document.cookie.split(";"),iNewCookieLen=sFullCookie.split(";")[0].length,aOldCookies=[];if(iNewCookieLen+document.cookie.length+10>4096){for(i=0,iLen=aCookies.length;i<iLen;i++)if(aCookies[i].indexOf(sBaseName)!=-1){aSplitCookie=aCookies[i].split("=");try{oData=eval("("+decodeURIComponent(aSplitCookie[1])+")");oData&&oData.iCreate&&aOldCookies.push({name:aSplitCookie[0],time:oData.iCreate})}catch(e){}}for(aOldCookies.sort(function(n,t){return t.time-n.time});iNewCookieLen+document.cookie.length+10>4096;){if(aOldCookies.length===0)return;old=aOldCookies.pop();document.cookie=old.name+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+aParts.join("/")+"/"}}document.cookie=sFullCookie}function su(n){for(var t,r=window.location.pathname.split("/"),u=n+"_"+r[r.length-1].replace(/[\/:]/g,"").toLowerCase()+"=",f=document.cookie.split(";"),i=0;i<f.length;i++){for(t=f[i];t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.indexOf(u)===0)return decodeURIComponent(t.substring(u.length,t.length))}return null}function f(n){for(var i=0;i<t.settings.length;i++)if(t.settings[i].nTable===n)return t.settings[i];return null}function st(n){for(var r=[],i=n.aoData,t=0,u=i.length;t<u;t++)i[t].nTr!==null&&r.push(i[t].nTr);return r}function d(t,i){var o=[],s,h,r,f,y=t.aoData.length,u,l,e,c,a=0,v=y;for(i!==n&&(a=i,v=i+1),f=a;f<v;f++)if(e=t.aoData[f],e.nTr!==null){for(h=[],r=e.nTr.firstChild;r;)c=r.nodeName.toLowerCase(),(c=="td"||c=="th")&&h.push(r),r=r.nextSibling;for(s=0,u=0,l=t.aoColumns.length;u<l;u++)t.aoColumns[u].bVisible?o.push(h[u-s]):(o.push(e._anHidden[u]),s++)}return o}function v(n,i,r){var u=n===null?"DataTables warning: "+r:"DataTables warning (table id = '"+n.sTableId+"'): "+r;if(i===0){if(t.ext.sErrMode=="alert")alert(u);else throw new Error(u);return}window.console&&console.log&&console.log(u)}function r(t,i,r,u){u===n&&(u=r);i[r]!==n&&(t[u]=i[r])}function iu(n,t){var r;for(var u in t)t.hasOwnProperty(u)&&(r=t[u],typeof i[u]=="object"&&r!==null&&$.isArray(r)===!1?$.extend(!0,n[u],r):n[u]=r);return n}function ru(n,t,i){$(n).bind("click.DT",t,function(t){n.blur();i(t)}).bind("keypress.DT",t,function(n){n.which===13&&i(n)}).bind("selectstart.DT",function(){return!1})}function h(n,t,i,r){i&&n[t].push({fn:i,sName:r})}function c(n,t,i,r){for(var f=n[t],e=[],u=f.length-1;u>=0;u--)e.push(f[u].fn.apply(n.oInstance,r));return i!==null&&$(n.oInstance).trigger(i,r),e}function fu(n){var t=$('<div style="position:absolute; top:0; left:0; height:1px; width:1px; overflow:hidden"><div style="position:absolute; top:1px; left:1px; width:100px; overflow:scroll;"><div id="DT_BrowserTest" style="width:100%; height:10px;"><\/div><\/div><\/div>')[0];document.body.appendChild(t);n.oBrowser.bScrollOversize=$("#DT_BrowserTest",t)[0].offsetWidth===100?!0:!1;document.body.removeChild(t)}function eu(n){return function(){var i=[f(this[t.ext.iApiIndex])].concat(Array.prototype.slice.call(arguments));return t.ext.oApi[n].apply(this,i)}}var rt=/\[.*?\]$/,uu=window.JSON?JSON.stringify:function(n){var i=typeof n,u,t,f,r;if(i!=="object"||n===null)return i==="string"&&(n='"'+n+'"'),n+"";f=[];r=$.isArray(n);for(u in n)t=n[u],i=typeof t,i==="string"?t='"'+t+'"':i==="object"&&t!==null&&(t=uu(t)),f.push((r?"":'"'+u+'":')+t);return(r?"[":"{")+f+(r?"]":"}")},wt,ht;this.$=function(n,i){var r,e,s=[],u,h=f(this[t.ext.iApiIndex]),o=h.aoData,c=h.aiDisplay,l=h.aiDisplayMaster;if(i||(i={}),i=$.extend({},{filter:"none",order:"current",page:"all"},i),i.page=="current")for(r=h._iDisplayStart,e=h.fnDisplayEnd();r<e;r++)u=o[c[r]].nTr,u&&s.push(u);else if(i.order=="current"&&i.filter=="none")for(r=0,e=l.length;r<e;r++)u=o[l[r]].nTr,u&&s.push(u);else if(i.order=="current"&&i.filter=="applied")for(r=0,e=c.length;r<e;r++)u=o[c[r]].nTr,u&&s.push(u);else if(i.order=="original"&&i.filter=="none")for(r=0,e=o.length;r<e;r++)u=o[r].nTr,u&&s.push(u);else if(i.order=="original"&&i.filter=="applied")for(r=0,e=o.length;r<e;r++)u=o[r].nTr,$.inArray(r,c)!==-1&&u&&s.push(u);else v(h,1,"Unknown selection options");var a=$(s),y=a.filter(n),p=a.find(n);return $([].concat($.makeArray(y),$.makeArray(p)))};this._=function(n,t){for(var r=[],f=this.$(n,t),i=0,u=f.length;i<u;i++)r.push(this.fnGetData(f[i]));return r};this.fnAddData=function(i,r){var u,e,o,s;if(i.length===0)return[];if(u=[],o=f(this[t.ext.iApiIndex]),typeof i[0]=="object"&&i[0]!==null)for(s=0;s<i.length;s++){if(e=w(o,i[s]),e==-1)return u;u.push(e)}else{if(e=w(o,i),e==-1)return u;u.push(e)}return o.aiDisplay=o.aiDisplayMaster.slice(),(r===n||r)&&vt(o),u};this.fnAdjustColumnSizing=function(i){var r=f(this[t.ext.iApiIndex]);ct(r);i===n||i?this.fnDraw(!1):(r.oScroll.sX!==""||r.oScroll.sY!=="")&&this.oApi._fnScrollDraw(r)};this.fnClearTable=function(i){var r=f(this[t.ext.iApiIndex]);ii(r);(i===n||i)&&o(r)};this.fnClose=function(n){for(var u,r=f(this[t.ext.iApiIndex]),i=0;i<r.aoOpenRows.length;i++)if(r.aoOpenRows[i].nParent==n)return u=r.aoOpenRows[i].nTr.parentNode,u&&u.removeChild(r.aoOpenRows[i].nTr),r.aoOpenRows.splice(i,1),0;return 1};this.fnDeleteRow=function(i,r,u){var e=f(this[t.ext.iApiIndex]),h,a,c,l,v;for(c=typeof i=="object"?b(e,i):i,l=e.aoData.splice(c,1),h=0,a=e.aoData.length;h<a;h++)e.aoData[h].nTr!==null&&(e.aoData[h].nTr._DT_RowIndex=h);return v=$.inArray(c,e.aiDisplay),e.asDataSearch.splice(v,1),ri(e.aiDisplayMaster,c),ri(e.aiDisplay,c),typeof r=="function"&&r.call(this,e,l),e._iDisplayStart>=e.fnRecordsDisplay()&&(e._iDisplayStart-=e._iDisplayLength,e._iDisplayStart<0&&(e._iDisplayStart=0)),(u===n||u)&&(s(e),o(e)),l};this.fnDestroy=function(r){var e=f(this[t.ext.iApiIndex]),h=e.nTableWrapper.parentNode,l=e.nTBody,o,s,a;if(r=r===n?!1:r,e.bDestroying=!0,c(e,"aoDestroyCallback","destroy",[e]),!r)for(o=0,s=e.aoColumns.length;o<s;o++)e.aoColumns[o].bVisible===!1&&this.fnSetColumnVis(o,!0);for($(e.nTableWrapper).find("*").andSelf().unbind(".DT"),$("tbody>tr>td."+e.oClasses.sRowEmpty,e.nTable).parent().remove(),e.nTable!=e.nTHead.parentNode&&($(e.nTable).children("thead").remove(),e.nTable.appendChild(e.nTHead)),e.nTFoot&&e.nTable!=e.nTFoot.parentNode&&($(e.nTable).children("tfoot").remove(),e.nTable.appendChild(e.nTFoot)),e.nTable.parentNode.removeChild(e.nTable),$(e.nTableWrapper).remove(),e.aaSorting=[],e.aaSortingFixed=[],tt(e),$(st(e)).removeClass(e.asStripeClasses.join(" ")),$("th, td",e.nTHead).removeClass([e.oClasses.sSortable,e.oClasses.sSortableAsc,e.oClasses.sSortableDesc,e.oClasses.sSortableNone].join(" ")),e.bJUI&&($("th span."+e.oClasses.sSortIcon+", td span."+e.oClasses.sSortIcon,e.nTHead).remove(),$("th, td",e.nTHead).each(function(){var n=$("div."+e.oClasses.sSortJUIWrapper,this),t=n.contents();$(this).append(t);n.remove()})),!r&&e.nTableReinsertBefore?h.insertBefore(e.nTable,e.nTableReinsertBefore):r||h.appendChild(e.nTable),o=0,s=e.aoData.length;o<s;o++)e.aoData[o].nTr!==null&&l.appendChild(e.aoData[o].nTr);if(e.oFeatures.bAutoWidth===!0&&(e.nTable.style.width=u(e.sDestroyWidth)),s=e.asDestroyStripes.length,s)for(a=$(l).children("tr"),o=0;o<s;o++)a.filter(":nth-child("+s+"n + "+o+")").addClass(e.asDestroyStripes[o]);for(o=0,s=t.settings.length;o<s;o++)t.settings[o]==e&&t.settings.splice(o,1);e=null;i=null};this.fnDraw=function(n){var i=f(this[t.ext.iApiIndex]);n===!1?(s(i),o(i)):vt(i)};this.fnFilter=function(i,r,u,e,o,s){var h=f(this[t.ext.iApiIndex]),l,c,a;if(h.oFeatures.bFilter)if((u===n||u===null)&&(u=!1),(e===n||e===null)&&(e=!0),(o===n||o===null)&&(o=!0),(s===n||s===null)&&(s=!0),r===n||r===null){if(k(h,{sSearch:i+"",bRegex:u,bSmart:e,bCaseInsensitive:s},1),o&&h.aanFeatures.f)for(l=h.aanFeatures.f,c=0,a=l.length;c<a;c++)try{l[c]._DT_Input!=document.activeElement&&$(l[c]._DT_Input).val(i)}catch(v){$(l[c]._DT_Input).val(i)}}else $.extend(h.aoPreSearchCols[r],{sSearch:i+"",bRegex:u,bSmart:e,bCaseInsensitive:s}),k(h,h.oPreviousSearch,1)};this.fnGetData=function(i,r){var u=f(this[t.ext.iApiIndex]),o,s;return i!==n?(o=i,typeof i=="object"&&(s=i.nodeName.toLowerCase(),s==="tr"?o=b(u,i):s==="td"&&(o=b(u,i.parentNode),r=ti(u,o,i))),r!==n)?e(u,o,r,""):u.aoData[o]!==n?u.aoData[o]._aData:null:at(u)};this.fnGetNodes=function(i){var r=f(this[t.ext.iApiIndex]);return i!==n?r.aoData[i]!==n?r.aoData[i].nTr:null:st(r)};this.fnGetPosition=function(n){var i=f(this[t.ext.iApiIndex]),r=n.nodeName.toUpperCase(),u,e;return r=="TR"?b(i,n):r=="TD"||r=="TH"?(u=b(i,n.parentNode),e=ti(i,u,n),[u,dt(i,e),e]):null};this.fnIsOpen=function(n){for(var i=f(this[t.ext.iApiIndex]),u=i.aoOpenRows,r=0;r<i.aoOpenRows.length;r++)if(i.aoOpenRows[r].nParent==n)return!0;return!1};this.fnOpen=function(n,i,r){var o=f(this[t.ext.iApiIndex]),h=st(o),e,u,s;if($.inArray(n,h)!==-1)return this.fnClose(n),e=document.createElement("tr"),u=document.createElement("td"),e.appendChild(u),u.className=r,u.colSpan=it(o),typeof i=="string"?u.innerHTML=i:$(u).html(i),s=$("tr",o.nTBody),$.inArray(n,s)!=-1&&$(e).insertAfter(n),o.aoOpenRows.push({nTr:e,nParent:n}),e};this.fnPageChange=function(i,r){var u=f(this[t.ext.iApiIndex]);ai(u,i);s(u);(r===n||r)&&o(u)};this.fnSetColumnVis=function(i,r,u){var s=f(this[t.ext.iApiIndex]),e,c,l=s.aoColumns,h=s.aoData,a,v,p,y;if(l[i].bVisible!=r){if(r){for(y=0,e=0;e<i;e++)l[e].bVisible&&y++;if(v=y>=it(s),!v)for(e=i;e<l.length;e++)if(l[e].bVisible){p=e;break}for(e=0,c=h.length;e<c;e++)h[e].nTr!==null&&(v?h[e].nTr.appendChild(h[e]._anHidden[i]):h[e].nTr.insertBefore(h[e]._anHidden[i],d(s,e)[p]))}else for(e=0,c=h.length;e<c;e++)h[e].nTr!==null&&(a=d(s,e)[i],h[e]._anHidden[i]=a,a.parentNode.removeChild(a));for(l[i].bVisible=r,et(s,s.aoHeader),s.nTFoot&&et(s,s.aoFooter),e=0,c=s.aoOpenRows.length;e<c;e++)s.aoOpenRows[e].nTr.colSpan=it(s);(u===n||u)&&(ct(s),o(s));pi(s)}};this.fnSettings=function(){return f(this[t.ext.iApiIndex])};this.fnSort=function(n){var i=f(this[t.ext.iApiIndex]);i.aaSorting=n;nt(i)};this.fnSortListener=function(n,i,r){yi(f(this[t.ext.iApiIndex]),n,i,r)};this.fnUpdate=function(i,r,u,o,s){var h=f(this[t.ext.iApiIndex]),l,a,c=typeof r=="object"?b(h,r):r,v,w;if($.isArray(i)&&u===n)for(h.aoData[c]._aData=i.slice(),l=0;l<h.aoColumns.length;l++)this.fnUpdate(e(h,c,l),c,l,!1,!1);else if($.isPlainObject(i)&&u===n)for(h.aoData[c]._aData=$.extend(!0,{},i),l=0;l<h.aoColumns.length;l++)this.fnUpdate(e(h,c,l),c,l,!1,!1);else y(h,c,u,i),a=e(h,c,u,"display"),v=h.aoColumns[u],v.fnRender!==null&&(a=ft(h,c,u),v.bUseRendered&&y(h,c,u,a)),h.aoData[c].nTr!==null&&(d(h,c)[u].innerHTML=a);return w=$.inArray(c,h.aiDisplay),h.asDataSearch[w]=oi(h,lt(h,c,"filter",p(h,"bSearchable"))),(s===n||s)&&ct(h),(o===n||o)&&vt(h),0};this.fnVersionCheck=t.ext.fnVersionCheck;this.oApi={_fnExternApiFunc:eu,_fnInitialise:yt,_fnInitComplete:pt,_fnLanguageCompat:li,_fnAddColumn:bt,_fnColumnOptions:kt,_fnAddData:w,_fnCreateTr:ui,_fnGatherData:di,_fnBuildHead:nr,_fnDrawHead:et,_fnDraw:o,_fnReDraw:vt,_fnAjaxUpdate:ir,_fnAjaxParameters:rr,_fnAjaxUpdateDraw:ur,_fnServerParams:fi,_fnAddOptionsHtml:tr,_fnFeatureHtmlTable:pr,_fnScrollDraw:wr,_fnAdjustColumnSizing:ct,_fnFeatureHtmlFilter:fr,_fnFilterComplete:k,_fnFilterCustom:er,_fnFilterColumn:or,_fnFilter:sr,_fnBuildSearchArray:ei,_fnBuildSearchRow:oi,_fnFilterCreateSearch:si,_fnDataToSearch:hr,_fnSort:nt,_fnSortAttachListener:yi,_fnSortingClasses:tt,_fnFeatureHtmlPaginate:vr,_fnPageChange:ai,_fnFeatureHtmlInfo:cr,_fnUpdateInfo:lr,_fnFeatureHtmlLength:ar,_fnFeatureHtmlProcessing:yr,_fnProcessingDisplay:a,_fnVisibleToColumnIndex:wi,_fnColumnIndexToVisible:dt,_fnNodeToDataIndex:b,_fnVisbleColumns:it,_fnCalculateEnd:s,_fnConvertToWidth:br,_fnCalculateColumnWidths:vi,_fnScrollingWidthAdjust:kr,_fnGetWidestNode:dr,_fnGetMaxLenString:gr,_fnStringToCss:u,_fnDetectType:gt,_fnSettingsFromNode:f,_fnGetDataMaster:at,_fnGetTrNodes:st,_fnGetTdNodes:d,_fnEscapeRegex:hi,_fnDeleteIndex:ri,_fnReOrderIndex:bi,_fnColumnOrdering:ni,_fnLog:v,_fnClearTable:ii,_fnSaveState:pi,_fnLoadState:tu,_fnCreateCookie:ou,_fnReadCookie:su,_fnDetectHeader:ot,_fnGetUniqueThs:g,_fnScrollBarWidth:nu,_fnApplyToChildren:l,_fnMap:r,_fnGetRowData:lt,_fnGetCellData:e,_fnSetCellData:y,_fnGetObjectDataFn:ut,_fnSetObjectDataFn:gi,_fnApplyColumnDefs:ki,_fnBindAction:ru,_fnExtend:iu,_fnCallbackReg:h,_fnCallbackFire:c,_fnJsonString:uu,_fnRender:ft,_fnNodeToColumnIndex:ti,_fnInfoMacros:ci,_fnBrowserDetect:fu,_fnGetColumns:p};$.extend(t.ext.oApi,this.oApi);for(wt in t.ext.oApi)wt&&(this[wt]=eu(wt));return ht=this,this.each(function(){var f=0,e,l,rt,s=this.getAttribute("id"),ut=!1,ft=!1,u,k,d,nt,a,o,it,b,et,y,p,c;if(this.nodeName.toLowerCase()!="table"){v(null,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);return}for(f=0,e=t.settings.length;f<e;f++){if(t.settings[f].nTable==this){if(i===n||i.bRetrieve)return t.settings[f].oInstance;if(i.bDestroy){t.settings[f].oInstance.fnDestroy();break}else{v(t.settings[f],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy");return}}if(t.settings[f].sTableId==this.id){t.settings.splice(f,1);break}}if((s===null||s==="")&&(s="DataTables_Table_"+t.ext._oExternConfig.iNextUnique++,this.id=s),u=$.extend(!0,{},t.models.oSettings,{nTable:this,oApi:ht.oApi,oInit:i,sDestroyWidth:$(this).width(),sInstance:s,sTableId:s}),t.settings.push(u),u.oInstance=ht.length===1?ht:$(this).dataTable(),i||(i={}),i.oLanguage&&li(i.oLanguage),i=iu($.extend(!0,{},t.defaults),i),r(u.oFeatures,i,"bPaginate"),r(u.oFeatures,i,"bLengthChange"),r(u.oFeatures,i,"bFilter"),r(u.oFeatures,i,"bSort"),r(u.oFeatures,i,"bInfo"),r(u.oFeatures,i,"bProcessing"),r(u.oFeatures,i,"bAutoWidth"),r(u.oFeatures,i,"bSortClasses"),r(u.oFeatures,i,"bServerSide"),r(u.oFeatures,i,"bDeferRender"),r(u.oScroll,i,"sScrollX","sX"),r(u.oScroll,i,"sScrollXInner","sXInner"),r(u.oScroll,i,"sScrollY","sY"),r(u.oScroll,i,"bScrollCollapse","bCollapse"),r(u.oScroll,i,"bScrollInfinite","bInfinite"),r(u.oScroll,i,"iScrollLoadGap","iLoadGap"),r(u.oScroll,i,"bScrollAutoCss","bAutoCss"),r(u,i,"asStripeClasses"),r(u,i,"asStripClasses","asStripeClasses"),r(u,i,"fnServerData"),r(u,i,"fnFormatNumber"),r(u,i,"sServerMethod"),r(u,i,"aaSorting"),r(u,i,"aaSortingFixed"),r(u,i,"aLengthMenu"),r(u,i,"sPaginationType"),r(u,i,"sAjaxSource"),r(u,i,"sAjaxDataProp"),r(u,i,"iCookieDuration"),r(u,i,"sCookiePrefix"),r(u,i,"sDom"),r(u,i,"bSortCellsTop"),r(u,i,"iTabIndex"),r(u,i,"oSearch","oPreviousSearch"),r(u,i,"aoSearchCols","aoPreSearchCols"),r(u,i,"iDisplayLength","_iDisplayLength"),r(u,i,"bJQueryUI","bJUI"),r(u,i,"fnCookieCallback"),r(u,i,"fnStateLoad"),r(u,i,"fnStateSave"),r(u.oLanguage,i,"fnInfoCallback"),h(u,"aoDrawCallback",i.fnDrawCallback,"user"),h(u,"aoServerParams",i.fnServerParams,"user"),h(u,"aoStateSaveParams",i.fnStateSaveParams,"user"),h(u,"aoStateLoadParams",i.fnStateLoadParams,"user"),h(u,"aoStateLoaded",i.fnStateLoaded,"user"),h(u,"aoRowCallback",i.fnRowCallback,"user"),h(u,"aoRowCreatedCallback",i.fnCreatedRow,"user"),h(u,"aoHeaderCallback",i.fnHeaderCallback,"user"),h(u,"aoFooterCallback",i.fnFooterCallback,"user"),h(u,"aoInitComplete",i.fnInitComplete,"user"),h(u,"aoPreDrawCallback",i.fnPreDrawCallback,"user"),u.oFeatures.bServerSide&&u.oFeatures.bSort&&u.oFeatures.bSortClasses?h(u,"aoDrawCallback",tt,"server_side_sort_classes"):u.oFeatures.bDeferRender&&h(u,"aoDrawCallback",tt,"defer_sort_classes"),i.bJQueryUI?($.extend(u.oClasses,t.ext.oJUIClasses),i.sDom===t.defaults.sDom&&t.defaults.sDom==="lfrtip"&&(u.sDom='<"H"lfr>t<"F"ip>')):$.extend(u.oClasses,t.ext.oStdClasses),$(this).addClass(u.oClasses.sTable),(u.oScroll.sX!==""||u.oScroll.sY!=="")&&(u.oScroll.iBarWidth=nu()),u.iInitDisplayStart===n&&(u.iInitDisplayStart=i.iDisplayStart,u._iDisplayStart=i.iDisplayStart),i.bStateSave&&(u.oFeatures.bStateSave=!0,tu(u,i),h(u,"aoDrawCallback",pi,"state_save")),i.iDeferLoading!==null&&(u.bDeferLoading=!0,k=$.isArray(i.iDeferLoading),u._iRecordsDisplay=k?i.iDeferLoading[0]:i.iDeferLoading,u._iRecordsTotal=k?i.iDeferLoading[1]:i.iDeferLoading),i.aaData!==null&&(ft=!0),i.oLanguage.sUrl!==""?(u.oLanguage.sUrl=i.oLanguage.sUrl,$.getJSON(u.oLanguage.sUrl,null,function(n){li(n);$.extend(!0,u.oLanguage,i.oLanguage,n);yt(u)}),ut=!0):$.extend(!0,u.oLanguage,i.oLanguage),i.asStripeClasses===null&&(u.asStripeClasses=[u.oClasses.sStripeOdd,u.oClasses.sStripeEven]),e=u.asStripeClasses.length,u.asDestroyStripes=[],e){for(d=!1,nt=$(this).children("tbody").children("tr:lt("+e+")"),f=0;f<e;f++)nt.hasClass(u.asStripeClasses[f])&&(d=!0,u.asDestroyStripes.push(u.asStripeClasses[f]));d&&nt.removeClass(u.asStripeClasses.join(" "))}if(a=[],it=this.getElementsByTagName("thead"),it.length!==0&&(ot(u.aoHeader,it[0]),a=g(u)),i.aoColumns===null)for(o=[],f=0,e=a.length;f<e;f++)o.push(null);else o=i.aoColumns;for(f=0,e=o.length;f<e;f++)i.saved_aoColumns!==n&&i.saved_aoColumns.length==e&&(o[f]===null&&(o[f]={}),o[f].bVisible=i.saved_aoColumns[f].bVisible),bt(u,a?a[f]:null);for(ki(u,i.aoColumnDefs,o,function(n,t){kt(u,n,t)}),f=0,e=u.aaSorting.length;f<e;f++)for(u.aaSorting[f][0]>=u.aoColumns.length&&(u.aaSorting[f][0]=0),b=u.aoColumns[u.aaSorting[f][0]],u.aaSorting[f][2]===n&&(u.aaSorting[f][2]=0),i.aaSorting===n&&u.saved_aaSorting===n&&(u.aaSorting[f][1]=b.asSorting[0]),l=0,rt=b.asSorting.length;l<rt;l++)if(u.aaSorting[f][1]==b.asSorting[l]){u.aaSorting[f][2]=l;break}if(tt(u),fu(u),et=$(this).children("caption").each(function(){this._captionSide=$(this).css("caption-side")}),y=$(this).children("thead"),y.length===0&&(y=[document.createElement("thead")],this.appendChild(y[0])),u.nTHead=y[0],p=$(this).children("tbody"),p.length===0&&(p=[document.createElement("tbody")],this.appendChild(p[0])),u.nTBody=p[0],u.nTBody.setAttribute("role","alert"),u.nTBody.setAttribute("aria-live","polite"),u.nTBody.setAttribute("aria-relevant","all"),c=$(this).children("tfoot"),c.length===0&&et.length>0&&(u.oScroll.sX!==""||u.oScroll.sY!=="")&&(c=[document.createElement("tfoot")],this.appendChild(c[0])),c.length>0&&(u.nTFoot=c[0],ot(u.aoFooter,u.nTFoot)),ft)for(f=0;f<i.aaData.length;f++)w(u,i.aaData[f]);else di(u);u.aiDisplay=u.aiDisplayMaster.slice();u.bInitialised=!0;ut===!1&&yt(u)}),ht=null,this};t.fnVersionCheck=function(n){for(var r=function(n,t){while(n.length<t)n+="0";return n},o=t.ext.sVersion.split("."),u=n.split("."),f="",e="",i=0,s=u.length;i<s;i++)f+=r(o[i],3),e+=r(u[i],3);return parseInt(f,10)>=parseInt(e,10)};t.fnIsDataTable=function(n){for(var r=t.settings,i=0;i<r.length;i++)if(r[i].nTable===n||r[i].nScrollHead===n||r[i].nScrollFoot===n)return!0;return!1};t.fnTables=function(n){var i=[];return jQuery.each(t.settings,function(t,r){(!n||n===!0&&$(r.nTable).is(":visible"))&&i.push(r.nTable)}),i};t.version="1.9.4";t.settings=[];t.models={};t.models.ext={afnFiltering:[],afnSortData:[],aoFeatures:[],aTypes:[],fnVersionCheck:t.fnVersionCheck,iApiIndex:0,ofnSearch:{},oApi:{},oStdClasses:{},oJUIClasses:{},oPagination:{},oSort:{},sVersion:t.version,sErrMode:"alert",_oExternConfig:{iNextUnique:0}};t.models.oSearch={bCaseInsensitive:!0,sSearch:"",bRegex:!1,bSmart:!0};t.models.oRow={nTr:null,_aData:[],_aSortData:[],_anHidden:[],_sRowStripe:""};t.models.oColumn={aDataSort:null,asSorting:null,bSearchable:null,bSortable:null,bUseRendered:null,bVisible:null,_bAutoType:!0,fnCreatedCell:null,fnGetData:null,fnRender:null,fnSetData:null,mData:null,mRender:null,nTh:null,nTf:null,sClass:null,sContentPadding:null,sDefaultContent:null,sName:null,sSortDataType:"std",sSortingClass:null,sSortingClassJUI:null,sTitle:null,sType:null,sWidth:null,sWidthOrig:null};t.defaults={aaData:null,aaSorting:[[0,"asc"]],aaSortingFixed:null,aLengthMenu:[10,25,50,100],aoColumns:null,aoColumnDefs:null,aoSearchCols:[],asStripeClasses:null,bAutoWidth:!0,bDeferRender:!1,bDestroy:!1,bFilter:!0,bInfo:!0,bJQueryUI:!1,bLengthChange:!0,bPaginate:!0,bProcessing:!1,bRetrieve:!1,bScrollAutoCss:!0,bScrollCollapse:!1,bScrollInfinite:!1,bServerSide:!1,bSort:!0,bSortCellsTop:!1,bSortClasses:!0,bStateSave:!1,fnCookieCallback:null,fnCreatedRow:null,fnDrawCallback:null,fnFooterCallback:null,fnFormatNumber:function(n){var t;if(n<1e3)return n;var r=n+"",f=r.split(""),i="",u=r.length;for(t=0;t<u;t++)t%3==0&&t!==0&&(i=this.oLanguage.sInfoThousands+i),i=f[u-t-1]+i;return i},fnHeaderCallback:null,fnInfoCallback:null,fnInitComplete:null,fnPreDrawCallback:null,fnRowCallback:null,fnServerData:function(n,t,i,r){r.jqXHR=$.ajax({url:n,data:t,success:function(n){n.sError&&r.oApi._fnLog(r,0,n.sError);$(r.oInstance).trigger("xhr",[r,n]);i(n)},dataType:"json",cache:!1,type:r.sServerMethod,error:function(n,t){t=="parsererror"&&r.oApi._fnLog(r,0,"DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})},fnServerParams:null,fnStateLoad:function(oSettings){var sData=this.oApi._fnReadCookie(oSettings.sCookiePrefix+oSettings.sInstance),oData;try{oData=typeof $.parseJSON=="function"?$.parseJSON(sData):eval("("+sData+")")}catch(e){oData=null}return oData},fnStateLoadParams:null,fnStateLoaded:null,fnStateSave:function(n,t){this.oApi._fnCreateCookie(n.sCookiePrefix+n.sInstance,this.oApi._fnJsonString(t),n.iCookieDuration,n.sCookiePrefix,n.fnCookieCallback)},fnStateSaveParams:null,iCookieDuration:7200,iDeferLoading:null,iDisplayLength:10,iDisplayStart:0,iScrollLoadGap:100,iTabIndex:0,oLanguage:{oAria:{sSortAscending:": activate to sort column ascending",sSortDescending:": activate to sort column descending"},oPaginate:{sFirst:"First",sLast:"Last",sNext:"Next",sPrevious:"Previous"},sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sInfoThousands:",",sLengthMenu:"Show _MENU_ entries",sLoadingRecords:"Loading...",sProcessing:"Processing...",sSearch:"Search:",sUrl:"",sZeroRecords:"No matching records found"},oSearch:$.extend({},t.models.oSearch),sAjaxDataProp:"aaData",sAjaxSource:null,sCookiePrefix:"SpryMedia_DataTables_",sDom:"lfrtip",sPaginationType:"two_button",sScrollX:"",sScrollXInner:"",sScrollY:"",sServerMethod:"GET"};t.defaults.columns={aDataSort:null,asSorting:["asc","desc"],bSearchable:!0,bSortable:!0,bUseRendered:!0,bVisible:!0,fnCreatedCell:null,fnRender:null,iDataSort:-1,mData:null,mRender:null,sCellType:"td",sClass:"",sContentPadding:"",sDefaultContent:null,sName:"",sSortDataType:"std",sTitle:null,sType:null,sWidth:null};t.models.oSettings={oFeatures:{bAutoWidth:null,bDeferRender:null,bFilter:null,bInfo:null,bLengthChange:null,bPaginate:null,bProcessing:null,bServerSide:null,bSort:null,bSortClasses:null,bStateSave:null},oScroll:{bAutoCss:null,bCollapse:null,bInfinite:null,iBarWidth:0,iLoadGap:null,sX:null,sXInner:null,sY:null},oLanguage:{fnInfoCallback:null},oBrowser:{bScrollOversize:!1},aanFeatures:[],aoData:[],aiDisplay:[],aiDisplayMaster:[],aoColumns:[],aoHeader:[],aoFooter:[],asDataSearch:[],oPreviousSearch:{},aoPreSearchCols:[],aaSorting:null,aaSortingFixed:null,asStripeClasses:null,asDestroyStripes:[],sDestroyWidth:0,aoRowCallback:[],aoHeaderCallback:[],aoFooterCallback:[],aoDrawCallback:[],aoRowCreatedCallback:[],aoPreDrawCallback:[],aoInitComplete:[],aoStateSaveParams:[],aoStateLoadParams:[],aoStateLoaded:[],sTableId:"",nTable:null,nTHead:null,nTFoot:null,nTBody:null,nTableWrapper:null,bDeferLoading:!1,bInitialised:!1,aoOpenRows:[],sDom:null,sPaginationType:"two_button",iCookieDuration:0,sCookiePrefix:"",fnCookieCallback:null,aoStateSave:[],aoStateLoad:[],oLoadedState:null,sAjaxSource:null,sAjaxDataProp:null,bAjaxDataGet:!0,jqXHR:null,fnServerData:null,aoServerParams:[],sServerMethod:null,fnFormatNumber:null,aLengthMenu:null,iDraw:0,bDrawing:!1,iDrawError:-1,_iDisplayLength:10,_iDisplayStart:0,_iDisplayEnd:10,_iRecordsTotal:0,_iRecordsDisplay:0,bJUI:null,oClasses:{},bFiltered:!1,bSorted:!1,bSortCellsTop:null,oInit:null,aoDestroyCallback:[],fnRecordsTotal:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length},fnRecordsDisplay:function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length},fnDisplayEnd:function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===!1||this._iDisplayLength==-1?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd},oInstance:null,sInstance:null,iTabIndex:0,nScrollHead:null,nScrollFoot:null};t.ext=$.extend(!0,{},t.models.ext);$.extend(t.ext.oStdClasses,{sTable:"dataTable",sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripeOdd:"odd",sStripeEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"",sJUIHeader:"",sJUIFooter:""});$.extend(t.ext.oJUIClasses,t.ext.oStdClasses,{sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl",sPageLast:"last ui-corner-tr ui-corner-br",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollFoot:"dataTables_scrollFoot ui-state-default",sFooterTH:"ui-state-default",sJUIHeader:"fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix",sJUIFooter:"fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix"});$.extend(t.ext.oPagination,{two_button:{fnInit:function(n,t,i){var f=n.oLanguage.oPaginate,h=n.oClasses,e=function(t){n.oApi._fnPageChange(n,t.data.action)&&i(n)},s=n.bJUI?'<a class="'+n.oClasses.sPagePrevDisabled+'" tabindex="'+n.iTabIndex+'" role="button"><span class="'+n.oClasses.sPageJUIPrev+'"><\/span><\/a><a class="'+n.oClasses.sPageNextDisabled+'" tabindex="'+n.iTabIndex+'" role="button"><span class="'+n.oClasses.sPageJUINext+'"><\/span><\/a>':'<a class="'+n.oClasses.sPagePrevDisabled+'" tabindex="'+n.iTabIndex+'" role="button">'+f.sPrevious+'<\/a><a class="'+n.oClasses.sPageNextDisabled+'" tabindex="'+n.iTabIndex+'" role="button">'+f.sNext+"<\/a>";$(t).append(s);var o=$("a",t),r=o[0],u=o[1];n.oApi._fnBindAction(r,{action:"previous"},e);n.oApi._fnBindAction(u,{action:"next"},e);n.aanFeatures.p||(t.id=n.sTableId+"_paginate",r.id=n.sTableId+"_previous",u.id=n.sTableId+"_next",r.setAttribute("aria-controls",n.sTableId),u.setAttribute("aria-controls",n.sTableId))},fnUpdate:function(n){var i,u,t,r,f;if(n.aanFeatures.p)for(i=n.oClasses,u=n.aanFeatures.p,r=0,f=u.length;r<f;r++)t=u[r].firstChild,t&&(t.className=n._iDisplayStart===0?i.sPagePrevDisabled:i.sPagePrevEnabled,t=t.nextSibling,t.className=n.fnDisplayEnd()==n.fnRecordsDisplay()?i.sPageNextDisabled:i.sPageNextEnabled)}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(n,t,i){var u=n.oLanguage.oPaginate,r=n.oClasses,f=function(t){n.oApi._fnPageChange(n,t.data.action)&&i(n)};$(t).append('<a  tabindex="'+n.iTabIndex+'" class="'+r.sPageButton+" "+r.sPageFirst+'">'+u.sFirst+'<\/a><a  tabindex="'+n.iTabIndex+'" class="'+r.sPageButton+" "+r.sPagePrevious+'">'+u.sPrevious+'<\/a><span><\/span><a tabindex="'+n.iTabIndex+'" class="'+r.sPageButton+" "+r.sPageNext+'">'+u.sNext+'<\/a><a tabindex="'+n.iTabIndex+'" class="'+r.sPageButton+" "+r.sPageLast+'">'+u.sLast+"<\/a>");var e=$("a",t),o=e[0],s=e[1],h=e[2],c=e[3];n.oApi._fnBindAction(o,{action:"first"},f);n.oApi._fnBindAction(s,{action:"previous"},f);n.oApi._fnBindAction(h,{action:"next"},f);n.oApi._fnBindAction(c,{action:"last"},f);n.aanFeatures.p||(t.id=n.sTableId+"_paginate",o.id=n.sTableId+"_first",s.id=n.sTableId+"_previous",h.id=n.sTableId+"_next",c.id=n.sTableId+"_last")},fnUpdate:function(n,i){if(n.aanFeatures.p){var h=t.ext.oPagination.iFullNumbersShowPages,v=Math.floor(h/2),e=Math.ceil(n.fnRecordsDisplay()/n._iDisplayLength),o=Math.ceil(n._iDisplayStart/n._iDisplayLength)+1,y="",f,c,r,p,u=n.oClasses,s,l,a,w=n.aanFeatures.p,b=function(t){n.oApi._fnBindAction(this,{page:t+f-1},function(t){n.oApi._fnPageChange(n,t.data.page);i(n);t.preventDefault()})};for(n._iDisplayLength===-1?(f=1,c=1,o=1):e<h?(f=1,c=e):o<=v?(f=1,c=h):o>=e-v?(f=e-h+1,c=e):(f=o-Math.ceil(h/2)+1,c=f+h-1),r=f;r<=c;r++)y+=o!==r?'<a tabindex="'+n.iTabIndex+'" class="'+u.sPageButton+'">'+n.fnFormatNumber(r)+"<\/a>":'<a tabindex="'+n.iTabIndex+'" class="'+u.sPageButtonActive+'">'+n.fnFormatNumber(r)+"<\/a>";for(r=0,p=w.length;r<p;r++)(a=w[r],a.hasChildNodes())&&($("span:eq(0)",a).html(y).children("a").each(b),s=a.getElementsByTagName("a"),l=[s[0],s[1],s[s.length-2],s[s.length-1]],$(l).removeClass(u.sPageButton+" "+u.sPageButtonActive+" "+u.sPageButtonStaticDisabled),$([l[0],l[1]]).addClass(o==1?u.sPageButtonStaticDisabled:u.sPageButton),$([l[2],l[3]]).addClass(e===0||o===e||n._iDisplayLength===-1?u.sPageButtonStaticDisabled:u.sPageButton))}}}});$.extend(t.ext.oSort,{"string-pre":function(n){return typeof n!="string"&&(n=n!==null&&n.toString?n.toString():""),n.toLowerCase()},"string-asc":function(n,t){return n<t?-1:n>t?1:0},"string-desc":function(n,t){return n<t?1:n>t?-1:0},"html-pre":function(n){return n.replace(/<.*?>/g,"").toLowerCase()},"html-asc":function(n,t){return n<t?-1:n>t?1:0},"html-desc":function(n,t){return n<t?1:n>t?-1:0},"date-pre":function(n){var t=Date.parse(n);return(isNaN(t)||t==="")&&(t=Date.parse("01/01/1970 00:00:00")),t},"date-asc":function(n,t){return n-t},"date-desc":function(n,t){return t-n},"numeric-pre":function(n){return n=="-"||n===""?0:n*1},"numeric-asc":function(n,t){return n-t},"numeric-desc":function(n,t){return t-n}});$.extend(t.ext.aTypes,[function(n){var i;if(typeof n=="number")return"numeric";if(typeof n!="string")return null;var t,r=!1;if(t=n.charAt(0),"0123456789-".indexOf(t)==-1)return null;for(i=1;i<n.length;i++){if(t=n.charAt(i),"0123456789.".indexOf(t)==-1)return null;if(t=="."){if(r)return null;r=!0}}return"numeric"},function(n){var t=Date.parse(n);return t!==null&&!isNaN(t)||typeof n=="string"&&n.length===0?"date":null},function(n){return typeof n=="string"&&n.indexOf("<")!=-1&&n.indexOf(">")!=-1?"html":null}]);$.fn.DataTable=t;$.fn.dataTable=t;$.fn.dataTableSettings=t.settings;$.fn.dataTableExt=t.ext})})(window,document);
//# sourceMappingURL=jquery.dataTables.min.js.map
;
+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.tooltip",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.VERSION="3.2.0";t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(this.options.viewport.selector||this.options.viewport),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else if(u!="manual"){o=u=="hover"?"mouseenter":"focusin";s=u=="hover"?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this));this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)};t.prototype.show=function(){var h=n.Event("show.bs."+this.type),c,y,s;if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),c=n.contains(document.documentElement,this.$element[0]),h.isDefaultPrevented()||!c)return;var f=this,i=this.tip(),l=this.getUID(this.type);this.setContent();i.attr("id",l);this.$element.attr("aria-describedby",l);this.options.animation&&i.addClass("fade");var t=typeof this.options.placement=="function"?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,v=a.test(t);v&&(t=t.replace(a,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t).data("bs."+this.type,this);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),e=i[0].offsetWidth,o=i[0].offsetHeight;if(v){var p=t,w=this.$element.parent(),u=this.getPosition(w);t=t=="bottom"&&r.top+r.height+o-u.scroll>u.height?"top":t=="top"&&r.top-u.scroll-o<0?"bottom":t=="right"&&r.right+e>u.width?"left":t=="left"&&r.left-e<u.left?"right":t;i.removeClass(p).addClass(t)}y=this.getCalculatedOffset(t,r,e,o);this.applyPlacement(y,t);s=function(){f.$element.trigger("shown.bs."+f.type);f.hoverState=null};n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",s).emulateTransitionEnd(150):s()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),c=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;i=="top"&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var l=u.left?u.left*2-c+h:u.top*2-e+f,a=u.left?"left":"top",v=u.left?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(l,r[0][v],a)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function u(){t.hoverState!="in"&&i.detach();t.$element.trigger("hidden.bs."+t.type)}var t=this,i=this.tip(),r=n.Event("hide.bs."+this.type);if(this.$element.removeAttr("aria-describedby"),this.$element.trigger(r),!r.isDefaultPrevented())return i.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",u).emulateTransitionEnd(150):u(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var r=t[0],i=r.tagName=="BODY";return n.extend({},typeof r.getBoundingClientRect=="function"?r.getBoundingClientRect():null,{scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop(),width:i?n(window).width():t.outerWidth(),height:i?n(window).height():t.outerHeight()},i?{top:0,left:0}:t.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.width&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(Math.random()*1e6);while(document.getElementById(n));return n};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){clearTimeout(this.timeout);this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);
//# sourceMappingURL=tooltip.min.js.map
;
+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.airview"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.airview",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.init("airview",n,t)},i;if(!n.fn.tooltip)throw new Error("Airview requires tooltip.js");t.VERSION="1.0.0";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"auto",trigger:"hover focus",url:!1,content:"",width:"auto",error:"Image Not Found",template:'<div class="airview" role="tooltip"><div class="airview-arrow"><\/div><div class="airview-inner"><div class="airview-loader"><\/div><img /><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var r=this.$element,t=this.tip(),n=this.getTitle(),f=n.substr(n.lastIndexOf("/")+1),i=this.getContent(),u={width:this.options.width=="auto"?500:this.options.width,height:this.options.width=="auto"?this.getHeight(500):this.getHeight(this.options.width)};n=n||i?n?this.options.url?this.options.url+n:n:i?this.options.url?this.options.url+i:i:n:this.options.content?this.options.url?this.options.url+this.options.content:this.options.content:"";t.find(".airview-inner > img").on("load",function(){t.find(".airview-loader").fadeOut()});this.options.html?t.find(".airview-inner").html(n):t.find(".airview-inner > img").attr({src:n,alt:f});t.find(".airview-inner > img").attr(u);t.removeClass("fade top bottom left right in");!n||r.attr("data-lost")?t.find(".airview-inner").empty().addClass("error").html("<span>"+this.options.error+"<\/span>"):n&&isNaN(u.height)&&r.attr("data-broken")&&t.find(".airview-inner").empty().addClass("error").html("<span>Broken Link<\/span>")};t.prototype.getHeight=function(n){var t=this.$element;return n/t.attr("data-aratio")};t.prototype.fixTitle=function(){var r=this.$element,f=!1,e=!1,i=new Image,o=this,t="",u="";(r.attr("title")||typeof r.attr("data-original-title")!="string")&&r.attr("data-original-title",r.attr("title")||"").attr("title","");t=this.getTitle();u=this.getContent();t=t||u?t?this.options.url?this.options.url+t:t:u?this.options.url?this.options.url+u:u:t:this.options.content?this.options.url?this.options.url+this.options.content:this.options.content:"";n(i).error(function(){t?r.attr("data-broken",!0):r.attr("data-lost",!0);f=!0});i.src=t;e=setInterval(function(){(i.width!=0&&i.height!=0||f)&&(r.attr("data-aratio",i.width/i.height),i.removeAttribute("src"),i=null,clearInterval(e))},0)};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()||" "};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".airview-arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.airview=r;n.fn.airview.Constructor=t;n.fn.airview.noConflict=function(){return n.fn.airview=i,this}}(jQuery);
//# sourceMappingURL=airview.min.js.map
;
(function(c){var j={init:function(a){var b={color:c(this).css("background-color"),reach:20,speed:1E3,pause:0,glow:!0,repeat:!0,onHover:!1};c(this).css({"-moz-outline-radius":c(this).css("border-top-left-radius"),"-webkit-outline-radius":c(this).css("border-top-left-radius"),"outline-radius":c(this).css("border-top-left-radius")});a&&c.extend(b,a);b.color=c("<div style='background:"+b.color+"'></div>").css("background-color");!0!==b.repeat&&(!isNaN(b.repeat)&&0<b.repeat)&&(b.repeat-=1);return this.each(function(){b.onHover?
c(this).bind("mouseover",function(){g(b,this,0)}).bind("mouseout",function(){c(this).pulsate("destroy")}):g(b,this,0)})},destroy:function(){return this.each(function(){clearTimeout(this.timer);c(this).css("outline",0)})}},g=function(a,b,d){var f=a.reach;d=d>f?0:d;var h=(f-d)/f,e=a.color.split(","),h="rgba("+e[0].split("(")[1]+","+e[1]+","+e[2].split(")")[0]+","+h+")",e={outline:"2px solid "+h};a.glow?(e["box-shadow"]="0px 0px "+parseInt(d/1.5)+"px "+h,userAgent=navigator.userAgent||"",/(chrome)[ \/]([\w.]+)/.test(userAgent.toLowerCase())&&
(e["outline-offset"]=d+"px",e["outline-radius"]="100 px")):e["outline-offset"]=d+"px";c(b).css(e);b.timer=setTimeout(function(){if(d>=f&&!a.repeat)return c(b).pulsate("destroy"),!1;if(d>=f&&!0!==a.repeat&&!isNaN(a.repeat)&&0<a.repeat)a.repeat-=1;else if(a.pause&&d>=f){var e=d+1;innerfunc=function(){g(a,b,e)};setTimeout(innerfunc,a.pause);return!1}g(a,b,d+1)},a.speed/f)};c.fn.pulsate=function(a){if(j[a])return j[a].apply(this,Array.prototype.slice.call(arguments,1));if("object"===typeof a||!a)return j.init.apply(this,
arguments);c.error("Method "+a+" does not exist on jQuery.pulsate")}})(jQuery);;
//Author      : @arboshiki
//create lobibox object
var Lobibox = Lobibox || {};
(function () {

    Lobibox.counter = 0;
    //------------------------------------------------------------------------------
    //------------------------------------------------------------------------------

    //User can set default properties for prompt in the following way
    //Lobibox.prompt.DEFAULT_OPTIONS = object;
    Lobibox.prompt = function (type, options) {
        return new LobiboxPrompt(type, options);
    };
    //User can set default properties for confirm in the following way
    //Lobibox.confirm.DEFAULT_OPTIONS = object;
    Lobibox.confirm = function (options) {
        return new LobiboxConfirm(options);
    };
    //User can set default properties for progress in the following way
    //Lobibox.progress.DEFAULT_OPTIONS = object;
    Lobibox.progress = function (options) {
        return new LobiboxProgress(options);
    };
    //Create empty objects in order user to be able to set default options in the following way
    //Lobibox.error.DEFAULT_OPTIONS = object;
    //Lobibox.success.DEFAULT_OPTIONS = object;
    //Lobibox.warning.DEFAULT_OPTIONS = object;
    //Lobibox.info.DEFAULT_OPTIONS = object;

    Lobibox.error = {};
    Lobibox.success = {};
    Lobibox.warning = {};
    Lobibox.info = {};

    //User can set default properties for alert in the following way
    //Lobibox.alert.DEFAULT_OPTIONS = object;
    Lobibox.alert = function (type, options) {
        if (["success", "error", "warning", "info"].indexOf(type) > -1) {
            return new LobiboxAlert(type, options);
        }
    };
    //User can set default properties for window in the following way
    //Lobibox.window.DEFAULT_OPTIONS = object;
    Lobibox.window = function (options) {
        return new LobiboxWindow('window', options);
    };


    /**
     * Base prototype for all messageboxes and window
     */
    var LobiboxBase = {
        $type: null,
        $el: null,
        $options: null,
        debug: function () {
            if (this.$options.debug) {
                window.console.debug.apply(window.console, arguments);
            }
        },
        _processInput: function (options) {
            if ($.isArray(options.buttons)) {
                var btns = {};
                for (var i = 0; i < options.buttons.length; i++) {
                    btns[options.buttons[i]] = Lobibox.base.OPTIONS.buttons[options.buttons[i]];
                }
                options.buttons = btns;
            }
            options.customBtnClass = options.customBtnClass ? options.customBtnClass : Lobibox.base.DEFAULTS.customBtnClass;
            for (var i in options.buttons) {
                if (options.buttons.hasOwnProperty(i)) {
                    var btn = options.buttons[i];
                    btn = $.extend({}, Lobibox.base.OPTIONS.buttons[i], btn);
                    if (!btn['class']) {
                        btn['class'] = options.customBtnClass;
                    }
                    options.buttons[i] = btn;
                }
            }
            options = $.extend({}, Lobibox.base.DEFAULTS, options);
            if (options.showClass === undefined) {
                options.showClass = Lobibox.base.OPTIONS.showClass;
            }
            if (options.hideClass === undefined) {
                options.hideClass = Lobibox.base.OPTIONS.hideClass;
            }
            if (options.baseClass === undefined) {
                options.baseClass = Lobibox.base.OPTIONS.baseClass;
            }
            if (options.delayToRemove === undefined) {
                options.delayToRemove = Lobibox.base.OPTIONS.delayToRemove;
            }
            if (!options.iconClass) {
                options.iconClass = Lobibox.base.OPTIONS.icons[options.iconSource][this.$type];
            }
            return options;
        },
        _init: function () {
            var me = this;

            me._createMarkup();
            me.setTitle(me.$options.title);
            if (me.$options.draggable && !me._isMobileScreen()) {
                me.$el.addClass('draggable');
                me._enableDrag();
            }
            if (me.$options.closeButton) {
                me._addCloseButton();
            }
            if (me.$options.closeOnEsc) {
                $(document).on('keyup.lobibox', function (ev) {
                    if (ev.which === 27) {
                        me.destroy();
                    }
                });
            }
            if (me.$options.baseClass) {
                me.$el.addClass(me.$options.baseClass);
            }
            if (me.$options.showClass) {
                me.$el.removeClass(me.$options.hideClass);
                me.$el.addClass(me.$options.showClass);
            }
            me.$el.data('lobibox', me);
        },

        /**
         * Calculate top, left position based on string keyword
         *
         * @param {string} position "'top', 'center', 'bottom'"
         * @returns {{left: number, top: number}}
         * @private
         */
        _calculatePosition: function (position) {
            var me = this;
            var top;
            if (position === 'top') {
                top = 30;
            } else if (position === 'bottom') {
                top = $(window).outerHeight() - me.$el.outerHeight() - 30;
            } else {
                top = ($(window).outerHeight() - me.$el.outerHeight()) / 2;
            }
            var left = ($(window).outerWidth() - me.$el.outerWidth()) / 2;
            return {
                left: left,
                top: top
            };
        },

        _createButton: function (type, op) {
            var me = this;
            var btn = $('<button></button>')
                .addClass(op['class'])
                .attr('data-type', type)
                .html(op.text);
            if (me.$options.callback && typeof me.$options.callback === 'function') {
                btn.on('click.lobibox', function (ev) {
                    var bt = $(this);
                    me._onButtonClick(me.$options.buttons[type], type);
                    me.$options.callback(me, bt.data('type'), ev);
                });
            }
            btn.click(function () {
                me._onButtonClick(me.$options.buttons[type], type);
            });
            return btn;
        },

        _onButtonClick: function (buttonOptions, type) {
            var me = this;

            if ((type === 'ok' && me.$type === 'prompt' && me.isValid() || me.$type !== 'prompt' || type !== 'ok')
                && buttonOptions && buttonOptions.closeOnClick) {
                me.destroy();
            }
        },

        _generateButtons: function () {
            var me = this;
            var btns = [];
            for (var i in me.$options.buttons) {
                if (me.$options.buttons.hasOwnProperty(i)) {
                    var op = me.$options.buttons[i];
                    var btn = me._createButton(i, op);
                    btns.push(btn);
                }
            }
            return btns;
        },
        _createMarkup: function () {
            var me = this;
            var lobibox = $('<div class="lobibox"></div>');
            lobibox.attr('data-is-modal', me.$options.modal);
            var header = $('<div class="lobibox-header"></div>')
                .append('<span class="lobibox-title"></span>')
                ;
            var body = $('<div class="lobibox-body"></div>');
            lobibox.append(header);
            lobibox.append(body);
            if (me.$options.buttons && !$.isEmptyObject(me.$options.buttons)) {
                var footer = $('<div class="lobibox-footer"></div>');
                footer.append(me._generateButtons());
                lobibox.append(footer);
                if (Lobibox.base.OPTIONS.buttonsAlign.indexOf(me.$options.buttonsAlign) > -1) {
                    footer.addClass('text-' + me.$options.buttonsAlign);
                }
            }
            me.$el = lobibox
                .addClass(Lobibox.base.OPTIONS.modalClasses[me.$type])
                ;
        },
        _setSize: function () {
            var me = this;
            me.setWidth(me.$options.width);
            if (me.$options.height === 'auto') {
                me.setHeight(me.$el.outerHeight());
            } else {
                me.setHeight(me.$options.height);
            }
        },
        _calculateBodyHeight: function (height) {
            var me = this;
            var headerHeight = me.$el.find('.lobibox-header').outerHeight();
            var footerHeight = me.$el.find('.lobibox-footer').outerHeight();
            return height - (headerHeight ? headerHeight : 0) - (footerHeight ? footerHeight : 0);

        },

        /**
         * Add backdrop in case if backdrop does not exist
         *
         * @private
         */
        _addBackdrop: function () {
            if ($('.lobibox-backdrop').length === 0) {
                $('body').append('<div class="lobibox-backdrop"></div>');
            }
        },

        _triggerEvent: function (type) {
            var me = this;
            if (me.$options[type] && typeof me.$options[type] === 'function') {
                me.$options[type](me);
            }
        },

        _calculateWidth: function (width) {
            var me = this;
            width = Math.min(Math.max(width, me.$options.width), $(window).outerWidth());
            if (width === $(window).outerWidth()) {
                width -= 2 * me.$options.horizontalOffset;
            }
            return width;
        },

        _calculateHeight: function (height) {
            var me = this;
            console.log(me.$options.height);
            height = Math.min(Math.max(height, me.$options.height), $(window).outerHeight());
            if (height === $(window).outerHeight()) {
                height -= 2 * me.$options.verticalOffset;
            }
            return height;
        },

        _addCloseButton: function () {
            var me = this;
            var closeBtn = $('<span class="btn-close">&times;</span>');
            me.$el.find('.lobibox-header').append(closeBtn);
            closeBtn.on('mousedown', function (ev) {
                ev.stopPropagation();
            });
            closeBtn.on('click.lobibox', function () {
                me.destroy();
            });
        },
        _position: function () {
            var me = this;

            me._setSize();
            var pos = me._calculatePosition();
            me.setPosition(pos.left, pos.top);
        },
        _isMobileScreen: function () {
            return $(window).outerWidth() < 768;
        },
        _enableDrag: function () {
            var el = this.$el,
                heading = el.find('.lobibox-header');

            heading.on('mousedown.lobibox', function (ev) {
                el.attr('offset-left', ev.offsetX);
                el.attr('offset-top', ev.offsetY);
                el.attr('allow-drag', 'true');
            });
            $(document).on('mouseup.lobibox', function () {
                el.attr('allow-drag', 'false');
            });
            $(document).on('mousemove.lobibox', function (ev) {
                if (el.attr('allow-drag') === 'true') {
                    var left = ev.clientX - parseInt(el.attr('offset-left'), 10) - parseInt(el.css('border-left-width'), 10);
                    var top = ev.clientY - parseInt(el.attr('offset-top'), 10) - parseInt(el.css('border-top-width'), 10);
                    el.css({
                        left: left,
                        top: top
                    });
                }
            });
        },

        /**
         * Set the message of messagebox
         *
         * @param {string} msg "new message of messagebox"
         * @returns {LobiboxBase}
         * @private
         */
        _setContent: function (msg) {
            var me = this;
            me.$el.find('.lobibox-body').html(msg);
            return me;
        },

        _beforeShow: function () {
            var me = this;
            me._triggerEvent('onShow');
        },

        _afterShow: function () {
            var me = this;
            Lobibox.counter++;
            me.$el.attr('data-nth', Lobibox.counter);
            if (!me.$options.draggable) {
                $(window).on('resize.lobibox-' + me.$el.attr('data-nth'), function () {
                    me.refreshWidth();
                    me.refreshHeight();
                    me.$el.css('left', '50%').css('margin-left', '-' + (me.$el.width() / 2) + 'px');
                    me.$el.css('top', '50%').css('margin-top', '-' + (me.$el.height() / 2) + 'px');
                });
            }

            me._triggerEvent('shown');
        },

        _beforeClose: function () {
            var me = this;
            me._triggerEvent('beforeClose');
        },

        _afterClose: function () {
            var me = this;
            if (!me.$options.draggable) {
                $(window).off('resize.lobibox-' + me.$el.attr('data-nth'));
            }
            me._triggerEvent('closed');
        },
        //------------------------------------------------------------------------------
        //--------------------------PUBLIC METHODS--------------------------------------
        //------------------------------------------------------------------------------

        /**
         * Hide the messagebox
         *
         * @returns {LobiboxBase}
         */
        hide: function () {
            var me = this;
            if (me.$options.hideClass) {
                me.$el.removeClass(me.$options.showClass);
                me.$el.addClass(me.$options.hideClass);
                setTimeout(function () {
                    callback();
                }, me.$options.delayToRemove);
            } else {
                callback();
            }
            function callback() {
                me.$el.addClass('lobibox-hidden');
                if ($('.lobibox[data-is-modal=true]:not(.lobibox-hidden)').length === 0) {
                    $('.lobibox-backdrop').remove();
                    $('body').removeClass(Lobibox.base.OPTIONS.bodyClass);
                }
            }

            return this;
        },

        /**
         * Removes the messagebox from document
         *
         * @returns {LobiboxBase}
         */
        destroy: function () {
            var me = this;
            me._beforeClose();
            if (me.$options.hideClass) {
                me.$el.removeClass(me.$options.showClass).addClass(me.$options.hideClass);
                setTimeout(function () {
                    callback();
                }, me.$options.delayToRemove);
            } else {
                callback();
            }
            function callback() {
                me.$el.remove();
                if ($('.lobibox[data-is-modal=true]').length === 0) {
                    $('.lobibox-backdrop').remove();
                    $('body').removeClass(Lobibox.base.OPTIONS.bodyClass);
                }
                me._afterClose();
            }

            return this;
        },

        /**
         * Set the width of messagebox
         *
         * @param {number} width "new width of messagebox"
         * @returns {LobiboxBase}
         */
        setWidth: function (width) {
            var me = this;
            me.$el.css('width', me._calculateWidth(width));
            return me;
        },

        refreshWidth: function () {
            this.setWidth(this.$el.width());
        },

        refreshHeight: function () {
            this.setHeight(this.$el.height());
        },

        /**
         * Set the height of messagebox
         *
         * @param {number} height "new height of messagebox"
         * @returns {LobiboxBase}
         */
        setHeight: function (height) {
            var me = this;
            me.$el.css('height', me._calculateHeight(height))
                .find('.lobibox-body')
                .css('height', me._calculateBodyHeight(me.$el.innerHeight()));
            return me;
        },

        /**
         * Set the width and height of messagebox
         *
         * @param {number} width "new width of messagebox"
         * @param {number} height "new height of messagebox"
         * @returns {LobiboxBase}
         */
        setSize: function (width, height) {
            var me = this;
            me.setWidth(width);
            me.setHeight(height);
            return me;
        },

        /**
         * Set position of messagebox
         *
         * @param {number|String} left "left coordinate of messsagebox or string representaing position. Available: ('top', 'center', 'bottom')"
         * @param {number} top
         * @returns {LobiboxBase}
         */
        setPosition: function (left, top) {
            var pos;
            if (typeof left === 'number' && typeof top === 'number') {
                pos = {
                    left: left,
                    top: top
                };
            } else if (typeof left === 'string') {
                pos = this._calculatePosition(left);
            }
            this.$el.css(pos);
            return this;
        },
        /**
         * Set the title of messagebox
         *
         * @param {string} title "new title of messagebox"
         * @returns {LobiboxBase}
         */
        setTitle: function (title) {
            return this.$el.find('.lobibox-title').html(title);
        },

        /**
         * Get the title of messagebox
         *
         * @returns {string}
         */
        getTitle: function () {
            return this.$el.find('.lobibox-title').html();
        },

        /**
         * Show messagebox
         *
         * @returns {LobiboxBase}
         */
        show: function () {
            var me = this,
                $body = $('body');

            me._beforeShow();

            me.$el.removeClass('lobibox-hidden');
            $body.append(me.$el);
            if (me.$options.buttons) {
                var buttons = me.$el.find('.lobibox-footer').children();
                buttons[0].focus();
            }
            if (me.$options.modal) {
                $body.addClass(Lobibox.base.OPTIONS.bodyClass);
                me._addBackdrop();
            }
            if (me.$options.delay !== false) {
                setTimeout(function () {
                    me.destroy();
                }, me.$options.delay);
            }
            me._afterShow();
            return me;
        }
    };
    //User can set default options by this variable
    Lobibox.base = {};
    Lobibox.base.OPTIONS = {
        bodyClass: 'lobibox-open',

        modalClasses: {
            'error': 'lobibox-error',
            'success': 'lobibox-success',
            'info': 'lobibox-info',
            'warning': 'lobibox-warning',
            'confirm': 'lobibox-confirm',
            'progress': 'lobibox-progress',
            'prompt': 'lobibox-prompt',
            'default': 'lobibox-default',
            'window': 'lobibox-window'
        },
        buttonsAlign: ['left', 'center', 'right'],
        buttons: {
            ok: {
                'class': 'lobibox-btn lobibox-btn-default',
                text: 'OK',
                closeOnClick: true
            },
            cancel: {
                'class': 'lobibox-btn lobibox-btn-cancel',
                text: 'Cancel',
                closeOnClick: true
            },
            yes: {
                'class': 'lobibox-btn lobibox-btn-yes',
                text: 'Yes',
                closeOnClick: true
            },
            no: {
                'class': 'lobibox-btn lobibox-btn-no',
                text: 'No',
                closeOnClick: true
            }
        },
        icons: {
            bootstrap: {
                confirm: 'fa fa-question-circle fa-lg',
                success: 'glyphicon glyphicon-ok-sign',
                error: 'glyphicon glyphicon-remove-sign',
                warning: 'glyphicon glyphicon-exclamation-sign',
                info: 'glyphicon glyphicon-info-sign'
            },
            fontAwesome: {
                confirm: 'fa fa-question-circle',
                success: 'fa fa-check-circle',
                error: 'fa fa-times-circle',
                warning: 'fa fa-exclamation-circle',
                info: 'fa fa-info-circle'
            }
        }
    };
    Lobibox.base.DEFAULTS = {
        horizontalOffset: 5,                //If the messagebox is larger (in width) than window's width. The messagebox's width is reduced to window width - 2 * horizontalOffset
        verticalOffset: 5,                  //If the messagebox is larger (in height) than window's height. The messagebox's height is reduced to window height - 2 * verticalOffset
        width: 600,
        height: 'auto',                     // Height is automatically calculated by width
        closeButton: true,                  // Show close button or not
        draggable: false,                   // Make messagebox draggable
        customBtnClass: 'lobibox-btn lobibox-btn-default', // Class for custom buttons
        modal: true,
        debug: false,
        buttonsAlign: 'center',             // Position where buttons should be aligned
        closeOnEsc: true,                   // Close messagebox on Esc press
        delayToRemove: 200,                 // Time after which lobibox will be removed after remove call. (This option is for hide animation to finish)
        delay: false,                       // Time to remove lobibox after shown
        baseClass: 'animated-super-fast',   // Base class to add all messageboxes
        showClass: 'zoomIn',                // Show animation class
        hideClass: 'zoomOut',               // Hide animation class
        iconSource: 'bootstrap',            // "bootstrap" or "fontAwesome" the library which will be used for icons

        //events
        //When messagebox show is called but before it is actually shown
        onShow: null,
        //After messagebox is shown
        shown: null,
        //When messagebox remove method is called but before it is actually hidden
        beforeClose: null,
        //After messagebox is hidden
        closed: null
    };
    //------------------------------------------------------------------------------
    //-------------------------LobiboxPrompt----------------------------------------
    //------------------------------------------------------------------------------
    function LobiboxPrompt(type, options) {
        this.$input = null;
        this.$type = 'prompt';
        this.$promptType = type;

        options = $.extend({}, Lobibox.prompt.DEFAULT_OPTIONS, options);

        this.$options = this._processInput(options);

        this._init();
        this.debug(this);
    }

    LobiboxPrompt.prototype = $.extend({}, LobiboxBase, {
        constructor: LobiboxPrompt,

        _processInput: function (options) {
            var me = this;

            var mergedOptions = LobiboxBase._processInput.call(me, options);
            mergedOptions.buttons = {
                ok: Lobibox.base.OPTIONS.buttons.ok,
                cancel: Lobibox.base.OPTIONS.buttons.cancel
            };
            options = $.extend({}, mergedOptions, LobiboxPrompt.DEFAULT_OPTIONS, options);
            return options;
        },

        _init: function () {
            var me = this;
            LobiboxBase._init.call(me);
            me.show();
        },

        _afterShow: function () {
            var me = this;
            me._setContent(me._createInput())._position();
            me.$input.focus();
            LobiboxBase._afterShow.call(me);
        },

        _createInput: function () {
            var me = this,
                label;
            if (me.$options.multiline) {
                me.$input = $('<textarea></textarea>').attr('rows', me.$options.lines);
            } else {
                me.$input = $('<input type="' + me.$promptType + '"/>');
            }
            me.$input.addClass('lobibox-input').attr(me.$options.attrs);
            if (me.$options.value) {
                me.setValue(me.$options.value);
            }
            if (me.$options.label) {
                label = $('<label>' + me.$options.label + '</label>');
            }
            return $('<div></div>').append(label, me.$input);
        },

        /**
         * Set value of input
         *
         * @param {string} val "value of input"
         * @returns {LobiboxPrompt}
         */
        setValue: function (val) {
            this.$input.val(val);
            return this;
        },

        /**
         * Get value of input
         *
         * @returns {String}
         */
        getValue: function () {
            return this.$input.val();
        },

        isValid: function () {
            var me = this,
                $error = me.$el.find('.lobibox-input-error-message');

            if (me.$options.required && !me.getValue()) {
                me.$input.addClass('invalid');
                if ($error.length === 0) {
                    me.$el.find('.lobibox-body').append('<p class="lobibox-input-error-message">' + me.$options.errorMessage + '</p>');
                    me._position();
                    me.$input.focus();
                }
                return false;
            }
            me.$input.removeClass('invalid');
            $error.remove();
            me._position();
            me.$input.focus();

            return true;
        }
    });

    LobiboxPrompt.DEFAULT_OPTIONS = {
        width: 400,
        attrs: {},          // Object of any valid attribute of input field
        value: '',          // Value which is given to textfield when messagebox is created
        multiline: false,   // Set this true for multiline prompt
        lines: 3,           // This works only for multiline prompt. Number of lines
        type: 'text',       // Prompt type. Available types (text|number|color)
        label: '',          // Set some text which will be shown exactly on top of textfield
        required: true,
        errorMessage: 'The field is required'
    };
    //------------------------------------------------------------------------------
    //-------------------------LobiboxConfirm---------------------------------------
    //------------------------------------------------------------------------------
    function LobiboxConfirm(options) {
        this.$type = 'confirm';

        //        options = $.extend({}, Lobibox.confirm.DEFAULT_OPTIONS, options);

        this.$options = this._processInput(options);
        this._init();
        this.debug(this);
    }

    LobiboxConfirm.prototype = $.extend({}, LobiboxBase, {
        constructor: LobiboxConfirm,

        _processInput: function (options) {
            var me = this;

            var mergedOptions = LobiboxBase._processInput.call(me, options);
            mergedOptions.buttons = {
                yes: Lobibox.base.OPTIONS.buttons.yes,
                no: Lobibox.base.OPTIONS.buttons.no
            };
            options = $.extend({}, mergedOptions, Lobibox.confirm.DEFAULTS, options);
            return options;
        },

        _init: function () {
            var me = this;

            LobiboxBase._init.call(me);
            me.show();
        },

        _afterShow: function () {
            var me = this;

            var d = $('<div></div>');
            if (me.$options.iconClass) {
                d.append($('<div class="lobibox-icon-wrapper"></div>')
                    .append('<i class="lobibox-icon ' + me.$options.iconClass + '"></i>'))
                    ;
            }
            d.append('<div class="lobibox-body-text-wrapper"><span class="lobibox-body-text">' + me.$options.msg + '</span></div>');
            me._setContent(d.html());

            me._position();

            LobiboxBase._afterShow.call(me);
        }
    });

    Lobibox.confirm.DEFAULTS = {
        title: 'Question',
        width: 500
    };
    //------------------------------------------------------------------------------
    //-------------------------LobiboxAlert------------------------------------------
    //------------------------------------------------------------------------------
    function LobiboxAlert(type, options) {
        this.$type = type;

        //        options = $.extend({}, Lobibox.alert.DEFAULT_OPTIONS, Lobibox[type].DEFAULT_OPTIONS, options);

        this.$options = this._processInput(options);

        this._init();
        this.debug(this);
    }

    LobiboxAlert.prototype = $.extend({}, LobiboxBase, {
        constructor: LobiboxAlert,

        _processInput: function (options) {

            //            ALERT_OPTIONS = $.extend({}, LobiboxAlert.OPTIONS, Lobibox.alert.DEFAULTS);
            var me = this;
            var mergedOptions = LobiboxBase._processInput.call(me, options);
            mergedOptions.buttons = {
                ok: Lobibox.base.OPTIONS.buttons.ok
            };

            options = $.extend({}, mergedOptions, Lobibox.alert.OPTIONS[me.$type], Lobibox.alert.DEFAULTS, options);

            return options;
        },

        _init: function () {
            var me = this;
            LobiboxBase._init.call(me);
            me.show();
        },

        _afterShow: function () {
            var me = this;

            var d = $('<div></div>');
            if (me.$options.iconClass) {
                d.append($('<div class="lobibox-icon-wrapper"></div>')
                    .append('<i class="lobibox-icon ' + me.$options.iconClass + '"></i>'))
                    ;
            }
            d.append('<div class="lobibox-body-text-wrapper"><span class="lobibox-body-text">' + me.$options.msg + '</span></div>');
            me._setContent(d.html());
            me._position();

            LobiboxBase._afterShow.call(me);
        }
    });
    Lobibox.alert.OPTIONS = {
        warning: {
            title: 'Uyari'
        },
        info: {
            title: 'Bilgilendirme'
        },
        success: {
            title: '��lem'
        },
        error: {
            title: 'Hata'
        }
    };
    //User can set default options by this variable
    Lobibox.alert.DEFAULTS = {};
    //------------------------------------------------------------------------------
    //-------------------------LobiboxProgress--------------------------------------
    //------------------------------------------------------------------------------
    function LobiboxProgress(options) {
        this.$type = 'progress';
        this.$progressBarElement = null;
        this.$options = this._processInput(options);
        this.$progress = 0;

        this._init();
        this.debug(this);
    }

    LobiboxProgress.prototype = $.extend({}, LobiboxBase, {
        constructor: LobiboxProgress,

        _processInput: function (options) {
            var me = this;
            var mergedOptions = LobiboxBase._processInput.call(me, options);

            options = $.extend({}, mergedOptions, Lobibox.progress.DEFAULTS, options);
            return options;
        },

        _init: function () {
            var me = this;

            LobiboxBase._init.call(me);
            me.show();
        },

        _afterShow: function () {
            var me = this;

            if (me.$options.progressTpl) {
                me.$progressBarElement = $(me.$options.progressTpl);
            } else {
                me.$progressBarElement = me._createProgressbar();
            }
            var label;
            if (me.$options.label) {
                label = $('<label>' + me.$options.label + '</label>');
            }
            var innerHTML = $('<div></div>').append(label, me.$progressBarElement);
            me._setContent(innerHTML);
            me._position();

            LobiboxBase._afterShow.call(me);
        },

        _createProgressbar: function () {
            var me = this;
            var outer = $('<div class="lobibox-progress-bar-wrapper lobibox-progress-outer"></div>')
                .append('<div class="lobibox-progress-bar lobibox-progress-element"></div>')
                ;
            if (me.$options.showProgressLabel) {
                outer.append('<span class="lobibox-progress-text" data-role="progress-text"></span>');
            }

            return outer;
        },

        /**
         * Set progress value
         *
         * @param {number} progress "progress value"
         * @returns {LobiboxProgress}
         */
        setProgress: function (progress) {
            var me = this;
            if (me.$progress === 100) {
                return;
            }
            progress = Math.min(100, Math.max(0, progress));
            me.$progress = progress;
            me._triggerEvent('progressUpdated');
            if (me.$progress === 100) {
                me._triggerEvent('progressCompleted');
            }
            me.$el.find('.lobibox-progress-element').css('width', progress.toFixed(1) + "%");
            me.$el.find('[data-role="progress-text"]').html(progress.toFixed(1) + "%");
            return me;
        },

        /**
         * Get progress value
         *
         * @returns {number}
         */
        getProgress: function () {
            return this.$progress;
        }
    });

    Lobibox.progress.DEFAULTS = {
        width: 500,
        showProgressLabel: true,  // Show percentage of progress
        label: '',  // Show progress label
        progressTpl: false,  //Template of progress bar

        //Events
        progressUpdated: null,
        progressCompleted: null
    };
    //------------------------------------------------------------------------------
    //-------------------------LobiboxWindow----------------------------------------
    //------------------------------------------------------------------------------
    function LobiboxWindow(type, options) {
        this.$type = type;

        this.$options = this._processInput(options);

        this._init();
        this.debug(this);
    }

    LobiboxWindow.prototype = $.extend({}, LobiboxBase, {
        constructor: LobiboxWindow,
        _processInput: function (options) {
            var me = this;
            var mergedOptions = LobiboxBase._processInput.call(me, options);

            if (options.content && typeof options.content === 'function') {
                options.content = options.content();
            }
            if (options.content instanceof jQuery) {
                options.content = options.content.clone();
            }
            options = $.extend({}, mergedOptions, Lobibox.window.DEFAULTS, options);
            return options;
        },

        _init: function () {
            var me = this;

            LobiboxBase._init.call(me);
            me.setContent(me.$options.content);
            if (me.$options.url && me.$options.autoload) {
                if (!me.$options.showAfterLoad) {
                    me.show();
                }
                me.load(function () {
                    if (me.$options.showAfterLoad) {
                        me.show();
                    }
                });
            } else {
                me.show();
            }
        },

        _afterShow: function () {
            var me = this;

            me._position();

            LobiboxBase._afterShow.call(me);
        },

        /**
         * Setter method for <code>params</code> option
         *
         * @param {object} params "new params"
         * @returns {LobiboxWindow}
         */
        setParams: function (params) {
            var me = this;
            me.$options.params = params;
            return me;
        },
        /**
         * Getter method for <code>params</code>
         *
         * @returns {object}
         */
        getParams: function () {
            var me = this;
            return me.$options.params;
        },
        /**
         * Setter method of <code>loadMethod</code> option
         *
         * @param {string} method "new method"
         * @returns {LobiboxWindow}
         */
        setLoadMethod: function (method) {
            var me = this;
            me.$options.loadMethod = method;
            return me;
        },
        /**
         * Getter method for <code>loadMethod</code> option
         *
         * @returns {string}
         */
        getLoadMethod: function () {
            var me = this;
            return me.$options.loadMethod;
        },
        /**
         * Setter method of <code>content</code> option.
         * Change the content of window
         *
         * @param {string} content "new content"
         * @returns {LobiboxWindow}
         */
        setContent: function (content) {
            var me = this;
            me.$options.content = content;
            me.$el.find('.lobibox-body').html('').append(content);
            return me;
        },
        /**
         * Getter method of <code>content</code> option
         *
         * @returns {string}
         */
        getContent: function () {
            var me = this;
            return me.$options.content;
        },
        /**
         * Setter method of <code>url</code> option
         *
         * @param {string} url "new url"
         * @returns {LobiboxWindow}
         */
        setUrl: function (url) {
            this.$options.url = url;
            return this;
        },
        /**
         * Getter method of <code>url</code> option
         *
         * @returns {String}
         */
        getUrl: function () {
            return this.$options.url;
        },
        /**
         * Loads content to window by ajax from specific url
         *
         * @param {Function} callback "callback function"
         * @returns {LobiboxWindow}
         */
        load: function (callback) {
            var me = this;
            if (!me.$options.url) {
                return me;
            }
            $.ajax(me.$options.url, {
                method: me.$options.loadMethod,
                data: me.$options.params
            }).done(function (res) {
                me.setContent(res);
                if (callback && typeof callback === 'function') {
                    callback(res);
                }
            });
            return me;
        }
    });

    Lobibox.window.DEFAULTS = {
        width: 480,
        height: 600,
        content: '',  // HTML Content of window
        url: '',  // URL which will be used to load content
        draggable: true,  // Override default option
        autoload: true,  // Auto load from given url when window is created
        loadMethod: 'GET',  // Ajax method to load content
        showAfterLoad: true,  // Show window after content is loaded or show and then load content
        params: {}  // Parameters which will be send by ajax for loading content
    };

})();

//Author      : @arboshiki
/**
 * Generates random string of n length.
 * String contains only letters and numbers
 *
 * @param {int} n
 * @returns {String}
 */
Math.randomString = function (n) {
    var text = "";
    var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

    for (var i = 0; i < n; i++)
        text += possible.charAt(Math.floor(Math.random() * possible.length));

    return text;
};
var Lobibox = Lobibox || {};
(function () {

    var LobiboxNotify = function (type, options) {
        //------------------------------------------------------------------------------
        //----------------PROTOTYPE VARIABLES-------------------------------------------
        //------------------------------------------------------------------------------
        this.$type = null;
        this.$options = null;
        this.$el = null;
        //------------------------------------------------------------------------------
        //-----------------PRIVATE VARIABLES--------------------------------------------
        //------------------------------------------------------------------------------        
        var me = this;
        //------------------------------------------------------------------------------
        //-----------------PRIVATE FUNCTIONS--------------------------------------------
        //------------------------------------------------------------------------------
        var _processInput = function (options) {

            if (options.size === 'mini' || options.size === 'large') {
                options = $.extend({}, Lobibox.notify.OPTIONS[options.size], options);
            }
            options = $.extend({}, Lobibox.notify.OPTIONS[me.$type], Lobibox.notify.DEFAULTS, options);

            if (options.size !== 'mini' && options.title === true) {
                options.title = Lobibox.notify.OPTIONS[me.$type].title;
            } else if (options.size === 'mini' && options.title === true) {
                options.title = false;
            }
            if (options.icon === true) {
                options.icon = Lobibox.notify.OPTIONS.icons[options.iconSource][me.$type];
            }
            if (options.sound === true) {
                options.sound = Lobibox.notify.OPTIONS[me.$type].sound;
            }
            if (options.sound) {
                options.sound = options.soundPath + options.sound + options.soundExt;
            }
            return options;
        };
        var _init = function () {
            // Create notification
            var $notify = _createNotify();
            if (me.$options.size === 'mini') {
                $notify.addClass('notify-mini');
            }

            if (typeof me.$options.position === 'string') {
                var $wrapper = _createNotifyWrapper();
                _appendInWrapper($notify, $wrapper);
                if ($wrapper.hasClass('center')) {
                    $wrapper.css('margin-left', '-' + ($wrapper.width() / 2) + "px");
                }
            } else {
                $('body').append($notify);
                $notify.css({
                    'position': 'fixed',
                    left: me.$options.position.left,
                    top: me.$options.position.top,
                })
            }

            me.$el = $notify;
            if (me.$options.sound) {
                var snd = new Audio(me.$options.sound); // buffers automatically when created
                snd.play();
            }
            if (me.$options.rounded) {
                me.$el.addClass('rounded');
            }
        };
        var _appendInWrapper = function ($el, $wrapper) {
            if (me.$options.size === 'normal') {
                if ($wrapper.hasClass('bottom')) {
                    $wrapper.prepend($el);
                } else {
                    $wrapper.append($el);
                }

            } else if (me.$options.size === 'mini') {
                if ($wrapper.hasClass('bottom')) {
                    $wrapper.prepend($el);
                } else {
                    $wrapper.append($el);
                }
            } else if (me.$options.size === 'large') {
                var tabPane = _createTabPane().append($el);
                var $li = _createTabControl(tabPane.attr('id'));
                $wrapper.find('.lb-notify-wrapper').append(tabPane);
                $wrapper.find('.lb-notify-tabs').append($li);
                _activateTab($li);
                $li.find('>a').click(function () {
                    _activateTab($li);
                });
            }
        };
        var _activateTab = function ($li) {
            $li.closest('.lb-notify-tabs').find('>li').removeClass('active');
            $li.addClass('active');
            var $current = $($li.find('>a').attr('href'));
            $current.closest('.lb-notify-wrapper').find('>.lb-tab-pane').removeClass('active');
            $current.addClass('active')
        };
        var _createTabControl = function (tabPaneId) {
            var $li = $('<li></li>', {
                'class': Lobibox.notify.OPTIONS[me.$type]['class']
            });
            $('<a></a>', {
                'href': '#' + tabPaneId
            }).append('<i class="tab-control-icon ' + me.$options.icon + '"></i>')
                .appendTo($li);
            return $li;
        };
        var _createTabPane = function () {
            return $('<div></div>', {
                'class': 'lb-tab-pane',
                'id': Math.randomString(10)
            })
        };
        var _createNotifyWrapper = function () {
            var selector = (me.$options.size === 'large' ? '.lobibox-notify-wrapper-large' : '.lobibox-notify-wrapper')
                + "." + me.$options.position.replace(/\s/gi, '.'),
                $wrapper;

            //var classes = me.$options.position.split(" ");
            $wrapper = $(selector);
            if ($wrapper.length === 0) {
                $wrapper = $('<div></div>')
                    .addClass(selector.replace(/\./g, ' ').trim())
                    .appendTo($('body'));
                if (me.$options.size === 'large') {
                    $wrapper.append($('<ul class="lb-notify-tabs"></ul>'))
                        .append($('<div class="lb-notify-wrapper"></div>'));
                }
            }
            return $wrapper;
        };
        var _createNotify = function () {
            var OPTS = Lobibox.notify.OPTIONS,
                $iconEl,
                $innerIconEl,
                $iconWrapper,
                $body,
                $msg,
                $notify = $('<div></div>', {
                    'class': 'lobibox-notify ' + OPTS[me.$type]['class'] + ' ' + OPTS['class'] + ' ' + me.$options.showClass
                });

            $iconWrapper = $('<div class="lobibox-notify-icon-wrapper"></div>').appendTo($notify);
            $iconEl = $('<div class="lobibox-notify-icon"></div>').appendTo($iconWrapper);
            $innerIconEl = $('<div></div>').appendTo($iconEl);

            // Add image or icon depending on given parameters
            if (me.$options.img) {
                $innerIconEl.append('<img src="' + me.$options.img + '"/>');
            } else if (me.$options.icon) {
                $innerIconEl.append('<div class="icon-el"><i class="' + me.$options.icon + '"></i></div>');
            } else {
                $notify.addClass('without-icon');
            }
            // Create body, append title and message in body and append body in notification
            $msg = $('<div class="lobibox-notify-msg">' + me.$options.msg + '</div>');

            if (me.$options.messageHeight !== false) {
                $msg.css('max-height', me.$options.messageHeight);
            }

            $body = $('<div></div>', {
                'class': 'lobibox-notify-body'
            }).append($msg).appendTo($notify);

            if (me.$options.title) {
                $body.prepend('<div class="lobibox-notify-title">' + me.$options.title + '<div>');
            }
            _addCloseButton($notify);
            if (me.$options.size === 'normal' || me.$options.size === 'mini') {
                _addCloseOnClick($notify);
                _addDelay($notify);
            }

            // Give width to notification
            if (me.$options.width) {
                $notify.css('width', _calculateWidth(me.$options.width));
            }

            return $notify;
        };
        var _addCloseButton = function ($el) {
            if (!me.$options.closable) {
                return;
            }
            $('<span class="lobibox-close">&times;</span>').click(function () {
                me.remove();
            }).appendTo($el);
        };
        var _addCloseOnClick = function ($el) {
            if (!me.$options.closeOnClick) {
                return;
            }
            $el.click(function () {
                me.remove();
            });
        };
        var _addDelay = function ($el) {
            if (!me.$options.delay) {
                return;
            }
            if (me.$options.delayIndicator) {
                var delay = $('<div class="lobibox-delay-indicator"><div></div></div>');
                $el.append(delay);
            }
            var time = 0;
            var interval = 1000 / 30;
            var timer = setInterval(function () {
                time += interval;
                var width = 100 * time / me.$options.delay;
                if (width >= 100) {
                    width = 100;
                    me.remove();
                    timer = clearInterval(timer);
                }
                if (me.$options.delayIndicator) {
                    delay.find('div').css('width', width + "%");
                }

            }, interval);
        };
        var _findTabToActivate = function ($li) {
            var $itemToActivate = $li.prev();
            if ($itemToActivate.length === 0) {
                $itemToActivate = $li.next();
            }
            if ($itemToActivate.length === 0) {
                return null;
            }
            return $itemToActivate;
        };
        var _calculateWidth = function (width) {
            width = Math.min($(window).outerWidth(), width);
            return width;
        };
        //------------------------------------------------------------------------------
        //----------------PROTOTYPE FUNCTIONS-------------------------------------------
        //------------------------------------------------------------------------------
        /**
         * Delete the notification
         *
         * @returns {LobiboxNotify}
         */
        this.remove = function () {
            me.$el.removeClass(me.$options.showClass)
                .addClass(me.$options.hideClass);
            var parent = me.$el.parent();
            var wrapper = parent.closest('.lobibox-notify-wrapper-large');

            var href = '#' + parent.attr('id');

            var $li = wrapper.find('>.lb-notify-tabs>li:has(a[href="' + href + '"])');
            $li.addClass(Lobibox.notify.OPTIONS['class'])
                .addClass(me.$options.hideClass);
            setTimeout(function () {
                if (me.$options.size === 'normal' || me.$options.size === 'mini') {
                    me.$el.remove();
                } else if (me.$options.size === 'large') {

                    var $newLi = _findTabToActivate($li);
                    if ($newLi) {
                        _activateTab($newLi);
                    }
                    $li.remove();
                    parent.remove();
                }
            }, 500);
            return me;
        };
        //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        //------------------------------------------------------------------------------
        this.$type = type;
        this.$options = _processInput(options);
        _init();
    };

    Lobibox.notify = function (type, options) {
        if (["default", "info", "warning", "error", "success"].indexOf(type) > -1) {
            var lobibox = new LobiboxNotify(type, options);
            lobibox.$el.data('lobibox', lobibox);
            return lobibox;
        }
    };
    Lobibox.notify.closeAll = function () {
        var ll = $('.lobibox-notify');
        ll.each(function (ind, el) {
            var notify = $(el).data('lobibox').remove();
        });
    };
    //User can set default options to this variable
    Lobibox.notify.DEFAULTS = {
        title: true,                // Title of notification. If you do not include the title in options it will automatically takes its value 
        //from Lobibox.notify.OPTIONS object depending of the type of the notifications or set custom string. Set this false to disable title
        size: 'normal',             // normal, mini, large
        soundPath: '/Content/plugins/Lobibox/sounds/',   // The folder path where sounds are located
        soundExt: '.ogg',           // Default extension for all sounds
        showClass: 'fadeInDown',    // Show animation class.
        hideClass: 'zoomOut',       // Hide animation class.
        icon: true,                 // Icon of notification. Leave as is for default icon or set custom string
        msg: '',                    // Message of notification
        img: null,                  // Image source string
        closable: true,             // Make notifications closable
        hideCloseButton: false,     // Notification may be closable but you can hide close button and it will be closed by clicking on notification itsef
        delay: 5000,                // Hide notification after this time (in miliseconds)
        delayIndicator: true,       // Show timer indicator
        closeOnClick: true,         // Close notifications by clicking on them
        width: 400,                 // Width of notification box
        sound: true,                // Sound of notification. Set this false to disable sound. Leave as is for default sound or set custom soud path
        // Place to show notification. Available options: "top left", "top right", "bottom left", "bottom right", "center top", "center bottom"
        // It can also be object {left: number, top: number} to position notification at any place
        position: "bottom right",
        iconSource: 'bootstrap',    // "bootstrap" or "fontAwesome" the library which will be used for icons
        rounded: false,             // Whether to make notification corners rounded
        messageHeight: 60           // Notification message maximum height
    };
    //This variable is necessary.
    Lobibox.notify.OPTIONS = {
        'class': 'animated-fast',
        large: {
            width: 500,
            messageHeight: 96
        },
        mini: {
            'class': 'notify-mini',
            messageHeight: 32
        },
        default: {
            'class': 'lobibox-notify-default',
            'title': 'Default',
            sound: false
        },
        success: {
            'class': 'lobibox-notify-success',
            'title': 'Success',
            sound: 'sound2'
        },
        error: {
            'class': 'lobibox-notify-error',
            'title': 'Error',
            sound: 'sound4'
        },
        warning: {
            'class': 'lobibox-notify-warning',
            'title': 'Warning',
            sound: 'sound5'
        },
        info: {
            'class': 'lobibox-notify-info',
            'title': 'Information',
            sound: 'sound6'
        },
        icons: {
            bootstrap: {
                success: 'fa fa-check-circle fa-lg',
                error: 'fa fa-times-circle fa-lg',
                warning: 'fa fa-exclamation-circle fa-lg',
                info: 'fa fa-info-circle fa-lg'
            },
            fontAwesome: {
                success: 'fa fa-check-circle',
                error: 'fa fa-times-circle',
                warning: 'fa fa-exclamation-circle',
                info: 'fa fa-info-circle'
            }
        }
    };
})();


;
/**
 * alertify
 * An unobtrusive customizable JavaScript notification system
 *
 * @author Fabien Doiron <fabien.doiron@gmail.com>
 * @copyright Fabien Doiron 2013
 * @license MIT <http://opensource.org/licenses/mit-license.php>
 * @link http://fabien-d.github.com/alertify.js/
 * @module alertify
 * @version 0.3.11
 */
(function (global, undefined) {
	"use strict";

	var document = global.document,
	    Alertify;

	Alertify = function () {

		var _alertify = {},
		    dialogs   = {},
		    isopen    = false,
		    keys      = { ENTER: 13, ESC: 27, SPACE: 32 },
		    queue     = [],
		    $, btnCancel, btnOK, btnReset, btnResetBack, btnFocus, elCallee, elCover, elDialog, elLog, form, input, getTransitionEvent;

		/**
		 * Markup pieces
		 * @type {Object}
		 */
		dialogs = {
			buttons : {
				holder : "<nav class=\"alertify-buttons\">{{buttons}}</nav>",
				submit : "<button type=\"submit\" class=\"alertify-button alertify-button-ok\" id=\"alertify-ok\">{{ok}}</button>",
				ok     : "<button class=\"alertify-button alertify-button-ok\" id=\"alertify-ok\">{{ok}}</button>",
				cancel : "<button class=\"alertify-button alertify-button-cancel\" id=\"alertify-cancel\">{{cancel}}</button>"
			},
			input   : "<div class=\"alertify-text-wrapper\"><input type=\"text\" class=\"alertify-text\" id=\"alertify-text\"></div>",
			message : "<p class=\"alertify-message\">{{message}}</p>",
			log     : "<article class=\"alertify-log{{class}}\">{{message}}</article>"
		};

		/**
		 * Return the proper transitionend event
		 * @return {String}    Transition type string
		 */
		getTransitionEvent = function () {
			var t,
			    type,
			    supported   = false,
			    el          = document.createElement("fakeelement"),
			    transitions = {
				    "WebkitTransition" : "webkitTransitionEnd",
				    "MozTransition"    : "transitionend",
				    "OTransition"      : "otransitionend",
				    "transition"       : "transitionend"
			    };

			for (t in transitions) {
				if (el.style[t] !== undefined) {
					type      = transitions[t];
					supported = true;
					break;
				}
			}

			return {
				type      : type,
				supported : supported
			};
		};

		/**
		 * Shorthand for document.getElementById()
		 *
		 * @param  {String} id    A specific element ID
		 * @return {Object}       HTML element
		 */
		$ = function (id) {
			return document.getElementById(id);
		};

		/**
		 * Alertify private object
		 * @type {Object}
		 */
		_alertify = {

			/**
			 * Labels object
			 * @type {Object}
			 */
			labels : {
			  ok: ozdisanLocalization.general.Tamam[lang],
			  cancel: ozdisanLocalization.general.Iptal[lang]
			},

			/**
			 * Delay number
			 * @type {Number}
			 */
			delay : 5000,

			/**
			 * Whether buttons are reversed (default is secondary/primary)
			 * @type {Boolean}
			 */
			buttonReverse : false,

			/**
			 * Which button should be focused by default
			 * @type {String}	"ok" (default), "cancel", or "none"
			 */
			buttonFocus : "ok",

			/**
			 * Set the transition event on load
			 * @type {[type]}
			 */
			transition : undefined,

			/**
			 * Set the proper button click events
			 *
			 * @param {Function} fn    [Optional] Callback function
			 *
			 * @return {undefined}
			 */
			addListeners : function (fn) {
				var hasOK     = (typeof btnOK !== "undefined"),
				    hasCancel = (typeof btnCancel !== "undefined"),
				    hasInput  = (typeof input !== "undefined"),
				    val       = "",
				    self      = this,
				    ok, cancel, common, key, reset;

				// ok event handler
				ok = function (event) {
					if (typeof event.preventDefault !== "undefined") event.preventDefault();
					common(event);
					if (typeof input !== "undefined") val = input.value;
					if (typeof fn === "function") {
						if (typeof input !== "undefined") {
							fn(true, val);
						}
						else fn(true);
					}
					return false;
				};

				// cancel event handler
				cancel = function (event) {
					if (typeof event.preventDefault !== "undefined") event.preventDefault();
					common(event);
					if (typeof fn === "function") fn(false);
					return false;
				};

				// common event handler (keyup, ok and cancel)
				common = function (event) {
					self.hide();
					self.unbind(document.body, "keyup", key);
					self.unbind(btnReset, "focus", reset);
					if (hasOK) self.unbind(btnOK, "click", ok);
					if (hasCancel) self.unbind(btnCancel, "click", cancel);
				};

				// keyup handler
				key = function (event) {
					var keyCode = event.keyCode;
					if ((keyCode === keys.SPACE && !hasInput) || (hasInput && keyCode === keys.ENTER)) ok(event);
					if (keyCode === keys.ESC && hasCancel) cancel(event);
				};

				// reset focus to first item in the dialog
				reset = function (event) {
					if (hasInput) input.focus();
					else if (!hasCancel || self.buttonReverse) btnOK.focus();
					else btnCancel.focus();
				};

				// handle reset focus link
				// this ensures that the keyboard focus does not
				// ever leave the dialog box until an action has
				// been taken
				this.bind(btnReset, "focus", reset);
				this.bind(btnResetBack, "focus", reset);
				// handle OK click
				if (hasOK) this.bind(btnOK, "click", ok);
				// handle Cancel click
				if (hasCancel) this.bind(btnCancel, "click", cancel);
				// listen for keys, Cancel => ESC
				this.bind(document.body, "keyup", key);
				if (!this.transition.supported) {
					this.setFocus();
				}
			},

			/**
			 * Bind events to elements
			 *
			 * @param  {Object}   el       HTML Object
			 * @param  {Event}    event    Event to attach to element
			 * @param  {Function} fn       Callback function
			 *
			 * @return {undefined}
			 */
			bind : function (el, event, fn) {
				if (typeof el.addEventListener === "function") {
					el.addEventListener(event, fn, false);
				} else if (el.attachEvent) {
					el.attachEvent("on" + event, fn);
				}
			},

			/**
			 * Use alertify as the global error handler (using window.onerror)
			 *
			 * @return {boolean} success
			 */
			handleErrors : function () {
				if (typeof global.onerror !== "undefined") {
					var self = this;
					global.onerror = function (msg, url, line) {
						self.error("[" + msg + " on line " + line + " of " + url + "]", 0);
					};
					return true;
				} else {
					return false;
				}
			},

			/**
			 * Append button HTML strings
			 *
			 * @param {String} secondary    The secondary button HTML string
			 * @param {String} primary      The primary button HTML string
			 *
			 * @return {String}             The appended button HTML strings
			 */
			appendButtons : function (secondary, primary) {
				return this.buttonReverse ? primary + secondary : secondary + primary;
			},

			/**
			 * Build the proper message box
			 *
			 * @param  {Object} item    Current object in the queue
			 *
			 * @return {String}         An HTML string of the message box
			 */
			build : function (item) {
				var html    = "",
				    type    = item.type,
				    message = item.message,
				    css     = item.cssClass || "";

				html += "<div class=\"alertify-dialog\">";
				html += "<a id=\"alertify-resetFocusBack\" class=\"alertify-resetFocus\" href=\"#\">Reset Focus</a>";

				if (_alertify.buttonFocus === "none") html += "<a href=\"#\" id=\"alertify-noneFocus\" class=\"alertify-hidden\"></a>";

				// doens't require an actual form
				if (type === "prompt") html += "<div id=\"alertify-form\">";

				html += "<article class=\"alertify-inner\">";
				html += dialogs.message.replace("{{message}}", message);

				if (type === "prompt") html += dialogs.input;

				html += dialogs.buttons.holder;
				html += "</article>";

				if (type === "prompt") html += "</div>";

				html += "<a id=\"alertify-resetFocus\" class=\"alertify-resetFocus\" href=\"#\">Reset Focus</a>";
				html += "</div>";

				switch (type) {
				case "confirm":
					html = html.replace("{{buttons}}", this.appendButtons(dialogs.buttons.cancel, dialogs.buttons.ok));
					html = html.replace("{{ok}}", this.labels.ok).replace("{{cancel}}", this.labels.cancel);
					break;
				case "prompt":
					html = html.replace("{{buttons}}", this.appendButtons(dialogs.buttons.cancel, dialogs.buttons.submit));
					html = html.replace("{{ok}}", this.labels.ok).replace("{{cancel}}", this.labels.cancel);
					break;
				case "alert":
					html = html.replace("{{buttons}}", dialogs.buttons.ok);
					html = html.replace("{{ok}}", this.labels.ok);
					break;
				default:
					break;
				}

				elDialog.className = "alertify alertify-" + type + " " + css;
				elCover.className  = "alertify-cover";
				return html;
			},

			/**
			 * Close the log messages
			 *
			 * @param  {Object} elem    HTML Element of log message to close
			 * @param  {Number} wait    [optional] Time (in ms) to wait before automatically hiding the message, if 0 never hide
			 *
			 * @return {undefined}
			 */
			close : function (elem, wait) {
				// Unary Plus: +"2" === 2
				var timer = (wait && !isNaN(wait)) ? +wait : this.delay,
				    self  = this,
				    hideElement, transitionDone;

				// set click event on log messages
				this.bind(elem, "click", function () {
					hideElement(elem);
				});
				// Hide the dialog box after transition
				// This ensure it doens't block any element from being clicked
				transitionDone = function (event) {
					event.stopPropagation();
					// unbind event so function only gets called once
					self.unbind(this, self.transition.type, transitionDone);
					// remove log message
					elLog.removeChild(this);
					if (!elLog.hasChildNodes()) elLog.className += " alertify-logs-hidden";
				};
				// this sets the hide class to transition out
				// or removes the child if css transitions aren't supported
				hideElement = function (el) {
					// ensure element exists
					if (typeof el !== "undefined" && el.parentNode === elLog) {
						// whether CSS transition exists
						if (self.transition.supported) {
							self.bind(el, self.transition.type, transitionDone);
							el.className += " alertify-log-hide";
						} else {
							elLog.removeChild(el);
							if (!elLog.hasChildNodes()) elLog.className += " alertify-logs-hidden";
						}
					}
				};
				// never close (until click) if wait is set to 0
				if (wait === 0) return;
				// set timeout to auto close the log message
				setTimeout(function () { hideElement(elem); }, timer);
			},

			/**
			 * Create a dialog box
			 *
			 * @param  {String}   message        The message passed from the callee
			 * @param  {String}   type           Type of dialog to create
			 * @param  {Function} fn             [Optional] Callback function
			 * @param  {String}   placeholder    [Optional] Default value for prompt input field
			 * @param  {String}   cssClass       [Optional] Class(es) to append to dialog box
			 *
			 * @return {Object}
			 */
			dialog : function (message, type, fn, placeholder, cssClass) {
				// set the current active element
				// this allows the keyboard focus to be resetted
				// after the dialog box is closed
				elCallee = document.activeElement;
				// check to ensure the alertify dialog element
				// has been successfully created
				var check = function () {
					if ((elLog && elLog.scrollTop !== null) && (elCover && elCover.scrollTop !== null)) return;
					else check();
				};
				// error catching
				if (typeof message !== "string") throw new Error("message must be a string");
				if (typeof type !== "string") throw new Error("type must be a string");
				if (typeof fn !== "undefined" && typeof fn !== "function") throw new Error("fn must be a function");
				// initialize alertify if it hasn't already been done
				this.init();
				check();

				queue.push({ type: type, message: message, callback: fn, placeholder: placeholder, cssClass: cssClass });
				if (!isopen) this.setup();

				return this;
			},

			/**
			 * Extend the log method to create custom methods
			 *
			 * @param  {String} type    Custom method name
			 *
			 * @return {Function}
			 */
			extend : function (type) {
				if (typeof type !== "string") throw new Error("extend method must have exactly one paramter");
				return function (message, wait) {
					this.log(message, type, wait);
					return this;
				};
			},

			/**
			 * Hide the dialog and rest to defaults
			 *
			 * @return {undefined}
			 */
			hide : function () {
				var transitionDone,
				    self = this;
				// remove reference from queue
				queue.splice(0,1);
				// if items remaining in the queue
				if (queue.length > 0) this.setup(true);
				else {
					isopen = false;
					// Hide the dialog box after transition
					// This ensure it doens't block any element from being clicked
					transitionDone = function (event) {
						event.stopPropagation();
						// unbind event so function only gets called once
						self.unbind(elDialog, self.transition.type, transitionDone);
					};
					// whether CSS transition exists
					if (this.transition.supported) {
						this.bind(elDialog, this.transition.type, transitionDone);
						elDialog.className = "alertify alertify-hide alertify-hidden";
					} else {
						elDialog.className = "alertify alertify-hide alertify-hidden alertify-isHidden";
					}
					elCover.className  = "alertify-cover alertify-cover-hidden";
					// set focus to the last element or body
					// after the dialog is closed
					elCallee.focus();
				}
			},

			/**
			 * Initialize Alertify
			 * Create the 2 main elements
			 *
			 * @return {undefined}
			 */
			init : function () {
				// ensure legacy browsers support html5 tags
				document.createElement("nav");
				document.createElement("article");
				document.createElement("section");
				// cover
				if ($("alertify-cover") == null) {
					elCover = document.createElement("div");
					elCover.setAttribute("id", "alertify-cover");
					elCover.className = "alertify-cover alertify-cover-hidden";
					document.body.appendChild(elCover);
				}
				// main element
				if ($("alertify") == null) {
					isopen = false;
					queue = [];
					elDialog = document.createElement("section");
					elDialog.setAttribute("id", "alertify");
					elDialog.className = "alertify alertify-hidden";
					document.body.appendChild(elDialog);
				}
				// log element
				if ($("alertify-logs") == null) {
					elLog = document.createElement("section");
					elLog.setAttribute("id", "alertify-logs");
					elLog.className = "alertify-logs alertify-logs-hidden";
					document.body.appendChild(elLog);
				}
				// set tabindex attribute on body element
				// this allows script to give it focus
				// after the dialog is closed
				document.body.setAttribute("tabindex", "0");
				// set transition type
				this.transition = getTransitionEvent();
			},

			/**
			 * Show a new log message box
			 *
			 * @param  {String} message    The message passed from the callee
			 * @param  {String} type       [Optional] Optional type of log message
			 * @param  {Number} wait       [Optional] Time (in ms) to wait before auto-hiding the log
			 *
			 * @return {Object}
			 */
			log : function (message, type, wait) {
				// check to ensure the alertify dialog element
				// has been successfully created
				var check = function () {
					if (elLog && elLog.scrollTop !== null) return;
					else check();
				};
				// initialize alertify if it hasn't already been done
				this.init();
				check();

				elLog.className = "alertify-logs";
				this.notify(message, type, wait);
				return this;
			},

			/**
			 * Add new log message
			 * If a type is passed, a class name "alertify-log-{type}" will get added.
			 * This allows for custom look and feel for various types of notifications.
			 *
			 * @param  {String} message    The message passed from the callee
			 * @param  {String} type       [Optional] Type of log message
			 * @param  {Number} wait       [Optional] Time (in ms) to wait before auto-hiding
			 *
			 * @return {undefined}
			 */
			notify : function (message, type, wait) {
				var log = document.createElement("article");
				log.className = "alertify-log" + ((typeof type === "string" && type !== "") ? " alertify-log-" + type : "");
				log.innerHTML = message;
				// append child
				elLog.appendChild(log);
				// triggers the CSS animation
				setTimeout(function() { log.className = log.className + " alertify-log-show"; }, 50);
				this.close(log, wait);
			},

			/**
			 * Set properties
			 *
			 * @param {Object} args     Passing parameters
			 *
			 * @return {undefined}
			 */
			set : function (args) {
				var k;
				// error catching
				if (typeof args !== "object" && args instanceof Array) throw new Error("args must be an object");
				// set parameters
				for (k in args) {
					if (args.hasOwnProperty(k)) {
						this[k] = args[k];
					}
				}
			},

			/**
			 * Common place to set focus to proper element
			 *
			 * @return {undefined}
			 */
			setFocus : function () {
				if (input) {
					input.focus();
					input.select();
				}
				else btnFocus.focus();
			},

			/**
			 * Initiate all the required pieces for the dialog box
			 *
			 * @return {undefined}
			 */
			setup : function (fromQueue) {
				var item = queue[0],
				    self = this,
				    transitionDone;

				// dialog is open
				isopen = true;
				// Set button focus after transition
				transitionDone = function (event) {
					event.stopPropagation();
					self.setFocus();
					// unbind event so function only gets called once
					self.unbind(elDialog, self.transition.type, transitionDone);
				};
				// whether CSS transition exists
				if (this.transition.supported && !fromQueue) {
					this.bind(elDialog, this.transition.type, transitionDone);
				}
				// build the proper dialog HTML
				elDialog.innerHTML = this.build(item);
				// assign all the common elements
				btnReset  = $("alertify-resetFocus");
				btnResetBack  = $("alertify-resetFocusBack");
				btnOK     = $("alertify-ok")     || undefined;
				btnCancel = $("alertify-cancel") || undefined;
				btnFocus  = (_alertify.buttonFocus === "cancel") ? btnCancel : ((_alertify.buttonFocus === "none") ? $("alertify-noneFocus") : btnOK),
				input     = $("alertify-text")   || undefined;
				form      = $("alertify-form")   || undefined;
				// add placeholder value to the input field
				if (typeof item.placeholder === "string" && item.placeholder !== "") input.value = item.placeholder;
				if (fromQueue) this.setFocus();
				this.addListeners(item.callback);
			},

			/**
			 * Unbind events to elements
			 *
			 * @param  {Object}   el       HTML Object
			 * @param  {Event}    event    Event to detach to element
			 * @param  {Function} fn       Callback function
			 *
			 * @return {undefined}
			 */
			unbind : function (el, event, fn) {
				if (typeof el.removeEventListener === "function") {
					el.removeEventListener(event, fn, false);
				} else if (el.detachEvent) {
					el.detachEvent("on" + event, fn);
				}
			}
		};

		return {
			alert   : function (message, fn, cssClass) { _alertify.dialog(message, "alert", fn, "", cssClass); return this; },
			confirm : function (message, fn, cssClass) { _alertify.dialog(message, "confirm", fn, "", cssClass); return this; },
			extend  : _alertify.extend,
			init    : _alertify.init,
			log     : function (message, type, wait) { _alertify.log(message, type, wait); return this; },
			prompt  : function (message, fn, placeholder, cssClass) { _alertify.dialog(message, "prompt", fn, placeholder, cssClass); return this; },
			success : function (message, wait) { _alertify.log(message, "success", wait); return this; },
			error   : function (message, wait) { _alertify.log(message, "error", wait); return this; },
			set     : function (args) { _alertify.set(args); },
			labels  : _alertify.labels,
			debug   : _alertify.handleErrors
		};
	};

	// AMD and window support
	if (typeof define === "function") {
		define([], function () { return new Alertify(); });
	} else if (typeof global.alertify === "undefined") {
		global.alertify = new Alertify();
	}

}(this));
;
/*! jQuery Validation Plugin - v1.13.0 - 7/1/2014
 * http://jqueryvalidation.org/
 * Copyright (c) 2014 Jörn Zaefferer; Licensed MIT */
!function(a){"function"==typeof define&&define.amd?define(["jquery","./jquery.validate.min"],a):a(jQuery)}(function(a){!function(){function b(a){return a.replace(/<.[^<>]*?>/g," ").replace(/&nbsp;|&#160;/gi," ").replace(/[.(),;:!?%#$'\"_+=\/\-“”’]*/g,"")}a.validator.addMethod("maxWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length<=d},a.validator.format("Please enter {0} words or less.")),a.validator.addMethod("minWords",function(a,c,d){return this.optional(c)||b(a).match(/\b\w+\b/g).length>=d},a.validator.format("Please enter at least {0} words.")),a.validator.addMethod("rangeWords",function(a,c,d){var e=b(a),f=/\b\w+\b/g;return this.optional(c)||e.match(f).length>=d[0]&&e.match(f).length<=d[1]},a.validator.format("Please enter between {0} and {1} words."))}(),a.validator.addMethod("accept",function(b,c,d){var e,f,g="string"==typeof d?d.replace(/\s/g,"").replace(/,/g,"|"):"image/*",h=this.optional(c);if(h)return h;if("file"===a(c).attr("type")&&(g=g.replace(/\*/g,".*"),c.files&&c.files.length))for(e=0;e<c.files.length;e++)if(f=c.files[e],!f.type.match(new RegExp(".?("+g+")$","i")))return!1;return!0},a.validator.format("Please enter a value with a valid mimetype.")),a.validator.addMethod("alphanumeric",function(a,b){return this.optional(b)||/^\w+$/i.test(a)},"Letters, numbers, and underscores only please"),a.validator.addMethod("bankaccountNL",function(a,b){if(this.optional(b))return!0;if(!/^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test(a))return!1;var c,d,e,f=a.replace(/ /g,""),g=0,h=f.length;for(c=0;h>c;c++)d=h-c,e=f.substring(c,c+1),g+=d*e;return g%11===0},"Please specify a valid bank account number"),a.validator.addMethod("bankorgiroaccountNL",function(b,c){return this.optional(c)||a.validator.methods.bankaccountNL.call(this,b,c)||a.validator.methods.giroaccountNL.call(this,b,c)},"Please specify a valid bank or giro account number"),a.validator.addMethod("bic",function(a,b){return this.optional(b)||/^([A-Z]{6}[A-Z2-9][A-NP-Z1-2])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test(a)},"Please specify a valid BIC code"),a.validator.addMethod("cifES",function(a){"use strict";var b,c,d,e,f,g,h=[];if(a=a.toUpperCase(),!a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)"))return!1;for(d=0;9>d;d++)h[d]=parseInt(a.charAt(d),10);for(c=h[2]+h[4]+h[6],e=1;8>e;e+=2)f=(2*h[e]).toString(),g=f.charAt(1),c+=parseInt(f.charAt(0),10)+(""===g?0:parseInt(g,10));return/^[ABCDEFGHJNPQRSUVW]{1}/.test(a)?(c+="",b=10-parseInt(c.charAt(c.length-1),10),a+=b,h[8].toString()===String.fromCharCode(64+b)||h[8].toString()===a.charAt(a.length-1)):!1},"Please specify a valid CIF number."),a.validator.addMethod("creditcardtypes",function(a,b,c){if(/[^0-9\-]+/.test(a))return!1;a=a.replace(/\D/g,"");var d=0;return c.mastercard&&(d|=1),c.visa&&(d|=2),c.amex&&(d|=4),c.dinersclub&&(d|=8),c.enroute&&(d|=16),c.discover&&(d|=32),c.jcb&&(d|=64),c.unknown&&(d|=128),c.all&&(d=255),1&d&&/^(5[12345])/.test(a)?16===a.length:2&d&&/^(4)/.test(a)?16===a.length:4&d&&/^(3[47])/.test(a)?15===a.length:8&d&&/^(3(0[012345]|[68]))/.test(a)?14===a.length:16&d&&/^(2(014|149))/.test(a)?15===a.length:32&d&&/^(6011)/.test(a)?16===a.length:64&d&&/^(3)/.test(a)?16===a.length:64&d&&/^(2131|1800)/.test(a)?15===a.length:128&d?!0:!1},"Please enter a valid credit card number."),a.validator.addMethod("currency",function(a,b,c){var d,e="string"==typeof c,f=e?c:c[0],g=e?!0:c[1];return f=f.replace(/,/g,""),f=g?f+"]":f+"]?",d="^["+f+"([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$",d=new RegExp(d),this.optional(b)||d.test(a)},"Please specify a valid currency"),a.validator.addMethod("dateFA",function(a,b){return this.optional(b)||/^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test(a)},"Please enter a correct date"),a.validator.addMethod("dateITA",function(a,b){var c,d,e,f,g,h=!1,i=/^\d{1,2}\/\d{1,2}\/\d{4}$/;return i.test(a)?(c=a.split("/"),d=parseInt(c[0],10),e=parseInt(c[1],10),f=parseInt(c[2],10),g=new Date(f,e-1,d,12,0,0,0),h=g.getUTCFullYear()===f&&g.getUTCMonth()===e-1&&g.getUTCDate()===d?!0:!1):h=!1,this.optional(b)||h},"Please enter a correct date"),a.validator.addMethod("dateNL",function(a,b){return this.optional(b)||/^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(a)},"Please enter a correct date"),a.validator.addMethod("extension",function(a,b,c){return c="string"==typeof c?c.replace(/,/g,"|"):"png|jpe?g|gif",this.optional(b)||a.match(new RegExp(".("+c+")$","i"))},a.validator.format("Please enter a value with a valid extension.")),a.validator.addMethod("giroaccountNL",function(a,b){return this.optional(b)||/^[0-9]{1,7}$/.test(a)},"Please specify a valid giro account number"),a.validator.addMethod("iban",function(a,b){if(this.optional(b))return!0;var c,d,e,f,g,h,i,j,k,l=a.replace(/ /g,"").toUpperCase(),m="",n=!0,o="",p="";if(!/^([a-zA-Z0-9]{4} ){2,8}[a-zA-Z0-9]{1,4}|[a-zA-Z0-9]{12,34}$/.test(l))return!1;if(c=l.substring(0,2),h={AL:"\\d{8}[\\dA-Z]{16}",AD:"\\d{8}[\\dA-Z]{12}",AT:"\\d{16}",AZ:"[\\dA-Z]{4}\\d{20}",BE:"\\d{12}",BH:"[A-Z]{4}[\\dA-Z]{14}",BA:"\\d{16}",BR:"\\d{23}[A-Z][\\dA-Z]",BG:"[A-Z]{4}\\d{6}[\\dA-Z]{8}",CR:"\\d{17}",HR:"\\d{17}",CY:"\\d{8}[\\dA-Z]{16}",CZ:"\\d{20}",DK:"\\d{14}",DO:"[A-Z]{4}\\d{20}",EE:"\\d{16}",FO:"\\d{14}",FI:"\\d{14}",FR:"\\d{10}[\\dA-Z]{11}\\d{2}",GE:"[\\dA-Z]{2}\\d{16}",DE:"\\d{18}",GI:"[A-Z]{4}[\\dA-Z]{15}",GR:"\\d{7}[\\dA-Z]{16}",GL:"\\d{14}",GT:"[\\dA-Z]{4}[\\dA-Z]{20}",HU:"\\d{24}",IS:"\\d{22}",IE:"[\\dA-Z]{4}\\d{14}",IL:"\\d{19}",IT:"[A-Z]\\d{10}[\\dA-Z]{12}",KZ:"\\d{3}[\\dA-Z]{13}",KW:"[A-Z]{4}[\\dA-Z]{22}",LV:"[A-Z]{4}[\\dA-Z]{13}",LB:"\\d{4}[\\dA-Z]{20}",LI:"\\d{5}[\\dA-Z]{12}",LT:"\\d{16}",LU:"\\d{3}[\\dA-Z]{13}",MK:"\\d{3}[\\dA-Z]{10}\\d{2}",MT:"[A-Z]{4}\\d{5}[\\dA-Z]{18}",MR:"\\d{23}",MU:"[A-Z]{4}\\d{19}[A-Z]{3}",MC:"\\d{10}[\\dA-Z]{11}\\d{2}",MD:"[\\dA-Z]{2}\\d{18}",ME:"\\d{18}",NL:"[A-Z]{4}\\d{10}",NO:"\\d{11}",PK:"[\\dA-Z]{4}\\d{16}",PS:"[\\dA-Z]{4}\\d{21}",PL:"\\d{24}",PT:"\\d{21}",RO:"[A-Z]{4}[\\dA-Z]{16}",SM:"[A-Z]\\d{10}[\\dA-Z]{12}",SA:"\\d{2}[\\dA-Z]{18}",RS:"\\d{18}",SK:"\\d{20}",SI:"\\d{15}",ES:"\\d{20}",SE:"\\d{20}",CH:"\\d{5}[\\dA-Z]{12}",TN:"\\d{20}",TR:"\\d{5}[\\dA-Z]{17}",AE:"\\d{3}\\d{16}",GB:"[A-Z]{4}\\d{14}",VG:"[\\dA-Z]{4}\\d{16}"},g=h[c],"undefined"!=typeof g&&(i=new RegExp("^[A-Z]{2}\\d{2}"+g+"$",""),!i.test(l)))return!1;for(d=l.substring(4,l.length)+l.substring(0,4),j=0;j<d.length;j++)e=d.charAt(j),"0"!==e&&(n=!1),n||(m+="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(e));for(k=0;k<m.length;k++)f=m.charAt(k),p=""+o+f,o=p%97;return 1===o},"Please specify a valid IBAN"),a.validator.addMethod("integer",function(a,b){return this.optional(b)||/^-?\d+$/.test(a)},"A positive or negative non-decimal number please"),a.validator.addMethod("ipv4",function(a,b){return this.optional(b)||/^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test(a)},"Please enter a valid IP v4 address."),a.validator.addMethod("ipv6",function(a,b){return this.optional(b)||/^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test(a)},"Please enter a valid IP v6 address."),a.validator.addMethod("lettersonly",function(a,b){return this.optional(b)||/^[a-z]+$/i.test(a)},"Letters only please"),a.validator.addMethod("letterswithbasicpunc",function(a,b){return this.optional(b)||/^[a-z\-.,()'"\s]+$/i.test(a)},"Letters or punctuation only please"),a.validator.addMethod("mobileNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid mobile number"),a.validator.addMethod("mobileUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/)},"Please specify a valid mobile number"),a.validator.addMethod("nieES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[T]{1}/.test(a)?a[8]===/^[T]{1}[A-Z0-9]{8}$/.test(a):/^[XYZ]{1}/.test(a)?a[8]==="TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.replace("X","0").replace("Y","1").replace("Z","2").substring(0,8)%23):!1:!1},"Please specify a valid NIE number."),a.validator.addMethod("nifES",function(a){"use strict";return a=a.toUpperCase(),a.match("((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)")?/^[0-9]{8}[A-Z]{1}$/.test(a)?"TRWAGMYFPDXBNJZSQVHLCKE".charAt(a.substring(8,0)%23)===a.charAt(8):/^[KLM]{1}/.test(a)?a[8]===String.fromCharCode(64):!1:!1},"Please specify a valid NIF number."),a.validator.addMethod("nowhitespace",function(a,b){return this.optional(b)||/^\S+$/i.test(a)},"No white space please"),a.validator.addMethod("pattern",function(a,b,c){return this.optional(b)?!0:("string"==typeof c&&(c=new RegExp(c)),c.test(a))},"Invalid format."),a.validator.addMethod("phoneNL",function(a,b){return this.optional(b)||/^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test(a)},"Please specify a valid phone number."),a.validator.addMethod("phoneUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/)},"Please specify a valid phone number"),a.validator.addMethod("phoneUS",function(a,b){return a=a.replace(/\s+/g,""),this.optional(b)||a.length>9&&a.match(/^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]([02-9]\d|1[02-9])-?\d{4}$/)},"Please specify a valid phone number"),a.validator.addMethod("phonesUK",function(a,b){return a=a.replace(/\(|\)|\s+|-/g,""),this.optional(b)||a.length>9&&a.match(/^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/)},"Please specify a valid uk phone number"),a.validator.addMethod("postalCodeCA",function(a,b){return this.optional(b)||/^[ABCEGHJKLMNPRSTVXY]\d[A-Z] \d[A-Z]\d$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeIT",function(a,b){return this.optional(b)||/^\d{5}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postalcodeNL",function(a,b){return this.optional(b)||/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test(a)},"Please specify a valid postal code"),a.validator.addMethod("postcodeUK",function(a,b){return this.optional(b)||/^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test(a)},"Please specify a valid UK postcode"),a.validator.addMethod("require_from_group",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_req_grp")?f.data("valid_req_grp"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length>=d[0];return f.data("valid_req_grp",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),h},a.validator.format("Please fill at least {0} of these fields.")),a.validator.addMethod("skip_or_fill_minimum",function(b,c,d){var e=a(d[1],c.form),f=e.eq(0),g=f.data("valid_skip")?f.data("valid_skip"):a.extend({},this),h=e.filter(function(){return g.elementValue(this)}).length,i=0===h||h>=d[0];return f.data("valid_skip",g),a(c).data("being_validated")||(e.data("being_validated",!0),e.each(function(){g.element(this)}),e.data("being_validated",!1)),i},a.validator.format("Please either skip these fields or fill at least {0} of them.")),jQuery.validator.addMethod("stateUS",function(a,b,c){var d,e="undefined"==typeof c,f=e||"undefined"==typeof c.caseSensitive?!1:c.caseSensitive,g=e||"undefined"==typeof c.includeTerritories?!1:c.includeTerritories,h=e||"undefined"==typeof c.includeMilitary?!1:c.includeMilitary;return d=g||h?g&&h?"^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":g?"^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$":"^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$":"^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$",d=f?new RegExp(d):new RegExp(d,"i"),this.optional(b)||d.test(a)},"Please specify a valid state"),a.validator.addMethod("strippedminlength",function(b,c,d){return a(b).text().length>=d},a.validator.format("Please enter at least {0} characters")),a.validator.addMethod("time",function(a,b){return this.optional(b)||/^([01]\d|2[0-3])(:[0-5]\d){1,2}$/.test(a)},"Please enter a valid time, between 00:00 and 23:59"),a.validator.addMethod("time12h",function(a,b){return this.optional(b)||/^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test(a)},"Please enter a valid time in 12-hour am/pm format"),a.validator.addMethod("url2",function(a,b){return this.optional(b)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(a)},a.validator.messages.url),a.validator.addMethod("vinUS",function(a){if(17!==a.length)return!1;var b,c,d,e,f,g,h=["A","B","C","D","E","F","G","H","J","K","L","M","N","P","R","S","T","U","V","W","X","Y","Z"],i=[1,2,3,4,5,6,7,8,1,2,3,4,5,7,9,2,3,4,5,6,7,8,9],j=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2],k=0;for(b=0;17>b;b++){if(e=j[b],d=a.slice(b,b+1),8===b&&(g=d),isNaN(d)){for(c=0;c<h.length;c++)if(d.toUpperCase()===h[c]){d=i[c],d*=e,isNaN(g)&&8===c&&(g=h[c]);break}}else d*=e;k+=d}return f=k%11,10===f&&(f="X"),f===g?!0:!1},"The specified vehicle identification number (VIN) is invalid."),a.validator.addMethod("zipcodeUS",function(a,b){return this.optional(b)||/^\d{5}(-\d{4})?$/.test(a)},"The specified US ZIP Code is invalid"),a.validator.addMethod("ziprange",function(a,b){return this.optional(b)||/^90[2-5]\d\{2\}-\d{4}$/.test(a)},"Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx")});;
(function(n){typeof define=="function"&&define.amd?define(["jquery","../jquery.validate"],n):n(jQuery)})(function(n){n.extend(n.validator.messages,{required:"Bu alanın doldurulması zorunludur.",remote:"Lütfen bu alanı düzeltin.",email:"Lütfen geçerli bir e-posta adresi giriniz.",url:"Lütfen geçerli bir web adresi (URL) giriniz.",date:"Lütfen geçerli bir tarih giriniz.",dateISO:"Lütfen geçerli bir tarih giriniz(ISO formatında)",number:"Lütfen geçerli bir sayı giriniz.",digits:"Lütfen sadece sayısal karakterler giriniz.",creditcard:"Lütfen geçerli bir kredi kartı giriniz.",equalTo:"Lütfen aynı değeri tekrar giriniz.",extension:"Lütfen geçerli uzantıya sahip bir değer giriniz.",maxlength:n.validator.format("Lütfen en fazla {0} karakter uzunluğunda bir değer giriniz."),minlength:n.validator.format("Lütfen en az {0} karakter uzunluğunda bir değer giriniz."),rangelength:n.validator.format("Lütfen en az {0} ve en fazla {1} uzunluğunda bir değer giriniz."),range:n.validator.format("Lütfen {0} ile {1} arasında bir değer giriniz."),max:n.validator.format("Lütfen {0} değerine eşit ya da daha küçük bir değer giriniz."),min:n.validator.format("Lütfen {0} değerine eşit ya da daha büyük bir değer giriniz.")})});
//# sourceMappingURL=messages_tr.min.js.map
;
/*!
 * Less - Leaner CSS v1.7.5
 * http://lesscss.org
 *
 * Copyright (c) 2009-2014, Alexis Sellier <self@cloudhead.net>
 * Licensed under the Apache v2 License.
 *
 */

 /** * @license Apache v2
 */

!function(a,b){function c(b){return a.less[b.split("/")[1]]}function d(a,b){"undefined"!=typeof console&&w.logLevel>=b&&console.log("less: "+a)}function e(a){return a.replace(/^[a-z-]+:\/+?[^\/]+/,"").replace(/^\//,"").replace(/\.[a-zA-Z]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function f(a,c){var e="{line} {content}",f=a.filename||c,g=[],h=(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+" in "+f+" ",i=function(a,c,d){a.extract[c]!==b&&g.push(e.replace(/\{line\}/,(parseInt(a.line,10)||0)+(c-1)).replace(/\{class\}/,d).replace(/\{content\}/,a.extract[c]))};a.extract?(i(a,0,""),i(a,1,"line"),i(a,2,""),h+="on line "+a.line+", column "+(a.column+1)+":\n"+g.join("\n")):a.stack&&(h+=a.stack),d(h,z.errors)}function g(a,b,c){var f=b.href||"",g="less:"+(b.title||e(f)),h=document.getElementById(g),i=!1,j=document.createElement("style");j.setAttribute("type","text/css"),b.media&&j.setAttribute("media",b.media),j.id=g,j.styleSheet||(j.appendChild(document.createTextNode(a)),i=null!==h&&h.childNodes.length>0&&j.childNodes.length>0&&h.firstChild.nodeValue===j.firstChild.nodeValue);var k=document.getElementsByTagName("head")[0];if(null===h||i===!1){var l=b&&b.nextSibling||null;l?l.parentNode.insertBefore(j,l):k.appendChild(j)}if(h&&i===!1&&h.parentNode.removeChild(h),j.styleSheet)try{j.styleSheet.cssText=a}catch(m){throw new Error("Couldn't reassign styleSheet.cssText.")}if(c&&D){d("saving "+f+" to cache.",z.info);try{D.setItem(f,a),D.setItem(f+":timestamp",c)}catch(m){d("failed to save",z.errors)}}}function h(a){return w.postProcessor&&"function"==typeof w.postProcessor&&(a=w.postProcessor.call(a,a)||a),a}function i(a,c){var d,f,h="less-error-message:"+e(c||""),i='<li><label>{line}</label><pre class="{class}">{content}</pre></li>',j=document.createElement("div"),k=[],l=a.filename||c,m=l.match(/([^\/]+(\?.*)?)$/)[1];j.id=h,j.className="less-error-message",f="<h3>"+(a.type||"Syntax")+"Error: "+(a.message||"There is an error in your .less file")+'</h3><p>in <a href="'+l+'">'+m+"</a> ";var n=function(a,c,d){a.extract[c]!==b&&k.push(i.replace(/\{line\}/,(parseInt(a.line,10)||0)+(c-1)).replace(/\{class\}/,d).replace(/\{content\}/,a.extract[c]))};a.extract?(n(a,0,""),n(a,1,"line"),n(a,2,""),f+="on line "+a.line+", column "+(a.column+1)+":</p><ul>"+k.join("")+"</ul>"):a.stack&&(f+="<br/>"+a.stack.split("\n").slice(1).join("<br/>")),j.innerHTML=f,g([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #dd6666;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.line {","color: #ff0000;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),j.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),"development"==w.env&&(d=setInterval(function(){document.body&&(document.getElementById(h)?document.body.replaceChild(j,document.getElementById(h)):document.body.insertBefore(j,document.body.firstChild),clearInterval(d))},10))}function j(a,b){w.errorReporting&&"html"!==w.errorReporting?"console"===w.errorReporting?f(a,b):"function"==typeof w.errorReporting&&w.errorReporting("add",a,b):i(a,b)}function k(a){var b=document.getElementById("less-error-message:"+e(a));b&&b.parentNode.removeChild(b)}function l(){}function m(a){w.errorReporting&&"html"!==w.errorReporting?"console"===w.errorReporting?l(a):"function"==typeof w.errorReporting&&w.errorReporting("remove",a):k(a)}function n(a){for(var b,c=document.getElementsByTagName("style"),d=0;d<c.length;d++)if(b=c[d],b.type.match(C)){var e=new w.tree.parseEnv(w),f=b.innerHTML||"";e.filename=document.location.href.replace(/#.*$/,""),(a||w.globalVars)&&(e.useFileCache=!0);var g=function(a){return function(b,c){if(b)return j(b,"inline");var d=c.toCSS(w);a.type="text/css",a.styleSheet?a.styleSheet.cssText=d:a.innerHTML=d}}(b);new w.Parser(e).parse(f,g,{globalVars:w.globalVars,modifyVars:a})}}function o(a,b){var c,d,e=/^((?:[a-z-]+:)?\/+?(?:[^\/\?#]*\/)|([\/\\]))?((?:[^\/\\\?#]*[\/\\])*)([^\/\\\?#]*)([#\?].*)?$/i,f=a.match(e),g={},h=[];if(!f)throw new Error("Could not parse sheet href - '"+a+"'");if(!f[1]||f[2]){if(d=b.match(e),!d)throw new Error("Could not parse page url - '"+b+"'");f[1]=f[1]||d[1]||"",f[2]||(f[3]=d[3]+f[3])}if(f[3]){for(h=f[3].replace(/\\/g,"/").split("/"),c=0;c<h.length;c++)"."===h[c]&&(h.splice(c,1),c-=1);for(c=0;c<h.length;c++)".."===h[c]&&c>0&&(h.splice(c-1,2),c-=2)}return g.hostPart=f[1],g.directories=h,g.path=f[1]+h.join("/"),g.fileUrl=g.path+(f[4]||""),g.url=g.fileUrl+(f[5]||""),g}function p(a,b){var c,d,e,f,g=o(a),h=o(b),i="";if(g.hostPart!==h.hostPart)return"";for(d=Math.max(h.directories.length,g.directories.length),c=0;d>c&&h.directories[c]===g.directories[c];c++);for(f=h.directories.slice(c),e=g.directories.slice(c),c=0;c<f.length-1;c++)i+="../";for(c=0;c<e.length-1;c++)i+=e[c]+"/";return i}function q(){if(a.XMLHttpRequest&&!("file:"===a.location.protocol&&"ActiveXObject"in a))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(b){return d("browser doesn't support AJAX.",z.errors),null}}function r(a,b,c,e){function f(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):"function"==typeof d&&d(b.status,a)}var g=q(),h=y?w.fileAsync:w.async;"function"==typeof g.overrideMimeType&&g.overrideMimeType("text/css"),d("XHR: Getting '"+a+"'",z.debug),g.open("GET",a,h),g.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),g.send(null),y&&!w.fileAsync?0===g.status||g.status>=200&&g.status<300?c(g.responseText):e(g.status,a):h?g.onreadystatechange=function(){4==g.readyState&&f(g,c,e)}:f(g,c,e)}function s(b,c,d,e){c&&c.currentDirectory&&!/^([A-Za-z-]+:)?\//.test(b)&&(b=c.currentDirectory+b);var f=o(b,a.location.href),g=f.url,h={currentDirectory:f.path,filename:g};if(c?(h.entryPath=c.entryPath,h.rootpath=c.rootpath,h.rootFilename=c.rootFilename,h.relativeUrls=c.relativeUrls):(h.entryPath=f.path,h.rootpath=w.rootpath||f.path,h.rootFilename=g,h.relativeUrls=e.relativeUrls),h.relativeUrls&&(h.rootpath=e.rootpath?o(e.rootpath+p(f.path,h.entryPath)).path:f.path),e.useFileCache&&E[g])try{var i=E[g];d(null,i,g,h,{lastModified:new Date})}catch(j){d(j,null,g)}else r(g,e.mime,function(a,b){E[g]=a;try{d(null,a,g,h,{lastModified:b})}catch(c){d(c,null,g)}},function(a,b){d({type:"File",message:"'"+b+"' wasn't found ("+a+")"},null,g)})}function t(a,b,c,d,e){var f=new w.tree.parseEnv(w);f.mime=a.type,(e||w.globalVars)&&(f.useFileCache=!0),s(a.href,null,function(h,i,j,k,l){if(l){l.remaining=d;var n=D&&D.getItem(j),o=D&&D.getItem(j+":timestamp");if(!c&&o&&l.lastModified&&new Date(l.lastModified).valueOf()===new Date(o).valueOf())return g(n,a),l.local=!0,void b(null,null,i,a,l,j)}m(j),i?(f.currentFileInfo=k,new w.Parser(f).parse(i,function(c,d){if(c)return b(c,null,null,a);try{b(c,d,i,a,l,j)}catch(c){b(c,null,null,a)}},{modifyVars:e,globalVars:w.globalVars})):b(h,null,null,a,l,j)},f,e)}function u(a,b,c){for(var d=0;d<w.sheets.length;d++)t(w.sheets[d],a,b,w.sheets.length-(d+1),c)}function v(){"development"===w.env?(w.optimization=0,w.watchTimer=setInterval(function(){w.watchMode&&u(function(a,b,c,d,e){if(a)j(a,d.href);else if(b){var f=b.toCSS(w);f=h(f),g(f,d,e.lastModified)}})},w.poll)):w.optimization=3}("undefined"==typeof a.less||"undefined"!=typeof a.less.nodeType)&&(a.less={}),w=a.less,x=a.less.tree={},w.mode="browser";var w,x;w===b&&(w=exports,x=c("./tree"),w.mode="node"),w.Parser=function(a){function d(){D=y,G.push({current:C,i:y,j:z})}function e(){var a=G.pop();C=a.current,D=y=a.i,z=a.j}function f(){G.pop()}function g(){y>D&&(C=C.slice(y-D),D=y)}function h(a,b){var c=a.charCodeAt(0|b);return 32>=c&&(32===c||10===c||9===c)}function i(a){var b,c,d=typeof a;return"string"===d?v.charAt(y)!==a?null:(l(1),a):(g(),(b=a.exec(C))?(c=b[0].length,l(c),"string"==typeof b?b:1===b.length?b[0]:b):null)}function j(a){y>D&&(C=C.slice(y-D),D=y);var b=a.exec(C);return b?(l(b[0].length),"string"==typeof b?b:1===b.length?b[0]:b):null}function k(a){return v.charAt(y)!==a?null:(l(1),a)}function l(a){for(var b,c=y,d=z,e=y-D,f=y+C.length-e,g=y+=a,h=v;f>y&&(b=h.charCodeAt(y),!(b>32))&&(32===b||10===b||9===b||13===b);y++);return C=C.slice(a+y-g+e),D=y,!C.length&&z<B.length-1?(C=B[++z],l(0),!0):c!==y||d!==z}function m(a,b){var c="[object Function]"===Object.prototype.toString.call(a)?a.call(F):i(a);return c?c:void o(b||("string"==typeof a?"expected '"+a+"' got '"+v.charAt(y)+"'":"unexpected token"))}function n(a,b){return v.charAt(y)===a?(l(1),a):void o(b||"expected '"+a+"' got '"+v.charAt(y)+"'")}function o(a,b){var c=new Error(a);throw c.index=y,c.type=b||"Syntax",c}function p(a){return"string"==typeof a?v.charAt(y)===a:a.test(C)}function q(a){return v.charAt(y)===a}function r(a,b){return a.filename&&b.currentFileInfo.filename&&a.filename!==b.currentFileInfo.filename?E.imports.contents[a.filename]:v}function s(a,b){for(var c=a+1,d=null,e=-1;--c>=0&&"\n"!==b.charAt(c);)e++;return"number"==typeof a&&(d=(b.slice(0,a).match(/\n/g)||"").length),{line:d,column:e}}function t(a,b,d){var e=d.currentFileInfo.filename;return"browser"!==w.mode&&"rhino"!==w.mode&&(e=c("path").resolve(e)),{lineNumber:s(a,b).line+1,fileName:e}}function u(a,b){var c=r(a,b),d=s(a.index,c),e=d.line,f=d.column,g=a.call&&s(a.call,c).line,h=c.split("\n");this.type=a.type||"Syntax",this.message=a.message,this.filename=a.filename||b.currentFileInfo.filename,this.index=a.index,this.line="number"==typeof e?e+1:null,this.callLine=g+1,this.callExtract=h[g],this.stack=a.stack,this.column=f,this.extract=[h[e-1],h[e],h[e+1]]}var v,y,z,A,B,C,D,E,F,G=[],H=a&&a.filename;a instanceof x.parseEnv||(a=new x.parseEnv(a));var I=this.imports={paths:a.paths||[],queue:[],files:a.files,contents:a.contents,contentsIgnoredChars:a.contentsIgnoredChars,mime:a.mime,error:null,push:function(b,c,d,e){var f=this;this.queue.push(b);var g=function(a,c,d){f.queue.splice(f.queue.indexOf(b),1);var g=d===H;f.files[d]=c,a&&!f.error&&(f.error=a),e(a,c,g,d)};w.Parser.importer?w.Parser.importer(b,c,g,a):w.Parser.fileLoader(b,c,function(b,e,f,h){if(b)return void g(b);var i=new x.parseEnv(a);i.currentFileInfo=h,i.processImports=!1,i.contents[f]=e,(c.reference||d.reference)&&(h.reference=!0),d.inline?g(null,e,f):new w.Parser(i).parse(e,function(a,b){g(a,b,f)})},a)}},J=j;return u.prototype=new Error,u.prototype.constructor=u,this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,E={imports:I,parse:function(d,e,f){var g,h,i,j,k,l=null,m="";if(y=z=D=A=0,j=f&&f.globalVars?w.Parser.serializeVars(f.globalVars)+"\n":"",k=f&&f.modifyVars?"\n"+w.Parser.serializeVars(f.modifyVars):"",(j||f&&f.banner)&&(m=(f&&f.banner?f.banner:"")+j,E.imports.contentsIgnoredChars[a.currentFileInfo.filename]=m.length),d=d.replace(/\r\n/g,"\n"),v=d=m+d.replace(/^\uFEFF/,"")+k,E.imports.contents[a.currentFileInfo.filename]=d,B=function(b){function c(b,c){l=new u({index:c||i,type:"Parse",message:b,filename:a.currentFileInfo.filename},a)}function d(a){var c=i-s;512>c&&!a||!c||(r.push(b.slice(s,i+1)),s=i+1)}var e,f,g,h,i,j,k,m,n,o=b.length,p=0,q=0,r=[],s=0;for(i=0;o>i;i++)if(k=b.charCodeAt(i),!(k>=97&&122>=k||34>k))switch(k){case 40:q++,f=i;continue;case 41:if(--q<0)return c("missing opening `(`");continue;case 59:q||d();continue;case 123:p++,e=i;continue;case 125:if(--p<0)return c("missing opening `{`");p||q||d();continue;case 92:if(o-1>i){i++;continue}return c("unescaped `\\`");case 34:case 39:case 96:for(n=0,j=i,i+=1;o>i;i++)if(m=b.charCodeAt(i),!(m>96)){if(m==k){n=1;break}if(92==m){if(i==o-1)return c("unescaped `\\`");i++}}if(n)continue;return c("unmatched `"+String.fromCharCode(k)+"`",j);case 47:if(q||i==o-1)continue;if(m=b.charCodeAt(i+1),47==m)for(i+=2;o>i&&(m=b.charCodeAt(i),!(13>=m)||10!=m&&13!=m);i++);else if(42==m){for(g=j=i,i+=2;o-1>i&&(m=b.charCodeAt(i),125==m&&(h=i),42!=m||47!=b.charCodeAt(i+1));i++);if(i==o-1)return c("missing closing `*/`",j);i++}continue;case 42:if(o-1>i&&47==b.charCodeAt(i+1))return c("unmatched `/*`");continue}return 0!==p?g>e&&h>g?c("missing closing `}` or `*/`",e):c("missing closing `}`",e):0!==q?c("missing closing `)`",f):(d(!0),r)}(d),l)return e(new u(l,a));C=B[0];try{g=new x.Ruleset(null,this.parsers.primary()),g.root=!0,g.firstRoot=!0}catch(n){return e(new u(n,a))}if(g.toCSS=function(d){return function(e,f){e=e||{};var g,h,i=new x.evalEnv(e);"object"!=typeof f||Array.isArray(f)||(f=Object.keys(f).map(function(a){var b=f[a];return b instanceof x.Value||(b instanceof x.Expression||(b=new x.Expression([b])),b=new x.Value([b])),new x.Rule("@"+a,b,!1,null,0)}),i.frames=[new x.Ruleset(null,f)]);try{var j,k=[],l=[new x.joinSelectorVisitor,new x.processExtendsVisitor,new x.toCSSVisitor({compress:Boolean(e.compress)})],m=this;if(e.plugins)for(j=0;j<e.plugins.length;j++)e.plugins[j].isPreEvalVisitor?k.push(e.plugins[j]):e.plugins[j].isPreVisitor?l.splice(0,0,e.plugins[j]):l.push(e.plugins[j]);for(j=0;j<k.length;j++)k[j].run(m);for(g=d.call(m,i),j=0;j<l.length;j++)l[j].run(g);e.sourceMap&&(g=new x.sourceMapOutput({contentsIgnoredCharsMap:E.imports.contentsIgnoredChars,writeSourceMap:e.writeSourceMap,rootNode:g,contentsMap:E.imports.contents,sourceMapFilename:e.sourceMapFilename,sourceMapURL:e.sourceMapURL,outputFilename:e.sourceMapOutputFilename,sourceMapBasepath:e.sourceMapBasepath,sourceMapRootpath:e.sourceMapRootpath,outputSourceFiles:e.outputSourceFiles,sourceMapGenerator:e.sourceMapGenerator})),h=g.toCSS({compress:Boolean(e.compress),dumpLineNumbers:a.dumpLineNumbers,strictUnits:Boolean(e.strictUnits),numPrecision:8})}catch(n){throw new u(n,a)}if(e.cleancss&&"node"===w.mode){var o=c("clean-css"),p=e.cleancssOptions||{};return p.keepSpecialComments===b&&(p.keepSpecialComments="*"),p.processImport=!1,p.noRebase=!0,p.noAdvanced===b&&(p.noAdvanced=!0),new o(p).minify(h)}return e.compress?h.replace(/(^(\s)+)|((\s)+$)/g,""):h}}(g.eval),y<v.length-1){y=A;var o=s(y,v);i=v.split("\n"),h=o.line+1,l={type:"Parse",message:"Unrecognised input",index:y,filename:a.currentFileInfo.filename,line:h,column:o.column,extract:[i[h-2],i[h-1],i[h]]}}var p=function(b){return b=l||b||E.imports.error,b?(b instanceof u||(b=new u(b,a)),e(b)):e(null,g)};return a.processImports===!1?p():void new x.importVisitor(this.imports,p).run(g)},parsers:F={primary:function(){for(var a,b=this.mixin,c=J,d=[];C;){if(a=this.extendRule()||b.definition()||this.rule()||this.ruleset()||b.call()||this.comment()||this.rulesetCall()||this.directive())d.push(a);else if(!c(/^[\s\n]+/)&&!c(/^;+/))break;if(q("}"))break}return d},comment:function(){var b;if("/"===v.charAt(y))return"/"===v.charAt(y+1)?new x.Comment(j(/^\/\/.*/),!0,y,a.currentFileInfo):(b=j(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/),b?new x.Comment(b,!1,y,a.currentFileInfo):void 0)},comments:function(){for(var a,b=[];;){if(a=this.comment(),!a)break;b.push(a)}return b},entities:{quoted:function(){var b,c,d=y,e=y;return"~"===v.charAt(d)&&(d++,c=!0),'"'===v.charAt(d)||"'"===v.charAt(d)?(c&&k("~"),b=j(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/),b?new x.Quoted(b[0],b[1]||b[2],c,e,a.currentFileInfo):void 0):void 0},keyword:function(){var a;if(a=j(/^%|^[_A-Za-z-][_A-Za-z0-9-]*/)){var b=x.Color.fromKeyword(a);return b?b:new x.Keyword(a)}},call:function(){var b,c,d,e,f=y;if(b=/^([\w-]+|%|progid:[\w\.]+)\(/.exec(C)){if(b=b[1],c=b.toLowerCase(),"url"===c)return null;if(y+=b.length,"alpha"===c&&(e=F.alpha(),"undefined"!=typeof e))return e;if(k("("),d=this.arguments(),k(")"))return b?new x.Call(b,d,f,a.currentFileInfo):void 0}},arguments:function(){for(var a,b=[];;){if(a=this.assignment()||F.expression(),!a)break;if(b.push(a),!k(","))break}return b},literal:function(){return this.dimension()||this.color()||this.quoted()||this.unicodeDescriptor()},assignment:function(){var a,b;return a=j(/^\w+(?=\s?=)/i),a&&k("=")?(b=F.entity(),b?new x.Assignment(a,b):void 0):void 0},url:function(){var b;if("u"===v.charAt(y)&&j(/^url\(/))return b=this.quoted()||this.variable()||j(/^(?:(?:\\[\(\)'"])|[^\(\)'"])+/)||"",n(")"),new x.URL(null!=b.value||b instanceof x.Variable?b:new x.Anonymous(b),a.currentFileInfo)},variable:function(){var b,c=y;return"@"===v.charAt(y)&&(b=j(/^@@?[\w-]+/))?new x.Variable(b,c,a.currentFileInfo):void 0},variableCurly:function(){var b,c=y;return"@"===v.charAt(y)&&(b=j(/^@\{([\w-]+)\}/))?new x.Variable("@"+b[1],c,a.currentFileInfo):void 0},color:function(){var a;if("#"===v.charAt(y)&&(a=j(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/))){var b=a.input.match(/^#([\w]+).*/);return b=b[1],b.match(/^[A-Fa-f0-9]+$/)||o("Invalid HEX color code"),new x.Color(a[1])}},dimension:function(){var a,b=v.charCodeAt(y);if(!(b>57||43>b||47===b||44==b))return a=j(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/),a?new x.Dimension(a[1],a[2]):void 0},unicodeDescriptor:function(){var a;return a=j(/^U\+[0-9a-fA-F?]+(\-[0-9a-fA-F?]+)?/),a?new x.UnicodeDescriptor(a[0]):void 0},javascript:function(){var c,d,e=y;return"~"===v.charAt(e)&&(e++,d=!0),"`"===v.charAt(e)?(a.javascriptEnabled===b||a.javascriptEnabled||o("You are using JavaScript, which has been disabled."),d&&k("~"),c=j(/^`([^`]*)`/),c?new x.JavaScript(c[1],y,d):void 0):void 0}},variable:function(){var a;return"@"===v.charAt(y)&&(a=j(/^(@[\w-]+)\s*:/))?a[1]:void 0},rulesetCall:function(){var a;return"@"===v.charAt(y)&&(a=j(/^(@[\w-]+)\s*\(\s*\)\s*;/))?new x.RulesetCall(a[1]):void 0},extend:function(a){var b,c,d,e,f,g=y;if(j(a?/^&:extend\(/:/^:extend\(/)){do{for(d=null,b=null;!(d=j(/^(all)(?=\s*(\)|,))/))&&(c=this.element());)b?b.push(c):b=[c];d=d&&d[1],b||o("Missing target selector for :extend()."),f=new x.Extend(new x.Selector(b),d,g),e?e.push(f):e=[f]}while(k(","));return m(/^\)/),a&&m(/^;/),e}},extendRule:function(){return this.extend(!0)},mixin:{call:function(){var b,c,g,h,i,l,m=v.charAt(y),o=!1,p=y;if("."===m||"#"===m){for(d();;){if(b=y,h=j(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/),!h)break;g=new x.Element(i,h,b,a.currentFileInfo),c?c.push(g):c=[g],i=k(">")}return c&&(k("(")&&(l=this.args(!0).args,n(")")),F.important()&&(o=!0),F.end())?(f(),new x.mixin.Call(c,l,p,a.currentFileInfo,o)):void e()}},args:function(a){var b,c,g,h,i,l,m=E.parsers,n=m.entities,p={args:null,variadic:!1},q=[],r=[],s=[];for(d();;){if(a)l=m.detachedRuleset()||m.expression();else{if(m.comments(),"."===v.charAt(y)&&j(/^\.{3}/)){p.variadic=!0,k(";")&&!b&&(b=!0),(b?r:s).push({variadic:!0});break}l=n.variable()||n.literal()||n.keyword()}if(!l)break;h=null,l.throwAwayComments&&l.throwAwayComments(),i=l;var t=null;if(a?l.value&&1==l.value.length&&(t=l.value[0]):t=l,t&&t instanceof x.Variable)if(k(":")){if(q.length>0&&(b&&o("Cannot mix ; and , as delimiter types"),c=!0),i=a&&m.detachedRuleset()||m.expression(),!i){if(!a)return e(),p.args=[],p;o("could not understand value for named argument")}h=g=t.name}else{if(!a&&j(/^\.{3}/)){p.variadic=!0,k(";")&&!b&&(b=!0),(b?r:s).push({name:l.name,variadic:!0});break}a||(g=h=t.name,i=null)}i&&q.push(i),s.push({name:h,value:i}),k(",")||(k(";")||b)&&(c&&o("Cannot mix ; and , as delimiter types"),b=!0,q.length>1&&(i=new x.Value(q)),r.push({name:g,value:i}),g=null,q=[],c=!1)}return f(),p.args=b?r:s,p},definition:function(){var a,b,c,g,h=[],i=!1;if(!("."!==v.charAt(y)&&"#"!==v.charAt(y)||p(/^[^{]*\}/)))if(d(),b=j(/^([#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+)\s*\(/)){a=b[1];var l=this.args(!1);if(h=l.args,i=l.variadic,!k(")"))return A=y,void e();if(F.comments(),j(/^when/)&&(g=m(F.conditions,"expected condition")),c=F.block())return f(),new x.mixin.Definition(a,h,c,g,i);e()}else f()}},entity:function(){var a=this.entities;return a.literal()||a.variable()||a.url()||a.call()||a.keyword()||a.javascript()||this.comment()},end:function(){return k(";")||q("}")},alpha:function(){var a;if(j(/^\(opacity=/i))return a=j(/^\d+/)||this.entities.variable(),a?(n(")"),new x.Alpha(a)):void 0},element:function(){var b,c,g,h=y;return c=this.combinator(),b=j(/^(?:\d+\.\d+|\d+)%/)||j(/^(?:[.#]?|:*)(?:[\w-]|[^\x00-\x9f]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)||k("*")||k("&")||this.attribute()||j(/^\([^()@]+\)/)||j(/^[\.#](?=@)/)||this.entities.variableCurly(),b||(d(),k("(")?(g=this.selector())&&k(")")?(b=new x.Paren(g),f()):e():f()),b?new x.Element(c,b,h,a.currentFileInfo):void 0},combinator:function(){var a=v.charAt(y);if("/"===a){d();var b=j(/^\/[a-z]+\//i);if(b)return f(),new x.Combinator(b);e()}if(">"===a||"+"===a||"~"===a||"|"===a||"^"===a){for(y++,"^"===a&&"^"===v.charAt(y)&&(a="^^",y++);h(v,y);)y++;return new x.Combinator(a)}return new x.Combinator(h(v,y-1)?" ":null)},lessSelector:function(){return this.selector(!0)},selector:function(b){for(var c,d,e,f,g,h,i,j=y,k=J;(b&&(g=this.extend())||b&&(h=k(/^when/))||(f=this.element()))&&(h?i=m(this.conditions,"expected condition"):i?o("CSS guard can only be used at the end of selector"):g?d?d.push(g):d=[g]:(d&&o("Extend can only be used at the end of selector"),e=v.charAt(y),c?c.push(f):c=[f],f=null),"{"!==e&&"}"!==e&&";"!==e&&","!==e&&")"!==e););return c?new x.Selector(c,d,i,j,a.currentFileInfo):void(d&&o("Extend must be used to extend a selector, it cannot be used on its own"))},attribute:function(){if(k("[")){var a,b,c,d=this.entities;return(a=d.variableCurly())||(a=m(/^(?:[_A-Za-z0-9-\*]*\|)?(?:[_A-Za-z0-9-]|\\.)+/)),c=j(/^[|~*$^]?=/),c&&(b=d.quoted()||j(/^[0-9]+%/)||j(/^[\w-]+/)||d.variableCurly()),n("]"),new x.Attribute(a,c,b)}},block:function(){var a;return k("{")&&(a=this.primary())&&k("}")?a:void 0},blockRuleset:function(){var a=this.block();return a&&(a=new x.Ruleset(null,a)),a},detachedRuleset:function(){var a=this.blockRuleset();return a?new x.DetachedRuleset(a):void 0},ruleset:function(){var b,c,g,h;for(d(),a.dumpLineNumbers&&(h=t(y,v,a));;){if(c=this.lessSelector(),!c)break;if(b?b.push(c):b=[c],this.comments(),c.condition&&b.length>1&&o("Guards are only currently allowed on a single selector."),!k(","))break;c.condition&&o("Guards are only currently allowed on a single selector."),this.comments()}if(b&&(g=this.block())){f();var i=new x.Ruleset(b,g,a.strictImports);return a.dumpLineNumbers&&(i.debugInfo=h),i}A=y,e()},rule:function(b){var c,g,h,i,j,k=y,l=v.charAt(k);if("."!==l&&"#"!==l&&"&"!==l)if(d(),c=this.variable()||this.ruleProperty()){if(j="string"==typeof c,j&&(g=this.detachedRuleset()),this.comments(),g||(g=b||!a.compress&&!j?this.anonymousValue()||this.value():this.value()||this.anonymousValue(),h=this.important(),i=!j&&c.pop().value),g&&this.end())return f(),new x.Rule(c,g,h,i,k,a.currentFileInfo);if(A=y,e(),g&&!b)return this.rule(!0)}else f()},anonymousValue:function(){var a;return a=/^([^@+\/'"*`(;{}-]*);/.exec(C),a?(y+=a[0].length-1,new x.Anonymous(a[1])):void 0},"import":function(){var b,c,d=y,e=j(/^@import?\s+/);if(e){var f=(e?this.importOptions():null)||{};if(b=this.entities.quoted()||this.entities.url())return c=this.mediaFeatures(),i(";")||(y=d,o("missing semi-colon or unrecognised media features on import")),c=c&&new x.Value(c),new x.Import(b,c,f,d,a.currentFileInfo);y=d,o("malformed import statement")}},importOptions:function(){var a,b,c,d={};if(!k("("))return null;do if(a=this.importOption()){switch(b=a,c=!0,b){case"css":b="less",c=!1;break;case"once":b="multiple",c=!1}if(d[b]=c,!k(","))break}while(a);return n(")"),d},importOption:function(){var a=j(/^(less|css|multiple|once|inline|reference)/);return a?a[1]:void 0},mediaFeature:function(){var b,c,d=this.entities,e=[];do if(b=d.keyword()||d.variable())e.push(b);else if(k("(")){if(c=this.property(),b=this.value(),!k(")"))return null;if(c&&b)e.push(new x.Paren(new x.Rule(c,b,null,null,y,a.currentFileInfo,!0)));else{if(!b)return null;e.push(new x.Paren(b))}}while(b);return e.length>0?new x.Expression(e):void 0},mediaFeatures:function(){var a,b=this.entities,c=[];do if(a=this.mediaFeature()){if(c.push(a),!k(","))break}else if(a=b.variable(),a&&(c.push(a),!k(",")))break;while(a);return c.length>0?c:null},media:function(){var b,c,d,e;return a.dumpLineNumbers&&(e=t(y,v,a)),j(/^@media/)&&(b=this.mediaFeatures(),c=this.block())?(d=new x.Media(c,b,y,a.currentFileInfo),a.dumpLineNumbers&&(d.debugInfo=e),d):void 0},directive:function(){var b,c,g,h,i,l,m,n=y,p=!0;if("@"===v.charAt(y)){if(c=this["import"]()||this.media())return c;if(d(),b=j(/^@[a-z-]+/)){switch(h=b,"-"==b.charAt(1)&&b.indexOf("-",2)>0&&(h="@"+b.slice(b.indexOf("-",2)+1)),h){case"@charset":i=!0,p=!1;break;case"@namespace":l=!0,p=!1;break;case"@keyframes":i=!0;break;case"@host":case"@page":case"@document":case"@supports":m=!0}return this.comments(),i?(c=this.entity(),c||o("expected "+b+" identifier")):l?(c=this.expression(),c||o("expected "+b+" expression")):m&&(c=(j(/^[^{;]+/)||"").trim(),c&&(c=new x.Anonymous(c))),this.comments(),p&&(g=this.blockRuleset()),g||!p&&c&&k(";")?(f(),new x.Directive(b,c,g,n,a.currentFileInfo,a.dumpLineNumbers?t(n,v,a):null)):void e()}}},value:function(){var a,b=[];do if(a=this.expression(),a&&(b.push(a),!k(",")))break;while(a);return b.length>0?new x.Value(b):void 0},important:function(){return"!"===v.charAt(y)?j(/^! *important/):void 0},sub:function(){var a,b;return k("(")&&(a=this.addition())?(b=new x.Expression([a]),n(")"),b.parens=!0,b):void 0},multiplication:function(){var a,b,c,g,i;if(a=this.operand()){for(i=h(v,y-1);;){if(p(/^\/[*\/]/))break;if(d(),c=k("/")||k("*"),!c){f();break}if(b=this.operand(),!b){e();break}f(),a.parensInOp=!0,b.parensInOp=!0,g=new x.Operation(c,[g||a,b],i),i=h(v,y-1)}return g||a}},addition:function(){var a,b,c,d,e;if(a=this.multiplication()){for(e=h(v,y-1);;){if(c=j(/^[-+]\s+/)||!e&&(k("+")||k("-")),!c)break;if(b=this.multiplication(),!b)break;a.parensInOp=!0,b.parensInOp=!0,d=new x.Operation(c,[d||a,b],e),e=h(v,y-1)}return d||a}},conditions:function(){var a,b,c,d=y;if(a=this.condition()){for(;;){if(!p(/^,\s*(not\s*)?\(/)||!k(","))break;if(b=this.condition(),!b)break;c=new x.Condition("or",c||a,b,d)}return c||a}},condition:function(){var a,b,c,d,e=this.entities,f=y,g=!1;return j(/^not/)&&(g=!0),n("("),a=this.addition()||e.keyword()||e.quoted(),a?(d=j(/^(?:>=|<=|=<|[<=>])/),d?(b=this.addition()||e.keyword()||e.quoted(),b?c=new x.Condition(d,a,b,f,g):o("expected expression")):c=new x.Condition("=",a,new x.Keyword("true"),f,g),n(")"),j(/^and/)?new x.Condition("and",c,this.condition()):c):void 0},operand:function(){var a,b=this.entities,c=v.charAt(y+1);"-"!==v.charAt(y)||"@"!==c&&"("!==c||(a=k("-"));var d=this.sub()||b.dimension()||b.color()||b.variable()||b.call();return a&&(d.parensInOp=!0,d=new x.Negative(d)),d},expression:function(){var a,b,c=[];do a=this.addition()||this.entity(),a&&(c.push(a),p(/^\/[\/*]/)||(b=k("/"),b&&c.push(new x.Anonymous(b))));while(a);return c.length>0?new x.Expression(c):void 0},property:function(){var a=j(/^(\*?-?[_a-zA-Z0-9-]+)\s*:/);return a?a[1]:void 0},ruleProperty:function(){function b(a){var b=a.exec(f);return b?(h.push(y+i),i+=b[0].length,f=f.slice(b[1].length),g.push(b[1])):void 0}function c(){var a=/^\s*\/\*(?:[^*]|\*+[^\/*])*\*+\//.exec(f);return a?(i+=a[0].length,f=f.slice(a[0].length),!0):!1}var d,e,f=C,g=[],h=[],i=0;for(b(/^(\*?)/);b(/^((?:[\w-]+)|(?:@\{[\w-]+\}))/););for(;c(););if(g.length>1&&b(/^\s*((?:\+_|\+)?)\s*:/)){for(l(i),""===g[0]&&(g.shift(),h.shift()),e=0;e<g.length;e++)d=g[e],g[e]="@"!==d.charAt(0)?new x.Keyword(d):new x.Variable("@"+d.slice(2,-1),h[e],a.currentFileInfo);return g}}}}},w.Parser.serializeVars=function(a){var b="";for(var c in a)if(Object.hasOwnProperty.call(a,c)){var d=a[c];b+=("@"===c[0]?"":"@")+c+": "+d+(";"===(""+d).slice(-1)?"":";")}return b},function(d){function e(a,b,c){if(!(c instanceof d.Dimension))throw{type:"Argument",message:"argument must be a number"};return null==b?b=c.unit:c=c.unify(),new d.Dimension(a(parseFloat(c.value)),b)}function f(a,b,c){var e,f,g,h,i=b.alpha,j=c.alpha,k=[];g=j+i*(1-j);for(var l=0;3>l;l++)e=b.rgb[l]/255,f=c.rgb[l]/255,h=a(e,f),g&&(h=(j*f+i*(e-j*(e+f-h)))/g),k[l]=255*h;return new d.Color(k,g)}function g(){var a,b=d.functions;for(a in l)l.hasOwnProperty(a)&&(b[a]=e.bind(null,Math[a],l[a]));for(a in m)m.hasOwnProperty(a)&&(b[a]=f.bind(null,m[a]));a=d.defaultFunc,b["default"]=a.eval.bind(a)}function h(a){return d.functions.hsla(a.h,a.s,a.l,a.a)}function i(a,b){return a instanceof d.Dimension&&a.unit.is("%")?parseFloat(a.value*b/100):j(a)}function j(a){if(a instanceof d.Dimension)return parseFloat(a.unit.is("%")?a.value/100:a.value);if("number"==typeof a)return a;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function k(a){return Math.min(1,Math.max(0,a))}d.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(a,b,c,e){var f=[a,b,c].map(function(a){return i(a,255)});return e=j(e),new d.Color(f,e)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,c,d){function e(a){return a=0>a?a+1:a>1?a-1:a,1>6*a?g+(f-g)*a*6:1>2*a?f:2>3*a?g+(f-g)*(2/3-a)*6:g}a=j(a)%360/360,b=k(j(b)),c=k(j(c)),d=k(j(d));var f=.5>=c?c*(b+1):c+b-c*b,g=2*c-f;return this.rgba(255*e(a+1/3),255*e(a),255*e(a-1/3),d)},hsv:function(a,b,c){return this.hsva(a,b,c,1)},hsva:function(a,b,c,d){a=j(a)%360/360*360,b=j(b),c=j(c),d=j(d);var e,f;e=Math.floor(a/60%6),f=a/60-e;var g=[c,c*(1-b),c*(1-f*b),c*(1-(1-f)*b)],h=[[0,3,1],[2,0,1],[1,0,3],[1,2,0],[3,1,0],[0,1,2]];return this.rgba(255*g[h[e][0]],255*g[h[e][1]],255*g[h[e][2]],d)},hue:function(a){return new d.Dimension(a.toHSL().h)},saturation:function(a){return new d.Dimension(100*a.toHSL().s,"%")},lightness:function(a){return new d.Dimension(100*a.toHSL().l,"%")},hsvhue:function(a){return new d.Dimension(a.toHSV().h)},hsvsaturation:function(a){return new d.Dimension(100*a.toHSV().s,"%")},hsvvalue:function(a){return new d.Dimension(100*a.toHSV().v,"%")},red:function(a){return new d.Dimension(a.rgb[0])},green:function(a){return new d.Dimension(a.rgb[1])},blue:function(a){return new d.Dimension(a.rgb[2])},alpha:function(a){return new d.Dimension(a.toHSL().a)},luma:function(a){return new d.Dimension(a.luma()*a.alpha*100,"%")},luminance:function(a){var b=.2126*a.rgb[0]/255+.7152*a.rgb[1]/255+.0722*a.rgb[2]/255;return new d.Dimension(b*a.alpha*100,"%")},saturate:function(a,b){if(!a.rgb)return null;var c=a.toHSL();return c.s+=b.value/100,c.s=k(c.s),h(c)},desaturate:function(a,b){var c=a.toHSL();return c.s-=b.value/100,c.s=k(c.s),h(c)},lighten:function(a,b){var c=a.toHSL();return c.l+=b.value/100,c.l=k(c.l),h(c)},darken:function(a,b){var c=a.toHSL();return c.l-=b.value/100,c.l=k(c.l),h(c)},fadein:function(a,b){var c=a.toHSL();return c.a+=b.value/100,c.a=k(c.a),h(c)},fadeout:function(a,b){var c=a.toHSL();return c.a-=b.value/100,c.a=k(c.a),h(c)},fade:function(a,b){var c=a.toHSL();return c.a=b.value/100,c.a=k(c.a),h(c)},spin:function(a,b){var c=a.toHSL(),d=(c.h+b.value)%360;return c.h=0>d?360+d:d,h(c)},mix:function(a,b,c){c||(c=new d.Dimension(50));var e=c.value/100,f=2*e-1,g=a.toHSL().a-b.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[a.rgb[0]*h+b.rgb[0]*i,a.rgb[1]*h+b.rgb[1]*i,a.rgb[2]*h+b.rgb[2]*i],k=a.alpha*e+b.alpha*(1-e);return new d.Color(j,k)},greyscale:function(a){return this.desaturate(a,new d.Dimension(100))},contrast:function(a,b,c,d){if(!a.rgb)return null;if("undefined"==typeof c&&(c=this.rgba(255,255,255,1)),"undefined"==typeof b&&(b=this.rgba(0,0,0,1)),b.luma()>c.luma()){var e=c;c=b,b=e}return d="undefined"==typeof d?.43:j(d),a.luma()<d?c:b},e:function(a){return new d.Anonymous(a instanceof d.JavaScript?a.evaluated:a.value)},escape:function(a){return new d.Anonymous(encodeURI(a.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))
},replace:function(a,b,c,e){var f=a.value;return f=f.replace(new RegExp(b.value,e?e.value:""),c.value),new d.Quoted(a.quote||"",f,a.escaped)},"%":function(a){for(var b=Array.prototype.slice.call(arguments,1),c=a.value,e=0;e<b.length;e++)c=c.replace(/%[sda]/i,function(a){var c=a.match(/s/i)?b[e].value:b[e].toCSS();return a.match(/[A-Z]$/)?encodeURIComponent(c):c});return c=c.replace(/%%/g,"%"),new d.Quoted(a.quote||"",c,a.escaped)},unit:function(a,b){if(!(a instanceof d.Dimension))throw{type:"Argument",message:"the first argument to unit must be a number"+(a instanceof d.Operation?". Have you forgotten parenthesis?":"")};return b=b?b instanceof d.Keyword?b.value:b.toCSS():"",new d.Dimension(a.value,b)},convert:function(a,b){return a.convertTo(b.value)},round:function(a,b){var c="undefined"==typeof b?0:b.value;return e(function(a){return a.toFixed(c)},null,a)},pi:function(){return new d.Dimension(Math.PI)},mod:function(a,b){return new d.Dimension(a.value%b.value,a.unit)},pow:function(a,b){if("number"==typeof a&&"number"==typeof b)a=new d.Dimension(a),b=new d.Dimension(b);else if(!(a instanceof d.Dimension&&b instanceof d.Dimension))throw{type:"Argument",message:"arguments must be numbers"};return new d.Dimension(Math.pow(a.value,b.value),a.unit)},_minmax:function(a,c){switch(c=Array.prototype.slice.call(c),c.length){case 0:throw{type:"Argument",message:"one or more arguments required"}}var e,f,g,h,i,j,k,l,m=[],n={};for(e=0;e<c.length;e++)if(g=c[e],g instanceof d.Dimension)if(h=""===g.unit.toString()&&l!==b?new d.Dimension(g.value,l).unify():g.unify(),j=""===h.unit.toString()&&k!==b?k:h.unit.toString(),k=""!==j&&k===b||""!==j&&""===m[0].unify().unit.toString()?j:k,l=""!==j&&l===b?g.unit.toString():l,f=n[""]!==b&&""!==j&&j===k?n[""]:n[j],f!==b)i=""===m[f].unit.toString()&&l!==b?new d.Dimension(m[f].value,l).unify():m[f].unify(),(a&&h.value<i.value||!a&&h.value>i.value)&&(m[f]=g);else{if(k!==b&&j!==k)throw{type:"Argument",message:"incompatible types"};n[j]=m.length,m.push(g)}else Array.isArray(c[e].value)&&Array.prototype.push.apply(c,Array.prototype.slice.call(c[e].value));return 1==m.length?m[0]:(c=m.map(function(a){return a.toCSS(this.env)}).join(this.env.compress?",":", "),new d.Anonymous((a?"min":"max")+"("+c+")"))},min:function(){return this._minmax(!0,arguments)},max:function(){return this._minmax(!1,arguments)},"get-unit":function(a){return new d.Anonymous(a.unit)},argb:function(a){return new d.Anonymous(a.toARGB())},percentage:function(a){return new d.Dimension(100*a.value,"%")},color:function(a){if(a instanceof d.Quoted){var b,c=a.value;if(b=d.Color.fromKeyword(c))return b;if(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/.test(c))return new d.Color(c.slice(1));throw{type:"Argument",message:"argument must be a color keyword or 3/6 digit hex e.g. #FFF"}}throw{type:"Argument",message:"argument must be a string"}},iscolor:function(a){return this._isa(a,d.Color)},isnumber:function(a){return this._isa(a,d.Dimension)},isstring:function(a){return this._isa(a,d.Quoted)},iskeyword:function(a){return this._isa(a,d.Keyword)},isurl:function(a){return this._isa(a,d.URL)},ispixel:function(a){return this.isunit(a,"px")},ispercentage:function(a){return this.isunit(a,"%")},isem:function(a){return this.isunit(a,"em")},isunit:function(a,b){return a instanceof d.Dimension&&a.unit.is(b.value||b)?d.True:d.False},_isa:function(a,b){return a instanceof b?d.True:d.False},tint:function(a,b){return this.mix(this.rgb(255,255,255),a,b)},shade:function(a,b){return this.mix(this.rgb(0,0,0),a,b)},extract:function(a,b){return b=b.value-1,Array.isArray(a.value)?a.value[b]:Array(a)[b]},length:function(a){var b=Array.isArray(a.value)?a.value.length:1;return new d.Dimension(b)},"data-uri":function(b,e){if("undefined"!=typeof a)return new d.URL(e||b,this.currentFileInfo).eval(this.env);var f=b.value,g=e&&e.value,h=c("./fs"),i=c("path"),j=!1;arguments.length<2&&(g=f);var k=g.indexOf("#"),l="";if(-1!==k&&(l=g.slice(k),g=g.slice(0,k)),this.env.isPathRelative(g)&&(g=this.currentFileInfo.relativeUrls?i.join(this.currentFileInfo.currentDirectory,g):i.join(this.currentFileInfo.entryPath,g)),arguments.length<2){var m;try{m=c("mime")}catch(n){m=d._mime}f=m.lookup(g);var o=m.charsets.lookup(f);j=["US-ASCII","UTF-8"].indexOf(o)<0,j&&(f+=";base64")}else j=/;base64$/.test(f);var p=h.readFileSync(g),q=32,r=parseInt(p.length/1024,10);if(r>=q&&this.env.ieCompat!==!1)return this.env.silent||console.warn("Skipped data-uri embedding of %s because its size (%dKB) exceeds IE8-safe %dKB!",g,r,q),new d.URL(e||b,this.currentFileInfo).eval(this.env);p=j?p.toString("base64"):encodeURIComponent(p);var s='"data:'+f+","+p+l+'"';return new d.URL(new d.Anonymous(s))},"svg-gradient":function(a){function e(){throw{type:"Argument",message:"svg-gradient expects direction, start_color [start_position], [color position,]..., end_color [end_position]"}}arguments.length<3&&e();var f,g,h,i,j,k,l,m=Array.prototype.slice.call(arguments,1),n="linear",o='x="0" y="0" width="1" height="1"',p=!0,q={compress:!1},r=a.toCSS(q);switch(r){case"to bottom":f='x1="0%" y1="0%" x2="0%" y2="100%"';break;case"to right":f='x1="0%" y1="0%" x2="100%" y2="0%"';break;case"to bottom right":f='x1="0%" y1="0%" x2="100%" y2="100%"';break;case"to top right":f='x1="0%" y1="100%" x2="100%" y2="0%"';break;case"ellipse":case"ellipse at center":n="radial",f='cx="50%" cy="50%" r="75%"',o='x="-50" y="-50" width="101" height="101"';break;default:throw{type:"Argument",message:"svg-gradient direction must be 'to bottom', 'to right', 'to bottom right', 'to top right' or 'ellipse at center'"}}for(g='<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="100%" height="100%" viewBox="0 0 1 1" preserveAspectRatio="none"><'+n+'Gradient id="gradient" gradientUnits="userSpaceOnUse" '+f+">",h=0;h<m.length;h+=1)m[h].value?(i=m[h].value[0],j=m[h].value[1]):(i=m[h],j=b),i instanceof d.Color&&((0===h||h+1===m.length)&&j===b||j instanceof d.Dimension)||e(),k=j?j.toCSS(q):0===h?"0%":"100%",l=i.alpha,g+='<stop offset="'+k+'" stop-color="'+i.toRGB()+'"'+(1>l?' stop-opacity="'+l+'"':"")+"/>";if(g+="</"+n+"Gradient><rect "+o+' fill="url(#gradient)" /></svg>',p)try{g=c("./encoder").encodeBase64(g)}catch(s){p=!1}return g="'data:image/svg+xml"+(p?";base64":"")+","+g+"'",new d.URL(new d.Anonymous(g))}},d._mime={_types:{".htm":"text/html",".html":"text/html",".gif":"image/gif",".jpg":"image/jpeg",".jpeg":"image/jpeg",".png":"image/png"},lookup:function(a){var e=c("path").extname(a),f=d._mime._types[e];if(f===b)throw new Error('Optional dependency "mime" is required for '+e);return f},charsets:{lookup:function(a){return a&&/^text\//.test(a)?"UTF-8":""}}};var l={ceil:null,floor:null,sqrt:null,abs:null,tan:"",sin:"",cos:"",atan:"rad",asin:"rad",acos:"rad"},m={multiply:function(a,b){return a*b},screen:function(a,b){return a+b-a*b},overlay:function(a,b){return a*=2,1>=a?m.multiply(a,b):m.screen(a-1,b)},softlight:function(a,b){var c=1,d=a;return b>.5&&(d=1,c=a>.25?Math.sqrt(a):((16*a-12)*a+4)*a),a-(1-2*b)*d*(c-a)},hardlight:function(a,b){return m.overlay(b,a)},difference:function(a,b){return Math.abs(a-b)},exclusion:function(a,b){return a+b-2*a*b},average:function(a,b){return(a+b)/2},negation:function(a,b){return 1-Math.abs(a+b-1)}};d.defaultFunc={eval:function(){var a=this.value_,b=this.error_;if(b)throw b;return null!=a?a?d.True:d.False:void 0},value:function(a){this.value_=a},error:function(a){this.error_=a},reset:function(){this.value_=this.error_=null}},g(),d.fround=function(a,b){var c=a&&a.numPrecision;return null==c?b:Number((b+2e-16).toFixed(c))},d.functionCall=function(a,b){this.env=a,this.currentFileInfo=b},d.functionCall.prototype=d.functions}(c("./tree")),function(a){a.colors={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}}(c("./tree")),function(a){a.debugInfo=function(b,c,d){var e="";if(b.dumpLineNumbers&&!b.compress)switch(b.dumpLineNumbers){case"comments":e=a.debugInfo.asComment(c);break;case"mediaquery":e=a.debugInfo.asMediaQuery(c);break;case"all":e=a.debugInfo.asComment(c)+(d||"")+a.debugInfo.asMediaQuery(c)}return e},a.debugInfo.asComment=function(a){return"/* line "+a.debugInfo.lineNumber+", "+a.debugInfo.fileName+" */\n"},a.debugInfo.asMediaQuery=function(a){return"@media -sass-debug-info{filename{font-family:"+("file://"+a.debugInfo.fileName).replace(/([.:\/\\])/g,function(a){return"\\"==a&&(a="/"),"\\"+a})+"}line{font-family:\\00003"+a.debugInfo.lineNumber+"}}\n"},a.find=function(a,b){for(var c,d=0;d<a.length;d++)if(c=b.call(a,a[d]))return c;return null},a.jsify=function(a){return Array.isArray(a.value)&&a.value.length>1?"["+a.value.map(function(a){return a.toCSS()}).join(", ")+"]":a.toCSS()},a.toCSS=function(a){var b=[];return this.genCSS(a,{add:function(a){b.push(a)},isEmpty:function(){return 0===b.length}}),b.join("")},a.outputRuleset=function(a,b,c){var d,e=c.length;if(a.tabLevel=(0|a.tabLevel)+1,a.compress){for(b.add("{"),d=0;e>d;d++)c[d].genCSS(a,b);return b.add("}"),void a.tabLevel--}var f="\n"+Array(a.tabLevel).join("  "),g=f+"  ";if(e){for(b.add(" {"+g),c[0].genCSS(a,b),d=1;e>d;d++)b.add(g),c[d].genCSS(a,b);b.add(f+"}")}else b.add(" {"+f+"}");a.tabLevel--}}(c("./tree")),function(a){a.Alpha=function(a){this.value=a},a.Alpha.prototype={type:"Alpha",accept:function(a){this.value=a.visit(this.value)},eval:function(b){return this.value.eval?new a.Alpha(this.value.eval(b)):this},genCSS:function(a,b){b.add("alpha(opacity="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value),b.add(")")},toCSS:a.toCSS}}(c("../tree")),function(a){a.Anonymous=function(a,b,c,d,e){this.value=a,this.index=b,this.mapLines=d,this.currentFileInfo=c,this.rulesetLike="undefined"==typeof e?!1:e},a.Anonymous.prototype={type:"Anonymous",eval:function(){return new a.Anonymous(this.value,this.index,this.currentFileInfo,this.mapLines,this.rulesetLike)},compare:function(a){if(!a.toCSS)return-1;var b=this.toCSS(),c=a.toCSS();return b===c?0:c>b?-1:1},isRulesetLike:function(){return this.rulesetLike},genCSS:function(a,b){b.add(this.value,this.currentFileInfo,this.index,this.mapLines)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Assignment=function(a,b){this.key=a,this.value=b},a.Assignment.prototype={type:"Assignment",accept:function(a){this.value=a.visit(this.value)},eval:function(b){return this.value.eval?new a.Assignment(this.key,this.value.eval(b)):this},genCSS:function(a,b){b.add(this.key+"="),this.value.genCSS?this.value.genCSS(a,b):b.add(this.value)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Call=function(a,b,c,d){this.name=a,this.args=b,this.index=c,this.currentFileInfo=d},a.Call.prototype={type:"Call",accept:function(a){this.args&&(this.args=a.visitArray(this.args))},eval:function(b){var c,d,e=this.args.map(function(a){return a.eval(b)}),f=this.name.toLowerCase();if(f in a.functions)try{if(d=new a.functionCall(b,this.currentFileInfo),c=d[f].apply(d,e),null!=c)return c}catch(g){throw{type:g.type||"Runtime",message:"error evaluating function `"+this.name+"`"+(g.message?": "+g.message:""),index:this.index,filename:this.currentFileInfo.filename}}return new a.Call(this.name,e,this.index,this.currentFileInfo)},genCSS:function(a,b){b.add(this.name+"(",this.currentFileInfo,this.index);for(var c=0;c<this.args.length;c++)this.args[c].genCSS(a,b),c+1<this.args.length&&b.add(", ");b.add(")")},toCSS:a.toCSS}}(c("../tree")),function(a){function b(a){return"#"+a.map(function(a){return a=c(Math.round(a),255),(16>a?"0":"")+a.toString(16)}).join("")}function c(a,b){return Math.min(Math.max(a,0),b)}a.Color=function(a,b){this.rgb=Array.isArray(a)?a:6==a.length?a.match(/.{2}/g).map(function(a){return parseInt(a,16)}):a.split("").map(function(a){return parseInt(a+a,16)}),this.alpha="number"==typeof b?b:1};var d="transparent";a.Color.prototype={type:"Color",eval:function(){return this},luma:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255;return a=.03928>=a?a/12.92:Math.pow((a+.055)/1.055,2.4),b=.03928>=b?b/12.92:Math.pow((b+.055)/1.055,2.4),c=.03928>=c?c/12.92:Math.pow((c+.055)/1.055,2.4),.2126*a+.7152*b+.0722*c},genCSS:function(a,b){b.add(this.toCSS(a))},toCSS:function(b,e){var f=b&&b.compress&&!e,g=a.fround(b,this.alpha);if(1>g)return 0===g&&this.isTransparentKeyword?d:"rgba("+this.rgb.map(function(a){return c(Math.round(a),255)}).concat(c(g,1)).join(","+(f?"":" "))+")";var h=this.toRGB();if(f){var i=h.split("");i[1]===i[2]&&i[3]===i[4]&&i[5]===i[6]&&(h="#"+i[1]+i[3]+i[5])}return h},operate:function(b,c,d){for(var e=[],f=this.alpha*(1-d.alpha)+d.alpha,g=0;3>g;g++)e[g]=a.operate(b,c,this.rgb[g],d.rgb[g]);return new a.Color(e,f)},toRGB:function(){return b(this.rgb)},toHSL:function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=(g+h)/2,j=g-h;if(g===h)a=b=0;else{switch(b=i>.5?j/(2-g-h):j/(g+h),g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,l:i,a:f}},toHSV:function(){var a,b,c=this.rgb[0]/255,d=this.rgb[1]/255,e=this.rgb[2]/255,f=this.alpha,g=Math.max(c,d,e),h=Math.min(c,d,e),i=g,j=g-h;if(b=0===g?0:j/g,g===h)a=0;else{switch(g){case c:a=(d-e)/j+(e>d?6:0);break;case d:a=(e-c)/j+2;break;case e:a=(c-d)/j+4}a/=6}return{h:360*a,s:b,v:i,a:f}},toARGB:function(){return b([255*this.alpha].concat(this.rgb))},compare:function(a){return a.rgb&&a.rgb[0]===this.rgb[0]&&a.rgb[1]===this.rgb[1]&&a.rgb[2]===this.rgb[2]&&a.alpha===this.alpha?0:-1}},a.Color.fromKeyword=function(b){if(b=b.toLowerCase(),a.colors.hasOwnProperty(b))return new a.Color(a.colors[b].slice(1));if(b===d){var c=new a.Color([0,0,0],0);return c.isTransparentKeyword=!0,c}}}(c("../tree")),function(a){a.Comment=function(a,b,c,d){this.value=a,this.silent=!!b,this.currentFileInfo=d},a.Comment.prototype={type:"Comment",genCSS:function(b,c){this.debugInfo&&c.add(a.debugInfo(b,this),this.currentFileInfo,this.index),c.add(this.value.trim())},toCSS:a.toCSS,isSilent:function(a){var b=this.currentFileInfo&&this.currentFileInfo.reference&&!this.isReferenced,c=a.compress&&!this.value.match(/^\/\*!/);return this.silent||b||c},eval:function(){return this},markReferenced:function(){this.isReferenced=!0}}}(c("../tree")),function(a){a.Condition=function(a,b,c,d,e){this.op=a.trim(),this.lvalue=b,this.rvalue=c,this.index=d,this.negate=e},a.Condition.prototype={type:"Condition",accept:function(a){this.lvalue=a.visit(this.lvalue),this.rvalue=a.visit(this.rvalue)},eval:function(a){var b,c=this.lvalue.eval(a),d=this.rvalue.eval(a),e=this.index;return b=function(a){switch(a){case"and":return c&&d;case"or":return c||d;default:if(c.compare)b=c.compare(d);else{if(!d.compare)throw{type:"Type",message:"Unable to perform comparison",index:e};b=d.compare(c)}switch(b){case-1:return"<"===a||"=<"===a||"<="===a;case 0:return"="===a||">="===a||"=<"===a||"<="===a;case 1:return">"===a||">="===a}}}(this.op),this.negate?!b:b}}}(c("../tree")),function(a){a.DetachedRuleset=function(a,b){this.ruleset=a,this.frames=b},a.DetachedRuleset.prototype={type:"DetachedRuleset",accept:function(a){this.ruleset=a.visit(this.ruleset)},eval:function(b){var c=this.frames||b.frames.slice(0);return new a.DetachedRuleset(this.ruleset,c)},callEval:function(b){return this.ruleset.eval(this.frames?new a.evalEnv(b,this.frames.concat(b.frames)):b)}}}(c("../tree")),function(a){a.Dimension=function(c,d){this.value=parseFloat(c),this.unit=d&&d instanceof a.Unit?d:new a.Unit(d?[d]:b)},a.Dimension.prototype={type:"Dimension",accept:function(a){this.unit=a.visit(this.unit)},eval:function(){return this},toColor:function(){return new a.Color([this.value,this.value,this.value])},genCSS:function(b,c){if(b&&b.strictUnits&&!this.unit.isSingular())throw new Error("Multiple units in dimension. Correct the units or use the unit function. Bad unit: "+this.unit.toString());var d=a.fround(b,this.value),e=String(d);if(0!==d&&1e-6>d&&d>-1e-6&&(e=d.toFixed(20).replace(/0+$/,"")),b&&b.compress){if(0===d&&this.unit.isLength())return void c.add(e);d>0&&1>d&&(e=e.substr(1))}c.add(e),this.unit.genCSS(b,c)},toCSS:a.toCSS,operate:function(b,c,d){var e=a.operate(b,c,this.value,d.value),f=this.unit.clone();if("+"===c||"-"===c)if(0===f.numerator.length&&0===f.denominator.length)f.numerator=d.unit.numerator.slice(0),f.denominator=d.unit.denominator.slice(0);else if(0===d.unit.numerator.length&&0===f.denominator.length);else{if(d=d.convertTo(this.unit.usedUnits()),b.strictUnits&&d.unit.toString()!==f.toString())throw new Error("Incompatible units. Change the units or use the unit function. Bad units: '"+f.toString()+"' and '"+d.unit.toString()+"'.");e=a.operate(b,c,this.value,d.value)}else"*"===c?(f.numerator=f.numerator.concat(d.unit.numerator).sort(),f.denominator=f.denominator.concat(d.unit.denominator).sort(),f.cancel()):"/"===c&&(f.numerator=f.numerator.concat(d.unit.denominator).sort(),f.denominator=f.denominator.concat(d.unit.numerator).sort(),f.cancel());return new a.Dimension(e,f)},compare:function(b){if(b instanceof a.Dimension){var c,d,e,f;if(this.unit.isEmpty()||b.unit.isEmpty())c=this,d=b;else if(c=this.unify(),d=b.unify(),0!==c.unit.compare(d.unit))return-1;return e=c.value,f=d.value,f>e?-1:e>f?1:0}return-1},unify:function(){return this.convertTo({length:"px",duration:"s",angle:"rad"})},convertTo:function(b){var c,d,e,f,g,h=this.value,i=this.unit.clone(),j={};if("string"==typeof b){for(c in a.UnitConversions)a.UnitConversions[c].hasOwnProperty(b)&&(j={},j[c]=b);b=j}g=function(a,b){return e.hasOwnProperty(a)?(b?h/=e[a]/e[f]:h*=e[a]/e[f],f):a};for(d in b)b.hasOwnProperty(d)&&(f=b[d],e=a.UnitConversions[d],i.map(g));return i.cancel(),new a.Dimension(h,i)}},a.UnitConversions={length:{m:1,cm:.01,mm:.001,"in":.0254,px:.0254/96,pt:.0254/72,pc:.0254/72*12},duration:{s:1,ms:.001},angle:{rad:1/(2*Math.PI),deg:1/360,grad:.0025,turn:1}},a.Unit=function(a,b,c){this.numerator=a?a.slice(0).sort():[],this.denominator=b?b.slice(0).sort():[],this.backupUnit=c},a.Unit.prototype={type:"Unit",clone:function(){return new a.Unit(this.numerator.slice(0),this.denominator.slice(0),this.backupUnit)},genCSS:function(a,b){this.numerator.length>=1?b.add(this.numerator[0]):this.denominator.length>=1?b.add(this.denominator[0]):a&&a.strictUnits||!this.backupUnit||b.add(this.backupUnit)},toCSS:a.toCSS,toString:function(){var a,b=this.numerator.join("*");for(a=0;a<this.denominator.length;a++)b+="/"+this.denominator[a];return b},compare:function(a){return this.is(a.toString())?0:-1},is:function(a){return this.toString()===a},isLength:function(){return Boolean(this.toCSS().match(/px|em|%|in|cm|mm|pc|pt|ex/))},isEmpty:function(){return 0===this.numerator.length&&0===this.denominator.length},isSingular:function(){return this.numerator.length<=1&&0===this.denominator.length},map:function(a){var b;for(b=0;b<this.numerator.length;b++)this.numerator[b]=a(this.numerator[b],!1);for(b=0;b<this.denominator.length;b++)this.denominator[b]=a(this.denominator[b],!0)},usedUnits:function(){var b,c,d={};c=function(a){return b.hasOwnProperty(a)&&!d[e]&&(d[e]=a),a};for(var e in a.UnitConversions)a.UnitConversions.hasOwnProperty(e)&&(b=a.UnitConversions[e],this.map(c));return d},cancel:function(){var a,b,c,d={};for(b=0;b<this.numerator.length;b++)a=this.numerator[b],c||(c=a),d[a]=(d[a]||0)+1;for(b=0;b<this.denominator.length;b++)a=this.denominator[b],c||(c=a),d[a]=(d[a]||0)-1;this.numerator=[],this.denominator=[];for(a in d)if(d.hasOwnProperty(a)){var e=d[a];if(e>0)for(b=0;e>b;b++)this.numerator.push(a);else if(0>e)for(b=0;-e>b;b++)this.denominator.push(a)}0===this.numerator.length&&0===this.denominator.length&&c&&(this.backupUnit=c),this.numerator.sort(),this.denominator.sort()}}}(c("../tree")),function(a){a.Directive=function(a,b,c,d,e,f){this.name=a,this.value=b,c&&(this.rules=c,this.rules.allowImports=!0),this.index=d,this.currentFileInfo=e,this.debugInfo=f},a.Directive.prototype={type:"Directive",accept:function(a){var b=this.value,c=this.rules;c&&(c=a.visit(c)),b&&(b=a.visit(b))},isRulesetLike:function(){return!this.isCharset()},isCharset:function(){return"@charset"===this.name},genCSS:function(b,c){var d=this.value,e=this.rules;c.add(this.name,this.currentFileInfo,this.index),d&&(c.add(" "),d.genCSS(b,c)),e?a.outputRuleset(b,c,[e]):c.add(";")},toCSS:a.toCSS,eval:function(b){var c=this.value,d=this.rules;return c&&(c=c.eval(b)),d&&(d=d.eval(b),d.root=!0),new a.Directive(this.name,c,d,this.index,this.currentFileInfo,this.debugInfo)},variable:function(b){return this.rules?a.Ruleset.prototype.variable.call(this.rules,b):void 0},find:function(){return this.rules?a.Ruleset.prototype.find.apply(this.rules,arguments):void 0},rulesets:function(){return this.rules?a.Ruleset.prototype.rulesets.apply(this.rules):void 0},markReferenced:function(){var a,b;if(this.isReferenced=!0,this.rules)for(b=this.rules.rules,a=0;a<b.length;a++)b[a].markReferenced&&b[a].markReferenced()}}}(c("../tree")),function(a){a.Element=function(b,c,d,e){this.combinator=b instanceof a.Combinator?b:new a.Combinator(b),this.value="string"==typeof c?c.trim():c?c:"",this.index=d,this.currentFileInfo=e},a.Element.prototype={type:"Element",accept:function(a){var b=this.value;this.combinator=a.visit(this.combinator),"object"==typeof b&&(this.value=a.visit(b))},eval:function(b){return new a.Element(this.combinator,this.value.eval?this.value.eval(b):this.value,this.index,this.currentFileInfo)},genCSS:function(a,b){b.add(this.toCSS(a),this.currentFileInfo,this.index)},toCSS:function(a){var b=this.value.toCSS?this.value.toCSS(a):this.value;return""===b&&"&"===this.combinator.value.charAt(0)?"":this.combinator.toCSS(a||{})+b}},a.Attribute=function(a,b,c){this.key=a,this.op=b,this.value=c},a.Attribute.prototype={type:"Attribute",eval:function(b){return new a.Attribute(this.key.eval?this.key.eval(b):this.key,this.op,this.value&&this.value.eval?this.value.eval(b):this.value)},genCSS:function(a,b){b.add(this.toCSS(a))},toCSS:function(a){var b=this.key.toCSS?this.key.toCSS(a):this.key;return this.op&&(b+=this.op,b+=this.value.toCSS?this.value.toCSS(a):this.value),"["+b+"]"}},a.Combinator=function(a){this.value=" "===a?" ":a?a.trim():""},a.Combinator.prototype={type:"Combinator",_noSpaceCombinators:{"":!0," ":!0,"|":!0},genCSS:function(a,b){var c=a.compress||this._noSpaceCombinators[this.value]?"":" ";b.add(c+this.value+c)},toCSS:a.toCSS}}(c("../tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={type:"Expression",accept:function(a){this.value&&(this.value=a.visitArray(this.value))},eval:function(b){var c,d=this.parens&&!this.parensInOp,e=!1;return d&&b.inParenthesis(),this.value.length>1?c=new a.Expression(this.value.map(function(a){return a.eval(b)})):1===this.value.length?(this.value[0].parens&&!this.value[0].parensInOp&&(e=!0),c=this.value[0].eval(b)):c=this,d&&b.outOfParenthesis(),this.parens&&this.parensInOp&&!b.isMathOn()&&!e&&(c=new a.Paren(c)),c},genCSS:function(a,b){for(var c=0;c<this.value.length;c++)this.value[c].genCSS(a,b),c+1<this.value.length&&b.add(" ")},toCSS:a.toCSS,throwAwayComments:function(){this.value=this.value.filter(function(b){return!(b instanceof a.Comment)})}}}(c("../tree")),function(a){a.Extend=function(b,c,d){switch(this.selector=b,this.option=c,this.index=d,this.object_id=a.Extend.next_id++,this.parent_ids=[this.object_id],c){case"all":this.allowBefore=!0,this.allowAfter=!0;break;default:this.allowBefore=!1,this.allowAfter=!1}},a.Extend.next_id=0,a.Extend.prototype={type:"Extend",accept:function(a){this.selector=a.visit(this.selector)},eval:function(b){return new a.Extend(this.selector.eval(b),this.option,this.index)},clone:function(){return new a.Extend(this.selector,this.option,this.index)},findSelfSelectors:function(a){var b,c,d=[];for(b=0;b<a.length;b++)c=a[b].elements,b>0&&c.length&&""===c[0].combinator.value&&(c[0].combinator.value=" "),d=d.concat(a[b].elements);this.selfSelectors=[{elements:d}]}}}(c("../tree")),function(a){a.Import=function(a,c,d,e,f){if(this.options=d,this.index=e,this.path=a,this.features=c,this.currentFileInfo=f,this.options.less!==b||this.options.inline)this.css=!this.options.less||this.options.inline;else{var g=this.getPath();g&&/css([\?;].*)?$/.test(g)&&(this.css=!0)}},a.Import.prototype={type:"Import",accept:function(a){this.features&&(this.features=a.visit(this.features)),this.path=a.visit(this.path),!this.options.inline&&this.root&&(this.root=a.visit(this.root))},genCSS:function(a,b){this.css&&(b.add("@import ",this.currentFileInfo,this.index),this.path.genCSS(a,b),this.features&&(b.add(" "),this.features.genCSS(a,b)),b.add(";"))},toCSS:a.toCSS,getPath:function(){if(this.path instanceof a.Quoted){var c=this.path.value;return this.css!==b||/(\.[a-z]*$)|([\?;].*)$/.test(c)?c:c+".less"}return this.path instanceof a.URL?this.path.value.value:null},evalForImport:function(b){return new a.Import(this.path.eval(b),this.features,this.options,this.index,this.currentFileInfo)},evalPath:function(b){var c=this.path.eval(b),d=this.currentFileInfo&&this.currentFileInfo.rootpath;if(!(c instanceof a.URL)){if(d){var e=c.value;e&&b.isPathRelative(e)&&(c.value=d+e)}c.value=b.normalizePath(c.value)}return c},eval:function(b){var c,d=this.features&&this.features.eval(b);if(this.skip&&("function"==typeof this.skip&&(this.skip=this.skip()),this.skip))return[];if(this.options.inline){var e=new a.Anonymous(this.root,0,{filename:this.importedFilename},!0,!0);return this.features?new a.Media([e],this.features.value):[e]}if(this.css){var f=new a.Import(this.evalPath(b),d,this.options,this.index);if(!f.css&&this.error)throw this.error;return f}return c=new a.Ruleset(null,this.root.rules.slice(0)),c.evalImports(b),this.features?new a.Media(c.rules,this.features.value):c.rules}}}(c("../tree")),function(a){a.JavaScript=function(a,b,c){this.escaped=c,this.expression=a,this.index=b},a.JavaScript.prototype={type:"JavaScript",eval:function(b){var c,d=this,e={},f=this.expression.replace(/@\{([\w-]+)\}/g,function(c,e){return a.jsify(new a.Variable("@"+e,d.index).eval(b))});try{f=new Function("return ("+f+")")}catch(g){throw{message:"JavaScript evaluation error: "+g.message+" from `"+f+"`",index:this.index}}var h=b.frames[0].variables();for(var i in h)h.hasOwnProperty(i)&&(e[i.slice(1)]={value:h[i].value,toJS:function(){return this.value.eval(b).toCSS()}});try{c=f.call(e)}catch(g){throw{message:"JavaScript evaluation error: '"+g.name+": "+g.message.replace(/["]/g,"'")+"'",index:this.index}}return"number"==typeof c?new a.Dimension(c):"string"==typeof c?new a.Quoted('"'+c+'"',c,this.escaped,this.index):new a.Anonymous(Array.isArray(c)?c.join(", "):c)}}}(c("../tree")),function(a){a.Keyword=function(a){this.value=a},a.Keyword.prototype={type:"Keyword",eval:function(){return this},genCSS:function(a,b){if("%"===this.value)throw{type:"Syntax",message:"Invalid % without number"};b.add(this.value)},toCSS:a.toCSS,compare:function(b){return b instanceof a.Keyword?b.value===this.value?0:1:-1}},a.True=new a.Keyword("true"),a.False=new a.Keyword("false")}(c("../tree")),function(a){a.Media=function(b,c,d,e){this.index=d,this.currentFileInfo=e;var f=this.emptySelectors();this.features=new a.Value(c),this.rules=[new a.Ruleset(f,b)],this.rules[0].allowImports=!0},a.Media.prototype={type:"Media",accept:function(a){this.features&&(this.features=a.visit(this.features)),this.rules&&(this.rules=a.visitArray(this.rules))},genCSS:function(b,c){c.add("@media ",this.currentFileInfo,this.index),this.features.genCSS(b,c),a.outputRuleset(b,c,this.rules)},toCSS:a.toCSS,eval:function(b){b.mediaBlocks||(b.mediaBlocks=[],b.mediaPath=[]);var c=new a.Media(null,[],this.index,this.currentFileInfo);this.debugInfo&&(this.rules[0].debugInfo=this.debugInfo,c.debugInfo=this.debugInfo);var d=!1;b.strictMath||(d=!0,b.strictMath=!0);try{c.features=this.features.eval(b)}finally{d&&(b.strictMath=!1)}return b.mediaPath.push(c),b.mediaBlocks.push(c),b.frames.unshift(this.rules[0]),c.rules=[this.rules[0].eval(b)],b.frames.shift(),b.mediaPath.pop(),0===b.mediaPath.length?c.evalTop(b):c.evalNested(b)},variable:function(b){return a.Ruleset.prototype.variable.call(this.rules[0],b)},find:function(){return a.Ruleset.prototype.find.apply(this.rules[0],arguments)},rulesets:function(){return a.Ruleset.prototype.rulesets.apply(this.rules[0])},emptySelectors:function(){var b=new a.Element("","&",this.index,this.currentFileInfo),c=[new a.Selector([b],null,null,this.index,this.currentFileInfo)];return c[0].mediaEmpty=!0,c},markReferenced:function(){var a,b=this.rules[0].rules;for(this.rules[0].markReferenced(),this.isReferenced=!0,a=0;a<b.length;a++)b[a].markReferenced&&b[a].markReferenced()},evalTop:function(b){var c=this;if(b.mediaBlocks.length>1){var d=this.emptySelectors();c=new a.Ruleset(d,b.mediaBlocks),c.multiMedia=!0}return delete b.mediaBlocks,delete b.mediaPath,c},evalNested:function(b){var c,d,e=b.mediaPath.concat([this]);for(c=0;c<e.length;c++)d=e[c].features instanceof a.Value?e[c].features.value:e[c].features,e[c]=Array.isArray(d)?d:[d];return this.features=new a.Value(this.permute(e).map(function(b){for(b=b.map(function(b){return b.toCSS?b:new a.Anonymous(b)}),c=b.length-1;c>0;c--)b.splice(c,0,new a.Anonymous("and"));return new a.Expression(b)})),new a.Ruleset([],[])},permute:function(a){if(0===a.length)return[];
if(1===a.length)return a[0];for(var b=[],c=this.permute(a.slice(1)),d=0;d<c.length;d++)for(var e=0;e<a[0].length;e++)b.push([a[0][e]].concat(c[d]));return b},bubbleSelectors:function(b){b&&(this.rules=[new a.Ruleset(b.slice(0),[this.rules[0]])])}}}(c("../tree")),function(a){a.mixin={},a.mixin.Call=function(b,c,d,e,f){this.selector=new a.Selector(b),this.arguments=c&&c.length?c:null,this.index=d,this.currentFileInfo=e,this.important=f},a.mixin.Call.prototype={type:"MixinCall",accept:function(a){this.selector&&(this.selector=a.visit(this.selector)),this.arguments&&(this.arguments=a.visitArray(this.arguments))},eval:function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[],q=!1,r=[],s=[],t=a.defaultFunc,u=0,v=1,w=2;for(e=this.arguments&&this.arguments.map(function(a){return{name:a.name,value:a.value.eval(b)}}),f=0;f<b.frames.length;f++)if((c=b.frames[f].find(this.selector)).length>0){for(j=!0,g=0;g<c.length;g++){for(d=c[g],i=!1,h=0;h<b.frames.length;h++)if(!(d instanceof a.mixin.Definition)&&d===(b.frames[h].originalRuleset||b.frames[h])){i=!0;break}if(!i&&d.matchArgs(e,b)){if(l={mixin:d,group:u},d.matchCondition){for(h=0;2>h;h++)t.value(h),s[h]=d.matchCondition(e,b);(s[0]||s[1])&&(s[0]!=s[1]&&(l.group=s[1]?v:w),r.push(l))}else r.push(l);q=!0}}for(t.reset(),n=[0,0,0],g=0;g<r.length;g++)n[r[g].group]++;if(n[u]>0)m=w;else if(m=v,n[v]+n[w]>1)throw{type:"Runtime",message:"Ambiguous use of `default()` found when matching for `"+this.format(e)+"`",index:this.index,filename:this.currentFileInfo.filename};for(g=0;g<r.length;g++)if(l=r[g].group,l===u||l===m)try{d=r[g].mixin,d instanceof a.mixin.Definition||(o=d.originalRuleset||d,d=new a.mixin.Definition("",[],d.rules,null,!1),d.originalRuleset=o),Array.prototype.push.apply(p,d.evalCall(b,e,this.important).rules)}catch(x){throw{message:x.message,index:this.index,filename:this.currentFileInfo.filename,stack:x.stack}}if(q){if(!this.currentFileInfo||!this.currentFileInfo.reference)for(f=0;f<p.length;f++)k=p[f],k.markReferenced&&k.markReferenced();return p}}throw j?{type:"Runtime",message:"No matching definition was found for `"+this.format(e)+"`",index:this.index,filename:this.currentFileInfo.filename}:{type:"Name",message:this.selector.toCSS().trim()+" is undefined",index:this.index,filename:this.currentFileInfo.filename}},format:function(a){return this.selector.toCSS().trim()+"("+(a?a.map(function(a){var b="";return a.name&&(b+=a.name+":"),b+=a.value.toCSS?a.value.toCSS():"???"}).join(", "):"")+")"}},a.mixin.Definition=function(b,c,d,e,f,g){this.name=b,this.selectors=[new a.Selector([new a.Element(null,b,this.index,this.currentFileInfo)])],this.params=c,this.condition=e,this.variadic=f,this.arity=c.length,this.rules=d,this._lookups={},this.required=c.reduce(function(a,b){return!b.name||b.name&&!b.value?a+1:a},0),this.parent=a.Ruleset.prototype,this.frames=g},a.mixin.Definition.prototype={type:"MixinDefinition",accept:function(a){this.params&&this.params.length&&(this.params=a.visitArray(this.params)),this.rules=a.visitArray(this.rules),this.condition&&(this.condition=a.visit(this.condition))},variable:function(a){return this.parent.variable.call(this,a)},variables:function(){return this.parent.variables.call(this)},find:function(){return this.parent.find.apply(this,arguments)},rulesets:function(){return this.parent.rulesets.apply(this)},evalParams:function(b,c,d,e){var f,g,h,i,j,k,l,m,n=new a.Ruleset(null,null),o=this.params.slice(0),p=0;if(c=new a.evalEnv(c,[n].concat(c.frames)),d)for(d=d.slice(0),p=d.length,h=0;p>h;h++)if(g=d[h],k=g&&g.name){for(l=!1,i=0;i<o.length;i++)if(!e[i]&&k===o[i].name){e[i]=g.value.eval(b),n.prependRule(new a.Rule(k,g.value.eval(b))),l=!0;break}if(l){d.splice(h,1),h--;continue}throw{type:"Runtime",message:"Named argument for "+this.name+" "+d[h].name+" not found"}}for(m=0,h=0;h<o.length;h++)if(!e[h]){if(g=d&&d[m],k=o[h].name)if(o[h].variadic){for(f=[],i=m;p>i;i++)f.push(d[i].value.eval(b));n.prependRule(new a.Rule(k,new a.Expression(f).eval(b)))}else{if(j=g&&g.value)j=j.eval(b);else{if(!o[h].value)throw{type:"Runtime",message:"wrong number of arguments for "+this.name+" ("+p+" for "+this.arity+")"};j=o[h].value.eval(c),n.resetCache()}n.prependRule(new a.Rule(k,j)),e[h]=j}if(o[h].variadic&&d)for(i=m;p>i;i++)e[i]=d[i].value.eval(b);m++}return n},eval:function(b){return new a.mixin.Definition(this.name,this.params,this.rules,this.condition,this.variadic,this.frames||b.frames.slice(0))},evalCall:function(b,c,d){var e,f,g=[],h=this.frames?this.frames.concat(b.frames):b.frames,i=this.evalParams(b,new a.evalEnv(b,h),c,g);return i.prependRule(new a.Rule("@arguments",new a.Expression(g).eval(b))),e=this.rules.slice(0),f=new a.Ruleset(null,e),f.originalRuleset=this,f=f.eval(new a.evalEnv(b,[this,i].concat(h))),d&&(f=this.parent.makeImportant.apply(f)),f},matchCondition:function(b,c){return this.condition&&!this.condition.eval(new a.evalEnv(c,[this.evalParams(c,new a.evalEnv(c,this.frames?this.frames.concat(c.frames):c.frames),b,[])].concat(this.frames).concat(c.frames)))?!1:!0},matchArgs:function(a,b){var c,d=a&&a.length||0;if(this.variadic){if(d<this.required-1)return!1}else{if(d<this.required)return!1;if(d>this.params.length)return!1}c=Math.min(d,this.arity);for(var e=0;c>e;e++)if(!this.params[e].name&&!this.params[e].variadic&&a[e].value.eval(b).toCSS()!=this.params[e].value.eval(b).toCSS())return!1;return!0}}}(c("../tree")),function(a){a.Negative=function(a){this.value=a},a.Negative.prototype={type:"Negative",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("-"),this.value.genCSS(a,b)},toCSS:a.toCSS,eval:function(b){return b.isMathOn()?new a.Operation("*",[new a.Dimension(-1),this.value]).eval(b):new a.Negative(this.value.eval(b))}}}(c("../tree")),function(a){a.Operation=function(a,b,c){this.op=a.trim(),this.operands=b,this.isSpaced=c},a.Operation.prototype={type:"Operation",accept:function(a){this.operands=a.visit(this.operands)},eval:function(b){var c=this.operands[0].eval(b),d=this.operands[1].eval(b);if(b.isMathOn()){if(c instanceof a.Dimension&&d instanceof a.Color&&(c=c.toColor()),d instanceof a.Dimension&&c instanceof a.Color&&(d=d.toColor()),!c.operate)throw{type:"Operation",message:"Operation on an invalid type"};return c.operate(b,this.op,d)}return new a.Operation(this.op,[c,d],this.isSpaced)},genCSS:function(a,b){this.operands[0].genCSS(a,b),this.isSpaced&&b.add(" "),b.add(this.op),this.isSpaced&&b.add(" "),this.operands[1].genCSS(a,b)},toCSS:a.toCSS},a.operate=function(a,b,c,d){switch(b){case"+":return c+d;case"-":return c-d;case"*":return c*d;case"/":return c/d}}}(c("../tree")),function(a){a.Paren=function(a){this.value=a},a.Paren.prototype={type:"Paren",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("("),this.value.genCSS(a,b),b.add(")")},toCSS:a.toCSS,eval:function(b){return new a.Paren(this.value.eval(b))}}}(c("../tree")),function(a){a.Quoted=function(a,b,c,d,e){this.escaped=c,this.value=b||"",this.quote=a.charAt(0),this.index=d,this.currentFileInfo=e},a.Quoted.prototype={type:"Quoted",genCSS:function(a,b){this.escaped||b.add(this.quote,this.currentFileInfo,this.index),b.add(this.value),this.escaped||b.add(this.quote)},toCSS:a.toCSS,eval:function(b){var c=this,d=this.value.replace(/`([^`]+)`/g,function(d,e){return new a.JavaScript(e,c.index,!0).eval(b).value}).replace(/@\{([\w-]+)\}/g,function(d,e){var f=new a.Variable("@"+e,c.index,c.currentFileInfo).eval(b,!0);return f instanceof a.Quoted?f.value:f.toCSS()});return new a.Quoted(this.quote+d+this.quote,d,this.escaped,this.index,this.currentFileInfo)},compare:function(a){if(!a.toCSS)return-1;var b,c;return"Quoted"!==a.type||this.escaped||a.escaped?(b=this.toCSS(),c=a.toCSS()):(b=a.value,c=this.value),b===c?0:c>b?-1:1}}}(c("../tree")),function(a){function c(a,b){var c,d="",e=b.length,f={add:function(a){d+=a}};for(c=0;e>c;c++)b[c].eval(a).genCSS(a,f);return d}a.Rule=function(c,d,e,f,g,h,i,j){this.name=c,this.value=d instanceof a.Value||d instanceof a.Ruleset?d:new a.Value([d]),this.important=e?" "+e.trim():"",this.merge=f,this.index=g,this.currentFileInfo=h,this.inline=i||!1,this.variable=j!==b?j:c.charAt&&"@"===c.charAt(0)},a.Rule.prototype={type:"Rule",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add(this.name+(a.compress?":":": "),this.currentFileInfo,this.index);try{this.value.genCSS(a,b)}catch(c){throw c.index=this.index,c.filename=this.currentFileInfo.filename,c}b.add(this.important+(this.inline||a.lastRule&&a.compress?"":";"),this.currentFileInfo,this.index)},toCSS:a.toCSS,eval:function(b){var d,e=!1,f=this.name,g=this.variable;"string"!=typeof f&&(f=1===f.length&&f[0]instanceof a.Keyword?f[0].value:c(b,f),g=!1),"font"!==f||b.strictMath||(e=!0,b.strictMath=!0);try{if(d=this.value.eval(b),!this.variable&&"DetachedRuleset"===d.type)throw{message:"Rulesets cannot be evaluated on a property.",index:this.index,filename:this.currentFileInfo.filename};return new a.Rule(f,d,this.important,this.merge,this.index,this.currentFileInfo,this.inline,g)}catch(h){throw"number"!=typeof h.index&&(h.index=this.index,h.filename=this.currentFileInfo.filename),h}finally{e&&(b.strictMath=!1)}},makeImportant:function(){return new a.Rule(this.name,this.value,"!important",this.merge,this.index,this.currentFileInfo,this.inline)}}}(c("../tree")),function(a){a.RulesetCall=function(a){this.variable=a},a.RulesetCall.prototype={type:"RulesetCall",accept:function(){},eval:function(b){var c=new a.Variable(this.variable).eval(b);return c.callEval(b)}}}(c("../tree")),function(a){a.Ruleset=function(a,b,c){this.selectors=a,this.rules=b,this._lookups={},this.strictImports=c},a.Ruleset.prototype={type:"Ruleset",accept:function(a){this.paths?a.visitArray(this.paths,!0):this.selectors&&(this.selectors=a.visitArray(this.selectors)),this.rules&&this.rules.length&&(this.rules=a.visitArray(this.rules))},eval:function(b){var c,d,e,f,g=this.selectors,h=a.defaultFunc,i=!1;if(g&&(d=g.length)){for(c=[],h.error({type:"Syntax",message:"it is currently only allowed in parametric mixin guards,"}),f=0;d>f;f++)e=g[f].eval(b),c.push(e),e.evaldCondition&&(i=!0);h.reset()}else i=!0;var j,k,l=this.rules?this.rules.slice(0):null,m=new a.Ruleset(c,l,this.strictImports);m.originalRuleset=this,m.root=this.root,m.firstRoot=this.firstRoot,m.allowImports=this.allowImports,this.debugInfo&&(m.debugInfo=this.debugInfo),i||(l.length=0);var n=b.frames;n.unshift(m);var o=b.selectors;o||(b.selectors=o=[]),o.unshift(this.selectors),(m.root||m.allowImports||!m.strictImports)&&m.evalImports(b);var p=m.rules,q=p?p.length:0;for(f=0;q>f;f++)(p[f]instanceof a.mixin.Definition||p[f]instanceof a.DetachedRuleset)&&(p[f]=p[f].eval(b));var r=b.mediaBlocks&&b.mediaBlocks.length||0;for(f=0;q>f;f++)p[f]instanceof a.mixin.Call?(l=p[f].eval(b).filter(function(b){return b instanceof a.Rule&&b.variable?!m.variable(b.name):!0}),p.splice.apply(p,[f,1].concat(l)),q+=l.length-1,f+=l.length-1,m.resetCache()):p[f]instanceof a.RulesetCall&&(l=p[f].eval(b).rules.filter(function(b){return b instanceof a.Rule&&b.variable?!1:!0}),p.splice.apply(p,[f,1].concat(l)),q+=l.length-1,f+=l.length-1,m.resetCache());for(f=0;f<p.length;f++)j=p[f],j instanceof a.mixin.Definition||j instanceof a.DetachedRuleset||(p[f]=j=j.eval?j.eval(b):j);for(f=0;f<p.length;f++)if(j=p[f],j instanceof a.Ruleset&&j.selectors&&1===j.selectors.length&&j.selectors[0].isJustParentSelector()){p.splice(f--,1);for(var s=0;s<j.rules.length;s++)k=j.rules[s],k instanceof a.Rule&&k.variable||p.splice(++f,0,k)}if(n.shift(),o.shift(),b.mediaBlocks)for(f=r;f<b.mediaBlocks.length;f++)b.mediaBlocks[f].bubbleSelectors(c);return m},evalImports:function(b){var c,d,e=this.rules;if(e)for(c=0;c<e.length;c++)e[c]instanceof a.Import&&(d=e[c].eval(b),d&&d.length?(e.splice.apply(e,[c,1].concat(d)),c+=d.length-1):e.splice(c,1,d),this.resetCache())},makeImportant:function(){return new a.Ruleset(this.selectors,this.rules.map(function(a){return a.makeImportant?a.makeImportant():a}),this.strictImports)},matchArgs:function(a){return!a||0===a.length},matchCondition:function(b,c){var d=this.selectors[this.selectors.length-1];return d.evaldCondition?d.condition&&!d.condition.eval(new a.evalEnv(c,c.frames))?!1:!0:!1},resetCache:function(){this._rulesets=null,this._variables=null,this._lookups={}},variables:function(){return this._variables||(this._variables=this.rules?this.rules.reduce(function(b,c){return c instanceof a.Rule&&c.variable===!0&&(b[c.name]=c),b},{}):{}),this._variables},variable:function(a){return this.variables()[a]},rulesets:function(){if(!this.rules)return null;var b,c,d=a.Ruleset,e=a.mixin.Definition,f=[],g=this.rules,h=g.length;for(b=0;h>b;b++)c=g[b],(c instanceof d||c instanceof e)&&f.push(c);return f},prependRule:function(a){var b=this.rules;b?b.unshift(a):this.rules=[a]},find:function(b,c){c=c||this;var d,e=[],f=b.toCSS();return f in this._lookups?this._lookups[f]:(this.rulesets().forEach(function(f){if(f!==c)for(var g=0;g<f.selectors.length;g++)if(d=b.match(f.selectors[g])){b.elements.length>d?Array.prototype.push.apply(e,f.find(new a.Selector(b.elements.slice(d)),c)):e.push(f);break}}),this._lookups[f]=e,e)},genCSS:function(b,c){function d(b,c){return b.rules?!0:b instanceof a.Media||c&&b instanceof a.Comment?!0:b instanceof a.Directive||b instanceof a.Anonymous?b.isRulesetLike():!1}var e,f,g,h,i,j,k=[],l=[],m=[];b.tabLevel=b.tabLevel||0,this.root||b.tabLevel++;var n,o=b.compress?"":Array(b.tabLevel+1).join("  "),p=b.compress?"":Array(b.tabLevel).join("  ");for(e=0;e<this.rules.length;e++)i=this.rules[e],d(i,this.root)?m.push(i):i.isCharset&&i.isCharset()?k.push(i):l.push(i);if(l=k.concat(l),!this.root){h=a.debugInfo(b,this,p),h&&(c.add(h),c.add(p));var q,r=this.paths,s=r.length;for(n=b.compress?",":",\n"+p,e=0;s>e;e++)if(j=r[e],q=j.length)for(e>0&&c.add(n),b.firstSelector=!0,j[0].genCSS(b,c),b.firstSelector=!1,f=1;q>f;f++)j[f].genCSS(b,c);c.add((b.compress?"{":" {\n")+o)}for(e=0;e<l.length;e++)i=l[e],e+1!==l.length||this.root&&0!==m.length&&!this.firstRoot||(b.lastRule=!0),i.genCSS?i.genCSS(b,c):i.value&&c.add(i.value.toString()),b.lastRule?b.lastRule=!1:c.add(b.compress?"":"\n"+o);if(this.root||(c.add(b.compress?"}":"\n"+p+"}"),b.tabLevel--),n=(b.compress?"":"\n")+(this.root?o:p),g=m.length)for(l.length&&n&&c.add(n),m[0].genCSS(b,c),e=1;g>e;e++)n&&c.add(n),m[e].genCSS(b,c);c.isEmpty()||b.compress||!this.firstRoot||c.add("\n")},toCSS:a.toCSS,markReferenced:function(){if(this.selectors)for(var a=0;a<this.selectors.length;a++)this.selectors[a].markReferenced()},joinSelectors:function(a,b,c){for(var d=0;d<c.length;d++)this.joinSelector(a,b,c[d])},joinSelector:function(b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;for(e=0;e<d.elements.length;e++)j=d.elements[e],"&"===j.value&&(h=!0);if(h){for(r=[],i=[[]],e=0;e<d.elements.length;e++)if(j=d.elements[e],"&"!==j.value)r.push(j);else{for(s=[],r.length>0&&this.mergeElementsOnToSelectors(r,i),f=0;f<i.length;f++)if(k=i[f],0===c.length)k.length>0&&(k[0].elements=k[0].elements.slice(0),k[0].elements.push(new a.Element(j.combinator,"",j.index,j.currentFileInfo))),s.push(k);else for(g=0;g<c.length;g++)l=c[g],m=[],n=[],p=!0,k.length>0?(m=k.slice(0),q=m.pop(),o=d.createDerived(q.elements.slice(0)),p=!1):o=d.createDerived([]),l.length>1&&(n=n.concat(l.slice(1))),l.length>0&&(p=!1,o.elements.push(new a.Element(j.combinator,l[0].elements[0].value,j.index,j.currentFileInfo)),o.elements=o.elements.concat(l[0].elements.slice(1))),p||m.push(o),m=m.concat(n),s.push(m);i=s,r=[]}for(r.length>0&&this.mergeElementsOnToSelectors(r,i),e=0;e<i.length;e++)i[e].length>0&&b.push(i[e])}else if(c.length>0)for(e=0;e<c.length;e++)b.push(c[e].concat(d));else b.push([d])},mergeElementsOnToSelectors:function(b,c){var d,e;if(0===c.length)return void c.push([new a.Selector(b)]);for(d=0;d<c.length;d++)e=c[d],e.length>0?e[e.length-1]=e[e.length-1].createDerived(e[e.length-1].elements.concat(b)):e.push(new a.Selector(b))}}}(c("../tree")),function(a){a.Selector=function(a,b,c,d,e,f){this.elements=a,this.extendList=b,this.condition=c,this.currentFileInfo=e||{},this.isReferenced=f,c||(this.evaldCondition=!0)},a.Selector.prototype={type:"Selector",accept:function(a){this.elements&&(this.elements=a.visitArray(this.elements)),this.extendList&&(this.extendList=a.visitArray(this.extendList)),this.condition&&(this.condition=a.visit(this.condition))},createDerived:function(b,c,d){d=null!=d?d:this.evaldCondition;var e=new a.Selector(b,c||this.extendList,null,this.index,this.currentFileInfo,this.isReferenced);return e.evaldCondition=d,e.mediaEmpty=this.mediaEmpty,e},match:function(a){var b,c,d=this.elements,e=d.length;if(a.CacheElements(),b=a._elements.length,0===b||b>e)return 0;for(c=0;b>c;c++)if(d[c].value!==a._elements[c])return 0;return b},CacheElements:function(){var a,b,c,d="";if(!this._elements){for(a=this.elements.length,c=0;a>c;c++)if(b=this.elements[c],d+=b.combinator.value,b.value.value){if("string"!=typeof b.value.value){d="";break}d+=b.value.value}else d+=b.value;this._elements=d.match(/[,&#\*\.\w-]([\w-]|(\\.))*/g),this._elements?"&"===this._elements[0]&&this._elements.shift():this._elements=[]}},isJustParentSelector:function(){return!this.mediaEmpty&&1===this.elements.length&&"&"===this.elements[0].value&&(" "===this.elements[0].combinator.value||""===this.elements[0].combinator.value)},eval:function(a){var b=this.condition&&this.condition.eval(a),c=this.elements,d=this.extendList;return c=c&&c.map(function(b){return b.eval(a)}),d=d&&d.map(function(b){return b.eval(a)}),this.createDerived(c,d,b)},genCSS:function(a,b){var c,d;if(a&&a.firstSelector||""!==this.elements[0].combinator.value||b.add(" ",this.currentFileInfo,this.index),!this._css)for(c=0;c<this.elements.length;c++)d=this.elements[c],d.genCSS(a,b)},toCSS:a.toCSS,markReferenced:function(){this.isReferenced=!0},getIsReferenced:function(){return!this.currentFileInfo.reference||this.isReferenced},getIsOutput:function(){return this.evaldCondition}}}(c("../tree")),function(a){a.UnicodeDescriptor=function(a){this.value=a},a.UnicodeDescriptor.prototype={type:"UnicodeDescriptor",genCSS:function(a,b){b.add(this.value)},toCSS:a.toCSS,eval:function(){return this}}}(c("../tree")),function(a){a.URL=function(a,b,c){this.value=a,this.currentFileInfo=b,this.isEvald=c},a.URL.prototype={type:"Url",accept:function(a){this.value=a.visit(this.value)},genCSS:function(a,b){b.add("url("),this.value.genCSS(a,b),b.add(")")},toCSS:a.toCSS,eval:function(b){var c,d=this.value.eval(b);if(!this.isEvald&&(c=this.currentFileInfo&&this.currentFileInfo.rootpath,c&&"string"==typeof d.value&&b.isPathRelative(d.value)&&(d.quote||(c=c.replace(/[\(\)'"\s]/g,function(a){return"\\"+a})),d.value=c+d.value),d.value=b.normalizePath(d.value),b.urlArgs&&!d.value.match(/^\s*data:/))){var e=-1===d.value.indexOf("?")?"?":"&",f=e+b.urlArgs;-1!==d.value.indexOf("#")?d.value=d.value.replace("#",f+"#"):d.value+=f}return new a.URL(d,this.currentFileInfo,!0)}}}(c("../tree")),function(a){a.Value=function(a){this.value=a},a.Value.prototype={type:"Value",accept:function(a){this.value&&(this.value=a.visitArray(this.value))},eval:function(b){return 1===this.value.length?this.value[0].eval(b):new a.Value(this.value.map(function(a){return a.eval(b)}))},genCSS:function(a,b){var c;for(c=0;c<this.value.length;c++)this.value[c].genCSS(a,b),c+1<this.value.length&&b.add(a&&a.compress?",":", ")},toCSS:a.toCSS}}(c("../tree")),function(a){a.Variable=function(a,b,c){this.name=a,this.index=b,this.currentFileInfo=c||{}},a.Variable.prototype={type:"Variable",eval:function(b){var c,d=this.name;if(0===d.indexOf("@@")&&(d="@"+new a.Variable(d.slice(1)).eval(b).value),this.evaluating)throw{type:"Name",message:"Recursive variable definition for "+d,filename:this.currentFileInfo.file,index:this.index};if(this.evaluating=!0,c=a.find(b.frames,function(a){var c=a.variable(d);return c?c.value.eval(b):void 0}))return this.evaluating=!1,c;throw{type:"Name",message:"variable "+d+" is undefined",filename:this.currentFileInfo.filename,index:this.index}}}}(c("../tree")),function(a){var b=["paths","optimization","files","contents","contentsIgnoredChars","relativeUrls","rootpath","strictImports","insecure","dumpLineNumbers","compress","processImports","syncImport","javascriptEnabled","mime","useFileCache","currentFileInfo"];a.parseEnv=function(a){if(d(a,this,b),this.contents||(this.contents={}),this.contentsIgnoredChars||(this.contentsIgnoredChars={}),this.files||(this.files={}),"string"==typeof this.paths&&(this.paths=[this.paths]),!this.currentFileInfo){var c=a&&a.filename||"input",e=c.replace(/[^\/\\]*$/,"");a&&(a.filename=null),this.currentFileInfo={filename:c,relativeUrls:this.relativeUrls,rootpath:a&&a.rootpath||"",currentDirectory:e,entryPath:e,rootFilename:c}}};var c=["silent","verbose","compress","yuicompress","ieCompat","strictMath","strictUnits","cleancss","sourceMap","importMultiple","urlArgs"];a.evalEnv=function(a,b){d(a,this,c),this.frames=b||[]},a.evalEnv.prototype.inParenthesis=function(){this.parensStack||(this.parensStack=[]),this.parensStack.push(!0)},a.evalEnv.prototype.outOfParenthesis=function(){this.parensStack.pop()},a.evalEnv.prototype.isMathOn=function(){return this.strictMath?this.parensStack&&this.parensStack.length:!0},a.evalEnv.prototype.isPathRelative=function(a){return!/^(?:[a-z-]+:|\/)/.test(a)},a.evalEnv.prototype.normalizePath=function(a){var b,c=a.split("/").reverse();for(a=[];0!==c.length;)switch(b=c.pop()){case".":break;case"..":0===a.length||".."===a[a.length-1]?a.push(b):a.pop();break;default:a.push(b)}return a.join("/")};var d=function(a,b,c){if(a)for(var d=0;d<c.length;d++)a.hasOwnProperty(c[d])&&(b[c[d]]=a[c[d]])}}(c("./tree")),function(a){function b(a){return a}function c(a,b){var d,e;for(d in a)if(a.hasOwnProperty(d))switch(e=a[d],typeof e){case"function":e.prototype&&e.prototype.type&&(e.prototype.typeIndex=b++);break;case"object":b=c(e,b)}return b}var d={visitDeeper:!0},e=!1;a.visitor=function(b){this._implementation=b,this._visitFnCache=[],e||(c(a,1),e=!0)},a.visitor.prototype={visit:function(a){if(!a)return a;var c=a.typeIndex;if(!c)return a;var e,f=this._visitFnCache,g=this._implementation,h=c<<1,i=1|h,j=f[h],k=f[i],l=d;if(l.visitDeeper=!0,j||(e="visit"+a.type,j=g[e]||b,k=g[e+"Out"]||b,f[h]=j,f[i]=k),j!==b){var m=j.call(g,a,l);g.isReplacing&&(a=m)}return l.visitDeeper&&a&&a.accept&&a.accept(this),k!=b&&k.call(g,a),a},visitArray:function(a,b){if(!a)return a;var c,d=a.length;if(b||!this._implementation.isReplacing){for(c=0;d>c;c++)this.visit(a[c]);return a}var e=[];for(c=0;d>c;c++){var f=this.visit(a[c]);f.splice?f.length&&this.flatten(f,e):e.push(f)}return e},flatten:function(a,b){b||(b=[]);var c,d,e,f,g,h;for(d=0,c=a.length;c>d;d++)if(e=a[d],e.splice)for(g=0,f=e.length;f>g;g++)h=e[g],h.splice?h.length&&this.flatten(h,b):b.push(h);else b.push(e);return b}}}(c("./tree")),function(a){a.importVisitor=function(b,c,d,e,f){if(this._visitor=new a.visitor(this),this._importer=b,this._finish=c,this.env=d||new a.evalEnv,this.importCount=0,this.onceFileDetectionMap=e||{},this.recursionDetector={},f)for(var g in f)f.hasOwnProperty(g)&&(this.recursionDetector[g]=!0)},a.importVisitor.prototype={isReplacing:!0,run:function(a){var b;try{this._visitor.visit(a)}catch(c){b=c}this.isFinished=!0,0===this.importCount&&this._finish(b)},visitImport:function(b,c){var d,e=this,f=b.options.inline;if(!b.css||f){try{d=b.evalForImport(this.env)}catch(g){g.filename||(g.index=b.index,g.filename=b.currentFileInfo.filename),b.css=!0,b.error=g}if(d&&(!d.css||f)){b=d,this.importCount++;var h=new a.evalEnv(this.env,this.env.frames.slice(0));b.options.multiple&&(h.importMultiple=!0),this._importer.push(b.getPath(),b.currentFileInfo,b.options,function(c,d,g,i){c&&!c.filename&&(c.index=b.index,c.filename=b.currentFileInfo.filename);var j=g||i in e.recursionDetector;h.importMultiple||(b.skip=j?!0:function(){return i in e.onceFileDetectionMap?!0:(e.onceFileDetectionMap[i]=!0,!1)});var k=function(a){e.importCount--,0===e.importCount&&e.isFinished&&e._finish(a)};return!d||(b.root=d,b.importedFilename=i,f||!h.importMultiple&&j)?void k():(e.recursionDetector[i]=!0,void new a.importVisitor(e._importer,k,h,e.onceFileDetectionMap,e.recursionDetector).run(d))})}}return c.visitDeeper=!1,b},visitRule:function(a,b){return b.visitDeeper=!1,a},visitDirective:function(a){return this.env.frames.unshift(a),a},visitDirectiveOut:function(){this.env.frames.shift()},visitMixinDefinition:function(a){return this.env.frames.unshift(a),a},visitMixinDefinitionOut:function(){this.env.frames.shift()},visitRuleset:function(a){return this.env.frames.unshift(a),a},visitRulesetOut:function(){this.env.frames.shift()},visitMedia:function(a){return this.env.frames.unshift(a.rules[0]),a},visitMediaOut:function(){this.env.frames.shift()}}}(c("./tree")),function(a){a.joinSelectorVisitor=function(){this.contexts=[[]],this._visitor=new a.visitor(this)},a.joinSelectorVisitor.prototype={run:function(a){return this._visitor.visit(a)},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){var b,c=this.contexts[this.contexts.length-1],d=[];this.contexts.push(d),a.root||(b=a.selectors,b&&(b=b.filter(function(a){return a.getIsOutput()}),a.selectors=b.length?b:b=null,b&&a.joinSelectors(d,c,b)),b||(a.rules=null),a.paths=d)},visitRulesetOut:function(){this.contexts.length=this.contexts.length-1},visitMedia:function(a){var b=this.contexts[this.contexts.length-1];a.rules[0].root=0===b.length||b[0].multiMedia}}}(c("./tree")),function(a){a.toCSSVisitor=function(b){this._visitor=new a.visitor(this),this._env=b},a.toCSSVisitor.prototype={isReplacing:!0,run:function(a){return this._visitor.visit(a)},visitRule:function(a){return a.variable?[]:a},visitMixinDefinition:function(a){return a.frames=[],[]},visitExtend:function(){return[]},visitComment:function(a){return a.isSilent(this._env)?[]:a},visitMedia:function(a,b){return a.accept(this._visitor),b.visitDeeper=!1,a.rules.length?a:[]},visitDirective:function(b){if(b.currentFileInfo.reference&&!b.isReferenced)return[];if("@charset"===b.name){if(this.charset){if(b.debugInfo){var c=new a.Comment("/* "+b.toCSS(this._env).replace(/\n/g,"")+" */\n");return c.debugInfo=b.debugInfo,this._visitor.visit(c)}return[]}this.charset=!0}return b.rules&&b.rules.rules&&this._mergeRules(b.rules.rules),b},checkPropertiesInRoot:function(b){for(var c,d=0;d<b.length;d++)if(c=b[d],c instanceof a.Rule&&!c.variable)throw{message:"properties must be inside selector blocks, they cannot be in the root.",index:c.index,filename:c.currentFileInfo?c.currentFileInfo.filename:null}},visitRuleset:function(b,c){var d,e=[];if(b.firstRoot&&this.checkPropertiesInRoot(b.rules),b.root)b.accept(this._visitor),c.visitDeeper=!1,(b.firstRoot||b.rules&&b.rules.length>0)&&e.splice(0,0,b);else{b.paths&&(b.paths=b.paths.filter(function(b){var c;for(" "===b[0].elements[0].combinator.value&&(b[0].elements[0].combinator=new a.Combinator("")),c=0;c<b.length;c++)if(b[c].getIsReferenced()&&b[c].getIsOutput())return!0;return!1}));for(var f=b.rules,g=f?f.length:0,h=0;g>h;)d=f[h],d&&d.rules?(e.push(this._visitor.visit(d)),f.splice(h,1),g--):h++;g>0?b.accept(this._visitor):b.rules=null,c.visitDeeper=!1,f=b.rules,f&&(this._mergeRules(f),f=b.rules),f&&(this._removeDuplicateRules(f),f=b.rules),f&&f.length>0&&b.paths.length>0&&e.splice(0,0,b)}return 1===e.length?e[0]:e},_removeDuplicateRules:function(b){if(b){var c,d,e,f={};for(e=b.length-1;e>=0;e--)if(d=b[e],d instanceof a.Rule)if(f[d.name]){c=f[d.name],c instanceof a.Rule&&(c=f[d.name]=[f[d.name].toCSS(this._env)]);var g=d.toCSS(this._env);-1!==c.indexOf(g)?b.splice(e,1):c.push(g)}else f[d.name]=d}},_mergeRules:function(b){if(b){for(var c,d,e,f={},g=0;g<b.length;g++)d=b[g],d instanceof a.Rule&&d.merge&&(e=[d.name,d.important?"!":""].join(","),f[e]?b.splice(g--,1):f[e]=[],f[e].push(d));Object.keys(f).map(function(b){function e(b){return new a.Expression(b.map(function(a){return a.value}))}function g(b){return new a.Value(b.map(function(a){return a}))}if(c=f[b],c.length>1){d=c[0];var h=[],i=[];c.map(function(a){"+"===a.merge&&(i.length>0&&h.push(e(i)),i=[]),i.push(a)}),h.push(e(i)),d.value=g(h)}})}}}}(c("./tree")),function(a){a.extendFinderVisitor=function(){this._visitor=new a.visitor(this),this.contexts=[],this.allExtendsStack=[[]]},a.extendFinderVisitor.prototype={run:function(a){return a=this._visitor.visit(a),a.allExtends=this.allExtendsStack[0],a},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitRuleset:function(b){if(!b.root){var c,d,e,f,g=[],h=b.rules,i=h?h.length:0;for(c=0;i>c;c++)b.rules[c]instanceof a.Extend&&(g.push(h[c]),b.extendOnEveryPath=!0);var j=b.paths;for(c=0;c<j.length;c++){var k=j[c],l=k[k.length-1],m=l.extendList;for(f=m?m.slice(0).concat(g):g,f&&(f=f.map(function(a){return a.clone()})),d=0;d<f.length;d++)this.foundExtends=!0,e=f[d],e.findSelfSelectors(k),e.ruleset=b,0===d&&(e.firstExtendOnThisSelectorPath=!0),this.allExtendsStack[this.allExtendsStack.length-1].push(e)}this.contexts.push(b.selectors)}},visitRulesetOut:function(a){a.root||(this.contexts.length=this.contexts.length-1)},visitMedia:function(a){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){a.allExtends=[],this.allExtendsStack.push(a.allExtends)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}},a.processExtendsVisitor=function(){this._visitor=new a.visitor(this)},a.processExtendsVisitor.prototype={run:function(b){var c=new a.extendFinderVisitor;return c.run(b),c.foundExtends?(b.allExtends=b.allExtends.concat(this.doExtendChaining(b.allExtends,b.allExtends)),this.allExtendsStack=[b.allExtends],this._visitor.visit(b)):b},doExtendChaining:function(b,c,d){var e,f,g,h,i,j,k,l,m=[],n=this;for(d=d||0,e=0;e<b.length;e++)for(f=0;f<c.length;f++)j=b[e],k=c[f],j.parent_ids.indexOf(k.object_id)>=0||(i=[k.selfSelectors[0]],g=n.findMatch(j,i),g.length&&j.selfSelectors.forEach(function(b){h=n.extendSelector(g,i,b),l=new a.Extend(k.selector,k.option,0),l.selfSelectors=h,h[h.length-1].extendList=[l],m.push(l),l.ruleset=k.ruleset,l.parent_ids=l.parent_ids.concat(k.parent_ids,j.parent_ids),k.firstExtendOnThisSelectorPath&&(l.firstExtendOnThisSelectorPath=!0,k.ruleset.paths.push(h))}));if(m.length){if(this.extendChainCount++,d>100){var o="{unable to calculate}",p="{unable to calculate}";try{o=m[0].selfSelectors[0].toCSS(),p=m[0].selector.toCSS()}catch(q){}throw{message:"extend circular reference detected. One of the circular extends is currently:"+o+":extend("+p+")"}}return m.concat(n.doExtendChaining(m,c,d+1))}return m},visitRule:function(a,b){b.visitDeeper=!1},visitMixinDefinition:function(a,b){b.visitDeeper=!1},visitSelector:function(a,b){b.visitDeeper=!1},visitRuleset:function(a){if(!a.root){var b,c,d,e,f=this.allExtendsStack[this.allExtendsStack.length-1],g=[],h=this;for(d=0;d<f.length;d++)for(c=0;c<a.paths.length;c++)if(e=a.paths[c],!a.extendOnEveryPath){var i=e[e.length-1].extendList;i&&i.length||(b=this.findMatch(f[d],e),b.length&&f[d].selfSelectors.forEach(function(a){g.push(h.extendSelector(b,e,a))}))}a.paths=a.paths.concat(g)}},findMatch:function(a,b){var c,d,e,f,g,h,i,j=this,k=a.selector.elements,l=[],m=[];for(c=0;c<b.length;c++)for(d=b[c],e=0;e<d.elements.length;e++)for(f=d.elements[e],(a.allowBefore||0===c&&0===e)&&l.push({pathIndex:c,index:e,matched:0,initialCombinator:f.combinator}),h=0;h<l.length;h++)i=l[h],g=f.combinator.value,""===g&&0===e&&(g=" "),!j.isElementValuesEqual(k[i.matched].value,f.value)||i.matched>0&&k[i.matched].combinator.value!==g?i=null:i.matched++,i&&(i.finished=i.matched===k.length,i.finished&&!a.allowAfter&&(e+1<d.elements.length||c+1<b.length)&&(i=null)),i?i.finished&&(i.length=k.length,i.endPathIndex=c,i.endPathElementIndex=e+1,l.length=0,m.push(i)):(l.splice(h,1),h--);return m},isElementValuesEqual:function(b,c){if("string"==typeof b||"string"==typeof c)return b===c;if(b instanceof a.Attribute)return b.op!==c.op||b.key!==c.key?!1:b.value&&c.value?(b=b.value.value||b.value,c=c.value.value||c.value,b===c):b.value||c.value?!1:!0;
if(b=b.value,c=c.value,b instanceof a.Selector){if(!(c instanceof a.Selector)||b.elements.length!==c.elements.length)return!1;for(var d=0;d<b.elements.length;d++){if(b.elements[d].combinator.value!==c.elements[d].combinator.value&&(0!==d||(b.elements[d].combinator.value||" ")!==(c.elements[d].combinator.value||" ")))return!1;if(!this.isElementValuesEqual(b.elements[d].value,c.elements[d].value))return!1}return!0}return!1},extendSelector:function(b,c,d){var e,f,g,h,i,j=0,k=0,l=[];for(e=0;e<b.length;e++)h=b[e],f=c[h.pathIndex],g=new a.Element(h.initialCombinator,d.elements[0].value,d.elements[0].index,d.elements[0].currentFileInfo),h.pathIndex>j&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(c[j].elements.slice(k)),k=0,j++),i=f.elements.slice(k,h.index).concat([g]).concat(d.elements.slice(1)),j===h.pathIndex&&e>0?l[l.length-1].elements=l[l.length-1].elements.concat(i):(l=l.concat(c.slice(j,h.pathIndex)),l.push(new a.Selector(i))),j=h.endPathIndex,k=h.endPathElementIndex,k>=c[j].elements.length&&(k=0,j++);return j<c.length&&k>0&&(l[l.length-1].elements=l[l.length-1].elements.concat(c[j].elements.slice(k)),j++),l=l.concat(c.slice(j,c.length))},visitRulesetOut:function(){},visitMedia:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitMediaOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1},visitDirective:function(a){var b=a.allExtends.concat(this.allExtendsStack[this.allExtendsStack.length-1]);b=b.concat(this.doExtendChaining(b,a.allExtends)),this.allExtendsStack.push(b)},visitDirectiveOut:function(){this.allExtendsStack.length=this.allExtendsStack.length-1}}}(c("./tree")),function(a){a.sourceMapOutput=function(a){this._css=[],this._rootNode=a.rootNode,this._writeSourceMap=a.writeSourceMap,this._contentsMap=a.contentsMap,this._contentsIgnoredCharsMap=a.contentsIgnoredCharsMap,this._sourceMapFilename=a.sourceMapFilename,this._outputFilename=a.outputFilename,this._sourceMapURL=a.sourceMapURL,a.sourceMapBasepath&&(this._sourceMapBasepath=a.sourceMapBasepath.replace(/\\/g,"/")),this._sourceMapRootpath=a.sourceMapRootpath,this._outputSourceFiles=a.outputSourceFiles,this._sourceMapGeneratorConstructor=a.sourceMapGenerator||c("source-map").SourceMapGenerator,this._sourceMapRootpath&&"/"!==this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1)&&(this._sourceMapRootpath+="/"),this._lineNumber=0,this._column=0},a.sourceMapOutput.prototype.normalizeFilename=function(a){return a=a.replace(/\\/g,"/"),this._sourceMapBasepath&&0===a.indexOf(this._sourceMapBasepath)&&(a=a.substring(this._sourceMapBasepath.length),("\\"===a.charAt(0)||"/"===a.charAt(0))&&(a=a.substring(1))),(this._sourceMapRootpath||"")+a},a.sourceMapOutput.prototype.add=function(a,b,c,d){if(a){var e,f,g,h,i;if(b){var j=this._contentsMap[b.filename];this._contentsIgnoredCharsMap[b.filename]&&(c-=this._contentsIgnoredCharsMap[b.filename],0>c&&(c=0),j=j.slice(this._contentsIgnoredCharsMap[b.filename])),j=j.substring(0,c),f=j.split("\n"),h=f[f.length-1]}if(e=a.split("\n"),g=e[e.length-1],b)if(d)for(i=0;i<e.length;i++)this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+i+1,column:0===i?this._column:0},original:{line:f.length+i,column:0===i?h.length:0},source:this.normalizeFilename(b.filename)});else this._sourceMapGenerator.addMapping({generated:{line:this._lineNumber+1,column:this._column},original:{line:f.length,column:h.length},source:this.normalizeFilename(b.filename)});1===e.length?this._column+=g.length:(this._lineNumber+=e.length-1,this._column=g.length),this._css.push(a)}},a.sourceMapOutput.prototype.isEmpty=function(){return 0===this._css.length},a.sourceMapOutput.prototype.toCSS=function(a){if(this._sourceMapGenerator=new this._sourceMapGeneratorConstructor({file:this._outputFilename,sourceRoot:null}),this._outputSourceFiles)for(var b in this._contentsMap)if(this._contentsMap.hasOwnProperty(b)){var d=this._contentsMap[b];this._contentsIgnoredCharsMap[b]&&(d=d.slice(this._contentsIgnoredCharsMap[b])),this._sourceMapGenerator.setSourceContent(this.normalizeFilename(b),d)}if(this._rootNode.genCSS(a,this),this._css.length>0){var e,f=JSON.stringify(this._sourceMapGenerator.toJSON());this._sourceMapURL?e=this._sourceMapURL:this._sourceMapFilename&&(e=this.normalizeFilename(this._sourceMapFilename)),this._writeSourceMap?this._writeSourceMap(f):e="data:application/json;base64,"+c("./encoder.js").encodeBase64(f),e&&this._css.push("/*# sourceMappingURL="+e+" */")}return this._css.join("")}}(c("./tree"));var y=/^(file|chrome(-extension)?|resource|qrc|app):/.test(location.protocol);w.env=w.env||("127.0.0.1"==location.hostname||"0.0.0.0"==location.hostname||"localhost"==location.hostname||location.port&&location.port.length>0||y?"development":"production");var z={debug:3,info:2,errors:1,none:0};if(w.logLevel="undefined"!=typeof w.logLevel?w.logLevel:"development"===w.env?z.debug:z.errors,w.async=w.async||!1,w.fileAsync=w.fileAsync||!1,w.poll=w.poll||(y?1e3:1500),w.functions)for(var A in w.functions)w.functions.hasOwnProperty(A)&&(w.tree.functions[A]=w.functions[A]);var B=/!dumpLineNumbers:(comments|mediaquery|all)/.exec(location.hash);B&&(w.dumpLineNumbers=B[1]);var C=/^text\/(x-)?less$/,D=null,E={};if(w.watch=function(){return w.watchMode||(w.env="development",v()),this.watchMode=!0,!0},w.unwatch=function(){return clearInterval(w.watchTimer),this.watchMode=!1,!1},/!watch/.test(location.hash)&&w.watch(),"development"!=w.env)try{D="undefined"==typeof a.localStorage?null:a.localStorage}catch(F){}var G=document.getElementsByTagName("link");w.sheets=[];for(var H=0;H<G.length;H++)("stylesheet/less"===G[H].rel||G[H].rel.match(/stylesheet/)&&G[H].type.match(C))&&w.sheets.push(G[H]);w.modifyVars=function(a){w.refresh(!1,a)},w.refresh=function(a,b){var c,e;c=e=new Date,u(function(a,b,f,i,k){if(a)return j(a,i.href);if(k.local)d("loading "+i.href+" from cache.",z.info);else{d("parsed "+i.href+" successfully.",z.debug);var l=b.toCSS(w);l=h(l),g(l,i,k.lastModified)}d("css for "+i.href+" generated in "+(new Date-e)+"ms",z.info),0===k.remaining&&d("less has finished. css generated in "+(new Date-c)+"ms",z.info),e=new Date},a,b),n(b)},w.refreshStyles=n,w.Parser.fileLoader=s,w.refresh("development"===w.env),"function"==typeof define&&define.amd&&define(function(){return w})}(window);;
typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t}),function(n,t,i){var r={init:function(t,i){var r=this;r.$elem=n(i);r.options=n.extend({},n.fn.owlCarousel.options,r.$elem.data(),t);r.userOptions=t;r.loadContent()},loadContent:function(){function r(n){var i,r="";if(typeof t.options.jsonSuccess=="function")t.options.jsonSuccess.apply(this,[n]);else{for(i in n.owl)n.owl.hasOwnProperty(i)&&(r+=n.owl[i].item);t.$elem.html(r)}t.logIn()}var t=this,i;typeof t.options.beforeInit=="function"&&t.options.beforeInit.apply(this,[t.$elem]);typeof t.options.jsonPath=="string"?(i=t.options.jsonPath,n.getJSON(i,r)):t.logIn()},logIn:function(){var n=this;n.$elem.data("owl-originalStyles",n.$elem.attr("style"));n.$elem.data("owl-originalClasses",n.$elem.attr("class"));n.$elem.css({opacity:0});n.orignalItems=n.options.items;n.checkBrowser();n.wrapperWidth=0;n.checkVisible=null;n.setVars()},setVars:function(){var n=this;if(n.$elem.children().length===0)return!1;n.baseClass();n.eventTypes();n.$userItems=n.$elem.children();n.itemsAmount=n.$userItems.length;n.wrapItems();n.$owlItems=n.$elem.find(".owl-item");n.$owlWrapper=n.$elem.find(".owl-wrapper");n.playDirection="next";n.prevItem=0;n.prevArr=[0];n.currentItem=0;n.customEvents();n.onStartup()},onStartup:function(){var n=this;n.updateItems();n.calculateAll();n.buildControls();n.updateControls();n.response();n.moveEvents();n.stopOnHover();n.owlStatus();n.options.transitionStyle!==!1&&n.transitionTypes(n.options.transitionStyle);n.options.autoPlay===!0&&(n.options.autoPlay=5e3);n.play();n.$elem.find(".owl-wrapper").css("display","block");n.$elem.is(":visible")?n.$elem.css("opacity",1):n.watchVisibility();n.onstartup=!1;n.eachMoveUpdate();typeof n.options.afterInit=="function"&&n.options.afterInit.apply(this,[n.$elem])},eachMoveUpdate:function(){var n=this;n.options.lazyLoad===!0&&n.lazyLoad();n.options.autoHeight===!0&&n.autoHeight();n.onVisibleItems();typeof n.options.afterAction=="function"&&n.options.afterAction.apply(this,[n.$elem])},updateVars:function(){var n=this;typeof n.options.beforeUpdate=="function"&&n.options.beforeUpdate.apply(this,[n.$elem]);n.watchVisibility();n.updateItems();n.calculateAll();n.updatePosition();n.updateControls();n.eachMoveUpdate();typeof n.options.afterUpdate=="function"&&n.options.afterUpdate.apply(this,[n.$elem])},reload:function(){var n=this;t.setTimeout(function(){n.updateVars()},0)},watchVisibility:function(){var n=this;if(n.$elem.is(":visible")===!1)n.$elem.css({opacity:0}),t.clearInterval(n.autoPlayInterval),t.clearInterval(n.checkVisible);else return!1;n.checkVisible=t.setInterval(function(){n.$elem.is(":visible")&&(n.reload(),n.$elem.animate({opacity:1},200),t.clearInterval(n.checkVisible))},500)},wrapItems:function(){var n=this;n.$userItems.wrapAll('<div class="owl-wrapper">').wrap('<div class="owl-item"><\/div>');n.$elem.find(".owl-wrapper").wrap('<div class="owl-wrapper-outer">');n.wrapperOuter=n.$elem.find(".owl-wrapper-outer");n.$elem.css("display","block")},baseClass:function(){var n=this,t=n.$elem.hasClass(n.options.baseClass),i=n.$elem.hasClass(n.options.theme);t||n.$elem.addClass(n.options.baseClass);i||n.$elem.addClass(n.options.theme)},updateItems:function(){var t=this,i,r;if(t.options.responsive===!1)return!1;if(t.options.singleItem===!0)return t.options.items=t.orignalItems=1,t.options.itemsCustom=!1,t.options.itemsDesktop=!1,t.options.itemsDesktopSmall=!1,t.options.itemsTablet=!1,t.options.itemsTabletSmall=!1,t.options.itemsMobile=!1,!1;if(i=n(t.options.responsiveBaseWidth).width(),i>(t.options.itemsDesktop[0]||t.orignalItems)&&(t.options.items=t.orignalItems),t.options.itemsCustom!==!1)for(t.options.itemsCustom.sort(function(n,t){return n[0]-t[0]}),r=0;r<t.options.itemsCustom.length;r+=1)t.options.itemsCustom[r][0]<=i&&(t.options.items=t.options.itemsCustom[r][1]);else i<=t.options.itemsDesktop[0]&&t.options.itemsDesktop!==!1&&(t.options.items=t.options.itemsDesktop[1]),i<=t.options.itemsDesktopSmall[0]&&t.options.itemsDesktopSmall!==!1&&(t.options.items=t.options.itemsDesktopSmall[1]),i<=t.options.itemsTablet[0]&&t.options.itemsTablet!==!1&&(t.options.items=t.options.itemsTablet[1]),i<=t.options.itemsTabletSmall[0]&&t.options.itemsTabletSmall!==!1&&(t.options.items=t.options.itemsTabletSmall[1]),i<=t.options.itemsMobile[0]&&t.options.itemsMobile!==!1&&(t.options.items=t.options.itemsMobile[1]);t.options.items>t.itemsAmount&&t.options.itemsScaleUp===!0&&(t.options.items=t.itemsAmount)},response:function(){var i=this,u,r;if(i.options.responsive!==!0)return!1;r=n(t).width();i.resizer=function(){n(t).width()!==r&&(i.options.autoPlay!==!1&&t.clearInterval(i.autoPlayInterval),t.clearTimeout(u),u=t.setTimeout(function(){r=n(t).width();i.updateVars()},i.options.responsiveRefreshRate))};n(t).resize(i.resizer)},updatePosition:function(){var n=this;n.jumpTo(n.currentItem);n.options.autoPlay!==!1&&n.checkAp()},appendItemsSizes:function(){var t=this,i=0,r=t.itemsAmount-t.options.items;t.$owlItems.each(function(u){var f=n(this);f.css({width:t.itemWidth}).data("owl-item",Number(u));(u%t.options.items==0||u===r)&&(u>r||(i+=1));f.data("owl-roundPages",i)})},appendWrapperSizes:function(){var n=this,t=n.$owlItems.length*n.itemWidth;n.$owlWrapper.css({width:t*2,left:0});n.appendItemsSizes()},calculateAll:function(){var n=this;n.calculateWidth();n.appendWrapperSizes();n.loops();n.max()},calculateWidth:function(){var n=this;n.itemWidth=Math.round(n.$elem.width()/n.options.items)},max:function(){var n=this,t=(n.itemsAmount*n.itemWidth-n.options.items*n.itemWidth)*-1;return n.options.items>n.itemsAmount?(n.maximumItem=0,t=0,n.maximumPixels=0):(n.maximumItem=n.itemsAmount-n.options.items,n.maximumPixels=t),t},min:function(){return 0},loops:function(){var t=this,r=0,f=0,i,e,u;for(t.positionsInArray=[0],t.pagesInArray=[],i=0;i<t.itemsAmount;i+=1)f+=t.itemWidth,t.positionsInArray.push(-f),t.options.scrollPerPage===!0&&(e=n(t.$owlItems[i]),u=e.data("owl-roundPages"),u!==r&&(t.pagesInArray[r]=t.positionsInArray[i],r=u))},buildControls:function(){var t=this;(t.options.navigation===!0||t.options.pagination===!0)&&(t.owlControls=n('<div class="owl-controls"/>').toggleClass("clickable",!t.browser.isTouch).appendTo(t.$elem));t.options.pagination===!0&&t.buildPagination();t.options.navigation===!0&&t.buildButtons()},buildButtons:function(){var t=this,i=n('<div class="owl-buttons"/>');t.owlControls.append(i);t.buttonPrev=n("<div/>",{"class":"owl-prev",html:t.options.navigationText[0]||""});t.buttonNext=n("<div/>",{"class":"owl-next",html:t.options.navigationText[1]||""});i.append(t.buttonPrev).append(t.buttonNext);i.on("touchstart.owlControls mousedown.owlControls",'div[class^="owl"]',function(n){n.preventDefault()});i.on("touchend.owlControls mouseup.owlControls",'div[class^="owl"]',function(i){i.preventDefault();n(this).hasClass("owl-next")?t.next():t.prev()})},buildPagination:function(){var t=this;t.paginationWrapper=n('<div class="owl-pagination"/>');t.owlControls.append(t.paginationWrapper);t.paginationWrapper.on("touchend.owlControls mouseup.owlControls",".owl-page",function(i){i.preventDefault();Number(n(this).data("owl-page"))!==t.currentItem&&t.goTo(Number(n(this).data("owl-page")),!0)})},updatePagination:function(){var t=this,u,f,e,i,r,o;if(t.options.pagination===!1)return!1;for(t.paginationWrapper.html(""),u=0,f=t.itemsAmount-t.itemsAmount%t.options.items,i=0;i<t.itemsAmount;i+=1)i%t.options.items==0&&(u+=1,f===i&&(e=t.itemsAmount-t.options.items),r=n("<div/>",{"class":"owl-page"}),o=n("<span><\/span>",{text:t.options.paginationNumbers===!0?u:"","class":t.options.paginationNumbers===!0?"owl-numbers":""}),r.append(o),r.data("owl-page",f===i?e:i),r.data("owl-roundPages",u),t.paginationWrapper.append(r));t.checkPagination()},checkPagination:function(){var t=this;if(t.options.pagination===!1)return!1;t.paginationWrapper.find(".owl-page").each(function(){n(this).data("owl-roundPages")===n(t.$owlItems[t.currentItem]).data("owl-roundPages")&&(t.paginationWrapper.find(".owl-page").removeClass("active"),n(this).addClass("active"))})},checkNavigation:function(){var n=this;if(n.options.navigation===!1)return!1;n.options.rewindNav===!1&&(n.currentItem===0&&n.maximumItem===0?(n.buttonPrev.addClass("disabled"),n.buttonNext.addClass("disabled")):n.currentItem===0&&n.maximumItem!==0?(n.buttonPrev.addClass("disabled"),n.buttonNext.removeClass("disabled")):n.currentItem===n.maximumItem?(n.buttonPrev.removeClass("disabled"),n.buttonNext.addClass("disabled")):n.currentItem!==0&&n.currentItem!==n.maximumItem&&(n.buttonPrev.removeClass("disabled"),n.buttonNext.removeClass("disabled")))},updateControls:function(){var n=this;n.updatePagination();n.checkNavigation();n.owlControls&&(n.options.items>=n.itemsAmount?n.owlControls.hide():n.owlControls.show())},destroyControls:function(){var n=this;n.owlControls&&n.owlControls.remove()},next:function(n){var t=this;if(t.isTransition)return!1;if(t.currentItem+=t.options.scrollPerPage===!0?t.options.items:1,t.currentItem>t.maximumItem+(t.options.scrollPerPage===!0?t.options.items-1:0))if(t.options.rewindNav===!0)t.currentItem=0,n="rewind";else return t.currentItem=t.maximumItem,!1;t.goTo(t.currentItem,n)},prev:function(n){var t=this;if(t.isTransition)return!1;if(t.options.scrollPerPage===!0&&t.currentItem>0&&t.currentItem<t.options.items?t.currentItem=0:t.currentItem-=t.options.scrollPerPage===!0?t.options.items:1,t.currentItem<0)if(t.options.rewindNav===!0)t.currentItem=t.maximumItem,n="rewind";else return t.currentItem=0,!1;t.goTo(t.currentItem,n)},goTo:function(n,i,r){var u=this,f;if(u.isTransition)return!1;if(typeof u.options.beforeMove=="function"&&u.options.beforeMove.apply(this,[u.$elem]),n>=u.maximumItem?n=u.maximumItem:n<=0&&(n=0),u.currentItem=u.owl.currentItem=n,u.options.transitionStyle!==!1&&r!=="drag"&&u.options.items===1&&u.browser.support3d===!0)return u.swapSpeed(0),u.browser.support3d===!0?u.transition3d(u.positionsInArray[n]):u.css2slide(u.positionsInArray[n],1),u.afterGo(),u.singleItemTransition(),!1;f=u.positionsInArray[n];u.browser.support3d===!0?(u.isCss3Finish=!1,i===!0?(u.swapSpeed("paginationSpeed"),t.setTimeout(function(){u.isCss3Finish=!0},u.options.paginationSpeed)):i==="rewind"?(u.swapSpeed(u.options.rewindSpeed),t.setTimeout(function(){u.isCss3Finish=!0},u.options.rewindSpeed)):(u.swapSpeed("slideSpeed"),t.setTimeout(function(){u.isCss3Finish=!0},u.options.slideSpeed)),u.transition3d(f)):i===!0?u.css2slide(f,u.options.paginationSpeed):i==="rewind"?u.css2slide(f,u.options.rewindSpeed):u.css2slide(f,u.options.slideSpeed);u.afterGo()},jumpTo:function(n){var t=this;typeof t.options.beforeMove=="function"&&t.options.beforeMove.apply(this,[t.$elem]);n>=t.maximumItem||n===-1?n=t.maximumItem:n<=0&&(n=0);t.swapSpeed(0);t.browser.support3d===!0?t.transition3d(t.positionsInArray[n]):t.css2slide(t.positionsInArray[n],1);t.currentItem=t.owl.currentItem=n;t.afterGo()},afterGo:function(){var n=this;n.prevArr.push(n.currentItem);n.prevItem=n.owl.prevItem=n.prevArr[n.prevArr.length-2];n.prevArr.shift(0);n.prevItem!==n.currentItem&&(n.checkPagination(),n.checkNavigation(),n.eachMoveUpdate(),n.options.autoPlay!==!1&&n.checkAp());typeof n.options.afterMove=="function"&&n.prevItem!==n.currentItem&&n.options.afterMove.apply(this,[n.$elem])},stop:function(){var n=this;n.apStatus="stop";t.clearInterval(n.autoPlayInterval)},checkAp:function(){var n=this;n.apStatus!=="stop"&&n.play()},play:function(){var n=this;if(n.apStatus="play",n.options.autoPlay===!1)return!1;t.clearInterval(n.autoPlayInterval);n.autoPlayInterval=t.setInterval(function(){n.next(!0)},n.options.autoPlay)},swapSpeed:function(n){var t=this;n==="slideSpeed"?t.$owlWrapper.css(t.addCssSpeed(t.options.slideSpeed)):n==="paginationSpeed"?t.$owlWrapper.css(t.addCssSpeed(t.options.paginationSpeed)):typeof n!="string"&&t.$owlWrapper.css(t.addCssSpeed(n))},addCssSpeed:function(n){return{"-webkit-transition":"all "+n+"ms ease","-moz-transition":"all "+n+"ms ease","-o-transition":"all "+n+"ms ease",transition:"all "+n+"ms ease"}},removeTransition:function(){return{"-webkit-transition":"","-moz-transition":"","-o-transition":"",transition:""}},doTranslate:function(n){return{"-webkit-transform":"translate3d("+n+"px, 0px, 0px)","-moz-transform":"translate3d("+n+"px, 0px, 0px)","-o-transform":"translate3d("+n+"px, 0px, 0px)","-ms-transform":"translate3d("+n+"px, 0px, 0px)",transform:"translate3d("+n+"px, 0px,0px)"}},transition3d:function(n){var t=this;t.$owlWrapper.css(t.doTranslate(n))},css2move:function(n){var t=this;t.$owlWrapper.css({left:n})},css2slide:function(n,t){var i=this;i.isCssFinish=!1;i.$owlWrapper.stop(!0,!0).animate({left:n},{duration:t||i.options.slideSpeed,complete:function(){i.isCssFinish=!0}})},checkBrowser:function(){var s=this,n="translate3d(0px, 0px, 0px)",u=i.createElement("div"),f,r,e,o;u.style.cssText="  -moz-transform:"+n+"; -ms-transform:"+n+"; -o-transform:"+n+"; -webkit-transform:"+n+"; transform:"+n;f=/translate3d\(0px, 0px, 0px\)/g;r=u.style.cssText.match(f);e=r!==null&&r.length===1;o="ontouchstart"in t||t.navigator.msMaxTouchPoints;s.browser={support3d:e,isTouch:o}},moveEvents:function(){var n=this;(n.options.mouseDrag!==!1||n.options.touchDrag!==!1)&&(n.gestures(),n.disabledEvents())},eventTypes:function(){var n=this,t=["s","e","x"];n.ev_types={};n.options.mouseDrag===!0&&n.options.touchDrag===!0?t=["touchstart.owl mousedown.owl","touchmove.owl mousemove.owl","touchend.owl touchcancel.owl mouseup.owl"]:n.options.mouseDrag===!1&&n.options.touchDrag===!0?t=["touchstart.owl","touchmove.owl","touchend.owl touchcancel.owl"]:n.options.mouseDrag===!0&&n.options.touchDrag===!1&&(t=["mousedown.owl","mousemove.owl","mouseup.owl"]);n.ev_types.start=t[0];n.ev_types.move=t[1];n.ev_types.end=t[2]},disabledEvents:function(){var t=this;t.$elem.on("dragstart.owl",function(n){n.preventDefault()});t.$elem.on("mousedown.disableTextSelect",function(t){return n(t.target).is("input, textarea, select, option")})},gestures:function(){function f(n){if(n.touches!==undefined)return{x:n.touches[0].pageX,y:n.touches[0].pageY};if(n.touches===undefined){if(n.pageX!==undefined)return{x:n.pageX,y:n.pageY};if(n.pageX===undefined)return{x:n.clientX,y:n.clientY}}}function e(t){if(t==="on"){n(i).on(r.ev_types.move,s);n(i).on(r.ev_types.end,h)}else t==="off"&&(n(i).off(r.ev_types.move),n(i).off(r.ev_types.end))}function o(i){var o=i.originalEvent||i||t.event,s;if(o.which===3)return!1;if(!(r.itemsAmount<=r.options.items)){if(r.isCssFinish===!1&&!r.options.dragBeforeAnimFinish||r.isCss3Finish===!1&&!r.options.dragBeforeAnimFinish)return!1;r.options.autoPlay!==!1&&t.clearInterval(r.autoPlayInterval);r.browser.isTouch===!0||r.$owlWrapper.hasClass("grabbing")||r.$owlWrapper.addClass("grabbing");r.newPosX=0;r.newRelativeX=0;n(this).css(r.removeTransition());s=n(this).position();u.relativePos=s.left;u.offsetX=f(o).x-s.left;u.offsetY=f(o).y-s.top;e("on");u.sliding=!1;u.targetElement=o.target||o.srcElement}}function s(e){var o=e.originalEvent||e||t.event,s,h;r.newPosX=f(o).x-u.offsetX;r.newPosY=f(o).y-u.offsetY;r.newRelativeX=r.newPosX-u.relativePos;typeof r.options.startDragging=="function"&&u.dragging!==!0&&r.newRelativeX!==0&&(u.dragging=!0,r.options.startDragging.apply(r,[r.$elem]));(r.newRelativeX>8||r.newRelativeX<-8)&&r.browser.isTouch===!0&&(o.preventDefault!==undefined?o.preventDefault():o.returnValue=!1,u.sliding=!0);(r.newPosY>10||r.newPosY<-10)&&u.sliding===!1&&n(i).off("touchmove.owl");s=function(){return r.newRelativeX/5};h=function(){return r.maximumPixels+r.newRelativeX/5};r.newPosX=Math.max(Math.min(r.newPosX,s()),h());r.browser.support3d===!0?r.transition3d(r.newPosX):r.css2move(r.newPosX)}function h(i){var f=i.originalEvent||i||t.event,s,o,h;if(f.target=f.target||f.srcElement,u.dragging=!1,r.browser.isTouch!==!0&&r.$owlWrapper.removeClass("grabbing"),r.dragDirection=r.newRelativeX<0?r.owl.dragDirection="left":r.owl.dragDirection="right",r.newRelativeX!==0&&(s=r.getNewPosition(),r.goTo(s,!1,"drag"),u.targetElement===f.target&&r.browser.isTouch!==!0)){n(f.target).on("click.disable",function(t){t.stopImmediatePropagation();t.stopPropagation();t.preventDefault();n(t.target).off("click.disable")});o=n._data(f.target,"events").click;h=o.pop();o.splice(0,0,h)}e("off")}var r=this,u={offsetX:0,offsetY:0,baseElWidth:0,relativePos:0,position:null,minSwipe:null,maxSwipe:null,sliding:null,dargging:null,targetElement:null};r.isCssFinish=!0;r.$elem.on(r.ev_types.start,".owl-wrapper",o)},getNewPosition:function(){var n=this,t=n.closestItem();return t>n.maximumItem?(n.currentItem=n.maximumItem,t=n.maximumItem):n.newPosX>=0&&(t=0,n.currentItem=0),t},closestItem:function(){var t=this,i=t.options.scrollPerPage===!0?t.pagesInArray:t.positionsInArray,u=t.newPosX,r=null;return n.each(i,function(f,e){u-t.itemWidth/20>i[f+1]&&u-t.itemWidth/20<e&&t.moveDirection()==="left"?(r=e,t.currentItem=t.options.scrollPerPage===!0?n.inArray(r,t.positionsInArray):f):u+t.itemWidth/20<e&&u+t.itemWidth/20>(i[f+1]||i[f]-t.itemWidth)&&t.moveDirection()==="right"&&(t.options.scrollPerPage===!0?(r=i[f+1]||i[i.length-1],t.currentItem=n.inArray(r,t.positionsInArray)):(r=i[f+1],t.currentItem=f+1))}),t.currentItem},moveDirection:function(){var n=this,t;return n.newRelativeX<0?(t="right",n.playDirection="next"):(t="left",n.playDirection="prev"),t},customEvents:function(){var n=this;n.$elem.on("owl.next",function(){n.next()});n.$elem.on("owl.prev",function(){n.prev()});n.$elem.on("owl.play",function(t,i){n.options.autoPlay=i;n.play();n.hoverStatus="play"});n.$elem.on("owl.stop",function(){n.stop();n.hoverStatus="stop"});n.$elem.on("owl.goTo",function(t,i){n.goTo(i)});n.$elem.on("owl.jumpTo",function(t,i){n.jumpTo(i)})},stopOnHover:function(){var n=this;if(n.options.stopOnHover===!0&&n.browser.isTouch!==!0&&n.options.autoPlay!==!1){n.$elem.on("mouseover",function(){n.stop()});n.$elem.on("mouseout",function(){n.hoverStatus!=="stop"&&n.play()})}},lazyLoad:function(){var t=this,u,i,f,r,e;if(t.options.lazyLoad===!1)return!1;for(u=0;u<t.itemsAmount;u+=1)if(i=n(t.$owlItems[u]),i.data("owl-loaded")!=="loaded"){if(f=i.data("owl-item"),r=i.find(".lazyOwl"),typeof r.data("src")!="string"){i.data("owl-loaded","loaded");continue}i.data("owl-loaded")===undefined&&(r.hide(),i.addClass("loading").data("owl-loaded","checked"));e=t.options.lazyFollow===!0?f>=t.currentItem:!0;e&&f<t.currentItem+t.options.items&&r.length&&t.lazyPreload(i,r)}},lazyPreload:function(n,i){function e(){n.data("owl-loaded","loaded").removeClass("loading");i.removeAttr("data-src");r.options.lazyEffect==="fade"?i.fadeIn(400):i.show();typeof r.options.afterLazyLoad=="function"&&r.options.afterLazyLoad.apply(this,[r.$elem])}function o(){u+=1;r.completeImg(i.get(0))||f===!0?e():u<=100?t.setTimeout(o,100):e()}var r=this,u=0,f;i.prop("tagName")==="DIV"?(i.css("background-image","url("+i.data("src")+")"),f=!0):i[0].src=i.data("src");o()},autoHeight:function(){function f(){var r=n(i.$owlItems[i.currentItem]).height();i.wrapperOuter.css("height",r+"px");i.wrapperOuter.hasClass("autoHeight")||t.setTimeout(function(){i.wrapperOuter.addClass("autoHeight")},0)}function e(){r+=1;i.completeImg(u.get(0))?f():r<=100?t.setTimeout(e,100):i.wrapperOuter.css("height","")}var i=this,u=n(i.$owlItems[i.currentItem]).find("img"),r;u.get(0)!==undefined?(r=0,e()):f()},completeImg:function(n){var t;return n.complete?(t=typeof n.naturalWidth,t!=="undefined"&&n.naturalWidth===0)?!1:!0:!1},onVisibleItems:function(){var t=this,i;for(t.options.addClassActive===!0&&t.$owlItems.removeClass("active"),t.visibleItems=[],i=t.currentItem;i<t.currentItem+t.options.items;i+=1)t.visibleItems.push(i),t.options.addClassActive===!0&&n(t.$owlItems[i]).addClass("active");t.owl.visibleItems=t.visibleItems},transitionTypes:function(n){var t=this;t.outClass="owl-"+n+"-out";t.inClass="owl-"+n+"-in"},singleItemTransition:function(){function s(n){return{position:"relative",left:n+"px"}}var n=this,f=n.outClass,e=n.inClass,i=n.$owlItems.eq(n.currentItem),r=n.$owlItems.eq(n.prevItem),o=Math.abs(n.positionsInArray[n.currentItem])+n.positionsInArray[n.prevItem],u=Math.abs(n.positionsInArray[n.currentItem])+n.itemWidth/2,t="webkitAnimationEnd oAnimationEnd MSAnimationEnd animationend";n.isTransition=!0;n.$owlWrapper.addClass("owl-origin").css({"-webkit-transform-origin":u+"px","-moz-perspective-origin":u+"px","perspective-origin":u+"px"});r.css(s(o,10)).addClass(f).on(t,function(){n.endPrev=!0;r.off(t);n.clearTransStyle(r,f)});i.addClass(e).on(t,function(){n.endCurrent=!0;i.off(t);n.clearTransStyle(i,e)})},clearTransStyle:function(n,t){var i=this;n.css({position:"",left:""}).removeClass(t);i.endPrev&&i.endCurrent&&(i.$owlWrapper.removeClass("owl-origin"),i.endPrev=!1,i.endCurrent=!1,i.isTransition=!1)},owlStatus:function(){var n=this;n.owl={userOptions:n.userOptions,baseElement:n.$elem,userItems:n.$userItems,owlItems:n.$owlItems,currentItem:n.currentItem,prevItem:n.prevItem,visibleItems:n.visibleItems,isTouch:n.browser.isTouch,browser:n.browser,dragDirection:n.dragDirection}},clearEvents:function(){var r=this;r.$elem.off(".owl owl mousedown.disableTextSelect");n(i).off(".owl owl");n(t).off("resize",r.resizer)},unWrap:function(){var n=this;n.$elem.children().length!==0&&(n.$owlWrapper.unwrap(),n.$userItems.unwrap().unwrap(),n.owlControls&&n.owlControls.remove());n.clearEvents();n.$elem.attr("style",n.$elem.data("owl-originalStyles")||"").attr("class",n.$elem.data("owl-originalClasses"))},destroy:function(){var n=this;n.stop();t.clearInterval(n.checkVisible);n.unWrap();n.$elem.removeData()},reinit:function(t){var i=this,r=n.extend({},i.userOptions,t);i.unWrap();i.init(r,i.$elem)},addItem:function(n,t){var i=this,r;if(!n)return!1;if(i.$elem.children().length===0)return i.$elem.append(n),i.setVars(),!1;i.unWrap();r=t===undefined||t===-1?-1:t;r>=i.$userItems.length||r===-1?i.$userItems.eq(-1).after(n):i.$userItems.eq(r).before(n);i.setVars()},removeItem:function(n){var t=this,i;if(t.$elem.children().length===0)return!1;i=n===undefined||n===-1?-1:n;t.unWrap();t.$userItems.eq(i).remove();t.setVars()}};n.fn.owlCarousel=function(t){return this.each(function(){if(n(this).data("owl-init")===!0)return!1;n(this).data("owl-init",!0);var i=Object.create(r);i.init(t,this);n.data(this,"owlCarousel",i)})};n.fn.owlCarousel.options={items:5,itemsCustom:!1,itemsDesktop:[1199,4],itemsDesktopSmall:[979,3],itemsTablet:[768,2],itemsTabletSmall:!1,itemsMobile:[479,1],singleItem:!1,itemsScaleUp:!1,slideSpeed:200,paginationSpeed:800,rewindSpeed:1e3,autoPlay:!1,stopOnHover:!1,navigation:!1,navigationText:["prev","next"],rewindNav:!0,scrollPerPage:!1,pagination:!0,paginationNumbers:!1,responsive:!0,responsiveRefreshRate:200,responsiveBaseWidth:t,baseClass:"owl-carousel",theme:"owl-theme",lazyLoad:!1,lazyFollow:!0,lazyEffect:"fade",autoHeight:!1,jsonPath:!1,jsonSuccess:!1,dragBeforeAnimFinish:!0,mouseDrag:!0,touchDrag:!0,addClassActive:!1,transitionStyle:!1,beforeUpdate:!1,afterUpdate:!1,beforeInit:!1,afterInit:!1,beforeMove:!1,afterMove:!1,afterAction:!1,startDragging:!1,afterLazyLoad:!1}}(jQuery,window,document);
//# sourceMappingURL=owl.carousel.min.js.map
;
/*!
 * jmpress.js v0.4.5
 * http://jmpressjs.github.com/jmpress.js
 *
 * A jQuery plugin to build a website on the infinite canvas.
 *
 * Copyright 2013 Kyle Robinson Young @shama & Tobias Koppers @sokra
 * Licensed MIT
 * http://www.opensource.org/licenses/mit-license.php
 *
 * Based on the foundation laid by Bartek Szopka @bartaz
 */(function(e,t,s,a){"use strict";function r(e){if(e){var t=1+e.substr(1).search(/[A-Z]/),s=e.substr(0,t).toLowerCase(),a=e.substr(t).toLowerCase();return"-"+s+"-"+a}}function n(e){return e?e+",":""}function i(e){return e.length>0?e:null}function o(r){function n(t,s){var a=p(t),r={oldStyle:e(t).attr("style")||""},n={data:a,stepData:r};f.call(this,"beforeInitStep",e(t),n),r.delegate=a.delegate,f.call(this,"initStep",e(t),n),e(t).data("stepData",r),e(t).attr("id")||e(t).attr("id","step-"+(s+1)),f.call(this,"applyStep",e(t),n)}function o(t){var s=e(t).data("stepData");e(t).attr("style",s.oldStyle),f.call(this,"unapplyStep",e(t),{stepData:s})}function c(t){f.call(this,"unapplyStep",e(t),{stepData:t.data("stepData")}),f.call(this,"applyStep",e(t),{stepData:t.data("stepData")})}function l(){O&&f.call(this,"setInactive",O,{stepData:e(O).data("stepData"),reason:"deinit"}),Y.jmpressClass&&e(I).removeClass(Y.jmpressClass),f.call(this,"beforeDeinit",e(this),{}),e(A.stepSelector,I).each(function(){o.call(I,this)}),z.attr("style",k.container),A.fullscreen&&e("html").attr("style",""),Z.attr("style",k.area),e(X).children().each(function(){I.append(e(this))}),A.fullscreen?X.remove():(X.remove(),Z.remove()),f.call(this,"afterDeinit",e(this),{}),e(I).data("jmpressmethods",!1)}function f(t,s,a){a.settings=A,a.current=Y,a.container=z,a.parents=s?d(s):null,a.current=Y,a.jmpress=this;var r={};return e.each(A[t],function(e,t){r.value=t.call(I,s,a)||r.value}),r.value}function d(t){return e(t).parentsUntil(I).not(I).filter(A.stepSelector)}function v(e){return g({step:O,substep:_},e)}function g(t,s){var r;if(e.isPlainObject(t)&&(r=t.substep,t=t.step),"string"==typeof t&&(t=I.find(t).first()),!t||!e(t).data("stepData"))return!1;b.call(this);var n=e(t).data("stepData"),o=!1;if(f.call(this,"beforeChange",t,{stepData:n,reason:s,cancel:function(){o=!0}}),o)return a;var c={},l=t;e(t).data("stepData").delegate&&(l=i(e(t).parentsUntil(I).filter(A.stepSelector).filter(n.delegate))||i(e(t).near(n.delegate))||i(e(t).near(n.delegate,!0))||i(e(n.delegate,I)),l?n=l.data("stepData"):l=t),F&&f.call(this,"setInactive",F,{stepData:e(F).data("stepData"),delegatedFrom:O,reason:s,target:c,nextStep:l,nextSubstep:r,nextStepData:n});var u={stepData:n,delegatedFrom:t,reason:s,target:c,substep:r,prevStep:F,prevSubstep:_,prevStepData:F&&e(F).data("stepData")};return f.call(this,"beforeActive",l,u),f.call(this,"setActive",l,u),Y.jmpressClass&&e(I).removeClass(Y.jmpressClass),e(I).addClass(Y.jmpressClass="step-"+e(l).attr("id")),Y.jmpressDelegatedClass&&e(I).removeClass(Y.jmpressDelegatedClass),e(I).addClass(Y.jmpressDelegatedClass="delegating-step-"+e(t).attr("id")),f.call(this,"applyTarget",l,e.extend({canvas:X,area:Z,beforeActive:F},u)),O=t,_=u.substep,F=l,Y.idleTimeout&&clearTimeout(Y.idleTimeout),Y.idleTimeout=setTimeout(function(){f.call(this,"idle",l,u)},Math.max(1,A.transitionDuration-100)),l}function b(){(function t(){function a(){(0!==e(z).scrollTop()||0!==e(z).scrollLeft())&&t()}if("BODY"===e(z)[0].tagName)try{s.scrollTo(0,0)}catch(r){}e(z).scrollTop(0),e(z).scrollLeft(0),setTimeout(a,1),setTimeout(a,10),setTimeout(a,100),setTimeout(a,200),setTimeout(a,400)})()}function j(e){return g.call(this,e,"jump")}function y(){return g.call(this,f.call(this,"selectNext",O,{stepData:e(O).data("stepData"),substep:_}),"next")}function D(){return g.call(this,f.call(this,"selectPrev",O,{stepData:e(O).data("stepData"),substep:_}),"prev")}function S(){return g.call(this,f.call(this,"selectHome",O,{stepData:e(O).data("stepData")}),"home")}function w(){return g.call(this,f.call(this,"selectEnd",O,{stepData:e(O).data("stepData")}),"end")}function x(t){return u(X,t||{}),e(X)}function C(){return F&&e(F)}function T(t,s,r){return h[t]?f.call(this,t,s,r):(e.error("callback "+t+" is not registered."),a)}function P(){var e=navigator.userAgent.toLowerCase();return-1===e.search(/(iphone)|(ipod)|(android)/)||-1!==e.search(/(chrome)/)}r=e.extend(!0,{},r||{});var M={},N=null;for(N in h)M[N]=e.isFunction(r[N])?[r[N]]:r[N],r[N]=[];var A=e.extend(!0,{},m,r);for(N in h)M[N]&&Array.prototype.push.apply(A[N],M[N]);var I=e(this),z=null,Z=null,k={container:"",area:""},X=null,Y=null,O=!1,_=null,F=!1;if(I.data("jmpressmethods",{select:g,reselect:v,scrollFix:b,goTo:j,next:y,prev:D,home:S,end:w,canvas:x,container:function(){return z},settings:function(){return A},active:C,current:function(){return Y},fire:T,init:function(t){n.call(this,e(t),Y.nextIdNumber++)},deinit:function(t){t?o.call(this,e(t)):l.call(this)},reapply:c}),P()===!1)return A.notSupportedClass&&I.addClass(A.notSupportedClass),a;A.notSupportedClass&&I.removeClass(A.notSupportedClass);var Q=e(A.stepSelector,I);z=I,Z=e("<div />"),X=e("<div />"),e(I).children().filter(Q).each(function(){X.append(e(this))}),A.fullscreen&&(z=e("body"),e("html").css({overflow:"hidden"}),Z=I),k.area=Z.attr("style")||"",k.container=z.attr("style")||"",A.fullscreen?(z.css({height:"100%"}),I.append(X)):(z.css({position:"relative"}),Z.append(X),I.append(Z)),e(z).addClass(A.containerClass),e(Z).addClass(A.areaClass),e(X).addClass(A.canvasClass),t.documentElement.style.height="100%",z.css({overflow:"hidden"});var E={position:"absolute",transitionDuration:"0s"};E=e.extend({},A.animation,E),u(Z,E),u(Z,{top:"50%",left:"50%",perspective:"1000px"}),u(X,E),Y={},f.call(this,"beforeInit",null,{}),Q.each(function(e){n.call(I,this,e)}),Y.nextIdNumber=Q.length,f.call(this,"afterInit",null,{}),g.call(this,f.call(this,"selectInitialStep","init",{})),A.initClass&&e(Q).removeClass(A.initClass)}function c(){return m}function l(t,s){e.isFunction(s)?g[t]?e.error("function "+t+" is already registered."):g[t]=s:h[t]?e.error("callback "+t+" is already registered."):(h[t]=1,m[t]=[])}function u(t,s){var a,r,n={};for(a in s)s.hasOwnProperty(a)&&(r=d(a),null!==r&&(n[r]=s[a]));return e(t).css(n),t}function p(t){function s(e){e=e.split("-");for(var t=1;e.length>t;t++)e[t]=e[t].substr(0,1).toUpperCase()+e[t].substr(1);return e.join("")}if(e(t)[0].dataset)return e.extend({},e(t)[0].dataset);var a={},r=e(t)[0].attributes;return e.each(r,function(e,t){"data-"===t.nodeName.substr(0,5)&&(a[s(t.nodeName.substr(5))]=t.nodeValue)}),a}function f(){return!!e(this).data("jmpressmethods")}var d=function(){var e=t.createElement("dummy").style,s="Webkit Moz O ms Khtml".split(" "),r={};return function(t){if(r[t]===a){var n=t.charAt(0).toUpperCase()+t.substr(1),i=(t+" "+s.join(n+" ")+n).split(" ");r[t]=null;for(var o in i)if(e[i[o]]!==a){r[t]=i[o];break}}return r[t]}}(),m={stepSelector:".step",containerClass:"",canvasClass:"",areaClass:"",notSupportedClass:"not-supported",fullscreen:!0,animation:{transformOrigin:"top left",transitionProperty:n(r(d("transform")))+n(r(d("perspective")))+"opacity",transitionDuration:"1s",transitionDelay:"500ms",transitionTimingFunction:"ease-in-out",transformStyle:"preserve-3d"},transitionDuration:1500},h={beforeChange:1,beforeInitStep:1,initStep:1,beforeInit:1,afterInit:1,beforeDeinit:1,afterDeinit:1,applyStep:1,unapplyStep:1,setInactive:1,beforeActive:1,setActive:1,selectInitialStep:1,selectPrev:1,selectNext:1,selectHome:1,selectEnd:1,idle:1,applyTarget:1};for(var v in h)m[v]=[];var g={init:o,initialized:f,deinit:function(){},css:u,pfx:d,defaults:c,register:l,dataset:p};e.fn.jmpress=function(t){function s(){var s=e(this).data("jmpressmethods");if(s&&s[t])return s[t].apply(this,Array.prototype.slice.call(arguments,1));if(g[t])return g[t].apply(this,Array.prototype.slice.call(arguments,1));if(h[t]&&s){var a=s.settings(),r=Array.prototype.slice.call(arguments,1)[0];e.isFunction(r)&&(a[t]=a[t]||[],a[t].push(r))}else{if("object"==typeof t||!t)return o.apply(this,arguments);e.error("Method "+t+" does not exist on jQuery.jmpress")}return this}var a,r=arguments;return e(this).each(function(e,t){a=s.apply(t,r)}),a},e.extend({jmpress:function(t){if(g[t])return g[t].apply(this,Array.prototype.slice.call(arguments,1));if(h[t]){var s=Array.prototype.slice.call(arguments,1)[0];e.isFunction(s)?m[t].push(s):e.error("Second parameter should be a function: $.jmpress( callbackName, callbackFunction )")}else e.error("Method "+t+" does not exist on jQuery.jmpress")}})})(jQuery,document,window),function(e){"use strict";function t(t,s,a,r){var n;return t.each(function(t,i){return r&&(n=s(i,a,r))?!1:e(i).is(a)?(n=i,!1):!r&&(n=s(i,a,r))?!1:undefined}),n}function s(a,r,n){var i=e(a).children();return n&&(i=e(i.get().reverse())),t(i,s,r,n)}function a(a,r,n){return t(e(a)[n?"prevAll":"nextAll"](),s,r,n)}function r(t,s,r){var n,i=e(t).parents();return i=e(i.get()),e.each(i.get(),function(t,i){return r&&e(i).is(s)?(n=i,!1):(n=a(i,s,r),n?!1:undefined)}),n}e.fn.near=function(t,n){var i=[];return e(this).each(function(e,o){var c=(n?!1:s(o,t,n))||a(o,t,n)||r(o,t,n);c&&i.push(c)}),e(i)}}(jQuery,document,window),function(e,t,s,a){"use strict";function r(e){return Math.round(1e4*e)/1e4+""}var n={3:{transform:function(t,s){var a="translate(-50%,-50%)";e.each(s,function(e,t){var s,n=["X","Y","Z"];if("translate"===t[0])a+=" translate3d("+r(t[1]||0)+"px,"+r(t[2]||0)+"px,"+r(t[3]||0)+"px)";else if("rotate"===t[0]){var i=t[4]?[1,2,3]:[3,2,1];for(s=0;3>s;s++)a+=" rotate"+n[i[s]-1]+"("+r(t[i[s]]||0)+"deg)"}else if("scale"===t[0])for(s=0;3>s;s++)a+=" scale"+n[s]+"("+r(t[s+1]||1)+")"}),e.jmpress("css",t,e.extend({},{transform:a}))}},2:{transform:function(t,s){var a="translate(-50%,-50%)";e.each(s,function(e,t){var s=["X","Y"];if("translate"===t[0])a+=" translate("+r(t[1]||0)+"px,"+r(t[2]||0)+"px)";else if("rotate"===t[0])a+=" rotate("+r(t[3]||0)+"deg)";else if("scale"===t[0])for(var n=0;2>n;n++)a+=" scale"+s[n]+"("+r(t[n+1]||1)+")"}),e.jmpress("css",t,e.extend({},{transform:a}))}},1:{transform:function(t,s){var a={top:0,left:0};e.each(s,function(e,t){"translate"===t[0]&&(a.left=Math.round(t[1]||0)+"px",a.top=Math.round(t[2]||0)+"px")}),t.animate(a,1e3)}}},i=function(){return e.jmpress("pfx","perspective")?n[3]:e.jmpress("pfx","transform")?n[2]:n[1]}();e.jmpress("defaults").reasonableAnimation={},e.jmpress("initStep",function(t,s){var a=s.data,r=s.stepData,n=parseFloat;e.extend(r,{x:n(a.x)||0,y:n(a.y)||0,z:n(a.z)||0,r:n(a.r)||0,phi:n(a.phi)||0,rotate:n(a.rotate)||0,rotateX:n(a.rotateX)||0,rotateY:n(a.rotateY)||0,rotateZ:n(a.rotateZ)||0,revertRotate:!1,scale:n(a.scale)||1,scaleX:n(a.scaleX)||!1,scaleY:n(a.scaleY)||!1,scaleZ:n(a.scaleZ)||1})}),e.jmpress("afterInit",function(t,s){var a=s.settings.stepSelector,r=s.current;r.perspectiveScale=1,r.maxNestedDepth=0;for(var n=e(s.jmpress).find(a).children(a);n.length;)r.maxNestedDepth++,n=n.children(a)}),e.jmpress("applyStep",function(t,s){e.jmpress("css",e(t),{position:"absolute",transformStyle:"preserve-3d"}),s.parents.length>0&&e.jmpress("css",e(t),{top:"50%",left:"50%"});var a=s.stepData,r=[["translate",a.x||a.r*Math.sin(a.phi*Math.PI/180),a.y||-a.r*Math.cos(a.phi*Math.PI/180),a.z],["rotate",a.rotateX,a.rotateY,a.rotateZ||a.rotate,!0],["scale",a.scaleX||a.scale,a.scaleY||a.scale,a.scaleZ||a.scale]];i.transform(t,r)}),e.jmpress("setActive",function(t,s){var r=s.target,n=s.stepData,i=r.transform=[];r.perspectiveScale=1;for(var o=s.current.maxNestedDepth;o>(s.parents.length||0);o--)i.push(["scale"],["rotate"],["translate"]);i.push(["scale",1/(n.scaleX||n.scale),1/(n.scaleY||n.scale),1/n.scaleZ]),i.push(["rotate",-n.rotateX,-n.rotateY,-(n.rotateZ||n.rotate)]),i.push(["translate",-(n.x||n.r*Math.sin(n.phi*Math.PI/180)),-(n.y||-n.r*Math.cos(n.phi*Math.PI/180)),-n.z]),r.perspectiveScale*=n.scaleX||n.scale,e.each(s.parents,function(t,s){var a=e(s).data("stepData");i.push(["scale",1/(a.scaleX||a.scale),1/(a.scaleY||a.scale),1/a.scaleZ]),i.push(["rotate",-a.rotateX,-a.rotateY,-(a.rotateZ||a.rotate)]),i.push(["translate",-(a.x||a.r*Math.sin(a.phi*Math.PI/180)),-(a.y||-a.r*Math.cos(a.phi*Math.PI/180)),-a.z]),r.perspectiveScale*=a.scaleX||a.scale}),e.each(i,function(e,t){function r(r){s.current["rotate"+r+"-"+e]===a&&(s.current["rotate"+r+"-"+e]=t[r]||0);var n=s.current["rotate"+r+"-"+e],i=t[r]||0,o=n%360,c=i%360;0>o&&(o+=360),0>c&&(c+=360);var l=c-o;-180>l?l+=360:l>180&&(l-=360),s.current["rotate"+r+"-"+e]=t[r]=n+l}"rotate"===t[0]&&(r(1),r(2),r(3))})}),e.jmpress("applyTarget",function(t,s){var r,n=s.target,o=(s.stepData,s.settings),c=1.3*n.perspectiveScale<s.current.perspectiveScale,l=n.perspectiveScale>1.3*s.current.perspectiveScale,u=-1;e.each(n.transform,function(e,t){return 1>=t.length||"rotate"===t[0]&&0===t[1]%360&&0===t[2]%360&&0===t[3]%360?a:"scale"!==t[0]?!1:(u=e,a)}),u!==s.current.oldLastScale&&(c=l=!1,s.current.oldLastScale=u);var p=[];if(-1!==u)for(;u>=0;)"scale"===n.transform[u][0]&&(p.push(n.transform[u]),n.transform[u]=["scale"]),u--;var f=o.animation;o.reasonableAnimation[s.reason]&&(f=e.extend({},f,o.reasonableAnimation[s.reason])),r={perspective:Math.round(1e3*n.perspectiveScale)+"px"},r=e.extend({},f,r),c||(r.transitionDelay="0s"),s.beforeActive||(r.transitionDuration="0s",r.transitionDelay="0s"),e.jmpress("css",s.area,r),i.transform(s.area,p),r=e.extend({},f),l||(r.transitionDelay="0s"),s.beforeActive||(r.transitionDuration="0s",r.transitionDelay="0s"),s.current.perspectiveScale=n.perspectiveScale,e.jmpress("css",s.canvas,r),i.transform(s.canvas,n.transform)})}(jQuery,document,window),function(e){"use strict";var t=e.jmpress,s="activeClass",a="nestedActiveClass",r=t("defaults");r[a]="nested-active",r[s]="active",t("setInactive",function(t,r){var n=r.settings,i=n[s],o=n[a];i&&e(t).removeClass(i),o&&e.each(r.parents,function(t,s){e(s).removeClass(o)})}),t("setActive",function(t,r){var n=r.settings,i=n[s],o=n[a];i&&e(t).addClass(i),o&&e.each(r.parents,function(t,s){e(s).addClass(o)})})}(jQuery,document,window),function(e){"use strict";function t(t,s){return e(this).find(s.settings.stepSelector).first()}function s(t,s,a,r){if(!s)return!1;var n=a.settings.stepSelector;s=e(s);do{var i=s.near(n,r);if((0===i.length||0===i.closest(t).length)&&(i=e(t).find(n)[r?"last":"first"]()),!i.length)return!1;s=i}while(s.data("stepData").exclude);return s}var a=e.jmpress;a("initStep",function(e,t){t.stepData.exclude=t.data.exclude&&-1===["false","no"].indexOf(t.data.exclude)}),a("selectInitialStep",t),a("selectHome",t),a("selectEnd",function(t,s){return e(this).find(s.settings.stepSelector).last()}),a("selectPrev",function(e,t){return s(this,e,t,!0)}),a("selectNext",function(e,t){return s(this,e,t)})}(jQuery,document,window),function(e){"use strict";e.jmpress("selectInitialStep",function(e,t){return t.settings.start})}(jQuery,document,window),function(e){"use strict";function t(t,s,a){for(var r=0;s.length-1>r;r++){var n=s[r],i=s[r+1];e(t).jmpress("initialized")?e(n,t).data("stepData")[a]=i:e(n,t).attr("data-"+a,i)}}function s(t,s,a,r){var n=s.stepData;if(n[a]){var i=e(t).near(n[a],r);if(i&&i.length)return i;if(i=e(n[a],this)[r?"last":"first"](),i&&i.length)return i}}var a=e.jmpress;a("register","route",function(e,s,a){"string"==typeof e&&(e=[e,e]),t(this,e,a?"prev":"next"),s||t(this,e.reverse(),a?"next":"prev")}),a("initStep",function(e,t){for(var s in{next:1,prev:1})t.stepData[s]=t.data[s]}),a("selectNext",function(e,t){return s.call(this,e,t,"next")}),a("selectPrev",function(e,t){return s.call(this,e,t,"prev",!0)})}(jQuery,document,window),function(e){"use strict";var t=e.jmpress,s="ajax:afterStepLoaded",a="ajax:loadStep";t("register",a),t("register",s),t("defaults").ajaxLoadedClass="loaded",t("initStep",function(t,s){s.stepData.src=e(t).attr("href")||s.data.src||!1,s.stepData.srcLoaded=!1}),t(a,function(t,a){var r=a.stepData,n=r&&r.src,i=a.settings;n&&(e(t).addClass(i.ajaxLoadedClass),r.srcLoaded=!0,e(t).load(n,function(r,n,i){e(a.jmpress).jmpress("fire",s,t,e.extend({},a,{response:r,status:n,xhr:i}))}))}),t("idle",function(t,s){if(t){var r=s.settings,n=e(this);s.stepData;var i=e(t).add(e(t).near(r.stepSelector)).add(e(t).near(r.stepSelector,!0)).add(n.jmpress("fire","selectPrev",t,{stepData:e(t).data("stepData")})).add(n.jmpress("fire","selectNext",t,{stepData:e(t).data("stepData")}));i.each(function(){var t=this,s=e(t).data("stepData");s.src&&!s.srcLoaded&&n.jmpress("fire",a,t,{stepData:e(t).data("stepData")})})}}),t("setActive",function(t){var s=e(t).data("stepData");s.src&&!s.srcLoaded&&e(this).jmpress("fire",a,t,{stepData:e(t).data("stepData")})})}(jQuery,document,window),function(e,t,s,a){"use strict";function r(){return""+Math.round(1e5*Math.random(),0)}function n(t){try{var r=e("#"+s.location.hash.replace(/^#\/?/,""));return r.length>0&&r.is(t.stepSelector)?r:a}catch(n){}}function i(e){var t="#/"+e;s.history&&s.history.pushState?s.location.hash!==t&&s.history.pushState({},"",t):s.location.hash!==t&&(s.location.hash=t)}var o=e.jmpress,c="a[href^=#]";o("defaults").hash={use:!0,update:!0,bindChange:!0},o("selectInitialStep",function(t,o){var l=o.settings,u=l.hash,p=o.current,f=e(this);return o.current.hashNamespace=".jmpress-"+r(),u.use?(u.bindChange&&(e(s).bind("hashchange"+p.hashNamespace,function(e){var t=n(l);f.jmpress("initialized")&&f.jmpress("scrollFix"),t&&t.length&&(t.attr("id")!==f.jmpress("active").attr("id")&&f.jmpress("select",t),i(t.attr("id"))),e.preventDefault()}),e(c).on("click"+p.hashNamespace,function(t){var s=e(this).attr("href");try{e(s).is(l.stepSelector)&&(f.jmpress("select",s),t.preventDefault(),t.stopPropagation())}catch(a){}})),n(l)):a}),o("afterDeinit",function(t,a){e(c).off(a.current.hashNamespace),e(s).unbind(a.current.hashNamespace)}),o("setActive",function(t,s){var a=s.settings,r=s.current;a.hash.use&&a.hash.update&&(clearTimeout(r.hashtimeout),r.hashtimeout=setTimeout(function(){i(e(s.delegatedFrom).attr("id"))},a.transitionDuration+200))})}(jQuery,document,window),function(e,t,s,a){"use strict";function r(){return""+Math.round(1e5*Math.random(),0)}function n(e){e.preventDefault(),e.stopPropagation()}var i=e.jmpress,o="next",c="prev";i("defaults").keyboard={use:!0,keys:{33:c,37:c,38:c,9:o+":"+c,32:o,34:o,39:o,40:o,36:"home",35:"end"},ignore:{INPUT:[32,37,38,39,40],TEXTAREA:[32,37,38,39,40],SELECT:[38,40]},tabSelector:"a[href]:visible, :input:visible"},i("afterInit",function(s,i){var o=i.settings,c=o.keyboard,l=c.ignore,u=i.current,p=e(this);o.fullscreen||p.attr("tabindex",0),u.keyboardNamespace=".jmpress-"+r(),e(o.fullscreen?t:p).bind("keypress"+u.keyboardNamespace,function(e){for(var t in l)if(e.target.nodeName===t&&-1!==l[t].indexOf(e.which))return;(e.which>=37&&40>=e.which||32===e.which)&&n(e)}),e(o.fullscreen?t:p).bind("keydown"+u.keyboardNamespace,function(t){var s=e(t.target);if((o.fullscreen||s.closest(p).length)&&c.use){for(var r in l)if(s[0].nodeName===r&&-1!==l[r].indexOf(t.which))return;var i,u=!1;if(9===t.which){if(s.closest(p.jmpress("active")).length?(i=s.near(c.tabSelector,t.shiftKey),e(i).closest(o.stepSelector).is(p.jmpress("active"))||(i=a)):t.shiftKey?u=!0:i=p.jmpress("active").find("a[href], :input").filter(":visible").first(),i&&i.length>0)return i.focus(),p.jmpress("scrollFix"),n(t),a;t.shiftKey&&(u=!0)}var f=c.keys[t.which];"string"==typeof f?(-1!==f.indexOf(":")&&(f=f.split(":"),f=t.shiftKey?f[1]:f[0]),p.jmpress(f),n(t)):e.isFunction(f)?f.call(p,t):f&&(p.jmpress.apply(p,f),n(t)),u&&(i=p.jmpress("active").find("a[href], :input").filter(":visible").last(),i.focus(),p.jmpress("scrollFix"))}})}),i("afterDeinit",function(s,a){e(t).unbind(a.current.keyboardNamespace)})}(jQuery,document,window),function(e,t,s,a){"use strict";function r(){return""+Math.round(1e5*Math.random(),0)}function n(e,t){return Math.max(Math.min(e,t),-t)}function i(t,s,a){var r=e(this).jmpress("current"),i=e(this).jmpress("settings"),o=e(this).jmpress("active").data("stepData"),c=e(this).jmpress("container");if(!(0===r.userZoom&&0>a)){var l=o.viewPortZoomable||i.viewPort.zoomable;if(!(r.userZoom===l&&a>0)){r.userZoom+=a;var u=e(c).innerWidth()/2,p=e(c).innerHeight()/2;t=t?t-u:t,s=s?s-p:s,r.userTranslateX=n(r.userTranslateX-a*t/r.zoomOriginWindowScale/l,u*r.userZoom*r.userZoom/l),r.userTranslateY=n(r.userTranslateY-a*s/r.zoomOriginWindowScale/l,p*r.userZoom*r.userZoom/l),e(this).jmpress("reselect","zoom")}}}var o=function(){var e=navigator.userAgent.toLowerCase(),t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return t[1]||""}(),c=e.jmpress("defaults");c.viewPort={width:!1,height:!1,maxScale:0,minScale:0,zoomable:0,zoomBindMove:!0,zoomBindWheel:!0};var l=c.keyboard.keys;l["mozilla"===o?107:187]="zoomIn",l["mozilla"===o?109:189]="zoomOut",c.reasonableAnimation.resize={transitionDuration:"0s",transitionDelay:"0ms"},c.reasonableAnimation.zoom={transitionDuration:"0s",transitionDelay:"0ms"},e.jmpress("initStep",function(e,t){for(var s in{viewPortHeight:1,viewPortWidth:1,viewPortMinScale:1,viewPortMaxScale:1,viewPortZoomable:1})t.stepData[s]=t.data[s]&&parseFloat(t.data[s])}),e.jmpress("afterInit",function(n,i){var o=this;i.current.viewPortNamespace=".jmpress-"+r(),e(s).bind("resize"+i.current.viewPortNamespace,function(){e(o).jmpress("reselect","resize")}),i.current.userZoom=0,i.current.userTranslateX=0,i.current.userTranslateY=0,i.settings.viewPort.zoomBindWheel&&e(i.settings.fullscreen?t:this).bind("mousewheel"+i.current.viewPortNamespace+" DOMMouseScroll"+i.current.viewPortNamespace,function(t,s){s=s||t.originalEvent.wheelDelta||-t.originalEvent.detail;var a=s/Math.abs(s);return 0>a?e(i.jmpress).jmpress("zoomOut",t.originalEvent.x,t.originalEvent.y):a>0&&e(i.jmpress).jmpress("zoomIn",t.originalEvent.x,t.originalEvent.y),!1}),i.settings.viewPort.zoomBindMove&&e(i.settings.fullscreen?t:this).bind("mousedown"+i.current.viewPortNamespace,function(e){i.current.userZoom&&(i.current.userTranslating={x:e.clientX,y:e.clientY},e.preventDefault(),e.stopImmediatePropagation())}).bind("mousemove"+i.current.viewPortNamespace,function(t){var s=i.current.userTranslating;s&&(e(o).jmpress("zoomTranslate",t.clientX-s.x,t.clientY-s.y),s.x=t.clientX,s.y=t.clientY,t.preventDefault(),t.stopImmediatePropagation())}).bind("mouseup"+i.current.viewPortNamespace,function(e){i.current.userTranslating&&(i.current.userTranslating=a,e.preventDefault(),e.stopImmediatePropagation())})}),e.jmpress("register","zoomIn",function(e,t){i.call(this,e||0,t||0,1)}),e.jmpress("register","zoomOut",function(e,t){i.call(this,e||0,t||0,-1)}),e.jmpress("register","zoomTranslate",function(t,s){var a=e(this).jmpress("current"),r=e(this).jmpress("settings"),i=e(this).jmpress("active").data("stepData"),o=e(this).jmpress("container"),c=i.viewPortZoomable||r.viewPort.zoomable,l=e(o).innerWidth(),u=e(o).innerHeight();a.userTranslateX=n(a.userTranslateX+t/a.zoomOriginWindowScale,l*a.userZoom*a.userZoom/c),a.userTranslateY=n(a.userTranslateY+s/a.zoomOriginWindowScale,u*a.userZoom*a.userZoom/c),e(this).jmpress("reselect","zoom")}),e.jmpress("afterDeinit",function(a,r){e(r.settings.fullscreen?t:this).unbind(r.current.viewPortNamespace),e(s).unbind(r.current.viewPortNamespace)}),e.jmpress("setActive",function(t,s){var a=s.settings.viewPort,r=s.stepData.viewPortHeight||a.height,n=s.stepData.viewPortWidth||a.width,i=s.stepData.viewPortMaxScale||a.maxScale,o=s.stepData.viewPortMinScale||a.minScale,c=r&&e(s.container).innerHeight()/r,l=n&&e(s.container).innerWidth()/n,u=(l||c)&&Math.min(l||c,c||l);if(u){u=u||1,i&&(u=Math.min(u,i)),o&&(u=Math.max(u,o));var p=s.stepData.viewPortZoomable||s.settings.viewPort.zoomable;if(p){var f=1/u-1/i;f/=p,u=1/(1/u-f*s.current.userZoom)}s.target.transform.reverse(),s.current.userTranslateX&&s.current.userTranslateY?s.target.transform.push(["translate",s.current.userTranslateX,s.current.userTranslateY,0]):s.target.transform.push(["translate"]),s.target.transform.push(["scale",u,u,1]),s.target.transform.reverse(),s.target.perspectiveScale/=u}s.current.zoomOriginWindowScale=u}),e.jmpress("setInactive",function(t,s){s.nextStep&&t&&e(s.nextStep).attr("id")===e(t).attr("id")||(s.current.userZoom=0,s.current.userTranslateX=0,s.current.userTranslateY=0)})}(jQuery,document,window),function(e){"use strict";function t(){return""+Math.round(1e5*Math.random(),0)}var s=e.jmpress;s("defaults").mouse={clickSelects:!0},s("afterInit",function(s,a){var r=a.settings,n=r.stepSelector,i=a.current,o=e(this);i.clickableStepsNamespace=".jmpress-"+t(),o.bind("click"+i.clickableStepsNamespace,function(t){if(r.mouse.clickSelects&&!i.userZoom){var s=e(t.target).closest(n);s.is(o.jmpress("active"))||s.length&&(o.jmpress("select",s[0],"click"),t.preventDefault(),t.stopPropagation())}})}),s("afterDeinit",function(t,s){e(this).unbind(s.current.clickableStepsNamespace)})}(jQuery,document,window),function(e,t){"use strict";function s(){return""+Math.round(1e5*Math.random(),0)}var a=e.jmpress;a("afterInit",function(a,r){var n=r.settings,i=r.current,o=r.jmpress;i.mobileNamespace=".jmpress-"+s();var c,l=[0,0];e(n.fullscreen?t:o).bind("touchstart"+i.mobileNamespace,function(e){c=e.originalEvent.touches[0],l=[c.pageX,c.pageY]}).bind("touchmove"+i.mobileNamespace,function(e){return c=e.originalEvent.touches[0],e.preventDefault(),!1}).bind("touchend"+i.mobileNamespace,function(t){var s=[c.pageX,c.pageY],a=[s[0]-l[0],s[1]-l[1]];return Math.max(Math.abs(a[0]),Math.abs(a[1]))>50?(a=Math.abs(a[0])>Math.abs(a[1])?a[0]:a[1],e(o).jmpress(a>0?"prev":"next"),t.preventDefault(),!1):undefined})}),a("afterDeinit",function(s,a){var r=a.settings,n=a.current,i=a.jmpress;e(r.fullscreen?t:i).unbind(n.mobileNamespace)})}(jQuery,document,window),function(e,t,s,a){"use strict";function r(t,s,n){for(var i in s){var o=i;n&&(o=n+o.substr(0,1).toUpperCase()+o.substr(1)),e.isPlainObject(s[i])?r(t,s[i],o):t[o]===a&&(t[o]=s[i])}}function n(t,s){e.isArray(s)?s.length<t.length?e.error("more nested steps than children in template"):t.each(function(t,a){a=e(a);var n=a.data(l)||{};r(n,s[t]),a.data(l,n)}):e.isFunction(s)&&t.each(function(a,n){n=e(n);var i=n.data(l)||{};r(i,s(a,n,t)),n.data(l,i)})}function i(e,t,s,a){if(s.children){var r=t.children(a.settings.stepSelector);n(r,s.children)}o(e,s)}function o(e,t){r(e,t)}var c=e.jmpress,l="_template_",u="_applied_template_",p={};c("beforeInitStep",function(t,s){t=e(t);var a=s.data,r=a.template,n=t.data(u),o=t.data(l);r&&e.each(r.split(" "),function(e,r){var n=p[r];i(a,t,n,s)}),n&&i(a,t,n,s),o&&(i(a,t,o,s),t.data(l,null),o.template&&e.each(o.template.split(" "),function(e,r){var n=p[r];i(a,t,n,s)}))}),c("beforeInit",function(t,s){var a=c("dataset",this),r=a.template,i=s.settings.stepSelector;if(r){var o=p[r];n(e(this).find(i).filter(function(){return!e(this).parent().is(i)}),o.children)}}),c("register","template",function(t,s){p[t]=p[t]?e.extend(!0,{},p[t],s):e.extend(!0,{},s)}),c("register","apply",function(t,s){if(s)if(e.isArray(s))n(e(t),s);else{var a;a="string"==typeof s?p[s]:e.extend(!0,{},s),e(t).each(function(t,s){s=e(s);var n=s.data(u)||{};r(n,a),s.data(u,n)})}else{var i=e(this).jmpress("settings").stepSelector;n(e(this).find(i).filter(function(){return!e(this).parent().is(i)}),t)}})}(jQuery,document,window),function(e){"use strict";e.jmpress("setActive",function(t,s){s.prevStep!==t&&e(t).triggerHandler("enterStep")}),e.jmpress("setInactive",function(t,s){s.nextStep!==t&&e(t).triggerHandler("leaveStep")})}(jQuery,document,window),function(e,t,s,a){"use strict";function r(t){for(var s=t.split(" "),a=s[0],r={willClass:"will-"+a,doClass:"do-"+a,hasClass:"has-"+a},n="",i=1;s.length>i;i++){var o=s[i];switch(n){case"":"after"===o?n="after":e.warn("unknown keyword in '"+t+"'. '"+o+"' unknown.");break;case"after":if(o.match(/^[1-9][0-9]*m?s?/)){var c=parseFloat(o);-1!==o.indexOf("ms")?c*=1:-1!==o.indexOf("s")?c*=1e3:-1!==o.indexOf("m")&&(c*=6e4),r.delay=c}else r.after=Array.prototype.slice.call(s,i).join(" "),i=s.length}}return r}function n(t,s,a,r){r=r||t.length-1,a=a||0;for(var n=a;r+1>n;n++)if(e(t[n].element).is(s))return n}function i(t,s,a){e.each(s._on,function(e,s){t.push({substep:s.substep,delay:s.delay+a}),i(t,s.substep,s.delay+a)})}e.jmpress("defaults").customAnimationDataAttribute="jmpress",e.jmpress("afterInit",function(e,t){t.current.animationTimeouts=[],t.current.animationCleanupWaiting=[]}),e.jmpress("applyStep",function(t,s){function o(e,t){return t.substep._after?(u=t.substep._after,!1):a}var c={},l=[];if(e(t).find("[data-"+s.settings.customAnimationDataAttribute+"]").each(function(a,r){e(r).closest(s.settings.stepSelector).is(t)&&l.push({element:r})}),0!==l.length){e.each(l,function(t,a){a.info=r(e(a.element).data(s.settings.customAnimationDataAttribute)),e(a.element).addClass(a.info.willClass),a._on=[],a._after=null});var u={_after:a,_on:[],info:{}};if(e.each(l,function(e,t){var s=t.info.after;if(s)if("step"===s)s=u;else if("prev"===s)s=l[e-1];else{var r=n(l,s,0,e-1);r===a&&(r=n(l,s)),s=r===a||r===e?l[e-1]:l[r]}else s=l[e-1];if(s){if(!t.info.delay){if(!s._after)return s._after=t,a;s=s._after}s._on.push({substep:t,delay:t.info.delay||0})}}),u._after===a&&0===u._on.length){var p=n(l,s.stepData.startSubstep)||0;u._after=l[p]}var f=[];do{var d=[{substep:u,delay:0}];i(d,u,0),f.push(d),u=null,e.each(d,o)}while(u);c.list=f,e(t).data("substepsData",c)}}),e.jmpress("unapplyStep",function(t){var s=e(t).data("substepsData");s&&e.each(s.list,function(t,s){e.each(s,function(t,s){s.substep.info.willClass&&e(s.substep.element).removeClass(s.substep.info.willClass),s.substep.info.hasClass&&e(s.substep.element).removeClass(s.substep.info.hasClass),s.substep.info.doClass&&e(s.substep.element).removeClass(s.substep.info.doClass)})})}),e.jmpress("setActive",function(t,s){var r=e(t).data("substepsData");if(r){s.substep===a&&(s.substep="prev"===s.reason?r.list.length-1:0);var n=s.substep;e.each(s.current.animationTimeouts,function(e,t){clearTimeout(t)}),s.current.animationTimeouts=[],e.each(r.list,function(t,a){var r=n>t,i=n>=t;e.each(a,function(t,a){function n(){e(a.substep.element).addClass(a.substep.info.doClass)}a.substep.info.hasClass&&e(a.substep.element)[(r?"add":"remove")+"Class"](a.substep.info.hasClass),i&&!r&&a.delay&&"prev"!==s.reason?a.substep.info.doClass&&(e(a.substep.element).removeClass(a.substep.info.doClass),s.current.animationTimeouts.push(setTimeout(n,a.delay))):a.substep.info.doClass&&e(a.substep.element)[(i?"add":"remove")+"Class"](a.substep.info.doClass)})})}}),e.jmpress("setInactive",function(t,s){function a(t){e.each(t.list,function(t,s){e.each(s,function(t,s){s.substep.info.hasClass&&e(s.substep.element).removeClass(s.substep.info.hasClass),s.substep.info.doClass&&e(s.substep.element).removeClass(s.substep.info.doClass)})})}if(s.nextStep!==t){e.each(s.current.animationCleanupWaiting,function(e,t){a(t)}),s.current.animationCleanupWaiting=[];var r=e(t).data("substepsData");r&&s.current.animationCleanupWaiting.push(r)}}),e.jmpress("selectNext",function(t,s){if(s.substep!==a){var r=e(t).data("substepsData");if(r)return s.substep<r.list.length-1?{step:t,substep:s.substep+1}:a}}),e.jmpress("selectPrev",function(t,s){if(s.substep!==a){var r=e(t).data("substepsData");if(r)return s.substep>0?{step:t,substep:s.substep-1}:a}})}(jQuery,document,window);;
! function (a) {
    a.Dasky = function (b, c) {
        var d = this;
        d.$el = a(b), d.$el.data("dasky", d), d._init = function (b) {
            var c = document.body,
                e = navigator.userAgent.toLowerCase(),
                f = function () {
                    var a = document.createElement("dummy").style,
                        b = "Webkit Moz O ms Khtml".split(" "),
                        c = {};
                    return function (d) {
                        var e, f, g;
                        if ("undefined" == typeof c[d]) {
                            e = d.charAt(0).toUpperCase() + d.substr(1), f = (d + " " + b.join(e + " ") + e).split(" "), c[d] = null;
                            for (g in f)
                                if (void 0 !== a[f[g]]) {
                                    c[d] = f[g];
                                    break
                                }
                        }
                        return c[d]
                    }
                }(),
                g = null !== f("perspective") && c.classList && c.dataset && -1 === e.search(/(iphone)|(ipod)|(android)/);
            if (g) {
                if (d.$el.addClass("dsk-supported"), !a.jmpress) return alert("The page do not include jmpress js file,Dasky will not work!"), void 0;
                d.options = a.extend(!0, {}, a.Dasky.defaults, b), d.$steps = d.$el.children("div"), d._layout(), d._initJmpress(), d._loadEvents(), d.options.autoplay && d._startSlider()
            } else d.$el.addClass("dsk-not-supported")
        }, d._layout = function () {
            d.$slideWrapper = d.$steps.wrapAll('<div class="dsk-wrapper"></div>').parent(), d.$slideWrapper.wrap('<div class="dsk-linewrapper"></div>'), d.options.nav && (d.$nav = a('<div class="dsk-nav"></div>'), d.$pre = a('<span class="dsk-pre"></span>').appendTo(d.$nav), d.$next = a('<span class="dsk-next"></span>').appendTo(d.$nav), d.$pause = a('<span class="dsk-autoplay"></span>').appendTo(d.$nav), d.$el.append(d.$nav)), d.options.fullscreen && (a("html,body").css({
                height: "100%"
            }), d.$el.css({
                height: "100%"
            }))
        }, d._initJmpress = function () {
            a.jmpress("template", "daskytpl", {
                children: function (a, b) {
                    var d = b.has(".dsk-titlenode").size() > 0;
                    return {
                        y: 0,
                        x: d ? 200 * (a - .5) : 200 * a,
                        scale: d > 0 ? .5 : 1
                    }
                }
            }), d.$slideWrapper.attr("data-template", "daskytpl").jmpress({
                viewPort: {
                    height: 550,
                    width: 1e3,
                    maxScale: 1
                },
                fullscreen: d.options.fullscreen,
                keyboard: {
                    use: d.options.keyboard
                }
            })
        }, d._startSliderTimer = function () {
            d.slideTimer = setTimeout(function () {
                d.$slideWrapper.jmpress("next"), d.options.autoplay && d._startSliderTimer()
            }, d.options.interval)
        }, d._startSlider = function () {
            d.options.autoplay = !0, d._startSliderTimer(), d.options.nav && d.$pause.addClass("playing")
        }, d._stopSlider = function () {
            d.options.autoplay && (clearTimeout(d.slideTimer), d.options.autoplay = !1, d.options.nav && d.$pause.removeClass("playing"))
        }, d._loadEvents = function () {
            d.options.nav && (d.$pre.on("click.dasky", function () {
                d._stopSlider(), d.$slideWrapper.jmpress("prev")
            }), d.$next.on("click.dasky", function () {
                d._stopSlider(), d.$slideWrapper.jmpress("next")
            }), d.$pause.on("click.dasky", function () {
                d.options.autoplay ? d._stopSlider() : d._startSlider()
            }), d.$slideWrapper.on("click.dasky", function () {
                d._stopSlider()
            }));
            var a = function (a, b) {
                d._stopSlider(), 0 > b ? d.$slideWrapper.jmpress("next") : d.$slideWrapper.jmpress("prev"), a.preventDefault()
            };
            d.options.mousewheel && (d.$slideWrapper.on("mousewheel.dasky", a), d.$el.on("mousewheel.dasky", a))
        }, d._init(c)
    }, a.Dasky.defaults = {
        autoplay: !0,
        nav: !0,
        interval: 4e3,
        mousewheel: !0,
        keyboard: !0,
        fullscreen: !0
    }, a.fn.Dasky = function (b) {
        return this.each(function () {
            new a.Dasky(this, b)
        })
    }
}(jQuery),
function (a) {
    function d(b) {
        var c = b || window.event,
            d = [].slice.call(arguments, 1),
            e = 0,
            g = 0,
            h = 0;
        return b = a.event.fix(c), b.type = "mousewheel", c.wheelDelta && (e = c.wheelDelta / 120), c.detail && (e = -c.detail / 3), h = e, void 0 !== c.axis && c.axis === c.HORIZONTAL_AXIS && (h = 0, g = -1 * e), void 0 !== c.wheelDeltaY && (h = c.wheelDeltaY / 120), void 0 !== c.wheelDeltaX && (g = -1 * c.wheelDeltaX / 120), d.unshift(b, e, g, h), (a.event.dispatch || a.event.handle).apply(this, d)
    }
    var c, b = ["DOMMouseScroll", "mousewheel"];
    if (a.event.fixHooks)
        for (c = b.length; c;) a.event.fixHooks[b[--c]] = a.event.mouseHooks;
    a.event.special.mousewheel = {
        setup: function () {
            if (this.addEventListener)
                for (var a = b.length; a;) this.addEventListener(b[--a], d, !1);
            else this.onmousewheel = d
        },
        teardown: function () {
            if (this.removeEventListener)
                for (var a = b.length; a;) this.removeEventListener(b[--a], d, !1);
            else this.onmousewheel = null
        }
    }, a.fn.extend({
        mousewheel: function (a) {
            return a ? this.bind("mousewheel", a) : this.trigger("mousewheel")
        },
        unmousewheel: function (a) {
            return this.unbind("mousewheel", a)
        }
    })
}(jQuery);
;
/*
                      _____              _____              _____             _______         
                     /\    \            /\    \            /\    \           /::\    \        
                    /::\    \          /::\    \          /::\    \         /::::\    \       
                   /::::\    \         \:::\    \        /::::\    \       /::::::\    \      
                  /::::::\    \         \:::\    \      /::::::\    \     /::::::::\    \     
                 /:::/\:::\    \         \:::\    \    /:::/\:::\    \   /:::/~~\:::\    \    
                /:::/__\:::\    \         \:::\    \  /:::/__\:::\    \ /:::/    \:::\    \   
               /::::\   \:::\    \        /::::\    \ \:::\   \:::\    \:::/    / \:::\    \  
              /::::::\   \:::\    \__    /::::::\    \_\:::\   \:::\    \:/____/   \:::\____\ 
             /:::/\:::\   \:::\____\ \  /:::/\:::\    \ \:::\   \:::\    \    |     |:::|    |
            /:::/  \:::\   \:::|    | \/:::/  \:::\____\ \:::\   \:::\____\___|     |:::|____|
            \::/   |::::\  /:::|____| /:::/    \::/    /  \:::\   \::/    /   _\___/:::/    / 
             \/____|:::::\/:::/    /\/:::/    / \/____/\   \:::\   \/____/:\ |::| /:::/    /  
                   |:::::::::/    /:::::/    /      \:::\   \:::\    \  \:::\|::|/:::/    /   
                   |::|\::::/    /\::::/____/        \:::\   \:::\____\  \::::::::::/    /    
                   |::| \::/____/  \:::\    \         \:::\  /:::/    /   \::::::::/    /     
                   |::|  ~|         \:::\    \         \:::\/:::/    /     \::::::/    /      
                   |::|   |          \:::\    \         \::::::/    /       \::::/____/       
                   \::|   |           \:::\____\         \::::/    /         |::|    |        
                    \:|   |            \::/    /          \::/    /          |::|____|        
                     \|___|             \/____/            \/____/            ~~              
                                                                                                                
     ____.________                                  _____       .___                                     .___ 
    |    |\_____  \  __ __   ___________ ___.__.   /  _  \    __| _/__  _______    ____   ____  ____   __| _/ 
    |    | /  / \  \|  |  \_/ __ \_  __ <   |  |  /  /_\  \  / __ |\  \/ /\__  \  /    \_/ ___\/ __ \ / __ |  
/\__|    |/   \_/.  \  |  /\  ___/|  | \/\___  | /    |    \/ /_/ | \   /  / __ \|   |  \  \__\  ___// /_/ |  
\________|\_____\ \_/____/  \___  >__|   / ____| \____|__  /\____ |  \_/  (____  /___|  /\___  >___  >____ |  
                 \__>           \/       \/              \/      \/            \/     \/     \/    \/     \/  
                   _______                        ___________.__        __                                    
                   \      \   ______  _  ________ \__    ___/|__| ____ |  | __ ___________                    
          ______   /   |   \_/ __ \ \/ \/ /  ___/   |    |   |  |/ ___\|  |/ // __ \_  __ \   ______          
         /_____/  /    |    \  ___/\     /\___ \    |    |   |  \  \___|    <\  ___/|  | \/  /_____/          
                  \____|__  /\___  >\/\_//____  >   |____|   |__|\___  >__|_ \\___  >__|                      
                          \/     \/           \/                     \/     \/    \/                          
*/

;
(function($, window, document, undefined) {
        'use strict';
        // undefined is used here as the undefined global variable in ECMAScript 3 is
        // mutable (ie. it can be hasMoved by someone else). undefined isn't really being
        // passed in so we can ensure the value of it is truly undefined. In ES5, undefined
        // can no longer be modified.

        // window and document are passed through as local variable rather than global
        // as this (slightly) quickens the resolution process and can be more efficiently
        // minified (especially when both are regularly referenced in your plugin).

        // Create the defaults once
        var pluginName = 'newsTicker',
                defaults = {
                        row_height: 20,
                        max_rows: 3,
                        speed: 400,
                        duration: 2500,
                        direction: 'up',
                        autostart: 1,
                        pauseOnHover: 1,
                        nextButton: null,
                        prevButton: null,
                        startButton: null,
                        stopButton: null,
                        hasMoved: function() {},
                        movingUp: function() {},
                        movingDown: function() {},
                        start: function() {},
                        stop: function() {},
                        pause: function() {},
                        unpause: function() {}
                };

        // The actual plugin constructor
        function Plugin(element, options) {
                this.element = element;
                this.$el = $(element);
                this.options = $.extend({}, defaults, options);
                this._defaults = defaults;
                this._name = pluginName;
                this.moveInterval;
                this.state = 0;
                this.paused = 0;
                this.moving = 0;
                if (this.$el.is('ul')) {
                        this.init();
                }
        }

        Plugin.prototype = {
                init: function() {
                        this.$el.height(this.options.row_height * this.options.max_rows)
                                .css({overflow : 'hidden'});

                        this.checkSpeed();

                        if(this.options.nextButton && typeof(this.options.nextButton[0]) !== 'undefined')
                                this.options.nextButton.click(function(e) {
                                        this.moveNext();
                                        this.resetInterval();
                                }.bind(this));
                        if(this.options.prevButton && typeof(this.options.prevButton[0]) !== 'undefined')
                                this.options.prevButton.click(function(e) {
                                        this.movePrev();
                                        this.resetInterval();
                                }.bind(this));
                        if(this.options.stopButton && typeof(this.options.stopButton[0]) !== 'undefined')
                                this.options.stopButton.click(function(e) {
                                        this.stop()
                                }.bind(this));
                        if(this.options.startButton && typeof(this.options.startButton[0]) !== 'undefined')
                                this.options.startButton.click(function(e) {
                                        this.start()
                                }.bind(this));
                        
                        if(this.options.pauseOnHover) {
                                this.$el.hover(function() {
                                        if (this.state)
                                                this.pause();
                                }.bind(this), function() {
                                        if (this.state)
                                                this.unpause();
                                }.bind(this));
                        }

                        if(this.options.autostart)
                                this.start();
                },

                start: function() {
                        if (!this.state) {
                                this.state = 1;
                                this.resetInterval();
                                this.options.start();
                        }
                },

                stop: function() {
                        if (this.state) {
                                clearInterval(this.moveInterval);
                                this.state = 0;
                                this.options.stop();
                        }
                },

                resetInterval: function() {
                        if (this.state) {
                                clearInterval(this.moveInterval);
                                this.moveInterval = setInterval(function() {this.move()}.bind(this), this.options.duration);
                        }
                },

                move: function() {
                         if (!this.paused) this.moveNext();
                },

                moveNext: function() {
                        if (this.options.direction === 'down')
                                this.moveDown();
                        else if (this.options.direction === 'up')
                                this.moveUp();
                },

                movePrev: function() {
                        if (this.options.direction === 'down')
                                this.moveUp();
                        else if (this.options.direction === 'up')
                                this.moveDown();
                },

                pause: function() {
                        if (!this.paused) this.paused = 1;
                        this.options.pause();
                },

                unpause: function() {
                        if (this.paused) this.paused = 0;
                        this.options.unpause();
                },

                moveDown: function() {
                        if (!this.moving) {
                                this.moving = 1;
                                this.options.movingDown();
                                this.$el.children('li:last').detach().prependTo(this.$el).css('marginTop', '-' + this.options.row_height + 'px')
                                        .animate({marginTop: '0px'}, this.options.speed, function(){
                                                this.moving = 0;
                                                this.options.hasMoved();
                                        }.bind(this));
                        }
                },

                moveUp: function() {
                        if (!this.moving) {
                                this.moving = 1;
                                this.options.movingUp();
                                var element = this.$el.children('li:first');
                                element.animate({marginTop: '-' + this.options.row_height + 'px'}, this.options.speed,
                                        function(){
                                                element.detach().css('marginTop', '0').appendTo(this.$el);
                                                this.moving = 0;
                                                this.options.hasMoved();
                                        }.bind(this));
                        }
                },

                updateOption: function(option, value) {
                        if (typeof(this.options[option]) !== 'undefined'){
                                this.options[option] = value;
                                if (option == 'duration' || option == 'speed'){
                                    this.checkSpeed();
                                    this.resetInterval();
                                }
                        }
                },

                getState: function() {
                        if (paused) return 2
                        else return this.state;//0 = stopped, 1 = started
                },

                checkSpeed: function() {
                        if (this.options.duration < (this.options.speed + 25))
                                this.options.speed = this.options.duration - 25;
                },

                destroy: function() {
                        this._destroy(); //or this.delete; depends on jQuery version
                }
        };

        // A really lightweight plugin wrapper around the constructor,
        // preventing against multiple instantiations
        $.fn[pluginName] = function(option) {
                var args = arguments;
                
                return this.each(function() {
                        var $this = $(this),
                                data = $.data(this, 'plugin_' + pluginName),
                                options = typeof option === 'object' && option;
                        if (!data) {
                                $this.data('plugin_' + pluginName, (data = new Plugin(this, options)));
                        }
                        // if first argument is a string, call silimarly named function
                        // this gives flexibility to call functions of the plugin e.g.
                        //   - $('.dial').plugin('destroy');
                        //   - $('.dial').plugin('render', $('.new-child'));
                        if (typeof option === 'string') {
                                data[option].apply(data, Array.prototype.slice.call(args, 1));
                        }
                });
        };
})(jQuery, window, document);;
/**
* http://hekigan.github.io/is-loading/
* Loading plugin for jQuery
* version: v1.0.6
* 
* Small helper to give the user a visual feedback that something is happening 
* when fetching/posting data
* 
* USAGE:
* - global overlay:                     $.isLoading();
* - use javascript:                     $( selector ).isLoading();
* - On non-form elements:               $("div").isLoading({ text: "Loading", position:'inside'});
* - remove the loading element:         $( selector ).isLoading( "hide" );
*
* @author Laurent Blanes <laurent.blanes@gmail.com>
* ---
* Copyright 2013, Laurent Blanes ( https://github.com/hekigan/is-loading )
* 
* The MIT License (MIT)
* 
* Copyright (c) 2013 Laurent Blanes
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
; (function ($, window, document, undefined) {

  // Create the defaults once
  var pluginName = "isLoading",
      defaults = {
        'position': "right",        // right | inside | overlay
        'text': "",                 // Text to display next to the loader
        'class': "icon-refresh",    // loader CSS class
        'tpl': '<span class="isloading-wrapper %wrapper%">%text%<i class="%class% icon-spin"></i></span>',    // loader base Tag
        'disableSource': true,      // true | false
        'disableOthers': []
      };

  // The actual plugin constructor
  function Plugin(element, options) {
    this.element = element;

    // Merge user options with default ones
    this.options = $.extend({}, defaults, options);

    this._defaults = defaults;
    this._name = pluginName;
    this._loader = null;                // Contain the loading tag element

    this.init();
  }

  // Contructor function for the plugin (only once on page load)
  function contruct() {

    if (!$[pluginName]) {
      $.isLoading = function (opts) {
        $("body").isLoading(opts);
      };
    }
  }

  Plugin.prototype = {

    init: function () {

      if ($(this.element).is("body")) {
        this.options.position = "overlay";
      }
      this.show();
    },

    show: function () {

      var self = this,
          tpl = self.options.tpl.replace('%wrapper%', ' isloading-show ' + ' isloading-' + self.options.position);
      tpl = tpl.replace('%class%', self.options['class']);
      tpl = tpl.replace('%text%', (self.options.text !== "") ? self.options.text + ' ' : '');
      self._loader = $(tpl);

      // Disable the element
      if ($(self.element).is("input, textarea") && true === self.options.disableSource) {

        $(self.element).attr("disabled", "disabled");

      }
      else if (true === self.options.disableSource) {

        $(self.element).addClass("disabled");

      }

      // Set position
      switch (self.options.position) {

        case "inside":
          $(self.element).html(self._loader);
          break;

        case "overlay":
          var $wrapperTpl = null;

          if ($(self.element).is("body")) {
            $wrapperTpl = $('<div class="isloading-overlay" style="position:fixed; left:0; top:0; z-index: 10000; background: rgba(0,0,0,0.5); width: 100%; height: ' + $(window).height() + 'px;" />');
            $("body").prepend($wrapperTpl);

            $(window).on('resize', function () {
              $wrapperTpl.height($(window).height() + 'px');
              self._loader.css({ top: ($(window).height() / 2 - self._loader.outerHeight() / 2) + 'px' });
            });
          } else {
            var cssPosition = $(self.element).css('position'),
                pos = {},
                height = $(self.element).outerHeight() + 'px',
                width = '100%'; // $( self.element ).outerWidth() + 'px;

            if ('relative' === cssPosition || 'absolute' === cssPosition) {
              pos = { 'top': 0, 'left': 0 };
            } else {
              pos = $(self.element).position();
            }
            $wrapperTpl = $('<div class="isloading-overlay" style="position:absolute; top: ' + pos.top + 'px; left: ' + pos.left + 'px; z-index: 10000; background: rgba(0,0,0,0.5); width: ' + width + '; height: ' + height + ';" />');
            $(self.element).prepend($wrapperTpl);

            $(window).on('resize', function () {
              $wrapperTpl.height($(self.element).outerHeight() + 'px');
              self._loader.css({ top: ($wrapperTpl.outerHeight() / 2 - self._loader.outerHeight() / 2) + 'px' });
            });
          }

          $wrapperTpl.html(self._loader);
          self._loader.css({ top: ($wrapperTpl.outerHeight() / 2 - self._loader.outerHeight() / 2) + 'px' });
          break;

        default:
          $(self.element).after(self._loader);
          break;
      }

      self.disableOthers();
    },

    hide: function () {

      if ("overlay" === this.options.position) {

        $(this.element).find(".isloading-overlay").first().remove();

      } else {

        $(this._loader).remove();
        $(this.element).text($(this.element).attr("data-isloading-label"));

      }

      $(this.element).removeAttr("disabled").removeClass("disabled");

      this.enableOthers();
    },

    disableOthers: function () {
      $.each(this.options.disableOthers, function (i, e) {
        var elt = $(e);
        if (elt.is("button, input, textarea")) {
          elt.attr("disabled", "disabled");
        }
        else {
          elt.addClass("disabled");
        }
      });
    },

    enableOthers: function () {
      $.each(this.options.disableOthers, function (i, e) {
        var elt = $(e);
        if (elt.is("button, input, textarea")) {
          elt.removeAttr("disabled");
        }
        else {
          elt.removeClass("disabled");
        }
      });
    }
  };

  // Constructor
  $.fn[pluginName] = function (options) {
    return this.each(function () {
      if (options && "hide" !== options || !$.data(this, "plugin_" + pluginName)) {
        $.data(this, "plugin_" + pluginName, new Plugin(this, options));
      } else {
        var elt = $.data(this, "plugin_" + pluginName);

        if ("hide" === options) { elt.hide(); }
        else { elt.show(); }
      }
    });
  };

  contruct();

})(jQuery, window, document);;
/*! Lazy Load 2.0.0-beta.2 - MIT license - Copyright 2007-2017 Mika Tuupola */
!function(t,e){"object"==typeof exports?module.exports=e(t):"function"==typeof define&&define.amd?define([],e(t)):t.LazyLoad=e(t)}("undefined"!=typeof global?global:this.window||this.global,function(t){"use strict";function e(t,e){this.settings=r(s,e||{}),this.images=t||document.querySelectorAll(this.settings.selector),this.observer=null,this.init()}const s={src:"data-src",srcset:"data-srcset",selector:".lazyload"},r=function(){let t={},e=!1,s=0,o=arguments.length;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(e=arguments[0],s++);for(;s<o;s++)!function(s){for(let o in s)Object.prototype.hasOwnProperty.call(s,o)&&(e&&"[object Object]"===Object.prototype.toString.call(s[o])?t[o]=r(!0,t[o],s[o]):t[o]=s[o])}(arguments[s]);return t};if(e.prototype={init:function(){if(!t.IntersectionObserver)return void this.loadImages();let e=this,s={root:null,rootMargin:"0px",threshold:[0]};this.observer=new IntersectionObserver(function(t){t.forEach(function(t){if(t.intersectionRatio>0){e.observer.unobserve(t.target);let s=t.target.getAttribute(e.settings.src),r=t.target.getAttribute(e.settings.srcset);"img"===t.target.tagName.toLowerCase()?(s&&(t.target.src=s),r&&(t.target.srcset=r)):t.target.style.backgroundImage="url("+s+")"}})},s),this.images.forEach(function(t){e.observer.observe(t)})},loadAndDestroy:function(){this.settings&&(this.loadImages(),this.destroy())},loadImages:function(){if(!this.settings)return;let t=this;this.images.forEach(function(e){let s=e.getAttribute(t.settings.src),r=e.getAttribute(t.settings.srcset);"img"===e.tagName.toLowerCase()?(s&&(e.src=s),r&&(e.srcset=r)):e.style.backgroundImage="url("+s+")"})},destroy:function(){this.settings&&(this.observer.disconnect(),this.settings=null)}},t.lazyload=function(t,s){return new e(t,s)},t.jQuery){const s=t.jQuery;s.fn.lazyload=function(t){return t=t||{},t.attribute=t.attribute||"data-src",new e(s.makeArray(this),t),this}}return e});
;
function URLParser(u) {
  var path = "", query = "", hash = "", params;
  if (u.indexOf("#") > 0) {
    hash = u.substr(u.indexOf("#") + 1);
    u = u.substr(0, u.indexOf("#"));
  }
  if (u.indexOf("?") > 0) {
    path = u.substr(0, u.indexOf("?"));
    query = u.substr(u.indexOf("?") + 1);
    params = query.split('&');
  } else
    path = u;
  return {
    getHost: function () {
      var hostexp = /\/\/([\w.-]*)/;
      var match = hostexp.exec(path);
      if (match != null && match.length > 1)
        return match[1];
      return "";
    },
    getPath: function () {
      var pathexp = /\/\/[\w.-]*(?:\/([^?]*))/;
      var match = pathexp.exec(path);
      if (match != null && match.length > 1)
        return match[1];
      return "";
    },
    getHash: function () {
      return hash;
    },
    getParams: function () {
      return params
    },
    getQuery: function () {
      return query;
    },
    setHash: function (value) {
      if (query.length > 0)
        query = "?" + query;
      if (value.length > 0)
        query = query + "#" + value;
      return path + query;
    },
    setParam: function (name, value) {
      if (!params) {
        params = new Array();
      }
      params.push(name + '=' + value);
      for (var i = 0; i < params.length; i++) {
        if (query.length > 0)
          query += "&";
        query += params[i];
      }
      if (query.length > 0)
        query = "?" + query;
      if (hash.length > 0)
        query = query + "#" + hash;
      return path + query;
    },
    getParam: function (name) {
      if (params) {
        for (var i = 0; i < params.length; i++) {
          var pair = params[i].split('=');
          if (decodeURIComponent(pair[0]) == name)
            return decodeURIComponent(pair[1]);
        }
      }
      //console.log('Query variable %s not found', name);
    },
    hasParam: function (name) {
      if (params) {
        for (var i = 0; i < params.length; i++) {
          var pair = params[i].split('=');
          if (decodeURIComponent(pair[0]) == name)
            return true;
        }
      }
      //console.log('Query variable %s not found', name);
    },
    removeParam: function (name) {
      query = "";
      if (params) {
        var newparams = new Array();
        for (var i = 0; i < params.length; i++) {
          var pair = params[i].split('=');
          if (decodeURIComponent(pair[0]) != name)
            newparams.push(params[i]);
        }
        params = newparams;
        for (var i = 0; i < params.length; i++) {
          if (query.length > 0)
            query += "&";
          query += params[i];
        }
      }
      if (query.length > 0)
        query = "?" + query;
      if (hash.length > 0)
        query = query + "#" + hash;
      return path + query;
    },
  }
};
/*
    jQuery Masked Input Plugin
    Copyright (c) 2007 - 2015 Josh Bush (digitalbush.com)
    Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)
    Version: 1.4.1
*/
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b,c=navigator.userAgent,d=/iphone/i.test(c),e=/chrome/i.test(c),f=/android/i.test(c);a.mask={definitions:{9:"[0-9]",a:"[A-Za-z]","*":"[A-Za-z0-9]"},autoclear:!0,dataName:"rawMaskFn",placeholder:"_"},a.fn.extend({caret:function(a,b){var c;if(0!==this.length&&!this.is(":hidden"))return"number"==typeof a?(b="number"==typeof b?b:a,this.each(function(){this.setSelectionRange?this.setSelectionRange(a,b):this.createTextRange&&(c=this.createTextRange(),c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select())})):(this[0].setSelectionRange?(a=this[0].selectionStart,b=this[0].selectionEnd):document.selection&&document.selection.createRange&&(c=document.selection.createRange(),a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length),{begin:a,end:b})},unmask:function(){return this.trigger("unmask")},mask:function(c,g){var h,i,j,k,l,m,n,o;if(!c&&this.length>0){h=a(this[0]);var p=h.data(a.mask.dataName);return p?p():void 0}return g=a.extend({autoclear:a.mask.autoclear,placeholder:a.mask.placeholder,completed:null},g),i=a.mask.definitions,j=[],k=n=c.length,l=null,a.each(c.split(""),function(a,b){"?"==b?(n--,k=a):i[b]?(j.push(new RegExp(i[b])),null===l&&(l=j.length-1),k>a&&(m=j.length-1)):j.push(null)}),this.trigger("unmask").each(function(){function h(){if(g.completed){for(var a=l;m>=a;a++)if(j[a]&&C[a]===p(a))return;g.completed.call(B)}}function p(a){return g.placeholder.charAt(a<g.placeholder.length?a:0)}function q(a){for(;++a<n&&!j[a];);return a}function r(a){for(;--a>=0&&!j[a];);return a}function s(a,b){var c,d;if(!(0>a)){for(c=a,d=q(b);n>c;c++)if(j[c]){if(!(n>d&&j[c].test(C[d])))break;C[c]=C[d],C[d]=p(d),d=q(d)}z(),B.caret(Math.max(l,a))}}function t(a){var b,c,d,e;for(b=a,c=p(a);n>b;b++)if(j[b]){if(d=q(b),e=C[b],C[b]=c,!(n>d&&j[d].test(e)))break;c=e}}function u(){var a=B.val(),b=B.caret();if(o&&o.length&&o.length>a.length){for(A(!0);b.begin>0&&!j[b.begin-1];)b.begin--;if(0===b.begin)for(;b.begin<l&&!j[b.begin];)b.begin++;B.caret(b.begin,b.begin)}else{for(A(!0);b.begin<n&&!j[b.begin];)b.begin++;B.caret(b.begin,b.begin)}h()}function v(){A(),B.val()!=E&&B.change()}function w(a){if(!B.prop("readonly")){var b,c,e,f=a.which||a.keyCode;o=B.val(),8===f||46===f||d&&127===f?(b=B.caret(),c=b.begin,e=b.end,e-c===0&&(c=46!==f?r(c):e=q(c-1),e=46===f?q(e):e),y(c,e),s(c,e-1),a.preventDefault()):13===f?v.call(this,a):27===f&&(B.val(E),B.caret(0,A()),a.preventDefault())}}function x(b){if(!B.prop("readonly")){var c,d,e,g=b.which||b.keyCode,i=B.caret();if(!(b.ctrlKey||b.altKey||b.metaKey||32>g)&&g&&13!==g){if(i.end-i.begin!==0&&(y(i.begin,i.end),s(i.begin,i.end-1)),c=q(i.begin-1),n>c&&(d=String.fromCharCode(g),j[c].test(d))){if(t(c),C[c]=d,z(),e=q(c),f){var k=function(){a.proxy(a.fn.caret,B,e)()};setTimeout(k,0)}else B.caret(e);i.begin<=m&&h()}b.preventDefault()}}}function y(a,b){var c;for(c=a;b>c&&n>c;c++)j[c]&&(C[c]=p(c))}function z(){B.val(C.join(""))}function A(a){var b,c,d,e=B.val(),f=-1;for(b=0,d=0;n>b;b++)if(j[b]){for(C[b]=p(b);d++<e.length;)if(c=e.charAt(d-1),j[b].test(c)){C[b]=c,f=b;break}if(d>e.length){y(b+1,n);break}}else C[b]===e.charAt(d)&&d++,k>b&&(f=b);return a?z():k>f+1?g.autoclear||C.join("")===D?(B.val()&&B.val(""),y(0,n)):z():(z(),B.val(B.val().substring(0,f+1))),k?b:l}var B=a(this),C=a.map(c.split(""),function(a,b){return"?"!=a?i[a]?p(b):a:void 0}),D=C.join(""),E=B.val();B.data(a.mask.dataName,function(){return a.map(C,function(a,b){return j[b]&&a!=p(b)?a:null}).join("")}),B.one("unmask",function(){B.off(".mask").removeData(a.mask.dataName)}).on("focus.mask",function(){if(!B.prop("readonly")){clearTimeout(b);var a;E=B.val(),a=A(),b=setTimeout(function(){B.get(0)===document.activeElement&&(z(),a==c.replace("?","").length?B.caret(0,a):B.caret(a))},10)}}).on("blur.mask",v).on("keydown.mask",w).on("keypress.mask",x).on("input.mask paste.mask",function(){B.prop("readonly")||setTimeout(function(){var a=A(!0);B.caret(a),h()},0)}),e&&f&&B.off("input.mask").on("input.mask",u),A()})}})});;

Date.parseDate = function (input, format) {
  return moment(input, format).toDate();
};
Date.prototype.dateFormat = function (format) {
  return moment(this).format(format);
};

// Pad Right
String.prototype.padRight = function (l, c) {
  return this + Array(l - this.length + 1).join(c || " ");
}

// Pad Left
String.prototype.padLeft = function (l, c) {
  return Array(l - this.length + 1).join(c || " ") + this;
}


Guid = {
  Set: function (val) {
    var value;
    if (arguments.length == 1) {
      if (this.IsValid(arguments[0])) {
        value = arguments[0];
      } else {
        value = this.Empty();
      }
    }
    $(this).data("value", value);
    return value;
  },

  Empty: function () {
    return "00000000-0000-0000-0000-000000000000";
  },

  IsEmpty: function (gid) {
    return gid == this.Empty() || typeof (gid) == 'undefined' || gid == null || gid == '';
  },

  IsValid: function (value) {
    rGx = new RegExp("\\b(?:[A-F0-9]{8})(?:-[A-F0-9]{4}){3}-(?:[A-F0-9]{12})\\b");
    return rGx.exec(value) != null;
  },

  New: function () {
    if (arguments.length == 1 && this.IsValid(arguments[0])) {
      $(this).data("value", arguments[0]);
      value = arguments[0];
      return value;
    }

    var res = [], hv;
    var rgx = new RegExp("[2345]");
    for (var i = 0; i < 8; i++) {
      hv = (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
      if (rgx.exec(i.toString()) != null) {
        if (i == 3) { hv = "6" + hv.substr(1, 3); }
        res.push("-");
      }
      res.push(hv.toUpperCase());
    }
    value = res.join('');
    $(this).data("value", value);
    return value;
  },

  Value: function () {
    if ($(this).data("value")) {
      return $(this).data("value");
    }
    var val = this.New();
    $(this).data("value", val);
    return val;
  }
};

xLoad = {
  add: function (container) {

    var height = $(container).height();
    var loading = tpl.get("controls/Loading");
    var spanh = height == 0 ? 0 : -16
    var xel = $(loading).css({ "margin-top": (height / 2) - spanh + "px" });
    $(container).append(xel);
  },
};
tpl = {
  url: function (name) {
    if (this.path != null)
      return '/Scripts/Templates/' + this.path + '/' + name + '.html' + '?v=' + window.AppVersion;
    else
      return '/Scripts/Templates/' + name + '.html' + '?v=' + window.AppVersion;
  },
  path: null,
  // Hash of preloaded templates for the app
  templates: {},

  // Recursively pre-load all the templates for the app.
  // This implementation should be changed in a production environment. All the template files should be
  // concatenated in a single file.
  loadTemplates: function (names, callback) {

    var that = this;

    var loadTemplate = function (index) {
      var name = names[index];
      //console.log('Loading template: ' + name);
      $.get(this.url(name), function (data) {
        that.templates[name] = data;
        index++;
        if (index < names.length) {
          loadTemplate(index);
        } else {
          callback();
        }
      });
    }

    loadTemplate(0);
  },

  loadInTemplate: function (name) {

    var that = this;
    //console.log('Loading template: ' + name);
    $.ajax({
      dataType: 'html',
      async: false,
      url: this.url(name),
      success: function (response) {
        that.templates[name] = response;
      }
    });
    return that.templates[name];
  },

  // Get template by name from hash of preloaded templates
  get: function (name, path) {
    if (path != 'undefined')
      this.path = path;
    var that = this;
    if (!that.templates[name]) {
      return that.loadInTemplate(name);
    }
    return that.templates[name];
  }

};
util = {
  stateImage: function (state) {
    return "<img src='/Content/Develop/img/states/active" + state + ".png' />";
  },
  ImageH: function (path, height) {
    return "<img height='" + height + "' src='/" + path + "' />";
  },
  ImageW: function (path, width) {
    return "<img width='" + width + "' src='/" + path + "' />";
  },

};


numberformat = {
  format: function (number, decimals, dec_point, thousands_sep, currency) {
    // Strip all characters but numerical ones.
    number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
    var n = !isFinite(+number) ? 0 : +number,
        prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
        sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
        dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
        s = '',
        toFixedFix = function (n, prec) {
          var k = Math.pow(10, prec);
          return '' + Math.round(n * k) / k;
        };
    // Fix for IE parseFloat(0.55).toFixed(0) = 0;
    s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.');
    if (s[0].length > 3) {
      s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep);
    }
    if ((s[1] || '').length < prec) {
      s[1] = s[1] || '';
      s[1] += new Array(prec - s[1].length + 1).join('0');
    }
    if (currency)
      return s.join(dec) + " " + currency;
    else
      return s.join(dec)
  }
}

dateutil = {
  dateparseGetDate: function (value) {
    return this.JSONDate(this.dateparsing(value));
  },
  dateparseGetDateWithTime: function (value) {
    return this.JSONDateWithTime(this.dateparsing(value));
  },
  dateparseGetDateOnlyTime: function (value) {
    return this.JSONDateOnlyTime(this.dateparsing(value));
  },
  dateparsing: function (value) {
    try {
      return new Date(parseInt(value.replace(/\/+Date\(([\d+-]+)\)\/+/, '$1')));
    } catch (e) {
      return "";
    }
  },
  JSONDate: function (dateStr) {
    try {

      var m, day;
      var jsonDate = dateStr;
      var d = jsonDate;
      m = d.getMonth() + 1;
      if (m < 10)
        m = '0' + m;
      if (d.getDate() < 10)
        day = '0' + d.getDate();
      else
        day = d.getDate();
      return (day + '.' + m + '.' + d.getFullYear());
    } catch (e) {
      return "";
    }
  },
  JSONDateWithTime: function (dateStr) {
    try {

      var jsonDate = dateStr;
      var d = jsonDate;
      var m, day;
      m = d.getMonth() + 1;
      if (m < 10)
        m = '0' + m;
      if (d.getDate() < 10)
        day = '0' + d.getDate();
      else
        day = d.getDate();
      var formattedDate = day + "." + m + "." + d.getFullYear();
      var hours = (d.getHours() < 10) ? "0" + d.getHours() : d.getHours();
      var minutes = (d.getMinutes() < 10) ? "0" + d.getMinutes() : d.getMinutes();
      var seconds = (d.getSeconds() < 10) ? "0" + d.getSeconds() : d.getSeconds();
      var formattedTime = hours + ":" + minutes + ":" + seconds;
      formattedDate = formattedDate + " " + formattedTime;
      return formattedDate;
    } catch (e) {
      return "";
    }
  },
  JSONDateOnlyTime: function (dateStr) {
    try {


      var jsonDate = dateStr;
      var d = jsonDate;
      var hours = (d.getHours() < 10) ? "0" + d.getHours() : d.getHours();
      var minutes = (d.getMinutes() < 10) ? "0" + d.getMinutes() : d.getMinutes();
      var seconds = (d.getSeconds() < 10) ? "0" + d.getSeconds() : d.getSeconds();
      var formattedTime = hours + ":" + minutes + ":" + seconds;
      return formattedTime;

    } catch (e) {
      return "";
    }
  }
}



function URLParser(u) {
  var path = "", query = "", hash = "", params;
  if (u.indexOf("#") > 0) {
    hash = u.substr(u.indexOf("#") + 1);
    u = u.substr(0, u.indexOf("#"));
  }
  if (u.indexOf("?") > 0) {
    path = u.substr(0, u.indexOf("?"));
    query = u.substr(u.indexOf("?") + 1);
    params = query.split('&');
  } else
    path = u;
  return {
    getHost: function () {
      var hostexp = /\/\/([\w.-]*)/;
      var match = hostexp.exec(path);
      if (match != null && match.length > 1)
        return match[1];
      return "";
    },
    getPath: function () {
      var pathexp = /\/\/[\w.-]*(?:\/([^?]*))/;
      var match = pathexp.exec(path);
      if (match != null && match.length > 1)
        return match[1];
      return "";
    },
    getHash: function () {
      return hash;
    },
    getParams: function () {
      return params
    },
    getQuery: function () {
      return query;
    },
    setHash: function (value) {
      if (query.length > 0)
        query = "?" + query;
      if (value.length > 0)
        query = query + "#" + value;
      return path + query;
    },
    setParam: function (name, value) {
      if (!params) {
        params = new Array();
      }
      params.push(name + '=' + value);
      for (var i = 0; i < params.length; i++) {
        if (query.length > 0)
          query += "&";
        query += params[i];
      }
      if (query.length > 0)
        query = "?" + query;
      if (hash.length > 0)
        query = query + "#" + hash;
      return path + query;
    },
    getParam: function (name) {
      if (params) {
        for (var i = 0; i < params.length; i++) {
          var pair = params[i].split('=');
          if (decodeURIComponent(pair[0]) == name)
            return decodeURIComponent(pair[1]);
        }
      }
      //console.log('Query variable %s not found', name);
    },
    hasParam: function (name) {
      if (params) {
        for (var i = 0; i < params.length; i++) {
          var pair = params[i].split('=');
          if (decodeURIComponent(pair[0]) == name)
            return true;
        }
      }
      //console.log('Query variable %s not found', name);
    },
    removeParam: function (name) {
      query = "";
      if (params) {
        var newparams = new Array();
        for (var i = 0; i < params.length; i++) {
          var pair = params[i].split('=');
          if (decodeURIComponent(pair[0]) != name)
            newparams.push(params[i]);
        }
        params = newparams;
        for (var i = 0; i < params.length; i++) {
          if (query.length > 0)
            query += "&";
          query += params[i];
        }
      }
      if (query.length > 0)
        query = "?" + query;
      if (hash.length > 0)
        query = query + "#" + hash;
      return path + query;
    },
  }
}
$(function () {
  $.ajaxSetup({
    cache: true,
    success: function (result, status, xhr) {

    },
    complete: function (xhr, status) {
      //if (xhr.responseText.contains("NotAuthorized"))
      //{
      //    alert("yetki yok");
      //}

    },
    error: function (jqXHR, exception) {
      //progressBox.Close();
      if (jqXHR.status === 0) {
        //alertify.alert('Bağlantı yok! Ağ bağlantısını kontrol ediniz.');
      } else if (jqXHR.status == 302) {
        //alertify.alert('Sayfa bulunamıyor. [302]');
      } else if (jqXHR.status == 404) {
        //alertify.alert('Sayfa bulunamıyor. [404]');
      } else if (jqXHR.status == 500) {
        //alertify.alert('Server hatası alındı. Hata [500].');
      } else if (exception === 'parsererror') {
        //alertify.alert('Veriler dönüştürülemiyor. Tekrar deneyiniz.');
      } else if (exception === 'timeout') {
        //alertify.alert('Oturumunuz sonlanmıştır. Lütfen tekrar oturum açınız.');
      } else if (exception === 'abort') {
        //alertify.alert('İstek iptal edildi.');
      } else {
        //alertify.alert('Bilinmeyen hata alındı! Hata : ' + jqXHR.responseText);
      }
    }
  });
});

$.fn.ForceNumericOnly =
function () {
  return this.each(function () {
    $(this).keydown(function (e) {
      var key = e.charCode || e.keyCode || 0;
      // allow backspace, tab, delete, arrows, numbers and keypad numbers ONLY
      // home, end, period, and numpad decimal
      //alert(key);
      return (
          key == 8 ||
          //key == 17 ||
          key == 9 ||
          key == 46 ||
          key == 110 ||
          key == 190 ||
          (key >= 35 && key <= 40) ||
          (key >= 48 && key <= 57) ||
          (key >= 96 && key <= 105));
    });
  });
};;
$(document).ready(function () {
 
    $("[rel=submit]").click(function (event) {
        var obj = $('form').validateForm();
        if (obj != null) {
            obj.focus();
            event.stopPropagation();
            event.preventDefault();
            return false;
        }
        $("#SubmitName").val($(this).attr('id'));
        //alert($('#SubmitName').val());
        $('form').submit();
    });
    $('[rel=clear], [rel=cancel]').click(function (event) {
        var obj = $('form').clearForm();
    });
    $('[rel=search]').click(function (event) {
        $('#Search_PageIndex').val('1');
        $('form').submit();
    });
});


$.fn.clearForm = function () {
    var form = $(this);
    $(':input', form).each(function () {
        var type = this.type;
        var tag = this.tagName.toLowerCase();
        if (type == 'text' || type == 'password' || tag == 'textarea') {
            $(this).val('');
        }
        else if (tag == 'select') {
            $(this)[0].selectedIndex = -1;
            $(this).change();
        }
    });
}
$.fn.validateForm = function () {
    var form = $(this);
    var required = false;
    var obj = null;

    $(':input', form).each(function () {
        var type = this.type;
        var tag = this.tagName.toLowerCase();
        var isreq = $(this).attr('isreq');
        if (type == 'text' || type == 'password' || tag == 'textarea') {
            if ($(this).isRequired()) {
                $('#' + $(this).attr('id') + '').css({
                    "border-color": "#FC0B0B",
                    "border-width": "1px",
                    "border-style": "solid"
                });
                required = true;
                obj = $(this)[0];
                return false;
            }
            if ($(this).attr('email') == 'true' || $(this).attr('email') == 'True') {
                if (!$(this).validateEmail()) {
                    $('#' + $(this).attr('id') + '').css({
                        "border-color": "#FC0B0B",
                        "border-width": "1px",
                        "border-style": "solid"
                    });
                    required = true;
                    obj = $(this)[0];
                    return false;
                } else {
                    $('#' + $(this).attr('id') + '').css({
                        "border-color": "#ccc",
                        "border-width": "1px",
                        "border-style": "solid"
                    });
                }
            }
            if ($(this).attr('username') == 'true' || $(this).attr('username') == 'True') {
                if (!$(this).validateUserName()) {
                    alert('Kullanıcı adı en az 4 karakter olmalı ve Türkçe karakter içermemelidir.');
                    $('#' + $(this).attr('id') + '').css({
                        "border-color": "#FC0B0B",
                        "border-width": "1px",
                        "border-style": "solid"
                    });
                    required = true;
                    obj = $(this)[0];
                    return false;
                }
            }
        }
        else if (tag == 'select') {
            if ($(this).isRequired()) {
                $('#' + $(this).attr('id') + '').css({
                    "border-color": "#FC0B0B",
                    "border-width": "1px",
                    "border-style": "solid"
                });
                required = true;
                obj = $(this)[0];
                return false;
            } else {
                $('#' + $(this).attr('id') + '').css({
                    "border-color": "#ccc",
                    "border-width": "1px",
                    "border-style": "solid"
                });
            }
        }
        else if (type == 'radio') {
            var checked = false;
            if ($(this)[0].style.display != 'none') {
                $('input:radio[name=' + $(this)[0].name + ']').each(function () {
                    if ($(this)[0].checked) checked = true;
                });
                if ($(this).is(':visible') && $(this).attr('isreq') == 'true' && checked == false) {
                    required = true;
                    obj = $(this)[0];
                    return false;
                }
            }
        }
    });
    if (required) {
        if ($(obj).msg() != undefined) {
            if ($(obj).msg() != '') {
                alert($(obj).msg());
            }
            else {
                //$('#' + $(this).attr('id') + '').css({
                //    "border-color": "#FC0B0B",
                //    "border-width": "1px",
                //    "border-style": "solid"
                //});
            }
        }
        else {
            if ($('label[for=' + $(obj).id() + ']').length > 0) {
                //$('#' + $(this).attr('id') + '').css({
                //    "border-color": "#FC0B0B",
                //    "border-width": "1px",
                //    "border-style": "solid"
                //});

            }
            else {
                //$('#' + $(this).attr('id') + '').css({
                //    "border-color": "#FC0B0B",
                //    "border-width": "1px",
                //    "border-style": "solid"
                //});
            }
        }
    }
    return required ? obj : null;
}
$.fn.validateUserName = function () {
    var re = new RegExp("(ı|ğ|ü|ş|ç|ö)", "g");
    //if it's NOT valid
    if ($(this).val().length < 4) {
        return false;
    }
    else if (re.test($(this).val())) {
        return false;
    }
        //if it's valid
    else {
        return true;
    }
}
$.fn.validateEmail = function () {
    var a = $(this).val();
    var filter = /^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/;
    //if it's valid email
    if (filter.test(a)) {
        return true;
    }
        //if it's NOT valid
    else {
        return false;
    }
}
$.fn.maxCount = function (to) {
    $(to).html($(this).val().length);
}
$.fn.copyText = function (to) {
    if ($.trim($(this).val()) == '') return false;
    $(to).val($(this).val());
}
$.fn.toLower = function () {
    if ($.trim($(this).val()) == '') return false;
    var str = new String();
    str = $(this).val();
    str = str.replace(/ +/g, ' ');
    str = str.replace(/I/g, "ı").toLowerCase();
    var names = str.split(' ');
    for (var i = 0; i < 1; i++) {
        if (names[i].length > 1) {
            letters = names[i].split('');
            if (letters[0] == 'i')
                letters[0] = 'İ';
            else
                letters[0] = letters[0].toUpperCase();
            names[i] = letters.join('');
        } else { names[i] = names[i].toUpperCase(); }
    }
    str = names.join(' ');
    $(this).val(str);
    return false;
}
$.fn.name = function () { return $(this).attr('name'); }
$.fn.id = function () { return $(this).attr('id'); }
$.fn.msg = function () { return $(this).attr('msg'); }
$.fn.isRequired = function () {
    if ($(this).is(':visible') && $(this).attr('isreq') == 'true' && $(this).isEmpty())
        return true;
    return false;
}
$.fn.isEmpty = function () {
    return $.trim($(this).val()) == '';
}
function htmlEscape(str) {
    return String(str)
            .replace(/&/g, '&amp;')
            .replace(/"/g, '&quot;')
            .replace(/'/g, '&#39;')
            .replace(/</g, '&lt;')
            .replace(/>/g, '&gt;');
}

;
/*!
 * Bootstrap v3.2.0 (http://getbootstrap.com)
 * Copyright 2011-2014 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
if(typeof jQuery=="undefined")throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(i.style[t]!==undefined)return{end:n[t]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("bsTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){(n.support.transition=t(),n.support.transition)&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery);+function(n){"use strict";function u(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));typeof i=="string"&&u[i].call(r)})}var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.2.0";t.prototype.close=function(t){function f(){i.detach().trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;(r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=n(r),t&&t.preventDefault(),i.length||(i=u.hasClass("alert")?u:u.parent()),i.trigger(t=n.Event("close.bs.alert")),t.isDefaultPrevented())||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=u;n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f=typeof i=="object"&&i;r||u.data("bs.button",r=new t(this,f));i=="toggle"?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.2.0";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var r="disabled",i=this.$element,f=i.is("input")?"val":"html",u=i.data();t=t+"Text";u.resetText==null&&i.data("resetText",i[f]());i[f](u[t]==null?this.options[t]:u[t]);setTimeout(n.proxy(function(){t=="loadingText"?(this.isLoading=!0,i.addClass(r).attr(r,r)):this.isLoading&&(this.isLoading=!1,i.removeClass(r).removeAttr(r))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length&&(n=this.$element.find("input"),n.prop("type")=="radio"&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target);r.hasClass("btn")||(r=r.closest(".btn"));i.call(r,"toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i),e=typeof i=="string"?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));typeof i=="number"?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t).on("keydown.bs.carousel",n.proxy(this.keydown,this));this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;this.options.pause=="hover"&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},r;t.VERSION="3.2.0";t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.keydown=function(n){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.to=function(t){var r=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1)&&!(t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),c=this.interval,f=t=="next"?"left":"right",a=t=="next"?"first":"last",l=this,e,o,s,h;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[a]()}return r.hasClass("active")?this.sliding=!1:(e=r[0],o=n.Event("slide.bs.carousel",{relatedTarget:e,direction:f}),this.$element.trigger(o),o.isDefaultPrevented())?void 0:(this.sliding=!0,c&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),s=n(this.$indicators.children()[this.getItemIndex(r)]),s&&s.addClass("active")),h=n.Event("slid.bs.carousel",{relatedTarget:e,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(r.addClass(t),r[0].offsetWidth,u.addClass(f),r.addClass(f),u.one("bsTransitionEnd",function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));l.sliding=!1;setTimeout(function(){l.$element.trigger(h)},0)}).emulateTransitionEnd(u.css("transition-duration").slice(0,-1)*1e3)):(u.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger(h)),c&&this.cycle(),this)};r=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=r,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var o,r=n(this),u=n(r.attr("data-target")||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,"")),e,f;u.hasClass("carousel")&&(e=n.extend({},u.data(),r.data()),f=r.attr("data-slide-to"),f&&(e.interval=!1),i.call(u,e),f&&u.data("bs.carousel").to(f),t.preventDefault())});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i);!r&&f.toggle&&i=="show"&&(i=!i);r||u.data("bs.collapse",r=new t(this,f));typeof i=="string"&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},r;t.VERSION="3.2.0";t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var f,t,u,r,e,o;if(!this.transitioning&&!this.$element.hasClass("in")&&(f=n.Event("show.bs.collapse"),this.$element.trigger(f),!f.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(u=t.data("bs.collapse"),u&&u.transitioning)return;i.call(t,"hide");u||t.data("bs.collapse",null)}if(r=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1,e=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return e.call(this);o=n.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",n.proxy(e,this)).emulateTransitionEnd(350)[r](this.$element[0][o])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented())){if(t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},!n.support.transition)return r.call(this);this.$element[t](0).one("bsTransitionEnd",n.proxy(r,this)).emulateTransitionEnd(350)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};r=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=r,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var o,r=n(this),h=r.attr("data-target")||t.preventDefault()||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""),u=n(h),f=u.data("bs.collapse"),c=f?"toggle":r.data(),e=r.attr("data-parent"),s=e&&n(e);f&&f.transitioning||(s&&s.find('[data-toggle="collapse"][data-parent="'+e+'"]').not(r).addClass("collapsed"),r[u.hasClass("in")?"addClass":"removeClass"]("collapsed"));i.call(u,c)})}(jQuery);+function(n){"use strict";function r(t){t&&t.which===3||(n(e).remove(),n(i).each(function(){var i=u(n(this)),r={relatedTarget:this};i.hasClass("open")&&((i.trigger(t=n.Event("hide.bs.dropdown",r)),t.isDefaultPrevented())||i.removeClass("open").trigger("hidden.bs.dropdown",r))}))}function u(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}function o(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));typeof i=="string"&&u[i].call(r)})}var e=".dropdown-backdrop",i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.2.0";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=u(f),o=i.hasClass("open"),r(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length)n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",r);if(e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus");i.toggleClass("open").trigger("shown.bs.dropdown",e)}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,r;if(/(38|40|27)/.test(t.keyCode)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=u(e),s=o.hasClass("open"),!s||s&&t.keyCode==27)return t.which==27&&o.find(i).trigger("focus"),e.trigger("click");(h=" li:not(.divider):visible a",f=o.find('[role="menu"]'+h+', [role="listbox"]'+h),f.length)&&(r=f.index(f.filter(":focus")),t.keyCode==38&&r>0&&r--,t.keyCode==40&&r<f.length-1&&r++,~r||(r=0),f.eq(r).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=o;n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i+', [role="menu"], [role="listbox"]',t.prototype.keydown)}(jQuery);+function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),typeof i=="object"&&i);u||f.data("bs.modal",u=new t(this,e));typeof i=="string"?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$backdrop=this.isShown=null;this.scrollbarWidth=0;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.2.0";t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});if(this.$element.trigger(r),!this.isShown&&!r.isDefaultPrevented()){this.isShown=!0;this.checkScrollbar();this.$body.addClass("modal-open");this.setScrollbar();this.escape();this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this));this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(i.$body);i.$element.show().scrollTop(0);u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(300):i.$element.trigger("focus").trigger(r)})}};t.prototype.hide=function(t){(t&&t.preventDefault(),t=n.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented())&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){if(this.isShown&&this.options.keyboard)this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){n.which==27&&this.hide()},this));else this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var f=this,u=this.$element.hasClass("fade")?"fade":"",i,r;if(this.isShown&&this.options.backdrop){i=n.support.transition&&u;this.$backdrop=n('<div class="modal-backdrop '+u+'" />').appendTo(this.$body);this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){n.target===n.currentTarget&&(this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this));if(i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),r=function(){f.removeBackdrop();t&&t()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(150):r()):t&&t()};t.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right","")};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),u=n(r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),e=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){if(!n.isDefaultPrevented())u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,e,this)})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.tooltip",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.VERSION="3.2.0";t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(this.options.viewport.selector||this.options.viewport),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else if(u!="manual"){o=u=="hover"?"mouseenter":"focusin";s=u=="hover"?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this));this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)};t.prototype.show=function(){var h=n.Event("show.bs."+this.type),c,y,s;if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),c=n.contains(document.documentElement,this.$element[0]),h.isDefaultPrevented()||!c)return;var f=this,i=this.tip(),l=this.getUID(this.type);this.setContent();i.attr("id",l);this.$element.attr("aria-describedby",l);this.options.animation&&i.addClass("fade");var t=typeof this.options.placement=="function"?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,v=a.test(t);v&&(t=t.replace(a,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t).data("bs."+this.type,this);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),e=i[0].offsetWidth,o=i[0].offsetHeight;if(v){var p=t,w=this.$element.parent(),u=this.getPosition(w);t=t=="bottom"&&r.top+r.height+o-u.scroll>u.height?"top":t=="top"&&r.top-u.scroll-o<0?"bottom":t=="right"&&r.right+e>u.width?"left":t=="left"&&r.left-e<u.left?"right":t;i.removeClass(p).addClass(t)}y=this.getCalculatedOffset(t,r,e,o);this.applyPlacement(y,t);s=function(){f.$element.trigger("shown.bs."+f.type);f.hoverState=null};n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",s).emulateTransitionEnd(150):s()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),c=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;i=="top"&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var l=u.left?u.left*2-c+h:u.top*2-e+f,a=u.left?"left":"top",v=u.left?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(l,r[0][v],a)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function u(){t.hoverState!="in"&&i.detach();t.$element.trigger("hidden.bs."+t.type)}var t=this,i=this.tip(),r=n.Event("hide.bs."+this.type);if(this.$element.removeAttr("aria-describedby"),this.$element.trigger(r),!r.isDefaultPrevented())return i.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",u).emulateTransitionEnd(150):u(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var r=t[0],i=r.tagName=="BODY";return n.extend({},typeof r.getBoundingClientRect=="function"?r.getBoundingClientRect():null,{scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop(),width:i?n(window).width():t.outerWidth(),height:i?n(window).height():t.outerHeight()},i?{top:0,left:0}:t.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.width&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(Math.random()*1e6);while(document.getElementById(n));return n};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){clearTimeout(this.timeout);this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.popover",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.2.0";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").empty()[this.options.html?typeof t=="string"?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=r;n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){var u=n.proxy(this.process,this);this.$body=n("body");this.$scrollElement=n(i).is("body")?n(window):n(i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",u);this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f=typeof i=="object"&&i;r||u.data("bs.scrollspy",r=new t(this,f));typeof i=="string"&&r[i]()})}t.VERSION="3.2.0";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var i="offset",r=0,t;n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();t=this;this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var r=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,i=this.targets,u=this.activeTarget,n;if(this.scrollHeight!=f&&this.refresh(),r>=e)return u!=(n=i[i.length-1])&&this.activate(n);if(u&&r<=t[0])return u!=(n=i[0])&&this.activate(n);for(n=t.length;n--;)u!=i[n]&&r>=t[n]&&(!t[n+1]||r<=t[n+1])&&this.activate(i[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));typeof i=="string"&&r[i]()})}var t=function(t){this.element=n(t)},r;t.VERSION="3.2.0";t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.closest("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})}))};t.prototype.activate=function(t,i,r){function e(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");f?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),f=r&&n.support.transition&&u.hasClass("fade");f?u.one("bsTransitionEnd",e).emulateTransitionEnd(150):e();u.removeClass("in")};r=n.fn.tab;n.fn.tab=i;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=r,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();i.call(n(this),"show")})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f=typeof i=="object"&&i;r||u.data("bs.affix",r=new t(this,f));typeof i=="string"&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$target=n(this.options.target).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.2.0";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=n(document).height(),h=this.$target.scrollTop(),c=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;(typeof r!="object"&&(u=f=r),typeof f=="function"&&(f=r.top(this.$element)),typeof u=="function"&&(u=r.bottom(this.$element)),i=this.unpin!=null&&h+this.unpin<=c.top?!1:u!=null&&c.top+this.$element.height()>=s-u?"bottom":f!=null&&h<=f?"top":!1,this.affixed!==i)&&((this.unpin!=null&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())||(this.affixed=i,this.unpin=i=="bottom"?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(e).trigger(n.Event(e.replace("affix","affixed"))),i=="bottom"&&this.$element.offset({top:s-this.$element.height()-u})))}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery);
//# sourceMappingURL=bootstrap.min.js.map
;
/// <reference path="~/js/lib/jquery/jquery-2.1.1.min.js" />

var mainActions = (function () {

  var $rootCategoryPanel = $('#rootCategoryPanel');

  return {
    rootContainer: {
      open: function () {
        if ($(window).width() > 768) {
          $rootCategoryPanel.stop().animate({
            "marginTop": "0"
          }, function () {
            $(".main").css("margin-top", "295px");
          });
          $(".floor").css("visibility","visible").fadeIn("fast");

          return $(".upBtn").css("background", "url(/Content/Company/images/productsUp.png)");
        }
        else
        {
          $(".main").css("margin-top", "120");
        }
      },
      close: function () {
        if ($(window).width() > 768) {
          $(".floor").css("visibility", "hidden").fadeOut("fast");
          $rootCategoryPanel.stop().animate({
            "marginTop": "-140"
          }, function () {
            $(".main").css("margin-top", "160px");
          });
          return $(".upBtn").css("background", "url(/Content/Company/images/productsDown.png)");
        }
        else {
          $(".main").css("margin-top", "120");
        }
      },
      
    }
  };

})();

;
/*!
 * jPushMenu.js
 * 1.1.1
 * @author: takien
 * http://takien.com
 * Original version (pure JS) is created by Mary Lou http://tympanus.net/
 */

(function ($) {
  
    $.fn.jPushMenu = function(customOptions) {
        var o = $.extend({}, $.fn.jPushMenu.defaultOptions, customOptions);

        $('body').addClass(o.pushBodyClass);
        //console.log(JSON.stringify(o.pushBodyClass));
        // Add class to toggler
        $(this).addClass('jPushMenuBtn');

        $(this).click(function(e) {
            e.stopPropagation();

            var target     = '',
            push_direction = '';

            // Determine menu and push direction
            if ($(this).is('.' + o.showLeftClass)) {
                target         = '.cbp-spmenu-left';
                push_direction = 'toright';
            }
            else if ($(this).is('.' + o.showRightClass)) {
                target         = '.cbp-spmenu-right';
                push_direction = 'toleft';
            }
            else if ($(this).is('.' + o.showTopClass)) {
                target = '.cbp-spmenu-top';
            }
            else if ($(this).is('.' + o.showBottomClass)) {
                target = '.cbp-spmenu-bottom';
            }

            if (target == '') {
                return;
            }

            $(this).toggleClass(o.activeClass);
            $(target).toggleClass(o.menuOpenClass);

            if ($(this).is('.' + o.pushBodyClass) && push_direction != '') {
                $('body').toggleClass(o.pushBodyClass + '-' + push_direction);
            }

            // Disable all other buttons
            $('.jPushMenuBtn').not($(this)).toggleClass('disabled');

            return;
        });

        var jPushMenu = {
            close: function (o) {
                $('.jPushMenuBtn,body,.cbp-spmenu')
                    .removeClass('disabled ' + o.activeClass + ' ' + o.menuOpenClass + ' ' + o.pushBodyClass + '-toleft ' + o.pushBodyClass + '-toright');
            }
        }

        //// Close menu on clicking outside menu
        //if (o.closeOnClickOutside) {
        //     $(document).click(function() {
        //        jPushMenu.close(o);
        //     });
        // }

        // Close menu on clicking menu link
        if (o.closeOnClickLink) {
            $('.jpushClose').on('click',function() {
                jPushMenu.close(o);
            });
        }
    };

   /*
    * In case you want to customize class name,
    * do not directly edit here, use function parameter when call jPushMenu.
    */
    $.fn.jPushMenu.defaultOptions = {
        pushBodyClass      : 'push-body',
        showLeftClass      : 'menu-left',
        showRightClass     : 'menu-right',
        showTopClass       : 'menu-top',
        showBottomClass    : 'menu-bottom',
        activeClass        : 'menu-active',
        menuOpenClass      : 'menu-open',
        closeOnClickOutside: true,
        closeOnClickLink   : true
    };

})(jQuery);
;
/// <reference path="/Content/ozdisan.localization.js" />

/*
   Sistem üzerinde sepet veri alışverişi yapacak tüm eventler burada toplanacak.
   Böylece tüm site üzerinden tek bir yerden çağrım ve kontrol edilebilecek hale gelmiş olacak
*/
var bskConfirm = $("<div>").addClass("thmcolor").css({
  "width": "100%",
  "height": "44px",
  "display": "none",
  "z-index": "100",
  "top": "0",
  "left": "0",
  "color": "#fff",
  "position": "absolute"
});
basketEvents = (function () {
  return {
    //return başlar

    CreateOffer: function () {
      var list = [];

      $(".basketItems").each(function () {
        var t = $(this);
        var productId = t.data("productid");
        var customerPrice = $(".txtCustomerRequestPrice-" + productId).val();
        var basketId = t.data("basketitemid");
        var add = {
          ProductId: productId,
          BasketId: basketId,
          CustomerPrice: customerPrice,
          CustomerProductCode: $(".txtCustomerProductCode-" + productId).val()
        }
        list.push(add);
      });

      //$.isLoading({ text: ozdisanLocalization.general.basketPayMessage[lang] });

      $.isLoading({
        text: ozdisanLocalization.general.basketPayMessage[lang],
        'tpl': '<span class="isloading-wrapper %wrapper%">%text%  <img src="' + NetBt.Utility.LoadingGifPath() + '" width="50" height="50" /></span>'
      });

      $.ajax({
        url: "/Basket/CreateOffer",
        type: "POST",
        data: { list: list },
        async: true,
        success: function (data) {
          // işlem sonucuna göre değişiklikler yapılacaktır
          if (data.status) {
            Lobibox.alert("info", //AVAILABLE TYPES: "error", "info", "success", "warning"
             {
               msg: data.Message,
               buttons: {
                 ok: {
                   text: ozdisanLocalization.general.btnOk[lang]
                 }
               }
             });
            setTimeout(function () {
              location.href = "/B2b/Offer/OfferDetail/" + data.data.OfferId;
            }, 1500);
          }
          else {
            $.isLoading("hide");
            alertify.alert(data.message);
            if (isAdd) {
              $(bskConfirm).html(data.message);
              $item.parent().append($(bskConfirm));
              $(bskConfirm).fadeIn();
              setTimeout(function () {
                $(bskConfirm).fadeOut();
                $(bskConfirm).remove();
              }, 1000);
            }
          }
        },
        error: function () {
          $.isLoading("hide");
          NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.basketPayError[lang]);
          if (isAdd) {
            $(bskConfirm).html(ozdisanLocalization.general.basketPayError);
            $item.parent().append($(bskConfirm));
            $(bskConfirm).fadeIn();
            setTimeout(function () {
              $(bskConfirm).fadeOut();
              $(bskConfirm).remove();
            }, 1000);
          }
        }
      });

    },
    CreateOrder: function (SameAsBilling, DeliveryAddressId, DeliveryDescription, OrderCreateWithNoPayment, BillingAddressId, siparisDescription, PaymentType, chooseMoneyScore, shipmentId) {
      //Tipi 3 olan havale ile ödemedir.
      if (PaymentType > 0 && PaymentType == 3) {
        Remmitence.OpenBankAccountRemitence();
        //alert(PaymentType);
        return false;
      }

      var list = [];

      $(".basketItems").each(function () {
        var t = $(this);
        var productId = t.data("productid");
        var customerPrice = $(".txtCustomerRequestPrice-" + productId).val();
        var basketId = t.data("basketitemid");
        var add = {
          ProductId: productId,
          BasketId: basketId,
          CustomerPrice: customerPrice,
          CustomerProductCode: $(".txtCustomerProductCode-" + productId).val()
        }
        list.push(add);
      });


      //$.isLoading({ text: ozdisanLocalization.general.basketPayMessage[lang] });

      $.isLoading({
        text: ozdisanLocalization.general.basketPayMessage[lang],
        'tpl': '<span class="isloading-wrapper %wrapper%">%text%  <img src="' + NetBt.Utility.LoadingGifPath() + '" width="50" height="50" /></span>'
        });

      var model = {
        SameAsBilling: SameAsBilling,
        DeliveryAddressId: DeliveryAddressId,
        DeliveryDescription: DeliveryDescription,
        OrderCreateWithNoPayment: OrderCreateWithNoPayment,
        BillingAddressId: BillingAddressId,
        list: list,
        siparisDescription: siparisDescription,
        PaymentType: PaymentType,
        CustomerProductCodeCategoryId: $(".b2b_customer_code_category_select option:selected").val(),
        ChooseMoneyScore: chooseMoneyScore,
        ShipmentId: shipmentId
      };
        
        //console.log(JSON.stringify(model));

      $.ajax({
        url: "/Basket/CreateOrder",
        type: "POST",
        data: {
          model: model
        },
        async: true,
        success: function (data) {
          // işlem sonucuna göre değişiklikler yapılacaktır
          if (data.status) {
            if (data.type == "payprocess")
              location.href = data.message;
            else {
              alertify.alert(data.message);
              setTimeout(function () {
                location.href = "/B2b/Order/OrderDetail/" + data.data.OrderId;
              }, 1500);

            }
          }
          else {
            $.isLoading("hide");
            Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
            {
              msg: data.message,
              title: "Uyarı"
            });

            if (isAdd) {
              $(bskConfirm).html(data.message);
              $item.parent().append($(bskConfirm));
              $(bskConfirm).fadeIn();
              setTimeout(function () {
                $(bskConfirm).fadeOut();
                $(bskConfirm).remove();
              }, 1000);
            }
          }
        },
        error: function () {
          $.isLoading("hide");
          Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
            {
              msg: ozdisanLocalization.general.basketPayError,
              title: "Uyarı"
            });
          if (isAdd) {
            $(bskConfirm).html(ozdisanLocalization.general.basketPayError);
            $item.parent().append($(bskConfirm));
            $(bskConfirm).fadeIn();
            setTimeout(function () {
              $(bskConfirm).fadeOut();
              $(bskConfirm).remove();
            }, 1000);
          }
        }
      });

    },
     /**
      * Proforma siparişi kaydeder.
      * @param {} data 
      * @returns {} 
      */
    CreateProformaModel:function(data) {
       
       $.isLoading({
          text: ozdisanLocalization.general.basketPayMessage[lang],
          'tpl': '<span class="isloading-wrapper %wrapper%">%text%  <img src="' + NetBt.Utility.LoadingGifPath() + '" width="40" height="40" /></span>'
       });

       var model = {
          SameAsBilling: data.SameAsBilling,
          DeliveryAddressId: data.DeliveryAddressId,
          DeliveryDescription: data.DeliveryDescription,
          OrderCreateWithNoPayment: data.OrderCreateWithNoPayment,
          BillingAddressId: data.BillingAddressId,
          siparisDescription: data.siparisDescription,
          PaymentType: data.PaymentType,
          ShipmentId: data.ShipmentId,
          AbroadAccountNo: data.AbroadAccountNo,
          IsAbroad: data.IsAbroad,
          CustomerProductCodeCategoryId: data.CustomerProductCodeCategoryId
       };

       $.ajax({
          url: "/B2b/Proforma/CreateOrder",
          type: "POST",
          data: {
             model: model
          },
          async: true,
          success: function (data) {
             // işlem sonucuna göre değişiklikler yapılacaktır
              console.log(JSON.stringify(data));

             if (data.status) {
                      location.href = data.message;
             }
             else {
                $.isLoading("hide");
                Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
                {
                   msg: data.message,
                   title: "Uyarı"
                });
             }
          },
          error: function (resp) {
             $.isLoading("hide");
            
             if (resp != null && resp.message != null) {
                alertify.alert(resp.message);
             }

          }
       });


    },
    CreateOrderModel: function (data) {
      //Tipi 3 olan havale ile ödemedir.
      if (data.PaymentType > 0 && data.PaymentType == 3) {
        var hiddenAbroad = $("#slctd_s_o_i_valid_us").val();
        var isAbroad = hiddenAbroad == "True" || hiddenAbroad == "true" || hiddenAbroad == true ? true : false;
        Remmitence.OpenBankAccountRemitence(isAbroad);
        return false;
      }

      var list = [];

      $(".basketItems").each(function () {
        var t = $(this);
        var productId = t.data("productid");
        var customerPrice = $(".txtCustomerRequestPrice-" + productId).val();
        var basketId = t.data("basketitemid");
        var add = {
          ProductId: productId,
          BasketId: basketId,
          CustomerPrice: customerPrice,
          CustomerProductCode: $(".txtCustomerProductCode-" + productId).val()
        }
        list.push(add);
      });

      //$.isLoading({ text: ozdisanLocalization.general.basketPayMessage[lang] });

      $.isLoading({
        text: ozdisanLocalization.general.basketPayMessage[lang],
        'tpl': '<span class="isloading-wrapper %wrapper%">%text%  <img src="' + NetBt.Utility.LoadingGifPath() + '" width="40" height="40" /></span>'
      });

      var model = {
        SameAsBilling: data.SameAsBilling,
        DeliveryAddressId: data.DeliveryAddressId,
        DeliveryDescription: data.DeliveryDescription,
        OrderCreateWithNoPayment: data.OrderCreateWithNoPayment,
        BillingAddressId: data.BillingAddressId,
        list: list,
        siparisDescription: data.siparisDescription,
        PaymentType: data.PaymentType,
        ShipmentId: data.ShipmentId,
        AbroadAccountNo: data.AbroadAccountNo,
        IsAbroad: data.IsAbroad,
        CustomerProductCodeCategoryId: data.CustomerProductCodeCategoryId
      };

      $.ajax({
        url: "/Basket/CreateOrder",
        type: "POST",
        data: {
          model: model
        },
        async: true,
        success: function (data) {
          // işlem sonucuna göre değişiklikler yapılacaktır

          if (data.status) {
            if (data.type == "payprocess")
              location.href = data.message;
            else {
              alertify.alert(data.message);
              setTimeout(function () {
                location.href = "/B2b/Order/OrderDetail/" + data.data.OrderId;
              }, 1500);
            }
          }
          else {
            $.isLoading("hide");
            Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
            {
              msg: data.message,
              title: ozdisanLocalization.general.UyariSiparisOlusmadi[lang] 
            });

            //if (isAdd) {
            //  $(bskConfirm).html(data.message);
            //  $item.parent().append($(bskConfirm));
            //  $(bskConfirm).fadeIn();
            //  setTimeout(function () {
            //    $(bskConfirm).fadeOut();
            //    $(bskConfirm).remove();
            //  }, 1000);
            //}
          }
        },
        error: function (resp) {
          $.isLoading("hide");
          Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
            {
              msg: ozdisanLocalization.general.basketPayError[lang],
              title: ozdisanLocalization.general.UyariSiparisOlusmadi[lang]
              });

          if (resp != null && resp.message!=null) {
            alertify.alert(resp.message);
          }
          
          //if (isAdd) {
          //  $(bskConfirm).html(ozdisanLocalization.general.basketPayError);
          //  $item.parent().append($(bskConfirm));
          //  $(bskConfirm).fadeIn();
          //  setTimeout(function () {
          //    $(bskConfirm).fadeOut();
          //    $(bskConfirm).remove();
          //  }, 1000);
          //}
        }
      });

    },
    CreateOrderRemitence: function (SameAsBilling, DeliveryAddressId, DeliveryDescription, OrderCreateWithNoPayment, BillingAddressId, siparisDescription, PaymentType, RemitenceBankId) {
      //Tipi 3 olan havale ile ödemedir Ajax metodudur.
      var list = [];

      $(".basketItems").each(function () {
        var t = $(this);
        var productId = t.data("productid");
        var customerPrice = $(".txtCustomerRequestPrice-" + productId).val();
        var basketId = t.data("basketitemid");
        var add = {
          ProductId: productId,
          BasketId: basketId,
          CustomerPrice: customerPrice,
          CustomerProductCode: $(".txtCustomerProductCode-" + productId).val()
        }
        list.push(add);
      });

      $.isLoading({
        text: ozdisanLocalization.general.basketPayMessage[lang],
        'tpl': '<span class="isloading-wrapper %wrapper%">%text%  <img src="' + NetBt.Utility.LoadingGifPath() + '" width="40" height="40" /></span>'
      });
      var model = {
        SameAsBilling: SameAsBilling,
        DeliveryAddressId: DeliveryAddressId,
        DeliveryDescription: DeliveryDescription,
        OrderCreateWithNoPayment: OrderCreateWithNoPayment,
        BillingAddressId: BillingAddressId,
        list: list,
        siparisDescription: siparisDescription,
        PaymentType: PaymentType,
        RemitenceBankId: RemitenceBankId
      };

      $.ajax({
        url: "/Basket/CreateOrder",
        type: "POST",
        data: {
          model: model
        },
        async: true,
        success: function (data) {
          // işlem sonucuna göre değişiklikler yapılacaktır
          if (data.status) {
            if (data.type == "payprocess")
              location.href = data.message;
            else {
              alertify.alert(data.message);
              setTimeout(function () {
                location.href = "/B2b/Order/OrderDetail/" + data.data;
              }, 1500);
            }
          }
          else {
            $.isLoading("hide");
            Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
            {
              msg: data.message,
              title: "Uyarı"
            });
            if (isAdd) {
              $(bskConfirm).html(data.message);
              $item.parent().append($(bskConfirm));
              $(bskConfirm).fadeIn();
              setTimeout(function () {
                $(bskConfirm).fadeOut();
                $(bskConfirm).remove();
              }, 1000);
            }
          }
        },
        error: function () {
          $.isLoading("hide");
          Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
            {
              msg: ozdisanLocalization.general.basketPayError,
              title: "Uyarı"
            });
          if (isAdd) {
            $(bskConfirm).html(ozdisanLocalization.general.basketPayError);
            $item.parent().append($(bskConfirm));
            $(bskConfirm).fadeIn();
            setTimeout(function () {
              $(bskConfirm).fadeOut();
              $(bskConfirm).remove();
            }, 1000);
          }
        }
      });

    },
    CreateOrderRemitenceModel: function (data) {
      //Tipi 3 olan havale ile ödemedir Ajax metodudur.
      var list = [];

      $(".basketItems").each(function () {
        var t = $(this);
        var productId = t.data("productid");
        var customerPrice = $(".txtCustomerRequestPrice-" + productId).val();
        var basketId = t.data("basketitemid");
        var add = {
          ProductId: productId,
          BasketId: basketId,
          CustomerPrice: customerPrice,
          CustomerProductCode: $(".txtCustomerProductCode-" + productId).val()
        }
        list.push(add);
      });

      $.isLoading({
        text: ozdisanLocalization.general.basketPayMessage[lang],
        'tpl': '<span class="isloading-wrapper %wrapper%">%text%  <img src="' + NetBt.Utility.LoadingGifPath() + '" width="40" height="40" /></span>'
      });
      var model = {
        SameAsBilling: data.SameAsBilling,
        DeliveryAddressId: data.DeliveryAddressId,
        DeliveryDescription: data.DeliveryDescription,
        OrderCreateWithNoPayment: data.OrderCreateWithNoPayment,
        BillingAddressId: data.BillingAddressId,
        list: list,
        siparisDescription: data.siparisDescription,
        PaymentType: data.PaymentType,
        RemitenceBankId: data.RemitenceBankId,
        ShipmentId: data.ShipmentId,
        AbroadAccountNo: data.AbroadAccountNo,
        IsAbroad: data.IsAbroad
      };
      $.ajax({
        url: "/Basket/CreateOrder",
        type: "POST",
        data: {
          model: model
        },
        async: true,
        success: function (data) {
          // işlem sonucuna göre değişiklikler yapılacaktır
          console.log(JSON.stringify(data));

          if (data.status) {
            if (data.type == "payprocess")
              location.href = data.message;
            else {
              alertify.alert(data.message);
              setTimeout(function () {
                location.href = "/B2b/Order/OrderDetail/" + data.data;
              }, 1500);
            }
          }
          else {
            $.isLoading("hide");

             var sttrErr = ""; 
            if (data.message != undefined&&data.message!=null) {
               sttrErr = data.message;
            } else {
               sttrErr = data.Message;
            }

             Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
                {
                   msg: sttrErr,
                   title: "Uyarı"
                });

             //if (isAdd) {
             //  $(bskConfirm).html(data.message);
             //  $item.parent().append($(bskConfirm));
             //  $(bskConfirm).fadeIn();
             //  setTimeout(function () {
             //    $(bskConfirm).fadeOut();
             //    $(bskConfirm).remove();
             //  }, 1000);
             //}
          }
        },
        error: function () {
          $.isLoading("hide");
          Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
            {
              msg: ozdisanLocalization.general.basketPayError,
              title: "Uyarı"
            });
          //if (isAdd) {
          //  $(bskConfirm).html(ozdisanLocalization.general.basketPayError);
          //  $item.parent().append($(bskConfirm));
          //  $(bskConfirm).fadeIn();
          //  setTimeout(function () {
          //    $(bskConfirm).fadeOut();
          //    $(bskConfirm).remove();
          //  }, 1000);
          //}
        }
      });

    },
    update: function (BasketItemId, qty, isAdd, isBasketPage, isAll) {

      //Basket sayfasında ve carttan güncelleme yaparsa kullanıcı burda kontrol ediyoruz
      //eğer carttan yapmışsa güncellemeyi sepet sayfa içeriğini update ediyoruz.
      var cartUpdate = window.location.pathname;

      if (BasketItemId == undefined) {
        return { status: false };
      }

      if (!$.isNumeric(qty) && qty < 1) {
        qty = 1;
      }

      if (typeof isAll == 'undefined')
        isAll = false;

      $.ajax({
        url: "/Basket/UpdateToCart?allstock=" + isAll,
        type: "POST",
        data: { BasketItemId: BasketItemId, Qty: qty },
        async: true,
        success: function (data) {
          // işlem sonucuna göre değişiklikler yapılacaktır

          if (data.status) {
            //if (data.Model.length > 0)
            //  $(".bsktCount").css("display", "block").html(data.Model.length);
            //else
            //  $(".bsktCount").css("display", "none").html(0);

            if (isAdd) {
              $(bskConfirm).html(ozdisanLocalization.general.basketUpdate);
              $item.parent().append($(bskConfirm));
              $(bskConfirm).fadeIn();
              setTimeout(function () {
                $(bskConfirm).fadeOut();
                $(bskConfirm).remove();
              }, 1000);
            }

             
            basketEvents.getItems(isBasketPage);
          }
          else {
            if (isAdd) {
              $(bskConfirm).html(ozdisanLocalization.general.basketUpdateError);
              $item.parent().append($(bskConfirm));
              $(bskConfirm).fadeIn();
              setTimeout(function () {
                $(bskConfirm).fadeOut();
                $(bskConfirm).remove();
              }, 1000);
            }
          }
        },
        error: function () {
          if (isAdd) {
            $(bskConfirm).html(ozdisanLocalization.general.basketUpdateError);
            $item.parent().append($(bskConfirm));
            $(bskConfirm).fadeIn();
            setTimeout(function () {
              $(bskConfirm).fadeOut();
              $(bskConfirm).remove();
            }, 1000);
          }
        }
      });

    },
    remove: function (basketItemID, control, isBasketPage) {
      if (basketItemID === undefined) {
        return { Result: false };
      }

      loadingPane.show();
      $.ajax({
        url: "/Basket/DeleteItem",
        type: "POST",
        data: { BasketItemID: basketItemID },
        async: true,
        success: function (data) {
          setTimeout(function () {
            loadingPane.hide();
          }, 200);
          
          if (data.Result) {
            NetBt.Utility.Plugin.Toast.Success("", ozdisanLocalization.general.SepettenUrunSilindi[lang]);
            StorageBasketCurrentItemsCountRefresh();
            basketEvents.getItems(isBasketPage);
          }
          else {
            NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.basketProductRemoveError);
            basketEvents.getItems(isBasketPage);
          }
        },
        error: function () {
          setTimeout(function () {
            loadingPane.hide();
          }, 200);

          NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.basketProductRemoveSystemError);
          basketEvents.getItems(isBasketPage);
        }
      });

    },
    bindDelete: function (isBasketPage) {
      $(".cartDelete").bind("click", function (event) {
        event.stopImmediatePropagation();
        var id = $(event.currentTarget).data("basketitemid");
        basketEvents.remove(id, $(event.currentTarget), false);
        if (window.location.pathname === "/Basket/Index") {
          fillTables();
        }
      });
    },
    unbindDelete: function () {
      $(".cartDelete").unbind("click");
    },
    getItems: function (isBasketPage) {

      if (window.location.pathname == "/Basket/Index") {
        fillTables();
      }
      basketEvents.unbindDelete();


      $.ajax({
        url: "/Basket/ShoppingCart",
        type: "post",
        async: false
      }).done(function (returnData) {
        $("#bskBox").html(returnData);
        basketEvents.bindDelete(isBasketPage);
      }).error(function () {
        NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.basketError);
      });

    },
    //return biter
  }
})();

// Proje sepet işlemleri
ProjectBasketEvents = (function () {
  return {
    //return başlar

    CreateOrder: function (model, isAdd) {

      //$.isLoading({ text: ozdisanLocalization.general.basketPayMessage[lang] });
      $.isLoading({
        text: ozdisanLocalization.general.basketPayMessage[lang],
        'tpl': '<span class="isloading-wrapper %wrapper%">%text%  <img src="' + NetBt.Utility.LoadingGifPath() + '" width="50" height="50" /></span>'
      });
        

      $.ajax({
        url: "/B2b/ProjectNew/CreateOrder",
        //url: "/Project/CreateOrder",
        type: "POST",
        data: { model: model },
        async: true,
        success: function (data) {
            console.log(JSON.stringify(data));
          if (data.status) {
            if (data.type == "payprocess")
              location.href = data.message;
            else {
              alertify.alert(data.message);
              setTimeout(function () {
                location.href = "/B2b/Order/OrderDetail/" + data.data;
              }, 1500);
            }
          }
          else {
            $.isLoading("hide");
            alertify.alert(data.message);
            if (isAdd) {
              $(bskConfirm).html(data.message);
              $item.parent().append($(bskConfirm));
              $(bskConfirm).fadeIn();
              setTimeout(function () {
                $(bskConfirm).fadeOut();
                $(bskConfirm).remove();
              }, 1000);
            }
          }
        },
        error: function () {
          $.isLoading("hide");
          NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.basketPayError);
          if (isAdd) {
            $(bskConfirm).html(ozdisanLocalization.general.basketPayError);
            $item.parent().append($(bskConfirm));
            $(bskConfirm).fadeIn();
            setTimeout(function () {
              $(bskConfirm).fadeOut();
              $(bskConfirm).remove();
            }, 1000);
          }
        }
      });

    },
    update: function (BasketItemId, qty, isAdd, isBasketPage, isAll) {

      //Basket sayfasında ve carttan güncelleme yaparsa kullanıcı burda kontrol ediyoruz
      //eğer carttan yapmışsa güncellemeyi sepet sayfa içeriğini update ediyoruz.
      var cartUpdate = window.location.pathname;

      if (BasketItemId == undefined) {
        return { status: false };
      }

      if (!$.isNumeric(qty) && qty < 1) {
        qty = 1;
      }

      if (typeof isAll == 'undefined')
        isAll = false;
      //Todo : bura değişcek.
      $.ajax({
        url: "/Project/UpdateToCart?allstock=" + isAll,
        type: "POST",
        data: { BasketItemId: BasketItemId, Qty: qty },
        success: function (data) {

          if (data.status) {
            if (isAdd) {
              $(bskConfirm).html(ozdisanLocalization.general.basketUpdate);
              $item.parent().append($(bskConfirm));
              $(bskConfirm).fadeIn();
              setTimeout(function () {
                $(bskConfirm).fadeOut();
                $(bskConfirm).remove();
              }, 1000);
            }
            ProjectBasketEvents.getItems(isBasketPage);
          }
          else {

            if (isAdd) {
              $(bskConfirm).html(ozdisanLocalization.general.basketUpdateError);
              $item.parent().append($(bskConfirm));
              $(bskConfirm).fadeIn();
              setTimeout(function () {
                $(bskConfirm).fadeOut();
                $(bskConfirm).remove();
              }, 1000);
            }
          }
        },
        error: function () {
          if (isAdd) {
            $(bskConfirm).html(ozdisanLocalization.general.basketUpdateError);
            $item.parent().append($(bskConfirm));
            $(bskConfirm).fadeIn();
            setTimeout(function () {
              $(bskConfirm).fadeOut();
              $(bskConfirm).remove();
            }, 1000);
          }
        }
      });

    },
    remove: function (basketItemID, control, isBasketPage) {
      if (basketItemID === undefined) {
        return { Result: false };
      }

      $.ajax({
        url: "/Project/DeleteItem",
        type: "POST",
        data: { BasketItemID: basketItemID },
        async: false,
        success: function (data) {
          if (data.Result) {
            ProjectBasketEvents.getItems(isBasketPage);
            StorageBasketCurrentProjectItemsCountRefresh();
          }
          else {
           
            NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.basketProductRemoveError[lang]);
            ProjectBasketEvents.getItems(isBasketPage);
          }
        },
        error: function () {
          NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.basketProductRemoveSystemError[lang]);
          ProjectBasketEvents.getItems(isBasketPage);
        }
      });

    },
    bindDelete: function (isBasketPage) {
      $(".cartDelete").bind("click", function (event) {
        event.stopImmediatePropagation();
        var id = $(event.currentTarget).data("basketitemid");
        ProjectBasketEvents.remove(id, $(event.currentTarget), false);
        if (window.location.pathname === "/Project/Index") {
          fillTables();
        }
      });
    },
    unbindDelete: function () {
      $(".cartDelete").unbind("click");
    },
    getItems: function (isBasketPage) {

      if (window.location.pathname == "/Project/Index") {
        fillTables();
      }
      ProjectBasketEvents.unbindDelete();

      $.ajax({
        url: "/Project/ShoppingCart",
        type: "post",
        async: false
      }).done(function (returnData) {
        $("#ProjectBskBox").html(returnData);
        ProjectBasketEvents.bindDelete(isBasketPage);
      }).error(function () {
        NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.basketError[lang]);
      });
    }
    //return biter
  }
})();


;
(function defineMustache(global,factory){if(typeof exports==="object"&&exports&&typeof exports.nodeName!=="string"){factory(exports)}else if(typeof define==="function"&&define.amd){define(["exports"],factory)}else{global.Mustache={};factory(Mustache)}})(this,function mustacheFactory(mustache){var objectToString=Object.prototype.toString;var isArray=Array.isArray||function isArrayPolyfill(object){return objectToString.call(object)==="[object Array]"};function isFunction(object){return typeof object==="function"}function typeStr(obj){return isArray(obj)?"array":typeof obj}function escapeRegExp(string){return string.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function hasProperty(obj,propName){return obj!=null&&typeof obj==="object"&&propName in obj}var regExpTest=RegExp.prototype.test;function testRegExp(re,string){return regExpTest.call(re,string)}var nonSpaceRe=/\S/;function isWhitespace(string){return!testRegExp(nonSpaceRe,string)}var entityMap={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function escapeHtml(string){return String(string).replace(/[&<>"'\/]/g,function fromEntityMap(s){return entityMap[s]})}var whiteRe=/\s*/;var spaceRe=/\s+/;var equalsRe=/\s*=/;var curlyRe=/\s*\}/;var tagRe=/#|\^|\/|>|\{|&|=|!/;function parseTemplate(template,tags){if(!template)return[];var sections=[];var tokens=[];var spaces=[];var hasTag=false;var nonSpace=false;function stripSpace(){if(hasTag&&!nonSpace){while(spaces.length)delete tokens[spaces.pop()]}else{spaces=[]}hasTag=false;nonSpace=false}var openingTagRe,closingTagRe,closingCurlyRe;function compileTags(tagsToCompile){if(typeof tagsToCompile==="string")tagsToCompile=tagsToCompile.split(spaceRe,2);if(!isArray(tagsToCompile)||tagsToCompile.length!==2)throw new Error("Invalid tags: "+tagsToCompile);openingTagRe=new RegExp(escapeRegExp(tagsToCompile[0])+"\\s*");closingTagRe=new RegExp("\\s*"+escapeRegExp(tagsToCompile[1]));closingCurlyRe=new RegExp("\\s*"+escapeRegExp("}"+tagsToCompile[1]))}compileTags(tags||mustache.tags);var scanner=new Scanner(template);var start,type,value,chr,token,openSection;while(!scanner.eos()){start=scanner.pos;value=scanner.scanUntil(openingTagRe);if(value){for(var i=0,valueLength=value.length;i<valueLength;++i){chr=value.charAt(i);if(isWhitespace(chr)){spaces.push(tokens.length)}else{nonSpace=true}tokens.push(["text",chr,start,start+1]);start+=1;if(chr==="\n")stripSpace()}}if(!scanner.scan(openingTagRe))break;hasTag=true;type=scanner.scan(tagRe)||"name";scanner.scan(whiteRe);if(type==="="){value=scanner.scanUntil(equalsRe);scanner.scan(equalsRe);scanner.scanUntil(closingTagRe)}else if(type==="{"){value=scanner.scanUntil(closingCurlyRe);scanner.scan(curlyRe);scanner.scanUntil(closingTagRe);type="&"}else{value=scanner.scanUntil(closingTagRe)}if(!scanner.scan(closingTagRe))throw new Error("Unclosed tag at "+scanner.pos);token=[type,value,start,scanner.pos];tokens.push(token);if(type==="#"||type==="^"){sections.push(token)}else if(type==="/"){openSection=sections.pop();if(!openSection)throw new Error('Unopened section "'+value+'" at '+start);if(openSection[1]!==value)throw new Error('Unclosed section "'+openSection[1]+'" at '+start)}else if(type==="name"||type==="{"||type==="&"){nonSpace=true}else if(type==="="){compileTags(value)}}openSection=sections.pop();if(openSection)throw new Error('Unclosed section "'+openSection[1]+'" at '+scanner.pos);return nestTokens(squashTokens(tokens))}function squashTokens(tokens){var squashedTokens=[];var token,lastToken;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];if(token){if(token[0]==="text"&&lastToken&&lastToken[0]==="text"){lastToken[1]+=token[1];lastToken[3]=token[3]}else{squashedTokens.push(token);lastToken=token}}}return squashedTokens}function nestTokens(tokens){var nestedTokens=[];var collector=nestedTokens;var sections=[];var token,section;for(var i=0,numTokens=tokens.length;i<numTokens;++i){token=tokens[i];switch(token[0]){case"#":case"^":collector.push(token);sections.push(token);collector=token[4]=[];break;case"/":section=sections.pop();section[5]=token[2];collector=sections.length>0?sections[sections.length-1][4]:nestedTokens;break;default:collector.push(token)}}return nestedTokens}function Scanner(string){this.string=string;this.tail=string;this.pos=0}Scanner.prototype.eos=function eos(){return this.tail===""};Scanner.prototype.scan=function scan(re){var match=this.tail.match(re);if(!match||match.index!==0)return"";var string=match[0];this.tail=this.tail.substring(string.length);this.pos+=string.length;return string};Scanner.prototype.scanUntil=function scanUntil(re){var index=this.tail.search(re),match;switch(index){case-1:match=this.tail;this.tail="";break;case 0:match="";break;default:match=this.tail.substring(0,index);this.tail=this.tail.substring(index)}this.pos+=match.length;return match};function Context(view,parentContext){this.view=view;this.cache={".":this.view};this.parent=parentContext}Context.prototype.push=function push(view){return new Context(view,this)};Context.prototype.lookup=function lookup(name){var cache=this.cache;var value;if(cache.hasOwnProperty(name)){value=cache[name]}else{var context=this,names,index,lookupHit=false;while(context){if(name.indexOf(".")>0){value=context.view;names=name.split(".");index=0;while(value!=null&&index<names.length){if(index===names.length-1)lookupHit=hasProperty(value,names[index]);value=value[names[index++]]}}else{value=context.view[name];lookupHit=hasProperty(context.view,name)}if(lookupHit)break;context=context.parent}cache[name]=value}if(isFunction(value))value=value.call(this.view);return value};function Writer(){this.cache={}}Writer.prototype.clearCache=function clearCache(){this.cache={}};Writer.prototype.parse=function parse(template,tags){var cache=this.cache;var tokens=cache[template];if(tokens==null)tokens=cache[template]=parseTemplate(template,tags);return tokens};Writer.prototype.render=function render(template,view,partials){var tokens=this.parse(template);var context=view instanceof Context?view:new Context(view);return this.renderTokens(tokens,context,partials,template)};Writer.prototype.renderTokens=function renderTokens(tokens,context,partials,originalTemplate){var buffer="";var token,symbol,value;for(var i=0,numTokens=tokens.length;i<numTokens;++i){value=undefined;token=tokens[i];symbol=token[0];if(symbol==="#")value=this.renderSection(token,context,partials,originalTemplate);else if(symbol==="^")value=this.renderInverted(token,context,partials,originalTemplate);else if(symbol===">")value=this.renderPartial(token,context,partials,originalTemplate);else if(symbol==="&")value=this.unescapedValue(token,context);else if(symbol==="name")value=this.escapedValue(token,context);else if(symbol==="text")value=this.rawValue(token);if(value!==undefined)buffer+=value}return buffer};Writer.prototype.renderSection=function renderSection(token,context,partials,originalTemplate){var self=this;var buffer="";var value=context.lookup(token[1]);function subRender(template){return self.render(template,context,partials)}if(!value)return;if(isArray(value)){for(var j=0,valueLength=value.length;j<valueLength;++j){buffer+=this.renderTokens(token[4],context.push(value[j]),partials,originalTemplate)}}else if(typeof value==="object"||typeof value==="string"||typeof value==="number"){buffer+=this.renderTokens(token[4],context.push(value),partials,originalTemplate)}else if(isFunction(value)){if(typeof originalTemplate!=="string")throw new Error("Cannot use higher-order sections without the original template");value=value.call(context.view,originalTemplate.slice(token[3],token[5]),subRender);if(value!=null)buffer+=value}else{buffer+=this.renderTokens(token[4],context,partials,originalTemplate)}return buffer};Writer.prototype.renderInverted=function renderInverted(token,context,partials,originalTemplate){var value=context.lookup(token[1]);if(!value||isArray(value)&&value.length===0)return this.renderTokens(token[4],context,partials,originalTemplate)};Writer.prototype.renderPartial=function renderPartial(token,context,partials){if(!partials)return;var value=isFunction(partials)?partials(token[1]):partials[token[1]];if(value!=null)return this.renderTokens(this.parse(value),context,partials,value)};Writer.prototype.unescapedValue=function unescapedValue(token,context){var value=context.lookup(token[1]);if(value!=null)return value};Writer.prototype.escapedValue=function escapedValue(token,context){var value=context.lookup(token[1]);if(value!=null)return mustache.escape(value)};Writer.prototype.rawValue=function rawValue(token){return token[1]};mustache.name="mustache.js";mustache.version="2.2.0";mustache.tags=["{{","}}"];var defaultWriter=new Writer;mustache.clearCache=function clearCache(){return defaultWriter.clearCache()};mustache.parse=function parse(template,tags){return defaultWriter.parse(template,tags)};mustache.render=function render(template,view,partials){if(typeof template!=="string"){throw new TypeError('Invalid template! Template should be a "string" '+'but "'+typeStr(template)+'" was given as the first '+"argument for mustache#render(template, view, partials)")}return defaultWriter.render(template,view,partials)};mustache.to_html=function to_html(template,view,partials,send){var result=mustache.render(template,view,partials);if(isFunction(send)){send(result)}else{return result}};mustache.escape=escapeHtml;mustache.Scanner=Scanner;mustache.Context=Context;mustache.Writer=Writer});
;
var Order_Common= {
  OpenContract:function(url,orderId) {
 
    //window.open(url, 'Sayfa Önizleme', 'scrollbars=yes,menubar=1,resizable=1,width=1100,height=600');

    window.open(url+'/Order/OrderDetailContract/' + orderId + "", 'Ozdisan A.S.', 'scrollbars=yes,menubar=1,resizable=1,height=600,width=800', false);

   // generator.document.write(orderId);
    //generator.document.close();
  }

}

function openPaymentNotifyForm(orderId) {
  
  NetBt.Utility.Plugin.Modal.Open("/Order/PaymentNotifyMe/", { orderId: orderId }, function (response) {
    $("#txtOdenenTutar").keyup(function () {
      if (this.value.match(/[^0-9-,]/g)) {
        this.value = this.value.replace(/[^0-9]/g, '');
      }
    });
    $("#drpCurrency").change(function (e) {
      e.preventDefault();
      var currency = $("#drpCurrency").val();
      if (currency != "") {
        $("#drpCurrency").css("border", "1px solid green");
      } else {
        $("#drpCurrency").css("border", "1px solid red");
      }
    });
  });
}
function openPaymentNotifyFormNew(orderId) {
  NetBt.Utility.Plugin.Modal.Open("/Order/PaymentNotifyMe/", { orderId: orderId }, function (response) {

    $("#txtOdenenTutar").keyup(function () {
      if (this.value.match(/[^0-9-,]/g)) {
        this.value = this.value.replace(/[^0-9]/g, '');
      }
    });
  });
}
function sendPaymentForm() {
  var currency = $("#drpCurrency").val();
  if (currency == "") {
    $("#drpCurrency").css("border", "1px solid red");
    NetBt.Utility.Plugin.Toast.Warning("", "Para birimi seçmelisiniz");
    return;
  }

  var odenenTutar = $("#txtOdenenTutar").val();
  var odemeyiGonderen = $("#txtOdemeyiGonderenKisi").val();
  if (odenenTutar == "" || odemeyiGonderen == "") {
    NetBt.Utility.Plugin.Toast.Warning("", ozdisanLocalization.general.OdenenTutarveGonderen[lang]);
    return;
  }

  var adSoyad = $("#txtAdSoyad").val();
  var eposta = $("#txtEposta").val();
  var banka = $("#drpOdemeBank :selected").text();
  var bankaId = $("#drpOdemeBank :selected").val();
  var havaleSipNo = $("#txtHavaleSiparisNo").val();
  var odenmesiGerekenTutar = $("#txtOdenmesiGerekenTutar").val();
  var odenmesiGerekenTutarDolar = $("#txtOdenmesiGerekenTutarDolar").val();
  var mesaj = $("#txtMesaj").val();

  var model = {
    AdSoyad: adSoyad,
    Eposta: eposta,
    OdemeYapilanBanka: banka,
    HavaleSiparisNo: havaleSipNo,
    OdemeyiGonderenKisi: odemeyiGonderen,
    OdenmesiGerekenTutar: odenmesiGerekenTutar,
    OdenmesiGerekenTutarDolar: odenmesiGerekenTutarDolar,
    OdenenTutar: odenenTutar,
    Mesaj: mesaj,
    OdemeYapilanBankaId: bankaId,
    ParaBirimi: currency
  };

  loadingPane.show();
 
  $.ajax({
    type: "POST",
    url: "/Order/RemittancePaymentSend",
    data: model,
    dataType: "json",
    success: function (response) {
      if (response.status) {
        loadingPane.hide();
        NetBt.Utility.Plugin.Modal.Close();
        NetBt.Utility.Plugin.Toast.Success("", ozdisanLocalization.general.OdemeBildirimFormuBasarili[lang]);
      }
      else if (!response.status && response.message != "") {
        loadingPane.hide();
        NetBt.Utility.Plugin.Modal.Close();
        NetBt.Utility.Plugin.Toast.Warning("", response.message);
      }
      else {
        loadingPane.hide();
        NetBt.Utility.Plugin.Modal.Close();
        NetBt.Utility.Plugin.Toast.Error("", ozdisanLocalization.general.HataOlustu[lang]);
      }
    }
  });
}
// Rakam kontrol
;
var NetBt = {
  Handler: {
    Exception: function() {
      //Burada hata oluşursa alertfiy message error yapıp göster.
    }
  },
  Utility: {
    Ajax: {
      Request: {
        Custom: function(method, action, params, fnSuccessCallback, fnErrorCallback) {
          $.ajax({
            type: method,
            url: action,
            data: params, //JSON.stringify(params),
            dataType: "JSON",
            contentType: "application/json; charset=utf-8",
            async: true,
            cache: false,
            //timeout: 3000,
            success: fnSuccessCallback,
            error: function(jqxhr, settings, thrownError) {
              if (fnErrorCallback == null) {
                NetBt.Utility.Ajax.Response.Error(jqxhr, settings, thrownError);
              } else {
                fnErrorCallback(jqxhr, settings, thrownError);
              }
            }
          });
        },
        Form: function(form, fnSuccessCallback, fnErrorCallback, fnBeforeSubmit, fnClass, isLoaderActive) {

          form.ajaxSubmit({
            dataType: 'json',
            clearForm: false,
            resetForm: false,
            //timeout: 5000,
            beforeSubmit: function() {
              form.find(":input[type='button']").each(function() {
                $(this).prop('disabled', true);
              });
              if (isLoaderActive === 'true' || isLoaderActive === true) {
                NetBt.Utility.Plugin.Loader.Open(fnClass);
              }

              if (fnBeforeSubmit != null) {
                fnBeforeSubmit();
              }
            },
            success: fnSuccessCallback,
            error: function(jqxhr, settings, thrownError) {
              if (fnErrorCallback == null) {
                NetBt.Utility.Ajax.Response.Error(jqxhr, settings, thrownError);
              } else {
                fnErrorCallback(jqxhr, settings, thrownError);
              }
            },
            complete: function() {
              if (isLoaderActive === 'true' || isLoaderActive === true) {
                NetBt.Utility.Plugin.Loader.Close(fnClass);
              }
              form.find(":input[type='button']").each(function() {
                $(this).prop('disabled', false);
              });
            }
          });
        },
      },
      Response: {
        Error: function(jqxhr, settings, thrownError) {
          var errorText = $("#NetBt_Error_Text").val();
          if (errorText.length < 1) {
            errorText = "Hata !";
          }
          NetBt.Utility.Plugin.Toast.Error('', errorText, null, function() {
            var message = "<b>Error Status:</b> " + jqxhr.status + "<br />";
            message += "<b>Thrown Error:</b> " + thrownError + "<br />";
            message += "<b>Error ResponseText:</b><br />" + jqxhr.responseText;

            var generator = window.open('', 'ErrorWindow', 'height=600,width=800');
            generator.document.write(message);
            generator.document.close();
          });

        },
        Exception: function(exception) {
          var errorText = $("#NetBt_Error_Text").val();
          if (errorText.length < 1) {
            errorText = "Hata !";
          }

          NetBt.Utility.Plugin.Toast.Error('', errorText, null, function() {
            var generator = window.open('', 'ExceptionWindow', 'height=600,width=800');
            generator.document.write(exception.Message);
            generator.document.close();
          });
        },
        ValidationErrors: function(validationErrors) {
          var errors = "";
          $.each(validationErrors, function(index, item) {
            errors += item + "<br />";
          });

          if (!NetBt.Utility.Variable.IsNullOrZero(validationErrors.length)) {
            //alertify.log(errors);
            NetBt.Utility.Plugin.Toast.Warning('', errors);

          }
        },
        FluentValidation: function(validationError) {

          if (!NetBt.Utility.Variable.IsNullOrZero(validationError.length)) {
            NetBt.Utility.Plugin.Toast.Warning('', validationError);

            //alertify.error(validationError);
          }
        },
        Result: function(response, fnSuccessCallback) {

          if (response.IsSuccess == undefined) {
            switch (response.ErrorFlag) {
            case 1:
              NetBt.Utility.Ajax.Response.Exception(response.Exception);
              return false;

            case 10:
              NetBt.Utility.Ajax.Response.ValidationErrors(response.ValidationErrors);
              return false;
            }
          } else {
            if (!response.IsSuccess) {
              NetBt.Utility.Ajax.Response.Exception(response.Exception);
              return false;
            }
          }

          if (response.status != null && response.status == false && response.type != null && response.type == "Error") {
            NetBt.Utility.Ajax.Response.Exception(response.message);
            return false;
          }

          if (response.ErrorFlug == null && response.Data.ErrorFlag === 16) {
            NetBt.Utility.Ajax.Response.FluentValidation(response.Data.Data);
            return false;
          }

          fnSuccessCallback(response.Data);
        }
      }
    },

    Variable: {
      IsNullOrEmpty: function(value) {
        var result = value == null || value.length == 0 || isNaN(value);
        return result;
      },
      IsNullOrZero: function(value) {
        var result = value == null || value == 0 || isNaN(value);
        return result;
      }
    },
    Validate: {
      IsValid: function(form) {
        var result = form.data('unobtrusiveValidation').validate();
        return result;
      },

      Validator: function(form) {
        $.validator.unobtrusive.parse(form);
      }

    },
    Plugin: {
      Modal: {
        Open: function(action, params, fnSuccessCallback, fnErrorCallback, modal, width, method) {
          NetBt.Utility.Plugin.Loader.Open();
            
          if (modal == null) {
            modal = $("#ajax-mymodal");
          }

          $.ajax({
            type: (method == null ? "GET" : method),
            url: action,
            dataType: "HTML",
            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
            async: true,
            cache: false,
            data: params, //JSON.stringify($params),
            success: function (data) {
              
              NetBt.Utility.Plugin.Loader.Close();

              if (data != null) {
                try {
                  var json = jQuery.parseJSON(data);

                  if (json != null && json.status == false) {
                    NetBt.Utility.Plugin.Toast.Error("Hata oluştu", "Lütfen sonra tekrar deneyiniz.");
                    return false;
                  }
                }
                catch (e) {
                }
              }
              
              var size = width != null ? width : 510;
              var styles = {
                "width": size + "px",
                "margin-left": (-1 * size / 2) + "px",
                "background-color": "yellow"
              };

              modal.html(data).modal(styles).on("hidden", function() {
                modal.empty();
              });

              if (fnSuccessCallback != null) {
                fnSuccessCallback(data);
              }
            },
              error: function (jqxhr, settings, thrownError) {
              
              NetBt.Utility.Plugin.Loader.Close();

              if (fnErrorCallback == null) {
                NetBt.Utility.Ajax.Response.Error(jqxhr, settings, thrownError);
              } else {
                fnErrorCallback(jqxhr, settings, thrownError);
              }
            }
          });
        },
        Close: function(modal) {
          if (modal == null) {
            $("#ajax-mymodal").modal('hide');
          } else {
            modal.modal('hide');
          }
        }
      },
      CategoryMenuOpen: function(action, params, fnSuccessCallback, fnErrorCallback, modal, width, method) {
        if (modal == null) {
          modal = $("#Cate_Menu_Div");
        }

        $.ajax({
          type: (method == null ? "GET" : method),
          url: action,
          dataType: "HTML",
          contentType: "application/x-www-form-urlencoded; charset=UTF-8",
          async: true,
          cache: false,
          data: params, //JSON.stringify($params),
          success: function(data) {

            modal.html(data);

            if (fnSuccessCallback != null) {
              fnSuccessCallback(data);
            }
          },
          error: function(jqxhr, settings, thrownError) {
            NetBt.Utility.Plugin.Loader.Close();

            if (fnErrorCallback == null) {
              NetBt.Utility.Ajax.Response.Error(jqxhr, settings, thrownError);
            } else {
              fnErrorCallback(jqxhr, settings, thrownError);
            }
          }
        });
      },
      Loader: {
        Open: function (object, message) {
          
          loadingPane2.show();
        },

        Close: function(object, message) {
          loadingPane2.hide();
        }
      },
      AjaxData: function (action, params, method, fnSuccessCallback) {
        $.ajax({
          type: (method == null ? "GET" : method),
          url: action,
          dataType: "HTML",
          contentType: "application/x-www-form-urlencoded; charset=UTF-8",
          async: true,
          cache: false,
          data: params, //JSON.stringify($params),
          success: function (data) {
            fnSuccessCallback(data);
          },
          error: function (jqxhr, settings, thrownError) {
          }
        });
      },
      Toast: {
        Init: function(type, title, message, position, fnOnClickCallback) {
          if (position == undefined || position.length < 1 || position == '') {
            position = "bottom right";
          }
          Lobibox.notify(type, {
            //size: 'mini', // normal,mini,large
            sound: false, // ses
            delayIndicator: false, // geri sayım process 
            //rounded: true, // oval kenar
            position: position,
            msg: message,
            callback: fnOnClickCallback,
            title: '<b>' + title + '<b/>'
          });
        },

        Success: function(title, message, position, fnOnClickCallback) {
          NetBt.Utility.Plugin.Toast.Init("success", title, message, position, fnOnClickCallback);
        },

        Warning: function(title, message, position, fnOnClickCallback) {
          NetBt.Utility.Plugin.Toast.Init("warning", title, message, position, fnOnClickCallback);
        },

        Info: function(title, message, position, fnOnClickCallback) {
          NetBt.Utility.Plugin.Toast.Init("info", title, message, position, fnOnClickCallback);
        },

        Error: function(title, message, position, fnOnClickCallback) {

          NetBt.Utility.Plugin.Toast.Init("error", title, message, position, fnOnClickCallback);
        }
      },
      Pulsate: function(input) {

        $("" + input + "").pulsate({
          color: "#399bc3",
          repeat: 3
        });
      }
    },
    HtmlData: function (method, action, params, fnSuccessCallback, fnErrorCallback) {
      $.ajax({
        type: method,
        url: action,
        dataType: "HTML",
        contentType: "application/x-www-form-urlencoded; charset=UTF-8",
        async: true,
        cache: false,
        data: params, //JSON.stringify($params),
        success: fnSuccessCallback,
        error: function (jqxhr, settings, thrownError) {
          if (fnErrorCallback == null) {
            NetBt.Utility.Ajax.Response.Error(jqxhr, settings, thrownError);
          } else {
            fnErrorCallback(jqxhr, settings, thrownError);
          }
        },
        complete: function () {

        }
      });
    },
    Share: function(socialSite, url, title, description) {
      url = url == null ? location.href : url;
      title = title == null ? document.title : title;
      description = description == null ? $('meta[name="description"]').attr('content') : description;

      var socialUrl = '';
      if (socialSite === 'tw' || socialSite === 'twitter') {

        socialUrl = 'http://twitter.com/home?status=' + url;
      } else if (socialSite === 'in' || socialSite === 'linkedin') {
        socialUrl = 'https://www.linkedin.com/shareArticle?url=' + url;
      } else if (socialSite === 'fb' || socialSite === 'facebook') {
        socialUrl = 'http://www.facebook.com/sharer.php?u=' + url + '&amp;t=' + title;
      } else if (socialSite === 'gp' || socialSite === 'googleplus') {
        socialUrl = 'https://plus.google.com/share?url=' + url;
      }else if (socialSite === 'pinterest' || socialSite === 'pin') {
        socialUrl = 'http://pinterest.com/pin/create/button/?url=' + url + '&description='+description;
      }else if (socialSite === 'whatsapp' || socialSite === 'wht') {
          socialUrl = "https://api.whatsapp.com/send?text=" + encodeURIComponent(url);
      }
        var dualScreenLeft = window.screenLeft != undefined ? window.screenLeft : window.screenX;
        var dualScreenTop = window.screenTop != undefined ? window.screenTop : window.screenY;
        var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
        var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;

        var left = ((width/2) - (300)) + dualScreenLeft;
        var top = ((height / 2) - (250)) + dualScreenTop;
        
        window.open(socialUrl, socialSite + 'win', 'width=600, height=500, top = ' + top + ', left= ' + left);
    },
    MobilSetting: function($this) {
      var show = $("#Sett_Mob_Show_Hide").val();
      if (show == 'true') //close
      {
        $("#Sett_Mob_Show_Hide").val(false);
        $("#navigationsMobil").show();
        // $("#navigationsMobil").slideDown();
        $("#navigationsMobil div").removeClass('hidden-sm');
        $("#navigationsMobil ul").removeClass('hidden-sm');
      } else //open
      {
        $("#Sett_Mob_Show_Hide").val(true);
        $("#navigationsMobil").hide();
        $("#navigationsMobil div").addClass('hidden-sm');
        $("#navigationsMobil ul").addClass('hidden-sm');
        //$("#navigationsMobil").slideUp();
      }
    },

    UrlMobilPage :function(url) {
      loadingPane.show();
      window.location.href = url;
      loadingPane.hide();
    },
    LogonB2c:function() {
      loadingPane.show();
      window.location.href = '/Account/LogOnB2c';
      loadingPane.hide();
    },
    QuickView: function (id) {
      NetBt.Utility.Plugin.Modal.Open("/Product/DetailPartial/", { id: id }, function () {
      });
    },
    QuickViewJustProperty: function (id) {
      NetBt.Utility.Plugin.Modal.Open("/Product/DetailPropertyPartial/", { id: id }, function () {
      });
    },
    FastSearch: function (input, placeholder, form, response) {
      input.select2({
        placeholder: placeholder,
        minimumInputLength: 3,
        allowClear: true,
        ajax: {
          url: form.attr('action'),
          dataType: 'json',
          type: "POST",
          error: function (jqXHR, textStatus, errorThrown) {
            $.Modal.Danger("Hata! " + textStatus, errorThrown);
          },
            data: function (term, page) {
                
            var postData = form.serializeArray();
            postData.push({ name: "name", value: term });
            return postData;
          },
          timeout: 10000,
          results: function (data, page) {
            var parseData;
            NetBt.Utility.Ajax.Response.Result(data, function (last) {
              parseData = last;
            });
            return {
              results: parseData
            };
          }
        }
      }).on("change", function (t) {

      });
    },
    GetPager: function (pager, total, id) {
      
      $.ToPager({
        count: total,
        currentPage: parseInt(pager.CurrentPage),
        target: id,
        maxView: 10,
        pageCount: pager.TakeCount
      });
    },
    SaveFilterParam: function (currentPage, filter, order, takeCount, defaultOrder) {
      if (takeCount > 0)
        $("#TakeCount").val(takeCount);
      if (filter !== undefined && filter !== null && filter.length > 0) {
        $("#Filter").val(filter);
      }

      $("#CurrentPage").val(currentPage);
      if (order === undefined || order === null) {
        $("#Order").val(defaultOrder);
      } else {
        $("#Order").val(order);
      }
    },
    SaveFilterParamDifferent: function (number, currentPage, filter, order, takeCount, defaultOrder) {
      if (takeCount > 0)
        $("#TakeCount" + number + "").val(takeCount);
      if (filter !== undefined && filter !== null && filter.length > 0) {
        $("#Filter" + number + "").val(filter);
      }

      $("#CurrentPage" + number + "").val(currentPage);
      if (order === undefined || order === null) {
        $("#Order" + number + "").val(defaultOrder);
      } else {
        $("#Order" + number + "").val(order);
      }
    },
    KeyPressActive: function (textbox, button) {
      $('' + textbox + '').bind('keypress', function (e) {
        var code = e.keyCode || e.which;
        if (code === 13) {
          $('' + button + '').click();
          return false;
        }
      });
    },
    SortOrderColumn: function (response) {
      $(".tablecontent thead tr th a").each(function () {
        $(this).click(function () {
          var t = $(this);
          var order = t.data('order').split('|');
          var prop = order[0];
          var r = '|';
          var ord = order[1];
          var d = "";
          // alert(ord);
          if (ord === 'DESC') {
            d = 'ASC';
          } else {
            d = 'DESC';
          }
          var cls = t.find('.angleitems');
          if (cls.hasClass('fa-angle-double-up')) {
            cls.removeClass('fa-angle-double-up').addClass('fa-angle-double-down');
          } else {
            cls.removeClass('fa-angle-double-down').addClass('fa-angle-double-up');
          }
          var orderResult = '' + prop + r + d + '';
          $(this).data('order', orderResult);
          //Response döndürür.
          response(orderResult);
          return true;
        });
      });
      return false;
    },
    TimeFormat: function (val) {
      if (val == null || val.length < 1) {
        return null;
      }
      if (val.indexOf("T") !== -1) {
        //T formatında tarih geliyor.
        var split = val.split('T');
        var dts = split[0].split('-');
        var hrs = split[1].split(":");
        return dts[2] + "." + dts[1] + "." + dts[0] + " " + hrs[0] + ":" + hrs[1];

      } else {
        var date = new Date(val);
        var _currMonth = parseInt(date.getMonth());
        var currMonth = _currMonth + 1;
        if (currMonth < 10) {
          currMonth = "0" + currMonth;
        }
        var day = date.getDate();
        if (day < 10) {
          day = "0" + day;
        }
        var h = date.getHours();
        if (h < 10) {
          h = "0" + h;
        }
        var m = date.getMinutes();
        if (m < 10) {
          m = "0" + m;
        }
        return day + "." + currMonth + "." + date.getFullYear() + " " + h + ":" + m;
      }
    },
    Cookie: {
      Write: function myfunction(c_name, value) {
        sessionStorage.setItem(''+c_name+'' ,value);
        //var exdate = new Date();
        //exdate.setDate(exdate.getDate() + expiredays);
        //document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toUTCString());
      },
      Read: function (c_name) {
       // alert(c_name);
        //if (document.cookie.length > 0) {
        //  c_start = document.cookie.indexOf(c_name + "=");
        //  if (c_start != -1) {
        //    c_start = c_start + c_name.length + 1;
        //    c_end = document.cookie.indexOf(";", c_start);
        //    if (c_end == -1) c_end = document.cookie.length;
        //    return unescape(document.cookie.substring(c_start, c_end));
        //  }
        //}
        //return "";
        
        sessionStorage.getItem(''+c_name+'');
      },
      Delete: function (name) {
        sessionStorage.setItem(name, null);

        //document.cookie = name + '=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
      }
    },
    UrlRedirect: function (url) {
      NetBt.Utility.Plugin.Loader.Open();
      location.href = url;
    },
    NumberStringFormat: function (nStr) {
        nStr += '';
        var x = nStr.split('.');
        var x1 = x[0];
        var x2 = x.length > 1 ? '.' + x[1] : '';
        var rgx = /(\d+)(\d{3})/;
        while (rgx.test(x1)) {
            x1 = x1.replace(rgx, '$1' + '.' + '$2');
        }
        return x1 + x2;
    },
    KeydownInit: function (element) {
      $("" + element + "").keydown(function (e) {
        // Allow: backspace, delete, tab, escape, enter and .
        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
          // Allow: Ctrl+A, Command+A
            (e.keyCode === 65 && (e.ctrlKey === true || e.metaKey === true)) ||
          // Allow: home, end, left, right, down, up
            (e.keyCode >= 35 && e.keyCode <= 40)) {
          // let it happen, don't do anything

          return;
        }
        // Ensure that it is a number and stop the keypress
        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105) && e.keyCode != 188) {
          e.preventDefault();
        }
      });
    },
    LoadingGifPath:function() {
      return "https://cdn.ozdisan.com/content/loading.svg";
      },
    CountDownDateInit: function () {

        $(".count-down").each(function () {
            var pid = $(this).data("id");
            var endDate = $(this).data("enddate");
            var end = new Date(endDate);
            var _second = 1000;
            var _minute = _second * 60;
            var _hour = _minute * 60;
            var _day = _hour * 24;
            var timer;
            function showRemaining() {
                var now = new Date();
                var distance = end - now;
                if (distance == 0) {
                    clearInterval(timer);
                    setTimeout(function() {
                        location.reload();
                    }, 2000);
                    
                    return;
                }

                var days = Math.floor(distance / _day);
                var hours = Math.floor((distance % _day) / _hour);
                var minutes = Math.floor((distance % _hour) / _minute);
                var seconds = Math.floor((distance % _minute) / _second);
                $(".count-day-" + pid).text(days);
                $(".count-hour-" + pid).text(hours);
                $(".count-min-" + pid).text(minutes);
                $(".count-sec-" + pid).text(seconds);
            }

            timer = setInterval(showRemaining, 1000);

        });


    }
  }

   
}

var typingTimer;
var doneTypingIntervalFastSearch = 500;
var doneTypingIntervalFastSearchMobil = 1000;

var txtFastSearchKeyDown = function () {
    clearTimeout(typingTimer);
}

var txtFastSearchKeyUp = function () {
    clearTimeout(typingTimer);
    typingTimer = setTimeout(FastSearch, doneTypingIntervalFastSearch);
}

var txtFastSearchMobilKeyDown = function () {
    clearTimeout(typingTimer);
}

var txtFastSearchMobilKeyUp = function () {
    clearTimeout(typingTimer);
    typingTimer = setTimeout(FastSearchMobil, doneTypingIntervalFastSearchMobil);
}

var prevSearch = ""

var FastSearch = function () {
    var q = $("#txtSearch").val();
    $(".fastSearchDiv").hide();
  if (q == "" || q == undefined) {
     NetBt.Utility.Plugin.Toast.Warning('', 'Bulmak istediğiniz ürünü ya da özelliği arama motoruna yazınız');
    return false;
    }

    if (q.trim().length < 4) {
        return false;
    }

    if (q.trim() == prevSearch) {
        $(".fastSearchDiv").show();
        return false
    }
    else {
        prevSearch = q.trim();
    }
  
  $("#Fast_Tmp_Product_List_Result").empty();

   // q = q.replace(".", " ");
    $.ajax({
      type: "GET",
      url: "/Product/FastSearch/",
      data: { q: q },
        success: function (data) {
            
        if (data.List.length > 0) {
          $(".fastSearchDiv").show();
          $(".fastSearchDiv").css('background-color', '');
          var innerHtml = Mustache.to_html($('#Fast_Search_Template_List').html(), { DATA: data.List });
          $("#Fast_Tmp_Product_List_Result").empty().append(innerHtml);
        } else {
          $(".fastSearchDiv").css('background-color', '#fcf8e3');
          var innerHtmlNot = $('#Fast_Search_Template_List_NotFount').html();
        //  alert(innerHtmlNot);
          $("#Fast_Tmp_Product_List_Result").empty().append(innerHtmlNot);
          }
          //for (var i = 0; i < data.List.length; i++) {
          //    if (data.IsCompany == true && data.List[i].IsB2C == true) {
          //        $(".fastSearchDiv").show();
          //        $(".fastSearchDiv").css('background-color', '');
          //        var innerHtml = Mustache.to_html($('#Fast_Search_Template_List').html(), { DATA: data.List });
          //        $("#Fast_Tmp_Product_List_Result").empty().append(innerHtml);
          //    }
          //    else if (data.IsCompany == false && data.List[i].IsB2B == true) {
          //        $(".fastSearchDiv").show();
          //        $(".fastSearchDiv").css('background-color', '');
          //        var innerHtml = Mustache.to_html($('#Fast_Search_Template_List').html(), { DATA: data.List });
          //        $("#Fast_Tmp_Product_List_Result").empty().append(innerHtml);
          //    }
          //    else {
          //        $(".fastSearchDiv").css('background-color', '#fcf8e3');
          //        var innerHtmlNot = $('#Fast_Search_Template_List_NotFount').html();
          //        //  alert(innerHtmlNot);
          //        $("#Fast_Tmp_Product_List_Result").empty().append(innerHtmlNot);
          //    }
          //}

        //if (data.Categories.length > 0) {
        //  var innerHtmlCate = Mustache.to_html($('#Category_Fast_Search_Template_List').html(), { DATA: data.Categories });
        //  $("#Fast_Category_SearchResult").empty().append(innerHtmlCate);
        //} else {
        //  $("#Fast_Category_SearchResult").empty();
        //}

      },
      error: function () {

      },
      complete: function () {

      }
    });


  //NetBt.Utility.Ajax.Request.Custom("GET", "/Product/FastSearch/", { q: q }, function (response) {
  //    NetBt.Utility.Ajax.Response.Result(response, function (data) {
  //      //alert(JSON.stringify(data));
  //      if (data.length > 0) {
  //        $(".fastSearchDiv").show();
  //        var innerHtml = Mustache.to_html($('#Fast_Search_Template_List').html(), { DATA: data });
  //        $("#Fast_Tmp_Product_List_Result").empty().append(innerHtml);
  //      }
  //    });
  //  });
  return false;
}

var FastSearchMobil = function () {
  var v = $("#txtSearchMobile");
    $(".fastSearchDivMobil").hide();

  var q = v.val();
  tog(v);
    $("#Fast_Tmp_Product_List_Result_Mobil").empty();
    if (q.trim().length < 4) {
        return false;
    }

    if (q.trim() == prevSearch) {
        $(".fastSearchDivMobil").show();
        return false
    }
    else {
        prevSearch = q.trim();
    }

   // q = q.replace(".", " ");
    $.ajax({
      type: "GET",
      url: "/Product/FastSearch/",
      data: { q: q },
      success: function (data) {
        if (data.List.length > 0) {
          $(".fastSearchDivMobil").show();
          $(".fastSearchDivMobil").css('background-color', '');
          var innerHtml = Mustache.to_html($('#Fast_Search_Template_List').html(), { DATA: data.List });
          $("#Fast_Tmp_Product_List_Result_Mobil").empty().append(innerHtml);

        } else {
          $(".fastSearchDivMobil").css('background-color', '#fcf8e3');
          var innerHtmlNot = $('#Fast_Search_Template_List_NotFount').html();
          //  alert(innerHtmlNot);
          $("#Fast_Tmp_Product_List_Result_Mobil").empty().append(innerHtmlNot);
        }

        console.log(JSON.stringify(data.Categories));

      },
      error: function () {

      },
      complete: function () {

      }
    });

  //NetBt.Utility.Ajax.Request.Custom("GET", "/Product/FastSearch/", { q: q }, function (response) {
  //    NetBt.Utility.Ajax.Response.Result(response, function (data) {
  //      //alert(JSON.stringify(data));
  //      if (data.length > 0) {
  //        $(".fastSearchDiv").show();
  //        var innerHtml = Mustache.to_html($('#Fast_Search_Template_List').html(), { DATA: data });
  //        $("#Fast_Tmp_Product_List_Result").empty().append(innerHtml);
  //      }
  //    });
  //  });
  return false;
}

$(document).keyup(function (e) {
  if (e.keyCode == 27) { // arama barına esc ye basılırsa div kapatır
    $(".fastSearchDiv").hide();
  }
});


 function SearcTextBoxEvent() {

  var v = $("#txtSearch");
  if (v!=undefined&&v!=null&& v.val()!=undefined&& v.val()!=null&& v.val().length > 0) {
    v.addClass("x onX");
  }
  var vm = $("#txtSearchMobile");
  if (vm!=null&& vm != undefined && vm.val() != undefined && vm.val() != null && vm.val().length > 0) {
    vm.addClass("x onX");
  }
}

function tog(v) { return v ? 'addClass' : 'removeClass'; }
$(document).on('input', '.clearable', function () {
  $(this)[tog(this.value)]('x');
}).on('mousemove', '.x', function (e) {
  $(this)[tog(this.offsetWidth - 18 < e.clientX - this.getBoundingClientRect().left)]('onX');
}).on('touchstart click', '.onX', function (ev) {
  $(".fastSearchDivMobil").hide();
  $("#Fast_Tmp_Product_List_Result_Mobil").empty();
  $(".fastSearchDiv").hide();
  $("#Fast_Tmp_Product_List_Result").empty();
  ev.preventDefault();
  $(this).removeClass('x onX').val('').change();
});

jQuery.ToPager = function (option) {
  var _options = $.extend(true, {}, option);
  var pages = Math.ceil(_options.count / (_options.pageCount));

  if (_options.currentPage > pages || _options.count < _options.pageCount || _options.count <= 3) {
    jQuery(_options.target).empty();
    return false;
  }
  var i = _options.currentPage + 1 >= _options.maxView ? _options.currentPage - 2 : 0;
  var ekle = i + _options.maxView;
  if (_options.maxView < pages) {
    if (pages - _options.currentPage === 1) {
      ekle = ekle - 2;
      i = i - 2;
    } else if (pages - _options.currentPage === 2) {
      ekle = ekle - 1;
      i = i - 1;
    }
  }
  var length = _options.currentPage + 1 >= _options.maxView ? ekle : _options.maxView > pages ? pages : _options.maxView;
  var pagination = new $.StringBuilder();
  
  // Left Pagination Begin
  pagination.Append('<ul class="pagination pagination-sm pull-left">');

  // Left Button Begin
  if (_options.currentPage === 0) {
    pagination.Append('<li class="disabled"><a href="javascript:;"><i class="fa fa-angle-left"></i></a></li>');
  } else {
    pagination.Append($.Format('<li><a href="javascript:;" data-page="{0}"><i class="fa fa-angle-left"></i></a></li>', (_options.currentPage - 1)));
  }
  // Left Button End

  // Numeric Button Begin
  for (i; i < length; i++) {
    if (i === _options.currentPage) {
      pagination.Append($.Format('<li class="disabled"><a href="javascript:;">{0}</a></li>', i + 1));
    } else {
      pagination.Append($.Format('<li><a href="javascript:;" data-page="{0}">{1}</a></li>', i, i + 1));
    }
  }
  // Numeric Button End

  // Right Button Begin
  if (_options.currentPage === (pages - 1)) {
    pagination.Append('<li class="disabled"><a href="javascript:;"><i class="fa fa-angle-right"></i></a></li>');
  } else {
    pagination.Append($.Format('<li><a href="javascript:;" data-page="{0}"><i class="fa fa-angle-right"></i></a></li>', _options.currentPage + 1));
  }
  // Right Button End

  pagination.Append('</ul>');
  // Left Pagination End

  // Right Pagination Begin
  pagination.Append('<ul class="pagination pagination-sm pull-right">');

  // First Button Begin
  if (_options.currentPage === 0) {
    pagination.Append('<li class="previous disabled"><a href="javascript:;">&larr;&nbsp;' + ozdisanLocalization.general.Ilk[lang] + '</a></li>');
  } else {
    pagination.Append('<li class="previous"><a href="javascript:;" data-page="0">&larr;&nbsp;' + ozdisanLocalization.general.Ilk[lang] + '</a></li>');
  }
  
  pagination.Append($.Format('<li><span class="text-muted" style="cursor:default;">{0} ' + ozdisanLocalization.general.Sayfa[lang] + ', {1} ' + ozdisanLocalization.general.Kayit[lang] + '</span></li>', pages, _options.count));

  // Last Button Begin
  if (_options.currentPage === (pages - 1)) {
    pagination.Append('<li class="next disabled"><a href="javascript:;">' + ozdisanLocalization.general.Son[lang] + '&nbsp;&rarr;</a></li>');
  } else {
    pagination.Append($.Format('<li class="next"><a href="javascript:;" data-page="{0}">' + ozdisanLocalization.general.Son[lang] + '&nbsp;&rarr;</a></li>', (pages - 1)));
  }
  // Last Button End

  pagination.Append('</ul>');
  // Right Pagination End

  jQuery(_options.target).empty().html(pagination.ToString());
};

jQuery.Format = function (source, params) {
  if (arguments.length === 1) {
    params = "";
    source = "Not found params!";
  }
  if (arguments.length > 2 && params.constructor !== Array) {
    params = $.makeArray(arguments).slice(1);
  }
  if (params.constructor !== Array) {
    params = [params];
  }
  $.each(params, function (i, n) {
    source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function () {
      return n;
    });
  });
  return source;
};


var urlRedirect = function (url) {
  loadingPane.show();
  window.location.href = url;
  loadingPane.hide();
};

$(function() {
    NetBt.Utility.CountDownDateInit();

});


function copyToClipboard(copyText) {
    var $temp = $("<input>");
    $("body").append($temp);
    $temp.val(copyText).select();
    document.execCommand("copy");
    $temp.remove();

    NetBt.Utility.Plugin.Toast.Success(ozdisanLocalization.general.Copied[lang]);
}
;
function openBankAccount() {
    NetBt.Utility.Plugin.Modal.Open("/Home/BankAccounts/", function (response) {
    });
}

$(function () {

    $('#srcBtnMobile').click(function () {
        window.location.href = '/Category/GetSearchCategories?SearchText=' + $('#txtSearchMobile').val();
    });

    $('.ChangeLanguage').each(function () {
        var $this = $(this);
        $this.click(function () {
            var culture = $this.data('culture');
            $.ajax({
                url: "/Home/SetLangCode/",
                dataType: 'json',
                contentType: "application/json",
                type: "GET",
                data: { LangCode: culture },
                success: function (response) {
                    location.reload();
                }
            });
        });
    });
});

$('body').on('hidden.bs.modal', '.modal', function () {
    $('video').trigger('pause');
});

$('#srcBtn').click(function () {
    window.location.href = '/Category/GetSearchCategories?SearchText=' + $('#txtSearch').val();
});



function genelMailGonder(mail) {
    var subject = $('.ddlGenelInfoMailSubject').val();
    var name = $('.txtGenelInfoMailName').val();
    var email = $('.txtGenelInfoMailEmail').val();
    var phone = $('.txtGenelInfoMailPhone').val();
    var message = $('.txtGenelMailInfoMessage').val();

    var to = mail;

    $.ajax({
        type: "POST",
        url: "/Home/SendMail",
        data: {
            subject: subject,
            name: name,
            email: email,
            phone: phone,
            message: message,
            to: to
        },
        success: function (data) {
            if (data.Result) {
                alertify.success(data.Message);
                $('#sendInfoMail').modal('toggle');
            } else {
                alertify.alert(data.Message);
            }

            $('#ddlGenelInfoMailSubject').val('');
            $('#txtGenelInfoMailName').val('');
            $('#txtGenelInfoMailEmail').val('');
            $('#txtGenelInfoMailPhone').val('');
            $('#txtGenelMailInfoMessage').val('');
        },
        error: function () {

        },
        complete: function () {

        }
    });
}

var ContactUs = {
    OpenModal: function (mail, bolum) {
        NetBt.Utility.Plugin.Modal.Open("/ContactUS/OpenForm/", {}, function () {
            $("#NetBt_SendMailName").val(mail);
            $("#ToMailName").text(mail);
            $("#SendMailButton").data('bolum', bolum);
        });
    }
}

var ReportAnError = {
    OpenModal: function (productName, productId) {
        NetBt.Utility.Plugin.Modal.Open("/Product/OpenReportForm/", {}, function () {
            $("#ProductId").val(productId);
            $("#ProductName").text(productName);
            $("#ProductNamex").val(productName);
            //$("#SendMailButton").data('bolum', productId);
        });
    }
}

var DesignContact = {
    OpenModal: function (mail, bolum) {
        NetBt.Utility.Plugin.Modal.Open("/ContactUS/OpenForm/", {}, function () {

            $(".ddlMerkezInfoMailSubject").val('teknik');
            $(".ddlMerkezInfoMailSubject").attr("disabled", "disabled");

            $("#NetBt_SendMailName").val(mail);
            $("#ToMailName").text(mail);
            $("#SendMailButton").data('bolum', bolum);
        });
    }
}

function CategoryMenuEventActive() {
    $('[data-toggle="tooltip"]').tooltip();

    var isOpen = true;
    $("#catBtn").click(function () {
        if (!isOpen) {

            mainActions.rootContainer.open();
            $("#Cate_Menu_Div").slideDown();
            $(".main").attr("style", "margin-top: 295px;");
            isOpen = true;
        } else {
            mainActions.rootContainer.close();
            $("#Cate_Menu_Div").slideUp();
            $(".main").attr("style", "margin-top: 160px;");
            isOpen = false;
        }
    });

    //menu management
    $(".subMenu").hover(function (e) {
        $(".subNav").hide();
        $("#subPane").stop().animate({
            top: $(".menu").height(),
            height: "toggle"
        }, 300, function () {
            $(e.currentTarget).stop().find(".subNav").show();
            $("#subPane").css('height', '110px');
        });


    }, function (e) {
        $(e.currentTarget).stop().find(".subNav").hide();
        $("#subPane").stop().animate({
            top: "-160",
            height: "toggle"
        }, 300, function () {
        });
    });
    //menu management

    //lg category management
    //Eski hali start
    $(".catList li a").hover(function (e) {

        if ($(e.currentTarget).find(".subCat").find("li").length > 0) {
            $li = $(e.currentTarget).parent();
            $cats2 = $(".catList").parent().next();
            $subCategory = $(e.currentTarget).find(".subCategory");
            $cats2.stop().animate({ marginTop: 300 }, 350);
            //$(".main").stop().animate({ marginTop: 560 }, 350);
            $subCategory.stop().animate({ height: 300 }, 350);
            $li.find(".arwCat").show();
        }
    }, function (e) {
        $li = $(e.currentTarget).parent();
        $subCategory = $(e.currentTarget).find(".subCategory");
        $cats2 = $(".catList").parent().next();
        $subCategory.stop().animate({ height: 0 }, 350);
        //$(".main").stop().animate({ marginTop: 260 }, 350);
        $cats2.stop().animate({ marginTop: 0 }, 350);
        $li.find(".arwCat").hide();
    });

    $(".catList2 li a").hover(function (e) {

        if ($(e.currentTarget).find(".subCat").find("li").length > 0) {
            $li = $(e.currentTarget).parent();
            $subCategory = $(e.currentTarget).find(".subCategory");
            $cats2 = $(".catList").parent().next();
            $cats2.stop().animate({ marginTop: 300 }, 350);
            //$(".main").stop().animate({ marginTop: 560 }, 350);
            $subCategory.stop().animate({ height: 300, }, 350);
            $li.find(".arwCat2").show();
        }
    }, function (e) {
        $li = $(e.currentTarget).parent();
        $subCategory = $(e.currentTarget).find(".subCategory");
        $cats2 = $(".catList").parent().next();
        $subCategory.stop().animate({ height: 0 }, 350);
        //$(".main").stop().animate({ marginTop: 260 }, 350);
        $cats2.stop().animate({ marginTop: 0 }, 350);
        $li.find(".arwCat2").hide();

    });

    $(".mdcategory a").hover(function (e) {
        var width = $(".mdcategory").width();
        var left = $(".mdcategory").position().left;
        $(e.currentTarget).find(".subCat").show().width(width).css("left", left + "px").stop();
    }, function (e) {
        $(e.currentTarget).find(".subCat").stop().slideUp(100).fadeOut();
    });


    $(window).scroll(function (event) {
        var scroll = $(window).scrollTop();
        if (scroll > 10)
            $(".shadow").css({
                "background": "rgba(255, 255, 255, 0.8)",
                "box-shadow": "3px 3px 7px 0px #DADADA"

            });
        else
            $(".shadow").css({
                "background": "#fff",
                "box-shadow": "none"

            });
    });

};
var Common =
    {
        GetCategoryMenu: function () {
            var status = $("#Root_Get_CategoryMenu_Selected").val();
            if (status == null || status.length < 1) {
                $(".main").attr("style", "margin-top: 295px;");
                NetBt.Utility.Plugin.CategoryMenuOpen("/Category/GetRootCategoryMenu/", {}, function (response) {
                    var selectedCategoryEvent;
                    $(".linkP").click(function (e) {
                        e.stopImmediatePropagation();
                        e.preventDefault();
                        selectedCategoryEvent = e;
                        var catid = $(e.currentTarget).data("catid");
                        window.location.href = "/c/" + catid;
                    });

                    $("#Root_Get_CategoryMenu_Selected").val('true');
                    var div = $("#Layout_Get_Category_Link").html();
                    $("#Layout_Get_Category_Link").parent().html(div);
                    CategoryMenuEventActive();
                });
            }

        },
        GetPaylessPartial: function (isAbroad) {
            NetBt.Utility.Plugin.Modal.Open("/Payless/ListPartial/", { isAbroad: isAbroad }, function () {
            });
        },
        GetHomePageCategoryMenu: function () {
            NetBt.Utility.Plugin.CategoryMenuOpen("/Category/GetHomePageCategoryMenu/", {}, function (response) {
                Common.CategoryMenuEvent();
            }, null, $("#ozd-ctgr-left-menu"));
        },
        CategoryRedirect: function (catId) {
            window.location.href = "/c/" + catId;
        },
        CategoryMenuEvent: function () {
            var selectedCategoryEvent;
            $(".level2xxx").click(function (e) {
                e.stopImmediatePropagation();
                e.preventDefault();
                selectedCategoryEvent = e;

                var catid = $(e.currentTarget).data("catid");

                window.location.href = "/c/" + catid;
               // loadingPane.show();
            });
            $(".linkP").click(function (e) {
                e.stopImmediatePropagation();
                e.preventDefault();
                selectedCategoryEvent = e;

                var catid = $(e.currentTarget).data("catid");

                window.location.href = "/c/" + catid;
                //loadingPane.show();
            });


            $("#stickymenu .ozdisanmenu").affix({
                offset: {
                    top: 100
                }
            });

            $('.nav-tabs > li').find('a').click(function () {
                $(this).parent()
                    .siblings().addClass('hoverblock');
            });

            $(".ozd-hovermenu .dropdown").hover(
                function () { $(this).addClass('open') },
                function () { $(this).removeClass('open') }
            );

            $(".level2xxx")
                .hover(function () {
                    $(".level2xxx").removeClass('level2hover');
                    var id = $(this).data("id");
                    $('[data-id="' + id + '"]').addClass('level2hover');
                });

            $('.clickablemenu .dropdown').click('show.bs.dropdown', function (e) {
                var $dropdown = $(this).find('.dropdown-menu');
                var orig_margin_top = parseInt($dropdown.css('margin-top'));
                $dropdown.css({ 'margin-top': (orig_margin_top + 65) + 'px', opacity: 0 }).animate({ 'margin-top': orig_margin_top + 'px', opacity: 1 }, 420, function () {
                    $(this).css({ 'margin-top': '' });
                });
            });

            $('.verticalmenu .dropdown').click('show.bs.dropdown', function (e) {
                var $dropdown = $(this).find('.dropdown-menu');
                var orig_margin_top = parseInt("1", 10);
                $dropdown.css({ 'margin-left': (orig_margin_top + 65) + 'px', opacity: 0 }).animate({ 'margin-left': orig_margin_top + 'px', opacity: 1 }, 420, function () {
                    $(this).css({ 'margin-left': '' });
                });
            });

        },
        AddToFavorite: function (productId) {
            if (productId < 1)
                return false;

            NetBt.Utility.Ajax.Request.Custom("POST", "/FavoriteProduct/Create/", JSON.stringify({ productId: productId }), function (response) {
                NetBt.Utility.Ajax.Response.Result(response, function () {
                    NetBt.Utility.Plugin.Toast.Success("", ozdisanLocalization.general.ProductAddedToFavorite[lang]);
                    $(".delete_to_favorite_" + productId).show();
                    $(".add_to_favorite_" + productId).hide();

                });
            });
            return false;
        },
        DeleteToFavorite: function (productId) {
            if (productId < 1)
                return false;

            NetBt.Utility.Ajax.Request.Custom("POST", "/FavoriteProduct/Delete/", JSON.stringify({ productId: productId }), function (response) {
                NetBt.Utility.Ajax.Response.Result(response, function () {
                    NetBt.Utility.Plugin.Toast.Warning("", ozdisanLocalization.general.ProductDeletedToFavorite[lang]);
                    $(".delete_to_favorite_" + productId).hide();
                    $(".add_to_favorite_" + productId).show();

                });
            });
            return false;
        },
        DeleteAllFavorite: function () {
            NetBt.Utility.Ajax.Request.Custom("POST", "/FavoriteProduct/DeleteAll/", {}, function (response) {
                NetBt.Utility.Ajax.Response.Result(response, function (data) {
                    NetBt.Utility.Plugin.Toast.Success("", ozdisanLocalization.general.AllOfThemDeleted[lang]);
                });
            });
            return false;
        },
        IsFavoriteProduct: function (productId) {
            if (productId < 1)
                return false;

            NetBt.Utility.Ajax.Request.Custom("GET", "/FavoriteProduct/IsAnyFavorite/", { productId: productId }, function (response) {
                NetBt.Utility.Ajax.Response.Result(response, function (data) {

                    if (data.status) {
                        if (data.data) {
                            $(".delete_to_favorite_" + productId).show();
                        } else {
                            $(".add_to_favorite_" + productId).show();
                        }
                    }

                });
            });
            return false;
        },
        /**
         * Kıyaslama Sepeti
         */
        CompareProduct: {
            Open: function (productId) {
                NetBt.Utility.Plugin.Modal.Open("/CompareProduct/Create/", { productId: productId }, function () { });
            },
            Delete: function (productId) {
                if (productId < 1)
                    return false;

                NetBt.Utility.Ajax.Request.Custom("POST", "/CompareProduct/Delete/", JSON.stringify({ productId: productId }), function (response) {
                    NetBt.Utility.Ajax.Response.Result(response, function (data) {

                        $('[data-id="' + data + '"').remove();
                        NetBt.Utility.Plugin.Toast.Success("", ozdisanLocalization.general.DeletedCompareProducts[lang]);

                    });
                });
                return false;
            },
            DeleteIndex: function (productId) {
                if (productId < 1)
                    return false;

                NetBt.Utility.Ajax.Request.Custom("POST", "/CompareProduct/Delete/", JSON.stringify({ productId: productId }), function (response) {
                    NetBt.Utility.Ajax.Response.Result(response, function (data) {
                        NetBt.Utility.Plugin.Toast.Warning("", ozdisanLocalization.general.DeletedCompareProducts[lang]);
                        setTimeout(function () {
                            location.reload();
                        }, 1000);

                    });
                });
                return false;
            }
        },
        /**
         * Table html i dikey yapar.
         * @param {} tableinput
         */
        MakeTableVertical: function (tableinput) {
            var t = $('' + tableinput + ' tbody').eq(0);
            var r = t.find('tr');
            var cols = r.length;
            var rows = r.eq(0).find('td').length;
            var cell, next, tem, i = 0;
            var tb = $('<tbody></tbody>');

            while (i < rows) {
                cell = 0;
                tem = $('<tr></tr>');
                while (cell < cols) {
                    next = r.eq(cell++).find('td').eq(0);
                    tem.append(next);
                }
                tb.append(tem);
                ++i;
            }
            $(tableinput).append(tb);
            $(tableinput).show();
        },
        /**
         * Product Project Modal Open
         * @param {} productId
         */
        OpenProjectProductDetailPartial: function (productId) {
            NetBt.Utility.Plugin.Modal.Open("/Product/ProjectProductList/", { productId: productId }, function (response) {

                setTimeout(function () {
                    Common.GetProductReservedTotalCountByCustomer(productId);
                }, 2000);

            });
        },
        OpenProjectProductDetailPartialNew: function (productId) {
            NetBt.Utility.Plugin.Modal.Open("/ProjectNew/ProjectProductList/", { productId: productId }, function (response) {

            });
        },
        /**
         * Ürünün cariye göre toplam rezervini getirir.
         * @param {} productId
         */
        GetProductReservedTotalCountByCustomer: function (productId) {
            NetBt.Utility.Ajax.Request.Custom("GET", "/Project/GetProductCustomerReservedTotal/", { productId: productId }, function (response) {
                NetBt.Utility.Ajax.Response.Result(response, function (data) {
                    if (data.Status) {
                        $(".product_reservedTotalCount").html("<b>" + data.RETURNDATA + "</b>");
                        $(".projectModal-addChart-button").attr('data-rezervestok', data.RETURNDATA);
                    } else {
                        $(".product_reservedTotalCount").html("!");
                    }
                });
            });
        },
        SliderEvent: function (input) {
            $("" + input + "").owlCarousel({
                slideSpeed: 300,
                paginationSpeed: 400,
                //singleItem: true,
                autoPlay: 3000,
                navigation: true,
                navigationText: ["<span class='prevSPPrd'></span>", "<span class='nextSPPrd'></span>"]
            });
        },

        BasketControlIsAdded: function (productId) {

            NetBt.Utility.Ajax.Request.Custom("GET", "/Home/IsAddedToBasket/", { productId: productId }, function (response) {
                NetBt.Utility.Ajax.Response.Result(response, function (data) {
                    if (data.status) {
                        // $(".product_reservedTotalCount").html("<b>" + data.RETURNDATA + "</b>");
                        // $(".projectModal-addChart-button").attr('data-rezervestok', data.RETURNDATA);
                    }
                });
            });


        },
        /**
         * Event tracking basket
         * @param {} productId
         * @param {} qty
         * @returns {}
         */
        AddBasketEventTracking: function (productId, qty, now, nextOur) {
            //30 minutes

            var timeOut = sessionStorage.getItem("trackingeventtime_event");

            if (timeOut == null || timeOut <= now) {

                sessionStorage.setItem("trackingeventtime_event", nextOur);
                var pageLink = window.location.href;
                var eventLabel = "StokId : " + productId + ' | Adet :' + qty;
                //sepetlendi sipariş.
                ga('send',
                    {
                        'hitType': 'event',
                        'eventCategory': 'Sepetlendi',
                        'eventAction': 'click',
                        'eventLabel': eventLabel
                    },
                    'event',
                    'category',
                    'action',
                    { 'page': pageLink });
            }
        },
        GetCountryShipmentPriceList: function () {
            NetBt.Utility.Plugin.Modal.Open("/Payless/GetCountryShipPrice/", {}, function (response) {
            });
        },
        OpenSecurityContractUser: function () {

            NetBt.Utility.Ajax.Request.Custom("GET", "/Home/IsConfirmedContract/", {}, function (resp) {
                if (resp.Data == null || resp.Data == false) {

                    NetBt.Utility.Plugin.Modal.Open("/Home/OpenUserInContractSecurity/", {}, function () { }, null, $("#ajax-mymodal2"));
                }
            });
        }, SaveSecurityContractUser: function () {
            NetBt.Utility.Ajax.Request.Custom("POST", "/Home/SaveConfirmedContract/", {}, function (response) {
                NetBt.Utility.Ajax.Response.Result(response, function (data) {
                    if (data) {
                        NetBt.Utility.Plugin.Toast.Success("Onaylandı", "");

                        setTimeout(function () {
                            location.reload();
                        }, 1000);
                    }
                });
            });
        },

        GetProductPricesInfoListForWeb: function (id) {
            if (id < 1) {
                return false;
            }

            NetBt.Utility.HtmlData("GET", "/Product/GetProductByQtySalesPriceList/", { id: id }, function (data) {
                if (data != null) {
                    $(".tooltipHtmlpr-" + id).html(data);
                }
            });
        },
        GetProductPricesInfoListForInit: function () {

            $(".hoverPrHtml").hover(
                function () {
                    var id = $(this).attr("data-productid");

                    if (id > 0) {
                        var isgetbefore = $(this).attr("data-isgetbeforeprice");
                        if (isgetbefore == "true") {
                            $(".tooltipHtmlpr-" + id).show();
                        } else {
                            Common.GetProductPricesInfoListForWeb(id);
                            $(this).attr("data-isgetbeforeprice", "true");
                            $(".tooltipHtmlpr-" + id).show();
                        }
                    }

                }, function () {
                    $(".tooltipHtml").hide();
                }
            );

            $(".hoverPrHtmlTxt").focusin(function () {
                var id = $(this).attr("data-productid");

                if (id > 0) {
                    var isgetbefore = $(this).attr("data-isgetbeforeprice");
                    if (isgetbefore == "true") {
                        $(".tooltipHtmlpr-" + id).show();
                    } else {
                        Common.GetProductPricesInfoListForWeb(id);
                        $(this).attr("data-isgetbeforeprice", "true");
                        $(".tooltipHtmlpr-" + id).show();
                    }
                }
            }).focusout(function () {
                    $(".tooltipHtml").hide();
            });


        },
        /**
         * send info email event track to analytc
         * @param {} productId

         * @returns {}
         */
        AddInfoMailEventTracking: function(email) {

                var pageLink = window.location.href;
                var eventLabel = email+ " adresi iletişim talebi istiyor.";
                //sepetlendi sipariş.
                ga('send',
                    {
                        'hitType': 'event',
                        'eventCategory': 'Bilgilendi',
                        'eventAction': 'click',
                        'eventLabel': eventLabel
                    },
                    'event',
                    'category',
                    'action',
                    { 'page': pageLink });

        },
        /**
         * send offer stock event tracjing to analytic
         * @param {} email
         * @param {} productId
         * @returns {}
         */
        AddOfferStockEventTracking: function (email,productId) {

            var pageLink = window.location.href;
            var eventLabel = email + " adresi "+productId+" stokId talebi istiyor.";
            //sepetlendi sipariş.
            ga('send',
                {
                    'hitType': 'event',
                    'eventCategory': 'Tekliflendi',
                    'eventAction': 'click',
                    'eventLabel': eventLabel
                },
                'event',
                'category',
                'action',
                { 'page': pageLink });

        },
        /**
        * send user activated for site to analytic
        * @param {} email
        * @param {} productId
        * @returns {}
        */
        AddUserActivatedEventTracking: function (email) {

            var pageLink = window.location.href;
            var eventLabel = email;
            //sepetlendi sipariş.
            ga('send',
                {
                    'hitType': 'event',
                    'eventCategory': 'UyeAktifOldu',
                    'eventAction': 'click',
                    'eventLabel': eventLabel
                },
                'event',
                'category',
                'action',
                { 'page': pageLink });

    },
        GetProductBasketInfoList: function (id) {
                    if (id < 1) {
                            return false;
                        }
                   NetBt.Utility.HtmlData("GET", "/Product/GetBasketName/", { id: id }, function (data) {
                       if (data != null) {

                               $(".tooltipHtmlprBasket-" + id).html(data);
                             }
                   });
    },
    GetProductBasketInfoListForInit: function () {

        $(".hoverPrHtmlBasket").hover(
            function () {
                var id = $(this).attr("data-productid");

                if (id > 0) {
                    var isgetbefore = $(this).attr("data-isgetbeforeprice");
                    if (isgetbefore == "true") {
                        $(".tooltipHtmlprBasket-" + id).show();
                    } else {
                        Common.GetProductBasketInfoList(id);
                        $(this).attr("data-isgetbeforeprice", "true");
                        $(".tooltipHtmlprBasket-" + id).show();
                    }
                }

            }, function () {
                $(".tooltipHtmlBasket").hide();
            }
        );

        $(".hoverPrHtmlTxt").focusin(function () {
            var id = $(this).attr("data-productid");

            if (id > 0) {
                var isgetbefore = $(this).attr("data-isgetbeforeprice");
                if (isgetbefore == "true") {
                    $(".tooltipHtmlprBasket-" + id).show();
                } else {
                    Common.GetProductBasketInfoList(id);
                    $(this).attr("data-isgetbeforeprice", "true");
                    $(".tooltipHtmlprBasket-" + id).show();
                }
            }
        }).focusout(function () {
            $(".tooltipHtmlBasket").hide();
        });


    }


    }

;
$(function() {
    $("#catBtn").hide();
    $(".carousel").carousel({
        interval: 6000
    });
    $("#owl-manufacturers").owlCarousel({
        autoPlay: 3000, //Set AutoPlay to 3 seconds
        items: 6,
        itemsDesktop: [1199, 6],
        itemsDesktopSmall: [979, 6],
        navigation: false,
        pagination: false,
        transitionStyle: "fade",
        navigationText: ["<span class='prevSP'></span>", "<span class='nextSP'></span>"]
    });
});

$(document).ready(function() {
    $(".modal").each(function() {
        var src = $(this).find("iframe").attr("src");

        $(this).on("click",
            function() {

                $(this).find("iframe").attr("src", "");
                $(this).find("iframe").attr("src", src);

            });
    });
});

//$('.close').click(function () {
//  $('#videoModal').hide();
//  $('#videoModal iframe').attr("src", $("#videoModal iframe").attr("src"));
//});

var nt_example1 = $("#nt-example1").newsTicker({
    row_height: 38,
    max_rows: 1,
    duration: 3000,
    prevButton: $("#upBtn"),
    nextButton: $("#downBtn")
});

var currentSlide;
var slideCount;
jQuery(document).ready(function ($) {
    var tickerSpeed = $('.news-ticker').attr('data-speed');

    $('.news-ticker ul li').hide();
    $('.news-ticker ul li:first').show();

    currentSlide = 0;
    slideCount = ($('.news-ticker li').length) - 1;

    var startTicker = setInterval(autoTicker, tickerSpeed);

    $('.ticker-nav').on('click', '.fa-arrow-up', function () {
        clearInterval(startTicker);
        $('.news-ticker ul li').eq(currentSlide).fadeOut(500);
        if (currentSlide == 0) {
            currentSlide = slideCount;
        } else {
            currentSlide -= 1;
        }
        $('.news-ticker ul li').eq(currentSlide).fadeIn(500);
        startTicker = setInterval(autoTicker, tickerSpeed);
    });
    $('.ticker-nav').on('click', '.fa-arrow-down', function () {
        clearInterval(startTicker);
        $('.news-ticker ul li').eq(currentSlide).fadeOut(500);
        if (currentSlide < slideCount) {
            currentSlide += 1;
        } else {
            currentSlide = 0;
        }
        $('.news-ticker ul li').eq(currentSlide).fadeIn(500);
        startTicker = setInterval(autoTicker, tickerSpeed);
    });
});

function autoTicker() {
    $('.news-ticker ul li').eq(currentSlide).fadeOut(500)

    if (currentSlide < slideCount) {
        currentSlide += 1;
    } else {
        currentSlide = 0;
    }

    $('.news-ticker ul li').eq(currentSlide).fadeIn(500)
}


$(function() {
    $(".btnAddToCart").click(function (evt) {
         
        var products = [];

        var pid = $(this).data("productid");
        var moq = $(this).data("moqcount");
        localStorage.setItem("currentProduct", pid);

        var cart = {
            Key: pid,
            Value: moq
        };
        products.push(cart);

        $.ajax({
            type: "POST",
            url: "/Basket/AddToCart",
            data: {
                products: products,
            },
            success: function(data) {
                if (data.status) {
                    alertify.success(data.message);
                } else {
                    alertify.alert(data.message);
                }
            },
            error: function() {

            },
            complete: function() {
               

            }
        });

    });

    $(".prdbox").hover(function() {
            //$prddtl = $(this).find(".prddtl");
            //$prddtl.stop().animate({ top: -60 }, 200);
            //$prddtl.find(".detailbtn").removeClass("hide");

        },
        function() {
            //$prddtl = $(this).find(".prddtl");
            //$prddtl.stop().animate({ top: 0 }, 200);
            //$prddtl.find(".detailbtn").addClass("hide");
        });

    $(".prdbox").click(function() {
        window.location.href = "/Product/Detail/" + $(this).attr("pid");
    });

});

$(document).ready(function() {
    $("#ozd-new-one-products")
        .owlCarousel({
            slideSpeed: 300,
            paginationSpeed: 400,
            singleItem: false,
            //autoPlay: 3000,
            navigation: true,
            navigationText: ["<span class='prevSPPrd'></span>", "<span class='nextSPPrd'></span>"]
        });

    $("#ozd-campaign-one-products")
        .owlCarousel({
            slideSpeed: 300,
            paginationSpeed: 400,
            singleItem: false,
            //autoPlay: 3000,
            navigation: true,
            navigationText: ["<span class='prevSPPrd'></span>", "<span class='nextSPPrd'></span>"]
            
        });

    var sync1 = $("#sync1");
    var sync2 = $("#sync2");

    sync1.owlCarousel({
        autoPlay: 5000,
        singleItem: true,
        slideSpeed: 1000,
        navigation: true,
        pagination: true,
        afterAction: syncPosition,
        responsiveRefreshRate: 200,
        transitionStyle: "fade",
        navigationClass: ["owl-prev-main", "owl-next-main"],
        navigationText: ["<span class='prevSPPrd'></span>", "<span class='nextSPPrd'></span>"]
    });

    sync2.owlCarousel({
        items: 10,
        itemsDesktop: [680, 10],
        itemsDesktopSmall: [680, 10],
        itemsTablet: [680, 8],
        itemsMobile: [479, 4],
        pagination: false,
        responsiveRefreshRate: 100,
        transitionStyle: "fade",
        afterInit: function(el) {
            el.find(".owl-item").eq(0).addClass("synced");
        }
    });

    function syncPosition(el) {
        var current = this.currentItem;
        $("#sync2")
            .find(".owl-item")
            .removeClass("synced")
            .eq(current)
            .addClass("synced");
        if ($("#sync2").data("owlCarousel") !== undefined) {
            center(current);
        }

    }

    $("#sync2").on("mouseover",
        ".owl-item",
        function(e) {
            e.preventDefault();
            var number = $(this).data("owlItem");
            sync1.trigger("owl.goTo", number);
        });

    $("#sync2").on("click",
        ".owl-item",
        function(e) {
            e.preventDefault();
            var number = $(this).data("owlItem");
            sync1.trigger("owl.goTo", number);
        });

    function center(number) {
        var sync2visible = sync2.data("owlCarousel").owl.visibleItems;

        var num = number;
        var found = false;
        for (var i in sync2visible) {
            if (num === sync2visible[i]) {
                var found = true;
            }
        }

        if (found === false) {
            if (num > sync2visible[sync2visible.length - 1]) {
                sync2.trigger("owl.goTo", num - sync2visible.length + 2);
            } else {
                if (num - 1 === -1) {
                    num = 0;
                }
                sync2.trigger("owl.goTo", num);
            }
        } else if (num === sync2visible[sync2visible.length - 1]) {
            sync2.trigger("owl.goTo", sync2visible[1]);
        } else if (num === sync2visible[0]) {
            sync2.trigger("owl.goTo", num - 1);
        }
    }

});

function openbannervideo(id) {
    $(".banner-modal-" + id).modal("show");
}

var HomePage = {
    GetLastVisitedPartial: function() {
        NetBt.Utility.Plugin.AjaxData("/Product/LastVisitedProduct/",
            {},
            null,
            function (data) {
               
                if (data != null && data.indexOf("lst_vstd_has_any") >= 0) {
                    $("#ozd-last-visited-list").html(data);
                    $(".last-visited-div").show();
                    Common.SliderEvent("#ozd-last-visited-slider-products");
                    $(".btnAddCart").bind("click",
                        function() {
                            addBasketForHomePage();
                        });
                }
            });
    },
    GetFavoriteProductList: function() {
        NetBt.Utility.Plugin.AjaxData("/FavoriteProduct/GetUserFavoriteList/",
            {},
            null,
            function (data) {
                
                if (data != null && data.indexOf("any_fav_list_user") >= 0) {
                    $("#ozd-my-favorite-list").html(data);
                    Common.SliderEvent("#ozd-my-favorite-slider-products");
                    $(".last-my-favorite-div").show();
                     
                    $(".btnAddCart").bind("click",
                        function () {
                            addBasketForHomePage();
                        });
                }
            });
    },

};
var add_minutes = function(dt, minutes) {
    return new Date(dt.getTime() + minutes * 60000);
};
$(".btnAddCart").on("click",
    function(event) {
        event.stopImmediatePropagation();
        addBasketForHomePage();
    });

function addBasketForHomePage() {

  
    if($(event.currentTarget).data("ispurchasable")==false){
        Lobibox.alert("warning",
            {
                title: ozdisanLocalization.general.Warning[lang],
                msg: ozdisanLocalization.general.btnPriceZeroError[lang],
                buttons: {
                    ok: {
                        text: ozdisanLocalization.general.btnOk[lang]
                    }
                }
            });
        return;
    }
    
    
    var dt = new Date();
    var time = dt.getHours() + ":" + dt.getMinutes() + ":" + dt.getSeconds();
    var addedTime = add_minutes(new Date(time), "30");

    var products = [];
    var pid = $(event.currentTarget).data("productid");
    var moq = $(event.currentTarget).data("moqcount");
    var isuserlogin = $(event.currentTarget).data("isuserlogin");
    var qty = $(".qty-" + pid).val();
    var stock = $(event.currentTarget).data("stock");
    var wanttotakeallstock = $(event.currentTarget).data("allstock");

    var limit = parseInt($(event.currentTarget).data("limit"));
    var isBuyNow = $(event.currentTarget).data("buynow")

    if (qty > limit && wanttotakeallstock == false) {

        Lobibox.confirm({
            msg: ozdisanLocalization.general.GetAllStock[lang],
            title: ozdisanLocalization.general.Info[lang],
            buttons: {
                yes: {
                    text: ozdisanLocalization.general.btnYes[lang]
                },
                no: {
                    text: ozdisanLocalization.general.btnNo[lang]
                }
            },
            callback: function($this, type, ev) {
                //Tüm stok alınsın mı evetse
                if (type === "yes") {
                    // user clicked "ok"
                    $(".qty-" + pid).val(stock);
                    $(event.currentTarget).attr("data-allstock", "true");
                    $("#incr-" + pid).attr("data-allstock", "true");
                    $("#decr-" + pid).attr("data-allstock", "true");
                    wanttotakeallstock = true;
                    qty = stock;
                }
                //Tüm stok alınsın mı hayırsa
                else {
                    $(event.currentTarget).attr("data-allstock", "false");
                    $("#incr-" + pid).attr("data-allstock", "false");
                    $("#decr-" + pid).attr("data-allstock", "false");
                    wanttotakeallstock = false;
                    //$(".qty-" + pid).val(limit);
                    //qty = limit;
                    return;
                }

                var ajaxUrl = "";
                var basketUrl = "";

                if (isuserlogin == "True") {

                    ajaxUrl = "/Basket/AddToCart?allstock=" + wanttotakeallstock;
                    basketUrl = "/Basket/Index";

                } else {

                    ajaxUrl = "/Home/AddToCartWithoutLogin?allstock=" + wanttotakeallstock;
                    basketUrl = "/Home/BasketWithoutLogin";
                }


                if (qty > 0) {
                    var cart = {
                        Key: pid,
                        Value: qty
                    };
                    products.push(cart);

                    $.ajax({
                        type: "POST",
                        url: ajaxUrl,
                        data: {
                            products: products
                        },
                        success: function(data) {
                            if (data.status) {
                                NetBt.Utility.Plugin.Toast.Success("", data.message);

                                $(".added-product-button-detail-" + cart.Key).text(cart.Value);

                                if (isuserlogin == "True") {
                                    StorageBasketCurrentItemsCountRefresh();
                                } else {

                                    StorageBasketWithoutLoginItemCount();
                                }

                                //Analytic event tracking
                                Common.AddBasketEventTracking(pid,
                                    qty,
                                    time,
                                    addedTime);

                                if ($("#bskBox").css("display") == "block")
                                    basketEvents.getItems(false);
                                if (isBuyNow) {
                                    urlRedirect(basketUrl);
                                } else {
                                    var product_id = pid;
                                    var el_hi = document.querySelectorAll('[data-btn-id="' + product_id + '"]');
                                    var f = el_hi[0];
                                    var s = el_hi[1];
                                    f.style.display = 'none';
                                    s.style.display = 'block';
                                }
                            } else {
                                Lobibox.alert(
                                    "warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
                                    {
                                        title: ozdisanLocalization.general.Warning[lang],
                                        msg: data.message
                                    });
                            }
                        }
                    });
                }
            }
        });
        return;
    }

    // MOQ kontrol
    if ((qty % moq !== 0 || qty < moq) && $(event.currentTarget).data("allstock") == false) {
        Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
            {
                msg: ozdisanLocalization.general.MoqAlanKontrol[lang] +
                    " " +
                    moq +
                    " " +
                    ozdisanLocalization.general.MoqAlanKontrol1[lang],
                title: ozdisanLocalization.general.Warning[lang],
            });
        return;
    }

    if (qty > 0) {
        var cart = {
            Key: pid,
            Value: qty
        };
        products.push(cart);

        var ajaxUrl = "";
        var basketUrl = "";

        if (isuserlogin == "True") {

            ajaxUrl = "/Basket/AddToCart?allstock=" + wanttotakeallstock;
            basketUrl = "/Basket/Index";
        } else {

            ajaxUrl = "/Home/AddToCartWithoutLogin?allstock=" + wanttotakeallstock;
            basketUrl = "/Home/BasketWithoutLogin";
        }

        $.ajax({
            type: "POST",
            url: ajaxUrl,
            data: {
                products: products
            },
            success: function(data) {
                if (data.status) {
                    $(".added-product-button-detail-" + cart.Key).text(cart.Value);
                    NetBt.Utility.Plugin.Toast.Success("", data.message);
                    if (isuserlogin == "True") {
                        BasketCreate.GetBasketCount();
                    } else {
                        BasketCreate.GetBasketWithoutLoginCount();
                    }

                    Common.AddBasketEventTracking(pid,
                        qty,
                        time,
                        addedTime);
                    if ($("#bskBox").css("display") == "block")
                        basketEvents.getItems(false);
                    if (isBuyNow) {
                        urlRedirect(basketUrl);
                    } else {
                        var product_id = pid;
                        var el_hi = document.querySelectorAll('[data-btn-id="' + product_id + '"]');
                        var f = el_hi[0];
                        var s = el_hi[1];
                        f.style.display = 'none';
                        s.style.display = 'block';
                    }
                } else {
                    Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
                        {
                            msg: data.message,
                            title: ozdisanLocalization.general.Warning[lang]
                        });
                }
            }
        });
    }
}

function openProductMailForm(productId, isHaberVer) {
    NetBt.Utility.Plugin.Modal.Open("/Product/NotifyMe/",
        { productId: productId, isHaberVer: isHaberVer},
        function (response) {
            IncreaseDecreaseActive();
        });
}

function openCreateDemandForm(productId, createDemand) {
    NetBt.Utility.Plugin.Modal.Open("/Product/CreateDemands/",
        { productId: productId, createDemand: createDemand },
        function (response) {
            IncreaseDecreaseActive();
        });
}

function openGetContactForm(productId, getContact) {
    NetBt.Utility.Plugin.Modal.Open("/Product/GetContact/",
        { productId: productId, getContact: getContact },
        function (response) {
            IncreaseDecreaseActive();
        });
}

function IncreaseDecreaseActive() {


    $('#btnProductInfoMailSend').on('click',
        function (event) {

            event.stopImmediatePropagation();
            var productId = $('#txtProductInfoProductID').val();
            if (productId != "703318" && productId != "703319" && productId != "710415") {
                var count = $("#NotifyCountQty").val();
                if (count < 1) {
                    Lobibox.alert("warning", //AVAILABLE TYPES: "error", "info", "success", "warning"
                        {
                            msg: '@Resources.MoqAlanKontrol',
                            title: ozdisanLocalization.general.Warning[lang],
                        });
                    return false;
                }

                if ($('#txtProductInfoUsername').val() == "") {
                    NetBt.Utility.Plugin.Toast.Error("", '@Resources.AdSoyadZorunlu');
                    return false;
                }

                if ($('#txtProductInfoMailSender').val() != '' &&
                    $('#txtProductInfoMailSender').val().indexOf('@@') != 0) {


                    $.ajax({
                        type: "POST",
                        url: "/Product/SendMail",
                        data: {
                            productName: $('#txtProductInfoProductCode').val(),
                            productId: $('#txtProductInfoProductID').val(),
                            sender: $('#txtProductInfoMailSender').val(),
                            username: $("#txtProductInfoUsername").val(),
                            requestAmont: $("#NotifyCountQty").val(),
                            productDesc: $("#txtProductInfo").val(),
                            companyName: '@ViewBag.CustomerName',
                            firstLastName: $("#txtFirstLastName").val(),
                            description: $("#txtDescription").val(),
                            IsHaberVer: $("#hdnIsHaberVer").val(),
                            answer: $("#formCaptcha").val()
                        },
                        success: function (data) {
                            if (data.Result) {
                                NetBt.Utility.Plugin.Toast.Success("", data.Message);
                                NetBt.Utility.Plugin.Modal.Close();
                                Common.AddOfferStockEventTracking($("#txtProductInfoUsername").val(),
                                    $('#txtProductInfoProductID').val());
                            } else {
                                NetBt.Utility.Plugin.Toast.Error("", data.Message);
                            }
                        },
                        error: function () {
                            NetBt.Utility.Plugin.Toast.Error("", data.Message);
                        }
                    });
                } else {
                    NetBt.Utility.Plugin.Toast.Error("", '@Resources.ProductMailFormatInfo');
                }

            }
           
        });
        }


    $(window).ready(function () {$('#activateSuccessModal').modal('show'); });
    $('#activateSuccessModal').on('hidden.bs.modal',
    function () {
                            var val = sessionStorage.getItem("payLessModal");

    var state = val == null ? true : JSON.parse(val);
    if (state) {
        sessionStorage.setItem("payLessModal", false);
    $('#payLessModal').modal('show');
                            }
                        });




    //UyeAktifOldu

    $(window).ready(function () {
        $('#activateSuccessModal').modal('show');
    Common.AddUserActivatedEventTracking('yeni uye ok');
                    });
    $('#activateSuccessModal').on('hidden.bs.modal',
    function () {
                            var val = sessionStorage.getItem("payLessModal");
    var state = val == null ? true : JSON.parse(val);
    if (state) {
        sessionStorage.setItem("payLessModal", false);
    $('#payLessModal').modal('show');
                            }
                        });


    $(window).ready(function () {$('#activateFailedModal').modal('show'); });
    $('#activateFailedModal').on('hidden.bs.modal',
    function () {
                            var val = sessionStorage.getItem("payLessModal");
    var state = val == null ? true : JSON.parse(val);
    if (state) {
        sessionStorage.setItem("payLessModal", false);
    $('#payLessModal').modal('show');
                            }
                        });


$(function () {
    IncreaseDecreaseActive();

});;
// Yeni sepet oluşturma işlemlerini yapar.

var BasketCreate = {
    // Kullanıcının tüm sepetleri çekilir partilalview'e basılır
    GetBasket: function () {

        
        //$.ajax({
        //    url: "/Basket/GetBasketSlidingPartial",
        //    success: function(data) {
        //        $(".my-basket-menulist").empty().html(data);
        //    }
        //});
        

        fetch('/Basket/GetBasketSlidingPartial')
            .then(response => response.text())
            .then(data => $(".my-basket-menulist").empty().html(data));
    },

    // Yeni sepet kaydemtme işlemi yapılır.
    NewBasket: function () {
        var basketName = $("#txtBasketNewName").val();
        if (basketName == "") {
            $("#txtBasketNewName").pulsate({
                color: "#fff",
                repeat: 3
            });
            return;
        }
        var refBasketId = $("#txtBasketNewName").data("basketid");
        if (refBasketId == null || refBasketId == "" || refBasketId == undefined) {
            // refBasketId yoksa yeni kayıttır.
            loadingPane.show();
            $.ajax({
                type: "POST",
                url: "/Basket/Basket",
                data: { BasketName: basketName },                
                success: function (data) {
                    if (data.status) {
                        loadingPane.hide();
                        NetBt.Utility.Plugin.Toast.Success("", data.message);
                    }
                    else {
                        loadingPane.hide();
                        NetBt.Utility.Plugin.Toast.Warning("", data.message);
                    }
                },
                error: function () {
                    loadingPane.hide();
                    NetBt.Utility.Plugin.Toast.Warning("", ozdisanLocalization.general.YeniSepetKayitHata[lang]);
                },
                complete: function () {
                    loadingPane.hide();

                    BasketCreate.GetBasket();

                    //fillTables();
                    StorageBasketCurrentItemsCountRefresh();
                }
            });
        }
        else {
            // refBasketId varsa sepet adı güncellenir.
            loadingPane.show();
            $.ajax({
                type: "POST",
                url: "/Basket/BasketNameChange",
                data: { BasketName: basketName, refBasketId: refBasketId },
                success: function (data) {
                    if (data.status) {
                        loadingPane.hide();
                        NetBt.Utility.Plugin.Toast.Success("", data.message);
                    }
                    else {
                        loadingPane.hide();
                        NetBt.Utility.Plugin.Toast.Warning("", data.message);
                    }
                },
                error: function () {
                    loadingPane.hide();
                    NetBt.Utility.Plugin.Toast.Warning("", ozdisanLocalization.general.SepetAdiGuncellemeHata[lang]);
                },
                complete: function () {
                    loadingPane.hide();
                    BasketCreate.GetBasket();
                    fillTables();
                    StorageBasketCurrentItemsCountRefresh();
                }
            });
        }
    },
    // Sepete adını güncellemek için veriler alınır ve textbox'a verilir.
    EditBasket: function (id, name) {
        $("#txtBasketNewName").attr("data-basketid", id);
        $("#txtBasketNewName").val(name);
    },
    //Sepet değiştirme işlemi
    ChangeBasket: function (id) {
        loadingPane.show();
        $.ajax({
            type: "POST",
            url: "/Basket/BasketChange",
            data: { BasketId: id },
            success: function (data) {
                if (data.status) {
                    loadingPane.hide();
                    NetBt.Utility.Plugin.Toast.Success("", data.message);

                    location.reload();

                }
                else {
                    loadingPane.hide();
                    NetBt.Utility.Plugin.Toast.Warning("", data.message);
                }
            },
            error: function () {
                loadingPane.hide();
                NetBt.Utility.Plugin.Toast.Warning("", ozdisanLocalization.general.SepetDegisirkenHata[lang]);
            },
            complete: function () {
                loadingPane.hide();

                //BasketCreate.GetBasket();
                //BasketCreate.GetBasketLayout();
                //
                //setTimeout(function () {
                //    fillTables();
                //}, 500);
            }
        });
    },
    // Kayıtlı sepeti komple silme işlemi
    DeleteBasket: function (id) {
        Lobibox.confirm({
            msg: ozdisanLocalization.general.SepetConfirm[lang],
            title: ozdisanLocalization.general.Info[lang],
            buttons: {
                yes: {
                    text: ozdisanLocalization.general.btnYes[lang]
                },
                no: {
                    text: ozdisanLocalization.general.btnNo[lang]
                }
            },
            callback: function ($this, type, ev) {
                if (type === "yes") {
                    loadingPane.show();
                    $.ajax({
                        type: "POST",
                        url: "/Basket/BasketDelete",
                        data: { BasketId: id },
                        success: function (data) {
                            if (data.status) {
                                loadingPane.hide();
                                NetBt.Utility.Plugin.Toast.Success("", data.message);
                            }
                            else {
                                loadingPane.hide();
                                NetBt.Utility.Plugin.Toast.Warning("", data.message);
                            }
                        },
                        error: function () {
                            loadingPane.hide();
                            NetBt.Utility.Plugin.Toast.Warning("", data.message);
                        },
                        complete: function () {
                            loadingPane.hide();
                            BasketCreate.GetBasket();
                            fillTables();
                            StorageBasketCurrentItemsCountRefresh();
                        }
                    });

                }
            }
        });
    },
    // Kullanıcının tüm sepetleri layoutki partilalview'e basılır
    GetBasketLayout: function () {

        $.ajax({
            url: "/Basket/GetLayoutBasketPartial",
            type: "GET"
        }).done(function (data) {
            //StorageBasketCurrentItemsCountRefresh();
            $(".drpBasket").empty().html(data);
            var count = $("#hdnSelectedBasketCount").val();
            if (!isNaN(count) && count >= 0) {
                //$(".BasketCurrentItemsCountSpan").html(count);
                $(".BasketCurrentProjectItemsCountSingleSpan").html(count);
            }
            else {
                //$(".BasketCurrentItemsCountSpan").html("0");
            }
        });
    },

    GetBasketCount: function () {
        $.ajax({
            url: "/Basket/GetLayoutBasketCount",
            type: "GET"
        }).done(function (data) {

            $(".BasketCurrentProjectItemsCountSingleSpan").html(data);
            $(".BasketCurrentItemsCountSpan").html(data);
        });
    },

    //Login olmadan sepete eklenen adedi çeker.
    GetBasketWithoutLoginCount: function () {
        $.ajax({
            url: "/Home/GetWithoutLoginBasketCount",
            dataType: 'json',
            contentType: 'application/json; charset=utf-8'
        }).done(function (data) {

            $(".withoutLoginBasketCount").html(data);
        });
    },
    //Sepet değiştirme işlemi
    ChangLayoutBasket: function (id) {
        loadingPane.show();
        $.ajax({
            type: "POST",
            url: "/Basket/BasketChange",
            data: { BasketId: id },
            success: function (data) {
                if (data.status) {
                    NetBt.Utility.Plugin.Toast.Success("", data.message);
                }
                else {
                    NetBt.Utility.Plugin.Toast.Warning("", data.message);
                }
            },
            error: function () {
                NetBt.Utility.Plugin.Toast.Warning("", ozdisanLocalization.general.SepetDegisirkenHata[lang]);
            },
            complete: function () {
                BasketCreate.GetBasket();
                BasketCreate.GetBasketCount();
                location.href = "/Basket/Index";
            }
        });
    }
}

;
