puredom-light-eval-benefit

JavaScript performance comparison

Test case created by Jason Miller

Info

How much longer does it take for the browser to evaluate the full version of puredom VS the light version when both are minified?

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Full
/*! puredom 03-03-2013 */
this.JSON||(this.JSON={}),function(){function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,a,s=gap,u=t[e];switch(u&&"object"==typeof u&&"function"==typeof u.toJSON&&(u=u.toJSON(e)),"function"==typeof rep&&(u=rep.call(t,e,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?u+"":"null";case"boolean":case"null":return u+"";case"object":if(!u)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(u)){for(i=u.length,n=0;i>n;n+=1)a[n]=str(n,u)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;i>n;n+=1)r=rep[n],"string"==typeof r&&(o=str(r,u),o&&a.push(quote(r)+(gap?": ":":")+o));else for(r in u)Object.hasOwnProperty.call(u,r)&&(o=str(r,u),o&&a.push(quote(r)+(gap?": ":":")+o));return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","       ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(e,t,o)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),"function"!=typeof Date.now&&(Date.now=function(){return(new Date).getTime()}),window._previousPureDom=window.puredom,function(){var e,t,n,o,i=function(){return l.puredom.apply(l,arguments)},a={version:"1.1.5",baseAnimationInterval:20,allowCssTransitions:!0,easingMethods:{ease:function(e){return(Math.sin(e*Math.PI-Math.PI/2)+1)/2},"ease-in-out":function(e){return(Math.sin(e*Math.PI-Math.PI/2)+1)/2},"ease-in-out-2":function(e){return this["ease-in-out"](this["ease-in-out"](e))},"ease-in-out-3":function(e){return this["ease-in-out"](this["ease-in-out"](this["ease-in-out"](e)))}}},s=!1,u=a.constructor,l={oninit:[],animationTimes:{fast:150,medium:450,slow:1e3},animationTimeScale:1,registeredEventCount:0,html5elements:"abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),support:{html5:!0,querySelectorAll:!!("querySelectorAll"in document),filters:!1,webkitMultitouch:!!("createTouch"in document)},regex:{css3AutoPrefix:/([\s\;\/\*])(box\-shadow|text\-shadow|border\-radius)\:([^\;]*)(\;|$)/gim,css3VendorPrefix:/\b\-(moz|webkit|ms|o|vendor)\-/gim,templateFieldToken:/([^\\]?)\{([a-z0-9A-Z\$_\.]+)(\|[^\}]*?)?\}/gm,parseObjectNameFromString:/^\[object ([^\s]+)\]$/gim,autoDetectHTMLContent:/(<[a-z]|&[a-z#0-9]{1,10};)/gim,whitespaceCharacters:/\s/,getNumericCSSValue:/[^0-9\.\-]/gm,getCSSValueUnits:/([a-z]+|%)$/,getNonIntegerCharsSigned:/[^0-9\.\-]/gm,getUpperCaseAlphaChars:/[A-Z]/gm},noop:function(){}};if(navigator.userAgent.match(/\b(iOS|Android|WebOS|iPhone|iPod|iPad)\b/gim)&&(i.allowCssTransitions=!1,i.baseAnimationInterval=50,l.animationTimeScale=1.5),navigator.userAgent.match(/\b(webkit|applewebkit|chrome|chromium|khtml)\b/gim)?(e="-webkit",t="Webkit"):navigator.userAgent.match(/\bopera\b/gim)?(e="-o",t="O"):navigator.userAgent.match(/\bgecko\b/gim)?(e="-moz",t="Moz"):navigator.userAgent.match(/\bmsie\s*?(8|9|[1-9][0-9]+)\b/gim)?(e="-ms",t="Ms"):navigator.userAgent.match(/\bmsie\s*?[4-8]\b/gim)&&(l.support.filters=!0,l.support.filterProperty="filter"),function(e,t){if(e=document.createElement("div"),e.innerHTML="<nav></nav>",l.support.html5=e.childNodes.length>0,!l.support.html5){for(l.html5frag=document.createDocumentFragment(),t=l.html5elements.length;t--;)l.html5frag.createElement(l.html5elements[t]);l.html5div=document.createElement("div"),l.html5frag.appendChild(l.html5div)}}(),o=function(){var e=document.body;return n=void 0!==e.textContent&&"textContent"||e.innerText&&"innerText"||"innerHTML",o=null,n},i.extend=function(e){var t,n,r;for(e=e||{},t=1;arguments.length>t;t++)if(r=arguments[t]){for(n in r)r.hasOwnProperty(n)&&(e[n]=r[n]);"function"==typeof r.toString&&r.toString!==Object.prototype.toString&&(e.toString=r.toString)}return e},i.mixin=function(e){var t,n,r;for(e=e||{},t=1;arguments.length>t;t++)if(r=arguments[t])for(n in r)r.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=r[n]);return e},i.strip=function(e,t){for(var n in e)(t===!0||e.hasOwnProperty(n))&&(e[n]=null)},i.delve=function(e,t,n,r){var o=0;for(t=t.split("."),n===!0&&t.splice(0,1);t.length>o&&e&&e.hasOwnProperty(t[o]);)e=e[t[o]],o+=1;return o>=t.length||r===!0&&o>0?e:void 0},i.flattenObj=function(e,t,n,r){var o,a;t=t||"",n=n||0,r=r||{};for(o in e)e.hasOwnProperty(o)&&(a=t?t+"_"+o:o,i.isScalar(e[o])?r[a]=e[o]:i.flattenObj(e[o],a,n+1,r));return n?void 0:r},i.template=function(e,t,n){var r,o;return n!==!1&&i.i18n&&(o=i.i18n),r=(e+"").replace(l.regex.templateFieldToken,function(e,n,r,a){var s;return"\\"!==n&&r?(s=i.delve(t,r),s?(o&&(s=o(s)||s),a&&"|"===a.substring(0,1)&&(s=i.text.filter(s,a.substring(1))),e=n+s):e=n):e=n,e})},i.inherits=function(e,t){function n(){}n.prototype=t.prototype;var r=e.prototype;e.prototype=new n,puredom.extend(e.prototype,r),e.prototype.constructor=e,e.prototype.__super=t},i.typeOf=function(e){if(void 0===e)return"undefined";if(null===e)return"null";if(e){if(e.constructor===u)return"object";if(i.isArray(e))return"array"}return Object.prototype.toString.call(e).replace(l.regex.parseObjectNameFromString,"$1").toLowerCase()},i.isScalar=function(e){var t=i.typeOf(e);return"undefined"===t||"null"===t||"number"===t||"string"===t||"boolean"===t?!0:!1},!Array.prototype.indexOf||0!==[i].indexOf(i))try{Array.prototype.indexOf=function(e){for(var t=0;this.length>t;t++)if(this[t]===e)return t;return-1}}catch(c){}i.toArray=function(e){var t,n=[],r=e&&e.length;if(r||0===r)for(t=r;t--;)n[t]=e[t];else for(t=0;;){if(e.hasOwnProperty&&e.hasOwnProperty(t))n.push(e[t]);else{if(!e.hasOwnProperty||!e.hasOwnProperty(t+""))break;n.push(e[t+""])}t+=1}return n},i.isArray=Array.isArray?function(e){return Array.isArray(e)}:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i.hasOwnProperty=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.forEach=function(e,t){var n,r;if(i.isArray(e))for(n=0;e.length>n&&(r=t(e[n],n),r!==!1);n++);else for(n in e)if(e.hasOwnProperty(n)&&(r=t(e[n],n),r===!1))break;return e},i.foreach=i.forEach,i.setInnerHTML=function(e,t){var n,r;if(l.support.html5)e.innerHTML=t||"";else{for(e.innerHTML="",l.html5div.innerHTML=t||"",n=document.createDocumentFragment(),r=l.html5div.childNodes.length;r--;)n.appendChild(l.html5div.firstChild);e.appendChild(n)}},i.createElement=function(t,n){var r,o,a,s,u;t=t||{},r=document.createElement(t.type||"div"),n=n||t.parent,t.insertBefore&&t.insertBefore.constructor===i.NodeSelection&&(t.insertBefore=t.insertBefore._nodes[0]),!n&&t.insertBefore&&(n=t.insertBefore.parentNode);for(o in t)if(i.hasOwnProperty(t,o))if("on"===(o+"").substring(0,2).toLowerCase())i.addEvent(r,o.substring(2),t[o]);else if("css"===o||"cssText"===o)e?(t[o]=t[o].replace(l.regex.css3AutoPrefix,"$1"+e+"-$2:$3; $2:$3;"),t[o]=t[o].replace(l.regex.css3VendorPrefix,"-"+e+"-"),r.style.cssText=t[o]):r.style.cssText=t[o];else if("html"===o||"innerHTML"===o)i.setInnerHTML(r,t[o]);else if("attributes"===o)for(a in t[o])i.hasOwnProperty(t[o],a)&&r.setAttribute(a,t[o][a]);else if("parent"!==o&&"children"!==o&&"insertBefore"!==o&&"type"!==o&&"children"!==o&&"html"!==o&&"innerHTML"!==o)if(document.all)try{r[o]=t[o]}catch(c){i.log(o)}else r[o]=t[o];if(n){if(t.insertBefore)try{n.insertBefore(r,t.insertBefore),u=!0}catch(c){u=!1}u||n.appendChild(r)}if(!n&&r.parentNode&&11===r.parentNode.nodeType&&"removeNode"in r,t.children&&i.isArray(t.children)){for(s=document.createDocumentFragment(),o=0;t.children.length>o;o++)i.createElement(t.children[o],s);r.appendChild(s)}return r},i.NodeSelection=function d(e){var t;if(this._results=[],this._nodes=[],this._animations=[],e)if(i.isArray(e))for(t=0;e.length>t;t++)e[t]&&(e[t].constructor===d&&e[t]._nodes?this._nodes.push(e[t]._nodes[0]):this._nodes.push(e[t]));else this._nodes.push(e)},i.extend(i.NodeSelection.prototype,{_results:[],_nodes:[],_animations:[],describe:function(){var e=[];return this.each(function(t){var n="<"+t.nodeName(),r=t.prop("id"),o=t.prop("className");r&&(n+=' id="'+r+'"'),o&&(n+=' class="'+o+'"'),n+=">",n+=1===t._nodes[0].childNodes.length&&3===t._nodes[0].childNodes[0].nodeType?t.text().replace(/(\r|\n)/gim,decodeURIComponent("%E2%86%A9")).replace(/\t/gim,decodeURIComponent("%E2%86%92")):"["+t.children().count()+" children]",n+="</"+t.nodeName()+">",e.push(n)}),e},toString:function(){return this.describe().join(", ")},toSource:function(){return this._nodes},getResult:function(e){return e=Math.round(e)||0,this._results[this._results.length-e-1]},pushResult:function(e){return this._results.push(e),this},each:function(e){return this._each(e,!0)},_each:function(e,t,n){var r,o,a,s,u=this._nodes.slice(0,this._nodes.length);for(r=0;u.length>r&&(o=r,n===!0&&(o=u.length-o-1),a=u[o],t===!0&&(a=new i.NodeSelection(a)),s=e.call(this,a,o),s!==!1);r++);return this},wait:function(e,t){var n=this;return t&&setTimeout(function(){t.apply(n),n=t=null},Math.abs(e)),this},nodeName:function(){var e=this._nodes[0],t=e&&e.nodeName&&e.nodeName.toLowerCase();return e===window?"#window":t?t:null},uuid:function(){return this._nodes[0]&&l.nodeToId(this._nodes[0])||null},text:function(e){return 0===arguments.length?this._nodes[0]&&this._nodes[0][n||o()]||"":(e+="",this._each(function(t){t[n||o()]=e}),this)},html:function(e,t){return 0===arguments.length?this._nodes[0]&&this._nodes[0].innerHTML||"":(e+="",l.regex.autoDetectHTMLContent.lastIndex=0,l.regex.autoDetectHTMLContent.test(e)&&t!==!0?this._each(function(t){i.setInnerHTML(t,e)}):this._each(function(t){t[n||o()]=e}),this)},css:function(e,t,n){var r,o=this;if(t=t||{},("string"==typeof t||"number"==typeof t)&&(t={tween:t}),!n&&t.callback&&(n=t.callback),n&&n.call||(n=l.noop),r=i.typeOf(t.tween),"string"==typeof e&&(e=l.parseCSS(e)),"string"===r&&"none"!==t.tween||"number"===r&&t.tween>0){var a,s,u=(t.tween+"").replace(l.regex.whitespaceCharacters,"").split(","),c=0,d=0;s=function(e){d+=1,d>=c&&(s=null,n&&n.call(o,o),o=n=e=null)};for(a in e)e.hasOwnProperty(a)&&(c+=1,this.animateCss(a,e[a],u[0],u[1],s))}else this._each(function(t){i.applyCss(t,e)}),n?setTimeout(function(){n.call(o,o),o=n=null},1):o=null;return this},show:function(){return this.css({display:"",visibility:"visible"}),this._each(function(e){("none"===e.style.display||"none"===i.nodeStyle(e,"display"))&&(e.style.display="block")}),this},hide:function(e){return this.css(e===!1?{visibility:"hidden"}:{display:"none"})},fadeIn:function(e,t){var n=parseFloat(this.getStyle("opacity")||"0")||0,r=1;return("none"===this.getStyle("display")||"hidden"===this.getStyle("visibility"))&&(this.getStyle("opacity")&&n>0&&1>n&&(r=n),n=0,this.css({opacity:0})),"function"===i.typeOf(e)&&(t=e,e=arguments[1]),n>=1||0==e||e===!1?(this.css({opacity:r}).show(),t&&t.call&&setTimeout(t,0),this):(this.css({opacity:r},{tween:e||"medium",callback:function(n){t&&t(n),e=t=null}}).show(),this)},fadeOut:function(e,t,n){var r=parseFloat(this.getStyle("opacity")||"1")||1;return"function"===i.typeOf(e)&&(t=e,e=arguments[1]),"boolean"===i.typeOf(t)&&(n=t,t=null,"function"===i.typeOf(arguments[2])&&(t=arguments[2])),0>=r||"none"===this.getStyle("display")||"hidden"===this.getStyle("visibility")||0===e||e===!1?(this.css({opacity:0}).hide(n),setTimeout(t,0),this):(this.css({opacity:0},{tween:e||"medium",callback:function(o){o.hide(n).css({opacity:r}),t&&t(o),e=t=null}}),this)},animateCSS:function(){var e,n,r,o;return e=function(e,t,n,r,o){var a,s,u,c=[],d=[];return e=e.toLowerCase(),"auto"!==t?(a=parseFloat((t+"").replace(l.regex.getNumericCSSValue,""))||0,u="string"===i.typeOf(t)&&t.match(l.regex.getCSSValueUnits),s=u&&u[0]||"px","opacity"===e&&(s="")):s="opacity"===e?"":"px",this._each(function(n,r){var o,u,p,h,f={};c[r]=parseFloat((i.nodeStyle(n,e)+"").replace(l.regex.getNonIntegerCharsSigned,""))||0,"auto"===t||""===t?(h=n.style.visibility||"",f[e]=t,f.visibility="hidden",i.applyCss(n,f),o=i.nodeStyle(n,e),(o===t||o.indexOf("px")<o.length-3)&&(p=e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase(),o=n["offset"+p]+"px"),u="string"===i.typeOf(o)&&o.match(l.regex.getCSSValueUnits),d[r]={_actualTarget:t,numericTargetValue:parseFloat((o+"").replace(l.regex.getNumericCSSValue,""))||0,units:"opacity"===e?"":u&&u[0]||"px"},setTimeout(function(){n.style.visibility=h,n=null},51),f=o=u=null):d[r]={numericTargetValue:a,units:s}}),this.animate(function(t){this._each(function(n,r){var o,a={},s=t*(d[r].numericTargetValue-c[r])+c[r],u=d[r].units;"px"===u?s=Math.round(s):(o=parseFloat(s),s=0===o%1?Math.round(o):o.toFixed(2)),a[e]=s+u,i.applyCss(n,a)})},n,r,function(t){t._each(function(t,n){var r={};d[n]._actualTarget&&(r[e]=d[n]._actualTarget,i.applyCss(t,r))}),o.apply(t,arguments)})},n=function(e,t,n,r,o){var a=this._createAnimationObj(function(){},n,r,o),s=this,u={},c={};e=i.getStyleAsProperty(e),"number"===i.typeOf(t)&&"opacity"!==(e+"").toLowerCase()&&(t+="px"),u[i.getStyleAsCSS(e)]={duration:a.duration,timingFunction:a.easing},c[e]=t,setTimeout(function(){s._each(function(e){i.updateCssTransitions(e,u),i.applyCss(e,c),l.incrementAnimationCount(e)}),a._cb=function(){if(a){var t={};t[e]=null,s._each(function(e){i.updateCssTransitions(e,t),l.decrementAnimationCount(e)}),a.callback&&a.callback.call(s,s);for(var n in a)if(a.hasOwnProperty(n))try{delete a[n]}catch(r){}}a=c=o=s=null},setTimeout(a._cb,(parseInt(a.duration,10)||0)+20)},10)},o=function(){return r=void 0!==document.body.style[t+"Transition"]||void 0!==document.body.style.transition},function(){var t=!1;return"boolean"!==i.typeOf(r)&&o(),i.allowCssTransitions===!1&&t!==!0||!r?e.apply(this,arguments):n.apply(this,arguments),this}}(),animate:function(e){if(e){var t,n=this,r=this._createAnimationObj.apply(this,arguments);this._each(function(e){l.incrementAnimationCount(e)}),t=function(e){if(r.frameTime=e,r.position=r.frameTime-r.start,r.fraction=r.position/r.duration,r.position>=r.duration?(r.fraction=1,r.position=r.duration):r.easingMethod&&(r.fraction=r.easingMethod.call(i.easingMethods,r.fraction,r)),r.animator.call(n,r.fraction,r),1===r.fraction){for(var o=n._animations.length;o--;)if(n._animations[o]===r){n._animations.splice(o,1);break}r.callback&&setTimeout(function(){n._each(function(e){l.decrementAnimationCount(e)}),r.callback.call(n,n,r),n=r=null},10)}else r.timer=i.animationFrame.getTimer(t,i.baseAnimationInterval||10)},i.animationFrame.getTimer(t,i.baseAnimationInterval||10),this._animations.push(r)}return this},_createAnimationObj:function(e,t,n,r){var o={animator:e,duration:t,easing:"string"===i.typeOf(n)?n:"ease",callback:r,start:i.animationFrame.getStartTime(),frameTime:null};if("string"===i.typeOf(o.duration))switch(o.duration.toLowerCase()){case"long":case"slow":o.duration=l.animationTimes.slow;break;case"short":case"fast":o.duration=l.animationTimes.fast;break;default:o.duration=parseInt(o.duration)||l.animationTimes.medium}else o.duration=Math.round(o.duration)||l.animationTimes.medium;return l.animationTimeScale&&(o.duration*=l.animationTimeScale),o.easing&&i.easingMethods.hasOwnProperty(o.easing)?o.easingMethod=i.easingMethods[o.easing]:o.easing=null,o},classify:function(){var e,t,n=[],r="{*^de^*}"===arguments[0]?"removeClass":"addClass";for(e=0;arguments.length>e;e++)if(i.isArray(arguments[e]))for(t=0;arguments[e].length>t;t++)n.push(arguments[e][t]);else n.push(arguments[e]);return this._each(function(e){i[r](e,n)}),this},declassify:function(){var e=["{*^de^*}"].concat(Array.prototype.slice.call(arguments,0));return this.classify.apply(this,e)},hasClass:function(e,t){var n=t!==!0;return this._each(function(r){var o=(" "+r.className+" ").indexOf(" "+e+" ")>-1;t===!0?o&&(n=!0):o||(n=!1)}),n},setOpacity:function(e){return this._each(function(t){i.setOpacity(t,e)}),this},sumOf:function(e){var t=0,n=Array.prototype.slice.call(arguments,1);return this.constructor.prototype.hasOwnProperty(e)&&this._each(function(r){r=new i.NodeSelection(r),t+=r[e].apply(r,n)}),t},height:function(e,t){var n,r,o=0;return"object"!==i.typeOf(e)||t||(t=e,e=null),t=t||{},e||0===e?(e+="","auto"===e?n="":(r=/^([\-0-9\.]+)(.*?)$/.exec(e),e=Math.round(r&&r[1]||e)||0,n=r&&r[2]||"px"),this.css({height:e+n}),this):(this._each(function(e){o+=parseInt(e.offsetHeight,10)||0,t.border!==!0&&(o-=parseInt((i.nodeStyle(e,"border-top-width")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o-=parseInt((i.nodeStyle(e,"border-bottom-width")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0),t.margin===!0&&(o+=parseInt((i.nodeStyle(e,"margin-top")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o+=parseInt((i.nodeStyle(e,"margin-bottom")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0),t.padding===!1&&(o-=parseInt((i.nodeStyle(e,"padding-top")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o-=parseInt((i.nodeStyle(e,"padding-bottom")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0)}),o)},width:function(e,t){var n,r,o=0;return"object"!==i.typeOf(e)||t||(t=e,e=null),t=t||{},e||0===e?(e+="","auto"===e?n="":(r=/^([\-0-9\.]+)(.*?)$/.exec(e),e=r&&r[1]||e,n=r&&r[2]||"px"),this.css({width:e+n}),this):(this._each(function(e){o+=parseInt(e.offsetWidth,10)||0,t.border!==!0&&(o-=parseInt((i.nodeStyle(e,"border-left-width")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o-=parseInt((i.nodeStyle(e,"border-right-width")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0),t.margin===!0&&(o+=parseInt((i.nodeStyle(e,"margin-left")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o+=parseInt((i.nodeStyle(e,"margin-right")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0),t.padding===!1&&(o-=parseInt((i.nodeStyle(e,"padding-left")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o-=parseInt((i.nodeStyle(e,"padding-right")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0)}),o)},x:function(e){var t=this._nodes[0],n=null;if(t&&(n=t.offsetLeft,e===!0))for(;(t=t.parentNode)&&t!==document;)n+=parseFloat(t.offsetLeft)||0;return n},y:function(e){var t=this._nodes[0],n=null;if(t&&(n=t.offsetTop,e===!0))for(;(t=t.parentNode)&&t!==document;)n+=parseFloat(t.offsetTop)||0;return n},position:function(e,t,n,r){var o;return r=r||"px",1>arguments.length||1===arguments.length&&arguments[0]===!0?{x:this.x(arguments[0]===!0),y:this.y(arguments[0]===!0)}:(o={},"number"===puredom.typeOf(e)?o.left=e+r:"string"===puredom.typeOf(e)&&(o.left=e),"number"===puredom.typeOf(t)?o.top=t+r:"string"===puredom.typeOf(t)&&(o.top=t),this.css(o,n),this)},scrollLeft:function(e){return e||0===e?("number"!==i.typeOf(e)&&(e=Math.round((e+"").replace(l.regex.getNonIntegerCharsSigned,""))),this._each(function(t){t.scrollLeft=e}),void 0):this._nodes&&this._nodes[0]&&this._nodes[0].scrollLeft||0},scrollTop:function(e){return e||0===e?("number"!==i.typeOf(e)&&(e=Math.round((e+"").replace(l.regex.getNonIntegerCharsSigned,""))),this._each(function(t){t.scrollTop=e}),void 0):this._nodes&&this._nodes[0]&&this._nodes[0].scrollTop||0},focus:function(){return this._each(function(e){e.focus&&e.focus()}),this},blur:function(){return this._each(function(e){e.blur&&e.blur()}),this},selectAll:function(){this._each(function(e){e.SelectAll&&e.SelectAll(),e.select&&e.select(),e.selectionStart&&e.hasOwnProperty("value")&&(e.selectionStart=0,e.selectionEnd=e.value.length)})},getStyle:function(e,t){var n=[];return this._each(function(t){n.push(i.nodeStyle(t,e)||null)}),t===!1?(this.pushResult(n),this):1>=n.length?n[0]:n},value:function(e,t){if(t=t||{},null!==e&&void 0!==e&&arguments.length>0)return this._each(function(n){var r=(n.nodeName+"").toLowerCase(),o=(n.getAttribute("type")||"").toLowerCase();"input"!==r||"checkbox"!==o&&"radio"!==o||(n.checked=!!e),n.value=e,t.fireChange!==!1&&i.fireEvent({type:"change",target:n,value:e})}),this;var n=[];return this._each(function(e){var t,r=(e.nodeName+"").toLowerCase(),o=(e.getAttribute("type")||"").toLowerCase();"input"!==r||"checkbox"!==o&&"radio"!==o?"select"===r?(t=e.multiselect||e.multiSelect?[]:null,i.el(e).query("option")._each(function(e){(e.selected||e.checked)&&(i.isArray(t)?t.push(e.value):t=e.value)}),n.push(t)):n.push(e.value):n.push(!!e.checked)}),2>n.length?n[0]||null:n},attr:function(e,t,n){var r,o,a=[];if(0===arguments.length){for(a={},r=this._nodes[0].attributes.length;r--;)o=this._nodes[0].attributes[r],o.specified&&(a[o.name||o.nodeName]=o.value||o.nodeValue);return a}if(arguments.length>1){if("object"===i.typeOf(e)){for(r in e)"string"==typeof r&&e.hasOwnProperty(r)&&this.attr(a,e[r]);return this}return this._each(function(n){try{n.setAttribute(e,t),!n.removeAttribute||null!==t&&void 0!==t||n.removeAttribute(e)}catch(r){}})}return this._each(function(t){var n=t.getAttribute(e);"string"!=typeof n&&(n=null),a.push(n)}),n===!1?(this.pushResult(a),this):1>=a.length?a[0]:a},prop:function(e,t,n){var r=[];return arguments.length>1?this._each(function(n){if(n[e]=t,void 0===t)try{delete n[e]}catch(r){}}):(this._each(function(t){var n;try{n=t[e]}catch(o){console.log("NodeSelection.prop("+e+") :: Access Error",o)}r.push(n||null)}),n===!1?(this.pushResult(r),this):1>=r.length?r[0]:r)},enable:function(){return this.attr("disabled",null),this.declassify("_puredom_disabled"),this},disable:function(){return this.attr("disabled","disabled"),this.classify("_puredom_disabled"),this},enabled:function(e){return e===!0||e===!1?(this[e?"enable":"disable"](),this):"disabled"!==this.attr("disabled")&&this.prop("disabled")!==!0&&!this.hasClass("_puredom_disabled")},addEvent:function(e,t,n){return this._each(function(r){i.addEvent(r,e,t,n)}),this},removeEvent:function(e,t,n){return this._each(function(r){i.removeEvent(r,e,t,n)}),this},fireEvent:function(e,t){return this._each(function(n){i.fireEvent(i.extend({},t||{},{type:e,target:n}))}),this},_removeAllEvents:function(e){var t;return this._each(function(e){l.wrappedEventListener.destroyObjHandlers(e,!0)}),t=this.children(),e===!0&&t.count()>0&&t._removeAllEvents(!0),t=e=null,this},appendChild:function(e){if(e&&this._nodes.length>0)if(e.constructor===this.constructor){var t=this._nodes[0];e._each(function(e){t.appendChild(e)})}else this._nodes[0].appendChild(e);return this},insertBefore:function(e,t){if(e&&this._nodes.length>0){if(t&&t.constructor===this.constructor&&(t=t._nodes[0]),!t||t.parentNode!==this._nodes[0])return this.appendChild(e);if(e.constructor===this.constructor){var n=this._nodes[0];e._each(function(e){n.insertBefore(e,t)},null,!0)}else this._nodes[0].insertBefore(e,t)}return this},insertInto:function(e){var t;return e&&this.count()>0&&(e.constructor===this.constructor&&(e=e._nodes[0]),1===this.count()?e.appendChild(this._nodes[0]):(t=document.createDocumentFragment(),this._each(function(e){t.appendChild(e)},null,!0),l.support.filters!==!0&&e.appendChild(t))),this},remove:function(){return this.fireEvent("remove"),this._each(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this},destroy:function(){return this.remove(),this.fireEvent("destroy"),this._removeAllEvents(!0),this._nodes.splice(0,this._nodes.length),this},query:function(e,t){var n=[];return this._nodes.length>0&&this._each(function(r){var o=i.getElement(e,puredom.extend({},t||{},{within:r}));i.isArray(o)&&o.length>0&&(n=n.concat(o))}),new i.NodeSelection(n)},clone:function(e,t){var n=[];return t===!0&&(t=this.parent()),this._each(function(t){n.push(t.cloneNode(e!==!1))}),n=new i.NodeSelection(n),t&&t.appendChild(n),n._each(l.removeNodeUID),e!==!1&&n.query("*")._each(l.removeNodeUID),n},count:function(){return this._nodes.length},exists:function(){return this.count()>0},next:function(){for(var e=this._nodes[0]&&this._nodes[0].nextSibling;e&&3===e.nodeType;)e=e.nextSibling;return new i.NodeSelection(e&&[e]||null)},prev:function(){for(var e=this._nodes[0]&&this._nodes[0].previousSibling;e&&3===e.nodeType;)e=e.previousSibling;return new i.NodeSelection(e&&[e]||null)},previous:function(){return this.prev.apply(this,arguments)},firstChild:function(){return this.children().first()},lastChild:function(){return this.children().last()},nthChild:function(e){return this.children().index(e)},first:function(e){return new i.NodeSelection(this._nodes.slice(0,e||1))},last:function(e){return new i.NodeSelection(this._nodes.slice(this._nodes.length-(e||1)))},index:function(e,t){return new i.NodeSelection("number"===i.typeOf(e)&&this._nodes.slice(e,e+(t||1))||null)},siblings:function(){var e=new i.NodeSelection;return this._each(function(t){for(var n=t;n=n.previousSibling;)"#text"!==n.nodeName&&"#comment"!==n.nodeName&&3!==n.nodeType&&e._nodes.push(n);for(n=t;n=n.nextSibling;)"#text"!==n.nodeName&&"#comment"!==n.nodeName&&3!==n.nodeType&&e._nodes.push(n)}),e},parent:function(){var e,t=[];return this._each(function(n){e=n.parentNode,e&&0>t.indexOf(e)&&11!==e.nodeType&&t.push(e)}),new i.NodeSelection(t)},children:function(){var e,t,n=[];if(this._nodes.length>0)for(e=0;this._nodes.length>e;e++)if(this._nodes[e].childNodes)for(t=0;this._nodes[e].childNodes.length>t;t++)3!==this._nodes[e].childNodes[t].nodeType&&"#text"!==this._nodes[e].childNodes[t].nodeName&&"#comment"!==this._nodes[e].childNodes[t].nodeName&&n.push(this._nodes[e].childNodes[t]);return new i.NodeSelection(n)},submit:function(){this._each(function(e){var t=i.fireEvent({type:"submit",target:e});t.rval!==!1&&t.returnValue!==!1&&t.preventDefault!==!0&&e.submit&&e.submit()})},selection:function(e,t){var n,r,o,a,s,u=this._nodes[0];return e&&"number"!=typeof e&&e.start&&(t=e.end,e=e.start),"number"!=typeof e?window.getSelection?(n="string"==typeof u.value?u.value:u.innerHTML,r=window.getSelection(),{start:u.selectionStart+0,end:u.selectionEnd+0,text:n.substring(r.start,r.end)}):document.selection?(r=document.selection.createRange(),o=document.body.createTextRange(),o.moveToElementText(u),o.setEndPoint("EndToStart",r),{start:o.text.length,end:o.text.length+r.text.length,text:r.text}):(i.log("Selection retrieval is not supported in this browser."),{start:0,end:0,text:""}):(0>e&&(e=0),a=u.value.length,t>a&&(t=a),e>t?e=t:e>t&&(t=e),window.getSelection?(u.selectionStart=e,u.selectionEnd=t):u.selectionEnd||0===u.selectionEnd?(u.selectionStart=e,u.selectionEnd=t):u.createTextRange&&(s=u.createTextRange(),s.collapse(!0),s.moveStart("character",e),s.moveEnd("character",t),s.select()),this)},template:function(e){var t;return e=e||{},t=function(e){var t,n=e.split("|");for(e=n.splice(0,1)[0],t=n.length;t--;)"htmlEntities"===n[t]&&n.splice(t,1);return n},this.query("[data-tpl-id]").each(function(n){var r,o,a=n.nodeName(),s=n.attr("data-tpl-id"),u=s;if(r=t(s),s=s.split("|")[0],u=puredom.delve(e,s),null!==u&&void 0!==u)if(("date"==typeof u||u.constructor===Date)&&(u=u.toLocaleString()),o=n.attr("data-tpl-prop"))n.prop(o,i.text.filter(u,r.join("|")));else switch(a){case"select":case"input":case"textarea":case"meter":case"progress":n.value(u);break;case"img":case"video":case"audio":case"iframe":r.splice(0,0,"htmlEntities"),u=i.text.filter(u,r.join("|")),n.attr("src",u);break;default:r.splice(0,0,"htmlEntities"),u=i.text.filter(u,r.join("|")),n.html(u)}}),e=null,this}}),i.NodeSelection.prototype.on=i.NodeSelection.prototype.addEvent,i.NodeSelection.prototype.animateCss=i.NodeSelection.prototype.animateCSS,l.incrementAnimationCount=function(e){e.setAttribute("data-puredom-animation-count",l.getAnimationCount(e)+1+""),i.addClass(e,"_puredom_animating")},l.decrementAnimationCount=function(e){var t=Math.max(0,l.getAnimationCount(e));t>1?e.setAttribute("data-puredom-animation-count",t-1+""):(e.setAttribute("data-puredom-animation-count",""),e.removeAttribute&&e.removeAttribute("data-puredom-animation-count"),i.removeClass(e,"_puredom_animating"))},l.getAnimationCount=function(e){return parseInt(e.getAttribute("data-puredom-animation-count"),10)||0},l.unload=function(){l.wrappedEventListener.reset(),i.getElement.clearCache(),l._nodeToIdList={},setTimeout(function(){window.puredom=l=u=o=null},10)},i.el=function(e,t){var n,r;if(e){if(r=i.typeOf(e),"array"===r){n=[];for(var o=0;e.length>o;o++)Array.prototype.splice.apply(n,[0,0].concat(i.el(e[o])._nodes))}if(e.constructor===i.NodeSelection)return t===!0&&console.log("query is already a NodeSelection",e.constructor+"",e.constructor.name),e;"string"===r&&"<"===e.charAt(0)||"object"===r&&!e.nodeName&&e!==window?(t===!0&&console.log("query is an HTML fragment",e,r),n=i.createElement.apply(i,arguments)):"string"===r?(t===!0&&console.log("query is a CSS selector",e,r),n=i.getElement(e,arguments[1])):(e.nodeName||e===window)&&(t===!0&&console.log("query is an HTML element",e,r),n=e)}return new i.NodeSelection(n)},i.node=function(e){return new i.NodeSelection(l.idToNode(e))},i.getElement=function(){var e,t,n,o={},a=!1,s=/^((?:[a-z][a-z0-9\_\-]*)|\*)?/gi,u=/^\s*(.*?)\s*$/gm,c=!1;return n=[{title:"ID selector {#id}",regex:/^#[_a-zA-Z0-9-]*/gm,filter:function(e,t,n){var r=n.searchBaseNode&&n.searchBaseNode.getElementById?n.searchBaseNode:document;return[r.getElementById(e[0].substring(1))]}},{title:"Class selector {.className}",regex:/^\.([^#.:\[<>\{+\|\s]+)/gim,filter:function(e,t){var n,r,o=" "+e[1]+" ";for(n=t.length;n--;)r=t[n]&&t[n].className,r&&-1!==(" "+r+" ").indexOf(o)||t.splice(n,1)}},{title:"Attribute selector {[name=value] & variants}",regex:/^\[([^\^\$\~=]+)(?:([\^\$\~=]+)(['"]?)([^\]]*))?\3\]/g,filter:function(e,t){var n,r,o,a,s;if(e&&e[1])for(r={attribute:e[1]},e[2]&&e[4]&&(r.type=e[2],r.attrValue=e[4]||""),n=t.length;n--;){switch(o=!1,a="checked"===r.attribute?"true"===r.attrValue||"false"===r.attrValue?t[n].checked?"true":"false":t[n].checked?"checked":null:"selected"===r.attribute?"true"===r.attrValue||"false"===r.attrValue?t[n].selected?"true":"false":t[n].selected?"selected":null:t[n]&&t[n].getAttribute(r.attribute+""),r.attrPresent="string"===i.typeOf(a),r.attrSet=a&&a.length>0,r.attrValue&&(s=r.attrPresent?a.indexOf(r.attrValue):-1),r.type||""){case"=":o=a===r.attrValue;break;case"^=":o=0===s;break;case"$=":o=r.attrSet&&a.substring(a.length-r.attrValue.length)===r.attrValue;break;case"~=":o=s>-1;break;default:o=!r.attrValue&&r.attrPresent}o||t.splice(n,1)}}},{title:"Descendant selector {>}",regex:/^\s*\>\s*((?:[a-z][a-z0-9\:\_\-]*)|\*)?/gi,filter:function(e,t,n){var r,o,a,s,u=[].concat(t),l=(e[1]||"*").toLowerCase();for(t.splice(0,t.length),!n.isFiltered&&n.first&&i.log("Descendant selector called on an unfiltered result set.  Operating on descendants of the document."),(!n.isFiltered||n.first)&&(u=[n.searchBaseNode]),r=0;u.length>r;r++)for(a=u[r].childNodes,o=0;a.length>o;o++)s=(a[o].nodeName+"").toLowerCase(),(s===l||"*"===l&&"#"!==s.charAt(0)&&(1===a[o].nodeType||9===a[o].nodeType))&&t.push(a[o])
}},{title:"nth-child aliases, like :first-child",regex:/^\:(first|last|only)\-(child|of\-type)/gm,filter:function(e,t,r){var o,a,s,u,l={"first-child":":nth-child(0n+1)","first-of-type":":nth-of-type(0n+1)","last-child":":nth-last-child(0n+1)","last-of-type":":nth-last-of-type(0n+1)"};for(o=n.length;o--;)if(n[o].isNthChildSelector===!0){a=n[o];break}return l.hasOwnProperty(e[1]+"-"+e[2])&&a?(s=l[e[1]+"-"+e[2]],a.regex.lastIndex=0,u=a.regex.exec(s),a.filter(u,t,r)):(i.log('
Unknown nth-child alias "'+e[1]+"-"+e[2]+'"'),void 0)}},{isNthChildSelector:!0,title:"nth-child selector {:nth-child(n+2) & variants}",regex:/^\:(nth(?:\-last)?(?:\-of\-type|\-child))\((?:(\-?[0-9]*n(?:[+-][0-9]+)?)|([0-9]+)|([a-z]+))\)/gm,filter:function(e,t){var n,o,a,s,u,l,c,d,p,h,f=-1!==e[1].indexOf("-of-type"),m={odd:[2,1],even:[2]};if(n=t.splice(0,t.length),-1!==e[1].indexOf("-last")&&n.reverse(),e[2]?(s=e[2].split("n"),0===s[0].replace("-","").length&&(s[0]=s[0]+"1"),p=Math.round(s[0].replace("+",""))||0,h=Math.round(s[1].replace("+",""))||0):e[3]?(p=0,h=Math.round(e[3])||0):e[4]&&(s=e[4].toLowerCase(),m.hasOwnProperty(s)?(p=m[s][0]||0,h=m[s][1]||0):i.log('Unknown named nth-child expression "'+r[4]+'"')),!(0>=p+h))for(p===h&&(h=0),o=0;n.length>o;o++){if(children=(n[o].parentNode||{}).childNodes,l=(n[o].nodeName+"").toLowerCase(),isMatch=!1,children)for(d=0,a=0;children.length>a&&(c=children[a],u=f?(c.nodeName+"").toLowerCase()===l:"#"!==(c.nodeName+"").substring(0,1)||1===c.nodeType||9===c.nodeType,!u||(d+=1,c!==n[o]||!(isMatch=p>0?0===d%p-h:d===h)));a++);isMatch&&t.push(n[o])}}},{title:"within_internal selector { }",regex:/^\s+((?:[a-z][a-z0-9\:\_\-]*)|\*)?/gi,filter:function(e,t){var n,r=[].concat(t),o=e[1]||"*";for(t.splice(0,t.length),n=0;r.length>n;n++)Array.prototype.splice.apply(t,[t.length-1,0].concat(i.toArray(r[n].getElementsByTagName(o))))}}],t=function(e){e.lastIndex=0},e=function(r,d){var p,h,f,m,g,y,v,b,w,_,S,x,C,T,O=document&&document.documentElement||document,E=r,N=0,P=!1,L=!l.support.querySelectorAll,A=Date.now();if(r=(r+"").replace(u,"$1"),d=puredom.extend({},d||{}),d.logging===!0&&(P=!0),a&&d.useCache===!0&&o[r])return o[r];if(d.within&&(O=d.within),O&&O.length&&!O.nodeName&&O.indexOf&&O[0]&&(O=O[0]),r.indexOf(",")>-1){for(r=r.split(","),h=[],T=r.length;T--;)if(r[T]=r[T].replace(u,"$1"),r[T].length>0&&(b=e(r[T],puredom.extend({},d,{logging:!1,internalLogging:P,internal:!0}))))for(C=0;b.length>C;C++)-1===h.indexOf(b[C])&&h.push(b[C]);return P&&i.log("query=",E,", result=",node),A=Date.now()-A,A>100&&i.log('Slow Selector Warning: "'+E+'" took '+A+"ms to complete."),h}if(f=r.match(s),f=(f&&f[0]||"").toLowerCase(),r=r.substring(f.length),v=r,">"===E.charAt(0)&&(L=!0),v.match(/^#[^\s\[\]\(\)\:\*\.\,<>#]+$/gim))p=[(O.getElementById?O:document).getElementById(v.substring(1))],L=!1;else if(l.support.querySelectorAll&&L!==!0){m=E.replace(/(\[[^\[\]= ]+=)([^\[\]"']+)(\])/gim,'$1"$2"$3');try{p=i.toArray(O.querySelectorAll(m)||[])}catch(M){console.log("Native querySelectorAll failed for selector: ",m,", error:",M.message),p=[],L=!0}}if(L)for("#"===r.substring(0,1)?p=[]:f&&"*"!==f||!document.all||window.opera||O!==document&&O!==document.documentElement?(p=i.toArray(O.getElementsByTagName(f||"*")),_=!0):(p=i.toArray(O.all||document.all),_=!1),g={searchBaseNode:O,negated:!1,first:!0,isFiltered:_||!(!f||"*"===f)};v.length>0;){for(N+=1,w=!1,C=0;n.length>C&&(c===!0&&(S=Date.now()),t(n[C].regex),b=n[C].regex.exec(v),c===!0&&(S=Date.now()-S),b&&(w=!0,P&&i.log((n[C].title||n[C].regex)+' ==>> matched:"'+v.substring(0,b[0].length)+'" ==>> remaining:"'+v.substring(b[0].length)+'" ||debug>> (submatches:'+b.slice(1).join(",")+")"),c===!0&&(x=Date.now()),y=n[C].filter(b,p,g),y&&i.isArray(y)&&(p=y),c===!0&&(x=Date.now()-x),v=v.substring(b[0].length),g.first=!1,g.isFiltered=!0),c===!0&&(n[C].matchTimes.push(S),w&&n[C].filterTimes.push(x)),0!==v.length);C++);if(!w)throw Error("puredom.getElement() :: Unknown CSS selector near: "+v.substring(0,20),"puredom.js",1775)}if(d.includeInvisibles!==!0)for(C=p.length;C--;)p[C]&&"#"===(p[C].nodeName+"").charAt(0)&&p.splice(C,1);return P&&i.log("query=",E,", result=",p),a&&d.cache===!0&&(o[r]=p),d.internal!==!0&&P===!0&&(A=Date.now()-A,A>10&&i.log('Slow Selector Warning: "'+E+'" took '+A+"ms to complete. "+N+" parse iterations.")),p},e.enableCache=function(e){a=e!==!1,a||(o={})},e.disableCache=function(){a=!1,o={}},e.clearCache=function(){o={}},e._normalizeSelectorFilter=function(e){return 2===arguments.length&&(e={regex:arguments[0],filter:arguments[1]}),e&&e.regex&&e.filter?e:!1},e.addSelectorFilter=function(t){return t=e._normalizeSelectorFilter.apply(e,arguments),t?(n.push(t),!0):!1},e.removeSelectorFilter=function(t){var r,o,i;if(t=e._normalizeSelectorFilter.apply(e,arguments))for(r=n.length;r--;){i=!0;for(o in n[r])if(n[r].hasOwnProperty(o)&&n[r][o]!==t[o]){i=!1;break}if(i){n.splice(r,1);break}}return i===!0},c===!0?(function(){for(var e=0;n.length>e;e++)n[e].matchTimes=[],n[e].filterTimes=[]}(),e.selectorStats=function(){var e,t,r,o,i,a,s={title:"--- Selector Statistics: ---",selectors:[]};for(t=0;n.length>t;t++){if(r=n[t],e={},e.title=r.title,a=0,r.matchTimes.length>0){for(i=0,o=0;r.matchTimes.length>o;o++)i+=r.matchTimes[o];a+=i,e.matching=Math.round(i/r.matchTimes.length)+"ms"}if(r.filterTimes.length>0){for(i=0,o=0;r.filterTimes.length>o;o++)i+=r.filterTimes[o];a+=i,e.filtering=Math.round(i/r.filterTimes.length)+"ms"}e.own_time=a+"ms",e.calls=r.matchTimes.length,s.selectors.push(e)}return s}):e.selectorStats=function(){return"disabled"},e}(),i.selectorEngine=i.getElement,i.DOMEvent=function(e){e&&(this.type=e.replace(/^on/gi,""))},i.DOMEvent.displayName="puredom.DOMEvent",i.extend(i.DOMEvent.prototype,{which:null,type:"",target:null,relatedTarget:null,preventDefault:function(){this.defaultPrevented=!0},stopPropagation:function(){this.propagationStopped=!0,this.bubblingCancelled=!0},cancel:function(){return this.preventDefault(),this.stopPropagation(),this.returnValue=!1,!1},returnValue:!0,originalEvent:null,timeStamp:null}),i.DOMEvent.prototype.cancelBubble=i.DOMEvent.prototype.stopPropagation,i.DOMEvent.prototype.stop=i.DOMEvent.prototype.cancel,i.DOMEvent.prototype.prevent=i.DOMEvent.prototype.cancel,l.wrappedEventListener={list:[],none:{},summary:function(){for(var e=0;this.list.length>e;e++)i.log(l.idToNode(this.list[e].target),".on",this.list[e].type," -> ",this.list[e].handler.displayName||this.list[e].handler.name)},reset:function(e){var t,n;if(e===!0)for(t=this.list.length;t--;)n=this.list[t],this.list[t]=this.none,i.removeEvent(l.idToNode(n.target),n.type,n.wrappedHandler),this.unsetRefs(n),window.killCount=(window.killCount||0)+1;this.list.splice(0,this.list.length)},destroyObjHandlers:function(e){var t,n,r=l.nodeToId(e);for(t=this.list.length;t--;)n=this.list[t],n.target===r&&(this.unsetRefs(n),this.list.splice(t,1),i.removeEvent(e,n.type,n.wrappedHandler),window.killCount=(window.killCount||0)+1)},get:function(e,t,n,r){var o,i;for(n=l.nodeToId(n),o=this.list.length;o--;)if(i=this.list[o],i.target===n&&i.handler===t&&i.type===e){t=i.wrappedHandler,r===!0&&(this.list.splice(o,1),window.killCount=(window.killCount||0)+1,this.unsetRefs(i));break}return t},unsetRefs:function(e){e.wrappedHandler.type=null,e.wrappedHandler.handler=null,e.wrappedHandler.target=null},internalFireEvent:function(e){var t,n,r,o=l.nodeToId(e.target),i=e.type.replace(/^on/gm,"");for(t=this.list.length;t--&&(n=this.list[t],n.target!==o||n.type!==i||(r=n.handler.call(e.target,e),r!==!1)););},create:function(e,t,n){var r={type:e,target:l.nodeToId(n),handler:t,wrappedHandler:function(e){var t,n,r=arguments.callee.handler,o=(arguments.callee.type||e.type).toLowerCase().replace(/^on/,""),a=this!==window?this:l&&l.idToNode(arguments.callee.target),s={isInSelf:!1,doPreventDefault:!1,doCancelBubble:!1,doStopPropagation:!1,e:e||window.event,ret:null,end:function(){return s.end=null,e=t=s=r=o=a=null,this.ret}};l&&l.idToNode||i.log("target:<"+e.target.nodeName+' class="'+e.target.className+'" id="'+e.target.id+'"'+"> , type:"+o+"/"+e.type),e=s.e,t=i.extend(new i.DOMEvent(o),{which:e.which,target:e.target||e.srcElement||a||document.body,relatedTarget:e.relatedTarget||("mouseout"===o?e.toElement:e.fromElement),returnValue:!0,originalEvent:e,timeStamp:e.timeStamp||Date.now()});for(n in e)t.hasOwnProperty(n)||"function"==typeof e[n]||n===n.toUpperCase()||"layerX"===n||"layerY"===n||(t[n]=e[n]);t.target||i.log("Event target doesn't exist for type \""+t.type+'": ',t.target,", srcElement=",e.srcElement),"touchend"===e.type&&l._lastTouchPos?(t.pageX=l._lastTouchPos.pageX,t.pageY=l._lastTouchPos.pageY):e.touches&&e.touches[0]?(t.pageX=e.touches[0].pageX,t.pageY=e.touches[0].pageY,l._lastTouchPos={pageX:t.pageX,pageY:t.pageY}):(e.pageX||0===e.pageX||e.clientX||0===e.clientX)&&(t.pageX=e.pageX||e.clientX+document.body.offsetLeft,t.pageY=e.pageY||e.clientY+document.body.offsetTop),(o.indexOf("key")>-1||e.keyCode||e.charCode)&&(t.keyCode=e.keyCode||e.which,t.charCode=e.keyCode||e.charCode||e.which,t.which=e.which),(o.indexOf("mouse")>-1||o.indexOf("click")>-1||null!==e.button&&void 0!==e.button)&&(t.button="number"==typeof e.button?e.button:e.which),t.target&&3===t.target.nodeType&&3!==a.nodeType&&(t.target=t.target.parentNode),s.searchNode=t.relatedTarget||t.target;do if(s.searchNode===a){s.isInSelf=!0;break}while(s.searchNode&&(s.searchNode=s.searchNode.parentNode)&&s.searchNode!==document);if("mouseover"!==o&&"mouseout"!==o||!s.isInSelf){if(r&&r.call&&(s.handlerResponse=r.call(a,t)),t.returnValue=s.handlerResponse!==!1&&t.returnValue!==!1,t.defaultPrevented&&(t.returnValue=e.returnValue=!1,e.preventDefault&&e.preventDefault()),t.bubblingCancelled===!0||t.propagationStopped===!0||t.cancelBubble===!0){e.stopPropagation&&e.stopPropagation();try{e.cancelBubble&&e.cancelBubble.call?e.cancelBubble():e.cancelBubble=!0}catch(u){}}s.ret=t.returnValue}else s.ret=!0;return s.end()}};return r.wrappedHandler.displayName="wrappedEventHandler_"+e,r.wrappedHandler.handler=t,r.wrappedHandler.type=e,r.wrappedHandler.target=r.target,this.list.push(r),n=e=t=r=null,this.list[this.list.length-1].wrappedHandler}},l.getSubjectDescription=function(e){return(e.nodeName?i.el(e)+"":e.constructor&&e.constructor.name||e.name||e)+""},i.eventTypeMap={},l.support.webkitMultitouch&&i.extend(i.eventTypeMap,{mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"}),i.addEvent=function(e,t,n,r){var o,a;if(e){if("string"===i.typeOf(t)&&t.indexOf(",")>-1&&(t=t.replace(/\s/gm,"").split(",")),i.isArray(t)){for(o=0;t.length>o;o++)i.addEvent(e,t[o],n);return!0}if(a=t=(t+"").toLowerCase().replace(/^\s*(on)?(.*?)\s*$/gim,"$2"),"string"!=typeof t||!n||!n.call)return i.log("Attempted to add event with invalid type or handler:",{type:t,handler:n+"",subject:l.getSubjectDescription(e),useCapture:r===!0}),void 0;i.eventTypeMap.hasOwnProperty(t)&&(t=i.eventTypeMap[t]),n=l.wrappedEventListener.create(a,n,e),e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener&&(e.addEventListener(t,n,r===!0),window._eventCount=(window._eventCount||0)+1)}},i.removeEvent=function(e,t,n,r){var o,a;if(e){if("string"===i.typeOf(t)&&t.indexOf(",")>-1&&(t=t.replace(/\s/gm,"").split(",")),i.isArray(t)){for(o=0;t.length>o;o++)i.removeEvent(e,t[o],n,r);return!0}if(a=t=(t+"").toLowerCase().replace(/^\s*(on)?(.*?)\s*$/gim,"$2"),"string"!=typeof t||!n||!n.call)return i.log("Attempted to remove event with invalid type or handler:",{type:t,handler:n+"",subject:l.getSubjectDescription(e),useCapture:r===!0}),void 0;if(i.eventTypeMap.hasOwnProperty(t)&&(t=i.eventTypeMap[t]),n=l.wrappedEventListener.get(a,n,e,!0),e.detachEvent)e.detachEvent("on"+t,n);else if(e.removeEventListener)try{e.removeEventListener(t,n,r===!0),window._eventCount=(window._eventCount||0)-1}catch(s){}}},i.cancelEvent=function(e){if(e=e||window.event){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation();try{e.cancelBubble=!0}catch(t){}e.returnValue=!1}return!1},i.fireEvent=function(e){var t,n,r,o,a;if(e=e||{},document.createEventObject){e=i.extend({},e),e.type="on"+e.type.toLowerCase().replace(/^on/,"");try{t=document.createEventObject()}catch(s){a=!0}if(!a){for(r in e)if(e.hasOwnProperty(r))try{t[r]=e[r]}catch(s){}try{n=e.target.fireEvent(e.type,t),o=t.preventDefault===!0}catch(s){a=!0}}a&&l.wrappedEventListener.internalFireEvent&&l.wrappedEventListener.internalFireEvent(e)}else{t=document.createEvent("HTMLEvents"),t.initEvent(e.type.toLowerCase().replace(/^on/,""),!0,!0);for(r in e)if(e.hasOwnProperty(r))try{t[r]=e[r]}catch(s){}n=!e.target.dispatchEvent(t),o=t.preventDefault===!0}return{evt:t,preventDefault:o,rval:n}},l._nodeToIdIndex=0,l._nodeToIdList={},l.nodeToId=function(e){var t,n;return e===window?"_td_autoid_window":e===document?"_td_autoid_document":e===document.body?"_td_autoid_documentbody":(t=/\s_td_autoid_([0-9]+)\s/gm.exec(" "+e.className+" "),t&&t[1]?n=t[1]:(l._nodeToIdIndex+=1,n=l._nodeToIdIndex+"",i.addClass(e,"_td_autoid_"+n)),l.ensureNodeIdListing(e,n),n)},l.idToNode=function(e){var t,n,r=l._nodeToIdList[e+""];return"_td_autoid_window"===e?window:"_td_autoid_document"===e?document:"_td_autoid_documentbody"===e?document.body:(r&&(n=i.getElement(r),/\s_td_autoid_[0-9]+\s/gm.exec(" "+n.className+" ")||(n=null)),n||(t=i.getElement("._td_autoid_"+e),n=t&&t[0],n&&l.ensureNodeIdListing(n,e)),n||!1)},l.ensureNodeIdListing=function(e,t){var n;e.getAttribute&&(n=e.getAttribute("id"),n||(n="_td_autoid_"+t,e.setAttribute("id",n)),l._nodeToIdList[t]="#"+n)},l.removeNodeUID=function(e){var t=e.getAttribute("id");t&&t.match(/^_td_autoid_[0-9]+$/g)&&(e.removeAttribute?e.removeAttribute("id"):e.setAttribute("id","")),e.className&&(e.className=e.className.replace(/(^|\b)_td_autoid_[0-9]+(\b|$)/gim,""))},i.animationFrame=function(e){var t={manualFramerate:11};return window.mozRequestAnimationFrame?e="moz":window.webkitRequestAnimationFrame&&(e="webkit"),t.nativeSupport=!!e,t.nativeSupport?(t.getTimer=function(t){return window[e+"RequestAnimationFrame"](t)},t.cancelTimer=function(t){window[e+"CancelRequestAnimationFrame"](t)},t.getStartTime=function(){return window[e+"AnimationStartTime"]||(new Date).getTime()}):(t.getTimer=function(e){return setTimeout(function(){e((new Date).getTime()),e=null},t.manualFramerate)},t.cancelTimer=function(e){clearTimeout(e)},t.getStartTime=function(){return(new Date).getTime()}),t}(),i.setOpacity=function(e,t){1>=t&&t>0&&(t=100*t),t=Math.round(t),100>t?(e.style.opacity=parseFloat(t/100).toFixed(2),e.style.filter="alpha(opacity="+t+")"):(e.style.opacity=null,e.style.filter=null)},i.applyMsFilter=function(e,t,n){var r,o,a,s,u,c="",d="MsFilter"===l.support.filterProperty?'"':"";if(t=t.charAt(0).toUpperCase()+t.substring(1),"string"==typeof n)for(c=n,n={},s=c.replace(/\s*(,|=)\s*      /gm,"$1").split(","),a=0;s.length>a;a++)u=s[a].indexOf("="),n[s[a].substring(0,u)]=s[a].substring(u+1);else{for(a in n)n.hasOwnProperty(a)&&(c+=", "+a+"="+n[a]);c=c.replace(",","")}try{r=e.filters&&e.filters.item&&(e.filters.item("DXImageTransform.Microsoft."+t)||e.filters.item(t))}catch(p){}if(r){for(a in n)n.hasOwnProperty(a)&&"enabled"!==a&&(r[a]=n[a]);r.enabled=n.enabled?1:0}else o=e.style.MsFilter||e.style.filter||"",o+=" "+(i.nodeStyle(e,"MsFilter")||i.nodeStyle(e,"filter")||""),o&&(o=o.replace(RegExp('(^|s|))"?((progid:)?DXImageTransform.Microsoft.)?'+t+'s*?(.*?)"?s*?',"gim"),"$1")+" "),e.style[l.support.filterProperty]=o+d+"progid:DXImageTransform.Microsoft."+t+"("+c+")"+d;e.style.zoom||(e.style.zoom=1)},i.applyCss=function(n,r){var o,a,s,u,c;r=r||{};for(o in r)if(r.hasOwnProperty(o))try{a=i.getStyleAsCSS(o),a=a.replace(/^\-(moz|webkit|ms|o|vendor)\-/gim,e+"-"),a=i.getStyleAsProperty(a),"opacity"===a&&l.support.filters?(c=Math.round(100*parseFloat(r[o])),100>c?i.applyMsFilter(n,"alpha",{enabled:!0,opacity:c}):i.applyMsFilter(n,"alpha",{enabled:!1})):"--box-shadow"===a&&l.support.filters?(s=r[o].match(/\b(\#[0-9af]{3}[0-9af]{3}?|rgba?\([0-9\,\s]+\))\b/gim),s=s&&s[0]||"",u=(" "+r[o]+" ").replace(s,"").replace(/\s+/m," ").split(" ").slice(1,4),i.applyMsFilter(n,"glow",{Color:s,Strength:Math.round(u[3].replace(/[^0-9\-\.]/gim,""))})):(n.style[a]=r[o],("boxShadow"===a||"textShadow"===a||"borderRadius"===a)&&t&&(n.style[t+a]=r[o]))}catch(d){}},i.getStyleAsProperty=function(e){return"string"!=typeof e?null:(e=e.replace(/\-[a-z0-9]/gim,l.styleAsPropReplacer),e=e.replace(/^(webkit|moz|ms|o)[A-Z]/gm,l.styleAsPropVendorPrefixReplacer))},l.styleAsPropReplacer=function(e){return e.charAt(1).toUpperCase()},l.styleAsPropVendorPrefixReplacer=function(e){return e.charAt(0).toUpperCase()+e.substring(1)},i.getStyleAsCSS=function(e){return"string"==typeof e&&e.replace(/\-*([A-Z])/gm,"-$1").toLowerCase()||null},l.parseCSS=function(e){var t,n,r=/\s*([a-z\-]+)\s*:\s*([^;]*?)\s*(?:;|$)/gi;if(e)for(t={},r.lastIndex=0;n=r.exec(e);)t[i.getStyleAsProperty(n[1])]=n[2];return t},i.getCssTransitions=function(e){var t,n,r,o,a={},s={properties:"-vendor-transition-property",durations:"-vendor-transition-duration",timingFunctions:"-vendor-transition-timing-function"};for(t in s)s.hasOwnProperty(t)&&(s[t]=(i.nodeStyle(e,s[t])||"").replace(/\s/,"").split(","));for(n=0;s.properties.length>n;n++)!s.properties[n]||"null"===s.properties[n]||"all"===s.properties[n]&&s.durations[n].match(/^[0\.ms]*$/)||(r=s.durations[n]||s.durations[s.durations.length-1],o=parseFloat(r.replace(/[^\-0-9\.]/gim,""))||0,r.match(/ms$/i)||(o*=1e3),a[i.getStyleAsProperty(s.properties[n])]={duration:o,timingFunction:s.timingFunctions[n]||s.timingFunctions[s.timingFunctions.length-1]||"ease"});return a},i.setCssTransitions=function(e,t){var n,r={"-vendor-transition-property":[],"-vendor-transition-duration":[],"-vendor-transition-timing-function":[]};for(n in t)t.hasOwnProperty(n)&&t[n]&&(r["-vendor-transition-property"].push(n.toLowerCase()),r["-vendor-transition-duration"].push((t[n].duration/1e3).toFixed(3)+"s"),r["-vendor-transition-timing-function"].push(t[n].timingFunction||"ease"));for(n in r)r.hasOwnProperty(n)&&(r[n]=r[n].join(", "));i.applyCss(e,r)},i.updateCssTransitions=function(e,t){var n,r;if(t){n=i.getCssTransitions(e);for(r in t)t.hasOwnProperty(r)&&(t[r]?n[r]=t[r]:delete n[r]);i.setCssTransitions(e,n)}},i.addClass=function(e,t){var n,r;if(t){if(i.isArray(t)||(t=[t]),n=e.className||"",n.length>0){for(n=" "+n+" ",r=0;t.length>r;r++)for(;n.indexOf(" "+t[r]+" ")>-1;)n=n.replace(" "+t[r]+" "," ");n=n.substring(1)}e.className=(n+t.join(" ")).replace(/\s+/gim," ")}},i.removeClass=function(e,t){var n,r;if(t){if(i.isArray(t)||(t=[t]),n=e.className||"",n.length>0){for(n=" "+n+" ",r=0;t.length>r;r++)for(;n.indexOf(" "+t[r]+" ")>-1;)n=n.replace(" "+t[r]+" "," ");n=n.substring(1)}e.className=n.replace(/\s+/gim," ")}},i.nodeStyle=function(t,n){var r,o,i,a=(n+"").replace(/[A-Z]/g,"-$0").toLowerCase();return a=a.replace(/^\-(moz|webkit|ms|o|vendor)\-/gim,e+"-"),r=a.replace(/\-[a-z]/gim,function(e){return e.substring(1).toUpperCase()}),"opacity"===a&&l.support.filters?t.filters.alpha&&t.filters.alpha.enabled!==!1&&Math.round(t.filters.alpha.opacity)/100:(t.style&&t.style[r]?i=t.style[r]||"":t.currentStyle&&t.currentStyle[r]?i=t.currentStyle[r]||t.currentStyle[a]||"":document.defaultView&&document.defaultView.getComputedStyle?(o=document.defaultView.getComputedStyle(t,null),i=o&&(o.getPropertyValue(a)||o.getPropertyValue(r))||""):window.getComputedStyle&&(o=window.getComputedStyle(t,null),i=o&&(o.getPropertyValue(a)||o.getPropertyValue(r))||""),i)},i.htmlEntities=function(e,t){var n=["htmlEntities"];return t===!0&&n.push("stripTags"),i.text.filter(e,n)},i.log=function(){window.console&&window.console.log&&window.console.log.apply(window.console,arguments)},i.addNodeSelectionPlugin=function(e,t){i.NodeSelection.prototype.hasOwnProperty(e)||(i.NodeSelection.prototype[e]=function(){var e=t.apply(this,arguments);return null===e||void 0===e?this:e})},i.init=function(){s||(s=!0,i.forEach(l.oninit,function(e){e.call(i,i)}),i.fireEvent({target:document.body,type:"puredomready",puredom:i}))},i.addEvent(document,"DOMContentLoaded",i.init),i.addEvent(window,"load",i.init),i.addEvent(window,"unload",l.unload),function(){if(window._previousPureDom){for(var e in window._previousPureDom)window._previousPureDom.hasOwnProperty(e)&&(i[e]=window._previousPureDom[e]);window._previousPureDom=null;try{delete window._previousPureDom}catch(t){}}}(),l.puredom=function(e){return"function"===i.typeOf(e)?(s===!0?e.call(i,i):l.oninit.push(e),i):i.el.apply(i,arguments)},i.extend(i,a),i.toString=function(){return"function puredom(){}"},window.puredom=i}(),window.puredom=window.puredom||{},function(){var e={text:function(){var e=function(){return e.filter.apply(this,arguments)},t={htmlEntities:/[&<>"]/gim,ucWords:/(^|\s)[a-z]/gim,ucFirst:/^[a-z]/gim,nl2br:/\r?\n/g,numbersOnly:/[^0-9.\-]/gim,trim:/^\s*?(.*?)\s*?$/gim};return e.filter=function(t,n){var r,o,i,a,s;if("array"!==puredom.typeOf(n)&&(n=((n||"")+"").split("|")),arguments.length>2)for(r=2;arguments.length>r;r++)"array"===puredom.typeOf(arguments[r])?n=n.concat(arguments[r]):n.push(arguments[r]);for(r=0;n.length>r;r++){o=n[r],a=[t],i=o.indexOf(":"),i>-1&&(o=o.substring(0,i),a=a.concat(n[r].substring(i+1).split(",")));for(s in e)if((s+"").toLowerCase()===o.toLowerCase()){t=e[s].apply(e,a);break}}return t},e.escape=function(e){return encodeURIComponent(e)},e.unescape=function(e){return decodeURIComponent(e)},e.htmlEntities=function(e){var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};return(e+"").replace(t.htmlEntities,function(e){return n[e]})},e.ucWords=function(e){return(e+"").toLowerCase().replace(t.ucWords,function(e){return e.toUpperCase()})},e.ucFirst=function(e){return(e+"").toLowerCase().replace(t.ucFirst,function(e){return e.toUpperCase()})},e.nl2br=function(e){return(e+"").replace(t.nl2br,"<br />")},e.numbersOnly=function(e){return(e+"").replace(t.numbersOnly,"")},e.truncate=function(e,t,n,r){var o=!1,i=e+"";return e=i,t=parseInt(t,10)||80,n=n===!0||"true"===n||"byWord"===n,r=r||"...",e.length>t&&(n?(e=e.substring(0,t),i.charAt(t).match(/\s/)||(e=e.replace(/\s[^\s]*$/,""))):e=e.substring(0,t-r.length),o=!0),o&&(e+=r),e},e.trim=function(e){var t,n=/\s/;for(e=e.replace(/^\s\s*/,""),t=e.length;n.test(e.charAt(--t)););return e.slice(0,t+1)},e["default"]=function(t,n){return t=e.trim(t),t?t:n},e.dateformat=function(e,t){var n,r=puredom.i18n,o=puredom.date;return o&&o.create&&(n=o.create(e)),(!n||(n+"").indexOf("Invalid")>-1)&&(n=new Date(e),(!n||(n+"").indexOf("Invalid")>-1)&&(n=new Date,n.setTime(Math.round(e)))),t&&t.indexOf("%")>-1?o&&o.format&&(e=o.format(n,t)):r&&(e=r(n,null,null,{datetype:t||"date"})||n+""),e},e}(),parameterize:function(e,t){var n,r,o,i,a=[],s=puredom.extend({delimiter:"&",startDelimiter:"?",assignment:"=",typeHandlers:null},t);for(n in e)if(e.hasOwnProperty(n))if(r=e[n],i=this.typeOf(r),s.typeHandlers&&s.typeHandlers.hasOwnProperty(i))a.push(s.delimiter+encodeURIComponent(n)+"="+encodeURIComponent(s.typeHandlers[i](r)));else if("array"===i&&s.disableArrayParams!==!0)for(o=0;r.length>o;o++)a.push(s.delimiter+encodeURIComponent(n)+"[]="+encodeURIComponent(r[o]));else{switch(i){case"boolean":r=r?"true":"false";break;case"null":case"undefined":r="";break;case"object":r=s.useJsonForObjects!==!1?this.json(r):this.parameterize(r)}a.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return a=a.join(s.delimiter||"&"),a=(s.startDelimiter||"")+a},querystring:{parse:function(e){var t,n,r,o={};for("?"===e.substring(0,1)&&(e=e.substring(1)),t=e.split("&"),n=0;t.length>n;n++)t[n]&&(r=t[n].indexOf("="),o[decodeURIComponent(t[n].substring(0,r))]=0>r?"":decodeURIComponent(t[n].substring(r+1)));return o},stringify:function(e,t){return t=puredom.extend({startDelimiter:""},t||{}),puredom.parameterize(e,t)},build:function(){return puredom.querystring.stringify.apply(puredom.querystring,arguments)}},cookies:function(){var e={};return{set:function(t,n,r,o,i,a){var s,u="",l="";i="string"==typeof i?i:"",r&&(s=new Date,s.setTime(s.getTime()+1e3*60*60*24*r),u="; expires="+s.toGMTString()),e.hasOwnProperty(t)&&e[t].expires&&(u="; expires="+e[t].expires.toGMTString()),l=t+"="+encodeURIComponent(n)+u+"; path=/"+i.replace(/^\//,""),"string"==typeof o&&o.length>0&&(l+="; domain="+o.replace(/[\;\,]/,"")),a===!0&&(l+="; secure"),document.cookie=l,e[t]={value:n,expires:s}},get:function(t,n){if(e.hasOwnProperty(t)&&n!==!0)return e[t].value;var r,o,i=document.cookie.split(";");for(o=0;i.length>o;o++)if(r=i[o].replace(/^\s+/gim,""),0===r.indexOf(t+"="))return decodeURIComponent(r.substring(t.length+1,r.length));return null},remove:function(t){this.set(t,"",-1),delete e[t]},purge:function(){for(var t in e)e.hasOwnProperty(t)&&(this.remove(t),delete e[t])},read:function(){return this.get.apply(this,arguments)},write:function(){return this.set.apply(this,arguments)}}}(),Cache:function(){function e(){return this.constructor!==arguments.callee&&this.constructor!==e?new e:(this.data={},void 0)}return puredom.extend(e.prototype,{defaultType:"_default",purge:function(){this.data={}},get:function(e,t,n){var r;return 2===arguments.length&&(t=e,n=t,e=null),e=(e||this.defaultType)+"",t+="",r=this.data.hasOwnProperty(e)&&this.data[e][t]||!1,n?(r&&n(r),!!r):r},set:function(e,t,n){2===arguments.length&&(t=e,n=t,e=null),e=(e||this.defaultType)+"",t+="",this.data[e]||(this.data[e]={}),this.data[e][t]=n},proxySet:function(e,t,n,r){var o=this;return function(){o.set(e,t,arguments[r||0]),n&&n.apply(n,arguments)}},each:function(e){return puredom.foreach(this.data,e)}}),e}(),json:function(){var e=function(t){return"string"===puredom.typeOf(t)?e.parse(t):e.stringify(t)};return e.stringify=function(e){var t;try{t=JSON.stringify(e)}catch(n){puredom.log("puredom.json:: Stringify failed: "+n+" | "+e)}return t},e.parse=function(e){var t;if("string"==typeof e&&e.length>0)try{t=JSON.parse(e)}catch(n){puredom.log("puredom.json:: Parse failed: "+n+" | "+e)}return t},e.serialize=e.stringify,e.unserialize=e.parse,e}(),xml:{parse:function(e){var t;return window.DOMParser?t=(new window.DOMParser).parseFromString(e,"text/xml"):(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)),t}}};for(var t in e)e.hasOwnProperty(t)&&(puredom[t]=e[t]);e=null}(),window.puredom=window.puredom||{},puredom.EventEmitter=function EventEmitter(){this._eventRegistry=[]},puredom.EventEmitter.prototype.addEventListener=function(e,t){var n,r;if(e=(e+"").toLowerCase().replace(/\s+/gim,""),e.indexOf(",")>-1){for(n=e.split(","),r=0;n.length>r;r++)this.addEventListener(n[r],t);return this}return e=e.replace(/^on/,""),this._eventRegistry.push({type:e,handler:t}),this},puredom.EventEmitter.prototype.addListener=puredom.EventEmitter.prototype.addEventListener,puredom.EventEmitter.prototype.on=puredom.EventEmitter.prototype.addEventListener,puredom.EventEmitter.prototype.removeEventListener=function(e,t){var n,r,o,i;if(e=(e+"").toLowerCase().replace(/\s+/gim,""),e.indexOf(",")>-1){for(o=e.split(","),i=0;o.length>i;i++)this.removeEventListener(o[i],t);return this}for(e=e.replace(/^on/,""),n=this._eventRegistry.length;n--;)if(r=this._eventRegistry[n],r.type===e&&r.handler===t){this._eventRegistry.splice(n,1);break}return this},puredom.EventEmitter.prototype.removeListener=puredom.EventEmitter.prototype.removeEventListener,puredom.EventEmitter.prototype.fireEvent=function(e,t){var n,r,o,i=[],a=[];for(e=(e+"").toLowerCase().replace(/^on/,""),puredom.isArray(t)||(t=[t]),n=this._eventRegistry.length;n--&&(r=this._eventRegistry[n],r.type!==e||(0===a.length&&(a.falsy=a.falsey=a.truthy=!0),o=r.handler.apply(this,t),a.push(o),o===!0?a.falsy=a.falsey=!1:o===!1&&(a.truthy=!1),o!==!1)););return i=null,a},puredom.EventEmitter.prototype._fireEvent=puredom.EventEmitter.prototype.fireEvent,puredom.ControllerManager=function(e){puredom.EventEmitter.call(this),this.controllerOptions=puredom.extend({},this.controllerOptions),this._messageListeners=[],this._controllers=[],this._current=null,e&&(e.controllerOptions&&puredom.extend(this.controllerOptions,e.controllerOptions),"boolean"===puredom.typeOf(e.singular)&&(this.singular=e.singular),"boolean"===puredom.typeOf(e.allowLoadDefault)&&(this.allowLoadDefault=e.allowLoadDefault))},puredom.extend(puredom.ControllerManager.prototype,{controllerOptions:{},restoreState:function(e){this.initialized!==!0?this._initState=e:e&&e.current?this.load(e.current):this.loadDefault()},doStateUpdate:function(e,t){this.updateState&&this.updateState(e,t)},init:function(e){var t=!0;if(this.initialized!==!0){this.initialized=!0,e&&(e.controllerOptions&&puredom.extend(this.controllerOptions,e.controllerOptions),"boolean"===puredom.typeOf(e.singular)&&(this.singular=e.singular),"boolean"===puredom.typeOf(e.allowLoadDefault)&&(this.allowLoadDefault=e.allowLoadDefault),e.autoRestoreOnInit===!1&&(t=!1)),this._initState&&t&&this.restoreState(this._initState),this._initState=null;try{delete this._initState}catch(n){}this.allowLoadDefault===!1||this.current()||this.loadDefault()}},destroy:function(){var e,t;try{for(e=this.current(),e&&e.unload&&e.unload(),t=this._controllers.length;t--;)this._controllers[t].destroy&&this._controllers[t].destroy()}catch(n){}this.controllerOptions={},this._controllers=[],this._messageListeners=[],this._current=null},register:function(e,t){t=t||{},"string"===puredom.typeOf(e)?t.name=e:t=e,this._controllers.push(t),this._fireEvent("add",[this.getIdFromName(t.name)])},load:function(e,t){var n,r,o,i,a,s,u,l;if(e=(e+"").toLowerCase(),r=this.singular===!0&&this.current(),r&&r.name.toLowerCase()===e)return r.handleRepeatLoad&&r.handleRepeatLoad(t||{}),!0;if(n=this._createControllerSandbox(e),o=puredom.extend({previousController:r},this.controllerOptions||{},t||{},n.sandbox),i=e&&this.get(e)){if(puredom.extend(i,n.sandbox),this.singular===!0&&(l=this._unloadCurrent(),l===!1))return!1;if(s=i,i.load){if(a=this._fireEvent("beforeload",[i.name]),a===!1||a.falsey&&!a.truthy)return!1;u=i.load(o),null!==u&&void 0!==u&&(s=u)}if(u===!1){if(a=this._fireEvent("loadcancel",[i.name]),a===!1||a.falsey&&!a.truthy)return!1;this.singular===!0&&o.previousController?this.load(o.previousController.name,t):this.loadDefault(t)}else this._current=this.getIdFromName(e),this._fireEvent("load",[e]),this._fireEvent("change",[e]),this.doStateUpdate({current:e});return s}return!1},loadDefault:function(e){for(var t=this._controllers.length;t--;)if(this._controllers[t].isDefault===!0)return this.load(this._controllers[t].name,e);return!1},loadPrevious:function(e){this._previousController&&this.load(this._previousController,e)},none:function(){this._unloadCurrent()},reloadCurrent:function(){var e=this.current();e&&(this._unloadCurrent(),this.load(e.name,this.controllerOptions))},_unloadCurrent:function(){var e,t=this.current();if(t&&t.unload){if(e=this._fireEvent("beforeunload",[t.name]),e===!1||e.falsey&&!e.truthy)return!1;if(e=t.unload(),e===!1)return!1;this._fireEvent("unload",[t.name]),this._current=null}},get:function(e,t){e=(e+"").toLowerCase();for(var n=this._controllers.length;n--;)if(this._controllers[n].name.toLowerCase()===e)return t===!0?n:this._controllers[n];return!1},postMessage:function(e,t){var n=this.current();return n&&n.onmessage?(n.onmessage(e,t),!0):!1},onMessage:function(e,t,n){var r={type:(e+"").toLowerCase().replace(/^on/gim,""),handler:t};n&&("string"===puredom.typeOf(n)?r.controller=n.toLowerCase():n.hasOwnProperty("name")&&(r.controller=(n.name+"").toLowerCase())),this._messageListeners.push(r)},getList:function(e){var t,n,r,o=[];for(e=e||[],t=0;this._controllers.length>t;t++){for(r={name:this._controllers[t].name},n=0;e.length>n;n++)r[e[n]]=this._controllers[t][e[n]];o.push(r)}return o},getIdFromName:function(e){return this.get(e,!0)},getNameFromId:function(e){var t="number"===puredom.typeOf(e)&&this._controllers[e];return t&&t.name||!1},current:function(){return"number"===puredom.typeOf(this._current)&&this._controllers[this._current]||!1},_createControllerSandbox:function(e){var t,n,r,o=this,i=!1;return e=(e+"").toLowerCase(),r=function(e,t){var n=Error("Listener error encountered in ControllerManager#sandbox.postMessage() :: "+t.message,t.fileName,t.lineNumber);
setTimeout(function(){throw n},10)},t={controllerManager:o,manager:o,postMessage:function(t,n){var r,a;if(n=puredom.extend({},n,{controller:e,type:(t+"").replace(/^on/gim,"")}),!i){o._fireEvent("message",n),o._fireEvent(n.type,n);for(var a=0;o._messageListeners.length>a;a++)if(r=o._messageListeners[a],!r.controller||r.controller===e.toLowerCase())try{r.handler(n)}catch(s){throwListnerError(r,s)}}}},n={setName:function(t){e=(t+"").toLowerCase()},mute:function(){i=!0},unmute:function(){i=!1},destroy:function(){for(var e in this.sandbox)this.sandbox.hasOwnProperty(e)&&(this.sandbox[e]=null);delete this.sandbox,o=null},sandbox:t},setTimeout(function(){n=t=null},1),n},_postMessageFromController:function(){},_controllers:[],_messageListeners:[],_current:null}),puredom.inherits(puredom.ControllerManager,puredom.EventEmitter),window.puredom=window.puredom||{},puredom.LocalStorage=function LocalStorage(e,t,n){var r=this;"function"==typeof arguments[2]&&(t=arguments[2],n=arguments[1]),n=n||{},this.id=e,this.adapter=null,this.data={},n.adapter&&this.setAdapter(n.adapter),this.adapter||n.useBest===!1||this.useBestAdapter(),this.adapter&&n.restore!==!1?this.restore(function(){t&&t(r),r=n=null}):t&&(t(r),r=null)},puredom.LocalStorage.prototype.commitDelay=100,puredom.LocalStorage.prototype.data={},puredom.LocalStorage.prototype.setAdapter=function(e){var t,n=this.constructor.adapters,r=(e+"").toLowerCase(),o=!1,i=!1;for(t in n)if(n.hasOwnProperty(t)&&(t+"").toLowerCase()===r&&(o=!0,n[t].test(this)===!0)){i=!0,this.adapterName=e,this.adapter=n[t];break}return o?i?!0:(puredom.log('
puredom.LocalStorage :: "'+e+'" adapter test() failed: conditions for adapter use not met.'),!1):(puredom.log('puredom.LocalStorage :: Could not find "'+e+'" adapter.'),!1)},puredom.LocalStorage.prototype.getAdapter=function(){return this.adapterName},puredom.LocalStorage.prototype.useBestAdapter=function(){var e,t,n,r=this.constructor.adapters;for(n in r)r.hasOwnProperty(n)&&"none"!==n&&r[n].test(this)===!0&&(!e||(Math.round(e.rating)||0)<(Math.round(r[n].rating)||0))&&(e=r[n],t=n);return e?(this.adapterName=t,this.adapter=e,!0):(setTimeout(function(){throw"puredom.LocalStorage :: Could not find the best adapter."},1),!1)},puredom.LocalStorage.prototype.getNamespace=function(e){var t,n=this;return e+="","."===e.substring(0,1)&&(e=e.substring(1)),"."===e.substring(e.length-1)&&(e=e.substring(0,e.length-1)),t=puredom.extend(new puredom.LocalStorage.NamespacedLocalStorage,{getAdapter:function(){return n.getAdapter()},getNamespace:this.getNamespace,getValue:function(t){return n.getValue(e+"."+t)},setValue:function(t,r){return n.setValue(e+"."+t,r),this},removeKey:function(t){return n.removeKey(e+"."+t),this},purge:function(){return n.removeKey(e),this},getData:function(){return n.getValue(e)},restore:function(e){var t,r=this;return e&&(t=function(){e(r),r=t=e=null}),n.restore(t),this},commit:function(e){var t,r=this;return e&&(t=function(){e(r),r=t=e=null}),n.commit(t),this}}),puredom.extend(t,{get:t.getValue,set:t.setValue,remove:t.removeKey}),t},puredom.LocalStorage.prototype.getData=function(){return this.data},puredom.LocalStorage.prototype.getValue=function(e){var t=puredom.delve(this.data,e);return t},puredom.LocalStorage.prototype.setValue=function(e,t){var n,r=this.data,o=e.split(".");for(n=0;o.length-1>n;n++)r.hasOwnProperty(o[n])||(r[o[n]]={}),r=r[o[n]];return void 0===t||null===t?(r[o[o.length-1]]=null,delete r[o[o.length-1]]):r[o[o.length-1]]=t,this.queueCommit(),this},puredom.LocalStorage.prototype.removeKey=function(e){return this.setValue(e,void 0),this},puredom.LocalStorage.prototype.get=puredom.LocalStorage.prototype.getValue,puredom.LocalStorage.prototype.set=puredom.LocalStorage.prototype.setValue,puredom.LocalStorage.prototype.remove=puredom.LocalStorage.prototype.removeKey,puredom.LocalStorage.prototype.purge=function(){return this.data={},this.queueCommit(),this},puredom.LocalStorage.prototype.restore=function(e){var t,n,r=this;return t=this._adapterCall("load",function(t){r.data=n=t||{},e&&e(r),r=null}),t&&!n&&(this.data=t,e&&e(this)),t=n=null,this},puredom.LocalStorage.prototype.commit=function(e){var t=this;return this._commitTimer&&(clearTimeout(this._commitTimer),this._commitTimer=null),this._adapterCall("save",this.data,function(){e&&e(t),t=null}),this},puredom.LocalStorage.prototype.queueCommit=function(){var e=this;this._commitTimer||(this._commitTimer=setTimeout(function(){e.commit(),e=null},this.commitDelay))},puredom.LocalStorage.prototype._adapterCall=function(e){return this.adapter&&this.adapter[e]?this.adapter[e].apply(this.adapter,[this].concat(puredom.toArray(arguments).slice(1))):void 0},puredom.LocalStorage.NamespacedLocalStorage=function(){},puredom.LocalStorage.adapters={},puredom.LocalStorage.addAdapter=function(e,t){if(!t.save)throw'puredom.LocalStorage :: Adapter "'+e+'" attempted to register, but does not provide a save() method.';if(!t.load)throw'puredom.LocalStorage :: Adapter "'+e+'" attempted to register, but does not provide a load() method.';this.adapters[e]=t},puredom.LocalStorage.adapters.none=function(){},puredom.extend(puredom.LocalStorage.adapters.none.prototype,{defaultName:"db",rating:0,test:function(){return!1},load:function(e,t){t&&t()},save:function(e,t,n){n&&n(!1)}}),puredom.LocalStorage.addAdapter("cookie",{defaultName:"db",rating:5,test:function(){return puredom.cookies&&puredom.cookies.get&&"cookie"in document?!0:!1},load:function(e,t){var n,r=puredom.cookies.get(e.id||this.defaultName);return r&&(n=puredom.json(r)),t&&t(n),n},save:function(e,t,n){puredom.cookies.set(e.id||this.defaultName,puredom.json(t)),n&&n(!0)}}),puredom.LocalStorage.addAdapter("LocalStorage",{defaultName:"db",rating:60,test:function(){var e,t="localStorage"in window&&"function"==typeof window.localStorage.hasOwnProperty,n=puredom.json({a:"a",b:4/3,c:!0,d:null});if(t)try{e=localStorage.__test,localStorage.__test=n,localStorage.__test!==n&&(t=!1),localStorage.__test=e,void 0===e&&delete localStorage.__test}catch(r){t=!1}return t},load:function(e,t){var n,r=this._getKey(e);return localStorage.hasOwnProperty(r)&&(n=puredom.json.parse(localStorage[r])),t&&t(n),n},save:function(e,t,n){var r=this._getKey(e);return void 0===t?delete localStorage[r]:localStorage[r]=puredom.json.stringify(t),n&&n(!0),!0},_getKey:function(e){return(e.id||this.defaultName||"")+""}}),puredom.LocalStorage.addAdapter("UserData",{defaultName:"db",rating:20,test:function(){return/\bMSIE\s[1-6](\.[0-9]*)?/gim.test(navigator.userAgent+"")?!1:document.body.addBehavior!==void 0},load:function(e,t){var n,r,o=this._getKey(e),i=this._getStore(o);return i&&(n=i.getAttribute("puredomlocalstorage")),n&&(r=puredom.json.parse(n)),t&&t(r),r},save:function(e,t,n){var r=this._getKey(e),o=this._getStore(r),i="puredomlocalstorage",a=!1;return o&&"save"in o&&(void 0===t?o.removeAttribute?o.removeAttribute(i):o.setAttribute(i,""):o.setAttribute(i,puredom.json.stringify(t)),o.save(r),a=!0),n&&n(a),a},_getStore:function(e){var t;return this.stores||(this.stores={}),t=this.stores[e],t||(t=this.stores[e]=document.getElementById(e),t||(t=this.stores[e]=document.createElement("span"),t.style.position="absolute",t.style.top="-100px",t.style.left="0",t.style.behavior="url('#default#userData')",document.body.appendChild(t))),"true"!==t.getAttribute("data-tdlsud-loaded")&&(t.setAttribute("data-tdlsud-loaded","true"),t.load(e)),t},_getKey:function(e){return"ieud"+(e.id||this.defaultName||"")}}),puredom.LocalStorage.addAdapter("WebkitSQLite",{defaultName:"db",dbInfo:{name:"PureDOMLocalStorage",table:"storage",version:"1.0",displayName:"Cache, Settings and Storage",quota:2e5,minimumQuota:1e4},rating:80,test:function(){return!!window.openDatabase},load:function(e,t){var n,r=this._getDatabase(e),o=this._getKey(e),i=this.dbInfo.table;t=t||this._nullCallback,r&&(n=function(e){e.message.indexOf("no such table")>-1?t():puredom.log("WebkitSQLite Adapter Error (load): "+e.message)},r.transaction(function(e){e?e.executeSql("SELECT key,value FROM "+i+" WHERE key=?",[o],function(e,n){var r=[];if(n&&n.rows)for(var o=0;n.rows.length>o;o++)r.push(n.rows.item(o));r.length>0?t(puredom.json.parse(r[0].value)):t()}):t(!1)},n))},save:function(e,t,n){var r=this._getKey(e),o=this.dbInfo.table;n=n||this._nullCallback,this._requireDatabase(e,function(i){var a,s,u=1;i?(a=function(e){puredom.log("WebkitSQLite Adapter Error (save): "+e.message)},s=function(){u-=1,0>=u&&(n&&n(!0),n=e=t=a=s=i=null)},t=puredom.json.stringify(t),i.transaction(function(e){e.executeSql("INSERT OR REPLACE INTO "+o+" (key,value) VALUES(?,?)",[r,t],s)},a)):(n(!1),n=null)})},_getDatabase:function(){var e,t=this.dbInfo.quota;if(this._currentDb)return this._currentDb;for(;!e&&t>this.dbInfo.minimumQuota;){try{e=openDatabase(this.dbInfo.name,this.dbInfo.version,this.dbInfo.displayName,t)}catch(n){}e||(t/=10)}return e?this._currentDb=e:puredom.log("LocalStorage ERROR: WebkitSQLite Adapter failed to open database."),e||!1},_requireDatabase:function(e,t){var n=this,r=this._getDatabase(e);this.dbInfo.table,t=t||this._nullCallback,r?n._createTable(r,function(){t(r),n=t=e=r=null}):(t(r,!1),n=t=e=null)},_createTable:function(e,t){var n=this.dbInfo.table;t=t||this._nullCallback,e?e.transaction(function(r){r.executeSql("CREATE TABLE IF NOT EXISTS "+n+" (key TEXT UNIQUE, value TEXT)",[],function(){t(!0),t=e=null},function(){t(!1)})}):t(!1)},_getKey:function(e){return(e.id||this.defaultName||"")+""},_nullCallback:function(){}}),window.puredom=window.puredom||{},puredom.date={now:Date.now?function(){return Date.now()}:function(){return+new Date},create:function(e){var t;return e?(e=(e+"").replace(/^([0-9]{4})\-([0-9]{2})\-([0-9]{2})T([0-9]{2})\:([0-9]{2})\:([0-9]{2})\.[0-9]{3}Z$/,"$1/$2/$3 $4:$5:$6"),t=new Date(e)):t=new Date,t},parse:function(e,t){function n(e,t){(t===!1||t===!0)&&(s.pm=t===!0),(e||0===e)&&(s.hours=e),e=s.hours,12>s.hours&&s.pm&&(e-=12);var n=a.getDate();12===s.hours&&s.pm===!1?(0!==a.getHours()||t===!!t)&&a.setHours(0):(a.setHours(e),a.setDate(n))}t=t||"%d/%m/%Y";var r,o,i,a=new Date(0),s={},u={H:[/^[0-9]{1,2}/g,function(e){e=Math.round(e),n(e)}],I:[/^[0-9]{1,2}/g,function(e){e=Math.round(e),n(e)}],p:[/^[AP]M/gi,function(e){n(null,"pm"===e.toLowerCase())}],M:[/^[0-9]{1,2}/g,function(e){a.setMinutes(Math.round(e))}],a:[/^(Mon|Tue(s?)|Wed|Thu|Fri|Sat|Sun)/i,function(){}],A:[/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)/i,function(){}],d:[/^[0-9]{1,2}/g,function(e){s.date=Math.round(e),a.setDate(s.date)}],m:[/^[0-9]{1,2}/g,function(e){s.month=Math.round(e)-1,a.setMonth(s.month)}],B:[RegExp("^("+this.months.join("|")+")","gi"),function(e){s.month=date._getMonthIndex(e),a.setMonth(s.month)}],b:[/^(Jan|Feb|Mar|Apr|May|Jun(e?)|Jul(y?)|Aug|Sep(t?)|Oct|Nov|Dec)/gi,function(e){s.month=date._getMonthIndex(e),a.setMonth(s.month)}],y:[/^[0-9]{2}/g,function(e){e=Math.round(e)+1900,1950>e&&(e+=100),a.setFullYear(e)}],Y:[/^[0-9]{4}/g,function(e){s.year=Math.round(e),a.setFullYear(s.year)}]};for(u.l=u.I,u.e=u.d,u.P=u.p,u.h=u.b,r=0;t.length>r;r++)if("%"===t.charAt(r)){o=null," "===e.charAt(0)&&"%"===t.charAt(r)&&(e=e.substring(1));for(i in u)if(u.hasOwnProperty(i)&&t.substring(r+1,r+1+i.length)===i){o=u[i],e=e.replace(o[0],function(e){return o[1](e),""}),r+=o.length-1;break}}else e.charAt(0)===t.charAt(r)&&(e=e.substring(1));return(s.month||0===s.month)&&a.setMonth(s.month),(s.year||0===s.year)&&a.setFullYear(s.year),a},unformat:function(){return this.parse.apply(this,arguments)},format:function(e,t){if(t=t||"%d/%m/%Y",!e||e.constructor!==Date||!e.toDateString)return!1;var n=e.toDateString();if(!n||"invalid date"===n.toLowerCase())return!1;if("NaN"===n)return!1;var r=n.split(" "),o=e.getHours(),i=(o+11)%12+1,a=e.getMonth()+1,s={H:o,I:(10>i?"0":"")+i,l:i,p:o>11?"PM":"AM",P:o>11?"pm":"am",M:(10>e.getMinutes()?"0":"")+e.getMinutes(),S:(10>e.getSeconds()?"0":"")+e.getSeconds(),a:r[0],A:this.weekdays[e.getDay()],d:r[2],e:Math.round(r[2]),m:(10>a?"0":"")+a,B:this.months[Math.round(r[1])],b:r[1],h:r[1],y:r[3].substring(2),Y:r[3]};return t.replace(/%[HIlpPMSaAdemBbhyY]/gm,function(e){var t=s[e.charAt(1)+""];return t||0===t||t===!1?t:e})},_getMonthIndex:function(e){e=e.substring(0,3).toLowerCase();for(var t=0;this.months.length>t;t++)if(this.months[t].substring(0,3).toLowerCase()===e)return t;return-1},weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},puredom.FormHandler=function(e,t){var n=this;t=t||{},1===arguments.length&&"object"==typeof e&&e.constructor!==puredom.NodeSelection&&(t=e,e=t.form),puredom.EventEmitter.call(this),this._customTypes=[].concat(this._customTypes),e&&this.setForm(e),t.enhance===!0&&this.enhance(),t.data&&this.setData(t.data),t.onsubmit&&"function"==typeof t.onsubmit&&(this.on("submit",t.onsubmit),this._constructorSubmitHandler=t.onsubmit),t.oncancel&&"function"==typeof t.oncancel&&(this.on("cancel",t.oncancel),this._constructorCancelHandler=t.oncancel),t.submitButton&&"on"in t.submitButton&&(t.submitButton.on("click",this._defaultSubmitButtonHandler),this._constructorSubmitButton=t.submitButton),t.cancelButton&&t.cancelButton.on&&(t.cancelButton.on("click",function(e){return n.cancel(),puredom.cancelEvent(e)}),this._constructorCancelButton=t.cancelButton)},puredom.extend(puredom.FormHandler.prototype,{errorMessageSelector:".errorMessage, .generalForm_errorMessage",setForm:function(e){var t=this;return this.form=puredom.el(e),this.action||(this.action=this.form.attr("action")),this.method||(this.method=this.form.attr("method")),puredom.el({type:"input",attributes:{type:"submit"},css:"position:absolute; left:0; top:-999em; width:1px; height:1px; font-size:1px; visibility:hidden;"},this.form),this.form.on("submit",function(e){return t.submit(),e.cancel()}),this._kill=function(){t=null},this},enhance:function(){var e=this,t=this._getFields();return t&&t.each(function(t){var n=e._getCustomType(t);n&&n.enhance&&n.enhance(t)}),e=t=null,this},disable:function(){return this.disabled=!0,this._getFields().disable(),this},enable:function(){return this.disabled=!1,this._getFields().enable(),this},destroy:function(){var e=this,t=this._getFields();return t&&t.each(function(t){var n=e._getCustomType(t);n&&n.destroy&&n.destroy(t)}),this._constructorSubmitHandler&&this.removeEventListener("submit",this._constructorSubmitHandler),this._constructorSubmitButton&&this._constructorSubmitButton.removeEvent("click",this._defaultSubmitButtonHandler),this._constructorCancelHandler&&this.removeEventListener("cancel",this._constructorCancelHandler),this._constructorCancelButton&&this._constructorCancelButton.removeEvent("click",this._constructorCancelHandler),e=t=null,this},clear:function(){return this.setData({},!0),this.clearErrors(),this},reset:function(){return this.clear.apply(this,arguments)},submit:function(){var e,t;return this.disabled===!0?(puredom.log("Notice: Not submitting disabled form."),this):(this.clearErrors(!1),e=this.getData(),this._hasErrors=!1,t=e?this._fireEvent("submit",[e]):this._fireEvent("submitfailed",[e]),this._hasErrors||t&&t.falsy===!0||this.clearErrors(),this)},cancel:function(){return this.disabled===!0?(puredom.log("Notice: Not cancelling on disabled form."),this):(this.clearErrors(),this._fireEvent("cancel"),this)},clearErrors:function(e){this._getFields().each(function(e){e.parent().declassify("error")}),e!==!1&&(this._hasErrors=!1,this.form.query(this.errorMessageSelector).first().css({height:0,opacity:0},{tween:"fast",callback:function(e){e.hide()}}))},showFieldErrors:function(e){var t=this;this._hasErrors=!0,puredom.forEach(e,function(e,n){var r;return e=(e||"Error")+"",e=e.replace(/\{fieldnames\.([^\}]+)\}/gim,function(e,n){var r=n&&t.form.query('[name="'+n+'"]').attr("id"),o=r&&t.form.query('label[for="'+r+'"]');return o&&o.exists()?(o._nodes[0].textContent||o._nodes[0].innerText||o._nodes[0].innerHTML||"").replace(/\:\s*?$/g,""):n}),t.form.query('[name="'+n+'"]').focus().parent().classify("error"),-1===e.indexOf(" ")&&(e=puredom.i18n(e.toUpperCase())),r=t.form.query(t.errorMessageSelector).first(),r.html('<div class="formHandlerErrorMessage">'+e+"</div>"),r.css({height:Math.round(r.prop("offsetHeight"))||0,opacity:0}).show().css({height:r.children().first().height()+"px",opacity:1},{tween:"medium"}),!1}),t=null},getData:function(){var e=null,t=this,n=this._getFields();return n&&(e={},n.each(function(n){var r=n.attr("name");r&&(e[r]=t._getInputValue(n))})),t=n=null,e},setData:function(e,t){var n=[],r=this,o=this._getFields();return e&&o&&o.each(function(o){var i=o.attr("name");e.hasOwnProperty(i)?(n.push(i),r._setInputValue(o,e[i])):t===!0&&r._setInputValue(o,null)}),r=o=null,this},addCustomType:function(e){var t=this,n=this._getFields();return this._customTypes.push(e),n&&e.enhance&&n.each(function(n){var r=t._getCustomType(n);r===e&&r.enhance(n)}),t=n=null,this},_getFields:function(){var e=null;return this.form&&(e=this.form.query("input,textarea,select")),e},_setInputValue:function(e,t){var n=this._getCustomType(e);return(void 0===t||null===t)&&(t=""),n&&n.setValue?n.setValue(e,t):e.value(t),this},_getInputValue:function(e){var t=this._getCustomType(e);return t&&t.getValue?t.getValue(e):e.value()},_getCustomType:function(e){var t,n,r,o;for(e.attr("customtype")?n=(e.attr("customtype")+"").toLowerCase():e.attr("type")&&(n=(e.attr("type")+"").toLowerCase()),r=(e.prop("nodeName")+"").toLowerCase(),t=0;this._customTypes.length>t;t++)if(o=this._customTypes[t],o.types&&this._arrayIndexNC(o.types,n)>-1||o.type&&(o.type+"").toLowerCase()===n||o.nodeNames&&this._arrayIndexNC(o.nodeNames,r)>-1||o.nodeName&&(o.nodeName+"").toLowerCase()===r)return o;return!1},_arrayIndexNC:function(e,t){t=(t+"").toLowerCase();for(var n=0;e.length>n;n++)if((e[n]+"").toLowerCase()===t)return n;return-1},_defaultSubmitButtonHandler:function(e){var t=puredom.el(this);do if("form"===t.nodeName()){t.submit();break}while((t=t.parent()).exists()&&"body"!==t.nodeName());return puredom.cancelEvent(e)},_customTypes:[]}),puredom.inherits(puredom.FormHandler,puredom.EventEmitter),puredom.FormHandler.addCustomType=function(e){this.prototype._customTypes.push(e)},window.puredom=window.puredom||{},puredom.i18n=function(){var e,t={};return e=function(){return e.localize.apply(this,arguments)},e.getLang=function(e){e=e.toLowerCase().replace(/[^a-z0-9]/gim,"");for(var n in t)if(t.hasOwnProperty(n)&&(n+"").toLowerCase().replace(/[^a-z0-9]/gim,"")===e)return t[n];return!1},e.hasLang=function(t){return!!e.getLang(t)},e.setLang=function(t){return e.hasLang(t)&&(e.locale=e.lang=t),this},e.localizeDOM=function(t){t.query("[data-i18n-id]").each(function(t){var n,r,o=(t.attr("data-i18n-id")||"")+"",i=t.nodeName();if(o&&o.length>0&&(r=e.localize(o,null,""),r&&r!==o&&""!==r))switch(i){case"select":case"input":case"textarea":n=t.value(),n!==r&&t.value(r);break;default:n=t.html(),n!==r&&t.html(r)}})},e.localize=function(n,r,o,i){var a,s,u,l,c=puredom.typeOf(n),d=n;if(i=i||{},r=(r||e.lang||e.locale||"en").toUpperCase(),t.hasOwnProperty(r)?s=t[r]:r.indexOf("-")>-1&&(r=r.substring(0,r.indexOf("-")),t.hasOwnProperty(r)&&(s=t[r])),s&&null!==n&&void 0!==n)if("string"===c&&(n=n.replace(/\{([^{}]+)\}/gim,"$1")),s={labels:s.labels||{},formats:s.formats||{}},"string"!==c||n.match(/^(labels|formats)\./gim)||(n="labels."+n),"date"===c||n.constructor===Date)a=s.formats[i.datetype||"date"],u=a&&puredom.date.format(n,a)||n.toLocaleString();else if("number"===c){if(s.formats.thousands_separator)for(u="",l=n+"";l.length>0;)u=l.substring(Math.max(0,l.length-3))+u,l.length>3&&(u=s.formats.thousands_separator+u),l=l.substring(0,Math.max(0,l.length-3))}else u="boolean"===c?(n===!0?s.formats.booleanTrue:s.formats.booleanFalse)||n+"":puredom.delve(s,n+"");return u?u:null!==o&&void 0!==o?o:d},e.addLang=function(e,n){return e=(e+"").toUpperCase(),n.labels||(n={labels:n}),t[e]=n,this},puredom.addNodeSelectionPlugin("localize",function(){return e.localizeDOM(this),this}),e}(),window.puredom=window.puredom||{},puredom.NativeAPI=function(e){var t,n,r,o,i,a,s,u,l=(this.constructor===arguments.callee?this:e)||{},c={},d={},h={},f={}.constructor,m=function(){};u=function(e){l.enableLogging!==!1&&window.console&&window.console.log&&window.console.log(e)},t=function(e){var t,n,o="";for(t in e)if(null===e[t]||void 0===e[t]||e[t].constructor===Function||e[t].constructor===f||"object"===puredom.typeOf(e[t])||r(e[t])){if(e[t]&&r(e[t]))for(n=0;e[t]>n;n++)o+="&"+encodeURIComponent(t)+"[]="+encodeURIComponent(e[t])}else o+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t]);return o},n=function(e){var t,n,r;for(t=1;arguments.length>t;t++){r=arguments[t];for(n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}return e},r=function(e){return"[object Array]"===Object.prototype.toString.apply(e)},i=function i(){},l.MessageStringWithData=a=function a(e,t){this.message=t||"",n(this,e)},a.prototype.toString=a.prototype.toSource=function(){return this.message},s=function(e,t){function r(){}var o;return puredom.isArray(e.data)&&0===e.data.length&&(e.data={}),n(r.prototype,{getData:function(){return puredom.extend({},this)},getResponse:function(){return this.constructor.prototype._originalResponse},_originalResponse:t}),o=new r,n(o,e),function(){return e=o=t=r=null,arguments[0]}(o)},l.setGlobalParameter=function(e,t){void 0===t||2>arguments.length?delete d[e]:d[e]=t},l.setAuthParameter=function(e,t){void 0===t||2>arguments.length?delete h[e]:h[e]=t},c.cache={},c.getCacheKey=function(e,t){var n,r="",o=[],i=[];t=puredom.extend({},t||{}),delete t.callback,r=(e.type||"")+"||"+e.endpoint+"||";for(n in t)t.hasOwnProperty(n)&&"_cache"!==n&&"_nocache"!==n&&"_cache_deleteonly"!==n&&"callback"!==n&&i.push(n);for(i.sort(),n=0;i.length>n;n++)o.push(encodeURIComponent("o_"+i[n])+"="+encodeURIComponent(t[i[n]]+""));return r+=o.join("&")},c.getCached=function(e,t){var n=c.getCacheKey(e,t),r=c.cache.hasOwnProperty(n)?puredom.json.parse(c.cache[n]):null;return l.enableCacheLogging===!0&&console.log("CACHE: Getting ["+e.type+"] "+e.endpoint,t," --> ",r),r},c.uncache=function(e,t){var n=c.getCacheKey(e,t);l.enableCacheLogging===!0&&console.log("CACHE: Clearing ["+e.type+"] "+e.endpoint,t),delete c.cache[n]},c.cacheResponse=function(e,t,n){var r=c.getCacheKey(e,t);l.enableCacheLogging===!0&&console.log("CACHE: Storing ["+e.type+"] "+e.endpoint,t," --> ",n),c.cache[r]=puredom.json.stringify(n)},l.clearCache=function(){l.enableCacheLogging===!0&&console.log("CACHE: Purging all entries"),c.cache={}},c.validateParameters=function(e,t){var n,r,o,i,a,s,u={errors:[],message:""},l={nativeApiError:!0,clientSideError:!0};if(t.parameters){n={};for(r in t.parameters)t.parameters.hasOwnProperty(r)&&(o=t.parameters[r],i=puredom.typeOf(o),"function"===i&&o.name?(i="string",o=o.name.toLowerCase()):("regexp"===i||o.constructor===RegExp)&&(i="string",o="/"+o.source+"/"+(o.global?"g":"")+(o.ignoreCase?"i":"")+(o.multiline?"m":"")),"string"===i&&("/"===o.substring(0,1)?(o=/^\/(.*?)\/([gim]*?)$/gim.exec(o),n[r]={validate:"regex",against:RegExp(o[1]||"",o[2]||"")}):n[r]={validate:"type",against:o.toLowerCase()}))}if(n)for(r in n)n.hasOwnProperty(r)&&(i=n[r].validate,o=n[r].against,a=e[r],s=null,"regex"===i&&(o.lastIndex=0),e.hasOwnProperty(r)&&null!==a&&void 0!==a&&""!==a?"regex"!==i||o.test(a+"")?"type"===i&&o!==puredom.typeOf(a)&&(s={field:r,type:"TypeError",message:"{fieldnames."+r+"} is invalid"}):s={field:r,type:"ValidationError",message:"{fieldnames."+r+"} is invalid"}:s={field:r,type:"RequiredError",message:"{fieldnames."+r+"} is required"},s&&(s.missingParameter=s.field,u.message+=(u.message.length>0?", ":"")+s.message+" ("+s.type+")",u.errors.push(puredom.extend(s,l))));return u.failed=u.errors.length>0,u},o=function(o,i,g){l[o][i]=function(y){var v,b,w,_,S,x,C,T,O,E,N=c.validateParameters(y=y||{},g),P=g.longPolling===!0||g.allowLongPolling===!0&&y.longPolling===!0,L=y.hasOwnProperty("longPolling"),A=y.longPolling;if(N.failed)return u("api."+o+"."+i+": Errors: "+N.message,9),y.callback(!1,N.errors[0],N.errors),!1;if(v=function v(t,n){var u,d,h=t&&(t[e.statusProperty||"success"]===!0||1===t[e.statusProperty||"success"]),N=t.data||t||null,M=t.errorMessage||t.message||null,I=t[e.statusProperty||"success"];return n=n||{},n.apiMethod=g.endpoint,n.cached!==!0&&g.cache===!0&&l.enableCache===!0&&c.cacheResponse(g,y,t),g.verifyResult?h=g.verifyResult(t):(I!==!0&&I!==!1&&0!==I&&1!==I||t.constructor!==f&&!r(t))&&(h=t.constructor===f||r(t)?!0:!1,N=t,M=null),P&&h&&t.timedout===!0?(u=y,setTimeout(function(){l[o][i](u),v=u=h=t=N=M=I=null},1),!0):(N=s(N,t,n),d=new a(t,M),n.parseError===!0&&(h=!1,N=N.message||N,e.onParseError&&e.onParseError(t,n)),(g.onbeforecomplete||g.onBeforeComplete||g.precallback||m)(h,h===!0?N:d,t),h===!0?(y.onsuccess||g.onsuccess||m).call(e.endpoints[o][i],N,t):(y.onerror||g.onerror||m).call(e.endpoints[o][i],M,N,t),(y.oncomplete||y.callback||m).call(e.endpoints[o][i],h,h===!0?N:d,t),(g.oncomplete||g.onComplete||g.callback||m)(h,h===!0?N:d,t),e.onRequestCompleted&&e.onRequestCompleted(o+"."+i,N,h,O,y),v=b=w=_=S=x=C=T=O=P=L=A=E=d=null,y=p=null,void 0)},w=g.type&&g.type.toLowerCase()||"",_=g.endpoint,g.formatSuffix?_+=g.formatSuffix:e.formatSuffix&&(_+=e.formatSuffix),_.match(/^(http|https|ftp)\:/)||(_=e.root+_),E=y._cache===!1||y._nocache===!0,P){y.longPolling=null;try{delete y.longPolling}catch(M){}y.timeout=y.timeout||g.longPollingTimeout||l.longPollingTimeout||60}else if(g.cache===!0&&l.enableCache===!0)if(E){if(c.uncache(g,y),y._cache_deleteonly===!0)return}else if(x=c.getCached(g,y))return setTimeout(function(){v(x,{cached:!0,fresh:!1})},1),void 0;switch(y&&(_=_.replace(/\{([a-z0-9\-\._]+)\}/gim,function(e,t){if(y.hasOwnProperty(t)&&null!==y[t]&&void 0!==y[t]){try{delete y[t]}catch(n){y[t]=null}return y[t]}return e})),w){case"xdr":u("Cross-domain requests are not yet supported.",7);break;case"post":C={};for(x in y)if(y.hasOwnProperty(x)&&"[object Function]"===Object.prototype.toString.apply(y[x])){C[x]=y[x],y[x]=null;try{delete y[x]}catch(I){}}O=T=n({},d,g.auth===!0?h:{},g.defaultParameters||{},y);for(x in C)C.hasOwnProperty(x)&&(y[x]=C[x]);C=null,puredom.net.request({url:_,type:"POST",post:T,callback:function(e,t){e&&t?v(t):this.jsonParseError===!0?v({status:!1,message:"Unable to parse server response",rawdata:this.responseText},{parseError:!0,clientsideErrorDetection:!0}):v({status:!1,message:"Connection error "+this.status},{clientsideErrorDetection:!0})},contentTypeOverride:"application/json"});break;case"jsonp":O=n({},d,g.auth===!0?h:{},g.defaultParameters||{},y),_+=t(O),(-1===_.indexOf("?")||_.indexOf("?")>_.indexOf("&"))&&(_=_.replace("&","?")),b=puredom.net.jsonp(_,v);break;default:O=n({},d,g.auth===!0?h:{},g.defaultParameters||{},y),_+=t(O),(-1===_.indexOf("?")||_.indexOf("?")>_.indexOf("&"))&&(_=_.replace("&","?")),puredom.net.request({url:_,type:"GET",callback:function(e,t){e&&t?v(t):this.jsonParseError===!0?v({status:!1,message:"Unable to parse server response",rawdata:this.responseText},{parseError:!0,clientsideErrorDetection:!0}):v({status:!1,message:"Connection error "+this.status},{clientsideErrorDetection:!0})},contentTypeOverride:"application/json"})}return L&&(y.longPolling=A),b}},l.constructor==={}.constructor&&(l=function(e){function t(){}for(var n in e)e.hasOwnProperty(n)&&(t.prototype[n]=e[n]);return new t}(l));var g,y;for(g in e.endpoints)if(e.endpoints.hasOwnProperty(g)){l[g]=new i;for(y in e.endpoints[g])e.endpoints[g].hasOwnProperty(y)&&o(g,y,e.endpoints[g][y])}if(l.globalParameters)for(var v in l.globalParameters)l.globalParameters.hasOwnProperty(v)&&l.setGlobalParameter(v,l.globalParameters[v]);return this.constructor!==arguments.callee?l:void 0},window.puredom=window.puredom||{},puredom.net={HttpRequest:function HttpRequest(e){puredom.extend(this,e)},get:function(e,t,n){return this.request(puredom.extend({url:e,type:"GET",callback:t},n||{}))},post:function(e,t,n,r){return this.request(puredom.extend({url:e,type:"POST",post:t,callback:n},r||{}))},multiLoad:function(e,t){if(!e)return!1;var n,r,o=-1,i=e.length,a=[],s=0,u=0;return n=function(i,l){if(i&&l){var c=e[o],d=l;c.process&&c.process.call&&(d=c.process(d),void 0===d&&(d=l)),a.push(d),t&&t(s>0,a,s,u),n=r=e=a=t=null}else r()},r=function(){o+=1;var a=e[o],s="string"==typeof a?{url:a}:a;s?http.request(s,n):i>o?r():t(!1,null,null,"No resources were available.")},r(),!0},request:function(e){var t,n,r;return e.url?(r=this,e=e||{},t=new puredom.net.HttpRequest({url:e.url,type:e.type||(e.post?"POST":"GET"),callback:e.callback||arguments[1]||function(){},post:e.post,headers:e.headers}),e.contentTypeOverride&&(t.contentTypeOverride=e.contentTypeOverride,delete e.contentTypeOverride),this.createXHR(t.url,function(e){if(t.request=e.xhr,t._xdrFrame=e.frame,e=null,t.post&&"object"===puredom.typeOf(t.post)&&(t.post=puredom.parameterize(t.post),"?"===t.post.substring(0,1)&&(t.post=t.post.substring(1))),t.request.onreadystatechange=function(){var e,n;if(t.request._orig&&(t.request.readyState=t.request._orig.readyState,t.request.status=t.request._orig.status,t.request.responseText=t.request._orig.responseText,t.request.responseXML=t.request._orig.responseXML),4===t.request.readyState){if(t._xdrFrame&&setTimeout(function(){r._freeIframes.push(t._xdrFrame),r=null},100),t.status=t.request.status,t.contentTypeOverride)e=t.contentTypeOverride.toLowerCase();else{try{e=t.request.getResponseHeader("Content-Type").toLowerCase()}catch(o){}e=e||""}if(t.responseText=t.request.responseText,e.match(/\/(json|javascript)$/gm)||"json"===e){t.responseType="json",n=t.responseJSON=null;try{n=t.responseJSON=JSON.parse(t.request.responseText.replace(/^[^\[\{]*(.*)[^\[\{]*$/g,"$1"))}catch(i){t.jsonParseError=!0}}else"application/xml"===e||"xml"===e?(t.responseType="xml",n=t.responseXML=t.request.responseXML):(t.responseType="text",n=t.responseText);t.callback&&t.callback(400>t.request.status,n)}},t.request.open(t.type,t.url,t.async!==!1),t.request.setRequestHeader("content-type","application/x-www-form-urlencoded"),t.request.setRequestHeader("x-requested-with","XMLHttpRequest"),t.headers)for(n in t.headers)if(t.headers.hasOwnProperty(n))try{t.request.setRequestHeader(n,t.headers[n])}catch(o){}t.request.send(t.post||null)}),t):!1},jsonp:function(){var e=function(){return e.get.apply(e,arguments)},t=0;return e.get=function(e,n,r){var o,i,a,s;return"function"===puredom.typeOf(n)&&(r&&"object"===puredom.typeOf(r)&&(s=r),r=n,s&&(n=s)),n=n||{},n.callback&&!r&&(r=n.callback),n.timeout||(n.timeout=10),(e=e||n.url)?(n.params&&puredom.parameterize&&(e+=(e.indexOf("?")>-1?"&":"?")+puredom.querystring.stringify(n.params)),t+=1,n.callback=a="puredom_net_jsonp_"+t,function(){window[n.callback]=function(e){var t;if(r){try{r(e)}catch(n){t=n}r=null}if(i&&(i.stop(),i=null),t)throw t}}(),e.indexOf("{!callback}")>-1?e=e.replace("{!callback}",a):e+=(0>e.indexOf("?")?"?":"&")+encodeURIComponent(n.callbackParam||"callback")+"="+encodeURIComponent(a),this._head||(s=document.getElementsByTagName("head"),this._head=s&&s[0]),o=puredom.el({type:"script",attributes:{src:e,async:"async",type:"text/javascript"},parent:this._head||document.body}),i={id:a,stop:function(){i._timer&&clearTimeout(i._timer),window[a]=null;try{delete window[a]}catch(e){}r=null,o.attr("src","about:blank").remove(),a=i=o=null}},n.timeout&&n.timeout>0&&(i._timer=setTimeout(function(){r&&r({_requestTimedOut:!0,_jsonpTimedout:!0,success:!1,result:!1}),i&&i.stop()},Math.round(1e3*n.timeout))),e=n=s=null,i):!1},e}(),_freeIframes:[],_xhrIndex:0,createXHR:function(e,t){var n,r,o,i,a,s,u=!1,l=this;if(this._xhrIndex+=1,e&&(n=/^[a-z]{3,9}\:\/\/([^\/\?#]+)/gim.exec(e),n=n&&n[1],n&&n!==location.hostname)){for(u=!0,document.domain=location.hostname.match(/[^.]+\.[^.]+$/gim)[0],s=0;this._freeIframes.length>s;s++)if(this._freeIframes[s].getAttribute("data-xhr-domain")===n){r=this._freeIframes.splice(s,1)[0];break}r?t(l._createXHRObj(r.contentWindow,r)):(r=document.createElement("iframe"),r.style.cssText="position:absolute; left:0; top:-1000px; width:1px; height:1px; border:none; overflow:hidden;",i=function(){var e,s;
try{e=r.contentWindow,s=e&&e.document&&e.document.domain===document.domain&&e.document.body}catch(u){s=null}s&&s.innerHTML&&(clearInterval(a),r.onload=r.onerror=null,t(l._createXHRObj(e,r)),l=t=o=r=n=i=a=null)},r.onload=r.onerror=i,r.setAttribute("src",location.protocol+"//"+n+"/xd_receiver.html"),r.setAttribute("role","presentation"),r.setAttribute("tabindex","-1"),r.setAttribute("data-xhr-domain",n),document.body.appendChild(r),a=setInterval(i,50))}return u?void 0:(o=this._createXHRObj(),t(o),o)},_createXHRObj:function(e,t){var n;e=e||window;try{n=new e.XMLHttpRequest}catch(r){try{n=new e.ActiveXObject("Msxml2.XMLHTTP")}catch(o){n=new e.ActiveXObject("Microsoft.XMLHTTP")}}return{xhr:n,frame:t}}},function(){this.puredom=this.puredom||{}}(),puredom.Notifier=function(e){var t=this;puredom.EventEmitter.call(this),this._data={counter:0,list:{}},this._notificationClickHandler=function(e){return t._performAction(puredom.el(this).attr("data-notification-id"),"notificationclick",e),puredom.cancelEvent(e)},e=e||{},e.parent&&this._createBase(e.parent)},puredom.extend(puredom.Notifier.prototype,{show:function(e){var t;return e?(this._data.counter+=1,t={id:this._data.counter+"",timeout:e.timeout||this.timeout},this._data.list[t.id]=t,t.base=this._build(t.id,e),this._show(t.id),t.timeout&&this._resetTimeout(t.id),t):!1},_createBase:function(e){this.notifications_base?(this.notifications_base.remove(),this.notifications_base.appendTo(e)):this.notifications_base=puredom.el({className:"notifications_base"},e)},_build:function(e,t){var n,r;return n=puredom.el({className:"notification",css:"height:0; opacity:0;",attributes:{"data-notification-id":e},children:[{className:"notification_top"},{className:"notification_inner",children:[{className:"notification_inner_top"},{className:"notification_closeButton",children:[{className:"label",innerHTML:this.closeButtonLabel||"&times;"}]},{className:"notification_message",children:[{className:"label",innerHTML:t.message||t.text}]},{className:"notification_inner_bottom"}]},{className:"notification_bottom"}],onclick:this._notificationClickHandler},this.notifications_base),r=t.icon||t.image,r!==!1&&this.defaultIcon&&(r=this.defaultIcon),r&&puredom.el({type:"img",className:"notification_message",attributes:{src:t.icon||t.image||this.defaultIcon}},n.query(".notification_inner")),t.userDismiss===!1&&n.query(".notification_closeButton").hide(!0),n},_show:function(e){var t=this.get(e);t&&t.base.css({opacity:0}).css({opacity:1,height:t.base.children().height()},{tween:this.showTween||"medium"})},_hide:function(e){var t=this.get(e);t&&t.base.css({opacity:0,height:0},{tween:this.hideTween||"medium",callback:function(){t.base.remove(),t=null}})},_resetTimeout:function(e){var t=this.get(e),n=this;t&&(t._hideTimer&&clearTimeout(t._hideTimer),t.timeout&&(t._hideTimer=setTimeout(function(){n._hide(e),n=e=null},1e3*t.timeout)),t=null)},get:function(e){return e&&this._data.list.hasOwnProperty(e+"")&&this._data.list[e+""]||!1},_performAction:function(e,t,n){var r,o=this.get(e);if(puredom.isArray(n)||(n=[n]),t&&o&&(n=[e].concat(n),r=this._fireEvent(t,n),r!==!1))switch(t.toLowerCase()){case"notificationclick":case"notificationclicked":this._hide(e)}},timeout:15,_data:{counter:0,list:{}}}),puredom.inherits(puredom.Notifier,puredom.EventEmitter),puredom.RouteManager=function(e){var t=this;puredom.ControllerManager.call(this),this.allowTemplateFallback=e.allowTemplateFallback===!0||e.useBest===!0,this.allowPartialUrlFallback=e.allowPartialUrlFallback===!0,this._controllerUpdateState=function(e){t.doStateUpdate(t._routerState,e)}},puredom.extend(puredom.RouteManager.prototype,{singular:!0,rewrites:[],restoreState:function(e){this.initialized!==!0?this._initState=e:e&&e.current_url?this.route(e.current_url):this.routeDefault()},doStateUpdate:function(e,t){var n,r;this._routerState=e&&puredom.extend({},e),e&&e.current&&(n=this.get(e.current),delete e.current,r=this._templateUrl(n.customUrl||n.urlTemplate||n.name,n),"/"!==r.substring(0,1)&&(r="/"+r),e.current_url=r),this.updateState(e,t)},register:function(e,t){return t.updateState=this._controllerUpdateState,puredom.ControllerManager.prototype.register.call(this,e,t)},route:function(e){var t,n,r,o,i,a,s,u=this._controllers,l=e.replace(/^[#!\/]+/gm,"").replace(/#.+$/gm,"");for(n=0;u.length>n;n++){if(t=u[n],o=t.customUrl||t.urlTemplate||t.name,i={},this._checkUrlMatch(o,e,i)===!0){a={};for(r in i)"params."===(r+"").substring(0,7)&&(a[r.substring(7)]=i[r]);return this.load(t.name,{params:a})}this.allowPartialUrlFallback===!0&&this._checkUrlMatch(o,e,i,{partial:!0})===!0&&(s=t.name)}return s?this.load(s,{params:{}}):this.allowTemplateFallback!==!1&&this.get(l)?this.load(l,{params:{}}):(this._fireEvent("routingError",[{attemptedFallback:this.allowTemplateFallback!==!1,url:e,type:"RoutingError"}]),!1)},routeDefault:function(){return this.loadDefault()},_templateUrl:function(e,t){return t=t||this.current(),puredom.template(e,t,!1)},_checkUrlMatch:function(e,t,n,r){var o,i=this._getUrlSegments(e),a=this._getUrlSegments(t),s=/^\{([^{}]+)\}$/gim,u=!0;if(r=r||{},n=n||{},r.partial===!0)for(o=i.length;o--;)i[o].match(s)&&i.splice(o,1);if(a.length===i.length)for(o=0;a.length>o;o++){if(a[o]!==i[o]&&!i[o].match(s)){u=!1;break}n[i[o].replace(s,"$1")]=a[o]}else u=!1;return u},_getUrlSegments:function(e){var t,n=(e+"").split("/");for(t=n.length;t--;)0===n[t].replace(/(\s|\/)/gm,"").length&&n.splice(t,1);return n}}),puredom.inherits(puredom.RouteManager,puredom.ControllerManager),puredom.StateManager=function(e,t){var n;if(t||"object"!==puredom.typeOf(e)||(t=e,e=t.adapter||t.adaptor),t=t||{},t.adaptor&&(t.adapter=t.adaptor,t.adapter=null),e=e||t.adapter,this.initialized=!1,this.objects={},this.states={},e&&this.adapters[e]||(e=this.defaultAdapter),this.adapter=puredom.extend({},this.adapters.none,this.adapters[e],{stateManager:this}),this.adapter.init&&this.adapter.init(puredom.extend({},t.adapterOptions||t.adaptorOptions||{},{adapter:e}),this),t.state&&(this.adapter.setState(t.state),this.restoreFromState(t.state)),t.objects)for(n in t.objects)this.addObject(n,t.objects[n])},puredom.extend(puredom.StateManager.prototype,{saveQueueDelay:50,replaceTimeout:0,adapters:{session:{getState:function(e){e(this.state)},setState:function(e,t){this.state=e,t(!0)},state:{}},base:{getState:function(e){throw Error("StateManager:: getState method not defined for the specified adapter.")},setState:function(e,t){throw Error("StateManager:: setState method not defined for the specified adapter.")}}},objects:{},states:{},initialized:!1,init:function(e){if(this.initialized===!0)return this;if(e=e||{},e.state&&(this.adapter.setState(e.state),this.restoreFromState(e.state)),e.objects)for(x in e.objects)this.addObject(x,e.objects[x]);return this.initialized=!0,e.restore!==!1&&this.restore(),this.startPolling(),this},destroy:function(){this.stopPolling(),this.adapter.stateManager=null,this.adapter=this.states=this.objects=null,this.initialized=!1},emptyFunc:function(){},startPolling:function(){this.adapter&&this.adapter.startPolling&&this.adapter.startPolling()},stopPolling:function(){this.adapter&&this.adapter.stopPolling&&this.adapter.stopPolling()},addObject:function(e,t,n){var r;if(this.objects.hasOwnProperty(e))throw Error("Cannot add duplicate object ID '
"+e+"' to state list.");return r=this,this.objects[e]=t,this.states[e]={},t.updateState=function(t,n,o){r.setObjState(e,puredom.extend({},r.getObjState(e),t),n||r.emptyFunc,o)},t.setState=function(t,n,o){r.setObjState(e,t,n||r.emptyFunc,o)},t.getState=function(){return r.getObjState(e)},t.destroyStateManagerConnections=function(){this.updateState=this.setState=this.getState=this.destroyStateManagerConnections=r.emptyFunc,r=null},t=null,this.initialized===!0&&this.restoreOne(e,function(){}),this},addObj:function(){return this.addObject.apply(this,arguments)},removeObject:function(e,t){if(this.objects.hasOwnProperty(e)){this.objects[e].destroyStateManagerConnections&&this.objects[e].destroyStateManagerConnections(),this.objects[e]=null,this.states[e]=null;try{delete this.objects[e],delete this.states[e]}catch(n){}this.save(t)}},removeObj:function(){return this.removeObject.apply(this,arguments)},restoreFromState:function(e,t,n){var r,o,i=this,a=0,s=0;r=t?function(){s+=1,s>=a&&(n!==!1?i.save(function(){t&&t(!0),i=t=null}):(t&&t(!0),i=t=null))}:function(){},"string"===puredom.typeOf(e)&&(e=puredom.json(e));for(o in this.objects)this.objects[o].restoreState&&(a+=1,this.objects[o].restoreState(e[o]),r());return 0===a&&(t&&t(!1),i=t=null),this},disableSave:function(){this._saveDisabled=!0},enableSave:function(){this._saveDisabled=!1},restoreOne:function(e,t){var n=this;this.adapter.getState(function(r){n.objects[e]&&n.objects[e].restoreState&&n.objects[e].restoreState(r[e]),n=null,t&&t()})},restore:function(e){var t=this;return this._restoring=!0,this.adapter.getState(function(n){var r=n&&puredom.json(n);t._lastSaveTime=(new Date).getTime(),r&&r!==t.currentState?(t.currentState=r,t.restoreFromState(n,function(){t._restoring=!1,e&&e(),t=null},!1)):t.save(function(){t._restoring=!1,t=null,e&&e(!1),e=null})}),this},save:function(e,t,n){var r=this;return n=n||{},this.initialized!==!0||this._saveDisabled||(t===!0?(this.currentSaveTimer&&(clearTimeout(this.currentSaveTimer),delete this.currentSaveTimer),this.getStateObj(function(t){var o=puredom.json(t),i=(new Date).getTime(),a=i-(r._lastSaveTime||i);r._lastSaveTime=i,o!==r.currentState?(r.currentState=o,r.adapter.setState(t,function(t){e&&"function"===puredom.typeOf(e)&&e(!!t),r=e=n=null},{replace:n.replace===!0||r.replaceTimeout&&0!==a&&r.replaceTimeout>a})):e&&"function"===puredom.typeOf(e)&&(e(),r=e=n=null)})):this.currentSaveTimer||(this.currentSaveTimer=setTimeout(function(){r.save(e,!0,n),delete r.currentSaveTimer,r=e=n=null},this.saveQueueDelay))),this},setObjState:function(e,t,n){var r;n&&"object"==typeof n&&(r=n),this.states[e]=t,this.save(n,r&&r.now===!0||n===!0,r)},getObjState:function(e,t){this.states[e]=t},getStateObj:function(e){return e&&e(this.states),this},emptyFunc:function(){}}),puredom.StateManager.prototype.adapters.url={init:function(e){var t=this,n=this._doPoll,r=this._doPollTimed;this._doPoll=function(){return n.apply(t,arguments)},this._doPollTimed=function(){return r.apply(t,arguments)},this.usePreceedingSlash=e.usePreceedingSlash!==!1,this.urlMapping=e.urlMapping,this.urlHistory=[],e.html5UrlPrefix&&(this.html5UrlPrefix=e.html5UrlPrefix),e.beforeParse&&(this.beforeParse=e.beforeParse),e.beforeCommit&&(this.beforeCommit=e.beforeCommit)},getPrefix:function(){return this.html5UrlPrefix?"function"==typeof this.html5UrlPrefix?this.html5UrlPrefix():this.html5UrlPrefix:""},usePreceedingSlash:!0,pollInterval:30,urlHistory:[],startPolling:function(){this.polling||(this.polling=!0,this.getCurrentUrl(!0),this.pollingTimer=setTimeout(this._doPollTimed,this.getPollInterval()),puredom.addEvent(window,"hashchange,pushstate,popstate",this._doPoll))},stopPolling:function(){clearTimeout(this.pollingTimer),puredom.removeEvent(window,"hashchange,pushstate,popstate",this._doPoll),this.polling=!1},getPollInterval:function(){return this.stateManager&&(this.stateManager.pollInterval||this.stateManager.adapterPollInterval)||this.pollInterval},_doPoll:function(){var e=this,t=e.currentUrl||null,n=e.getCurrentUrl(!0)||null;n!==t&&((new Date).getTime(),e.stateManager.disableSave(),e.stateManager.restore(function(){e.stateManager.enableSave(),e=t=n=null}))},_doPollTimed:function(){this._doPoll.apply(this,arguments),this.pollingTimer&&clearTimeout(this.pollingTimer),this.polling&&(this.pollingTimer=setTimeout(this._doPollTimed,this.getPollInterval()))},normalizeUrl:function(e){return(this.usePreceedingSlash?"/":"")+e.replace(/^[#!\/]+/gm,"").replace(/#.+$/gm,"")},getCurrentUrl:function(e){var t=location.href+"",n=t.indexOf("#!"),r=t.indexOf(location.host);return n>-1?(t=t.substring(n+2),window.history.replaceState&&window.history.replaceState(null,null,t)):t=r>-1?t.substring(r+location.host.length):null,(t||""===t)&&(t=this.normalizeUrl(t)),e===!0&&(t!==this.currentUrl&&this.urlHistory[this.urlHistory.length-1]!==t&&this.urlHistory.push(t),this.currentUrl=t),t||!1},setCurrentUrl:function(e,t){var n,r,o,i=this.getCurrentUrl(!1);e=this.normalizeUrl(e),n="#!"+e,o=this.urlHistory.length>0&&this.urlHistory[this.urlHistory.length-1]===e,e===i||o||(window.history.pushState?("/"!==e.substring(0,1)&&(e="/"+e),r=this.getPrefix().replace(/\/$/,""),e=r+e,this.beforeCommit&&(e=this.beforeCommit(e)||e),t===!0&&window.history.replaceState?window.history.replaceState(null,null,e):window.history.pushState(null,null,e)):window.location.href!==n&&(t===!0&&window.location.replace?window.location.replace(n):window.location.href=n),this.getCurrentUrl(!0))},setState:function(e,t,n){var r,o=location.href+"";o.indexOf("#!"),this.getCurrentUrl(!1),n=n||{},r=this.stringify(e),this.setCurrentUrl(r,n.replace===!0),t(!0)},getState:function(e){var t,n=this.getCurrentUrl(!0);n?(t=this.parse(n),e(t)):e(!1)},parse:function(e){var t,n,r,o,i,a,s,u,l,c,d,p,h,f,m,g={};for(f=function(e){return!!e.match(/^\-?[0-9]+$/)},m=function(e){if("undefined"===e)e=void 0;else if("null"===e)e=null;else if(e.match(/^\-?[0-9]+$/))e=parseInt(e,10);else if(e.match(/^\-?[0-9\.]+$/))e=parseFloat(e);else if(e.match(/^(true|false)$/i))e="true"===e.toLowerCase();else if(e.match(/^\[[a-z0-9%_\-]+(,[a-z0-9%_\-]+)*\]$/)){e=e.substring(1,e.length-1).split(",");for(var t=0;e.length>t;t++)e[t]=m(e[t])}return e},this.beforeParse&&(t=this.beforeParse(e),(t||""===t)&&(e=t)),n=this.getPrefix(),n&&e.substring(0,n.length)===n&&(e=e.substring(n.length)),this.usePreceedingSlash!==!1&&"/"===e.charAt(0)&&(e=e.substring(1)),h=e.indexOf("?"),-1===h&&-1===e.indexOf("=")&&(h=e.length),this.urlMapping&&h>0&&(p=e.substring(0,h),e=encodeURIComponent(this.urlMapping)+"="+encodeURIComponent(p)+"&"+e.substring(h+1)),"?"===e.substring(0,1)&&(e=e.substring(1)),r=e.split("&"),o=0;r.length>o;o++){if(a=r[o].indexOf("="),s=decodeURIComponent(r[o].substring(0,a)),l=decodeURIComponent(r[o].substring(a+1)),u=decodeURIComponent(l),s.match(/\[\]$/g))for(s=s.substring(0,s.length-2),u=u.split(","),i=0;u.length>i;i++)u[i]=decodeURIComponent(u[i]);else u=m(u);for(s=s.split("."),d=g,i=0;s.length>i;i++)c=s[i],f(c)&&(c=parseInt(c.replace(/[^0-9]/,""),10)),s.length-1>i?(d[c]||(d[c]=f(s[i+1])?[]:{}),d=d[c]):d[c]=u}return g},stringify:function(e){var n,r="",o="",i=this.urlMapping;return n=function(e,a){var s,u;switch(puredom.typeOf(e)){case"object":for(s in e)e.hasOwnProperty(s)&&n(e[s],(a?a+".":"")+s);break;case"array":for(u=!0,s=0;e.length>s;s++)t=puredom.typeOf(e[s]),"string"!==t&&"number"!==t&&"boolean"!==t&&(u=!1);if(u)for(r+="&"+encodeURIComponent(a)+"[]=",s=0;e.length>s;s++)r+=(s>0?",":"")+encodeURIComponent(e[s]);else for(s=0;e.length>s;s++)n(e[s],(a?a+".":"")+s);break;case"null":case"undefined":case"function":break;default:i&&a===i?o=e:r+="&"+encodeURIComponent(a)+"="+encodeURIComponent(e)}},n(e),n=e=null,"&"===r.substring(0,1)&&(r="?"+r.substring(1)),this.usePreceedingSlash!==!1&&"/"!==o.charAt(0)&&(o="/"+o),o+r}},puredom.StateManager.prototype.adapters.urlbasic={setState:function(e,t){var n=location.href+"",r=n.indexOf("#!");r>-1&&(n=n.substring(0,r)),n+="#!"+this.serializeState(e),location.href=n,t(!0)},getState:function(e){var t,n=location.href+"",r=n.indexOf("#!");r>-1?(n=n.substring(r+2),t=puredom.json.parse(n),e(t)):e(!1)},serializeState:function(e){return puredom.json.stringify(e)}},puredom.StateManager.prototype.adapters.cookies={init:function(e){e=e||{},this.dbName=e.dbName||"state"},setState:function(e,t){puredom.cookies.set(this.dbName,puredom.json.stringify(e)),t(!0)},getState:function(e){var t=puredom.cookies.get(this.dbName);t=puredom.json.parse(t),e(t)},serializeState:function(e){return puredom.json.stringify(e)}},puredom.TestSuite=function(){puredom.EventEmitter.call(this),this.list={}},puredom.extend(puredom.TestSuite.prototype,{add:function(e,t){var n=this._getIdFromName(e);this.list[n]={name:e,test:t,results:[]}},run:function(e,t,n){var r,o,i,a,s,u=this.get(e),l=u&&u.test,c=null;l&&l.run&&(o=function(e,t){if("status"===e&&(s=t),"result"===e)c=t===!0;else if(n)return n(e,t),!1},r=function(e){l.cleanup&&l.cleanup(a),e?s=e:a.results&&(s=a.results),e&&u.results.push({time:(new Date).getTime(),results:e}),t&&t(s,c),i.destroy(),r=o=s=u=l=i=a=t=n=null},i=this._createSandboxController(u),i.messageHandler=o,i.onfinish=r,a=i.getSandbox(),l.prepare&&l.prepare(a),results=l.run(a))},get:function(e){var t=this._getIdFromName(e);return this.list.hasOwnProperty(t)&&this.list[t]||!1},getList:function(){var e,t=[];for(e in this.list)this.list.hasOwnProperty(e)&&this.list[e].name&&t.push(this.list[e].name);return t},_getIdFromName:function(e){return(e+"").toLowerCase().replace(/[^a-z0-9_]+/gm,"")},_createSandboxController:function(e){var t=this,n={},r={};return n.getSandbox=function(){return r},n.destroy=function(){r=n=t=e=null},r.status=r.setStatus=function(r){var o;n.messageHandler&&(o=n.messageHandler.call(t,"status",r)),o!==!1&&puredom.log('tests["'+e.name+'"] >> '+r)},r.log=r.postMessage=function(r){var o;n.messageHandler&&(o=n.messageHandler.call(t,"log",r)),o!==!1&&puredom.log('tests["'+e.name+'"] >> '+r)},r.done=r.finish=r.complete=function(e){n.onfinish&&setTimeout(function(){n.messageHandler&&n.messageHandler.call(t,"status",e),n.onfinish&&n.onfinish.call(t,e),e=null},1)},r.pass=function(e){n.messageHandler&&n.messageHandler.call(t,"result",!0),n.onpass&&n.onpass.call(t,!0),r.done(e)},r.fail=function(e){n.messageHandler&&n.messageHandler.call(t,"result",!1),n.onfail&&n.onfail.call(t,fail),r.done(e)},n},list:{}}),puredom.ViewManager=function(e){puredom.EventEmitter.call(this),this._htmlViews={},this._postProcessors=[],e&&e.init===!0&&this.init(e)},puredom.extend(puredom.ViewManager.prototype,{viewDomPrefix:"views_",_regs:{node:/<(\/?)([a-z][a-z0-9]*)(\s+[a-z0-9._-]+=(['"]).*?\4)*\s*\/?>/gim},init:function(e){e=e||{},this.initialized!==!0&&(this.initialized=!0,e.viewDomPrefix&&(this.viewDomPrefix=e.viewDomPrefix),this.cacheBase=puredom.el({className:"views_cacheBase",css:"display: none;"},e.cacheBase||document.body))},destroy:function(){this.initialized===!0&&(this.initialized=!1)},log:function(e,t){this.logging===!0&&puredom.log("ViewManager :: "+e,t)},addView:function(e,t){"string"===puredom.typeOf(t)?this._htmlViews[(e+"").toLowerCase()]=t:this.load(e,!1)},exists:function(e){return this._htmlViews.hasOwnProperty((e+"").toLowerCase())},template:function(e,t,n,r){var o,i;return e=(e+"").toLowerCase(),t=t||{},this._htmlViews.hasOwnProperty(e)&&(i=this._htmlViews[e],o=this.load(puredom.template(i,t),n,r,null,!1)),o||!1},load:function(e,t,n,r,o){var i,a,s;return e&&(s=o!==!1&&this.getCachedView(e),s?(this.log('Using cached view for "'+e+'".'),i=this.buildCachedView(s)):"string"===puredom.typeOf(e)&&(this._regs.node.lastIndex=0,this._regs.node.test(e)?(this.log('Parsing HTML view for "'+e+'".'),i=this.buildViewFromHTML(e),e=null):this._htmlViews.hasOwnProperty((e+"").toLowerCase())?(this.log('Loading stored HTML view for "'+e+'".'),i=this.buildViewFromHTML(this._htmlViews[(e+"").toLowerCase()])):(this.log('Looking up in-DOM view for "'+e+'"...'),a=this.getViewFromDOM(e),a&&a.exists()?(this.log("Lookup succeeded, view found."),i=this.buildViewFromDOM(a,r!==!1)):this.log("Lookup failed, no matching view found.")))),i&&i.exists()?(e&&(this.log('View "'+e+'" loaded.'),o!==!1&&this.cacheView(e,i,r!==!1),i.classify("views_"+e)),i.parent().exists()||(n&&n.parent().insertBefore(i,n),!n&&t&&i.insertInto(t)),this.postProcessView(i),i):(puredom.log('ViewManager :: Unable to find view "'+e+'".'),!1)},unload:function(e){e&&e.destroy&&e.destroy()},_postProcessors:[],addViewPostProcessor:function(e){var t,n=!1;for(t=this._postProcessors.length;t--;)if(this._postProcessors[t]===e){n=!0;break}n||this._postProcessors.push(e)},postProcessView:function(e){for(var t=0;this._postProcessors.length>t;t++)this._postProcessors[t](e)},getViewFromDOM:function(e,t){var n;return t=t||this.viewDomPrefix,t.match(/[a-z0-9_-]/i)&&(t="#"+t),e=e.replace(/[\s.\/\\]/gim,""),this.log('Lookup: prefix="'+t+'", def="'+e+'"'),t&&(n=puredom.el(t+e),n&&n.exists())?n:!1},buildViewFromHTML:function(e){var t=puredom.el({innerHTML:e});return t=t.children(),t.remove(),t.exists()&&t||!1},buildViewFromObj:function(e){var t;return puredom.isArray(e)?(t=tinyom.el({children:e}),t=t.children()):(e=puredom.extend({},e,{parent:null,insertBefore:null}),t=puredom.el(e)),t.exists()&&t||!1},buildViewFromDOM:function(e,t){var n;return e=puredom.el(e),t===!1?e:(n=e.clone(!0),n.exists()&&n||!1)},_htmlViews:{},cacheBase:null,getCachedView:function(e){var t=this.cacheBase.query('[data-viewname="'+e+'"]').first();return t.exists()&&t||!1},buildCachedView:function(e){var t;return"string"===puredom.typeOf(e)&&(e=this.getCachedView(e)),t=e&&this.buildViewFromDOM(e),t&&t.attr("id",this.viewDomPrefix+t.attr("data-viewname")),t},cacheView:function(e,t,n){return!1}}),puredom.inherits(puredom.ViewManager,puredom.EventEmitter);
pending…
Light
/*! puredom light 03-03-2013 */
this.JSON||(this.JSON={}),function(){function f(e){return 10>e?"0"+e:e}function quote(e){return escapable.lastIndex=0,escapable.test(e)?'"'+e.replace(escapable,function(e){var t=meta[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function str(e,t){var n,r,o,i,a,s=gap,u=t[e];switch(u&&"object"==typeof u&&"function"==typeof u.toJSON&&(u=u.toJSON(e)),"function"==typeof rep&&(u=rep.call(t,e,u)),typeof u){case"string":return quote(u);case"number":return isFinite(u)?u+"":"null";case"boolean":case"null":return u+"";case"object":if(!u)return"null";if(gap+=indent,a=[],"[object Array]"===Object.prototype.toString.apply(u)){for(i=u.length,n=0;i>n;n+=1)a[n]=str(n,u)||"null";return o=0===a.length?"[]":gap?"[\n"+gap+a.join(",\n"+gap)+"\n"+s+"]":"["+a.join(",")+"]",gap=s,o}if(rep&&"object"==typeof rep)for(i=rep.length,n=0;i>n;n+=1)r=rep[n],"string"==typeof r&&(o=str(r,u),o&&a.push(quote(r)+(gap?": ":":")+o));else for(r in u)Object.hasOwnProperty.call(u,r)&&(o=str(r,u),o&&a.push(quote(r)+(gap?": ":":")+o));return o=0===a.length?"{}":gap?"{\n"+gap+a.join(",\n"+gap)+"\n"+s+"}":"{"+a.join(",")+"}",gap=s,o}}"function"!=typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","       ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;"function"!=typeof JSON.stringify&&(JSON.stringify=function(e,t,n){var r;if(gap="",indent="","number"==typeof n)for(r=0;n>r;r+=1)indent+=" ";else"string"==typeof n&&(indent=n);if(rep=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return str("",{"":e})}),"function"!=typeof JSON.parse&&(JSON.parse=function(text,reviver){function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(e,t,o)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")})}(),"function"!=typeof Date.now&&(Date.now=function(){return(new Date).getTime()}),window._previousPureDom=window.puredom,function(){var e,t,n,o,i=function(){return l.puredom.apply(l,arguments)},a={version:"1.1.5",baseAnimationInterval:20,allowCssTransitions:!0,easingMethods:{ease:function(e){return(Math.sin(e*Math.PI-Math.PI/2)+1)/2},"ease-in-out":function(e){return(Math.sin(e*Math.PI-Math.PI/2)+1)/2},"ease-in-out-2":function(e){return this["ease-in-out"](this["ease-in-out"](e))},"ease-in-out-3":function(e){return this["ease-in-out"](this["ease-in-out"](this["ease-in-out"](e)))}}},s=!1,u=a.constructor,l={oninit:[],animationTimes:{fast:150,medium:450,slow:1e3},animationTimeScale:1,registeredEventCount:0,html5elements:"abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video".split(" "),support:{html5:!0,querySelectorAll:!!("querySelectorAll"in document),filters:!1,webkitMultitouch:!!("createTouch"in document)},regex:{css3AutoPrefix:/([\s\;\/\*])(box\-shadow|text\-shadow|border\-radius)\:([^\;]*)(\;|$)/gim,css3VendorPrefix:/\b\-(moz|webkit|ms|o|vendor)\-/gim,templateFieldToken:/([^\\]?)\{([a-z0-9A-Z\$_\.]+)(\|[^\}]*?)?\}/gm,parseObjectNameFromString:/^\[object ([^\s]+)\]$/gim,autoDetectHTMLContent:/(<[a-z]|&[a-z#0-9]{1,10};)/gim,whitespaceCharacters:/\s/,getNumericCSSValue:/[^0-9\.\-]/gm,getCSSValueUnits:/([a-z]+|%)$/,getNonIntegerCharsSigned:/[^0-9\.\-]/gm,getUpperCaseAlphaChars:/[A-Z]/gm},noop:function(){}};if(navigator.userAgent.match(/\b(iOS|Android|WebOS|iPhone|iPod|iPad)\b/gim)&&(i.allowCssTransitions=!1,i.baseAnimationInterval=50,l.animationTimeScale=1.5),navigator.userAgent.match(/\b(webkit|applewebkit|chrome|chromium|khtml)\b/gim)?(e="-webkit",t="Webkit"):navigator.userAgent.match(/\bopera\b/gim)?(e="-o",t="O"):navigator.userAgent.match(/\bgecko\b/gim)?(e="-moz",t="Moz"):navigator.userAgent.match(/\bmsie\s*?(8|9|[1-9][0-9]+)\b/gim)?(e="-ms",t="Ms"):navigator.userAgent.match(/\bmsie\s*?[4-8]\b/gim)&&(l.support.filters=!0,l.support.filterProperty="filter"),function(e,t){if(e=document.createElement("div"),e.innerHTML="<nav></nav>",l.support.html5=e.childNodes.length>0,!l.support.html5){for(l.html5frag=document.createDocumentFragment(),t=l.html5elements.length;t--;)l.html5frag.createElement(l.html5elements[t]);l.html5div=document.createElement("div"),l.html5frag.appendChild(l.html5div)}}(),o=function(){var e=document.body;return n=void 0!==e.textContent&&"textContent"||e.innerText&&"innerText"||"innerHTML",o=null,n},i.extend=function(e){var t,n,r;for(e=e||{},t=1;arguments.length>t;t++)if(r=arguments[t]){for(n in r)r.hasOwnProperty(n)&&(e[n]=r[n]);"function"==typeof r.toString&&r.toString!==Object.prototype.toString&&(e.toString=r.toString)}return e},i.mixin=function(e){var t,n,r;for(e=e||{},t=1;arguments.length>t;t++)if(r=arguments[t])for(n in r)r.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=r[n]);return e},i.strip=function(e,t){for(var n in e)(t===!0||e.hasOwnProperty(n))&&(e[n]=null)},i.delve=function(e,t,n,r){var o=0;for(t=t.split("."),n===!0&&t.splice(0,1);t.length>o&&e&&e.hasOwnProperty(t[o]);)e=e[t[o]],o+=1;return o>=t.length||r===!0&&o>0?e:void 0},i.flattenObj=function(e,t,n,r){var o,a;t=t||"",n=n||0,r=r||{};for(o in e)e.hasOwnProperty(o)&&(a=t?t+"_"+o:o,i.isScalar(e[o])?r[a]=e[o]:i.flattenObj(e[o],a,n+1,r));return n?void 0:r},i.template=function(e,t,n){var r,o;return n!==!1&&i.i18n&&(o=i.i18n),r=(e+"").replace(l.regex.templateFieldToken,function(e,n,r,a){var s;return"\\"!==n&&r?(s=i.delve(t,r),s?(o&&(s=o(s)||s),a&&"|"===a.substring(0,1)&&(s=i.text.filter(s,a.substring(1))),e=n+s):e=n):e=n,e})},i.inherits=function(e,t){function n(){}n.prototype=t.prototype;var r=e.prototype;e.prototype=new n,puredom.extend(e.prototype,r),e.prototype.constructor=e,e.prototype.__super=t},i.typeOf=function(e){if(void 0===e)return"undefined";if(null===e)return"null";if(e){if(e.constructor===u)return"object";if(i.isArray(e))return"array"}return Object.prototype.toString.call(e).replace(l.regex.parseObjectNameFromString,"$1").toLowerCase()},i.isScalar=function(e){var t=i.typeOf(e);return"undefined"===t||"null"===t||"number"===t||"string"===t||"boolean"===t?!0:!1},!Array.prototype.indexOf||0!==[i].indexOf(i))try{Array.prototype.indexOf=function(e){for(var t=0;this.length>t;t++)if(this[t]===e)return t;return-1}}catch(c){}i.toArray=function(e){var t,n=[],r=e&&e.length;if(r||0===r)for(t=r;t--;)n[t]=e[t];else for(t=0;;){if(e.hasOwnProperty&&e.hasOwnProperty(t))n.push(e[t]);else{if(!e.hasOwnProperty||!e.hasOwnProperty(t+""))break;n.push(e[t+""])}t+=1}return n},i.isArray=Array.isArray?function(e){return Array.isArray(e)}:function(e){return"[object Array]"===Object.prototype.toString.call(e)},i.hasOwnProperty=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.forEach=function(e,t){var n,r;if(i.isArray(e))for(n=0;e.length>n&&(r=t(e[n],n),r!==!1);n++);else for(n in e)if(e.hasOwnProperty(n)&&(r=t(e[n],n),r===!1))break;return e},i.foreach=i.forEach,i.setInnerHTML=function(e,t){var n,r;if(l.support.html5)e.innerHTML=t||"";else{for(e.innerHTML="",l.html5div.innerHTML=t||"",n=document.createDocumentFragment(),r=l.html5div.childNodes.length;r--;)n.appendChild(l.html5div.firstChild);e.appendChild(n)}},i.createElement=function(t,n){var r,o,a,s,u;t=t||{},r=document.createElement(t.type||"div"),n=n||t.parent,t.insertBefore&&t.insertBefore.constructor===i.NodeSelection&&(t.insertBefore=t.insertBefore._nodes[0]),!n&&t.insertBefore&&(n=t.insertBefore.parentNode);for(o in t)if(i.hasOwnProperty(t,o))if("on"===(o+"").substring(0,2).toLowerCase())i.addEvent(r,o.substring(2),t[o]);else if("css"===o||"cssText"===o)e?(t[o]=t[o].replace(l.regex.css3AutoPrefix,"$1"+e+"-$2:$3; $2:$3;"),t[o]=t[o].replace(l.regex.css3VendorPrefix,"-"+e+"-"),r.style.cssText=t[o]):r.style.cssText=t[o];else if("html"===o||"innerHTML"===o)i.setInnerHTML(r,t[o]);else if("attributes"===o)for(a in t[o])i.hasOwnProperty(t[o],a)&&r.setAttribute(a,t[o][a]);else if("parent"!==o&&"children"!==o&&"insertBefore"!==o&&"type"!==o&&"children"!==o&&"html"!==o&&"innerHTML"!==o)if(document.all)try{r[o]=t[o]}catch(c){i.log(o)}else r[o]=t[o];if(n){if(t.insertBefore)try{n.insertBefore(r,t.insertBefore),u=!0}catch(c){u=!1}u||n.appendChild(r)}if(!n&&r.parentNode&&11===r.parentNode.nodeType&&"removeNode"in r,t.children&&i.isArray(t.children)){for(s=document.createDocumentFragment(),o=0;t.children.length>o;o++)i.createElement(t.children[o],s);r.appendChild(s)}return r},i.NodeSelection=function d(e){var t;if(this._results=[],this._nodes=[],this._animations=[],e)if(i.isArray(e))for(t=0;e.length>t;t++)e[t]&&(e[t].constructor===d&&e[t]._nodes?this._nodes.push(e[t]._nodes[0]):this._nodes.push(e[t]));else this._nodes.push(e)},i.extend(i.NodeSelection.prototype,{_results:[],_nodes:[],_animations:[],describe:function(){var e=[];return this.each(function(t){var n="<"+t.nodeName(),r=t.prop("id"),o=t.prop("className");r&&(n+=' id="'+r+'"'),o&&(n+=' class="'+o+'"'),n+=">",n+=1===t._nodes[0].childNodes.length&&3===t._nodes[0].childNodes[0].nodeType?t.text().replace(/(\r|\n)/gim,decodeURIComponent("%E2%86%A9")).replace(/\t/gim,decodeURIComponent("%E2%86%92")):"["+t.children().count()+" children]",n+="</"+t.nodeName()+">",e.push(n)}),e},toString:function(){return this.describe().join(", ")},toSource:function(){return this._nodes},getResult:function(e){return e=Math.round(e)||0,this._results[this._results.length-e-1]},pushResult:function(e){return this._results.push(e),this},each:function(e){return this._each(e,!0)},_each:function(e,t,n){var r,o,a,s,u=this._nodes.slice(0,this._nodes.length);for(r=0;u.length>r&&(o=r,n===!0&&(o=u.length-o-1),a=u[o],t===!0&&(a=new i.NodeSelection(a)),s=e.call(this,a,o),s!==!1);r++);return this},wait:function(e,t){var n=this;return t&&setTimeout(function(){t.apply(n),n=t=null},Math.abs(e)),this},nodeName:function(){var e=this._nodes[0],t=e&&e.nodeName&&e.nodeName.toLowerCase();return e===window?"#window":t?t:null},uuid:function(){return this._nodes[0]&&l.nodeToId(this._nodes[0])||null},text:function(e){return 0===arguments.length?this._nodes[0]&&this._nodes[0][n||o()]||"":(e+="",this._each(function(t){t[n||o()]=e}),this)},html:function(e,t){return 0===arguments.length?this._nodes[0]&&this._nodes[0].innerHTML||"":(e+="",l.regex.autoDetectHTMLContent.lastIndex=0,l.regex.autoDetectHTMLContent.test(e)&&t!==!0?this._each(function(t){i.setInnerHTML(t,e)}):this._each(function(t){t[n||o()]=e}),this)},css:function(e,t,n){var r,o=this;if(t=t||{},("string"==typeof t||"number"==typeof t)&&(t={tween:t}),!n&&t.callback&&(n=t.callback),n&&n.call||(n=l.noop),r=i.typeOf(t.tween),"string"==typeof e&&(e=l.parseCSS(e)),"string"===r&&"none"!==t.tween||"number"===r&&t.tween>0){var a,s,u=(t.tween+"").replace(l.regex.whitespaceCharacters,"").split(","),c=0,d=0;s=function(e){d+=1,d>=c&&(s=null,n&&n.call(o,o),o=n=e=null)};for(a in e)e.hasOwnProperty(a)&&(c+=1,this.animateCss(a,e[a],u[0],u[1],s))}else this._each(function(t){i.applyCss(t,e)}),n?setTimeout(function(){n.call(o,o),o=n=null},1):o=null;return this},show:function(){return this.css({display:"",visibility:"visible"}),this._each(function(e){("none"===e.style.display||"none"===i.nodeStyle(e,"display"))&&(e.style.display="block")}),this},hide:function(e){return this.css(e===!1?{visibility:"hidden"}:{display:"none"})},fadeIn:function(e,t){var n=parseFloat(this.getStyle("opacity")||"0")||0,r=1;return("none"===this.getStyle("display")||"hidden"===this.getStyle("visibility"))&&(this.getStyle("opacity")&&n>0&&1>n&&(r=n),n=0,this.css({opacity:0})),"function"===i.typeOf(e)&&(t=e,e=arguments[1]),n>=1||0==e||e===!1?(this.css({opacity:r}).show(),t&&t.call&&setTimeout(t,0),this):(this.css({opacity:r},{tween:e||"medium",callback:function(n){t&&t(n),e=t=null}}).show(),this)},fadeOut:function(e,t,n){var r=parseFloat(this.getStyle("opacity")||"1")||1;return"function"===i.typeOf(e)&&(t=e,e=arguments[1]),"boolean"===i.typeOf(t)&&(n=t,t=null,"function"===i.typeOf(arguments[2])&&(t=arguments[2])),0>=r||"none"===this.getStyle("display")||"hidden"===this.getStyle("visibility")||0===e||e===!1?(this.css({opacity:0}).hide(n),setTimeout(t,0),this):(this.css({opacity:0},{tween:e||"medium",callback:function(o){o.hide(n).css({opacity:r}),t&&t(o),e=t=null}}),this)},animateCSS:function(){var e,n,r,o;return e=function(e,t,n,r,o){var a,s,u,c=[],d=[];return e=e.toLowerCase(),"auto"!==t?(a=parseFloat((t+"").replace(l.regex.getNumericCSSValue,""))||0,u="string"===i.typeOf(t)&&t.match(l.regex.getCSSValueUnits),s=u&&u[0]||"px","opacity"===e&&(s="")):s="opacity"===e?"":"px",this._each(function(n,r){var o,u,p,h,f={};c[r]=parseFloat((i.nodeStyle(n,e)+"").replace(l.regex.getNonIntegerCharsSigned,""))||0,"auto"===t||""===t?(h=n.style.visibility||"",f[e]=t,f.visibility="hidden",i.applyCss(n,f),o=i.nodeStyle(n,e),(o===t||o.indexOf("px")<o.length-3)&&(p=e.substring(0,1).toUpperCase()+e.substring(1).toLowerCase(),o=n["offset"+p]+"px"),u="string"===i.typeOf(o)&&o.match(l.regex.getCSSValueUnits),d[r]={_actualTarget:t,numericTargetValue:parseFloat((o+"").replace(l.regex.getNumericCSSValue,""))||0,units:"opacity"===e?"":u&&u[0]||"px"},setTimeout(function(){n.style.visibility=h,n=null},51),f=o=u=null):d[r]={numericTargetValue:a,units:s}}),this.animate(function(t){this._each(function(n,r){var o,a={},s=t*(d[r].numericTargetValue-c[r])+c[r],u=d[r].units;"px"===u?s=Math.round(s):(o=parseFloat(s),s=0===o%1?Math.round(o):o.toFixed(2)),a[e]=s+u,i.applyCss(n,a)})},n,r,function(t){t._each(function(t,n){var r={};d[n]._actualTarget&&(r[e]=d[n]._actualTarget,i.applyCss(t,r))}),o.apply(t,arguments)})},n=function(e,t,n,r,o){var a=this._createAnimationObj(function(){},n,r,o),s=this,u={},c={};e=i.getStyleAsProperty(e),"number"===i.typeOf(t)&&"opacity"!==(e+"").toLowerCase()&&(t+="px"),u[i.getStyleAsCSS(e)]={duration:a.duration,timingFunction:a.easing},c[e]=t,setTimeout(function(){s._each(function(e){i.updateCssTransitions(e,u),i.applyCss(e,c),l.incrementAnimationCount(e)}),a._cb=function(){if(a){var t={};t[e]=null,s._each(function(e){i.updateCssTransitions(e,t),l.decrementAnimationCount(e)}),a.callback&&a.callback.call(s,s);for(var n in a)if(a.hasOwnProperty(n))try{delete a[n]}catch(r){}}a=c=o=s=null},setTimeout(a._cb,(parseInt(a.duration,10)||0)+20)},10)},o=function(){return r=void 0!==document.body.style[t+"Transition"]||void 0!==document.body.style.transition},function(){var t=!1;return"boolean"!==i.typeOf(r)&&o(),i.allowCssTransitions===!1&&t!==!0||!r?e.apply(this,arguments):n.apply(this,arguments),this}}(),animate:function(e){if(e){var t,n=this,r=this._createAnimationObj.apply(this,arguments);this._each(function(e){l.incrementAnimationCount(e)}),t=function(e){if(r.frameTime=e,r.position=r.frameTime-r.start,r.fraction=r.position/r.duration,r.position>=r.duration?(r.fraction=1,r.position=r.duration):r.easingMethod&&(r.fraction=r.easingMethod.call(i.easingMethods,r.fraction,r)),r.animator.call(n,r.fraction,r),1===r.fraction){for(var o=n._animations.length;o--;)if(n._animations[o]===r){n._animations.splice(o,1);break}r.callback&&setTimeout(function(){n._each(function(e){l.decrementAnimationCount(e)}),r.callback.call(n,n,r),n=r=null},10)}else r.timer=i.animationFrame.getTimer(t,i.baseAnimationInterval||10)},i.animationFrame.getTimer(t,i.baseAnimationInterval||10),this._animations.push(r)}return this},_createAnimationObj:function(e,t,n,r){var o={animator:e,duration:t,easing:"string"===i.typeOf(n)?n:"ease",callback:r,start:i.animationFrame.getStartTime(),frameTime:null};if("string"===i.typeOf(o.duration))switch(o.duration.toLowerCase()){case"long":case"slow":o.duration=l.animationTimes.slow;break;case"short":case"fast":o.duration=l.animationTimes.fast;break;default:o.duration=parseInt(o.duration)||l.animationTimes.medium}else o.duration=Math.round(o.duration)||l.animationTimes.medium;return l.animationTimeScale&&(o.duration*=l.animationTimeScale),o.easing&&i.easingMethods.hasOwnProperty(o.easing)?o.easingMethod=i.easingMethods[o.easing]:o.easing=null,o},classify:function(){var e,t,n=[],r="{*^de^*}"===arguments[0]?"removeClass":"addClass";for(e=0;arguments.length>e;e++)if(i.isArray(arguments[e]))for(t=0;arguments[e].length>t;t++)n.push(arguments[e][t]);else n.push(arguments[e]);return this._each(function(e){i[r](e,n)}),this},declassify:function(){var e=["{*^de^*}"].concat(Array.prototype.slice.call(arguments,0));return this.classify.apply(this,e)},hasClass:function(e,t){var n=t!==!0;return this._each(function(r){var o=(" "+r.className+" ").indexOf(" "+e+" ")>-1;t===!0?o&&(n=!0):o||(n=!1)}),n},setOpacity:function(e){return this._each(function(t){i.setOpacity(t,e)}),this},sumOf:function(e){var t=0,n=Array.prototype.slice.call(arguments,1);return this.constructor.prototype.hasOwnProperty(e)&&this._each(function(r){r=new i.NodeSelection(r),t+=r[e].apply(r,n)}),t},height:function(e,t){var n,r,o=0;return"object"!==i.typeOf(e)||t||(t=e,e=null),t=t||{},e||0===e?(e+="","auto"===e?n="":(r=/^([\-0-9\.]+)(.*?)$/.exec(e),e=Math.round(r&&r[1]||e)||0,n=r&&r[2]||"px"),this.css({height:e+n}),this):(this._each(function(e){o+=parseInt(e.offsetHeight,10)||0,t.border!==!0&&(o-=parseInt((i.nodeStyle(e,"border-top-width")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o-=parseInt((i.nodeStyle(e,"border-bottom-width")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0),t.margin===!0&&(o+=parseInt((i.nodeStyle(e,"margin-top")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o+=parseInt((i.nodeStyle(e,"margin-bottom")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0),t.padding===!1&&(o-=parseInt((i.nodeStyle(e,"padding-top")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o-=parseInt((i.nodeStyle(e,"padding-bottom")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0)}),o)},width:function(e,t){var n,r,o=0;return"object"!==i.typeOf(e)||t||(t=e,e=null),t=t||{},e||0===e?(e+="","auto"===e?n="":(r=/^([\-0-9\.]+)(.*?)$/.exec(e),e=r&&r[1]||e,n=r&&r[2]||"px"),this.css({width:e+n}),this):(this._each(function(e){o+=parseInt(e.offsetWidth,10)||0,t.border!==!0&&(o-=parseInt((i.nodeStyle(e,"border-left-width")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o-=parseInt((i.nodeStyle(e,"border-right-width")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0),t.margin===!0&&(o+=parseInt((i.nodeStyle(e,"margin-left")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o+=parseInt((i.nodeStyle(e,"margin-right")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0),t.padding===!1&&(o-=parseInt((i.nodeStyle(e,"padding-left")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0,o-=parseInt((i.nodeStyle(e,"padding-right")+"").replace(l.regex.getNonIntegerCharsSigned,""),10)||0)}),o)},x:function(e){var t=this._nodes[0],n=null;if(t&&(n=t.offsetLeft,e===!0))for(;(t=t.parentNode)&&t!==document;)n+=parseFloat(t.offsetLeft)||0;return n},y:function(e){var t=this._nodes[0],n=null;if(t&&(n=t.offsetTop,e===!0))for(;(t=t.parentNode)&&t!==document;)n+=parseFloat(t.offsetTop)||0;return n},position:function(e,t,n,r){var o;return r=r||"px",1>arguments.length||1===arguments.length&&arguments[0]===!0?{x:this.x(arguments[0]===!0),y:this.y(arguments[0]===!0)}:(o={},"number"===puredom.typeOf(e)?o.left=e+r:"string"===puredom.typeOf(e)&&(o.left=e),"number"===puredom.typeOf(t)?o.top=t+r:"string"===puredom.typeOf(t)&&(o.top=t),this.css(o,n),this)},scrollLeft:function(e){return e||0===e?("number"!==i.typeOf(e)&&(e=Math.round((e+"").replace(l.regex.getNonIntegerCharsSigned,""))),this._each(function(t){t.scrollLeft=e}),void 0):this._nodes&&this._nodes[0]&&this._nodes[0].scrollLeft||0},scrollTop:function(e){return e||0===e?("number"!==i.typeOf(e)&&(e=Math.round((e+"").replace(l.regex.getNonIntegerCharsSigned,""))),this._each(function(t){t.scrollTop=e}),void 0):this._nodes&&this._nodes[0]&&this._nodes[0].scrollTop||0},focus:function(){return this._each(function(e){e.focus&&e.focus()}),this},blur:function(){return this._each(function(e){e.blur&&e.blur()}),this},selectAll:function(){this._each(function(e){e.SelectAll&&e.SelectAll(),e.select&&e.select(),e.selectionStart&&e.hasOwnProperty("value")&&(e.selectionStart=0,e.selectionEnd=e.value.length)})},getStyle:function(e,t){var n=[];return this._each(function(t){n.push(i.nodeStyle(t,e)||null)}),t===!1?(this.pushResult(n),this):1>=n.length?n[0]:n},value:function(e,t){if(t=t||{},null!==e&&void 0!==e&&arguments.length>0)return this._each(function(n){var r=(n.nodeName+"").toLowerCase(),o=(n.getAttribute("type")||"").toLowerCase();"input"!==r||"checkbox"!==o&&"radio"!==o||(n.checked=!!e),n.value=e,t.fireChange!==!1&&i.fireEvent({type:"change",target:n,value:e})}),this;var n=[];return this._each(function(e){var t,r=(e.nodeName+"").toLowerCase(),o=(e.getAttribute("type")||"").toLowerCase();"input"!==r||"checkbox"!==o&&"radio"!==o?"select"===r?(t=e.multiselect||e.multiSelect?[]:null,i.el(e).query("option")._each(function(e){(e.selected||e.checked)&&(i.isArray(t)?t.push(e.value):t=e.value)}),n.push(t)):n.push(e.value):n.push(!!e.checked)}),2>n.length?n[0]||null:n},attr:function(e,t,n){var r,o,a=[];if(0===arguments.length){for(a={},r=this._nodes[0].attributes.length;r--;)o=this._nodes[0].attributes[r],o.specified&&(a[o.name||o.nodeName]=o.value||o.nodeValue);return a}if(arguments.length>1){if("object"===i.typeOf(e)){for(r in e)"string"==typeof r&&e.hasOwnProperty(r)&&this.attr(a,e[r]);return this}return this._each(function(n){try{n.setAttribute(e,t),!n.removeAttribute||null!==t&&void 0!==t||n.removeAttribute(e)}catch(r){}})}return this._each(function(t){var n=t.getAttribute(e);"string"!=typeof n&&(n=null),a.push(n)}),n===!1?(this.pushResult(a),this):1>=a.length?a[0]:a},prop:function(e,t,n){var r=[];return arguments.length>1?this._each(function(n){if(n[e]=t,void 0===t)try{delete n[e]}catch(r){}}):(this._each(function(t){var n;try{n=t[e]}catch(o){console.log("NodeSelection.prop("+e+") :: Access Error",o)}r.push(n||null)}),n===!1?(this.pushResult(r),this):1>=r.length?r[0]:r)},enable:function(){return this.attr("disabled",null),this.declassify("_puredom_disabled"),this},disable:function(){return this.attr("disabled","disabled"),this.classify("_puredom_disabled"),this},enabled:function(e){return e===!0||e===!1?(this[e?"enable":"disable"](),this):"disabled"!==this.attr("disabled")&&this.prop("disabled")!==!0&&!this.hasClass("_puredom_disabled")},addEvent:function(e,t,n){return this._each(function(r){i.addEvent(r,e,t,n)}),this},removeEvent:function(e,t,n){return this._each(function(r){i.removeEvent(r,e,t,n)}),this},fireEvent:function(e,t){return this._each(function(n){i.fireEvent(i.extend({},t||{},{type:e,target:n}))}),this},_removeAllEvents:function(e){var t;return this._each(function(e){l.wrappedEventListener.destroyObjHandlers(e,!0)}),t=this.children(),e===!0&&t.count()>0&&t._removeAllEvents(!0),t=e=null,this},appendChild:function(e){if(e&&this._nodes.length>0)if(e.constructor===this.constructor){var t=this._nodes[0];e._each(function(e){t.appendChild(e)})}else this._nodes[0].appendChild(e);return this},insertBefore:function(e,t){if(e&&this._nodes.length>0){if(t&&t.constructor===this.constructor&&(t=t._nodes[0]),!t||t.parentNode!==this._nodes[0])return this.appendChild(e);if(e.constructor===this.constructor){var n=this._nodes[0];e._each(function(e){n.insertBefore(e,t)},null,!0)}else this._nodes[0].insertBefore(e,t)}return this},insertInto:function(e){var t;return e&&this.count()>0&&(e.constructor===this.constructor&&(e=e._nodes[0]),1===this.count()?e.appendChild(this._nodes[0]):(t=document.createDocumentFragment(),this._each(function(e){t.appendChild(e)},null,!0),l.support.filters!==!0&&e.appendChild(t))),this},remove:function(){return this.fireEvent("remove"),this._each(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this},destroy:function(){return this.remove(),this.fireEvent("destroy"),this._removeAllEvents(!0),this._nodes.splice(0,this._nodes.length),this},query:function(e,t){var n=[];return this._nodes.length>0&&this._each(function(r){var o=i.getElement(e,puredom.extend({},t||{},{within:r}));i.isArray(o)&&o.length>0&&(n=n.concat(o))}),new i.NodeSelection(n)},clone:function(e,t){var n=[];return t===!0&&(t=this.parent()),this._each(function(t){n.push(t.cloneNode(e!==!1))}),n=new i.NodeSelection(n),t&&t.appendChild(n),n._each(l.removeNodeUID),e!==!1&&n.query("*")._each(l.removeNodeUID),n},count:function(){return this._nodes.length},exists:function(){return this.count()>0},next:function(){for(var e=this._nodes[0]&&this._nodes[0].nextSibling;e&&3===e.nodeType;)e=e.nextSibling;return new i.NodeSelection(e&&[e]||null)},prev:function(){for(var e=this._nodes[0]&&this._nodes[0].previousSibling;e&&3===e.nodeType;)e=e.previousSibling;return new i.NodeSelection(e&&[e]||null)},previous:function(){return this.prev.apply(this,arguments)},firstChild:function(){return this.children().first()},lastChild:function(){return this.children().last()},nthChild:function(e){return this.children().index(e)},first:function(e){return new i.NodeSelection(this._nodes.slice(0,e||1))},last:function(e){return new i.NodeSelection(this._nodes.slice(this._nodes.length-(e||1)))},index:function(e,t){return new i.NodeSelection("number"===i.typeOf(e)&&this._nodes.slice(e,e+(t||1))||null)},siblings:function(){var e=new i.NodeSelection;return this._each(function(t){for(var n=t;n=n.previousSibling;)"#text"!==n.nodeName&&"#comment"!==n.nodeName&&3!==n.nodeType&&e._nodes.push(n);for(n=t;n=n.nextSibling;)"#text"!==n.nodeName&&"#comment"!==n.nodeName&&3!==n.nodeType&&e._nodes.push(n)}),e},parent:function(){var e,t=[];return this._each(function(n){e=n.parentNode,e&&0>t.indexOf(e)&&11!==e.nodeType&&t.push(e)}),new i.NodeSelection(t)},children:function(){var e,t,n=[];if(this._nodes.length>0)for(e=0;this._nodes.length>e;e++)if(this._nodes[e].childNodes)for(t=0;this._nodes[e].childNodes.length>t;t++)3!==this._nodes[e].childNodes[t].nodeType&&"#text"!==this._nodes[e].childNodes[t].nodeName&&"#comment"!==this._nodes[e].childNodes[t].nodeName&&n.push(this._nodes[e].childNodes[t]);return new i.NodeSelection(n)},submit:function(){this._each(function(e){var t=i.fireEvent({type:"submit",target:e});t.rval!==!1&&t.returnValue!==!1&&t.preventDefault!==!0&&e.submit&&e.submit()})},selection:function(e,t){var n,r,o,a,s,u=this._nodes[0];return e&&"number"!=typeof e&&e.start&&(t=e.end,e=e.start),"number"!=typeof e?window.getSelection?(n="string"==typeof u.value?u.value:u.innerHTML,r=window.getSelection(),{start:u.selectionStart+0,end:u.selectionEnd+0,text:n.substring(r.start,r.end)}):document.selection?(r=document.selection.createRange(),o=document.body.createTextRange(),o.moveToElementText(u),o.setEndPoint("EndToStart",r),{start:o.text.length,end:o.text.length+r.text.length,text:r.text}):(i.log("Selection retrieval is not supported in this browser."),{start:0,end:0,text:""}):(0>e&&(e=0),a=u.value.length,t>a&&(t=a),e>t?e=t:e>t&&(t=e),window.getSelection?(u.selectionStart=e,u.selectionEnd=t):u.selectionEnd||0===u.selectionEnd?(u.selectionStart=e,u.selectionEnd=t):u.createTextRange&&(s=u.createTextRange(),s.collapse(!0),s.moveStart("character",e),s.moveEnd("character",t),s.select()),this)},template:function(e){var t;return e=e||{},t=function(e){var t,n=e.split("|");for(e=n.splice(0,1)[0],t=n.length;t--;)"htmlEntities"===n[t]&&n.splice(t,1);return n},this.query("[data-tpl-id]").each(function(n){var r,o,a=n.nodeName(),s=n.attr("data-tpl-id"),u=s;if(r=t(s),s=s.split("|")[0],u=puredom.delve(e,s),null!==u&&void 0!==u)if(("date"==typeof u||u.constructor===Date)&&(u=u.toLocaleString()),o=n.attr("data-tpl-prop"))n.prop(o,i.text.filter(u,r.join("|")));else switch(a){case"select":case"input":case"textarea":case"meter":case"progress":n.value(u);break;case"img":case"video":case"audio":case"iframe":r.splice(0,0,"htmlEntities"),u=i.text.filter(u,r.join("|")),n.attr("src",u);break;default:r.splice(0,0,"htmlEntities"),u=i.text.filter(u,r.join("|")),n.html(u)}}),e=null,this}}),i.NodeSelection.prototype.on=i.NodeSelection.prototype.addEvent,i.NodeSelection.prototype.animateCss=i.NodeSelection.prototype.animateCSS,l.incrementAnimationCount=function(e){e.setAttribute("data-puredom-animation-count",l.getAnimationCount(e)+1+""),i.addClass(e,"_puredom_animating")},l.decrementAnimationCount=function(e){var t=Math.max(0,l.getAnimationCount(e));t>1?e.setAttribute("data-puredom-animation-count",t-1+""):(e.setAttribute("data-puredom-animation-count",""),e.removeAttribute&&e.removeAttribute("data-puredom-animation-count"),i.removeClass(e,"_puredom_animating"))},l.getAnimationCount=function(e){return parseInt(e.getAttribute("data-puredom-animation-count"),10)||0},l.unload=function(){l.wrappedEventListener.reset(),i.getElement.clearCache(),l._nodeToIdList={},setTimeout(function(){window.puredom=l=u=o=null},10)},i.el=function(e,t){var n,r;if(e){if(r=i.typeOf(e),"array"===r){n=[];for(var o=0;e.length>o;o++)Array.prototype.splice.apply(n,[0,0].concat(i.el(e[o])._nodes))}if(e.constructor===i.NodeSelection)return t===!0&&console.log("query is already a NodeSelection",e.constructor+"",e.constructor.name),e;"string"===r&&"<"===e.charAt(0)||"object"===r&&!e.nodeName&&e!==window?(t===!0&&console.log("query is an HTML fragment",e,r),n=i.createElement.apply(i,arguments)):"string"===r?(t===!0&&console.log("query is a CSS selector",e,r),n=i.getElement(e,arguments[1])):(e.nodeName||e===window)&&(t===!0&&console.log("query is an HTML element",e,r),n=e)}return new i.NodeSelection(n)},i.node=function(e){return new i.NodeSelection(l.idToNode(e))},i.getElement=function(){var e,t,n,o={},a=!1,s=/^((?:[a-z][a-z0-9\_\-]*)|\*)?/gi,u=/^\s*(.*?)\s*$/gm,c=!1;return n=[{title:"ID selector {#id}",regex:/^#[_a-zA-Z0-9-]*/gm,filter:function(e,t,n){var r=n.searchBaseNode&&n.searchBaseNode.getElementById?n.searchBaseNode:document;return[r.getElementById(e[0].substring(1))]}},{title:"Class selector {.className}",regex:/^\.([^#.:\[<>\{+\|\s]+)/gim,filter:function(e,t){var n,r,o=" "+e[1]+" ";for(n=t.length;n--;)r=t[n]&&t[n].className,r&&-1!==(" "+r+" ").indexOf(o)||t.splice(n,1)}},{title:"Attribute selector {[name=value] & variants}",regex:/^\[([^\^\$\~=]+)(?:([\^\$\~=]+)(['"]?)([^\]]*))?\3\]/g,filter:function(e,t){var n,r,o,a,s;if(e&&e[1])for(r={attribute:e[1]},e[2]&&e[4]&&(r.type=e[2],r.attrValue=e[4]||""),n=t.length;n--;){switch(o=!1,a="checked"===r.attribute?"true"===r.attrValue||"false"===r.attrValue?t[n].checked?"true":"false":t[n].checked?"checked":null:"selected"===r.attribute?"true"===r.attrValue||"false"===r.attrValue?t[n].selected?"true":"false":t[n].selected?"selected":null:t[n]&&t[n].getAttribute(r.attribute+""),r.attrPresent="string"===i.typeOf(a),r.attrSet=a&&a.length>0,r.attrValue&&(s=r.attrPresent?a.indexOf(r.attrValue):-1),r.type||""){case"=":o=a===r.attrValue;break;case"^=":o=0===s;break;case"$=":o=r.attrSet&&a.substring(a.length-r.attrValue.length)===r.attrValue;break;case"~=":o=s>-1;break;default:o=!r.attrValue&&r.attrPresent}o||t.splice(n,1)}}},{title:"Descendant selector {>}",regex:/^\s*\>\s*((?:[a-z][a-z0-9\:\_\-]*)|\*)?/gi,filter:function(e,t,n){var r,o,a,s,u=[].concat(t),l=(e[1]||"*").toLowerCase();for(t.splice(0,t.length),!n.isFiltered&&n.first&&i.log("Descendant selector called on an unfiltered result set.  Operating on descendants of the document."),(!n.isFiltered||n.first)&&(u=[n.searchBaseNode]),r=0;u.length>r;r++)for(a=u[r].childNodes,o=0;a.length>o;o++)s=(a[o].nodeName+"").toLowerCase(),(s===l||"*"===l&&"#"!==s.charAt(0)&&(1===a[o].nodeType||9===a[o].nodeType))&&t.push(a[o])
}},{title:"nth-child aliases, like :first-child",regex:/^\:(first|last|only)\-(child|of\-type)/gm,filter:function(e,t,r){var o,a,s,u,l={"first-child":":nth-child(0n+1)","first-of-type":":nth-of-type(0n+1)","last-child":":nth-last-child(0n+1)","last-of-type":":nth-last-of-type(0n+1)"};for(o=n.length;o--;)if(n[o].isNthChildSelector===!0){a=n[o];break}return l.hasOwnProperty(e[1]+"-"+e[2])&&a?(s=l[e[1]+"-"+e[2]],a.regex.lastIndex=0,u=a.regex.exec(s),a.filter(u,t,r)):(i.log('
Unknown nth-child alias "'+e[1]+"-"+e[2]+'"'),void 0)}},{isNthChildSelector:!0,title:"nth-child selector {:nth-child(n+2) & variants}",regex:/^\:(nth(?:\-last)?(?:\-of\-type|\-child))\((?:(\-?[0-9]*n(?:[+-][0-9]+)?)|([0-9]+)|([a-z]+))\)/gm,filter:function(e,t){var n,o,a,s,u,l,c,d,p,h,f=-1!==e[1].indexOf("-of-type"),m={odd:[2,1],even:[2]};if(n=t.splice(0,t.length),-1!==e[1].indexOf("-last")&&n.reverse(),e[2]?(s=e[2].split("n"),0===s[0].replace("-","").length&&(s[0]=s[0]+"1"),p=Math.round(s[0].replace("+",""))||0,h=Math.round(s[1].replace("+",""))||0):e[3]?(p=0,h=Math.round(e[3])||0):e[4]&&(s=e[4].toLowerCase(),m.hasOwnProperty(s)?(p=m[s][0]||0,h=m[s][1]||0):i.log('Unknown named nth-child expression "'+r[4]+'"')),!(0>=p+h))for(p===h&&(h=0),o=0;n.length>o;o++){if(children=(n[o].parentNode||{}).childNodes,l=(n[o].nodeName+"").toLowerCase(),isMatch=!1,children)for(d=0,a=0;children.length>a&&(c=children[a],u=f?(c.nodeName+"").toLowerCase()===l:"#"!==(c.nodeName+"").substring(0,1)||1===c.nodeType||9===c.nodeType,!u||(d+=1,c!==n[o]||!(isMatch=p>0?0===d%p-h:d===h)));a++);isMatch&&t.push(n[o])}}},{title:"within_internal selector { }",regex:/^\s+((?:[a-z][a-z0-9\:\_\-]*)|\*)?/gi,filter:function(e,t){var n,r=[].concat(t),o=e[1]||"*";for(t.splice(0,t.length),n=0;r.length>n;n++)Array.prototype.splice.apply(t,[t.length-1,0].concat(i.toArray(r[n].getElementsByTagName(o))))}}],t=function(e){e.lastIndex=0},e=function(r,d){var p,h,f,m,g,y,v,b,w,S,_,x,T,C,O=document&&document.documentElement||document,N=r,A=0,E=!1,L=!l.support.querySelectorAll,M=Date.now();if(r=(r+"").replace(u,"$1"),d=puredom.extend({},d||{}),d.logging===!0&&(E=!0),a&&d.useCache===!0&&o[r])return o[r];if(d.within&&(O=d.within),O&&O.length&&!O.nodeName&&O.indexOf&&O[0]&&(O=O[0]),r.indexOf(",")>-1){for(r=r.split(","),h=[],C=r.length;C--;)if(r[C]=r[C].replace(u,"$1"),r[C].length>0&&(b=e(r[C],puredom.extend({},d,{logging:!1,internalLogging:E,internal:!0}))))for(T=0;b.length>T;T++)-1===h.indexOf(b[T])&&h.push(b[T]);return E&&i.log("query=",N,", result=",node),M=Date.now()-M,M>100&&i.log('Slow Selector Warning: "'+N+'" took '+M+"ms to complete."),h}if(f=r.match(s),f=(f&&f[0]||"").toLowerCase(),r=r.substring(f.length),v=r,">"===N.charAt(0)&&(L=!0),v.match(/^#[^\s\[\]\(\)\:\*\.\,<>#]+$/gim))p=[(O.getElementById?O:document).getElementById(v.substring(1))],L=!1;else if(l.support.querySelectorAll&&L!==!0){m=N.replace(/(\[[^\[\]= ]+=)([^\[\]"']+)(\])/gim,'$1"$2"$3');try{p=i.toArray(O.querySelectorAll(m)||[])}catch(P){console.log("Native querySelectorAll failed for selector: ",m,", error:",P.message),p=[],L=!0}}if(L)for("#"===r.substring(0,1)?p=[]:f&&"*"!==f||!document.all||window.opera||O!==document&&O!==document.documentElement?(p=i.toArray(O.getElementsByTagName(f||"*")),S=!0):(p=i.toArray(O.all||document.all),S=!1),g={searchBaseNode:O,negated:!1,first:!0,isFiltered:S||!(!f||"*"===f)};v.length>0;){for(A+=1,w=!1,T=0;n.length>T&&(c===!0&&(_=Date.now()),t(n[T].regex),b=n[T].regex.exec(v),c===!0&&(_=Date.now()-_),b&&(w=!0,E&&i.log((n[T].title||n[T].regex)+' ==>> matched:"'+v.substring(0,b[0].length)+'" ==>> remaining:"'+v.substring(b[0].length)+'" ||debug>> (submatches:'+b.slice(1).join(",")+")"),c===!0&&(x=Date.now()),y=n[T].filter(b,p,g),y&&i.isArray(y)&&(p=y),c===!0&&(x=Date.now()-x),v=v.substring(b[0].length),g.first=!1,g.isFiltered=!0),c===!0&&(n[T].matchTimes.push(_),w&&n[T].filterTimes.push(x)),0!==v.length);T++);if(!w)throw Error("puredom.getElement() :: Unknown CSS selector near: "+v.substring(0,20),"puredom.js",1775)}if(d.includeInvisibles!==!0)for(T=p.length;T--;)p[T]&&"#"===(p[T].nodeName+"").charAt(0)&&p.splice(T,1);return E&&i.log("query=",N,", result=",p),a&&d.cache===!0&&(o[r]=p),d.internal!==!0&&E===!0&&(M=Date.now()-M,M>10&&i.log('Slow Selector Warning: "'+N+'" took '+M+"ms to complete. "+A+" parse iterations.")),p},e.enableCache=function(e){a=e!==!1,a||(o={})},e.disableCache=function(){a=!1,o={}},e.clearCache=function(){o={}},e._normalizeSelectorFilter=function(e){return 2===arguments.length&&(e={regex:arguments[0],filter:arguments[1]}),e&&e.regex&&e.filter?e:!1},e.addSelectorFilter=function(t){return t=e._normalizeSelectorFilter.apply(e,arguments),t?(n.push(t),!0):!1},e.removeSelectorFilter=function(t){var r,o,i;if(t=e._normalizeSelectorFilter.apply(e,arguments))for(r=n.length;r--;){i=!0;for(o in n[r])if(n[r].hasOwnProperty(o)&&n[r][o]!==t[o]){i=!1;break}if(i){n.splice(r,1);break}}return i===!0},c===!0?(function(){for(var e=0;n.length>e;e++)n[e].matchTimes=[],n[e].filterTimes=[]}(),e.selectorStats=function(){var e,t,r,o,i,a,s={title:"--- Selector Statistics: ---",selectors:[]};for(t=0;n.length>t;t++){if(r=n[t],e={},e.title=r.title,a=0,r.matchTimes.length>0){for(i=0,o=0;r.matchTimes.length>o;o++)i+=r.matchTimes[o];a+=i,e.matching=Math.round(i/r.matchTimes.length)+"ms"}if(r.filterTimes.length>0){for(i=0,o=0;r.filterTimes.length>o;o++)i+=r.filterTimes[o];a+=i,e.filtering=Math.round(i/r.filterTimes.length)+"ms"}e.own_time=a+"ms",e.calls=r.matchTimes.length,s.selectors.push(e)}return s}):e.selectorStats=function(){return"disabled"},e}(),i.selectorEngine=i.getElement,i.DOMEvent=function(e){e&&(this.type=e.replace(/^on/gi,""))},i.DOMEvent.displayName="puredom.DOMEvent",i.extend(i.DOMEvent.prototype,{which:null,type:"",target:null,relatedTarget:null,preventDefault:function(){this.defaultPrevented=!0},stopPropagation:function(){this.propagationStopped=!0,this.bubblingCancelled=!0},cancel:function(){return this.preventDefault(),this.stopPropagation(),this.returnValue=!1,!1},returnValue:!0,originalEvent:null,timeStamp:null}),i.DOMEvent.prototype.cancelBubble=i.DOMEvent.prototype.stopPropagation,i.DOMEvent.prototype.stop=i.DOMEvent.prototype.cancel,i.DOMEvent.prototype.prevent=i.DOMEvent.prototype.cancel,l.wrappedEventListener={list:[],none:{},summary:function(){for(var e=0;this.list.length>e;e++)i.log(l.idToNode(this.list[e].target),".on",this.list[e].type," -> ",this.list[e].handler.displayName||this.list[e].handler.name)},reset:function(e){var t,n;if(e===!0)for(t=this.list.length;t--;)n=this.list[t],this.list[t]=this.none,i.removeEvent(l.idToNode(n.target),n.type,n.wrappedHandler),this.unsetRefs(n),window.killCount=(window.killCount||0)+1;this.list.splice(0,this.list.length)},destroyObjHandlers:function(e){var t,n,r=l.nodeToId(e);for(t=this.list.length;t--;)n=this.list[t],n.target===r&&(this.unsetRefs(n),this.list.splice(t,1),i.removeEvent(e,n.type,n.wrappedHandler),window.killCount=(window.killCount||0)+1)},get:function(e,t,n,r){var o,i;for(n=l.nodeToId(n),o=this.list.length;o--;)if(i=this.list[o],i.target===n&&i.handler===t&&i.type===e){t=i.wrappedHandler,r===!0&&(this.list.splice(o,1),window.killCount=(window.killCount||0)+1,this.unsetRefs(i));break}return t},unsetRefs:function(e){e.wrappedHandler.type=null,e.wrappedHandler.handler=null,e.wrappedHandler.target=null},internalFireEvent:function(e){var t,n,r,o=l.nodeToId(e.target),i=e.type.replace(/^on/gm,"");for(t=this.list.length;t--&&(n=this.list[t],n.target!==o||n.type!==i||(r=n.handler.call(e.target,e),r!==!1)););},create:function(e,t,n){var r={type:e,target:l.nodeToId(n),handler:t,wrappedHandler:function(e){var t,n,r=arguments.callee.handler,o=(arguments.callee.type||e.type).toLowerCase().replace(/^on/,""),a=this!==window?this:l&&l.idToNode(arguments.callee.target),s={isInSelf:!1,doPreventDefault:!1,doCancelBubble:!1,doStopPropagation:!1,e:e||window.event,ret:null,end:function(){return s.end=null,e=t=s=r=o=a=null,this.ret}};l&&l.idToNode||i.log("target:<"+e.target.nodeName+' class="'+e.target.className+'" id="'+e.target.id+'"'+"> , type:"+o+"/"+e.type),e=s.e,t=i.extend(new i.DOMEvent(o),{which:e.which,target:e.target||e.srcElement||a||document.body,relatedTarget:e.relatedTarget||("mouseout"===o?e.toElement:e.fromElement),returnValue:!0,originalEvent:e,timeStamp:e.timeStamp||Date.now()});for(n in e)t.hasOwnProperty(n)||"function"==typeof e[n]||n===n.toUpperCase()||"layerX"===n||"layerY"===n||(t[n]=e[n]);t.target||i.log("Event target doesn't exist for type \""+t.type+'": ',t.target,", srcElement=",e.srcElement),"touchend"===e.type&&l._lastTouchPos?(t.pageX=l._lastTouchPos.pageX,t.pageY=l._lastTouchPos.pageY):e.touches&&e.touches[0]?(t.pageX=e.touches[0].pageX,t.pageY=e.touches[0].pageY,l._lastTouchPos={pageX:t.pageX,pageY:t.pageY}):(e.pageX||0===e.pageX||e.clientX||0===e.clientX)&&(t.pageX=e.pageX||e.clientX+document.body.offsetLeft,t.pageY=e.pageY||e.clientY+document.body.offsetTop),(o.indexOf("key")>-1||e.keyCode||e.charCode)&&(t.keyCode=e.keyCode||e.which,t.charCode=e.keyCode||e.charCode||e.which,t.which=e.which),(o.indexOf("mouse")>-1||o.indexOf("click")>-1||null!==e.button&&void 0!==e.button)&&(t.button="number"==typeof e.button?e.button:e.which),t.target&&3===t.target.nodeType&&3!==a.nodeType&&(t.target=t.target.parentNode),s.searchNode=t.relatedTarget||t.target;do if(s.searchNode===a){s.isInSelf=!0;break}while(s.searchNode&&(s.searchNode=s.searchNode.parentNode)&&s.searchNode!==document);if("mouseover"!==o&&"mouseout"!==o||!s.isInSelf){if(r&&r.call&&(s.handlerResponse=r.call(a,t)),t.returnValue=s.handlerResponse!==!1&&t.returnValue!==!1,t.defaultPrevented&&(t.returnValue=e.returnValue=!1,e.preventDefault&&e.preventDefault()),t.bubblingCancelled===!0||t.propagationStopped===!0||t.cancelBubble===!0){e.stopPropagation&&e.stopPropagation();try{e.cancelBubble&&e.cancelBubble.call?e.cancelBubble():e.cancelBubble=!0}catch(u){}}s.ret=t.returnValue}else s.ret=!0;return s.end()}};return r.wrappedHandler.displayName="wrappedEventHandler_"+e,r.wrappedHandler.handler=t,r.wrappedHandler.type=e,r.wrappedHandler.target=r.target,this.list.push(r),n=e=t=r=null,this.list[this.list.length-1].wrappedHandler}},l.getSubjectDescription=function(e){return(e.nodeName?i.el(e)+"":e.constructor&&e.constructor.name||e.name||e)+""},i.eventTypeMap={},l.support.webkitMultitouch&&i.extend(i.eventTypeMap,{mousedown:"touchstart",mousemove:"touchmove",mouseup:"touchend"}),i.addEvent=function(e,t,n,r){var o,a;if(e){if("string"===i.typeOf(t)&&t.indexOf(",")>-1&&(t=t.replace(/\s/gm,"").split(",")),i.isArray(t)){for(o=0;t.length>o;o++)i.addEvent(e,t[o],n);return!0}if(a=t=(t+"").toLowerCase().replace(/^\s*(on)?(.*?)\s*$/gim,"$2"),"string"!=typeof t||!n||!n.call)return i.log("Attempted to add event with invalid type or handler:",{type:t,handler:n+"",subject:l.getSubjectDescription(e),useCapture:r===!0}),void 0;i.eventTypeMap.hasOwnProperty(t)&&(t=i.eventTypeMap[t]),n=l.wrappedEventListener.create(a,n,e),e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener&&(e.addEventListener(t,n,r===!0),window._eventCount=(window._eventCount||0)+1)}},i.removeEvent=function(e,t,n,r){var o,a;if(e){if("string"===i.typeOf(t)&&t.indexOf(",")>-1&&(t=t.replace(/\s/gm,"").split(",")),i.isArray(t)){for(o=0;t.length>o;o++)i.removeEvent(e,t[o],n,r);return!0}if(a=t=(t+"").toLowerCase().replace(/^\s*(on)?(.*?)\s*$/gim,"$2"),"string"!=typeof t||!n||!n.call)return i.log("Attempted to remove event with invalid type or handler:",{type:t,handler:n+"",subject:l.getSubjectDescription(e),useCapture:r===!0}),void 0;if(i.eventTypeMap.hasOwnProperty(t)&&(t=i.eventTypeMap[t]),n=l.wrappedEventListener.get(a,n,e,!0),e.detachEvent)e.detachEvent("on"+t,n);else if(e.removeEventListener)try{e.removeEventListener(t,n,r===!0),window._eventCount=(window._eventCount||0)-1}catch(s){}}},i.cancelEvent=function(e){if(e=e||window.event){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation();try{e.cancelBubble=!0}catch(t){}e.returnValue=!1}return!1},i.fireEvent=function(e){var t,n,r,o,a;if(e=e||{},document.createEventObject){e=i.extend({},e),e.type="on"+e.type.toLowerCase().replace(/^on/,"");try{t=document.createEventObject()}catch(s){a=!0}if(!a){for(r in e)if(e.hasOwnProperty(r))try{t[r]=e[r]}catch(s){}try{n=e.target.fireEvent(e.type,t),o=t.preventDefault===!0}catch(s){a=!0}}a&&l.wrappedEventListener.internalFireEvent&&l.wrappedEventListener.internalFireEvent(e)}else{t=document.createEvent("HTMLEvents"),t.initEvent(e.type.toLowerCase().replace(/^on/,""),!0,!0);for(r in e)if(e.hasOwnProperty(r))try{t[r]=e[r]}catch(s){}n=!e.target.dispatchEvent(t),o=t.preventDefault===!0}return{evt:t,preventDefault:o,rval:n}},l._nodeToIdIndex=0,l._nodeToIdList={},l.nodeToId=function(e){var t,n;return e===window?"_td_autoid_window":e===document?"_td_autoid_document":e===document.body?"_td_autoid_documentbody":(t=/\s_td_autoid_([0-9]+)\s/gm.exec(" "+e.className+" "),t&&t[1]?n=t[1]:(l._nodeToIdIndex+=1,n=l._nodeToIdIndex+"",i.addClass(e,"_td_autoid_"+n)),l.ensureNodeIdListing(e,n),n)},l.idToNode=function(e){var t,n,r=l._nodeToIdList[e+""];return"_td_autoid_window"===e?window:"_td_autoid_document"===e?document:"_td_autoid_documentbody"===e?document.body:(r&&(n=i.getElement(r),/\s_td_autoid_[0-9]+\s/gm.exec(" "+n.className+" ")||(n=null)),n||(t=i.getElement("._td_autoid_"+e),n=t&&t[0],n&&l.ensureNodeIdListing(n,e)),n||!1)},l.ensureNodeIdListing=function(e,t){var n;e.getAttribute&&(n=e.getAttribute("id"),n||(n="_td_autoid_"+t,e.setAttribute("id",n)),l._nodeToIdList[t]="#"+n)},l.removeNodeUID=function(e){var t=e.getAttribute("id");t&&t.match(/^_td_autoid_[0-9]+$/g)&&(e.removeAttribute?e.removeAttribute("id"):e.setAttribute("id","")),e.className&&(e.className=e.className.replace(/(^|\b)_td_autoid_[0-9]+(\b|$)/gim,""))},i.animationFrame=function(e){var t={manualFramerate:11};return window.mozRequestAnimationFrame?e="moz":window.webkitRequestAnimationFrame&&(e="webkit"),t.nativeSupport=!!e,t.nativeSupport?(t.getTimer=function(t){return window[e+"RequestAnimationFrame"](t)},t.cancelTimer=function(t){window[e+"CancelRequestAnimationFrame"](t)},t.getStartTime=function(){return window[e+"AnimationStartTime"]||(new Date).getTime()}):(t.getTimer=function(e){return setTimeout(function(){e((new Date).getTime()),e=null},t.manualFramerate)},t.cancelTimer=function(e){clearTimeout(e)},t.getStartTime=function(){return(new Date).getTime()}),t}(),i.setOpacity=function(e,t){1>=t&&t>0&&(t=100*t),t=Math.round(t),100>t?(e.style.opacity=parseFloat(t/100).toFixed(2),e.style.filter="alpha(opacity="+t+")"):(e.style.opacity=null,e.style.filter=null)},i.applyMsFilter=function(e,t,n){var r,o,a,s,u,c="",d="MsFilter"===l.support.filterProperty?'"':"";if(t=t.charAt(0).toUpperCase()+t.substring(1),"string"==typeof n)for(c=n,n={},s=c.replace(/\s*(,|=)\s*      /gm,"$1").split(","),a=0;s.length>a;a++)u=s[a].indexOf("="),n[s[a].substring(0,u)]=s[a].substring(u+1);else{for(a in n)n.hasOwnProperty(a)&&(c+=", "+a+"="+n[a]);c=c.replace(",","")}try{r=e.filters&&e.filters.item&&(e.filters.item("DXImageTransform.Microsoft."+t)||e.filters.item(t))}catch(p){}if(r){for(a in n)n.hasOwnProperty(a)&&"enabled"!==a&&(r[a]=n[a]);r.enabled=n.enabled?1:0}else o=e.style.MsFilter||e.style.filter||"",o+=" "+(i.nodeStyle(e,"MsFilter")||i.nodeStyle(e,"filter")||""),o&&(o=o.replace(RegExp('(^|s|))"?((progid:)?DXImageTransform.Microsoft.)?'+t+'s*?(.*?)"?s*?',"gim"),"$1")+" "),e.style[l.support.filterProperty]=o+d+"progid:DXImageTransform.Microsoft."+t+"("+c+")"+d;e.style.zoom||(e.style.zoom=1)},i.applyCss=function(n,r){var o,a,s,u,c;r=r||{};for(o in r)if(r.hasOwnProperty(o))try{a=i.getStyleAsCSS(o),a=a.replace(/^\-(moz|webkit|ms|o|vendor)\-/gim,e+"-"),a=i.getStyleAsProperty(a),"opacity"===a&&l.support.filters?(c=Math.round(100*parseFloat(r[o])),100>c?i.applyMsFilter(n,"alpha",{enabled:!0,opacity:c}):i.applyMsFilter(n,"alpha",{enabled:!1})):"--box-shadow"===a&&l.support.filters?(s=r[o].match(/\b(\#[0-9af]{3}[0-9af]{3}?|rgba?\([0-9\,\s]+\))\b/gim),s=s&&s[0]||"",u=(" "+r[o]+" ").replace(s,"").replace(/\s+/m," ").split(" ").slice(1,4),i.applyMsFilter(n,"glow",{Color:s,Strength:Math.round(u[3].replace(/[^0-9\-\.]/gim,""))})):(n.style[a]=r[o],("boxShadow"===a||"textShadow"===a||"borderRadius"===a)&&t&&(n.style[t+a]=r[o]))}catch(d){}},i.getStyleAsProperty=function(e){return"string"!=typeof e?null:(e=e.replace(/\-[a-z0-9]/gim,l.styleAsPropReplacer),e=e.replace(/^(webkit|moz|ms|o)[A-Z]/gm,l.styleAsPropVendorPrefixReplacer))},l.styleAsPropReplacer=function(e){return e.charAt(1).toUpperCase()},l.styleAsPropVendorPrefixReplacer=function(e){return e.charAt(0).toUpperCase()+e.substring(1)},i.getStyleAsCSS=function(e){return"string"==typeof e&&e.replace(/\-*([A-Z])/gm,"-$1").toLowerCase()||null},l.parseCSS=function(e){var t,n,r=/\s*([a-z\-]+)\s*:\s*([^;]*?)\s*(?:;|$)/gi;if(e)for(t={},r.lastIndex=0;n=r.exec(e);)t[i.getStyleAsProperty(n[1])]=n[2];return t},i.getCssTransitions=function(e){var t,n,r,o,a={},s={properties:"-vendor-transition-property",durations:"-vendor-transition-duration",timingFunctions:"-vendor-transition-timing-function"};for(t in s)s.hasOwnProperty(t)&&(s[t]=(i.nodeStyle(e,s[t])||"").replace(/\s/,"").split(","));for(n=0;s.properties.length>n;n++)!s.properties[n]||"null"===s.properties[n]||"all"===s.properties[n]&&s.durations[n].match(/^[0\.ms]*$/)||(r=s.durations[n]||s.durations[s.durations.length-1],o=parseFloat(r.replace(/[^\-0-9\.]/gim,""))||0,r.match(/ms$/i)||(o*=1e3),a[i.getStyleAsProperty(s.properties[n])]={duration:o,timingFunction:s.timingFunctions[n]||s.timingFunctions[s.timingFunctions.length-1]||"ease"});return a},i.setCssTransitions=function(e,t){var n,r={"-vendor-transition-property":[],"-vendor-transition-duration":[],"-vendor-transition-timing-function":[]};for(n in t)t.hasOwnProperty(n)&&t[n]&&(r["-vendor-transition-property"].push(n.toLowerCase()),r["-vendor-transition-duration"].push((t[n].duration/1e3).toFixed(3)+"s"),r["-vendor-transition-timing-function"].push(t[n].timingFunction||"ease"));for(n in r)r.hasOwnProperty(n)&&(r[n]=r[n].join(", "));i.applyCss(e,r)},i.updateCssTransitions=function(e,t){var n,r;if(t){n=i.getCssTransitions(e);for(r in t)t.hasOwnProperty(r)&&(t[r]?n[r]=t[r]:delete n[r]);i.setCssTransitions(e,n)}},i.addClass=function(e,t){var n,r;if(t){if(i.isArray(t)||(t=[t]),n=e.className||"",n.length>0){for(n=" "+n+" ",r=0;t.length>r;r++)for(;n.indexOf(" "+t[r]+" ")>-1;)n=n.replace(" "+t[r]+" "," ");n=n.substring(1)}e.className=(n+t.join(" ")).replace(/\s+/gim," ")}},i.removeClass=function(e,t){var n,r;if(t){if(i.isArray(t)||(t=[t]),n=e.className||"",n.length>0){for(n=" "+n+" ",r=0;t.length>r;r++)for(;n.indexOf(" "+t[r]+" ")>-1;)n=n.replace(" "+t[r]+" "," ");n=n.substring(1)}e.className=n.replace(/\s+/gim," ")}},i.nodeStyle=function(t,n){var r,o,i,a=(n+"").replace(/[A-Z]/g,"-$0").toLowerCase();return a=a.replace(/^\-(moz|webkit|ms|o|vendor)\-/gim,e+"-"),r=a.replace(/\-[a-z]/gim,function(e){return e.substring(1).toUpperCase()}),"opacity"===a&&l.support.filters?t.filters.alpha&&t.filters.alpha.enabled!==!1&&Math.round(t.filters.alpha.opacity)/100:(t.style&&t.style[r]?i=t.style[r]||"":t.currentStyle&&t.currentStyle[r]?i=t.currentStyle[r]||t.currentStyle[a]||"":document.defaultView&&document.defaultView.getComputedStyle?(o=document.defaultView.getComputedStyle(t,null),i=o&&(o.getPropertyValue(a)||o.getPropertyValue(r))||""):window.getComputedStyle&&(o=window.getComputedStyle(t,null),i=o&&(o.getPropertyValue(a)||o.getPropertyValue(r))||""),i)},i.htmlEntities=function(e,t){var n=["htmlEntities"];return t===!0&&n.push("stripTags"),i.text.filter(e,n)},i.log=function(){window.console&&window.console.log&&window.console.log.apply(window.console,arguments)},i.addNodeSelectionPlugin=function(e,t){i.NodeSelection.prototype.hasOwnProperty(e)||(i.NodeSelection.prototype[e]=function(){var e=t.apply(this,arguments);return null===e||void 0===e?this:e})},i.init=function(){s||(s=!0,i.forEach(l.oninit,function(e){e.call(i,i)}),i.fireEvent({target:document.body,type:"puredomready",puredom:i}))},i.addEvent(document,"DOMContentLoaded",i.init),i.addEvent(window,"load",i.init),i.addEvent(window,"unload",l.unload),function(){if(window._previousPureDom){for(var e in window._previousPureDom)window._previousPureDom.hasOwnProperty(e)&&(i[e]=window._previousPureDom[e]);window._previousPureDom=null;try{delete window._previousPureDom}catch(t){}}}(),l.puredom=function(e){return"function"===i.typeOf(e)?(s===!0?e.call(i,i):l.oninit.push(e),i):i.el.apply(i,arguments)},i.extend(i,a),i.toString=function(){return"function puredom(){}"},window.puredom=i}(),window.puredom=window.puredom||{},function(){var e={text:function(){var e=function(){return e.filter.apply(this,arguments)},t={htmlEntities:/[&<>"]/gim,ucWords:/(^|\s)[a-z]/gim,ucFirst:/^[a-z]/gim,nl2br:/\r?\n/g,numbersOnly:/[^0-9.\-]/gim,trim:/^\s*?(.*?)\s*?$/gim};return e.filter=function(t,n){var r,o,i,a,s;if("array"!==puredom.typeOf(n)&&(n=((n||"")+"").split("|")),arguments.length>2)for(r=2;arguments.length>r;r++)"array"===puredom.typeOf(arguments[r])?n=n.concat(arguments[r]):n.push(arguments[r]);for(r=0;n.length>r;r++){o=n[r],a=[t],i=o.indexOf(":"),i>-1&&(o=o.substring(0,i),a=a.concat(n[r].substring(i+1).split(",")));for(s in e)if((s+"").toLowerCase()===o.toLowerCase()){t=e[s].apply(e,a);break}}return t},e.escape=function(e){return encodeURIComponent(e)},e.unescape=function(e){return decodeURIComponent(e)},e.htmlEntities=function(e){var n={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};return(e+"").replace(t.htmlEntities,function(e){return n[e]})},e.ucWords=function(e){return(e+"").toLowerCase().replace(t.ucWords,function(e){return e.toUpperCase()})},e.ucFirst=function(e){return(e+"").toLowerCase().replace(t.ucFirst,function(e){return e.toUpperCase()})},e.nl2br=function(e){return(e+"").replace(t.nl2br,"<br />")},e.numbersOnly=function(e){return(e+"").replace(t.numbersOnly,"")},e.truncate=function(e,t,n,r){var o=!1,i=e+"";return e=i,t=parseInt(t,10)||80,n=n===!0||"true"===n||"byWord"===n,r=r||"...",e.length>t&&(n?(e=e.substring(0,t),i.charAt(t).match(/\s/)||(e=e.replace(/\s[^\s]*$/,""))):e=e.substring(0,t-r.length),o=!0),o&&(e+=r),e},e.trim=function(e){var t,n=/\s/;for(e=e.replace(/^\s\s*/,""),t=e.length;n.test(e.charAt(--t)););return e.slice(0,t+1)},e["default"]=function(t,n){return t=e.trim(t),t?t:n},e.dateformat=function(e,t){var n,r=puredom.i18n,o=puredom.date;return o&&o.create&&(n=o.create(e)),(!n||(n+"").indexOf("Invalid")>-1)&&(n=new Date(e),(!n||(n+"").indexOf("Invalid")>-1)&&(n=new Date,n.setTime(Math.round(e)))),t&&t.indexOf("%")>-1?o&&o.format&&(e=o.format(n,t)):r&&(e=r(n,null,null,{datetype:t||"date"})||n+""),e},e}(),parameterize:function(e,t){var n,r,o,i,a=[],s=puredom.extend({delimiter:"&",startDelimiter:"?",assignment:"=",typeHandlers:null},t);for(n in e)if(e.hasOwnProperty(n))if(r=e[n],i=this.typeOf(r),s.typeHandlers&&s.typeHandlers.hasOwnProperty(i))a.push(s.delimiter+encodeURIComponent(n)+"="+encodeURIComponent(s.typeHandlers[i](r)));else if("array"===i&&s.disableArrayParams!==!0)for(o=0;r.length>o;o++)a.push(s.delimiter+encodeURIComponent(n)+"[]="+encodeURIComponent(r[o]));else{switch(i){case"boolean":r=r?"true":"false";break;case"null":case"undefined":r="";break;case"object":r=s.useJsonForObjects!==!1?this.json(r):this.parameterize(r)}a.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}return a=a.join(s.delimiter||"&"),a=(s.startDelimiter||"")+a},querystring:{parse:function(e){var t,n,r,o={};for("?"===e.substring(0,1)&&(e=e.substring(1)),t=e.split("&"),n=0;t.length>n;n++)t[n]&&(r=t[n].indexOf("="),o[decodeURIComponent(t[n].substring(0,r))]=0>r?"":decodeURIComponent(t[n].substring(r+1)));return o},stringify:function(e,t){return t=puredom.extend({startDelimiter:""},t||{}),puredom.parameterize(e,t)},build:function(){return puredom.querystring.stringify.apply(puredom.querystring,arguments)}},cookies:function(){var e={};return{set:function(t,n,r,o,i,a){var s,u="",l="";i="string"==typeof i?i:"",r&&(s=new Date,s.setTime(s.getTime()+1e3*60*60*24*r),u="; expires="+s.toGMTString()),e.hasOwnProperty(t)&&e[t].expires&&(u="; expires="+e[t].expires.toGMTString()),l=t+"="+encodeURIComponent(n)+u+"; path=/"+i.replace(/^\//,""),"string"==typeof o&&o.length>0&&(l+="; domain="+o.replace(/[\;\,]/,"")),a===!0&&(l+="; secure"),document.cookie=l,e[t]={value:n,expires:s}},get:function(t,n){if(e.hasOwnProperty(t)&&n!==!0)return e[t].value;var r,o,i=document.cookie.split(";");for(o=0;i.length>o;o++)if(r=i[o].replace(/^\s+/gim,""),0===r.indexOf(t+"="))return decodeURIComponent(r.substring(t.length+1,r.length));return null},remove:function(t){this.set(t,"",-1),delete e[t]},purge:function(){for(var t in e)e.hasOwnProperty(t)&&(this.remove(t),delete e[t])},read:function(){return this.get.apply(this,arguments)},write:function(){return this.set.apply(this,arguments)}}}(),Cache:function(){function e(){return this.constructor!==arguments.callee&&this.constructor!==e?new e:(this.data={},void 0)}return puredom.extend(e.prototype,{defaultType:"_default",purge:function(){this.data={}},get:function(e,t,n){var r;return 2===arguments.length&&(t=e,n=t,e=null),e=(e||this.defaultType)+"",t+="",r=this.data.hasOwnProperty(e)&&this.data[e][t]||!1,n?(r&&n(r),!!r):r},set:function(e,t,n){2===arguments.length&&(t=e,n=t,e=null),e=(e||this.defaultType)+"",t+="",this.data[e]||(this.data[e]={}),this.data[e][t]=n},proxySet:function(e,t,n,r){var o=this;return function(){o.set(e,t,arguments[r||0]),n&&n.apply(n,arguments)}},each:function(e){return puredom.foreach(this.data,e)}}),e}(),json:function(){var e=function(t){return"string"===puredom.typeOf(t)?e.parse(t):e.stringify(t)};return e.stringify=function(e){var t;try{t=JSON.stringify(e)}catch(n){puredom.log("puredom.json:: Stringify failed: "+n+" | "+e)}return t},e.parse=function(e){var t;if("string"==typeof e&&e.length>0)try{t=JSON.parse(e)}catch(n){puredom.log("puredom.json:: Parse failed: "+n+" | "+e)}return t},e.serialize=e.stringify,e.unserialize=e.parse,e}(),xml:{parse:function(e){var t;return window.DOMParser?t=(new window.DOMParser).parseFromString(e,"text/xml"):(t=new window.ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)),t}}};for(var t in e)e.hasOwnProperty(t)&&(puredom[t]=e[t]);e=null}(),window.puredom=window.puredom||{},puredom.EventEmitter=function EventEmitter(){this._eventRegistry=[]},puredom.EventEmitter.prototype.addEventListener=function(e,t){var n,r;if(e=(e+"").toLowerCase().replace(/\s+/gim,""),e.indexOf(",")>-1){for(n=e.split(","),r=0;n.length>r;r++)this.addEventListener(n[r],t);return this}return e=e.replace(/^on/,""),this._eventRegistry.push({type:e,handler:t}),this},puredom.EventEmitter.prototype.addListener=puredom.EventEmitter.prototype.addEventListener,puredom.EventEmitter.prototype.on=puredom.EventEmitter.prototype.addEventListener,puredom.EventEmitter.prototype.removeEventListener=function(e,t){var n,r,o,i;if(e=(e+"").toLowerCase().replace(/\s+/gim,""),e.indexOf(",")>-1){for(o=e.split(","),i=0;o.length>i;i++)this.removeEventListener(o[i],t);return this}for(e=e.replace(/^on/,""),n=this._eventRegistry.length;n--;)if(r=this._eventRegistry[n],r.type===e&&r.handler===t){this._eventRegistry.splice(n,1);break}return this},puredom.EventEmitter.prototype.removeListener=puredom.EventEmitter.prototype.removeEventListener,puredom.EventEmitter.prototype.fireEvent=function(e,t){var n,r,o,i=[],a=[];for(e=(e+"").toLowerCase().replace(/^on/,""),puredom.isArray(t)||(t=[t]),n=this._eventRegistry.length;n--&&(r=this._eventRegistry[n],r.type!==e||(0===a.length&&(a.falsy=a.falsey=a.truthy=!0),o=r.handler.apply(this,t),a.push(o),o===!0?a.falsy=a.falsey=!1:o===!1&&(a.truthy=!1),o!==!1)););return i=null,a},puredom.EventEmitter.prototype._fireEvent=puredom.EventEmitter.prototype.fireEvent,window.puredom=window.puredom||{},puredom.date={now:Date.now?function(){return Date.now()}:function(){return+new Date},create:function(e){var t;return e?(e=(e+"").replace(/^([0-9]{4})\-([0-9]{2})\-([0-9]{2})T([0-9]{2})\:([0-9]{2})\:([0-9]{2})\.[0-9]{3}Z$/,"$1/$2/$3 $4:$5:$6"),t=new Date(e)):t=new Date,t},parse:function(e,t){function n(e,t){(t===!1||t===!0)&&(s.pm=t===!0),(e||0===e)&&(s.hours=e),e=s.hours,12>s.hours&&s.pm&&(e-=12);var n=a.getDate();12===s.hours&&s.pm===!1?(0!==a.getHours()||t===!!t)&&a.setHours(0):(a.setHours(e),a.setDate(n))}t=t||"%d/%m/%Y";var r,o,i,a=new Date(0),s={},u={H:[/^[0-9]{1,2}/g,function(e){e=Math.round(e),n(e)}],I:[/^[0-9]{1,2}/g,function(e){e=Math.round(e),n(e)}],p:[/^[AP]M/gi,function(e){n(null,"pm"===e.toLowerCase())}],M:[/^[0-9]{1,2}/g,function(e){a.setMinutes(Math.round(e))}],a:[/^(Mon|Tue(s?)|Wed|Thu|Fri|Sat|Sun)/i,function(){}],A:[/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)/i,function(){}],d:[/^[0-9]{1,2}/g,function(e){s.date=Math.round(e),a.setDate(s.date)}],m:[/^[0-9]{1,2}/g,function(e){s.month=Math.round(e)-1,a.setMonth(s.month)}],B:[RegExp("^("+this.months.join("|")+")","gi"),function(e){s.month=date._getMonthIndex(e),a.setMonth(s.month)}],b:[/^(Jan|Feb|Mar|Apr|May|Jun(e?)|Jul(y?)|Aug|Sep(t?)|Oct|Nov|Dec)/gi,function(e){s.month=date._getMonthIndex(e),a.setMonth(s.month)}],y:[/^[0-9]{2}/g,function(e){e=Math.round(e)+1900,1950>e&&(e+=100),a.setFullYear(e)}],Y:[/^[0-9]{4}/g,function(e){s.year=Math.round(e),a.setFullYear(s.year)}]};for(u.l=u.I,u.e=u.d,u.P=u.p,u.h=u.b,r=0;t.length>r;r++)if("%"===t.charAt(r)){o=null," "===e.charAt(0)&&"%"===t.charAt(r)&&(e=e.substring(1));for(i in u)if(u.hasOwnProperty(i)&&t.substring(r+1,r+1+i.length)===i){o=u[i],e=e.replace(o[0],function(e){return o[1](e),""}),r+=o.length-1;break}}else e.charAt(0)===t.charAt(r)&&(e=e.substring(1));return(s.month||0===s.month)&&a.setMonth(s.month),(s.year||0===s.year)&&a.setFullYear(s.year),a},unformat:function(){return this.parse.apply(this,arguments)},format:function(e,t){if(t=t||"%d/%m/%Y",!e||e.constructor!==Date||!e.toDateString)return!1;var n=e.toDateString();if(!n||"invalid date"===n.toLowerCase())return!1;if("NaN"===n)return!1;var r=n.split(" "),o=e.getHours(),i=(o+11)%12+1,a=e.getMonth()+1,s={H:o,I:(10>i?"0":"")+i,l:i,p:o>11?"PM":"AM",P:o>11?"pm":"am",M:(10>e.getMinutes()?"0":"")+e.getMinutes(),S:(10>e.getSeconds()?"0":"")+e.getSeconds(),a:r[0],A:this.weekdays[e.getDay()],d:r[2],e:Math.round(r[2]),m:(10>a?"0":"")+a,B:this.months[Math.round(r[1])],b:r[1],h:r[1],y:r[3].substring(2),Y:r[3]};return t.replace(/%[HIlpPMSaAdemBbhyY]/gm,function(e){var t=s[e.charAt(1)+""];return t||0===t||t===!1?t:e})},_getMonthIndex:function(e){e=e.substring(0,3).toLowerCase();for(var t=0;this.months.length>t;t++)if(this.months[t].substring(0,3).toLowerCase()===e)return t;return-1},weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],months:["January","February","March","April","May","June","July","August","September","October","November","December"]},window.puredom=window.puredom||{},puredom.net={HttpRequest:function HttpRequest(e){puredom.extend(this,e)},get:function(e,t,n){return this.request(puredom.extend({url:e,type:"GET",callback:t},n||{}))},post:function(e,t,n,r){return this.request(puredom.extend({url:e,type:"POST",post:t,callback:n},r||{}))},multiLoad:function(e,t){if(!e)return!1;var n,r,o=-1,i=e.length,a=[],s=0,u=0;return n=function(i,l){if(i&&l){var c=e[o],d=l;c.process&&c.process.call&&(d=c.process(d),void 0===d&&(d=l)),a.push(d),t&&t(s>0,a,s,u),n=r=e=a=t=null}else r()},r=function(){o+=1;var a=e[o],s="string"==typeof a?{url:a}:a;s?http.request(s,n):i>o?r():t(!1,null,null,"No resources were available.")},r(),!0},request:function(e){var t,n,r;return e.url?(r=this,e=e||{},t=new puredom.net.HttpRequest({url:e.url,type:e.type||(e.post?"POST":"GET"),callback:e.callback||arguments[1]||function(){},post:e.post,headers:e.headers}),e.contentTypeOverride&&(t.contentTypeOverride=e.contentTypeOverride,delete e.contentTypeOverride),this.createXHR(t.url,function(e){if(t.request=e.xhr,t._xdrFrame=e.frame,e=null,t.post&&"object"===puredom.typeOf(t.post)&&(t.post=puredom.parameterize(t.post),"?"===t.post.substring(0,1)&&(t.post=t.post.substring(1))),t.request.onreadystatechange=function(){var e,n;
if(t.request._orig&&(t.request.readyState=t.request._orig.readyState,t.request.status=t.request._orig.status,t.request.responseText=t.request._orig.responseText,t.request.responseXML=t.request._orig.responseXML),4===t.request.readyState){if(t._xdrFrame&&setTimeout(function(){r._freeIframes.push(t._xdrFrame),r=null},100),t.status=t.request.status,t.contentTypeOverride)e=t.contentTypeOverride.toLowerCase();else{try{e=t.request.getResponseHeader("Content-Type").toLowerCase()}catch(o){}e=e||""}if(t.responseText=t.request.responseText,e.match(/\/(json|javascript)$/gm)||"json"===e){t.responseType="json",n=t.responseJSON=null;try{n=t.responseJSON=JSON.parse(t.request.responseText.replace(/^[^\[\{]*(.*)[^\[\{]*$/g,"$1"))}catch(i){t.jsonParseError=!0}}else"application/xml"===e||"xml"===e?(t.responseType="xml",n=t.responseXML=t.request.responseXML):(t.responseType="text",n=t.responseText);t.callback&&t.callback(400>t.request.status,n)}},t.request.open(t.type,t.url,t.async!==!1),t.request.setRequestHeader("content-type","application/x-www-form-urlencoded"),t.request.setRequestHeader("x-requested-with","XMLHttpRequest"),t.headers)for(n in t.headers)if(t.headers.hasOwnProperty(n))try{t.request.setRequestHeader(n,t.headers[n])}catch(o){}t.request.send(t.post||null)}),t):!1},jsonp:function(){var e=function(){return e.get.apply(e,arguments)},t=0;return e.get=function(e,n,r){var o,i,a,s;return"function"===puredom.typeOf(n)&&(r&&"object"===puredom.typeOf(r)&&(s=r),r=n,s&&(n=s)),n=n||{},n.callback&&!r&&(r=n.callback),n.timeout||(n.timeout=10),(e=e||n.url)?(n.params&&puredom.parameterize&&(e+=(e.indexOf("?")>-1?"&":"?")+puredom.querystring.stringify(n.params)),t+=1,n.callback=a="puredom_net_jsonp_"+t,function(){window[n.callback]=function(e){var t;if(r){try{r(e)}catch(n){t=n}r=null}if(i&&(i.stop(),i=null),t)throw t}}(),e.indexOf("{!callback}")>-1?e=e.replace("{!callback}",a):e+=(0>e.indexOf("?")?"?":"&")+encodeURIComponent(n.callbackParam||"callback")+"="+encodeURIComponent(a),this._head||(s=document.getElementsByTagName("head"),this._head=s&&s[0]),o=puredom.el({type:"script",attributes:{src:e,async:"async",type:"text/javascript"},parent:this._head||document.body}),i={id:a,stop:function(){i._timer&&clearTimeout(i._timer),window[a]=null;try{delete window[a]}catch(e){}r=null,o.attr("src","about:blank").remove(),a=i=o=null}},n.timeout&&n.timeout>0&&(i._timer=setTimeout(function(){r&&r({_requestTimedOut:!0,_jsonpTimedout:!0,success:!1,result:!1}),i&&i.stop()},Math.round(1e3*n.timeout))),e=n=s=null,i):!1},e}(),_freeIframes:[],_xhrIndex:0,createXHR:function(e,t){var n,r,o,i,a,s,u=!1,l=this;if(this._xhrIndex+=1,e&&(n=/^[a-z]{3,9}\:\/\/([^\/\?#]+)/gim.exec(e),n=n&&n[1],n&&n!==location.hostname)){for(u=!0,document.domain=location.hostname.match(/[^.]+\.[^.]+$/gim)[0],s=0;this._freeIframes.length>s;s++)if(this._freeIframes[s].getAttribute("data-xhr-domain")===n){r=this._freeIframes.splice(s,1)[0];break}r?t(l._createXHRObj(r.contentWindow,r)):(r=document.createElement("iframe"),r.style.cssText="position:absolute; left:0; top:-1000px; width:1px; height:1px; border:none; overflow:hidden;",i=function(){var e,s;try{e=r.contentWindow,s=e&&e.document&&e.document.domain===document.domain&&e.document.body}catch(u){s=null}s&&s.innerHTML&&(clearInterval(a),r.onload=r.onerror=null,t(l._createXHRObj(e,r)),l=t=o=r=n=i=a=null)},r.onload=r.onerror=i,r.setAttribute("src",location.protocol+"//"+n+"/xd_receiver.html"),r.setAttribute("role","presentation"),r.setAttribute("tabindex","-1"),r.setAttribute("data-xhr-domain",n),document.body.appendChild(r),a=setInterval(i,50))}return u?void 0:(o=this._createXHRObj(),t(o),o)},_createXHRObj:function(e,t){var n;e=e||window;try{n=new e.XMLHttpRequest}catch(r){try{n=new e.ActiveXObject("Msxml2.XMLHTTP")}catch(o){n=new e.ActiveXObject("Microsoft.XMLHTTP")}}return{xhr:n,frame:t}}},window.puredom=window.puredom||{},puredom.LocalStorage=function LocalStorage(e,t,n){var r=this;"function"==typeof arguments[2]&&(t=arguments[2],n=arguments[1]),n=n||{},this.id=e,this.adapter=null,this.data={},n.adapter&&this.setAdapter(n.adapter),this.adapter||n.useBest===!1||this.useBestAdapter(),this.adapter&&n.restore!==!1?this.restore(function(){t&&t(r),r=n=null}):t&&(t(r),r=null)},puredom.LocalStorage.prototype.commitDelay=100,puredom.LocalStorage.prototype.data={},puredom.LocalStorage.prototype.setAdapter=function(e){var t,n=this.constructor.adapters,r=(e+"").toLowerCase(),o=!1,i=!1;for(t in n)if(n.hasOwnProperty(t)&&(t+"").toLowerCase()===r&&(o=!0,n[t].test(this)===!0)){i=!0,this.adapterName=e,this.adapter=n[t];break}return o?i?!0:(puredom.log('
puredom.LocalStorage :: "'+e+'" adapter test() failed: conditions for adapter use not met.'),!1):(puredom.log('puredom.LocalStorage :: Could not find "'+e+'" adapter.'),!1)},puredom.LocalStorage.prototype.getAdapter=function(){return this.adapterName},puredom.LocalStorage.prototype.useBestAdapter=function(){var e,t,n,r=this.constructor.adapters;for(n in r)r.hasOwnProperty(n)&&"none"!==n&&r[n].test(this)===!0&&(!e||(Math.round(e.rating)||0)<(Math.round(r[n].rating)||0))&&(e=r[n],t=n);return e?(this.adapterName=t,this.adapter=e,!0):(setTimeout(function(){throw"puredom.LocalStorage :: Could not find the best adapter."},1),!1)},puredom.LocalStorage.prototype.getNamespace=function(e){var t,n=this;return e+="","."===e.substring(0,1)&&(e=e.substring(1)),"."===e.substring(e.length-1)&&(e=e.substring(0,e.length-1)),t=puredom.extend(new puredom.LocalStorage.NamespacedLocalStorage,{getAdapter:function(){return n.getAdapter()},getNamespace:this.getNamespace,getValue:function(t){return n.getValue(e+"."+t)},setValue:function(t,r){return n.setValue(e+"."+t,r),this},removeKey:function(t){return n.removeKey(e+"."+t),this},purge:function(){return n.removeKey(e),this},getData:function(){return n.getValue(e)},restore:function(e){var t,r=this;return e&&(t=function(){e(r),r=t=e=null}),n.restore(t),this},commit:function(e){var t,r=this;return e&&(t=function(){e(r),r=t=e=null}),n.commit(t),this}}),puredom.extend(t,{get:t.getValue,set:t.setValue,remove:t.removeKey}),t},puredom.LocalStorage.prototype.getData=function(){return this.data},puredom.LocalStorage.prototype.getValue=function(e){var t=puredom.delve(this.data,e);return t},puredom.LocalStorage.prototype.setValue=function(e,t){var n,r=this.data,o=e.split(".");for(n=0;o.length-1>n;n++)r.hasOwnProperty(o[n])||(r[o[n]]={}),r=r[o[n]];return void 0===t||null===t?(r[o[o.length-1]]=null,delete r[o[o.length-1]]):r[o[o.length-1]]=t,this.queueCommit(),this},puredom.LocalStorage.prototype.removeKey=function(e){return this.setValue(e,void 0),this},puredom.LocalStorage.prototype.get=puredom.LocalStorage.prototype.getValue,puredom.LocalStorage.prototype.set=puredom.LocalStorage.prototype.setValue,puredom.LocalStorage.prototype.remove=puredom.LocalStorage.prototype.removeKey,puredom.LocalStorage.prototype.purge=function(){return this.data={},this.queueCommit(),this},puredom.LocalStorage.prototype.restore=function(e){var t,n,r=this;return t=this._adapterCall("load",function(t){r.data=n=t||{},e&&e(r),r=null}),t&&!n&&(this.data=t,e&&e(this)),t=n=null,this},puredom.LocalStorage.prototype.commit=function(e){var t=this;return this._commitTimer&&(clearTimeout(this._commitTimer),this._commitTimer=null),this._adapterCall("save",this.data,function(){e&&e(t),t=null}),this},puredom.LocalStorage.prototype.queueCommit=function(){var e=this;this._commitTimer||(this._commitTimer=setTimeout(function(){e.commit(),e=null},this.commitDelay))},puredom.LocalStorage.prototype._adapterCall=function(e){return this.adapter&&this.adapter[e]?this.adapter[e].apply(this.adapter,[this].concat(puredom.toArray(arguments).slice(1))):void 0},puredom.LocalStorage.NamespacedLocalStorage=function(){},puredom.LocalStorage.adapters={},puredom.LocalStorage.addAdapter=function(e,t){if(!t.save)throw'puredom.LocalStorage :: Adapter "'+e+'" attempted to register, but does not provide a save() method.';if(!t.load)throw'puredom.LocalStorage :: Adapter "'+e+'" attempted to register, but does not provide a load() method.';this.adapters[e]=t},puredom.LocalStorage.adapters.none=function(){},puredom.extend(puredom.LocalStorage.adapters.none.prototype,{defaultName:"db",rating:0,test:function(){return!1},load:function(e,t){t&&t()},save:function(e,t,n){n&&n(!1)}}),puredom.LocalStorage.addAdapter("cookie",{defaultName:"db",rating:5,test:function(){return puredom.cookies&&puredom.cookies.get&&"cookie"in document?!0:!1},load:function(e,t){var n,r=puredom.cookies.get(e.id||this.defaultName);return r&&(n=puredom.json(r)),t&&t(n),n},save:function(e,t,n){puredom.cookies.set(e.id||this.defaultName,puredom.json(t)),n&&n(!0)}}),puredom.LocalStorage.addAdapter("LocalStorage",{defaultName:"db",rating:60,test:function(){var e,t="localStorage"in window&&"function"==typeof window.localStorage.hasOwnProperty,n=puredom.json({a:"a",b:4/3,c:!0,d:null});if(t)try{e=localStorage.__test,localStorage.__test=n,localStorage.__test!==n&&(t=!1),localStorage.__test=e,void 0===e&&delete localStorage.__test}catch(r){t=!1}return t},load:function(e,t){var n,r=this._getKey(e);return localStorage.hasOwnProperty(r)&&(n=puredom.json.parse(localStorage[r])),t&&t(n),n},save:function(e,t,n){var r=this._getKey(e);return void 0===t?delete localStorage[r]:localStorage[r]=puredom.json.stringify(t),n&&n(!0),!0},_getKey:function(e){return(e.id||this.defaultName||"")+""}}),puredom.LocalStorage.addAdapter("UserData",{defaultName:"db",rating:20,test:function(){return/\bMSIE\s[1-6](\.[0-9]*)?/gim.test(navigator.userAgent+"")?!1:document.body.addBehavior!==void 0},load:function(e,t){var n,r,o=this._getKey(e),i=this._getStore(o);return i&&(n=i.getAttribute("puredomlocalstorage")),n&&(r=puredom.json.parse(n)),t&&t(r),r},save:function(e,t,n){var r=this._getKey(e),o=this._getStore(r),i="puredomlocalstorage",a=!1;return o&&"save"in o&&(void 0===t?o.removeAttribute?o.removeAttribute(i):o.setAttribute(i,""):o.setAttribute(i,puredom.json.stringify(t)),o.save(r),a=!0),n&&n(a),a},_getStore:function(e){var t;return this.stores||(this.stores={}),t=this.stores[e],t||(t=this.stores[e]=document.getElementById(e),t||(t=this.stores[e]=document.createElement("span"),t.style.position="absolute",t.style.top="-100px",t.style.left="0",t.style.behavior="url('#default#userData')",document.body.appendChild(t))),"true"!==t.getAttribute("data-tdlsud-loaded")&&(t.setAttribute("data-tdlsud-loaded","true"),t.load(e)),t},_getKey:function(e){return"ieud"+(e.id||this.defaultName||"")}});
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

1 comment

Jason Miller (revision owner) commented :

Looks like I'll take advantage of ViewManager after all..

Add a comment