function enable_all_customers(){$("li.customer").each(function(t){$(this).removeClass("marked"),$(this).show()})}function filter_customers(t){setTimeout(function(){$("li.customer").each(function(e){var n=new RegExp(t,"i"),i=$(this).children("span.name").text();if(n.test(i)){$(this).show();var r=i.toLowerCase()==t.toLowerCase(),o=1==$("li.customer:visible").length;console.log(r,o),r?$(this).addClass("marked"):$(this).removeClass("marked")}else $(this).hide(),$(this).removeClass("marked")})},50)}function enable_all_products(){$("li.product").each(function(t){$(this).removeClass("marked"),$(this).show()})}function reset_qtys(){$(".qty").each(function(t){$(this).html("0")}),$("input[name$=amount]").each(function(t){$(this).val("0")})}function update_total(){var t=0;$("li.product").each(function(){var e=Number($(this).find("[name$=amount]").val()),n=".sale_price_int";"Ekstern"===$("#id_customer_typeahead").val()&&(n=".sale_price_ext");var i=Number($(this).find(n).text());t+=e*i}),0===t&&(t=""),$("span.total_text").html(t)}function productFormatter(){return""+this.point.name+": "+Highcharts.numberFormat(this.percentage,1)+" %"}function parse_products_realtime_data(t,e){for(var n in t.products){null===e.get(n)&&e.addSeries({data:[],id:n,name:n});var i=e.get(n);_.each(t.products[n],function(t){null===e.get(t[0])&&i.addPoint({id:t[0],x:t[0],y:t[1]})})}}function get_products_realtime_data(){$.ajax({url:products_realtime_url,dataType:"json",success:function(t){parse_products_realtime_data(t,products_realtime_chart),setTimeout(function(){get_products_realtime_data()},15e3)},cache:!1})}function renderProductCharts(t){for(var e in t){var n="product_chart"+t[e].id,i=t[e].counts;i=_.map(i,function(t){return[t.full_name,t.amount_total]}),new Highcharts.Chart({chart:{renderTo:n,plotBackgroundColor:null,plotBorderWidth:null,plotShadow:!1},title:{text:t[e].name},tooltip:{formatter:productFormatter},plotOptions:{pie:{allowPointSelect:!0,cursor:"pointer",dataLabels:{enabled:!0,color:"#000000",connectorColor:"#000000",formatter:function(){return""+this.point.name+": "+this.y}}}},series:[{type:"pie",name:"Orders",data:i}]})}}function renderOrdersGroupedChart(t){var e=t.grouping,n="order_chart_"+e;new Highcharts.Chart({chart:{renderTo:n,type:"column"},title:{text:"Ordre - "+e},tooltip:{formatter:function(){return this.y+" stk"}},yAxis:{title:{text:"Ordre"}},xAxis:{title:{text:"Tid"},labels:{formatter:orderFormatters[e]}},plotOptions:{column:{minPointLength:3,colorByPoint:!0},series:{groupPadding:0,pointPadding:.05}},series:[{name:"Ordre",data:t.orders}]})}!function(t,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){"use strict";function n(t,e){var n=(e=e||et).createElement("script");n.text=t,e.head.appendChild(n).parentNode.removeChild(n)}function i(t){var e=!!t&&"length"in t&&t.length,n=pt.type(t);return"function"!==n&&!pt.isWindow(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}function r(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}function o(t,e,n){return pt.isFunction(e)?pt.grep(t,function(t,i){return!!e.call(t,i,t)!==n}):e.nodeType?pt.grep(t,function(t){return t===e!==n}):"string"!=typeof e?pt.grep(t,function(t){return at.call(e,t)>-1!==n}):Ct.test(e)?pt.filter(e,t,n):(e=pt.filter(e,t),pt.grep(t,function(t){return at.call(e,t)>-1!==n&&1===t.nodeType}))}function a(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function s(t){var e={};return pt.each(t.match(Et)||[],function(t,n){e[n]=!0}),e}function l(t){return t}function u(t){throw t}function c(t,e,n,i){var r;try{t&&pt.isFunction(r=t.promise)?r.call(t).done(e).fail(n):t&&pt.isFunction(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}function h(){et.removeEventListener("DOMContentLoaded",h),t.removeEventListener("load",h),pt.ready()}function d(){this.expando=pt.expando+d.uid++}function f(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:Ut.test(t)?JSON.parse(t):t)}function p(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(qt,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=f(n)}catch(t){}Ft.set(t,e,n)}else n=void 0;return n}function g(t,e,n,i){var r,o=1,a=20,s=i?function(){return i.cur()}:function(){return pt.css(t,e,"")},l=s(),u=n&&n[3]||(pt.cssNumber[e]?"":"px"),c=(pt.cssNumber[e]||"px"!==u&&+l)&&It.exec(pt.css(t,e));if(c&&c[3]!==u){u=u||c[3],n=n||[],c=+l||1;do{o=o||".5",c/=o,pt.style(t,e,c+u)}while(o!==(o=s()/l)&&1!==o&&--a)}return n&&(c=+c||+l||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=u,i.start=c,i.end=r)),r}function v(t){var e,n=t.ownerDocument,i=t.nodeName,r=Wt[i];return r||(e=n.body.appendChild(n.createElement(i)),r=pt.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),Wt[i]=r,r)}function m(t,e){for(var n,i,r=[],o=0,a=t.length;o-1)r&&r.push(o);else if(u=pt.contains(o.ownerDocument,o),a=y(h.appendChild(o),"script"),u&&w(a),n)for(c=0;o=a[c++];)Yt.test(o.type||"")&&n.push(o);return h}function x(){return!0}function D(){return!1}function T(){try{return et.activeElement}catch(t){}}function C(t,e,n,i,r,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(i=i||n,n=void 0);for(s in e)C(t,s,n,i,e[s],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=D;else if(!r)return t;return 1===o&&(a=r,r=function(t){return pt().off(t),a.apply(this,arguments)},r.guid=a.guid||(a.guid=pt.guid++)),t.each(function(){pt.event.add(this,e,r,i,n)})}function k(t,e){return r(t,"table")&&r(11!==e.nodeType?e:e.firstChild,"tr")?pt(">tbody",t)[0]||t:t}function _(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function S(t){var e=ne.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function A(t,e){var n,i,r,o,a,s,l,u;if(1===e.nodeType){if($t.hasData(t)&&(o=$t.access(t),a=$t.set(e,o),u=o.events)){delete a.handle,a.events={};for(r in u)for(n=0,i=u[r].length;n1&&"string"==typeof p&&!dt.checkClone&&ee.test(p))return t.each(function(n){var o=t.eq(n);g&&(e[0]=p.call(this,n,o.html())),N(o,e,i,r)});if(d&&(o=b(e,t[0].ownerDocument,!1,t,r),a=o.firstChild,1===o.childNodes.length&&(o=a),a||r)){for(l=(s=pt.map(y(o,"script"),_)).length;h=0&&nx.cacheLength&&delete t[e.shift()],t[n+" "]=i}var e=[];return t}function i(t){return t[L]=!0,t}function r(t){var e=M.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function o(t,e){for(var n=t.split("|"),i=n.length;i--;)x.attrHandle[n[i]]=e}function a(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function s(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Dt(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function l(t){return i(function(e){return e=+e,i(function(n,i){for(var r,o=t([],n.length,e),a=o.length;a--;)n[r=o[a]]&&(n[r]=!(i[r]=n[r]))})})}function u(t){return t&&void 0!==t.getElementsByTagName&&t}function c(){}function h(t){for(var e=0,n=t.length,i="";e1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function p(t,n,i){for(var r=0,o=n.length;r-1&&(i[u]=!(a[u]=h))}}else w=g(w===a?w.splice(v,w.length):w),o?o(null,a,w,l):G.apply(a,w)})}function m(t){for(var e,n,i,r=t.length,o=x.relative[t[0].type],a=o||x.relative[" "],s=o?1:0,l=d(function(t){return t===e},a,!0),u=d(function(t){return Q(e,t)>-1},a,!0),c=[function(t,n,i){var r=!o&&(i||n!==S)||((e=n).nodeType?l(t,n,i):u(t,n,i));return e=null,r}];s1&&f(c),s>1&&h(t.slice(0,s-1).concat({value:" "===t[s-2].type?"*":""})).replace(ot,"$1"),n,s0,o=t.length>0,a=function(i,a,s,l,u){var c,h,d,f=0,p="0",v=i&&[],m=[],y=S,w=i||o&&x.find.TAG("*",u),b=H+=null==y?1:Math.random()||.1,D=w.length;for(u&&(S=a===M||a||u);p!==D&&null!=(c=w[p]);p++){if(o&&c){for(h=0,a||c.ownerDocument===M||(N(c),s=!j);d=t[h++];)if(d(c,a||M,s)){l.push(c);break}u&&(H=b)}r&&((c=!d&&c)&&f--,i&&v.push(c))}if(f+=p,r&&p!==f){for(h=0;d=n[h++];)d(v,m,a,s);if(i){if(f>0)for(;p--;)v[p]||m[p]||(m[p]=J.call(l));m=g(m)}G.apply(l,m),u&&!i&&m.length>0&&f+n.length>1&&e.uniqueSort(l)}return u&&(H=b,S=y),v};return r?i(a):a}var w,b,x,D,T,C,k,_,S,A,E,N,M,O,j,$,F,U,q,L="sizzle"+1*new Date,I=t.document,H=0,P=0,R=n(),W=n(),V=n(),B=function(t,e){return t===e&&(E=!0),0},Y={}.hasOwnProperty,z=[],J=z.pop,X=z.push,G=z.push,K=z.slice,Q=function(t,e){for(var n=0,i=t.length;n+~]|"+tt+")"+tt+"*"),lt=new RegExp("="+tt+"*([^\\]'\"]*?)"+tt+"*\\]","g"),ut=new RegExp(it),ct=new RegExp("^"+et+"$"),ht={ID:new RegExp("^#("+et+")"),CLASS:new RegExp("^\\.("+et+")"),TAG:new RegExp("^("+et+"|[*])"),ATTR:new RegExp("^"+nt),PSEUDO:new RegExp("^"+it),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+tt+"*(even|odd|(([+-]|)(\\d*)n|)"+tt+"*(?:([+-]|)"+tt+"*(\\d+)|))"+tt+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+tt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+tt+"*((?:-\\d)?\\d*)"+tt+"*\\)|)(?=[^-]|$)","i")},dt=/^(?:input|select|textarea|button)$/i,ft=/^h\d$/i,pt=/^[^{]+\{\s*\[native \w/,gt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,vt=/[+~]/,mt=new RegExp("\\\\([\\da-f]{1,6}"+tt+"?|("+tt+")|.)","ig"),yt=function(t,e,n){var i="0x"+e-65536;return i!==i||n?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},wt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,bt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},xt=function(){N()},Dt=d(function(t){return!0===t.disabled&&("form"in t||"label"in t)},{dir:"parentNode",next:"legend"});try{G.apply(z=K.call(I.childNodes),I.childNodes),z[I.childNodes.length].nodeType}catch(t){G={apply:z.length?function(t,e){X.apply(t,K.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}b=e.support={},T=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},N=e.setDocument=function(t){var e,n,i=t?t.ownerDocument||t:I;return i!==M&&9===i.nodeType&&i.documentElement?(M=i,O=M.documentElement,j=!T(M),I!==M&&(n=M.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",xt,!1):n.attachEvent&&n.attachEvent("onunload",xt)),b.attributes=r(function(t){return t.className="i",!t.getAttribute("className")}),b.getElementsByTagName=r(function(t){return t.appendChild(M.createComment("")),!t.getElementsByTagName("*").length}),b.getElementsByClassName=pt.test(M.getElementsByClassName),b.getById=r(function(t){return O.appendChild(t).id=L,!M.getElementsByName||!M.getElementsByName(L).length}),b.getById?(x.filter.ID=function(t){var e=t.replace(mt,yt);return function(t){return t.getAttribute("id")===e}},x.find.ID=function(t,e){if(void 0!==e.getElementById&&j){var n=e.getElementById(t);return n?[n]:[]}}):(x.filter.ID=function(t){var e=t.replace(mt,yt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},x.find.ID=function(t,e){if(void 0!==e.getElementById&&j){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),x.find.TAG=b.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):b.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},x.find.CLASS=b.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&j)return e.getElementsByClassName(t)},F=[],$=[],(b.qsa=pt.test(M.querySelectorAll))&&(r(function(t){O.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&$.push("[*^$]="+tt+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||$.push("\\["+tt+"*(?:value|"+Z+")"),t.querySelectorAll("[id~="+L+"-]").length||$.push("~="),t.querySelectorAll(":checked").length||$.push(":checked"),t.querySelectorAll("a#"+L+"+*").length||$.push(".#.+[+~]")}),r(function(t){t.innerHTML="";var e=M.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&$.push("name"+tt+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&$.push(":enabled",":disabled"),O.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&$.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),$.push(",.*:")})),(b.matchesSelector=pt.test(U=O.matches||O.webkitMatchesSelector||O.mozMatchesSelector||O.oMatchesSelector||O.msMatchesSelector))&&r(function(t){b.disconnectedMatch=U.call(t,"*"),U.call(t,"[s!='']:x"),F.push("!=",it)}),$=$.length&&new RegExp($.join("|")),F=F.length&&new RegExp(F.join("|")),e=pt.test(O.compareDocumentPosition),q=e||pt.test(O.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},B=e?function(t,e){if(t===e)return E=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!b.sortDetached&&e.compareDocumentPosition(t)===n?t===M||t.ownerDocument===I&&q(I,t)?-1:e===M||e.ownerDocument===I&&q(I,e)?1:A?Q(A,t)-Q(A,e):0:4&n?-1:1)}:function(t,e){if(t===e)return E=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,s=[t],l=[e];if(!r||!o)return t===M?-1:e===M?1:r?-1:o?1:A?Q(A,t)-Q(A,e):0;if(r===o)return a(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)l.unshift(n);for(;s[i]===l[i];)i++;return i?a(s[i],l[i]):s[i]===I?-1:l[i]===I?1:0},M):M},e.matches=function(t,n){return e(t,null,null,n)},e.matchesSelector=function(t,n){if((t.ownerDocument||t)!==M&&N(t),n=n.replace(lt,"='$1']"),b.matchesSelector&&j&&!V[n+" "]&&(!F||!F.test(n))&&(!$||!$.test(n)))try{var i=U.call(t,n);if(i||b.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){}return e(n,M,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==M&&N(t),q(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==M&&N(t);var n=x.attrHandle[e.toLowerCase()],i=n&&Y.call(x.attrHandle,e.toLowerCase())?n(t,e,!j):void 0;return void 0!==i?i:b.attributes||!j?t.getAttribute(e):(i=t.getAttributeNode(e))&&i.specified?i.value:null},e.escape=function(t){return(t+"").replace(wt,bt)},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,n=[],i=0,r=0;if(E=!b.detectDuplicates,A=!b.sortStable&&t.slice(0),t.sort(B),E){for(;e=t[r++];)e===t[r]&&(i=n.push(r));for(;i--;)t.splice(n[i],1)}return A=null,t},D=e.getText=function(t){var e,n="",i=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=D(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[i++];)n+=D(e);return n},(x=e.selectors={cacheLength:50,createPseudo:i,match:ht,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(mt,yt),t[3]=(t[3]||t[4]||t[5]||"").replace(mt,yt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return ht.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&ut.test(n)&&(e=C(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(mt,yt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=R[t+" "];return e||(e=new RegExp("(^|"+tt+")"+t+"("+tt+"|$)"))&&R(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,n,i){return function(r){var o=e.attr(r,t);return null==o?"!="===n:!n||(o+="","="===n?o===i:"!="===n?o!==i:"^="===n?i&&0===o.indexOf(i):"*="===n?i&&o.indexOf(i)>-1:"$="===n?i&&o.slice(-i.length)===i:"~="===n?(" "+o.replace(rt," ")+" ").indexOf(i)>-1:"|="===n&&(o===i||o.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,l){var u,c,h,d,f,p,g=o!==a?"nextSibling":"previousSibling",v=e.parentNode,m=s&&e.nodeName.toLowerCase(),y=!l&&!s,w=!1;if(v){if(o){for(;g;){for(d=e;d=d[g];)if(s?d.nodeName.toLowerCase()===m:1===d.nodeType)return!1;p=g="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?v.firstChild:v.lastChild],a&&y){for(w=(f=(u=(c=(h=(d=v)[L]||(d[L]={}))[d.uniqueID]||(h[d.uniqueID]={}))[t]||[])[0]===H&&u[1])&&u[2],d=f&&v.childNodes[f];d=++f&&d&&d[g]||(w=f=0)||p.pop();)if(1===d.nodeType&&++w&&d===e){c[t]=[H,f,w];break}}else if(y&&(d=e,h=d[L]||(d[L]={}),c=h[d.uniqueID]||(h[d.uniqueID]={}),u=c[t]||[],f=u[0]===H&&u[1],w=f),!1===w)for(;(d=++f&&d&&d[g]||(w=f=0)||p.pop())&&((s?d.nodeName.toLowerCase()!==m:1!==d.nodeType)||!++w||(y&&(h=d[L]||(d[L]={}),c=h[d.uniqueID]||(h[d.uniqueID]={}),c[t]=[H,w]),d!==e)););return(w-=r)===i||w%i==0&&w/i>=0}}},PSEUDO:function(t,n){var r,o=x.pseudos[t]||x.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return o[L]?o(n):o.length>1?(r=[t,t,"",n],x.setFilters.hasOwnProperty(t.toLowerCase())?i(function(t,e){for(var i,r=o(t,n),a=r.length;a--;)i=Q(t,r[a]),t[i]=!(e[i]=r[a])}):function(t){return o(t,0,r)}):o}},pseudos:{not:i(function(t){var e=[],n=[],r=k(t.replace(ot,"$1"));return r[L]?i(function(t,e,n,i){for(var o,a=r(t,null,i,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))}):function(t,i,o){return e[0]=t,r(e,null,o,n),e[0]=null,!n.pop()}}),has:i(function(t){return function(n){return e(t,n).length>0}}),contains:i(function(t){return t=t.replace(mt,yt),function(e){return(e.textContent||e.innerText||D(e)).indexOf(t)>-1}}),lang:i(function(t){return ct.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(mt,yt).toLowerCase(),function(e){var n;do{if(n=j?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===O},focus:function(t){return t===M.activeElement&&(!M.hasFocus||M.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:s(!1),disabled:s(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!x.pseudos.empty(t)},header:function(t){return ft.test(t.nodeName)},input:function(t){return dt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:l(function(){return[0]}),last:l(function(t,e){return[e-1]}),eq:l(function(t,e,n){return[n<0?n+e:n]}),even:l(function(t,e){for(var n=0;n=0;)t.push(i);return t}),gt:l(function(t,e,n){for(var i=n<0?n+e:n;++i2&&"ID"===(a=o[0]).type&&9===e.nodeType&&j&&x.relative[o[1].type]){if(!(e=(x.find.ID(a.matches[0].replace(mt,yt),e)||[])[0]))return n;c&&(e=e.parentNode),t=t.slice(o.shift().value.length)}for(r=ht.needsContext.test(t)?0:o.length;r--&&(a=o[r],!x.relative[s=a.type]);)if((l=x.find[s])&&(i=l(a.matches[0].replace(mt,yt),vt.test(o[0].type)&&u(e.parentNode)||e))){if(o.splice(r,1),!(t=i.length&&h(o)))return G.apply(n,i),n;break}}return(c||k(t,d))(i,e,!j,n,!e||vt.test(t)&&u(e.parentNode)||e),n},b.sortStable=L.split("").sort(B).join("")===L,b.detectDuplicates=!!E,N(),b.sortDetached=r(function(t){return 1&t.compareDocumentPosition(M.createElement("fieldset"))}),r(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||o("type|href|height|width",function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),b.attributes&&r(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||o("value",function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||o(Z,function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null}),e}(t);pt.find=wt,pt.expr=wt.selectors,pt.expr[":"]=pt.expr.pseudos,pt.uniqueSort=pt.unique=wt.uniqueSort,pt.text=wt.getText,pt.isXMLDoc=wt.isXML,pt.contains=wt.contains,pt.escapeSelector=wt.escape;var bt=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&pt(t).is(n))break;i.push(t)}return i},xt=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},Dt=pt.expr.match.needsContext,Tt=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Ct=/^.[^:#\[\.,]*$/;pt.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?pt.find.matchesSelector(i,t)?[i]:[]:pt.find.matches(t,pt.grep(e,function(t){return 1===t.nodeType}))},pt.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(pt(t).filter(function(){for(e=0;e1?pt.uniqueSort(n):n},filter:function(t){return this.pushStack(o(this,t||[],!1))},not:function(t){return this.pushStack(o(this,t||[],!0))},is:function(t){return!!o(this,"string"==typeof t&&Dt.test(t)?pt(t):t||[],!1).length}});var kt,_t=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(pt.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||kt,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:_t.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof pt?e[0]:e,pt.merge(this,pt.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:et,!0)),Tt.test(i[1])&&pt.isPlainObject(e))for(i in e)pt.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=et.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):pt.isFunction(t)?void 0!==n.ready?n.ready(t):t(pt):pt.makeArray(t,this)}).prototype=pt.fn,kt=pt(et);var St=/^(?:parents|prev(?:Until|All))/,At={children:!0,contents:!0,next:!0,prev:!0};pt.fn.extend({has:function(t){var e=pt(t,this),n=e.length;return this.filter(function(){for(var t=0;t-1:1===n.nodeType&&pt.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?pt.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?at.call(pt(t),this[0]):at.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(pt.uniqueSort(pt.merge(this.get(),pt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),pt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return bt(t,"parentNode")},parentsUntil:function(t,e,n){return bt(t,"parentNode",n)},next:function(t){return a(t,"nextSibling")},prev:function(t){return a(t,"previousSibling")},nextAll:function(t){return bt(t,"nextSibling")},prevAll:function(t){return bt(t,"previousSibling")},nextUntil:function(t,e,n){return bt(t,"nextSibling",n)},prevUntil:function(t,e,n){return bt(t,"previousSibling",n)},siblings:function(t){return xt((t.parentNode||{}).firstChild,t)},children:function(t){return xt(t.firstChild)},contents:function(t){return r(t,"iframe")?t.contentDocument:(r(t,"template")&&(t=t.content||t),pt.merge([],t.childNodes))}},function(t,e){pt.fn[t]=function(n,i){var r=pt.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=pt.filter(i,r)),this.length>1&&(At[t]||pt.uniqueSort(r),St.test(t)&&r.reverse()),this.pushStack(r)}});var Et=/[^\x20\t\r\n\f]+/g;pt.Callbacks=function(t){t="string"==typeof t?s(t):pt.extend({},t);var e,n,i,r,o=[],a=[],l=-1,u=function(){for(r=r||t.once,i=e=!0;a.length;l=-1)for(n=a.shift();++l-1;)o.splice(n,1),n<=l&&l--}),this},has:function(t){return t?pt.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=a=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=n||[],n=[t,n.slice?n.slice():n],a.push(n),e||u()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!i}};return c},pt.extend({Deferred:function(e){var n=[["notify","progress",pt.Callbacks("memory"),pt.Callbacks("memory"),2],["resolve","done",pt.Callbacks("once memory"),pt.Callbacks("once memory"),0,"resolved"],["reject","fail",pt.Callbacks("once memory"),pt.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return pt.Deferred(function(e){pt.each(n,function(n,i){var r=pt.isFunction(t[i[4]])&&t[i[4]];o[i[1]](function(){var t=r&&r.apply(this,arguments);t&&pt.isFunction(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[i[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(e,i,r){function o(e,n,i,r){return function(){var s=this,c=arguments,h=function(){var t,h;if(!(e=a&&(i!==u&&(s=void 0,c=[t]),n.rejectWith(s,c))}};e?d():(pt.Deferred.getStackHook&&(d.stackTrace=pt.Deferred.getStackHook()),t.setTimeout(d))}}var a=0;return pt.Deferred(function(t){n[0][3].add(o(0,t,pt.isFunction(r)?r:l,t.notifyWith)),n[1][3].add(o(0,t,pt.isFunction(e)?e:l)),n[2][3].add(o(0,t,pt.isFunction(i)?i:u))}).promise()},promise:function(t){return null!=t?pt.extend(t,r):r}},o={};return pt.each(n,function(t,e){var a=e[2],s=e[5];r[e[1]]=a.add,s&&a.add(function(){i=s},n[3-t][2].disable,n[0][2].lock),a.add(e[3].fire),o[e[0]]=function(){return o[e[0]+"With"](this===o?void 0:this,arguments),this},o[e[0]+"With"]=a.fireWith}),r.promise(o),e&&e.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=it.call(arguments),o=pt.Deferred(),a=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?it.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(c(t,o.done(a(n)).resolve,o.reject,!e),"pending"===o.state()||pt.isFunction(r[n]&&r[n].then)))return o.then();for(;n--;)c(r[n],a(n),o.reject);return o.promise()}});var Nt=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;pt.Deferred.exceptionHook=function(e,n){t.console&&t.console.warn&&e&&Nt.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,n)},pt.readyException=function(e){t.setTimeout(function(){throw e})};var Mt=pt.Deferred();pt.fn.ready=function(t){return Mt.then(t).catch(function(t){pt.readyException(t)}),this},pt.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--pt.readyWait:pt.isReady)||(pt.isReady=!0,!0!==t&&--pt.readyWait>0||Mt.resolveWith(et,[pt]))}}),pt.ready.then=Mt.then,"complete"===et.readyState||"loading"!==et.readyState&&!et.documentElement.doScroll?t.setTimeout(pt.ready):(et.addEventListener("DOMContentLoaded",h),t.addEventListener("load",h));var Ot=function(t,e,n,i,r,o,a){var s=0,l=t.length,u=null==n;if("object"===pt.type(n)){r=!0;for(s in n)Ot(t,e,s,n[s],!0,o,a)}else if(void 0!==i&&(r=!0,pt.isFunction(i)||(a=!0),u&&(a?(e.call(t,i),e=null):(u=e,e=function(t,e,n){return u.call(pt(t),n)})),e))for(;s1,null,!0)},removeData:function(t){return this.each(function(){Ft.remove(this,t)})}}),pt.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=$t.get(t,e),n&&(!i||Array.isArray(n)?i=$t.access(t,e,pt.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){e=e||"fx";var n=pt.queue(t,e),i=n.length,r=n.shift(),o=pt._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,function(){pt.dequeue(t,e)},o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return $t.get(t,n)||$t.access(t,n,{empty:pt.Callbacks("once memory").add(function(){$t.remove(t,[e+"queue",n])})})}}),pt.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]+)/i,Yt=/^$|\/(?:java|ecma)script/i,zt={option:[1,""],thead:[1,""],col:[2,""],tr:[2,""],td:[3,""],_default:[0,"",""]};zt.optgroup=zt.option,zt.tbody=zt.tfoot=zt.colgroup=zt.caption=zt.thead,zt.th=zt.td;var Jt=/<|?\w+;/;!function(){var t=et.createDocumentFragment().appendChild(et.createElement("div")),e=et.createElement("input");e.setAttribute("type","radio"),e.setAttribute("checked","checked"),e.setAttribute("name","t"),t.appendChild(e),dt.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",dt.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Xt=et.documentElement,Gt=/^key/,Kt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Qt=/^([^.]*)(?:\.(.+)|)/;pt.event={global:{},add:function(t,e,n,i,r){var o,a,s,l,u,c,h,d,f,p,g,v=$t.get(t);if(v)for(n.handler&&(o=n,n=o.handler,r=o.selector),r&&pt.find.matchesSelector(Xt,r),n.guid||(n.guid=pt.guid++),(l=v.events)||(l=v.events={}),(a=v.handle)||(a=v.handle=function(e){return void 0!==pt&&pt.event.triggered!==e.type?pt.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(Et)||[""]).length;u--;)s=Qt.exec(e[u])||[],f=g=s[1],p=(s[2]||"").split(".").sort(),f&&(h=pt.event.special[f]||{},f=(r?h.delegateType:h.bindType)||f,h=pt.event.special[f]||{},c=pt.extend({type:f,origType:g,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&pt.expr.match.needsContext.test(r),namespace:p.join(".")},o),(d=l[f])||(d=l[f]=[],d.delegateCount=0,h.setup&&!1!==h.setup.call(t,i,p,a)||t.addEventListener&&t.addEventListener(f,a)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),r?d.splice(d.delegateCount++,0,c):d.push(c),pt.event.global[f]=!0)},remove:function(t,e,n,i,r){var o,a,s,l,u,c,h,d,f,p,g,v=$t.hasData(t)&&$t.get(t);if(v&&(l=v.events)){for(u=(e=(e||"").match(Et)||[""]).length;u--;)if(s=Qt.exec(e[u])||[],f=g=s[1],p=(s[2]||"").split(".").sort(),f){for(h=pt.event.special[f]||{},d=l[f=(i?h.delegateType:h.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!r&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,h.remove&&h.remove.call(t,c));a&&!d.length&&(h.teardown&&!1!==h.teardown.call(t,p,v.handle)||pt.removeEvent(t,f,v.handle),delete l[f])}else for(f in l)pt.event.remove(t,f+e[u],n,i,!0);pt.isEmptyObject(l)&&$t.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,a,s=pt.event.fix(t),l=new Array(arguments.length),u=($t.get(this,"events")||{})[s.type]||[],c=pt.event.special[s.type]||{};for(l[0]=s,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},n=0;n-1:pt.find(r,this,null,[u]).length),a[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return u=this,l\x20\t\r\n\f]*)[^>]*)\/>/gi,te=/