[
  {
    "path": "LICENSE.txt",
    "content": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, compile, sell, or\ndistribute this software, either in source code form or as a compiled\nbinary, for any purpose, commercial or non-commercial, and by any\nmeans.\n\nIn jurisdictions that recognize copyright laws, the author or authors\nof this software dedicate any and all copyright interest in the\nsoftware to the public domain. We make this dedication for the benefit\nof the public at large and to the detriment of our heirs and\nsuccessors. We intend this dedication to be an overt act of\nrelinquishment in perpetuity of all present and future rights to this\nsoftware under copyright law.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\nFor more information, please refer to <http://unlicense.org>\n"
  },
  {
    "path": "README.md",
    "content": "# FileDrop Revamped\n#### Self-contained cross-browser HTML5, legacy, AJAX, drag & drop JavaScript file upload\n\n**FileDrop** is a lightweight JavaScript class for easy-to-use file uploading that works out of the box and supports even most legacy browsers.\n\n[ [Documentation](http://filedropjs.org) | [Demo page](http://filedropjs.org/demo/) ]\n\n## Features\n\n* **Cross-browser** – supports Firefox 3.6, Internet Explorer 6, Google Chrome 7, Apple Safari 5 and Opera 11.61.\n* **No JS dependencies**, Flash or Java applets\n* 900 lines of code, 1300 lines of comments\n* **16 KiB minified**, 6 KiB gzipped\n* **HTML5, drag &amp; drop** for modern browsers\n* **IFrame fallback** for legacy agents (IE 6+)\n* Flexible **event system** with over 15 callbacks\n* Multiple **independent FileDrops** on one page\n* Ready for **jQuery**, PHP, ASP.net and others\n* 500+ lines of **unit tests** ([tests.html](http://filedropjs.org/demo/tests.html))\n\n## Basic example\n\n[Live demo](http://filedropjs.org/demo/basic.html) →\n\n```HTML\n<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>Basic FileDrop example</title>\n\n    <script type=\"text/javascript\" src=\"../filedrop.js\"></script>\n    <script type=\"text/javascript\" src=\"filedrop.js\"></script>\n\n    <style type=\"text/css\">\n    /***\n      Styles below are only required if you're using <iframe> fallback in\n      addition to HTML5 drag & drop (only working in Firefox/Chrome).\n     ***/\n\n    /* Essential FileDrop zone element configuration: */\n    .fd-zone {\n      position: relative;\n      overflow: hidden;\n      /* The following are not required but create a pretty box: */\n      width: 15em;\n      margin: 0 auto;\n      text-align: center;\n    }\n\n    /* Hides <input type=\"file\"> while simulating \"Browse\" button: */\n    .fd-file {\n      opacity: 0;\n      font-size: 118px;\n      position: absolute;\n      right: 0;\n      top: 0;\n      z-index: 1;\n      padding: 0;\n      margin: 0;\n      cursor: pointer;\n      filter: alpha(opacity=0);\n      font-family: sans-serif;\n    }\n\n    /* Provides visible feedback when use drags a file over the drop zone: */\n    .fd-zone.over { border-color: maroon; background: #eee; }\n    </style>\n  </head>\n  <body>\n    <noscript style=\"color: maroon\">\n      <h2>JavaScript is disabled in your browser. How do you expect FileDrop to work?</h2>\n    </noscript>\n\n    <h2 style=\"text-align: center\">\n      <a href=\"http://filedropjs.org\">FileDrop</a> basic sample\n    </h2>\n\n    <!-- A FileDrop area. Can contain any text or elements, or be empty.\n         Can be of any HTML tag too, not necessary fieldset. -->\n    <fieldset id=\"zone\">\n      <legend>Drop a file inside&hellip;</legend>\n      <p>Or click here to <em>Browse</em>..</p>\n\n      <!-- Putting another element on top of file input so it overlays it\n           and user can interact with it freely. -->\n      <p style=\"z-index: 10; position: relative\">\n        <input type=\"checkbox\" id=\"multiple\">\n        <label for=\"multiple\">Allow multiple selection</label>\n      </p>\n    </fieldset>\n\n    <script type=\"text/javascript\">\n      // Tell FileDrop we can deal with iframe uploads using this URL:\n      var options = {iframe: {url: 'upload.php'}};\n      // Attach FileDrop to an area ('zone' is an ID but you can also give a DOM node):\n      var zone = new FileDrop('zone', options);\n\n      // Do something when a user chooses or drops a file:\n      zone.event('send', function (files) {\n        // Depending on browser support files (FileList) might contain multiple items.\n        files.each(function (file) {\n          // React on successful AJAX upload:\n          file.event('done', function (xhr) {\n            // 'this' here points to fd.File instance that has triggered the event.\n            alert('Done uploading ' + this.name + ', response:\\n\\n' + xhr.responseText);\n          });\n\n          // Send the file:\n          file.sendTo('upload.php');\n        });\n      });\n\n      // React on successful iframe fallback upload (this is separate mechanism\n      // from proper AJAX upload hence another handler):\n      zone.event('iframeDone', function (xhr) {\n        alert('Done uploading via <iframe>, response:\\n\\n' + xhr.responseText);\n      });\n\n      // A bit of sugar - toggling multiple selection:\n      fd.addEvent(fd.byID('multiple'), 'change', function (e) {\n        zone.multiple(e.currentTarget || e.srcElement.checked);\n      });\n    </script>\n  </body>\n</html>\n```\n\n## jQuery integration\n\n FileDrop can be integrated with jQuery by simply calling the following method (once, after loading both FileDrop and jQuery): `fd.jQuery()`.\n\nDrop zone events are prefixed with **fd** while individual file events start with **file**. DOM node events are triggered before those assigned to `obj.on.XXX` arrays and if a node handler returns non-null value on’s events are skipped.\n\nNote that jQuery will prepend its own event object in front of FileDrop’s normal event arguments since they’re triggered as regular events of a DOM node. See extensive comments in the sources for more details and examples.\n\nMore information in the [documentation](http://filedropjs.org/#jquery) →\n\n```JS\nfd.jQuery();  // you can also pass an object like 'jQuery'.\n\n// Henceforth it's possible to access FileDrop as $().filedrop().\n$('<div><p>Drop something here...</p></div>')\n  .appendTo(document.body)\n  .filedrop()\n  // jQuery always passes event object as the first argument.\n  .on('fdsend', function (e, files) {\n    $.each(files, function (i, file) {\n      file.SendTo('upload.php');\n    });\n  })\n  .on('filedone', function (e, file) {\n    alert('Done uploading ' + file.name + ' on ' + this.tagName);\n  });\n```\n"
  },
  {
    "path": "demo/basic.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta charset=\"utf-8\">\n    <title>Basic FileDrop example</title>\n\n    <script type=\"text/javascript\" src=\"../filedrop.js\"></script>\n    <script type=\"text/javascript\" src=\"filedrop.js\"></script>\n\n    <style type=\"text/css\">\n    /***\n      Styles below are only required if you're using <iframe> fallback in\n      addition to HTML5 drag & drop (only working in Firefox/Chrome).\n     ***/\n\n    /* Essential FileDrop zone element configuration: */\n    .fd-zone {\n      position: relative;\n      overflow: hidden;\n      /* The following are not required but create a pretty box: */\n      width: 15em;\n      margin: 0 auto;\n      text-align: center;\n    }\n\n    /* Hides <input type=\"file\"> while simulating \"Browse\" button: */\n    .fd-file {\n      opacity: 0;\n      font-size: 118px;\n      position: absolute;\n      right: 0;\n      top: 0;\n      z-index: 1;\n      padding: 0;\n      margin: 0;\n      cursor: pointer;\n      filter: alpha(opacity=0);\n      font-family: sans-serif;\n    }\n\n    /* Provides visible feedback when use drags a file over the drop zone: */\n    .fd-zone.over { border-color: maroon; background: #eee; }\n    </style>\n  </head>\n  <body>\n    <noscript style=\"color: maroon\">\n      <h2>JavaScript is disabled in your browser. How do you expect FileDrop to work?</h2>\n    </noscript>\n\n    <h2 style=\"text-align: center\">\n      <a href=\"http://filedropjs.org\">FileDrop</a> basic sample\n    </h2>\n\n    <!-- A FileDrop area. Can contain any text or elements, or be empty.\n         Can be of any HTML tag too, not necessary fieldset. -->\n    <fieldset id=\"zone\">\n      <legend>Drop a file inside&hellip;</legend>\n      <p>Or click here to <em>Browse</em>..</p>\n\n      <!-- Putting another element on top of file input so it overlays it\n           and user can interact with it freely. -->\n      <p style=\"z-index: 10; position: relative\">\n        <input type=\"checkbox\" id=\"multiple\">\n        <label for=\"multiple\">Allow multiple selection</label>\n      </p>\n    </fieldset>\n\n    <script type=\"text/javascript\">\n      // Tell FileDrop we can deal with iframe uploads using this URL:\n      var options = {iframe: {url: 'upload.php'}};\n      // Attach FileDrop to an area ('zone' is an ID but you can also give a DOM node):\n      var zone = new FileDrop('zone', options);\n\n      // Do something when a user chooses or drops a file:\n      zone.event('send', function (files) {\n        // Depending on browser support files (FileList) might contain multiple items.\n        files.each(function (file) {\n          // React on successful AJAX upload:\n          file.event('done', function (xhr) {\n            // 'this' here points to fd.File instance that has triggered the event.\n            alert('Done uploading ' + this.name + ', response:\\n\\n' + xhr.responseText);\n          });\n\n          // Send the file:\n          file.sendTo('upload.php');\n        });\n      });\n\n      // React on successful iframe fallback upload (this is separate mechanism\n      // from proper AJAX upload hence another handler):\n      zone.event('iframeDone', function (xhr) {\n        alert('Done uploading via <iframe>, response:\\n\\n' + xhr.responseText);\n      });\n\n      // A bit of sugar - toggling multiple selection:\n      fd.addEvent(fd.byID('multiple'), 'change', function (e) {\n        zone.multiple(e.currentTarget || e.srcElement.checked);\n      });\n    </script>\n  </body>\n</html>"
  },
  {
    "path": "demo/ie9.js",
    "content": "/*\n  IE7/IE8/IE9.js - copyright 2004-2010, Dean Edwards\n  http://code.google.com/p/ie7-js/\n  http://www.opensource.org/licenses/mit-license.php\n*/\n;(function(N,p){var h=N.IE7={version:\"2.1(beta4)\",toString:bT(\"[IE7]\")};h.compat=9;var t=h.appVersion=navigator.appVersion.match(/MSIE (\\d\\.\\d)/)[1]-0;if(/ie7_off/.test(top.location.search)||t<5.5||t>=h.compat)return;var E=t<6,bj=bT(),bx=p.documentElement,B,x,cy=\"!\",U=\":link{ie7-link:link}:visited{ie7-link:visited}\",cz=/^[\\w\\.]+[^:]*$/;function bk(c,a){if(cz.test(c))c=(a||\"\")+c;return c};function by(c,a){c=bk(c,a);return c.slice(0,c.lastIndexOf(\"/\")+1)};var bU=p.scripts[p.scripts.length-1],cA=by(bU.src);try{var V=new ActiveXObject(\"Microsoft.XMLHTTP\")}catch(ex){}var bl={};function cB(c,a){try{c=bk(c,a);if(!bl[c]){V.open(\"GET\",c,false);V.send();if(V.status==0||V.status==200){bl[c]=V.responseText}}}catch(ex){}return bl[c]||\"\"};var dA=Array.prototype.slice,dB=/%([1-9])/g,cC=/^\\s\\s*/,cD=/\\s\\s*$/,cE=/([\\/()[\\]{}|*+-.,^$?\\\\])/g,bV=/\\bbase\\b/,bW=[\"constructor\",\"toString\"],bm;function F(){};F.extend=function(g,f){bm=true;var d=new this;O(d,g);bm=false;var c=d.constructor;function a(){if(!bm)c.apply(this,arguments)};d.constructor=a;a.extend=arguments.callee;O(a,f);a.prototype=d;return a};F.prototype.extend=function(a){return O(this,a)};var P=\"#\",Q=\"#\",bc=\".\",bn=\"/\",dC=/\\\\(\\d+)/g,cF=/\\[(\\\\.|[^\\]\\\\])+\\]|\\\\.|\\(\\?/g,cG=/\\(/g,cH=/\\$(\\d+)/,cI=/^\\$\\d+$/,cJ=/(\\[(\\\\.|[^\\]\\\\])+\\]|\\\\.|\\(\\?)|\\(/g,cK=/^<#\\w+>$/,cL=/<#(\\w+)>/g,G=F.extend({constructor:function(a){this[bc]=[];this[Q]={};this.merge(a)},add:function(c,a){delete this[bn];if(c instanceof RegExp){c=c.source}if(!this[P+c])this[bc].push(String(c));return this[Q][P+c]=new G.Item(c,a,this)},compile:function(a){if(a||!this[bn]){this[bn]=new RegExp(this,this.ignoreCase?\"gi\":\"g\")}return this[bn]},merge:function(c){for(var a in c)this.add(a,c[a])},exec:function(o){var k=this,l=k[bc],m=k[Q],j,i=this.compile(true).exec(o);if(i){var g=0,f=1;while((j=m[P+l[g++]])){var d=f+j.length+1;if(i[f]){if(j.replacement===0){return k.exec(o)}else{var c=i.slice(f,d),a=c.length;while(--a)c[a]=c[a]||\"\";c[0]={match:c[0],item:j};return c}}f=d}}return null},parse:function(o){o+=\"\";var k=this,l=k[bc],m=k[Q];return o.replace(this.compile(),function(j){var i=[],g,f=1,d=arguments.length;while(--d)i[d]=arguments[d]||\"\";while((g=m[P+l[d++]])){var c=f+g.length+1;if(i[f]){var a=g.replacement;switch(typeof a){case\"function\":return a.apply(k,i.slice(f,c));case\"number\":return i[f+a];default:return a}}f=c}return j})},toString:function(){var g=[],f=this[bc],d=this[Q],c;for(var a=0;c=d[P+f[a]];a++){g[a]=c.source}return\"(\"+g.join(\")|(\")+\")\"}},{IGNORE:null,Item:F.extend({constructor:function(k,l,m){var j=k.indexOf(\"(\")===-1?0:G.count(k),i=m.dictionary;if(i&&k.indexOf(\"<#\")!==-1){if(cK.test(k)){var g=i[Q][P+k.slice(2,-1)];k=g.replacement;j=g._5}else{k=i.parse(k)}}if(typeof l==\"number\")l=String(l);else if(l==null)l=0;if(typeof l==\"string\"&&cH.test(l)){if(cI.test(l)){var f=l.slice(1)-0;if(f&&f<=j)l=f}else{var d=l,c;l=function(a){if(!c){c=new RegExp(k,\"g\"+(this.ignoreCase?\"i\":\"\"))}return a.replace(c,d)}}}this.length=j;this.source=String(k);this.replacement=l}}),count:function(a){return(String(a).replace(cF,\"\").match(cG)||\"\").length}}),cM=G.extend({parse:function(f){var d=this[Q];return f.replace(cL,function(c,a){a=d[P+a];return a?a._6:c})},add:function(g,f){if(f instanceof RegExp){f=f.source}var d=f.replace(cJ,cN);if(f.indexOf(\"(\")!==-1){var c=G.count(f)}if(f.indexOf(\"<#\")!==-1){f=this.parse(f);d=this.parse(d)}var a=this.base(g,f);a._6=d;a._5=c||a.length;return a},toString:function(){return\"(<#\"+this[PATTERNS].join(\">)|(<#\")+\">)\"}});function cN(c,a){return a||\"(?:\"};function O(i,g){if(i&&g){var f=(typeof g==\"function\"?Function:Object).prototype;var d=bW.length,c;if(bm)while(c=bW[--d]){var a=g[c];if(a!=f[c]){if(bV.test(a)){bX(i,c,a)}else{i[c]=a}}}for(c in g)if(typeof f[c]==\"undefined\"){var a=g[c];if(i[c]&&typeof a==\"function\"&&bV.test(a)){bX(i,c,a)}else{i[c]=a}}}return i};function bX(i,g,f){var d=i[g];i[g]=function(){var c=this.base;this.base=d;var a=f.apply(this,arguments);this.base=c;return a}};function cO(f,d){if(!d)d=f;var c={};for(var a in f)c[a]=d[a];return c};function H(g){var f=arguments,d=new RegExp(\"%([1-\"+arguments.length+\"])\",\"g\");return String(g).replace(d,function(c,a){return a<f.length?f[a]:c})};function bo(c,a){return String(c).match(a)||[]};function bY(a){return String(a).replace(cE,\"\\\\$1\")};function bZ(a){return String(a).replace(cC,\"\").replace(cD,\"\")};function bT(a){return function(){return a}};var ca=G.extend({ignoreCase:true}),cP=/'/g,cb=/'(\\d+)'/g,dD=/\\\\/g,bz=/\\\\([nrtf'\"])/g,W=[],cc=new ca({\"<!\\\\-\\\\-|\\\\-\\\\->\":\"\",\"\\\\/\\\\*[^*]*\\\\*+([^\\\\/][^*]*\\\\*+)*\\\\/\":\"\",\"@(namespace|import)[^;\\\\n]+[;\\\\n]\":\"\",\"'(\\\\\\\\.|[^'\\\\\\\\])*'\":cd,'\"(\\\\\\\\.|[^\"\\\\\\\\])*\"':cd,\"\\\\s+\":\" \"});function cQ(a){return cc.parse(a).replace(bz,\"$1\")};function bd(a){return a.replace(cb,cR)};function cd(c){var a=W.length;W[a]=c.slice(1,-1).replace(bz,\"$1\").replace(cP,\"\\\\'\");return\"'\"+a+\"'\"};function cR(d,c){var a=W[c];if(a==null)return d;return\"'\"+W[c]+\"'\"};function bp(a){return a.indexOf(\"'\")===0?W[a.slice(1,-1)]:a};var cS=new G({Width:\"Height\",width:\"height\",Left:\"Top\",left:\"top\",Right:\"Bottom\",right:\"bottom\",onX:\"onY\"});function ce(a){return cS.parse(a)};var cf=[];function bA(a){cT(a);y(N,\"onresize\",a)};function y(d,c,a){d.attachEvent(c,a);cf.push(arguments)};function cU(d,c,a){try{d.detachEvent(c,a)}catch(ex){}};y(N,\"onunload\",function(){var a;while(a=cf.pop()){cU(a[0],a[1],a[2])}});function be(d,c,a){if(!d.elements)d.elements={};if(a)d.elements[c.uniqueID]=c;else delete d.elements[c.uniqueID];return a};y(N,\"onbeforeprint\",function(){if(!h.CSS.print)new cg(\"print\");h.CSS.print.recalc()});var ch=/^\\d+(px)?$/i,X=/^\\d+%$/,C=function(f,d){if(ch.test(d))return parseInt(d);var c=f.style.left,a=f.runtimeStyle.left;f.runtimeStyle.left=f.currentStyle.left;f.style.left=d||0;d=f.style.pixelLeft;f.style.left=c;f.runtimeStyle.left=a;return d},bB=\"ie7-\",ci=F.extend({constructor:function(){this.fixes=[];this.recalcs=[]},init:bj}),bC=[];function cT(a){bC.push(a)};h.recalc=function(){h.HTML.recalc();h.CSS.recalc();for(var a=0;a<bC.length;a++)bC[a]()};function bq(a){return a.currentStyle[\"ie7-position\"]==\"fixed\"};function bD(c,a){return c.currentStyle[bB+a]||c.currentStyle[a]};function Y(d,c,a){if(d.currentStyle[bB+c]==null){d.runtimeStyle[bB+c]=d.currentStyle[c]}d.runtimeStyle[c]=a};function cj(c){var a=p.createElement(c||\"object\");a.style.cssText=\"position:absolute;padding:0;display:block;border:none;clip:rect(0 0 0 0);left:-9999\";a.ie7_anon=true;return a};var bE=\"(e.nextSibling&&IE7._1(e,'next'))\",ck=bE.replace(/next/g,\"previous\"),cl=\"e.nodeName>'@'\",cm=\"if(\"+cl+\"){\",cn=\"(e.nodeName==='FORM'?IE7._0(e,'id'):e.id)\",cV=/a(#[\\w-]+)?(\\.[\\w-]+)?:(hover|active)/i,cW=/(.*)(:first-(line|letter))/,cX=/\\s/,cY=/((?:\\\\.|[^{\\\\])+)\\{((?:\\\\.|[^}\\\\])+)\\}/g,cZ=/(?:\\\\.|[^,\\\\])+/g,I=p.styleSheets,bF=[];h.CSS=new(ci.extend({parser:new ca,screen:\"\",print:\"\",styles:[],rules:[],pseudoClasses:t<7?\"first\\\\-child\":\"\",dynamicPseudoClasses:{toString:function(){var c=[];for(var a in this)c.push(a);return c.join(\"|\")}},init:function(){var j=\"^\\x01$\",i=\"\\\\[class=?[^\\\\]]*\\\\]\",g=[];if(this.pseudoClasses)g.push(this.pseudoClasses);var f=this.dynamicPseudoClasses.toString();if(f)g.push(f);g=g.join(\"|\");var d=t<7?[\"[>+~\\\\[(]|([:.])[\\\\w-]+\\\\1\"]:[i];if(g)d.push(\":(\"+g+\")\");this.UNKNOWN=new RegExp(d.join(\"|\")||j,\"i\");var c=t<7?[\"\\\\[[^\\\\]]+\\\\]|[^\\\\s(\\\\[]+\\\\s*[+~]\"]:[i],a=c.concat();if(g)a.push(\":(\"+g+\")\");u.COMPLEX=new RegExp(a.join(\"|\")||j,\"ig\");if(this.pseudoClasses)c.push(\":(\"+this.pseudoClasses+\")\");bf.COMPLEX=new RegExp(c.join(\"|\")||j,\"i\");f=\"not\\\\(:\"+f.split(\"|\").join(\"\\\\)|not\\\\(:\")+\"\\\\)|\"+f;bf.MATCH=new RegExp(f?\"(.*?):(\"+f+\")(.*)\":j,\"i\");this.createStyleSheet();this.refresh()},addEventHandler:function(){y.apply(null,arguments)},addFix:function(c,a){this.parser.add(c,a)},addRecalc:function(i,g,f,d){i=i.source||i;g=new RegExp(\"([{;\\\\s])\"+i+\"\\\\s*:\\\\s*\"+g+\"[^;}]*\");var c=this.recalcs.length;if(typeof d==\"string\")d=i+\":\"+d;this.addFix(g,function(a){if(typeof d==\"function\")d=d(a);return(d?d:a)+\";ie7-\"+a.slice(1)+\";ie7_recalc\"+c+\":1\"});this.recalcs.push(arguments);return c},apply:function(){this.getInlineCSS();new cg(\"screen\");this.trash()},createStyleSheet:function(){p.getElementsByTagName(\"head\")[0].appendChild(p.createElement(\"style\"));this.styleSheet=I[I.length-1];this.styleSheet.ie7=true;this.styleSheet.owningElement.ie7=true;this.styleSheet.cssText=U},getInlineCSS:function(){var d=p.getElementsByTagName(\"style\"),c;for(var a=d.length-1;c=d[a];a--){if(!c.disabled&&!c.ie7){c._7=c.innerHTML}}},getText:function(d,c){try{var a=d.cssText}catch(e){a=\"\"}if(V)a=cB(d.href,c)||a;return a},recalc:function(){this.screen.recalc();var q=/ie7_recalc\\d+/g,n=U.match(/[{,]/g).length,o=this.styleSheet.rules,k,l,m,j,i,g,f,d,c;for(g=n;k=o[g];g++){var a=k.style.cssText;if(l=a.match(q)){j=J(k.selectorText);if(j.length)for(f=0;f<l.length;f++){c=l[f];m=h.CSS.recalcs[c.slice(10)][2];for(d=0;(i=j[d]);d++){if(i.currentStyle[c])m(i,a)}}}}},refresh:function(){this.styleSheet.cssText=U+this.screen+this.print},trash:function(){for(var c=0;c<I.length;c++){if(!I[c].ie7){try{var a=I[c].cssText}catch(e){a=\"\"}if(a)I[c].cssText=\"\"}}}}));var cg=F.extend({constructor:function(a){this.media=a;this.load();h.CSS[a]=this;h.CSS.refresh()},createRule:function(d,c){var a;if(R&&(a=d.match(R.MATCH))){return new R(a[1],a[2],c)}else if(a=d.match(bf.MATCH)){if(!cV.test(a[0])||bf.COMPLEX.test(a[0])){return new bf(d,a[1],a[2],a[3],c)}}else{return new u(d,c)}return d+\" {\"+c+\"}\"},getText:function(){var v=/@media\\s+([^{]+?)\\s*\\{([^@]+\\})\\s*\\}/gi,Z=/@import[^;\\n]+/gi,S=/@import\\s+url\\s*\\(\\s*[\"']?|[\"']?\\s*\\)\\s*/gi,ba=/(url\\s*\\(\\s*['\"]?)([\\w\\.]+[^:\\)]*['\"]?\\))/gi,K=this,L={};function z(k,l,m,j){var i=\"\";if(!j){m=q(k.media);j=0}if(m===\"none\"){k.disabled=true;return\"\"}if(m===\"all\"||m===K.media){try{var g=!!k.cssText}catch(exe){}if(j<3&&g){var f=k.cssText.match(Z);for(var d=0,c;d<k.imports.length;d++){var c=k.imports[d];var a=k._2||k.href;c._2=f[d].replace(S,\"\");i+=z(c,by(a,l),m,j+1)}}i+=cQ(k.href?n(k,l):k.owningElement._7);i=A(i,K.media)}return i};for(var w=0;w<I.length;w++){var r=I[w];if(!r.disabled&&!r.ie7)this.cssText+=z(r)}function A(c,a){s.value=a;return c.replace(v,s)};function s(d,c,a){c=q(c);switch(c){case\"screen\":case\"print\":if(c!==s.value)return\"\";case\"all\":return a}return\"\"};function q(d){if(!d)return\"all\";var c=d.toLowerCase().split(/\\s*,\\s*/);d=\"none\";for(var a=0;a<c.length;a++){if(c[a]===\"all\")return\"all\";if(c[a]===\"screen\"){if(d===\"print\")return\"all\";d=\"screen\"}else if(c[a]===\"print\"){if(d===\"screen\")return\"all\";d=\"print\"}}return d};function n(f,d){var c=f._2||f.href,a=bk(c,d);if(L[a])return\"\";L[a]=f.disabled?\"\":o(h.CSS.getText(f,d),by(c,d));return L[a]};function o(c,a){return c.replace(ba,\"$1\"+a.slice(0,a.lastIndexOf(\"/\")+1)+\"$2\")}},load:function(){this.cssText=\"\";this.getText();this.parse();if(bF.length){this.cssText=da(this.cssText)}this.cssText=bd(this.cssText);bl={}},parse:function(){var j=h.CSS.parser.parse(this.cssText),o=\"\";this.cssText=j.replace(/@charset[^;]+;|@font\\-face[^\\}]+\\}/g,function(a){o+=a+\"\\n\";return\"\"});this.declarations=bd(o);var k=h.CSS.rules.length,l=[],m;while((m=cY.exec(this.cssText))){var j=m[2];if(j){var i=t<7&&j.indexOf(\"AlphaImageLoader\")!==-1;var g=m[1].match(cZ),f;for(var d=0;f=g[d];d++){f=bZ(f);var c=h.CSS.UNKNOWN.test(f);g[d]=c?this.createRule(f,j):f+\"{\"+j+\"}\";if(i)g[d]+=this.createRule(f+\">*\",\"position:relative\")}l.push(g.join(\"\\n\"))}}this.cssText=l.join(\"\\n\");this.rules=h.CSS.rules.slice(k)},recalc:function(){var c,a;for(a=0;(c=this.rules[a]);a++)c.recalc()},toString:function(){return this.declarations+\"@media \"+this.media+\"{\"+this.cssText+\"}\"}}),R,u=h.Rule=F.extend({constructor:function(d,c){this.id=h.CSS.rules.length;this.className=u.PREFIX+this.id;var a=d.match(cW);this.selector=(a?a[1]:d)||\"*\";this.selectorText=this.parse(this.selector)+(a?a[2]:\"\");this.cssText=c;this.MATCH=new RegExp(\"\\\\s\"+this.className+\"(\\\\s|$)\",\"g\");h.CSS.rules.push(this);this.init()},init:bj,add:function(a){a.className+=\" \"+this.className},recalc:function(){var c=J(this.selector);for(var a=0;a<c.length;a++)this.add(c[a])},parse:function(g){var f=g.replace(u.CHILD,\" \").replace(u.COMPLEX,\"\");if(t<7)f=f.replace(u.MULTI,\"\");var d=bo(f,u.TAGS).length-bo(g,u.TAGS).length,c=bo(f,u.CLASSES).length-bo(g,u.CLASSES).length+1;while(c>0&&u.CLASS.test(f)){f=f.replace(u.CLASS,\"\");c--}while(d>0&&u.TAG.test(f)){f=f.replace(u.TAG,\"$1*\");d--}f+=\".\"+this.className;c=Math.min(c,2);d=Math.min(d,2);var a=-10*c-d;if(a>0){f=f+\",\"+u.MAP[a]+\" \"+f}return f},remove:function(a){a.className=a.className.replace(this.MATCH,\"$1\")},toString:function(){return H(\"%1 {%2}\",this.selectorText,this.cssText)}},{CHILD:/>/g,CLASS:/\\.[\\w-]+/,CLASSES:/[.:\\[]/g,MULTI:/(\\.[\\w-]+)+/g,PREFIX:\"ie7_class\",TAG:/^\\w+|([\\s>+~])\\w+/,TAGS:/^\\w|[\\s>+~]\\w/g,MAP:{\"1\":\"html\",\"2\":\"html body\",\"10\":\".ie7_html\",\"11\":\"html.ie7_html\",\"12\":\"html.ie7_html body\",\"20\":\".ie7_html .ie7_body\",\"21\":\"html.ie7_html .ie7_body\",\"22\":\"html.ie7_html body.ie7_body\"}}),bf=u.extend({constructor:function(g,f,d,c,a){this.negated=d.indexOf(\"not\")===0;if(this.negated)d=d.slice(5,-1);this.attach=f||\"*\";this.dynamicPseudoClass=h.CSS.dynamicPseudoClasses[d];this.target=c;this.base(g,a)},recalc:function(){var f=J(this.attach),d;for(var c=0;d=f[c];c++){var a=this.target?J(this.target,d):[d];if(a.length)this.dynamicPseudoClass.apply(d,a,this)}}}),M=F.extend({constructor:function(c,a){this.name=c;this.apply=a;this.instances={};h.CSS.dynamicPseudoClasses[c]=this},register:function(g,f){var d=g[2];if(!f&&d.negated){this.unregister(g,true)}else{g.id=d.id+g[0].uniqueID;if(!this.instances[g.id]){var c=g[1],a;for(a=0;a<c.length;a++)d.add(c[a]);this.instances[g.id]=g}}},unregister:function(g,f){var d=g[2];if(!f&&d.negated){this.register(g,true)}else{if(this.instances[g.id]){var c=g[1],a;for(a=0;a<c.length;a++)d.remove(c[a]);delete this.instances[g.id]}}}}),br=new M(\"hover\",function(c){var a=arguments;h.CSS.addEventHandler(c,\"onmouseenter\",function(){br.register(a)});h.CSS.addEventHandler(c,\"onmouseleave\",function(){br.unregister(a)})});y(p,\"onmouseup\",function(){var c=br.instances;for(var a in c)if(!c[a][0].contains(event.srcElement))br.unregister(c[a])});var co={\"=\":\"%1==='%2'\",\"~=\":\"(' '+%1+' ').indexOf(' %2 ')!==-1\",\"|=\":\"%1==='%2'||%1.indexOf('%2-')===0\",\"^=\":\"%1.indexOf('%2')===0\",\"$=\":\"%1.slice(-'%2'.length)==='%2'\",\"*=\":\"%1.indexOf('%2')!==-1\"};co[\"\"]=\"%1!=null\";var T={\"<#attr>\":function(g,f,d,c){var a=\"IE7._0(e,'\"+f+\"')\";c=bp(c);if(d.length>1){if(!c||d===\"~=\"&&cX.test(c)){return\"false&&\"}a=\"(\"+a+\"||'')\"}return\"(\"+H(co[d],a,c)+\")&&\"},\"<#id>\":cn+\"==='$1'&&\",\"<#class>\":\"e.className&&(' '+e.className+' ').indexOf(' $1 ')!==-1&&\",\":first-child\":\"!\"+ck+\"&&\",\":link\":\"e.currentStyle['ie7-link']=='link'&&\",\":visited\":\"e.currentStyle['ie7-link']=='visited'&&\"};h.HTML=new(ci.extend({fixed:{},init:bj,addFix:function(){this.fixes.push(arguments)},apply:function(){for(var f=0;f<this.fixes.length;f++){var d=J(this.fixes[f][0]);var c=this.fixes[f][1];for(var a=0;a<d.length;a++)c(d[a])}},addRecalc:function(){this.recalcs.push(arguments)},recalc:function(){for(var j=0;j<this.recalcs.length;j++){var i=J(this.recalcs[j][0]);var g=this.recalcs[j][1],f;var d=Math.pow(2,j);for(var c=0;(f=i[c]);c++){var a=f.uniqueID;if((this.fixed[a]&d)===0){f=g(f)||f;this.fixed[a]|=d}}}}}));if(t<7){p.createElement(\"abbr\");h.HTML.addRecalc(\"label\",function(c){if(!c.htmlFor){var a=J(\"input,textarea\",c,true);if(a){y(c,\"onclick\",function(){a.click()})}}})}var bg=\"[.\\\\d]\";(function(){var v=h.Layout={};U+=\"*{boxSizing:content-box}\";v.boxSizing=function(a){if(!a.currentStyle.hasLayout){a.style.height=\"0cm\";if(a.currentStyle.verticalAlign===\"auto\")a.runtimeStyle.verticalAlign=\"top\";Z(a)}};function Z(a){if(a!=x&&a.currentStyle.position!==\"absolute\"){S(a,\"marginTop\");S(a,\"marginBottom\")}};function S(g,f){if(!g.runtimeStyle[f]){var d=g.parentElement;var c=f===\"marginTop\";if(d&&d.currentStyle.hasLayout&&!h._1(g,c?\"previous\":\"next\"))return;var a=g[c?\"firstChild\":\"lastChild\"];if(a&&a.nodeName<\"@\")a=h._1(a,c?\"next\":\"previous\");if(a&&a.currentStyle.styleFloat===\"none\"&&a.currentStyle.hasLayout){S(a,f);margin=ba(g,g.currentStyle[f]);childMargin=ba(a,a.currentStyle[f]);if(margin<0||childMargin<0){g.runtimeStyle[f]=margin+childMargin}else{g.runtimeStyle[f]=Math.max(childMargin,margin)}a.runtimeStyle[f]=\"0px\"}}};function ba(c,a){return a===\"auto\"?0:C(c,a)};var K=/^[.\\d][\\w]*$/,L=/^(auto|0cm)$/,z={};v.borderBox=function(a){z.Width(a);z.Height(a)};var w=function(r){z.Width=function(a){if(!X.test(a.currentStyle.width))A(a);if(r)Z(a)};function A(c,a){if(!c.runtimeStyle.fixedWidth){if(!a)a=c.currentStyle.width;c.runtimeStyle.fixedWidth=K.test(a)?Math.max(0,n(c,a))+\"px\":a;Y(c,\"width\",c.runtimeStyle.fixedWidth)}};function s(c){if(!bq(c)){var a=c.offsetParent;while(a&&!a.currentStyle.hasLayout)a=a.offsetParent}return(a||x).clientWidth};function q(c,a){if(X.test(a))return parseInt(parseFloat(a)/100*s(c));return C(c,a)};var n=function(f,d){var c=f.currentStyle[\"ie7-box-sizing\"]===\"border-box\",a=0;if(E&&!c)a+=o(f)+k(f,\"padding\");else if(!E&&c)a-=o(f)+k(f,\"padding\");return q(f,d)+a};function o(a){return a.offsetWidth-a.clientWidth};function k(c,a){return q(c,c.currentStyle[a+\"Left\"])+q(c,c.currentStyle[a+\"Right\"])};U+=\"*{minWidth:none;maxWidth:none;min-width:none;max-width:none}\";v.minWidth=function(a){if(a.currentStyle[\"min-width\"]!=null){a.style.minWidth=a.currentStyle[\"min-width\"]}if(be(arguments.callee,a,a.currentStyle.minWidth!==\"none\")){v.boxSizing(a);A(a);l(a)}};eval(\"IE7.Layout.maxWidth=\"+String(v.minWidth).replace(/min/g,\"max\"));function l(d){if(d==p.body){var c=d.clientWidth}else{var a=d.getBoundingClientRect();c=a.right-a.left}if(d.currentStyle.minWidth!==\"none\"&&c<n(d,d.currentStyle.minWidth)){d.runtimeStyle.width=d.currentStyle.minWidth}else if(d.currentStyle.maxWidth!==\"none\"&&c>=n(d,d.currentStyle.maxWidth)){d.runtimeStyle.width=d.currentStyle.maxWidth}else{d.runtimeStyle.width=d.runtimeStyle.fixedWidth}};function m(a){if(be(m,a,/^(fixed|absolute)$/.test(a.currentStyle.position)&&bD(a,\"left\")!==\"auto\"&&bD(a,\"right\")!==\"auto\"&&L.test(bD(a,\"width\")))){j(a);v.boxSizing(a)}};v.fixRight=m;function j(d){var c=q(d,d.runtimeStyle._3||d.currentStyle.left),a=s(d)-q(d,d.currentStyle.right)-c-k(d,\"margin\");if(parseInt(d.runtimeStyle.width)===a)return;d.runtimeStyle.width=\"\";if(bq(d)||r||d.offsetWidth<a){if(!E)a-=o(d)+k(d,\"padding\");if(a<0)a=0;d.runtimeStyle.fixedWidth=a;Y(d,\"width\",a)}};var i=0;bA(function(){if(!x)return;var g,f=(i<x.clientWidth);i=x.clientWidth;var d=v.minWidth.elements;for(g in d){var c=d[g];var a=(parseInt(c.runtimeStyle.width)===n(c,c.currentStyle.minWidth));if(f&&a)c.runtimeStyle.width=\"\";if(f==a)l(c)}var d=v.maxWidth.elements;for(g in d){var c=d[g];var a=(parseInt(c.runtimeStyle.width)===n(c,c.currentStyle.maxWidth));if(!f&&a)c.runtimeStyle.width=\"\";if(f!==a)l(c)}for(g in m.elements)j(m.elements[g])});if(E){h.CSS.addRecalc(\"width\",bg,z.Width)}if(t<7){h.CSS.addRecalc(\"max-width\",bg,v.maxWidth);h.CSS.addRecalc(\"right\",bg,m)}else if(t==7){if(r)h.CSS.addRecalc(\"height\",\"[\\\\d.]+%\",function(element){element.runtimeStyle.pixelHeight=parseInt(s(element)*element.currentStyle[\"ie7-height\"].slice(0,-1)/100)})}};eval(\"var _8=\"+ce(w));w();_8(true);if(t<7){h.CSS.addRecalc(\"min-width\",bg,v.minWidth);h.CSS.addFix(/\\bmin-height\\s*/,\"height\")}})();var bG=bk(\"blank.gif\",cA),bH=\"DXImageTransform.Microsoft.AlphaImageLoader\",cp=\"progid:\"+bH+\"(src='%1',sizingMethod='%2')\",bh,bi=[];function cq(c){if(bh.test(c.src)){var a=new Image(c.width,c.height);a.onload=function(){c.width=a.width;c.height=a.height;a=null};a.src=c.src;c.pngSrc=c.src;bs(c)}};if(t<7){h.CSS.addFix(/background(-image)?\\s*:\\s*([^};]*)?url\\(([^\\)]+)\\)([^;}]*)?/,function(g,f,d,c,a){c=bp(c);return bh.test(c)?\"filter:\"+H(cp,c,a.indexOf(\"no-repeat\")===-1?\"scale\":\"crop\")+\";zoom:1;background\"+(f||\"\")+\":\"+(d||\"\")+\"none\"+(a||\"\"):g});h.CSS.addRecalc(/list\\-style(\\-image)?/,\"[^};]*url\",function(f){var d=f.currentStyle.listStyleImage.slice(5,-2);if(bh.test(d)){if(f.nodeName===\"LI\"){cr(f,d)}else if(f.nodeName===\"UL\"){for(var c=0,a;a=f.childNodes[c];c++){if(a.nodeName===\"LI\")cr(a,d)}}}});function cr(i,g){var f=i.runtimeStyle,d=i.offsetHeight,c=new Image;c.onload=function(){var a=i.currentStyle.paddingLeft;a=a===\"0px\"?0:C(i,a);f.paddingLeft=(a+this.width)+\"px\";f.marginLeft=-this.width+\"px\";f.listStyleType=\"none\";f.listStyleImage=\"none\";f.paddingTop=Math.max(d-i.offsetHeight,0)+\"px\";bs(i,\"crop\",g);i.style.zoom=\"100%\"};c.src=g};h.HTML.addRecalc(\"img,input\",function(a){if(a.nodeName===\"INPUT\"&&a.type!==\"image\")return;cq(a);y(a,\"onpropertychange\",function(){if(!bI&&event.propertyName===\"src\"&&a.src.indexOf(bG)===-1)cq(a)})});var bI=false;y(N,\"onbeforeprint\",function(){bI=true;for(var a=0;a<bi.length;a++)db(bi[a])});y(N,\"onafterprint\",function(){for(var a=0;a<bi.length;a++)bs(bi[a]);bI=false})}function bs(f,d,c){var a=f.filters[bH];if(a){a.src=c||f.src;a.enabled=true}else{f.runtimeStyle.filter=H(cp,c||f.src,d||\"scale\");bi.push(f)}f.src=bG};function db(a){a.src=a.pngSrc;a.filters[bH].enabled=false};(function(){if(t>=7)return;h.CSS.addRecalc(\"position\",\"fixed\",o,\"absolute\");h.CSS.addRecalc(\"background(-attachment)?\",\"[^};]*fixed\",q);var z=E?\"body\":\"documentElement\";function w(){if(B.currentStyle.backgroundAttachment!==\"fixed\"){if(B.currentStyle.backgroundImage===\"none\"){B.runtimeStyle.backgroundRepeat=\"no-repeat\";B.runtimeStyle.backgroundImage=\"url(\"+bG+\")\"}B.runtimeStyle.backgroundAttachment=\"fixed\"}w=bj};var r=cj(\"img\");function A(a){return a?bq(a)||A(a.parentElement):false};function s(d,c,a){setTimeout(\"document.all.\"+d.uniqueID+\".runtimeStyle.setExpression('\"+c+\"','\"+a+\"')\",0)};function q(a){if(be(q,a,a.currentStyle.backgroundAttachment===\"fixed\"&&!a.contains(B))){w();j.bgLeft(a);j.bgTop(a);n(a)}};function n(c){r.src=c.currentStyle.backgroundImage.slice(5,-2);var a=c.canHaveChildren?c:c.parentElement;a.appendChild(r);j.setOffsetLeft(c);j.setOffsetTop(c);a.removeChild(r)};function o(a){if(be(o,a,bq(a))){Y(a,\"position\",\"absolute\");Y(a,\"left\",a.currentStyle.left);Y(a,\"top\",a.currentStyle.top);w();h.Layout.fixRight(a);k(a)}};function k(d,c){p.body.getBoundingClientRect();j.positionTop(d,c);j.positionLeft(d,c,true);if(!d.runtimeStyle.autoLeft&&d.currentStyle.marginLeft===\"auto\"&&d.currentStyle.right!==\"auto\"){var a=x.clientWidth-j.getPixelWidth(d,d.currentStyle.right)-j.getPixelWidth(d,d.runtimeStyle._3)-d.clientWidth;if(d.currentStyle.marginRight===\"auto\")a=parseInt(a/2);if(A(d.offsetParent))d.runtimeStyle.pixelLeft+=a;else d.runtimeStyle.shiftLeft=a}if(!d.runtimeStyle.fixedWidth)j.clipWidth(d);if(!d.runtimeStyle.fixedHeight)j.clipHeight(d)};function l(){var c=q.elements;for(var a in c)n(c[a]);c=o.elements;for(a in c){k(c[a],true);k(c[a],true)}m=0};var m;bA(function(){if(!m)m=setTimeout(l,100)});var j={},i=function(g){g.bgLeft=function(a){a.style.backgroundPositionX=a.currentStyle.backgroundPositionX;if(!A(a)){s(a,\"backgroundPositionX\",\"(parseInt(runtimeStyle.offsetLeft)+document.\"+z+\".scrollLeft)||0\")}};g.setOffsetLeft=function(c){var a=A(c)?\"backgroundPositionX\":\"offsetLeft\";c.runtimeStyle[a]=g.getOffsetLeft(c,c.style.backgroundPositionX)-c.getBoundingClientRect().left-c.clientLeft+2};g.getOffsetLeft=function(c,a){switch(a){case\"left\":case\"top\":return 0;case\"right\":case\"bottom\":return x.clientWidth-r.offsetWidth;case\"center\":return(x.clientWidth-r.offsetWidth)/2;default:if(X.test(a)){return parseInt((x.clientWidth-r.offsetWidth)*parseFloat(a)/100)}r.style.left=a;return r.offsetLeft}};g.clipWidth=function(f){var d=f.runtimeStyle.fixWidth;f.runtimeStyle.borderRightWidth=\"\";f.runtimeStyle.width=d?g.getPixelWidth(f,d)+\"px\":\"\";if(f.currentStyle.width!==\"auto\"){var c=f.getBoundingClientRect();var a=f.offsetWidth-x.clientWidth+c.left-2;if(a>=0){f.runtimeStyle.borderRightWidth=\"0px\";a=Math.max(C(f,f.currentStyle.width)-a,0);Y(f,\"width\",a);return a}}};g.positionLeft=function(c,a){if(!a&&X.test(c.currentStyle.width)){c.runtimeStyle.fixWidth=c.currentStyle.width}if(c.runtimeStyle.fixWidth){c.runtimeStyle.width=g.getPixelWidth(c,c.runtimeStyle.fixWidth)}c.runtimeStyle.shiftLeft=0;c.runtimeStyle._3=c.currentStyle.left;c.runtimeStyle.autoLeft=c.currentStyle.right!==\"auto\"&&c.currentStyle.left===\"auto\";c.runtimeStyle.left=\"\";c.runtimeStyle.screenLeft=g.getScreenLeft(c);c.runtimeStyle.pixelLeft=c.runtimeStyle.screenLeft;if(!a&&!A(c.offsetParent)){s(c,\"pixelLeft\",\"runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document.\"+z+\".scrollLeft\")}};g.getScreenLeft=function(d){var c=d.offsetLeft,a=1;if(d.runtimeStyle.autoLeft){c=x.clientWidth-d.offsetWidth-g.getPixelWidth(d,d.currentStyle.right)}if(d.currentStyle.marginLeft!==\"auto\"){c-=g.getPixelWidth(d,d.currentStyle.marginLeft)}while(d=d.offsetParent){if(d.currentStyle.position!==\"static\")a=-1;c+=d.offsetLeft*a}return c};g.getPixelWidth=function(c,a){return X.test(a)?parseInt(parseFloat(a)/100*x.clientWidth):C(c,a)}};eval(\"var _9=\"+ce(i));i(j);_9(j)})();if(t<7){var bJ={backgroundColor:\"transparent\",backgroundImage:\"none\",backgroundPositionX:null,backgroundPositionY:null,backgroundRepeat:null,borderTopWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftStyle:\"none\",borderTopStyle:\"none\",borderRightStyle:\"none\",borderBottomStyle:\"none\",borderLeftWidth:0,borderLeftColor:\"#000\",borderTopColor:\"#000\",borderRightColor:\"#000\",borderBottomColor:\"#000\",height:null,marginTop:0,marginBottom:0,marginRight:0,marginLeft:0,width:\"100%\"};h.CSS.addRecalc(\"overflow\",\"visible\",function(d){if(d.currentStyle.position===\"absolute\")return;if(d.parentNode.ie7_wrapped)return;if(h.Layout&&d.currentStyle[\"max-height\"]!==\"auto\"){h.Layout.maxHeight(d)}if(d.currentStyle.marginLeft===\"auto\")d.style.marginLeft=0;if(d.currentStyle.marginRight===\"auto\")d.style.marginRight=0;var c=p.createElement(cy);c.ie7_wrapped=d;for(var a in bJ){c.style[a]=d.currentStyle[a];if(bJ[a]!=null){d.runtimeStyle[a]=bJ[a]}}c.style.display=\"block\";c.style.position=\"relative\";d.runtimeStyle.position=\"absolute\";d.parentNode.insertBefore(c,d);c.appendChild(d)})}function dc(){var s=\"xx-small,x-small,small,medium,large,x-large,xx-large\".split(\",\");for(var q=0;q<s.length;q++){s[s[q]]=s[q-1]||\"0.67em\"}h.CSS.addFix(/(font(-size)?\\s*:\\s*)([\\w.-]+)/,function(f,d,c,a){return d+(s[a]||a)});var n=/^\\-/,o=/(em|ex)$/i,k=/em$/i,l=/ex$/i;C=function(d,c){if(ch.test(c))return parseInt(c)||0;var a=n.test(c)?-1:1;if(o.test(c))a*=j(d);m.style.width=a<0?c.slice(1):c;B.appendChild(m);c=a*m.offsetWidth;m.removeNode();return parseInt(c)};var m=cj();function j(d){var c=1;m.style.fontFamily=d.currentStyle.fontFamily;m.style.lineHeight=d.currentStyle.lineHeight;while(d!=B){var a=d.currentStyle[\"ie7-font-size\"];if(a){if(k.test(a))c*=parseFloat(a);else if(X.test(a))c*=(parseFloat(a)/100);else if(l.test(a))c*=(parseFloat(a)/2);else{m.style.fontSize=a;return 1}}d=d.parentElement}return c};h.CSS.addFix(/cursor\\s*:\\s*pointer/,\"cursor:hand\");h.CSS.addFix(/display\\s*:\\s*list-item/,\"display:block\");function i(f){var d=f.parentElement,c=d.offsetWidth-f.offsetWidth-g(d),a=(f.currentStyle[\"ie7-margin\"]&&f.currentStyle.marginRight===\"auto\")||f.currentStyle[\"ie7-margin-right\"]===\"auto\";switch(d.currentStyle.textAlign){case\"right\":c=a?parseInt(c/2):0;f.runtimeStyle.marginRight=c+\"px\";break;case\"center\":if(a)c=0;default:if(a)c/=2;f.runtimeStyle.marginLeft=parseInt(c)+\"px\"}};function g(a){return C(a,a.currentStyle.paddingLeft)+C(a,a.currentStyle.paddingRight)};h.CSS.addRecalc(\"margin(-left|-right)?\",\"[^};]*auto\",function(a){if(be(i,a,a.parentElement&&a.currentStyle.display===\"block\"&&a.currentStyle.marginLeft===\"auto\"&&a.currentStyle.position!==\"absolute\")){i(a)}});bA(function(){for(var c in i.elements){var a=i.elements[c];a.runtimeStyle.marginLeft=a.runtimeStyle.marginRight=\"\";i(a)}})};var bK=\"\\\\([^)]+\\\\)\";cc.add(/::(before|after)/,\":$1\");if(t<8){if(h.CSS.pseudoClasses)h.CSS.pseudoClasses+=\"|\";h.CSS.pseudoClasses+=\"before|after|lang\"+bK;function da(a){return a.replace(new RegExp(\"([{;\\\\s])(\"+bF.join(\"|\")+\")\\\\s*:\\\\s*([^;}]+)\",\"g\"),\"$1$2:$3;ie7-$2:$3\")};var dd=/[\\w-]+\\s*:\\s*inherit/g;var de=/ie7\\-|\\s*:\\s*inherit/g;var df=/\\-([a-z])/g;function dg(c,a){return a.toUpperCase()};h.CSS.addRecalc(\"[\\\\w-]+\",\"inherit\",function(g,f){if(g.parentElement){var d=f.match(dd);for(var c=0;c<d.length;c++){var a=d[c].replace(de,\"\");if(g.currentStyle[\"ie7-\"+a]===\"inherit\"){a=a.replace(df,dg);g.runtimeStyle[a]=g.parentElement.currentStyle[a]}}}},function(a){bF.push(bY(a.slice(1).split(\":\")[0]));return a});var bt=new M(\"focus\",function(c){var a=arguments;h.CSS.addEventHandler(c,\"onfocus\",function(){bt.unregister(a);bt.register(a)});h.CSS.addEventHandler(c,\"onblur\",function(){bt.unregister(a)});if(c==p.activeElement){bt.register(a)}});var bL=new M(\"active\",function(c){var a=arguments;h.CSS.addEventHandler(c,\"onmousedown\",function(){bL.register(a)})});y(p,\"onmouseup\",function(){var c=bL.instances;for(var a in c)bL.unregister(c[a])});var dh=/^url\\s*\\(\\s*([^)]*)\\)$/;var di={before0:\"beforeBegin\",before1:\"afterBegin\",after0:\"afterEnd\",after1:\"beforeEnd\"};var R=h.PseudoElement=u.extend({constructor:function(j,i,g){this.position=i;var f=g.match(R.CONTENT),d,c;if(f){f=f[1];d=f.split(/\\s+/);for(var a=0;(c=d[a]);a++){d[a]=/^attr/.test(c)?{attr:c.slice(5,-1)}:c.charAt(0)===\"'\"?bp(c):bd(c)}f=d}this.content=f;this.base(j,bd(g))},init:function(){this.match=J(this.selector);for(var c=0;c<this.match.length;c++){var a=this.match[c].runtimeStyle;if(!a[this.position])a[this.position]={cssText:\"\"};a[this.position].cssText+=\";\"+this.cssText;if(this.content!=null)a[this.position].content=this.content}},create:function(n){var o=n.runtimeStyle[this.position];if(o){var k=[].concat(o.content||\"\");for(var l=0;l<k.length;l++){if(typeof k[l]==\"object\"){k[l]=n.getAttribute(k[l].attr)}}k=k.join(\"\");var m=k.match(dh);var j=\"overflow:hidden;\"+o.cssText.replace(/'/g,'\"');var i=di[this.position+Number(n.canHaveChildren)];var g='ie7_pseudo'+R.count++;n.insertAdjacentHTML(i,H(R.ANON,this.className,g,j,m?\"\":k));if(m){var f=bp(m[1]);var d=p.getElementById(g);d.src=f;bs(d,\"crop\");var c=n.currentStyle.styleFloat!==\"none\";if(d.currentStyle.display===\"inline\"||c){if(t<7&&c&&n.canHaveChildren){n.runtimeStyle.display=\"inline\";n.runtimeStyle.position=\"relative\";d.runtimeStyle.position=\"absolute\"}d.style.display=\"inline-block\";if(n.currentStyle.styleFloat!==\"none\"){d.style.pixelWidth=n.offsetWidth}var a=new Image;a.onload=function(){d.style.pixelWidth=this.width;d.style.pixelHeight=Math.max(this.height,d.offsetHeight)};a.src=f}}n.runtimeStyle[this.position]=null}},recalc:function(){if(this.content==null)return;for(var a=0;a<this.match.length;a++){this.create(this.match[a])}},toString:function(){return\".\"+this.className+\"{display:inline}\"}},{CONTENT:/content\\s*:\\s*([^;]*)(;|$)/,ANON:\"<ie7:! class='ie7_anon %1' id=%2 style='%3'>%4</ie7:!>\",MATCH:/(.*):(before|after).*/,count:0});h._getLang=function(c){var a=\"\";while(c&&c.nodeType===1){a=c.lang||c.getAttribute(\"lang\")||\"\";if(a)break;c=c.parentNode}return a};T=O(T,{\":lang\\\\(([^)]+)\\\\)\":\"((ii=IE7._getLang(e))==='$1'||ii.indexOf('$1-')===0)&&\"})}var dj=/^(submit|reset|button)$/;h.HTML.addRecalc(\"button,input\",function(c){if(c.nodeName===\"BUTTON\"){var a=c.outerHTML.match(/ value=\"([^\"]*)\"/i);c.runtimeStyle.value=a?a[1]:\"\"}if(c.type===\"submit\"){y(c,\"onclick\",function(){c.runtimeStyle.clicked=true;setTimeout(\"document.all.\"+c.uniqueID+\".runtimeStyle.clicked=false\",1)})}});h.HTML.addRecalc(\"form\",function(d){y(d,\"onsubmit\",function(){for(var c,a=0;c=d[a];a++){if(dj.test(c.type)&&!c.disabled&&!c.runtimeStyle.clicked){c.disabled=true;setTimeout(\"document.all.\"+c.uniqueID+\".disabled=false\",1)}else if(c.nodeName===\"BUTTON\"&&c.type===\"submit\"){setTimeout(\"document.all.\"+c.uniqueID+\".value='\"+c.value+\"'\",1);c.value=c.runtimeStyle.value}}})});h.HTML.addRecalc(\"img\",function(a){if(a.alt&&!a.title)a.title=\"\"});if(t<8){h.CSS.addRecalc(\"border-spacing\",bg,function(a){if(a.currentStyle.borderCollapse!==\"collapse\"){a.cellSpacing=C(a,a.currentStyle[\"ie7-border-spacing\"].split(\" \")[0])}});h.CSS.addRecalc(\"box-sizing\",\"content-box\",h.Layout.boxSizing);h.CSS.addRecalc(\"box-sizing\",\"border-box\",h.Layout.borderBox)}if(t<8){var dk=/^image/i;h.HTML.addRecalc(\"object\",function(a){if(dk.test(a.type)){a.body.style.cssText=\"margin:0;padding:0;border:none;overflow:hidden\";return a}})}var bM=\"!IE7._a(e,'next')&&\",cs=bM.replace(\"next\",\"previous\");if(h.CSS.pseudoClasses)h.CSS.pseudoClasses+=\"|\";h.CSS.pseudoClasses+=\"(?:first|last|only)\\\\-(?:child|of\\\\-type)|empty|root|target|\"+(\"not|nth\\\\-child|nth\\\\-last\\\\-child|nth\\\\-of\\\\-type|nth\\\\-last\\\\-of\\\\-type\".split(\"|\").join(bK+\"|\")+bK);var bN=new M(\"checked\",function(c){if(typeof c.checked!==\"boolean\")return;var a=arguments;h.CSS.addEventHandler(c,\"onpropertychange\",function(){if(event.propertyName===\"checked\"){if(c.checked===true)bN.register(a);else bN.unregister(a)}});if(c.checked===true)bN.register(a)}),bO=new M(\"enabled\",function(c){if(typeof c.disabled!==\"boolean\")return;var a=arguments;h.CSS.addEventHandler(c,\"onpropertychange\",function(){if(event.propertyName===\"disabled\"){if(c.disabled===false)bO.register(a);else bO.unregister(a)}});if(c.disabled===false)bO.register(a)}),bP=new M(\"disabled\",function(c){if(typeof c.disabled!==\"boolean\")return;var a=arguments;h.CSS.addEventHandler(c,\"onpropertychange\",function(){if(event.propertyName===\"disabled\"){if(c.disabled===true)bP.register(a);else bP.unregister(a)}});if(c.disabled===true)bP.register(a)}),bQ=new M(\"indeterminate\",function(c){if(typeof c.indeterminate!==\"boolean\")return;var a=arguments;h.CSS.addEventHandler(c,\"onpropertychange\",function(){if(event.propertyName===\"indeterminate\"){if(c.indeterminate===true)bQ.register(a);else bQ.unregister(a)}});h.CSS.addEventHandler(c,\"onclick\",function(){bQ.unregister(a)})}),bR=new M(\"target\",function(c){var a=arguments;if(!c.tabIndex)c.tabIndex=0;h.CSS.addEventHandler(p,\"onpropertychange\",function(){if(event.propertyName===\"activeElement\"){if(c.id&&c.id===location.hash.slice(1))bR.register(a);else bR.unregister(a)}});if(c.id&&c.id===location.hash.slice(1))bR.register(a)}),ct=1,bu={_4:1};h._b=function(l,m,j){var i=l.parentNode;if(!i||i.nodeType!==1)return NaN;var g=j?l.nodeName:\"\";if(g===\"TR\"&&l.sectionRowIndex>=0){var c=l.sectionRowIndex;return m?l.parentNode.rows.length-c+1:c}if((g===\"TD\"||g===\"TH\")&&l.cellIndex>=0){c=l.cellIndex;return m?l.parentNode.cells.length-c+1:c}if(bu._4!==ct){bu={_4:ct}}var f=(i.uniqueID)+\"-\"+g,d=bu[f];if(!d){d={};var c=0,a=i.firstChild;while(a){if(j?a.nodeName===g:a.nodeName>\"@\"){d[a.uniqueID]=++c}a=a.nextSibling}d.length=c;bu[f]=d}c=d[l.uniqueID];return m?d.length-c+1:c};h._c=function(a){a=a.firstChild;while(a){if(a.nodeType===3||a.nodeName>\"@\")return false;a=a.nextSibling}return true};h._a=function(d,c){var a=d.nodeName;c+=\"Sibling\";do{d=d[c];if(d&&d.nodeName===a)break}while(d);return d};var dl={\"+\":1,\"-\":-1},dm=/ /g;T=O(O({\":nth(-last)?-(?:child|(of-type))\\\\((<#nth_arg>)\\\\)(<#filter>)?\":function(m,j,i,g,f){g=g.replace(dm,\"\");var d=\"IE7._b(e,\"+!!j+\",\"+!!i+\")\";if(g===\"even\")g=\"2n\";else if(g===\"odd\")g=\"2n+1\";else if(!isNaN(g))g=\"0n\"+~~g;g=g.split(\"n\");var c=~~(dl[g[0]]||g[0]||1),b=~~g[1];if(c===0){var a=d+\"===\"+b}else{a=\"((ii=\"+d+\")-(\"+b+\"))%\"+c+\"===0&&ii\"+(c<0?\"<\":\">\")+\"=\"+b}return this.parse(f)+a+\"&&\"},\"<#negation>\":function(c,a){if(/:not/i.test(a))bv();if(/^[#.:\\[]/.test(a)){a=\"*\"+a}return\"!(\"+D.parse(a).slice(3,-2)+\")&&\"}},T),{\":checked\":\"e.checked===true&&\",\":disabled\":\"e.disabled===true&&\",\":enabled\":\"e.disabled===false&&\",\":last-child\":\"!\"+bE+\"&&\",\":only-child\":\"!\"+ck+\"&&!\"+bE+\"&&\",\":first-of-type\":cs,\":last-of-type\":bM,\":only-of-type\":cs+bM,\":empty\":\"IE7._c(e)&&\",\":root\":\"e==R&&\",\":target\":\"H&&\"+cn+\"===H&&\"});var dn=\"article,aside,audio,canvas,details,figcaption,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video\".split(\",\");for(var cu=0,cv;cv=dn[cu];cu++)p.createElement(cv);U+=\"datalist{display:none}details{padding-left:40px;display:block;margin:1em 0}meter,progress{vertical-align:-0.2em;width:5em;height:1em;display:inline-block}progress{width:10em;}article,aside,figcaption,footer,header,hgroup,summary,section,nav{display:block;margin:1em 0}figure{margin:1em 40px;display:block}mark{background:yellow}\";h.CSS.addFix(/\\bopacity\\s*:\\s*([\\d.]+)/,function(c,a){return\"zoom:1;filter:Alpha(opacity=\"+((a*100)||1)+\")\"});var D,J=(function(){var o0=/^[>+~]/,bw=false;function dp(f,d,c){f=bZ(f);if(!d)d=p;var a=d;bw=o0.test(f);if(bw){d=d.parentNode;f=\"*\"+f}try{return n.create(f,bw)(d,c?null:[],a)}catch(ex){return c?null:[]}};var dq=/^(\\\\.|[' >+~#.\\[\\]:*(),\\w-\\^|$=]|[^\\x00-\\xa0])+$/,dE=/^(href|src)$/,cw={\"class\":\"className\",\"for\":\"htmlFor\"},dF=/\\sie7_\\w+/g,dr=/^(action|cite|codebase|data|dynsrc|href|longdesc|lowsrc|src|usemap|url)$/i;h._0=function(f,d){if(f.getAttributeNode){var c=f.getAttributeNode(d)}d=cw[d.toLowerCase()]||d;if(!c)c=f.attributes[d];var a=c&&c.specified;if(f[d]&&typeof f[d]==\"boolean\")return d.toLowerCase();if((a&&dr.test(d))||(!c&&E)||d===\"value\"||d===\"type\"){return f.getAttribute(d,2)}if(d===\"style\")return f.style.cssText.toLowerCase()||null;return a?String(c.nodeValue):null};var cx=\"colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc\";O(cw,cO(cx.toLowerCase().split(\",\"),cx.split(\",\")));h._1=function(c,a){a+=\"Sibling\";do{c=c[a];if(c&&c.nodeName>\"@\")break}while(c);return c};var ds=/(^|[, >+~])([#.:\\[])/g,dG=/\\)\\{/g,dt=/,/,dH=/^['\"]/,du=/\\\\([\\da-f]{2,2})/gi,dI=/last/i;h._d=function(f,d){var c=f.all[d]||null;if(!c||(c.nodeType&&h._0(c,\"id\")===d))return c;for(var a=0;a<c.length;a++){if(h._0(c[a],\"id\")===d)return c[a]}return null};var bb=G.extend({dictionary:new cM({ident:/\\-?(\\\\.|[_a-z]|[^\\x00-\\xa0])(\\\\.|[\\w-]|[^\\x00-\\xa0])*/,combinator:/[\\s>+~]/,operator:/[\\^~|$*]?=/,nth_arg:/[+-]?\\d+|[+-]?\\d*n(?:\\s*[+-]\\s*\\d+)?|even|odd/,tag:/\\*|<#ident>/,id:/#(<#ident>)/,'class':/\\.(<#ident>)/,pseudo:/\\:([\\w-]+)(?:\\(([^)]+)\\))?/,attr:/\\[(<#ident>)(?:(<#operator>)((?:\\\\.|[^\\[\\]#.:])+))?\\]/,negation:/:not\\((<#tag>|<#id>|<#class>|<#attr>|<#pseudo>)\\)/,sequence:/(\\\\.|[~*]=|\\+\\d|\\+?\\d*n\\s*\\+\\s*\\d|[^\\s>+~,\\*])+/,filter:/[#.:\\[]<#sequence>/,selector:/[^>+~](\\\\.|[^,])*?/,grammar:/^(<#selector>)((,<#selector>)*)$/}),ignoreCase:true}),dv=new bb({\"\\\\\\\\.|[~*]\\\\s+=|\\\\+\\\\s+\\\\d\":G.IGNORE,\"\\\\[\\\\s+\":\"[\",\"\\\\(\\\\s+\":\"(\",\"\\\\s+\\\\)\":\")\",\"\\\\s+\\\\]\":\"]\",\"\\\\s*([,>+~]|<#operator>)\\\\s*\":\"$1\",\"\\\\s+$\":\"\",\"\\\\s+\":\" \"});function dw(a){a=dv.parse(a.replace(du,\"\\\\x$1\")).replace(bz,\"$1\").replace(ds,\"$1*$2\");if(!dq.test(a))bv();return a};function dJ(a){return a.replace(cb,dx)};function dx(c,a){return W[a]};var dy=/\\{/g,dz=/\\\\{/g;function bS(a){return Array((a.replace(dz,\"\").match(dy)||\"\").length+1).join(\"}\")};T=new bb(T);var v=/:target/i,Z=/:root/i;function S(c){var a=\"\";if(Z.test(c))a+=\",R=d.documentElement\";if(v.test(c))a+=\",H=d.location;H=H&&H.hash.replace('#','')\";if(a||c.indexOf(\"#\")!==-1){a=\",t=c.nodeType,d=t===9?c:c.ownerDocument||(c.document||c).parentWindow.document\"+a}return\"var ii\"+a+\";\"};var ba={\" \":\";while(e!=s&&(e=e.parentNode)&&e.nodeType===1){\",\">\":\".parentElement;if(e){\",\"+\":\";while((e=e.previousSibling)&&!(\"+cl+\"))continue;if(e){\",\"~\":\";while((e=e.previousSibling)){\"+cm},K=/\\be\\b/g;D=new bb({\"(?:(<#selector>)(<#combinator>))?(<#tag>)(<#filter>)?$\":function(j,i,g,f,d){var c=\"\";if(f!==\"*\"){var a=f.toUpperCase();c+=\"if(e.nodeName==='\"+a+(a===f?\"\":\"'||e.nodeName==='\"+f)+\"'){\"}if(d){c+=\"if(\"+T.parse(d).slice(0,-2)+\"){\"}c=c.replace(K,\"e\"+this.index);if(g){c+=\"var e=e\"+(this.index++)+ba[g];c=c.replace(K,\"e\"+this.index)}if(i){c+=this.parse(i)}return c}});var L=\"e0=IE7._d(d,'%1');if(e0){\",z=\"var n=c.getElementsByTagName('%1');\",w=\"if(r==null)return e0;r[k++]=e0;\",r=1,A=new bb({\"^((?:<#selector>)?(?:<#combinator>))(<#tag>)(<#filter>)?$\":true}),s={},q=new bb({\"^(<#tag>)#(<#ident>)(<#filter>)?( [^,]*)?$\":function(j,i,g,f,d){var c=H(L,g),a=\"}\";if(f){c+=D.parse(i+f);a=bS(c)}if(d){c+=\"s=c=e0;\"+n.parse(\"*\"+d)}else{c+=w}return c+a},\"^([^#,]+)#(<#ident>)(<#filter>)?$\":function(g,f,d,c){var a=H(L,d);if(f===\"*\"){a+=w}else{a+=D.parse(f+c)+w+\"break\"}return a+bS(a)},\"^.*$\":\"\"}),n=new bb({\"<#grammar>\":function(k,l,m){if(!this.groups)this.groups=[];var j=A.exec(\" \"+l);if(!j)bv();this.groups.push(j.slice(1));if(m){return this.parse(m.replace(dt,\"\"))}var i=this.groups,g=i[0][r];for(var c=1;j=i[c];c++){if(g!==j[r]){g=\"*\";break}}var f=\"\",d=w+\"continue filtering;\";for(var c=0;j=i[c];c++){D.index=0;if(g!==\"*\")j[r]=\"*\";j=j.join(\"\");if(j===\" *\"){f=d;break}else{j=D.parse(j);if(bw)j+=\"if(e\"+D.index+\"==s){\";f+=j+d+bS(j)}}var a=g===\"*\";return(a?\"var n=c.all;\":H(z,g))+\"filtering:while((e0=n[i++]))\"+(a?cm.replace(K,\"e0\"):\"{\")+f+\"}\"},\"^.*$\":bv}),o=/\\&\\&(e\\d+)\\.nodeType===1(\\)\\{\\s*if\\(\\1\\.nodeName=)/g;n.create=function(d){if(!s[d]){d=dw(d);this.groups=null;D.index=0;var c=this.parse(d);this.groups=null;D.index=0;if(d.indexOf(\"#\")!==-1){var a=q.parse(d);if(a){c=\"if(t===1||t===11|!c.getElementById){\"+c+\"}else{\"+a+\"}\"}}c=c.replace(o,\"$2\");c=S(d)+bd(c);s[d]=new Function(\"return function(c,r,s){var i=0,k=0,e0;\"+c+\"return r}\")()}return s[d]};return dp})();function bv(){throw new SyntaxError(\"Invalid selector.\");};h.loaded=true;(function(){try{if(!p.body)throw\"continue\";bx.doScroll(\"left\")}catch(ex){setTimeout(arguments.callee,1);return}try{eval(bU.innerHTML)}catch(ex){}if(typeof IE7_PNG_SUFFIX==\"object\"){bh=IE7_PNG_SUFFIX}else{bh=new RegExp(bY(N.IE7_PNG_SUFFIX||\"-trans.png\")+\"(\\\\?.*)?$\",\"i\")}B=p.body;x=E?B:bx;B.className+=\" ie7_body\";bx.className+=\" ie7_html\";if(E)dc();h.CSS.init();h.HTML.init();h.HTML.apply();h.CSS.apply();h.recalc()})()})(this,document);\n"
  },
  {
    "path": "demo/index.css",
    "content": "@import url(normalize.css);\n\n/***\n  Essential FileDrop styles for <iframe> support\n ***/\n\n.fd-zone {\n  position: relative;\n  overflow: hidden;\n  width: 23em;\n  text-align: center;\n  margin: 0 auto;\n}\n\n.fd-file {\n  opacity: 0;\n  font-size: 118px;\n  position: absolute;\n  right: 0;\n  top: 0;\n  z-index: 1;\n  padding: 0;\n  margin: 0;\n  cursor: pointer;\n  filter: alpha(opacity=0);\n  font-family: sans-serif;\n}\n\n/***\n  Demo page styles\n ***/\n\nh1, h2, h3, h4, h5, h6 { font-weight: normal; }\na, header { color: #104167; text-decoration: none; }\na:hover { text-decoration: underline; }\n[readonly] { background: #EBEBE4; border: 1px solid #C4C4C4; }\n\nbody {\n  margin: 11px auto 0;\n  font-size: 14px;\n  max-width: 1100px;\n  position: relative;\n  background: repeat-x left top url(\"data:image/gif;base64,R0lGODlhNAALAIAAABBQdcHm+SwAAAAANAALAAACK4SPqWvhD6MMrNo2s7xc6f90IgZqo1h+Z5ea69VmLxxvc1Xb95JHO9ODWAoAOw==\") #f2f2f2;\n}\n\nheader {\n  margin-bottom: 20px;\n  padding: 15px 40px 26px 10px;\n  background: repeat-x left bottom url(\"data:image/gif;base64,R0lGODlhAQAJAKIAANvb29jY2OXl5e/v7xBQdenp6eDg4O3t7SH5BAAAAAAALAAAAAABAAkAAAMGSAEmdWMkADs=\") white;\n}\n\n#logo { float: left; margin-right: 20px; }\n\nh1 {\n  font-family: Georgia, serif;\n  font-size: 36px;\n  margin: 0;\n}\n\nh1 span {\n  background: #104167;\n  color: #FFFFFF;\n  font-size: 14px;\n  padding: 5px 9px;\n  position: relative;\n  top: -8px;\n  margin: 0 22px 0 6px;\n}\n\nh1 a:last-child {\n  font-family: sans-serif;\n  font-size: 14px;\n  padding: 0 0 6px 30px;\n  position: relative;\n  top: -10px;\n  background: no-repeat left center url(\"data:image/gif;base64,R0lGODlhggAUAKIAAD/O+IPf+sHm+QC+9v///wAAAAAAAAAAACH5BAAAAAAALAAAAACCABQAAAOdSLrMAmMAsWi7OOvNu/9cEGxBZA4iCq5s675KZF3CaU9wru+sOV4QmwkA4BmPSMIJxxAuk9BoKzgUWJwmqXbLoS69Qq54TEhhzwOyWopGF9fwY6nt/MXvOjB9MMP7XQF6aH+EgIJYfYWKXXsRb4uQjHuRlBwCc2eJlZsLmE6anItWl4c+o6eoqaqrrK2ur7Cxr6U+obYKpF5EoLeQCQA7\");\n}\n\nh2 {\n  font-family: Georgia, serif;\n  font-size: 16px;\n  margin: 7px 0 0;\n}\n\nheader ul { float: right; margin: 0; }\n\nheader li {\n  list-style: none;\n  padding: 4px 0 4px 28px;\n  background: no-repeat left center;\n}\n\nheader li:nth-child(1) { background-image: url(\"data:image/gif;base64,R0lGODlhEAAOAKIAALW1tV1dXWxsbPDw8E5OTpmZmQAAAP///yH5BAAAAAAALAAAAAAQAA4AAANeeHpi/q+sAwwQIuhtpsVDCBABASzVVQgEMZBBp3wZIJaEdBQ5JrwtVmwGWGVaBFbjNDIGgKSWzFCoGn0k6gyHRGIICwPGFhIVLAueIUkeAIaTQaHkIFV0E4V75QjkEwA7\"); }\nheader li:nth-child(2) { background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAKIAAEZHR29vcMfHx5WVlT8/P0tMTgAAAP///yH5BAAAAAAALAAAAAAQABAAAANeeFHczkEFQaulIQA6es9eV2zhcEhZMADAl54pCBBDypwMWwQEvQinII7AI44KwKBgRij0ir2kgGCoOpu9KoFS7faa3bD4C6gKhdpe2XAOVpkz8djpZH3vBHsEir9HEgA7\"); }\nheader li:nth-child(3) { background-image: url(\"data:image/gif;base64,R0lGODlhEAAPAKIAAMrJypmYmGxqa+fn5zw7O/f39xcVFv///yH5BAAAAAAALAAAAAAQAA8AAANYeFpB9oaEoipwMBNQB87acBSOAAiEgJpCxDxCJR+tEdTBXAUwJuqHwQNDoABJw8dPJ4xgckBehOcIDIyFgdQmFEg5h0tGxAsAJormA3rgeY1qtkL8E24qCQA7\"); }\n\nh3 {\n  font-family: Georgia, serif;\n  font-size: 18px;\n  font-weight: bold;\n  margin-top: 0;\n}\n\n#btns { float: right; }\n\n.btn {\n  border: 1px solid silver;\n  border-color: silver gray gray silver;\n  background: white;\n  font-size: 12px;\n  cursor: pointer;\n  padding: 0.2em 0.5em;\n  font-weight: normal;\n}\n\n.btn.down, .btn:active:hover {\n  border: 1px inset black;\n  background: #eee;\n}\n\nfieldset {\n  border: 1px solid #105075;\n  background: white;\n}\n\nlegend { font-weight: bold; padding: 0 0.3em; }\n#report { color: red; }\n\n.ff, .ie, .chrome, .safari, .opera {\n  padding-left: 22px;\n  background: no-repeat left top;\n  white-space: nowrap;\n}\n\n.ff { background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAMQAAPDx8fjsoRWZzBhqqeCeIa+3sNdTJJNJNUas1dDQzpl8d+J8JffiZdeynKrW6EpaW/DKImjE7K2bROBkJRYrV92hdawtIRNKe4FuRVCBe7NWJl8wNcdBJuzWvc9sQP///yH5BAAAAAAALAAAAAAQABAAAAWX4CeOZFkCTqRGDmB2DiIgNO0kJDApmZQJwFmnMeoYFgvCLzgIOEWVyQTpUQgG2EKAIfJIkxgs9qKFiAxSw+EyvlC2EhEHzdFcLg83hQEhdA2AUwsaDxQYEBAVIg1zaAcbFJEEBAtEHwAcjRMaGwdIgx0jDRaNaFITBoojAAqkpQYWCi4kCQoHFrgWBwoJszkACQUFCb0kIQA7\"); }\n.ie { background-image: url(\"data:image/gif;base64,R0lGODlhEAAQALMAAPjANgKW7fHu2wROlEdSU/HefWTO/k+j47bQ00J4o5KhnCaz+sa5daiPO3mAav///yH5BAAAAAAALAAAAAAQABAAAASF8MlJRQGgCPrQWcvVOE1TTMJnIJfjJBIzqQzQEI5hJIgiIQuDCAfS8SSf4UYRCB4cD0GiBiBYE4RB4HAgRBWXbGBMXgS8glpjwG67vRdAe8ORWAAOduDINJ/vCVpkAQZmCwMCAjYCgkGFIAMIUTYdeiABbHQPAAwMFiMJCQqadhgNnnUTEQA7\"); }\n.chrome { background-image: url(\"data:image/gif;base64,R0lGODlhEAAQALMAAEiyQ+Tm3vjNBuBYStgdHVKS0O3NTNuqD+d3dq3Q+xlpskKGMuE7MXS7c6a95P///yH5BAAAAAAALAAAAAAQABAAAARz8MlJaw1o6IGCfQjDbIOIVAghritxSsFCzITGEt7TADPzBB6DYGiQAACyR2FZeAyHxuMgwSwkhNDHEdBIKJaK61Oy2D4UaIVzeJDsjo2Hw/HACoq/8raxex5yOnpbfngTDQt6BwIHB4UUAUgLjAaAH5YSEQA7\"); }\n.safari { background-image: url(\"data:image/gif;base64,R0lGODlhEAAQALMAAEGr4snKynx6fa6trOPm50xNTVB2pjCJx2aQvp2202m44qPZ8rlNLJekuZSSlv///yH5BAAAAAAALAAAAAAQABAAAAR68ElJApk4vzCCv9pTcY4znOBUDULjOkKZPmeb3EkDO1ON/AkETCgIiEoGA9DBUOp4gVhSaWA4FD/WpqVEJAIGxWGsDZgQ46BCATgoYJJSw40AsNlR3qYwSAD+fwoLAwUpDgUBC2uCFXwZAgUOH2aRIQEFmJhFISofGhEAOw==\"); }\n.opera { background-image: url(\"data:image/gif;base64,R0lGODlhEAAQAKIAAOqnpaoZEPfj4ehnY3sMBd0+Npk6NP///yH5BAAAAAAALAAAAAAQABAAAANkeHoC7mLJ9iqIi4JhghnggB0PB5BBOChCWASREBR0cW5gQSxEXawuHa/mORh8O0UvwAwYkcPmrsMUKmZMguEwaL4WM4J4CyBUYYyw+GQUz24vcZIkn9XkbJZBzifkJQB7YxcSCQA7\"); }\n\naside {\n  width: 320px;\n  position: absolute;\n  right: 20px;\n  font-size: 12px;\n}\n\naside p { margin: 16px 0 16px 2.125em; }\naside legend { font-size: 14px; }\naside fieldset { margin-bottom: 16px; }\n\naside fieldset ul {\n  margin: 0 0 0 1.5em;\n  padding: 0;\n}\n\naside fieldset ul li { margin-top: 0.3em; }\naside fieldset p { margin: 0.75em 0 0.5em; }\naside legend + p { margin-top: 0; }\naside li u { text-decoration: none; background: #ffc; padding: 0 2px; }\n\n#content {\n  margin: 0 360px 0 20px;\n  padding-right: 150px;\n  position: relative;\n}\n\nnav {\n  width: 130px;\n  position: absolute;\n  right: 0;\n}\n\nnav ul { margin: 0; padding: 0; }\n\nnav li {\n  list-style: none;\n  margin: 0 0 0.5em;\n  font-family: Georgia, serif;\n  font-size: 14px;\n  font-weight: bold;\n}\n\nnav li:before { content: \"« \"; }\nnav li.cur:before { color: red; }\nnav li:last-child:before { content: \"+ \"; }\nnav li:last-child { font-weight: normal; }\nnav li.cur a { color: black; }\n\narticle {\n  margin: 0 0 30px;\n}\n\nh4 {\n  font-family: Georgia, serif;\n  font-size: 18px;\n  margin-top: 30px;\n}\n\narticle h4:hover { text-decoration: underline; cursor: pointer; }\narticle h4.collapsed { color: gray; }\narticle h4.collapsed + pre { display: none; }\n\npre {\n  margin: 0;\n  padding: 0.5em 0.75em;\n  background: white;\n  color: navy;\n  font-size: 13px;\n}\n\n.fd-zone {\n  border: 3px dashed #105075;\n  background-color: white;    /* IE */\n  background: no-repeat right top url(icon.png), repeat left top url(\"data:image/gif;base64,R0lGODlhDgAOAIAAANjY2P///yH5BAAAAAAALAAAAAAOAA4AAAIVRIynFu3/GJyUyopt3vPy7X1YKFIFADs=\");\n  transition: border-color 0.2s;\n}\n\n.fd-zone.over { border: 3px solid orange; }\n.fd-zone:hover { border-color: #C9C9C9; }\nfieldset.fd-zone { border-style: double; }\nfieldset.fd-zone p { margin: 0.5em 0; }\nfieldset.fd-zone :last-child:not(img) { margin-bottom: 0; }\n\n.fd-zone > img {\n  margin: 2px;\n  max-width: 150px;\n  border: 1px solid silver;\n  padding: 1px;\n}\n\n.fd-zone textarea {\n  width: 88%;\n  font-size: 11px;\n  height: 6em;\n  overflow: auto;\n  display: block;\n  margin: 1em auto;\n  border: 1px solid silver;\n  background: #f1f1f1;\n  padding: 0.2em 0.4em;\n}\n\n#events {\n  border-top: 1px solid silver;\n}\n\n#events [colspan] {\n  font-family: Georgia, serif;\n  padding: 0.75em 0 0.5em 0;\n}\n\n#events tr:first-child th { padding-top: 30px; }\n#events th, #events td { vertical-align: top; padding: 0.2em 0 0.2em; }\n#events th { text-align: left; padding-left: 1em; }\n#events th + td { padding-left: 0.75em; padding-right: 0.75em; }\n\n#response, #log { display: block; width: 100%; margin: 0.5em 0; padding: 0.5em; }\n\n@media (min-width: 1110px) {\n  header {\n    border-radius: 0 0 20px 20px;\n    border: 1px solid silver;\n    border-width: 0 1px;\n  }\n}"
  },
  {
    "path": "demo/index.html",
    "content": "<!DOCTYPE html>\r\n<html>\r\n  <head>\r\n    <meta charset=\"utf-8\">\r\n\r\n    <title>FileDrop.js demo - self-contained HTML5, AJAX, drag &amp; drop file upload</title>\r\n\r\n    <link type=\"text/css\" href=\"index.css\" rel=\"stylesheet\" media=\"all\">\r\n\r\n    <!--[if lt IE 9]>\r\n    <script src=\"ie9.js\"></script>\r\n    <![endif]-->\r\n  </head>\r\n  <body>\r\n    <header>\r\n      <a id=\"logo\" href=\"http://filedropjs.org\"><img src=\"logo.png\"></a>\r\n\r\n      <ul>\r\n        <li><a href=\"http://filedropjs.org\">Documentation</a></li>\r\n        <li><a href=\"http://filedropjs.org/#download\">Download latest</a></li>\r\n        <li><a href=\"http://github.com/ProgerXP/FileDrop/issues\">Report bugs</a></li>\r\n      </ul>\r\n\r\n      <h1>\r\n        <a href=\"http://filedropjs.org\">FileDrop.js</a>\r\n        <span>REVAMPED</span>\r\n        <a target=\"_blank\" href=\"https://twitter.com/share?url=http%3A%2F%2Ffiledropjs.org\">Share the love!</a>\r\n      </h1>\r\n\r\n      <h2>Self-contained cross-browser HTML5, legacy, AJAX, drag &amp; drop JavaScript file upload</h2>\r\n    </header>\r\n\r\n    <noscript>\r\n      JavaScript is disabled! This page won't quite work.\r\n    </noscript>\r\n\r\n    <aside>\r\n      <fieldset>\r\n        <legend>Features</legend>\r\n\r\n        <ul>\r\n          <li><b>No JS dependencies</b>, Flash or Java applets</li>\r\n          <li>900 lines of code, 1300 lines of comments</li>\r\n          <li><b>18 KiB minified</b>, 6 KiB gzipped</li>\r\n          <li><b>HTML5, drag &amp; drop</b> for modern browsers</li>\r\n          <li><b>IFrame fallback</b> for legacy agents (IE 6+)</li>\r\n          <li>Flexible <b>event system</b> with over 15 callbacks</li>\r\n          <li>Multiple <b>independent FileDrops</b> on one page</li>\r\n          <li>Ready for <b>jQuery</b>, PHP, ASP.net and others</li>\r\n          <li>600+ lines of <b>unit tests</b> (<a href=\"tests.html\">tests.html</a>)</li>\r\n        </ul>\r\n      </fieldset>\r\n\r\n      <fieldset>\r\n        <legend>Browsers uploading by AJAX</legend>\r\n        <p>They also support drag &amp; drop on the drop zone.</p>\r\n\r\n        <ul>\r\n          <li>\r\n            <b class=\"ff\">Firefox:</b>\r\n            <u>XP SP3:</u> 26.0 29.0\r\n          </li>\r\n          <li>\r\n            <b class=\"ff\">Firefox x64:</b>\r\n            <u>XP SP2 x64:</u> 23.0a1 28.0a1\r\n          </li>\r\n          <li>\r\n            <b class=\"chrome\">Chrome:</b>\r\n            <u>XP SP2 x64:</u> 29.0 35.0\r\n          </li>\r\n          <li>\r\n            <b class=\"ie\">Internet Explorer:</b>\r\n            <u>Win7 SP1:</u> 10, 11\r\n          </li>\r\n          <li>\r\n            <b class=\"opera\">Opera:</b>\r\n            <u>XP SP2 x64:</u> 12.16\r\n            <u>Win7:</u> 12.17\r\n          </li>\r\n          <li>\r\n            <b class=\"safari\">Safari:</b>\r\n            <u>XP SP3:</u> 5.1.7\r\n            <u>Win7 SP1:</u> 5.1.7\r\n            <u>iOS:</u> 7, 8\r\n          </li>\r\n        </ul>\r\n      </fieldset>\r\n\r\n      <fieldset>\r\n        <legend>Browsers uploading by IFrame</legend>\r\n        <p>If you set <code>input: false</code> or don't set <code>iframe.url</code> these agents will be unable to upload the data.</p>\r\n\r\n        <ul>\r\n          <li>\r\n            <b class=\"ie\">Internet Explorer:</b>\r\n            <u>XP SP3:</u> 6, 8\r\n            <u>Win7 SP1:</u> 8\r\n          </li>\r\n          <li>\r\n            <b class=\"ie\">Internet Explorer x64:</b>\r\n            <u>XP SP2 x64:</u> 6, 7\r\n          </li>\r\n        </ul>\r\n      </fieldset>\r\n\r\n      <p><a id=\"report\" href=\"http://filedropjs.org\">Report problem with this demo (no page reload)</a></p>\r\n\r\n      <fieldset>\r\n        <legend>Support Notes</legend>\r\n\r\n        <ul>\r\n          <li>\r\n            <b class=\"ff\">Firefox 3.6</b> and <b class=\"opera\">Opera</b> skip <code>cursor</code> CSS style for <code>&lt;input type=\"file\"&gt;</code>.\r\n          </li>\r\n          <li>\r\n            <b class=\"ff\">Firefox ~13</b> and later ignore <em>overflow: hidden</em> on <code>&lt;fieldset&gt;</code> &ndash; FileDrop will automatically wrap such drop zones into <code>&lt;div&gt;</code> with proper styles but make sure this doesn't affect your layout (for example, <em>margin</em> might show differently).\r\n          </li>\r\n          <li>\r\n            <b class=\"ie\">IE 6-9</b> fire <b>ondrop</b> on <code>&lt;input type=\"file\"&gt;</code> but when the form is submitted this way sends an empty POST body so drag &amp; drop is forcefully disabled for <b class=\"ie\">IE 6</b> (normal upload by clicking on the drop zone is still possible using <b>iframe</b> fallback).\r\n          </li>\r\n          <li>\r\n            <b class=\"ie\">IE 6-10</b> don't support multiple selection in file open dialog.\r\n          </li>\r\n          <li>\r\n            <b class=\"ie\">IE 10</b> lacks <code>readAsBinaryString()</code>. Unless you are calling it directly FileDrop will transparently translate it to <code>readAsArrayBuffer()</code>.\r\n          </li>\r\n          <li>\r\n            <b class=\"safari\">Safari 5</b> provides drag & drop upload but no file reading functions.\r\n          </li>\r\n        </ul>\r\n      </fieldset>\r\n    </aside>\r\n\r\n    <div id=\"content\">\r\n      <nav>\r\n        <ul>\r\n          <li><a href=\"#basic\">Basic usage</a></li>\r\n          <li><a href=\"#jquery\">jQuery wrapper</a></li>\r\n          <li><a href=\"#progress\">Progress bar</a></li>\r\n          <li><a href=\"#thumbs\">Thumbnails</a></li>\r\n          <li><a href=\"#text\">Read text files</a></li>\r\n          <li><a href=\"#dir\">Read folders</a></li>\r\n          <li><a href=\"http://filedropjs.org/#samples\">More samples</a></li>\r\n        </ul>\r\n      </nav>\r\n\r\n      <article id=\"basic\">\r\n        <h3>\r\n          Basic usage\r\n\r\n          <span id=\"btns\">\r\n            <span class=\"btn\" id=\"badd\">+ Add drop zone</span>\r\n            <span class=\"btn\" id=\"berror\">Cause error on upload</span>\r\n            <span class=\"btn\" id=\"babort\">Abort upload</span>\r\n          </span>\r\n        </h3>\r\n\r\n        <p>Lets you upload a file by clicking on the drop zone and, additionally, by dropping it from your computer for supported modern browsers. Pure native JavaScript, no library is used.</p>\r\n\r\n        <fieldset id=\"zbasic\">\r\n          <legend>Drop a file inside…</legend>\r\n          <p>Or click here to <em>Browse…</em></p>\r\n\r\n          <p style=\"position: relative; z-index: 1\">\r\n            <input type=\"checkbox\" id=\"zbasicm\">\r\n\r\n            <label for=\"zbasicm\">\r\n              Allow multiple selection in <em>Browse</em> dialog.\r\n            </label>\r\n          </p>\r\n        </fieldset>\r\n\r\n        <script type=\"sample/javascript\">\r\n          var options = {iframe: {url: 'upload.php'}};\r\n          var zone = new FileDrop('zbasic', options);\r\n\r\n          zone.event('send', function (files) {\r\n            files.each(function (file) {\r\n              file.event('done', function (xhr) {\r\n                alert('Done uploading ' + this.name + ',' +\r\n                      ' response:\\n\\n' + xhr.responseText);\r\n              });\r\n\r\n              file.event('error', function (e, xhr) {\r\n                alert('Error uploading ' + this.name + ': ' +\r\n                      xhr.status + ', ' + xhr.statusText);\r\n              });\r\n\r\n              file.sendTo('upload.php');\r\n            });\r\n          });\r\n\r\n          // <iframe> uploads are special - handle them.\r\n          zone.event('iframeDone', function (xhr) {\r\n            alert('Done uploading via <iframe>, response:\\n\\n' + xhr.responseText);\r\n          });\r\n\r\n          // Toggle multiple file selection in the File Open dialog.\r\n          fd.addEvent(fd.byID('zbasicm'), 'change', function (e) {\r\n            zone.multiple((e.currentTarget || e.srcElement).checked);\r\n          });\r\n        </script>\r\n      </article>\r\n\r\n      <article id=\"jquery\">\r\n        <h3>jQuery integration</h3>\r\n\r\n        <p>Complete analog of the basic sample rewritten using jQuery wrapper.</p>\r\n\r\n        <fieldset id=\"zjquery\">\r\n          <legend>Drop a file inside…</legend>\r\n          <p>Or click here to <em>Browse…</em></p>\r\n\r\n          <p style=\"position: relative; z-index: 1\">\r\n            <input type=\"checkbox\" id=\"zjquerym\">\r\n\r\n            <label for=\"zjquerym\">\r\n              Allow multiple selection in <em>Browse</em> dialog.\r\n            </label>\r\n          </p>\r\n        </fieldset>\r\n\r\n        <script type=\"sample/javascript\">\r\n          // Tell FileDrop we want to integrate with jQuery\r\n          // making $().filedrop() available.\r\n          fd.jQuery();\r\n\r\n          var options = {iframe: {url: 'upload.php'}};\r\n\r\n          $('#zjquery')\r\n            // Create FileDrop on the first node in this collection.\r\n            .filedrop(options)\r\n            .on('fdsend', function (jQueryEvent, files) {\r\n              // 'fd' prefix is added to all FileDrop events that\r\n              // are triggered on the zone element.\r\n              files.each(function (file) {\r\n                file.sendTo('upload.php');\r\n              });\r\n\r\n              // Or if you're more of a functional guy here's your call:\r\n              //files.invoke('sendTo', 'upload.php');\r\n            })\r\n            .on('filedone', function (e, file, xhr) {\r\n              // FileDrop binds events of all constructed Files to the\r\n              // zone element and prefixes event names with 'file'.\r\n              alert('Done uploading ' + file.name + ',' +\r\n                    ' response:\\n\\n' + xhr.responseText);\r\n            })\r\n            .on('fileerror', function (e, file, xhrError, xhr) {\r\n              alert('Error uploading ' + file.name + ': ' +\r\n                    xhr.status + ', ' + xhr.statusText);\r\n            })\r\n            .on('fdiframedone', function (e, xhr) {\r\n              alert('Done uploading via <iframe>, response:\\n\\n' + xhr.responseText);\r\n            });\r\n\r\n          $('#zjquerym').change(function () {\r\n            $('#zjquery')\r\n              // Retrieve created FileDrop object (or create it):\r\n              .filedrop()\r\n              .multiple(this.checked);\r\n              // Would also work retaining 'this' as jQuery collection:\r\n              //.filedrop('multiple', this.checked);\r\n          });\r\n        </script>\r\n      </article>\r\n\r\n      <article id=\"progress\">\r\n        <h3>\r\n          Progress bar\r\n        </h3>\r\n\r\n        <p>On AJAX uploads browser reports how much data has been already sent. <b class=\"ff\">Firefox</b> won't trigger this event on small files.</p>\r\n        <p><b>IFrame</b> (legacy) uploads don't provide this feature but are still supported.</p>\r\n\r\n        <fieldset id=\"zprogress\">\r\n          <legend>Drop a file inside…</legend>\r\n          <p>Or click here to <em>Browse…</em></p>\r\n        </fieldset>\r\n\r\n        <script type=\"sample/javascript\">\r\n          var options = {iframe: {url: 'upload.php'}};\r\n          var zone = new FileDrop('zprogress', options);\r\n\r\n          zone.event('send', function (files) {\r\n            files.each(function (file) {\r\n              file.event('done', function (xhr) {\r\n                alert('Done uploading ' + this.name);\r\n              });\r\n\r\n              file.event('progress', function (sent, total) {\r\n                var p = document.createElement('p');\r\n                p.textContent = 'Uploaded ' + Math.round(sent / total * 100) + '%...';\r\n                zone.el.appendChild(p);\r\n              })\r\n\r\n              file.sendTo('upload.php');\r\n            });\r\n          });\r\n\r\n          zone.event('iframeDone', function (xhr) {\r\n            alert('Done uploading via <iframe>');\r\n          });\r\n        </script>\r\n      </article>\r\n\r\n      <article id=\"thumbs\">\r\n        <h3>Thumbnails</h3>\r\n\r\n        <p><b>HTML5-only.</b> When dropped one or more image files generates thumbnails and displays them right on the page, without uploading the data anywhere.</p>\r\n\r\n        <fieldset id=\"zthumbs\" style=\"min-height: 100px\">\r\n          <legend>Drop an image inside…</legend>\r\n        </fieldset>\r\n\r\n        <script type=\"sample/javascript\">\r\n          var zone = new FileDrop('zthumbs', {input: false});\r\n\r\n          zone.event('upload', function (e) {\r\n            zone.eventFiles(e).images().each(function (file) {\r\n              file.readDataURI(function (uri) {\r\n                var img = new Image;\r\n                img.src = uri;\r\n                zone.el.appendChild(img);\r\n              });\r\n            });\r\n          });\r\n        </script>\r\n      </article>\r\n\r\n      <article id=\"text\">\r\n        <h3>Read text files</h3>\r\n\r\n        <p><b>HTML5-only.</b> Drop a (better) text file from your computer to load it into the <b>textarea</b>. Drop zone can be made from any element - <b>fieldset</b>, <b>div</b> or, say, a <b>textarea</b> itself.</p>\r\n\r\n        <div id=\"ztext\">\r\n          <p>Drop one or more text files…</p>\r\n        </div>\r\n\r\n        <script type=\"sample/javascript\">\r\n          var zone = new FileDrop('ztext', {input: false});\r\n\r\n          zone.event('upload', function (e) {\r\n            zone.eventFiles(e).each(function (file) {\r\n              file.readData(\r\n                function (str) {\r\n                  var area = document.createElement('textarea');\r\n                  area.value = str;\r\n                  zone.el.appendChild(area);\r\n                },\r\n                function () { alert('Problem reading this file.'); },\r\n                'text'\r\n              );\r\n            });\r\n          });\r\n        </script>\r\n      </article>\r\n\r\n      <article id=\"dir\">\r\n        <h3>Read folders</h3>\r\n\r\n        <p><b>Supported only in Chrome 21+.</b> W3C has a <a href=\"http://www.w3.org/TR/file-system-api/#the-entry-interface\" target=\"_blank\">working draft</a> on File System API that introduces lots of interesting features allowing us to read and write files and directories. This sample will non-recursively list all files and folders, also displaying thumbnails of images it finds.\r\n\r\n        <div id=\"zdir\">\r\n          <p>Drop a directory here…</p>\r\n        </div>\r\n\r\n        <script type=\"sample/javascript\">\r\n          var zone = new FileDrop('zdir', {input: false});\r\n\r\n          zone.event('upload', function (e) {\r\n            while (cleared = zone.el.firstChild) {\r\n              zone.el.removeChild(zone.el.firstChild);\r\n            }\r\n\r\n            var error = function () { alert('Problem reading the file system.'); }\r\n\r\n            var done = function (files) {\r\n              // files is standard FileDrop's FileList object.\r\n              files.each(function (file) {\r\n                // file is FileDrop.File with native objects accessible\r\n                // as file.nativeFile and file.nativeEntry.\r\n                var node = document.createElement('p');\r\n                node.innerText = file.name\r\n\r\n                if (file.nativeFile) {\r\n                  // This is a file. We can use any FileDrop method here\r\n                  // like sendTo() and readData() - see below.\r\n                  node.innerText += ' (' + file.size + ')';\r\n                } else {\r\n                  // This is a directory - it has no File API object.\r\n                  node.innerHTML = '<b>' + node.innerHTML + '/</b>';\r\n                }\r\n\r\n                zone.el.appendChild(node);\r\n              });\r\n\r\n              // Let's show thumbs of images using FileDrop.File methods.\r\n              files.images().each(function (file) {\r\n                file.readDataURI(function (uri) {\r\n                  var img = new Image;\r\n                  img.src = uri;\r\n                  zone.el.appendChild(img);\r\n                });\r\n              });\r\n            };\r\n\r\n            zone.eventFiles(e).each(function (root) {\r\n              if (root.listEntries(done, error)) {\r\n                // Success.\r\n              } else if (!root.nativeEntry) {\r\n                zone.el.innerHTML = '<p><b>File System API is not' +\r\n                                    ' supported by this browser.</b></p>';\r\n              } else {\r\n                zone.el.innerHTML = '<p><b>Problem listing ' +\r\n                                    root.name + '.</b></p>';\r\n              }\r\n            });\r\n          });\r\n        </script>\r\n      </article>\r\n\r\n      <table id=\"events\">\r\n        <tr>\r\n          <th colspan=\"3\">Drag events</th>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#dragEnter\">dragEnter</a></th>\r\n          <td>—</td>\r\n          <td>User drags an object into the drop zone (<b class=\"ff\">Firefox</b>) or document (<b class=\"chrome\">Chrome</b>).</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#dragLeave\">dragLeave</a></th>\r\n          <td>—</td>\r\n          <td>Dragged object has left the drop zone or document.</td>\r\n        </tr>\r\n\r\n        <tr>\r\n          <th colspan=\"3\">Misc events</th>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#upload\">upload</a></th>\r\n          <td>—</td>\r\n          <td>Files were dropped or selected using the <em>Browse</em> button.</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#send\">send</a></th>\r\n          <td>—</td>\r\n          <td>File info is normalized (cross-browser) and ready to send.</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#iframeDone\">iframeDone</a></th>\r\n          <td>—</td>\r\n          <td>Server response received after uploading file via <b>iframe</b>.</td>\r\n        </tr>\r\n\r\n        <tr>\r\n          <th colspan=\"3\">Setup events</th>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#inputSetup\">inputSetup</a></th>\r\n          <td>—</td>\r\n          <td>A hidden file input is being set up.</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#fileSetup\">fileSetup</a></th>\r\n          <td>—</td>\r\n          <td>File info is uniformized (<b class=\"ff\">Firefox</b>, <b class=\"chrome\">Chrome</b> only).</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#iframeSetup\">iframeSetup</a></th>\r\n          <td>—</td>\r\n          <td>A file is about to be sent via <b>iframe</b>.</td>\r\n        </tr>\r\n\r\n        <tr>\r\n          <th colspan=\"3\">XMLHttpRequest events</th>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#xhrSetup\">xhrSetup</a></th>\r\n          <td>—</td>\r\n          <td>An <b>XHR</b> was created to be used to upload a file.</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#xhrSend\">xhrSend</a></th>\r\n          <td>—</td>\r\n          <td>After <b>xhrSetup</b>, <b>XHR</b> needs to be <b>send()</b>.</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#progress\">progress</a></th>\r\n          <td>—</td>\r\n          <td>Data upload progress, in <b class=\"ff\">Firefox</b> only works on large files.</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#error\">error</a></th>\r\n          <td>—</td>\r\n          <td>Request has ended with an error</td>\r\n        </tr>\r\n        <tr>\r\n          <th><a href=\"http://filedropjs.org/#done\">done</a></th>\r\n          <td>—</td>\r\n          <td>Data has been successfully uploaded.</td>\r\n        </tr>\r\n      </table>\r\n\r\n      <h4>Last server response to upload</h4>\r\n      <input type=\"text\" id=\"response\" readonly=\"readonly\" placeholder=\"Nothing uploaded yet\">\r\n      <textarea id=\"log\" cols=\"20\" rows=\"20\" readonly=\"readonly\"></textarea>\r\n    </div>\r\n\r\n    <script type=\"text/javascript\" src=\"../filedrop.js\"></script>\r\n    <!-- If the above is missing (useful when debugging) -->\r\n    <script type=\"text/javascript\" src=\"filedrop.js\"></script>\r\n    <script type=\"text/javascript\" src=\"filedrop-min.js\"></script>\r\n\r\n    <script type=\"text/javascript\" src=\"index.js\"></script>\r\n    <!-- jQuery is only used in plugin samples, it's not required for FileDrop -->\r\n    <script type=\"text/javascript\" src=\"jquery.js\"></script>\r\n  </body>\r\n</html>"
  },
  {
    "path": "demo/index.js",
    "content": "/*!\n  FileDrop Revamped - demo page\n  in public domain  | http://filedropjs.org\n  by Proger_XP      | http://proger.me\n*/\n\n(function (fd) {\n  if (!fd) {\n    return alert('Problem loading FileDrop script. Check your console for messages.')\n  }\n\n  var yesImage = 'data:image/gif;base64,R0lGODlhEAAOAKIAAEa+FXvcR+Pm4qzmk3ecbPLy8gAAAAAAACH5BAAAAAAALAAAAAAQAA4AAANDWLqsRC26MaBcZKjqLB4CBUBEEHglNQAjAVBnkYqjzJonHrCWywK6n0fgu+FqDKIR5kmWAqpmgwjlXBRUguC6IG4lCQA7'\n\n  var $\n  var curSample = ':'\n  var allFiles = new fd.FileList\n\n  function cleanCode(str) {\n    str = $.trim(str)\n    var minIndent = NaN\n\n    $.each(str.match(/^ +/gm) || [], function (i, indent) {\n      if (isNaN(minIndent) || minIndent > indent.length) {\n        minIndent = indent.length\n      }\n    })\n\n    if (!isNaN(minIndent)) {\n      str = str.replace(new RegExp('^ {' + minIndent + '}', 'gm'), '')\n    }\n\n    return str\n  }\n\n  function nav(cur) {\n    curSample = cur\n    cur = cur || $('nav li a').attr('href')\n    log('')\n\n    $(cur).show()\n      .siblings('article').hide()\n\n    $('nav li').removeClass('cur')\n      .find('a[href=\"' + cur + '\"]').parent().addClass('cur')\n\n    var cont = $(cur)\n    if (!cont.length) { return }\n\n    cont.children('h3').append($('#btns'))\n    var js = cont.children('script').first()\n    var html = cont.children().first()\n    while (html.is('h3,p')) { html = html.next() }\n    html = html.nextAll(':not(script)').andSelf()\n\n    if (js[0] == cont.children().last()[0]) {\n      // Sample page not yet initialized.\n      cont.append('<h4>JavaScript</h4>')\n      $('<pre>').text( cleanCode(js.html()) ).appendTo(cont)\n\n      cont.append('<h4>HTML</h4>')\n      var rawHTML = $('<div>').append(html.clone()).html()\n      $('<pre>').text( cleanCode(rawHTML) ).appendTo(cont)\n\n      try {\n        ;(function () { eval(js.html()) })()\n      } catch (e) {\n        alert('Problem running this sample:\\n' + e)\n      }\n    }\n  }\n\n  function log(line) {\n    var log = fd.byID('log')\n    log.value && (line += '\\n')\n    if (log.value.substr(0, line.length) != line) {\n      log.value = line + log.value\n    }\n    return line\n  }\n\n  fd.addEvent(window, 'load', function () {\n    if (!('jQuery' in window)) {\n      return\n    }\n\n    $ = jQuery\n\n    setInterval(function () {\n      var cur = location.hash\n      curSample == cur || nav(cur)\n    }, 100)\n\n    $(document).on('click', 'article h4', function () {\n      $(this).toggleClass('collapsed')\n    })\n  })\n\n  fd.onObjectCall = function (e, arg1, arg2) {\n    $('#events th').filter(function () { return $.trim(this.textContent) == e })\n      .next().empty().append( $('<img>').attr('src', yesImage) )\n\n    var handlers = this.events[e] ? this.events[e].length : 0\n    var s = handlers == 1 ? '' : 's'\n    log('  ' + e + ' event (' + handlers + ' handler' + s + ')')\n\n    if (e == 'iframeSetup') {\n      log('\\nSending data via <'+'iframe>...\\n')\n    } else if (e == 'iframeDone') {\n      fd.byID('response').value = 'IFrame upload response: ' + arg1.responseText;\n    } else if (e == 'xhrSend') {\n      var info = [Math.round(this.size / 1024) + ' KiB', this.type,\n                  'changed on ' + this.modDate.toLocaleString()]\n      log('\\n' + this.name + ' (' + info.join(', ') + ')...\\n')\n    } else if (e == 'xhrSetup') {\n      $('#berror.down').length && arg1.open('POST', 'non-existing.php', true)\n    } else if (e == 'fileSetup') {\n      allFiles.push(arg1)\n    } else if (e == 'progress') {\n      log(arg1 + ' of ' + arg2 + ' bytes uploaded')\n    } else if (e == 'error') {\n      if (arg2) {\n        fd.byID('response').value = '-- XMLHttpRequest error -- status = ' + arg2.status\n      } else {\n        log(arg1)\n      }\n    } else if (e == 'done') {\n      fd.byID('response').value = arg1.responseText\n    }\n  }\n\n  fd.byID('badd').onclick = function () {\n    var cont = $(this).parents('article')\n    var zone = cont.find('.fd-zone').first()\n    var parent = zone.parent().is('article') ? zone : zone.parentsUntil('article')\n    var id = fd.uniqueID()\n\n    var regexp = new RegExp(zone.attr('id'), 'g')\n    var code = $('<div>').append(zone.clone()).html().replace(regexp, id)\n    $(code).css({marginTop: '1em'}).insertAfter(parent)\n\n    var js = cont.children('script').first()\n    var code = js.html().replace(regexp, id)\n    ;(function () { eval(code) })()\n  }\n\n  fd.byID('berror').onclick = function () {\n    $(this).toggleClass('down')\n  }\n\n  fd.byID('babort').onclick = function () {\n    $.each(fd.all, function (i, obj) {\n      obj.abortIFrame && obj.abortIFrame()\n    })\n\n    allFiles.abort()\n  }\n\n  ;(fd.byID('report') || {}).onclick = function () {\n    var ua = navigator.userAgent\n    var msg = prompt('Have any comment? The following user-agent string will be sent along:\\n' + ua, '-');\n\n    if (typeof msg == 'string') {\n      var script = document.createElement('script')\n      script.type = 'text/javascript'\n      script.src = this.href.replace(/\\/+$/, '') +\n                   '/report.php?jsonp=1&msg=' + encodeURIComponent('[BROKEN] ' + msg)\n      var first = document.getElementsByTagName('script')[0]\n      first.parentNode.insertBefore(script, first)\n    }\n\n    return false\n  }\n})(window.fd)"
  },
  {
    "path": "demo/jquery.js",
    "content": "/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license\n//@ sourceMappingURL=jquery-1.10.2.min.map\n*/\n(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f=\"1.10.2\",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\\d*\\.|)\\d+(?:[eE][+-]?\\d+|)/.source,T=/\\S+/g,C=/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,N=/^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,k=/^<(\\w+)\\s*\\/?>(?:<\\/\\1>|)$/,E=/^[\\],:{}\\s]*$/,S=/(?:^|:|,)(?:\\s*\\[)+/g,A=/\\\\(?:[\"\\\\\\/bfnrt]|u[\\da-fA-F]{4})/g,j=/\"[^\"\\\\\\r\\n]*\"|true|false|null|-?(?:\\d+\\.|)\\d+(?:[eE][+-]?\\d+|)/g,D=/^-ms-/,L=/-([\\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||\"load\"===e.type||\"complete\"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener(\"DOMContentLoaded\",q,!1),e.removeEventListener(\"load\",q,!1)):(a.detachEvent(\"onreadystatechange\",q),e.detachEvent(\"onload\",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if(\"string\"==typeof e){if(i=\"<\"===e.charAt(0)&&\">\"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:\"\",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for(\"boolean\"==typeof s&&(c=s,s=arguments[1]||{},l=2),\"object\"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:\"jQuery\"+(f+Math.random()).replace(/\\D/g,\"\"),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger(\"ready\").off(\"ready\"))}},isFunction:function(e){return\"function\"===x.type(e)},isArray:Array.isArray||function(e){return\"array\"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+\"\":\"object\"==typeof e||\"function\"==typeof e?c[y.call(e)]||\"object\":typeof e},isPlainObject:function(e){var n;if(!e||\"object\"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,\"constructor\")&&!v.call(e.constructor.prototype,\"isPrototypeOf\"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||\"string\"!=typeof e)return null;\"boolean\"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:\"string\"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,\"@\").replace(j,\"]\").replace(S,\"\")))?Function(\"return \"+n)():(x.error(\"Invalid JSON: \"+n),t)},parseXML:function(n){var r,i;if(!n||\"string\"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,\"text/xml\")):(r=new ActiveXObject(\"Microsoft.XMLDOM\"),r.async=\"false\",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName(\"parsererror\").length||x.error(\"Invalid XML: \"+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,\"ms-\").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call(\"\\ufeff\\u00a0\")?function(e){return null==e?\"\":b.call(e)}:function(e){return null==e?\"\":(e+\"\").replace(C,\"\")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,\"string\"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if(\"number\"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return\"string\"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if(\"object\"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),\"complete\"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener(\"DOMContentLoaded\",q,!1),e.addEventListener(\"load\",q,!1);else{a.attachEvent(\"onreadystatechange\",q),e.attachEvent(\"onload\",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll(\"left\")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"),function(e,t){c[\"[object \"+t+\"]\"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:\"array\"===n||\"function\"!==n&&(0===t||\"number\"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b=\"sizzle\"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B=\"checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped\",P=\"[\\\\x20\\\\t\\\\r\\\\n\\\\f]\",R=\"(?:\\\\\\\\.|[\\\\w-]|[^\\\\x00-\\\\xa0])+\",W=R.replace(\"w\",\"w#\"),$=\"\\\\[\"+P+\"*(\"+R+\")\"+P+\"*(?:([*^$|!~]?=)\"+P+\"*(?:(['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|(\"+W+\")|)|)\"+P+\"*\\\\]\",I=\":(\"+R+\")(?:\\\\(((['\\\"])((?:\\\\\\\\.|[^\\\\\\\\])*?)\\\\3|((?:\\\\\\\\.|[^\\\\\\\\()[\\\\]]|\"+$.replace(3,8)+\")*)|.*)\\\\)|)\",z=RegExp(\"^\"+P+\"+|((?:^|[^\\\\\\\\])(?:\\\\\\\\.)*)\"+P+\"+$\",\"g\"),X=RegExp(\"^\"+P+\"*,\"+P+\"*\"),U=RegExp(\"^\"+P+\"*([>+~]|\"+P+\")\"+P+\"*\"),V=RegExp(P+\"*[+~]\"),Y=RegExp(\"=\"+P+\"*([^\\\\]'\\\"]*)\"+P+\"*\\\\]\",\"g\"),J=RegExp(I),G=RegExp(\"^\"+W+\"$\"),Q={ID:RegExp(\"^#(\"+R+\")\"),CLASS:RegExp(\"^\\\\.(\"+R+\")\"),TAG:RegExp(\"^(\"+R.replace(\"w\",\"w*\")+\")\"),ATTR:RegExp(\"^\"+$),PSEUDO:RegExp(\"^\"+I),CHILD:RegExp(\"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\\\(\"+P+\"*(even|odd|(([+-]|)(\\\\d*)n|)\"+P+\"*(?:([+-]|)\"+P+\"*(\\\\d+)|))\"+P+\"*\\\\)|)\",\"i\"),bool:RegExp(\"^(?:\"+B+\")$\",\"i\"),needsContext:RegExp(\"^\"+P+\"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\\\(\"+P+\"*((?:-\\\\d)?\\\\d*)\"+P+\"*\\\\)|)(?=[^-]|$)\",\"i\")},K=/^[^{]+\\{\\s*\\[native \\w/,Z=/^(?:#([\\w-]+)|(\\w+)|\\.([\\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\\d$/i,nt=/'|\\\\/g,rt=RegExp(\"\\\\\\\\([\\\\da-f]{1,6}\"+P+\"?|(\"+P+\")|.)\",\"ig\"),it=function(e,t,n){var r=\"0x\"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||\"string\"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&\"object\"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute(\"id\"))?m=d.replace(nt,\"\\\\$&\"):t.setAttribute(\"id\",m),m=\"[id='\"+m+\"'] \",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(\",\")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute(\"id\")}}}return kt(e.replace(z,\"$1\"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=\" \")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement(\"div\");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split(\"|\"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return\"input\"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return(\"input\"===n||\"button\"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?\"HTML\"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent(\"onbeforeunload\",function(){p()}),r.attributes=ut(function(e){return e.className=\"i\",!e.getAttribute(\"className\")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment(\"\")),!e.getElementsByTagName(\"*\").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML=\"<div class='a'></div><div class='a i'></div>\",e.firstChild.className=\"i\",2===e.getElementsByClassName(\"i\").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute(\"id\")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode(\"id\");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if(\"*\"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML=\"<select><option selected=''></option></select>\",e.querySelectorAll(\"[selected]\").length||g.push(\"\\\\[\"+P+\"*(?:value|\"+B+\")\"),e.querySelectorAll(\":checked\").length||g.push(\":checked\")}),ut(function(e){var t=n.createElement(\"input\");t.setAttribute(\"type\",\"hidden\"),e.appendChild(t).setAttribute(\"t\",\"\"),e.querySelectorAll(\"[t^='']\").length&&g.push(\"[*^$]=\"+P+\"*(?:''|\\\"\\\")\"),e.querySelectorAll(\":enabled\").length||g.push(\":enabled\",\":disabled\"),e.querySelectorAll(\"*,:x\"),g.push(\",.*:\")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,\"div\"),y.call(e,\"[s!='']:x\"),m.push(\"!=\",I)}),g=g.length&&RegExp(g.join(\"|\")),m=m.length&&RegExp(m.join(\"|\")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,\"='$1']\"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error(\"Syntax error, unrecognized expression: \"+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n=\"\",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if(\"string\"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{\">\":{dir:\"parentNode\",first:!0},\" \":{dir:\"parentNode\"},\"+\":{dir:\"previousSibling\",first:!0},\"~\":{dir:\"previousSibling\"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||\"\").replace(rt,it),\"~=\"===e[2]&&(e[3]=\" \"+e[3]+\" \"),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),\"nth\"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*(\"even\"===e[3]||\"odd\"===e[3])),e[5]=+(e[7]+e[8]||\"odd\"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(\")\",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return\"*\"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+\" \"];return t||(t=RegExp(\"(^|\"+P+\")\"+e+\"(\"+P+\"|$)\"))&&N(e,function(e){return t.test(\"string\"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute(\"class\")||\"\")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?\"!=\"===t:t?(i+=\"\",\"=\"===t?i===n:\"!=\"===t?i!==n:\"^=\"===t?n&&0===i.indexOf(n):\"*=\"===t?n&&i.indexOf(n)>-1:\"$=\"===t?n&&i.slice(-n.length)===n:\"~=\"===t?(\" \"+i+\" \").indexOf(n)>-1:\"|=\"===t?i===n||i.slice(0,n.length+1)===n+\"-\":!1):!0}},CHILD:function(e,t,n,r,i){var o=\"nth\"!==e.slice(0,3),a=\"last\"!==e.slice(-4),s=\"of-type\"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?\"nextSibling\":\"previousSibling\",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g=\"only\"===e&&!h&&\"nextSibling\"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error(\"unsupported pseudo: \"+e);return r[b]?r(t):r.length>1?(n=[e,e,\"\",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,\"$1\"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||\"\")||at.error(\"unsupported lang: \"+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute(\"xml:lang\")||t.getAttribute(\"lang\"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+\"-\");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&!!e.checked||\"option\"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>\"@\"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return\"input\"===t&&\"button\"===e.type||\"button\"===t},text:function(e){var t;return\"input\"===e.nodeName.toLowerCase()&&\"text\"===e.type&&(null==(t=e.getAttribute(\"type\"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+\" \"];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z,\" \")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r=\"\";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&\"parentNode\"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+\" \"+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||\"*\",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[\" \"],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:\" \"===e[l-2].type?\"*\":\"\"})).replace(z,\"$1\"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b=\"0\",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG(\"*\",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+\" \"];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&\"ID\"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split(\"\").sort(A).join(\"\")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement(\"div\"))}),ut(function(e){return e.innerHTML=\"<a href='#'></a>\",\"#\"===e.firstChild.getAttribute(\"href\")})||ct(\"type|href|height|width\",function(e,n,r){return r?t:e.getAttribute(n,\"type\"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML=\"<input/>\",e.firstChild.setAttribute(\"value\",\"\"),\"\"===e.firstChild.getAttribute(\"value\")})||ct(\"value\",function(e,n,r){return r||\"input\"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute(\"disabled\")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[\":\"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e=\"string\"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);\"function\"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&\"string\"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[[\"resolve\",\"done\",x.Callbacks(\"once memory\"),\"resolved\"],[\"reject\",\"fail\",x.Callbacks(\"once memory\"),\"rejected\"],[\"notify\",\"progress\",x.Callbacks(\"memory\")]],n=\"pending\",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+\"With\"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+\"With\"](this===i?r:this,arguments),this},i[o[0]+\"With\"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement(\"div\");if(d.setAttribute(\"className\",\"t\"),d.innerHTML=\"  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>\",n=d.getElementsByTagName(\"*\")||[],r=d.getElementsByTagName(\"a\")[0],!r||!r.style||!n.length)return t;s=a.createElement(\"select\"),u=s.appendChild(a.createElement(\"option\")),o=d.getElementsByTagName(\"input\")[0],r.style.cssText=\"top:1px;float:left;opacity:.5\",t.getSetAttribute=\"t\"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName(\"tbody\").length,t.htmlSerialize=!!d.getElementsByTagName(\"link\").length,t.style=/top/.test(r.getAttribute(\"style\")),t.hrefNormalized=\"/a\"===r.getAttribute(\"href\"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement(\"form\").enctype,t.html5Clone=\"<:nav></:nav>\"!==a.createElement(\"nav\").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement(\"input\"),o.setAttribute(\"value\",\"\"),t.input=\"\"===o.getAttribute(\"value\"),o.value=\"t\",o.setAttribute(\"type\",\"radio\"),t.radioValue=\"t\"===o.value,o.setAttribute(\"checked\",\"t\"),o.setAttribute(\"name\",\"t\"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent(\"onclick\",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c=\"on\"+f,\"t\"),t[f+\"Bubbles\"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip=\"content-box\",d.cloneNode(!0).style.backgroundClip=\"\",t.clearCloneStyle=\"content-box\"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast=\"0\"!==f,x(function(){var n,r,o,s=\"padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;\",l=a.getElementsByTagName(\"body\")[0];l&&(n=a.createElement(\"div\"),n.style.cssText=\"border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px\",l.appendChild(n).appendChild(d),d.innerHTML=\"<table><tr><td></td><td>t</td></tr></table>\",o=d.getElementsByTagName(\"td\"),o[0].style.cssText=\"padding:0;margin:0;border:0;display:none\",p=0===o[0].offsetHeight,o[0].style.display=\"\",o[1].style.display=\"none\",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML=\"\",d.style.cssText=\"box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;\",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition=\"1%\"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable=\"4px\"===(e.getComputedStyle(d,null)||{width:\"4px\"}).width,r=d.appendChild(a.createElement(\"div\")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width=\"0\",d.style.width=\"1px\",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML=\"\",d.style.cssText=s+\"width:1px;padding:1px;display:inline;zoom:1\",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display=\"block\",d.innerHTML=\"<div></div>\",d.firstChild.style.width=\"5px\",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t\n}({});var B=/(?:\\{[\\s\\S]*\\}|\\[[\\s\\S]*\\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||\"string\"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),(\"object\"==typeof n||\"function\"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),\"string\"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(\" \")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute(\"classid\")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,\"parsedAttrs\"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf(\"data-\")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,\"parsedAttrs\",!0)}return o}return\"object\"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i=\"data-\"+n.replace(P,\"-$1\").toLowerCase();if(r=e.getAttribute(i),\"string\"==typeof r){try{r=\"true\"===r?!0:\"false\"===r?!1:\"null\"===r?null:+r+\"\"===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if((\"data\"!==t||!x.isEmptyObject(e[t]))&&\"toJSON\"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||\"fx\")+\"queue\",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||\"fx\";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};\"inprogress\"===i&&(i=n.shift(),r--),i&&(\"fx\"===t&&n.unshift(\"inprogress\"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+\"queueHooks\";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks(\"once memory\").add(function(){x._removeData(e,t+\"queue\"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return\"string\"!=typeof e&&(n=e,e=\"fx\",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),\"fx\"===e&&\"inprogress\"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||\"fx\",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||\"fx\",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};\"string\"!=typeof e&&(n=e,e=t),e=e||\"fx\";while(s--)r=x._data(a[s],e+\"queueHooks\"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\\t\\r\\n\\f]/g,V=/\\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=\"string\"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||\"\").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(\" \"+n.className+\" \").replace(U,\" \"):\" \")){o=0;while(i=t[o++])0>r.indexOf(\" \"+i+\" \")&&(r+=i+\" \");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||\"string\"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||\"\").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(\" \"+n.className+\" \").replace(U,\" \"):\"\")){o=0;while(i=t[o++])while(r.indexOf(\" \"+i+\" \")>=0)r=r.replace(\" \"+i+\" \",\" \");n.className=e?x.trim(r):\"\"}return this},toggleClass:function(e,t){var n=typeof e;return\"boolean\"==typeof t&&\"string\"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(\"string\"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||\"boolean\"===n)&&(this.className&&x._data(this,\"__className__\",this.className),this.className=this.className||e===!1?\"\":x._data(this,\"__className__\")||\"\")})},hasClass:function(e){var t=\" \"+e+\" \",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(\" \"+this[n].className+\" \").replace(U,\" \").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o=\"\":\"number\"==typeof o?o+=\"\":x.isArray(o)&&(o=x.map(o,function(e){return null==e?\"\":e+\"\"})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&\"set\"in r&&r.set(this,o,\"value\")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&\"get\"in r&&(n=r.get(o,\"value\"))!==t?n:(n=o.value,\"string\"==typeof n?n.replace(V,\"\"):null==n?\"\":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,\"value\");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o=\"select-one\"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute(\"disabled\"))||n.parentNode.disabled&&x.nodeName(n.parentNode,\"optgroup\"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&\"get\"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&\"set\"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+\"\"),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase(\"default-\"+n)]=e[r]=!1:x.attr(e,n,\"\"),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&\"radio\"===t&&x.nodeName(e,\"input\")){var n=e.value;return e.setAttribute(\"type\",t),n&&(e.value=n),t}}}},propFix:{\"for\":\"htmlFor\",\"class\":\"className\"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&\"set\"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&\"get\"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,\"tabindex\");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase(\"default-\"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase(\"default-\"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,\"input\")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+=\"\",\"value\"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&\"\"!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,\"\"===t?!1:t,n)}},x.each([\"width\",\"height\"],function(e,n){x.attrHooks[n]={set:function(e,r){return\"\"===r?(e.setAttribute(n,\"auto\"),r):t}}})),x.support.hrefNormalized||x.each([\"href\",\"src\"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+\"\"}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each([\"tabIndex\",\"readOnly\",\"maxLength\",\"cellSpacing\",\"cellPadding\",\"rowSpan\",\"colSpan\",\"useMap\",\"frameBorder\",\"contentEditable\"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype=\"encoding\"),x.each([\"radio\",\"checkbox\"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute(\"value\")?\"on\":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||\"\").match(T)||[\"\"],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||\"\").split(\".\").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(\".\")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent(\"on\"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||\"\").match(T)||[\"\"],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||\"\").split(\".\").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp(\"(^|\\\\.)\"+h.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&(\"**\"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,\"events\"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,\"type\")?n.type:n,m=v.call(n,\"namespace\")?n.namespace.split(\".\"):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(\".\")>=0&&(m=g.split(\".\"),g=m.shift(),m.sort()),l=0>g.indexOf(\":\")&&\"on\"+g,n=n[x.expando]?n:new x.Event(g,\"object\"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join(\".\"),n.namespace_re=n.namespace?RegExp(\"(^|\\\\.)\"+m.join(\"\\\\.(?:.*\\\\.|)\")+\"(\\\\.|$)\"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,\"events\")||{})[n.type]&&x._data(u,\"handle\"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,\"events\")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||\"click\"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||\"click\"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+\" \",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:\"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),fixHooks:{},keyHooks:{props:\"char charCode key keyCode\".split(\" \"),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:\"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:\"focusin\"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:\"focusout\"},click:{trigger:function(){return x.nodeName(this,\"input\")&&\"checkbox\"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,\"a\")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r=\"on\"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:\"mouseover\",mouseleave:\"mouseout\"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,\"form\")?!1:(x.event.add(this,\"click._submit keypress._submit\",function(e){var n=e.target,r=x.nodeName(n,\"input\")||x.nodeName(n,\"button\")?n.form:t;r&&!x._data(r,\"submitBubbles\")&&(x.event.add(r,\"submit._submit\",function(e){e._submit_bubble=!0}),x._data(r,\"submitBubbles\",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate(\"submit\",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,\"form\")?!1:(x.event.remove(this,\"._submit\"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?((\"checkbox\"===this.type||\"radio\"===this.type)&&(x.event.add(this,\"propertychange._change\",function(e){\"checked\"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,\"click._change\",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate(\"change\",this,e,!0)})),!1):(x.event.add(this,\"beforeactivate._change\",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,\"changeBubbles\")&&(x.event.add(t,\"change._change\",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate(\"change\",this.parentNode,e,!0)}),x._data(t,\"changeBubbles\",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||\"radio\"!==n.type&&\"checkbox\"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,\"._change\"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:\"focusin\",blur:\"focusout\"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if(\"object\"==typeof e){\"string\"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&(\"string\"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+\".\"+i.namespace:i.origType,i.selector,i.handler),this;if(\"object\"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||\"function\"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\\[\\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if(\"string\"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+\" \"+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,\"string\"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||\"string\"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?\"string\"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n=\"string\"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,\"parentNode\")},parentsUntil:function(e,t,n){return x.dir(e,\"parentNode\",n)},next:function(e){return pt(e,\"nextSibling\")},prev:function(e){return pt(e,\"previousSibling\")},nextAll:function(e){return x.dir(e,\"nextSibling\")},prevAll:function(e){return x.dir(e,\"previousSibling\")},nextUntil:function(e,t,n){return x.dir(e,\"nextSibling\",n)},prevUntil:function(e,t,n){return x.dir(e,\"previousSibling\",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,\"iframe\")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return\"Until\"!==e.slice(-5)&&(r=n),r&&\"string\"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=\":not(\"+e+\")\"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if(\"string\"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split(\"|\"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht=\"abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video\",gt=/ jQuery\\d+=\"(?:null|\\d+)\"/g,mt=RegExp(\"<(?:\"+ht+\")[\\\\s/>]\",\"i\"),yt=/^\\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\\w:]+)[^>]*)\\/>/gi,bt=/<([\\w:]+)/,xt=/<tbody/i,wt=/<|&#?\\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\\s*(?:[^=]|=\\s*.checked.)/i,kt=/^$|\\/(?:java|ecma)script/i,Et=/^true\\/(.*)/,St=/^\\s*<!(?:\\[CDATA\\[|--)|(?:\\]\\]|--)>\\s*$/g,At={option:[1,\"<select multiple='multiple'>\",\"</select>\"],legend:[1,\"<fieldset>\",\"</fieldset>\"],area:[1,\"<map>\",\"</map>\"],param:[1,\"<object>\",\"</object>\"],thead:[1,\"<table>\",\"</table>\"],tr:[2,\"<table><tbody>\",\"</tbody></table>\"],col:[2,\"<table><tbody></tbody><colgroup>\",\"</colgroup></table>\"],td:[3,\"<table><tbody><tr>\",\"</tr></tbody></table>\"],_default:x.support.htmlSerialize?[0,\"\",\"\"]:[1,\"X<div>\",\"</div>\"]},jt=dt(a),Dt=jt.appendChild(a.createElement(\"div\"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,\"script\")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,\"select\")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,\"\"):t;if(!(\"string\"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||[\"\",\"\"])[1].toLowerCase()])){e=e.replace(vt,\"<$1></$2>\");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||\"string\"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,\"script\"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,\"script\"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||\"\")&&!x._data(i,\"globalEval\")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||\"\").replace(St,\"\")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,\"table\")&&x.nodeName(1===t.nodeType?t:t.firstChild,\"tr\")?e.getElementsByTagName(\"tbody\")[0]||e.appendChild(e.ownerDocument.createElement(\"tbody\")):e}function Ht(e){return e.type=(null!==x.find.attr(e,\"type\"))+\"/\"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute(\"type\"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,\"globalEval\",!t||x._data(t[r],\"globalEval\"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}\"script\"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):\"object\"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):\"input\"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):\"option\"===n?t.defaultSelected=t.selected=e.defaultSelected:(\"input\"===n||\"textarea\"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:\"append\",prependTo:\"prepend\",insertBefore:\"before\",insertAfter:\"after\",replaceAll:\"replaceWith\"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||\"*\"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||\"*\"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test(\"<\"+e.nodeName+\">\")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,\"script\"),r.length>0&&_t(r,!l&&Ft(e,\"script\")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if(\"object\"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement(\"div\")),l=(bt.exec(o)||[\"\",\"\"])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,\"<$1></$2>\")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o=\"table\"!==l||xt.test(o)?\"<table>\"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],\"tbody\")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent=\"\";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,\"input\"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),\"script\"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||\"\")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);\nu[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:\"GET\",dataType:\"script\",async:!1,global:!1,\"throws\":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,\"body\")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\\([^)]*\\)/i,It=/opacity\\s*=\\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp(\"^(\"+w+\")(.*)$\",\"i\"),Yt=RegExp(\"^(\"+w+\")(?!px)[a-z%]+$\",\"i\"),Jt=RegExp(\"^([+-])=(\"+w+\")\",\"i\"),Gt={BODY:\"block\"},Qt={position:\"absolute\",visibility:\"hidden\",display:\"block\"},Kt={letterSpacing:0,fontWeight:400},Zt=[\"Top\",\"Right\",\"Bottom\",\"Left\"],en=[\"Webkit\",\"O\",\"Moz\",\"ms\"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,\"none\"===x.css(e,\"display\")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,\"olddisplay\"),n=r.style.display,t?(o[a]||\"none\"!==n||(r.style.display=\"\"),\"\"===r.style.display&&nn(r)&&(o[a]=x._data(r,\"olddisplay\",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&\"none\"!==n||!i)&&x._data(r,\"olddisplay\",i?n:x.css(r,\"display\"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&\"none\"!==r.style.display&&\"\"!==r.style.display||(r.style.display=t?o[a]||\"\":\"none\"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return\"boolean\"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,\"opacity\");return\"\"===n?\"1\":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{\"float\":x.support.cssFloat?\"cssFloat\":\"styleFloat\"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&\"get\"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,\"string\"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a=\"number\"),!(null==r||\"number\"===a&&isNaN(r)||(\"number\"!==a||x.cssNumber[l]||(r+=\"px\"),x.support.clearCloneStyle||\"\"!==r||0!==n.indexOf(\"background\")||(u[n]=\"inherit\"),s&&\"set\"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&\"get\"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),\"normal\"===a&&n in Kt&&(a=Kt[n]),\"\"===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(\"\"!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left=\"fontSize\"===n?\"1em\":l,l=u.pixelLeft+\"px\",u.left=i,a&&(o.left=a)),\"\"===l?\"auto\":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||\"px\"):t}function an(e,t,n,r,i){var o=n===(r?\"border\":\"content\")?4:\"width\"===t?1:0,a=0;for(;4>o;o+=2)\"margin\"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?(\"content\"===n&&(a-=x.css(e,\"padding\"+Zt[o],!0,i)),\"margin\"!==n&&(a-=x.css(e,\"border\"+Zt[o]+\"Width\",!0,i))):(a+=x.css(e,\"padding\"+Zt[o],!0,i),\"padding\"!==n&&(a+=x.css(e,\"border\"+Zt[o]+\"Width\",!0,i)));return a}function sn(e,t,n){var r=!0,i=\"width\"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&\"border-box\"===x.css(e,\"boxSizing\",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?\"border\":\"content\"),r,o)+\"px\"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),\"none\"!==n&&n||(Pt=(Pt||x(\"<iframe frameborder='0' width='0' height='0'/>\").css(\"cssText\",\"display:block !important\")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write(\"<!doctype html><html><body>\"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],\"display\");return n.remove(),r}x.each([\"height\",\"width\"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,\"display\"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&\"border-box\"===x.css(e,\"boxSizing\",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||\"\")?.01*parseFloat(RegExp.$1)+\"\":t?\"1\":\"\"},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?\"alpha(opacity=\"+100*t+\")\":\"\",o=r&&r.filter||n.filter||\"\";n.zoom=1,(t>=1||\"\"===t)&&\"\"===x.trim(o.replace($t,\"\"))&&n.removeAttribute&&(n.removeAttribute(\"filter\"),\"\"===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+\" \"+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:\"inline-block\"},Wt,[e,\"marginRight\"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each([\"top\",\"left\"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+\"px\":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&\"none\"===(e.style&&e.style.display||x.css(e,\"display\"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:\"\",padding:\"\",border:\"Width\"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o=\"string\"==typeof n?n.split(\" \"):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\\[\\]$/,fn=/\\r?\\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,\"elements\");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(\":disabled\")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,\"\\r\\n\")}}):{name:t.name,value:n.replace(fn,\"\\r\\n\")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?\"\":t,i[i.length]=encodeURIComponent(e)+\"=\"+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join(\"&\").replace(cn,\"+\")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+\"[\"+(\"object\"==typeof i?t:\"\")+\"]\",i,n,r)});else if(n||\"object\"!==x.type(t))r(e,t);else for(i in t)gn(e+\"[\"+i+\"]\",t[i],n,r)}x.each(\"blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu\".split(\" \"),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,\"**\"):this.off(t,e||\"**\",n)}});var mn,yn,vn=x.now(),bn=/\\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\\/\\//,En=/^([\\w.+-]+:)(?:\\/\\/([^\\/?#:]*)(?::(\\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn=\"*/\".concat(\"*\");try{yn=o.href}catch(Ln){yn=a.createElement(\"a\"),yn.href=\"\",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){\"string\"!=typeof t&&(n=t,t=\"*\");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])\"+\"===r[0]?(r=r.slice(1)||\"*\",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return\"string\"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o[\"*\"]&&s(\"*\")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if(\"string\"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(\" \");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&\"object\"==typeof n&&(a=\"POST\"),s.length>0&&x.ajax({url:e,type:a,dataType:\"html\",data:n}).done(function(e){o=arguments,s.html(i?x(\"<div>\").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each([\"ajaxStart\",\"ajaxStop\",\"ajaxComplete\",\"ajaxError\",\"ajaxSuccess\",\"ajaxSend\"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:\"GET\",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:\"application/x-www-form-urlencoded; charset=UTF-8\",accepts:{\"*\":Dn,text:\"text/plain\",html:\"text/html\",xml:\"application/xml, text/xml\",json:\"application/json, text/javascript\"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:\"responseXML\",text:\"responseText\",json:\"responseJSON\"},converters:{\"* text\":String,\"text html\":!0,\"text json\":x.parseJSON,\"text xml\":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){\"object\"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks(\"once memory\"),m=p.statusCode||{},y={},v={},b=0,w=\"canceled\",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+\"\").replace(xn,\"\").replace(kn,mn[1]+\"//\"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||\"*\").toLowerCase().match(T)||[\"\"],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||(\"http:\"===r[1]?\"80\":\"443\"))===(mn[3]||(\"http:\"===mn[1]?\"80\":\"443\")))),p.data&&p.processData&&\"string\"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger(\"ajaxStart\"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?\"&\":\"?\")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,\"$1_=\"+vn++):o+(bn.test(o)?\"&\":\"?\")+\"_=\"+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader(\"If-Modified-Since\",x.lastModified[o]),x.etag[o]&&C.setRequestHeader(\"If-None-Match\",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader(\"Content-Type\",p.contentType),C.setRequestHeader(\"Accept\",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+(\"*\"!==p.dataTypes[0]?\", \"+Dn+\"; q=0.01\":\"\"):p.accepts[\"*\"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w=\"abort\";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger(\"ajaxSend\",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort(\"timeout\")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,\"No Transport\");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||\"\",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader(\"Last-Modified\"),T&&(x.lastModified[o]=T),T=C.getResponseHeader(\"etag\"),T&&(x.etag[o]=T)),204===e||\"HEAD\"===p.type?N=\"nocontent\":304===e?N=\"notmodified\":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N=\"error\",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+\"\",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?\"ajaxSuccess\":\"ajaxError\",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger(\"ajaxComplete\",[C,p]),--x.active||x.event.trigger(\"ajaxStop\")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,\"json\")},getScript:function(e,n){return x.get(e,t,n,\"script\")}}),x.each([\"get\",\"post\"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while(\"*\"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader(\"Content-Type\"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+\" \"+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if(\"*\"===o)o=l;else if(\"*\"!==l&&l!==o){if(a=u[l+\" \"+o]||u[\"* \"+o],!a)for(i in u)if(s=i.split(\" \"),s[1]===o&&(a=u[l+\" \"+s[0]]||u[\"* \"+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e[\"throws\"])t=a(t);else try{t=a(t)}catch(p){return{state:\"parsererror\",error:a?p:\"No conversion from \"+l+\" to \"+o}}}return{state:\"success\",data:t}}x.ajaxSetup({accepts:{script:\"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"},contents:{script:/(?:java|ecma)script/},converters:{\"text script\":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter(\"script\",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type=\"GET\",e.global=!1)}),x.ajaxTransport(\"script\",function(e){if(e.crossDomain){var n,r=a.head||x(\"head\")[0]||a.documentElement;return{send:function(t,i){n=a.createElement(\"script\"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,\"success\"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\\?(?=&|$)|\\?\\?/;x.ajaxSetup({jsonp:\"callback\",jsonpCallback:function(){var e=Fn.pop()||x.expando+\"_\"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter(\"json jsonp\",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?\"url\":\"string\"==typeof n.data&&!(n.contentType||\"\").indexOf(\"application/x-www-form-urlencoded\")&&Bn.test(n.data)&&\"data\");return l||\"jsonp\"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,\"$1\"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?\"&\":\"?\")+n.jsonp+\"=\"+o),n.converters[\"script json\"]=function(){return s||x.error(o+\" was not called\"),s[0]},n.dataTypes[0]=\"json\",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),\"script\"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject(\"Microsoft.XMLHTTP\")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&\"withCredentials\"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i[\"X-Requested-With\"]||(i[\"X-Requested-With\"]=\"XMLHttpRequest\");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),\"string\"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=\"\"}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp(\"^(?:([+-])=|)(\"+w+\")([a-z%]*)$\",\"i\"),Jn=/queueHooks$/,Gn=[nr],Qn={\"*\":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?\"\":\"px\"),a=(x.cssNumber[e]||\"px\"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||\".5\",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn[\"*\"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&\"expand\"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=[\"*\"]):e=e.split(\" \");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,\"fxshow\");n.queue||(s=x._queueHooks(e,\"fx\"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,\"fx\").length||s.empty.fire()})})),1===e.nodeType&&(\"height\"in t||\"width\"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],\"inline\"===x.css(e,\"display\")&&\"none\"===x.css(e,\"float\")&&(x.support.inlineBlockNeedsLayout&&\"inline\"!==ln(e.nodeName)?p.zoom=1:p.display=\"inline-block\")),n.overflow&&(p.overflow=\"hidden\",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||\"toggle\"===i,i===(f?\"hide\":\"show\"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?\"hidden\"in d&&(f=d.hidden):d=x._data(e,\"fxshow\",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,\"fxshow\");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start=\"width\"===r||\"height\"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||\"swing\",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?\"\":\"px\")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,\"\"),t&&\"auto\"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each([\"toggle\",\"show\",\"hide\"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||\"boolean\"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css(\"opacity\",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,\"finish\"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return\"string\"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||\"fx\",[]),this.each(function(){var t=!0,n=null!=e&&e+\"queueHooks\",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||\"fx\"),this.each(function(){var t,n=x._data(this),r=n[e+\"queue\"],i=n[e+\"queueHooks\"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r[\"margin\"+n]=r[\"padding\"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir(\"show\"),slideUp:ir(\"hide\"),slideToggle:ir(\"toggle\"),fadeIn:{opacity:\"show\"},fadeOut:{opacity:\"hide\"},fadeToggle:{opacity:\"toggle\"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&\"object\"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:\"number\"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue=\"fx\"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,\"position\");\"static\"===r&&(e.style.position=\"relative\");var i=x(e),o=i.offset(),a=x.css(e,\"top\"),s=x.css(e,\"left\"),l=(\"absolute\"===r||\"fixed\"===r)&&x.inArray(\"auto\",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),\"using\"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return\"fixed\"===x.css(r,\"position\")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],\"html\")||(n=e.offset()),n.top+=x.css(e[0],\"borderTopWidth\",!0),n.left+=x.css(e[0],\"borderLeftWidth\",!0)),{top:t.top-n.top-x.css(r,\"marginTop\",!0),left:t.left-n.left-x.css(r,\"marginLeft\",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,\"html\")&&\"static\"===x.css(e,\"position\"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:\"pageXOffset\",scrollTop:\"pageYOffset\"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:\"height\",Width:\"width\"},function(e,n){x.each({padding:\"inner\"+e,content:n,\"\":\"outer\"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||\"boolean\"!=typeof i),s=r||(i===!0||o===!0?\"margin\":\"border\");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement[\"client\"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body[\"scroll\"+e],o[\"scroll\"+e],n.body[\"offset\"+e],o[\"offset\"+e],o[\"client\"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,\"object\"==typeof module&&module&&\"object\"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,\"function\"==typeof define&&define.amd&&define(\"jquery\",[],function(){return x}))})(window);\n"
  },
  {
    "path": "demo/normalize.css",
    "content": "/*! normalize.css v2.1.3 | MIT License | git.io/normalize */\n\n/* ==========================================================================\n   HTML5 display definitions\n   ========================================================================== */\n\n/**\n * Correct `block` display not defined in IE 8/9.\n */\n\narticle,\naside,\ndetails,\nfigcaption,\nfigure,\nfooter,\nheader,\nhgroup,\nmain,\nnav,\nsection,\nsummary {\n    display: block;\n}\n\n/**\n * Correct `inline-block` display not defined in IE 8/9.\n */\n\naudio,\ncanvas,\nvideo {\n    display: inline-block;\n}\n\n/**\n * Prevent modern browsers from displaying `audio` without controls.\n * Remove excess height in iOS 5 devices.\n */\n\naudio:not([controls]) {\n    display: none;\n    height: 0;\n}\n\n/**\n * Address `[hidden]` styling not present in IE 8/9.\n * Hide the `template` element in IE, Safari, and Firefox < 22.\n */\n\n[hidden],\ntemplate {\n    display: none;\n}\n\n/* ==========================================================================\n   Base\n   ========================================================================== */\n\n/**\n * 1. Set default font family to sans-serif.\n * 2. Prevent iOS text size adjust after orientation change, without disabling\n *    user zoom.\n */\n\nhtml {\n    font-family: sans-serif; /* 1 */\n    -ms-text-size-adjust: 100%; /* 2 */\n    -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove default margin.\n */\n\nbody {\n    margin: 0;\n}\n\n/* ==========================================================================\n   Links\n   ========================================================================== */\n\n/**\n * Remove the gray background color from active links in IE 10.\n */\n\na {\n    background: transparent;\n}\n\n/**\n * Address `outline` inconsistency between Chrome and other browsers.\n */\n\na:focus {\n    outline: thin dotted;\n}\n\n/**\n * Improve readability when focused and also mouse hovered in all browsers.\n */\n\na:active,\na:hover {\n    outline: 0;\n}\n\n/* ==========================================================================\n   Typography\n   ========================================================================== */\n\n/**\n * Address variable `h1` font-size and margin within `section` and `article`\n * contexts in Firefox 4+, Safari 5, and Chrome.\n */\n\nh1 {\n    font-size: 2em;\n    margin: 0.67em 0;\n}\n\n/**\n * Address styling not present in IE 8/9, Safari 5, and Chrome.\n */\n\nabbr[title] {\n    border-bottom: 1px dotted;\n}\n\n/**\n * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.\n */\n\nb,\nstrong {\n    font-weight: bold;\n}\n\n/**\n * Address styling not present in Safari 5 and Chrome.\n */\n\ndfn {\n    font-style: italic;\n}\n\n/**\n * Address differences between Firefox and other browsers.\n */\n\nhr {\n    -moz-box-sizing: content-box;\n    box-sizing: content-box;\n    height: 0;\n}\n\n/**\n * Address styling not present in IE 8/9.\n */\n\nmark {\n    background: #ff0;\n    color: #000;\n}\n\n/**\n * Correct font family set oddly in Safari 5 and Chrome.\n */\n\ncode,\nkbd,\npre,\nsamp {\n    font-family: monospace, serif;\n    font-size: 1em;\n}\n\n/**\n * Improve readability of pre-formatted text in all browsers.\n */\n\npre {\n    white-space: pre-wrap;\n}\n\n/**\n * Set consistent quote types.\n */\n\nq {\n    quotes: \"\\201C\" \"\\201D\" \"\\2018\" \"\\2019\";\n}\n\n/**\n * Address inconsistent and variable font size in all browsers.\n */\n\nsmall {\n    font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` affecting `line-height` in all browsers.\n */\n\nsub,\nsup {\n    font-size: 75%;\n    line-height: 0;\n    position: relative;\n    vertical-align: baseline;\n}\n\nsup {\n    top: -0.5em;\n}\n\nsub {\n    bottom: -0.25em;\n}\n\n/* ==========================================================================\n   Embedded content\n   ========================================================================== */\n\n/**\n * Remove border when inside `a` element in IE 8/9.\n */\n\nimg {\n    border: 0;\n}\n\n/**\n * Correct overflow displayed oddly in IE 9.\n */\n\nsvg:not(:root) {\n    overflow: hidden;\n}\n\n/* ==========================================================================\n   Figures\n   ========================================================================== */\n\n/**\n * Address margin not present in IE 8/9 and Safari 5.\n */\n\nfigure {\n    margin: 0;\n}\n\n/* ==========================================================================\n   Forms\n   ========================================================================== */\n\n/**\n * Define consistent border, margin, and padding.\n */\n\nfieldset {\n    border: 1px solid #c0c0c0;\n    margin: 0 2px;\n    padding: 0.35em 0.625em 0.75em;\n}\n\n/**\n * 1. Correct `color` not being inherited in IE 8/9.\n * 2. Remove padding so people aren't caught out if they zero out fieldsets.\n */\n\nlegend {\n    border: 0; /* 1 */\n    padding: 0; /* 2 */\n}\n\n/**\n * 1. Correct font family not being inherited in all browsers.\n * 2. Correct font size not being inherited in all browsers.\n * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.\n */\n\nbutton,\ninput,\nselect,\ntextarea {\n    font-family: inherit; /* 1 */\n    font-size: 100%; /* 2 */\n    margin: 0; /* 3 */\n}\n\n/**\n * Address Firefox 4+ setting `line-height` on `input` using `!important` in\n * the UA stylesheet.\n */\n\nbutton,\ninput {\n    line-height: normal;\n}\n\n/**\n * Address inconsistent `text-transform` inheritance for `button` and `select`.\n * All other form control elements do not inherit `text-transform` values.\n * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.\n * Correct `select` style inheritance in Firefox 4+ and Opera.\n */\n\nbutton,\nselect {\n    text-transform: none;\n}\n\n/**\n * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`\n *    and `video` controls.\n * 2. Correct inability to style clickable `input` types in iOS.\n * 3. Improve usability and consistency of cursor style between image-type\n *    `input` and others.\n */\n\nbutton,\nhtml input[type=\"button\"], /* 1 */\ninput[type=\"reset\"],\ninput[type=\"submit\"] {\n    -webkit-appearance: button; /* 2 */\n    cursor: pointer; /* 3 */\n}\n\n/**\n * Re-set default cursor for disabled elements.\n */\n\nbutton[disabled],\nhtml input[disabled] {\n    cursor: default;\n}\n\n/**\n * 1. Address box sizing set to `content-box` in IE 8/9/10.\n * 2. Remove excess padding in IE 8/9/10.\n */\n\ninput[type=\"checkbox\"],\ninput[type=\"radio\"] {\n    box-sizing: border-box; /* 1 */\n    padding: 0; /* 2 */\n}\n\n/**\n * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.\n * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome\n *    (include `-moz` to future-proof).\n */\n\ninput[type=\"search\"] {\n    -webkit-appearance: textfield; /* 1 */\n    -moz-box-sizing: content-box;\n    -webkit-box-sizing: content-box; /* 2 */\n    box-sizing: content-box;\n}\n\n/**\n * Remove inner padding and search cancel button in Safari 5 and Chrome\n * on OS X.\n */\n\ninput[type=\"search\"]::-webkit-search-cancel-button,\ninput[type=\"search\"]::-webkit-search-decoration {\n    -webkit-appearance: none;\n}\n\n/**\n * Remove inner padding and border in Firefox 4+.\n */\n\nbutton::-moz-focus-inner,\ninput::-moz-focus-inner {\n    border: 0;\n    padding: 0;\n}\n\n/**\n * 1. Remove default vertical scrollbar in IE 8/9.\n * 2. Improve readability and alignment in all browsers.\n */\n\ntextarea {\n    overflow: auto; /* 1 */\n    vertical-align: top; /* 2 */\n}\n\n/* ==========================================================================\n   Tables\n   ========================================================================== */\n\n/**\n * Remove most spacing between table cells.\n */\n\ntable {\n    border-collapse: collapse;\n    border-spacing: 0;\n}\n"
  },
  {
    "path": "demo/tests.html",
    "content": "<!DOCTYPE html>\r\n<html>\r\n  <head>\r\n    <title>FileDrop Test Sheet</title>\r\n\r\n    <style type=\"text/css\">\r\n      body { margin: 5% auto; width: 500px; }\r\n      #okmsg { display: none; }\r\n      body.ok #okmsg { display: block; }\r\n      #okmsg b { background: #5a5; color: white; padding: 0.2em 0.5em; }\r\n      body.ok { background: #cfc; }\r\n      body.fail { background: #fcc; }\r\n      ul u { background: #ff6; text-decoration: none; }\r\n    </style>\r\n  </head>\r\n  <body>\r\n    <h2>FileDrop Test Sheet</h2>\r\n    <p>This page tests <a href=\"http://filedropjs.org\">FileDrop</a> global utility methods. If this page backgruond is green then everything went fine for you.</p>\r\n\r\n    <p><b>Tested browsers that pass:</b></p>\r\n    <ul>\r\n      <li>\r\n        <b>Internet Explorer:</b>\r\n        <u>XP SP3:</u> 6\r\n        <u>Win7 SP1:</u> 8, 9, 10, 11\r\n      </li>\r\n      <li>\r\n        <b>Internet Explorer x64:</b>\r\n        <u>XP SP2 x64:</u> 6, 7\r\n      </li>\r\n      <li>\r\n        <b>Firefox:</b>\r\n        <u>XP SP3:</u> 26.0\r\n      </li>\r\n      <li>\r\n        <b>Firefox x64:</b>\r\n        <u>XP SP2 x64:</u> 23.0a1\r\n      </li>\r\n      <li>\r\n        <b>Chrome:</b>\r\n        <u>XP SP2 x64:</u> 29.0\r\n      </li>\r\n      <li>\r\n        <b>Opera:</b>\r\n        <u>XP SP2 x64:</u> 12.16\r\n      </li>\r\n      <li>\r\n        <b>Safari:</b>\r\n        <u>XP SP3:</u> 5.1.7\r\n        <u>Win7 SP1:</u> 5.1.7\r\n      </li>\r\n    </ul>\r\n\r\n    <p id=\"okmsg\"><b>Success.</b></p>\r\n    <p><b><code id=\"ua\"></code></b></p>\r\n    <div id=\"log\" style=\"font-family: monospace\"></div>\r\n\r\n    <div style=\"position: absolute; left: -999px; top: -999px\">\r\n      <a id=\"idok\" href=\"#\"></a>\r\n      <iframe id=\"ifr\" src=\"about:blank\"></iframe>\r\n    </div>\r\n\r\n    <script type=\"text/javascript\" src=\"jquery.js\"></script>\r\n    <script type=\"text/javascript\" src=\"../filedrop.js\"></script>\r\n\r\n    <script type=\"text/javascript\">\r\n      // IE 6 or IE 7.\r\n      var ie6 = fd.isIE6\r\n      // IE 8 and below.\r\n      var ie8 = false\r\n      // IE 9 and below.\r\n      var ie9 = false\r\n      // Any IE.\r\n      var ie = new Function(\"/*@cc_on return @_jscript_version; @*/\")() !== undefined;\r\n    </script>\r\n\r\n    <!--[if lte IE 8]>\r\n      <script type=\"text/javascript\">var ie8 = true</script>\r\n    <![endif]-->\r\n\r\n    <!--[if lte IE 9]>\r\n      <script type=\"text/javascript\">var ie9 = true</script>\r\n    <![endif]-->\r\n\r\n    <script type=\"text/javascript\">\r\n      var real = true\r\n\r\n      function log(str) {\r\n        var p = document.createElement('p')\r\n        p.innerHTML = str\r\n        fd.byID('log').appendChild(p)\r\n      }\r\n\r\n      function loop(func, max) {\r\n        for (var i = 0; i < (max || 100); i++) { func(i) }\r\n      }\r\n\r\n      function fail() {\r\n        if (real) {\r\n          log('<b>Failed.</b>')\r\n          fd.setClass(document.body, 'ok', false)\r\n          fd.setClass(document.body, 'fail')\r\n          debugger\r\n        }\r\n\r\n        throw 'Failure.'\r\n      }\r\n\r\n      function eqo(a, b, recursive) {\r\n        if (typeof a != 'object' || typeof b != 'object') {\r\n          fail()\r\n        }\r\n\r\n        b = $.extend({}, b)\r\n\r\n        for (var k in a) {\r\n          is(k in b)\r\n\r\n          if (recursive && typeof a[k] == 'object') {\r\n            eqo(a[k], b[k], true)\r\n          } else {\r\n            eq(b[k], a[k])\r\n          }\r\n\r\n          delete b[k]\r\n        }\r\n\r\n        for (var k in b) { fail() }\r\n      }\r\n\r\n      function eqor(a, b) { eqo(a, b, true) }\r\n      function eq(a, b) { a == b || fail() }\r\n      function is(expr) { expr || fail() }\r\n      function not(expr) { expr && fail() }\r\n\r\n      var tests = {\r\n        eq: function () {\r\n          is(true)\r\n          not(false)\r\n          eq(1, 1)\r\n          eqo([], [])\r\n          eqo([1, 2], [1, 2])\r\n          eqo({}, {})\r\n          eqo({a: 1, b: 2}, {a: 1, b: 2})\r\n\r\n          var toFail = [\r\n            function () { fail() },\r\n            function () { is(false) },\r\n            function () { not(true) },\r\n            function () { eq(1, 2) },\r\n            function () { eq([], []) },\r\n            function () { eq({}, {}) },\r\n            function () { eqo([1, 3], [1, 2]) },\r\n            function () { eqo([1], [1, 2]) },\r\n            function () { eqo([1, 2], [1]) },\r\n            function () { eqo([], null) },\r\n            function () { eqo(null, {}) },\r\n            function () { eqo({a: 1}, {a: 1, b: 2}) },\r\n            function () { eqo({a: 1, c: 2}, {a: 1, b: 2}) },\r\n            function () { eqo({c: 2}, {}) }\r\n          ]\r\n\r\n          real = false\r\n\r\n          for (var i = 0; i < toFail.length; i++) {\r\n            try {\r\n              toFail\r\n              fail()\r\n            } catch (e) { }\r\n          }\r\n\r\n          real = true\r\n        },\r\n\r\n        randomID: function (unique) {\r\n          var t = fd[unique ? 'uniqueID' : 'randomID']\r\n\r\n          var parts = t().split('_')\r\n          eq(parts[0], 'fd')\r\n          is(parts[1].match(/^[\\d.]+$/))\r\n\r\n          var parts = t('foo').split('_')\r\n          eq(parts[0], 'foo')\r\n          is(parts[1].match(/^[\\d.]+$/))\r\n\r\n          is(t() != t())\r\n          loop(function () { t() })\r\n        },\r\n\r\n        uniqueID: function () {\r\n          tests.randomID(true)\r\n\r\n          loop(function () {\r\n            var id = fd.uniqueID\r\n            not( document.getElementById(id) )\r\n          })\r\n        },\r\n\r\n        byID: function () {\r\n          not(fd.byID('body'))\r\n          not(fd.byID('BODY'))\r\n          not(fd.byID( {foo: 1} ))\r\n          not(fd.byID(null))\r\n          not(fd.byID(window))\r\n\r\n          var p = document.createElement('p')\r\n          eq(fd.byID(p), p)\r\n          eq(fd.byID(document.body), document.body)\r\n          eq(fd.byID('idok'), document.getElementById('idok'))\r\n\r\n          var el = document.createElement('p')\r\n          el.id = fd.randomID()\r\n          not(fd.byID(el.id))\r\n          eq(fd.byID(el), el)\r\n\r\n          document.body.appendChild(el)\r\n          eq(fd.byID(el.id), el)\r\n\r\n          if (ie6) {\r\n            eq(fd.byID( el.id.toUpperCase() ), el)\r\n          } else {\r\n            not(fd.byID( el.id.toUpperCase() ))\r\n          }\r\n        },\r\n\r\n        isTag: function () {\r\n          not(fd.isTag('idok'))\r\n          not(fd.isTag('wrrrrrong'))\r\n          not(fd.isTag({foo: 1}))\r\n          not(fd.isTag(null))\r\n          not(fd.isTag(window))\r\n          is(fd.isTag(document.body))\r\n          is(fd.isTag(document.body, 'BoDy'))\r\n          not(fd.isTag(document.body, 'head'))\r\n\r\n          is(fd.isTag(fd.byID('idok'), 'a'))\r\n          is(fd.isTag(fd.byID('idok'), 'A'))\r\n          not(fd.isTag(fd.byID('idok'), 'div'))\r\n          not(fd.isTag(fd.byID('idok'), 'DiV'))\r\n          is(fd.isTag(document.createElement('p')))\r\n          not(fd.isTag(document.createElement('p'), 'div'))\r\n        },\r\n\r\n        newXHR: function () {\r\n          // IE 7 includes XMLHttpRequest but instanceof fails on its object.\r\n          if (window.XMLHttpRequest && !ie6) {\r\n            var xhr = new XMLHttpRequest\r\n            is(fd.newXHR() instanceof XMLHttpRequest)\r\n          } else {\r\n            var xhr = new ActiveXObject('MSXML2.XMLHTTP')\r\n          }\r\n\r\n          if (ie6) {\r\n            var fnType = 'unknown'\r\n          } else if (ie8) {\r\n            var fnType = 'object'\r\n          } else {\r\n            var fnType = 'function'\r\n          }\r\n\r\n          var props = [\r\n            // property -                 - IE 6-7   - IE 8     - W3C -\r\n            '  open                         unknown    object     function',\r\n            '  send                         unknown    object     function',\r\n            '  abort                        unknown    object     function',\r\n            '  setRequestHeader             unknown    object     function',\r\n            '  onreadystatechange           unknown    object     object',\r\n            '  readyState                   number     number     number'\r\n          ]\r\n\r\n          for (var i = 0; i < props.length; i++) {\r\n            var parts = props[i].replace(/^\\s+/, '').split(/\\s+/)\r\n            var type = ie6 ? parts[1] : (ie8 ? parts[2] : parts[3])\r\n            eq(typeof xhr[parts[0]], type)\r\n          }\r\n\r\n          // unknown = IE 9 and below; number = IE 10+ and W3C.\r\n          is(typeof xhr.status == 'unknown' || typeof xhr.status == 'number')\r\n\r\n          loop(function () { is(fd.newXHR() !== xhr) })\r\n        },\r\n\r\n        isArray: function () {\r\n          is(fd.isArray([]))\r\n          is(fd.isArray([]))\r\n          is(fd.isArray(new Array))\r\n          not(fd.isArray({}))\r\n          not(fd.isArray('foo'))\r\n          not(fd.isArray(null))\r\n          not(fd.isArray(undefined))\r\n          not(fd.isArray($('a')))\r\n          is(fd.isArray($('a').toArray()))\r\n          not(fd.isArray(/x/))\r\n          not(fd.isArray(new Function))\r\n          not(fd.isArray(arguments))\r\n        },\r\n\r\n        toArray: function () {\r\n          var a = []\r\n          eq(fd.toArray(a).length, 0)\r\n          is(a !== fd.toArray(a))\r\n\r\n          fd.toArray(a).push('x')\r\n          eq(a.length, 0)\r\n\r\n          a.push('foo')\r\n          eqo(fd.toArray(a), a)\r\n          is(a !== fd.toArray(a))\r\n\r\n          eqo(fd.toArray(['foo'], 1), [])\r\n          eqo(fd.toArray(['foo'], 999), [])\r\n          eqo(fd.toArray('foo'), ['foo'])\r\n          eqo(fd.toArray('foo', 1), [])\r\n          eqo(fd.toArray('foo', 999), [])\r\n\r\n          var el = fd.byID('idok')\r\n          eqo(fd.toArray(el), [el])\r\n          eqo(fd.toArray([el]), [el])\r\n          eqo(fd.toArray(el, 1), [])\r\n          // jQuery collection looks like array but it's not.\r\n          var o = $(el)\r\n          eqo(fd.toArray(o), [o])\r\n\r\n          eqo(fd.toArray(null), [])\r\n          eqo(fd.toArray(undefined), [])\r\n          eqo(fd.toArray(false), [false])\r\n          eqo(fd.toArray(true), [true])\r\n          eqo(fd.toArray([]), [])\r\n          var o = {}\r\n          eqo(fd.toArray(o), [o])\r\n          eqo(fd.toArray(''), [''])\r\n          eqo(fd.toArray(0), [0])\r\n          eqo(fd.toArray(0.0), [0.0])\r\n          eqo(fd.toArray(1.1), [1.1])\r\n          eqo(fd.toArray([1.1]), [1.1])\r\n          eqo(fd.toArray(1), [1])\r\n          eqo(fd.toArray([1]), [1])\r\n\r\n          var o = {foo: 1}\r\n          eqo(fd.toArray(o), [o])\r\n          is(o === fd.toArray(o)[0])\r\n          eqo(fd.toArray(o, 1), [])\r\n          eqo(fd.toArray([o]), [o])\r\n          o.length = 2\r\n          eqo(fd.toArray(o), [o])\r\n\r\n          a = new Array('foo', 'bar')\r\n          eqo(fd.toArray(a), a)\r\n          is(a !== fd.toArray(a))\r\n\r\n          eqo(fd.toArray(a, 1), ['bar'])\r\n          eqo(fd.toArray(a, 2), [])\r\n\r\n          var f = function () { }\r\n          eqo(fd.toArray(f), [f])\r\n          eqo(fd.toArray([f]), [f])\r\n\r\n          var r = /x/\r\n          eqo(fd.toArray(r), [r])\r\n          eqo(fd.toArray([r]), [r])\r\n\r\n          ;(function () {\r\n            eqo(fd.toArray(arguments), ['a', 'b'])\r\n            eqo(fd.toArray(arguments, 1), ['b'])\r\n            eqo(fd.toArray(arguments, 2), [])\r\n          })('a', 'b')\r\n        },\r\n\r\n        addEvent: function () {\r\n          var fired\r\n          var cb = function () { fired++ }\r\n          var el = fd.byID('ifr')\r\n          var timeout = setTimeout(fail, 1000)\r\n\r\n          function fire(cb) {\r\n            fired = 0\r\n            el.contentWindow.location.reload()\r\n            setTimeout(cb, 100)\r\n          }\r\n\r\n          fd.addEvent(el, 'load', cb)\r\n          fire(function () {\r\n            eq(fired, 1)\r\n            next()\r\n          })\r\n\r\n          function next() {\r\n            // Need to attach different function with different code.\r\n            fd.addEvent(el, 'load', function () { return fired++ })\r\n            fire(function () {\r\n              eq(fired, 2)\r\n              clearTimeout(timeout)\r\n            })\r\n          }\r\n\r\n          // No exceptions testing.\r\n          fd.addEvent()\r\n          fd.addEvent(el)\r\n          fd.addEvent(el, 'click')\r\n          fd.addEvent(el, null, new Function)\r\n          fd.addEvent(null, 'click', new Function)\r\n        },\r\n\r\n        stopEvent: function () {\r\n          var active = true\r\n          var fired = 0\r\n\r\n          fd.addEvent(fd.byID('idok'), 'click', function (e) {\r\n            active && fd.stopEvent(e)\r\n            fired++\r\n          })\r\n          fd.addEvent(document.body, 'click', function () {\r\n            active && fail()\r\n          })\r\n\r\n          if (ie) {\r\n            $('#idok')[0].click()\r\n          } else {\r\n            // Safari doesn't have click() on elements.\r\n            // Credits to http://stackoverflow.com/questions/7930001/8833025#8833025.\r\n            var dispatch = document.createEvent('HTMLEvents')\r\n            dispatch.initEvent('click', true, true)\r\n            $('#idok')[0].dispatchEvent(dispatch)\r\n          }\r\n\r\n          eq(fired, 1)\r\n          active = false\r\n        },\r\n\r\n        setClass_hasClass: function () {\r\n          var $el = $('<p>')\r\n          var el = $el[0]\r\n\r\n          function normClass(str) {\r\n            return $.trim(str).replace(/(\\s)+/g, '$1')\r\n          }\r\n\r\n          function test(ref) {\r\n            eq(fd.setClass(ref, 'c1'), el)\r\n            eq(normClass(el.className), 'c1')\r\n            is(fd.hasClass(el, 'c1'))\r\n            eq(fd.setClass(ref, 'c1', false), el)\r\n            eq(normClass(el.className), '')\r\n            not(fd.hasClass(el, 'c1'))\r\n            eq(fd.setClass(ref, 'c1', true), el)\r\n            eq(normClass(el.className), 'c1')\r\n            is(fd.hasClass(el, 'c1'))\r\n\r\n            eq(fd.setClass(ref, 'c2'), el)\r\n            eq(normClass(el.className), 'c1 c2')\r\n            is(fd.hasClass(el, 'c1'))\r\n            is(fd.hasClass(el, 'c2'))\r\n\r\n            not(fd.hasClass(el, ''))\r\n            not(fd.hasClass(el, []))\r\n            not(fd.hasClass(el, {}))\r\n            not(fd.hasClass(el, null))\r\n            not(fd.hasClass(el, undefined))\r\n            not(fd.hasClass([], ''))\r\n\r\n            eq(fd.setClass(ref, 'c', true), el)\r\n            eq(normClass(el.className), 'c1 c2 c')\r\n            is(fd.hasClass(el, 'c1'))\r\n            is(fd.hasClass(el, 'c2'))\r\n            is(fd.hasClass(el, 'c'))\r\n\r\n            eq(fd.setClass(ref, '2', false), el)\r\n            eq(normClass(el.className), 'c1 c2 c')\r\n            eq(fd.setClass(ref, 'c', false), el)\r\n            eq(normClass(el.className), 'c1 c2')\r\n            eq(fd.setClass(ref, 'c', false), el)\r\n            eq(normClass(el.className), 'c1 c2')\r\n            eq(fd.setClass(ref, 'c'), el)\r\n            eq(normClass(el.className), 'c1 c2 c')\r\n\r\n            eq(fd.setClass(ref, '', true), el)\r\n            eq(normClass(el.className), 'c1 c2 c')\r\n            eq(fd.setClass(ref), el)\r\n            eq(normClass(el.className), 'c1 c2 c')\r\n            eq(fd.setClass(ref, 2), el)\r\n            eq(normClass(el.className), 'c1 c2 c 2')\r\n            is(fd.hasClass(el, 2))\r\n            is(fd.hasClass(el, '2'))\r\n\r\n            eq(fd.setClass(ref, 'c1', false), el)\r\n            eq(normClass(el.className), 'c2 c 2')\r\n            eq(fd.setClass(ref, 2, false), el)\r\n            eq(normClass(el.className), 'c2 c')\r\n            eq(fd.setClass(ref, 'c2', false), el)\r\n            eq(normClass(el.className), 'c')\r\n            eq(fd.setClass(ref, 'c', false), el)\r\n            eq(normClass(el.className), '')\r\n          }\r\n\r\n          test(el)\r\n\r\n          var id = fd.randomID()\r\n          $el.attr('id', id).appendTo('body')\r\n          test(id)\r\n\r\n          not(fd.setClass(null, 'c'))\r\n          not(fd.setClass(undefined, 'c'))\r\n          not(fd.setClass('', 'c'))\r\n          not(fd.setClass(false, 'c'))\r\n          not(fd.setClass({}, 'c'))\r\n          not(fd.setClass([], 'c'))\r\n        },\r\n\r\n        extend: function () {\r\n          var c = {a: [1], c: 'c'}\r\n          var p = {b: true, c: 'p'}\r\n          var d\r\n          function clone() { d = $.extend({}, c) }\r\n\r\n          clone()\r\n          eqo(fd.extend(d, p),            {a: c.a, c: 'c', b: true})\r\n          clone()\r\n          eqo(fd.extend(d, p, false),     {a: c.a, c: 'c', b: true})\r\n          clone()\r\n          eqo(fd.extend(d, p, true),      {a: c.a, c: 'p', b: true})\r\n          clone()\r\n          is(fd.extend(d, p).a === c.a)\r\n\r\n          c.b = undefined\r\n          clone()\r\n          eqo(fd.extend(d, p),            {a: c.a, c: 'c', b: true})\r\n          clone()\r\n          eqo(fd.extend(d, p, false),     {a: c.a, c: 'c', b: true})\r\n          clone()\r\n          eqo(fd.extend(d, p, true),      {a: c.a, c: 'p', b: true})\r\n\r\n          c.b = null\r\n          clone()\r\n          eqo(fd.extend(d, p),            {a: c.a, c: 'c', b: null})\r\n          clone()\r\n          eqo(fd.extend(d, p, false),     {a: c.a, c: 'c', b: null})\r\n          clone()\r\n          eqo(fd.extend(d, p, true),      {a: c.a, c: 'p', b: true})\r\n\r\n          var o = {}\r\n          is(fd.extend(o, {x: 1}) === o)\r\n          eqo(o, {x: 1})\r\n\r\n          eqo(fd.extend(null, {a: 1}), {a: 1})\r\n          eqo(fd.extend({a: 1}, null), {a: 1})\r\n        },\r\n\r\n        callAll: function () {\r\n          var o = {}\r\n          var fired = 0\r\n          var e = [function () { fired++ }, function (a) { return 'br' + a }, fail]\r\n\r\n          eq(fd.callAll(e, 'eak'), 'break')\r\n          eq(fired, 1)\r\n          eq(fd.callAll(e, ['eak']), 'break')\r\n          eq(fired, 2)\r\n\r\n          e = []\r\n          eq(fired, 2)\r\n          not(fd.callAll(e))\r\n\r\n          var fn = function () {\r\n            is(this === o)\r\n            eqo(fd.toArray(arguments), [1, 2])\r\n          }\r\n\r\n          fd.callAll(fn, [1, 2], o)\r\n          fd.callAll([fn], [1, 2], o)\r\n        },\r\n\r\n        callAllOfObject: function () {\r\n          var o = { events: {event: [], evt: [fail]} }\r\n\r\n          fd.onObjectCall = function (event) {\r\n            eq(event, 'evt')\r\n            is(this === o)\r\n            eqo(fd.toArray(arguments, 1), [1, 2])\r\n            return 'ok'\r\n          };\r\n\r\n          eq(fd.callAllOfObject(o, 'evt', [1, 2]), 'ok')\r\n\r\n          var fn = fd.onObjectCall\r\n          fd.onObjectCall = null\r\n          o.events.any = [fn]\r\n          eq(fd.callAllOfObject(o, 'evt', [1, 2]), 'ok')\r\n\r\n          o.events.any = []\r\n          o.events.evt.unshift(function (a) { return 'o' + a })\r\n          eq(fd.callAllOfObject(o, 'evt', 'bj'), 'obj')\r\n        },\r\n\r\n        funcNS: function () {\r\n          var fn = new Function\r\n\r\n          eq(fd.funcNS(fn), '')\r\n          is(fd.funcNS(fn, 'Ns') === fn)\r\n          eq(fd.funcNS(fn), 'Ns')\r\n          is(fd.funcNS(fn, '') === fn)\r\n          eq(fd.funcNS(fn), '')\r\n        },\r\n\r\n        splitNS: function () {\r\n          eqo(fd.splitNS(''), ['', ''])\r\n          eqo(fd.splitNS(':'), ['', ''])\r\n          eqo(fd.splitNS(null), ['', ''])\r\n          eqo(fd.splitNS(undefined), ['', ''])\r\n\r\n          eqo(fd.splitNS('x:'), ['x', ''])\r\n          eqo(fd.splitNS('x'), ['x', ''])\r\n          eqo(fd.splitNS(':x'), ['', 'x'])\r\n          eqo(fd.splitNS('x:y'), ['x', 'y'])\r\n          eqo(fd.splitNS('x:y:z'), ['x', 'y:z'])\r\n        },\r\n\r\n        appendEventsToObject: function () {\r\n          var o = {events: {}}\r\n          var t = function () { return fd.appendEventsToObject.apply(o, arguments) }\r\n\r\n          eqor(t(), {})\r\n          eqor(t(['x']), {x: []})\r\n          eq(t( fd.funcNS(new Function, 'Ns') ), 'Ns')\r\n          eqor(t('x'), [])\r\n\r\n          eq(t('x', null), o)\r\n          eqor(o.events, {x: []})\r\n          eq(t(['x', 'y'], null), o)\r\n          eqor(o.events, {x: [], y: []})\r\n\r\n          var x1 = new Function\r\n          var x2 = new Function\r\n          var y1 = new Function\r\n\r\n          eq(t('x', x1), o)\r\n          eq(t(['x', 'y'], y1), o)\r\n          eqor(o.events, {x: [x1, y1], y: [y1]})\r\n\r\n          eq(t({x: x2}), o)\r\n          eqor(o.events, {x: [x1, y1, x2], y: [y1]})\r\n\r\n          eqor(t(), o.events)\r\n          eqor(t('x'), o.events.x)\r\n          eqor(t(['x']), {x: o.events.x})\r\n          eqor(t(['y', 'x']), o.events)\r\n\r\n          eq(t(['x', 'z'], null), o)\r\n          eqor(o.events, {x: [], y: [y1], z: []})\r\n        },\r\n\r\n        appendEventsToObjectNS: function () {\r\n          var o = {events: {}}\r\n          var t = function () { return fd.appendEventsToObject.apply(o, arguments) }\r\n\r\n          var fn = new Function\r\n          var f = new Function\r\n          var fz = new Function\r\n\r\n          t(['x:n', 'y:n'], fn)\r\n          t('x', f)\r\n          t('x:z', fz)\r\n          t('y:z', fz)\r\n\r\n          eq(t(fn), 'n')\r\n          eq(t(f), '')\r\n          eq(t(fz), 'z')\r\n          eq(t(new Function), '')\r\n\r\n          eqor(o.events, {x: [fn, f, fz], y: [fn, fz]})\r\n          eq(t(':n', null), o)\r\n          eqor(o.events, {x: [f, fz], y: [fz]})\r\n          eqor(t(), o.events)\r\n          eq(t('x:z', null), o)\r\n          eqor(o.events, {x: [f], y: [fz]})\r\n\r\n          eq(t([':'], null), o)\r\n          eqor(o.events, {x: [], y: []})\r\n        },\r\n\r\n        previewToObject: function () {\r\n          var o = {events: {}}\r\n          var t = function () { return fd.previewToObject.apply(o, arguments) }\r\n\r\n          var fn = new Function\r\n          var f = new Function\r\n\r\n          eq(fd.funcNS(fn), '')\r\n          eq(t('x:n', fn), o)\r\n          eq(fd.funcNS(fn), 'n')\r\n          eqor(o.events, {x: [fn]})\r\n\r\n          eq(t('x', f), o)\r\n          eqor(o.events, {x: [f, fn]})\r\n\r\n          eq(t(['x', 'y'], f), o)\r\n          eqor(o.events, {x: [f, f, fn], y: [f]})\r\n\r\n          eq(t({x: f, y: fn}), o)\r\n          eqor(o.events, {x: [f, f, f, fn], y: [fn, f]})\r\n        }\r\n      }\r\n\r\n      for (var key in tests) {\r\n        log(key + '...')\r\n        tests[key]()\r\n      }\r\n\r\n      log('<b>Done.</b>')\r\n      fd.byID('ua').textContent = navigator.userAgent\r\n      fd.setClass(document.body, 'ok')\r\n    </script>\r\n  </body>\r\n</html>"
  },
  {
    "path": "demo/upload.php",
    "content": "<?php\n/*!\n  FileDrop Revamped - server-side upload handler sample\n  in public domain  | http://filedropjs.org\n\n ***\n\n  This is an example of server-side script that handles both AJAX and IFrame uploads.\n\n  AJAX upload provides raw file data as POST input while IFrame is a POST request\n  with $_FILES member set.\n\n  Result is either output as HTML with JavaScript code to invoke the callback\n  (like JSONP) or in plain text if none is given (it's usually absent on AJAX).\n*/\n\n// If an error causes output to be generated before headers are sent - catch it.\nob_start();\n\n// Callback name is passed if upload happens via iframe, not AJAX (FileAPI).\n$callback = &$_REQUEST['fd-callback'];\n\n// Upload data can be POST'ed as raw form data or uploaded via <iframe> and <form>\n// using regular multipart/form-data enctype (which is handled by PHP $_FILES).\nif (!empty($_FILES['fd-file']) and is_uploaded_file($_FILES['fd-file']['tmp_name'])) {\n  // Regular multipart/form-data upload.\n  $name = $_FILES['fd-file']['name'];\n  $data = file_get_contents($_FILES['fd-file']['tmp_name']);\n} else {\n  // Raw POST data.\n  $name = urldecode(@$_SERVER['HTTP_X_FILE_NAME']);\n  $data = file_get_contents(\"php://input\");\n}\n\n// Output message for this demo upload. In your real app this would be something\n// meaningful for the calling script (that uses FileDrop.js).\n$output = sprintf('%s; received %s bytes, CRC32 = %08X, MD5 = %s', $name,\n                  number_format(strlen($data)), crc32($data), strtoupper(md5($data)));\n\n// In FileDrop sample this demonstrates the passing of custom ?query variables along\n// with an AJAX/iframe upload.\n$opt = &$_REQUEST['upload_option'];\nisset($opt) and $output .= \"\\nReceived upload_option with value $opt\";\n\nif ($callback) {\n  // Callback function given - the caller loads response into a hidden <iframe> so\n  // it expects it to be a valid HTML calling this callback function.\n  header('Content-Type: text/html; charset=utf-8');\n\n  // Escape output so it remains valid when inserted into a JS 'string'.\n  $output = addcslashes($output, \"\\\\\\\"\\0..\\x1F\");\n\n  // Finally output the HTML with an embedded JavaScript to call the function giving\n  // it our message(in your app it doesn't have to be a string) as the first parameter.\n  echo '<!DOCTYPE html><html><head></head><body><script type=\"text/javascript\">',\n       \"try{window.top.$callback(\\\"$output\\\")}catch(e){}</script></body></html>\";\n} else {\n  // Caller reads data with XMLHttpRequest so we can output it raw. Real apps would\n  // usually pass and read a JSON object instead of plan text.\n  header('Content-Type: text/plain; charset=utf-8');\n  echo $output;\n}\n"
  },
  {
    "path": "filedrop-min.js",
    "content": "/*!\n  FileDrop Revamped - HTML5 & legacy file upload\n  in public domain  | http://filedropjs.org\n  by Proger_XP      | http://proger.me\n\n  Supports IE 6+, FF 3.6+, Chrome 7+, Safari 5+, Opera 11+.\n  Fork & report problems at https://github.com/ProgerXP/FileDrop\n*/\n!function(t,n){\"function\"==typeof define&&define.amd?define([\"exports\"],function(e){n(t,e)}):\"undefined\"!=typeof exports?n(t,exports):n(t,t.fd=t.fd||{})}(this,function(t,f){f.randomID=function(e){return(e||\"fd\")+\"_\"+(1e4*Math.random()).toFixed()},f.uniqueID=function(e){do{var t=f.randomID(e)}while(f.byID(t));return t},f.byID=function(e){return f.isTag(e)?e:document.getElementById(e)},f.isTag=function(e,t){return\"object\"==typeof e&&e&&1==e.nodeType&&(!t||e.tagName.toUpperCase()==t.toUpperCase())},f.newXHR=function(){try{return new XMLHttpRequest}catch(e){for(var t=[\"MSXML2.XMLHTTP.6.0\",\"MSXML2.XMLHTTP.5.0\",\"MSXML2.XMLHTTP.4.0\",\"MSXML2.XMLHTTP.3.0\",\"MSXML2.XMLHTTP\",\"Microsoft.XMLHTTP\"],n=0;n<t.length;n++)try{return new ActiveXObject(t[n])}catch(e){}}throw\"Cannot create XMLHttpRequest.\"},f.isArray=function(e){return\"[object Array]\"===Object.prototype.toString.call(e)},f.toArray=function(e,t){return null==e?[]:(f.isArray(e)||\"object\"==typeof e&&\"callee\"in e||(e=[e]),Array.prototype.slice.call(e,t||0))},f.addEvent=function(e,t,n){return e&&t&&n&&(e.attachEvent?(e[\"e\"+t+n]=n,e[t+n]=function(){e[\"e\"+t+n](window.event)},e.attachEvent(\"on\"+t,e[t+n])):e.addEventListener(t,n,!1)),e},f.stopEvent=function(e){return e.cancelBubble=!0,e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault(),e},f.setClass=function(e,t,n){return(e=f.byID(e))&&null!=t&&(void 0===n||n?f.hasClass(e,t)||(e.className+=\" \"+t):e.className=e.className.replace(f.classRegExp(t),\" \")),e},f.hasClass=function(e,t){return f.classRegExp(t).test((f.byID(e)||{}).className)},f.classRegExp=function(e){return\"\"==e||\"object\"==typeof e?/$o_O/:new RegExp(\"(^|\\\\s+)\"+e+\"(\\\\s+|$)\",\"gi\")},f.extend=function(e,t,n){for(var r in e=e||{},t=t||{})!n&&void 0!==e[r]||(e[r]=t[r]);return e},f.callAll=function(e,t,n){var r;if(t=f.toArray(t),\"function\"==typeof e&&(e=[e]),f.isArray(e))for(var o=0;o<e.length&&(\"function\"!=typeof e[o]||null==(r=e[o].apply(n||this,t)));o++);else if(e)throw\"FileDrop event list must be either an Array, Function, undefined or null but \"+typeof e+\" was given.\";return r},f.callAllOfObject=function(e,t,n){f.logging&&f.hasConsole&&(r=e.events[t]&&e.events[t].length||0,console.info(\"FileDrop \"+t+\" event (\"+r+\") args:\"),console.dir([n]));var r=[f.onObjectCall].concat(e.events.any);return null!=(r=f.callAll(r,[t].concat(f.toArray(n)),e))?r:f.callAll(e.events[t],n,e)},f.appendEventsToObject=function(e,t){if(f.addEventsToObject(this,!1,arguments))return this;switch(arguments.length){case 0:return f.extend({},this.events);case 1:if(null===e)return this.events={},this;if(f.isArray(e)){for(var n={},r=0;r<e.length;r++)n[e[r]]=f.toArray(this.events[e[r]]);return n}if(\"function\"==typeof e)return f.funcNS(e);if(\"string\"==typeof e)return f.toArray(this.events[e]);case 2:if(e=f.toArray(e),null===t){for(r=0;r<e.length;r++){var o=f.splitNS(e[r]);if(o[0])if(o[1]){if(this.events[o[0]])for(var i=this.events[o[0]].length-1;0<=i;i--)f.funcNS(this.events[o[0]][i])==o[1]&&this.events[o[0]].splice(i,1)}else this.events[o[0]]=[];else for(var a in this.events)arguments.callee.call(this,[a+\":\"+o[1]],null)}return this}}throw\"Bad parameters for FileDrop event().\"},f.previewToObject=function(e,t){if(f.addEventsToObject(this,!0,arguments))return this;throw\"Bad parameters for FileDrop preview().\"},f.addEventsToObject=function(e,t,n){var r=n[0],o=n[1];switch(n.length){case 1:if(r&&\"object\"==typeof r&&!f.isArray(r)){for(var i in r)arguments.callee(e,t,[i,r[i]]);return!0}case 2:if(\"function\"==typeof o||f.isArray(o)){for(var r=f.toArray(r),o=f.toArray(o),a=t?\"unshift\":\"push\",l=0;l<r.length;l++){for(var s=f.splitNS(r[l]),u=0;u<o.length;u++)f.funcNS(o[u],s[1]);e.events[s[0]]=e.events[s[0]]||[],e.events[s[0]][a].apply(e.events[s[0]],o)}return!0}}},f.funcNS=function(e,t){return\"function\"!=typeof e?e:1==arguments.length?(e[f.nsProp]||\"\").toString():(e[f.nsProp]=(t||\"\").toString(),e)},f.splitNS=function(e){return(e||\"\").match(/^([^:]*):?(.*)$/).slice(1)},f.extend(f,{logging:!0,hasConsole:\"console\"in window&&console.log&&console.dir,onObjectCall:null,all:[],isIE6:!1,isIE9:!1,isChrome:-1!=(navigator.vendor||\"\").indexOf(\"Google\"),nsProp:\"_fdns\"}),f.DropHandle=function(n,e){var o=this;if(o.el=n=f.byID(n),!n)throw\"Cannot locate DOM node given to new FileDrop class.\";o.opt={zoneClass:\"fd-zone\",inputClass:\"fd-file\",iframe:{url:\"\",callbackParam:\"fd-callback\",fileParam:\"fd-file\"},input:null,recreateInput:!0,fullDocDragDetect:!1,multiple:!1,dropEffect:\"copy\"},f.all.push(o),o.filedrop=null;var t=o.opt.iframe;f.extend(o.opt,e,!0),f.extend(o.opt.iframe,t),f.isChrome&&(o.opt.fullDocDragDetect=!0),o.events={any:[],dragEnter:[],dragLeave:[],dragOver:[],dragEnd:[],dragExit:[],upload:[],uploadElsewhere:[],inputSetup:[],iframeSetup:[],iframeDone:[]},o.on=o.events,o.zone=o.el,o.hook=function(e){!1!==o.opt.input&&(o.opt.input=o.opt.input||o.prepareInput(e),o.opt.input&&f.callAllOfObject(o,\"inputSetup\",o.opt.input)),o.hookDragOn(e),o.hookDropOn(e)},o.hookDragOn=function(e){o.opt.fullDocDragDetect?(o.delegate(document.body,\"dragEnter\"),f.addEvent(document,\"dragleave\",function(e){(0==e.clientX&&0==e.clientY||f.isTag(e.relatedTarget,\"html\"))&&(f.stopEvent(e),f.callAllOfObject(o,\"dragLeave\",e))})):(o.delegate(e,\"dragEnter\"),o.delegate(e,\"dragLeave\")),o.delegate(e,\"dragOver\"),o.delegate(e,\"dragEnd\"),o.delegate(e,\"dragExit\")},o.hookDropOn=function(e){f.isIE9||o.delegate(e,\"drop\",\"upload\")},o.delegate=function(e,t,n){f.addEvent(e,t.toLowerCase(),function(e){f.stopEvent(e),f.callAllOfObject(o,n||t,e)})},o.prepareInput=function(e){var t=o.findInputRecursive(e)||o.createInputAt(e);if(t){for(var n=t.parentNode;n&&!f.isTag(n,\"form\");)n=n.parentNode;if(!n)throw\"FileDrop file input has no parent form element.\";if((e=n?n.getAttribute(\"target\"):\"\")&&f.isTag(f.byID(e),\"iframe\"))return{file:t,form:n}}return!1},o.findInputRecursive=function(e){for(var t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(f.isTag(n,\"input\")&&\"file\"==n.getAttribute(\"type\")&&f.hasClass(n,o.opt.inputClass))return n;if(n=arguments.callee(n))return n}},o.createInputAt=function(e){do{var t=f.randomID()}while(f.byID(t));var n=document.createElement(\"div\");n.innerHTML='<iframe src=\"javascript:false\" name=\"'+t+'\"></iframe><form method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"'+o.opt.iframe.callbackParam+'\" /><input type=\"file\" name=\"'+o.opt.iframe.fileParam+'\" /></form>',n.firstChild.setAttribute(\"id\",t),n.firstChild.style.display=\"none\",n.lastChild.setAttribute(\"target\",t);for(var r=e.firstChild;r&&(!f.isTag(r)||f.isTag(r,\"legend\"));)r=r.nextSibling;return r?e.insertBefore(n,r):e.appendChild(n),n.lastChild.lastChild},o.abortIFrame=function(){var e;!o.opt.input.form||(e=f.byID(o.opt.input.form.getAttribute(\"target\")))&&e.setAttribute(\"src\",\"javascript:false\")},o.sendViaIFrame=function(t){t=t||o.opt.iframe.url;var e=(o.opt.input||{}).form;if(t&&e){do{var n=f.randomID()}while(n in window);window[n]=function(e){\"object\"!=typeof e&&(e={response:e,responseXML:\"\",responseText:(e||\"\").toString(),readyState:4,status:200,statusText:\"OK\",getAllResponseHeaders:function(){return\"\"},getResponseHeader:function(){return\"\"},setRequestHeader:function(){return this},statusCode:function(){return this},abort:function(){return this}}),f.extend(e,{iframe:!0,url:t}),f.callAllOfObject(o,\"iframeDone\",e)};for(var r=e.firstChild;r&&(!f.isTag(r,\"input\")||r.name!=o.opt.iframe.callbackParam);)r=r.nextSibling;return r?r.value=n:t=t.replace(/[?&]+$/,\"\")+(-1==t.indexOf(\"?\")?\"?\":\"&\")+o.opt.iframe.callbackParam+\"=\"+n,e.setAttribute(\"action\",t),f.callAllOfObject(o,\"iframeSetup\",e),e.submit(),setTimeout(o.resetForm,300),!0}},o.resetForm=function(){var e,t=o.opt.input&&o.opt.input.file;t&&(t.value=\"\",o.opt.recreateInput&&(e=o.opt.input.file=t.cloneNode(!0),t.parentNode.replaceChild(e,t),f.callAllOfObject(o,\"inputSetup\",[o.opt.input,t])))},o.multiple=function(e){return o.opt.input&&void 0!==e&&(e?o.opt.input.file.setAttribute(\"multiple\",\"multiple\"):o.opt.input.file.removeAttribute(\"multiple\")),o.opt.input&&!!o.opt.input.file.getAttribute(\"multiple\")},o.event=function(e,t){return f.appendEventsToObject.apply(o,arguments)},o.preview=function(e,t){return f.previewToObject.apply(o,arguments)},o.onInputSetup=function(e,t){t?(e.file.clearAttributes&&e.file.clearAttributes(),e.file.mergeAttributes&&e.file.mergeAttributes(t)):o.multiple(o.opt.multiple),f.setClass(e.file,o.opt.inputClass),o.delegate(e.file,\"change\",\"upload\"),(e=e.file.parentNode)&&e.style.display.match(/^(static)?$/)&&(e.style.position=\"relative\"),f.isTag(n,\"fieldset\")&&((e=document.createElement(\"div\")).style.position=\"relative\",e.style.overflow=\"hidden\",n.parentNode.insertBefore(e,n),e.appendChild(n))},o.onDragOver=function(e){f.stopEvent(e),e.dataTransfer&&(e.dataTransfer.dropEffect=o.opt.dropEffect)},o.onUpload=function(){for(var e=0;e<f.all.length;e++)f.all[e]!==o&&f.all[e].events&&f.callAllOfObject(f.all[e],\"uploadElsewhere\",o)},o.event({inputSetup:o.onInputSetup,dragOver:o.onDragOver,upload:o.onUpload}),f.setClass(n,o.opt.zoneClass),o.hook(n)},f.FileDrop=function(t,e){var s=this;function n(e){return function(){f.setClass(t,s.opt.dragOverClass,e)}}t=f.byID(t),s.handle=new f.DropHandle(t,e),s.handle.filedrop=s,f.extend(s.handle.opt,{dragOverClass:\"over\"}),f.extend(s.handle.opt.iframe,{force:!1}),f.extend(s.handle.events,{send:[],fileSetup:[]}),s.onUpload=function(e){(e=!s.opt.iframe.force&&s.eventFiles(e,!0))?0<e.length&&f.callAllOfObject(s,\"send\",[e]):!s.handle.sendViaIFrame()&&f.hasConsole&&console.warn(\"FileDrop fallback upload triggered but iframe options were not configured - doing nothing.\")},s.eventFiles=function(e,t){var n,r=new f.FileList(e);if(n=e.dataTransfer&&(e.dataTransfer.length||e.dataTransfer.files)?e.dataTransfer:e.target&&e.target.files||e.srcElement&&e.srcElement.files){var o=n.items||[];n.files&&(n=n.files);for(var i={},a=0;a<n.length;a++){var l=new f.File(n[a]);i[l.name]&&\"image.jpg\"!=l.name||(i[l.name]=!0,l.setNativeEntry(o[a]),f.callAllOfObject(s,\"fileSetup\",l),(0<l.size||l.nativeEntry)&&r.push(l))}}else t&&(r=!1);return r},f.extend(s,s.handle),s.event({upload:s.onUpload,send:s.resetForm,dragEnter:n(!0),dragLeave:n(!1),uploadElsewhere:n(!1)}),s.preview({upload:n(!1)})},f.FileList=function(e){var a=this;a.dropEffect=e&&e.dropEffect||\"\",a.length=0,e=null,a.push=function(e){return a[a.length++]=e,a},a.pop=function(){if(0<a.length){var e=a.last();return delete a[--a.length],e}},a.first=function(){return a[0]},a.last=function(){return a[a.length-1]},a.remove=function(e){for(;e<a.length-1;e++)a[e]=a[e+1];return se.f.pop(),a},a.clear=function(){for(var e=0;e<a.length;e++)delete a[e];return a.length=0,a},a.reverse=function(){for(var e=0;e<Math.floor(a.length/2);e++)a[e]=a[a.length-e-1];return a},a.concat=function(e){for(var t=new f.FileList,n=0;n<a.length;n++)t[n]=a[n];for(n=0;e&&n<e.length;n++)t[a.length+n+1]=e[n];return t.length=a.length+(e||[]).length,a},a.sort=function(e,t){for(var n=0;n<a.length;n++)for(var r,o=0;o<a.length;o++)e.call(t||this,a[n],a[o],n,o)<0&&(r=a[n],a[n]=a[o],a[o]=r);return a},a.sortBy=function(e,t){for(var n=[],r=0;r<a.length;r++)n.push([r,e.call(t||this,a[r],r)]);for(n.sort(function(e,t){return e[1]>t[1]?1:e[1]<t[1]?-1:0}),r=0;r<n.length;r++)a[r]=n[r][0];return a},a.find=function(e,t){for(var n=0;n<a.length;n++)if(null!=e.call(t||this,a[n],n))return a[n]},a.each=function(e,t){return a.find(function(){e.apply(this,arguments)},t),a},a.invoke=function(t,e){var n=f.toArray(arguments,1);return this.each(function(e){e[t].apply(e,n)})},a.abort=function(){return this.invoke(\"abort\")},a.findCompare=function(t,n){var r,o,i=null;return a.each(function(e){(null==i||i<(o=t.call(n,r)))&&(r=e,i=o)},n),r},a.filter=function(t,e){var n=new f.FileList;return a.each(function(e){t.apply(this,arguments)&&n.push(e)},e),n},a.largest=function(){return a.findCompare(function(e){return e.size})},a.smallest=function(){return a.findCompare(function(e){return-e.size})},a.oldest=function(){return a.findCompare(function(e){return-e.modDate.getTime()})},a.newest=function(){return a.findCompare(function(e){return e.modDate})},a.ofType=function(t){return t+=-1==t.indexOf(\"/\")?\"/\":\"$\",t=new RegExp(\"^\"+t,\"i\"),a.filter(function(e){return t.test(e.type)})},a.images=function(){return a.ofType(\"image\")},a.named=function(t){return\"string\"==typeof t?a.find(function(e){return e.name==t}):a.filter(function(e){return t.test(e.name)})}},f.FileList.prototype.length=0,f.FileList.prototype.splice=Array.prototype.splice,f.File=function(t){var s=this;s.nativeFile=t,s.nativeEntry=null,s.name=t.webkitRelativePath||t.fileName||t.name||\"\",s.size=t.fileSize||t.size||0,s.type=s.mime=t.fileType||t.type||\"\",s.modDate=t.lastModifiedDate||new Date,s.xhr=null,s.opt={extraHeaders:!0,xRequestedWith:!0,method:\"POST\"},s.events={any:[],xhrSetup:[],xhrSend:[],progress:[],done:[],error:[]},s.events.sendXHR=s.events.xhrSend,s.abort=function(){return s.xhr&&s.xhr.abort&&s.xhr.abort(),s},s.sendTo=function(e,t){return(t=f.extend(t,s.opt)).url=e,s.size?window.FileReader?((e=new FileReader).onload=function(e){s.sendDataReadyTo(t,e)},e.onerror=function(e){f.callAllOfObject(s,\"error\",[e])},e.readAsArrayBuffer(s.nativeFile)):s.sendDataReadyTo(t):f.hasConsole&&console.warn(\"Trying to send an empty FileDrop.File.\"),s},s.sendDataReadyTo=function(e,t){var n;return s.abort(),s.xhr=f.newXHR(),s.hookXHR(s.xhr),s.xhr.open(e.method,e.url,!0),s.xhr.overrideMimeType&&s.xhr.overrideMimeType(\"application/octet-stream\"),s.xhr.setRequestHeader(\"Content-Type\",\"application/octet-stream\"),e.extraHeaders&&(s.xhr.setRequestHeader(\"X-File-Name\",encodeURIComponent(s.name)),s.xhr.setRequestHeader(\"X-File-Size\",s.size),s.xhr.setRequestHeader(\"X-File-Type\",s.type),s.xhr.setRequestHeader(\"X-File-Date\",s.modDate.toGMTString()),(n=!0===(n=e.xRequestedWith)?\"FileDrop-XHR-\"+(window.FileReader?\"FileAPI\":\"Webkit\"):n)&&s.xhr.setRequestHeader(\"X-Requested-With\",n)),f.callAllOfObject(s,\"xhrSetup\",[s.xhr,e]),t=t&&t.target&&t.target.result?t.target.result:s.nativeFile,f.callAllOfObject(s,\"xhrSend\",[s.xhr,t,e]),s.xhr},s.hookXHR=function(r){var e=r.upload||r;r.onreadystatechange=function(e){if(4==r.readyState){try{var t=200==r.status?\"done\":\"error\"}catch(e){t=\"error\"}var n=\"error\"==t?[e,r]:[r,e];f.callAllOfObject(s,t,n)}},e.onprogress=function(e){var t=e.lengthComputable?e.loaded:null;f.callAllOfObject(s,\"progress\",[t,e.total||null,r,e])}},s.readData=function(e,t,n){return s.read({onDone:e,onError:t,func:n})},s.readDataURL=function(e,t){return s.readData(e,t||!1,\"uri\")},s.readDataURI=s.readDataURL,s.read=function(n){function t(e,t){\"object\"==typeof t||(t.message=t),t.fdError=e,!1!==n.onError&&(n.onError||n.onDone).apply(this,arguments)}if(f.extend(n,{onDone:new Function,onError:null,blob:s.nativeFile,func:\"\",start:0,end:null,mime:\"\"}),!window.FileReader)return t(\"support\",e);(0<n.start||null!=n.end&&n.end)&&(n.blob.slice?(null==n.end&&(n.end=n.blob.size||n.blob.fileSize),n.blob=n.blob.slice(n.start,n.end,n.mime)):f.hasConsole&&console.warn(\"File Blob/slice() are unsupported - operating on entire File.\"));var r=new FileReader;r.onerror=function(e){t(\"read\",e)},r.onload=function(e){e.target&&e.target.result?(\"readAsBinaryString\"==n.func&&(e.target.result=String.fromCharCode.apply(null,new Uint8Array(e.target.result))),n.onDone(e.target.result)):r.onerror(e)};var o=n.func;if(f.isArray(o)){var i=o[0];return o[0]=n.blob,r[i].apply(r,o)}if(o&&\"bin\"!=o){if(\"url\"==o||\"uri\"==o||\"src\"==o)o=\"readAsDataURL\";else if(\"array\"==o)o=\"readAsArrayBuffer\";else if(\"text\"==o)o=\"readAsText\";else if(\"read\"!=o.substr(0,4))return r.readAsText(n.blob,o)}else o=\"readAsBinaryString\";return r[o=\"readAsBinaryString\"==o?\"readAsArrayBuffer\":o](n.blob)},s.listEntries=function(t,r){if(s.nativeEntry&&s.nativeEntry.isDirectory){r=r||new Function;var o=s.nativeEntry.createReader(),i=new f.FileList,a=0;function l(e){0==(a-=e)&&t&&(t(i),t=null)}return o.readEntries(function(e){for(var t=0;t<e.length;t++){var n=e[t];n.file?(a++,n.file(function(e){(e=new f.File(e)).setNativeEntry(n),i.push(e),l(1)},function(){i.push(f.File.fromEntry(n)),l(1),r.apply(this,arguments)})):i.push(f.File.fromEntry(n))}t?o.readEntries(arguments.callee,r):l(0)},r),!0}},s.setNativeEntry=function(e){s.nativeEntry=e&&e.webkitGetAsEntry&&e.webkitGetAsEntry()},s.event=function(e,t){return f.appendEventsToObject.apply(s,arguments)},s.preview=function(e,t){return f.previewToObject.apply(s,arguments)},s.onXhrSend=function(e,t){e.send(t)},s.event({xhrSend:s.onXhrSend})},f.File.fromEntry=function(e){var t=new f.File(e);return t.setNativeEntry(e),t.nativeFile=null,t},f.jQuery=function(i){if(!(i=i||jQuery||window.jQuery))throw\"No window.jQuery object to integrate FileDrop into.\";i.fn.filedrop=function(e){function t(n,r){return function(e){var t=(r||[]).concat(f.toArray(arguments,1));return o.triggerHandler((n+e).toLowerCase(),t)}}var o=this,n=this.data(\"filedrop\");if(\"string\"==typeof e)if(n){if(void 0!==n[e]){var r=n[e];return\"function\"==typeof r?r.apply(n,f.toArray(arguments,1)):r}i.error(\"There's no method or property FileDrop.\"+e+\".\")}else i.error(\"$.filedrop('comment') needs an initialized FilrDrop on this element.\");else if(e&&\"object\"!=typeof e)i.error(\"Invalid $.filedrop() parameter - expected nothing (creates new zone), a string (property to access) or an object (custom zone options).\");else if(n){if(!e)return n;f.extend(n.opt,e,!0)}else(n=new FileDrop(this[0],e)).$el=i(this),this.first().data(\"filedrop\",n),n.event(\"any\",t(\"fd\")),n.on.fileSetup.push(function(e){e.event(\"any\",t(\"file\",[e]))});return o}},t.FileDrop=f.FileDrop});"
  },
  {
    "path": "filedrop.css",
    "content": "/***\r\n  Styles below are only required if you're using <iframe> fallback in\r\n  addition to HTML5 drag & drop (only working in Firefox/Chrome/Opera 15+).\r\n  You can @import this file and override individual styles. Drag & drop zone\r\n  can be styled in absolutely any way you want so there are no defaults.\r\n ***/\r\n\r\n/* Essential FileDrop zone element configuration: */\r\n.fd-zone {\r\n  position: relative;\r\n  overflow: hidden;\r\n  /***\r\n    This way you can create a pretty box that will be both clickable and droppable:\r\n   ***\r\n    width: 15em;\r\n    margin: 0 auto;\r\n    text-align: center;\r\n  */\r\n}\r\n\r\n/* Hides <input type=\"file\"> while simulating \"Browse\" button: */\r\n.fd-file {\r\n  opacity: 0;\r\n  font-size: 118px;\r\n  position: absolute;\r\n  right: 0;\r\n  top: 0;\r\n  z-index: 1;\r\n  padding: 0;\r\n  margin: 0;\r\n  cursor: pointer;\r\n  filter: alpha(opacity=0);\r\n  font-family: sans-serif;\r\n}\r\n\r\n/***\r\n  With .over you can provide feedback when user drags a file over the drop zone:\r\n ***\r\n  .fd-zone.over { border-color: maroon; background: #eee; }\r\n*/"
  },
  {
    "path": "filedrop.js",
    "content": "/*!\n  FileDrop Revamped - HTML5 & legacy file upload\n  in public domain  | http://filedropjs.org\n  by Proger_XP      | http://proger.me\n\n  Supports IE 6+, FF 3.6+, Chrome 7+, Safari 5+, Opera 11+.\n  Fork & report problems at https://github.com/ProgerXP/FileDrop\n*/\n\n;(function (root, init) {\n  if (typeof define == 'function' && define.amd) {\n    define(['exports'], function (exports) { init(root, exports) })\n  } else if (typeof exports !== 'undefined') {\n    init(root, exports)\n  } else {\n    init(root, root.fd = root.fd || {})\n  }\n})(this, function (root, global) {\n  /***\n    Global Utility Functions\n   ***/\n\n  // Produces random ID (non necessary unique to anything) with given prefix\n  // or 'fd' if it's not passed.\n  //\n  //? randomID()        //=> 'fd_9854'\n  //? randomID('foo')   //=> 'foo_1582'\n  global.randomID = function (prefix) {\n    return (prefix || 'fd') + '_' + (Math.random() * 10000).toFixed()\n  }\n\n  // Generates random DOM node ID that's unique to this document with given prefix\n  // or 'fd' if it's not passed.\n  //\n  //? randomID()        //=> 'fd_9854'\n  //? randomID('foo')   //=> 'foo_1582'\n  global.uniqueID = function (prefix) {\n    do { var id = global.randomID(prefix) } while (global.byID(id))\n    return id\n  }\n\n  // Retrieves DOM element by its ID attribute or returns id itself if it's\n  // an element.\n  //\n  //? byID('foo')       //=> <p id=\"foo\">\n  //? byID('abracadabra!')  //=> null\n  //? byID({foo: 1})    //=> null\n  //? byID(null)        //=> null\n  //\n  //? byID(document.createElement('p'))\n  //    //=> <p>\n  global.byID = function (id) {\n    return global.isTag(id) ? id : document.getElementById(id)\n  }\n\n  // Checks if given object is a proper DOM node. If tag is passed also\n  // checks if that DOM node is of the same tag (case-insensitive).\n  // Returns true or false.\n  //\n  //? isTag('foo')        //=> false\n  //? isTag({foo: 1})     //=> false\n  //? isTag(null)         //=> false\n  //? isTag(window)       //=> false\n  //? isTag(document.body)          //=> true\n  //? isTag(document.body, 'BoDy')  //=> true\n  //? isTag(document.body, 'head')  //=> false\n  //\n  //? var el = byID('foo')    //=> <p id=\"foo\">\n  //  isTag(el, 'p')    //=> true\n  //  isTag(el, 'P')    //=> true\n  //  isTag(el, 'div')  //=> false\n  //  isTag(el, 'DiV')  //=> false\n  //\n  //? isTag(document.createElement('p'))\n  //    //=> true\n  //\n  //? isTag(document.createElement('p'), 'div')\n  //    //=> false\n  global.isTag = function (element, tag) {\n    return typeof element == 'object' && element && element.nodeType == 1 &&\n           ( !tag || element.tagName.toUpperCase() == tag.toUpperCase() )\n  }\n\n  // Creates new XMLHttpRequest object. Falls back for ActiveX for IE 6.\n  // Throws an exception if couldn't succeed (this shouldn't happen these days).\n  //\n  //? newXHR()    //=> XMLHttpRequest\n  global.newXHR = function () {\n    try {\n      return new XMLHttpRequest\n    } catch (e) {\n      // IE 6.\n      var activex = ['MSXML2.XMLHTTP.6.0', 'MSXML2.XMLHTTP.5.0',\n                     'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0',\n                     'MSXML2.XMLHTTP', 'Microsoft.XMLHTTP']\n\n      for (var i = 0; i < activex.length; i++) {\n        try {\n          return new ActiveXObject(activex[i])\n        } catch (e) {}\n      }\n    }\n\n    throw 'Cannot create XMLHttpRequest.'\n  }\n\n  // Checks if given value is a native Array object. Note that jQuery and\n  // other pseudo-arrays are reported as false.\n  //\n  //? isArray([])       //=> true\n  //? isArray([])       //=> true\n  //? isArray(new Array)    //=> true\n  //? isArray({})       //=> false\n  //? isArray('foo')    //=> false\n  //? isArray(null)     //=> false\n  //? isArray($('a'))   //=> false\n  //? isArray(arguments)    //=> false\n  //? isArray($('a').toArray())   //=> true\n  global.isArray = function (value) {\n    return Object.prototype.toString.call(value) === '[object Array]'\n  }\n\n  // Converts passed value into an array. If value is already an array its\n  // copy is returned (so changing value later doesn't affect the returned\n  // clone).\n  //\n  // skipFirst, if given, omits specified number of elements from the start.\n  // Useful for turning arguments into arrays.\n  //\n  //? toArray([])           //=> [] (copy)\n  //? toArray(['foo'])      //=> ['foo'] (copy)\n  //? toArray(['foo'], 1)   //=> []\n  //? toArray(['foo'], 999)   //=> []\n  //? toArray('foo')        //=> ['foo']\n  //? toArray('foo', 1)     //=> []\n  //? toArray('foo', 999)   //=> []\n  //? toArray({foo: 1})     //=> [{foo: 1}]\n  //? toArray({foo: 1}, 1)  //=> []\n  //? toArray(null)         //=> []\n  //? toArray(new Array('foo', 'bar'))      => ['foo', 'bar'] (copy)\n  //? toArray(new Array('foo', 'bar'), 1)   => ['bar']\n  //? toArray(new Array('foo', 'bar'), 2)   => []\n  //\n  //? function showMessage(func, line1, line2, ...) {\n  //    window[func](toArray(arguments, 1).join('\\n'))\n  //  }\n  //\n  //  showMessage('confirm', 'It\\'s first line.', 'Second line.')\n  //    //=> confirm('It\\'s first line.\\nSecond line.')\n  //\n  //  showMessage('alert', 'First', 'Second')\n  //    //=> alert('First\\nSecond')\n  global.toArray = function (value, skipFirst) {\n    if (value === null || typeof value == 'undefined') {\n      return []\n    } else if (!global.isArray(value) && (typeof value != 'object' || !('callee' in value))) {\n      // Made sure it's not 'arguments'.\n      value = [value]\n    }\n\n    return Array.prototype.slice.call(value, skipFirst || 0)\n  }\n\n  // Adds an event listener to a DOM element. Works for old IE as well\n  // as modern W3C-compliant browsers. type is short event name (without\n  // 'on' prefix). Does nothing if any parameter is invalid.\n  // Returns the DOM element itself or whatever was given as this argument.\n  //\n  //? addEvent(byID('p'), 'mousemove', function () { alert('Whoosh!') })\n  //? addEvent(window, 'load', function () { alert('Done loading.') })\n  //\n  //? addEvent(null, 'blur', function () { })   // nothing.\n  //? addEvent(window, null, function () { })   // nothing.\n  //? addEvent(window, 'blur', null)            // nothing.\n  //\n  //? addEvent(window, 'nonstandard', function () { })\n  //      // works.\n  global.addEvent = function (element, type, callback) {\n    if (element && type && callback) {\n      if (element.attachEvent) {\n        element['e' + type + callback] = callback\n        element[type + callback] = function() {\n          element['e' + type + callback](window.event)\n        }\n        element.attachEvent('on' + type, element[type + callback])\n      } else {\n        element.addEventListener(type, callback, false)\n      }\n    }\n\n    return element\n  }\n\n  // Stops propagation and default browser action of an event.\n  // Works for old IE and modern W3C-compliant browsers.\n  //\n  //? byID('p').onmousemove = function (e) { stopEvent(e) }\n  global.stopEvent = function (event) {\n    event.cancelBubble = true\n    event.returnValue = false\n    event.stopPropagation && event.stopPropagation()\n    event.preventDefault && event.preventDefault()\n    return event\n  }\n\n  // Adds or removes HTML class of a DOM element. Keeps old classes.\n  // element can be either ID string or a DOM node.\n  // Returns the element (even if ID was passed) or null if passed value\n  // is neither a string nor a DOM node or if there's no element with\n  // this ID.\n  //\n  //? setClass(byID('p'), 'foo')      //=> <p class=\"... foo\">\n  //? setClass(byID('p'), 'foo', true)  // equivalent to above\n  //? setClass(byID('p'), 'foo', false)   //=> <p class=\"...\"> (no 'foo')\n  //? setClass('anID', 'foo')         //=> <a id=\"anID\" class=\"... foo\">\n  //? setClass('anID', 'foo', false)  //=> <a> without 'foo' class\n  //?\n  global.setClass = function (element, className, append) {\n    if ((element = global.byID(element)) && className != null) {\n      if (typeof append != 'undefined' && !append) {\n        element.className = element.className.replace(global.classRegExp(className), ' ')\n      } else if (!global.hasClass(element, className)) {\n        element.className += ' ' + className\n      }\n    }\n\n    return element\n  }\n\n  // Determines if given element has class attribute containing the className\n  // word. Accepts DOM element or ID string. Returns true or false.\n  // Examples below refer to <p class=\"cls1 cls2\" id=\"anID\">\n  //\n  //? hasClass(byID('anID'), 'cls1')  //=> true\n  //? hasClass('anID', 'cls1')        // equivalent to above\n  //? hasClass('anID', 'cls')         //=> false\n  //? hasClass('anID', 'foo')         //=> false\n  //? hasClass('abra!', 'cls1')       //=> false (no such element)\n  //? hasClass('anID', '')            //=> false (empty class)\n  //? hasClass('anID', null)          //=> false\n  //? hasClass('anID', {foo: 1})      //=> false (not a string)\n  //? hasClass(null, 'foo')           //=> false\n  //? hasClass({foo: 1}, 'foo')       //=> false (not a DOM node)\n  //? hasClass(window, foo)           //=> false\n  global.hasClass = function (element, className) {\n    return global.classRegExp(className).test( (global.byID(element) || {}).className )\n  }\n\n  // Returns a regular expression suitable for testing of HTML class-like\n  // strings to find out if it contains a given word or not (it's not as\n  // simple as a substring match: 'some class' contains words 'some' and\n  // 'class' but not 'som' and 'cl' or 'ame' and 'ass').\n  //\n  // Shouldn't be used for testing multiple words (space-separated) - will\n  // only match if they are in the same position in testing string which\n  // doesn't have to be true: classRegExp('some class') would match\n  // 'this is some class' but won't match 'some of the class'.\n  //\n  // Returns a never matching regexp for bad parameter like object or an\n  // empty string.\n  //\n  //? classRegExp('foo')        //=> RegExp /(^|\\s+)foo(\\s+|$)/ig\n  //? classRegExp('x').test('x y z')  //=> true\n  //? classRegExp('foo bar')    // works but not advised\n  //? classRegExp({foo: 1})     //=> RegExp /$o_O/\n  //? classRegExp(null)         // the same as above\n  //? classRegExp(window)       // the same as above\n  //? classRegExp(null).test('foo')  //=> false (always)\n  global.classRegExp = function (className) {\n    if (className == '' || typeof className == 'object') {\n      return /$o_O/  // never matches.\n    } else {\n      return new RegExp('(^|\\\\s+)' + className + '(\\\\s+|$)', 'gi')\n    }\n  }\n\n  // Copies properties from object base to object child. If overwrite\n  // is passed and true then base's properties will replace those\n  // in child even if child has its own properties of that name.\n  // Note that it doesn't clone child, it's edited in-place.\n  // Also note that defined properties that are 'undefined' on child are\n  // replaced by base's even if overwrite is false (see examples).\n  //\n  // Returns the modified child (first argument).\n  //\n  //? extend({common: 1, child: false}, {common: 'foo', base: true})\n  //    //=> {common: 1, child: false, base: true}\n  //\n  //? extend({common: 1, child: false}, {common: 'foo', base: true}, true)\n  //    //=> {common: 'foo', child: false, base: true}\n  //\n  //? extend({x: undefined}, {x: 1})    //=> {x: 1}\n  //? extend({x: null}, {x: 1})         //=> {x: null}\n  //\n  //? var child = {y: 1}\n  //  extend(child, {x: 1}) === child   //=> true (same object)\n  //  console.dir(child)    //=> {y: 1, x: 1}\n  global.extend = function (child, base, overwrite) {\n    child = child || {}\n    base = base || {}\n\n    for (var prop in base) {\n      if (overwrite || typeof child[prop] == 'undefined') {\n        child[prop] = base[prop]\n      }\n    }\n\n    return child\n  }\n\n  /***\n    Event Manipulation Functions\n   ***/\n\n  // Calls every handler of the passed callback list with given arguments\n  // and in context of obj or 'this' if it's omitted.\n  //\n  // list can be undefined, a single function or an array (non-function members\n  // are skipped). Throws exception if list is something else.\n  // args is converted to array with toArray() so it can be a single value,\n  // an arguments object or something else - see that function for info.\n  //\n  // Returns result of the last called function. If any function returns\n  // a non-null and non-undefined value all following handlers are skipped.\n  //\n  //? callAll(function (a) { return a + 'foo' }, 'arg1')\n  //    //=> 'arg1foo'\n  //? callAll([ function () { } ], ['arg1'])\n  //    // equivalent to above\n  //\n  //? var list = [function (a) { return a[0] == 'a' ? a + 'foo' : null },\n  //              function (a) { alert(a) }]\n  //  callAll(list, 'arg1')   //=> 'arg1foo' (first handler)\n  //  callAll(list, 'foo')    //=> alert('foo') (second handler)\n  //\n  //? callAll(function () { alert(this.x) }, [], {x: 'foo'})\n  //    //=> alert('foo')\n  //\n  //? callAll(function () { alert(this.x) }).call({x: 'foo'})\n  //    // equivalent to above\n  //\n  //? window.onload = function () {\n  //    callAll([...], arguments, window)\n  //      // equivalent to callAll([...], toArray(arguments), window)\n  //  }\n  global.callAll = function (list, args, obj) {\n    var res\n    args = global.toArray(args)\n    typeof list == 'function' && (list = [list])\n\n    if (global.isArray(list)) {\n      for (var i = 0; i < list.length; i++) {\n        if (typeof list[i] == 'function') {\n          res = list[i].apply(obj || this, args)\n          if (res != null) { break }\n        }\n      }\n    } else if (list) {\n      throw 'FileDrop event list must be either an Array, Function, undefined or' +\n            ' null but ' + (typeof list) + ' was given.'\n    }\n\n    return res\n  }\n\n  // Calls event handlers attached on given FileDrop object to passed\n  // event name with arguments. Hands off most work to callAll().\n  // obj is an object with the 'events' property (object with keys = event\n  // names and values = arrays of functions).\n  //\n  // Before calling handlers of obj looks if global configuration has\n  // a preview handler specified - if it does then calls that handler\n  // and if it returns non-null and non-undefined value doesn't call\n  // obj's handlers but returns that value immediately. After the global\n  // preview function it checks for object-wise preview - its 'any' event\n  // handlers which are treated likewise.\n  // Preview functions are called with event name pushed in front of\n  // the other event args.\n  //\n  //? var obj = {events: { foo: [function (a) { alert(a); return true }] }}\n  //  callAllOfObject(obj, 'foo', 'arg1')   //=> true after alert('arg1')\n  //\n  //? window.fd.onObjectCall = function (e) { alert(e + ': tee hee'); return false }\n  //  var obj = ...   // as above\n  //  callAllOfObject(obj, 'foo', 'arg1')   //=> false after alert('foo: tee hee')\n  //\n  //? var obj = {events: { any: [function (e) { return false }] }}\n  //  callAllOfObject(obj, 'anyevent')\n  //    // because of the object-wise preview handler that returns false\n  //    // any event we call will return false bypassing its actual handlers.\n  global.callAllOfObject = function (obj, event, args) {\n    if (global.logging && global.hasConsole) {\n      var handlers = obj.events[event] ? obj.events[event].length || 0 : 0\n      console.info('FileDrop ' + event + ' event (' + handlers + ') args:')\n      console.dir([args])\n    }\n\n    var preview = [global.onObjectCall].concat(obj.events.any)\n    var res = global.callAll(preview, [event].concat(global.toArray(args)), obj)\n    return res != null ? res : global.callAll(obj.events[event], args, obj)\n  }\n\n  // Appends event listeners to given object with 'events' property according\n  // to passed parameters. See DropHandle.event() for details.\n  // 'this' must be set to the object which events are updated.\n  global.appendEventsToObject = function (events, funcs) {\n    if (global.addEventsToObject(this, false, arguments)) {\n      return this\n    }\n\n    switch (arguments.length) {\n    case 0:\n      return global.extend({}, this.events)\n\n    case 1:\n      if (events === null) {\n        this.events = {}\n        return this\n      } else if (global.isArray(events)) {\n        var res = {}\n\n        for (var i = 0; i < events.length; i++) {\n          res[events[i]] = global.toArray(this.events[events[i]])\n        }\n\n        return res\n      } else if (typeof events == 'function') {\n        return global.funcNS(events)\n      } else if (typeof events == 'string') {\n        return global.toArray(this.events[events])\n      }\n\n    case 2:\n      events = global.toArray(events)\n\n      if (funcs === null) {\n        for (var i = 0; i < events.length; i++) {\n          var ns = global.splitNS(events[i])\n\n          if (!ns[0]) {\n            for (var event in this.events) {\n              arguments.callee.call(this, [event + ':' + ns[1]], null)\n            }\n          } else if (!ns[1]) {\n            this.events[ns[0]] = []\n          } else if (this.events[ns[0]]) {\n            for (var fi = this.events[ns[0]].length - 1; fi >= 0; fi--) {\n              if (global.funcNS( this.events[ns[0]][fi] ) == ns[1]) {\n                this.events[ns[0]].splice(fi, 1)\n              }\n            }\n          }\n        }\n\n        return this\n      }\n    }\n\n    throw 'Bad parameters for FileDrop event().'\n  }\n\n  // Prepends event listeners to given object with 'events' property according\n  // to passed parameters. See DropHandle.event() for details.\n  // 'this' must be set to the object which events are updated.\n  global.previewToObject = function (events, funcs) {\n    if (global.addEventsToObject(this, true, arguments)) {\n      return this\n    } else {\n      throw 'Bad parameters for FileDrop preview().'\n    }\n  }\n\n  // Adds event listeners to given object with 'events' property according\n  // to passed parameters. See DropHandle.event() for details.\n  // Returns nothing if couldn't handle given parameter combination.\n  global.addEventsToObject = function (obj, prepend, args) {\n    var events = args[0]\n    var funcs = args[1]\n\n    switch (args.length) {\n    case 1:\n      if (events && typeof events == 'object' && !global.isArray(events)) {\n        for (var event in events) {\n          arguments.callee(obj, prepend, [event, events[event]])\n        }\n\n        return true\n      }\n\n    case 2:\n      if (typeof funcs == 'function' || global.isArray(funcs)) {\n        events = global.toArray(events)\n        funcs = global.toArray(funcs)\n        var pusher = prepend ? 'unshift' : 'push'\n\n        for (var i = 0; i < events.length; i++) {\n          var ns = global.splitNS(events[i])\n          for (var fi = 0; fi < funcs.length; fi++) {\n            global.funcNS(funcs[fi], ns[1])\n          }\n\n          obj.events[ns[0]] = obj.events[ns[0]] || []\n          obj.events[ns[0]][pusher].apply(obj.events[ns[0]], funcs)\n        }\n\n        return true\n      }\n    }\n  }\n\n  // Adds namespace identifier to a Function object. Used when labeling event\n  // listeners in DropHandle.event(). If given just one parameter reads\n  // attached namespace, if present.\n  //\n  //? funcNS(function () { }, 'foo')\n  //? funcNS(function () { })   //=> 'foo'\n  global.funcNS = function (func, ns) {\n    if (typeof func != 'function') {\n      return func\n    } else if (arguments.length == 1) {\n      return (func[global.nsProp] || '').toString()\n    } else {\n      func[global.nsProp] = (ns || '').toString()\n      return func\n    }\n  }\n\n  // Extracts namespace identifier from the string. Uses jQuery notation:\n  // 'event:namespace'. Both parts can be empty. If colon is omitted returns\n  // '' instead of namespace.\n  // Returns array with two items - event name (or other prefix) and namespace.\n  //\n  //? splitNS('')       //=> ['', '']\n  //? splitNS(null)     // identical to above\n  //? splitNS(':')      // identical to above\n  //? splitNS('x:')     //=> ['x', '']\n  //? splitNS(':y')     //=> ['', 'y']\n  //? splitNS('x:y')    //=> ['x', 'y']\n  //? splitNS('x:y:z')  //=> ['x', 'y:z']\n  global.splitNS = function (str) {\n    return (str || '').match(/^([^:]*):?(.*)$/).slice(1)\n  }\n\n  /***\n    Global Configuration\n   ***/\n\n  global.extend(global, {\n    // If set all event calls will be logged to console if one is present.\n    logging: true,\n\n    // Indicates if console.log and console.dir are available for usage.\n    hasConsole: 'console' in window && console.log && console.dir,\n\n    // If set must be a function that's called on every event being fired.\n    // See how it works in callAllOfObject().\n    onObjectCall: null,\n\n    // All DropHandle objects that were instantinated on this page.\n    // Note that these are not FileDrop instances as not all DropHandles\n    // might be part of FileDrops. Use DropHandle.filedrop property.\n    all: [],\n\n    // Tests for IE versions, must be true for 6-7/9 and below and\n    // false for any other version/browser.\n    // IE 6 on XP SP 3 gives JScript version 5.7 while IE 8 - 5.8.\n    // IE 9 on Win7 gives 9.\n    isIE6: /*@cc_on/*@if(@_jscript_version<=5.7)true@else@*/false/*@end@*/,\n    isIE9: /*@cc_on/*@if(@_jscript_version<=9)true@else@*/false/*@end@*/,\n\n    // Test for Google Chrome. This isn't used to determine available\n    // File API but only to work around certain event glitches.\n    isChrome: (navigator.vendor || '').indexOf('Google') != -1,\n\n    // Name of Function object property where event namespace is stored.\n    // See funcNS(), splitNS(), DropHandle.event().\n    nsProp: '_fdns'\n  })\n\n  /***\n    Basic Drop Handle Class\n   ***\n\n    Has some file upload functionality (mostly legacy <iframe>) but is mainly\n    used to handle all drag & drop operations in a cross-browser way.\n    You can use it as a basis for your own component.\n    Main FileDrop class extends it and listens for produced drop events.\n   ***/\n\n  // Parameters:\n  // * zone - ID or DOM element which accepts drag & drop. This is often a\n  //          <fieldset>. If such element doesn't exist an exception is thrown\n  //          when trying to create the class. DropHandle will add some children\n  //          to this element to facilitate external drop events. Once created this\n  //          element is accessible as (new DropHandle(...)).el property.\n  //\n  // * opt -  object, key/value pairs of options. See the code for the list of\n  //          keys and their purpose. Can be omitted or empty to use defaults.\n  //          Current option values are accessible as the opt property.\n  //\n  //? new fd.DropHandle('anID')\n  //? new fd.DropHandle(document.body, {zoneClass: 'with-filedrop'})\n  global.DropHandle = function (zone, opt) {\n    // Persistent 'this' instance reference.\n    var self = this\n\n    self.el = zone = global.byID(zone)\n    if (!zone) { throw 'Cannot locate DOM node given to new FileDrop class.' }\n\n    /***\n      DropHandle Options\n     ***\n\n      Changing these on runtime after the class was created doesn't affect\n      anything so make sure to pass desired values to the constructor.\n     ***/\n\n    self.opt = {\n      // The zone element gets this HTML class appended immediately after\n      // the DropHandle object is created.\n      zoneClass: 'fd-zone',\n\n      // DropHandle creates a hidden form and <input type=\"file\">. The input\n      // is completely transparent so the contents underneath is visible\n      // but at the same time a dropped object lands on the input triggering\n      // its DOM events. This option specifies the class name assigned\n      // to this input.\n      inputClass: 'fd-file',\n\n      // Options for fallback upload via <iframe> for browsers lacking\n      // native drag & drop support - IE and others.\n      iframe: {\n        // URL to send uploaded file to. It's a regular form upload with\n        // enctype=\"multipart/form-data\" so if you're using PHP it's handled\n        // with $_FILES as usual. The URL can have query string. It will have\n        // the 'fd-callback' parameter appended containing the name of\n        // function your server script must call when generating JavaScript\n        // output - if it does the upload succeeds, otherwise it \"fails\".\n        // Calling external function is the only reliable way to know that\n        // we've uploaded the file right. Plus you can pass any data to\n        // that function as its parameters.\n        // For the practical server-side example see included upload.php.\n        //\n        // If unset <iframe> upload is disabled so only drag & drop-aware\n        // browsers (Firefox and Crhome-based) will handle this drop zone.\n        url: '',\n\n        // Name of GET input variable containing the name of the global window\n        // callback function to be called by the server in the generated\n        // page after uploading a file via <iframe>.\n        callbackParam: 'fd-callback',\n\n        // Name of POST file input variable (<input type=\"file\" name=\"$nameParam\">).\n        // Maps to $_FILE[] in PHP.\n        fileParam: 'fd-file'\n      },\n\n      // Contains DOM nodes of fallback upload via <iframe>. If null necessary\n      // elements for <iframe> upload will be created automatically.\n      //\n      // If this is false (boolean) then DropHandle creates no input at all.\n      // This is useful if you need pure drag & drop upload that works in\n      // Firefox and Chrome-based browsers, no <iframe> uploads for IE 9-,\n      // Opera, Safari and others. This creates \"perfect\" drop zone that\n      // doesn't prevent user interaction with underlying components so the\n      // zone can be extended onto large document area or the entire window.\n      input: null,\n\n      // After construction opt.input's structure is as follows: {\n        // If unset DropHandle will first recursively look for <input type=\"file\">\n        // among the children of the zone element and having opt.inputClass among\n        // its HTML classes. If found no new element will be created. This makes it\n        // safe to create multiple DropHandle objects for the same zone handle (not\n        // tested though).\n        //\n        // If unset but no suitable node would be found (see above) then DropHandle\n        // creates the input automatically along with the form which is usually\n        // exactly what you need.\n        //file: null,\n\n        // This value is set to match the parent form of <input type=\"file\">.\n        // Changing it isn't recommended.\n        //form: null\n      //},\n\n      // If using <input type=\"file\"> (legacy <iframe> upload, see input option)\n      // some browsers including IE 6-10 and Opera will keep last selected file\n      // in the input after upload which will prevent the user from uploading\n      // the same file twice in a row (this doesn't apply to drag & drop uploads).\n      // When enabled, this option will let FileDrop recreate the file input\n      // thus resetting file selection. This is safe in most cases but if your\n      // project does some extra customization on opt.input.file this might erase\n      // them and attached events unless you are doing that in inputSetup event.\n      // When disabled, input will be cleared in Firefox/Chrome thus preventing\n      // user from reuploading the same file one after another in other browsers.\n      recreateInput: true,\n\n      // Chrome, unlike Firefox, dispatches drag events for the entire document\n      // rather than the input element. For Chrome this option is always true.\n      // If you want the same behaviout in Firefox then you can manually set\n      // it to true to let all of your drop zones receive drag events as soon\n      // as they enter the browser's window but not those zones' boundaries.\n      // Note that drop events (when user releases the mouse button) are always\n      // dispatched to drop zone under the mouse pointer, if there's any.\n      // This only makes drag (hover) events fire for all zones regardless of\n      // the pointer position.\n      fullDocDragDetect: false,\n\n      // Initial state of the multiple selection in browser's Open File dialog\n      // appearing when clicking on the drop zone (<input type=\"file\">).\n      // After this object was created toggle this setting with this.multiple().\n      multiple: false,\n\n      // Cursor displayed when a user drags an object over this drop zone.\n      // Working values depend on the browser. 'copy' and 'none' work for\n      // Firefox and Chrome; the latter also supports 'move', 'link'.\n      // Setting to 'none' will cause \"No Drop\" cursor and will cause drop\n      // operation to be ignored on this drop zone (on-drop event not fired).\n      // This option can be set on runtime.\n      dropEffect: 'copy'\n    }\n\n    // Keeping track of all DropHandle instances.\n    global.all.push(self)\n    // If this DropHandle was created by a FileDrop instance this property\n    // will point to that instance.\n    self.filedrop = null\n\n    var iframe = self.opt.iframe\n    global.extend(self.opt, opt, true)\n    // In case user options contained {iframe} without full set of properties.\n    global.extend(self.opt.iframe, iframe)\n\n    // Chrome dispatches drop events document-wise rather than zone-wise.\n    // If unset we won't receive any reaction on individual elements.\n    global.isChrome && (self.opt.fullDocDragDetect = true)\n\n    /***\n      DropHandle Events\n     ***\n\n      Attach new listeners with (new DropHandle).event('dragEnter', function ...).\n      As a low-level alternative you can change/move items around this array\n      directly but it's not future-proof.\n\n      Note that all callbacks are executed with 'this' pointing to this\n      object so it's easy to know which DropHandle has caused that particular\n      event. For example:\n\n        var dh = new DropHandle('myzone')\n        dh.event('dragEnter', function () {\n          alert('Entering the ' + this.el.id + ' drop zone!')\n        })\n     ***/\n\n    self.events = {\n      // Object-wise event preview handlers. They get executed on any event\n      // of this object (like dragEnter) and if any of them returns a non-null\n      // and non-undefined value actual event handlers are not called and\n      // that value is returned. These callbacks receive the same arguments\n      // as the target event plus that event's name in front.\n      // See callAllOfObject() for more details.\n      any: [],\n\n      // Occurs when a user drags something across this zone element (Firefox)\n      // or across the entire browser window (Chrome or if opt.fullDocDragDetect\n      // is set).\n      //\n      // function (eventObject)\n      dragEnter: [],\n\n      // Occurs when user drags the object away from the zone element (Firefox)\n      // or outside of the window (Chrome or opt.fullDocDragDetect).\n      //\n      // function (eventObject)\n      dragLeave: [],\n\n      // Occurs periodically after dragEnter while user is still dragging an\n      // object inside the drop zone. If not using DropHandle be aware that\n      // Chrome requires a listener attached to ondragover or it will discard\n      // the drop operation. DropHandle takes care of this for you.\n      //\n      // function (eventObject)\n      dragOver: [],\n\n      // The following 2 events are somewhat superficient and not really useful\n      // or working but they're still listened to in case you need to hook them.\n      //\n      // function (eventObject)\n      dragEnd: [],\n      dragExit: [],\n\n      // Occurs when a file has been dropped on the zone element or when a file\n      // was selected in/dropped onto fallback <form> to trigger <iframe> upload.\n      // The former occurs in Firefox and Chrome-based browsers that support\n      // drag & drop natively. The latter occurs in Opera and others that only\n      // work with regular form file uploads.\n      //\n      // function (eventObject)\n      //    - is passed native browser-dependent event object.\n      upload: [],\n\n      // Occurs when another DropHandle object on the page initiates upload\n      // event. Can be used to reset some visual state of all drop zones but\n      // the one that's actually got the file landed.\n      //\n      // function (DropHandle)\n      //    - is passed another DropHandle object that has initiated the\n      //      upload event.\n      uploadElsewhere: [],\n\n      // Occurs after <input type=\"file\"> used to accept file drops was created\n      // or found (see the description of the 'input' option). Here it's used to\n      // assign it some HTML classes. You can do similar setup.\n      // Is also fired after recreating file input on upload if opt.recreateInput\n      // is set - in this case is passed old <input type=\"file\"> (that was cloned).\n      //\n      // function ({ file: DOM_Input, form: DOM_Form }, oldFileInput)\n      //    - is passed an object with the same keys as 'input' option -\n      //      the DOM element of the <input type=\"file\"> and its parent\n      //      <form> DOM element.\n      inputSetup: [],\n\n      // Occurs when a fallback <iframe> element was created. Can be used for\n      // setup actions similar to inputSetup.\n      //\n      // function (DOM_Iframe)\n      //    - is passed the DOM element of the new <iframe>.\n      iframeSetup: [],\n\n      // Occurs when a file was successfully uploaded to the server, i.e.\n      // when the form was submitted and the server has returned the output\n      // that calls 'fd-callback' function to indicate successful (or unsuccessful)\n      // upload to the client page. See the 'iframe' option and included upload.php\n      // for samples and explanations.\n      //\n      // function (response)\n      //    - is passed the same data as given by the server-generated JavaScript\n      //      to the global 'fd-callback'. Note that it's the first argument to\n      //      that function, all others are ignored.\n      //      This object will mimic some of XMLHttpRequest properties so you\n      //      can use single handler for both XHR and <iframe> uploads - see\n      //      sendViaIFrame() for details.\n      iframeDone: []\n    }\n\n    // Old FireDrop compatibility. Now deprecated.\n    self.on = self.events\n    self.zone = self.el\n\n    /***\n      DropHandle Methods\n     ***/\n\n    // Prepares target DOM element for drag & drop and <iframe> uploads by\n    // adding more child nodes and listening to appropriate events.\n    // Usually you don't need to call this function since it's automatically\n    // called for the zone element (given to the constructor).\n    //\n    //? hook(byID('myzone'))\n    self.hook = function (zoneNode) {\n      // If <input type=\"file\"> support was turned off then we're not aiming\n      // for the support of uploads without File API, i.e. via <iframe> for\n      // all but Firefox and Chrome. If such we're not creating the form and\n      // other supportive elements.\n      if (self.opt.input !== false) {\n        self.opt.input = self.opt.input || self.prepareInput(zoneNode)\n        self.opt.input && global.callAllOfObject(self, 'inputSetup', self.opt.input)\n      }\n\n      self.hookDragOn(zoneNode)\n      self.hookDropOn(zoneNode)\n    }\n\n    // Attaches listeners for drag events - when an object is moved in or out\n    // the scope of the zone element (or document for Chrome). This provides\n    // common layer for various browser-specific ways to utilize drag* events.\n    // Once a suitable event occurs DropHandle's own event callbacks are invoked.\n    self.hookDragOn = function (zoneNode) {\n      // With dragenter we detect when user moves object over our zone or\n      // document window to display some feedback.\n      //\n      // With dragleave we do the opposite and restore previous component state\n      // when an object is being moved away or drag & drop is cancelled.\n\n      if (self.opt.fullDocDragDetect) {\n        self.delegate(document.body, 'dragEnter')\n\n        global.addEvent(document, 'dragleave', function (e) {\n          // Chrome (at least in earlier versions) fires dragleave randomly,\n          // this is used to normalize it to just one real occurrence.\n          if ((e.clientX == 0 && e.clientY == 0) || global.isTag(e.relatedTarget, 'html')) {\n            global.stopEvent(e)\n            global.callAllOfObject(self, 'dragLeave', e)\n          }\n        })\n      } else {\n        self.delegate(zoneNode, 'dragEnter')\n        self.delegate(zoneNode, 'dragLeave')\n      }\n\n      self.delegate(zoneNode, 'dragOver')\n      self.delegate(zoneNode, 'dragEnd')    // doesn't work anywhere; unused by FileDrop.\n      self.delegate(zoneNode, 'dragExit')   // works in Firefox; unused by FileDrop.\n    }\n\n    // Attaches listeners to drop events. Just like hookDragOn provides\n    // common browser-independent ground by normalizing occurred events\n    // and calling DropHandle's own event handlers.\n    self.hookDropOn = function (zoneNode) {\n      // IE 6-9 fire 'drop' event if you drop a file onto a file input. However,\n      // if the form is submitted after this event IE will send empty POST body\n      // instead of the actual file data. So handling of this event is disabled here\n      // although technically it could've worked since IE 6 if not for that bug (?).\n      //\n      // Firefox and Chrome-based browsers are the only ones supporting this\n      // event which we use to read dropped file data in the FileDrop class.\n      global.isIE9 || self.delegate(zoneNode, 'drop', 'upload')\n    }\n\n    // Listens for DOM events and initiates corresponding DropHandle's events.\n    // Third argument can specify DropHandle's event name if it differs from\n    // the DOM event. Propagation of caught events is stopped.\n    //\n    //? delegate(byID('myzone'), 'dragleave')\n    //? delegate(byID('myzone'), 'drop', 'upload')\n    self.delegate = function (zoneNode, domEvent, selfEvent) {\n      global.addEvent(zoneNode, domEvent.toLowerCase(), function (e) {\n        global.stopEvent(e)\n        global.callAllOfObject(self, selfEvent || domEvent, e)\n      })\n    }\n\n    // Finds or creates <input type=\"file\"> used to facilitate non-drag & drop\n    // uploads for browsers othat than Firefox and Chrome-based.\n    // Returns that input's DOM element and its parent <form> or, if none,\n    // throws an exception since there's no meaning in having <input type=\"file\">\n    // and no <form> as both are only reuqired for fallback <iframe> upload.\n    // This result is assigned to 'input' option.\n    self.prepareInput = function (parent) {\n      var file = self.findInputRecursive(parent) || self.createInputAt(parent)\n\n      if (file) {\n        var form = file.parentNode\n        while (form && !global.isTag(form, 'form')) {\n          form = form.parentNode\n        }\n\n        if (!form) { throw 'FileDrop file input has no parent form element.' }\n\n        // See if the located form has proper target and if that target\n        // (supposedly <iframe>) really exists - we don't want to reload\n        // the entire document on file upload since it defeats the purpose\n        // of AJAX and is probably an error condition.\n        var target = form ? form.getAttribute('target') : ''\n\n        if (target && global.isTag(global.byID(target), 'iframe')) {\n          // Once here it means the setup is good to go. Return with success.\n          return {file: file, form: form}\n        }\n      }\n\n      // Similarly to opt.input == false this means there's input/form found\n      // so turn off <iframe> upload or create our own elements.\n      return false\n    }\n\n    // Searches for <input type=\"file\"> containing HTML class opt.inputClass\n    // among the children of parent. Is used to autodetect pre-created input\n    // of a drop zone. parent must be a DOM element.\n    // Returns DOM element or null.\n    //\n    //? // <form id=\"myzone\"><input type=\"file\" class=\"fd-input\"></form>\n    //  findInputRecursive(byID('myzone'))\n    //    //=> <input type=\"file\" class=\"fd-input\">\n    //\n    //? findInputRecursive(byID('foo'))   //=> null\n    self.findInputRecursive = function (parent) {\n      for (var i = 0; i < parent.childNodes.length; i++) {\n        var node = parent.childNodes[i]\n\n        if (global.isTag(node, 'input') && node.getAttribute('type') == 'file' &&\n            global.hasClass(node, self.opt.inputClass)) {\n          return node\n        } else if (node = arguments.callee(node)) {\n          return node\n        }\n      }\n    }\n\n    // Creates elements necessary for <iframe> upload to work - the input,\n    // form and iframe itself. A random unique ID is generated and assigned to\n    // the iframe, plus new form's target attribute. Once <input type=\"file\">\n    // gets clicked (and file chosen in the appeared dialog) or once it gets\n    // a file dropped onto (supported by some browsers) its onchange event\n    // occurs which we're intercepting in hookDropOn(). With that we trigger\n    // <form> submission which sends data to our hidden <iframe>. Just like\n    // old times.\n    //\n    // Returns the DOM element of (new) <input type=\"file\">.\n    self.createInputAt = function (parent) {\n      do { var id = global.randomID() } while (global.byID(id))\n\n      var cont = document.createElement('div')\n      // <iframe> code and several other things around are courtesy of\n      // QQ File Uploader (https://github.com/valums/file-uploader).\n      cont.innerHTML = '<iframe src=\"javascript:false\" name=\"' + id + '\"></iframe>' +\n                       '<form method=\"post\" enctype=\"multipart/form-data\">' +\n                         '<input type=\"hidden\" name=\"' + self.opt.iframe.callbackParam + '\" />' +\n                         '<input type=\"file\" name=\"' + self.opt.iframe.fileParam + '\" />' +\n                       '</form>'\n\n      // <iframe>.\n      cont.firstChild.setAttribute('id', id)\n      cont.firstChild.style.display = 'none'\n      // <form>.\n      cont.lastChild.setAttribute('target', id)\n\n      var nextChild = parent.firstChild\n      // Opera doesn't recognize <legend> and doesn't put it on top of the fieldset\n      // unless it's the first child. For this we skip over <legend> which can\n      // happen if parent is a <fieldset>.\n      while (nextChild && (!global.isTag(nextChild) || global.isTag(nextChild, 'legend'))) {\n        nextChild = nextChild.nextSibling\n      }\n\n      // Now put our controls as first child so they overlap the contents and\n      // <input type=\"file\"> can be clicked or dropped onto to fire the events.\n      if (nextChild) {\n        // Firefox 10 requires that immediate parent has position: relative for\n        // overflow: hidden to work on the input this in turn requires that the\n        // parent is the first child, otherwise top: 0 of the file input won't work.\n        parent.insertBefore(cont, nextChild)\n      } else {\n        // parent has no children or it's just <legend> - append controls to the end.\n        parent.appendChild(cont)\n      }\n\n      // The file input.\n      return cont.lastChild.lastChild\n    }\n\n    // Can be used to abort <iframe> upload. Isn't guaranteed to work since\n    // it's unreliable and highly browser-dependent (especially IE) but at\n    // least it might work. Does nothing if this DropHandle doesn't use\n    // <iframe> upload (see the input option).\n    self.abortIFrame = function () {\n      if (self.opt.input.form) {\n        var iframe = global.byID(self.opt.input.form.getAttribute('target'))\n        iframe && iframe.setAttribute('src', 'javascript:false')\n      }\n    }\n\n    // Sends the data via <iframe> as a fallback for proper File API AJAX upload.\n    // If url is omitted iframe.url option is used. See its description for more\n    // info. Does nothing if this DropHandle doesn't use <iframe> upload (see\n    // the input option). FileDrop class calls this automatically if an upload\n    // was triggered by an unsupported browser (neither Firefox nor Chrome-based).\n    //\n    // Unlike FileAPI events that let you decide what to do with the file - read,\n    // upload or descrad it - <iframe> upload is an imitation that simply submits\n    // the form as logn as <input type=\"file\"> was changed according to onchange\n    // event. There's no way to make sure it was populated or retrieve any info\n    // about the file - this can only be done by the server which may return\n    // something useful in response. For this reason DropHandle automatically\n    // facilitates the upload and offers only one 'iframeDone' event when all\n    // went fine.\n    //\n    // Returns true if upload was sent (but no guarantees about its success,\n    // use 'iframeDone' event for this purpose).\n    //\n    //? sendViaIFrame('http://my.host/upload.php?var=foo&var2=123')\n    //? sendViaIFrame()   // uses opt.iframe.url\n    self.sendViaIFrame = function (url) {\n      url = url || self.opt.iframe.url\n      var form = (self.opt.input || {}).form\n\n      if (url && form) {\n        do { var callback = global.randomID() } while (callback in window)\n\n        // This function is meant for calling by the code generated by the\n        // server-side script to which we've sent the file via the <form>.\n        // callback is that function's globally unique name (window-wise).\n        window[callback] = function (resp) {\n          // If server didn't pass a JS object let's mimic XMLHttpRequest\n          // and put that response data there.\n          if (typeof resp != 'object') {\n            resp = {\n              response: resp,\n              responseXML: '',\n              responseText: (resp || '').toString(),\n              readyState: 4,\n              status: 200,\n              statusText: 'OK',\n              // A bunch of XMLHttpRequest/jqXHR stub methods.\n              getAllResponseHeaders: function () { return '' },\n              getResponseHeader: function () { return '' },\n              setRequestHeader: function () { return this },\n              statusCode: function () { return this },\n              abort: function () { return this }\n            }\n          }\n\n          // These are extra properties given to event handlers so they\n          // can differentiate between AJAX upload and <iframe> fallback.\n          // Note that if properties with these names are already present\n          // in response they won't be overwritten.\n          global.extend(resp, {\n            // Just an indicator that it's an upload via <iframe>.\n            iframe: true,\n            // This URL contains full URL to which the data was sent (usually\n            // opt.iframe.url) that might include 'fd-callback' parameter.\n            url: url\n          })\n\n          global.callAllOfObject(self, 'iframeDone', resp)\n        }\n\n        // Setting the hidden input with the callback name to our newly generated name.\n        var cbInput = form.firstChild\n        while (cbInput && (!global.isTag(cbInput, 'input') ||\n               cbInput.name != self.opt.iframe.callbackParam)) {\n          cbInput = cbInput.nextSibling\n        }\n\n        if (cbInput) {\n          cbInput.value = callback\n        } else {\n          // This shouldn't happen with standard usage but if the hidden field\n          // is missing let's append callback name to the URL itself.\n          url = url.replace(/[?&]+$/, '') +\n                (url.indexOf('?') == -1 ? '?' : '&') +\n                self.opt.iframe.callbackParam + '=' + callback\n        }\n\n        form.setAttribute('action', url)\n        global.callAllOfObject(self, 'iframeSetup', form)\n        form.submit()\n        setTimeout(self.resetForm, 300)\n\n        return true\n      }\n    }\n\n    // Clears value of the file input so that the same file (with the same\n    // local path) can be uploaded again without reloading the page.\n    // Thanks to @rafaelmaiolla for the tips.\n    self.resetForm = function () {\n      var input = self.opt.input && self.opt.input.file\n      if (input) {\n        // Works in Firefox/Chrome only. Funny fact is that cloneNode() there\n        // will clone file selection too. IE doesn't support value = '' but\n        // node cloning erases it.\n        input.value = ''\n\n        if (self.opt.recreateInput) {\n          var clone = self.opt.input.file = input.cloneNode(true)\n          input.parentNode.replaceChild(clone, input)\n          global.callAllOfObject(self, 'inputSetup', [self.opt.input, input])\n        }\n      }\n    }\n\n    // Toggles selection of multiple files in the browser's open file dialog\n    // that appears when you click on <input type=\"file\">. Does nothing if\n    // this DropHandle doesn't use <iframe> upload (see the input option).\n    //\n    // If an argument is given it's used to set the new state. If no arguments\n    // are passed then current state is read.\n    //\n    // When doing initial setup on object construction you can pass {multiple: true}\n    // as an option instead of calling this method right after.\n    //\n    //? multiple(true)    //=> true; multiple file selection is possible\n    //? multiple(false)   //=> false; only one file can be selected\n    //? multiple()        //=> true if multiple selection is enabled or false otherwise\n    //? multiple(undefined)   // equivalent to above\n    self.multiple = function (enable) {\n      if (self.opt.input && typeof enable != 'undefined') {\n        enable ? self.opt.input.file.setAttribute('multiple', 'multiple')\n               : self.opt.input.file.removeAttribute('multiple')\n      }\n\n      return self.opt.input && !!self.opt.input.file.getAttribute('multiple')\n    }\n\n    // Function to manipulate events that correspond to DropHandle's events - not\n    // DOM node events. If you need to listen to them instead then use this:\n    //   addEvent(yourDropHandle.el, 'mousemove', function ...)\n    // Or any other standard way, e.g. with jQuery:\n    //   $(yourDropHandle.el).mousemove(function () { ... })\n    //\n    // Without parameters returns copy of {event: [func, func, ...], ...}\n    // event map - all handlers attached to this zone.\n    //\n    // When given a single non-array parameter returns array of handlers\n    // of that particular event:\n    //   event('iframeDone')     //=> [function () { ... }, func, ...]\n    //\n    // When givne a single array parameter acts similarly to parameterless\n    // form - returns event map of those particular events:\n    //   event(['inputSetup', 'iframeDone'])\n    //     //=> { inputSetup: [function () { ... }], iframeDone: [func, ...] }\n    //\n    // When givne one object parameter - an event map - all its handlers\n    // are added (values can be either functions or arrays, namespaces are\n    // not supported by this call form):\n    //   event({ inputSetup: [func, func, ...], iframeDone: func })\n    //     //=> this (DropHandle)\n    //\n    // When given two parameters and the second is null removes all handlers\n    // of event(s) listen in the first parameter (array or string):\n    //   event('inputSetup', null)    //=> this (DropHandle) - and below\n    //   event(['inputSetup', 'iframeDone'], null)\n    //\n    // When given two parameters and the second is either a function or array\n    // adds listeners to listed event(s):\n    //   event('inputSetup', function () { alert('New listener') })\n    //     //=> this (DropHandle) - here and below\n    //   event(['inputSetup', 'iframeDone'], function () { ... })\n    //   event('inputSetup', [func_1, func_2, ...])\n    //   event(['inputSetup', 'iframeDone'], [func_1, func_2, ...])\n    //\n    // Since two parameter-long calls return 'this' you can easily chain\n    // multiple calls to the object methods like in jQuery.\n    //\n    // New listeners are pushed at the end of event chain (see callAll()).\n    // Use preview() to add handlers in front of others.\n    //\n    // Event names can contain namespaces in form 'event:namespace' - this\n    // string identifier (not necessary unique) is assigned to every function\n    // handler and can be used later to remove that handler or a bunch of others\n    // with the same ID. Empty namespace ('event:') is the same as just 'event'.\n    // Registering new handler with the same NS in the same event doesn't remove\n    // the former (NS can duplicate). On unlisten, empty event name with non-empty\n    // namespace looks over all events.\n    //\n    //   event('event:myns', [func_1, func_2])\n    //     // adds 2 handlers, both under 'myns' namespace.\n    //   event('event', func_3)\n    //     // adds third function under empty namespace.\n    //   event('event:myns', null)    // removes 2 functions added first.\n    //   event(':myns', null)   // removes all 'myns' functions from all events.\n    //   event('event')   //=> {event: func_3}\n    //\n    // Any other parameter combination will result in exception.\n    //\n    // You can preview any event (execute your own handlers before any occurring\n    // event's handlers are executed) with 'any' event name (see callAllOfObject()):\n    //\n    //   event('any', function () { return false })\n    //     // suppresses all events.\n    //   event('any:myns', function () { return false })\n    //     // the same but lets you later remove this namespaced handler.\n    //   event('any:myns', null)    // removes the handler set above.\n    //\n    // There are also more special call forms. With one null parameter all\n    // handlers on this zone are removed - can be used to transfer all handlers\n    // from one DropHandle to another or save/restore their state:\n    //   var old = event()    //=> {event: [func], ...}\n    //   event(null)\n    //   event(old)\n    //\n    // With one function parameter this function's namespace is returned\n    // or empty strign if there's none:\n    //   event(function () { })     //=> ''\n    //\n    //? event('inputSetup', function (input) {\n    //    alert('Setting up file input of ' + input.form.target)\n    //  })\n    //\n    //? event('iframeDone', [handler_1, handler_2, ...])\n    //? event(['inputSetup', 'iframeDone'], function () { alert(this.el.id) })\n    //? event('any:namespace', ...)\n    self.event = function (events, funcs) {\n      return global.appendEventsToObject.apply(self, arguments)\n    }\n\n    // A simplified companion of event() that adds listeners not after\n    // existing but in front of them. Useful for intercepting and overriding\n    // calls of certain events. Supports namespaces.\n    //\n    // Has several call forms which are identical to event():\n    // 1. One parameter - object (event map)\n    // 2. Two parameters - array/array, array/func, string/array, string/func\n    //\n    // Any other parameter combination will result in exception.\n    //\n    //? preview('iframeDone', function () { alert('Abort!'); return false })\n    //? preview(['inputSetup:myns'], [func, func])\n    //? preview('any:myns', function () { alert('Stop that!'); return false })\n    self.preview = function (events, funcs) {\n      return global.previewToObject.apply(self, arguments)\n    }\n\n    /***\n      Standard DropHandle Event Callbacks\n     ***\n\n      These are used to support default behaviour like assignment of HTML\n      classes to zone and input nodes.\n     ***/\n\n    self.onInputSetup = function (input, oldInput) {\n      if (oldInput) {\n        // IE clones elements \"by reference\" so when one's attributes or\n        // events are changed the other also reflects the change.\n        // Taken from jQuery which borrowed that from MooTools.\n        input.file.clearAttributes && input.file.clearAttributes()\n        input.file.mergeAttributes && input.file.mergeAttributes(oldInput)\n      } else {\n        self.multiple(self.opt.multiple)\n      }\n\n      global.setClass(input.file, self.opt.inputClass)\n\n      // We listen for <input type=\"file\">'s onchange event - when it occurs\n      // we trigger submission of the hidden form which navigates hidden\n      // <iframe> to upload the file to the server script and read its response.\n      // This can be used in drag & drop-aware browsers (Firefox and Chrome-based)\n      // to create a \"Browse for file\" button as an alternative to drag & drop.\n      // For more details see the 'iframe' option.\n      self.delegate(input.file, 'change', 'upload')\n\n      var parent = input.file.parentNode\n      if (parent && parent.style.display.match(/^(static)?$/)) {\n        // We need to anchor <input>'s position relative to its parent node.\n        parent.style.position = 'relative'\n      }\n\n      if (global.isTag(zone, 'fieldset')) {\n        // Firefox 13 or so has started to ignore overflow: hidden on fieldsets.\n        // We need to wrap it in a <div> that by itself will hide any overflow.\n        var div = document.createElement('div')\n        div.style.position = 'relative'\n        div.style.overflow = 'hidden'\n        zone.parentNode.insertBefore(div, zone)\n        div.appendChild(zone)\n      }\n    }\n\n    self.onDragOver = function (e) {\n      global.stopEvent(e)\n      e.dataTransfer && (e.dataTransfer.dropEffect = self.opt.dropEffect)\n    }\n\n    self.onUpload = function () {\n      for (var i = 0; i < global.all.length; i++) {\n        if (global.all[i] !== self && global.all[i].events) {\n          global.callAllOfObject(global.all[i], 'uploadElsewhere', self)\n        }\n      }\n    }\n\n    self.event({\n      inputSetup: self.onInputSetup,\n      dragOver: self.onDragOver,\n      upload: self.onUpload\n    })\n\n    // Initialization.\n    global.setClass(zone, self.opt.zoneClass)\n    self.hook(zone)\n  }\n\n  /***\n    Main FileDrop Class\n   ***\n\n    Based on DropHandle to abstract from browser-specific drag & drop\n    and fallback <iframe> upload quirks, this class adds actual upload\n    functionality. It listens for drop events and <iframe> submission\n    triggering dedicated events with normalized parameters. Underlying\n    DropHandle class can be accessed via this.handle property. It shares\n    options and events with FileDrop object so changing one affects another.\n\n    DropHandle properties and methods are available on this object as well.\n\n    This object is defined in window.fd and aliased as window.FileDrop.\n   ***/\n\n  // Parameters - identical to DropHandle, see its note for details.\n  //? new FileDrop('anID')\n  //? new FileDrop(document.body, {zoneClass: 'with-filedrop'})\n  global.FileDrop = function (zone, opt) {\n    // Persistent 'this' instance reference.\n    var self = this\n\n    zone = global.byID(zone)\n\n    // Underlying DropHandle instance providing browser-independent\n    // handlers for drag & drop and <iframe> upload facility.\n    // Constructor will throw an exception if zone is invalid/undefined.\n    self.handle = new global.DropHandle(zone, opt)\n    self.handle.filedrop = self\n\n    /***\n      FileDrop Options\n     ***\n\n      Changing these on runtime after the class was created doesn't affect\n      anything so make sure to pass desired values to the constructor.\n\n      Extends DropHandle options so check that class for more options and info.\n     ***/\n\n    global.extend(self.handle.opt, {\n      // HTML class name for the zone DOM node that is set when an object\n      // is being dragged over that zone (Firefox) or over entire document\n      // (Chrome-powered browsers). It's removed once the object was dragged\n      // away or drag & drop was cancelled.\n      dragOverClass: 'over'\n    })\n\n    global.extend(self.handle.opt.iframe, {\n      // opt.iframe.force - if set FileDrop will always upload files by using\n      // fallback <iframe> method. This only makes sense in debugging and\n      // for some browsers (Opera before migrating to Chrome engine).\n      force: false\n    })\n\n    /***\n      FileDrop Events\n     ***\n\n      Attach new listeners with (new FileDrop).event('send', function ...).\n      Extends DropHandle options so check that class for more events and info.\n\n      This only applies to FileDrop zone overall - it doesn't define events\n      for individual File objects being generated by this zone. This means\n      that to determine upload state or progress you need to attach listeners\n      to each produced File object - either inside FileDrop's 'send' event\n      before sending a file to the server or inside its 'fileSetup' event\n      which is fired right after the creation of File object.\n\n      Note that all callbacks are executed with 'this' pointing to this\n      object so it's easy to know which FileDrop has caused that particular\n      event. For example:\n\n        var dh = new FileDrop('myzone')\n        dh.event('send', function (files) {\n          alert('Sending files via ' + this.el.id)\n\n          for (var i = 0; i < files.length; i++) {\n            files[i].sendTo('http://my.host/upload.php')\n          }\n        })\n     ***/\n\n    global.extend(self.handle.events, {\n      // Occurs when a file is ready to be sent via drag & drop. Doesn't\n      // occur for <iframe> uploads since the only thing you can do about them\n      // is submit the file to the server (no file info is available).\n      // If for some reason you still need to know when a file was *potentially*\n      // placed into <input type=\"file\"> for such fallback uploads listen or\n      // preview the 'upload' event (inherited from DropHandle).\n      //\n      // function (fd.FileList)\n      //    - is passed list of files that were dropped onto this zone - see\n      //      the description of this object for more details.\n      send: [],\n\n      // Occurs when a new fd.File object was created. You can use this to\n      // attach your own events if you don't want to do this on every 'send'\n      // occurrence.\n      //\n      // function (fd.File)\n      //    - is passed instance of the newly created File object.\n      fileSetup: []\n    })\n\n    // Handles upload that happens when a user drops a file onto the zone\n    // (Firefox, Chrome-based) or its <input type=\"file\" (Opera, others).\n    self.onUpload = function (e) {\n      var files = !self.opt.iframe.force && self.eventFiles(e, true)\n\n      // This was likely triggered by onchange event of <input type=\"file\">\n      // which means the browser doesn't support drag & drop or the user\n      // has picked file by clicking on the drop zone, bringing up Open File\n      // dialog and selecting a file there.\n      // If that's the case we don't have any file info available so just\n      // submit the form to the server and see what it responds with (only\n      // if <iframe> upload was enabled by filling out opt.iframe.url).\n      if (!files) {\n        if (!self.handle.sendViaIFrame() && global.hasConsole) {\n          // Must set opt.iframe.url if <iframe> fallback needs to work.\n          console.warn('FileDrop fallback upload triggered but iframe options' +\n                       ' were not configured - doing nothing.')\n        }\n      } else if (files.length > 0) {\n        // Dropped one or more files and we have FileAPI available (Firefox,\n        // Chrome-based) so fire off the usual on-drop event.\n        global.callAllOfObject(self, 'send', [files])\n      }\n    }\n\n    // Retrieves fd.File objects from an on-drop event. Returns a fd.FileList\n    // array-like object (not W3C FileList).\n    // If orFalse is unset always returns a FileList even if event was invalid,\n    // otherwise returns false in such occurrences instead of empty FileList.\n    self.eventFiles = function (e, orFalse) {\n      var result = new global.FileList(e)\n\n      // IE 8 supplies dataTransfer but it's of its own format (getData(), etc.)\n      // and not standardized. Has no file objects.\n      if (e.dataTransfer && (e.dataTransfer.length || e.dataTransfer.files)) {\n        var list = e.dataTransfer\n      } else {\n        // IE 10 provides dataTransfer on drag & drop but when selecting with\n        // Open File dialog of <input type=\"file\"> it only has e.srcElement.files.\n        // Thanks to @rafaelmaiolla for this correction.\n        var list = (e.target && e.target.files) || (e.srcElement && e.srcElement.files)\n      }\n\n      if (list) {\n        var entries = list.items || []\n        list.files && (list = list.files)   // Firefox 3.6.\n        var names = {}\n\n        for (var i = 0; i < list.length; i++) {\n          var file = new global.File(list[i])\n\n          // Safari Windows adds first file several times so skip them.\n          // ...while iOS Safari adds files under the same name - image.jpg (#30).\n          if (!names[file.name] || file.name == 'image.jpg') {\n            names[file.name] = true\n            file.setNativeEntry(entries[i])\n            global.callAllOfObject(self, 'fileSetup', file)\n\n            // Directories have zero size but in Chrome they are useful\n            // since you can access underlying DIrectoryEntry and read files.\n            if (file.size > 0 || file.nativeEntry) {\n              result.push(file)\n            }\n          }\n        }\n      } else if (orFalse) {\n        result = false\n      }\n\n      return result\n    }\n\n    // Linking both classes together. Objects become references so changing,\n    // for example, handle.events affects this.events. Functions of DropHandle\n    // become available on this FileDrop instance which is fine since they\n    // operate on 'self' bound to DropHandle object rather than 'this' of FileDrop.\n    global.extend(self, self.handle)\n\n    /***\n      Standard FileDrop Event Callbacks\n     ***\n\n      These are used to support default behaviour like actual upload process\n      after dropping a file or updating zone HTML classes on drag over/out.\n     ***/\n\n    function dragClassChanger(isHovered) {\n      return function () {\n        global.setClass(zone, self.opt.dragOverClass, isHovered)\n      }\n    }\n\n    self.event({\n      upload:           self.onUpload,\n      send:             self.resetForm,\n      // Add/remove on-drag HTML classes to/from the zone element.\n      dragEnter:        dragClassChanger(true),\n      dragLeave:        dragClassChanger(false),\n      uploadElsewhere:  dragClassChanger(false)\n    })\n\n    self.preview({\n      // Placing handler to reset on-drop state of the zone for better\n      // visual feedback - the user immediately recognizes that the file is no\n      // more dragged even if actual upload handler takes some time to execute.\n      upload:           dragClassChanger(false)\n    })\n  }\n\n  /***\n    FileList Class\n   ***\n\n    It's sort of W3C class (that has no special methods defined in the spec)\n    with a bunch of File-oriented methods that this object is meant to contain.\n    It's an array-like object with length, splice and other methods.\n   ***/\n\n  global.FileList = function (event) {\n    // Persistent 'this' instance reference.\n    var self = this\n\n    // If set can be 'copy', 'move' or other action. Doesn't reliably work\n    // cross-browser and cross-platform. See MDN for more info:\n    // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer\n    self.dropEffect = (event && event.dropEffect) || ''\n    self.length = 0\n\n    // No need to hold the reference to this variable.\n    event = null\n\n    self.push = function (file) {\n      self[self.length++] = file\n      return self\n    }\n\n    // Returns undefind if this list is empty.\n    self.pop = function () {\n      if (self.length > 0) {\n        var file = self.last()\n        delete self[--self.length]\n        return file\n      }\n    }\n\n    self.first = function () {\n      return self[0]\n    }\n\n    self.last = function () {\n      return self[self.length - 1]\n    }\n\n    self.remove = function (i) {\n      for (; i < self.length - 1; i++) {\n        self[i] = self[i + 1]\n      }\n\n      se.f.pop()\n      return self\n    }\n\n    self.clear = function () {\n      for (var i = 0; i < self.length; i++) {\n        delete self[i]\n      }\n\n      self.length = 0\n      return self\n    }\n\n    // Reverses order of files in this list (changes self).\n    self.reverse = function () {\n      for (var i = 0; i < Math.floor(self.length / 2); i++) {\n        self[i] = self[self.length - i - 1]\n      }\n      return self\n    }\n\n    // Creates copy of this list and adds items from FileList or array\n    // to the end of the returned copy.\n    self.concat = function (list) {\n      var copy = new global.FileList\n      for (var i = 0; i < self.length; i++) {\n        copy[i] = self[i]\n      }\n\n      for (var i = 0; list && i < list.length; i++) {\n        copy[self.length + i + 1] = list[i]\n      }\n\n      copy.length = self.length + (list || []).length\n      return self\n    }\n\n    // Sorts this list by calling comparator in context cx (or 'this' FileList).\n    // func = function (File a, File b, aIndex, bIndex) - if returns < 0 second\n    // file (b) must go before first (a). Very similar to Array.sort().\n    //\n    //? sort(function (a, b) { return a.name > b.name ? +1 : -1 })\n    self.sort = function (func, cx) {\n      for (var i = 0; i < self.length; i++) {\n        for (var j = 0; j < self.length; j++) {\n          if (func.call(cx || this, self[i], self[j], i, j) < 0) {\n            var temp = self[i]\n            self[i] = self[j]\n            self[j] = temp\n          }\n        }\n      }\n\n      return self\n    }\n\n    // Sorts this list by calling func on each File alone and using that value\n    // (hash) to compare itsems between themselves. Like Underscore's sortBy().\n    // func = function (File, index) - returns something comparable, e.g. string,\n    // number or Date.\n    //\n    //? sortBy(function (file) { return file.modDate })\n    //? sortBy(function () { return Math.random() })\n    self.sortBy = function (func, cx) {\n      var list = []\n\n      for (var i = 0; i < self.length; i++) {\n        list.push([ i, func.call(cx || this, self[i], i) ])\n      }\n\n      list.sort(function (a, b) {\n        return a[1] > b[1] ? +1 : (a[1] < b[1] ? -1 : 0)\n      })\n\n      for (var i = 0; i < list.length; i++) {\n        self[i] = list[i][0]\n      }\n\n      return self\n    }\n\n    // Calls func in context cx for every File in the list and if it returns\n    // a non-null value returns the File object on which func was invoked.\n    // If this list is empty or if func didn't return anything for any file\n    // returns undfined.\n    //\n    //? find(function (f) { return f.name[0] == 'a' })\n    //    // returns first File which local name starts with 'a', if any.\n    self.find = function (func, cx) {\n      for (var i = 0; i < self.length; i++) {\n        var res = func.call(cx || this, self[i], i)\n        if (res != null) { return self[i] }\n      }\n    }\n\n    // The same as find() but ignores returned value of the callback invoking\n    // it for every File in the list.\n    //\n    //? each(function (f) { alert(f.name) })\n    self.each = function (func, cx) {\n      self.find(function () { func.apply(this, arguments) }, cx)\n      return self\n    }\n\n    // Calls method on every contained object with given arguments. Returns self.\n    //\n    //? invoke('fileMethod', 'arg1', 2, 3.33)\n    self.invoke = function (method, arg_1) {\n      var args = global.toArray(arguments, 1)\n      return this.each(function (file) { file[method].apply(file, args) })\n    }\n\n    // Aborts all uploads of files contained in this list. Does nothing if\n    // upload isn't active. Doesn't abort <iframe> uploads - for this call\n    // abortIFrame() on the corresponding DropHandle object.\n    //\n    //? abort()\n    self.abort = function () {\n      return this.invoke('abort')\n    }\n\n    // Runs through over all items in this list calling func in context cx (or\n    // this) and storing returned values. Returns File object for which func\n    // generated the largest value (or first such File for multiple same values).\n    // Returns undefined if this list is empty.\n    //\n    //? findCompare(function (f) { return f.size })\n    //    // returns largest file.\n    self.findCompare = function (func, cx) {\n      var file, value = null, res\n\n      self.each(function (f) {\n        if (value == null || value < (res = func.call(cx, file))) {\n          file = f\n          value = res\n        }\n      }, cx)\n\n      return file\n    }\n\n    // Returns new list that only contains items for which func called in context\n    // cx (or this) has returned a truthy value.\n    self.filter = function (func, cx) {\n      var list = new global.FileList\n\n      self.each(function (f) {\n        func.apply(this, arguments) && list.push(f)\n      }, cx)\n\n      return list\n    }\n\n    // Finds File with biggest size or undefined for empty list.\n    self.largest = function () {\n      return self.findCompare(function (f) { return f.size })\n    }\n\n    // Finds File with smallest size or undefined for empty list.\n    self.smallest = function () {\n      return self.findCompare(function (f) { return -f.size })\n    }\n\n    // Finds File that was changed the longest time before or undefined for empty list.\n    self.oldest = function () {\n      return self.findCompare(function (f) { return -f.modDate.getTime() })\n    }\n\n    // Finds File that was most recently changed or undefined for empty list.\n    self.newest = function () {\n      return self.findCompare(function (f) { return f.modDate })\n    }\n\n    // Returns new list of all files which MIME type matches. MIME shouldn't contain\n    // RegExp symbols except for '/'. To match MIME group like 'image/*' don't\n    // include trailing '/*' - just 'image'.\n    //\n    //? ofType('image').first()   //=> File or undefined if none\n    self.ofType = function (mime) {\n      mime += mime.indexOf('/') == -1 ? '/' : '$'\n      mime = new RegExp('^' + mime, 'i')\n      return self.filter(function (f) { return mime.test(f.type) })\n    }\n\n    // Returns new list with File items with image/* MIME type.\n    self.images = function () {\n      return self.ofType('image')\n    }\n\n    // If name is string returns File with name exactly matching that string\n    // If name is RegExp returns new list containing File items which 'name'\n    // match given RegExp.\n    //\n    //? named('myfile.txt')     //=> File or undefined\n    //? named(/^start_\\..+$/i)  //=> FileList (copy)\n    self.named = function (name) {\n      if (typeof name == 'string') {\n        return self.find(function (f) { return f.name == name })\n      } else {\n        return self.filter(function (f) { return name.test(f.name) })\n      }\n    }\n  }\n\n  // Making FileList array-like.\n  global.FileList.prototype.length = 0\n  global.FileList.prototype.splice = Array.prototype.splice\n\n  /***\n    Browser-Independent File Class\n   ***\n\n    It's passed on FileDrop 'send' event as members fd.FileList and provides\n    cross-browser access to file information and ability to upload it to the server.\n    Wraps around native browser's File object.\n   ***/\n\n  // Parameters:\n  // * file - native browser File object that was retrieved from the on-drop\n  //          event object. Can be accessed via this.nativeFile property.\n  global.File = function (file) {\n    // Persistent 'this' instance reference.\n    var self = this\n\n    // Native browser's File object as it was given in the on-drop event.\n    // Is null for directory entries if on lists produced by listEntries().\n    self.nativeFile = file\n\n    // In Chrome 21+ will be set to native Entry (FileEntry, DirectoryEntry, etc.)\n    // instance. See W3C spec: http://www.w3.org/TR/file-system-api/#the-entry-interface\n    self.nativeEntry = null\n\n    // Local file name, possibly relative.\n    // webkitRelativePath present in <input type=\"file\" webkitdirectory />:\n    // https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/webkitdirectory\n    // https://developer.mozilla.org/en-US/docs/Web/API/File/webkitRelativePath\n    self.name = file.webkitRelativePath || file.fileName || file.name || ''\n\n    // Local file size (bytes).\n    self.size = file.fileSize || file.size || 0\n\n    // Local file MIME type.\n    self.type = self.mime = file.fileType || file.type || ''\n\n    // Last modification of the local time. Standard Date object.\n    self.modDate = file.lastModifiedDate || new Date\n\n    // XMLHttpRequest object that was used to upload the file to the server.\n    // Only filled after sendTo() was called.\n    self.xhr = null\n\n    /***\n      File Options\n     ***\n\n      Values here specify default values for sendTo() options - like HTTP\n      method used to submit the data. They can be overriden by passing an\n      object to sendTo() - e.g. sendTo('upload.php', {method: 'PUT'}).\n     ***/\n\n    self.opt = {\n      // If enabled this object will add several X-... headers to provide\n      // information about the original file to the server (e.g. name and size).\n      extraHeaders: true,\n\n      // The value of X-Requested-With header sent with XMLHttpRequest used\n      // to upload the dropped file(s). If false then this header is not set\n      // (but you can use xhrSetup/xhrSend events to set it). If true - it's\n      // set to one of 'FileDrop-XHR-...'. A string sets it to that string -\n      // e.g. 'XMLHttpRequest' would simulate regular $.ajax() request.\n      xRequestedWith: true,\n\n      // HTTP method used to submit the upload data. Useful for contacting\n      // WebDAV services which might accept PUT or DELETE. Given in sendTo()\n      // to XMLHttpRequest.open().\n      method: 'POST'\n    }\n\n    /***\n      File Events\n     ***\n\n      These are different from FileDrop events and are individual to each File.\n      See FileDrop events for more info on how to attach listeners here.\n     ***/\n\n    self.events = {\n      // Object-wise event preview handlers. See DropHandle's 'any' description.\n      any: [],\n\n      // Occurs after an XMLHttpRequest object was prepared to submit the file\n      // to the server. All FileDrop-specific headers and other customization\n      // (Content-Type, etc.) was already done. You can set extra headers or add\n      // event listeners here before it's dispatched to the server.\n      //\n      // function (XMLHttpRequest, opt)\n      //    - is passed the request object and the options object that was\n      //      passed to sendTo() with missing fields populated as this.opt.\n      xhrSetup: [],\n\n      // Occurs when a file and XMLHttpRequest were prepared for upload and need\n      // to be sent. It's handled by fd.File.xhrSend() but you might want to\n      // add your logic here.\n      //\n      // function (XMLHttpRequest, data, opt)\n      //    - is passed the request object, options and raw file data that is\n      //      browser-specific (it might not be raw binary stream in some\n      //      older browsers as it is in Firefox and Chrome-based). opt is the\n      //      object passed to sendTo() with missing fields populated as this.opt.\n      xhrSend: [],\n\n      // Occurs during file upload with information on current upload progress.\n      // This happens on browser-sepcific intervals and usually on somewhat large\n      // files only.\n      //\n      // function (sentBytes, totalBytes, XMLHttpRequest, eventObject)\n      //    - is passed two integers (already uploaded bytes and total amount\n      //      of data - local file size, of which first or both might be unset\n      //      if browser can't provide this info), the request object that is\n      //      uploading this file and native browser event object that was\n      //      given to the XHR's event handler of fd.File.\n      progress: [],\n\n      // Occurs when a file has successfully finished uploading.\n      //\n      // function (XMLHttpRequest, eventObject)\n      //    - is passed the request object that was used to upload the file and\n      //      native browser event object that was given to the XHR's event handler\n      //      of fd.File.\n      done: [],\n\n      // Occurs when a file has failed during upload much like regular XHR error.\n      // Note that \"failing\" means all response code except for 200 - even 2xx like\n      // 202 Accepted (WebDAV and such) or 3xx (redirects).\n      // This isn't called when upload was aborted - if you specifically need to\n      // track this call fd.addEvent(fileObject, 'abort', function ...).\n      //\n      // function (eventObject, [XMLHttpRequest])\n      //    - using passed objects you can determine the type of error as you\n      //      would outside of FileDrop - e.g. by XMLHttpRequest.statusText.\n      //      If XHR object is not passed this marks an error that has occurred\n      //      while reading file from local file system with readAsArrayBuffer().\n      error: []\n    }\n\n    // Old FireDrop compatibility. Now deprecated.\n    self.events.sendXHR = self.events.xhrSend\n\n    /***\n      File Methods\n     ***/\n\n    // Aborts current upload, if any.\n    //\n    //? file.abort()\n    self.abort = function () {\n      self.xhr && self.xhr.abort && self.xhr.abort()\n      return self\n    }\n\n    // Submits the dropped file to the server script at given URL and with\n    // optional options (fields default to this fd.File.opt).\n    // Incapsulates browser-specific logic behind reading a local file.\n    // If an upload request has been already made on this fd.File instance will\n    // abort it (unless it's finished) and start anew.\n    //\n    //? sendTo('http://my.host/upload.php?var=foo&var2=123')\n    //? sendTo('upload.php', {method: 'PUT'})\n    self.sendTo = function (url, opt) {\n      opt = global.extend(opt, self.opt)\n      opt.url = url\n\n      if (!self.size) {\n        // Zero size also indicates that it might be a directory.\n        global.hasConsole && console.warn('Trying to send an empty FileDrop.File.')\n      } else if (window.FileReader) {\n        // Using Firefox FileAPI.\n        var reader = new FileReader\n\n        reader.onload = function (e) { self.sendDataReadyTo(opt, e) }\n        reader.onerror = function (e) { global.callAllOfObject(self, 'error', [e]) }\n\n        reader.readAsArrayBuffer(self.nativeFile)\n      } else {\n        // Using early Chrome/Safari File API.\n        self.sendDataReadyTo(opt)\n      }\n\n      return self\n    }\n\n    // Internal method that's called when file data was read and is ready for\n    // upload. For FileAPI (Firefox) gets called on readAsArrayBuffer() onload\n    // event; for Safari/early Chrome it's called immediately and gets passed\n    // the native file object itself.\n    self.sendDataReadyTo = function (opt, e) {\n      self.abort()\n\n      self.xhr = global.newXHR()\n      self.hookXHR(self.xhr)\n\n      self.xhr.open(opt.method, opt.url, true)\n      // Missing in IE.\n      self.xhr.overrideMimeType && self.xhr.overrideMimeType('application/octet-stream')\n      self.xhr.setRequestHeader('Content-Type', 'application/octet-stream')\n\n      if (opt.extraHeaders) {\n        self.xhr.setRequestHeader('X-File-Name', encodeURIComponent(self.name))\n        self.xhr.setRequestHeader('X-File-Size', self.size)\n        self.xhr.setRequestHeader('X-File-Type', self.type)\n        self.xhr.setRequestHeader('X-File-Date', self.modDate.toGMTString())\n\n        var reqWith = opt.xRequestedWith\n        if (reqWith === true) {\n          var api = window.FileReader ? 'FileAPI' : 'Webkit'\n          reqWith = 'FileDrop-XHR-' + api\n        }\n\n        reqWith && self.xhr.setRequestHeader('X-Requested-With', reqWith)\n      }\n\n      global.callAllOfObject(self, 'xhrSetup', [self.xhr, opt])\n\n      // Some browsers allow reading raw data, some don't. See if ours allows\n      // and if not then it should support just passing the native file object\n      // to XMLHttpRequest.send().\n      var data = (e && e.target && e.target.result) ? e.target.result : self.nativeFile\n      global.callAllOfObject(self, 'xhrSend', [self.xhr, data, opt])\n      return self.xhr\n    }\n\n    // Attaches internal event listeners to the XMLHttpRequest object that is\n    // used to upload the dropped file. Not all browsers trigger upload events\n    // on the XHR object itself (hence evtHost).\n    self.hookXHR = function (xhr) {\n      var evtHost = xhr.upload || xhr\n\n      xhr.onreadystatechange = function (e) {\n        if (xhr.readyState == 4) {\n          try {\n            var event = xhr.status == 200 ? 'done' : 'error'\n          } catch (e) {\n            var event = 'error'\n          }\n\n          var args = event == 'error' ? [e, xhr] : [xhr, e]\n          global.callAllOfObject(self, event, args)\n        }\n      }\n\n      evtHost.onprogress = function (e) {\n        var current = e.lengthComputable ? e.loaded : null\n        global.callAllOfObject(self, 'progress', [current, e.total || null, xhr, e])\n      }\n    }\n\n    // Browser-independent way of reading binary data. Doesn't work on all browsers.\n    // Asynchronous. If onError is omitted then onDone is called with the usual\n    // arguments (errorObject). If onError is false errors are not reported\n    // (onDone not called).\n    //\n    // Third parameter specifies the way to read the file and if omitted or 'bin'\n    // reads binary data, if 'url', 'uri' or 'src' reads Data URI (very nice for\n    // generating thumbnails), if 'array' reads it as ArrayBuffer, if 'text' reads\n    // data as UTF-8 string, if starts with 'read' is assumed to be a method name on\n    // native File object which will be called. Any other string value istreated as\n    // character encoding (e.g. 'cp1251') and data is read as text in that encoding.\n    // If 3rd parameter is an array its first element is treated as File's method\n    // name and all other parameters are parameters for that method.\n    //\n    // Note that readAsBinaryString() is deprecated, missing in IE 10 and simulated\n    // by FileDrop using readAsArrayBuffer().\n    //\n    // errorObject will fdError string property describing the type of the problem:\n    // 1. 'read'      - browser has failed to read file data.\n    // 2. 'support'   - browser doesn't support File API.\n    //\n    // onDone   = function (string|array)\n    // onError  = function (errorObject)\n    //\n    //?\n    //  readData(function (uri) { byID('myImg').src = uri },\n    //           function (e) { alert('Terrible error!') },\n    //           'uri')\n    //      // reads dropped image into a thumbnail (Data URI).\n    //\n    //? readData(function (bytes) { alert(bytes) }, false)\n    //      // shows message with raw read byte string.\n    //\n    //? readData(function (bytes) { alert(bytes) }, false, 'bin')\n    //      // identical to above.\n    //\n    //? readData(function (bytes) { alert(bytes) }, false, 'readAsBinaryString')\n    //      // identical to above.\n    //\n    //? readData(function (bytes) { alert(bytes) }, false, ['readAsBinaryString'])\n    //      // identical to above but won't automatically fall back to\n    //      // readAsArrayBuffer() failing in IE and early Chrome.\n    //\n    //? readData(function (bytes) { alert(Array.prototype.slice.call(bytes)) }, false, 'array')\n    //      // shows message with comma-separated list of byte values.\n    //\n    //? readData(function (str) { alert(str) }, false, 'cp1251')\n    //      // shows message with file read as a string in CP-1251 charset.\n    //\n    //? readData(function (str) { alert(str), false, ['readAsText', 'cp1251'])\n    //      // identical to above.\n    //\n    //? readData(function (str) { alert(str), false, 'text')\n    //      // similar to above but treats string as UTF-8 encoded (default charset).\n    //\n    //? readData(function (str) { alert(str), false, 'utf-8')\n    //      // identical to above.\n    //\n    //? readData(function (str) { alert(str), false, 'readAsText')\n    //      // identical to above.\n    self.readData = function (onDone, onError, func) {\n      return self.read({onDone: onDone, onError: onError, func: func})\n    }\n\n    // Alias to readData() that reads Data URI suitable for <img src> attribute.\n    // Unlike readData() if onError isn't passed explicitly it's set to false\n    // (errors suppressed, onDone not called instead).\n    //\n    //?\n    //  readDataURI(function (uri) {\n    //    var img = new Image\n    //    img.src = uri\n    //    document.body.appendChild(img)\n    //  })\n    self.readDataURL = function (onDone, onError) {\n      return self.readData(onDone, onError || false, 'uri')\n    }\n\n    // Alias to readDataURL().\n    self.readDataURI = self.readDataURL;\n\n    // Advanced reading function that can be used to read Blobs and make\n    // slices of this file rather than load the entire data into memory.\n    // Accepts various options, see the code for information.\n    //\n    //? read({onDone: function (str) { alert(str) }, func: 'text', start: 0, end: 5})\n    //    // reads first 4 bytes of the file, treats them as UTF-8 and shows them.\n    self.read = function (opt) {\n      function error(reason, e) {\n        typeof e == 'object' || (e.message = e)\n        e.fdError = reason\n\n        if (opt.onError !== false) {\n          (opt.onError || opt.onDone).apply(this, arguments)\n        }\n      }\n\n      global.extend(opt, {\n        // function (data) - gets passed data according to selected func (below).\n        onDone: new Function,\n\n        // function (e), false (errors are not reported), null (calls onDone).\n        onError: null,\n\n        // Target File or Blob object to read data from.\n        blob: self.nativeFile,\n\n        // Reading method alias (e.g. 'uri'), name (e.g. 'readAsText') or\n        // array like ['readAsText', 'arg-1', ...].\n        func: '',\n\n        // New Blob slice options. Negative becomes 0.\n        start: 0,\n\n        // null = this.size. Note that according to W3C byte with this offset\n        // is not included in result (so last byte read is end - 1).\n        // If negative offset is counted from the end (-1 skips last 2 bytes).\n        end: null,\n\n        // contentType assigned to new Blob (empty leaves default).\n        mime: ''\n      })\n\n      if (!window.FileReader) {\n        return error('support', e)\n      }\n\n      if (opt.start > 0 || opt.end != null && opt.end) {\n        if (opt.blob.slice) {\n          opt.end == null && (opt.end = opt.blob.size || opt.blob.fileSize)\n          opt.blob = opt.blob.slice(opt.start, opt.end, opt.mime)\n        } else if (global.hasConsole) {\n          console.warn('File Blob/slice() are unsupported - operating on entire File.')\n        }\n      }\n\n      var reader = new FileReader\n      reader.onerror = function (e) { error('read', e) }\n\n      reader.onload = function (e) {\n        if (e.target && e.target.result) {\n          if (opt.func == 'readAsBinaryString') {\n            // Function actually used was readAsArrayBuffer() - see the note below.\n            e.target.result = String.fromCharCode.apply(null, new Uint8Array(e.target.result))\n          }\n\n          opt.onDone(e.target.result)\n        } else {\n          reader.onerror(e)\n        }\n      }\n\n      var func = opt.func\n\n      if (global.isArray(func)) {\n        var name = func[0]\n        func[0] = opt.blob\n        return reader[name].apply(reader, func)\n      } else {\n        if (!func || func == 'bin') {\n          func = 'readAsBinaryString'\n        } else if (func == 'url' || func == 'uri' || func == 'src') {\n          func = 'readAsDataURL'\n        } else if (func == 'array') {\n          func = 'readAsArrayBuffer'\n        } else if (func == 'text') {\n          func = 'readAsText'   // reads as UTF-8 by default.\n        } else if (func.substr(0, 4) != 'read') {\n          return reader.readAsText(opt.blob, func)\n        }\n\n        // readAsBinaryString() has been deprecated since mid-2012 in favour\n        // of readAsArrayBuffer(). Additionally, IE 10 only supports the latter.\n        // Result that's been read will be converted to string in onload.\n        func == 'readAsBinaryString' && (func = 'readAsArrayBuffer')\n\n        return reader[func](opt.blob)\n      }\n    }\n\n    // Uses W3C draft File System API to traverse this DirectoryEntry.\n    // Currently supported in Chrome 21+. Spec: http://www.w3.org/TR/file-system-api/\n    // Thanks to @kevinkrouse for pointing me to this wonderful interface.\n    // This function is not recursive.\n    //\n    // onDone is a function callback that receives FileDrop.FileList object.\n    // Each entry there can be either a file or a directory. Files have nativeFile\n    // set (but not in case of error - if so use nativeEntry's isDirectory and\n    // isFile props to determine which one is which). On these, correct files you\n    // can use any of FileDrop methods - sendTo(), readFile(), etc. On directories\n    // (but not failed files) you can use listEntries() to traverse them further.\n    //\n    // onError is an optional function called by the browser when it runs into errors.\n    // It gets passed error object. Note that it might be called multiple times\n    // and that onDone can be still called (this might happen if FileEntry can't\n    // read particular File object when using file()).\n    //\n    //? listEntries(function (files) { files.images().invoke('sendTo', 'upload.php') })\n    //      // sends all images in the dropped directory to upload.php; errors are\n    //      // ignored but if one has occurred while retrieving File API object this\n    //      // call with fail with a JavaScript error - this is fixed by removing\n    //      // all entries with null nativeFile before doing sendTo().\n    //\n    //? listEntries(function (files) { files.each(...) },\n    //              function (e) { alert('File System API error ' + e.code) })\n    self.listEntries = function (onDone, onError) {\n      if (self.nativeEntry && self.nativeEntry.isDirectory) {\n        onError = onError || new Function\n        var reader = self.nativeEntry.createReader()\n        var files = new global.FileList\n        var enqueued = 0\n\n        function dequeue(count) {\n          enqueued -= count\n          if (enqueued == 0 && onDone) {\n            onDone(files)\n            onDone = null\n          }\n        }\n\n        reader.readEntries(function (list) {\n          for (var i = 0; i < list.length; i++) {\n            var nativeEntry = list[i]\n\n            if (nativeEntry.file) {\n              // This entry is a file (FileEntry).\n              enqueued++\n              nativeEntry.file(\n                function (nativeFile) {\n                  var file = new global.File(nativeFile)\n                  file.setNativeEntry(nativeEntry)\n                  files.push(file)\n                  dequeue(1)\n                },\n                function () {\n                  // Error getting a File object. Let's still insert it\n                  // into the resulting list but without nativeFile (which\n                  // makes sendTo(), readData(), etc. unavailable).\n                  files.push( global.File.fromEntry(nativeEntry) )\n                  dequeue(1)\n                  onError.apply(this, arguments)\n                }\n              )\n            } else {\n              // This is a DirectoryEntry. It has no File object (that comes\n              // from File API spec: http://dev.w3.org/2006/webapi/FileAPI/).\n              // Don't try calling sendTo(), readFile() and the likes on the\n              // FileDrop.File items returned in the FileList passed to onDone.\n              files.push( global.File.fromEntry(nativeEntry) )\n            }\n          }\n\n          i ? reader.readEntries(arguments.callee, onError) : dequeue(0)\n        }, onError)\n\n        return true\n      }\n    }\n\n    // Internal method to assign data from a native Entry object.\n    self.setNativeEntry = function (item) {\n      self.nativeEntry = item && item.webkitGetAsEntry && item.webkitGetAsEntry()\n    }\n\n    // Adds event listeners to this object. See DropHandle.event() for\n    // extended comment and examples.\n    self.event = function (events, funcs) {\n      return global.appendEventsToObject.apply(self, arguments)\n    }\n\n    // Adds event listeners to this object in front of existing handlers.\n    // Can be used to intercept/override certain events. See DropHandle.event()\n    // for extended comment and examples.\n    self.preview = function (events, funcs) {\n      return global.previewToObject.apply(self, arguments)\n    }\n\n    /***\n      Standard File Event Callbacks\n     ***/\n\n    // Takes care of reading binary stream from file and sending it\n    // to the remote server using prepared XMLHttpRequest.\n    // data is either an ArrayBuffer (Gecko/Chrome) or a native file object\n    // (Safari). Either way, send() handles both. This used to deal with\n    // sendAsBinary() but it's specific to Firefox 3.6 and is removed now.\n    self.onXhrSend = function (xhr, data) {\n      xhr.send(data)\n    }\n\n    self.event({\n      xhrSend:        self.onXhrSend\n    })\n  }\n\n  // Static method of File that creates an object without attaching to any\n  // File API's File object. It's only useful if you have an Entry object\n  // that lets you get at least some of the info (e.g. file name) and list\n  // contents for DirectoryEntry. See listEntries(). Using sendTo(), readData()\n  // and others on such an instance will result in errors.\n  //\n  //? fromEntry( e.dataTransfer.items[0].webkitGetAsEntry() )\n  //      //=> FileDrop.File\n  global.File.fromEntry = function (nativeEntry) {\n    var file = new global.File(nativeEntry)\n    file.setNativeEntry(nativeEntry)\n    file.nativeFile = null\n    return file\n  }\n\n  /***\n    FileDrop jQuery Interface\n   ***\n\n    After both FileDrop and jQuery (v1 or v2) scripts have loaded call fd.jQuery().\n    Don't forget to include/write your FileDrop's CSS as well.\n\n    Once done it becomes possible to access FileDrop as $('#zone').filedrop()\n    and avoid accessing its methods and bind event altogether. FileDrop will\n    trigger events as if they originated from the DOM node itself and prefix\n    each event with either 'fd' (DropHandle/FileDrop classes) or 'file'\n    (File class). Arguments remain the same except that:\n    * jQuery always passes event object as the first argument so just skip it.\n    * File events ('file' prefix) get passed File object as second argument\n      (after jQuery event).\n\n    Note that 'this' points to jQuery collection and no more to the FileDrop\n    or File instance that has initiated the event.\n\n      $('<div><p>Drop something here...</p></div>')\n        .appendTo(document.body)\n        .filedrop()\n        .on('fdsend', function (e, files) {\n          // Occurs when FileDrop's 'send' event is initiated.\n          $.each(files, function (i, file) {\n            file.sendTo('upload.php')\n          })\n        })\n        .on('filedone', function (e, file) {\n          // Occurs when a File object has done uploading.\n          alert('Done uploading ' + file.name + ' on ' + this.tagName)\n        })\n\n    When constructing FileDrop instance by jQuery in addition to regular 'el'\n    property '$el' is set to point to $(el) - zone DOM node as jQuery collection.\n\n    Also, it's still possible to attach listeners to FileDrop object with\n    fd.event('event', func) but these events are called after corresponding\n    DOM events (added with jQuery). If a DOM event handler returns a non-null\n    and non-undefined value - FileDrop's handlers won't be called.\n\n    Event preview handlers ('any' event) can only be attached directly to FileDrop:\n\n      $('#zone')\n        .fildrop()\n        .filedrop().event('any', function () { ... })\n\n    You can access underlying FileDrop object by calling filedrop() without\n    parameters (first such call creates FileDrop, later calls return the\n    instance on the first element in the collection):\n\n      $('#zone')            // select <p id=\"zone\">\n        .filedrop()         // turn it into a FileDrop zone\n        .css({color: red})  // any normal jQuery code\n        .filedrop()         // retrieve FileDrop object\n        .multiple(true)     // call its method\n\n    Alternatively you can pass a string to filedrop() to select a property\n    or call a method - in this case their value/result is returned\n\n      $('#zone')\n        .filedrop()\n        .filedrop('multiple', true)\n          // returns the new state of 'multiple' option, not jQuery object.\n\n    It's also possible to pass custom options to FileDrop constructor:\n\n      $('#zone')\n        .filedrop({\n          multiple: true,\n          iframe: {url: '/upload.php'}\n        })\n   ***/\n\n  global.jQuery = function ($) {\n    $ = $ || jQuery || window.jQuery\n    if (!$) { throw 'No window.jQuery object to integrate FileDrop into.' }\n\n    $.fn.filedrop = function (options) {\n      function delegate(prefix, firstArgs) {\n        return function (event) {\n          var args = (firstArgs || []).concat(global.toArray(arguments, 1))\n          return $node.triggerHandler((prefix + event).toLowerCase(), args)\n        }\n      }\n\n      var $node = this\n      var host = this.data('filedrop')\n\n      if (typeof options == 'string') {\n        if (!host) {\n          $.error(\"$.filedrop('comment') needs an initialized FilrDrop on this element.\")\n        } else if (typeof host[options] == 'undefined') {\n          $.error(\"There's no method or property FileDrop.\" + options + \".\")\n        } else {\n          var value = host[options]\n          if (typeof value == 'function') {\n            return value.apply(host, global.toArray(arguments, 1))\n          } else {\n            return value\n          }\n        }\n      } else if (!options || typeof options == 'object') {\n        if (!host) {\n          var zone = new FileDrop(this[0], options)\n          zone.$el = $(this)\n          this.first().data('filedrop', zone)\n\n          zone.event('any', delegate('fd'))\n\n          zone.on.fileSetup.push(function (file) {\n            file.event('any', delegate('file', [file]))\n          })\n        } else if (!options) {\n          return host\n        } else {\n          global.extend(host.opt, options, true)\n        }\n      } else {\n        $.error('Invalid $.filedrop() parameter - expected nothing (creates new zone),' +\n                ' a string (property to access) or an object (custom zone options).')\n      }\n\n      return $node\n    }\n  }\n\n  // Alias window.fd.FileDrop class to just window.FileDrop since it's most used.\n  root.FileDrop = global.FileDrop\n});\n"
  },
  {
    "path": "logos/CREDIT.md",
    "content": "CamiloMM - author of the beautiful FileDrop logo.\n\nhttp://camilomm.deviantart.com"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"filedrop\",\n  \"main\": \"filedrop.js\",\n  \"version\": \"2.1.0\",\n  \"homepage\": \"http://filedropjs.org\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git@github.com:ProgerXP/FileDrop.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/ProgerXP/FileDrop/issues\"\n  },\n  \"author\": \"Proger_XP <proger.xp@gmail.com> (http://proger.me)\",\n  \"description\": \"Self-contained cross-browser pure JavaScript class for Drag & Drop and AJAX (multi) file upload.\",\n  \"files\": [\n    \"filedrop.js\",\n    \"filedrop.min.js\",\n    \"filedrop.css\",\n    \"README.txt\",\n    \"upload.php\",\n    \"upload.aspx\",\n    \"demo\"\n  ],\n  \"keywords\": [\n    \"filedrop\", \"ajax\", \"file\", \"upload\", \"drag\", \"drop\"\n  ],\n  \"license\": \"Unlicense\"\n}"
  },
  {
    "path": "upload.aspx",
    "content": "<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"Upload.aspx.cs\" Inherits=\"FileDropAspNetScript.Upload\" %>\r\n<%@ Import Namespace=\"System.Security.Cryptography\" %>\r\n\r\n<script runat=\"server\">\r\n    public string BytesArrayToHexString(byte[] hash)\r\n    {\r\n        var sb = new StringBuilder();\r\n        for (int i = 0; i < hash.Length; i++)\r\n        {\r\n            sb.Append(hash[i].ToString(\"X2\"));\r\n        }\r\n        return sb.ToString();\r\n    }\r\n</script>\r\n\r\n<%\r\n/*!\r\n    FileDrop Revamped - server-side upload handler sample\r\n    in public domain  | http://filedropjs.org\r\n\r\n    ***\r\n\r\n    This is an example of server-side script that handles both AJAX and IFrame uploads.\r\n\r\n    AJAX upload provides raw file data as POST input while IFrame is a POST request\r\n    with Request.Files member set.\r\n\r\n    Result is either output as HTML with JavaScript code to invoke the callback\r\n    (like JSONP) or in plain text if none is given (it's usually absent on AJAX).\r\n*/\r\n\r\n// Callback name is passed if upload happens via iframe, not AJAX (FileAPI).\r\nstring callback = Request.Form[\"fd-callback\"];\r\nstring name;\r\nbyte[] data;\r\n\r\n// Upload data can be POST'ed as raw form data or uploaded via <iframe> and <form>\r\n// using regular multipart/form-data enctype (which is handled by ASP.NET Request.Files).\r\nHttpPostedFile fdFile = Request.Files[\"fd-file\"];\r\nif (fdFile != null) {\r\n    // Regular multipart/form-data upload.\r\n    name = fdFile.FileName;\r\n    data = new byte[fdFile.ContentLength];\r\n    fdFile.InputStream.Read(data, 0, fdFile.ContentLength);\r\n} else {\r\n    // Raw POST data.\r\n    name = HttpUtility.UrlDecode(Request.Headers[\"X-File-Name\"]);\r\n    data = new byte[Request.InputStream.Length];\r\n    Request.InputStream.Read(data, 0, (int) Request.InputStream.Length); //up to 2GB\r\n}\r\n\r\n// Output message for this demo upload. In your real app this would be something\r\n// meaningful for the calling script (that uses FileDrop.js).\r\nbyte[] md5Hash;\r\nusing (MD5 md5 = MD5.Create())\r\n{\r\n    md5Hash = md5.ComputeHash(data);\r\n}\r\nstring output = string.Format(\"{0}; received {1} bytes, MD5 = {2}\", name, data.Length, BytesArrayToHexString(md5Hash));\r\n\r\n// In FileDrop sample this demonstrates the passing of custom ?query variables along\r\n// with an AJAX/iframe upload.\r\nstring opt = Request[\"upload_option\"];\r\nif (! string.IsNullOrEmpty(opt))\r\n{\r\n    output += \"\\nReceived upload_option with value \" + opt;\r\n}\r\n\r\nif (! string.IsNullOrEmpty(callback))\r\n{\r\n    // Callback function given - the caller loads response into a hidden <iframe> so\r\n    // it expects it to be a valid HTML calling this callback function.\r\n    Response.Headers[\"Content-Type\"] = \"text/html; charset=utf-8\";\r\n    output = HttpUtility.JavaScriptStringEncode(output);\r\n\r\n    Response.Write(\r\n        \"<!DOCTYPE html><html><head></head><body><script type=\\\"text/javascript\\\">\" +\r\n       \"try{window.top.\" + callback + \"(\\\"\" + output + \"\\\")}catch(e){}</script></body></html>\");\r\n}\r\nelse\r\n{\r\n    Response.Headers[\"Content-Type\"] = \"text/plain; charset=utf-8\";\r\n    Response.Write(output);\r\n}\r\n\r\n%>"
  },
  {
    "path": "upload.php",
    "content": "<?php\n/*!\n  FileDrop Revamped - server-side upload handler sample\n  in public domain  | http://filedropjs.org\n\n ***\n\n  This is an example of server-side script that handles both AJAX and IFrame uploads.\n\n  AJAX upload provides raw file data as POST input while IFrame is a POST request\n  with $_FILES member set.\n\n  Result is either output as HTML with JavaScript code to invoke the callback\n  (like JSONP) or in plain text if none is given (it's usually absent on AJAX).\n*/\n\n// If an error causes output to be generated before headers are sent - catch it.\nob_start();\n\n// Callback name is passed if upload happens via iframe, not AJAX (FileAPI).\n$callback = &$_REQUEST['fd-callback'];\n\n// Upload data can be POST'ed as raw form data or uploaded via <iframe> and <form>\n// using regular multipart/form-data enctype (which is handled by PHP $_FILES).\nif (!empty($_FILES['fd-file']) and is_uploaded_file($_FILES['fd-file']['tmp_name'])) {\n  // Regular multipart/form-data upload.\n  $name = $_FILES['fd-file']['name'];\n  $data = file_get_contents($_FILES['fd-file']['tmp_name']);\n} else {\n  // Raw POST data.\n  $name = urldecode(@$_SERVER['HTTP_X_FILE_NAME']);\n  $data = file_get_contents(\"php://input\");\n}\n\n// Output message for this demo upload. In your real app this would be something\n// meaningful for the calling script (that uses FileDrop.js).\n$output = sprintf('%s; received %s bytes, CRC32 = %08X, MD5 = %s', $name,\n                  number_format(strlen($data)), crc32($data), strtoupper(md5($data)));\n\n// In FileDrop sample this demonstrates the passing of custom ?query variables along\n// with an AJAX/iframe upload.\n$opt = &$_REQUEST['upload_option'];\nisset($opt) and $output .= \"\\nReceived upload_option with value $opt\";\n\nif ($callback) {\n  // Callback function given - the caller loads response into a hidden <iframe> so\n  // it expects it to be a valid HTML calling this callback function.\n  header('Content-Type: text/html; charset=utf-8');\n\n  // Escape output so it remains valid when inserted into a JS 'string'.\n  $output = addcslashes($output, \"\\\\\\\"\\0..\\x1F\");\n\n  // Finally output the HTML with an embedded JavaScript to call the function giving\n  // it our message(in your app it doesn't have to be a string) as the first parameter.\n  echo '<!DOCTYPE html><html><head></head><body><script type=\"text/javascript\">',\n       \"try{window.top.$callback(\\\"$output\\\")}catch(e){}</script></body></html>\";\n} else {\n  // Caller reads data with XMLHttpRequest so we can output it raw. Real apps would\n  // usually pass and read a JSON object instead of plan text.\n  header('Content-Type: text/plain; charset=utf-8');\n  echo $output;\n}\n"
  }
]